Merge branch 'release-2016'
authorSzilárd Páll <pall.szilard@gmail.com>
Mon, 11 Sep 2017 17:33:09 +0000 (19:33 +0200)
committerBerk Hess <hess@kth.se>
Tue, 12 Sep 2017 06:47:39 +0000 (08:47 +0200)
Note that changes to the simd_math module/tests from the 2016 branch
were omitted in favor of the current code in master.

Conflicts:
src/gromacs/fileio/oenv.cpp
src/gromacs/fileio/oenv.h
src/gromacs/gmxlib/nonbonded/CMakeLists.txt
src/gromacs/hardware/cpuinfo.cpp
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh
src/gromacs/simd/simd_math.h
src/gromacs/simd/tests/simd_math.cpp
src/gromacs/swap/swapcoords.cpp

Change-Id: I357e40f97fd53a34ff900f40bb3fdeb20d864c13

2636 files changed:
.gitattributes
.gitignore
CMakeLists.txt
INSTALL-dev [new file with mode: 0644]
admin/builds/clang-analyzer.py
admin/builds/coverage.py
admin/builds/cppcheck.py
admin/builds/documentation.py
admin/builds/gromacs.py
admin/builds/post-submit-matrix.txt
admin/builds/pre-submit-matrix.txt
admin/builds/regressiontests-update.py
admin/builds/release-matrix.txt
admin/builds/source-package.py
cmake/FindFFTW.cmake
cmake/FindHwloc.cmake
cmake/TestAVXMaskload.c [deleted file]
cmake/TestClangVersion.c [deleted file]
cmake/gmxBuildTypeASAN.cmake
cmake/gmxBuildTypeReference.cmake
cmake/gmxBuildTypeTSAN.cmake
cmake/gmxCFlags.cmake
cmake/gmxCPackUtilities.cmake
cmake/gmxCTestUtilities.cmake [new file with mode: 0644]
cmake/gmxCustomCommandUtilities.cmake
cmake/gmxDetectCpu.cmake [new file with mode: 0644]
cmake/gmxDetectSimd.cmake
cmake/gmxManageFFTLibraries.cmake
cmake/gmxManageGPU.cmake
cmake/gmxManageLinearAlgebraLibraries.cmake
cmake/gmxManageMPI.cmake
cmake/gmxManageNvccConfig.cmake
cmake/gmxManageOpenMP.cmake
cmake/gmxManagePluginSupport.cmake
cmake/gmxManageSimd.cmake
cmake/gmxManageTNG.cmake
cmake/gmxOptionUtilities.cmake
cmake/gmxSetBuildInformation.cmake
cmake/gmxTestAVXMaskload.cmake [deleted file]
cmake/gmxTestCXX11.cmake
cmake/gmxTestCompilerProblems.cmake
cmake/gmxVersionInfo.cmake
cmake/legacy_and_external.supp
cmake/with_asan_opts.sh [new file with mode: 0755]
docs/CMakeLists.txt
docs/conf-vars.py.cmakein
docs/conf.py
docs/dev-manual/build-system.rst
docs/dev-manual/doxygen.rst
docs/dev-manual/language-features.rst
docs/doxygen/CMakeLists.txt
docs/doxygen/Doxyfile-compact
docs/doxygen/Doxyfile-dev.cmakein [new file with mode: 0644]
docs/doxygen/cycle-suppressions.txt
docs/doxygen/directories.cpp
docs/doxygen/gmxtree.py
docs/doxygen/includesorter.py
docs/doxygen/lib/logging.md [new file with mode: 0644]
docs/doxygen/lib/mdmodules.md [new file with mode: 0644]
docs/doxygen/lib/refdata.md
docs/doxygen/lib/simd.md
docs/doxygen/misc.cpp
docs/doxygen/suppressions.txt
docs/doxygen/user/analysisnbsearch.md
docs/doxygen/user/mainpage.md
docs/install-guide/index.rst
docs/manual/algorithms.tex
docs/manual/forcefield.tex
docs/manual/monster.bib
docs/manual/plots/field.eps [new file with mode: 0644]
docs/manual/plots/field.xvg [new file with mode: 0644]
docs/manual/special.tex
docs/user-guide/cmdline.rst
docs/user-guide/environment-variables.rst
share/template/CMakeLists.txt.template
src/CMakeLists.txt
src/config.h.cmakein
src/contrib/do_multiprot.c
src/contrib/do_shift.c
src/contrib/fftw/CMakeLists.txt
src/contrib/gmx_sdf.c
src/external/gmock-1.7.0/CMakeLists.txt
src/external/gmock-1.7.0/gtest/include/gtest/gtest-param-test.h
src/external/thread_mpi/include/thread_mpi/mutex.h
src/external/thread_mpi/include/thread_mpi/threads.h
src/external/thread_mpi/include/thread_mpi/tmpi.h
src/external/thread_mpi/src/gather.c
src/external/thread_mpi/src/p2p_send_recv.c
src/external/thread_mpi/src/pthreads.c
src/external/thread_mpi/src/scatter.c
src/external/thread_mpi/src/winthreads.c
src/external/tinyxml2/tinyxml2.cpp
src/external/tng_io/BuildTNG.cmake
src/external/tng_io/CMakeLists.txt
src/external/tng_io/external/README [new file with mode: 0644]
src/external/tng_io/external/zlib/README [new file with mode: 0644]
src/external/tng_io/external/zlib/adler32.c [new file with mode: 0644]
src/external/tng_io/external/zlib/compress.c [new file with mode: 0644]
src/external/tng_io/external/zlib/crc32.c [new file with mode: 0644]
src/external/tng_io/external/zlib/crc32.h [new file with mode: 0644]
src/external/tng_io/external/zlib/deflate.c [new file with mode: 0644]
src/external/tng_io/external/zlib/deflate.h [new file with mode: 0644]
src/external/tng_io/external/zlib/inffast.c [new file with mode: 0644]
src/external/tng_io/external/zlib/inffast.h [new file with mode: 0644]
src/external/tng_io/external/zlib/inffixed.h [new file with mode: 0644]
src/external/tng_io/external/zlib/inflate.c [new file with mode: 0644]
src/external/tng_io/external/zlib/inflate.h [new file with mode: 0644]
src/external/tng_io/external/zlib/inftrees.c [new file with mode: 0644]
src/external/tng_io/external/zlib/inftrees.h [new file with mode: 0644]
src/external/tng_io/external/zlib/trees.c [new file with mode: 0644]
src/external/tng_io/external/zlib/trees.h [new file with mode: 0644]
src/external/tng_io/external/zlib/uncompr.c [new file with mode: 0644]
src/external/tng_io/external/zlib/zconf.h [new file with mode: 0644]
src/external/tng_io/external/zlib/zlib.h [new file with mode: 0644]
src/external/tng_io/external/zlib/zutil.c [new file with mode: 0644]
src/external/tng_io/external/zlib/zutil.h [new file with mode: 0644]
src/external/tng_io/include/tng/tng_io.h
src/external/tng_io/src/lib/tng_io-config.cmake.in
src/external/tng_io/src/lib/tng_io.c
src/external/tng_io/src/lib/tng_io_fortran.c
src/external/tng_io/src/tests/CMakeLists.txt
src/external/tng_io/src/tests/md_openmp.f
src/external/tng_io/src/tests/tng_io_testing.c
src/external/tng_io/src/tests/using/CMakeLists.txt [new file with mode: 0644]
src/external/tng_io/src/tests/using/dummy_zlib.c [new file with mode: 0644]
src/external/tng_io/src/tests/using/main.c [new file with mode: 0644]
src/external/tng_io/src/tests/using/use_tng.c [new file with mode: 0644]
src/external/tng_io/src/tests/using/use_zlib.c [new file with mode: 0644]
src/gromacs/CMakeLists.txt
src/gromacs/analysisdata/analysisdata.cpp
src/gromacs/analysisdata/analysisdata.h
src/gromacs/analysisdata/datamodulemanager.cpp
src/gromacs/analysisdata/dataproxy.cpp
src/gromacs/analysisdata/datastorage.cpp
src/gromacs/analysisdata/modules/displacement.cpp
src/gromacs/analysisdata/modules/lifetime.cpp
src/gromacs/analysisdata/modules/plot.cpp
src/gromacs/analysisdata/tests/datatest.h
src/gromacs/analysisdata/tests/mock_datamodule.cpp
src/gromacs/applied-forces/CMakeLists.txt [new file with mode: 0644]
src/gromacs/applied-forces/electricfield.cpp [new file with mode: 0644]
src/gromacs/applied-forces/electricfield.h [new file with mode: 0644]
src/gromacs/applied-forces/tests/CMakeLists.txt [new file with mode: 0644]
src/gromacs/applied-forces/tests/electricfield.cpp [new file with mode: 0644]
src/gromacs/commandline/cmdlinehelpcontext.cpp
src/gromacs/commandline/cmdlinehelpmodule.cpp
src/gromacs/commandline/cmdlinehelpwriter.cpp
src/gromacs/commandline/cmdlineinit.cpp
src/gromacs/commandline/cmdlinemodule.cpp
src/gromacs/commandline/cmdlinemodulemanager.cpp
src/gromacs/commandline/cmdlineoptionsmodule.cpp
src/gromacs/commandline/cmdlineparser.cpp
src/gromacs/commandline/cmdlineprogramcontext.cpp
src/gromacs/commandline/filenm.cpp
src/gromacs/commandline/filenm.h
src/gromacs/commandline/pargs.cpp
src/gromacs/commandline/pargs.h
src/gromacs/commandline/shellcompletions.cpp
src/gromacs/commandline/tests/CMakeLists.txt
src/gromacs/commandline/tests/cmdlinehelpwriter.cpp
src/gromacs/commandline/tests/cmdlinemodulemanager.cpp
src/gromacs/commandline/tests/cmdlineparser.cpp
src/gromacs/commandline/tests/cmdlineprogramcontext.cpp
src/gromacs/commandline/tests/pargs.cpp
src/gromacs/commandline/viewit.cpp
src/gromacs/compat/make_unique.h [new file with mode: 0644]
src/gromacs/compat/tests/CMakeLists.txt [new file with mode: 0644]
src/gromacs/compat/tests/make_unique.cpp [new file with mode: 0644]
src/gromacs/correlationfunctions/autocorr.cpp
src/gromacs/correlationfunctions/expfit.cpp
src/gromacs/correlationfunctions/manyautocorrelation.cpp
src/gromacs/correlationfunctions/manyautocorrelation.h
src/gromacs/correlationfunctions/tests/CMakeLists.txt
src/gromacs/correlationfunctions/tests/autocorr.cpp
src/gromacs/correlationfunctions/tests/correlationdataset.cpp
src/gromacs/correlationfunctions/tests/expfit.cpp
src/gromacs/correlationfunctions/tests/manyautocorrelation.cpp [new file with mode: 0644]
src/gromacs/domdec/dlbtiming.cpp [new file with mode: 0644]
src/gromacs/domdec/dlbtiming.h [new file with mode: 0644]
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_network.cpp
src/gromacs/domdec/domdec_network.h
src/gromacs/domdec/domdec_setup.cpp
src/gromacs/domdec/domdec_specatomcomm.cpp
src/gromacs/domdec/domdec_topology.cpp
src/gromacs/domdec/domdec_vsite.cpp
src/gromacs/domdec/ga2la.h
src/gromacs/domdec/hash.h
src/gromacs/energyanalysis/CMakeLists.txt [new file with mode: 0644]
src/gromacs/energyanalysis/tests/CMakeLists.txt [new file with mode: 0644]
src/gromacs/energyanalysis/tests/dhdl.edr [new file with mode: 0644]
src/gromacs/energyanalysis/tests/dhdl.tpr [new file with mode: 0644]
src/gromacs/energyanalysis/tests/ener.edr [new file with mode: 0644]
src/gromacs/energyanalysis/tests/legacyenergy.cpp [new file with mode: 0644]
src/gromacs/energyanalysis/tests/orires.edr [new file with mode: 0644]
src/gromacs/energyanalysis/tests/orires.tpr [new file with mode: 0644]
src/gromacs/energyanalysis/tests/refdata/DhdlTest_ExtractDhdl.xml [new file with mode: 0644]
src/gromacs/energyanalysis/tests/refdata/EnergyTest_ExtractEnergy.xml [new file with mode: 0644]
src/gromacs/energyanalysis/tests/refdata/EnergyTest_ExtractEnergyByNumber.xml [new file with mode: 0644]
src/gromacs/energyanalysis/tests/refdata/EnergyTest_ExtractEnergyMixed.xml [new file with mode: 0644]
src/gromacs/energyanalysis/tests/refdata/OriresTest_ExtractOrires.xml [new file with mode: 0644]
src/gromacs/energyanalysis/tests/refdata/ViscosityTest_EinsteinViscosity.xml [new file with mode: 0644]
src/gromacs/energyanalysis/tests/refdata/ViscosityTest_EinsteinViscosityIntegral.xml [new file with mode: 0644]
src/gromacs/essentialdynamics/edsam.cpp
src/gromacs/essentialdynamics/edsam.h
src/gromacs/ewald/CMakeLists.txt
src/gromacs/ewald/calculate-spline-moduli.cpp
src/gromacs/ewald/ewald.cpp
src/gromacs/ewald/long-range-correction.cpp
src/gromacs/ewald/pme-gather.cpp
src/gromacs/ewald/pme-gather.h
src/gromacs/ewald/pme-grid.cpp
src/gromacs/ewald/pme-grid.h
src/gromacs/ewald/pme-internal.h
src/gromacs/ewald/pme-load-balancing.cpp
src/gromacs/ewald/pme-load-balancing.h
src/gromacs/ewald/pme-only.cpp
src/gromacs/ewald/pme-pp.cpp
src/gromacs/ewald/pme-simd4.h
src/gromacs/ewald/pme-solve.cpp
src/gromacs/ewald/pme-solve.h
src/gromacs/ewald/pme-spread.cpp
src/gromacs/ewald/pme-spread.h
src/gromacs/ewald/pme.cpp
src/gromacs/ewald/pme.h
src/gromacs/ewald/tests/CMakeLists.txt [new file with mode: 0644]
src/gromacs/ewald/tests/pmebsplinetest.cpp [new file with mode: 0644]
src/gromacs/ewald/tests/pmegathertest.cpp [new file with mode: 0644]
src/gromacs/ewald/tests/pmesolvetest.cpp [new file with mode: 0644]
src/gromacs/ewald/tests/pmesplinespreadtest.cpp [new file with mode: 0644]
src/gromacs/ewald/tests/pmetestcommon.cpp [new file with mode: 0644]
src/gromacs/ewald/tests/pmetestcommon.h [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_0.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_1.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_10.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_11.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_12.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_13.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_14.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_15.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_2.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_3.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_4.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_5.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_6.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_7.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_8.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_9.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffLJ_PmeSolveTest_ReproducesOutputs_0.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffLJ_PmeSolveTest_ReproducesOutputs_1.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffLJ_PmeSolveTest_ReproducesOutputs_2.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffLJ_PmeSolveTest_ReproducesOutputs_3.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffLJ_PmeSolveTest_ReproducesOutputs_4.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffLJ_PmeSolveTest_ReproducesOutputs_5.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffLJ_PmeSolveTest_ReproducesOutputs_6.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffLJ_PmeSolveTest_ReproducesOutputs_7.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffQ_PmeSolveTest_ReproducesOutputs_0.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffQ_PmeSolveTest_ReproducesOutputs_1.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffQ_PmeSolveTest_ReproducesOutputs_2.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffQ_PmeSolveTest_ReproducesOutputs_3.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffQ_PmeSolveTest_ReproducesOutputs_4.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffQ_PmeSolveTest_ReproducesOutputs_5.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffQ_PmeSolveTest_ReproducesOutputs_6.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffQ_PmeSolveTest_ReproducesOutputs_7.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_0.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_1.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_10.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_11.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_2.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_3.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_4.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_5.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_6.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_7.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_8.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_9.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_0.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_1.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_10.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_11.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_12.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_13.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_14.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_15.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_16.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_17.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_18.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_19.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_2.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_20.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_21.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_22.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_23.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_3.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_4.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_5.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_6.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_7.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_8.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_9.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_0.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_1.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_10.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_11.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_2.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_3.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_4.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_5.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_6.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_7.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_8.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_9.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_0.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_1.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_10.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_11.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_2.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_3.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_4.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_5.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_6.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_7.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_8.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_9.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_0.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_1.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_10.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_100.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_101.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_102.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_103.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_104.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_105.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_106.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_107.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_108.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_109.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_11.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_110.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_111.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_112.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_113.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_114.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_115.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_116.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_117.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_118.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_119.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_12.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_120.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_121.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_122.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_123.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_124.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_125.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_126.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_127.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_128.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_129.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_13.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_130.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_131.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_132.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_133.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_134.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_135.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_136.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_137.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_138.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_139.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_14.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_140.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_141.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_142.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_143.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_15.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_16.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_17.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_18.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_19.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_2.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_20.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_21.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_22.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_23.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_24.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_25.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_26.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_27.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_28.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_29.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_3.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_30.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_31.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_32.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_33.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_34.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_35.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_36.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_37.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_38.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_39.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_4.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_40.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_41.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_42.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_43.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_44.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_45.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_46.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_47.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_48.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_49.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_5.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_50.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_51.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_52.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_53.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_54.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_55.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_56.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_57.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_58.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_59.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_6.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_60.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_61.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_62.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_63.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_64.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_65.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_66.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_67.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_68.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_69.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_7.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_70.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_71.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_72.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_73.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_74.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_75.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_76.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_77.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_78.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_79.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_8.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_80.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_81.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_82.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_83.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_84.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_85.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_86.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_87.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_88.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_89.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_9.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_90.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_91.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_92.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_93.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_94.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_95.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_96.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_97.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_98.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_99.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_0.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_1.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_10.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_11.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_12.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_13.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_14.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_15.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_2.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_3.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_4.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_5.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_6.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_7.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_8.xml [new file with mode: 0644]
src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_9.xml [new file with mode: 0644]
src/gromacs/fft/calcgrid.cpp
src/gromacs/fft/calcgrid.h
src/gromacs/fft/fft.cpp
src/gromacs/fft/fft5d.cpp
src/gromacs/fft/fft_fftpack.cpp
src/gromacs/fft/fft_fftw3.cpp
src/gromacs/fft/fft_mkl.cpp
src/gromacs/fft/parallel_3dfft.cpp
src/gromacs/fft/tests/fft.cpp
src/gromacs/fileio/CMakeLists.txt
src/gromacs/fileio/checkpoint.cpp
src/gromacs/fileio/checkpoint.h
src/gromacs/fileio/confio.cpp
src/gromacs/fileio/confio.h
src/gromacs/fileio/enxio.cpp
src/gromacs/fileio/enxio.h
src/gromacs/fileio/espio.cpp
src/gromacs/fileio/espio.h
src/gromacs/fileio/filetypes.cpp
src/gromacs/fileio/g96io.cpp
src/gromacs/fileio/g96io.h
src/gromacs/fileio/gmxfio-xdr.cpp
src/gromacs/fileio/gmxfio-xdr.h
src/gromacs/fileio/gmxfio.cpp
src/gromacs/fileio/groio.cpp
src/gromacs/fileio/groio.h
src/gromacs/fileio/libxdrf.cpp
src/gromacs/fileio/matio.cpp
src/gromacs/fileio/matio.h
src/gromacs/fileio/mtxio.cpp
src/gromacs/fileio/oenv.cpp
src/gromacs/fileio/oenv.h
src/gromacs/fileio/pdbio.cpp
src/gromacs/fileio/pdbio.h
src/gromacs/fileio/readinp.cpp
src/gromacs/fileio/readinp.h
src/gromacs/fileio/tests/confio.cpp
src/gromacs/fileio/tests/readinp.cpp
src/gromacs/fileio/tests/tngio.cpp
src/gromacs/fileio/tngio.cpp
src/gromacs/fileio/tngio.h
src/gromacs/fileio/tngio_for_tools.cpp [deleted file]
src/gromacs/fileio/tngio_for_tools.h [deleted file]
src/gromacs/fileio/tpxio.cpp
src/gromacs/fileio/tpxio.h
src/gromacs/fileio/trxio.cpp
src/gromacs/fileio/trxio.h
src/gromacs/fileio/vmdio.cpp
src/gromacs/fileio/warninp.cpp
src/gromacs/fileio/warninp.h
src/gromacs/fileio/writeps.cpp
src/gromacs/fileio/xvgr.cpp
src/gromacs/fileio/xvgr.h
src/gromacs/gmxana/CMakeLists.txt
src/gromacs/gmxana/anadih.cpp
src/gromacs/gmxana/binsearch.cpp
src/gromacs/gmxana/cmat.cpp
src/gromacs/gmxana/edittop.cpp [deleted file]
src/gromacs/gmxana/eigio.cpp
src/gromacs/gmxana/fitahx.cpp
src/gromacs/gmxana/gmx_anadock.cpp
src/gromacs/gmxana/gmx_anaeig.cpp
src/gromacs/gmxana/gmx_analyze.cpp
src/gromacs/gmxana/gmx_angle.cpp
src/gromacs/gmxana/gmx_bar.cpp
src/gromacs/gmxana/gmx_bundle.cpp
src/gromacs/gmxana/gmx_chi.cpp
src/gromacs/gmxana/gmx_cluster.cpp
src/gromacs/gmxana/gmx_clustsize.cpp
src/gromacs/gmxana/gmx_confrms.cpp
src/gromacs/gmxana/gmx_covar.cpp
src/gromacs/gmxana/gmx_current.cpp
src/gromacs/gmxana/gmx_density.cpp
src/gromacs/gmxana/gmx_densmap.cpp
src/gromacs/gmxana/gmx_densorder.cpp
src/gromacs/gmxana/gmx_dielectric.cpp
src/gromacs/gmxana/gmx_dipoles.cpp
src/gromacs/gmxana/gmx_disre.cpp
src/gromacs/gmxana/gmx_do_dssp.cpp
src/gromacs/gmxana/gmx_dos.cpp
src/gromacs/gmxana/gmx_dyecoupl.cpp
src/gromacs/gmxana/gmx_dyndom.cpp
src/gromacs/gmxana/gmx_editconf.cpp
src/gromacs/gmxana/gmx_eneconv.cpp
src/gromacs/gmxana/gmx_enemat.cpp
src/gromacs/gmxana/gmx_energy.cpp
src/gromacs/gmxana/gmx_filter.cpp
src/gromacs/gmxana/gmx_genion.cpp
src/gromacs/gmxana/gmx_genpr.cpp
src/gromacs/gmxana/gmx_gyrate.cpp
src/gromacs/gmxana/gmx_h2order.cpp
src/gromacs/gmxana/gmx_hbond.cpp
src/gromacs/gmxana/gmx_helix.cpp
src/gromacs/gmxana/gmx_helixorient.cpp
src/gromacs/gmxana/gmx_hydorder.cpp
src/gromacs/gmxana/gmx_lie.cpp
src/gromacs/gmxana/gmx_make_edi.cpp
src/gromacs/gmxana/gmx_make_ndx.cpp
src/gromacs/gmxana/gmx_mdmat.cpp
src/gromacs/gmxana/gmx_mindist.cpp
src/gromacs/gmxana/gmx_mk_angndx.cpp
src/gromacs/gmxana/gmx_morph.cpp
src/gromacs/gmxana/gmx_msd.cpp
src/gromacs/gmxana/gmx_nmeig.cpp
src/gromacs/gmxana/gmx_nmens.cpp
src/gromacs/gmxana/gmx_nmtraj.cpp
src/gromacs/gmxana/gmx_order.cpp
src/gromacs/gmxana/gmx_pme_error.cpp
src/gromacs/gmxana/gmx_polystat.cpp
src/gromacs/gmxana/gmx_potential.cpp
src/gromacs/gmxana/gmx_principal.cpp
src/gromacs/gmxana/gmx_rama.cpp
src/gromacs/gmxana/gmx_rms.cpp
src/gromacs/gmxana/gmx_rmsdist.cpp
src/gromacs/gmxana/gmx_rmsf.cpp
src/gromacs/gmxana/gmx_rotacf.cpp
src/gromacs/gmxana/gmx_rotmat.cpp
src/gromacs/gmxana/gmx_saltbr.cpp
src/gromacs/gmxana/gmx_sans.cpp
src/gromacs/gmxana/gmx_saxs.cpp
src/gromacs/gmxana/gmx_sham.cpp
src/gromacs/gmxana/gmx_sigeps.cpp
src/gromacs/gmxana/gmx_sorient.cpp
src/gromacs/gmxana/gmx_spatial.cpp
src/gromacs/gmxana/gmx_spol.cpp
src/gromacs/gmxana/gmx_tcaf.cpp
src/gromacs/gmxana/gmx_traj.cpp
src/gromacs/gmxana/gmx_trjcat.cpp
src/gromacs/gmxana/gmx_trjconv.cpp
src/gromacs/gmxana/gmx_trjorder.cpp
src/gromacs/gmxana/gmx_tune_pme.cpp
src/gromacs/gmxana/gmx_vanhove.cpp
src/gromacs/gmxana/gmx_velacc.cpp
src/gromacs/gmxana/gmx_wham.cpp
src/gromacs/gmxana/gmx_wheel.cpp
src/gromacs/gmxana/gmx_xpm2ps.cpp
src/gromacs/gmxana/hxprops.cpp
src/gromacs/gmxana/interf.h
src/gromacs/gmxana/nrama.cpp
src/gromacs/gmxana/nsfactor.cpp
src/gromacs/gmxana/powerspect.cpp
src/gromacs/gmxana/princ.cpp
src/gromacs/gmxana/sfactor.cpp
src/gromacs/gmxana/tests/CMakeLists.txt [moved from src/gromacs/gmxana/legacytests/CMakeLists.txt with 85% similarity]
src/gromacs/gmxana/tests/gmx_traj.cpp [new file with mode: 0644]
src/gromacs/gmxana/tests/gmx_trjconv.cpp [moved from src/gromacs/gmxana/legacytests/gmx_traj_tests.cpp with 54% similarity]
src/gromacs/gmxana/tests/spc2-traj.g96 [moved from src/gromacs/gmxana/legacytests/spc2-traj.g96 with 100% similarity]
src/gromacs/gmxana/tests/spc2-traj.gro [moved from src/gromacs/gmxana/legacytests/spc2-traj.gro with 100% similarity]
src/gromacs/gmxana/tests/spc2-traj.pdb [moved from src/gromacs/gmxana/legacytests/spc2-traj.pdb with 100% similarity]
src/gromacs/gmxana/tests/spc2-traj.tng [moved from src/gromacs/gmxana/legacytests/spc2-traj.tng with 100% similarity]
src/gromacs/gmxana/tests/spc2-traj.trr [moved from src/gromacs/gmxana/legacytests/spc2-traj.trr with 100% similarity]
src/gromacs/gmxana/tests/spc2-traj.xtc [moved from src/gromacs/gmxana/legacytests/spc2-traj.xtc with 100% similarity]
src/gromacs/gmxana/tests/spc2.gro [moved from src/gromacs/gmxana/legacytests/spc2.gro with 100% similarity]
src/gromacs/gmxana/tests/spc2.ndx [moved from src/gromacs/gmxana/legacytests/spc2.ndx with 100% similarity]
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_generic_cg.cpp
src/gromacs/gmxlib/nonbonded/nb_kernel.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_ElecCSTab_VdwCSTab_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCSTab_VdwNone_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCSTab_VdwNone_GeomW3P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCSTab_VdwNone_GeomW3W3_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCSTab_VdwNone_GeomW4P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCSTab_VdwNone_GeomW4W4_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCoul_VdwLJ_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCoul_VdwLJ_GeomW3P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCoul_VdwLJ_GeomW3W3_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCoul_VdwLJ_GeomW4P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCoul_VdwLJ_GeomW4W4_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCoul_VdwNone_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCoul_VdwNone_GeomW3P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCoul_VdwNone_GeomW3W3_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCoul_VdwNone_GeomW4P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecCoul_VdwNone_GeomW4W4_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSh_VdwNone_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSh_VdwNone_GeomW3P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSh_VdwNone_GeomW3W3_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSh_VdwNone_GeomW4P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSh_VdwNone_GeomW4W4_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSw_VdwNone_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSw_VdwNone_GeomW3P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSw_VdwNone_GeomW3W3_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSw_VdwNone_GeomW4P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEwSw_VdwNone_GeomW4W4_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEw_VdwCSTab_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEw_VdwCSTab_GeomW3P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEw_VdwCSTab_GeomW3W3_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEw_VdwCSTab_GeomW4P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEw_VdwCSTab_GeomW4W4_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEw_VdwLJEw_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEw_VdwLJEw_GeomW3P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEw_VdwLJEw_GeomW3W3_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEw_VdwLJEw_GeomW4P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEw_VdwLJEw_GeomW4W4_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEw_VdwLJ_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEw_VdwLJ_GeomW3P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEw_VdwLJ_GeomW3W3_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEw_VdwLJ_GeomW4P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEw_VdwLJ_GeomW4W4_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEw_VdwNone_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEw_VdwNone_GeomW3P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEw_VdwNone_GeomW3W3_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEw_VdwNone_GeomW4P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecEw_VdwNone_GeomW4W4_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecGB_VdwLJ_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecGB_VdwNone_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecNone_VdwCSTab_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecNone_VdwLJEw_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecNone_VdwLJSh_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecNone_VdwLJSw_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecNone_VdwLJ_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRFCut_VdwNone_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRFCut_VdwNone_GeomW3P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRFCut_VdwNone_GeomW3W3_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRFCut_VdwNone_GeomW4P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRFCut_VdwNone_GeomW4W4_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRF_VdwCSTab_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRF_VdwCSTab_GeomW3P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRF_VdwCSTab_GeomW3W3_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRF_VdwCSTab_GeomW4P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRF_VdwCSTab_GeomW4W4_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRF_VdwLJ_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRF_VdwLJ_GeomW3P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRF_VdwLJ_GeomW3W3_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRF_VdwLJ_GeomW4P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRF_VdwLJ_GeomW4W4_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRF_VdwNone_GeomP1P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRF_VdwNone_GeomW3P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRF_VdwNone_GeomW3W3_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRF_VdwNone_GeomW4P1_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecRF_VdwNone_GeomW4W4_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/kernelutil_x86_avx_128_fma_single.h
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_ElecCSTab_VdwCSTab_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCSTab_VdwNone_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCSTab_VdwNone_GeomW3P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCSTab_VdwNone_GeomW3W3_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCSTab_VdwNone_GeomW4P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCSTab_VdwNone_GeomW4W4_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCoul_VdwLJ_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCoul_VdwLJ_GeomW3P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCoul_VdwLJ_GeomW3W3_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCoul_VdwLJ_GeomW4P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCoul_VdwLJ_GeomW4W4_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCoul_VdwNone_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCoul_VdwNone_GeomW3P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCoul_VdwNone_GeomW3W3_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCoul_VdwNone_GeomW4P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecCoul_VdwNone_GeomW4W4_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSh_VdwNone_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSh_VdwNone_GeomW3P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSh_VdwNone_GeomW3W3_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSh_VdwNone_GeomW4P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSh_VdwNone_GeomW4W4_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSw_VdwNone_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSw_VdwNone_GeomW3P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSw_VdwNone_GeomW3W3_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSw_VdwNone_GeomW4P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEwSw_VdwNone_GeomW4W4_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEw_VdwCSTab_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEw_VdwCSTab_GeomW3P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEw_VdwCSTab_GeomW3W3_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEw_VdwCSTab_GeomW4P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEw_VdwCSTab_GeomW4W4_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEw_VdwLJEw_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEw_VdwLJEw_GeomW3P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEw_VdwLJEw_GeomW3W3_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEw_VdwLJEw_GeomW4P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEw_VdwLJEw_GeomW4W4_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEw_VdwLJ_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEw_VdwLJ_GeomW3P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEw_VdwLJ_GeomW3W3_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEw_VdwLJ_GeomW4P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEw_VdwLJ_GeomW4W4_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEw_VdwNone_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEw_VdwNone_GeomW3P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEw_VdwNone_GeomW3W3_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEw_VdwNone_GeomW4P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecEw_VdwNone_GeomW4W4_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecGB_VdwLJ_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecGB_VdwNone_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecNone_VdwCSTab_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecNone_VdwLJEw_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecNone_VdwLJSh_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecNone_VdwLJSw_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecNone_VdwLJ_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRFCut_VdwNone_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRFCut_VdwNone_GeomW3P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRFCut_VdwNone_GeomW3W3_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRFCut_VdwNone_GeomW4P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRFCut_VdwNone_GeomW4W4_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRF_VdwCSTab_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRF_VdwCSTab_GeomW3P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRF_VdwCSTab_GeomW3W3_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRF_VdwCSTab_GeomW4P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRF_VdwCSTab_GeomW4W4_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRF_VdwLJ_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRF_VdwLJ_GeomW3P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRF_VdwLJ_GeomW3W3_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRF_VdwLJ_GeomW4P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRF_VdwLJ_GeomW4W4_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRF_VdwNone_GeomP1P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRF_VdwNone_GeomW3P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRF_VdwNone_GeomW3W3_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRF_VdwNone_GeomW4P1_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecRF_VdwNone_GeomW4W4_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_ElecCSTab_VdwCSTab_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCSTab_VdwNone_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCSTab_VdwNone_GeomW3P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCSTab_VdwNone_GeomW3W3_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCSTab_VdwNone_GeomW4P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCSTab_VdwNone_GeomW4W4_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCoul_VdwLJ_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCoul_VdwLJ_GeomW3P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCoul_VdwLJ_GeomW3W3_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCoul_VdwLJ_GeomW4P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCoul_VdwLJ_GeomW4W4_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCoul_VdwNone_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCoul_VdwNone_GeomW3P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCoul_VdwNone_GeomW3W3_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCoul_VdwNone_GeomW4P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecCoul_VdwNone_GeomW4W4_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSh_VdwNone_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSh_VdwNone_GeomW3P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSh_VdwNone_GeomW3W3_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSh_VdwNone_GeomW4P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSh_VdwNone_GeomW4W4_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSw_VdwNone_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSw_VdwNone_GeomW3P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSw_VdwNone_GeomW3W3_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSw_VdwNone_GeomW4P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEwSw_VdwNone_GeomW4W4_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEw_VdwCSTab_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEw_VdwCSTab_GeomW3P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEw_VdwCSTab_GeomW3W3_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEw_VdwCSTab_GeomW4P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEw_VdwCSTab_GeomW4W4_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEw_VdwLJEw_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEw_VdwLJEw_GeomW3P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEw_VdwLJEw_GeomW3W3_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEw_VdwLJEw_GeomW4P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEw_VdwLJEw_GeomW4W4_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEw_VdwLJ_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEw_VdwLJ_GeomW3P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEw_VdwLJ_GeomW3W3_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEw_VdwLJ_GeomW4P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEw_VdwLJ_GeomW4W4_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEw_VdwNone_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEw_VdwNone_GeomW3P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEw_VdwNone_GeomW3W3_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEw_VdwNone_GeomW4P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecEw_VdwNone_GeomW4W4_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecGB_VdwLJ_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecGB_VdwNone_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecNone_VdwCSTab_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecNone_VdwLJEw_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecNone_VdwLJSh_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecNone_VdwLJSw_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecNone_VdwLJ_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRFCut_VdwNone_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRFCut_VdwNone_GeomW3P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRFCut_VdwNone_GeomW3W3_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRFCut_VdwNone_GeomW4P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRFCut_VdwNone_GeomW4W4_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRF_VdwCSTab_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRF_VdwCSTab_GeomW3P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRF_VdwCSTab_GeomW3W3_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRF_VdwCSTab_GeomW4P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRF_VdwCSTab_GeomW4W4_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRF_VdwLJ_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRF_VdwLJ_GeomW3P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRF_VdwLJ_GeomW3W3_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRF_VdwLJ_GeomW4P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRF_VdwLJ_GeomW4W4_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRF_VdwNone_GeomP1P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRF_VdwNone_GeomW3P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRF_VdwNone_GeomW3W3_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRF_VdwNone_GeomW4P1_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecRF_VdwNone_GeomW4W4_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/kernelutil_x86_avx_256_single.h
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_ElecCSTab_VdwCSTab_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCSTab_VdwNone_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCSTab_VdwNone_GeomW3P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCSTab_VdwNone_GeomW3W3_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCSTab_VdwNone_GeomW4P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCSTab_VdwNone_GeomW4W4_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCoul_VdwLJ_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCoul_VdwLJ_GeomW3P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCoul_VdwLJ_GeomW3W3_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCoul_VdwLJ_GeomW4P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCoul_VdwLJ_GeomW4W4_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCoul_VdwNone_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCoul_VdwNone_GeomW3P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCoul_VdwNone_GeomW3W3_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCoul_VdwNone_GeomW4P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecCoul_VdwNone_GeomW4W4_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSh_VdwNone_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSh_VdwNone_GeomW3P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSh_VdwNone_GeomW3W3_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSh_VdwNone_GeomW4P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSh_VdwNone_GeomW4W4_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSw_VdwNone_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSw_VdwNone_GeomW3P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSw_VdwNone_GeomW3W3_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSw_VdwNone_GeomW4P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEwSw_VdwNone_GeomW4W4_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEw_VdwCSTab_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEw_VdwCSTab_GeomW3P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEw_VdwCSTab_GeomW3W3_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEw_VdwCSTab_GeomW4P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEw_VdwCSTab_GeomW4W4_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEw_VdwLJEw_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEw_VdwLJEw_GeomW3P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEw_VdwLJEw_GeomW3W3_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEw_VdwLJEw_GeomW4P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEw_VdwLJEw_GeomW4W4_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEw_VdwLJ_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEw_VdwLJ_GeomW3P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEw_VdwLJ_GeomW3W3_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEw_VdwLJ_GeomW4P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEw_VdwLJ_GeomW4W4_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEw_VdwNone_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEw_VdwNone_GeomW3P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEw_VdwNone_GeomW3W3_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEw_VdwNone_GeomW4P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecEw_VdwNone_GeomW4W4_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecGB_VdwLJ_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecGB_VdwNone_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecNone_VdwCSTab_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecNone_VdwLJEw_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecNone_VdwLJSh_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecNone_VdwLJSw_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecNone_VdwLJ_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRFCut_VdwNone_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRFCut_VdwNone_GeomW3P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRFCut_VdwNone_GeomW3W3_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRFCut_VdwNone_GeomW4P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRFCut_VdwNone_GeomW4W4_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRF_VdwCSTab_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRF_VdwCSTab_GeomW3P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRF_VdwCSTab_GeomW3W3_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRF_VdwCSTab_GeomW4P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRF_VdwCSTab_GeomW4W4_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRF_VdwLJ_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRF_VdwLJ_GeomW3P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRF_VdwLJ_GeomW3W3_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRF_VdwLJ_GeomW4P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRF_VdwLJ_GeomW4W4_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRF_VdwNone_GeomP1P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRF_VdwNone_GeomW3P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRF_VdwNone_GeomW3W3_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRF_VdwNone_GeomW4P1_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecRF_VdwNone_GeomW4W4_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_ElecCSTab_VdwBham_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCSTab_VdwBham_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCSTab_VdwBham_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCSTab_VdwBham_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCSTab_VdwBham_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCSTab_VdwNone_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCSTab_VdwNone_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCSTab_VdwNone_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCSTab_VdwNone_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCSTab_VdwNone_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCoul_VdwBham_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCoul_VdwBham_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCoul_VdwBham_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCoul_VdwBham_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCoul_VdwBham_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCoul_VdwLJ_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCoul_VdwLJ_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCoul_VdwLJ_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCoul_VdwLJ_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCoul_VdwLJ_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCoul_VdwNone_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCoul_VdwNone_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCoul_VdwNone_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCoul_VdwNone_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCoul_VdwNone_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSh_VdwBhamSh_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSh_VdwBhamSh_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSh_VdwBhamSh_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSh_VdwBhamSh_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSh_VdwBhamSh_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSh_VdwNone_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSh_VdwNone_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSh_VdwNone_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSh_VdwNone_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSh_VdwNone_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSw_VdwBhamSw_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSw_VdwBhamSw_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSw_VdwBhamSw_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSw_VdwBhamSw_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSw_VdwBhamSw_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSw_VdwNone_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSw_VdwNone_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSw_VdwNone_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSw_VdwNone_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEwSw_VdwNone_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwBham_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwBham_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwBham_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwBham_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwBham_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwCSTab_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwCSTab_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwCSTab_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwCSTab_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwCSTab_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwLJEw_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwLJEw_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwLJEw_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwLJEw_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwLJEw_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwLJ_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwLJ_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwLJ_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwLJ_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwLJ_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwNone_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwNone_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwNone_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwNone_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecEw_VdwNone_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecGB_VdwBham_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecGB_VdwLJ_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecGB_VdwNone_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecNone_VdwBhamSh_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecNone_VdwBhamSw_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecNone_VdwBham_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecNone_VdwCSTab_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecNone_VdwLJEw_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecNone_VdwLJSh_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecNone_VdwLJSw_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecNone_VdwLJ_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwBhamSh_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwBhamSh_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwBhamSh_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwBhamSh_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwBhamSh_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwBhamSw_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwBhamSw_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwBhamSw_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwBhamSw_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwBhamSw_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwNone_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwNone_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwNone_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwNone_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwNone_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRF_VdwBham_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRF_VdwBham_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRF_VdwBham_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRF_VdwBham_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRF_VdwBham_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRF_VdwCSTab_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRF_VdwCSTab_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRF_VdwCSTab_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRF_VdwCSTab_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRF_VdwCSTab_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRF_VdwLJ_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRF_VdwLJ_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRF_VdwLJ_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRF_VdwLJ_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRF_VdwLJ_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRF_VdwNone_GeomP1P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRF_VdwNone_GeomW3P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRF_VdwNone_GeomW3W3_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRF_VdwNone_GeomW4P1_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRF_VdwNone_GeomW4W4_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_allvsall.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_allvsall.h
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_allvsallgb.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_allvsallgb.h
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_ElecCSTab_VdwCSTab_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCSTab_VdwNone_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCSTab_VdwNone_GeomW3P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCSTab_VdwNone_GeomW3W3_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCSTab_VdwNone_GeomW4P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCSTab_VdwNone_GeomW4W4_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCoul_VdwLJ_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCoul_VdwLJ_GeomW3P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCoul_VdwLJ_GeomW3W3_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCoul_VdwLJ_GeomW4P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCoul_VdwLJ_GeomW4W4_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCoul_VdwNone_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCoul_VdwNone_GeomW3P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCoul_VdwNone_GeomW3W3_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCoul_VdwNone_GeomW4P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecCoul_VdwNone_GeomW4W4_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSh_VdwNone_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSh_VdwNone_GeomW3P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSh_VdwNone_GeomW3W3_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSh_VdwNone_GeomW4P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSh_VdwNone_GeomW4W4_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSw_VdwNone_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSw_VdwNone_GeomW3P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSw_VdwNone_GeomW3W3_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSw_VdwNone_GeomW4P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEwSw_VdwNone_GeomW4W4_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEw_VdwCSTab_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEw_VdwCSTab_GeomW3P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEw_VdwCSTab_GeomW3W3_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEw_VdwCSTab_GeomW4P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEw_VdwCSTab_GeomW4W4_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEw_VdwLJEw_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEw_VdwLJEw_GeomW3P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEw_VdwLJEw_GeomW3W3_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEw_VdwLJEw_GeomW4P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEw_VdwLJEw_GeomW4W4_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEw_VdwLJ_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEw_VdwLJ_GeomW3P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEw_VdwLJ_GeomW3W3_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEw_VdwLJ_GeomW4P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEw_VdwLJ_GeomW4W4_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEw_VdwNone_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEw_VdwNone_GeomW3P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEw_VdwNone_GeomW3W3_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEw_VdwNone_GeomW4P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecEw_VdwNone_GeomW4W4_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecGB_VdwLJ_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecGB_VdwNone_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecNone_VdwCSTab_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecNone_VdwLJEw_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecNone_VdwLJSh_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecNone_VdwLJSw_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecNone_VdwLJ_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRFCut_VdwNone_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRFCut_VdwNone_GeomW3P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRFCut_VdwNone_GeomW3W3_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRFCut_VdwNone_GeomW4P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRFCut_VdwNone_GeomW4W4_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRF_VdwCSTab_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRF_VdwCSTab_GeomW3P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRF_VdwCSTab_GeomW3W3_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRF_VdwCSTab_GeomW4P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRF_VdwCSTab_GeomW4W4_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRF_VdwLJ_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRF_VdwLJ_GeomW3P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRF_VdwLJ_GeomW3W3_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRF_VdwLJ_GeomW4P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRF_VdwLJ_GeomW4W4_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRF_VdwNone_GeomP1P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRF_VdwNone_GeomW3P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRF_VdwNone_GeomW3W3_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRF_VdwNone_GeomW4P1_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecRF_VdwNone_GeomW4W4_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_ElecCSTab_VdwCSTab_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCSTab_VdwNone_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCSTab_VdwNone_GeomW3P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCSTab_VdwNone_GeomW3W3_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCSTab_VdwNone_GeomW4P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCSTab_VdwNone_GeomW4W4_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCoul_VdwLJ_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCoul_VdwLJ_GeomW3P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCoul_VdwLJ_GeomW3W3_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCoul_VdwLJ_GeomW4P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCoul_VdwLJ_GeomW4W4_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCoul_VdwNone_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCoul_VdwNone_GeomW3P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCoul_VdwNone_GeomW3W3_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCoul_VdwNone_GeomW4P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecCoul_VdwNone_GeomW4W4_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSh_VdwNone_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSh_VdwNone_GeomW3P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSh_VdwNone_GeomW3W3_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSh_VdwNone_GeomW4P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSh_VdwNone_GeomW4W4_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSw_VdwNone_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSw_VdwNone_GeomW3P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSw_VdwNone_GeomW3W3_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSw_VdwNone_GeomW4P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEwSw_VdwNone_GeomW4W4_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEw_VdwCSTab_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEw_VdwCSTab_GeomW3P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEw_VdwCSTab_GeomW3W3_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEw_VdwCSTab_GeomW4P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEw_VdwCSTab_GeomW4W4_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEw_VdwLJEw_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEw_VdwLJEw_GeomW3P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEw_VdwLJEw_GeomW3W3_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEw_VdwLJEw_GeomW4P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEw_VdwLJEw_GeomW4W4_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEw_VdwLJ_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEw_VdwLJ_GeomW3P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEw_VdwLJ_GeomW3W3_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEw_VdwLJ_GeomW4P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEw_VdwLJ_GeomW4W4_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEw_VdwNone_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEw_VdwNone_GeomW3P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEw_VdwNone_GeomW3W3_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEw_VdwNone_GeomW4P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecEw_VdwNone_GeomW4W4_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecGB_VdwLJ_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecGB_VdwNone_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecNone_VdwCSTab_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecNone_VdwLJEw_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecNone_VdwLJSh_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecNone_VdwLJSw_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecNone_VdwLJ_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRFCut_VdwNone_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRFCut_VdwNone_GeomW3P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRFCut_VdwNone_GeomW3W3_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRFCut_VdwNone_GeomW4P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRFCut_VdwNone_GeomW4W4_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRF_VdwCSTab_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRF_VdwCSTab_GeomW3P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRF_VdwCSTab_GeomW3W3_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRF_VdwCSTab_GeomW4P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRF_VdwCSTab_GeomW4W4_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRF_VdwLJ_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRF_VdwLJ_GeomW3P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRF_VdwLJ_GeomW3W3_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRF_VdwLJ_GeomW4P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRF_VdwLJ_GeomW4W4_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRF_VdwNone_GeomP1P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRF_VdwNone_GeomW3P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRF_VdwNone_GeomW3W3_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRF_VdwNone_GeomW4P1_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecRF_VdwNone_GeomW4W4_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_ElecCSTab_VdwCSTab_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCSTab_VdwNone_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCSTab_VdwNone_GeomW3P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCSTab_VdwNone_GeomW3W3_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCSTab_VdwNone_GeomW4P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCSTab_VdwNone_GeomW4W4_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCoul_VdwLJ_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCoul_VdwLJ_GeomW3P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCoul_VdwLJ_GeomW3W3_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCoul_VdwLJ_GeomW4P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCoul_VdwLJ_GeomW4W4_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCoul_VdwNone_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCoul_VdwNone_GeomW3P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCoul_VdwNone_GeomW3W3_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCoul_VdwNone_GeomW4P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecCoul_VdwNone_GeomW4W4_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSh_VdwNone_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSh_VdwNone_GeomW3P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSh_VdwNone_GeomW3W3_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSh_VdwNone_GeomW4P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSh_VdwNone_GeomW4W4_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSw_VdwNone_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSw_VdwNone_GeomW3P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSw_VdwNone_GeomW3W3_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSw_VdwNone_GeomW4P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEwSw_VdwNone_GeomW4W4_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEw_VdwCSTab_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEw_VdwCSTab_GeomW3P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEw_VdwCSTab_GeomW3W3_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEw_VdwCSTab_GeomW4P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEw_VdwCSTab_GeomW4W4_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEw_VdwLJEw_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEw_VdwLJEw_GeomW3P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEw_VdwLJEw_GeomW3W3_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEw_VdwLJEw_GeomW4P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEw_VdwLJEw_GeomW4W4_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEw_VdwLJ_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEw_VdwLJ_GeomW3P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEw_VdwLJ_GeomW3W3_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEw_VdwLJ_GeomW4P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEw_VdwLJ_GeomW4W4_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEw_VdwNone_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEw_VdwNone_GeomW3P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEw_VdwNone_GeomW3W3_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEw_VdwNone_GeomW4P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecEw_VdwNone_GeomW4W4_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecGB_VdwLJ_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecGB_VdwNone_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecNone_VdwCSTab_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecNone_VdwLJEw_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecNone_VdwLJSh_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecNone_VdwLJSw_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecNone_VdwLJ_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRFCut_VdwNone_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRFCut_VdwNone_GeomW3P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRFCut_VdwNone_GeomW3W3_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRFCut_VdwNone_GeomW4P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRFCut_VdwNone_GeomW4W4_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRF_VdwCSTab_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRF_VdwCSTab_GeomW3P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRF_VdwCSTab_GeomW3W3_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRF_VdwCSTab_GeomW4P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRF_VdwCSTab_GeomW4W4_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRF_VdwLJ_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRF_VdwLJ_GeomW3P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRF_VdwLJ_GeomW3W3_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRF_VdwLJ_GeomW4P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRF_VdwLJ_GeomW4W4_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRF_VdwNone_GeomP1P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRF_VdwNone_GeomW3P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRF_VdwNone_GeomW3W3_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRF_VdwNone_GeomW4P1_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecRF_VdwNone_GeomW4W4_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_ElecCSTab_VdwCSTab_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCSTab_VdwNone_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCSTab_VdwNone_GeomW3P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCSTab_VdwNone_GeomW3W3_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCSTab_VdwNone_GeomW4P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCSTab_VdwNone_GeomW4W4_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCoul_VdwLJ_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCoul_VdwLJ_GeomW3P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCoul_VdwLJ_GeomW3W3_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCoul_VdwLJ_GeomW4P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCoul_VdwLJ_GeomW4W4_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCoul_VdwNone_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCoul_VdwNone_GeomW3P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCoul_VdwNone_GeomW3W3_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCoul_VdwNone_GeomW4P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecCoul_VdwNone_GeomW4W4_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSh_VdwNone_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSh_VdwNone_GeomW3P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSh_VdwNone_GeomW3W3_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSh_VdwNone_GeomW4P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSh_VdwNone_GeomW4W4_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSw_VdwNone_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSw_VdwNone_GeomW3P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSw_VdwNone_GeomW3W3_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSw_VdwNone_GeomW4P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEwSw_VdwNone_GeomW4W4_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEw_VdwCSTab_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEw_VdwCSTab_GeomW3P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEw_VdwCSTab_GeomW3W3_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEw_VdwCSTab_GeomW4P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEw_VdwCSTab_GeomW4W4_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEw_VdwLJEw_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEw_VdwLJEw_GeomW3P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEw_VdwLJEw_GeomW3W3_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEw_VdwLJEw_GeomW4P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEw_VdwLJEw_GeomW4W4_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEw_VdwLJ_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEw_VdwLJ_GeomW3P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEw_VdwLJ_GeomW3W3_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEw_VdwLJ_GeomW4P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEw_VdwLJ_GeomW4W4_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEw_VdwNone_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEw_VdwNone_GeomW3P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEw_VdwNone_GeomW3W3_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEw_VdwNone_GeomW4P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecEw_VdwNone_GeomW4W4_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecGB_VdwLJ_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecGB_VdwNone_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecNone_VdwCSTab_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecNone_VdwLJEw_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecNone_VdwLJSh_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecNone_VdwLJSw_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecNone_VdwLJ_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRFCut_VdwNone_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRFCut_VdwNone_GeomW3P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRFCut_VdwNone_GeomW3W3_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRFCut_VdwNone_GeomW4P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRFCut_VdwNone_GeomW4W4_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRF_VdwCSTab_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRF_VdwCSTab_GeomW3P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRF_VdwCSTab_GeomW3W3_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRF_VdwCSTab_GeomW4P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRF_VdwCSTab_GeomW4W4_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRF_VdwLJ_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRF_VdwLJ_GeomW3P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRF_VdwLJ_GeomW3W3_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRF_VdwLJ_GeomW4P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRF_VdwLJ_GeomW4W4_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRF_VdwNone_GeomP1P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRF_VdwNone_GeomW3P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRF_VdwNone_GeomW3W3_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRF_VdwNone_GeomW4P1_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecRF_VdwNone_GeomW4W4_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_ElecCSTab_VdwCSTab_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCSTab_VdwNone_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCSTab_VdwNone_GeomW3P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCSTab_VdwNone_GeomW3W3_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCSTab_VdwNone_GeomW4P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCSTab_VdwNone_GeomW4W4_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCoul_VdwLJ_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCoul_VdwLJ_GeomW3P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCoul_VdwLJ_GeomW3W3_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCoul_VdwLJ_GeomW4P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCoul_VdwLJ_GeomW4W4_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCoul_VdwNone_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCoul_VdwNone_GeomW3P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCoul_VdwNone_GeomW3W3_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCoul_VdwNone_GeomW4P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecCoul_VdwNone_GeomW4W4_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSh_VdwNone_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSh_VdwNone_GeomW3P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSh_VdwNone_GeomW3W3_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSh_VdwNone_GeomW4P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSh_VdwNone_GeomW4W4_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSw_VdwNone_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSw_VdwNone_GeomW3P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSw_VdwNone_GeomW3W3_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSw_VdwNone_GeomW4P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEwSw_VdwNone_GeomW4W4_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEw_VdwCSTab_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEw_VdwCSTab_GeomW3P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEw_VdwCSTab_GeomW3W3_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEw_VdwCSTab_GeomW4P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEw_VdwCSTab_GeomW4W4_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEw_VdwLJEw_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEw_VdwLJEw_GeomW3P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEw_VdwLJEw_GeomW3W3_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEw_VdwLJEw_GeomW4P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEw_VdwLJEw_GeomW4W4_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEw_VdwLJ_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEw_VdwLJ_GeomW3P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEw_VdwLJ_GeomW3W3_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEw_VdwLJ_GeomW4P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEw_VdwLJ_GeomW4W4_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEw_VdwNone_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEw_VdwNone_GeomW3P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEw_VdwNone_GeomW3W3_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEw_VdwNone_GeomW4P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecEw_VdwNone_GeomW4W4_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecGB_VdwLJ_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecGB_VdwNone_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecNone_VdwCSTab_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecNone_VdwLJEw_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecNone_VdwLJSh_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecNone_VdwLJSw_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecNone_VdwLJ_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRFCut_VdwNone_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRFCut_VdwNone_GeomW3P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRFCut_VdwNone_GeomW3W3_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRFCut_VdwNone_GeomW4P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRFCut_VdwNone_GeomW4W4_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRF_VdwCSTab_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRF_VdwCSTab_GeomW3P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRF_VdwCSTab_GeomW3W3_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRF_VdwCSTab_GeomW4P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRF_VdwCSTab_GeomW4W4_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRF_VdwLJ_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRF_VdwLJ_GeomW3P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRF_VdwLJ_GeomW3W3_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRF_VdwLJ_GeomW4P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRF_VdwLJ_GeomW4W4_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRF_VdwNone_GeomP1P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRF_VdwNone_GeomW3P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRF_VdwNone_GeomW3W3_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRF_VdwNone_GeomW4P1_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecRF_VdwNone_GeomW4W4_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/gmxpreprocess/add_par.cpp
src/gromacs/gmxpreprocess/convparm.cpp
src/gromacs/gmxpreprocess/fflibutil.cpp
src/gromacs/gmxpreprocess/gen_ad.cpp
src/gromacs/gmxpreprocess/gen_maxwell_velocities.cpp
src/gromacs/gmxpreprocess/gen_vsite.cpp
src/gromacs/gmxpreprocess/genconf.cpp
src/gromacs/gmxpreprocess/genhydro.cpp
src/gromacs/gmxpreprocess/gmxcpp.cpp
src/gromacs/gmxpreprocess/gpp_atomtype.cpp
src/gromacs/gmxpreprocess/gpp_bond_atomtype.cpp
src/gromacs/gmxpreprocess/grompp-impl.h
src/gromacs/gmxpreprocess/grompp.cpp
src/gromacs/gmxpreprocess/h_db.cpp
src/gromacs/gmxpreprocess/hackblock.cpp
src/gromacs/gmxpreprocess/hizzie.cpp
src/gromacs/gmxpreprocess/hizzie.h
src/gromacs/gmxpreprocess/insert-molecules.cpp
src/gromacs/gmxpreprocess/keyvaluetreemdpwriter.cpp [new file with mode: 0644]
src/gromacs/gmxpreprocess/keyvaluetreemdpwriter.h [new file with mode: 0644]
src/gromacs/gmxpreprocess/nm2type.cpp
src/gromacs/gmxpreprocess/pdb2gmx.cpp
src/gromacs/gmxpreprocess/pdb2top.cpp
src/gromacs/gmxpreprocess/pgutil.cpp
src/gromacs/gmxpreprocess/read-conformation.cpp
src/gromacs/gmxpreprocess/read-conformation.h
src/gromacs/gmxpreprocess/readir.cpp
src/gromacs/gmxpreprocess/readir.h
src/gromacs/gmxpreprocess/readpull.cpp
src/gromacs/gmxpreprocess/readrot.cpp
src/gromacs/gmxpreprocess/resall.cpp
src/gromacs/gmxpreprocess/solvate.cpp
src/gromacs/gmxpreprocess/specbond.cpp
src/gromacs/gmxpreprocess/ter_db.cpp
src/gromacs/gmxpreprocess/tests/CMakeLists.txt
src/gromacs/gmxpreprocess/tests/readir.cpp [new file with mode: 0644]
src/gromacs/gmxpreprocess/tests/refdata/GenconfTest_nbox_dist_Works.xml
src/gromacs/gmxpreprocess/tests/refdata/GenconfTest_nbox_rot_Works.xml
src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_EmptyInputWorks.xml [new file with mode: 0644]
src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_HandlesDifferentKindsOfMdpLines.xml [new file with mode: 0644]
src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_HandlesOnlyCutoffScheme.xml [new file with mode: 0644]
src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_ProducesOutputFromElectricField.xml [new file with mode: 0644]
src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_UserErrorsSilentlyTolerated.xml [new file with mode: 0644]
src/gromacs/gmxpreprocess/tomorse.cpp
src/gromacs/gmxpreprocess/topdirs.cpp
src/gromacs/gmxpreprocess/topio.cpp
src/gromacs/gmxpreprocess/topio.h
src/gromacs/gmxpreprocess/toppush.cpp
src/gromacs/gmxpreprocess/toputil.cpp
src/gromacs/gmxpreprocess/vsite_parm.cpp
src/gromacs/gmxpreprocess/x2top.cpp
src/gromacs/gmxpreprocess/xlate.cpp
src/gromacs/gpu_utils/cuda_arch_utils.cuh
src/gromacs/gpu_utils/cuda_kernel_utils.cuh [new file with mode: 0644]
src/gromacs/gpu_utils/cudautils.cu
src/gromacs/gpu_utils/cudautils.cuh
src/gromacs/gpu_utils/gpu_macros.h
src/gromacs/gpu_utils/gpu_utils.cpp
src/gromacs/gpu_utils/gpu_utils.cu
src/gromacs/gpu_utils/gpu_utils.h
src/gromacs/gpu_utils/gpu_utils_ocl.cpp
src/gromacs/gpu_utils/ocl_caching.cpp
src/gromacs/gpu_utils/ocl_compiler.cpp
src/gromacs/gpu_utils/ocl_compiler.h
src/gromacs/gpu_utils/oclutils.cpp
src/gromacs/gromacs-config.cmake.cmakein
src/gromacs/hardware/CMakeLists.txt
src/gromacs/hardware/architecture.h [new file with mode: 0644]
src/gromacs/hardware/cpuinfo.cpp
src/gromacs/hardware/cpuinfo.h
src/gromacs/hardware/detecthardware.cpp
src/gromacs/hardware/detecthardware.h
src/gromacs/hardware/gpu_hw_info.cpp [new file with mode: 0644]
src/gromacs/hardware/gpu_hw_info.h
src/gromacs/hardware/hardwareassign.cpp [new file with mode: 0644]
src/gromacs/hardware/hardwareassign.h [new file with mode: 0644]
src/gromacs/hardware/hardwaretopology.cpp
src/gromacs/hardware/hardwaretopology.h
src/gromacs/hardware/hw_info.h
src/gromacs/hardware/printhardware.cpp [new file with mode: 0644]
src/gromacs/hardware/printhardware.h [new file with mode: 0644]
src/gromacs/imd/imd.cpp
src/gromacs/imd/imd.h
src/gromacs/imd/imdsocket.cpp
src/gromacs/linearalgebra/eigensolver.cpp
src/gromacs/linearalgebra/gmx_arpack.cpp
src/gromacs/linearalgebra/gmx_lapack/dbdsqr.cpp
src/gromacs/linearalgebra/gmx_lapack/dstebz.cpp
src/gromacs/linearalgebra/gmx_lapack/sbdsqr.cpp
src/gromacs/linearalgebra/gmx_lapack/sstebz.cpp
src/gromacs/linearalgebra/matrix.cpp
src/gromacs/linearalgebra/nrjac.cpp
src/gromacs/linearalgebra/nrjac.h
src/gromacs/linearalgebra/sparsematrix.cpp
src/gromacs/listed-forces/CMakeLists.txt
src/gromacs/listed-forces/bonded.cpp
src/gromacs/listed-forces/bonded.h
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/listed-internal.cpp
src/gromacs/listed-forces/manage-threading.cpp
src/gromacs/listed-forces/orires.cpp
src/gromacs/listed-forces/orires.h
src/gromacs/listed-forces/pairs.cpp
src/gromacs/listed-forces/pairs.h
src/gromacs/listed-forces/position-restraints.cpp
src/gromacs/listed-forces/position-restraints.h
src/gromacs/listed-forces/tests/CMakeLists.txt [new file with mode: 0644]
src/gromacs/listed-forces/tests/bonded.cpp [new file with mode: 0644]
src/gromacs/listed-forces/tests/refdata/BondedTest_BondAnglePbcNone.xml [new file with mode: 0644]
src/gromacs/listed-forces/tests/refdata/BondedTest_BondAnglePbcXy.xml [new file with mode: 0644]
src/gromacs/listed-forces/tests/refdata/BondedTest_BondAnglePbcXyz.xml [new file with mode: 0644]
src/gromacs/listed-forces/tests/refdata/BondedTest_DihedralAnglePbcNone.xml [new file with mode: 0644]
src/gromacs/listed-forces/tests/refdata/BondedTest_DihedralAnglePbcXy.xml [new file with mode: 0644]
src/gromacs/listed-forces/tests/refdata/BondedTest_DihedralAnglePbcXyz.xml [new file with mode: 0644]
src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncAnglesPbcNo.xml [new file with mode: 0644]
src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncAnglesPbcXYZ.xml [new file with mode: 0644]
src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncAnglesPbcXy.xml [new file with mode: 0644]
src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncBondsPbcNo.xml [new file with mode: 0644]
src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncBondsPbcXy.xml [new file with mode: 0644]
src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncBondsPbcXyz.xml [new file with mode: 0644]
src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncProperDihedralsPbcNo.xml [new file with mode: 0644]
src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncProperDihedralsPbcXy.xml [new file with mode: 0644]
src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncProperDihedralsPbcXyz.xml [new file with mode: 0644]
src/gromacs/math/CMakeLists.txt
src/gromacs/math/do_fit.cpp
src/gromacs/math/gmxcomplex.h
src/gromacs/math/paddedvector.h [new file with mode: 0644]
src/gromacs/math/tests/vectypes.cpp
src/gromacs/math/units.cpp
src/gromacs/math/utilities.h
src/gromacs/math/veccompare.cpp [new file with mode: 0644]
src/gromacs/math/veccompare.h [moved from src/gromacs/tools/compare.h with 70% similarity]
src/gromacs/math/vecdump.cpp
src/gromacs/math/vecdump.h
src/gromacs/math/vectypes.h
src/gromacs/mdlib/broadcaststructs.cpp
src/gromacs/mdlib/broadcaststructs.h [new file with mode: 0644]
src/gromacs/mdlib/calc_verletbuf.cpp
src/gromacs/mdlib/calc_verletbuf.h
src/gromacs/mdlib/clincs.cpp
src/gromacs/mdlib/compute_io.cpp
src/gromacs/mdlib/constr.cpp
src/gromacs/mdlib/constr.h
src/gromacs/mdlib/coupling.cpp
src/gromacs/mdlib/csettle.cpp
src/gromacs/mdlib/ebin.cpp
src/gromacs/mdlib/expanded.cpp
src/gromacs/mdlib/expanded.h [new file with mode: 0644]
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
src/gromacs/mdlib/genborn_allvsall.cpp
src/gromacs/mdlib/gmx_omp_nthreads.cpp
src/gromacs/mdlib/gmx_omp_nthreads.h
src/gromacs/mdlib/groupcoord.cpp
src/gromacs/mdlib/integrator.h
src/gromacs/mdlib/main.cpp
src/gromacs/mdlib/md_support.cpp
src/gromacs/mdlib/md_support.h
src/gromacs/mdlib/mdatoms.cpp
src/gromacs/mdlib/mdatoms.h
src/gromacs/mdlib/mdebin.cpp
src/gromacs/mdlib/mdebin.h
src/gromacs/mdlib/mdebin_bar.cpp
src/gromacs/mdlib/mdebin_bar.h
src/gromacs/mdlib/mdoutf.cpp
src/gromacs/mdlib/mdoutf.h
src/gromacs/mdlib/mdrun.h
src/gromacs/mdlib/mdsetup.cpp [new file with mode: 0644]
src/gromacs/mdlib/mdsetup.h [new file with mode: 0644]
src/gromacs/mdlib/minimize.cpp
src/gromacs/mdlib/nb_verlet.h
src/gromacs/mdlib/nbnxn_atomdata.cpp
src/gromacs/mdlib/nbnxn_atomdata.h
src/gromacs/mdlib/nbnxn_cuda/CMakeLists.txt
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.h [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.cu
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_fermi.cuh
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_pruneonly.cu [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_pruneonly.cuh [new file with mode: 0644]
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.h
src/gromacs/mdlib/nbnxn_gpu_data_mgmt.h
src/gromacs/mdlib/nbnxn_grid.cpp
src/gromacs/mdlib/nbnxn_internal.h
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_common.h
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_cpu.cpp [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_cpu.h [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_file_generator/make_verlet_simd_kernel_files.py
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_file_generator/nbnxn_kernel_simd_template.cpp.pre [deleted file]
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_file_generator/nbnxn_kernel_simd_template.h.pre
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_gpu_ref.cpp
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_prune.cpp [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_prune.h [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref.cpp
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref.h
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_inner.h
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_outer.h
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_prune.cpp [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_prune.h [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.cpp [deleted file]
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.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_prune.cpp [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_prune.h [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.cpp [deleted file]
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.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_kernels/simd_4xn/nbnxn_kernel_simd_4xn_prune.cpp [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_prune.h [new file with mode: 0644]
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_jit_support.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_kernel_pruneonly.clh [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_kernel_utils.clh
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_kernels.cl
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_types.h
src/gromacs/mdlib/nbnxn_pairlist.h
src/gromacs/mdlib/nbnxn_search.cpp
src/gromacs/mdlib/nbnxn_search.h
src/gromacs/mdlib/nbnxn_search_simd_2xnn.h
src/gromacs/mdlib/nbnxn_search_simd_4xn.h
src/gromacs/mdlib/nbnxn_tuning.cpp [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_tuning.h [new file with mode: 0644]
src/gromacs/mdlib/ns.cpp
src/gromacs/mdlib/nsgrid.cpp
src/gromacs/mdlib/perf_est.cpp
src/gromacs/mdlib/qm_orca.cpp
src/gromacs/mdlib/qm_orca.h [new file with mode: 0644]
src/gromacs/mdlib/qmmm.cpp
src/gromacs/mdlib/shakef.cpp
src/gromacs/mdlib/shellfc.cpp
src/gromacs/mdlib/shellfc.h
src/gromacs/mdlib/sighandler.cpp
src/gromacs/mdlib/sim_util.cpp
src/gromacs/mdlib/sim_util.h
src/gromacs/mdlib/simulationsignal.h
src/gromacs/mdlib/splitter.cpp
src/gromacs/mdlib/stat.cpp
src/gromacs/mdlib/tests/CMakeLists.txt
src/gromacs/mdlib/tests/calc_verletbuf.cpp [new file with mode: 0644]
src/gromacs/mdlib/tests/settle.cpp
src/gromacs/mdlib/tgroup.cpp
src/gromacs/mdlib/tpi.cpp
src/gromacs/mdlib/trajectory_writing.cpp
src/gromacs/mdlib/trajectory_writing.h
src/gromacs/mdlib/update.cpp
src/gromacs/mdlib/update.h
src/gromacs/mdlib/vsite.cpp
src/gromacs/mdrunutility/CMakeLists.txt
src/gromacs/mdrunutility/handlerestart.cpp
src/gromacs/mdrunutility/handlerestart.h
src/gromacs/mdrunutility/mdmodules.cpp [new file with mode: 0644]
src/gromacs/mdrunutility/mdmodules.h [new file with mode: 0644]
src/gromacs/mdrunutility/tests/CMakeLists.txt [new file with mode: 0644]
src/gromacs/mdrunutility/tests/threadaffinity-mpi.cpp [new file with mode: 0644]
src/gromacs/mdrunutility/tests/threadaffinity.cpp [new file with mode: 0644]
src/gromacs/mdrunutility/tests/threadaffinitytest.cpp [new file with mode: 0644]
src/gromacs/mdrunutility/tests/threadaffinitytest.h [new file with mode: 0644]
src/gromacs/mdrunutility/threadaffinity.cpp
src/gromacs/mdrunutility/threadaffinity.h
src/gromacs/mdtypes/commrec.h
src/gromacs/mdtypes/edsamhistory.h [new file with mode: 0644]
src/gromacs/mdtypes/energyhistory.h
src/gromacs/mdtypes/fcdata.h
src/gromacs/mdtypes/forcerec.h
src/gromacs/mdtypes/iforceprovider.cpp [new file with mode: 0644]
src/gromacs/mdtypes/iforceprovider.h [new file with mode: 0644]
src/gromacs/mdtypes/imdmodule.h [new file with mode: 0644]
src/gromacs/mdtypes/imdoutputprovider.h [new file with mode: 0644]
src/gromacs/mdtypes/imdpoptionprovider.h [new file with mode: 0644]
src/gromacs/mdtypes/inputrec.cpp
src/gromacs/mdtypes/inputrec.h
src/gromacs/mdtypes/interaction_const.h
src/gromacs/mdtypes/md_enums.cpp
src/gromacs/mdtypes/md_enums.h
src/gromacs/mdtypes/mdatom.h
src/gromacs/mdtypes/observableshistory.h [new file with mode: 0644]
src/gromacs/mdtypes/state.cpp
src/gromacs/mdtypes/state.h
src/gromacs/mdtypes/swaphistory.h [new file with mode: 0644]
src/gromacs/onlinehelp/helpformat.cpp
src/gromacs/onlinehelp/helpmanager.cpp
src/gromacs/onlinehelp/helptopic.cpp
src/gromacs/onlinehelp/helpwritercontext.cpp
src/gromacs/onlinehelp/tests/CMakeLists.txt
src/gromacs/onlinehelp/tests/helpformat.cpp
src/gromacs/onlinehelp/tests/helpmanager.cpp
src/gromacs/onlinehelp/tests/helpwritercontext.cpp
src/gromacs/onlinehelp/tests/mock_helptopic.cpp
src/gromacs/options/CMakeLists.txt
src/gromacs/options/abstractoption.cpp
src/gromacs/options/abstractoption.h
src/gromacs/options/abstractoptionstorage.h
src/gromacs/options/abstractsection.cpp [new file with mode: 0644]
src/gromacs/options/abstractsection.h [new file with mode: 0644]
src/gromacs/options/basicoptions.cpp
src/gromacs/options/basicoptions.h
src/gromacs/options/basicoptionstorage.h
src/gromacs/options/filenameoption.cpp
src/gromacs/options/filenameoption.h
src/gromacs/options/filenameoptionstorage.h
src/gromacs/options/ioptionscontainer.h
src/gromacs/options/ioptionscontainerwithsections.h [new file with mode: 0644]
src/gromacs/options/isectionstorage.h [new file with mode: 0644]
src/gromacs/options/ivaluestore.h [new file with mode: 0644]
src/gromacs/options/optionmanagercontainer.h
src/gromacs/options/options-impl.h
src/gromacs/options/options.cpp
src/gromacs/options/options.h
src/gromacs/options/optionsassigner.cpp
src/gromacs/options/optionsassigner.h
src/gromacs/options/optionsection.cpp [new file with mode: 0644]
src/gromacs/options/optionsection.h [new file with mode: 0644]
src/gromacs/options/optionstoragetemplate.h
src/gromacs/options/optionsvisitor.cpp
src/gromacs/options/optionsvisitor.h
src/gromacs/options/repeatingsection.h [new file with mode: 0644]
src/gromacs/options/tests/CMakeLists.txt
src/gromacs/options/tests/abstractoptionstorage.cpp
src/gromacs/options/tests/filenameoption.cpp
src/gromacs/options/tests/filenameoptionmanager.cpp
src/gromacs/options/tests/option.cpp
src/gromacs/options/tests/optionsassigner.cpp
src/gromacs/options/tests/refdata/TreeValueSupportAdjustTest_FillsDefaultObjectValues.xml [new file with mode: 0644]
src/gromacs/options/tests/refdata/TreeValueSupportAdjustTest_FillsDefaultValues.xml [new file with mode: 0644]
src/gromacs/options/tests/refdata/TreeValueSupportAdjustTest_FillsDefaultVectorValues.xml [new file with mode: 0644]
src/gromacs/options/tests/refdata/TreeValueSupportAdjustTest_MergesDefaultValues.xml [new file with mode: 0644]
src/gromacs/options/tests/refdata/TreeValueSupportAdjustTest_NormalizesValues.xml [new file with mode: 0644]
src/gromacs/options/tests/refdata/TreeValueSupportAdjustTest_OrdersValues.xml [new file with mode: 0644]
src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsBooleanOption.xml [new file with mode: 0644]
src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsDoubleOption.xml [new file with mode: 0644]
src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsEnumIntOption.xml [new file with mode: 0644]
src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsEnumOption.xml [new file with mode: 0644]
src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsFloatOption.xml [new file with mode: 0644]
src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsInt64Option.xml [new file with mode: 0644]
src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsIntegerOption.xml [new file with mode: 0644]
src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsStringOption.xml [new file with mode: 0644]
src/gromacs/options/tests/repeatingsection.cpp [new file with mode: 0644]
src/gromacs/options/tests/timeunitmanager.cpp
src/gromacs/options/tests/treesupport.cpp [new file with mode: 0644]
src/gromacs/options/timeunitmanager.cpp
src/gromacs/options/treesupport.cpp [new file with mode: 0644]
src/gromacs/options/treesupport.h [new file with mode: 0644]
src/gromacs/options/valueconverter.h [new file with mode: 0644]
src/gromacs/options/valuestore.h [new file with mode: 0644]
src/gromacs/pbcutil/boxutilities.cpp
src/gromacs/pbcutil/boxutilities.h
src/gromacs/pbcutil/mshift.cpp
src/gromacs/pbcutil/pbc-simd.cpp
src/gromacs/pbcutil/pbc.cpp
src/gromacs/pbcutil/pbc.h
src/gromacs/pbcutil/rmpbc.cpp
src/gromacs/pulling/pull.cpp
src/gromacs/pulling/pull.h
src/gromacs/pulling/pull_rotation.cpp
src/gromacs/pulling/pull_rotation.h
src/gromacs/pulling/pullutil.cpp
src/gromacs/random/gammadistribution.h
src/gromacs/random/threefry.h
src/gromacs/selection/centerofmass.cpp
src/gromacs/selection/centerofmass.h
src/gromacs/selection/compiler.cpp
src/gromacs/selection/evaluate.cpp
src/gromacs/selection/evaluate.h
src/gromacs/selection/indexutil.cpp
src/gromacs/selection/indexutil.h
src/gromacs/selection/mempool.cpp
src/gromacs/selection/nbsearch.cpp
src/gromacs/selection/nbsearch.h
src/gromacs/selection/params.cpp
src/gromacs/selection/parser.cpp
src/gromacs/selection/parser.h
src/gromacs/selection/parser.patch
src/gromacs/selection/parser.y
src/gromacs/selection/parser_internal.h
src/gromacs/selection/parsetree.cpp
src/gromacs/selection/poscalc.cpp
src/gromacs/selection/poscalc.h
src/gromacs/selection/position.cpp
src/gromacs/selection/scanner.cpp
src/gromacs/selection/scanner.l
src/gromacs/selection/scanner_flex.h
src/gromacs/selection/scanner_internal.cpp
src/gromacs/selection/selection.cpp
src/gromacs/selection/selection.h
src/gromacs/selection/selectioncollection-impl.h
src/gromacs/selection/selectioncollection.cpp
src/gromacs/selection/selectioncollection.h
src/gromacs/selection/selectionenums.h
src/gromacs/selection/selectionfileoptionstorage.h
src/gromacs/selection/selectionoption.cpp
src/gromacs/selection/selectionoptionbehavior.cpp
src/gromacs/selection/selectionoptionbehavior.h
src/gromacs/selection/selectionoptionmanager.cpp
src/gromacs/selection/selectionoptionstorage.h
src/gromacs/selection/selelem.cpp
src/gromacs/selection/selelem.h
src/gromacs/selection/selhelp.cpp
src/gromacs/selection/selmethod.cpp
src/gromacs/selection/selmethod.h
src/gromacs/selection/selvalue.cpp
src/gromacs/selection/sm_compare.cpp
src/gromacs/selection/sm_distance.cpp
src/gromacs/selection/sm_insolidangle.cpp
src/gromacs/selection/sm_keywords.cpp
src/gromacs/selection/sm_merge.cpp
src/gromacs/selection/sm_permute.cpp
src/gromacs/selection/sm_position.cpp
src/gromacs/selection/sm_same.cpp
src/gromacs/selection/sm_simple.cpp
src/gromacs/selection/symrec.cpp
src/gromacs/selection/tests/indexutil.cpp
src/gromacs/selection/tests/nbsearch.cpp
src/gromacs/selection/tests/poscalc.cpp
src/gromacs/selection/tests/selectioncollection.cpp
src/gromacs/selection/tests/selectionoption.cpp
src/gromacs/selection/tests/toputils.cpp
src/gromacs/selection/tests/toputils.h
src/gromacs/simd/impl_arm_neon_asimd/impl_arm_neon_asimd_simd_double.h
src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_general.h
src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_simd4_double.h
src/gromacs/simd/impl_reference/impl_reference_general.h
src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128.h [new file with mode: 0644]
src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_definitions.h [new file with mode: 0644]
src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_general.h [new file with mode: 0644]
src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_simd4_double.h [new file with mode: 0644]
src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_simd4_float.h [new file with mode: 0644]
src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_simd_double.h [new file with mode: 0644]
src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_simd_float.h [new file with mode: 0644]
src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_util_double.h [new file with mode: 0644]
src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_util_float.h [new file with mode: 0644]
src/gromacs/simd/impl_x86_avx_128_fma/impl_x86_avx_128_fma_definitions.h
src/gromacs/simd/impl_x86_avx_512/impl_x86_avx_512_simd_float.h
src/gromacs/simd/impl_x86_avx_512/impl_x86_avx_512_util_double.h
src/gromacs/simd/impl_x86_avx_512/impl_x86_avx_512_util_float.h
src/gromacs/simd/impl_x86_avx_512_knl/impl_x86_avx_512_knl_simd_float.h
src/gromacs/simd/impl_x86_mic/impl_x86_mic_simd_float.h
src/gromacs/simd/impl_x86_mic/impl_x86_mic_util_float.h
src/gromacs/simd/scalar/scalar_util.h
src/gromacs/simd/simd.h
src/gromacs/simd/simd_math.h
src/gromacs/simd/support.cpp
src/gromacs/simd/support.h
src/gromacs/simd/tests/CMakeLists.txt
src/gromacs/simd/tests/data.cpp [new file with mode: 0644]
src/gromacs/simd/tests/data.h [new file with mode: 0644]
src/gromacs/simd/tests/scalar.cpp
src/gromacs/simd/tests/scalar_math.cpp
src/gromacs/simd/tests/scalar_util.cpp
src/gromacs/simd/tests/simd.cpp
src/gromacs/simd/tests/simd.h
src/gromacs/simd/tests/simd4.cpp
src/gromacs/simd/tests/simd4.h
src/gromacs/simd/tests/simd4_floatingpoint.cpp
src/gromacs/simd/tests/simd4_vector_operations.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_vector_operations.cpp
src/gromacs/simd/vector_operations.h
src/gromacs/statistics/statistics.cpp
src/gromacs/swap/swapcoords.cpp
src/gromacs/swap/swapcoords.h
src/gromacs/tables/CMakeLists.txt
src/gromacs/tables/cubicsplinetable.cpp [new file with mode: 0644]
src/gromacs/tables/cubicsplinetable.h [new file with mode: 0644]
src/gromacs/tables/forcetable.cpp
src/gromacs/tables/forcetable.h
src/gromacs/tables/quadraticsplinetable.cpp [new file with mode: 0644]
src/gromacs/tables/quadraticsplinetable.h [new file with mode: 0644]
src/gromacs/tables/splineutil.cpp [new file with mode: 0644]
src/gromacs/tables/splineutil.h [new file with mode: 0644]
src/gromacs/tables/tableinput.h [new file with mode: 0644]
src/gromacs/tables/tests/CMakeLists.txt [new file with mode: 0644]
src/gromacs/tables/tests/splinetable.cpp [new file with mode: 0644]
src/gromacs/timing/cyclecounter.cpp
src/gromacs/timing/cyclecounter.h
src/gromacs/timing/gpu_timing.h
src/gromacs/timing/wallcycle.cpp
src/gromacs/timing/wallcycle.h
src/gromacs/timing/wallcyclereporting.h
src/gromacs/timing/walltime_accounting.cpp
src/gromacs/tools/check.cpp
src/gromacs/tools/compare.cpp [deleted file]
src/gromacs/tools/convert_tpr.cpp
src/gromacs/tools/dump.cpp
src/gromacs/topology/atomprop.cpp
src/gromacs/topology/atoms.cpp
src/gromacs/topology/atoms.h
src/gromacs/topology/atomsbuilder.cpp
src/gromacs/topology/block.cpp
src/gromacs/topology/idef.cpp
src/gromacs/topology/idef.h
src/gromacs/topology/index.cpp
src/gromacs/topology/index.h
src/gromacs/topology/mtop_lookup.h [new file with mode: 0644]
src/gromacs/topology/mtop_util.cpp
src/gromacs/topology/mtop_util.h
src/gromacs/topology/residuetypes.cpp
src/gromacs/topology/symtab.cpp
src/gromacs/topology/symtab.h
src/gromacs/topology/topology.cpp
src/gromacs/topology/topology.h
src/gromacs/topology/topsort.cpp
src/gromacs/trajectory/CMakeLists.txt
src/gromacs/trajectory/trajectoryframe.cpp [new file with mode: 0644]
src/gromacs/trajectory/trajectoryframe.h
src/gromacs/trajectoryanalysis/analysismodule.cpp
src/gromacs/trajectoryanalysis/analysissettings.cpp
src/gromacs/trajectoryanalysis/analysissettings.h
src/gromacs/trajectoryanalysis/cmdlinerunner.cpp
src/gromacs/trajectoryanalysis/modules.cpp
src/gromacs/trajectoryanalysis/modules/angle.cpp
src/gromacs/trajectoryanalysis/modules/distance.cpp
src/gromacs/trajectoryanalysis/modules/freevolume.cpp
src/gromacs/trajectoryanalysis/modules/pairdist.cpp
src/gromacs/trajectoryanalysis/modules/rdf.cpp
src/gromacs/trajectoryanalysis/modules/sasa.cpp
src/gromacs/trajectoryanalysis/modules/select.cpp
src/gromacs/trajectoryanalysis/modules/surfacearea.cpp
src/gromacs/trajectoryanalysis/modules/trajectory.cpp [new file with mode: 0644]
src/gromacs/trajectoryanalysis/modules/trajectory.h [new file with mode: 0644]
src/gromacs/trajectoryanalysis/modules/unionfind.h [new file with mode: 0644]
src/gromacs/trajectoryanalysis/runnercommon.cpp
src/gromacs/trajectoryanalysis/tests/CMakeLists.txt
src/gromacs/trajectoryanalysis/tests/clustsize.cpp [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/clustsize.ndx [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/clustsize.pdb [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/clustsize.tpr [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/moduletest.cpp
src/gromacs/trajectoryanalysis/tests/refdata/ClustsizeTest_MolCSize.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/ClustsizeTest_MolDefaultCutoff.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/ClustsizeTest_MolShortCutoff.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/ClustsizeTest_NoMolDefaultCutoff.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/ClustsizeTest_NoMolShortCutoff.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/DistanceModuleTest_HandlesDynamicSelections.xml
src/gromacs/trajectoryanalysis/tests/refdata/TrajectoryModuleTest_BasicTest.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/TrajectoryModuleTest_HandlesNoForces.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/TrajectoryModuleTest_HandlesNoVelocities.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/TrajectoryModuleTest_PlotsXOnly.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/surfacearea.cpp
src/gromacs/trajectoryanalysis/tests/trajectory.cpp [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/unionfind.cpp [new file with mode: 0644]
src/gromacs/utility.h
src/gromacs/utility/alignedallocator.cpp
src/gromacs/utility/alignedallocator.h
src/gromacs/utility/arrayref.h
src/gromacs/utility/basedefinitions.h
src/gromacs/utility/binaryinformation.cpp
src/gromacs/utility/binaryinformation.h
src/gromacs/utility/classhelpers.h
src/gromacs/utility/compare.cpp [new file with mode: 0644]
src/gromacs/utility/compare.h [new file with mode: 0644]
src/gromacs/utility/coolstuff.cpp
src/gromacs/utility/cstringutil.cpp
src/gromacs/utility/cstringutil.h
src/gromacs/utility/cuda_version_information.cu
src/gromacs/utility/cuda_version_information.h
src/gromacs/utility/datafilefinder.cpp
src/gromacs/utility/directoryenumerator.cpp
src/gromacs/utility/errorcodes.cpp
src/gromacs/utility/errorcodes.h
src/gromacs/utility/errorformat.cpp
src/gromacs/utility/exceptions.cpp
src/gromacs/utility/exceptions.h
src/gromacs/utility/fatalerror.cpp
src/gromacs/utility/filestream.cpp
src/gromacs/utility/futil.cpp
src/gromacs/utility/gmxmpi.h
src/gromacs/utility/gmxomp.cpp
src/gromacs/utility/gmxregex.cpp
src/gromacs/utility/ikeyvaluetreeerror.cpp [new file with mode: 0644]
src/gromacs/utility/ikeyvaluetreeerror.h [moved from src/gromacs/gmxlib/md_logging.h with 63% similarity]
src/gromacs/utility/inmemoryserializer.cpp [new file with mode: 0644]
src/gromacs/utility/inmemoryserializer.h [new file with mode: 0644]
src/gromacs/utility/int64_to_int.cpp
src/gromacs/utility/iserializer.h [new file with mode: 0644]
src/gromacs/utility/keyvaluetree.cpp [new file with mode: 0644]
src/gromacs/utility/keyvaluetree.h [new file with mode: 0644]
src/gromacs/utility/keyvaluetreebuilder.h [new file with mode: 0644]
src/gromacs/utility/keyvaluetreeserializer.cpp [new file with mode: 0644]
src/gromacs/utility/keyvaluetreeserializer.h [new file with mode: 0644]
src/gromacs/utility/keyvaluetreetransform.cpp [new file with mode: 0644]
src/gromacs/utility/keyvaluetreetransform.h [new file with mode: 0644]
src/gromacs/utility/logger.cpp [new file with mode: 0644]
src/gromacs/utility/logger.h [new file with mode: 0644]
src/gromacs/utility/loggerbuilder.cpp [new file with mode: 0644]
src/gromacs/utility/loggerbuilder.h [new file with mode: 0644]
src/gromacs/utility/messagestringcollector.cpp
src/gromacs/utility/niceheader.cpp [new file with mode: 0644]
src/gromacs/utility/niceheader.h [new file with mode: 0644]
src/gromacs/utility/path.cpp
src/gromacs/utility/pleasecite.cpp
src/gromacs/utility/programcontext.cpp
src/gromacs/utility/qsort_threadsafe.cpp
src/gromacs/utility/scoped_cptr.h [deleted file]
src/gromacs/utility/smalloc.cpp
src/gromacs/utility/strconvert.cpp [new file with mode: 0644]
src/gromacs/utility/strconvert.h [new file with mode: 0644]
src/gromacs/utility/strdb.cpp
src/gromacs/utility/stringcompare.h [new file with mode: 0644]
src/gromacs/utility/stringutil.cpp
src/gromacs/utility/stringutil.h
src/gromacs/utility/sysinfo.cpp
src/gromacs/utility/sysinfo.h
src/gromacs/utility/tests/CMakeLists.txt
src/gromacs/utility/tests/arrayref.cpp
src/gromacs/utility/tests/keyvaluetreeserializer.cpp [new file with mode: 0644]
src/gromacs/utility/tests/keyvaluetreetransform.cpp [new file with mode: 0644]
src/gromacs/utility/tests/logger.cpp [new file with mode: 0644]
src/gromacs/utility/tests/mutex.cpp [new file with mode: 0644]
src/gromacs/utility/tests/refdata/KeyValueTreeSerializerTest_EmptyTree.xml [new file with mode: 0644]
src/gromacs/utility/tests/refdata/KeyValueTreeSerializerTest_ObjectWithArrays.xml [new file with mode: 0644]
src/gromacs/utility/tests/refdata/KeyValueTreeSerializerTest_ObjectWithObjects.xml [new file with mode: 0644]
src/gromacs/utility/tests/refdata/KeyValueTreeSerializerTest_SimpleObject.xml [new file with mode: 0644]
src/gromacs/utility/tests/refdata/LoggerTest_LevelFilteringWorks.xml [new file with mode: 0644]
src/gromacs/utility/tests/refdata/LoggerTest_LogsToFile.xml [new file with mode: 0644]
src/gromacs/utility/tests/refdata/LoggerTest_LogsToMultipleStreams.xml [new file with mode: 0644]
src/gromacs/utility/tests/refdata/LoggerTest_LogsToStream.xml [new file with mode: 0644]
src/gromacs/utility/tests/refdata/TextLineWrapperTest_WrapsCorrectlyWithExtraWhitespace.xml
src/gromacs/utility/tests/refdata/TextWriterTest_PreservesTrailingWhitespace.xml [new file with mode: 0644]
src/gromacs/utility/tests/refdata/TreeValueTransformTest_ObjectFromMultipleStrings.xml [new file with mode: 0644]
src/gromacs/utility/tests/refdata/TreeValueTransformTest_ObjectFromString.xml [new file with mode: 0644]
src/gromacs/utility/tests/refdata/TreeValueTransformTest_ScopedTransformRules.xml [new file with mode: 0644]
src/gromacs/utility/tests/refdata/TreeValueTransformTest_SimpleTransforms.xml [new file with mode: 0644]
src/gromacs/utility/tests/refdata/TreeValueTransformTest_SimpleTransformsCaseAndDashInsensitive.xml [new file with mode: 0644]
src/gromacs/utility/tests/refdata/TreeValueTransformTest_SimpleTransformsToObject.xml [new file with mode: 0644]
src/gromacs/utility/tests/stringutil.cpp
src/gromacs/utility/tests/textreader.cpp [new file with mode: 0644]
src/gromacs/utility/tests/textwriter.cpp
src/gromacs/utility/tests/typetraits.cpp [new file with mode: 0644]
src/gromacs/utility/textreader.cpp
src/gromacs/utility/textreader.h
src/gromacs/utility/textwriter.cpp
src/gromacs/utility/txtdump.cpp
src/gromacs/utility/typetraits.h [new file with mode: 0644]
src/gromacs/utility/unique_cptr.h [new file with mode: 0644]
src/gromacs/utility/variant.cpp [moved from src/gromacs/gmxlib/md_logging.cpp with 59% similarity]
src/gromacs/utility/variant.h [new file with mode: 0644]
src/programs/CMakeLists.txt
src/programs/legacymodules.cpp
src/programs/mdrun/md.cpp
src/programs/mdrun/mdrun.cpp
src/programs/mdrun/membed.cpp
src/programs/mdrun/membed.h
src/programs/mdrun/repl_ex.cpp
src/programs/mdrun/repl_ex.h
src/programs/mdrun/resource-division.cpp
src/programs/mdrun/resource-division.h
src/programs/mdrun/runner.cpp
src/programs/mdrun/runner.h
src/programs/mdrun/tests/CMakeLists.txt
src/programs/mdrun/tests/energyreader.cpp
src/programs/mdrun/tests/energyreader.h
src/programs/mdrun/tests/moduletest.cpp
src/programs/mdrun/tests/moduletest.h
src/programs/mdrun/tests/rerun.cpp
src/programs/mdrun/tests/termination.cpp
src/programs/mdrun/tests/trajectoryreader.cpp
src/programs/mdrun/tests/trajectoryreader.h
src/programs/view/dialogs.cpp
src/programs/view/fgrid.cpp
src/programs/view/filter.cpp
src/programs/view/logo.cpp
src/programs/view/manager.cpp
src/programs/view/molps.cpp
src/programs/view/nleg.cpp
src/programs/view/nmol.cpp
src/programs/view/popup.cpp
src/programs/view/view.cpp
src/programs/view/x11.cpp
src/programs/view/xdlg.cpp
src/programs/view/xdlghi.cpp
src/programs/view/xdlgitem.cpp
src/programs/view/xmb.cpp
src/programs/view/xutil.cpp
src/testutils/CMakeLists.txt
src/testutils/TestMacros.cmake
src/testutils/cmdlinetest.cpp
src/testutils/cmdlinetest.h
src/testutils/filematchers.cpp [new file with mode: 0644]
src/testutils/filematchers.h [new file with mode: 0644]
src/testutils/interactivetest.cpp
src/testutils/loggertest.cpp [new file with mode: 0644]
src/testutils/loggertest.h [new file with mode: 0644]
src/testutils/mpitest.cpp [new file with mode: 0644]
src/testutils/mpitest.h [new file with mode: 0644]
src/testutils/refdata-checkers.h
src/testutils/refdata-impl.h
src/testutils/refdata.cpp
src/testutils/refdata.h
src/testutils/stdiohelper.cpp [moved from src/testutils/integrationtests.cpp with 82% similarity]
src/testutils/stdiohelper.h [moved from src/testutils/integrationtests.h with 62% similarity]
src/testutils/stringtest.h
src/testutils/testasserts.cpp
src/testutils/testasserts.h
src/testutils/testfilemanager.cpp
src/testutils/testfileredirector.cpp
src/testutils/testinit.cpp
src/testutils/tests/CMakeLists.txt
src/testutils/tests/interactivetest.cpp
src/testutils/tests/mpitest.cpp [moved from src/gromacs/mdtypes/energyhistory.cpp with 61% similarity]
src/testutils/tests/refdata_tests.cpp
src/testutils/tests/xvgtest_tests.cpp
src/testutils/testutils-doc.h
src/testutils/xvgtest.cpp
tests/CMakeLists.txt
tests/CheckTarget.cmake [new file with mode: 0644]
tests/CppCheck.cmake

index de7013116b04b74de97238ccaa265e685ab7ecd3..61c7f7095cc8d1df429891592daee6cb41a26d40 100644 (file)
@@ -36,7 +36,6 @@ docs/manual/UseLATEX.cmake              !filter
 scripts/GMXRC.*                         !filter
 scripts/make_gromos_rtp.py              !filter
 share/template/README.cmakein           !filter
-share/template/template.cpp             filter=copyright
 src/contrib/*                           -filter -gmx-doxygen
 src/gromacs/gmxlib/nonbonded/preprocessor/gmxpreprocess.py !filter
 src/gromacs/linearalgebra/gmx_blas/*    !filter
index 42b80429af71f94372e2aea5b5ebc5adf5f87a32..bb634343502202bcf0537014b023247afa84f9bb 100644 (file)
@@ -2,16 +2,26 @@
 /lib
 *~
 #*
-*.pyc
-*.o
 *.a
+*.cache
+*.DS_Store
+*.egg-info
 *.exe
+*.gch
 *.lib
-*.cache
+*.o
+*.pyc
+*.so
+*.swp
+.eggs
+.idea
 Makefile
 lib*.pc
 .project
+.tox
 .cproject
+build
+_build
 CMakeLists.txt.user
 /VersionInfo*.cmake
 Testing
index 52634bf9b89732faafceaaf2399679e3e035bea7..3aa958f4b1eb8bf2fb8918f8d58b9c05e7d059d9 100644 (file)
 # 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_minimum_required(VERSION 2.8.8)
-# When we require cmake >= 2.8.12, it will provide
-# CMAKE_MINIMUM_REQUIRED_VERSION automatically, but in the meantime we
-# need to set a variable, and it must have a different name.
-set(GMX_CMAKE_MINIMUM_REQUIRED_VERSION "2.8.8")
+cmake_minimum_required(VERSION 3.4.3)
 
 # CMake modules/macros are in a subdirectory to keep this file cleaner
 # This needs to be set before project() in order to pick up toolchain files
@@ -70,11 +66,10 @@ include(gmxBuildTypeMSAN)
 include(gmxBuildTypeReleaseWithAssert)
 
 if(NOT CMAKE_BUILD_TYPE)
-    set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel Reference RelWithAssert Profile." FORCE)
-    # There's no need to offer a user the choice of ThreadSanitizer
+    set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel Reference RelWithAssert Profile TSAN ASAN MSAN." FORCE)
     # Set the possible values of build type for cmake-gui
     set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
-        "MinSizeRel" "RelWithDebInfo" "Reference" "RelWithAssert" "Profile")
+        "MinSizeRel" "RelWithDebInfo" "Reference" "RelWithAssert" "Profile" "TSAN" "ASAN" "MSAN")
 endif()
 if(CMAKE_CONFIGURATION_TYPES)
     # Add appropriate GROMACS-specific build types for the Visual
@@ -90,14 +85,8 @@ set(build_types_with_explicit_flags RELEASE DEBUG RELWITHDEBINFO RELWITHASSERT M
 
 set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON)
 
-# Set a default valgrind suppression file.
-# This unfortunately needs to duplicate information from CTest to work as
-# expected...
-set(MEMORYCHECK_SUPPRESSIONS_FILE
-    "${CMAKE_SOURCE_DIR}/cmake/legacy_and_external.supp"
-    CACHE FILEPATH
-    "File that contains suppressions for the memory checker")
-include(CTest)
+include(gmxCTestUtilities)
+gmx_ctest_init()
 
 include(gmxCPackUtilities)
 gmx_cpack_init()
@@ -106,6 +95,21 @@ gmx_cpack_init()
 set(INSTALLED_HEADER_INCLUDE_DIRS "")
 set(INSTALLED_HEADER_DEFINITIONS "")
 
+########################################################################
+# Global non-cache variables for implementing the build system
+########################################################################
+
+# These variables collect libraries that GROMACS requires for
+# linking. They should be appended to with list(APPEND ${name}
+# new-library) calls. They are:
+#  - Libraries that are required for libgromacs (only)
+set(GMX_EXTRA_LIBRARIES "")
+#  - Libraries that are required for all code in the repository
+set(GMX_COMMON_LIBRARIES "")
+#  - Libraries that all code linked against libgromacs needs
+#    (i.e., something that is exposed in installed headers).
+set(GMX_PUBLIC_LIBRARIES "")
+
 ########################################################################
 # Check and warn if cache generated on a different host is being reused
 ########################################################################
@@ -197,12 +201,16 @@ gmx_add_cache_dependency(GMX_COOL_QUOTES BOOL "NOT GMX_FAHCORE" OFF)
 
 option(GMX_USE_OPENCL "Enable OpenCL acceleration" OFF)
 
-# Decide on GPU settings based on user-settings and GPU/CUDA detection.
-# GCC 4.6 requires CUDA 5.0 and VS2015 requires CUDA 8.0
+# Decide on GPU settings based on user-settings and GPU/CUDA
+# detection.  GCC 4.8 requires CUDA 6.0 (but we choose 6.5 for the
+# preliminary C++11 support), icc 15 requires CUDA 7.0, and VS2015
+# requires CUDA 8.0
 if(MSVC)
     set(REQUIRED_CUDA_VERSION 8.0)
+elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
+    set(REQUIRED_CUDA_VERSION 7.0)
 else()
-    set(REQUIRED_CUDA_VERSION 5.0)
+    set(REQUIRED_CUDA_VERSION 6.5)
 endif()
 set(REQUIRED_CUDA_COMPUTE_CAPABILITY 2.0)
 
@@ -228,14 +236,11 @@ else()
     endif()
 endif()
 
-include(gmxDetectSimd)
-gmx_detect_simd(GMX_SUGGESTED_SIMD)
-
 gmx_option_multichoice(
     GMX_SIMD
     "SIMD instruction set for CPU kernels and compiler optimization"
-    "${GMX_SUGGESTED_SIMD}"
-    None SSE2 SSE4.1 AVX_128_FMA AVX_256 AVX2_256 AVX_512 AVX_512_KNL MIC ARM_NEON ARM_NEON_ASIMD IBM_QPX IBM_VMX IBM_VSX Sparc64_HPC_ACE Reference)
+    "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)
 
 if(GMX_TARGET_MIC)
     set(GMX_FFT_LIBRARY_DEFAULT "mkl")
@@ -339,17 +344,6 @@ set(EXTRA_CXX_FLAGS "")
 # Run through a number of tests for buggy compilers and other issues
 include(gmxTestCompilerProblems)
 gmx_test_compiler_problems()
-# GMX_SIMD will not be set automatically until the second
-# pass (which is not strictly guaranteed to occur), so putting this
-# check here among logically-related tests is inefficient, but the
-# potential loss is likely zero.
-if(GMX_SIMD STREQUAL "AVX_256"
-        AND CMAKE_COMPILER_IS_GNUCC
-        AND (C_COMPILER_VERSION VERSION_EQUAL "4.6.1"
-            OR CXX_COMPILER_VERSION VERSION_EQUAL "4.6.1"))
-    message(FATAL_ERROR "gcc 4.6.1 has buggy support for AVX, and GROMACS mdrun will not work. If you want simulation performance, use a more recent compiler. Otherwise, use GMX_SIMD=SSE4.1")
-    # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49002
-endif()
 
 # Implement double-precision option. This is complicated because we
 # need installed headers to use the precision mode of the build that
@@ -469,11 +463,6 @@ include(gmxManageSharedLibraries)
 # Find external packages                                               #
 ########################################################################
 
-# TNG wants zlib if it is available. And static libxml2 might have a dependency
-find_package(ZLIB QUIET)
-include(gmxTestZLib)
-gmx_test_zlib(HAVE_ZLIB)
-
 # Unconditionally find the package, as it is also required for unit
 # tests. This exports LIBXML2_FOUND, which we should not use because
 # it does not tell us that linking will succeed. Instead, we test that
@@ -519,7 +508,7 @@ endif()
 option(GMX_HWLOC "Add support for hwloc Portable Hardware locality library" ${GMX_HWLOC_DEFAULT})
 if(GMX_HWLOC)
     if(HWLOC_FOUND)
-        include_directories(${HWLOC_INCLUDE_DIRS})
+        include_directories(SYSTEM ${HWLOC_INCLUDE_DIRS})
         list(APPEND GMX_EXTRA_LIBRARIES ${HWLOC_LIBRARIES})
     else()
         message(FATAL_ERROR "Hwloc package support requested, but not found.")
@@ -578,7 +567,6 @@ if (TMPI_ATOMICS_DISABLED)
    add_definitions(-DTMPI_ATOMICS_DISABLED)
 endif()
 
-# Note this relies on zlib detection having already run
 include(gmxManageTNG)
 
 include(gmxManageLmfit)
@@ -586,8 +574,6 @@ include(gmxManageLmfit)
 if(GMX_GPU)
     # now that we have detected the dependencies, do the second configure pass
     gmx_gpu_setup()
-else()
-    mark_as_advanced(CUDA_HOST_COMPILER)
 endif()
 
 if(CYGWIN)
@@ -620,7 +606,9 @@ gmx_add_cache_dependency(GMX_BUILD_UNITTESTS BOOL BUILD_TESTING OFF)
 
 add_definitions( -DHAVE_CONFIG_H )
 include_directories(BEFORE ${CMAKE_SOURCE_DIR}/src)
-include_directories(BEFORE ${CMAKE_SOURCE_DIR}/src/external/thread_mpi/include)
+# TODO required at high level because both libgromacs and progs/mdrun
+# require it, both for thread-MPI and its atomics and mutexes.
+include_directories(BEFORE SYSTEM ${CMAKE_SOURCE_DIR}/src/external/thread_mpi/include)
 # Required for config.h, maybe should only be set in src/CMakeLists.txt
 include_directories(BEFORE ${CMAKE_BINARY_DIR}/src)
 
@@ -629,24 +617,50 @@ gmx_test_inline_asm_gcc_x86(GMX_X86_GCC_INLINE_ASM)
 
 include(gmxSetBuildInformation)
 gmx_set_build_information()
-# Turn on RDTSCP if:
-# - the build system's CPU supports it
-# - the acceleration is set to AVX as all AVX-capable CPUs support AVX (which
-#   at this point means that the user set it).
-# Note: it's better to not use the later set value of GMX_SIMD because
-# it reflects the system's capability of both compiling and running AVX code.
-# TODO: After merge with 5.0 one could implement a cache variable dependency
-# such that GMX_USE_RDTSCP can change if GMX_SIMD is changed to AVX
-# after the first cmake pass.
-if (BUILD_CPU_FEATURES MATCHES "rdtscp" OR GMX_SIMD MATCHES "AVX")
-    set(GMX_USE_RDTSCP_DEFAULT_VALUE ON)
-else()
-    set(GMX_USE_RDTSCP_DEFAULT_VALUE OFF)
-endif()
-option(GMX_USE_RDTSCP "Use RDTSCP for better CPU-based timers (available on recent x86 CPUs; might need to be off when compiling for heterogeneous environments)" ${GMX_USE_RDTSCP_DEFAULT_VALUE})
+
+gmx_option_multichoice(
+    GMX_USE_RDTSCP
+    "Use low-latency RDTSCP instruction for CPU-based timers for mdrun execution; might need to be off when compiling for heterogeneous environments)"
+    "AUTO"
+    OFF ON AUTO DETECT)
 mark_as_advanced(GMX_USE_RDTSCP)
-if(GMX_USE_RDTSCP)
+
+macro(gmx_check_rdtscp)
+    if (CPU_DETECTION_FEATURES MATCHES "rdtscp")
+        set(HAVE_RDTSCP 1)
+        set(RDTSCP_DETECTION_MESSAGE " - detected on the build host")
+    else()
+        set(RDTSCP_DETECTION_MESSAGE " - not detected on the build host")
+    endif()
+endmacro()
+
+set(HAVE_RDTSCP 0)
+if (GMX_USE_RDTSCP STREQUAL "ON")
     set(HAVE_RDTSCP 1)
+elseif(GMX_USE_RDTSCP STREQUAL "DETECT")
+    gmx_check_rdtscp()
+elseif(GMX_USE_RDTSCP STREQUAL "AUTO")
+    # If the user specified automated SIMD selection, that the choice
+    # is made based on detection on the build host. If so, then RDTSCP
+    # should be chosen the same way.
+    #
+    # If the user specified an AVX SIMD level (e.g. when
+    # cross-compiling GROMACS) then they will get our best guess, ie
+    # that in practice AVX mostly correlates with rdtscp (and anyway
+    # is only relevant in rather old x86 hardware).
+    if (GMX_SIMD STREQUAL "AUTO")
+        gmx_check_rdtscp()
+    elseif (GMX_SIMD MATCHES "AVX")
+        set(HAVE_RDTSCP 1)
+    endif()
+endif()
+gmx_check_if_changed(HAVE_RDTSCP_CHANGED HAVE_RDTSCP)
+if (HAVE_RDTSCP_CHANGED)
+    if (HAVE_RDTSCP)
+        message(STATUS "Enabling RDTSCP support${RDTSCP_DETECTION_MESSAGE}")
+    else()
+        message(STATUS "Disabling RDTSCP support${RDTSCP_DETECTION_MESSAGE}")
+    endif()
 endif()
 
 include(gmxTestLargeFiles)
@@ -720,8 +734,8 @@ if(HAVE_TIME_H AND HAVE_UNISTD_H AND HAVE_CLOCK_GETTIME)
 endif()
 
 # Math and thread libraries must often come after all others when linking...
-if(HAVE_LIBM)
-    list(APPEND GMX_EXTRA_LIBRARIES m)
+if (HAVE_LIBM)
+    list(APPEND GMX_PUBLIC_LIBRARIES m)
 endif()
 
 option(GMX_NACL "Configure for Native Client builds" OFF)
@@ -771,7 +785,7 @@ else()
     message("CMAKE_CXX_FLAGS_RELEASE: ${GMXC_CXXFLAGS_RELEASE}")
     message("CMAKE_CXX_FLAGS_DEBUG: ${GMXC_CXXFLAGS_DEBUG}")
     message("CMAKE_EXE_LINKER_FLAGS: ${FFT_LINKER_FLAGS} ${MPI_LINKER_FLAGS}")
-    message("CMAKE_SHARED_LINKER_FLAGS: ${MPI_LINKER_FLAGS}")
+    message("CMAKE_SHARED_LINKER_FLAGS: ${FFT_LINKER_FLAGS} ${MPI_LINKER_FLAGS}")
 endif()
 
 if(NOT GMX_OPENMP)
@@ -821,17 +835,12 @@ include(gmxManageSuffixes)
 ################################################################
 # Shared library load path settings
 ################################################################
-# CMake supports RPATH on OS X only from 2.8.12 upwards.
-# CMAKE_SYSTEM_VERSION > 8.0 matches OS X 10.5 and above, where RPATH support
-# was added.
-
 if(NOT GMX_BUILD_SHARED_EXE)
     # No rpath
     set(CMAKE_SKIP_RPATH TRUE)
     set(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS) # remove -Wl,-Bdynamic
     set(CMAKE_EXE_LINK_DYNAMIC_CXX_FLAGS)
-elseif((NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin") OR
-   ((CMAKE_SYSTEM_VERSION VERSION_GREATER 8.0) AND (NOT CMAKE_VERSION VERSION_LESS 2.8.12)))
+else()
     # The build folder always has bin/ and lib/; if we are also going to
     # install to lib/, then the installation RPATH works also in the build
     # tree.  This makes installation slightly faster (no need to rewrite the
@@ -841,23 +850,13 @@ elseif((NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin") OR
     endif()
     # Set the RPATH as relative to the executable location to make the
     # binaries relocatable.
-    if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+    if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin") #Assume OS X >=10.5
         set(CMAKE_INSTALL_RPATH "\$ORIGIN/../${GMX_LIB_INSTALL_DIR}")
     else()
         set(CMAKE_INSTALL_RPATH "@executable_path/../${GMX_LIB_INSTALL_DIR}")
     endif()
     set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
     set(CMAKE_MACOSX_RPATH 1)
-else()
-    # We are on Darwin/OSX, and CMake cannot handle RPATHs automatically.
-    if(CMAKE_SYSTEM_VERSION VERSION_GREATER 8.0)
-        # Set the RPATH options manually.
-        set(CMAKE_INSTALL_NAME_DIR "@rpath")
-        set(GMX_EXE_LINKER_FLAGS ${GMX_EXE_LINKER_FLAGS} "-Wl,-rpath,@executable_path/../${GMX_LIB_INSTALL_DIR}")
-    else()
-        # Use the old INSTALL_NAME_DIR mechanism if RPATH is not supported.
-        set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}")
-    endif()
 endif()
 
 #COPYING file: Only necessary for binary distributions.
@@ -874,18 +873,7 @@ if (GMX_BUILD_FOR_COVERAGE)
 endif()
 
 if (BUILD_TESTING)
-    # "tests" target builds all the separate test binaries.
-    add_custom_target(tests)
-    # "run-ctest" is an internal target that actually runs the tests.
-    # This is necessary to be able to add separate targets that execute as part
-    # of 'make check', but are ensured to be executed after the actual tests.
-    add_custom_target(run-ctest
-                      COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure
-                      COMMENT "Running all tests"
-                      VERBATIM)
-    add_dependencies(run-ctest tests)
-    # "check" target builds and runs all tests.
-    add_custom_target(check DEPENDS run-ctest)
+    include(tests/CheckTarget.cmake)
 endif()
 
 if (NOT GMX_BUILD_MDRUN_ONLY)
diff --git a/INSTALL-dev b/INSTALL-dev
new file mode 100644 (file)
index 0000000..b6e0836
--- /dev/null
@@ -0,0 +1,16 @@
+The GROMACS developers generally suggest you install GROMACS for
+production scientific use only from a tarball from an official
+source-code release.
+
+However, if you have a special need and wish to build and/or install a
+version from a git repository, please see
+docs/install-guide/index.rst in this repository, or (if applicable)
+the latest master branch documentation found via
+http://manual.gromacs.org/documentation/.
+
+Note for GROMACS developers
+---------------------------
+This file is excluded from the GROMACS source packages made with CPack,
+and not included into binary packages made with CPack. Source packages
+do include an INSTALL file containing the installation instructions, which
+has been compiled into plain text by Sphinx from docs/install-guide.
index 1031bf78c7123357c7b94e86c17a58544c401a29..1b556ad8ef004c593e1ff5345227a0a5d2162c1c 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,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.
@@ -32,7 +32,9 @@
 # To help us fund GROMACS development, we humbly ask that you cite
 # the research papers on the package. Check out http://www.gromacs.org.
 
-build_options = ['clang-3.8', 'clang-static-analyzer-3.8']
+# These options need to match Jenkins labels on the slave where the
+# analysis is intended to run.
+build_options = ['clang-4', 'clang-static-analyzer-4']
 
 def do_build(context):
     cmake_opts = {
@@ -42,6 +44,7 @@ def do_build(context):
             'GMX_GPU': 'OFF',
             'GMX_OPENMP': 'OFF',
             'GMX_SIMD': 'None',
+            'GMX_USE_RDTSCP': 'OFF',
             'GMX_FFT_LIBRARY': 'fftpack'
         }
 
index 022aafdf96e028449852f2bf5dd72302c09d99f0..4ca7f9357232291fc4accaa0a5e085fa0bc94403 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,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.
@@ -34,7 +34,7 @@
 
 import os.path
 
-build_options = ['gcc-4.6']
+build_options = ['gcc-6', 'gcov-6']
 extra_projects = [Project.REGRESSIONTESTS]
 
 def do_build(context):
@@ -47,6 +47,7 @@ def do_build(context):
     # Ideally, this would be Reference, but running the regression tests is way
     # too slow that way (and also with None)...
     cmake_opts['GMX_SIMD'] = 'SSE4.1'
+    cmake_opts['GMX_USE_RDTSCP'] = 'DETECT'
 
     context.env.set_env_var('GMX_NO_TERM', '1')
 
index 85711e98b1e86b6db5eabda9ffe616a4629daf10..91415e3c469ade5b2473ca43667cd5959ce52851 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,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.
@@ -36,9 +36,10 @@ def do_build(context):
     # TODO: Make the XMLs go directly to the desired folder.
     # xml_dir = context.workspace.get_log_dir(category='cppcheck')
     cmake_opts = {
-            'CPPCHECK_EXECUTABLE': context.env.get_cppcheck_command(version='1.72'),
+            'CPPCHECK_EXECUTABLE': context.env.get_cppcheck_command(version='1.76.1'),
             'CPPCHECK_XML_OUTPUT': 'ON',
-            'GMX_SIMD': 'Reference'
+            'GMX_SIMD': 'Reference',
+            'GMX_USE_RDTSCP': 'OFF'
         }
 
     context.run_cmake(cmake_opts)
index 5511aeb646f6eb243e0ea3dd1201479856414292..2ec2c049f0d7acbdc7e322e8982112cc6f2ed6b5 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,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.
@@ -49,7 +49,8 @@ def do_build(context):
             'CMAKE_BUILD_TYPE': 'Debug',
             'GMX_GPU': 'OFF',
             'GMX_OPENMP': 'OFF',
-            'GMX_SIMD': 'None'
+            'GMX_SIMD': 'None',
+            'GMX_USE_RDTSCP': 'OFF'
         }
     release = (context.job_type == JobType.RELEASE)
     if release:
index ceefaf9c46be5c6528303a3aaebfd4db3ebd5cf1..0e2a2ec9bae387d9ade260142e6a12e2a0ef9af5 100644 (file)
@@ -62,6 +62,7 @@ def do_build(context):
     cmake_opts['GMX_COMPILER_WARNINGS'] = 'ON'
     cmake_opts['GMX_DEFAULT_SUFFIX'] = 'OFF'
     cmake_opts['CMAKE_BUILD_TYPE'] = 'Debug'
+    cmake_opts['GMX_USE_RDTSCP'] = 'DETECT'
 
     if context.opts.reference:
         cmake_opts['CMAKE_BUILD_TYPE'] = 'Reference'
@@ -116,6 +117,12 @@ def do_build(context):
     if context.opts.x11:
         cmake_opts['GMX_X11'] = 'ON'
 
+    # At least hwloc on Jenkins produces a massive amount of reports about
+    # memory leaks, which cannot be reasonably suppressed because ASAN cannot
+    # produce a reasonable stack trace for them.
+    if context.opts.asan:
+        cmake_opts['GMX_HWLOC'] = 'OFF'
+
     regressiontests_path = context.workspace.get_project_dir(Project.REGRESSIONTESTS)
 
     if context.job_type == JobType.RELEASE:
@@ -159,7 +166,7 @@ def do_build(context):
     else:
         context.build_target(target='tests', keep_going=True)
 
-        context.run_ctest(args=['--output-on-failure'])
+        context.run_ctest(args=['--output-on-failure'], memcheck=context.opts.asan)
 
         context.build_target(target='install')
         # TODO: Consider what could be tested about the installed binaries.
@@ -171,8 +178,6 @@ def do_build(context):
             use_tmpi = not context.opts.mpi and context.opts.thread_mpi is not False
 
             cmd = 'perl gmxtest.pl -mpirun mpirun -xml -nosuffix all'
-            if context.opts.asan:
-                cmd+=' -parse asan_symbolize.py'
 
             # setting this stuff below is just a temporary solution,
             # it should all be passed as a proper the runconf from outside
@@ -201,4 +206,6 @@ def do_build(context):
                 cmd += ' -nt ' + nranks
             if context.opts.double:
                 cmd += ' -double'
+            if context.opts.asan:
+                context.env.set_env_var('ASAN_OPTIONS', 'detect_leaks=0')
             context.run_cmd(cmd, shell=True, failure_message='Regression tests failed to execute')
index fc2f6a19afe03b73a63b8949e3eb80530250dfbc..5170412addee08b2789882b25099ab35eefd4b5b 100644 (file)
@@ -9,13 +9,21 @@
 # configuration syntax, so that the configurations are stable even
 # if the defaults change in future.
 
+# Test on ARM v7
+# Test ARM_NEON SIMD
+gcc-4.8 simd=ARM_NEON release
+
+# Test on ARM v8
+# Test ARM_NEON_ASIMD SIMD
+gcc-5 simd=ARM_NEON_ASIMD release
+
 # Test the mdrun-only build
 # TODO In combination with gmx from another build, arrange to run regressiontests
 clang-3.7 double mpi no-openmp fftpack mdrun-only
 
 # Test MPMD PME with thread-MPI
 # TODO Add double to this configuration if/when we stablize the essentialdynamics tests
-gcc-5 npme=1 nranks=2 no-openmp fftpack simd=avx_128_fma release
+gcc-7 npme=1 nranks=2 no-openmp fftpack release
 
 # Test non-default GMX_PREFER_STATIC_LIBS behavior
 # TODO enable this
@@ -27,10 +35,13 @@ gcc-5 npme=1 nranks=2 no-openmp fftpack simd=avx_128_fma release
 
 # Test SSE4.1 SIMD
 # Test single-rank GPU
-gcc-4.8 nranks=1 gpu cuda-7.5 simd=sse4.1
+# TODO Test clang + OpenMP + CUDA
+# TODO change to clang-4 and cuda-8.0
+gcc-4.8 openmp nranks=1 gpu cuda-7.5 simd=sse4.1
 
 # Test MPMD PME with library MPI
-clang-3.4 npme=1 nranks=2 mpi
+# Test clang + OpenMP
+clang-4 openmp simd=avx_128_fma npme=1 nranks=2 mpi
 
 # Test non-default use of mdrun -gpu_id
 # Test SSE2 SIMD
@@ -46,4 +57,3 @@ gcc-4.8 gpu npme=1 nranks=2 gpu_id=2 cuda-7.5 simd=sse2 release
 # Test own-fftw build (from local copy of the file)
 # Test mdrun -tunepme (e.g. with relaxed tolerances, for now)
 # Consider testing of other CMake option paths
-# Consider adding our ARM dev boards as slaves to improve cross-platform portability testing.
index 06b3aa696cbce328bfeb2ce730494292550de38a..9960a318dfd6ea0ee85fff03945365b56de815e3 100644 (file)
@@ -8,39 +8,51 @@
 # once, and for the intent to be reflected precisely in the
 # configuration syntax, so that the configurations are stable even
 # if the defaults change in future.
+#
+# The phrase "at time of release" refers to either the initial
+# GROMACS release from that branch, or the next expected release
+# from that branch. (We will tend not to retroactively support
+# newer infrastructure in CI, unless it's either easy or of
+# high impact.)
 
 # Test older gcc
 # Test oldest supported CUDA
-# Test oldest supported cmake
 # Test oldest supported Ubuntu
-# Test X11 build
 # Test MPI with CUDA
 # Test MPMD PME with library MPI
-gcc-4.6 gpu cuda-5.0 mpi npme=1 nranks=2 openmp x11 cmake-2.8.8
-
-# Test newest gcc supported by newest CUDA shortly after the release
-# Test SIMD implementation of pair search for GPU code-path
-gcc-5 gpu cuda-8.0 openmp simd=avx2_256
+# Test cmake FindCUDA functionality introduced in 3.8
+gcc-4.8 gpu cuda-6.5 cmake-3.8.1 mpi npme=1 nranks=2 openmp
 
 # Test newest gcc supported by newest CUDA at time of release
 # Test thread-MPI with CUDA
-gcc-4.8 gpu thread-mpi cuda-7.5 openmp release
+# Test cmake version from before new FindCUDA support (in 3.8)
+# Test SIMD implementation of pair search for GPU code-path
+gcc-5 gpu cuda-8.0 thread-mpi openmp cmake-3.6.1 release simd=avx2_256
 
-# Test with ThreadSanitizer
-# Test AVX2_256 SIMD
+# Test with ThreadSanitizer (compiled without OpenMP, even though
+#   this gcc was configured with --disable-linux-futex, because
+#   Redmine #1850 is unresolved, which causes more suspected
+#   false positives than races detected)
 # Test fftpack fallback
-gcc-4.9 tsan fftpack simd=avx2_256
+gcc-7 tsan no-openmp fftpack
 
 # Test newest gcc at time of release
+gcc-7 mpi
+
 # Test on MacOS (because gcc-6 is only available there)
-gcc-6 double
+# Test X11 build
+gcc-6 double x11
 
+# Test oldest supported cmake
 # Test older clang
 # Test double precision
-# Test with AddressSanitizer
 # Test without OpenMP
 # Test thread-MPI
-clang-3.4 double thread-mpi no-openmp fftpack asan
+clang-3.4 double thread-mpi no-openmp fftpack cmake-3.4.3
+
+# Test newest clang at time of release
+# Test with AddressSanitizer (without OpenMP, see below)
+clang-4 no-openmp asan
 
 # Test oldest supported MSVC on Windows
 # Test newest supported MSVC on Windows
@@ -54,19 +66,20 @@ icc-16.0 msvc-2015 fftpack
 # Test MKL
 # Test without any MPI
 # Test on CentOS (because icc-16.0 is only available there)
-icc-16.0 no-thread-mpi openmp mkl cmake-3.3.2 simd=avx_256
-
-# Test AVX_128_FMA SIMD
-gcc-5 mpi openmp simd=avx_128_fma
+icc-16.0 no-thread-mpi openmp mkl cmake-3.8.1 simd=avx_256
 
 # Test NVIDIA OpenCL
 # Test MPI + OpenCL
-gcc-4.8 openmp opencl cuda-7.5 mpi release
+# Test AVX2_256 SIMD
+gcc-4.8 openmp opencl cuda-7.5 mpi release simd=avx2_256
 
 # Test AMD OpenCL
-gcc-5 openmp opencl amdappsdk-3.0
+# Test AVX_128_FMA SIMD
+gcc-5 openmp simd=avx_128_fma opencl amdappsdk-3.0
 
 # TODO
+# Add OpenMP support to ASAN build (but libomp.so in clang-4 reports leaks, so might need a suitable build or suppression)
 # Test hwloc support
-# Test newest supported Ubuntu
-# Migrate ThreadSanitizer test off GPU build slave
+# Test newest supported LTS Ubuntu
+# Update gpu testing specifiers per https://redmine.gromacs.org/issues/2161
+# Resolve Redmine #1850 so that ThreadSanitizer can test our OpenMP code
index 2ee6d955aab90b550345583ac8b2a1f273ce1805..7786d17274820563ba2a79e87b78ce44e8eae820 100644 (file)
@@ -34,8 +34,7 @@
 
 import os.path
 
-# TODO when merging this to master, update gcc to 4.8
-build_options = ['gcc-4.7', 'cmake-3.4.3']
+build_options = ['gcc-4.8', 'cmake-3.4.3']
 extra_projects = [Project.REGRESSIONTESTS]
 
 def run_build(context, cmake_opts):
index ef5faea09b18ebad1480c5e220fb4bfd4f76ce11..d357c0b4e373d7b6a5dadea8726f7e4f8feb5520 100644 (file)
@@ -1,6 +1,6 @@
 # These configurations will be used to build and test the tarballs
 # before the release.
 gcc-4.8 mpi mdrun-only
-gcc-4.6 static
-gcc-4.7 double
+gcc-6 static
+gcc-5 double
 clang-3.4 static double
index 0c3222a22aaa1b22d06ef5c23e6b7efd2afab7ce..6c6322e1f9e1a201c765af8b165ac5248aeaabf1 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,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.
@@ -41,6 +41,7 @@ def do_build(context):
             'GMX_BUILD_HELP': 'ON',
             'CMAKE_BUILD_TYPE': 'Debug',
             'GMX_SIMD': 'None',
+            'GMX_USE_RDTSCP': 'OFF',
             'GMX_THREAD_MPI': 'OFF',
             'GMX_OPENMP': 'OFF',
             'GMX_GPU': 'OFF'
index 6781ad0e8c22504a9fa669256de8f0a3ff51fce1..9e4620f35616c1602ed6c664b74292c739c21ffd 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,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.
index 863ed5431c21360cb63ba6492a34d54a54ef262c..677107a7bfb2f69f382a91867fb864f06d1030f7 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,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.
@@ -121,6 +121,7 @@ if(HWLOC_INCLUDE_DIRS)
     endif()
 endif()
 
+include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(Hwloc
                                   REQUIRED_VARS HWLOC_LIBRARIES HWLOC_INCLUDE_DIRS
                                   VERSION_VAR HWLOC_VERSION)
diff --git a/cmake/TestAVXMaskload.c b/cmake/TestAVXMaskload.c
deleted file mode 100644 (file)
index e8438a1..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#include<immintrin.h>
-int main()
-{
-    __m256d a;
-    __m256i mask;
-    double  d[4]={1,2,3,4};
-
-    a = _mm256_setzero_pd();
-    mask = _mm256_castpd_si256(a);
-
-#if GMX_SIMD_X86_AVX_GCC_MASKLOAD_BUG
-    a = _mm256_maskload_pd(d,_mm256_castsi256_pd(mask));
-#else
-    a = _mm256_maskload_pd(d,mask);
-#endif
-    return 0;
-}
-
diff --git a/cmake/TestClangVersion.c b/cmake/TestClangVersion.c
deleted file mode 100644 (file)
index f47c777..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-int main()
-{
-/* This detects 3.0 versions for both C and C++ clang. It detects the
- * version of the LLVM back end, and not (for example) the Apple clang
- * version number (which might be 4.1 or some number based on its
- * "compatibility with gcc 4.2.1," even though the LLVM back end is
- * 3.0!).
- *
- * If/when we have time or user complaints, we can maybe ban earlier
- * versions of clang, but we don't actually know there's a problem
- * with them at the time of this commit.
- */
-#if (__clang_major__ == 3) && (__clang_minor__ == 0)
-    return 0;
-#else
-#error clang version information not found
-#endif
-}
index a37fc309af041b76fb24627ccf108a56dd2fc7f7..505b1ef0a338729fadaea4bafeb7872c5c368dff 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,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.
@@ -42,9 +42,3 @@ foreach(_language C CXX)
     set(CMAKE_${_language}_FLAGS_ASAN ${_flags} CACHE STRING "${_human_readable_language} flags for address sanitizer")
     mark_as_advanced(CMAKE_${_language}_FLAGS_ASAN)
 endforeach()
-
-string(TOUPPER "${CMAKE_BUILD_TYPE}" _cmake_build_type)
-if (APPLE AND _cmake_build_type STREQUAL ASAN) #https://code.google.com/p/address-sanitizer/issues/detail?id=210
-   set(BUILD_SHARED_LIBS OFF CACHE BOOL "Disabled for ASAN builds" FORCE)
-endif()
-
index 6c33a5fe99d96de2d849085162d85b500bbb7ee6..8116ac7b7f44cafb4b12764ffee92ec2ef5eafe9 100644 (file)
@@ -48,8 +48,8 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Reference")
     set(GMX_SOFTWARE_INVSQRT OFF CACHE BOOL "Disabled for regressiontests reference builds" FORCE)
     set(GMX_THREAD_MPI OFF CACHE BOOL "Disabled for regressiontests reference builds" FORCE)
 
-    if(NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR NOT "${CMAKE_C_COMPILER_VERSION}" MATCHES "4.7")
+    if(NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR NOT "${CMAKE_C_COMPILER_VERSION}" MATCHES "4.8")
         message(WARNING "Reference values for regressiontests should use GROMACS compiled with "
-            "gcc 4.7, but your configuration is using ${CMAKE_C_COMPILER_ID}-${CMAKE_C_COMPILER_VERSION}.")
+            "gcc 4.8, but your configuration is using ${CMAKE_C_COMPILER_ID}-${CMAKE_C_COMPILER_VERSION}.")
     endif()
 endif()
index 550edb88f91bbb5a93eef918f54a12355201ea7b..da60cbef466c65bbb394820c24808a6edd437817 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,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.
@@ -81,7 +81,6 @@ foreach(_language C CXX)
     string(TOUPPER "${CMAKE_BUILD_TYPE}" _cmake_build_type)
     if (_cmake_build_type STREQUAL TSAN)
         set(TMPI_ATOMICS_DISABLED 1)
-        set(TMPI_ATOMICS 0)
         if (NOT((CMAKE_${_language}_COMPILER_ID MATCHES "Clang" AND
                     CMAKE_${_language}_COMPILER_VERSION VERSION_GREATER 3.2.999)
              OR (CMAKE_${_language}_COMPILER_ID MATCHES "GNU" AND
index 2a86ced5fcca1755042b6a22046d339674c90376..a1703625ddea4d33c326143eea12dd998056fad2 100644 (file)
@@ -130,11 +130,15 @@ macro (gmx_c_flags)
             GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "-Wno-unknown-pragmas" GMXC_CXXFLAGS)
         endif()
         if (GMX_COMPILER_WARNINGS)
-            GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-Wall -Wno-unused-function" GMXC_CXXFLAGS)
+            GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-Wall" GMXC_CXXFLAGS)
             # Problematic with CUDA
             # GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EFFCXX "-Wnon-virtual-dtor" GMXC_CXXFLAGS)
-            GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EXTRA "-Wextra -Wno-missing-field-initializers -Wpointer-arith" GMXC_CXXFLAGS)
-            GMX_TEST_CXXFLAG(CXXFLAGS_WARN_UNDEF "-Wundef" GMXC_CXXFLAGS)
+            GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EXTRA "-Wextra -Wno-missing-field-initializers -Wpointer-arith -Wmissing-declarations" GMXC_CXXFLAGS)
+            # CUDA versions prior to 7.5 come with a header (math_functions.h) which uses the _MSC_VER macro
+            # unconditionally, so we don't use -Wundef for earlier CUDA versions.
+            if(NOT(GMX_GPU AND CUDA_VERSION VERSION_LESS "7.5"))
+                GMX_TEST_CXXFLAG(CXXFLAGS_WARN_UNDEF "-Wundef" GMXC_CXXFLAGS)
+            endif()
             GMX_TEST_CFLAG(CXXFLAGS_WARN_REL "-Wno-array-bounds" GMXC_CXXFLAGS_RELEASE_ONLY)
         endif()
         # new in gcc 4.5
@@ -148,28 +152,13 @@ macro (gmx_c_flags)
     if (CMAKE_C_COMPILER_ID MATCHES "Intel")
         if (NOT WIN32)
             if(NOT GMX_OPENMP)
-                if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 13.99.99)
 # 3180: unrecognized OpenMP #pragma
-                    GMX_TEST_CFLAG(CFLAGS_PRAGMA "-wd3180" GMXC_CFLAGS)
-                else()
-# 161: unrecognized #pragma
-                    GMX_TEST_CFLAG(CFLAGS_PRAGMA "-wd161" GMXC_CFLAGS)
-                endif()
+                GMX_TEST_CFLAG(CFLAGS_PRAGMA "-wd3180" GMXC_CFLAGS)
             endif()
             if (GMX_COMPILER_WARNINGS)
-                if(CMAKE_C_COMPILER_VERSION VERSION_LESS 15.00.00)
-# 193: zero used for undefined preprocessing identifier ".."
-                    GMX_TEST_CFLAG(CFLAGS_WARN_OLD -wd193 GMXC_CFLAGS)
-                endif()
 # 177: function/variable ".." was declared but never referenced
-# 271: trailing comma is nonstandard
-# 304: access control not specified ("public" by default)
-# 383: value copied to temporary, reference to temporary used
-# 424: extra ";" ignored
-# 444: destructor for base class ".." is not virtual
-# 522: function ".." redeclared "inline" after being called
+# 411: class defines no constructor to initialize the following (incorrect for struct, initializer list works)
 # 593: variable ".." was set but never used
-# 869: parameter ".." was never referenced
 # 981: operands are evaluated in unspecified order
 #1418: external function definition with no prior declaration
 #1419: external declaration in primary source file
@@ -180,28 +169,20 @@ macro (gmx_c_flags)
 #2547: ".." was specified as both a system and non-system include directory
 #2557: comparison between signed and unsigned operands
 #3280: declaration hides member ".."
-#3346: dynamic exception specifications are deprecated
 #11074: Inlining inhibited by limit max-size(/max-total-size)
 #11076: To get full report use -opt-report=3 -opt-report-phase ipo (shown for previous remark)
-                GMX_TEST_CFLAG(CFLAGS_WARN "-w3 -wd177 -wd271 -wd304 -wd383 -wd424 -wd444 -wd522 -wd593 -wd869 -wd981 -wd1418 -wd1419 -wd1572 -wd1599 -wd2259 -wd2415 -wd2547 -wd2557 -wd3280 -wd3346 -wd11074 -wd11076" GMXC_CFLAGS)
+                GMX_TEST_CFLAG(CFLAGS_WARN "-w3 -wd177 -wd411 -wd593 -wd981 -wd1418 -wd1419 -wd1572 -wd1599 -wd2259 -wd2415 -wd2547 -wd2557 -wd3280 -wd11074 -wd11076" GMXC_CFLAGS)
             endif()
             GMX_TEST_CFLAG(CFLAGS_STDGNU "-std=gnu99" GMXC_CFLAGS)
-            GMX_TEST_CFLAG(CFLAGS_OPT "-ip -funroll-all-loops -alias-const -ansi-alias" GMXC_CFLAGS_RELEASE)
+            GMX_TEST_CFLAG(CFLAGS_OPT "-ip -funroll-all-loops -alias-const -ansi-alias -no-prec-div -fimf-domain-exclusion=14" GMXC_CFLAGS_RELEASE)
             GMX_TEST_CFLAG(CFLAGS_DEBUG "-O0" GMXC_CFLAGS_DEBUG) #icc defaults to -O2 even with -g
             GMX_TEST_CFLAG(CFLAGS_FP_RELASSERT "-fp-model except -fp-model precise" GMXC_CFLAGS_RELWITHASSERT)
         else()
             if(NOT GMX_OPENMP)
-                if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 13.99.99)
-                    GMX_TEST_CFLAG(CFLAGS_PRAGMA "/wd3180" GMXC_CFLAGS)
-                else()
-                    GMX_TEST_CFLAG(CFLAGS_PRAGMA "/wd161" GMXC_CFLAGS)
-                endif()
+                GMX_TEST_CFLAG(CFLAGS_PRAGMA "/wd3180" GMXC_CFLAGS)
             endif()
             if (GMX_COMPILER_WARNINGS)
-                if(CMAKE_C_COMPILER_VERSION VERSION_LESS 15.00.00)
-                    GMX_TEST_CFLAG(CFLAGS_WARN_OLD /wd193 GMXC_CFLAGS)
-                endif()
-                GMX_TEST_CFLAG(CFLAGS_WARN "/W3 /wd177 /wd271 /wd304 /wd383 /wd424 /wd444 /wd522 /wd593 /wd869 /wd981 /wd1418 /wd1419 /wd1572 /wd1599 /wd2259 /wd2415 /wd2547 /wd2557 /wd3280 /wd3346" GMXC_CFLAGS)
+GMX_TEST_CFLAG(CFLAGS_WARN "/W3 /wd177 /wd411 /wd593 /wd981 /wd1418 /wd1419 /wd1572 /wd1599 /wd2259 /wd2415 /wd2547 /wd2557 /wd3280" GMXC_CFLAGS)
             endif()
             GMX_TEST_CFLAG(CFLAGS_OPT "/Qip" GMXC_CFLAGS_RELEASE)
         endif()
@@ -210,38 +191,34 @@ macro (gmx_c_flags)
     if (CMAKE_CXX_COMPILER_ID MATCHES "Intel")
         if (NOT WIN32) 
             if(NOT GMX_OPENMP)
-                if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.99.99)
-                    GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "-wd3180" GMXC_CXXFLAGS)
-                else()
-                    GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "-wd161" GMXC_CXXFLAGS)
-                endif()
+                GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "-wd3180" GMXC_CXXFLAGS)
             endif()
             if (GMX_COMPILER_WARNINGS)
-                if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.00.00)
-                    GMX_TEST_CXXFLAG(CXXFLAGS_WARN_OLD -wd193 GMXC_CXXFLAGS)
+                if (GMX_GPU)
+# Suppress warnings from CUDA headers
+# 7:   unrecognized token
+# 82:  storage class is not first
+# The below are also required for math_functions.h / math_functions.hpp at least until CUDA 8.0-RC
+# 193: zero used for undefined preprocessing identifer
+# 3346:dynamic exception specifiers are deprecated
+                    GMX_TEST_CXXFLAG(CXXFLAGS_WARN_OLD_GPU "-wd7 -wd82 -wd193 -wd3346" GMXC_CXXFLAGS)
                 endif()
 #All but the following warnings are identical for the C-compiler (see above)
-#1782: #pragma once is obsolete
+# 383: value copied to temporary, reference to temporary used
+# 444: destructor for base class ".." is not virtual
 #2282: unrecognized GCC pragma
-                GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-w3 -wd177 -wd271 -wd304 -wd383 -wd424 -wd444 -wd522 -wd593 -wd869 -wd981 -wd1418 -wd1419 -wd1572 -wd1599 -wd2259 -wd2415 -wd2547 -wd2557 -wd3280 -wd3346 -wd11074 -wd11076 -wd1782 -wd2282" GMXC_CXXFLAGS)
+                GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-w3 -wd177 -wd383 -wd411 -wd444 -wd981 -wd1418 -wd1572 -wd1599 -wd2259 -wd3280 -wd11074 -wd11076 -wd2282" GMXC_CXXFLAGS)
             endif()
-            GMX_TEST_CXXFLAG(CXXFLAGS_OPT "-ip -funroll-all-loops -alias-const -ansi-alias" GMXC_CXXFLAGS_RELEASE)
+            GMX_TEST_CXXFLAG(CXXFLAGS_OPT "-ip -funroll-all-loops -alias-const -ansi-alias -no-prec-div -fimf-domain-exclusion=14" GMXC_CXXFLAGS_RELEASE)
             GMX_TEST_CXXFLAG(CXXFLAGS_DEBUG "-O0" GMXC_CXXFLAGS_DEBUG)
             GMX_TEST_CXXFLAG(CXXFLAGS_FP_RELASSERT "-fp-model except -fp-model precise" GMXC_CXXFLAGS_RELWITHASSERT)
         else()
             if(NOT GMX_OPENMP)
-                if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.99.99)
-                    GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "/wd3180" GMXC_CFLAGS)
-                else()
-                    GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "/wd161" GMXC_CXXFLAGS)
-                endif()
+                GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "/wd3180" GMXC_CFLAGS)
             endif()
             if (GMX_COMPILER_WARNINGS)
-                if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.00.00)
-                    GMX_TEST_CXXFLAG(CXXFLAGS_WARN_OLD /wd193 GMXC_CXXFLAGS)
-                endif()
 #809: exception specification for virtual function X is incompatible with that of overridden function
-                GMX_TEST_CXXFLAG(CXXFLAGS_WARN "/W3 /wd177 /wd271 /wd304 /wd383 /wd424 /wd444 /wd522 /wd593 /wd809 /wd869 /wd981 /wd1418 /wd1419 /wd1572 /wd1599 /wd2259 /wd2415 /wd2547 /wd2557 /wd3280 /wd3346 /wd1782 /wd2282" GMXC_CXXFLAGS)
+                GMX_TEST_CXXFLAG(CXXFLAGS_WARN "/W3 /wd177 /wd383 /wd411 /wd444 /wd809 /wd981 /wd1418 /wd1572 /wd1599 /wd2259 /wd3280 /wd11074 /wd11076 /wd2282" GMXC_CXXFLAGS)
             endif()
             GMX_TEST_CXXFLAG(CXXFLAGS_OPT "/Qip" GMXC_CXXFLAGS_RELEASE)
         endif()
@@ -335,8 +312,8 @@ macro (gmx_c_flags)
             GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "-Wno-unknown-pragmas" GMXC_CXXFLAGS)
         endif()
         if (GMX_COMPILER_WARNINGS)
-            GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-Wall -Wno-unused-function" GMXC_CXXFLAGS)
-            GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EXTRA "-Wextra -Wno-missing-field-initializers -Wpointer-arith" GMXC_CXXFLAGS)
+            GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-Wall" GMXC_CXXFLAGS)
+            GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EXTRA "-Wextra -Wno-missing-field-initializers -Wpointer-arith -Wmissing-prototypes" GMXC_CXXFLAGS)
             GMX_TEST_CXXFLAG(CXXFLAGS_DEPRECATED "-Wdeprecated" GMXC_CXXFLAGS)
         endif()
     endif()
index 5e80714cd9d25ff5f21cd9bc222a42efc86e32d5..7867998a8a68c61587fbbc023adfee54e7baa9a4 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,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.
@@ -119,7 +119,7 @@ function (gmx_cpack_write_config)
     set(CPACK_SOURCE_GENERATOR TGZ)
     set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
     set(CPACK_SOURCE_IGNORE_FILES
-        "\\\\.isreposource$;\\\\.git/;\\\\.gitignore$;\\\\.gitattributes;")
+        "\\\\.isreposource$;\\\\.git/;\\\\.gitignore$;\\\\.gitattributes;INSTALL-dev;")
     # Get the list of directories added with gmx_cpack_add_generated_source_directory()
     get_property(CPACK_SOURCE_INSTALLED_DIRECTORIES
         GLOBAL PROPERTY GMX_CPACK_SOURCE_INSTALLED_DIRECTORIES)
diff --git a/cmake/gmxCTestUtilities.cmake b/cmake/gmxCTestUtilities.cmake
new file mode 100644 (file)
index 0000000..89715f9
--- /dev/null
@@ -0,0 +1,75 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 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.
+
+# Helper macros to encapsulate some usage of CTest
+#
+# This file is intended to contain CTest workarounds and such.
+include(CMakeParseArguments)
+
+macro (gmx_ctest_init)
+    # Set a default valgrind suppression file.
+    # This unfortunately needs to duplicate information from CTest to work as
+    # expected...
+    #set(MEMORYCHECK_SUPPRESSIONS_FILE
+    #    "${CMAKE_SOURCE_DIR}/cmake/legacy_and_external.supp"
+    #    CACHE FILEPATH
+    #    "File that contains suppressions for the memory checker")
+    string(TOUPPER "${CMAKE_BUILD_TYPE}" _cmake_build_type)
+    if (_cmake_build_type STREQUAL "ASAN")
+        set(MEMORYCHECK_TYPE "AddressSanitizer")
+    endif()
+    include(CTest)
+    # At least with CMake 3.4.1 on OS X, AddressSanitizer support in CTest
+    # does not work without this...
+    set(_ctest_config_file "${PROJECT_BINARY_DIR}/DartConfiguration.tcl")
+    file(STRINGS ${_ctest_config_file} _existing REGEX "^CMakeCommand: ")
+    if (NOT _existing)
+        file(APPEND ${_ctest_config_file} "\nCMakeCommand: ${CMAKE_COMMAND}\n")
+    endif()
+endmacro()
+
+function (gmx_get_test_prefix_cmd VAR)
+    set(_options IGNORE_LEAKS)
+    cmake_parse_arguments(ARG "${_options}" "" "" ${ARGN})
+    set(_opts "")
+    if (ARG_IGNORE_LEAKS OR APPLE)
+        list(APPEND _opts "detect_leaks=0")
+    endif()
+    set(_cmd "")
+    if (MEMORYCHECK_TYPE STREQUAL "AddressSanitizer")
+        string(REPLACE ";" " " _opts "${_opts}")
+        set(_cmd ${PROJECT_SOURCE_DIR}/cmake/with_asan_opts.sh ${_opts} --)
+    endif()
+    set(${VAR} "${_cmd}" PARENT_SCOPE)
+endfunction()
index ae3279a8317d9e5a9d8048d0356adde3589fd2b4..082c3eec80d300f0c45f142b89779801b6129e3c 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,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.
@@ -90,10 +90,6 @@ endfunction()
 
 # More flexible alternative to add_custom_command() and add_custom_target()
 # for dependent custom commands.  It adds a few convenience features:
-#   - Support for custom commands that always run (like add_custom_target()),
-#     but still have the ability to act as dependencies of other custom
-#     commands (such that the dependent commands run only if the output
-#     has been updated) also for Ninja.
 #   - Adds file-level dependencies between custom targets added with this
 #     command such that if there is a target-level dependency, it also implies
 #     that the custom command should always be run if the output file of the
@@ -110,16 +106,13 @@ endfunction()
 #                                [WORKING_DIRECTORY <dir>]
 #                                [DEPENDS <deps...>]
 #                                [DEPENDS_FILE_LIST <list>]
-#                                [COMMENT <comment>])
+#                                [COMMENT <comment>] [USES_TERMINAL])
 #
 #   <target>
 #     - Name of the custom target to create.
 #   RUN_ALWAYS
-#     - Create the command such that it always runs.
-#       This takes care of differences between the Ninja generator and others,
-#       which require different rules to make this happen such that
-#       dependencies on the output of the target work correctly, also in the
-#       case the command does not always update the timestamp of the output.
+#     - Create the command such that it always runs, and may update the output
+#       file in the process.
 #       The dependencies listed with DEPENDS are ignored in this case.
 #   ADD_FAST_TARGET
 #     - In addition to creating <target>, create a secondary target
@@ -143,6 +136,8 @@ endfunction()
 #     - Passed to add_custom_command()/add_custom_target()
 #   COMMENT
 #     - Passed to add_custom_command()/add_custom_target()
+#   USES_TERMINAL
+#     - Passed to add_custom_command()/add_custom_target()
 #   DEPENDS
 #     - Dependencies passed to add_custom_command().  Any targets in this list
 #       that have been created with gmx_add_custom_output_target() are
@@ -176,7 +171,7 @@ function (gmx_add_custom_output_target targetname)
             set(_add_fast ON)
         elseif ("x${_arg}" MATCHES "^x(OUTPUT|DEPENDS|DEPENDS_FILE_LIST)$")
             set(_option ${_arg})
-        elseif ("x${_arg}" MATCHES "^x(COMMAND|COMMENT|WORKING_DIRECTORY)$")
+        elseif ("x${_arg}" MATCHES "^x(COMMAND|COMMENT|WORKING_DIRECTORY|USES_TERMINAL)$")
             set(_option "PASS")
             list(APPEND _command_args "${_arg}")
         elseif ("x${_option}" STREQUAL "xDEPENDS")
@@ -214,37 +209,12 @@ function (gmx_add_custom_output_target targetname)
     endif()
     # Create the actual command as requested.
     if (NOT _always)
-        # If the command does not need to run always, the standard CMake
-        # mechanism is sufficient.
         add_custom_command(OUTPUT ${_output}
             ${_command_args} DEPENDS ${_deps} VERBATIM)
         add_custom_target(${targetname} DEPENDS ${_output})
-    elseif (CMAKE_GENERATOR STREQUAL "Ninja")
-        # Ninja requires all generated files mentioned in dependencies of custom
-        # commands to be actually mentioned in the build system, and luckily
-        # add_custom_command() makes that possible.
-        # But it seems impossible to create a robust custom command that would be
-        # always run, so other generators that do not have this constraint simply
-        # use an add_custom_target().
-        #
-        # The second, phony file is never created, so the rule is always
-        # triggered again.  TODO: Figure out why this works, even though ninja
-        # very eagerly complains about missing files.
-        # This unfortunately does not work with the make generator, as
-        # the non-existent second file causes some part of the generated system
-        # erase the first file at the beginning of every build, causing a full
-        # rebuild of the dependencies.
-        add_custom_command(OUTPUT ${_output} ${targetname}-phony
-            ${_command_args} VERBATIM)
-        # The generated Ninja build system would probably work fine even
-        # without this target, but CMake requires all custom commands to belong
-        # to a target in the same CMakeLists.txt to generate anything for them.
-        add_custom_target(${targetname} DEPENDS ${_output})
     else()
-        # For other generators, a target-level dependency on the custom target
-        # ensures that the output is created before the dependent targets'
-        # dependencies are even evaluated.
-        add_custom_target(${targetname} ${_command_args} VERBATIM)
+        add_custom_target(${targetname} BYPRODUCTS ${_output}
+            ${_command_args} VERBATIM)
     endif()
     # Store the output file name in a custom property to be used in dependency
     # resolution later.
diff --git a/cmake/gmxDetectCpu.cmake b/cmake/gmxDetectCpu.cmake
new file mode 100644 (file)
index 0000000..d5a8f12
--- /dev/null
@@ -0,0 +1,119 @@
+#
+# 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
+# Mark Abraham, David van der Spoel, Berk Hess, and 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(gmxTestInlineASM)
+
+# Ensure things like GMX_TARGET_X86 are available
+include(gmxDetectTargetArchitecture)
+gmx_detect_target_architecture()
+
+# gmx_run_cpu_detection()
+#
+# Try to detect information about the CPU of the build host by
+# building and running the same detection code used by mdrun. This
+# works on all architectures where we are not cross-compiling;
+# depending on the architecture the detection will either use special
+# assembly instructions (like cpuid), preprocessor defines, or probing
+# /proc/cpuinfo on Linux.
+#
+# The TYPE argument is passed as a command-line argument to the
+# detection program, and the terminal output is captured and stored in
+# the cache variable CPU_DETECTION_${TYPE} as the result. If the detection
+# program fails to compile, or fails to run, no value is stored.
+#
+# The function caches information about whether the detection program
+# has already been built or run with this TYPE, so this function
+# should be called freely, even if the call might be repeated within
+# or across invocations of cmake.
+#
+function(gmx_run_cpu_detection TYPE)
+    string(TOUPPER ${TYPE} UPPERTYPE)
+    string(TOLOWER ${TYPE} LOWERTYPE)
+
+    set(OUTPUT_VAR "")
+    # We need to execute the binary, so this only works if not
+    # cross-compiling. However, note that we are NOT limited to x86.
+    if(CMAKE_CROSSCOMPILING)
+        # TODO Need we explain that we're not detecting because we are cross compiling?
+    else()
+        set(CPU_DETECTION_BINARY "${PROJECT_BINARY_DIR}/CMakeFiles/GmxDetectCpu${CMAKE_EXECUTABLE_SUFFIX}")
+        if(NOT CPU_DETECTION_COMPILED)
+            # Compile the detection program
+            set(GMX_TARGET_X86_VALUE 0)
+            if(GMX_TARGET_X86)
+                set(GMX_TARGET_X86_VALUE 1)
+            endif()
+
+            # for x86 we need inline assembly to use cpuid
+            gmx_test_inline_asm_gcc_x86(GMX_X86_GCC_INLINE_ASM)
+            if(GMX_X86_GCC_INLINE_ASM)
+                set(GCC_INLINE_ASM_DEFINE "-DGMX_X86_GCC_INLINE_ASM=1")
+            else()
+                set(GCC_INLINE_ASM_DEFINE "-DGMX_X86_GCC_INLINE_ASM=0")
+            endif()
+
+            set(_compile_definitions "${GCC_INLINE_ASM_DEFINE} -I${PROJECT_SOURCE_DIR}/src -DGMX_CPUINFO_STANDALONE ${GMX_STDLIB_CXX_FLAGS} -DGMX_TARGET_X86=${GMX_TARGET_X86_VALUE}")
+            set(LINK_LIBRARIES "${GMX_STDLIB_LIBRARIES}")
+            try_compile(CPU_DETECTION_COMPILED
+                "${PROJECT_BINARY_DIR}"
+                "${PROJECT_SOURCE_DIR}/src/gromacs/hardware/cpuinfo.cpp"
+                COMPILE_DEFINITIONS "${_compile_definitions}"
+                CMAKE_FLAGS "-DLINK_LIBRARIES=${LINK_LIBRARIES}"
+                OUTPUT_VARIABLE CPU_DETECTION_COMPILED_OUTPUT
+                COPY_FILE ${CPU_DETECTION_BINARY})
+            if(NOT CPU_DETECTION_COMPILED AND NOT RUN_CPU_DETECTION_COMPILATION_QUIETLY)
+                message(STATUS "Did not detect build CPU ${LOWERTYPE} - detection program did not compile")
+            endif()
+            set(RUN_CPU_DETECTION_COMPILATION_QUIETLY TRUE CACHE INTERNAL "Keep quiet on any future compilation attempts")
+        endif()
+
+        if(CPU_DETECTION_COMPILED)
+            # Run the detection program with -type as the argument.
+
+            if(NOT DEFINED CPU_DETECTION_${UPPERTYPE})
+                execute_process(COMMAND ${CPU_DETECTION_BINARY} "-${LOWERTYPE}"
+                    RESULT_VARIABLE RESULT_VAR
+                    OUTPUT_VARIABLE OUTPUT_VAR_TEMP
+                    ERROR_QUIET)
+                if (RESULT_VAR EQUAL 0)
+                    string(STRIP "${OUTPUT_VAR_TEMP}" OUTPUT_VAR)
+                    message(STATUS "Detected build CPU ${LOWERTYPE} - ${OUTPUT_VAR}")
+                    set(CPU_DETECTION_${UPPERTYPE} "${OUTPUT_VAR}" CACHE INTERNAL "Result of running cpu detection code with argument -${LOWERTYPE}")
+                else()
+                    message(STATUS "Did not detect build CPU ${LOWERTYPE} - detection program did not run successfully")
+                endif()
+            endif()
+        endif()
+    endif()
+endfunction()
index c0cf2f56ac17db11670d50fc40101c7a3c223233..50088be99f190879bf4d71a9804e27ddba2a99d5 100644 (file)
 
 # - Check the username performing the build, as well as date and time
 #
-# gmx_detect_simd(GMX_SUGGESTED_SIMD)
+# gmx_detect_simd(_suggested_simd_)
 #
-# Try to detect CPU information and suggest SIMD instruction set
+# Try to detect CPU features and suggest a SIMD instruction set
 # that fits the current CPU. This should work on all architectures
 # where we are not cross-compiling; depending on the architecture the
 # detection will either use special assembly instructions (like cpuid),
 # preprocessor defines, or probing /proc/cpuinfo on Linux.
 # 
-# This assumes gmx_detect_target_architecture() has already been run,
-# so that things like GMX_TARGET_X86 are already available.
-# (otherwise we cannot use inline ASM on x86).
-#
-# Sets ${GMX_SUGGESTED_SIMD} in the parent scope if
-# GMX_SIMD is not set (e.g. by the user, or a previous run
-# of CMake).
+# Sets ${suggested_simd} in the parent scope if GMX_SIMD is not set
+# (e.g. by the user, or a previous run of CMake).
 #
 
 # we rely on inline asm support for GNU!
 include(gmxTestInlineASM)
+# Ensure things like GMX_TARGET_X86 are available
+include(gmxDetectTargetArchitecture)
+gmx_detect_target_architecture()
 
+include(gmxDetectCpu)
 function(gmx_suggest_simd _suggested_simd)
-    if(${_suggested_simd})
-        # There's already been a suggestion made, which can't change
-        return()
-    endif()
-
-    # for x86 we need inline asm to use cpuid
-    gmx_test_inline_asm_gcc_x86(GMX_X86_GCC_INLINE_ASM)
-
-    if(GMX_X86_GCC_INLINE_ASM)
-        set(GCC_INLINE_ASM_DEFINE "-DGMX_X86_GCC_INLINE_ASM=1")
-    else()
-        set(GCC_INLINE_ASM_DEFINE "-DGMX_X86_GCC_INLINE_ASM=0")
+    if (NOT SUGGEST_SIMD_QUIETLY)
+        message(STATUS "Detecting best SIMD instructions for this CPU")
     endif()
 
-    message(STATUS "Detecting best SIMD instructions for this CPU")
-
-    # Get CPU SIMD properties information
-    if(GMX_TARGET_X86)
-        set(GMX_TARGET_X86_VALUE 1)
-    else()
-        set(GMX_TARGET_X86_VALUE 0)
-    endif()
-    set(_compile_definitions "${GCC_INLINE_ASM_DEFINE} -I${CMAKE_SOURCE_DIR}/src -DGMX_CPUINFO_STANDALONE ${GMX_STDLIB_CXX_FLAGS} -DGMX_TARGET_X86=${GMX_TARGET_X86_VALUE}")
-
     # Prepare a default suggestion
     set(OUTPUT_SIMD "None")
 
-    # We need to execute the binary, so this only works if not cross-compiling.
-    # However, note that we are NOT limited to x86.
-    if(NOT CMAKE_CROSSCOMPILING)
-        # TODO Extract this try_compile to a helper function, because
-        # it duplicates code in gmxSetBuildInformation.cmake
-        set(GMX_DETECTSIMD_BINARY "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/GmxDetectSimd${CMAKE_EXECUTABLE_SUFFIX}")
-        set(LINK_LIBRARIES "${GMX_STDLIB_LIBRARIES}")
-        try_compile(GMX_DETECTSIMD_COMPILED
-            "${CMAKE_CURRENT_BINARY_DIR}"
-            "${CMAKE_CURRENT_SOURCE_DIR}/src/gromacs/hardware/cpuinfo.cpp"
-            COMPILE_DEFINITIONS "${_compile_definitions}"
-            CMAKE_FLAGS "-DLINK_LIBRARIES=${LINK_LIBRARIES}"
-            OUTPUT_VARIABLE GMX_DETECTSIMD_COMPILED_OUTPUT
-            COPY_FILE ${GMX_DETECTSIMD_BINARY})
-        unset(_compile_definitions)
+    # Detect CPU features and place the string in CPU_DETECTION_FEATURES
+    # Note that we are NOT limited to x86.
+    gmx_run_cpu_detection(features)
+
+    if (DEFINED CPU_DETECTION_FEATURES)
+        # Make a concrete suggestion of SIMD level if a feature flag
+        # matches. Make sure that the match strings below work even if
+        # the feature is first or last.
+        set(CPU_DETECTION_FEATURES " ${CPU_DETECTION_FEATURES} ")
 
-        if(GMX_DETECTSIMD_COMPILED)
-            if(NOT DEFINED GMX_DETECTSIMD_RUN)
-                execute_process(COMMAND ${GMX_DETECTSIMD_BINARY} "-features"
-                    RESULT_VARIABLE GMX_DETECTSIMD_RUN
-                    OUTPUT_VARIABLE OUTPUT_TMP
-                    ERROR_QUIET)
-                set(GMX_DETECTSIMD_RUN "${GMX_DETECTSIMD_RUN}" CACHE INTERNAL "Result of running cpuinfo code to detect SIMD support")
-                if(GMX_DETECTSIMD_RUN EQUAL 0)
-                    # Make a concrete suggestion of SIMD level
-                    if(GMX_TARGET_X86)
-                        if(OUTPUT_TMP MATCHES " avx512er ")
-                            set(OUTPUT_SIMD "AVX_512_KNL")
-                        elseif(OUTPUT_TMP MATCHES " avx512f ")
-                            set(OUTPUT_SIMD "AVX_512")
-                        elseif(OUTPUT_TMP MATCHES " avx2 ")
-                            set(OUTPUT_SIMD "AVX2_256")
-                        elseif(OUTPUT_TMP MATCHES " avx ")
-                            if(OUTPUT_TMP MATCHES " fma4 ")
-                                # AMD that works better with avx-128-fma
-                                set(OUTPUT_SIMD "AVX_128_FMA")
-                            else()
-                                # Intel
-                                set(OUTPUT_SIMD "AVX_256")
-                            endif()
-                        elseif(OUTPUT_TMP MATCHES " sse4.1 ")
-                            set(OUTPUT_SIMD "SSE4.1")
-                        elseif(OUTPUT_TMP MATCHES " sse2 ")
-                            set(OUTPUT_SIMD "SSE2")
-                        endif()
-                    else()
-                        if(OUTPUT_TMP MATCHES " vsx ")
-                            set(OUTPUT_SIMD "IBM_VSX")
-                        elseif(OUTPUT_TMP MATCHES " vmx ")
-                            set(OUTPUT_SIMD "IBM_VMX")
-                        elseif(OUTPUT_TMP MATCHES " qpx ")
-                            set(OUTPUT_SIMD "IBM_QPX")
-                        elseif(OUTPUT_TMP MATCHES " neon_asimd ")
-                            set(OUTPUT_SIMD "ARM_NEON_ASIMD")
-                        elseif(OUTPUT_TMP MATCHES " neon " AND NOT GMX_DOUBLE)
-                            set(OUTPUT_SIMD "ARM_NEON")
-                        endif()
-                    endif()
-                    message(STATUS "Detected best SIMD instructions for this CPU - ${OUTPUT_SIMD}")
+        if(GMX_TARGET_X86)
+            if(CPU_DETECTION_FEATURES MATCHES " avx512er ")
+                set(OUTPUT_SIMD "AVX_512_KNL")
+            elseif(CPU_DETECTION_FEATURES MATCHES " avx512f ")
+                set(OUTPUT_SIMD "AVX_512")
+            elseif(CPU_DETECTION_FEATURES MATCHES " avx2 ")
+                if(CPU_DETECTION_FEATURES MATCHES " amd ")
+                    set(OUTPUT_SIMD "AVX2_128")
+                else()
+                    set(OUTPUT_SIMD "AVX2_256")
+                endif()
+            elseif(CPU_DETECTION_FEATURES MATCHES " avx ")
+                if(CPU_DETECTION_FEATURES MATCHES " fma4 ")
+                    # AMD that works better with avx-128-fma
+                    set(OUTPUT_SIMD "AVX_128_FMA")
                 else()
-                    message(WARNING "Cannot run cpuinfo code, which means no SIMD suggestion can be made.")
-                    message(STATUS "Run output: ${OUTPUT_TMP}")
+                    # Intel
+                    set(OUTPUT_SIMD "AVX_256")
                 endif()
+            elseif(CPU_DETECTION_FEATURES MATCHES " sse4.1 ")
+                set(OUTPUT_SIMD "SSE4.1")
+            elseif(CPU_DETECTION_FEATURES MATCHES " sse2 ")
+                set(OUTPUT_SIMD "SSE2")
             endif()
         else()
-            message(WARNING "Cannot compile cpuinfo code, which means no SIMD instructions.")
-            message(STATUS "Compile output: ${GMX_DETECTSIMD_COMPILED_OUTPUT}")
+            if(CPU_DETECTION_FEATURES MATCHES " vsx ")
+                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)
+                set(OUTPUT_SIMD "ARM_NEON")
+            endif()
+        endif()
+        if (NOT SUGGEST_SIMD_QUIETLY)
+            message(STATUS "Detected best SIMD instructions for this CPU - ${OUTPUT_SIMD}")
         endif()
     else()
-        message(WARNING "Cannot detect SIMD architecture for this cross-compile; you should check it manually.")
+        if (NOT SUGGEST_SIMD_QUIETLY)
+            message(STATUS "Detection for best SIMD instructions failed, using SIMD - ${OUTPUT_SIMD}")
+        endif()
     endif()
 
-    set(${_suggested_simd} "${OUTPUT_SIMD}" CACHE INTERNAL "Suggested SIMD")
+    set(${_suggested_simd} "${OUTPUT_SIMD}" PARENT_SCOPE)
+    set(SUGGEST_SIMD_QUIETLY TRUE CACHE INTERNAL "Be quiet during future construction of SIMD suggestions")
 endfunction()
 
 function(gmx_detect_simd _suggested_simd)
-    if(NOT DEFINED GMX_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)
             # HPC-ACE is always present. In the future we
index 6577ef201c858b46b79493bc41ecfa9478f64080..8a184948cde1b20acf68a6f58cb251b690b2fe6f 100644 (file)
@@ -89,10 +89,10 @@ if(${GMX_FFT_LIBRARY} STREQUAL "FFTW3")
         set(PKG_FFT "${${FFTW}_PKG}")
         include_directories(SYSTEM ${${FFTW}_INCLUDE_DIRS})
 
-        if ((${GMX_SIMD} MATCHES "SSE" OR ${GMX_SIMD} MATCHES "AVX") AND NOT ${FFTW}_HAVE_SIMD)
+        if ((${GMX_SIMD_ACTIVE} MATCHES "SSE" OR ${GMX_SIMD_ACTIVE} MATCHES "AVX") AND NOT ${FFTW}_HAVE_SIMD)
             message(WARNING "The fftw library found is compiled without SIMD support, which makes it slow. Consider recompiling it or contact your admin")
         else()
-            if(${GMX_SIMD} MATCHES "AVX" AND NOT (${FFTW}_HAVE_SSE OR ${FFTW}_HAVE_SSE2))
+            if(${GMX_SIMD_ACTIVE} MATCHES "AVX" AND NOT (${FFTW}_HAVE_SSE OR ${FFTW}_HAVE_SSE2))
                 # If we end up here we have an AVX Gromacs build, and
                 # FFTW with SIMD.
                 message(WARNING "The FFTW library was compiled with neither --enable-sse nor --enable-sse2; those would have enabled SSE(2) SIMD instructions. This will give suboptimal performance. You should (re)compile the FFTW library with --enable-sse2 and --enable-avx (and --enable-avx2 or --enable-avx512 if supported).")
index a6b5439303a32ea1a687c026bf262d6e7de91e0f..60a74291ecf64a174b7366d30efb143388c05b2a 100644 (file)
@@ -57,18 +57,8 @@ if ((GMX_GPU OR GMX_GPU_AUTO) AND NOT GMX_GPU_DETECTION_DONE)
     gmx_detect_gpu()
 endif()
 
-# CMake 3.0-3.1 has a bug in the following case, which breaks
-# configuration on at least BlueGene/Q. Fixed in 3.1.1
-if ((NOT CMAKE_VERSION VERSION_LESS "3.0.0") AND
-    (CMAKE_VERSION VERSION_LESS "3.1.1") AND
-        (CMAKE_CROSSCOMPILING AND NOT CMAKE_SYSTEM_PROCESSOR))
-    message(STATUS "Cannot search for CUDA because the CMake find package has a bug. Set a valid CMAKE_SYSTEM_PROCESSOR if you need to detect CUDA")
-else()
-    set(CAN_RUN_CUDA_FIND_PACKAGE 1)
-endif()
-
 # We need to call find_package even when we've already done the detection/setup
-if(GMX_GPU OR GMX_GPU_AUTO AND CAN_RUN_CUDA_FIND_PACKAGE)
+if(GMX_GPU OR GMX_GPU_AUTO)
     if(NOT GMX_GPU AND NOT GMX_DETECT_GPU_AVAILABLE)
         # Stay quiet when detection has occured and found no GPU.
         # Noise is acceptable when there is a GPU or the user required one.
@@ -82,23 +72,6 @@ if(GMX_GPU OR GMX_GPU_AUTO AND CAN_RUN_CUDA_FIND_PACKAGE)
     endif()
 
     find_package(CUDA ${REQUIRED_CUDA_VERSION} ${FIND_CUDA_QUIETLY})
-
-    # Cmake 2.8.12 (and CMake 3.0) introduced a new bug where the cuda
-    # library dir is added twice as an rpath on APPLE, which in turn causes
-    # the install_name_tool to wreck the binaries when it tries to remove this
-    # path. Since this is set inside the cuda module, we remove the extra rpath
-    # added in the library string - an rpath is not a library anyway, and at
-    # least for Gromacs this works on all CMake versions. This should be
-    # reasonably future-proof, since newer versions of CMake appear to handle
-    # the rpath automatically based on the provided library path, meaning
-    # the explicit rpath specification is no longer needed.
-    if(APPLE AND (CMAKE_VERSION VERSION_GREATER 2.8.11))
-        foreach(elem ${CUDA_LIBRARIES})
-            if(elem MATCHES "-Wl,.*")
-                list(REMOVE_ITEM CUDA_LIBRARIES ${elem})
-            endif()
-        endforeach(elem)
-    endif()
 endif()
 
 # Depending on the current vale of GMX_GPU and GMX_GPU_AUTO:
@@ -182,13 +155,13 @@ endif()
 # We need to mark these advanced outside the conditional, otherwise, if the
 # user turns GMX_GPU=OFF after a failed cmake pass, these variables will be
 # left behind in the cache.
-mark_as_advanced(CUDA_BUILD_CUBIN CUDA_BUILD_EMULATION CUDA_SDK_ROOT_DIR CUDA_VERBOSE_BUILD # cmake 2.8.9 still spews these, check again when requirements change
-                 CUDA_SEPARABLE_COMPILATION      # not present at least with cmake 3.2, remove when required
-                 CUDA_USE_STATIC_CUDA_RUNTIME    # since cmake 3.3
-                 CUDA_dl_LIBRARY CUDA_rt_LIBRARY # - || -
+mark_as_advanced(CUDA_SDK_ROOT_DIR
+                 CUDA_USE_STATIC_CUDA_RUNTIME
+                 CUDA_dl_LIBRARY CUDA_rt_LIBRARY
                  )
 if(NOT GMX_GPU)
     mark_as_advanced(CUDA_TOOLKIT_ROOT_DIR)
+    mark_as_advanced(CUDA_HOST_COMPILER)
 endif()
 
 # Try to execute ${CUDA_NVCC_EXECUTABLE} --version and set the output
index 8c8562b9c75dc100154a1679ee369d26dc821284..aeb7937c7405d06c7d3213dcff64df7c7fe83258 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2013,2014, by the GROMACS development team, led by
+# Copyright (c) 2013,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.
@@ -89,7 +89,7 @@ macro(manage_linear_algebra_library name function_in_library)
             set(CMAKE_REQUIRED_FLAGS "${FFT_LINKER_FLAGS}")
             # This may also not work correctly if the user changes
             # MKL_LIBRARIES after the first run. However,
-            # MKL_LIBRARIES is only needed for icc version < 11, or
+            # MKL_LIBRARIES is only needed
             # for trying to use MKL with a non-Intel compiler, and we
             # can live with that for now.
             check_function_exists(${function_in_library} _${name}_mkl_works)
@@ -110,8 +110,7 @@ macro(manage_linear_algebra_library name function_in_library)
         if (NOT _library_was_found)
             set(${name}_FIND_QUIETLY ${_find_quietly})
             # Note that this finds all kinds of system libraries,
-            # including Apple's Accelerate Framework (and perhaps MKL for
-            # icc < 11).
+            # including Apple's Accelerate Framework
             find_package(${name})
             if (${name}_FOUND)
                 set(_libraries_to_link ${${name}_LIBRARIES})
index 1d3645a44383c704275d67fb88e3457b8f6ffd5a..02db55732d049d95d626ffc6700d524eee7ba7f5 100644 (file)
@@ -53,7 +53,7 @@ if(GMX_MPI)
         set(MPI_COMPILE_FLAGS ${MPI_C_COMPILE_FLAGS})
         set(MPI_LINKER_FLAGS ${MPI_C_LINK_FLAGS})
         include_directories(SYSTEM ${MPI_C_INCLUDE_PATH})
-        list(APPEND GMX_EXTRA_LIBRARIES ${MPI_C_LIBRARIES})
+        list(APPEND GMX_COMMON_LIBRARIES ${MPI_C_LIBRARIES})
       endif()
       set(MPI_FOUND ${MPI_C_FOUND})
   else()
@@ -165,15 +165,6 @@ if(GMX_MPI)
       endif()
     endif()
     unset(MPINAME_BIN CACHE)
-
-    # Using find_file() runs the CMake standard module
-    # GetPrerequisites.cmake, which adds the file_cmd
-    # variable to the top-level CMake namespace. This is
-    # fixed in CMake 2.8.10. Meanwhile, clean up for it.
-    if(CMAKE_VERSION VERSION_LESS "2.8.10")
-        mark_as_advanced(file_cmd)
-    endif()
-
   else()
       message(FATAL_ERROR
         "MPI support requested, but no MPI compiler found. Either set the "
index a32b19f17c9fb5bdb6fec53b76ee1e414a130a2e..10bce1dc64c3caa81cf25df8737d21634570ea77 100644 (file)
@@ -36,7 +36,7 @@
 # pain as much as possible:
 # - use the CUDA_HOST_COMPILER if defined by the user, otherwise
 # - auto-detect compatible nvcc host compiler and set nvcc -ccbin (if not MPI wrapper)
-# - set icc compatibility mode to gcc 4.6
+# - set icc compatibility mode to gcc 4.8.1
 # - (advanced) variables set:
 #   * CUDA_HOST_COMPILER            - the host compiler for nvcc (only with cmake <2.8.10)
 #   * CUDA_HOST_COMPILER_OPTIONS    - the full host-compiler related option list passed to nvcc
@@ -51,23 +51,6 @@ if (CUDA_HOST_COMPILER_CHANGED AND CUDA_HOST_COMPILER_AUTOSET)
     unset(CUDA_HOST_COMPILER_AUTOSET CACHE)
 endif()
 
-# Set the host compiler for nvcc if this is not set by CMake (v<=2.8.9)
-#
-# Note that even though nvcc compiles host code as C++, we use the
-# CMAKE_C_COMPILER as host compiler. We do this because CUDA versions
-# preceding 5.0 only recognize icc, but not icpc. However, both gcc and icc
-# (i.e. all supported compilers) happily compile C++ code.
-#
-# Also note that with MSVC nvcc sets the -compiler-bindir option behind the
-# scenes; to avoid conflicts we don't set -ccbin automatically.
-#
-# TODO: remove this when CMAke >=v2.8.10 is required.
-if (NOT DEFINED CUDA_HOST_COMPILER AND NOT MSVC)
-    set(CUDA_HOST_COMPILER "${CMAKE_C_COMPILER}")
-    set(CUDA_HOST_COMPILER_AUTOSET TRUE CACHE INTERNAL
-        "True if CUDA_HOST_COMPILER is automatically set")
-endif()
-
 # glibc 2.23 changed string.h in a way that breaks CUDA compilation in
 # many projects, but which has a trivial workaround. It would be nicer
 # to compile with nvcc and see that the workaround is necessary and
@@ -87,25 +70,7 @@ endfunction()
 
 # set up host compiler and its options
 if(CUDA_HOST_COMPILER_CHANGED)
-    # FindCUDA in CMake 2.8.10 sets the host compiler internally
-    if (CMAKE_VERSION VERSION_LESS "2.8.10")
-        set(CUDA_HOST_COMPILER ${CUDA_HOST_COMPILER}
-            CACHE PATH "Host compiler for nvcc")
-    endif()
-
-    # On *nix force icc in gcc 4.6 compatibility mode. This is needed
-    # as even with icc used as host compiler, when icc's gcc compatibility
-    # mode is higher than the max gcc version officially supported by CUDA,
-    # nvcc will freak out.
     set(CUDA_HOST_COMPILER_OPTIONS "")
-    if (UNIX AND
-            ((CMAKE_C_COMPILER_ID MATCHES "Intel" AND
-              (CUDA_HOST_COMPILER_AUTOSET OR CMAKE_C_COMPILER STREQUAL CUDA_HOST_COMPILER)) OR
-            (CMAKE_CXX_COMPILER_ID MATCHES "Intel" AND CMAKE_CXX_COMPILER STREQUAL CUDA_HOST_COMPILER))
-        )
-        message(STATUS "Setting Intel Compiler compatibity mode to gcc 4.6 for nvcc host compilation")
-        list(APPEND CUDA_HOST_COMPILER_OPTIONS "-Xcompiler;-gcc-version=460")
-    endif()
 
     if(APPLE AND CMAKE_C_COMPILER_ID MATCHES "GNU")
         # Some versions of gcc-4.8 and gcc-4.9 produce errors (in particular on OS X)
@@ -191,8 +156,14 @@ else()
     endif()
 endif()
 
-gmx_dependent_cache_variable(GMX_CUDA_TARGET_SM "List of CUDA GPU architecture codes to compile for (without the sm_ prefix)" STRING "" GMX_CUDA_TARGET_SM)
-gmx_dependent_cache_variable(GMX_CUDA_TARGET_COMPUTE "List of CUDA virtual architecture codes to compile for (without the compute_ prefix)" STRING "" GMX_CUDA_TARGET_COMPUTE)
+if (GMX_CUDA_TARGET_SM)
+    set_property(CACHE GMX_CUDA_TARGET_SM PROPERTY HELPSTRING "List of CUDA GPU architecture codes to compile for (without the sm_ prefix)")
+    set_property(CACHE GMX_CUDA_TARGET_SM PROPERTY TYPE STRING)
+endif()
+if (GMX_CUDA_TARGET_COMPUTE)
+    set_property(CACHE GMX_CUDA_TARGET_COMPUTE PROPERTY HELPSTRING "List of CUDA virtual architecture codes to compile for (without the compute_ prefix)")
+    set_property(CACHE GMX_CUDA_TARGET_COMPUTE PROPERTY TYPE STRING)
+endif()
 
 # assemble the CUDA flags
 list(APPEND GMX_CUDA_NVCC_FLAGS "${GMX_CUDA_NVCC_GENCODE_FLAGS}")
@@ -203,52 +174,11 @@ if (CUDA_VERSION VERSION_EQUAL "8.0")
 endif()
 
 # assemble the CUDA host compiler flags
-# with CMake <2.8.10 the host compiler needs to be set on the nvcc command line
-if (CMAKE_VERSION VERSION_LESS "2.8.10")
-    list(APPEND GMX_CUDA_NVCC_FLAGS "-ccbin=${CUDA_HOST_COMPILER}")
-endif()
 list(APPEND GMX_CUDA_NVCC_FLAGS "${CUDA_HOST_COMPILER_OPTIONS}")
 
 # The flags are set as local variables which shadow the cache variables. The cache variables
 # (can be set by the user) are appended. This is done in a macro to set the flags when all
 # host compiler flags are already set.
 macro(GMX_SET_CUDA_NVCC_FLAGS)
-    if(CUDA_PROPAGATE_HOST_FLAGS)
-        set(CUDA_PROPAGATE_HOST_FLAGS OFF)
-
-        # When CUDA 6.5 is required we should use C++11 also for CUDA and also propagate
-        # the C++11 flag to CUDA. Then we can use the solution implemented in FindCUDA
-        # (starting with 3.3 - can be backported). For now we need to remove the C++11
-        # flag which means we need to manually propagate all other flags.
-        string(REGEX REPLACE "[-]+std=c\\+\\+0x" "" _CMAKE_CXX_FLAGS_SANITIZED "${CMAKE_CXX_FLAGS}")
-
-        # The IBM xlc compiler chokes if we use both altivec and Cuda. Solve
-        # this by not propagating the flag in this case.
-        if(CMAKE_CXX_COMPILER_ID MATCHES "XL")
-            string(REGEX REPLACE "-qaltivec" "" _CMAKE_CXX_FLAGS_SANITIZED "${_CMAKE_CXX_FLAGS_SANITIZED}")
-        endif()
-
-        # CUDA versions prior to 7.5 come with a header (math_functions.h) which uses the _MSC_VER macro
-        # unconditionally, so we strip -Wundef from the propagatest flags for earlier CUDA versions.
-        if (CUDA_VERSION VERSION_LESS "7.5")
-            string(REGEX REPLACE "-Wundef" "" _CMAKE_CXX_FLAGS_SANITIZED "${_CMAKE_CXX_FLAGS_SANITIZED}")
-        endif()
-
-        string(REPLACE " " "," _flags "${_CMAKE_CXX_FLAGS_SANITIZED}")
-        set(CUDA_NVCC_FLAGS "${GMX_CUDA_NVCC_FLAGS};${CUDA_NVCC_FLAGS};-Xcompiler;${_flags}")
-
-        # Create list of all possible configurations. For multi-configuration this is CMAKE_CONFIGURATION_TYPES
-        # and for single configuration CMAKE_BUILD_TYPE. Not sure why to add the default ones, but FindCUDA
-        # claims one should.
-        set(CUDA_configuration_types ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE} Debug MinSizeRel Release RelWithDebInfo)
-        list(REMOVE_DUPLICATES CUDA_configuration_types)
-
-        foreach(_config ${CUDA_configuration_types})
-            string(TOUPPER ${_config} _config_upper)
-            string(REPLACE " " "," _flags "${CMAKE_CXX_FLAGS_${_config_upper}}")
-            set(CUDA_NVCC_FLAGS_${_config_upper} "${CUDA_NVCC_FLAGS_${_config_upper}};-Xcompiler;${_flags}")
-        endforeach()
-    else()
-        set(CUDA_NVCC_FLAGS "${GMX_CUDA_NVCC_FLAGS};${CUDA_NVCC_FLAGS}")
-    endif()
+    set(CUDA_NVCC_FLAGS "${GMX_CUDA_NVCC_FLAGS};${CUDA_NVCC_FLAGS}")
 endmacro()
index 5903957beff2a67a1d01d03e107a79e8bf0b202d..301778256b0ab7d7288b26ac1cfd8c4211139736 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,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.
 # and then does some additional tests for flags afterwards.
 
 if(GMX_OPENMP)
-    if(CMAKE_C_COMPILER_ID MATCHES "Cray" AND CMAKE_VERSION VERSION_LESS 3)
-        message(STATUS "OpenMP multithreading is not detected correctly for the Cray compiler with CMake before version 3.0 (see http://public.kitware.com/Bug/view.php?id=14567)")
-        set(GMX_OPENMP OFF CACHE BOOL
-            "OpenMP multithreading is not detected correctly for the Cray compiler with CMake before version 3.0 (see http://public.kitware.com/Bug/view.php?id=14567)" FORCE)
-    else()
-        # We should do OpenMP detection if we get here
-        # OpenMP check must come before other CFLAGS!
-        find_package(OpenMP)
-        if(OPENMP_FOUND)
-            # CMake on Windows doesn't support linker flags passed to target_link_libraries
-            # (i.e. it treats /openmp as \openmp library file). Also, no OpenMP linker flags are needed.
-            if(NOT (WIN32 AND NOT MINGW))
-                if(CMAKE_COMPILER_IS_GNUCC AND GMX_PREFER_STATIC_OPENMP AND NOT APPLE)
-                    set(OpenMP_LINKER_FLAGS "-Wl,-static -lgomp -lrt -Wl,-Bdynamic -lpthread")
-                    set(OpenMP_SHARED_LINKER_FLAGS "")
-                else()
-                    # Only set a linker flag if the user didn't set them manually
-                    if(NOT DEFINED OpenMP_LINKER_FLAGS)
-                        set(OpenMP_LINKER_FLAGS "${OpenMP_C_FLAGS}")
-                    endif()
-                    if(NOT DEFINED OpenMP_SHARED_LINKER_FLAGS)
-                        set(OpenMP_SHARED_LINKER_FLAGS "${OpenMP_C_FLAGS}")
-                    endif()
+    # We should do OpenMP detection if we get here
+    # OpenMP check must come before other CFLAGS!
+    find_package(OpenMP)
+    if(OPENMP_FOUND)
+        # CMake on Windows doesn't support linker flags passed to target_link_libraries
+        # (i.e. it treats /openmp as \openmp library file). Also, no OpenMP linker flags are needed.
+        if(NOT (WIN32 AND NOT MINGW))
+            if(CMAKE_COMPILER_IS_GNUCC AND GMX_PREFER_STATIC_OPENMP AND NOT APPLE)
+                set(OpenMP_LINKER_FLAGS "-Wl,-static -lgomp -lrt -Wl,-Bdynamic -lpthread")
+                set(OpenMP_SHARED_LINKER_FLAGS "")
+            else()
+                # Only set a linker flag if the user didn't set them manually
+                if(NOT DEFINED OpenMP_LINKER_FLAGS)
+                    set(OpenMP_LINKER_FLAGS "${OpenMP_C_FLAGS}")
+                endif()
+                if(NOT DEFINED OpenMP_SHARED_LINKER_FLAGS)
+                    set(OpenMP_SHARED_LINKER_FLAGS "${OpenMP_C_FLAGS}")
                 endif()
             endif()
-            if(MINGW)
-                #GCC Bug 48659
-                set(OpenMP_C_FLAGS "${OpenMP_C_FLAGS} -mstackrealign")
-            endif()
-        else()
-            message(WARNING
-                    "The compiler you are using does not support OpenMP parallelism. This might hurt your performance a lot, in particular with GPUs. Try using a more recent version, or a different compiler. For now, we are proceeding by turning off OpenMP.")
-            set(GMX_OPENMP OFF CACHE STRING "Whether GROMACS will use OpenMP parallelism." FORCE)
         endif()
+        if(MINGW)
+            #GCC Bug 48659
+            set(OpenMP_C_FLAGS "${OpenMP_C_FLAGS} -mstackrealign")
+        endif()
+    else()
+        message(WARNING
+                "The compiler you are using does not support OpenMP parallelism. This might hurt your performance a lot, in particular with GPUs. Try using a more recent version, or a different compiler. For now, we are proceeding by turning off OpenMP.")
+        set(GMX_OPENMP OFF CACHE STRING "Whether GROMACS will use OpenMP parallelism." FORCE)
     endif()
 endif()
 gmx_dependent_cache_variable(GMX_OPENMP_MAX_THREADS
     "Maximum number of OpenMP Threads supported. Has to be 32 or a multiple of 64."
-    STRING 32 GMX_OPENMP)
+    STRING 64 GMX_OPENMP)
 mark_as_advanced(GMX_OPENMP_MAX_THREADS)
 math(EXPR MAX_THREAD_MOD "${GMX_OPENMP_MAX_THREADS} % 64")
 if (NOT GMX_OPENMP_MAX_THREADS EQUAL 32 AND NOT ${MAX_THREAD_MOD} EQUAL 0)
index 69c1e4c55ab34eb919be17c629beb6b8d7184d74..e3af82761e3cf698127305f0023b1c501f350ede 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,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.
index b1b76a51d3844d420948c455d4640fbff960481e..84045516d6607e5a1f08920553b4066cfaf1b1e5 100644 (file)
@@ -32,8 +32,7 @@
 # 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 avx test source, used if the AVX flags are set below
-include(gmxTestAVXMaskload)
+include(gmxDetectCpu)
 include(gmxFindFlagsForSource)
 
 # Macro that manages setting the respective C and C++ toolchain
@@ -60,7 +59,8 @@ macro(prepare_power_vsx_toolchain TOOLCHAIN_C_FLAGS_VARIABLE TOOLCHAIN_CXX_FLAGS
         # VSX uses the same function API as Altivec/VMX, so make sure we tune for the current CPU and not VMX.
         # By putting these flags here rather than in the general compiler flags file we can safely assume
         # that we are at least on Power7 since that is when VSX appeared.
-        if(BUILD_CPU_BRAND MATCHES "POWER7")
+        gmx_run_cpu_detection(brand)
+        if(CPU_DETECTION_BRAND MATCHES "POWER7")
             gmx_test_cflag(GNU_C_VSX_POWER7   "-mcpu=power7 -mtune=power7" ${TOOLCHAIN_C_FLAGS_VARIABLE})
             gmx_test_cflag(GNU_CXX_VSX_POWER7 "-mcpu=power7 -mtune=power7" ${TOOLCHAIN_CXX_FLAGS_VARIABLE})
         else()
@@ -126,33 +126,41 @@ endif()
 #
 # Section to set (and test) compiler flags for SIMD.
 #
-# The flags will be set based on the GMX_SIMD choice provided by the user.
-# Automatic detection of the architecture on the build host is done prior to
-# calling this macro.
+# If the user chose the (default) automatic behaviour, then detection
+# is run to suggest a SIMD choice suitable for the build
+# host. Otherwise, the users's choice is always honoured. The compiler
+# flags will be set based on that choice.
 #
 
-if(GMX_SIMD STREQUAL "NONE")
+set(GMX_SIMD_ACTIVE ${GMX_SIMD})
+if(GMX_SIMD STREQUAL "AUTO")
+    include(gmxDetectSimd)
+    gmx_detect_simd(GMX_SUGGESTED_SIMD)
+    set(GMX_SIMD_ACTIVE ${GMX_SUGGESTED_SIMD})
+endif()
+
+if(GMX_SIMD_ACTIVE STREQUAL "NONE")
     # nothing to do configuration-wise
     set(SIMD_STATUS_MESSAGE "SIMD instructions disabled")
-elseif(GMX_SIMD STREQUAL "SSE2")
+elseif(GMX_SIMD_ACTIVE STREQUAL "SSE2")
 
     gmx_find_flags(
         "#include<xmmintrin.h>
          int main(){__m128 x=_mm_set1_ps(0.5);x=_mm_rsqrt_ps(x);return _mm_movemask_ps(x);}"
         TOOLCHAIN_C_FLAGS TOOLCHAIN_CXX_FLAGS
-        SIMD_${GMX_SIMD}_C_FLAGS SIMD_${GMX_SIMD}_CXX_FLAGS
+        SIMD_${GMX_SIMD_ACTIVE}_C_FLAGS SIMD_${GMX_SIMD_ACTIVE}_CXX_FLAGS
         "-msse2" "/arch:SSE2" "-hgnu")
 
-    if(NOT SIMD_${GMX_SIMD}_C_FLAGS OR NOT SIMD_${GMX_SIMD}_CXX_FLAGS)
+    if(NOT SIMD_${GMX_SIMD_ACTIVE}_C_FLAGS OR NOT SIMD_${GMX_SIMD_ACTIVE}_CXX_FLAGS)
         gmx_give_fatal_error_when_simd_support_not_found("SSE2" "disable SIMD support (slow)" "${SUGGEST_BINUTILS_UPDATE}")
     endif()
 
     set(SIMD_C_FLAGS "${TOOLCHAIN_C_FLAGS}")
     set(SIMD_CXX_FLAGS "${TOOLCHAIN_CXX_FLAGS}")
-    set(GMX_SIMD_X86_${GMX_SIMD} 1)
+    set(GMX_SIMD_X86_${GMX_SIMD_ACTIVE} 1)
     set(SIMD_STATUS_MESSAGE "Enabling SSE2 SIMD instructions")
 
-elseif(GMX_SIMD STREQUAL "SSE4.1")
+elseif(GMX_SIMD_ACTIVE STREQUAL "SSE4.1")
 
     # Note: MSVC enables SSE4.1 with the SSE2 flag, so we include that in testing.
     gmx_find_flags(
@@ -171,7 +179,7 @@ elseif(GMX_SIMD STREQUAL "SSE4.1")
     set(GMX_SIMD_X86_SSE4_1 1)
     set(SIMD_STATUS_MESSAGE "Enabling SSE4.1 SIMD instructions")
 
-elseif(GMX_SIMD STREQUAL "AVX_128_FMA")
+elseif(GMX_SIMD_ACTIVE STREQUAL "AVX_128_FMA")
 
     prepare_x86_toolchain(TOOLCHAIN_C_FLAGS TOOLCHAIN_CXX_FLAGS)
 
@@ -229,11 +237,11 @@ elseif(GMX_SIMD STREQUAL "AVX_128_FMA")
         ${INCLUDE_INTRIN_H}
         int main(){__m128 x=_mm_set1_ps(0.5);x=_mm_macc_ps(x,x,x);return _mm_movemask_ps(x);}"
         TOOLCHAIN_C_FLAGS TOOLCHAIN_CXX_FLAGS
-        SIMD_${GMX_SIMD}_C_FLAGS SIMD_${GMX_SIMD}_CXX_FLAGS
+        SIMD_${GMX_SIMD_ACTIVE}_C_FLAGS SIMD_${GMX_SIMD_ACTIVE}_CXX_FLAGS
         "-mfma4" "-hgnu")
 
     # We only need to check the last (FMA) test; that will always fail if the generic AVX test failed
-    if(NOT SIMD_${GMX_SIMD}_C_FLAGS OR NOT SIMD_${GMX_SIMD}_CXX_FLAGS)
+    if(NOT SIMD_${GMX_SIMD_ACTIVE}_C_FLAGS OR NOT SIMD_${GMX_SIMD_ACTIVE}_CXX_FLAGS)
         gmx_give_fatal_error_when_simd_support_not_found("128-bit AVX with FMA support" "choose SSE4.1 SIMD (slower)" "${SUGGEST_BINUTILS_UPDATE}")
     endif()
 
@@ -249,12 +257,10 @@ elseif(GMX_SIMD STREQUAL "AVX_128_FMA")
 
     set(SIMD_C_FLAGS "${TOOLCHAIN_C_FLAGS}")
     set(SIMD_CXX_FLAGS "${TOOLCHAIN_CXX_FLAGS}")
-    set(GMX_SIMD_X86_${GMX_SIMD} 1)
+    set(GMX_SIMD_X86_${GMX_SIMD_ACTIVE} 1)
     set(SIMD_STATUS_MESSAGE "Enabling 128-bit AVX SIMD GROMACS SIMD (with fused-multiply add)")
 
-    gmx_test_avx_gcc_maskload_bug(GMX_SIMD_X86_AVX_GCC_MASKLOAD_BUG "${SIMD_C_FLAGS}")
-
-elseif(GMX_SIMD STREQUAL "AVX_256")
+elseif(GMX_SIMD_ACTIVE STREQUAL "AVX_256")
 
     prepare_x86_toolchain(TOOLCHAIN_C_FLAGS TOOLCHAIN_CXX_FLAGS)
 
@@ -262,21 +268,19 @@ elseif(GMX_SIMD STREQUAL "AVX_256")
         "#include<immintrin.h>
          int main(){__m256 x=_mm256_set1_ps(0.5);x=_mm256_add_ps(x,x);return _mm256_movemask_ps(x);}"
         TOOLCHAIN_C_FLAGS TOOLCHAIN_CXX_FLAGS
-        SIMD_${GMX_SIMD}_C_FLAGS SIMD_${GMX_SIMD}_CXX_FLAGS
+        SIMD_${GMX_SIMD_ACTIVE}_C_FLAGS SIMD_${GMX_SIMD_ACTIVE}_CXX_FLAGS
         "-mavx" "/arch:AVX" "-hgnu")
 
-    if(NOT SIMD_${GMX_SIMD}_C_FLAGS OR NOT SIMD_${GMX_SIMD}_CXX_FLAGS)
+    if(NOT SIMD_${GMX_SIMD_ACTIVE}_C_FLAGS OR NOT SIMD_${GMX_SIMD_ACTIVE}_CXX_FLAGS)
         gmx_give_fatal_error_when_simd_support_not_found("AVX" "choose SSE4.1 SIMD (slower)" "${SUGGEST_BINUTILS_UPDATE}")
     endif()
 
     set(SIMD_C_FLAGS "${TOOLCHAIN_C_FLAGS}")
     set(SIMD_CXX_FLAGS "${TOOLCHAIN_CXX_FLAGS}")
-    set(GMX_SIMD_X86_${GMX_SIMD} 1)
+    set(GMX_SIMD_X86_${GMX_SIMD_ACTIVE} 1)
     set(SIMD_STATUS_MESSAGE "Enabling 256-bit AVX SIMD instructions")
 
-    gmx_test_avx_gcc_maskload_bug(GMX_SIMD_X86_AVX_GCC_MASKLOAD_BUG "${SIMD_C_FLAGS}")
-
-elseif(GMX_SIMD STREQUAL "AVX2_256")
+elseif(GMX_SIMD_ACTIVE MATCHES "AVX2_")
 
     prepare_x86_toolchain(TOOLCHAIN_C_FLAGS TOOLCHAIN_CXX_FLAGS)
 
@@ -284,27 +288,30 @@ elseif(GMX_SIMD STREQUAL "AVX2_256")
         "#include<immintrin.h>
          int main(){__m256i x=_mm256_set1_epi32(5);x=_mm256_add_epi32(x,x);return _mm256_movemask_epi8(x);}"
         TOOLCHAIN_C_FLAGS TOOLCHAIN_CXX_FLAGS
-        SIMD_${GMX_SIMD}_C_FLAGS SIMD_${GMX_SIMD}_CXX_FLAGS
+        SIMD_${GMX_SIMD_ACTIVE}_C_FLAGS SIMD_${GMX_SIMD_ACTIVE}_CXX_FLAGS
         "-march=core-avx2" "-mavx2" "/arch:AVX" "-hgnu") # no AVX2-specific flag for MSVC yet
 
-    if(NOT SIMD_${GMX_SIMD}_C_FLAGS OR NOT SIMD_${GMX_SIMD}_CXX_FLAGS)
+    if(NOT SIMD_${GMX_SIMD_ACTIVE}_C_FLAGS OR NOT SIMD_${GMX_SIMD_ACTIVE}_CXX_FLAGS)
         gmx_give_fatal_error_when_simd_support_not_found("AVX2" "choose AVX SIMD (slower)" "${SUGGEST_BINUTILS_UPDATE}")
     endif()
 
     set(SIMD_C_FLAGS "${TOOLCHAIN_C_FLAGS}")
     set(SIMD_CXX_FLAGS "${TOOLCHAIN_CXX_FLAGS}")
-    set(GMX_SIMD_X86_${GMX_SIMD} 1)
-    set(SIMD_STATUS_MESSAGE "Enabling 256-bit AVX2 SIMD instructions")
+    set(GMX_SIMD_X86_${GMX_SIMD_ACTIVE} 1)
 
-    # No need to test for Maskload bug - it was fixed before gcc added AVX2 support
+    if(GMX_SIMD_ACTIVE STREQUAL "AVX2_128")
+        set(SIMD_STATUS_MESSAGE "Enabling 128-bit AVX2 SIMD instructions")
+    else()
+        set(SIMD_STATUS_MESSAGE "Enabling 256-bit AVX2 SIMD instructions")
+    endif()
 
-elseif(GMX_SIMD STREQUAL "MIC")
+elseif(GMX_SIMD_ACTIVE STREQUAL "MIC")
 
     # No flags needed. Not testing.
     set(GMX_SIMD_X86_MIC 1)
     set(SIMD_STATUS_MESSAGE "Enabling MIC (Xeon Phi) SIMD instructions")
 
-elseif(GMX_SIMD STREQUAL "AVX_512")
+elseif(GMX_SIMD_ACTIVE STREQUAL "AVX_512")
 
     prepare_x86_toolchain(TOOLCHAIN_C_FLAGS TOOLCHAIN_CXX_FLAGS)
 
@@ -312,19 +319,19 @@ elseif(GMX_SIMD STREQUAL "AVX_512")
         "#include<immintrin.h>
          int main(){__m512 y,x=_mm512_set1_ps(0.5);y=_mm512_fmadd_ps(x,x,x);return (int)_mm512_cmp_ps_mask(x,y,_CMP_LT_OS);}"
         TOOLCHAIN_C_FLAGS TOOLCHAIN_CXX_FLAGS
-        SIMD_${GMX_SIMD}_C_FLAGS SIMD_${GMX_SIMD}_CXX_FLAGS
+        SIMD_${GMX_SIMD_ACTIVE}_C_FLAGS SIMD_${GMX_SIMD_ACTIVE}_CXX_FLAGS
         "-xCORE-AVX512" "-mavx512f -mfma" "-mavx512f" "/arch:AVX" "-hgnu") # no AVX_512F flags known for MSVC yet
 
-    if(NOT SIMD_${GMX_SIMD}_C_FLAGS OR NOT SIMD_${GMX_SIMD}_CXX_FLAGS)
+    if(NOT SIMD_${GMX_SIMD_ACTIVE}_C_FLAGS OR NOT SIMD_${GMX_SIMD_ACTIVE}_CXX_FLAGS)
         gmx_give_fatal_error_when_simd_support_not_found("AVX 512F" "choose a lower level of SIMD (slower)" "${SUGGEST_BINUTILS_UPDATE}")
     endif()
 
     set(SIMD_C_FLAGS "${TOOLCHAIN_C_FLAGS}")
     set(SIMD_CXX_FLAGS "${TOOLCHAIN_CXX_FLAGS}")
-    set(GMX_SIMD_X86_${GMX_SIMD} 1)
+    set(GMX_SIMD_X86_${GMX_SIMD_ACTIVE} 1)
     set(SIMD_STATUS_MESSAGE "Enabling 512-bit AVX-512 SIMD instructions")
 
-elseif(GMX_SIMD STREQUAL "AVX_512_KNL")
+elseif(GMX_SIMD_ACTIVE STREQUAL "AVX_512_KNL")
 
     prepare_x86_toolchain(TOOLCHAIN_C_FLAGS TOOLCHAIN_CXX_FLAGS)
 
@@ -332,19 +339,19 @@ elseif(GMX_SIMD STREQUAL "AVX_512_KNL")
         "#include<immintrin.h>
         int main(){__m512 y,x=_mm512_set1_ps(0.5);y=_mm512_rsqrt28_ps(x);return (int)_mm512_cmp_ps_mask(x,y,_CMP_LT_OS);}"
         TOOLCHAIN_C_FLAGS TOOLCHAIN_CXX_FLAGS
-        SIMD_${GMX_SIMD}_C_FLAGS SIMD_${GMX_SIMD}_CXX_FLAGS
+        SIMD_${GMX_SIMD_ACTIVE}_C_FLAGS SIMD_${GMX_SIMD_ACTIVE}_CXX_FLAGS
         "-xMIC-AVX512" "-mavx512er -mfma" "-mavx512er" "/arch:AVX" "-hgnu") # no AVX_512ER flags known for MSVC yet
 
-    if(NOT SIMD_${GMX_SIMD}_C_FLAGS OR NOT SIMD_${GMX_SIMD}_CXX_FLAGS)
+    if(NOT SIMD_${GMX_SIMD_ACTIVE}_C_FLAGS OR NOT SIMD_${GMX_SIMD_ACTIVE}_CXX_FLAGS)
         gmx_give_fatal_error_when_simd_support_not_found("AVX 512ER" "choose a lower level of SIMD (slower)" "${SUGGEST_BINUTILS_UPDATE}")
     endif()
 
     set(SIMD_C_FLAGS "${TOOLCHAIN_C_FLAGS}")
     set(SIMD_CXX_FLAGS "${TOOLCHAIN_CXX_FLAGS}")
-    set(GMX_SIMD_X86_${GMX_SIMD} 1)
+    set(GMX_SIMD_X86_${GMX_SIMD_ACTIVE} 1)
     set(SIMD_STATUS_MESSAGE "Enabling 512-bit AVX-512-KNL SIMD instructions")
 
-elseif(GMX_SIMD STREQUAL "ARM_NEON")
+elseif(GMX_SIMD_ACTIVE STREQUAL "ARM_NEON")
 
     if (GMX_DOUBLE)
         message(FATAL_ERROR "ARM_NEON SIMD support is not available for a double precision build because the architecture lacks double-precision support")
@@ -354,69 +361,69 @@ elseif(GMX_SIMD STREQUAL "ARM_NEON")
         "#include<arm_neon.h>
          int main(){float32x4_t x=vdupq_n_f32(0.5);x=vmlaq_f32(x,x,x);return vgetq_lane_f32(x,0)>0;}"
         TOOLCHAIN_C_FLAGS TOOLCHAIN_CXX_FLAGS
-        SIMD_${GMX_SIMD}_C_FLAGS SIMD_${GMX_SIMD}_CXX_FLAGS
+        SIMD_${GMX_SIMD_ACTIVE}_C_FLAGS SIMD_${GMX_SIMD_ACTIVE}_CXX_FLAGS
         "-mfpu=neon-vfpv4" "-mfpu=neon" "")
 
-    if(NOT SIMD_${GMX_SIMD}_C_FLAGS OR NOT SIMD_${GMX_SIMD}_CXX_FLAGS)
+    if(NOT SIMD_${GMX_SIMD_ACTIVE}_C_FLAGS OR NOT SIMD_${GMX_SIMD_ACTIVE}_CXX_FLAGS)
         gmx_give_fatal_error_when_simd_support_not_found("ARM NEON" "disable SIMD support (slower)" "${SUGGEST_BINUTILS_UPDATE}")
     endif()
 
     set(SIMD_C_FLAGS "${TOOLCHAIN_C_FLAGS}")
     set(SIMD_CXX_FLAGS "${TOOLCHAIN_CXX_FLAGS}")
-    set(GMX_SIMD_${GMX_SIMD} 1)
+    set(GMX_SIMD_${GMX_SIMD_ACTIVE} 1)
     set(SIMD_STATUS_MESSAGE "Enabling 32-bit ARM NEON SIMD instructions")
 
-elseif(GMX_SIMD STREQUAL "ARM_NEON_ASIMD")
+elseif(GMX_SIMD_ACTIVE STREQUAL "ARM_NEON_ASIMD")
 
     gmx_find_flags(
         "#include<arm_neon.h>
          int main(){float64x2_t x=vdupq_n_f64(0.5);x=vfmaq_f64(x,x,x);x=vrndnq_f64(x);return vgetq_lane_f64(x,0)>0;}"
         TOOLCHAIN_C_FLAGS TOOLCHAIN_CXX_FLAGS
-        SIMD_${GMX_SIMD}_C_FLAGS SIMD_${GMX_SIMD}_CXX_FLAGS
+        SIMD_${GMX_SIMD_ACTIVE}_C_FLAGS SIMD_${GMX_SIMD_ACTIVE}_CXX_FLAGS
         "")
 
-    if(NOT SIMD_${GMX_SIMD}_C_FLAGS OR NOT SIMD_${GMX_SIMD}_CXX_FLAGS)
+    if(NOT SIMD_${GMX_SIMD_ACTIVE}_C_FLAGS OR NOT SIMD_${GMX_SIMD_ACTIVE}_CXX_FLAGS)
         gmx_give_fatal_error_when_simd_support_not_found("ARM (AArch64) NEON Advanced SIMD" "particularly gcc version 4.9 or later, or disable SIMD support (slower)" "${SUGGEST_BINUTILS_UPDATE}")
     endif()
 
     set(SIMD_C_FLAGS "${TOOLCHAIN_C_FLAGS}")
     set(SIMD_CXX_FLAGS "${TOOLCHAIN_CXX_FLAGS}")
-    set(GMX_SIMD_${GMX_SIMD} 1)
+    set(GMX_SIMD_${GMX_SIMD_ACTIVE} 1)
     set(SIMD_STATUS_MESSAGE "Enabling ARM (AArch64) NEON Advanced SIMD instructions")
 
-elseif(GMX_SIMD STREQUAL "IBM_QPX")
+elseif(GMX_SIMD_ACTIVE STREQUAL "IBM_QPX")
 
     try_compile(TEST_QPX ${CMAKE_BINARY_DIR}
         "${CMAKE_SOURCE_DIR}/cmake/TestQPX.c")
 
     if (TEST_QPX)
         message(WARNING "IBM QPX SIMD instructions selected. This will work, but SIMD kernels are only available for the Verlet cut-off scheme. The plain C kernels that are used for the group cut-off scheme kernels will be slow, so please consider using the Verlet cut-off scheme.")
-        set(GMX_SIMD_${GMX_SIMD} 1)
+        set(GMX_SIMD_${GMX_SIMD_ACTIVE} 1)
         set(SIMD_STATUS_MESSAGE "Enabling IBM QPX SIMD instructions")
 
     else()
-        gmx_give_fatal_error_when_simd_support_not_found("IBM QPX" "or 'cmake .. -DCMAKE_TOOLCHAIN_FILE=Platform/BlueGeneQ-static-XL-CXX' to set up the tool chain" "${SUGGEST_BINUTILS_UPDATE}")
+        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 STREQUAL "IBM_VMX")
+elseif(GMX_SIMD_ACTIVE STREQUAL "IBM_VMX")
 
     gmx_find_flags(
         "#include<altivec.h>
          int main(){vector float x,y=vec_ctf(vec_splat_s32(1),0);x=vec_madd(y,y,y);return vec_all_ge(y,x);}"
         TOOLCHAIN_C_FLAGS TOOLCHAIN_CXX_FLAGS
-        SIMD_${GMX_SIMD}_C_FLAGS SIMD_${GMX_SIMD}_CXX_FLAGS
+        SIMD_${GMX_SIMD_ACTIVE}_C_FLAGS SIMD_${GMX_SIMD_ACTIVE}_CXX_FLAGS
         "-maltivec -mabi=altivec" "-qarch=auto -qaltivec")
 
-    if(NOT SIMD_${GMX_SIMD}_C_FLAGS OR NOT SIMD_${GMX_SIMD}_CXX_FLAGS)
+    if(NOT SIMD_${GMX_SIMD_ACTIVE}_C_FLAGS OR NOT SIMD_${GMX_SIMD_ACTIVE}_CXX_FLAGS)
         gmx_give_fatal_error_when_simd_support_not_found("IBM VMX" "disable SIMD support (slower)" "${SUGGEST_BINUTILS_UPDATE}")
     endif()
 
     set(SIMD_C_FLAGS "${TOOLCHAIN_C_FLAGS}")
     set(SIMD_CXX_FLAGS "${TOOLCHAIN_CXX_FLAGS}")
-    set(GMX_SIMD_${GMX_SIMD} 1)
+    set(GMX_SIMD_${GMX_SIMD_ACTIVE} 1)
     set(SIMD_STATUS_MESSAGE "Enabling IBM VMX SIMD instructions")
 
-elseif(GMX_SIMD STREQUAL "IBM_VSX")
+elseif(GMX_SIMD_ACTIVE STREQUAL "IBM_VSX")
 
     prepare_power_vsx_toolchain(TOOLCHAIN_C_FLAGS TOOLCHAIN_CXX_FLAGS)
 
@@ -424,7 +431,7 @@ elseif(GMX_SIMD STREQUAL "IBM_VSX")
         "#include<altivec.h>
          int main(){vector double x,y=vec_splats(1.0);x=vec_madd(y,y,y);return vec_all_ge(y,x);}"
         TOOLCHAIN_C_FLAGS TOOLCHAIN_CXX_FLAGS
-        SIMD_${GMX_SIMD}_C_FLAGS SIMD_${GMX_SIMD}_CXX_FLAGS
+        SIMD_${GMX_SIMD_ACTIVE}_C_FLAGS SIMD_${GMX_SIMD_ACTIVE}_CXX_FLAGS
         "-mvsx" "-maltivec -mabi=altivec" "-qarch=auto -qaltivec")
 
     # Usually we check also for the C compiler here, but a C compiler
@@ -432,23 +439,23 @@ elseif(GMX_SIMD STREQUAL "IBM_VSX")
     # at least version 3.7 cannot pass this check with the C compiler
     # in the latest xlc 13.1.5, but the C++ compiler has different
     # behaviour and is OK. See Redmine #2102.
-    if(NOT SIMD_${GMX_SIMD}_CXX_FLAGS)
+    if(NOT SIMD_${GMX_SIMD_ACTIVE}_CXX_FLAGS)
         gmx_give_fatal_error_when_simd_support_not_found("IBM VSX" "disable SIMD support (slower)" "${SUGGEST_BINUTILS_UPDATE}")
     endif()
 
     set(SIMD_C_FLAGS "${TOOLCHAIN_C_FLAGS}")
     set(SIMD_CXX_FLAGS "${TOOLCHAIN_CXX_FLAGS}")
-    set(GMX_SIMD_${GMX_SIMD} 1)
+    set(GMX_SIMD_${GMX_SIMD_ACTIVE} 1)
     set(SIMD_STATUS_MESSAGE "Enabling IBM VSX SIMD instructions")
 
-elseif(GMX_SIMD STREQUAL "SPARC64_HPC_ACE")
+elseif(GMX_SIMD_ACTIVE STREQUAL "SPARC64_HPC_ACE")
 
     # Note that GMX_RELAXED_DOUBLE_PRECISION is enabled by default in the top-level CMakeLists.txt
 
-    set(GMX_SIMD_${GMX_SIMD} 1)
+    set(GMX_SIMD_${GMX_SIMD_ACTIVE} 1)
     set(SIMD_STATUS_MESSAGE "Enabling Sparc64 HPC-ACE SIMD instructions")
 
-elseif(GMX_SIMD STREQUAL "REFERENCE")
+elseif(GMX_SIMD_ACTIVE STREQUAL "REFERENCE")
 
     # NB: This file handles settings for the SIMD module, so in the interest 
     # of proper modularization, please do NOT put any verlet kernel settings in this file.
@@ -460,15 +467,15 @@ elseif(GMX_SIMD STREQUAL "REFERENCE")
        add_definitions(-DGMX_SIMD_REF_DOUBLE_WIDTH=${GMX_SIMD_REF_DOUBLE_WIDTH})
     endif()
 
-    set(GMX_SIMD_${GMX_SIMD} 1)
+    set(GMX_SIMD_${GMX_SIMD_ACTIVE} 1)
     set(SIMD_STATUS_MESSAGE "Enabling reference (emulated) SIMD instructions.")
 
 else()
-    gmx_invalid_option_value(GMX_SIMD)
+    gmx_invalid_option_value(GMX_SIMD_ACTIVE)
 endif()
 
 
-gmx_check_if_changed(SIMD_CHANGED GMX_SIMD)
+gmx_check_if_changed(SIMD_CHANGED GMX_SIMD_ACTIVE)
 if (SIMD_CHANGED AND DEFINED SIMD_STATUS_MESSAGE)
     message(STATUS "${SIMD_STATUS_MESSAGE}")
 endif()
@@ -496,7 +503,7 @@ endif()
 if(NOT DEFINED GMX_SIMD_CALLING_CONVENTION)
     if(GMX_TARGET_BGQ)
         set(CALLCONV_LIST " ")
-    elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND GMX_SIMD STREQUAL "REFERENCE")
+    elseif(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 " ")
@@ -513,5 +520,14 @@ if(NOT DEFINED GMX_SIMD_CALLING_CONVENTION)
     endforeach()
 endif()
 
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+    # GCC bug 49001, 54412 on Windows (just warn, since it might be fixed in later versions)
+    if((CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9.0" OR CMAKE_SIZEOF_VOID_P EQUAL 8)
+            AND (WIN32 OR CYGWIN)
+            AND (GMX_SIMD_ACTIVE MATCHES "AVX") AND NOT (GMX_SIMD_ACTIVE STREQUAL "AVX_128_FMA"))
+        message(WARNING "GCC on Windows (GCC older than 4.9 in 32-bit mode, or any version in 64-bit mode) with 256-bit AVX will probably crash. You might want to choose a different GMX_SIMD or a different compiler.")
+    endif()
+endif()
+
 endmacro()
 
index 12ada3d967fdb597064c9bfdd5bc64335e8fff3f..8ef96a298d184c44870bda924db76fc16bf2af90 100644 (file)
 # To help us fund GROMACS development, we humbly ask that you cite
 # the research papers on the package. Check out http://www.gromacs.org.
 
-set(GMX_TNG_MINIMUM_REQUIRED_VERSION "1.7.6")
-set(BUNDLED_TNG_LOCATION "${CMAKE_SOURCE_DIR}/src/external/tng_io")
-if(GMX_USE_TNG)
-    option(GMX_EXTERNAL_TNG "Use external TNG instead of compiling the version shipped with GROMACS." OFF)
+set(GMX_TNG_MINIMUM_REQUIRED_VERSION "1.7.10")
+
+gmx_dependent_option(
+    GMX_EXTERNAL_TNG
+    "Use external TNG instead of compiling the version shipped with GROMACS."
+    OFF
+    GMX_USE_TNG)
+gmx_dependent_option(
+    GMX_EXTERNAL_ZLIB
+    "Use external ZLIB instead of compiling the version shipped with GROMACS as part of TNG."
+    OFF
+    "NOT GMX_EXTERNAL_TNG")
 
+if(GMX_USE_TNG)
     # Detect TNG if GMX_EXTERNAL_TNG is explicitly ON
     if(GMX_EXTERNAL_TNG)
         find_package(TNG_IO ${GMX_TNG_MINIMUM_REQUIRED_VERSION})
         if(NOT TNG_IO_FOUND)
             message(FATAL_ERROR "TNG >= ${GMX_TNG_MINIMUM_REQUIRED_VERSION} not found. You can set GMX_EXTERNAL_TNG=OFF to compile the TNG bundled with GROMACS.")
         endif()
-        include_directories(SYSTEM ${TNG_IO_INCLUDE_DIRS})
     else()
-        include(${BUNDLED_TNG_LOCATION}/BuildTNG.cmake)
-        tng_get_source_list(TNG_SOURCES TNG_IO_DEFINITIONS)
-
-        if (HAVE_ZLIB)
-            list(APPEND GMX_EXTRA_LIBRARIES ${ZLIB_LIBRARIES})
-            include_directories(SYSTEM ${ZLIB_INCLUDE_DIRS})
+        # Detect zlib if the user requires us to use an external
+        # version. If found, it can be used by TNG.
+        if(GMX_EXTERNAL_ZLIB)
+            find_package(ZLIB)
+            if(NOT ZLIB_FOUND)
+                message(FATAL_ERROR "External zlib compression library was required but could not be found. Set GMX_EXTERNAL_ZLIB=OFF to compile zlib as part of GROMACS.")
+            endif()
+            include(gmxTestZLib)
+            gmx_test_zlib(HAVE_ZLIB)
+            if(NOT HAVE_ZLIB)
+                message(FATAL_ERROR "External zlib compression library was required but could not compile and link. Set GMX_EXTERNAL_ZLIB=OFF to compile zlib as part of GROMACS.")
+            endif()
         endif()
     endif()
-else()
-    # We still need to get tng/tng_io_fwd.h from somewhere!
-    include_directories(BEFORE ${BUNDLED_TNG_LOCATION}/include)
 endif()
 
+function(gmx_setup_tng_for_libgromacs)
+    set(BUNDLED_TNG_LOCATION "${CMAKE_SOURCE_DIR}/src/external/tng_io")
+    if (GMX_USE_TNG)
+        if (GMX_EXTERNAL_TNG)
+            target_link_libraries(libgromacs PRIVATE tng_io::tng_io)
+        else()
+            set(_zlib_arg)
+            if (NOT GMX_EXTERNAL_ZLIB)
+                set(_zlib_arg OWN_ZLIB)
+            endif()
+            include(${BUNDLED_TNG_LOCATION}/BuildTNG.cmake)
+            add_tng_io_library(tng_io OBJECT ${_zlib_arg})
+            add_library(tng_io::tng_io ALIAS tng_io)
+            target_link_libraries(libgromacs PRIVATE $<BUILD_INTERFACE:tng_io::tng_io>)
+        endif()
+    endif()
+endfunction()
index b698cd68793da249f58ff60e8b6cf0764f37724d..01b55c93ce2b74c72a240ade7ae692907d6e1e21 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,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.
@@ -210,13 +210,13 @@ function (GMX_SET_BOOLEAN NAME CONDITIONS)
     set(${NAME} ${${NAME}} PARENT_SCOPE)
 endfunction()
 
-# Checks if one or more cache variables have changed
+# Checks if one or more variables have changed since last call to this function
 #
 # Usage:
 #   gmx_check_if_changed(RESULT VAR1 VAR2 ... VARN)
 #
-# Sets RESULT to true if any of the given cache variables VAR1 ... VARN has
-# changes since the last call to this function for that variable.
+# Sets RESULT to true if any of the given variables VAR1 ... VARN has
+# changed since the last call to this function for that variable.
 # Changes are tracked also across CMake runs.
 function(GMX_CHECK_IF_CHANGED RESULT)
     set(_result FALSE)
index 52b60c3ea0a8a65558c1c5149f8d0aa5c781b51b..6d34b444c8d910989adfde5184e3de442ba362bb 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,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.
 # To help us fund GROMACS development, we humbly ask that you cite
 # the research papers on the package. Check out http://www.gromacs.org.
 
-# - Check the username performing the build, as well as date and time
+# Check the username performing the build, as well as date, time, and
+# build CPU features.
 #
-# gmx_set_build_information()
-#
-# The macro variables will be set to the user/host/cpu used for configuration,
-# or anonymous/unknown if it cannot be detected (windows)
+# The following variables will be set to the user/host/cpu used for
+# configuration, or anonymous/unknown if it cannot be detected
+# (Windows).
 #
 # BUILD_TIME
 # BUILD_USER
 # BUILD_CPU_FEATURES
 #
 
-# we rely on inline asm support for GNU!
-include(gmxTestInlineASM)
-
-macro(gmx_set_build_information)
-    IF(NOT DEFINED BUILD_USER)
+include(gmxDetectCpu)
 
-    gmx_test_inline_asm_gcc_x86(GMX_X86_GCC_INLINE_ASM)
+function(gmx_set_build_information)
+    if(NOT BUILD_USER)
+        if(CMAKE_HOST_UNIX)
+            execute_process( COMMAND whoami OUTPUT_VARIABLE TMP_USER OUTPUT_STRIP_TRAILING_WHITESPACE)
+            execute_process( COMMAND hostname OUTPUT_VARIABLE TMP_HOSTNAME OUTPUT_STRIP_TRAILING_WHITESPACE)
+        else()
+            set(TMP_USER "Anonymous")
+            set(TMP_HOSTNAME "unknown")
+        endif()
+        set(BUILD_USER "${TMP_USER}\@${TMP_HOSTNAME} [CMAKE]" CACHE INTERNAL "Build user")
+        message(STATUS "Setting build user - ${BUILD_USER}")
+    endif()
 
-    if(GMX_X86_GCC_INLINE_ASM)
-        set(GCC_INLINE_ASM_DEFINE "-DGMX_X86_GCC_INLINE_ASM=1")
-    else()
-        set(GCC_INLINE_ASM_DEFINE "-DGMX_X86_GCC_INLINE_ASM=0")
+    if(NOT BUILD_TIME)
+        STRING(TIMESTAMP TMP_TIME "%Y-%m-%d %H:%M:%S" UTC)
+        set(BUILD_TIME "${TMP_TIME}" CACHE INTERNAL "Build date & time")
+        message(STATUS "Setting build time - ${BUILD_TIME}")
     endif()
 
-    message(STATUS "Setting build user/date/host/cpu information")
-    if(CMAKE_HOST_UNIX)
-        execute_process( COMMAND date     OUTPUT_VARIABLE TMP_TIME    OUTPUT_STRIP_TRAILING_WHITESPACE)
-        execute_process( COMMAND whoami   OUTPUT_VARIABLE TMP_USER       OUTPUT_STRIP_TRAILING_WHITESPACE)
-        execute_process( COMMAND hostname OUTPUT_VARIABLE TMP_HOSTNAME   OUTPUT_STRIP_TRAILING_WHITESPACE)
-        set(BUILD_USER    "${TMP_USER}\@${TMP_HOSTNAME} [CMAKE]" CACHE INTERNAL "Build user")
-        set(BUILD_TIME    "${TMP_TIME}" CACHE INTERNAL "Build date & time")
-        execute_process( COMMAND uname -srm OUTPUT_VARIABLE TMP_HOST OUTPUT_STRIP_TRAILING_WHITESPACE)
-        set(BUILD_HOST    "${TMP_HOST}" CACHE INTERNAL "Build host & architecture")
-        message(STATUS "Setting build user & time - OK")
-    else()
-        set(BUILD_USER    "Anonymous\@unknown [CMAKE]" CACHE INTERNAL "Build user")
-        set(BUILD_TIME    "Unknown date" CACHE INTERNAL "Build date & time")
-        set(BUILD_HOST    "${CMAKE_HOST_SYSTEM} ${CMAKE_HOST_SYSTEM_PROCESSOR}" CACHE INTERNAL "Build host & architecture")
-        message(STATUS "Setting build user & time - not on Unix, using anonymous")
+    if(NOT BUILD_HOST)
+        if(CMAKE_HOST_UNIX)
+            execute_process( COMMAND uname -srm OUTPUT_VARIABLE TMP_HOST OUTPUT_STRIP_TRAILING_WHITESPACE)
+        else()
+            set(TMP_HOST "${CMAKE_HOST_SYSTEM} ${CMAKE_HOST_SYSTEM_PROCESSOR}")
+        endif()
+        set(BUILD_HOST "${TMP_HOST}" CACHE INTERNAL "Build host & architecture")
+        message(STATUS "Setting build host - ${BUILD_HOST}")
     endif()
 
-    # Set up some defaults that will usually be overridden
+    # Set up some defaults that will usually be overwritten
     if(CMAKE_CROSSCOMPILING)
         set(_reason ", cross-compiled")
     endif()
-    set(OUTPUT_CPU_VENDOR   "Unknown${_reason}")
-    set(OUTPUT_CPU_BRAND    "Unknown${_reason}")
-    set(OUTPUT_CPU_FAMILY   "0")
-    set(OUTPUT_CPU_MODEL    "0")
-    set(OUTPUT_CPU_STEPPING "0")
-    set(OUTPUT_CPU_FEATURES "Unknown${_reason}")
-    unset(_reason)
-
-    if(NOT CMAKE_CROSSCOMPILING)
-        # Get CPU information, e.g. for deciding what SIMD support probably exists
-        if(GMX_TARGET_X86)
-            set(GMX_TARGET_X86_VALUE 1)
-        else()
-            set(GMX_TARGET_X86_VALUE 0)
-        endif()
-        set(_compile_definitions "${GCC_INLINE_ASM_DEFINE} -I${CMAKE_SOURCE_DIR}/src -DGMX_CPUINFO_STANDALONE ${GMX_STDLIB_CXX_FLAGS} -DGMX_TARGET_X86=${GMX_TARGET_X86_VALUE}")
 
-        set(GMX_BUILDINFORMATION_BINARY "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/GmxBuildInformation${CMAKE_EXECUTABLE_SUFFIX}")
-        set(LINK_LIBRARIES "${GMX_STDLIB_LIBRARIES}")
-        # TODO Extract this try_compile to a helper function, because
-        # it duplicates code in gmxDetectSimd.cmake
-        try_compile(GMX_BUILDINFORMATION_COMPILED
-            "${CMAKE_CURRENT_BINARY_DIR}"
-            "${CMAKE_CURRENT_SOURCE_DIR}/src/gromacs/hardware/cpuinfo.cpp"
-            COMPILE_DEFINITIONS "${_compile_definitions}"
-            CMAKE_FLAGS "-DLINK_LIBRARIES=${LINK_LIBRARIES}"
-            OUTPUT_VARIABLE GMX_BUILDINFORMATION_COMPILED_OUTPUT
-            COPY_FILE ${GMX_BUILDINFORMATION_BINARY})
-        unset(_compile_definitions)
+    # Run the cpu detection. If it produces an empty output, set a
+    # local value in the parent scope with a suitable fallback (which
+    # hides the cached value).
 
-        if(GMX_BUILDINFORMATION_COMPILED)
-            # TODO Extract this duplication to a helper function (also
-            # from gmxDetectSimd.cmake)
-            if(NOT DEFINED GMX_BUILDINFORMATION_RUN_VENDOR)
-                execute_process(COMMAND ${GMX_BUILDINFORMATION_BINARY} "-vendor"
-                    RESULT_VARIABLE GMX_BUILDINFORMATION_RUN_VENDOR
-                    OUTPUT_VARIABLE OUTPUT_TMP
-                    ERROR_QUIET)
-                set(GMX_BUILDINFORMATION_RUN_VENDOR "${GMX_BUILDINFORMATION_RUN_VENDOR}" CACHE INTERNAL "Result of running cpuinfo code with arg -vendor")
-                if(GMX_BUILDINFORMATION_RUN_VENDOR EQUAL 0)
-                    string(STRIP "${OUTPUT_TMP}" OUTPUT_CPU_VENDOR)
-                endif()
-            endif()
-            if(NOT DEFINED GMX_BUILDINFORMATION_RUN_BRAND)
-                execute_process(COMMAND ${GMX_BUILDINFORMATION_BINARY} "-brand"
-                    RESULT_VARIABLE GMX_BUILDINFORMATION_RUN_BRAND
-                    OUTPUT_VARIABLE OUTPUT_TMP
-                    ERROR_QUIET)
-                set(GMX_BUILDINFORMATION_RUN_BRAND "${GMX_BUILDINFORMATION_RUN_BRAND}" CACHE INTERNAL "Result of running cpuinfo code with arg -brand")
-                if(GMX_BUILDINFORMATION_RUN_BRAND EQUAL 0)
-                    string(STRIP "${OUTPUT_TMP}" OUTPUT_CPU_BRAND)
-                endif()
-            endif()
-            if(NOT DEFINED GMX_BUILDINFORMATION_RUN_FAMILY)
-                execute_process(COMMAND ${GMX_BUILDINFORMATION_BINARY} "-family"
-                    RESULT_VARIABLE GMX_BUILDINFORMATION_RUN_FAMILY
-                    OUTPUT_VARIABLE OUTPUT_TMP
-                    ERROR_QUIET)
-                set(GMX_BUILDINFORMATION_RUN_FAMILY "${GMX_BUILDINFORMATION_RUN_FAMILY}" CACHE INTERNAL "Result of running cpuinfo code with arg -family")
-                if(GMX_BUILDINFORMATION_RUN_FAMILY EQUAL 0)
-                    string(STRIP "${OUTPUT_TMP}" OUTPUT_CPU_FAMILY)
-                endif()
-            endif()
-            if(NOT DEFINED GMX_BUILDINFORMATION_RUN_MODEL)
-                execute_process(COMMAND ${GMX_BUILDINFORMATION_BINARY} "-model"
-                    RESULT_VARIABLE GMX_BUILDINFORMATION_RUN_MODEL
-                    OUTPUT_VARIABLE OUTPUT_TMP
-                    ERROR_QUIET)
-                set(GMX_BUILDINFORMATION_RUN_MODEL "${GMX_BUILDINFORMATION_RUN_MODEL}" CACHE INTERNAL "Result of running cpuinfo code with arg -model")
-                if(GMX_BUILDINFORMATION_RUN_MODEL EQUAL 0)
-                    string(STRIP "${OUTPUT_TMP}" OUTPUT_CPU_MODEL)
-                endif()
-            endif()
-            if(NOT DEFINED GMX_BUILDINFORMATION_RUN_STEPPING)
-                execute_process(COMMAND ${GMX_BUILDINFORMATION_BINARY} "-stepping"
-                    RESULT_VARIABLE GMX_BUILDINFORMATION_RUN_STEPPING
-                    OUTPUT_VARIABLE OUTPUT_TMP
-                    ERROR_QUIET)
-                set(GMX_BUILDINFORMATION_RUN_STEPPING "${GMX_BUILDINFORMATION_RUN_STEPPING}" CACHE INTERNAL "Result of running cpuinfo code with arg -stepping")
-                if(GMX_BUILDINFORMATION_RUN_STEPPING EQUAL 0)
-                    string(STRIP "${OUTPUT_TMP}" OUTPUT_CPU_STEPPING)
-                endif()
-            endif()
-            if(NOT DEFINED GMX_BUILDINFORMATION_RUN_FEATURES)
-                execute_process(COMMAND ${GMX_BUILDINFORMATION_BINARY} "-features"
-                    RESULT_VARIABLE GMX_BUILDINFORMATION_RUN_FEATURES
-                    OUTPUT_VARIABLE OUTPUT_TMP
-                    ERROR_QUIET)
-                set(GMX_BUILDINFORMATION_RUN_FEATURES "${GMX_BUILDINFORMATION_RUN_FEATURES}" CACHE INTERNAL "Result of running cpuinfo code with arg -features")
-                if(GMX_BUILDINFORMATION_RUN_FEATURES EQUAL 0)
-                    string(STRIP "${OUTPUT_TMP}" OUTPUT_CPU_FEATURES)
-                endif()
-            endif()
+    macro(gmx_get_build_cpu_string TYPE DEFAULT_VALUE)
+        string(TOUPPER ${TYPE} UPPERTYPE)
+        gmx_run_cpu_detection(${TYPE})
+        set(OUTPUT_VALUE "${DEFAULT_VALUE}")
+        if (CPU_DETECTION_${UPPERTYPE})
+            set(OUTPUT_VALUE ${CPU_DETECTION_${UPPERTYPE}})
         endif()
-    endif()
-
-    set(BUILD_CPU_VENDOR   "${OUTPUT_CPU_VENDOR}"   CACHE INTERNAL "Build CPU vendor")
-    set(BUILD_CPU_BRAND    "${OUTPUT_CPU_BRAND}"    CACHE INTERNAL "Build CPU brand")
-    set(BUILD_CPU_FAMILY   "${OUTPUT_CPU_FAMILY}"   CACHE INTERNAL "Build CPU family")
-    set(BUILD_CPU_MODEL    "${OUTPUT_CPU_MODEL}"    CACHE INTERNAL "Build CPU model")
-    set(BUILD_CPU_STEPPING "${OUTPUT_CPU_STEPPING}" CACHE INTERNAL "Build CPU stepping")
-    set(BUILD_CPU_FEATURES "${OUTPUT_CPU_FEATURES}" CACHE INTERNAL "Build CPU features")
+        set(BUILD_CPU_${UPPERTYPE} ${OUTPUT_VALUE} PARENT_SCOPE)
+    endmacro()
 
-    ENDIF(NOT DEFINED BUILD_USER)
-endmacro(gmx_set_build_information)
+    gmx_get_build_cpu_string(vendor   "Unknown${_reason}")
+    gmx_get_build_cpu_string(brand    "Unknown${_reason}")
+    gmx_get_build_cpu_string(family   "0")
+    gmx_get_build_cpu_string(model    "0")
+    gmx_get_build_cpu_string(stepping "0")
+    gmx_get_build_cpu_string(features "Unknown${_reason}")
+endfunction()
diff --git a/cmake/gmxTestAVXMaskload.cmake b/cmake/gmxTestAVXMaskload.cmake
deleted file mode 100644 (file)
index a522d6c..0000000
+++ /dev/null
@@ -1,68 +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.
-
-#  GMX_TEST_AVX_GCC_MASKLOAD_BUG(VARIABLE AVX_CFLAGS)
-#
-#  VARIABLE will be set if the compiler is a buggy version
-#  of GCC (prior to 4.5.3, and maybe 4.6) that has an incorrect second
-#  argument to the AVX _mm256_maskload_ps() intrinsic.
-#
-#  You need to use this variable in a cmakedefine, and then handle
-#  the case separately in your code - no automatic cure, unfortunately.
-#
-MACRO(GMX_TEST_AVX_GCC_MASKLOAD_BUG VARIABLE AVX_CFLAGS)
-    IF(NOT DEFINED ${VARIABLE})
-        MESSAGE(STATUS "Checking for gcc AVX maskload bug")
-        # some compilers like clang accept both cases, 
-        # so first try a normal compile to avoid flagging those as buggy.
-        TRY_COMPILE(${VARIABLE}_COMPILEOK "${CMAKE_BINARY_DIR}"
-                    "${CMAKE_SOURCE_DIR}/cmake/TestAVXMaskload.c"
-                    COMPILE_DEFINITIONS "${AVX_CFLAGS} -DGMX_SIMD_X86_AVX_GCC_MASKLOAD_BUG=0" )
-        IF(${VARIABLE}_COMPILEOK)
-            SET(${VARIABLE} 0 CACHE INTERNAL "Work around GCC bug in AVX maskload argument" FORCE)
-            MESSAGE(STATUS "Checking for gcc AVX maskload bug - not present")
-        ELSE()
-            TRY_COMPILE(${VARIABLE}_COMPILEOK "${CMAKE_BINARY_DIR}"
-                        "${CMAKE_SOURCE_DIR}/cmake/TestAVXMaskload.c"
-                         COMPILE_DEFINITIONS "${AVX_CFLAGS} -DGMX_SIMD_X86_AVX_GCC_MASKLOAD_BUG=1" )
-            IF(${VARIABLE}_COMPILEOK)
-                SET(${VARIABLE} 1 CACHE INTERNAL "Work around GCC bug in AVX maskload argument" FORCE)
-                MESSAGE(STATUS "Checking for gcc AVX maskload bug - found, will try to work around")
-            ELSE()
-                MESSAGE(WARNING "Cannot compile AVX code - assuming gcc AVX maskload bug not present." )
-                MESSAGE(STATUS "Checking for gcc AVX maskload bug - not present")
-            ENDIF()
-        ENDIF()
-    ENDIF()
-ENDMACRO()
index f289f811db2f1aa416ff1fde014651c1a7c017df..3024495a7ccbc04ea377414587b84b4c3c17738b 100644 (file)
@@ -45,11 +45,11 @@ function(GMX_TEST_CXX11 CXX11_CXX_FLAG_NAME STDLIB_CXX_FLAG_NAME STDLIB_LIBRARIE
     # First check that the compiler is OK, and find the appropriate flag.
 
     if(WIN32 AND NOT MINGW)
-        set(CXX11_CXX_FLAG "/Qstd=c++0x")
+        set(CXX11_CXX_FLAG "/Qstd=c++11")
     elseif(CYGWIN)
-        set(CXX11_CXX_FLAG "-std=gnu++0x") #required for strdup
+        set(CXX11_CXX_FLAG "-std=gnu++11") #required for strdup
     else()
-        set(CXX11_CXX_FLAG "-std=c++0x")
+        set(CXX11_CXX_FLAG "-std=c++11")
     endif()
     CHECK_CXX_COMPILER_FLAG("${CXX11_CXX_FLAG}" CXXFLAG_STD_CXX0X)
     if(NOT CXXFLAG_STD_CXX0X)
@@ -69,10 +69,12 @@ class b: public a
 b bTest() {
   return b();
 }
-// Early patch versions of icc 16 (and perhaps earlier versions)
-// have an issue with this test, but the GROMACS tests pass,
-// so we disable this test in that sub-case.
-#if (defined __INTEL_COMPILER && __INTEL_COMPILER >= 1700) || (defined __ICL && __ICL >= 1700) || (defined __INTEL_COMPILER_UDPATE && __INTEL_COMPILER_UPDATE >= 3)
+// ICC requires that a suitable GCC is available. It is using its standard library and emulates
+// GCC behaviour based on its version. Relevant here it emulates the implementation of the move
+// constructor. This compiler check should only fail based on the compiler not GCC. The GCC version
+// is checked by the following STL check. It is known that all ICC>=15 have the proper move
+// constructor. Thus this check is disabled for ICC.
+#if !((defined __INTEL_COMPILER && __INTEL_COMPILER >= 1500) || (defined __ICL && __ICL >= 1500))
 // Test that a subclass has a proper move constructor
 struct c {
   c() {};
@@ -107,7 +109,26 @@ int main() {
   int array[5] = { 1, 2, 3, 4, 5 };
   for (int& x : array)
     x *= 2;
+  // Test alignas
+  alignas(4*sizeof(int)) int y;
 }" CXX11_SUPPORTED)
+    if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+        if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8.1")
+            message(FATAL_ERROR "GROMACS requires version 4.8.1 or later of the GNU C++ compiler for complete C++11 support")
+        endif()
+    elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+        if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.3")
+            message(FATAL_ERROR "GROMACS requires version 3.3 or later of the Clang C++ compiler for complete C++11 support")
+        endif()
+    elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
+        if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "15.0")
+            message(FATAL_ERROR "GROMACS requires version 15.0 or later of the Intel C++ compiler for complete C++11 support")
+        endif()
+    elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
+        if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.0.23026")
+            message(FATAL_ERROR "GROMACS requires version 2015 (19.0.23026) or later of the MSVC C++ compiler for complete C++11 support")
+        endif()
+    endif()
     if(CXX11_SUPPORTED)
         set(${CXX11_CXX_FLAG_NAME} ${CXX11_CXX_FLAG} PARENT_SCOPE)
     else()
@@ -129,13 +150,13 @@ int main() {
   intPointer p(new int(10));
   std::map<int, std::unique_ptr<int>> m;
   m.insert(std::make_pair(5, std::move(p)));
-  auto start = std::chrono::system_clock::now();
-  if (std::chrono::system_clock::now() - start < std::chrono::seconds(2))
+  auto start = std::chrono::steady_clock::now();
+  if (std::chrono::steady_clock::now() - start < std::chrono::seconds(2))
   {
       std::thread t;
   }
 }" CXX11_STDLIB_PRESENT)
     if(NOT CXX11_STDLIB_PRESENT)
-        message(FATAL_ERROR "This version of GROMACS requires C++11-compatible standard library. Please use a newer compiler, or a newer standard library, or use the GROMACS 5.1.x release. See the installation guide for details.")
+        message(FATAL_ERROR "This version of GROMACS requires C++11-compatible standard library. Several compilers (e.g. Clang and Intel) use GCC. For those make sure to have GCC 4.8.1 or later. Please use a newer compiler, or a newer standard library, or use the GROMACS 5.1.x release. See the installation guide for details.")
     endif()
 endfunction()
index 80bfc062f3ead631863ba40f09f26e1fada75798..2d55e192f02dd3ff4fdc3bc1dccbd1236df0633c 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,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.
@@ -44,37 +44,13 @@ macro(gmx_test_compiler_problems)
         message(WARNING "The versions of the C and C++ compilers do not match (${CMAKE_C_COMPILER_VERSION} and ${CMAKE_CXX_COMPILER_VERSION}, respectively). Mixing different C/C++ compilers can cause problems.")
     endif()
 
-    # clang 3.0 is buggy for some unknown reason detected during adding
-    # the SSE2 group kernels for GROMACS 4.6. If we ever work out what
-    # that is, we should replace these tests with a compiler feature test,
-    # update GROMACS Redmine task #1039 and perhaps report a clang bug.
-    #
-    # In the meantime, until we require CMake 2.8.10 we cannot rely on it to detect
-    # the compiler version for us. So we need a manual check for clang 3.0.
-    include(gmxDetectClang30)
-    gmx_detect_clang_3_0(COMPILER_IS_CLANG_3_0)
-    if(COMPILER_IS_CLANG_3_0)
-        message(FATAL_ERROR "Your compiler is clang version 3.0, which is known to be buggy for GROMACS. Use a different compiler.")
-    endif()
-
-    if (CMAKE_C_COMPILER_ID STREQUAL "PGI")
-        message(WARNING "Currently tested PGI compiler versions (up to 15.7) generate binaries that do not pass all regression test, and the generated binaries are significantly slower than with GCC, ICC or Clang. For now we do not recommend PGI beyond development testing - make sure to run the regressiontests.")
-    endif()
-
-    if(CMAKE_COMPILER_IS_GNUCC AND
-            (CMAKE_C_COMPILER_VERSION VERSION_LESS "4.9.0" OR CMAKE_SIZEOF_VOID_P EQUAL 8)
-            AND (WIN32 OR CYGWIN)
-            AND GMX_SIMD MATCHES "AVX" AND NOT GMX_SIMD STREQUAL AVX_128_FMA)
-        message(WARNING "GCC on Windows (GCC older than 4.9 or any version when compiling for 64bit) with AVX (other than AVX_128_FMA) crashes. Choose a different GMX_SIMD or a different compiler.") # GCC bug 49001, 54412.
-    endif()
-
-    if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND WIN32)
-        if(CMAKE_VERSION VERSION_LESS 3.0.0)
-            message(WARNING "Clang on Windows requires cmake 3.0.0")
-        endif()
-        if(CMAKE_C_COMPILER_VERSION VERSION_LESS 3.5.0)
-            message(WARNING "Clang on Windows requires clang 3.5.0")
+    # Note that we've already tested that the compiler works with C++11
+    if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+        if(WIN32 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0")
+            message(WARNING "Using Clang on Windows requires Clang 3.5.0")
         endif()
+    elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "PGI")
+        message(WARNING "Currently tested PGI compiler versions (up to 15.7) generate binaries that do not pass all regression test, and the generated binaries are significantly slower than with GCC, ICC or Clang. For now we do not recommend PGI beyond development testing - make sure to run the regressiontests.")
     endif()
 
 endmacro(gmx_test_compiler_problems)
index d87cea96fa9b0e233a58d897e07b13861a3cdec1..ec96b3b60f6f8d202bef41236ea1e8df7236610b 100644 (file)
 # The main interface to this machinery is the gmx_configure_version_file()
 # CMake function.  The signature is
 #   gmx_configure_version_file(<input> <output>
-#                              [REMOTE_HASH] [SOURCE_FILE]
+#                              [REMOTE_HASH]
 #                              [TARGET <target>]
 #                              [COMMENT <comment>])
 #   <input>      Specify the input and output files as for configure_file().
 #                This variable is much more expensive to initialize than the
 #                others, so this allows local changes in this file to only
 #                compute that value when required if that becomes necessary.
-#   SOURCE_FILE  Signals that <output> will be used as a source file.
-#                The function will set properties for the source file
-#                appropriately to signify that it is generated.
 #   TARGET       By default, this function uses add_custom_command() to
 #                generate the output file.  If TARGET is specified, then
 #                add_custom_target() is used to create a target with the given
 
 # 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 2016)
-set(GMX_VERSION_PATCH 4)
+set(GMX_VERSION_MAJOR 2017)
+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
@@ -204,8 +201,8 @@ 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 2)
-set(LIBRARY_SOVERSION_MINOR 3)
+set(LIBRARY_SOVERSION_MAJOR 3)
+set(LIBRARY_SOVERSION_MINOR 0)
 set(LIBRARY_VERSION ${LIBRARY_SOVERSION_MAJOR}.${LIBRARY_SOVERSION_MINOR}.0)
 
 #####################################################################
@@ -227,8 +224,8 @@ if (NOT SOURCE_IS_SOURCE_DISTRIBUTION AND
 endif()
 
 set(REGRESSIONTEST_VERSION "${GMX_VERSION_STRING}")
-set(REGRESSIONTEST_BRANCH "refs/heads/release-2016")
-set(REGRESSIONTEST_MD5SUM "bed92d1d9cdca66fbd2efa142b6e0dd3" CACHE INTERNAL "MD5 sum of the regressiontests tarball")
+set(REGRESSIONTEST_BRANCH "refs/heads/master")
+set(REGRESSIONTEST_MD5SUM "366438549270d005fa6def6e56ca0256")
 
 math(EXPR GMX_VERSION_NUMERIC
      "${GMX_VERSION_MAJOR}*10000 + ${GMX_VERSION_PATCH}")
@@ -356,7 +353,7 @@ unset(GMX_VERSION_CENTRAL_BASE_HASH)
 # See documentation at the top of the script.
 function (gmx_configure_version_file INFILE OUTFILE)
     include(CMakeParseArguments)
-    set(_options REMOTE_HASH SOURCE_FILE)
+    set(_options REMOTE_HASH)
     set(_one_value_args COMMENT TARGET)
     set(_multi_value_args EXTRA_VARS)
     cmake_parse_arguments(
@@ -398,7 +395,4 @@ function (gmx_configure_version_file INFILE OUTFILE)
         add_custom_target(${ARG_TARGET} DEPENDS ${OUTFILE} VERBATIM)
         gmx_set_custom_target_output(${ARG_TARGET} ${OUTFILE})
     endif()
-    if (ARG_SOURCE_FILE)
-        set_source_files_properties(${OUTFILE} PROPERTIES GENERATED true)
-    endif()
 endfunction()
index 90a2d8d25d331aedb523725d84b081b37a5fa0d6..5c41503688f835a317968e5ab89dcbb28e913f26 100644 (file)
    ...
    fun:gmx_fio_fopen
 }
-{
-   bTimeSet/tMPI_Thread_mutex_init_once
-   Memcheck:Leak
-   ...
-   fun:tMPI_Thread_mutex_init_once
-   fun:tMPI_Thread_mutex_lock
-   fun:bTimeSet
-}
-{
-   gmx_ffclose/tMPI_Thread_mutex_init_once
-   Memcheck:Leak
-   ...
-   fun:tMPI_Thread_mutex_init_once
-   fun:tMPI_Thread_mutex_lock
-   fun:gmx_ffclose
-}
 
 {
    mdrun
diff --git a/cmake/with_asan_opts.sh b/cmake/with_asan_opts.sh
new file mode 100755 (executable)
index 0000000..283368c
--- /dev/null
@@ -0,0 +1,54 @@
+#!/bin/bash
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 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.
+
+while [[ "$1" != "--" ]] ; do
+    extra_opts="$extra_opts $1"
+    shift
+done
+for opt in $ASAN_OPTIONS ; do
+    if [[ "$opt" == log_path=* ]] ; then
+        # CTest gives errors if the file does not exist, but AddressSanitizer
+        # only produces it if it finds issues...
+        log_path="${opt#log_path=}"
+        log_path="${log_path%\"}"
+        log_path="${log_path#\"}"
+        touch ${log_path}.99999
+    fi
+done
+# Suppressions are not currently necessary, but can be introduced like this.
+#path=`dirname $0`
+#export LSAN_OPTIONS="suppressions=$path/../admin/lsan-suppressions.txt"
+export ASAN_OPTIONS="$ASAN_OPTIONS $extra_opts"
+exec "$@"
index d1d613d7660a976eae9d4bf7de120b747662f7eb..a5c0b95e077a357f4fe8a4cb160a851421becab1 100644 (file)
@@ -146,7 +146,7 @@ if (SPHINX_FOUND)
         EXTRA_VARS
             SPHINX_EXTENSION_PATH RELENG_PATH
             EXPECTED_DOXYGEN_VERSION
-            GMX_CMAKE_MINIMUM_REQUIRED_VERSION REQUIRED_CUDA_VERSION
+            CMAKE_MINIMUM_REQUIRED_VERSION REQUIRED_CUDA_VERSION
             REQUIRED_OPENCL_MIN_VERSION
             REQUIRED_CUDA_COMPUTE_CAPABILITY REGRESSIONTEST_VERSION
             SOURCE_MD5SUM REGRESSIONTEST_MD5SUM_STRING
index a8bbe35e3c153b5f3ceb2bd6655ba3bc489b01b1..b7c216a81be246e658a194a4d1db193d95f1ca11 100644 (file)
@@ -39,7 +39,7 @@ gmx_version_string_full = '@GMX_VERSION_STRING_FULL@'
 regressiontest_version = '@REGRESSIONTEST_VERSION@'
 variables = [
         ('EXPECTED_DOXYGEN_VERSION', '@EXPECTED_DOXYGEN_VERSION@'),
-        ('GMX_CMAKE_MINIMUM_REQUIRED_VERSION', '@GMX_CMAKE_MINIMUM_REQUIRED_VERSION@'),
+        ('CMAKE_MINIMUM_REQUIRED_VERSION', '@CMAKE_MINIMUM_REQUIRED_VERSION@'),
         ('REQUIRED_CUDA_VERSION', '@REQUIRED_CUDA_VERSION@'),
         ('REQUIRED_CUDA_COMPUTE_CAPABILITY', '@REQUIRED_CUDA_COMPUTE_CAPABILITY@'),
         ('REQUIRED_OPENCL_MIN_VERSION', '@REQUIRED_OPENCL_MIN_VERSION@'),
index 94c0012893adb693507dcf2e75bbe6f4d8e4a6f1..6b1cbe048ba11d50fd85cd34397c29a18a36914f 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,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.
@@ -161,6 +161,8 @@ rst_epilog += """
 .. _LAM-MPI: http://www.lam-mpi.org
 .. _OpenMP: http://en.wikipedia.org/wiki/OpenMP
 .. _CMake installation page: http://www.cmake.org/install/
+.. _Ubuntu toolchain ppa page: https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test
+.. _EPEL page: https://fedoraproject.org/wiki/EPEL
 .. _running CMake: http://www.cmake.org/runningcmake/
 .. _CMake environment variables: http://cmake.org/Wiki/CMake_Useful_Variables#Environment_Variables
 .. _FFTW: http://www.fftw.org
@@ -307,7 +309,8 @@ latex_documents = [
 
 # One entry per manual page. List of tuples
 # (source start file, name, description, authors, manual section).
-execfile('conf-man.py')
+if tags.has('do_man'):
+    execfile('conf-man.py')
 
 # If true, show URL addresses after external links.
 #man_show_urls = False
index 40e3e8e90f946e43b00e36cb0f58a981d5e9dc6c..b055116cf657e3fdbbff276d1017a31ef4057a9b 100644 (file)
@@ -4,7 +4,7 @@ Build system overview
 =====================
 
 The |Gromacs| build system uses CMake (version
-|GMX_CMAKE_MINIMUM_REQUIRED_VERSION| or newer is required) to generate the
+|CMAKE_MINIMUM_REQUIRED_VERSION| or newer is required) to generate the
 actual build system for the build tool choosen by the user.  See CMake
 documentation for general introduction to CMake and how to use it.  This
 documentation focuses on how the |Gromacs| build system is organized and
index a9950b6ddf9aaf70d46e744be3878dbc5b39eefe..15dd37f56221fdb6e3ad6d240914fc0468940b06 100644 (file)
@@ -23,7 +23,7 @@ individual Doxygen commands, you should first look at Doxygen documentation
 Documentation flavors
 ---------------------
 
-The |Gromacs| source tree is set up to produce three different levels of Doxygen
+The |Gromacs| source tree is set up to produce several different levels of Doxygen
 documentation:
 
 1. Public API documentation (suffix ``-user``), which documents functions and
@@ -35,6 +35,8 @@ documentation:
    developers.
 3. Full documentation (suffix ``-full``), which includes (nearly) all (documented)
    functions and classes in the source tree.
+4. Maximally verbose documentation (suffix ``-dev``) with everything doxygen can
+   extract as well as additional internal links.
 
 Each subsequent level of documentation includes all the documentation from the
 levels above it.  The suffixes above refer to the suffixes of Doxygen input and
@@ -76,12 +78,14 @@ It is a good idea to build with all the different settings to see that the
 result is what you want, and that you do not produce any warnings.
 For local work, it is generally a good idea to set ``GMX_COMPACT_DOXYGEN=ON``
 CMake option, which removes some large generated graphs from the documentation
-and speeds up the process significantly.
+and speeds up the process significantly. There are also "fast" versions
+of the ``make`` targets that skip the additional diagrams built for the ``lib``
+level and lower.
 
 All files related to Doxygen reside in the ``docs/doxygen/`` subdirectory in the source
 and build trees.  In a freshly checked out source tree, this directory contains
 various ``Doxyfile-*.cmakein`` files.  When you run CMake, corresponding files
-``Doxyfile-user``, ``Doxyfile-lib``, and ``Doxyfile-full`` are generated at the
+``Doxyfile-user``, ``Doxyfile-lib``, ``Doxyfile-full``, ``Doxyfile-dev`` are generated at the
 corresponding location in the build tree.  There is also a
 ``Doxyfile-common.cmakein``, which is used to produce ``Doxyfile-common``.
 This file contains settings that are shared between all the input files.
@@ -89,14 +93,14 @@ This file contains settings that are shared between all the input files.
 
 You can run Doxygen directly with one of the generated files (all output will
 be produced under the current working directory), or build one of the
-``doxygen-user``, ``doxygen-lib``, and ``doxygen-full`` targets.  The targets run
+``doxygen-user``, ``doxygen-lib``, ``doxygen-full``, ``doxygen-dev`` targets.  The targets run
 Doxygen in a quieter mode and only show the warnings if there were any, and put
 the output under ``docs/html/doxygen/`` in the build tree, so that the Doxygen
 build cooperates with the broader ``webpage`` target.
 The ``doxygen-all`` target builds all three targets with less typing.
 
-The generated documentation is put under ``html-user/``, ``html-lib/``, and/or
-``html-full/``.  Open ``index.xhtml`` file from one of
+The generated documentation is put under ``html-user/``, ``html-lib/``,
+``html-full/``, and/or ``html-dev/``.  Open ``index.xhtml`` file from one of
 these subdirectories to start browsing (for |Gromacs| developers, the
 ``html-lib/`` is a reasonable starting point).  Log files with all Doxygen
 warnings are also produced as ``docs/doxygen/doxygen-*.log``, so you can inspect them after
index f2a3b36f242487ad40643bf6ea53c8e3a80eda19..98ed8e6de13445cb1831ecfd7f47a4b14b60747d 100644 (file)
@@ -10,8 +10,19 @@ these standards fully.
 
 * MSVC supports only a subset of C99 and work-arounds are required in those cases.
 * Before 7.0 (partial support in 6.5) CUDA didn't support C++11. Therefore any
-  header file which is needed (or likly will be nedded) by CUDA should not use C++11.
-* C++11 features which are not widely implemented (including in MSVC 2015 and GCC 4.6)
-  should not be used.
+  header file which is needed (or likely will be nedded) by CUDA should not use C++11.
+* We should be able to use virtually all C++ features outside of the header files
+  required by CUDA code (and OpenCL kernels), since we have gradually moved to
+  compilers that have full support for C++11.
 
 .. TODO: Copy important points from http://www.gromacs.org/index.php?title=Developer_Zone/Programming_Guide/Allowed_C%2B%2B_Features
+
+C++ Standard Library
+--------------------
+
+|Gromacs| code must support the lowest common denominator of C++11 standard library
+features available on supported platforms.
+Some modern features are useful enough to warrant back-porting.
+Consistent and forward-compatible headers are provided in ``src/gromacs/compat/``
+as described in the `Library documentation <../doxygen/html-lib/group__group__compatibility.xhtml>`_
+
index 50d5460e3fdb95a6c5e561e20197939cc221c690..17e2de5ccb15787e06785e9035e68b105cd61fb0 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,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.
@@ -86,6 +86,7 @@ if (DOXYGEN_FOUND)
         set(DOXYGEN_EXTRA_SETTINGS "@INCLUDE   = ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile-compact")
     endif()
     configure_file(Doxyfile-common.cmakein Doxyfile-common)
+    configure_file(Doxyfile-dev.cmakein Doxyfile-dev)
     configure_file(Doxyfile-full.cmakein Doxyfile-full)
     configure_file(Doxyfile-lib.cmakein Doxyfile-lib)
     configure_file(Doxyfile-user.cmakein Doxyfile-user)
@@ -144,7 +145,7 @@ if (DOXYGEN_FOUND)
             COMMAND ${CMAKE_COMMAND} -DDOCTYPE=${TYPE} -P RunDoxygen.cmake
             DEPENDS ${_deps}
             WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-            COMMENT "${COMMENT}")
+            COMMENT "${COMMENT}" USES_TERMINAL)
         if (_fast_arg)
             add_dependencies(${TARGET}-fast doxygen-version)
         endif()
@@ -171,7 +172,8 @@ if (DOXYGEN_FOUND)
                 ${CMAKE_CURRENT_SOURCE_DIR}/gmxtree.py
                 ${CMAKE_CURRENT_SOURCE_DIR}/graphbuilder.py
                 ${CMAKE_CURRENT_SOURCE_DIR}/cycle-suppressions.txt
-            COMMENT "Generating include dependency graphs for dot")
+            COMMENT "Generating include dependency graphs for dot"
+            USES_TERMINAL)
 
         # Add separate targets for converting the .dot files to .png.
         # These are not needed by the Doxygen targets, but are useful for
@@ -192,6 +194,7 @@ if (DOXYGEN_FOUND)
     add_doxygen_target(doxygen-full full "Generating full documentation with Doxygen" DEPGRAPHS)
     add_doxygen_target(doxygen-lib  lib  "Generating library documentation with Doxygen" DEPGRAPHS)
     add_doxygen_target(doxygen-user user "Generating public API documentation with Doxygen")
+    add_doxygen_target(doxygen-dev dev "Generating verbose developer docs with Doxygen" DEPGRAPHS)
     # Convenience targets to build all the documentation flavors.
     add_custom_target(doxygen-all)
     add_custom_target(doxygen-all-fast)
@@ -212,9 +215,9 @@ if (DOXYGEN_FOUND)
             --ignore ${CMAKE_CURRENT_SOURCE_DIR}/suppressions.txt
             --ignore-cycles ${CMAKE_CURRENT_SOURCE_DIR}/cycle-suppressions.txt)
         add_custom_target(check-source      COMMAND ${check_source_command}
-            COMMENT "Checking source code for various issues" VERBATIM)
+            COMMENT "Checking source code for various issues" VERBATIM USES_TERMINAL)
         add_custom_target(check-source-fast COMMAND ${check_source_command}
-            COMMENT "Checking source code for various issues" VERBATIM)
+            COMMENT "Checking source code for various issues" VERBATIM USES_TERMINAL)
         add_dependencies(check-source       doxygen-xml)
     endif()
 else()
index 3cc566c24874c7c2fbe3aed593a63f1669f47146..ee077862bc5bfddb9dba0d7a52c5a1c45f2ee836 100644 (file)
@@ -1,5 +1,11 @@
 CLASS_DIAGRAMS         = NO
 CLASS_GRAPH            = NO
 COLLABORATION_GRAPH    = NO
+GROUP_GRAPHS           = NO
+TEMPLATE_RELATIONS     = NO
 INCLUDE_GRAPH          = NO
 INCLUDED_BY_GRAPH      = NO
+CALL_GRAPH             = NO
+CALLER_GRAPH           = NO
+GRAPHICAL_HIERARCHY    = NO
+DIRECTORY_GRAPH        = NO
diff --git a/docs/doxygen/Doxyfile-dev.cmakein b/docs/doxygen/Doxyfile-dev.cmakein
new file mode 100644 (file)
index 0000000..b07564d
--- /dev/null
@@ -0,0 +1,22 @@
+@INCLUDE               = Doxyfile-common
+
+PREDEFINED            += F77_FUNC(name,NAME)=name
+
+ENABLED_SECTIONS      += libapi internal
+INTERNAL_DOCS          = YES
+EXTRACT_LOCAL_CLASSES  = YES
+EXTRACT_LOCAL_METHODS  = YES
+EXTRACT_ANON_NSPACES   = YES
+SOURCE_BROWSER         = YES
+HIDE_UNDOC_CLASSES     = NO
+HIDE_UNDOC_MEMBERS     = NO
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION    = YES
+VERBATIM_HEADERS       = YES # restore default overridden by Doxyfile-common
+
+WARN_LOGFILE           = doxygen-dev.log
+HTML_OUTPUT            = html-dev
+
+ALIASES               += inpublicapi="\ingroup group_publicapi"
+ALIASES               += inlibraryapi="\ingroup group_libraryapi"
+ALIASES               += libinternal=
index 6bb9f1e2bc5645eebd8205b11d9989d9a61702ce..b3dbe47434e2d0ac8a4f170272dfaa60cf83361e 100644 (file)
@@ -15,5 +15,4 @@ mdlib -> pulling
 simd -> hardware
 gpu_utils -> hardware
 topology -> listed-forces
-pbcutil -> mdtypes
 listed-forces -> mdlib
index a98c001e3c1403911d98029131e40ddf33a7c0bf..14bb097b0b7a42ffbbdea39853f75e9b114013f1 100644 (file)
@@ -51,6 +51,20 @@ Doxygen documentation file for directories in the source tree.
 \ingroup module_commandline
  */
 
+/*! \libinternal
+\dir src/gromacs/compat
+\brief \ref group_compatibility
+
+\ingroup group_compatibility
+ */
+
+/*! \internal
+\dir src/gromacs/compat/tests
+\brief Tests for \ref group_compatibility
+
+\ingroup group_compatibility
+ */
+
 /*! \libinternal
 \dir src/gromacs/onlinehelp
 \brief \ref module_onlinehelp
index cb6573922684e954d535e667273bddacd43f54f3..3f98b01c6587aa7ac10faf011c43b5b37612175f 100644 (file)
@@ -2,7 +2,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) 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.
@@ -410,7 +410,7 @@ class Directory(object):
         self._module = None
         self._is_test_dir = False
         if parent and parent.is_test_directory() or \
-                self._name in ('tests', 'legacytests'):
+                self._name == 'tests':
             self._is_test_dir = True
         self._is_external = False
         if parent and parent.is_external() or self._name == 'external':
index f2236d4cf5429a6cbfe8c4754c4eece52a063ec7..d934209d8c2a6144fa51403cb62bc2a74771f154 100755 (executable)
@@ -2,7 +2,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,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.
@@ -105,8 +105,10 @@ class GroupedSorter(object):
             'time.h']
     _std_c_cpp_headers = ['c' + x[:-2] for x in _std_c_headers]
     _std_cpp_headers = ['algorithm', 'array', 'chrono', 'deque', 'exception', 'fstream',
-            'functional', 'iomanip', 'ios', 'iosfwd', 'iostream', 'istream', 'iterator',
-            'limits', 'list', 'map', 'memory', 'new', 'numeric', 'ostream', 'random',
+            'functional', 'initializer_list', 'iomanip', 'ios', 'iosfwd',
+            'iostream', 'istream', 'iterator',
+            'limits', 'list', 'map', 'memory', 'mutex',
+            'new', 'numeric', 'ostream', 'random',
             'regex', 'set', 'sstream', 'stdexcept', 'streambuf', 'string', 'strstream',
             'thread', 'tuple', 'type_traits', 'typeindex', 'typeinfo', 'vector', 'utility']
 
diff --git a/docs/doxygen/lib/logging.md b/docs/doxygen/lib/logging.md
new file mode 100644 (file)
index 0000000..7cdc697
--- /dev/null
@@ -0,0 +1,53 @@
+Logging {#page_logging}
+=======
+
+Currently, mdrun is using a combination of direct C-style I/O into `fplog` and
+`stderr`, and the facilities described here.  However, more and more should get
+moved to this interface in the future.
+
+The parts that make up the logging system are shown below.
+
+\dot
+    digraph logging_overview {
+        builder [label="LoggerBuilder", URL="\ref gmx::LoggerBuilder"]
+        owner [label="LoggerOwner", URL="\ref gmx::LoggerOwner"]
+        logger [label="MDLogger", URL="\ref gmx::MDLogger"]
+        target [label="ILogTarget", URL="\ref gmx::ILogTarget"]
+        user [label="using code"]
+
+        builder -> owner [label="builds"]
+        owner -> logger
+        owner -> target [label="owns"]
+        logger -> target [label="references"]
+        user -> builder [label="set logging targets"]
+        user -> logger [label="write with\nGMX_LOG()"]
+    }
+\enddot
+
+To initialize the logging system, the using code creates an instance of
+gmx::LoggerBuilder, and sets the desired logging targets with provided methods.
+Once all targets have been initialized, the code calls
+gmx::LoggerBuilder::build() and gets a gmx::LoggerOwner, which is responsible
+of managing the memory allocated for the logger.
+
+To log information, the using code uses an gmx::MDLogger returned by
+gmx::LoggerOwner::logger() with the ::GMX_LOG macro.  Code that writes to the
+log only needs to know of this class (and helper classes used to implement the
+macro), which is a relatively simple container for references to the logging
+targets.  If there is no log target that would consume the information written
+with ::GMX_LOG, the whole statement evaluates to a conditional that reads the
+log target from a member variable and compares it against `nullptr`.  All the
+code that formats the output is skipped in this case.
+
+Currently the implementation is geared to making ::GMX_LOG behavior stable, and
+to be relatively extensible.  However, using any other approach than ::GMX_LOG
+for writing to the log should first think about how the API could be best
+organized for that.
+
+All information written to the log is composed of _log entries_.  Each
+::GMX_LOG statement writes a single log entry, meaning that newlines are
+automatically added.
+
+The logging methods are not thread-safe, so it is the responsibility of the
+calling code to only use them from a single thread or otherwise synchronize
+access.
diff --git a/docs/doxygen/lib/mdmodules.md b/docs/doxygen/lib/mdmodules.md
new file mode 100644 (file)
index 0000000..b0fa0b1
--- /dev/null
@@ -0,0 +1,154 @@
+mdrun modules {#page_mdmodules}
+=============
+
+Currently, most of mdrun is constructed as a set of C routines calling each
+other, and sharing data through a couple of common data structures (t_inputrec,
+t_forcerec, t_state etc.) that flow throughout the code.
+
+The electric field code (in `src/gromacs/applied-forces/`) implements an
+alternative concept that allows keeping everything related to the electric
+field functionality in a single place.  At least for most special-purpose
+functionality, this would hopefully provide a more maintainable approach that
+would also support more easily adding new functionality.  Some core features
+may still need stronger coupling than this provides.
+
+The rest of the page documents those parts of the modularity mechanism that
+have taken a clear form.  Generalizing and designing other parts may require
+more code to be converted to modules to have clearer requirements on what the
+mechanism needs to support and what is the best way to express that in a
+generally usable form.
+
+Structure of a module
+---------------------
+
+Each module implements a factory that returns an instance of gmx::IMDModule.
+This interface has methods that in turn refer to other interfaces:
+gmx::IMdpOptionProvider, gmx::IMDOutputProvider, and gmx::IForceProvider.
+The module also implements these interfaces (or a subset of them), and code
+outside the module only calls methods in these interfaces.
+
+See documentation of the individual interfaces for details of what they
+support.
+
+Implementation of a module
+--------------------------
+
+Modules are constructed by composition of interfaces (i.e. abstract classes,
+general with pure virtual methods lacking implementations), so that e.g.
+trajectory-writing code can loop over containers of pointers to
+gmx::IMDOutputProvider without needing to know about all the concrete types
+that might implement that interface.
+
+The module classes should not be extended by using them as a base
+class, which is expressed with the final keyword in the class
+definition. Generally, modules will implement different flavours of
+functionality, perhaps based on user choices, or available computing
+resources. This should generally be implemented by providing variable
+behaviour for the methods that are called through the above
+interfaces. Either code should branch at run time upon some data
+contained by the module (e.g. read from the mdp options), or that the
+module class should contain a pointer to an internal interface class
+whose concrete type might be chosen during setup from the set of
+implementations of that internal interface. Such an approach keeps
+separate the set of interfaces characteristic of "MD modules" from
+those that are particular to flavours of any specific module.
+
+The virtual methods that the module classes inherit from their
+interfaces should be declared as `override`, to express the intent
+that they implement a virtual function from the interface. This
+permits the compiler to check that this is true, e.g. if the interface
+class changes. The `virtual` keyword should not be specified,
+because this is redundant when `override` is used. This follows
+the Cpp Core Guidelines (guideline C.128).
+
+Handling mdp input
+------------------
+
+To accept parameters from an mdp file, a module needs to implement
+gmx::IMdpOptionProvider.
+
+initMdpOptions() should declare the required input parameters using the options
+module.  In most cases, the parameters should be declared as nested sections
+instead of a flat set of options.  The structure used should be such that in
+the future, we can get the input values from a structured mdp file (e.g., JSON
+or XML), where the structure matches the declared options.  As with other uses
+of the options module, the module needs to declare local variables where the
+values from the options will be assigned.  The defined structure will also be
+used for storing in the tpr file (see below).
+
+initMdpTransform() should declare the mapping from current flat mdp format to
+the structured format defined in initMdpOptions().  For now, this makes it
+possible to have an internal forward-looking structured representation while
+the input is still a flat list of values, but in the future it also allows
+supporting both formats side-by-side as long as that is deemed necessary.
+
+On the implementation side, the framework (and other code that interacts with
+the modules) will do the following things to make mdp input work:
+
+* When grompp reads the mdp file, it will first construct a flat
+  KeyValueTreeObject, where each input option is set as a property.
+
+  It then calls initMdpTransform() for the module(s), and uses the produced
+  transform to convert the flat tree into a structured tree, performing any
+  defined conversions in the process.  This transformation is one-way only,
+  although the framework keeps track of the origin of each value to provide
+  sensible error messages that have the original mdp option name included.
+
+  It calls initMdpOptions() for the module(s), initializing a single Options
+  object that has the input options.
+
+  It processes the structured tree using the options in two steps:
+
+  * For any option that is not specified in the input, it adds a property to
+    the tree with a default value.  For options specified in the input, the
+    values in the tree are converted to native values for the options (e.g.,
+    from string to int for integer options).
+  * It assigns the values from the tree to the Options object.  This will make
+    the values available in the local variables the module defined in
+    initMdpOptions().
+
+  Note that currently, the module(s) cannot use storeIsSet() in options to know
+  whether a particular option has been provided from the mdp file.  This will
+  always return true for all the options.  This is a limitation in the current
+  implementation, but it also, in part, enforces that the mdp file written out
+  by `gmx grompp -po` cannot produce different behavior because of set/not-set
+  differences.
+
+* grompp -po writes an mdp file that was equivalent to the input,
+  which is implemented by calling buildMdpOutput() for each module, to
+  prepare a builder object that is used with writeKeyValueTreeAsMdp().
+  As with the old flat tree, the values given by the user's input are
+  preserved, but not the ordering of options, or their formatting.
+
+* When grompp writes the tpr file, it writes the structured tree (after the
+  default value and native value conversion) into the tpr file.
+
+* When mdrun reads the tpr file, it reads the structured tree.
+  It then broadcasts the structure to all ranks.  Each rank calls
+  initMdpOptions() for the modules, and assigns the values from the tree to the
+  Options object.  After this, the modules will be exactly in the same state as
+  in grompp.
+
+* When other tools (gmx dump or gmx check in particular) read the tpr file,
+  they read the structured tree.  In principle, they could operate directly on
+  this tree (and `gmx dump` in particular does, with the `-orgir` option).
+  However, in the future with proper tpr backward compatibility support, they
+  need to call to the modules to ensure that the tree has the structure that
+  this version expects, instead of what the original version that wrote the
+  file had.  Currently, these tools only call initMdpOptions() and do the basic
+  default+native value conversion.
+
+* Any code that is not interested in the parameters for these modules can just
+  read the t_inputrec from the tpr file and ignore the tree.
+
+* For compatibility with old tpr files that did not yet have the structured
+  tree, the I/O code converts old values for the modules to parameters in the
+  structured tree (in tpxio.cpp).
+
+Currently, there is no mechanism for changing the mdp input parameters (adding
+new or removing old ones) that would maintain tpr and mdp backward
+compatibility.  The vision for this is to use the same transformation engine as
+for initMdpTransform() to support specifying version-to-version conversions for
+any changed options, and applying the necessary conversions in sequence.  The
+main challenge is keeping track of the versions to know which conversions to
+apply.
index 7cca467b7bf7e6682613bac683f2497e994376c2..81c4501d8b8cf07ed29f2625f2b357092e051db6 100644 (file)
@@ -77,6 +77,15 @@ reference data, it will generate a non-fatal Google Test failure in the current
 test.  The test can naturally also use its own test assertions for additional
 checks, but any mismatch will automatically also fail the test.
 
+It is also possible to read values of the reference data items using
+gmx::test::TestReferenceChecker, so that they can be used programmatically.
+For this to work, those items should first be written in the same test.
+This supports tests that want to both check data against a reference, and use
+that reference as a persistence layer for storing information.  This is useful
+at least for serialization tests.
+This is currently not supported for all use cases, but with some caveats, it is
+possible to use this for testing.
+
 When using floating-point values in reference data, the tolerance for the
 comparison can be influenced with
 gmx::test::TestReferenceChecker::setDefaultTolerance().
index d2f8868354967c0f974e3fd30206f2948010a414..66f717d73216b0ed5488dfa6e1d3878e668c0d62 100644 (file)
@@ -579,3 +579,26 @@ performance problem if the code does not correctly include
 in `gromacs/simd/simd.h` and requires that files using those symbols
 do the correct include. Similar checking is done for higher-level
 SIMD-management headers, e.g. `gromacs/ewald/pme-simd.h`.
+
+
+The SIMD math library
+=====================
+
+In addition to the low-level SIMD instructions, \Gromacs comes with a fairly
+extensive SIMD math library in `gromacs/simd/simd_math.h` to support various
+mathematical functions. The functions are available both in single and
+double precision (overloaded on the usual math function names), and we also
+provide a special version of functions that use double precision arguments,
+but that only evaluate the result to single precision accuracy. This is
+useful when you don’t need highly accurate results, but you want to avoid
+the overhead of doing multiple single/double conversions, or if the hardware
+architecture only provides a double precision SIMD implementation.
+
+For a few functions such as the square root and exponential that are
+performance-critical, we provide additional tempate parameters where the
+default choice is to execute the normal function version, but it is also
+possible to choose an unsafe execution path that completely bypass all
+argument checking. Make absolutely sure your arguments always fulfil the
+restrictions listed in the documentation of such a function before using it,
+and it might even be a good idea to add a note before each call to an unsafe
+function justifying why that flavor is fine to use here.
index 69f9b9e12ea3caf53eb04ccf62bd8d001de9a5ca..786d97f228f2797d38133ff9148a629f77058b5b 100644 (file)
@@ -60,6 +60,40 @@ classes.  These are not meant for direct user access, but typically reside
 in public headers because of implementation reasons.
 */
 
+/*!
+\libinternal
+\namespace gmx::compat
+\brief Compatibility aliases for standard library features.
+
+Provide consistent naming for standard library features that must be back-ported
+on some platforms.
+gmx::compat::some_feature may map to back-ported code or to a feature provided by
+the STL available on a given build platform, but by including the compatibility
+header and using the gmx::compat namespace, forward and backward compatible code
+is cleaner and clearer. In the future, when a feature is determined to be provided
+by the system on all supported platforms, references to gmx::compat::some_feature
+can be replaced, e.g. with std::some_feature, and gmx::compat::some_feature
+deprecated.
+
+Since compatibility headers are likely to be included by other
+headers, there is a risk of ambiguity if code in the gmx namespace refers to an
+unqualified name in the std namespace. To reduce ambiguity, symbol names from
+gmx::compat should not be imported into scopes that are shared between multiple
+translation units (e.g. via `using` statements in header files).
+
+\ingroup group_compatibility
+*/
+
+/*!
+\libinternal
+\defgroup group_compatibility C++ standard library compatibility helpers.
+\brief Provide uniform interface to selected C++ standard library features.
+
+For some features not available on all platforms supported by \Gromacs,
+provide back-ports or mappings to available standard library implementations
+as appropriate.
+*/
+
 /*!
 \file share/template/template.cpp
 \brief Template code for writing analysis programs.
index 5aaec1a50fe33f44f037046e7b71e796008e0b11..7ca9ce61fd371de8f21c70a09ffaf56dbd1b228a 100644 (file)
@@ -40,10 +40,8 @@ src/gromacs/gmxlib/nonbonded/nb_kernel_*/*: warning: includes "config.h" unneces
 src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/kernelutil_sparc64_hpc_ace_double.h: warning: should include "config.h"
 src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_gpu_ref.cpp: warning: includes "config.h" unnecessarily
 src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref.cpp: warning: includes "config.h" unnecessarily
-src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.cpp: warning: includes "config.h" unnecessarily
 src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h: warning: should include "config.h"
 src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h: warning: should include "nbnxn_simd.h"
-src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.cpp: warning: includes "config.h" unnecessarily
 src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h: warning: should include "nbnxn_simd.h"
 
 # Temporary while we change the SIMD implementation
@@ -52,6 +50,8 @@ src/gromacs/simd/impl_sparc64_hpc_ace/impl_sparc64_hpc_ace_common.h: warning: sh
 src/gromacs/simd/tests/scalar.cpp: warning: includes "simd.h" unnecessarily
 src/gromacs/simd/tests/scalar_math.cpp: warning: includes "simd.h" unnecessarily
 src/gromacs/simd/tests/scalar_util.cpp: warning: includes "simd.h" unnecessarily
+src/gromacs/tables/cubicsplinetable.h: warning: includes "simd.h" unnecessarily
+src/gromacs/tables/quadraticsplinetable.h: warning: includes "simd.h" unnecessarily
 
 # These are specific to Folding@Home, and easiest to suppress here
 *: warning: includes non-local file as "corewrap.h"
index a8b2bf554a23f494719f4746862a28b38227f790..3b46da5de8aac6052084f32b5315abf45185c6c4 100644 (file)
@@ -21,6 +21,8 @@ performance improvement this allows).  The main features that it provides:
    density and not limited by the cutoff.
  - Transparent fallback to a simple all-pairs search if the cutoff is too long
    for the algorithm or grid searching is not otherwise supported.
+ - Support for either N-vs-M pair search with two sets of coordinates, or for
+   all pairs within a single set of coordinates.
  - Support for computing all distances in the XY plane only (and still
    grid-based).
  - Convenience functions for finding the shortest distance or the nearest pair
@@ -83,18 +85,14 @@ PBC information:
    falls back automatically to an all-pairs search.  For correct operation, the
    grid algorithm needs three cells in each dimension, but the code can fall
    back to a non-gridded search for each dimension separately.
- - If the resulting grid has so few cells that the search would anyways
-   consider all (or nearly all) cell pairs, the search falls back to a
-   simple search.
  - The initialization also pre-calculates the shifts required across the
    periodic boundaries for triclinic cells, i.e., the fractional number of
    cells that the grid origin is shifted when crossing the periodic boundary in
    Y or Z directions.
  - Finally, all the reference positions are mapped to the grid cells.
 
-There are a few heuristic numbers in the above logic: the average number of
-particles within a cell, and the cutover point from grid to an all-pairs
-search.  These have not been particularly optimized for best performance.
+The average number of particles within a cell is somewhat heuristic in the
+above logic.  This has not been particularly optimized for best performance.
 
 When doing the search for test positions, each test position is considered
 independently:
index 0177a2717a5d932811a452cf69ff672b5889d3fe..7090ff9b4a93c3f44b9ae6d971a8e4550d4079f2 100644 (file)
@@ -60,9 +60,15 @@ give an overview of some of the topics that are documented:
 \if libapi
  - \subpage page_wrapperbinary <br/>
    Provides an overview of how the `gmx` wrapper binary is implemented.
+ - \subpage page_logging <br/>
+   Documentation for logging and status output (for now, within mdrun).
  - \subpage page_simd <br/>
    Documentation about the new SIMD module that makes it possible to write
    highly accelerated CPU code that is still portable.
+ - \subpage page_mdmodules <br/>
+   Documentation for work-in-progress modularization of parts of mdrun, that
+   should make it easier to implement additional features as add-ons on top of
+   a common interface.
  - \subpage page_refdata <br/>
    Documentation for writing tests that use reference data generated by the
    same test.
index 2f8afec88bb6a9c86dacf7d035f7cda04a9c3a47..98b6fa8b074a9eb5a1ac6b55b1b2d82e217bdd77 100644 (file)
@@ -15,7 +15,7 @@ These instructions pertain to building |Gromacs|
 Quick and dirty installation
 ----------------------------
 1. Get the latest version of your C and C++ compilers.
-2. Check that you have CMake version |GMX_CMAKE_MINIMUM_REQUIRED_VERSION| or later.
+2. Check that you have CMake version |CMAKE_MINIMUM_REQUIRED_VERSION| or later.
 3. Get and unpack the latest version of the |Gromacs| tarball.
 4. Make a separate build directory and change to it. 
 5. Run ``cmake`` with the path to the source as an argument
@@ -100,11 +100,12 @@ compiler. We recommend gcc, because it is free, widely available and
 frequently provides the best performance.
 
 You should strive to use the most recent version of your
-compiler. Minimum supported compiler versions are
+compiler. Since we require full C++11 support the minimum supported
+compiler versions are
 
-* GNU (gcc) 4.6
-* Intel (icc) 14
-* LLVM (clang) 3.4
+* GNU (gcc) 4.8.1
+* Intel (icc) 15.0
+* LLVM (clang) 3.3
 * Microsoft (MSVC) 2015
 
 Other compilers may work (Cray, Pathscale, older clang) but do
@@ -122,7 +123,7 @@ other compilers, read on.
 
 On Linux, both the Intel and clang compiler use the libstdc++ which
 comes with gcc as the default C++ library. For |Gromacs|, we require
-the compiler to support libstc++ version 4.6.1 or higher. To select a
+the compiler to support libstc++ version 4.8.1 or higher. To select a
 particular libstdc++ library, use:
 
 * For Intel: ``-DGMX_STDLIB_CXX_FLAGS=-gcc-name=/path/to/gcc/binary``
@@ -151,6 +152,11 @@ For all non-x86 platforms, your best option is typically to use gcc or
 the vendor's default or recommended compiler, and check for
 specialized information below.
 
+For updated versions of gcc to add to your Linux OS, see
+
+* Ubuntu: `Ubuntu toolchain ppa page`_
+* RHEL/CentOS: `EPEL page`_ or the RedHat Developer Toolset
+
 Compiling with parallelization options
 --------------------------------------
 
@@ -162,8 +168,10 @@ generally built into your compiler and detected automatically.
 GPU support
 ^^^^^^^^^^^
 |Gromacs| has excellent support for NVIDIA GPUs supported via CUDA.
-NVIDIA's CUDA_ version |REQUIRED_CUDA_VERSION| software development kit is required,
-and the latest version is strongly encouraged. NVIDIA GPUs with at
+On Linux with gcc, NVIDIA's CUDA_ version |REQUIRED_CUDA_VERSION|
+software development kit is required, and the latest
+version is strongly encouraged. Using Intel or Microsoft compilers
+requires version 7.0 and 8.0, respectively. NVIDIA GPUs with at
 least NVIDIA compute capability |REQUIRED_CUDA_COMPUTE_CAPABILITY| are
 required, e.g. Fermi, Kepler, Maxwell or Pascal cards. You are strongly recommended to
 get the latest CUDA version and driver supported by your hardware, but
@@ -220,7 +228,7 @@ CMake
 -----
 
 |Gromacs| builds with the CMake build system, requiring at least
-version |GMX_CMAKE_MINIMUM_REQUIRED_VERSION|. You can check whether
+version |CMAKE_MINIMUM_REQUIRED_VERSION|. You can check whether
 CMake is installed, and what version it is, with ``cmake
 --version``. If you need to install CMake, then first check whether
 your platform's package management system provides a suitable version,
@@ -1155,9 +1163,9 @@ much everywhere, it is important that we tell you where we really know
 it works because we have tested it. We do test on Linux, Windows, and
 Mac with a range of compilers and libraries for a range of our
 configuration options. Every commit in our git source code repository
-is currently tested on x86 with gcc versions ranging from 4.6 through
-5.2, and versions 16 of the Intel compiler as well as Clang
-version 3.4 through 3.8. For this, we use a variety of GNU/Linux
+is currently tested on x86 with a number of gcc versions ranging from 4.8.1
+through 6.1, versions 16 of the Intel compiler, and Clang
+versions 3.4 through 3.8. For this, we use a variety of GNU/Linux
 flavors and versions as well as recent versions of Windows. Under
 Windows, we test both MSVC 2015 and version 16 of the Intel compiler.
 For details, you can
index 2aaf6339bdf1fcf83009efa3d5f9317d6f408d48..a01b46e81c56e554d6a0337ff03f05c0bfa075f1 100644 (file)
@@ -557,6 +557,21 @@ floating operations at once. These non-bonded kernels
 are much faster than the kernels used in the group scheme for most
 types of systems, particularly on newer hardware.
 
+Additionally, when the list buffer is determined automatically as
+described below, we also apply dynamic pair list pruning. The pair list
+can be constructed infrequently, but that can lead to a lot of pairs
+in the list that are outside the cut-off range for all or most of
+the life time of this pair list. Such pairs can be pruned out by
+applying a cluster-pair kernel that only determines which clusters
+are in range. Because of the way the non-bonded data is regularized
+in {\gromacs}, this kernel is an order of magnitude faster than
+the search and the interaction kernel. On the GPU this pruning is
+overlapped with the integration on the CPU, so it is free in most
+cases. Therefore we can prune every 4-10 integration steps with
+little overhead and significantly reduce the number of cluster pairs
+in the interaction kernel. This procedure is applied automatically,
+unless the user set the pair-list buffer size manually.
+
 \ifthenelse{\equal{\gmxlite}{1}}{}{
 \subsubsection{Energy drift and pair-list buffering}
 For a canonical (NVT) ensemble, the average energy error caused by
@@ -574,7 +589,7 @@ a Gaussian $G(x)$
 of zero mean and variance $\sigma^2 = t^2 k_B T/m$. For the distance
 between two particles, the variance changes to $\sigma^2 = \sigma_{12}^2 =
 t^2 k_B T(1/m_1+1/m_2)$. Note that in practice particles usually
-interact with other particles over time $t$ and therefore the real
+interact with (bump into) other particles over time $t$ and therefore the real
 displacement distribution is much narrower.  Given a non-bonded
 interaction cut-off distance of $r_c$ and a pair-list cut-off
 $r_\ell=r_c+r_b$ for $r_b$ the Verlet buffer size, we can then
@@ -1136,6 +1151,20 @@ in temperature appear to be negligible, but no completely
 comprehensive comparisons have been carried out, and some caution must
 be taking in interpreting the results.
 
+When using temperature and/or pressure coupling the total energy is
+no longer conserved. Instead there is a \normindex{conserved energy quantity}
+the formula of which will depend on the combination or temperature and
+pressure coupling algorithm used. For all coupling algorithms, except
+for Andersen temperature coupling and Parrinello-Rahman pressure coupling
+combined with shear stress, the conserved energy quantity is computed
+and stored in the energy and log file. Note that this quantity will not
+be conserved when external forces are applied to the system, such as
+pulling on group with a changing distance or an electric field.
+Furthermore, how well the energy is conserved depends on the accuracy
+of all algorithms involved in the simulation. Usually the algorithms that
+cause most drift are constraints and the pair-list buffer, depending
+on the parameters used.
+
 \subsubsection{Berendsen temperature coupling\pawsindexquiet{Berendsen}{temperature coupling}\index{weak coupling}}
 The Berendsen algorithm mimics weak coupling with first-order 
 kinetics to an external heat bath with given temperature $T_0$. 
@@ -1193,6 +1222,13 @@ the range of 0.8 $<= \lambda <=$ 1.25, to avoid scaling by very large
 numbers which may crash the simulation. In normal use, 
 $\lambda$ will always be much closer to 1.0.
 
+The thermostat modifies the kinetic energy at each scaling step by:
+\beq
+\Delta E_k = (\lambda - 1)^2 E_k
+\eeq
+The sum of these changes over the run needs to subtracted from the total energy
+to obtain the conserved energy quantity.
+
 \subsubsection{Velocity-rescaling temperature coupling\pawsindexquiet{velocity-rescaling}{temperature coupling}}
 The velocity-rescaling thermostat~\cite{Bussi2007a} is essentially a Berendsen
 thermostat (see above) with an additional stochastic term that ensures
@@ -1206,8 +1242,6 @@ There are no additional parameters, except for a random seed.
 This thermostat produces a correct canonical ensemble and still has
 the advantage of the Berendsen thermostat: first order decay of
 temperature deviations and no oscillations.
-When an $NVT$ ensemble is used, the conserved energy quantity
-is written to the energy and log file.  
 
 \subsubsection{\normindex{Andersen thermostat}}
 One simple way to maintain a thermostatted ensemble is to take an
@@ -1479,6 +1513,18 @@ less than $10^{-4}$. The actual scaling matrix {\boldmath $\mu'$} is
 \end{array}\right).
 \eeq
 The velocities are neither scaled nor rotated.
+Since the equations of motion are modified by pressure coupling, the conserved
+energy quantity also needs to be modified. For first order pressure coupling,
+the work the barostat applies to the system every step needs to
+be subtracted from the total energy to obtain the conserved energy quantity:
+\beq
+- \sum_{i,j} (\mu_{ij} -\delta_{ij}) P_{ij} V =
+\sum_{i,j} 2(\mu_{ij} -\delta_{ij}) \Xi_{ij}
+\eeq
+where $\delta_{ij}$ is the Kronecker delta and  ${\bf \Xi}$ is the virial.
+Note that the factor 2 originates from the factor $\frac{1}{2}$
+in the virial definition (\eqnref{Xi}).
+
 
 In {\gromacs}, the Berendsen scaling can also be done isotropically, 
 which means that instead of $\ve{P}$ a diagonal matrix with elements of size
@@ -1526,8 +1572,12 @@ The equations of motion for the particles are also changed, just as
 for the Nos{\'e}-Hoover coupling. In most cases you would combine the 
 Parrinello-Rahman barostat with the Nos{\'e}-Hoover
 thermostat, but to keep it simple we only show the Parrinello-Rahman 
-modification here:
-
+modification here. The modified Hamiltonian, which will be conserved, is:
+\beq
+E_\mathrm{pot} + E_\mathrm{kin} +  \sum_i P_{ii} V +
+\sum_{i,j} \frac{1}{2} W_{ij}  \left( \frac{\de b_{ij}}{\de t} \right)^2
+\eeq
+The equations of motion for the atoms, obtained from the Hamiltonian are:
 \bea \frac {\de^2\ve{r}_i}{\de t^2} & = & \frac{\ve{F}_i}{m_i} -
 \ve{M} \frac{\de \ve{r}_i}{\de t} , \\ \ve{M} & = & \ve{b}^{-1} \left[
   \ve{b} \frac{\de \ve{b}'}{\de t} + \frac{\de \ve{b}}{\de t} \ve{b}'
index c754382c77b980f7b04224190c7e0f1c6734f0c9..cc63d51d0ad9560a3e0abd7076fd132fac7c7c2d 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,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.
@@ -51,6 +51,10 @@ basis of fixed lists.
 \item   {\em Restraints}: position restraints, angle restraints,
 distance restraints, orientation restraints and dihedral restraints, all
 based on fixed lists. 
+%\ifthenelse{\equal{\gmxlite}{1}}{}{
+\item {\em Applied Forces}:
+externally applied forces, see \chref{special}.
+%}
 \end{enumerate}
 
 \section{Non-bonded interactions}
@@ -850,7 +854,7 @@ literature OPLS and RB parameters to {\bf kJ mol$^{-1}$} in {\gromacs}.\\
 \subsubsection{Proper dihedrals: Fourier function}
 \label{subsec:Fourierdihedral}
 The OPLS potential function is given as the first three
-or four~\cite{Jorgensen2005a} cosine terms of a Fourier series.
+~\cite{Jorgensen1996} or four~\cite{Robertson2015a} cosine terms of a Fourier series.
 In {\gromacs} the four term function is implemented:
 \beq
 V_{F} (\phi_{ijkl}) ~=~ \frac{1}{2} \left[C_1(1+\cos(\phi)) + C_2(
@@ -1653,7 +1657,43 @@ virtual sites. The energy of the shell particle is then minimized at
 each time step in order to remain on the Born-Oppenheimer surface.
 
 \subsection{Simple polarization}
-This is merely a harmonic potential with equilibrium distance 0.
+This is implemented as a harmonic potential with equilibrium distance
+0.
+The input given in the topology file is the polarizability $\alpha$ (in
+{\gromacs} units) as follows:
+\begin{verbatim}
+[ polarization ]
+; Atom i  j  type  alpha
+1         2  1     0.001
+\end{verbatim}
+in this case the polarizability volume is 0.001 nm$^3$ (or 1
+{\AA$^3$}). In order to compute the harmonic force constant $k_{cs}$
+(where $cs$ stands for core-shell), the
+following is used~\cite{Maaren2001a}:
+\begin{equation}
+k_{cs} ~=~ \frac{q_s^2}{\alpha}
+\end{equation}
+where $q_s$ is the charge on the shell particle.
+
+\subsection{Anharmonic polarization}
+For the development of the Drude force field by Roux and McKerell~\cite{Lopes2013a}
+it was found
+that some particles can overpolarize and this was fixed by introducing
+a higher order term in the polarization energy:
+\begin{eqnarray}
+V_{pol} ~=& \frac{k_{cs}}{2} r_{cs}^2 & r_{cs} \le \delta \\
+            =& \frac{k_{cs}}{2} r_{cs}^2 + k_{hyp} (r_{cs}-\delta)^4 & r_{cs} > \delta
+\end{eqnarray}
+where $\delta$ is a user-defined constant that is set to 0.02 nm for
+anions in the Drude force field~\cite{HYu2010}. Since this original introduction it
+has also been used in other atom types~\cite{Lopes2013a}.
+\begin{verbatim}
+[ polarization ]
+;Atom i j    type   alpha (nm^3)    delta  khyp
+1       2       2       0.001786     0.02  16.736e8
+\end{verbatim}
+The above force constant $k_{hyp}$ corresponds to 4$\cdot$10$^8$
+kcal/mol/nm$^4$, hence the strange number.
 
 \subsection{Water polarization}
 A special potential for water that allows anisotropic polarization of
index b6d97cc0b7ea9305cd09f94464f953ec0651bc66..613bbbffc36217d1c4604defab10c0f57143049e 100644 (file)
@@ -6487,6 +6487,18 @@ pages = {2044--2053}
   pages =        "294--305",
 }
 
+@ARTICLE{HYu2010,
+  author = {Yu, Haibo and Whitfield, Troy W and Harder, Edward and Lamoureux,
+       Guillaume and Vorobyov, Igor and Anisimov, Victor M and {MacKerell,
+       Jr.}, Alexander D and Roux, Benoit},
+  title = {{Simulating Monovalent and Divalent Ions in Aqueous Solution Using
+       a Drude Polarizable Force Field}},
+  journal = BTjctc,
+  year = {2010},
+  volume = {6},
+  pages = {774--786},
+}
+
 @Article{Zettlmeissl83,
   author =       "Gerd Zettlmeissl and Rainer Rudolph and Rainer
                  Jaenicke",
@@ -8748,6 +8760,16 @@ doi = "http://dx.doi.org/10.1016/j.softx.2015.06.001"
        pages = {1986--1994}
 }
 
+@article{Caleman2008a,
+  author = {Caleman, C and van der Spoel, D},
+  title = {{Picosecond Melting of Ice by an Infrared Laser Pulse - A simulation
+       study}},
+  journal = {Angew. Chem., Int. Ed. Engl.},
+  year = {2008},
+  volume = {47},
+  pages = {1417--1420}
+}
+
 @article{Wolf2010,
        author = {Wolf, M.G. and Hoefling, M. and Aponte-Santamar\'{i}a, C. and Grubm\"{u}ller, H. and Groenhof, G.},
        title = {{g\_membed}: Efficient insertion of a membrane protein into an equilibrated lipid bilayer with minimal perturbation},
@@ -8756,3 +8778,20 @@ doi = "http://dx.doi.org/10.1016/j.softx.2015.06.001"
        volume = {31},
        pages = {2169--2174}
 }
+
+@Article{Lopes2013a,
+  author =       {Lopes, Pedro E. M. and Huang, Jing and Shim, Jihyun and Luo, Yun and Li, Hui and Roux, Benoit and MacKerell, Alexander D., Jr.},
+  title =        {Polarizable Force Field for Peptides and Proteins Based on the Classical Drude Oscillator},
+  journal =      {J. Chem. Theory Comput},
+  year =         2013,
+  volume =    9,
+  pages =     {5430-5449}}
+
+@Article{Robertson2015a,
+  author =       {Michael J. Robertson and Julian Tirado-Rives and William L. Jorgensen},
+  title =        {Improved Peptide and Protein Torsional Energetics with the OPLS-AA Force Field},
+  journal =      BTjctc,
+  year =         2015,
+  volume =    11,
+  pages =     {3499-3509}}
+
diff --git a/docs/manual/plots/field.eps b/docs/manual/plots/field.eps
new file mode 100644 (file)
index 0000000..5ac7e7d
--- /dev/null
@@ -0,0 +1,4666 @@
+%!PS-Adobe-3.0 EPSF-3.0
+%%BoundingBox: 5 8 769 591
+%%LanguageLevel: 2
+%%Creator: Grace-5.1.25
+%%CreationDate: Tue Jul  5 08:32:47 2016
+%%DocumentData: Clean8Bit
+%%Orientation: Portrait
+%%Title: field.xvg
+%%For: spoel
+%%DocumentNeededResources: (atend)
+%%EndComments
+%%BeginProlog
+/m {moveto} def
+/l {lineto} def
+/s {stroke} def
+/n {newpath} def
+/c {closepath} def
+/RL {rlineto} def
+/SLW {setlinewidth} def
+/GS {gsave} def
+/GR {grestore} def
+/SC {setcolor} def
+/SGRY {setgray} def
+/SRGB {setrgbcolor} def
+/SD {setdash} def
+/SLC {setlinecap} def
+/SLJ {setlinejoin} def
+/SCS {setcolorspace} def
+/FFSF {findfont setfont} def
+/CC {concat} def
+/PXL {n m 0 0 RL s} def
+/Color0 {1.0000 1.0000 1.0000} def
+/Color1 {0.0000 0.0000 0.0000} def
+/Color2 {1.0000 0.0000 0.0000} def
+/Color3 {0.0000 1.0000 0.0000} def
+/Color4 {0.0000 0.0000 1.0000} def
+/Color5 {1.0000 1.0000 0.0000} def
+/Color6 {0.7373 0.5608 0.5608} def
+/Color7 {0.8627 0.8627 0.8627} def
+/Color8 {0.5804 0.0000 0.8275} def
+/Color9 {0.0000 1.0000 1.0000} def
+/Color10 {1.0000 0.0000 1.0000} def
+/Color11 {1.0000 0.6471 0.0000} def
+/Color12 {0.4471 0.1294 0.7373} def
+/Color13 {0.4039 0.0275 0.2824} def
+/Color14 {0.2510 0.8784 0.8157} def
+/Color15 {0.0000 0.5451 0.0000} def
+/Color16 {0.7529 0.7529 0.7529} def
+/Color17 {0.5059 0.5059 0.5059} def
+/Color18 {0.2588 0.2588 0.2588} def
+/PTRN {
+ /pat_bits exch def 
+ <<
+  /PaintType 2
+  /PatternType 1 /TilingType 1
+  /BBox[0 0 16 16]
+  /XStep 16 /YStep 16
+  /PaintProc {
+   pop
+   16 16 true [-1 0 0 -1 16 16] pat_bits imagemask
+  }
+ >>
+ [0.0016 0 0 0.0016 0 0]
+ makepattern
+} def
+/Pattern0 {<0000000000000000000000000000000000000000000000000000000000000000> PTRN} bind def
+/Pattern1 {<ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff> PTRN} bind def
+/Pattern2 {<eeeeffffbbbbffffeeeeffffbbbbffffeeeeffffbbbbffffeeeeffffbbbbffff> PTRN} bind def
+/Pattern3 {<eeeebbbbeeeebbbbeeeebbbbeeeebbbbeeeebbbbeeeebbbbeeeebbbbeeeebbbb> PTRN} bind def
+/Pattern4 {<5555aaaa5555aaaa5555aaaa5555aaaa5555aaaa5555aaaa5555aaaa5555aaaa> PTRN} bind def
+/Pattern5 {<1111444411114444111144441111444411114444111144441111444411114444> PTRN} bind def
+/Pattern6 {<1111000044440000111100004444000011110000444400001111000044440000> PTRN} bind def
+/Pattern7 {<1010000000000000010100000000000010100000000000000101000000000000> PTRN} bind def
+/Pattern8 {<0000000000000000000000000000000000000000000000000000000000000000> PTRN} bind def
+/Pattern9 {<1e1e0f0f8787c3c3e1e1f0f078783c3c1e1e0f0f8787c3c3e1e1f0f078783c3c> PTRN} bind def
+/Pattern10 {<7878f0f0e1e1c3c387870f0f1e1e3c3c7878f0f0e1e1c3c387870f0f1e1e3c3c> PTRN} bind def
+/Pattern11 {<3333333333333333333333333333333333333333333333333333333333333333> PTRN} bind def
+/Pattern12 {<ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000> PTRN} bind def
+/Pattern13 {<8181424224241818181824244242818181814242242418181818242442428181> PTRN} bind def
+/Pattern14 {<8080404020201010080804040202010180804040202010100808040402020101> PTRN} bind def
+/Pattern15 {<0101020204040808101020204040808001010202040408081010202040408080> PTRN} bind def
+/Pattern16 {<2222222222222222222222222222222222222222222222222222222222222222> PTRN} bind def
+/Pattern17 {<0000ffff000000000000ffff000000000000ffff000000000000ffff00000000> PTRN} bind def
+/Pattern18 {<2222ffff222222222222ffff222222222222ffff222222222222ffff22222222> PTRN} bind def
+/Pattern19 {<ffffffff33333333ffffffff33333333ffffffff33333333ffffffff33333333> PTRN} bind def
+/Pattern20 {<0f0f0f0f0f0f0f0ff0f0f0f0f0f0f0f00f0f0f0f0f0f0f0ff0f0f0f0f0f0f0f0> PTRN} bind def
+/Pattern21 {<ff00ff00ff00ff00ff00ff00ff00ff0000ff00ff00ff00ff00ff00ff00ff00ff> PTRN} bind def
+/Pattern22 {<8001800180018001800180018001ffffffff8001800180018001800180018001> PTRN} bind def
+/Pattern23 {<c003c003c003c003c003c003ffffffffffffffffc003c003c003c003c003c003> PTRN} bind def
+/Pattern24 {<040404040404ffff404040404040ffff040404040404ffff404040404040ffff> PTRN} bind def
+/Pattern25 {<180018001800180018001800ffffffff001800180018001800180018ffffffff> PTRN} bind def
+/Pattern26 {<1111b8b87c7c3a3a1111a3a3c7c78b8b1111b8b87c7c3a3a1111a3a3c7c78b8b> PTRN} bind def
+/Pattern27 {<101010102828c7c70101010182827c7c101010102828c7c70101010182827c7c> PTRN} bind def
+/Pattern28 {<1c1c121211112121c1c12121111112121c1c121211112121c1c1212111111212> PTRN} bind def
+/Pattern29 {<3e3e414180808080e3e31414080808083e3e414180808080e3e3141408080808> PTRN} bind def
+/Pattern30 {<4848888884848383848488884848383848488888848483838484888848483838> PTRN} bind def
+/Pattern31 {<03030404080808080c0c12122121c0c003030404080808080c0c12122121c0c0> PTRN} bind def
+/ellipsedict 8 dict def
+ellipsedict /mtrx matrix put
+/EARC {
+ ellipsedict begin
+  /endangle exch def
+  /startangle exch def
+  /yrad exch def
+  /xrad exch def
+  /y exch def
+  /x exch def
+  /savematrix mtrx currentmatrix def
+  x y translate
+  xrad yrad scale
+  0 0 1 startangle endangle arc
+  savematrix setmatrix
+ end
+} def
+/TL {
+  /kcomp exch def
+  /linewidth exch def
+  /offset exch def
+  GS
+  0 offset rmoveto
+  linewidth SLW
+  dup stringwidth exch kcomp add exch RL s
+  GR
+} def
+/KINIT
+{
+ /kvector exch def
+ /kid 0 def
+} def
+/KPROC
+{
+ pop pop
+ kvector kid get
+ 0 rmoveto
+ /kid 1 kid add def
+} def
+/DefEncoding [
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /space
+ /exclam
+ /quotedbl
+ /numbersign
+ /dollar
+ /percent
+ /ampersand
+ /quoteright
+ /parenleft
+ /parenright
+ /asterisk
+ /plus
+ /comma
+ /hyphen
+ /period
+ /slash
+ /zero
+ /one
+ /two
+ /three
+ /four
+ /five
+ /six
+ /seven
+ /eight
+ /nine
+ /colon
+ /semicolon
+ /less
+ /equal
+ /greater
+ /question
+ /at
+ /A
+ /B
+ /C
+ /D
+ /E
+ /F
+ /G
+ /H
+ /I
+ /J
+ /K
+ /L
+ /M
+ /N
+ /O
+ /P
+ /Q
+ /R
+ /S
+ /T
+ /U
+ /V
+ /W
+ /X
+ /Y
+ /Z
+ /bracketleft
+ /backslash
+ /bracketright
+ /asciicircum
+ /underscore
+ /grave
+ /a
+ /b
+ /c
+ /d
+ /e
+ /f
+ /g
+ /h
+ /i
+ /j
+ /k
+ /l
+ /m
+ /n
+ /o
+ /p
+ /q
+ /r
+ /s
+ /t
+ /u
+ /v
+ /w
+ /x
+ /y
+ /z
+ /braceleft
+ /bar
+ /braceright
+ /asciitilde
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /.notdef
+ /space
+ /exclamdown
+ /cent
+ /sterling
+ /currency
+ /yen
+ /brokenbar
+ /section
+ /dieresis
+ /copyright
+ /ordfeminine
+ /guillemotleft
+ /logicalnot
+ /hyphen
+ /registered
+ /macron
+ /degree
+ /plusminus
+ /twosuperior
+ /threesuperior
+ /acute
+ /mu
+ /paragraph
+ /periodcentered
+ /cedilla
+ /onesuperior
+ /ordmasculine
+ /guillemotright
+ /onequarter
+ /onehalf
+ /threequarters
+ /questiondown
+ /Agrave
+ /Aacute
+ /Acircumflex
+ /Atilde
+ /Adieresis
+ /Aring
+ /AE
+ /Ccedilla
+ /Egrave
+ /Eacute
+ /Ecircumflex
+ /Edieresis
+ /Igrave
+ /Iacute
+ /Icircumflex
+ /Idieresis
+ /Eth
+ /Ntilde
+ /Ograve
+ /Oacute
+ /Ocircumflex
+ /Otilde
+ /Odieresis
+ /multiply
+ /Oslash
+ /Ugrave
+ /Uacute
+ /Ucircumflex
+ /Udieresis
+ /Yacute
+ /Thorn
+ /germandbls
+ /agrave
+ /aacute
+ /acircumflex
+ /atilde
+ /adieresis
+ /aring
+ /ae
+ /ccedilla
+ /egrave
+ /eacute
+ /ecircumflex
+ /edieresis
+ /igrave
+ /iacute
+ /icircumflex
+ /idieresis
+ /eth
+ /ntilde
+ /ograve
+ /oacute
+ /ocircumflex
+ /otilde
+ /odieresis
+ /divide
+ /oslash
+ /ugrave
+ /uacute
+ /ucircumflex
+ /udieresis
+ /yacute
+ /thorn
+ /ydieresis
+] def
+%%EndProlog
+%%BeginSetup
+%%EndSetup
+612.00 612.00 scale
+n
+0.0000 0.0000 m
+0.0000 1.0000 l
+1.2941 1.0000 l
+1.2941 0.0000 l
+c
+[/DeviceRGB] SCS
+Color0 SC
+fill
+[/DeviceRGB] SCS
+Color1 SC
+[] 0 SD
+0.0015 SLW
+0 SLC
+0 SLJ
+n
+0.1000 0.5250 m
+0.1003 0.5250 l
+0.1006 0.5250 l
+0.1009 0.5250 l
+0.1011 0.5250 l
+0.1014 0.5250 l
+0.1017 0.5250 l
+0.1020 0.5250 l
+0.1023 0.5250 l
+0.1026 0.5250 l
+0.1029 0.5250 l
+0.1031 0.5250 l
+0.1034 0.5250 l
+0.1037 0.5250 l
+0.1040 0.5250 l
+0.1043 0.5250 l
+0.1046 0.5250 l
+0.1049 0.5250 l
+0.1052 0.5250 l
+0.1054 0.5250 l
+0.1057 0.5250 l
+0.1060 0.5250 l
+0.1063 0.5250 l
+0.1066 0.5250 l
+0.1069 0.5250 l
+0.1072 0.5250 l
+0.1074 0.5250 l
+0.1077 0.5250 l
+0.1080 0.5250 l
+0.1083 0.5250 l
+0.1086 0.5250 l
+0.1089 0.5250 l
+0.1092 0.5250 l
+0.1094 0.5250 l
+0.1097 0.5250 l
+0.1100 0.5250 l
+0.1103 0.5250 l
+0.1106 0.5250 l
+0.1109 0.5250 l
+0.1112 0.5250 l
+0.1114 0.5250 l
+0.1117 0.5250 l
+0.1120 0.5250 l
+0.1123 0.5250 l
+0.1126 0.5250 l
+0.1129 0.5250 l
+0.1132 0.5250 l
+0.1135 0.5250 l
+0.1137 0.5250 l
+0.1140 0.5250 l
+0.1143 0.5250 l
+0.1146 0.5250 l
+0.1149 0.5250 l
+0.1152 0.5250 l
+0.1155 0.5250 l
+0.1157 0.5250 l
+0.1160 0.5250 l
+0.1163 0.5250 l
+0.1166 0.5250 l
+0.1169 0.5250 l
+0.1172 0.5250 l
+0.1175 0.5250 l
+0.1177 0.5250 l
+0.1180 0.5250 l
+0.1183 0.5250 l
+0.1186 0.5250 l
+0.1189 0.5250 l
+0.1192 0.5250 l
+0.1195 0.5250 l
+0.1197 0.5250 l
+0.1200 0.5250 l
+0.1203 0.5250 l
+0.1206 0.5250 l
+0.1209 0.5250 l
+0.1212 0.5250 l
+0.1215 0.5250 l
+0.1218 0.5250 l
+0.1220 0.5250 l
+0.1223 0.5250 l
+0.1226 0.5250 l
+0.1229 0.5250 l
+0.1232 0.5250 l
+0.1235 0.5250 l
+0.1238 0.5250 l
+0.1240 0.5250 l
+0.1243 0.5250 l
+0.1246 0.5250 l
+0.1249 0.5250 l
+0.1252 0.5250 l
+0.1255 0.5250 l
+0.1258 0.5250 l
+0.1260 0.5250 l
+0.1263 0.5250 l
+0.1266 0.5250 l
+0.1269 0.5250 l
+0.1272 0.5250 l
+0.1275 0.5250 l
+0.1278 0.5250 l
+0.1281 0.5250 l
+0.1283 0.5250 l
+0.1286 0.5250 l
+0.1289 0.5250 l
+0.1292 0.5250 l
+0.1295 0.5250 l
+0.1298 0.5250 l
+0.1301 0.5250 l
+0.1303 0.5250 l
+0.1306 0.5250 l
+0.1309 0.5250 l
+0.1312 0.5250 l
+0.1315 0.5250 l
+0.1318 0.5250 l
+0.1321 0.5250 l
+0.1323 0.5250 l
+0.1326 0.5250 l
+0.1329 0.5250 l
+0.1332 0.5250 l
+0.1335 0.5250 l
+0.1338 0.5250 l
+0.1341 0.5250 l
+0.1343 0.5250 l
+0.1346 0.5250 l
+0.1349 0.5250 l
+0.1352 0.5250 l
+0.1355 0.5250 l
+0.1358 0.5250 l
+0.1361 0.5250 l
+0.1364 0.5250 l
+0.1366 0.5250 l
+0.1369 0.5250 l
+0.1372 0.5250 l
+0.1375 0.5250 l
+0.1378 0.5250 l
+0.1381 0.5250 l
+0.1384 0.5250 l
+0.1386 0.5250 l
+0.1389 0.5250 l
+0.1392 0.5250 l
+0.1395 0.5250 l
+0.1398 0.5250 l
+0.1401 0.5250 l
+0.1404 0.5250 l
+0.1406 0.5250 l
+0.1409 0.5250 l
+0.1412 0.5250 l
+0.1415 0.5250 l
+0.1418 0.5250 l
+0.1421 0.5250 l
+0.1424 0.5250 l
+0.1426 0.5250 l
+0.1429 0.5250 l
+0.1432 0.5250 l
+0.1435 0.5250 l
+0.1438 0.5250 l
+0.1441 0.5250 l
+0.1444 0.5250 l
+0.1447 0.5250 l
+0.1449 0.5250 l
+0.1452 0.5250 l
+0.1455 0.5250 l
+0.1458 0.5250 l
+0.1461 0.5250 l
+0.1464 0.5250 l
+0.1467 0.5250 l
+0.1469 0.5250 l
+0.1472 0.5250 l
+0.1475 0.5250 l
+0.1478 0.5250 l
+0.1481 0.5250 l
+0.1484 0.5250 l
+0.1487 0.5250 l
+0.1489 0.5250 l
+0.1492 0.5250 l
+0.1495 0.5250 l
+0.1498 0.5250 l
+0.1501 0.5250 l
+0.1504 0.5250 l
+0.1507 0.5250 l
+0.1509 0.5250 l
+0.1512 0.5250 l
+0.1515 0.5250 l
+0.1518 0.5250 l
+0.1521 0.5250 l
+0.1524 0.5250 l
+0.1527 0.5250 l
+0.1530 0.5250 l
+0.1532 0.5250 l
+0.1535 0.5250 l
+0.1538 0.5250 l
+0.1541 0.5250 l
+0.1544 0.5250 l
+0.1547 0.5250 l
+0.1550 0.5250 l
+0.1552 0.5250 l
+0.1555 0.5250 l
+0.1558 0.5250 l
+0.1561 0.5250 l
+0.1564 0.5250 l
+0.1567 0.5250 l
+0.1570 0.5250 l
+0.1572 0.5250 l
+0.1575 0.5250 l
+0.1578 0.5250 l
+0.1581 0.5250 l
+0.1584 0.5250 l
+0.1587 0.5250 l
+0.1590 0.5250 l
+0.1592 0.5250 l
+0.1595 0.5250 l
+0.1598 0.5250 l
+0.1601 0.5250 l
+0.1604 0.5250 l
+0.1607 0.5250 l
+0.1610 0.5250 l
+0.1613 0.5250 l
+0.1615 0.5250 l
+0.1618 0.5250 l
+0.1621 0.5250 l
+0.1624 0.5250 l
+0.1627 0.5250 l
+0.1630 0.5250 l
+0.1633 0.5250 l
+0.1635 0.5250 l
+0.1638 0.5250 l
+0.1641 0.5250 l
+0.1644 0.5250 l
+0.1647 0.5250 l
+0.1650 0.5250 l
+0.1653 0.5250 l
+0.1655 0.5250 l
+0.1658 0.5250 l
+0.1661 0.5250 l
+0.1664 0.5250 l
+0.1667 0.5250 l
+0.1670 0.5250 l
+0.1673 0.5250 l
+0.1675 0.5250 l
+0.1678 0.5250 l
+0.1681 0.5250 l
+0.1684 0.5250 l
+0.1687 0.5250 l
+0.1690 0.5250 l
+0.1693 0.5250 l
+0.1696 0.5250 l
+0.1698 0.5250 l
+0.1701 0.5250 l
+0.1704 0.5250 l
+0.1707 0.5250 l
+0.1710 0.5250 l
+0.1713 0.5250 l
+0.1716 0.5250 l
+0.1718 0.5250 l
+0.1721 0.5250 l
+0.1724 0.5250 l
+0.1727 0.5250 l
+0.1730 0.5250 l
+0.1733 0.5250 l
+0.1736 0.5250 l
+0.1738 0.5250 l
+0.1741 0.5250 l
+0.1744 0.5250 l
+0.1747 0.5250 l
+0.1750 0.5250 l
+0.1753 0.5250 l
+0.1756 0.5250 l
+0.1758 0.5250 l
+0.1761 0.5250 l
+0.1764 0.5250 l
+0.1767 0.5250 l
+0.1770 0.5250 l
+0.1773 0.5250 l
+0.1776 0.5250 l
+0.1779 0.5250 l
+0.1781 0.5250 l
+0.1784 0.5250 l
+0.1787 0.5250 l
+0.1790 0.5250 l
+0.1793 0.5250 l
+0.1796 0.5250 l
+0.1799 0.5250 l
+0.1801 0.5250 l
+0.1804 0.5250 l
+0.1807 0.5250 l
+0.1810 0.5250 l
+0.1813 0.5250 l
+0.1816 0.5250 l
+0.1819 0.5250 l
+0.1821 0.5250 l
+0.1824 0.5250 l
+0.1827 0.5250 l
+0.1830 0.5250 l
+0.1833 0.5250 l
+0.1836 0.5250 l
+0.1839 0.5250 l
+0.1842 0.5250 l
+0.1844 0.5250 l
+0.1847 0.5250 l
+0.1850 0.5250 l
+0.1853 0.5250 l
+0.1856 0.5250 l
+0.1859 0.5250 l
+0.1862 0.5250 l
+0.1864 0.5250 l
+0.1867 0.5250 l
+0.1870 0.5250 l
+0.1873 0.5250 l
+0.1876 0.5250 l
+0.1879 0.5250 l
+0.1882 0.5250 l
+0.1884 0.5250 l
+0.1887 0.5250 l
+0.1890 0.5250 l
+0.1893 0.5250 l
+0.1896 0.5250 l
+0.1899 0.5250 l
+0.1902 0.5250 l
+0.1904 0.5250 l
+0.1907 0.5251 l
+0.1910 0.5251 l
+0.1913 0.5251 l
+0.1916 0.5251 l
+0.1919 0.5251 l
+0.1922 0.5251 l
+0.1925 0.5251 l
+0.1927 0.5251 l
+0.1930 0.5251 l
+0.1933 0.5251 l
+0.1936 0.5251 l
+0.1939 0.5251 l
+0.1942 0.5251 l
+0.1945 0.5251 l
+0.1947 0.5251 l
+0.1950 0.5251 l
+0.1953 0.5251 l
+0.1956 0.5251 l
+0.1959 0.5251 l
+0.1962 0.5250 l
+0.1965 0.5250 l
+0.1967 0.5250 l
+0.1970 0.5250 l
+0.1973 0.5250 l
+0.1976 0.5250 l
+0.1979 0.5250 l
+0.1982 0.5250 l
+0.1985 0.5250 l
+0.1987 0.5250 l
+0.1990 0.5250 l
+0.1993 0.5250 l
+0.1996 0.5250 l
+0.1999 0.5250 l
+0.2002 0.5250 l
+0.2005 0.5250 l
+0.2008 0.5250 l
+0.2010 0.5250 l
+0.2013 0.5249 l
+0.2016 0.5249 l
+0.2019 0.5249 l
+0.2022 0.5249 l
+0.2025 0.5249 l
+0.2028 0.5249 l
+0.2030 0.5249 l
+0.2033 0.5249 l
+0.2036 0.5249 l
+0.2039 0.5249 l
+0.2042 0.5249 l
+0.2045 0.5249 l
+0.2048 0.5249 l
+0.2050 0.5249 l
+0.2053 0.5249 l
+0.2056 0.5249 l
+0.2059 0.5249 l
+0.2062 0.5249 l
+0.2065 0.5249 l
+0.2068 0.5249 l
+0.2070 0.5249 l
+0.2073 0.5249 l
+0.2076 0.5249 l
+0.2079 0.5249 l
+0.2082 0.5249 l
+0.2085 0.5249 l
+0.2088 0.5249 l
+0.2091 0.5249 l
+0.2093 0.5250 l
+0.2096 0.5250 l
+0.2099 0.5250 l
+0.2102 0.5250 l
+0.2105 0.5250 l
+0.2108 0.5250 l
+0.2111 0.5250 l
+0.2113 0.5250 l
+0.2116 0.5250 l
+0.2119 0.5250 l
+0.2122 0.5250 l
+0.2125 0.5251 l
+0.2128 0.5251 l
+0.2131 0.5251 l
+0.2133 0.5251 l
+0.2136 0.5251 l
+0.2139 0.5251 l
+0.2142 0.5251 l
+0.2145 0.5251 l
+0.2148 0.5251 l
+0.2151 0.5251 l
+0.2153 0.5251 l
+0.2156 0.5251 l
+0.2159 0.5251 l
+0.2162 0.5251 l
+0.2165 0.5252 l
+0.2168 0.5252 l
+0.2171 0.5252 l
+0.2174 0.5252 l
+0.2176 0.5252 l
+0.2179 0.5252 l
+0.2182 0.5252 l
+0.2185 0.5251 l
+0.2188 0.5251 l
+0.2191 0.5251 l
+0.2194 0.5251 l
+0.2196 0.5251 l
+0.2199 0.5251 l
+0.2202 0.5251 l
+0.2205 0.5251 l
+0.2208 0.5251 l
+0.2211 0.5251 l
+0.2214 0.5251 l
+0.2216 0.5251 l
+0.2219 0.5250 l
+0.2222 0.5250 l
+0.2225 0.5250 l
+0.2228 0.5250 l
+0.2231 0.5250 l
+0.2234 0.5250 l
+0.2236 0.5250 l
+0.2239 0.5249 l
+0.2242 0.5249 l
+0.2245 0.5249 l
+0.2248 0.5249 l
+0.2251 0.5249 l
+0.2254 0.5249 l
+0.2257 0.5249 l
+0.2259 0.5248 l
+0.2262 0.5248 l
+0.2265 0.5248 l
+0.2268 0.5248 l
+0.2271 0.5248 l
+0.2274 0.5248 l
+0.2277 0.5248 l
+0.2279 0.5248 l
+0.2282 0.5248 l
+0.2285 0.5248 l
+0.2288 0.5248 l
+0.2291 0.5248 l
+0.2294 0.5248 l
+0.2297 0.5248 l
+0.2299 0.5248 l
+0.2302 0.5248 l
+0.2305 0.5248 l
+0.2308 0.5248 l
+0.2311 0.5248 l
+0.2314 0.5248 l
+0.2317 0.5248 l
+0.2320 0.5248 l
+0.2322 0.5248 l
+0.2325 0.5248 l
+0.2328 0.5249 l
+0.2331 0.5249 l
+0.2334 0.5249 l
+0.2337 0.5249 l
+0.2340 0.5249 l
+0.2342 0.5250 l
+0.2345 0.5250 l
+0.2348 0.5250 l
+0.2351 0.5250 l
+0.2354 0.5250 l
+0.2357 0.5251 l
+0.2360 0.5251 l
+0.2362 0.5251 l
+0.2365 0.5251 l
+0.2368 0.5252 l
+0.2371 0.5252 l
+0.2374 0.5252 l
+0.2377 0.5252 l
+0.2380 0.5252 l
+0.2382 0.5252 l
+0.2385 0.5253 l
+0.2388 0.5253 l
+0.2391 0.5253 l
+0.2394 0.5253 l
+0.2397 0.5253 l
+0.2400 0.5253 l
+0.2403 0.5253 l
+0.2405 0.5253 l
+0.2408 0.5253 l
+0.2411 0.5254 l
+0.2414 0.5254 l
+0.2417 0.5253 l
+0.2420 0.5253 l
+0.2423 0.5253 l
+0.2425 0.5253 l
+0.2428 0.5253 l
+0.2431 0.5253 l
+0.2434 0.5253 l
+0.2437 0.5253 l
+0.2440 0.5253 l
+0.2443 0.5252 l
+0.2445 0.5252 l
+0.2448 0.5252 l
+0.2451 0.5252 l
+0.2454 0.5251 l
+0.2457 0.5251 l
+0.2460 0.5251 l
+0.2463 0.5251 l
+0.2465 0.5250 l
+0.2468 0.5250 l
+0.2471 0.5250 l
+0.2474 0.5249 l
+0.2477 0.5249 l
+0.2480 0.5249 l
+0.2483 0.5248 l
+0.2486 0.5248 l
+0.2488 0.5248 l
+0.2491 0.5247 l
+0.2494 0.5247 l
+0.2497 0.5247 l
+0.2500 0.5247 l
+0.2503 0.5246 l
+0.2506 0.5246 l
+0.2508 0.5246 l
+0.2511 0.5246 l
+0.2514 0.5245 l
+0.2517 0.5245 l
+0.2520 0.5245 l
+0.2523 0.5245 l
+0.2526 0.5245 l
+0.2528 0.5245 l
+0.2531 0.5245 l
+0.2534 0.5245 l
+0.2537 0.5245 l
+0.2540 0.5245 l
+0.2543 0.5245 l
+0.2546 0.5245 l
+0.2548 0.5245 l
+0.2551 0.5245 l
+0.2554 0.5246 l
+0.2557 0.5246 l
+0.2560 0.5246 l
+0.2563 0.5246 l
+0.2566 0.5247 l
+0.2569 0.5247 l
+0.2571 0.5247 l
+0.2574 0.5248 l
+0.2577 0.5248 l
+0.2580 0.5249 l
+0.2583 0.5249 l
+0.2586 0.5250 l
+0.2589 0.5250 l
+0.2591 0.5251 l
+0.2594 0.5251 l
+0.2597 0.5251 l
+0.2600 0.5252 l
+0.2603 0.5252 l
+0.2606 0.5253 l
+0.2609 0.5253 l
+0.2611 0.5254 l
+0.2614 0.5254 l
+0.2617 0.5255 l
+0.2620 0.5255 l
+0.2623 0.5255 l
+0.2626 0.5256 l
+0.2629 0.5256 l
+0.2631 0.5256 l
+0.2634 0.5257 l
+0.2637 0.5257 l
+0.2640 0.5257 l
+0.2643 0.5257 l
+0.2646 0.5257 l
+0.2649 0.5258 l
+0.2652 0.5258 l
+0.2654 0.5258 l
+0.2657 0.5258 l
+0.2660 0.5257 l
+0.2663 0.5257 l
+0.2666 0.5257 l
+0.2669 0.5257 l
+0.2672 0.5257 l
+0.2674 0.5256 l
+0.2677 0.5256 l
+0.2680 0.5256 l
+0.2683 0.5255 l
+0.2686 0.5255 l
+0.2689 0.5254 l
+0.2692 0.5254 l
+0.2694 0.5253 l
+0.2697 0.5252 l
+0.2700 0.5252 l
+0.2703 0.5251 l
+0.2706 0.5251 l
+0.2709 0.5250 l
+0.2712 0.5249 l
+0.2714 0.5248 l
+0.2717 0.5248 l
+0.2720 0.5247 l
+0.2723 0.5246 l
+0.2726 0.5246 l
+0.2729 0.5245 l
+0.2732 0.5244 l
+0.2735 0.5244 l
+0.2737 0.5243 l
+0.2740 0.5243 l
+0.2743 0.5242 l
+0.2746 0.5242 l
+0.2749 0.5241 l
+0.2752 0.5241 l
+0.2755 0.5240 l
+0.2757 0.5240 l
+0.2760 0.5240 l
+0.2763 0.5239 l
+0.2766 0.5239 l
+0.2769 0.5239 l
+0.2772 0.5239 l
+0.2775 0.5239 l
+0.2777 0.5239 l
+0.2780 0.5239 l
+0.2783 0.5240 l
+0.2786 0.5240 l
+0.2789 0.5240 l
+0.2792 0.5241 l
+0.2795 0.5241 l
+0.2797 0.5242 l
+0.2800 0.5242 l
+0.2803 0.5243 l
+0.2806 0.5243 l
+0.2809 0.5244 l
+0.2812 0.5245 l
+0.2815 0.5246 l
+0.2818 0.5247 l
+0.2820 0.5248 l
+0.2823 0.5248 l
+0.2826 0.5249 l
+0.2829 0.5250 l
+0.2832 0.5251 l
+0.2835 0.5252 l
+0.2838 0.5253 l
+0.2840 0.5254 l
+0.2843 0.5255 l
+0.2846 0.5256 l
+0.2849 0.5257 l
+0.2852 0.5258 l
+0.2855 0.5259 l
+0.2858 0.5260 l
+0.2860 0.5261 l
+0.2863 0.5262 l
+0.2866 0.5262 l
+0.2869 0.5263 l
+0.2872 0.5263 l
+0.2875 0.5264 l
+0.2878 0.5264 l
+0.2881 0.5265 l
+0.2883 0.5265 l
+0.2886 0.5265 l
+0.2889 0.5266 l
+0.2892 0.5266 l
+0.2895 0.5266 l
+0.2898 0.5265 l
+0.2901 0.5265 l
+0.2903 0.5265 l
+0.2906 0.5264 l
+0.2909 0.5264 l
+0.2912 0.5263 l
+0.2915 0.5263 l
+0.2918 0.5262 l
+0.2921 0.5261 l
+0.2923 0.5260 l
+0.2926 0.5259 l
+0.2929 0.5258 l
+0.2932 0.5257 l
+0.2935 0.5256 l
+0.2938 0.5255 l
+0.2941 0.5253 l
+0.2943 0.5252 l
+0.2946 0.5251 l
+0.2949 0.5249 l
+0.2952 0.5248 l
+0.2955 0.5247 l
+0.2958 0.5245 l
+0.2961 0.5244 l
+0.2964 0.5242 l
+0.2966 0.5241 l
+0.2969 0.5240 l
+0.2972 0.5238 l
+0.2975 0.5237 l
+0.2978 0.5236 l
+0.2981 0.5235 l
+0.2984 0.5234 l
+0.2986 0.5233 l
+0.2989 0.5232 l
+0.2992 0.5231 l
+0.2995 0.5230 l
+0.2998 0.5229 l
+0.3001 0.5229 l
+0.3004 0.5229 l
+0.3006 0.5228 l
+0.3009 0.5228 l
+0.3012 0.5228 l
+0.3015 0.5228 l
+0.3018 0.5228 l
+0.3021 0.5229 l
+0.3024 0.5229 l
+0.3026 0.5230 l
+0.3029 0.5230 l
+0.3032 0.5231 l
+0.3035 0.5232 l
+0.3038 0.5233 l
+0.3041 0.5234 l
+0.3044 0.5236 l
+0.3047 0.5237 l
+0.3049 0.5239 l
+0.3052 0.5240 l
+0.3055 0.5242 l
+0.3058 0.5244 l
+0.3061 0.5245 l
+0.3064 0.5247 l
+0.3067 0.5249 l
+0.3069 0.5251 l
+0.3072 0.5253 l
+0.3075 0.5255 l
+0.3078 0.5257 l
+0.3081 0.5259 l
+0.3084 0.5261 l
+0.3087 0.5263 l
+0.3089 0.5265 l
+0.3092 0.5267 l
+0.3095 0.5268 l
+0.3098 0.5270 l
+0.3101 0.5272 l
+0.3104 0.5273 l
+0.3107 0.5275 l
+0.3109 0.5276 l
+0.3112 0.5277 l
+0.3115 0.5278 l
+0.3118 0.5279 l
+0.3121 0.5280 l
+0.3124 0.5280 l
+0.3127 0.5280 l
+0.3130 0.5281 l
+0.3132 0.5281 l
+0.3135 0.5281 l
+0.3138 0.5280 l
+0.3141 0.5280 l
+0.3144 0.5279 l
+0.3147 0.5278 l
+0.3150 0.5277 l
+0.3152 0.5276 l
+0.3155 0.5275 l
+0.3158 0.5273 l
+0.3161 0.5272 l
+0.3164 0.5270 l
+0.3167 0.5268 l
+0.3170 0.5266 l
+0.3172 0.5263 l
+0.3175 0.5261 l
+0.3178 0.5259 l
+0.3181 0.5256 l
+0.3184 0.5253 l
+0.3187 0.5251 l
+0.3190 0.5248 l
+0.3192 0.5245 l
+0.3195 0.5243 l
+0.3198 0.5240 l
+0.3201 0.5237 l
+0.3204 0.5234 l
+0.3207 0.5232 l
+0.3210 0.5229 l
+0.3213 0.5227 l
+0.3215 0.5224 l
+0.3218 0.5222 l
+0.3221 0.5220 l
+0.3224 0.5218 l
+0.3227 0.5216 l
+0.3230 0.5214 l
+0.3233 0.5213 l
+0.3235 0.5211 l
+0.3238 0.5210 l
+0.3241 0.5209 l
+0.3244 0.5208 l
+0.3247 0.5208 l
+0.3250 0.5208 l
+0.3253 0.5208 l
+0.3255 0.5208 l
+0.3258 0.5208 l
+0.3261 0.5209 l
+0.3264 0.5210 l
+0.3267 0.5211 l
+0.3270 0.5213 l
+0.3273 0.5214 l
+0.3275 0.5216 l
+0.3278 0.5218 l
+0.3281 0.5221 l
+0.3284 0.5223 l
+0.3287 0.5226 l
+0.3290 0.5229 l
+0.3293 0.5232 l
+0.3296 0.5235 l
+0.3298 0.5239 l
+0.3301 0.5242 l
+0.3304 0.5246 l
+0.3307 0.5249 l
+0.3310 0.5253 l
+0.3313 0.5257 l
+0.3316 0.5261 l
+0.3318 0.5264 l
+0.3321 0.5268 l
+0.3324 0.5272 l
+0.3327 0.5275 l
+0.3330 0.5279 l
+0.3333 0.5282 l
+0.3336 0.5286 l
+0.3338 0.5289 l
+0.3341 0.5292 l
+0.3344 0.5295 l
+0.3347 0.5297 l
+0.3350 0.5299 l
+0.3353 0.5302 l
+0.3356 0.5303 l
+0.3359 0.5305 l
+0.3361 0.5306 l
+0.3364 0.5307 l
+0.3367 0.5308 l
+0.3370 0.5308 l
+0.3373 0.5308 l
+0.3376 0.5308 l
+0.3379 0.5307 l
+0.3381 0.5306 l
+0.3384 0.5305 l
+0.3387 0.5303 l
+0.3390 0.5301 l
+0.3393 0.5298 l
+0.3396 0.5296 l
+0.3399 0.5293 l
+0.3401 0.5290 l
+0.3404 0.5286 l
+0.3407 0.5282 l
+0.3410 0.5278 l
+0.3413 0.5274 l
+0.3416 0.5270 l
+0.3419 0.5265 l
+0.3421 0.5260 l
+0.3424 0.5255 l
+0.3427 0.5250 l
+0.3430 0.5245 l
+0.3433 0.5240 l
+0.3436 0.5235 l
+0.3439 0.5230 l
+0.3442 0.5225 l
+0.3444 0.5220 l
+0.3447 0.5215 l
+0.3450 0.5210 l
+0.3453 0.5206 l
+0.3456 0.5201 l
+0.3459 0.5197 l
+0.3462 0.5193 l
+0.3464 0.5189 l
+0.3467 0.5186 l
+0.3470 0.5183 l
+0.3473 0.5180 l
+0.3476 0.5178 l
+0.3479 0.5176 l
+0.3482 0.5174 l
+0.3484 0.5173 l
+0.3487 0.5172 l
+0.3490 0.5172 l
+0.3493 0.5172 l
+0.3496 0.5172 l
+0.3499 0.5173 l
+0.3502 0.5175 l
+0.3504 0.5177 l
+0.3507 0.5179 l
+0.3510 0.5182 l
+0.3513 0.5185 l
+0.3516 0.5189 l
+0.3519 0.5193 l
+0.3522 0.5197 l
+0.3525 0.5202 l
+0.3527 0.5207 l
+0.3530 0.5212 l
+0.3533 0.5218 l
+0.3536 0.5224 l
+0.3539 0.5230 l
+0.3542 0.5237 l
+0.3545 0.5243 l
+0.3547 0.5250 l
+0.3550 0.5257 l
+0.3553 0.5264 l
+0.3556 0.5271 l
+0.3559 0.5278 l
+0.3562 0.5284 l
+0.3565 0.5291 l
+0.3567 0.5298 l
+0.3570 0.5304 l
+0.3573 0.5310 l
+0.3576 0.5316 l
+0.3579 0.5322 l
+0.3582 0.5327 l
+0.3585 0.5332 l
+0.3587 0.5336 l
+0.3590 0.5341 l
+0.3593 0.5344 l
+0.3596 0.5347 l
+0.3599 0.5350 l
+0.3602 0.5352 l
+0.3605 0.5353 l
+0.3608 0.5354 l
+0.3610 0.5355 l
+0.3613 0.5355 l
+0.3616 0.5354 l
+0.3619 0.5352 l
+0.3622 0.5350 l
+0.3625 0.5348 l
+0.3628 0.5344 l
+0.3630 0.5341 l
+0.3633 0.5336 l
+0.3636 0.5331 l
+0.3639 0.5326 l
+0.3642 0.5320 l
+0.3645 0.5313 l
+0.3648 0.5306 l
+0.3650 0.5299 l
+0.3653 0.5291 l
+0.3656 0.5283 l
+0.3659 0.5275 l
+0.3662 0.5266 l
+0.3665 0.5258 l
+0.3668 0.5249 l
+0.3670 0.5240 l
+0.3673 0.5230 l
+0.3676 0.5221 l
+0.3679 0.5212 l
+0.3682 0.5203 l
+0.3685 0.5194 l
+0.3688 0.5186 l
+0.3691 0.5177 l
+0.3693 0.5169 l
+0.3696 0.5161 l
+0.3699 0.5154 l
+0.3702 0.5147 l
+0.3705 0.5141 l
+0.3708 0.5135 l
+0.3711 0.5129 l
+0.3713 0.5125 l
+0.3716 0.5121 l
+0.3719 0.5117 l
+0.3722 0.5115 l
+0.3725 0.5113 l
+0.3728 0.5112 l
+0.3731 0.5111 l
+0.3733 0.5112 l
+0.3736 0.5113 l
+0.3739 0.5115 l
+0.3742 0.5118 l
+0.3745 0.5121 l
+0.3748 0.5126 l
+0.3751 0.5131 l
+0.3753 0.5137 l
+0.3756 0.5144 l
+0.3759 0.5151 l
+0.3762 0.5159 l
+0.3765 0.5167 l
+0.3768 0.5177 l
+0.3771 0.5186 l
+0.3774 0.5197 l
+0.3776 0.5207 l
+0.3779 0.5218 l
+0.3782 0.5230 l
+0.3785 0.5241 l
+0.3788 0.5253 l
+0.3791 0.5265 l
+0.3794 0.5277 l
+0.3796 0.5289 l
+0.3799 0.5301 l
+0.3802 0.5313 l
+0.3805 0.5324 l
+0.3808 0.5336 l
+0.3811 0.5347 l
+0.3814 0.5357 l
+0.3816 0.5367 l
+0.3819 0.5377 l
+0.3822 0.5386 l
+0.3825 0.5394 l
+0.3828 0.5402 l
+0.3831 0.5409 l
+0.3834 0.5415 l
+0.3836 0.5420 l
+0.3839 0.5424 l
+0.3842 0.5427 l
+0.3845 0.5430 l
+0.3848 0.5431 l
+0.3851 0.5431 l
+0.3854 0.5431 l
+0.3857 0.5429 l
+0.3859 0.5426 l
+0.3862 0.5422 l
+0.3865 0.5417 l
+0.3868 0.5411 l
+0.3871 0.5404 l
+0.3874 0.5397 l
+0.3877 0.5388 l
+0.3879 0.5378 l
+0.3882 0.5368 l
+0.3885 0.5356 l
+0.3888 0.5344 l
+0.3891 0.5331 l
+0.3894 0.5318 l
+0.3897 0.5304 l
+0.3899 0.5290 l
+0.3902 0.5275 l
+0.3905 0.5260 l
+0.3908 0.5244 l
+0.3911 0.5229 l
+0.3914 0.5213 l
+0.3917 0.5198 l
+0.3920 0.5182 l
+0.3922 0.5167 l
+0.3925 0.5152 l
+0.3928 0.5137 l
+0.3931 0.5123 l
+0.3934 0.5109 l
+0.3937 0.5096 l
+0.3940 0.5084 l
+0.3942 0.5072 l
+0.3945 0.5062 l
+0.3948 0.5052 l
+0.3951 0.5044 l
+0.3954 0.5036 l
+0.3957 0.5029 l
+0.3960 0.5024 l
+0.3962 0.5020 l
+0.3965 0.5017 l
+0.3968 0.5016 l
+0.3971 0.5016 l
+0.3974 0.5017 l
+0.3977 0.5019 l
+0.3980 0.5023 l
+0.3982 0.5028 l
+0.3985 0.5035 l
+0.3988 0.5043 l
+0.3991 0.5052 l
+0.3994 0.5062 l
+0.3997 0.5073 l
+0.4000 0.5086 l
+0.4003 0.5100 l
+0.4005 0.5115 l
+0.4008 0.5130 l
+0.4011 0.5147 l
+0.4014 0.5164 l
+0.4017 0.5182 l
+0.4020 0.5201 l
+0.4023 0.5220 l
+0.4025 0.5240 l
+0.4028 0.5260 l
+0.4031 0.5280 l
+0.4034 0.5300 l
+0.4037 0.5320 l
+0.4040 0.5340 l
+0.4043 0.5359 l
+0.4045 0.5378 l
+0.4048 0.5397 l
+0.4051 0.5415 l
+0.4054 0.5433 l
+0.4057 0.5449 l
+0.4060 0.5465 l
+0.4063 0.5479 l
+0.4065 0.5493 l
+0.4068 0.5505 l
+0.4071 0.5516 l
+0.4074 0.5525 l
+0.4077 0.5533 l
+0.4080 0.5540 l
+0.4083 0.5545 l
+0.4086 0.5548 l
+0.4088 0.5550 l
+0.4091 0.5550 l
+0.4094 0.5548 l
+0.4097 0.5545 l
+0.4100 0.5539 l
+0.4103 0.5533 l
+0.4106 0.5524 l
+0.4108 0.5514 l
+0.4111 0.5502 l
+0.4114 0.5489 l
+0.4117 0.5474 l
+0.4120 0.5457 l
+0.4123 0.5440 l
+0.4126 0.5421 l
+0.4128 0.5400 l
+0.4131 0.5379 l
+0.4134 0.5357 l
+0.4137 0.5334 l
+0.4140 0.5310 l
+0.4143 0.5285 l
+0.4146 0.5260 l
+0.4148 0.5235 l
+0.4151 0.5210 l
+0.4154 0.5184 l
+0.4157 0.5159 l
+0.4160 0.5133 l
+0.4163 0.5108 l
+0.4166 0.5084 l
+0.4169 0.5060 l
+0.4171 0.5038 l
+0.4174 0.5016 l
+0.4177 0.4995 l
+0.4180 0.4975 l
+0.4183 0.4957 l
+0.4186 0.4940 l
+0.4189 0.4925 l
+0.4191 0.4912 l
+0.4194 0.4900 l
+0.4197 0.4890 l
+0.4200 0.4882 l
+0.4203 0.4876 l
+0.4206 0.4872 l
+0.4209 0.4870 l
+0.4211 0.4871 l
+0.4214 0.4873 l
+0.4217 0.4878 l
+0.4220 0.4885 l
+0.4223 0.4894 l
+0.4226 0.4905 l
+0.4229 0.4918 l
+0.4231 0.4934 l
+0.4234 0.4951 l
+0.4237 0.4970 l
+0.4240 0.4991 l
+0.4243 0.5013 l
+0.4246 0.5038 l
+0.4249 0.5063 l
+0.4252 0.5090 l
+0.4254 0.5119 l
+0.4257 0.5148 l
+0.4260 0.5178 l
+0.4263 0.5209 l
+0.4266 0.5241 l
+0.4269 0.5272 l
+0.4272 0.5305 l
+0.4274 0.5337 l
+0.4277 0.5369 l
+0.4280 0.5400 l
+0.4283 0.5431 l
+0.4286 0.5462 l
+0.4289 0.5491 l
+0.4292 0.5520 l
+0.4294 0.5547 l
+0.4297 0.5573 l
+0.4300 0.5597 l
+0.4303 0.5620 l
+0.4306 0.5641 l
+0.4309 0.5659 l
+0.4312 0.5676 l
+0.4314 0.5690 l
+0.4317 0.5702 l
+0.4320 0.5712 l
+0.4323 0.5719 l
+0.4326 0.5723 l
+0.4329 0.5725 l
+0.4332 0.5724 l
+0.4335 0.5721 l
+0.4337 0.5714 l
+0.4340 0.5705 l
+0.4343 0.5694 l
+0.4346 0.5679 l
+0.4349 0.5662 l
+0.4352 0.5643 l
+0.4355 0.5621 l
+0.4357 0.5597 l
+0.4360 0.5570 l
+0.4363 0.5542 l
+0.4366 0.5511 l
+0.4369 0.5479 l
+0.4372 0.5445 l
+0.4375 0.5410 l
+0.4377 0.5373 l
+0.4380 0.5335 l
+0.4383 0.5297 l
+0.4386 0.5257 l
+0.4389 0.5218 l
+0.4392 0.5178 l
+0.4395 0.5138 l
+0.4397 0.5098 l
+0.4400 0.5059 l
+0.4403 0.5020 l
+0.4406 0.4982 l
+0.4409 0.4946 l
+0.4412 0.4911 l
+0.4415 0.4877 l
+0.4418 0.4845 l
+0.4420 0.4816 l
+0.4423 0.4788 l
+0.4426 0.4762 l
+0.4429 0.4740 l
+0.4432 0.4720 l
+0.4435 0.4702 l
+0.4438 0.4688 l
+0.4440 0.4676 l
+0.4443 0.4668 l
+0.4446 0.4663 l
+0.4449 0.4662 l
+0.4452 0.4663 l
+0.4455 0.4668 l
+0.4458 0.4677 l
+0.4460 0.4688 l
+0.4463 0.4703 l
+0.4466 0.4721 l
+0.4469 0.4743 l
+0.4472 0.4767 l
+0.4475 0.4795 l
+0.4478 0.4825 l
+0.4481 0.4858 l
+0.4483 0.4894 l
+0.4486 0.4932 l
+0.4489 0.4972 l
+0.4492 0.5014 l
+0.4495 0.5058 l
+0.4498 0.5104 l
+0.4501 0.5150 l
+0.4503 0.5198 l
+0.4506 0.5246 l
+0.4509 0.5295 l
+0.4512 0.5345 l
+0.4515 0.5394 l
+0.4518 0.5442 l
+0.4521 0.5491 l
+0.4523 0.5538 l
+0.4526 0.5584 l
+0.4529 0.5629 l
+0.4532 0.5672 l
+0.4535 0.5712 l
+0.4538 0.5751 l
+0.4541 0.5787 l
+0.4543 0.5821 l
+0.4546 0.5852 l
+0.4549 0.5879 l
+0.4552 0.5903 l
+0.4555 0.5924 l
+0.4558 0.5941 l
+0.4561 0.5954 l
+0.4564 0.5964 l
+0.4566 0.5969 l
+0.4569 0.5971 l
+0.4572 0.5968 l
+0.4575 0.5961 l
+0.4578 0.5950 l
+0.4581 0.5935 l
+0.4584 0.5916 l
+0.4586 0.5894 l
+0.4589 0.5867 l
+0.4592 0.5836 l
+0.4595 0.5802 l
+0.4598 0.5764 l
+0.4601 0.5724 l
+0.4604 0.5680 l
+0.4606 0.5633 l
+0.4609 0.5583 l
+0.4612 0.5532 l
+0.4615 0.5478 l
+0.4618 0.5422 l
+0.4621 0.5365 l
+0.4624 0.5307 l
+0.4626 0.5248 l
+0.4629 0.5188 l
+0.4632 0.5128 l
+0.4635 0.5068 l
+0.4638 0.5009 l
+0.4641 0.4951 l
+0.4644 0.4893 l
+0.4647 0.4838 l
+0.4649 0.4784 l
+0.4652 0.4732 l
+0.4655 0.4683 l
+0.4658 0.4636 l
+0.4661 0.4593 l
+0.4664 0.4552 l
+0.4667 0.4516 l
+0.4669 0.4483 l
+0.4672 0.4455 l
+0.4675 0.4430 l
+0.4678 0.4410 l
+0.4681 0.4395 l
+0.4684 0.4384 l
+0.4687 0.4378 l
+0.4689 0.4377 l
+0.4692 0.4381 l
+0.4695 0.4390 l
+0.4698 0.4404 l
+0.4701 0.4423 l
+0.4704 0.4447 l
+0.4707 0.4475 l
+0.4709 0.4508 l
+0.4712 0.4546 l
+0.4715 0.4588 l
+0.4718 0.4634 l
+0.4721 0.4684 l
+0.4724 0.4737 l
+0.4727 0.4794 l
+0.4730 0.4854 l
+0.4732 0.4917 l
+0.4735 0.4983 l
+0.4738 0.5050 l
+0.4741 0.5119 l
+0.4744 0.5189 l
+0.4747 0.5261 l
+0.4750 0.5333 l
+0.4752 0.5405 l
+0.4755 0.5477 l
+0.4758 0.5548 l
+0.4761 0.5618 l
+0.4764 0.5687 l
+0.4767 0.5753 l
+0.4770 0.5818 l
+0.4772 0.5879 l
+0.4775 0.5938 l
+0.4778 0.5994 l
+0.4781 0.6045 l
+0.4784 0.6093 l
+0.4787 0.6136 l
+0.4790 0.6174 l
+0.4792 0.6208 l
+0.4795 0.6236 l
+0.4798 0.6259 l
+0.4801 0.6277 l
+0.4804 0.6289 l
+0.4807 0.6295 l
+0.4810 0.6295 l
+0.4813 0.6289 l
+0.4815 0.6278 l
+0.4818 0.6260 l
+0.4821 0.6237 l
+0.4824 0.6208 l
+0.4827 0.6173 l
+0.4830 0.6132 l
+0.4833 0.6086 l
+0.4835 0.6036 l
+0.4838 0.5980 l
+0.4841 0.5919 l
+0.4844 0.5855 l
+0.4847 0.5786 l
+0.4850 0.5714 l
+0.4853 0.5638 l
+0.4855 0.5560 l
+0.4858 0.5480 l
+0.4861 0.5397 l
+0.4864 0.5313 l
+0.4867 0.5228 l
+0.4870 0.5142 l
+0.4873 0.5056 l
+0.4875 0.4971 l
+0.4878 0.4886 l
+0.4881 0.4803 l
+0.4884 0.4722 l
+0.4887 0.4643 l
+0.4890 0.4566 l
+0.4893 0.4494 l
+0.4896 0.4424 l
+0.4898 0.4359 l
+0.4901 0.4299 l
+0.4904 0.4243 l
+0.4907 0.4193 l
+0.4910 0.4148 l
+0.4913 0.4109 l
+0.4916 0.4076 l
+0.4918 0.4050 l
+0.4921 0.4030 l
+0.4924 0.4017 l
+0.4927 0.4011 l
+0.4930 0.4012 l
+0.4933 0.4020 l
+0.4936 0.4035 l
+0.4938 0.4057 l
+0.4941 0.4086 l
+0.4944 0.4121 l
+0.4947 0.4164 l
+0.4950 0.4212 l
+0.4953 0.4267 l
+0.4956 0.4329 l
+0.4959 0.4395 l
+0.4961 0.4467 l
+0.4964 0.4545 l
+0.4967 0.4626 l
+0.4970 0.4712 l
+0.4973 0.4802 l
+0.4976 0.4895 l
+0.4979 0.4990 l
+0.4981 0.5088 l
+0.4984 0.5187 l
+0.4987 0.5288 l
+0.4990 0.5389 l
+0.4993 0.5490 l
+0.4996 0.5590 l
+0.4999 0.5690 l
+0.5001 0.5787 l
+0.5004 0.5882 l
+0.5007 0.5975 l
+0.5010 0.6064 l
+0.5013 0.6149 l
+0.5016 0.6229 l
+0.5019 0.6305 l
+0.5021 0.6375 l
+0.5024 0.6440 l
+0.5027 0.6498 l
+0.5030 0.6549 l
+0.5033 0.6594 l
+0.5036 0.6631 l
+0.5039 0.6661 l
+0.5042 0.6683 l
+0.5044 0.6697 l
+0.5047 0.6702 l
+0.5050 0.6700 l
+0.5053 0.6690 l
+0.5056 0.6671 l
+0.5059 0.6644 l
+0.5062 0.6609 l
+0.5064 0.6566 l
+0.5067 0.6515 l
+0.5070 0.6457 l
+0.5073 0.6391 l
+0.5076 0.6319 l
+0.5079 0.6240 l
+0.5082 0.6155 l
+0.5084 0.6064 l
+0.5087 0.5967 l
+0.5090 0.5866 l
+0.5093 0.5761 l
+0.5096 0.5652 l
+0.5099 0.5541 l
+0.5102 0.5426 l
+0.5104 0.5310 l
+0.5107 0.5193 l
+0.5110 0.5075 l
+0.5113 0.4957 l
+0.5116 0.4841 l
+0.5119 0.4725 l
+0.5122 0.4612 l
+0.5125 0.4502 l
+0.5127 0.4395 l
+0.5130 0.4292 l
+0.5133 0.4194 l
+0.5136 0.4101 l
+0.5139 0.4014 l
+0.5142 0.3934 l
+0.5145 0.3860 l
+0.5147 0.3794 l
+0.5150 0.3735 l
+0.5153 0.3685 l
+0.5156 0.3643 l
+0.5159 0.3610 l
+0.5162 0.3586 l
+0.5165 0.3571 l
+0.5167 0.3566 l
+0.5170 0.3570 l
+0.5173 0.3584 l
+0.5176 0.3607 l
+0.5179 0.3640 l
+0.5182 0.3682 l
+0.5185 0.3733 l
+0.5187 0.3793 l
+0.5190 0.3862 l
+0.5193 0.3939 l
+0.5196 0.4024 l
+0.5199 0.4116 l
+0.5202 0.4216 l
+0.5205 0.4322 l
+0.5208 0.4434 l
+0.5210 0.4551 l
+0.5213 0.4674 l
+0.5216 0.4800 l
+0.5219 0.4929 l
+0.5222 0.5062 l
+0.5225 0.5196 l
+0.5228 0.5331 l
+0.5230 0.5467 l
+0.5233 0.5602 l
+0.5236 0.5737 l
+0.5239 0.5869 l
+0.5242 0.5999 l
+0.5245 0.6126 l
+0.5248 0.6248 l
+0.5250 0.6365 l
+0.5253 0.6477 l
+0.5256 0.6583 l
+0.5259 0.6682 l
+0.5262 0.6773 l
+0.5265 0.6856 l
+0.5268 0.6931 l
+0.5270 0.6997 l
+0.5273 0.7053 l
+0.5276 0.7100 l
+0.5279 0.7136 l
+0.5282 0.7162 l
+0.5285 0.7177 l
+0.5288 0.7181 l
+0.5291 0.7175 l
+0.5293 0.7157 l
+0.5296 0.7129 l
+0.5299 0.7090 l
+0.5302 0.7040 l
+0.5305 0.6980 l
+0.5308 0.6909 l
+0.5311 0.6829 l
+0.5313 0.6740 l
+0.5316 0.6641 l
+0.5319 0.6534 l
+0.5322 0.6419 l
+0.5325 0.6297 l
+0.5328 0.6168 l
+0.5331 0.6033 l
+0.5333 0.5892 l
+0.5336 0.5748 l
+0.5339 0.5599 l
+0.5342 0.5448 l
+0.5345 0.5295 l
+0.5348 0.5140 l
+0.5351 0.4985 l
+0.5353 0.4831 l
+0.5356 0.4678 l
+0.5359 0.4528 l
+0.5362 0.4380 l
+0.5365 0.4237 l
+0.5368 0.4099 l
+0.5371 0.3966 l
+0.5374 0.3840 l
+0.5376 0.3721 l
+0.5379 0.3610 l
+0.5382 0.3507 l
+0.5385 0.3414 l
+0.5388 0.3331 l
+0.5391 0.3258 l
+0.5394 0.3196 l
+0.5396 0.3145 l
+0.5399 0.3105 l
+0.5402 0.3078 l
+0.5405 0.3063 l
+0.5408 0.3060 l
+0.5411 0.3069 l
+0.5414 0.3091 l
+0.5416 0.3125 l
+0.5419 0.3171 l
+0.5422 0.3229 l
+0.5425 0.3300 l
+0.5428 0.3381 l
+0.5431 0.3473 l
+0.5434 0.3577 l
+0.5436 0.3690 l
+0.5439 0.3812 l
+0.5442 0.3944 l
+0.5445 0.4083 l
+0.5448 0.4230 l
+0.5451 0.4383 l
+0.5454 0.4543 l
+0.5457 0.4707 l
+0.5459 0.4875 l
+0.5462 0.5046 l
+0.5465 0.5219 l
+0.5468 0.5394 l
+0.5471 0.5568 l
+0.5474 0.5742 l
+0.5477 0.5914 l
+0.5479 0.6083 l
+0.5482 0.6248 l
+0.5485 0.6408 l
+0.5488 0.6563 l
+0.5491 0.6711 l
+0.5494 0.6852 l
+0.5497 0.6985 l
+0.5499 0.7108 l
+0.5502 0.7222 l
+0.5505 0.7325 l
+0.5508 0.7417 l
+0.5511 0.7497 l
+0.5514 0.7565 l
+0.5517 0.7620 l
+0.5520 0.7662 l
+0.5522 0.7690 l
+0.5525 0.7705 l
+0.5528 0.7706 l
+0.5531 0.7694 l
+0.5534 0.7667 l
+0.5537 0.7627 l
+0.5540 0.7573 l
+0.5542 0.7505 l
+0.5545 0.7425 l
+0.5548 0.7332 l
+0.5551 0.7226 l
+0.5554 0.7109 l
+0.5557 0.6981 l
+0.5560 0.6842 l
+0.5562 0.6694 l
+0.5565 0.6537 l
+0.5568 0.6371 l
+0.5571 0.6199 l
+0.5574 0.6020 l
+0.5577 0.5836 l
+0.5580 0.5648 l
+0.5582 0.5456 l
+0.5585 0.5263 l
+0.5588 0.5068 l
+0.5591 0.4873 l
+0.5594 0.4680 l
+0.5597 0.4489 l
+0.5600 0.4301 l
+0.5603 0.4118 l
+0.5605 0.3940 l
+0.5608 0.3769 l
+0.5611 0.3605 l
+0.5614 0.3450 l
+0.5617 0.3304 l
+0.5620 0.3168 l
+0.5623 0.3044 l
+0.5625 0.2931 l
+0.5628 0.2831 l
+0.5631 0.2744 l
+0.5634 0.2671 l
+0.5637 0.2612 l
+0.5640 0.2568 l
+0.5643 0.2538 l
+0.5645 0.2524 l
+0.5648 0.2525 l
+0.5651 0.2542 l
+0.5654 0.2574 l
+0.5657 0.2621 l
+0.5660 0.2683 l
+0.5663 0.2760 l
+0.5665 0.2852 l
+0.5668 0.2957 l
+0.5671 0.3076 l
+0.5674 0.3207 l
+0.5677 0.3351 l
+0.5680 0.3506 l
+0.5683 0.3672 l
+0.5686 0.3847 l
+0.5688 0.4032 l
+0.5691 0.4223 l
+0.5694 0.4422 l
+0.5697 0.4626 l
+0.5700 0.4834 l
+0.5703 0.5046 l
+0.5706 0.5260 l
+0.5708 0.5475 l
+0.5711 0.5689 l
+0.5714 0.5902 l
+0.5717 0.6112 l
+0.5720 0.6319 l
+0.5723 0.6520 l
+0.5726 0.6715 l
+0.5728 0.6902 l
+0.5731 0.7081 l
+0.5734 0.7250 l
+0.5737 0.7409 l
+0.5740 0.7556 l
+0.5743 0.7691 l
+0.5746 0.7813 l
+0.5748 0.7921 l
+0.5751 0.8014 l
+0.5754 0.8092 l
+0.5757 0.8154 l
+0.5760 0.8200 l
+0.5763 0.8230 l
+0.5766 0.8243 l
+0.5769 0.8239 l
+0.5771 0.8218 l
+0.5774 0.8180 l
+0.5777 0.8126 l
+0.5780 0.8055 l
+0.5783 0.7968 l
+0.5786 0.7866 l
+0.5789 0.7748 l
+0.5791 0.7616 l
+0.5794 0.7469 l
+0.5797 0.7310 l
+0.5800 0.7138 l
+0.5803 0.6955 l
+0.5806 0.6762 l
+0.5809 0.6559 l
+0.5811 0.6348 l
+0.5814 0.6130 l
+0.5817 0.5906 l
+0.5820 0.5678 l
+0.5823 0.5446 l
+0.5826 0.5213 l
+0.5829 0.4978 l
+0.5831 0.4744 l
+0.5834 0.4513 l
+0.5837 0.4284 l
+0.5840 0.4060 l
+0.5843 0.3842 l
+0.5846 0.3631 l
+0.5849 0.3428 l
+0.5852 0.3235 l
+0.5854 0.3052 l
+0.5857 0.2881 l
+0.5860 0.2723 l
+0.5863 0.2578 l
+0.5866 0.2448 l
+0.5869 0.2334 l
+0.5872 0.2235 l
+0.5874 0.2153 l
+0.5877 0.2088 l
+0.5880 0.2041 l
+0.5883 0.2012 l
+0.5886 0.2000 l
+0.5889 0.2008 l
+0.5892 0.2033 l
+0.5894 0.2077 l
+0.5897 0.2139 l
+0.5900 0.2218 l
+0.5903 0.2315 l
+0.5906 0.2429 l
+0.5909 0.2559 l
+0.5912 0.2705 l
+0.5914 0.2866 l
+0.5917 0.3040 l
+0.5920 0.3228 l
+0.5923 0.3428 l
+0.5926 0.3639 l
+0.5929 0.3860 l
+0.5932 0.4089 l
+0.5935 0.4325 l
+0.5937 0.4568 l
+0.5940 0.4815 l
+0.5943 0.5066 l
+0.5946 0.5319 l
+0.5949 0.5572 l
+0.5952 0.5824 l
+0.5955 0.6073 l
+0.5957 0.6319 l
+0.5960 0.6560 l
+0.5963 0.6794 l
+0.5966 0.7020 l
+0.5969 0.7237 l
+0.5972 0.7444 l
+0.5975 0.7638 l
+0.5977 0.7820 l
+0.5980 0.7988 l
+0.5983 0.8141 l
+0.5986 0.8279 l
+0.5989 0.8399 l
+0.5992 0.8502 l
+0.5995 0.8588 l
+0.5998 0.8654 l
+0.6000 0.8702 l
+0.6003 0.8731 l
+0.6006 0.8739 l
+0.6009 0.8729 l
+0.6012 0.8698 l
+0.6015 0.8648 l
+0.6018 0.8579 l
+0.6020 0.8491 l
+0.6023 0.8384 l
+0.6026 0.8259 l
+0.6029 0.8117 l
+0.6032 0.7958 l
+0.6035 0.7783 l
+0.6038 0.7594 l
+0.6040 0.7391 l
+0.6043 0.7175 l
+0.6046 0.6948 l
+0.6049 0.6710 l
+0.6052 0.6464 l
+0.6055 0.6210 l
+0.6058 0.5949 l
+0.6060 0.5684 l
+0.6063 0.5416 l
+0.6066 0.5146 l
+0.6069 0.4876 l
+0.6072 0.4608 l
+0.6075 0.4342 l
+0.6078 0.4080 l
+0.6081 0.3825 l
+0.6083 0.3576 l
+0.6086 0.3337 l
+0.6089 0.3107 l
+0.6092 0.2889 l
+0.6095 0.2684 l
+0.6098 0.2492 l
+0.6101 0.2316 l
+0.6103 0.2156 l
+0.6106 0.2012 l
+0.6109 0.1887 l
+0.6112 0.1780 l
+0.6115 0.1693 l
+0.6118 0.1625 l
+0.6121 0.1577 l
+0.6123 0.1550 l
+0.6126 0.1544 l
+0.6129 0.1559 l
+0.6132 0.1595 l
+0.6135 0.1651 l
+0.6138 0.1728 l
+0.6141 0.1825 l
+0.6143 0.1941 l
+0.6146 0.2076 l
+0.6149 0.2230 l
+0.6152 0.2401 l
+0.6155 0.2588 l
+0.6158 0.2791 l
+0.6161 0.3008 l
+0.6164 0.3239 l
+0.6166 0.3481 l
+0.6169 0.3734 l
+0.6172 0.3996 l
+0.6175 0.4266 l
+0.6178 0.4542 l
+0.6181 0.4823 l
+0.6184 0.5106 l
+0.6186 0.5391 l
+0.6189 0.5676 l
+0.6192 0.5960 l
+0.6195 0.6240 l
+0.6198 0.6515 l
+0.6201 0.6783 l
+0.6204 0.7044 l
+0.6206 0.7295 l
+0.6209 0.7535 l
+0.6212 0.7763 l
+0.6215 0.7977 l
+0.6218 0.8176 l
+0.6221 0.8359 l
+0.6224 0.8525 l
+0.6226 0.8673 l
+0.6229 0.8802 l
+0.6232 0.8911 l
+0.6235 0.9000 l
+0.6238 0.9068 l
+0.6241 0.9114 l
+0.6244 0.9139 l
+0.6247 0.9142 l
+0.6249 0.9123 l
+0.6252 0.9082 l
+0.6255 0.9020 l
+0.6258 0.8936 l
+0.6261 0.8831 l
+0.6264 0.8706 l
+0.6267 0.8561 l
+0.6269 0.8397 l
+0.6272 0.8215 l
+0.6275 0.8016 l
+0.6278 0.7801 l
+0.6281 0.7571 l
+0.6284 0.7328 l
+0.6287 0.7072 l
+0.6289 0.6806 l
+0.6292 0.6530 l
+0.6295 0.6247 l
+0.6298 0.5958 l
+0.6301 0.5664 l
+0.6304 0.5367 l
+0.6307 0.5069 l
+0.6309 0.4771 l
+0.6312 0.4476 l
+0.6315 0.4184 l
+0.6318 0.3898 l
+0.6321 0.3619 l
+0.6324 0.3349 l
+0.6327 0.3089 l
+0.6330 0.2841 l
+0.6332 0.2606 l
+0.6335 0.2385 l
+0.6338 0.2180 l
+0.6341 0.1992 l
+0.6344 0.1822 l
+0.6347 0.1671 l
+0.6350 0.1540 l
+0.6352 0.1430 l
+0.6355 0.1341 l
+0.6358 0.1274 l
+0.6361 0.1229 l
+0.6364 0.1207 l
+0.6367 0.1208 l
+0.6370 0.1231 l
+0.6372 0.1277 l
+0.6375 0.1345 l
+0.6378 0.1436 l
+0.6381 0.1548 l
+0.6384 0.1681 l
+0.6387 0.1835 l
+0.6390 0.2008 l
+0.6392 0.2199 l
+0.6395 0.2408 l
+0.6398 0.2633 l
+0.6401 0.2874 l
+0.6404 0.3128 l
+0.6407 0.3394 l
+0.6410 0.3671 l
+0.6413 0.3958 l
+0.6415 0.4252 l
+0.6418 0.4552 l
+0.6421 0.4857 l
+0.6424 0.5164 l
+0.6427 0.5472 l
+0.6430 0.5779 l
+0.6433 0.6083 l
+0.6435 0.6384 l
+0.6438 0.6678 l
+0.6441 0.6964 l
+0.6444 0.7242 l
+0.6447 0.7508 l
+0.6450 0.7762 l
+0.6453 0.8002 l
+0.6455 0.8227 l
+0.6458 0.8436 l
+0.6461 0.8626 l
+0.6464 0.8798 l
+0.6467 0.8950 l
+0.6470 0.9082 l
+0.6473 0.9192 l
+0.6475 0.9280 l
+0.6478 0.9345 l
+0.6481 0.9388 l
+0.6484 0.9407 l
+0.6487 0.9402 l
+0.6490 0.9375 l
+0.6493 0.9324 l
+0.6496 0.9250 l
+0.6498 0.9153 l
+0.6501 0.9035 l
+0.6504 0.8895 l
+0.6507 0.8734 l
+0.6510 0.8554 l
+0.6513 0.8354 l
+0.6516 0.8137 l
+0.6518 0.7904 l
+0.6521 0.7656 l
+0.6524 0.7393 l
+0.6527 0.7119 l
+0.6530 0.6833 l
+0.6533 0.6539 l
+0.6536 0.6237 l
+0.6538 0.5929 l
+0.6541 0.5617 l
+0.6544 0.5303 l
+0.6547 0.4988 l
+0.6550 0.4675 l
+0.6553 0.4364 l
+0.6556 0.4058 l
+0.6559 0.3759 l
+0.6561 0.3468 l
+0.6564 0.3187 l
+0.6567 0.2917 l
+0.6570 0.2660 l
+0.6573 0.2417 l
+0.6576 0.2191 l
+0.6579 0.1981 l
+0.6581 0.1790 l
+0.6584 0.1618 l
+0.6587 0.1466 l
+0.6590 0.1336 l
+0.6593 0.1227 l
+0.6596 0.1141 l
+0.6599 0.1079 l
+0.6601 0.1039 l
+0.6604 0.1024 l
+0.6607 0.1032 l
+0.6610 0.1064 l
+0.6613 0.1119 l
+0.6616 0.1198 l
+0.6619 0.1299 l
+0.6621 0.1423 l
+0.6624 0.1569 l
+0.6627 0.1735 l
+0.6630 0.1921 l
+0.6633 0.2126 l
+0.6636 0.2349 l
+0.6639 0.2588 l
+0.6642 0.2842 l
+0.6644 0.3110 l
+0.6647 0.3390 l
+0.6650 0.3680 l
+0.6653 0.3979 l
+0.6656 0.4286 l
+0.6659 0.4598 l
+0.6662 0.4914 l
+0.6664 0.5232 l
+0.6667 0.5550 l
+0.6670 0.5867 l
+0.6673 0.6180 l
+0.6676 0.6488 l
+0.6679 0.6789 l
+0.6682 0.7081 l
+0.6684 0.7363 l
+0.6687 0.7634 l
+0.6690 0.7891 l
+0.6693 0.8133 l
+0.6696 0.8359 l
+0.6699 0.8567 l
+0.6702 0.8757 l
+0.6704 0.8927 l
+0.6707 0.9076 l
+0.6710 0.9204 l
+0.6713 0.9310 l
+0.6716 0.9393 l
+0.6719 0.9452 l
+0.6722 0.9488 l
+0.6725 0.9500 l
+0.6727 0.9488 l
+0.6730 0.9452 l
+0.6733 0.9393 l
+0.6736 0.9310 l
+0.6739 0.9204 l
+0.6742 0.9076 l
+0.6745 0.8927 l
+0.6747 0.8757 l
+0.6750 0.8567 l
+0.6753 0.8359 l
+0.6756 0.8133 l
+0.6759 0.7891 l
+0.6762 0.7634 l
+0.6765 0.7363 l
+0.6767 0.7081 l
+0.6770 0.6789 l
+0.6773 0.6488 l
+0.6776 0.6180 l
+0.6779 0.5867 l
+0.6782 0.5550 l
+0.6785 0.5232 l
+0.6787 0.4914 l
+0.6790 0.4598 l
+0.6793 0.4286 l
+0.6796 0.3979 l
+0.6799 0.3680 l
+0.6802 0.3390 l
+0.6805 0.3110 l
+0.6808 0.2842 l
+0.6810 0.2588 l
+0.6813 0.2349 l
+0.6816 0.2126 l
+0.6819 0.1921 l
+0.6822 0.1735 l
+0.6825 0.1569 l
+0.6828 0.1423 l
+0.6830 0.1299 l
+0.6833 0.1198 l
+0.6836 0.1119 l
+0.6839 0.1064 l
+0.6842 0.1032 l
+0.6845 0.1024 l
+0.6848 0.1039 l
+0.6850 0.1079 l
+0.6853 0.1141 l
+0.6856 0.1227 l
+0.6859 0.1336 l
+0.6862 0.1466 l
+0.6865 0.1618 l
+0.6868 0.1790 l
+0.6870 0.1981 l
+0.6873 0.2191 l
+0.6876 0.2417 l
+0.6879 0.2660 l
+0.6882 0.2917 l
+0.6885 0.3187 l
+0.6888 0.3468 l
+0.6891 0.3759 l
+0.6893 0.4058 l
+0.6896 0.4364 l
+0.6899 0.4675 l
+0.6902 0.4988 l
+0.6905 0.5303 l
+0.6908 0.5617 l
+0.6911 0.5929 l
+0.6913 0.6237 l
+0.6916 0.6539 l
+0.6919 0.6833 l
+0.6922 0.7119 l
+0.6925 0.7393 l
+0.6928 0.7656 l
+0.6931 0.7904 l
+0.6933 0.8137 l
+0.6936 0.8354 l
+0.6939 0.8554 l
+0.6942 0.8734 l
+0.6945 0.8895 l
+0.6948 0.9035 l
+0.6951 0.9153 l
+0.6953 0.9250 l
+0.6956 0.9324 l
+0.6959 0.9375 l
+0.6962 0.9402 l
+0.6965 0.9407 l
+0.6968 0.9388 l
+0.6971 0.9345 l
+0.6974 0.9280 l
+0.6976 0.9192 l
+0.6979 0.9082 l
+0.6982 0.8950 l
+0.6985 0.8798 l
+0.6988 0.8626 l
+0.6991 0.8436 l
+0.6994 0.8227 l
+0.6996 0.8002 l
+0.6999 0.7762 l
+0.7002 0.7508 l
+0.7005 0.7242 l
+0.7008 0.6964 l
+0.7011 0.6678 l
+0.7014 0.6384 l
+0.7016 0.6083 l
+0.7019 0.5779 l
+0.7022 0.5472 l
+0.7025 0.5164 l
+0.7028 0.4857 l
+0.7031 0.4552 l
+0.7034 0.4252 l
+0.7037 0.3958 l
+0.7039 0.3671 l
+0.7042 0.3394 l
+0.7045 0.3128 l
+0.7048 0.2874 l
+0.7051 0.2633 l
+0.7054 0.2408 l
+0.7057 0.2199 l
+0.7059 0.2008 l
+0.7062 0.1835 l
+0.7065 0.1681 l
+0.7068 0.1548 l
+0.7071 0.1436 l
+0.7074 0.1345 l
+0.7077 0.1277 l
+0.7079 0.1231 l
+0.7082 0.1208 l
+0.7085 0.1207 l
+0.7088 0.1229 l
+0.7091 0.1274 l
+0.7094 0.1341 l
+0.7097 0.1430 l
+0.7099 0.1540 l
+0.7102 0.1671 l
+0.7105 0.1822 l
+0.7108 0.1992 l
+0.7111 0.2180 l
+0.7114 0.2385 l
+0.7117 0.2606 l
+0.7120 0.2841 l
+0.7122 0.3089 l
+0.7125 0.3349 l
+0.7128 0.3619 l
+0.7131 0.3898 l
+0.7134 0.4184 l
+0.7137 0.4476 l
+0.7140 0.4771 l
+0.7142 0.5069 l
+0.7145 0.5367 l
+0.7148 0.5664 l
+0.7151 0.5958 l
+0.7154 0.6247 l
+0.7157 0.6530 l
+0.7160 0.6806 l
+0.7162 0.7072 l
+0.7165 0.7328 l
+0.7168 0.7571 l
+0.7171 0.7801 l
+0.7174 0.8016 l
+0.7177 0.8215 l
+0.7180 0.8397 l
+0.7182 0.8561 l
+0.7185 0.8706 l
+0.7188 0.8831 l
+0.7191 0.8936 l
+0.7194 0.9020 l
+0.7197 0.9082 l
+0.7200 0.9123 l
+0.7203 0.9142 l
+0.7205 0.9139 l
+0.7208 0.9114 l
+0.7211 0.9068 l
+0.7214 0.9000 l
+0.7217 0.8911 l
+0.7220 0.8802 l
+0.7223 0.8673 l
+0.7225 0.8525 l
+0.7228 0.8359 l
+0.7231 0.8176 l
+0.7234 0.7977 l
+0.7237 0.7763 l
+0.7240 0.7535 l
+0.7243 0.7295 l
+0.7245 0.7044 l
+0.7248 0.6783 l
+0.7251 0.6515 l
+0.7254 0.6240 l
+0.7257 0.5960 l
+0.7260 0.5676 l
+0.7263 0.5391 l
+0.7265 0.5106 l
+0.7268 0.4823 l
+0.7271 0.4542 l
+0.7274 0.4266 l
+0.7277 0.3996 l
+0.7280 0.3734 l
+0.7283 0.3481 l
+0.7286 0.3239 l
+0.7288 0.3008 l
+0.7291 0.2791 l
+0.7294 0.2588 l
+0.7297 0.2401 l
+0.7300 0.2230 l
+0.7303 0.2076 l
+0.7306 0.1941 l
+0.7308 0.1825 l
+0.7311 0.1728 l
+0.7314 0.1651 l
+0.7317 0.1595 l
+0.7320 0.1559 l
+0.7323 0.1544 l
+0.7326 0.1550 l
+0.7328 0.1577 l
+0.7331 0.1625 l
+0.7334 0.1693 l
+0.7337 0.1780 l
+0.7340 0.1887 l
+0.7343 0.2012 l
+0.7346 0.2156 l
+0.7348 0.2316 l
+0.7351 0.2492 l
+0.7354 0.2684 l
+0.7357 0.2889 l
+0.7360 0.3107 l
+0.7363 0.3337 l
+0.7366 0.3576 l
+0.7369 0.3825 l
+0.7371 0.4080 l
+0.7374 0.4342 l
+0.7377 0.4608 l
+0.7380 0.4876 l
+0.7383 0.5146 l
+0.7386 0.5416 l
+0.7389 0.5684 l
+0.7391 0.5949 l
+0.7394 0.6210 l
+0.7397 0.6464 l
+0.7400 0.6710 l
+0.7403 0.6948 l
+0.7406 0.7175 l
+0.7409 0.7391 l
+0.7411 0.7594 l
+0.7414 0.7783 l
+0.7417 0.7958 l
+0.7420 0.8117 l
+0.7423 0.8259 l
+0.7426 0.8384 l
+0.7429 0.8491 l
+0.7431 0.8579 l
+0.7434 0.8648 l
+0.7437 0.8698 l
+0.7440 0.8729 l
+0.7443 0.8739 l
+0.7446 0.8731 l
+0.7449 0.8702 l
+0.7452 0.8654 l
+0.7454 0.8588 l
+0.7457 0.8502 l
+0.7460 0.8399 l
+0.7463 0.8279 l
+0.7466 0.8141 l
+0.7469 0.7988 l
+0.7472 0.7820 l
+0.7474 0.7638 l
+0.7477 0.7444 l
+0.7480 0.7237 l
+0.7483 0.7020 l
+0.7486 0.6794 l
+0.7489 0.6560 l
+0.7492 0.6319 l
+0.7494 0.6073 l
+0.7497 0.5824 l
+0.7500 0.5572 l
+0.7503 0.5319 l
+0.7506 0.5066 l
+0.7509 0.4815 l
+0.7512 0.4568 l
+0.7514 0.4325 l
+0.7517 0.4089 l
+0.7520 0.3859 l
+0.7523 0.3639 l
+0.7526 0.3428 l
+0.7529 0.3228 l
+0.7532 0.3040 l
+0.7535 0.2866 l
+0.7537 0.2705 l
+0.7540 0.2559 l
+0.7543 0.2429 l
+0.7546 0.2315 l
+0.7549 0.2218 l
+0.7552 0.2139 l
+0.7555 0.2077 l
+0.7557 0.2033 l
+0.7560 0.2008 l
+0.7563 0.2000 l
+0.7566 0.2012 l
+0.7569 0.2041 l
+0.7572 0.2088 l
+0.7575 0.2153 l
+0.7577 0.2235 l
+0.7580 0.2334 l
+0.7583 0.2448 l
+0.7586 0.2578 l
+0.7589 0.2723 l
+0.7592 0.2881 l
+0.7595 0.3052 l
+0.7598 0.3235 l
+0.7600 0.3428 l
+0.7603 0.3631 l
+0.7606 0.3842 l
+0.7609 0.4060 l
+0.7612 0.4284 l
+0.7615 0.4513 l
+0.7618 0.4744 l
+0.7620 0.4978 l
+0.7623 0.5213 l
+0.7626 0.5446 l
+0.7629 0.5678 l
+0.7632 0.5906 l
+0.7635 0.6130 l
+0.7638 0.6348 l
+0.7640 0.6559 l
+0.7643 0.6762 l
+0.7646 0.6955 l
+0.7649 0.7138 l
+0.7652 0.7310 l
+0.7655 0.7469 l
+0.7658 0.7616 l
+0.7660 0.7748 l
+0.7663 0.7866 l
+0.7666 0.7968 l
+0.7669 0.8055 l
+0.7672 0.8126 l
+0.7675 0.8180 l
+0.7678 0.8218 l
+0.7681 0.8239 l
+0.7683 0.8243 l
+0.7686 0.8230 l
+0.7689 0.8200 l
+0.7692 0.8154 l
+0.7695 0.8092 l
+0.7698 0.8014 l
+0.7701 0.7921 l
+0.7703 0.7813 l
+0.7706 0.7691 l
+0.7709 0.7556 l
+0.7712 0.7409 l
+0.7715 0.7250 l
+0.7718 0.7081 l
+0.7721 0.6902 l
+0.7723 0.6715 l
+0.7726 0.6520 l
+0.7729 0.6319 l
+0.7732 0.6112 l
+0.7735 0.5902 l
+0.7738 0.5689 l
+0.7741 0.5475 l
+0.7743 0.5260 l
+0.7746 0.5046 l
+0.7749 0.4834 l
+0.7752 0.4626 l
+0.7755 0.4422 l
+0.7758 0.4223 l
+0.7761 0.4032 l
+0.7764 0.3847 l
+0.7766 0.3672 l
+0.7769 0.3506 l
+0.7772 0.3351 l
+0.7775 0.3207 l
+0.7778 0.3076 l
+0.7781 0.2957 l
+0.7784 0.2852 l
+0.7786 0.2760 l
+0.7789 0.2683 l
+0.7792 0.2621 l
+0.7795 0.2574 l
+0.7798 0.2542 l
+0.7801 0.2525 l
+0.7804 0.2524 l
+0.7806 0.2538 l
+0.7809 0.2568 l
+0.7812 0.2612 l
+0.7815 0.2671 l
+0.7818 0.2744 l
+0.7821 0.2831 l
+0.7824 0.2931 l
+0.7826 0.3044 l
+0.7829 0.3168 l
+0.7832 0.3304 l
+0.7835 0.3450 l
+0.7838 0.3605 l
+0.7841 0.3769 l
+0.7844 0.3940 l
+0.7847 0.4118 l
+0.7849 0.4301 l
+0.7852 0.4489 l
+0.7855 0.4680 l
+0.7858 0.4873 l
+0.7861 0.5068 l
+0.7864 0.5263 l
+0.7867 0.5456 l
+0.7869 0.5648 l
+0.7872 0.5836 l
+0.7875 0.6020 l
+0.7878 0.6199 l
+0.7881 0.6371 l
+0.7884 0.6537 l
+0.7887 0.6694 l
+0.7889 0.6842 l
+0.7892 0.6981 l
+0.7895 0.7109 l
+0.7898 0.7226 l
+0.7901 0.7332 l
+0.7904 0.7425 l
+0.7907 0.7505 l
+0.7909 0.7573 l
+0.7912 0.7627 l
+0.7915 0.7667 l
+0.7918 0.7694 l
+0.7921 0.7706 l
+0.7924 0.7705 l
+0.7927 0.7690 l
+0.7930 0.7662 l
+0.7932 0.7620 l
+0.7935 0.7565 l
+0.7938 0.7497 l
+0.7941 0.7417 l
+0.7944 0.7325 l
+0.7947 0.7222 l
+0.7950 0.7108 l
+0.7952 0.6985 l
+0.7955 0.6852 l
+0.7958 0.6711 l
+0.7961 0.6563 l
+0.7964 0.6408 l
+0.7967 0.6248 l
+0.7970 0.6083 l
+0.7972 0.5914 l
+0.7975 0.5742 l
+0.7978 0.5568 l
+0.7981 0.5394 l
+0.7984 0.5219 l
+0.7987 0.5046 l
+0.7990 0.4875 l
+0.7992 0.4707 l
+0.7995 0.4543 l
+0.7998 0.4383 l
+0.8001 0.4230 l
+0.8004 0.4083 l
+0.8007 0.3944 l
+0.8010 0.3812 l
+0.8013 0.3690 l
+0.8015 0.3577 l
+0.8018 0.3473 l
+0.8021 0.3381 l
+0.8024 0.3300 l
+0.8027 0.3229 l
+0.8030 0.3171 l
+0.8033 0.3125 l
+0.8035 0.3091 l
+0.8038 0.3069 l
+0.8041 0.3060 l
+0.8044 0.3063 l
+0.8047 0.3078 l
+0.8050 0.3105 l
+0.8053 0.3145 l
+0.8055 0.3196 l
+0.8058 0.3258 l
+0.8061 0.3331 l
+0.8064 0.3414 l
+0.8067 0.3507 l
+0.8070 0.3610 l
+0.8073 0.3721 l
+0.8076 0.3840 l
+0.8078 0.3966 l
+0.8081 0.4099 l
+0.8084 0.4237 l
+0.8087 0.4380 l
+0.8090 0.4528 l
+0.8093 0.4678 l
+0.8096 0.4831 l
+0.8098 0.4985 l
+0.8101 0.5140 l
+0.8104 0.5295 l
+0.8107 0.5448 l
+0.8110 0.5599 l
+0.8113 0.5748 l
+0.8116 0.5892 l
+0.8118 0.6033 l
+0.8121 0.6168 l
+0.8124 0.6297 l
+0.8127 0.6419 l
+0.8130 0.6534 l
+0.8133 0.6641 l
+0.8136 0.6740 l
+0.8138 0.6829 l
+0.8141 0.6909 l
+0.8144 0.6980 l
+0.8147 0.7040 l
+0.8150 0.7090 l
+0.8153 0.7129 l
+0.8156 0.7157 l
+0.8159 0.7175 l
+0.8161 0.7181 l
+0.8164 0.7177 l
+0.8167 0.7162 l
+0.8170 0.7136 l
+0.8173 0.7100 l
+0.8176 0.7053 l
+0.8179 0.6997 l
+0.8181 0.6931 l
+0.8184 0.6856 l
+0.8187 0.6773 l
+0.8190 0.6682 l
+0.8193 0.6583 l
+0.8196 0.6477 l
+0.8199 0.6365 l
+0.8201 0.6248 l
+0.8204 0.6126 l
+0.8207 0.5999 l
+0.8210 0.5869 l
+0.8213 0.5737 l
+0.8216 0.5602 l
+0.8219 0.5467 l
+0.8221 0.5331 l
+0.8224 0.5196 l
+0.8227 0.5062 l
+0.8230 0.4929 l
+0.8233 0.4800 l
+0.8236 0.4674 l
+0.8239 0.4551 l
+0.8242 0.4434 l
+0.8244 0.4322 l
+0.8247 0.4216 l
+0.8250 0.4116 l
+0.8253 0.4024 l
+0.8256 0.3939 l
+0.8259 0.3862 l
+0.8262 0.3793 l
+0.8264 0.3733 l
+0.8267 0.3682 l
+0.8270 0.3640 l
+0.8273 0.3607 l
+0.8276 0.3584 l
+0.8279 0.3570 l
+0.8282 0.3566 l
+0.8284 0.3571 l
+0.8287 0.3586 l
+0.8290 0.3610 l
+0.8293 0.3643 l
+0.8296 0.3685 l
+0.8299 0.3735 l
+0.8302 0.3794 l
+0.8304 0.3860 l
+0.8307 0.3934 l
+0.8310 0.4014 l
+0.8313 0.4101 l
+0.8316 0.4194 l
+0.8319 0.4292 l
+0.8322 0.4395 l
+0.8325 0.4502 l
+0.8327 0.4612 l
+0.8330 0.4725 l
+0.8333 0.4841 l
+0.8336 0.4957 l
+0.8339 0.5075 l
+0.8342 0.5193 l
+0.8345 0.5310 l
+0.8347 0.5426 l
+0.8350 0.5541 l
+0.8353 0.5652 l
+0.8356 0.5761 l
+0.8359 0.5866 l
+0.8362 0.5967 l
+0.8365 0.6064 l
+0.8367 0.6155 l
+0.8370 0.6240 l
+0.8373 0.6319 l
+0.8376 0.6391 l
+0.8379 0.6457 l
+0.8382 0.6515 l
+0.8385 0.6566 l
+0.8387 0.6609 l
+0.8390 0.6644 l
+0.8393 0.6671 l
+0.8396 0.6690 l
+0.8399 0.6700 l
+0.8402 0.6702 l
+0.8405 0.6697 l
+0.8408 0.6683 l
+0.8410 0.6661 l
+0.8413 0.6631 l
+0.8416 0.6594 l
+0.8419 0.6549 l
+0.8422 0.6498 l
+0.8425 0.6440 l
+0.8428 0.6375 l
+0.8430 0.6305 l
+0.8433 0.6229 l
+0.8436 0.6149 l
+0.8439 0.6064 l
+0.8442 0.5975 l
+0.8445 0.5882 l
+0.8448 0.5787 l
+0.8450 0.5690 l
+0.8453 0.5590 l
+0.8456 0.5490 l
+0.8459 0.5389 l
+0.8462 0.5288 l
+0.8465 0.5187 l
+0.8468 0.5088 l
+0.8470 0.4990 l
+0.8473 0.4895 l
+0.8476 0.4802 l
+0.8479 0.4712 l
+0.8482 0.4626 l
+0.8485 0.4545 l
+0.8488 0.4467 l
+0.8491 0.4395 l
+0.8493 0.4329 l
+0.8496 0.4267 l
+0.8499 0.4212 l
+0.8502 0.4164 l
+0.8505 0.4121 l
+0.8508 0.4086 l
+0.8511 0.4057 l
+0.8513 0.4035 l
+0.8516 0.4020 l
+0.8519 0.4012 l
+0.8522 0.4011 l
+0.8525 0.4017 l
+0.8528 0.4030 l
+0.8531 0.4050 l
+0.8533 0.4076 l
+0.8536 0.4109 l
+0.8539 0.4148 l
+0.8542 0.4193 l
+0.8545 0.4243 l
+0.8548 0.4299 l
+0.8551 0.4359 l
+0.8553 0.4424 l
+0.8556 0.4494 l
+0.8559 0.4566 l
+0.8562 0.4643 l
+0.8565 0.4722 l
+0.8568 0.4803 l
+0.8571 0.4886 l
+0.8574 0.4971 l
+0.8576 0.5056 l
+0.8579 0.5142 l
+0.8582 0.5228 l
+0.8585 0.5313 l
+0.8588 0.5397 l
+0.8591 0.5480 l
+0.8594 0.5560 l
+0.8596 0.5638 l
+0.8599 0.5714 l
+0.8602 0.5786 l
+0.8605 0.5855 l
+0.8608 0.5919 l
+0.8611 0.5980 l
+0.8614 0.6036 l
+0.8616 0.6086 l
+0.8619 0.6132 l
+0.8622 0.6173 l
+0.8625 0.6208 l
+0.8628 0.6237 l
+0.8631 0.6260 l
+0.8634 0.6278 l
+0.8637 0.6289 l
+0.8639 0.6295 l
+0.8642 0.6295 l
+0.8645 0.6289 l
+0.8648 0.6277 l
+0.8651 0.6259 l
+0.8654 0.6236 l
+0.8657 0.6208 l
+0.8659 0.6174 l
+0.8662 0.6136 l
+0.8665 0.6093 l
+0.8668 0.6045 l
+0.8671 0.5994 l
+0.8674 0.5938 l
+0.8677 0.5880 l
+0.8679 0.5818 l
+0.8682 0.5753 l
+0.8685 0.5687 l
+0.8688 0.5618 l
+0.8691 0.5548 l
+0.8694 0.5477 l
+0.8697 0.5405 l
+0.8699 0.5333 l
+0.8702 0.5261 l
+0.8705 0.5189 l
+0.8708 0.5119 l
+0.8711 0.5050 l
+0.8714 0.4983 l
+0.8717 0.4917 l
+0.8720 0.4854 l
+0.8722 0.4794 l
+0.8725 0.4737 l
+0.8728 0.4684 l
+0.8731 0.4634 l
+0.8734 0.4588 l
+0.8737 0.4546 l
+0.8740 0.4508 l
+0.8742 0.4475 l
+0.8745 0.4447 l
+0.8748 0.4423 l
+0.8751 0.4404 l
+0.8754 0.4390 l
+0.8757 0.4381 l
+0.8760 0.4377 l
+0.8762 0.4378 l
+0.8765 0.4384 l
+0.8768 0.4395 l
+0.8771 0.4410 l
+0.8774 0.4430 l
+0.8777 0.4455 l
+0.8780 0.4483 l
+0.8782 0.4516 l
+0.8785 0.4552 l
+0.8788 0.4593 l
+0.8791 0.4636 l
+0.8794 0.4683 l
+0.8797 0.4732 l
+0.8800 0.4784 l
+0.8803 0.4838 l
+0.8805 0.4893 l
+0.8808 0.4951 l
+0.8811 0.5009 l
+0.8814 0.5068 l
+0.8817 0.5128 l
+0.8820 0.5188 l
+0.8823 0.5248 l
+0.8825 0.5307 l
+0.8828 0.5365 l
+0.8831 0.5422 l
+0.8834 0.5478 l
+0.8837 0.5532 l
+0.8840 0.5583 l
+0.8843 0.5633 l
+0.8845 0.5680 l
+0.8848 0.5724 l
+0.8851 0.5764 l
+0.8854 0.5802 l
+0.8857 0.5836 l
+0.8860 0.5867 l
+0.8863 0.5894 l
+0.8865 0.5916 l
+0.8868 0.5935 l
+0.8871 0.5950 l
+0.8874 0.5961 l
+0.8877 0.5968 l
+0.8880 0.5971 l
+0.8883 0.5969 l
+0.8886 0.5964 l
+0.8888 0.5954 l
+0.8891 0.5941 l
+0.8894 0.5924 l
+0.8897 0.5903 l
+0.8900 0.5879 l
+0.8903 0.5852 l
+0.8906 0.5821 l
+0.8908 0.5787 l
+0.8911 0.5751 l
+0.8914 0.5712 l
+0.8917 0.5672 l
+0.8920 0.5629 l
+0.8923 0.5584 l
+0.8926 0.5538 l
+0.8928 0.5491 l
+0.8931 0.5442 l
+0.8934 0.5394 l
+0.8937 0.5345 l
+0.8940 0.5295 l
+0.8943 0.5246 l
+0.8946 0.5198 l
+0.8948 0.5150 l
+0.8951 0.5104 l
+0.8954 0.5058 l
+0.8957 0.5014 l
+0.8960 0.4972 l
+0.8963 0.4932 l
+0.8966 0.4894 l
+0.8969 0.4858 l
+0.8971 0.4825 l
+0.8974 0.4795 l
+0.8977 0.4767 l
+0.8980 0.4743 l
+0.8983 0.4721 l
+0.8986 0.4703 l
+0.8989 0.4688 l
+0.8991 0.4677 l
+0.8994 0.4668 l
+0.8997 0.4663 l
+0.9000 0.4662 l
+0.9003 0.4663 l
+0.9006 0.4668 l
+0.9009 0.4676 l
+0.9011 0.4688 l
+0.9014 0.4702 l
+0.9017 0.4720 l
+0.9020 0.4740 l
+0.9023 0.4762 l
+0.9026 0.4788 l
+0.9029 0.4816 l
+0.9031 0.4845 l
+0.9034 0.4877 l
+0.9037 0.4911 l
+0.9040 0.4946 l
+0.9043 0.4982 l
+0.9046 0.5020 l
+0.9049 0.5059 l
+0.9052 0.5098 l
+0.9054 0.5138 l
+0.9057 0.5178 l
+0.9060 0.5218 l
+0.9063 0.5257 l
+0.9066 0.5297 l
+0.9069 0.5335 l
+0.9072 0.5373 l
+0.9074 0.5410 l
+0.9077 0.5445 l
+0.9080 0.5479 l
+0.9083 0.5511 l
+0.9086 0.5542 l
+0.9089 0.5570 l
+0.9092 0.5597 l
+0.9094 0.5621 l
+0.9097 0.5643 l
+0.9100 0.5662 l
+0.9103 0.5679 l
+0.9106 0.5694 l
+0.9109 0.5705 l
+0.9112 0.5714 l
+0.9115 0.5721 l
+0.9117 0.5724 l
+0.9120 0.5725 l
+0.9123 0.5723 l
+0.9126 0.5719 l
+0.9129 0.5712 l
+0.9132 0.5702 l
+0.9135 0.5690 l
+0.9137 0.5676 l
+0.9140 0.5659 l
+0.9143 0.5641 l
+0.9146 0.5620 l
+0.9149 0.5597 l
+0.9152 0.5573 l
+0.9155 0.5547 l
+0.9157 0.5520 l
+0.9160 0.5491 l
+0.9163 0.5462 l
+0.9166 0.5431 l
+0.9169 0.5400 l
+0.9172 0.5369 l
+0.9175 0.5337 l
+0.9177 0.5305 l
+0.9180 0.5272 l
+0.9183 0.5241 l
+0.9186 0.5209 l
+0.9189 0.5178 l
+0.9192 0.5148 l
+0.9195 0.5119 l
+0.9198 0.5090 l
+0.9200 0.5063 l
+0.9203 0.5038 l
+0.9206 0.5013 l
+0.9209 0.4991 l
+0.9212 0.4970 l
+0.9215 0.4951 l
+0.9218 0.4934 l
+0.9220 0.4918 l
+0.9223 0.4905 l
+0.9226 0.4894 l
+0.9229 0.4885 l
+0.9232 0.4878 l
+0.9235 0.4873 l
+0.9238 0.4871 l
+0.9240 0.4870 l
+0.9243 0.4872 l
+0.9246 0.4876 l
+0.9249 0.4882 l
+0.9252 0.4890 l
+0.9255 0.4900 l
+0.9258 0.4912 l
+0.9260 0.4925 l
+0.9263 0.4940 l
+0.9266 0.4957 l
+0.9269 0.4975 l
+0.9272 0.4995 l
+0.9275 0.5016 l
+0.9278 0.5038 l
+0.9281 0.5060 l
+0.9283 0.5084 l
+0.9286 0.5108 l
+0.9289 0.5133 l
+0.9292 0.5159 l
+0.9295 0.5184 l
+0.9298 0.5210 l
+0.9301 0.5235 l
+0.9303 0.5260 l
+0.9306 0.5285 l
+0.9309 0.5310 l
+0.9312 0.5334 l
+0.9315 0.5357 l
+0.9318 0.5379 l
+0.9321 0.5400 l
+0.9323 0.5421 l
+0.9326 0.5440 l
+0.9329 0.5457 l
+0.9332 0.5474 l
+0.9335 0.5489 l
+0.9338 0.5502 l
+0.9341 0.5514 l
+0.9343 0.5524 l
+0.9346 0.5533 l
+0.9349 0.5539 l
+0.9352 0.5545 l
+0.9355 0.5548 l
+0.9358 0.5550 l
+0.9361 0.5550 l
+0.9364 0.5548 l
+0.9366 0.5545 l
+0.9369 0.5540 l
+0.9372 0.5533 l
+0.9375 0.5525 l
+0.9378 0.5516 l
+0.9381 0.5505 l
+0.9384 0.5493 l
+0.9386 0.5479 l
+0.9389 0.5465 l
+0.9392 0.5449 l
+0.9395 0.5433 l
+0.9398 0.5415 l
+0.9401 0.5397 l
+0.9404 0.5378 l
+0.9406 0.5359 l
+0.9409 0.5340 l
+0.9412 0.5320 l
+0.9415 0.5300 l
+0.9418 0.5280 l
+0.9421 0.5260 l
+0.9424 0.5240 l
+0.9426 0.5220 l
+0.9429 0.5201 l
+0.9432 0.5182 l
+0.9435 0.5164 l
+0.9438 0.5147 l
+0.9441 0.5130 l
+0.9444 0.5115 l
+0.9447 0.5100 l
+0.9449 0.5086 l
+0.9452 0.5073 l
+0.9455 0.5062 l
+0.9458 0.5052 l
+0.9461 0.5043 l
+0.9464 0.5035 l
+0.9467 0.5028 l
+0.9469 0.5023 l
+0.9472 0.5019 l
+0.9475 0.5017 l
+0.9478 0.5016 l
+0.9481 0.5016 l
+0.9484 0.5017 l
+0.9487 0.5020 l
+0.9489 0.5024 l
+0.9492 0.5029 l
+0.9495 0.5036 l
+0.9498 0.5044 l
+0.9501 0.5052 l
+0.9504 0.5062 l
+0.9507 0.5072 l
+0.9509 0.5084 l
+0.9512 0.5096 l
+0.9515 0.5109 l
+0.9518 0.5123 l
+0.9521 0.5137 l
+0.9524 0.5152 l
+0.9527 0.5167 l
+0.9530 0.5182 l
+0.9532 0.5198 l
+0.9535 0.5213 l
+0.9538 0.5229 l
+0.9541 0.5244 l
+0.9544 0.5260 l
+0.9547 0.5275 l
+0.9550 0.5290 l
+0.9552 0.5304 l
+0.9555 0.5318 l
+0.9558 0.5331 l
+0.9561 0.5344 l
+0.9564 0.5356 l
+0.9567 0.5368 l
+0.9570 0.5378 l
+0.9572 0.5388 l
+0.9575 0.5397 l
+0.9578 0.5404 l
+0.9581 0.5411 l
+0.9584 0.5417 l
+0.9587 0.5422 l
+0.9590 0.5426 l
+0.9592 0.5429 l
+0.9595 0.5431 l
+0.9598 0.5431 l
+0.9601 0.5431 l
+0.9604 0.5430 l
+0.9607 0.5427 l
+0.9610 0.5424 l
+0.9613 0.5420 l
+0.9615 0.5415 l
+0.9618 0.5409 l
+0.9621 0.5402 l
+0.9624 0.5394 l
+0.9627 0.5386 l
+0.9630 0.5377 l
+0.9633 0.5367 l
+0.9635 0.5357 l
+0.9638 0.5347 l
+0.9641 0.5336 l
+0.9644 0.5324 l
+0.9647 0.5313 l
+0.9650 0.5301 l
+0.9653 0.5289 l
+0.9655 0.5277 l
+0.9658 0.5265 l
+0.9661 0.5253 l
+0.9664 0.5241 l
+0.9667 0.5230 l
+0.9670 0.5218 l
+0.9673 0.5207 l
+0.9676 0.5197 l
+0.9678 0.5186 l
+0.9681 0.5177 l
+0.9684 0.5167 l
+0.9687 0.5159 l
+0.9690 0.5151 l
+0.9693 0.5144 l
+0.9696 0.5137 l
+0.9698 0.5131 l
+0.9701 0.5126 l
+0.9704 0.5121 l
+0.9707 0.5118 l
+0.9710 0.5115 l
+0.9713 0.5113 l
+0.9716 0.5112 l
+0.9718 0.5111 l
+0.9721 0.5112 l
+0.9724 0.5113 l
+0.9727 0.5115 l
+0.9730 0.5117 l
+0.9733 0.5121 l
+0.9736 0.5125 l
+0.9738 0.5129 l
+0.9741 0.5135 l
+0.9744 0.5141 l
+0.9747 0.5147 l
+0.9750 0.5154 l
+0.9753 0.5161 l
+0.9756 0.5169 l
+0.9759 0.5177 l
+0.9761 0.5186 l
+0.9764 0.5194 l
+0.9767 0.5203 l
+0.9770 0.5212 l
+0.9773 0.5221 l
+0.9776 0.5230 l
+0.9779 0.5240 l
+0.9781 0.5249 l
+0.9784 0.5258 l
+0.9787 0.5266 l
+0.9790 0.5275 l
+0.9793 0.5283 l
+0.9796 0.5291 l
+0.9799 0.5299 l
+0.9801 0.5306 l
+0.9804 0.5313 l
+0.9807 0.5320 l
+0.9810 0.5326 l
+0.9813 0.5331 l
+0.9816 0.5336 l
+0.9819 0.5341 l
+0.9821 0.5344 l
+0.9824 0.5348 l
+0.9827 0.5350 l
+0.9830 0.5352 l
+0.9833 0.5354 l
+0.9836 0.5355 l
+0.9839 0.5355 l
+0.9842 0.5354 l
+0.9844 0.5353 l
+0.9847 0.5352 l
+0.9850 0.5350 l
+0.9853 0.5347 l
+0.9856 0.5344 l
+0.9859 0.5341 l
+0.9862 0.5336 l
+0.9864 0.5332 l
+0.9867 0.5327 l
+0.9870 0.5322 l
+0.9873 0.5316 l
+0.9876 0.5310 l
+0.9879 0.5304 l
+0.9882 0.5298 l
+0.9884 0.5291 l
+0.9887 0.5284 l
+0.9890 0.5278 l
+0.9893 0.5271 l
+0.9896 0.5264 l
+0.9899 0.5257 l
+0.9902 0.5250 l
+0.9904 0.5243 l
+0.9907 0.5237 l
+0.9910 0.5230 l
+0.9913 0.5224 l
+0.9916 0.5218 l
+0.9919 0.5212 l
+0.9922 0.5207 l
+0.9925 0.5202 l
+0.9927 0.5197 l
+0.9930 0.5193 l
+0.9933 0.5189 l
+0.9936 0.5185 l
+0.9939 0.5182 l
+0.9942 0.5179 l
+0.9945 0.5177 l
+0.9947 0.5175 l
+0.9950 0.5173 l
+0.9953 0.5172 l
+0.9956 0.5172 l
+0.9959 0.5172 l
+0.9962 0.5172 l
+0.9965 0.5173 l
+0.9967 0.5174 l
+0.9970 0.5176 l
+0.9973 0.5178 l
+0.9976 0.5180 l
+0.9979 0.5183 l
+0.9982 0.5186 l
+0.9985 0.5189 l
+0.9987 0.5193 l
+0.9990 0.5197 l
+0.9993 0.5201 l
+0.9996 0.5206 l
+0.9999 0.5210 l
+1.0002 0.5215 l
+1.0005 0.5220 l
+1.0008 0.5225 l
+1.0010 0.5230 l
+1.0013 0.5235 l
+1.0016 0.5240 l
+1.0019 0.5245 l
+1.0022 0.5250 l
+1.0025 0.5255 l
+1.0028 0.5260 l
+1.0030 0.5265 l
+1.0033 0.5270 l
+1.0036 0.5274 l
+1.0039 0.5278 l
+1.0042 0.5282 l
+1.0045 0.5286 l
+1.0048 0.5290 l
+1.0050 0.5293 l
+1.0053 0.5296 l
+1.0056 0.5298 l
+1.0059 0.5301 l
+1.0062 0.5303 l
+1.0065 0.5305 l
+1.0068 0.5306 l
+1.0070 0.5307 l
+1.0073 0.5308 l
+1.0076 0.5308 l
+1.0079 0.5308 l
+1.0082 0.5308 l
+1.0085 0.5307 l
+1.0088 0.5306 l
+1.0091 0.5305 l
+1.0093 0.5303 l
+1.0096 0.5302 l
+1.0099 0.5299 l
+1.0102 0.5297 l
+1.0105 0.5295 l
+1.0108 0.5292 l
+1.0111 0.5289 l
+1.0113 0.5286 l
+1.0116 0.5282 l
+1.0119 0.5279 l
+1.0122 0.5275 l
+1.0125 0.5272 l
+1.0128 0.5268 l
+1.0131 0.5264 l
+1.0133 0.5261 l
+1.0136 0.5257 l
+1.0139 0.5253 l
+1.0142 0.5249 l
+1.0145 0.5246 l
+1.0148 0.5242 l
+1.0151 0.5239 l
+1.0153 0.5235 l
+1.0156 0.5232 l
+1.0159 0.5229 l
+1.0162 0.5226 l
+1.0165 0.5223 l
+1.0168 0.5221 l
+1.0171 0.5218 l
+1.0174 0.5216 l
+1.0176 0.5214 l
+1.0179 0.5213 l
+1.0182 0.5211 l
+1.0185 0.5210 l
+1.0188 0.5209 l
+1.0191 0.5208 l
+1.0194 0.5208 l
+1.0196 0.5208 l
+1.0199 0.5208 l
+1.0202 0.5208 l
+1.0205 0.5208 l
+1.0208 0.5209 l
+1.0211 0.5210 l
+1.0214 0.5211 l
+1.0216 0.5213 l
+1.0219 0.5214 l
+1.0222 0.5216 l
+1.0225 0.5218 l
+1.0228 0.5220 l
+1.0231 0.5222 l
+1.0234 0.5224 l
+1.0237 0.5227 l
+1.0239 0.5229 l
+1.0242 0.5232 l
+1.0245 0.5234 l
+1.0248 0.5237 l
+1.0251 0.5240 l
+1.0254 0.5243 l
+1.0257 0.5245 l
+1.0259 0.5248 l
+1.0262 0.5251 l
+1.0265 0.5253 l
+1.0268 0.5256 l
+1.0271 0.5259 l
+1.0274 0.5261 l
+1.0277 0.5263 l
+1.0279 0.5266 l
+1.0282 0.5268 l
+1.0285 0.5270 l
+1.0288 0.5272 l
+1.0291 0.5273 l
+1.0294 0.5275 l
+1.0297 0.5276 l
+1.0299 0.5277 l
+1.0302 0.5278 l
+1.0305 0.5279 l
+1.0308 0.5280 l
+1.0311 0.5280 l
+1.0314 0.5281 l
+1.0317 0.5281 l
+1.0320 0.5281 l
+1.0322 0.5280 l
+1.0325 0.5280 l
+1.0328 0.5280 l
+1.0331 0.5279 l
+1.0334 0.5278 l
+1.0337 0.5277 l
+1.0340 0.5276 l
+1.0342 0.5275 l
+1.0345 0.5273 l
+1.0348 0.5272 l
+1.0351 0.5270 l
+1.0354 0.5268 l
+1.0357 0.5267 l
+1.0360 0.5265 l
+1.0362 0.5263 l
+1.0365 0.5261 l
+1.0368 0.5259 l
+1.0371 0.5257 l
+1.0374 0.5255 l
+1.0377 0.5253 l
+1.0380 0.5251 l
+1.0382 0.5249 l
+1.0385 0.5247 l
+1.0388 0.5245 l
+1.0391 0.5244 l
+1.0394 0.5242 l
+1.0397 0.5240 l
+1.0400 0.5239 l
+1.0403 0.5237 l
+1.0405 0.5236 l
+1.0408 0.5234 l
+1.0411 0.5233 l
+1.0414 0.5232 l
+1.0417 0.5231 l
+1.0420 0.5230 l
+1.0423 0.5230 l
+1.0425 0.5229 l
+1.0428 0.5229 l
+1.0431 0.5228 l
+1.0434 0.5228 l
+1.0437 0.5228 l
+1.0440 0.5228 l
+1.0443 0.5228 l
+1.0445 0.5229 l
+1.0448 0.5229 l
+1.0451 0.5229 l
+1.0454 0.5230 l
+1.0457 0.5231 l
+1.0460 0.5232 l
+1.0463 0.5233 l
+1.0465 0.5234 l
+1.0468 0.5235 l
+1.0471 0.5236 l
+1.0474 0.5237 l
+1.0477 0.5238 l
+1.0480 0.5240 l
+1.0483 0.5241 l
+1.0486 0.5242 l
+1.0488 0.5244 l
+1.0491 0.5245 l
+1.0494 0.5247 l
+1.0497 0.5248 l
+1.0500 0.5249 l
+1.0503 0.5251 l
+1.0506 0.5252 l
+1.0508 0.5253 l
+1.0511 0.5255 l
+1.0514 0.5256 l
+1.0517 0.5257 l
+1.0520 0.5258 l
+1.0523 0.5259 l
+1.0526 0.5260 l
+1.0528 0.5261 l
+1.0531 0.5262 l
+1.0534 0.5263 l
+1.0537 0.5263 l
+1.0540 0.5264 l
+1.0543 0.5264 l
+1.0546 0.5265 l
+1.0548 0.5265 l
+1.0551 0.5265 l
+1.0554 0.5266 l
+1.0557 0.5266 l
+1.0560 0.5266 l
+1.0563 0.5265 l
+1.0566 0.5265 l
+1.0569 0.5265 l
+1.0571 0.5264 l
+1.0574 0.5264 l
+1.0577 0.5263 l
+1.0580 0.5263 l
+1.0583 0.5262 l
+1.0586 0.5262 l
+1.0589 0.5261 l
+1.0591 0.5260 l
+1.0594 0.5259 l
+1.0597 0.5258 l
+1.0600 0.5257 l
+1.0603 0.5256 l
+1.0606 0.5255 l
+1.0609 0.5254 l
+1.0611 0.5253 l
+1.0614 0.5252 l
+1.0617 0.5251 l
+1.0620 0.5250 l
+1.0623 0.5249 l
+1.0626 0.5248 l
+1.0629 0.5248 l
+1.0631 0.5247 l
+1.0634 0.5246 l
+1.0637 0.5245 l
+1.0640 0.5244 l
+1.0643 0.5243 l
+1.0646 0.5243 l
+1.0649 0.5242 l
+1.0652 0.5242 l
+1.0654 0.5241 l
+1.0657 0.5241 l
+1.0660 0.5240 l
+1.0663 0.5240 l
+1.0666 0.5240 l
+1.0669 0.5239 l
+1.0672 0.5239 l
+1.0674 0.5239 l
+1.0677 0.5239 l
+1.0680 0.5239 l
+1.0683 0.5239 l
+1.0686 0.5239 l
+1.0689 0.5240 l
+1.0692 0.5240 l
+1.0694 0.5240 l
+1.0697 0.5241 l
+1.0700 0.5241 l
+1.0703 0.5242 l
+1.0706 0.5242 l
+1.0709 0.5243 l
+1.0712 0.5243 l
+1.0715 0.5244 l
+1.0717 0.5244 l
+1.0720 0.5245 l
+1.0723 0.5246 l
+1.0726 0.5246 l
+1.0729 0.5247 l
+1.0732 0.5248 l
+1.0735 0.5248 l
+1.0737 0.5249 l
+1.0740 0.5250 l
+1.0743 0.5251 l
+1.0746 0.5251 l
+1.0749 0.5252 l
+1.0752 0.5252 l
+1.0755 0.5253 l
+1.0757 0.5254 l
+1.0760 0.5254 l
+1.0763 0.5255 l
+1.0766 0.5255 l
+1.0769 0.5256 l
+1.0772 0.5256 l
+1.0775 0.5256 l
+1.0777 0.5257 l
+1.0780 0.5257 l
+1.0783 0.5257 l
+1.0786 0.5257 l
+1.0789 0.5257 l
+1.0792 0.5258 l
+1.0795 0.5258 l
+1.0798 0.5258 l
+1.0800 0.5258 l
+1.0803 0.5257 l
+1.0806 0.5257 l
+1.0809 0.5257 l
+1.0812 0.5257 l
+1.0815 0.5257 l
+1.0818 0.5256 l
+1.0820 0.5256 l
+1.0823 0.5256 l
+1.0826 0.5255 l
+1.0829 0.5255 l
+1.0832 0.5255 l
+1.0835 0.5254 l
+1.0838 0.5254 l
+1.0840 0.5253 l
+1.0843 0.5253 l
+1.0846 0.5252 l
+1.0849 0.5252 l
+1.0852 0.5251 l
+1.0855 0.5251 l
+1.0858 0.5251 l
+1.0860 0.5250 l
+1.0863 0.5250 l
+1.0866 0.5249 l
+1.0869 0.5249 l
+1.0872 0.5248 l
+1.0875 0.5248 l
+1.0878 0.5247 l
+1.0881 0.5247 l
+1.0883 0.5247 l
+1.0886 0.5246 l
+1.0889 0.5246 l
+1.0892 0.5246 l
+1.0895 0.5246 l
+1.0898 0.5245 l
+1.0901 0.5245 l
+1.0903 0.5245 l
+1.0906 0.5245 l
+1.0909 0.5245 l
+1.0912 0.5245 l
+1.0915 0.5245 l
+1.0918 0.5245 l
+1.0921 0.5245 l
+1.0923 0.5245 l
+1.0926 0.5245 l
+1.0929 0.5245 l
+1.0932 0.5245 l
+1.0935 0.5245 l
+1.0938 0.5246 l
+1.0941 0.5246 l
+1.0943 0.5246 l
+1.0946 0.5246 l
+1.0949 0.5247 l
+1.0952 0.5247 l
+1.0955 0.5247 l
+1.0958 0.5247 l
+1.0961 0.5248 l
+1.0964 0.5248 l
+1.0966 0.5248 l
+1.0969 0.5249 l
+1.0972 0.5249 l
+1.0975 0.5249 l
+1.0978 0.5250 l
+1.0981 0.5250 l
+1.0984 0.5250 l
+1.0986 0.5251 l
+1.0989 0.5251 l
+1.0992 0.5251 l
+1.0995 0.5251 l
+1.0998 0.5252 l
+1.1001 0.5252 l
+1.1004 0.5252 l
+1.1006 0.5252 l
+1.1009 0.5253 l
+1.1012 0.5253 l
+1.1015 0.5253 l
+1.1018 0.5253 l
+1.1021 0.5253 l
+1.1024 0.5253 l
+1.1026 0.5253 l
+1.1029 0.5253 l
+1.1032 0.5253 l
+1.1035 0.5254 l
+1.1038 0.5254 l
+1.1041 0.5253 l
+1.1044 0.5253 l
+1.1047 0.5253 l
+1.1049 0.5253 l
+1.1052 0.5253 l
+1.1055 0.5253 l
+1.1058 0.5253 l
+1.1061 0.5253 l
+1.1064 0.5253 l
+1.1067 0.5252 l
+1.1069 0.5252 l
+1.1072 0.5252 l
+1.1075 0.5252 l
+1.1078 0.5252 l
+1.1081 0.5252 l
+1.1084 0.5251 l
+1.1087 0.5251 l
+1.1089 0.5251 l
+1.1092 0.5251 l
+1.1095 0.5250 l
+1.1098 0.5250 l
+1.1101 0.5250 l
+1.1104 0.5250 l
+1.1107 0.5250 l
+1.1109 0.5249 l
+1.1112 0.5249 l
+1.1115 0.5249 l
+1.1118 0.5249 l
+1.1121 0.5249 l
+1.1124 0.5248 l
+1.1127 0.5248 l
+1.1130 0.5248 l
+1.1132 0.5248 l
+1.1135 0.5248 l
+1.1138 0.5248 l
+1.1141 0.5248 l
+1.1144 0.5248 l
+1.1147 0.5248 l
+1.1150 0.5248 l
+1.1152 0.5248 l
+1.1155 0.5248 l
+1.1158 0.5248 l
+1.1161 0.5248 l
+1.1164 0.5248 l
+1.1167 0.5248 l
+1.1170 0.5248 l
+1.1172 0.5248 l
+1.1175 0.5248 l
+1.1178 0.5248 l
+1.1181 0.5248 l
+1.1184 0.5248 l
+1.1187 0.5248 l
+1.1190 0.5248 l
+1.1192 0.5249 l
+1.1195 0.5249 l
+1.1198 0.5249 l
+1.1201 0.5249 l
+1.1204 0.5249 l
+1.1207 0.5249 l
+1.1210 0.5249 l
+1.1213 0.5250 l
+1.1215 0.5250 l
+1.1218 0.5250 l
+1.1221 0.5250 l
+1.1224 0.5250 l
+1.1227 0.5250 l
+1.1230 0.5250 l
+1.1233 0.5251 l
+1.1235 0.5251 l
+1.1238 0.5251 l
+1.1241 0.5251 l
+1.1244 0.5251 l
+1.1247 0.5251 l
+1.1250 0.5251 l
+1.1253 0.5251 l
+1.1255 0.5251 l
+1.1258 0.5251 l
+1.1261 0.5251 l
+1.1264 0.5251 l
+1.1267 0.5252 l
+1.1270 0.5252 l
+1.1273 0.5252 l
+1.1276 0.5252 l
+1.1278 0.5252 l
+1.1281 0.5252 l
+1.1284 0.5252 l
+1.1287 0.5251 l
+1.1290 0.5251 l
+1.1293 0.5251 l
+1.1296 0.5251 l
+1.1298 0.5251 l
+1.1301 0.5251 l
+1.1304 0.5251 l
+1.1307 0.5251 l
+1.1310 0.5251 l
+1.1313 0.5251 l
+1.1316 0.5251 l
+1.1318 0.5251 l
+1.1321 0.5251 l
+1.1324 0.5251 l
+1.1327 0.5250 l
+1.1330 0.5250 l
+1.1333 0.5250 l
+1.1336 0.5250 l
+1.1338 0.5250 l
+1.1341 0.5250 l
+1.1344 0.5250 l
+1.1347 0.5250 l
+1.1350 0.5250 l
+1.1353 0.5250 l
+1.1356 0.5250 l
+1.1359 0.5249 l
+1.1361 0.5249 l
+1.1364 0.5249 l
+1.1367 0.5249 l
+1.1370 0.5249 l
+1.1373 0.5249 l
+1.1376 0.5249 l
+1.1379 0.5249 l
+1.1381 0.5249 l
+1.1384 0.5249 l
+1.1387 0.5249 l
+1.1390 0.5249 l
+1.1393 0.5249 l
+1.1396 0.5249 l
+1.1399 0.5249 l
+1.1401 0.5249 l
+1.1404 0.5249 l
+1.1407 0.5249 l
+1.1410 0.5249 l
+1.1413 0.5249 l
+1.1416 0.5249 l
+1.1419 0.5249 l
+1.1421 0.5249 l
+1.1424 0.5249 l
+1.1427 0.5249 l
+1.1430 0.5249 l
+1.1433 0.5249 l
+1.1436 0.5249 l
+1.1439 0.5250 l
+1.1442 0.5250 l
+1.1444 0.5250 l
+1.1447 0.5250 l
+1.1450 0.5250 l
+1.1453 0.5250 l
+1.1456 0.5250 l
+1.1459 0.5250 l
+1.1462 0.5250 l
+1.1464 0.5250 l
+1.1467 0.5250 l
+1.1470 0.5250 l
+1.1473 0.5250 l
+1.1476 0.5250 l
+1.1479 0.5250 l
+1.1482 0.5250 l
+1.1484 0.5250 l
+1.1487 0.5250 l
+1.1490 0.5251 l
+1.1493 0.5251 l
+1.1496 0.5251 l
+1.1499 0.5251 l
+1.1502 0.5251 l
+1.1504 0.5251 l
+1.1507 0.5251 l
+1.1510 0.5251 l
+1.1513 0.5251 l
+1.1516 0.5251 l
+1.1519 0.5251 l
+1.1522 0.5251 l
+1.1525 0.5251 l
+1.1527 0.5251 l
+1.1530 0.5251 l
+1.1533 0.5251 l
+1.1536 0.5251 l
+1.1539 0.5251 l
+1.1542 0.5251 l
+1.1545 0.5250 l
+1.1547 0.5250 l
+1.1550 0.5250 l
+1.1553 0.5250 l
+1.1556 0.5250 l
+1.1559 0.5250 l
+1.1562 0.5250 l
+1.1565 0.5250 l
+1.1567 0.5250 l
+1.1570 0.5250 l
+1.1573 0.5250 l
+1.1576 0.5250 l
+1.1579 0.5250 l
+1.1582 0.5250 l
+1.1585 0.5250 l
+1.1587 0.5250 l
+1.1590 0.5250 l
+1.1593 0.5250 l
+1.1596 0.5250 l
+1.1599 0.5250 l
+1.1602 0.5250 l
+1.1605 0.5250 l
+1.1608 0.5250 l
+1.1610 0.5250 l
+1.1613 0.5250 l
+1.1616 0.5250 l
+1.1619 0.5250 l
+1.1622 0.5250 l
+1.1625 0.5250 l
+1.1628 0.5250 l
+1.1630 0.5250 l
+1.1633 0.5250 l
+1.1636 0.5250 l
+1.1639 0.5250 l
+1.1642 0.5250 l
+1.1645 0.5250 l
+1.1648 0.5250 l
+1.1650 0.5250 l
+1.1653 0.5250 l
+1.1656 0.5250 l
+1.1659 0.5250 l
+1.1662 0.5250 l
+1.1665 0.5250 l
+1.1668 0.5250 l
+1.1670 0.5250 l
+1.1673 0.5250 l
+1.1676 0.5250 l
+1.1679 0.5250 l
+1.1682 0.5250 l
+1.1685 0.5250 l
+1.1688 0.5250 l
+1.1691 0.5250 l
+1.1693 0.5250 l
+1.1696 0.5250 l
+1.1699 0.5250 l
+1.1702 0.5250 l
+1.1705 0.5250 l
+1.1708 0.5250 l
+1.1711 0.5250 l
+1.1713 0.5250 l
+1.1716 0.5250 l
+1.1719 0.5250 l
+1.1722 0.5250 l
+1.1725 0.5250 l
+1.1728 0.5250 l
+1.1731 0.5250 l
+1.1733 0.5250 l
+1.1736 0.5250 l
+1.1739 0.5250 l
+1.1742 0.5250 l
+1.1745 0.5250 l
+1.1748 0.5250 l
+1.1751 0.5250 l
+1.1754 0.5250 l
+1.1756 0.5250 l
+1.1759 0.5250 l
+1.1762 0.5250 l
+1.1765 0.5250 l
+1.1768 0.5250 l
+1.1771 0.5250 l
+1.1774 0.5250 l
+1.1776 0.5250 l
+1.1779 0.5250 l
+1.1782 0.5250 l
+1.1785 0.5250 l
+1.1788 0.5250 l
+1.1791 0.5250 l
+1.1794 0.5250 l
+1.1796 0.5250 l
+1.1799 0.5250 l
+1.1802 0.5250 l
+1.1805 0.5250 l
+1.1808 0.5250 l
+1.1811 0.5250 l
+1.1814 0.5250 l
+1.1816 0.5250 l
+1.1819 0.5250 l
+1.1822 0.5250 l
+1.1825 0.5250 l
+1.1828 0.5250 l
+1.1831 0.5250 l
+1.1834 0.5250 l
+1.1837 0.5250 l
+1.1839 0.5250 l
+1.1842 0.5250 l
+1.1845 0.5250 l
+1.1848 0.5250 l
+1.1851 0.5250 l
+1.1854 0.5250 l
+1.1857 0.5250 l
+1.1859 0.5250 l
+1.1862 0.5250 l
+1.1865 0.5250 l
+1.1868 0.5250 l
+1.1871 0.5250 l
+1.1874 0.5250 l
+1.1877 0.5250 l
+1.1879 0.5250 l
+1.1882 0.5250 l
+1.1885 0.5250 l
+1.1888 0.5250 l
+1.1891 0.5250 l
+1.1894 0.5250 l
+1.1897 0.5250 l
+1.1899 0.5250 l
+1.1902 0.5250 l
+1.1905 0.5250 l
+1.1908 0.5250 l
+1.1911 0.5250 l
+1.1914 0.5250 l
+1.1917 0.5250 l
+1.1920 0.5250 l
+1.1922 0.5250 l
+1.1925 0.5250 l
+1.1928 0.5250 l
+1.1931 0.5250 l
+1.1934 0.5250 l
+1.1937 0.5250 l
+1.1940 0.5250 l
+1.1942 0.5250 l
+1.1945 0.5250 l
+1.1948 0.5250 l
+1.1951 0.5250 l
+1.1954 0.5250 l
+1.1957 0.5250 l
+1.1960 0.5250 l
+1.1962 0.5250 l
+1.1965 0.5250 l
+1.1968 0.5250 l
+1.1971 0.5250 l
+1.1974 0.5250 l
+1.1977 0.5250 l
+1.1980 0.5250 l
+1.1982 0.5250 l
+1.1985 0.5250 l
+1.1988 0.5250 l
+1.1991 0.5250 l
+1.1994 0.5250 l
+1.1997 0.5250 l
+1.2000 0.5250 l
+1.2003 0.5250 l
+1.2005 0.5250 l
+1.2008 0.5250 l
+1.2011 0.5250 l
+1.2014 0.5250 l
+1.2017 0.5250 l
+1.2020 0.5250 l
+1.2023 0.5250 l
+1.2025 0.5250 l
+1.2028 0.5250 l
+1.2031 0.5250 l
+1.2034 0.5250 l
+1.2037 0.5250 l
+1.2040 0.5250 l
+1.2043 0.5250 l
+1.2045 0.5250 l
+1.2048 0.5250 l
+1.2051 0.5250 l
+1.2054 0.5250 l
+1.2057 0.5250 l
+1.2060 0.5250 l
+1.2063 0.5250 l
+1.2065 0.5250 l
+1.2068 0.5250 l
+1.2071 0.5250 l
+1.2074 0.5250 l
+1.2077 0.5250 l
+1.2080 0.5250 l
+1.2083 0.5250 l
+1.2086 0.5250 l
+1.2088 0.5250 l
+1.2091 0.5250 l
+1.2094 0.5250 l
+1.2097 0.5250 l
+1.2100 0.5250 l
+1.2103 0.5250 l
+1.2106 0.5250 l
+1.2108 0.5250 l
+1.2111 0.5250 l
+1.2114 0.5250 l
+1.2117 0.5250 l
+1.2120 0.5250 l
+1.2123 0.5250 l
+1.2126 0.5250 l
+1.2128 0.5250 l
+1.2131 0.5250 l
+1.2134 0.5250 l
+1.2137 0.5250 l
+1.2140 0.5250 l
+1.2143 0.5250 l
+1.2146 0.5250 l
+1.2148 0.5250 l
+1.2151 0.5250 l
+1.2154 0.5250 l
+1.2157 0.5250 l
+1.2160 0.5250 l
+1.2163 0.5250 l
+1.2166 0.5250 l
+1.2169 0.5250 l
+1.2171 0.5250 l
+1.2174 0.5250 l
+1.2177 0.5250 l
+1.2180 0.5250 l
+1.2183 0.5250 l
+1.2186 0.5250 l
+1.2189 0.5250 l
+1.2191 0.5250 l
+1.2194 0.5250 l
+1.2197 0.5250 l
+1.2200 0.5250 l
+1.2203 0.5250 l
+1.2206 0.5250 l
+1.2209 0.5250 l
+1.2211 0.5250 l
+1.2214 0.5250 l
+1.2217 0.5250 l
+1.2220 0.5250 l
+1.2223 0.5250 l
+1.2226 0.5250 l
+1.2229 0.5250 l
+1.2231 0.5250 l
+1.2234 0.5250 l
+1.2237 0.5250 l
+1.2240 0.5250 l
+1.2243 0.5250 l
+1.2246 0.5250 l
+1.2249 0.5250 l
+1.2252 0.5250 l
+1.2254 0.5250 l
+1.2257 0.5250 l
+1.2260 0.5250 l
+1.2263 0.5250 l
+1.2266 0.5250 l
+1.2269 0.5250 l
+1.2272 0.5250 l
+1.2274 0.5250 l
+1.2277 0.5250 l
+1.2280 0.5250 l
+1.2283 0.5250 l
+1.2286 0.5250 l
+1.2289 0.5250 l
+1.2292 0.5250 l
+1.2294 0.5250 l
+1.2297 0.5250 l
+1.2300 0.5250 l
+1.2303 0.5250 l
+1.2306 0.5250 l
+1.2309 0.5250 l
+1.2312 0.5250 l
+1.2315 0.5250 l
+1.2317 0.5250 l
+1.2320 0.5250 l
+1.2323 0.5250 l
+1.2326 0.5250 l
+1.2329 0.5250 l
+1.2332 0.5250 l
+1.2335 0.5250 l
+1.2337 0.5250 l
+1.2340 0.5250 l
+1.2343 0.5250 l
+1.2346 0.5250 l
+1.2349 0.5250 l
+1.2352 0.5250 l
+1.2355 0.5250 l
+1.2357 0.5250 l
+1.2360 0.5250 l
+1.2363 0.5250 l
+1.2366 0.5250 l
+1.2369 0.5250 l
+1.2372 0.5250 l
+1.2375 0.5250 l
+1.2377 0.5250 l
+1.2380 0.5250 l
+1.2383 0.5250 l
+1.2386 0.5250 l
+1.2389 0.5250 l
+1.2392 0.5250 l
+1.2395 0.5250 l
+1.2398 0.5250 l
+1.2400 0.5250 l
+1.2403 0.5250 l
+1.2406 0.5250 l
+1.2409 0.5250 l
+1.2412 0.5250 l
+1.2415 0.5250 l
+1.2418 0.5250 l
+1.2420 0.5250 l
+1.2423 0.5250 l
+1.2426 0.5250 l
+1.2429 0.5250 l
+1.2432 0.5250 l
+1.2435 0.5250 l
+1.2438 0.5250 l
+1.2440 0.5250 l
+1.2443 0.5250 l
+1.2446 0.5250 l
+1.2449 0.5250 l
+s
+n
+0.1000 0.1000 m
+1.2449 0.1000 l
+s
+n
+0.1000 0.9500 m
+1.2449 0.9500 l
+s
+n
+0.2431 0.1000 m
+0.2431 0.1100 l
+s
+n
+0.2431 0.9500 m
+0.2431 0.9400 l
+s
+n
+0.5293 0.1000 m
+0.5293 0.1100 l
+s
+n
+0.5293 0.9500 m
+0.5293 0.9400 l
+s
+n
+0.8156 0.1000 m
+0.8156 0.1100 l
+s
+n
+0.8156 0.9500 m
+0.8156 0.9400 l
+s
+n
+1.1018 0.1000 m
+1.1018 0.1100 l
+s
+n
+1.1018 0.9500 m
+1.1018 0.9400 l
+s
+n
+0.1000 0.1000 m
+0.1000 0.1200 l
+s
+n
+0.1000 0.9500 m
+0.1000 0.9300 l
+s
+n
+0.3862 0.1000 m
+0.3862 0.1200 l
+s
+n
+0.3862 0.9500 m
+0.3862 0.9300 l
+s
+n
+0.6725 0.1000 m
+0.6725 0.1200 l
+s
+n
+0.6725 0.9500 m
+0.6725 0.9300 l
+s
+n
+0.9587 0.1000 m
+0.9587 0.1200 l
+s
+n
+0.9587 0.9500 m
+0.9587 0.9300 l
+s
+n
+1.2449 0.1000 m
+1.2449 0.1200 l
+s
+n
+1.2449 0.9500 m
+1.2449 0.9300 l
+s
+/Helvetica findfont
+dup length dict begin
+ {1 index /FID ne {def} {pop pop} ifelse} forall
+ /Encoding DefEncoding def
+ currentdict
+end
+/Font4 exch definefont pop
+/Font4 FFSF
+0.0912 0.0653 m
+GS
+[0.0350 0.0000 0.0000 0.0350 0 0] CC
+(0) show
+GR
+/Font4 FFSF
+0.3627 0.0653 m
+GS
+[0.0350 0.0000 0.0000 0.0350 0 0] CC
+(0.5) show
+GR
+/Font4 FFSF
+0.6664 0.0653 m
+GS
+[0.0350 0.0000 0.0000 0.0350 0 0] CC
+(1) show
+GR
+/Font4 FFSF
+0.9351 0.0653 m
+GS
+[0.0350 0.0000 0.0000 0.0350 0 0] CC
+(1.5) show
+GR
+/Font4 FFSF
+1.2359 0.0653 m
+GS
+[0.0350 0.0000 0.0000 0.0350 0 0] CC
+(2) show
+GR
+/Font4 FFSF
+0.5854 0.0239 m
+GS
+[0.0420 0.0000 0.0000 0.0420 0 0] CC
+(Time \(ps\)) show
+GR
+n
+0.1000 0.1000 m
+0.1000 0.9500 l
+s
+n
+1.2449 0.1000 m
+1.2449 0.9500 l
+s
+n
+0.1000 0.2063 m
+0.1100 0.2063 l
+s
+n
+1.2449 0.2063 m
+1.2349 0.2063 l
+s
+n
+0.1000 0.4188 m
+0.1100 0.4188 l
+s
+n
+1.2449 0.4188 m
+1.2349 0.4188 l
+s
+n
+0.1000 0.6312 m
+0.1100 0.6312 l
+s
+n
+1.2449 0.6312 m
+1.2349 0.6312 l
+s
+n
+0.1000 0.8438 m
+0.1100 0.8438 l
+s
+n
+1.2449 0.8438 m
+1.2349 0.8438 l
+s
+n
+0.1000 0.1000 m
+0.1200 0.1000 l
+s
+n
+1.2449 0.1000 m
+1.2249 0.1000 l
+s
+n
+0.1000 0.3125 m
+0.1200 0.3125 l
+s
+n
+1.2449 0.3125 m
+1.2249 0.3125 l
+s
+n
+0.1000 0.5250 m
+0.1200 0.5250 l
+s
+n
+1.2449 0.5250 m
+1.2249 0.5250 l
+s
+n
+0.1000 0.7375 m
+0.1200 0.7375 l
+s
+n
+1.2449 0.7375 m
+1.2249 0.7375 l
+s
+n
+0.1000 0.9500 m
+0.1200 0.9500 l
+s
+n
+1.2449 0.9500 m
+1.2249 0.9500 l
+s
+/Font4 FFSF
+0.0602 0.0878 m
+GS
+[0.0350 0.0000 0.0000 0.0350 0 0] CC
+(-2) show
+GR
+/Font4 FFSF
+0.0661 0.3001 m
+GS
+[0.0350 0.0000 0.0000 0.0350 0 0] CC
+(-1) show
+GR
+/Font4 FFSF
+0.0724 0.5130 m
+GS
+[0.0350 0.0000 0.0000 0.0350 0 0] CC
+(0) show
+GR
+/Font4 FFSF
+0.0778 0.7251 m
+GS
+[0.0350 0.0000 0.0000 0.0350 0 0] CC
+(1) show
+GR
+/Font4 FFSF
+0.0720 0.9378 m
+GS
+[0.0350 0.0000 0.0000 0.0350 0 0] CC
+(2) show
+GR
+/Font4 FFSF
+0.0412 0.3446 m
+GS
+[0.0000 0.0420 -0.0420 0.0000 0 0] CC
+(Electric field \(V/nm\)) show
+GR
+n
+0.1000 0.1000 m
+0.1000 0.9500 l
+1.2449 0.9500 l
+1.2449 0.1000 l
+0.1000 0.1000 l
+c
+s
+%%Trailer
+%%DocumentNeededResources: font Helvetica
+%%EOF
diff --git a/docs/manual/plots/field.xvg b/docs/manual/plots/field.xvg
new file mode 100644 (file)
index 0000000..0e333d3
--- /dev/null
@@ -0,0 +1,4299 @@
+# Grace project file
+#
+@version 50125
+@page size 792, 612
+@page scroll 5%
+@page inout 5%
+@link page off
+@map font 0 to "Times-Roman", "Times-Roman"
+@map font 1 to "Times-Italic", "Times-Italic"
+@map font 2 to "Times-Bold", "Times-Bold"
+@map font 3 to "Times-BoldItalic", "Times-BoldItalic"
+@map font 4 to "Helvetica", "Helvetica"
+@map font 5 to "Helvetica-Oblique", "Helvetica-Oblique"
+@map font 6 to "Helvetica-Bold", "Helvetica-Bold"
+@map font 7 to "Helvetica-BoldOblique", "Helvetica-BoldOblique"
+@map font 8 to "Courier", "Courier"
+@map font 9 to "Courier-Oblique", "Courier-Oblique"
+@map font 10 to "Courier-Bold", "Courier-Bold"
+@map font 11 to "Courier-BoldOblique", "Courier-BoldOblique"
+@map font 12 to "Symbol", "Symbol"
+@map font 13 to "ZapfDingbats", "ZapfDingbats"
+@map color 0 to (255, 255, 255), "white"
+@map color 1 to (0, 0, 0), "black"
+@map color 2 to (255, 0, 0), "red"
+@map color 3 to (0, 255, 0), "green"
+@map color 4 to (0, 0, 255), "blue"
+@map color 5 to (255, 255, 0), "yellow"
+@map color 6 to (188, 143, 143), "brown"
+@map color 7 to (220, 220, 220), "grey"
+@map color 8 to (148, 0, 211), "violet"
+@map color 9 to (0, 255, 255), "cyan"
+@map color 10 to (255, 0, 255), "magenta"
+@map color 11 to (255, 165, 0), "orange"
+@map color 12 to (114, 33, 188), "indigo"
+@map color 13 to (103, 7, 72), "maroon"
+@map color 14 to (64, 224, 208), "turquoise"
+@map color 15 to (0, 139, 0), "green4"
+@reference date 0
+@date wrap off
+@date wrap year 1950
+@default linewidth 1.0
+@default linestyle 1
+@default color 1
+@default pattern 1
+@default font 0
+@default char size 1.000000
+@default symbol size 1.000000
+@default sformat "%.8g"
+@background color 0
+@page background fill on
+@timestamp off
+@timestamp 0.03, 0.03
+@timestamp color 1
+@timestamp rot 0
+@timestamp font 0
+@timestamp char size 1.000000
+@timestamp def "Tue Jul  5 08:29:55 2016"
+@r0 off
+@link r0 to g0
+@r0 type above
+@r0 linestyle 1
+@r0 linewidth 1.0
+@r0 color 1
+@r0 line 0, 0, 0, 0
+@r1 off
+@link r1 to g0
+@r1 type above
+@r1 linestyle 1
+@r1 linewidth 1.0
+@r1 color 1
+@r1 line 0, 0, 0, 0
+@r2 off
+@link r2 to g0
+@r2 type above
+@r2 linestyle 1
+@r2 linewidth 1.0
+@r2 color 1
+@r2 line 0, 0, 0, 0
+@r3 off
+@link r3 to g0
+@r3 type above
+@r3 linestyle 1
+@r3 linewidth 1.0
+@r3 color 1
+@r3 line 0, 0, 0, 0
+@r4 off
+@link r4 to g0
+@r4 type above
+@r4 linestyle 1
+@r4 linewidth 1.0
+@r4 color 1
+@r4 line 0, 0, 0, 0
+@g0 on
+@g0 hidden false
+@g0 type XY
+@g0 stacked false
+@g0 bar hgap 0.000000
+@g0 fixedpoint off
+@g0 fixedpoint type 0
+@g0 fixedpoint xy 0.000000, 0.000000
+@g0 fixedpoint format general general
+@g0 fixedpoint prec 6, 6
+@with g0
+@    world 0, -2, 2, 2
+@    stack world 0, 0, 0, 0
+@    znorm 1
+@    view 0.100000, 0.100000, 1.244903, 0.950000
+@    title ""
+@    title font 0
+@    title size 1.500000
+@    title color 1
+@    subtitle ""
+@    subtitle font 0
+@    subtitle size 1.000000
+@    subtitle color 1
+@    xaxes scale Normal
+@    yaxes scale Normal
+@    xaxes invert off
+@    yaxes invert off
+@    xaxis  on
+@    xaxis  type zero false
+@    xaxis  offset 0.000000 , 0.000000
+@    xaxis  bar on
+@    xaxis  bar color 1
+@    xaxis  bar linestyle 1
+@    xaxis  bar linewidth 1.0
+@    xaxis  label "Time (ps)"
+@    xaxis  label layout para
+@    xaxis  label place auto
+@    xaxis  label char size 1.500000
+@    xaxis  label font 4
+@    xaxis  label color 1
+@    xaxis  label place normal
+@    xaxis  tick on
+@    xaxis  tick major 0.5
+@    xaxis  tick minor ticks 1
+@    xaxis  tick default 6
+@    xaxis  tick place rounded true
+@    xaxis  tick in
+@    xaxis  tick major size 1.000000
+@    xaxis  tick major color 1
+@    xaxis  tick major linewidth 1.0
+@    xaxis  tick major linestyle 1
+@    xaxis  tick major grid off
+@    xaxis  tick minor color 1
+@    xaxis  tick minor linewidth 1.0
+@    xaxis  tick minor linestyle 1
+@    xaxis  tick minor grid off
+@    xaxis  tick minor size 0.500000
+@    xaxis  ticklabel on
+@    xaxis  ticklabel format general
+@    xaxis  ticklabel prec 5
+@    xaxis  ticklabel formula ""
+@    xaxis  ticklabel append ""
+@    xaxis  ticklabel prepend ""
+@    xaxis  ticklabel angle 0
+@    xaxis  ticklabel skip 0
+@    xaxis  ticklabel stagger 0
+@    xaxis  ticklabel place normal
+@    xaxis  ticklabel offset auto
+@    xaxis  ticklabel offset 0.000000 , 0.010000
+@    xaxis  ticklabel start type auto
+@    xaxis  ticklabel start 0.000000
+@    xaxis  ticklabel stop type auto
+@    xaxis  ticklabel stop 0.000000
+@    xaxis  ticklabel char size 1.250000
+@    xaxis  ticklabel font 4
+@    xaxis  ticklabel color 1
+@    xaxis  tick place both
+@    xaxis  tick spec type none
+@    yaxis  on
+@    yaxis  type zero false
+@    yaxis  offset 0.000000 , 0.000000
+@    yaxis  bar on
+@    yaxis  bar color 1
+@    yaxis  bar linestyle 1
+@    yaxis  bar linewidth 1.0
+@    yaxis  label "Electric field (V/nm)"
+@    yaxis  label layout para
+@    yaxis  label place auto
+@    yaxis  label char size 1.500000
+@    yaxis  label font 4
+@    yaxis  label color 1
+@    yaxis  label place normal
+@    yaxis  tick on
+@    yaxis  tick major 1
+@    yaxis  tick minor ticks 1
+@    yaxis  tick default 6
+@    yaxis  tick place rounded true
+@    yaxis  tick in
+@    yaxis  tick major size 1.000000
+@    yaxis  tick major color 1
+@    yaxis  tick major linewidth 1.0
+@    yaxis  tick major linestyle 1
+@    yaxis  tick major grid off
+@    yaxis  tick minor color 1
+@    yaxis  tick minor linewidth 1.0
+@    yaxis  tick minor linestyle 1
+@    yaxis  tick minor grid off
+@    yaxis  tick minor size 0.500000
+@    yaxis  ticklabel on
+@    yaxis  ticklabel format general
+@    yaxis  ticklabel prec 5
+@    yaxis  ticklabel formula ""
+@    yaxis  ticklabel append ""
+@    yaxis  ticklabel prepend ""
+@    yaxis  ticklabel angle 0
+@    yaxis  ticklabel skip 0
+@    yaxis  ticklabel stagger 0
+@    yaxis  ticklabel place normal
+@    yaxis  ticklabel offset auto
+@    yaxis  ticklabel offset 0.000000 , 0.010000
+@    yaxis  ticklabel start type auto
+@    yaxis  ticklabel start 0.000000
+@    yaxis  ticklabel stop type auto
+@    yaxis  ticklabel stop 0.000000
+@    yaxis  ticklabel char size 1.250000
+@    yaxis  ticklabel font 4
+@    yaxis  ticklabel color 1
+@    yaxis  tick place both
+@    yaxis  tick spec type none
+@    altxaxis  off
+@    altyaxis  off
+@    legend on
+@    legend loctype view
+@    legend 0.85, 0.8
+@    legend box color 1
+@    legend box pattern 1
+@    legend box linewidth 1.0
+@    legend box linestyle 1
+@    legend box fill color 0
+@    legend box fill pattern 1
+@    legend font 0
+@    legend char size 1.000000
+@    legend color 1
+@    legend length 4
+@    legend vgap 1
+@    legend hgap 1
+@    legend invert false
+@    frame type 0
+@    frame linestyle 1
+@    frame linewidth 1.0
+@    frame color 1
+@    frame pattern 1
+@    frame background color 0
+@    frame background pattern 0
+@    s0 hidden false
+@    s0 type xy
+@    s0 symbol 0
+@    s0 symbol size 1.000000
+@    s0 symbol color 1
+@    s0 symbol pattern 1
+@    s0 symbol fill color 1
+@    s0 symbol fill pattern 0
+@    s0 symbol linewidth 1.0
+@    s0 symbol linestyle 1
+@    s0 symbol char 65
+@    s0 symbol char font 0
+@    s0 symbol skip 0
+@    s0 line type 1
+@    s0 line linestyle 1
+@    s0 line linewidth 1.0
+@    s0 line color 1
+@    s0 line pattern 1
+@    s0 baseline type 0
+@    s0 baseline off
+@    s0 dropline off
+@    s0 fill type 0
+@    s0 fill rule 0
+@    s0 fill color 1
+@    s0 fill pattern 1
+@    s0 avalue off
+@    s0 avalue type 2
+@    s0 avalue char size 1.000000
+@    s0 avalue font 0
+@    s0 avalue color 1
+@    s0 avalue rot 0
+@    s0 avalue format general
+@    s0 avalue prec 3
+@    s0 avalue prepend ""
+@    s0 avalue append ""
+@    s0 avalue offset 0.000000 , 0.000000
+@    s0 errorbar on
+@    s0 errorbar place both
+@    s0 errorbar color 1
+@    s0 errorbar pattern 1
+@    s0 errorbar size 1.000000
+@    s0 errorbar linewidth 1.0
+@    s0 errorbar linestyle 1
+@    s0 errorbar riser linewidth 1.0
+@    s0 errorbar riser linestyle 1
+@    s0 errorbar riser clip off
+@    s0 errorbar riser clip length 0.100000
+@    s0 comment "field.xvg"
+@    s0 legend  ""
+@target G0.S0
+@type xy
+0 5.21174e-06
+0.0005 4.8582e-06
+0.001 4.46725e-06
+0.0015 4.04017e-06
+0.002 3.57871e-06
+0.0025 3.08465e-06
+0.003 2.56005e-06
+0.0035 2.0072e-06
+0.004 1.42855e-06
+0.0045 8.27051e-07
+0.005 2.0556e-07
+0.0055 -4.3279e-07
+0.006 -1.08468e-06
+0.0065 -1.74674e-06
+0.007 -2.4151e-06
+0.0075 -3.08612e-06
+0.008 -3.75593e-06
+0.0085 -4.42057e-06
+0.009 -5.07613e-06
+0.0095 -5.7183e-06
+0.01 -6.34309e-06
+0.0105 -6.94642e-06
+0.011 -7.52419e-06
+0.0115 -8.07249e-06
+0.012 -8.58716e-06
+0.0125 -9.06443e-06
+0.013 -9.5006e-06
+0.0135 -9.89205e-06
+0.014 -1.02354e-05
+0.0145 -1.05275e-05
+0.015 -1.07651e-05
+0.0155 -1.09458e-05
+0.016 -1.10668e-05
+0.0165 -1.11262e-05
+0.017 -1.11219e-05
+0.0175 -1.10524e-05
+0.018 -1.09166e-05
+0.0185 -1.07135e-05
+0.019 -1.04426e-05
+0.0195 -1.01039e-05
+0.02 -9.69779e-06
+0.0205 -9.22485e-06
+0.021 -8.68609e-06
+0.0215 -8.0833e-06
+0.022 -7.41831e-06
+0.0225 -6.69347e-06
+0.023 -5.91155e-06
+0.0235 -5.07554e-06
+0.024 -4.18956e-06
+0.0245 -3.25681e-06
+0.025 -2.28218e-06
+0.0255 -1.27017e-06
+0.026 -2.25546e-07
+0.0265 8.45705e-07
+0.027 1.93884e-06
+0.0275 3.04734e-06
+0.028 4.1653e-06
+0.0285 5.28662e-06
+0.029 6.40417e-06
+0.0295 7.51217e-06
+0.03 8.60324e-06
+0.0305 9.67081e-06
+0.031 1.07082e-05
+0.0315 1.17081e-05
+0.032 1.26644e-05
+0.0325 1.357e-05
+0.033 1.44184e-05
+0.0335 1.52034e-05
+0.034 1.59185e-05
+0.0345 1.65582e-05
+0.035 1.71168e-05
+0.0355 1.75889e-05
+0.036 1.79698e-05
+0.0365 1.82549e-05
+0.037 1.84404e-05
+0.0375 1.85226e-05
+0.038 1.84986e-05
+0.0385 1.83658e-05
+0.039 1.81227e-05
+0.0395 1.77676e-05
+0.04 1.73001e-05
+0.0405 1.67203e-05
+0.041 1.60287e-05
+0.0415 1.52266e-05
+0.042 1.4316e-05
+0.0425 1.32999e-05
+0.043 1.21814e-05
+0.0435 1.09648e-05
+0.044 9.65433e-06
+0.0445 8.2561e-06
+0.045 6.77585e-06
+0.0455 5.22026e-06
+0.046 3.59662e-06
+0.0465 1.91244e-06
+0.047 1.76813e-07
+0.0475 -1.60169e-06
+0.048 -3.4137e-06
+0.0485 -5.24943e-06
+0.049 -7.09906e-06
+0.0495 -8.95136e-06
+0.05 -1.0796e-05
+0.0505 -1.26218e-05
+0.051 -1.44179e-05
+0.0515 -1.61733e-05
+0.052 -1.7876e-05
+0.0525 -1.95152e-05
+0.053 -2.10797e-05
+0.0535 -2.25588e-05
+0.054 -2.39418e-05
+0.0545 -2.52179e-05
+0.055 -2.63773e-05
+0.0555 -2.74107e-05
+0.056 -2.83084e-05
+0.0565 -2.90627e-05
+0.057 -2.96652e-05
+0.0575 -3.0109e-05
+0.058 -3.03877e-05
+0.0585 -3.04957e-05
+0.059 -3.04283e-05
+0.0595 -3.01817e-05
+0.06 -2.97532e-05
+0.0605 -2.9141e-05
+0.061 -2.83441e-05
+0.0615 -2.73627e-05
+0.062 -2.61986e-05
+0.0625 -2.48541e-05
+0.063 -2.33327e-05
+0.0635 -2.16391e-05
+0.064 -1.97788e-05
+0.0645 -1.77594e-05
+0.065 -1.55887e-05
+0.0655 -1.32758e-05
+0.066 -1.08307e-05
+0.0665 -8.26413e-06
+0.067 -5.58933e-06
+0.0675 -2.8188e-06
+0.068 3.3503e-08
+0.0685 2.95285e-06
+0.069 5.92437e-06
+0.0695 8.93009e-06
+0.07 1.19557e-05
+0.0705 1.49822e-05
+0.071 1.79924e-05
+0.0715 2.09691e-05
+0.072 2.38928e-05
+0.0725 2.67458e-05
+0.073 2.95098e-05
+0.0735 3.21666e-05
+0.074 3.46986e-05
+0.0745 3.70872e-05
+0.075 3.93155e-05
+0.0755 4.13667e-05
+0.076 4.32248e-05
+0.0765 4.48746e-05
+0.077 4.63011e-05
+0.0775 4.74911e-05
+0.078 4.8432e-05
+0.0785 4.91127e-05
+0.079 4.95229e-05
+0.0795 4.96542e-05
+0.08 4.94991e-05
+0.0805 4.90519e-05
+0.081 4.83086e-05
+0.0815 4.72662e-05
+0.082 4.59245e-05
+0.0825 4.4284e-05
+0.083 4.23475e-05
+0.0835 4.01187e-05
+0.084 3.76052e-05
+0.0845 3.48143e-05
+0.085 3.1756e-05
+0.0855 2.8442e-05
+0.086 2.48848e-05
+0.0865 2.11021e-05
+0.087 1.71074e-05
+0.0875 1.29217e-05
+0.088 8.5642e-06
+0.0885 4.05536e-06
+0.089 -5.79145e-07
+0.0895 -5.31895e-06
+0.09 -1.01359e-05
+0.0905 -1.50047e-05
+0.091 -1.98991e-05
+0.0915 -2.47881e-05
+0.092 -2.96471e-05
+0.0925 -3.44439e-05
+0.093 -3.91504e-05
+0.0935 -4.37376e-05
+0.094 -4.81737e-05
+0.0945 -5.24325e-05
+0.095 -5.64828e-05
+0.0955 -6.02969e-05
+0.096 -6.38478e-05
+0.0965 -6.7107e-05
+0.097 -7.00511e-05
+0.0975 -7.26541e-05
+0.098 -7.48937e-05
+0.0985 -7.67485e-05
+0.099 -7.81986e-05
+0.0995 -7.92268e-05
+0.1 -7.98172e-05
+0.1005 -7.99564e-05
+0.101 -7.96334e-05
+0.1015 -7.884e-05
+0.102 -7.75691e-05
+0.1025 -7.58184e-05
+0.103 -7.35867e-05
+0.1035 -7.08762e-05
+0.104 -6.76919e-05
+0.1045 -6.40408e-05
+0.105 -5.99352e-05
+0.1055 -5.53879e-05
+0.106 -5.04157e-05
+0.1065 -4.50365e-05
+0.107 -3.92749e-05
+0.1075 -3.31549e-05
+0.108 -2.67039e-05
+0.1085 -1.9952e-05
+0.109 -1.2932e-05
+0.1095 -5.67709e-06
+0.11 1.77265e-06
+0.1105 9.37968e-06
+0.111 1.71032e-05
+0.1115 2.49024e-05
+0.112 3.27304e-05
+0.1125 4.05437e-05
+0.113 4.82966e-05
+0.1135 5.59424e-05
+0.114 6.34357e-05
+0.1145 7.07264e-05
+0.115 7.77691e-05
+0.1155 8.45172e-05
+0.116 9.09248e-05
+0.1165 9.69478e-05
+0.117 0.000102541
+0.1175 0.000107662
+0.118 0.000112273
+0.1185 0.000116332
+0.119 0.000119806
+0.1195 0.000122661
+0.12 0.000124867
+0.1205 0.000126395
+0.121 0.000127223
+0.1215 0.00012733
+0.122 0.000126699
+0.1225 0.000125318
+0.123 0.000123178
+0.1235 0.000120274
+0.124 0.000116606
+0.1245 0.00011218
+0.125 0.000107004
+0.1255 0.000101092
+0.126 9.44624e-05
+0.1265 8.71353e-05
+0.127 7.91416e-05
+0.1275 7.05119e-05
+0.128 6.12822e-05
+0.1285 5.14929e-05
+0.129 4.11867e-05
+0.1295 3.04165e-05
+0.13 1.92326e-05
+0.1305 7.69112e-06
+0.131 -4.14868e-06
+0.1315 -1.62269e-05
+0.132 -2.8471e-05
+0.1325 -4.08232e-05
+0.133 -5.32067e-05
+0.1335 -6.55524e-05
+0.134 -7.77902e-05
+0.1345 -8.98416e-05
+0.135 -0.000101635
+0.1355 -0.000113095
+0.136 -0.000124152
+0.1365 -0.000134726
+0.137 -0.000144748
+0.1375 -0.00015415
+0.138 -0.000162861
+0.1385 -0.000170816
+0.139 -0.000177954
+0.1395 -0.000184212
+0.14 -0.000189537
+0.1405 -0.000193877
+0.141 -0.000197186
+0.1415 -0.000199421
+0.142 -0.000200548
+0.1425 -0.000200535
+0.143 -0.000199357
+0.1435 -0.000196997
+0.144 -0.000193441
+0.1445 -0.000188686
+0.145 -0.000182733
+0.1455 -0.000175591
+0.146 -0.000167273
+0.1465 -0.000157807
+0.147 -0.000147221
+0.1475 -0.000135553
+0.148 -0.000122847
+0.1485 -0.000109154
+0.149 -9.45312e-05
+0.1495 -7.90457e-05
+0.15 -6.27703e-05
+0.1505 -4.57812e-05
+0.151 -2.816e-05
+0.1515 -9.9992e-06
+0.152 8.61086e-06
+0.1525 2.75697e-05
+0.153 4.67707e-05
+0.1535 6.61152e-05
+0.154 8.54878e-05
+0.1545 0.000104781
+0.155 0.000123874
+0.1555 0.00014266
+0.156 0.000161019
+0.1565 0.000178834
+0.157 0.000195993
+0.1575 0.00021238
+0.158 0.000227882
+0.1585 0.000242394
+0.159 0.000255808
+0.1595 0.000268024
+0.16 0.000278943
+0.1605 0.000288479
+0.161 0.000296543
+0.1615 0.000303058
+0.162 0.000307954
+0.1625 0.000311168
+0.163 0.000312645
+0.1635 0.00031234
+0.164 0.000310218
+0.1645 0.000306253
+0.165 0.000300429
+0.1655 0.00029274
+0.166 0.000283191
+0.1665 0.0002718
+0.167 0.000258592
+0.1675 0.000243609
+0.168 0.000226898
+0.1685 0.000208519
+0.169 0.000188545
+0.1695 0.000167064
+0.17 0.000144158
+0.1705 0.00011994
+0.171 9.45162e-05
+0.1715 6.8015e-05
+0.172 4.0565e-05
+0.1725 1.23028e-05
+0.173 -1.66184e-05
+0.1735 -4.60506e-05
+0.174 -7.58303e-05
+0.1745 -0.000105786
+0.175 -0.000135759
+0.1755 -0.00016557
+0.176 -0.00019504
+0.1765 -0.000223991
+0.177 -0.000252251
+0.1775 -0.000279638
+0.178 -0.00030597
+0.1785 -0.000331079
+0.179 -0.000354791
+0.1795 -0.000376935
+0.18 -0.000397359
+0.1805 -0.000415904
+0.181 -0.000432421
+0.1815 -0.000446777
+0.182 -0.00045884
+0.1825 -0.000468496
+0.183 -0.000475638
+0.1835 -0.000480172
+0.184 -0.000482019
+0.1845 -0.000481113
+0.185 -0.000477401
+0.1855 -0.000470848
+0.186 -0.000461434
+0.1865 -0.000449155
+0.187 -0.000434021
+0.1875 -0.000416065
+0.188 -0.000395332
+0.1885 -0.000371882
+0.189 -0.000345801
+0.1895 -0.000317184
+0.19 -0.000286141
+0.1905 -0.000252807
+0.191 -0.000217334
+0.1915 -0.000179872
+0.192 -0.000140603
+0.1925 -9.97231e-05
+0.193 -5.7428e-05
+0.1935 -1.39473e-05
+0.194 3.05086e-05
+0.1945 7.56883e-05
+0.195 0.000121353
+0.1955 0.000167245
+0.196 0.000213091
+0.1965 0.000258644
+0.197 0.000303625
+0.1975 0.000347756
+0.198 0.000390773
+0.1985 0.0004324
+0.199 0.000472359
+0.1995 0.000510397
+0.2 0.000546255
+0.2005 0.000579676
+0.201 0.000610412
+0.2015 0.000638241
+0.202 0.000662939
+0.2025 0.000684297
+0.203 0.000702128
+0.2035 0.000716255
+0.204 0.000726522
+0.2045 0.000732793
+0.205 0.000734951
+0.2055 0.0007329
+0.206 0.000726571
+0.2065 0.000715911
+0.207 0.000700895
+0.2075 0.000681526
+0.208 0.000657829
+0.2085 0.00062985
+0.209 0.000597673
+0.2095 0.000561393
+0.21 0.000521145
+0.2105 0.000477082
+0.211 0.000429382
+0.2115 0.000378243
+0.212 0.000323899
+0.2125 0.000266607
+0.213 0.000206634
+0.2135 0.000144268
+0.214 7.98362e-05
+0.2145 1.36575e-05
+0.215 -5.39127e-05
+0.2155 -0.000122496
+0.216 -0.000191745
+0.2165 -0.000261247
+0.217 -0.000330622
+0.2175 -0.000399443
+0.218 -0.000467329
+0.2185 -0.000533853
+0.219 -0.000598597
+0.2195 -0.000661164
+0.22 -0.000721143
+0.2205 -0.000778123
+0.221 -0.000831738
+0.2215 -0.000881594
+0.222 -0.000927342
+0.2225 -0.00096862
+0.223 -0.00100512
+0.2235 -0.00103652
+0.224 -0.00106255
+0.2245 -0.00108295
+0.225 -0.00109749
+0.2255 -0.00110598
+0.226 -0.00110824
+0.2265 -0.00110414
+0.227 -0.00109358
+0.2275 -0.0010765
+0.228 -0.00105286
+0.2285 -0.00102268
+0.229 -0.000986009
+0.2295 -0.000942923
+0.23 -0.000893556
+0.2305 -0.000838068
+0.231 -0.000776655
+0.2315 -0.000709563
+0.232 -0.000637087
+0.2325 -0.00055951
+0.233 -0.000477207
+0.2335 -0.000390545
+0.234 -0.000299961
+0.2345 -0.000205893
+0.235 -0.000108808
+0.2355 -9.23019e-06
+0.236 9.23325e-05
+0.2365 0.000195321
+0.237 0.000299144
+0.2375 0.000403262
+0.238 0.000507054
+0.2385 0.000609903
+0.239 0.000711199
+0.2395 0.000810355
+0.24 0.000906734
+0.2405 0.000999717
+0.241 0.00108872
+0.2415 0.00117314
+0.242 0.00125239
+0.2425 0.00132595
+0.243 0.00139325
+0.2435 0.00145379
+0.244 0.0015071
+0.2445 0.00155272
+0.245 0.00159025
+0.2455 0.00161932
+0.246 0.0016396
+0.2465 0.00165079
+0.247 0.00165268
+0.2475 0.00164506
+0.248 0.0016278
+0.2485 0.00160082
+0.249 0.0015641
+0.2495 0.00151765
+0.25 0.00146156
+0.2505 0.00139598
+0.251 0.0013211
+0.2515 0.00123719
+0.252 0.00114455
+0.2525 0.00104356
+0.253 0.000934631
+0.2535 0.000818285
+0.254 0.000695002
+0.2545 0.000565389
+0.255 0.000430088
+0.2555 0.000289763
+0.256 0.000145101
+0.2565 -3.06876e-06
+0.257 -0.000154016
+0.2575 -0.000306921
+0.258 -0.000460919
+0.2585 -0.000615112
+0.259 -0.000768673
+0.2595 -0.000920672
+0.26 -0.00107018
+0.2605 -0.00121633
+0.261 -0.00135819
+0.2615 -0.00149484
+0.262 -0.00162542
+0.2625 -0.00174908
+0.263 -0.00186495
+0.2635 -0.0019722
+0.264 -0.00207009
+0.2645 -0.00215786
+0.265 -0.00223481
+0.2655 -0.00230031
+0.266 -0.00235376
+0.2665 -0.00239462
+0.267 -0.00242243
+0.2675 -0.0024368
+0.268 -0.00243738
+0.2685 -0.00242393
+0.269 -0.00239625
+0.2695 -0.00235424
+0.27 -0.0022979
+0.2705 -0.00222727
+0.271 -0.0021425
+0.2715 -0.00204382
+0.272 -0.00193154
+0.2725 -0.00180607
+0.273 -0.00166791
+0.2735 -0.00151759
+0.274 -0.00135576
+0.2745 -0.00118314
+0.275 -0.00100057
+0.2755 -0.000808891
+0.276 -0.000609027
+0.2765 -0.000402025
+0.277 -0.000188906
+0.2775 2.91893e-05
+0.278 0.000251046
+0.2785 0.00047552
+0.279 0.000701385
+0.2795 0.000927272
+0.28 0.0011519
+0.2805 0.00137402
+0.281 0.00159225
+0.2815 0.00180524
+0.282 0.00201172
+0.2825 0.00221035
+0.283 0.0023998
+0.2835 0.00257887
+0.284 0.00274636
+0.2845 0.00290102
+0.285 0.00304176
+0.2855 0.00316753
+0.286 0.00327733
+0.2865 0.00337022
+0.287 0.00344538
+0.2875 0.00350205
+0.288 0.00353956
+0.2885 0.00355737
+0.289 0.00355501
+0.2895 0.00353213
+0.29 0.00348852
+0.2905 0.00342402
+0.291 0.00333865
+0.2915 0.00323254
+0.292 0.00310591
+0.2925 0.00295915
+0.293 0.00279274
+0.2935 0.00260726
+0.294 0.00240346
+0.2945 0.00218224
+0.295 0.0019445
+0.2955 0.00169129
+0.296 0.0014239
+0.2965 0.00114356
+0.297 0.000851664
+0.2975 0.000549661
+0.298 0.000239175
+0.2985 -7.82175e-05
+0.299 -0.000400775
+0.2995 -0.000726663
+0.3 -0.00105419
+0.3005 -0.00138144
+0.301 -0.00170647
+0.3015 -0.00202738
+0.302 -0.00234234
+0.3025 -0.00264937
+0.303 -0.00294652
+0.3035 -0.00323196
+0.304 -0.00350382
+0.3045 -0.00376024
+0.305 -0.00399958
+0.3055 -0.00422009
+0.306 -0.00442015
+0.3065 -0.00459828
+0.307 -0.00475312
+0.3075 -0.00488328
+0.308 -0.00498762
+0.3085 -0.0050651
+0.309 -0.00511479
+0.3095 -0.00513592
+0.31 -0.00512787
+0.3105 -0.00509018
+0.311 -0.00502256
+0.3115 -0.00492488
+0.312 -0.00479717
+0.3125 -0.00463965
+0.313 -0.00445273
+0.3135 -0.00423693
+0.314 -0.00399306
+0.3145 -0.003722
+0.315 -0.00342483
+0.3155 -0.00310282
+0.316 -0.00275748
+0.3165 -0.00239025
+0.317 -0.00200295
+0.3175 -0.0015975
+0.318 -0.00117589
+0.3185 -0.000740179
+0.319 -0.000292861
+0.3195 0.000163868
+0.32 0.000627539
+0.3205 0.00109555
+0.321 0.00156519
+0.3215 0.00203396
+0.322 0.00249906
+0.3225 0.0029577
+0.323 0.00340721
+0.3235 0.0038448
+0.324 0.00426768
+0.3245 0.00467327
+0.325 0.00505895
+0.3255 0.0054221
+0.326 0.00576021
+0.3265 0.00607101
+0.327 0.0063522
+0.3275 0.00660161
+0.328 0.00681734
+0.3285 0.00699752
+0.329 0.00714054
+0.3295 0.00724495
+0.33 0.00730949
+0.3305 0.00733311
+0.331 0.007315
+0.3315 0.00725454
+0.332 0.00715136
+0.3325 0.00700537
+0.333 0.00681668
+0.3335 0.00658563
+0.334 0.00631287
+0.3345 0.00599924
+0.335 0.00564587
+0.3355 0.00525422
+0.336 0.00482578
+0.3365 0.00436241
+0.337 0.00386622
+0.3375 0.00333958
+0.338 0.00278496
+0.3385 0.00220503
+0.339 0.00160282
+0.3395 0.000981312
+0.34 0.000343815
+0.3405 -0.00030613
+0.341 -0.000965188
+0.3415 -0.00162979
+0.342 -0.00229592
+0.3425 -0.00295985
+0.343 -0.00361791
+0.3435 -0.0042661
+0.344 -0.00490045
+0.3445 -0.0055172
+0.345 -0.00611246
+0.3455 -0.00668234
+0.346 -0.0072233
+0.3465 -0.00773181
+0.347 -0.00820419
+0.3475 -0.0086372
+0.348 -0.00902783
+0.3485 -0.00937304
+0.349 -0.00967006
+0.3495 -0.00991647
+0.35 -0.01011
+0.3505 -0.0102486
+0.351 -0.0103306
+0.3515 -0.0103547
+0.352 -0.0103198
+0.3525 -0.010225
+0.353 -0.01007
+0.3535 -0.00985468
+0.354 -0.00957927
+0.3545 -0.00924437
+0.355 -0.008851
+0.3555 -0.00840043
+0.356 -0.00789427
+0.3565 -0.00733459
+0.357 -0.00672387
+0.3575 -0.00606459
+0.358 -0.00535969
+0.3585 -0.00461278
+0.359 -0.00382731
+0.3595 -0.00300721
+0.36 -0.00215651
+0.3605 -0.00127982
+0.361 -0.000381554
+0.3615 0.000533364
+0.362 0.00145975
+0.3625 0.00239285
+0.363 0.00332721
+0.3635 0.00425738
+0.364 0.00517796
+0.3645 0.00608377
+0.365 0.00696918
+0.3655 0.00782868
+0.366 0.00865711
+0.3665 0.00944909
+0.367 0.0101994
+0.3675 0.0109033
+0.368 0.0115558
+0.3685 0.0121524
+0.369 0.0126887
+0.3695 0.013161
+0.37 0.0135651
+0.3705 0.0138979
+0.371 0.0141563
+0.3715 0.0143375
+0.372 0.0144394
+0.3725 0.0144601
+0.373 0.0143982
+0.3735 0.0142527
+0.374 0.0140233
+0.3745 0.0137097
+0.375 0.0133127
+0.3755 0.012833
+0.376 0.0122722
+0.3765 0.0116322
+0.377 0.0109155
+0.3775 0.0101249
+0.378 0.00926381
+0.3785 0.00833631
+0.379 0.00734629
+0.3795 0.00629867
+0.38 0.00519866
+0.3805 0.00405167
+0.381 0.00286331
+0.3815 0.00164037
+0.382 0.000388846
+0.3825 -0.000884521
+0.383 -0.00217263
+0.3835 -0.00346804
+0.384 -0.00476396
+0.3845 -0.00605269
+0.385 -0.00732657
+0.3855 -0.00857832
+0.386 -0.00980029
+0.3865 -0.0109847
+0.387 -0.0121247
+0.3875 -0.0132128
+0.388 -0.0142421
+0.3885 -0.0152053
+0.389 -0.0160965
+0.3895 -0.0169092
+0.39 -0.0176373
+0.3905 -0.0182757
+0.391 -0.018819
+0.3915 -0.0192629
+0.392 -0.0196032
+0.3925 -0.0198365
+0.393 -0.0199596
+0.3935 -0.0199703
+0.394 -0.0198667
+0.3945 -0.0196477
+0.395 -0.0193128
+0.3955 -0.0188622
+0.396 -0.0182966
+0.3965 -0.0176176
+0.397 -0.0168273
+0.3975 -0.0159286
+0.398 -0.0149253
+0.3985 -0.0138211
+0.399 -0.0126209
+0.3995 -0.0113302
+0.4 -0.0099553
+0.4005 -0.00850257
+0.401 -0.00697904
+0.4015 -0.00539271
+0.402 -0.00375142
+0.4025 -0.00206392
+0.403 -0.000339552
+0.4035 0.00141286
+0.404 0.00318388
+0.4045 0.00496288
+0.405 0.00673997
+0.4055 0.00850546
+0.406 0.0102487
+0.4065 0.0119591
+0.407 0.0136268
+0.4075 0.0152414
+0.408 0.0167925
+0.4085 0.0182707
+0.409 0.0196666
+0.4095 0.0209704
+0.41 0.0221735
+0.4105 0.0232677
+0.411 0.0242449
+0.4115 0.0250978
+0.412 0.0258196
+0.4125 0.0264044
+0.413 0.0268466
+0.4135 0.0271417
+0.414 0.0272858
+0.4145 0.0272758
+0.415 0.0271096
+0.4155 0.0267857
+0.416 0.0263037
+0.4165 0.0256642
+0.417 0.0248683
+0.4175 0.0239184
+0.418 0.0228178
+0.4185 0.0215703
+0.419 0.0201811
+0.4195 0.0186564
+0.42 0.0170024
+0.4205 0.0152267
+0.421 0.0133383
+0.4215 0.011346
+0.422 0.00925979
+0.4225 0.00709001
+0.423 0.00484833
+0.4235 0.00254611
+0.424 0.000195897
+0.4245 -0.00218904
+0.425 -0.0045965
+0.4255 -0.00701253
+0.426 -0.00942313
+0.4265 -0.0118144
+0.427 -0.0141732
+0.4275 -0.0164848
+0.428 -0.0187353
+0.4285 -0.0209112
+0.429 -0.0229988
+0.4295 -0.0249845
+0.43 -0.0268561
+0.4305 -0.028601
+0.431 -0.0302072
+0.4315 -0.0316634
+0.432 -0.0329599
+0.4325 -0.034086
+0.433 -0.0350334
+0.4335 -0.0357939
+0.434 -0.0363606
+0.4345 -0.0367274
+0.435 -0.0368894
+0.4355 -0.0368427
+0.436 -0.0365846
+0.4365 -0.0361138
+0.437 -0.0354296
+0.4375 -0.0345333
+0.438 -0.0334268
+0.4385 -0.0321134
+0.439 -0.0305979
+0.4395 -0.0288861
+0.44 -0.0269848
+0.4405 -0.0249024
+0.441 -0.0226488
+0.4415 -0.0202334
+0.442 -0.0176684
+0.4425 -0.0149667
+0.443 -0.0121414
+0.4435 -0.00920658
+0.444 -0.00617889
+0.4445 -0.00307319
+0.445 9.38279e-05
+0.4455 0.00330456
+0.446 0.00654057
+0.4465 0.00978498
+0.447 0.0130187
+0.4475 0.0162226
+0.448 0.0193787
+0.4485 0.0224679
+0.449 0.025471
+0.4495 0.0283705
+0.45 0.0311483
+0.4505 0.0337865
+0.451 0.0362676
+0.4515 0.0385763
+0.452 0.0406963
+0.4525 0.0426129
+0.453 0.0443125
+0.4535 0.0457821
+0.454 0.0470104
+0.4545 0.0479869
+0.455 0.0487028
+0.4555 0.0491501
+0.456 0.0493228
+0.4565 0.049216
+0.457 0.0488265
+0.4575 0.0481527
+0.458 0.0471947
+0.4585 0.0459539
+0.459 0.0444338
+0.4595 0.0426389
+0.46 0.040576
+0.4605 0.0382538
+0.461 0.0356813
+0.4615 0.0328698
+0.462 0.0298324
+0.4625 0.0265838
+0.463 0.0231394
+0.4635 0.0195159
+0.464 0.0157324
+0.4645 0.0118076
+0.465 0.00776245
+0.4655 0.00361934
+0.466 -0.000600586
+0.4665 -0.00487467
+0.467 -0.00917742
+0.4675 -0.0134851
+0.468 -0.0177743
+0.4685 -0.0220194
+0.469 -0.0261952
+0.4695 -0.0302776
+0.47 -0.0342415
+0.4705 -0.0380621
+0.471 -0.0417166
+0.4715 -0.0451823
+0.472 -0.0484354
+0.4725 -0.0514549
+0.473 -0.0542213
+0.4735 -0.0567147
+0.474 -0.0589172
+0.4745 -0.0608126
+0.475 -0.0623858
+0.4755 -0.0636236
+0.476 -0.0645146
+0.4765 -0.065049
+0.477 -0.065219
+0.4775 -0.0650191
+0.478 -0.0644453
+0.4785 -0.0634961
+0.479 -0.0621721
+0.4795 -0.0604757
+0.48 -0.058412
+0.4805 -0.055988
+0.481 -0.0532125
+0.4815 -0.0500969
+0.482 -0.0466555
+0.4825 -0.0429026
+0.483 -0.0388552
+0.4835 -0.0345342
+0.484 -0.0299599
+0.4845 -0.0251554
+0.485 -0.0201444
+0.4855 -0.014954
+0.486 -0.00961063
+0.4865 -0.00414326
+0.487 0.00141726
+0.4875 0.00704261
+0.488 0.0127003
+0.4885 0.0183578
+0.489 0.0239829
+0.4895 0.0295446
+0.49 0.0350091
+0.4905 0.0403434
+0.491 0.0455165
+0.4915 0.0504961
+0.492 0.0552504
+0.4925 0.0597511
+0.493 0.0639685
+0.4935 0.0678742
+0.494 0.0714423
+0.4945 0.0746493
+0.495 0.0774705
+0.4955 0.0798857
+0.496 0.081876
+0.4965 0.0834246
+0.497 0.0845167
+0.4975 0.0851407
+0.498 0.0852869
+0.4985 0.0849485
+0.499 0.0841214
+0.4995 0.082804
+0.5 0.0809979
+0.5005 0.0787068
+0.501 0.0759384
+0.5015 0.0727022
+0.502 0.0690109
+0.5025 0.0648793
+0.503 0.060326
+0.5035 0.0553728
+0.504 0.0500409
+0.5045 0.0443576
+0.505 0.03835
+0.5055 0.0320489
+0.506 0.0254881
+0.5065 0.018699
+0.507 0.011719
+0.5075 0.00458631
+0.508 -0.00266161
+0.5085 -0.00998256
+0.509 -0.0173386
+0.5095 -0.0246866
+0.51 -0.0319838
+0.5105 -0.0391894
+0.511 -0.0462588
+0.5115 -0.0531529
+0.512 -0.0598287
+0.5125 -0.0662447
+0.513 -0.0723624
+0.5135 -0.0781414
+0.514 -0.0835468
+0.5145 -0.088542
+0.515 -0.0930931
+0.5155 -0.0971695
+0.516 -0.100741
+0.5165 -0.103783
+0.517 -0.106269
+0.5175 -0.108181
+0.518 -0.109499
+0.5185 -0.110208
+0.519 -0.110299
+0.5195 -0.109762
+0.52 -0.108593
+0.5205 -0.106791
+0.521 -0.104358
+0.5215 -0.101302
+0.522 -0.0976316
+0.5225 -0.093361
+0.523 -0.0885072
+0.5235 -0.0830903
+0.524 -0.0771355
+0.5245 -0.0706694
+0.525 -0.0637239
+0.5255 -0.0563325
+0.526 -0.0485311
+0.5265 -0.040361
+0.527 -0.0318629
+0.5275 -0.0230839
+0.528 -0.0140672
+0.5285 -0.00486342
+0.529 0.00447629
+0.5295 0.0139021
+0.53 0.0233583
+0.5305 0.0327951
+0.531 0.0421565
+0.5315 0.0513873
+0.532 0.060435
+0.5325 0.0692449
+0.533 0.0777623
+0.5335 0.0859384
+0.534 0.0937202
+0.5345 0.10106
+0.535 0.10791
+0.5355 0.114225
+0.536 0.119964
+0.5365 0.125086
+0.537 0.129556
+0.5375 0.133339
+0.538 0.136408
+0.5385 0.138735
+0.539 0.140299
+0.5395 0.141083
+0.54 0.141072
+0.5405 0.140258
+0.541 0.138635
+0.5415 0.136205
+0.542 0.132971
+0.5425 0.128943
+0.543 0.124134
+0.5435 0.118563
+0.544 0.112252
+0.5445 0.105232
+0.545 0.0975308
+0.5455 0.0891869
+0.546 0.080239
+0.5465 0.0707321
+0.547 0.0607162
+0.5475 0.0502385
+0.548 0.0393566
+0.5485 0.028126
+0.549 0.0166077
+0.5495 0.00486666
+0.55 -0.00703746
+0.5505 -0.019035
+0.551 -0.031061
+0.5515 -0.0430459
+0.552 -0.0549185
+0.5525 -0.0666147
+0.553 -0.0780621
+0.5535 -0.0891951
+0.554 -0.0999452
+0.5545 -0.110245
+0.555 -0.120035
+0.5555 -0.12925
+0.556 -0.137834
+0.5565 -0.145729
+0.557 -0.152881
+0.5575 -0.159244
+0.558 -0.164772
+0.5585 -0.169423
+0.559 -0.173161
+0.5595 -0.175956
+0.56 -0.177781
+0.5605 -0.178614
+0.561 -0.17844
+0.5615 -0.177249
+0.562 -0.175036
+0.5625 -0.171803
+0.563 -0.167556
+0.5635 -0.162311
+0.564 -0.156084
+0.5645 -0.148901
+0.565 -0.140792
+0.5655 -0.131792
+0.566 -0.121947
+0.5665 -0.111299
+0.567 -0.0999022
+0.5675 -0.0878121
+0.568 -0.075091
+0.5685 -0.0618074
+0.569 -0.0480254
+0.5695 -0.0338208
+0.57 -0.0192717
+0.5705 -0.00445414
+0.571 0.0105456
+0.5715 0.0256502
+0.572 0.0407716
+0.5725 0.0558222
+0.573 0.0707186
+0.5735 0.0853704
+0.574 0.0996952
+0.5745 0.113607
+0.575 0.12702
+0.5755 0.139855
+0.576 0.152031
+0.5765 0.163472
+0.577 0.174107
+0.5775 0.183863
+0.578 0.192678
+0.5785 0.20049
+0.579 0.207245
+0.5795 0.212894
+0.58 0.217391
+0.5805 0.2207
+0.581 0.222789
+0.5815 0.223633
+0.582 0.223215
+0.5825 0.221523
+0.583 0.218554
+0.5835 0.214311
+0.584 0.208806
+0.5845 0.202055
+0.585 0.194086
+0.5855 0.18493
+0.586 0.174627
+0.5865 0.163225
+0.587 0.150776
+0.5875 0.137342
+0.588 0.122986
+0.5885 0.107783
+0.589 0.0918109
+0.5895 0.0751504
+0.59 0.0578935
+0.5905 0.0401271
+0.591 0.0219507
+0.5915 0.00346363
+0.592 -0.0152348
+0.5925 -0.0340354
+0.593 -0.052838
+0.5935 -0.0715316
+0.594 -0.0900087
+0.5945 -0.108164
+0.595 -0.12589
+0.5955 -0.143078
+0.596 -0.159631
+0.5965 -0.175443
+0.597 -0.190419
+0.5975 -0.204465
+0.598 -0.21749
+0.5985 -0.229412
+0.599 -0.24015
+0.5995 -0.249631
+0.6 -0.257791
+0.6005 -0.264566
+0.601 -0.269907
+0.6015 -0.273767
+0.602 -0.276112
+0.6025 -0.27691
+0.603 -0.276144
+0.6035 -0.2738
+0.604 -0.269879
+0.6045 -0.264384
+0.605 -0.257333
+0.6055 -0.248751
+0.606 -0.23867
+0.6065 -0.227132
+0.607 -0.214193
+0.6075 -0.199906
+0.608 -0.184346
+0.6085 -0.167583
+0.609 -0.149704
+0.6095 -0.1308
+0.61 -0.110965
+0.6105 -0.0903091
+0.611 -0.0689348
+0.6115 -0.0469612
+0.612 -0.0245075
+0.6125 -0.0016946
+0.613 0.0213488
+0.6135 0.0444974
+0.614 0.0676168
+0.6145 0.0905752
+0.615 0.113243
+0.6155 0.135485
+0.616 0.157174
+0.6165 0.178181
+0.617 0.198376
+0.6175 0.21764
+0.618 0.235853
+0.6185 0.252901
+0.619 0.268678
+0.6195 0.283078
+0.62 0.29601
+0.6205 0.307385
+0.621 0.317121
+0.6215 0.325151
+0.622 0.33141
+0.6225 0.335848
+0.623 0.338421
+0.6235 0.339096
+0.624 0.337853
+0.6245 0.33468
+0.625 0.329577
+0.6255 0.322554
+0.626 0.313636
+0.6265 0.302851
+0.627 0.290249
+0.6275 0.275878
+0.628 0.259807
+0.6285 0.242113
+0.629 0.222877
+0.6295 0.2022
+0.63 0.18018
+0.6305 0.156932
+0.631 0.132581
+0.6315 0.107248
+0.632 0.0810733
+0.6325 0.0541978
+0.633 0.0267653
+0.6335 -0.00107051
+0.634 -0.0291593
+0.6345 -0.0573394
+0.635 -0.0854513
+0.6355 -0.113337
+0.636 -0.140834
+0.6365 -0.167785
+0.637 -0.19403
+0.6375 -0.219411
+0.638 -0.243779
+0.6385 -0.266984
+0.639 -0.288886
+0.6395 -0.309349
+0.64 -0.328238
+0.6405 -0.345438
+0.641 -0.360832
+0.6415 -0.374318
+0.642 -0.385802
+0.6425 -0.395198
+0.643 -0.402438
+0.6435 -0.407459
+0.644 -0.410213
+0.6445 -0.410665
+0.645 -0.408791
+0.6455 -0.40458
+0.646 -0.398036
+0.6465 -0.389178
+0.647 -0.378031
+0.6475 -0.364643
+0.648 -0.349066
+0.6485 -0.33137
+0.649 -0.311641
+0.6495 -0.289968
+0.65 -0.266463
+0.6505 -0.241235
+0.651 -0.21442
+0.6515 -0.186154
+0.652 -0.156582
+0.6525 -0.125868
+0.653 -0.0941679
+0.6535 -0.0616588
+0.654 -0.0285188
+0.6545 0.00507432
+0.655 0.0389249
+0.6555 0.072853
+0.656 0.10666
+0.6565 0.140152
+0.657 0.17314
+0.6575 0.205431
+0.658 0.236831
+0.6585 0.267161
+0.659 0.296234
+0.6595 0.323877
+0.66 0.349921
+0.6605 0.374199
+0.661 0.396566
+0.6615 0.416873
+0.662 0.434989
+0.6625 0.450793
+0.663 0.464172
+0.6635 0.475035
+0.664 0.483295
+0.6645 0.488885
+0.665 0.49175
+0.6655 0.491851
+0.666 0.489164
+0.6665 0.483681
+0.667 0.47541
+0.6675 0.464374
+0.668 0.450615
+0.6685 0.434184
+0.669 0.415155
+0.6695 0.393617
+0.67 0.369666
+0.6705 0.343425
+0.671 0.315015
+0.6715 0.284587
+0.672 0.252296
+0.6725 0.218306
+0.673 0.182804
+0.6735 0.145969
+0.674 0.108006
+0.6745 0.0691231
+0.675 0.0295283
+0.6755 -0.0105549
+0.676 -0.0509088
+0.6765 -0.0913003
+0.677 -0.1315
+0.6775 -0.171283
+0.678 -0.210415
+0.6785 -0.248673
+0.679 -0.285832
+0.6795 -0.321666
+0.68 -0.355968
+0.6805 -0.388526
+0.681 -0.419146
+0.6815 -0.447636
+0.682 -0.473813
+0.6825 -0.497519
+0.683 -0.518593
+0.6835 -0.536893
+0.684 -0.552299
+0.6845 -0.564696
+0.685 -0.573993
+0.6855 -0.58011
+0.686 -0.582988
+0.6865 -0.582586
+0.687 -0.57888
+0.6875 -0.571864
+0.688 -0.561552
+0.6885 -0.547981
+0.689 -0.531196
+0.6895 -0.511273
+0.69 -0.488295
+0.6905 -0.462372
+0.691 -0.433632
+0.6915 -0.402208
+0.692 -0.368267
+0.6925 -0.331972
+0.693 -0.293516
+0.6935 -0.253107
+0.694 -0.210947
+0.6945 -0.167271
+0.695 -0.122314
+0.6955 -0.0763184
+0.696 -0.0295412
+0.6965 0.017765
+0.697 0.0653285
+0.6975 0.112881
+0.698 0.160158
+0.6985 0.206883
+0.699 0.252793
+0.6995 0.29762
+0.7 0.341094
+0.7005 0.382966
+0.701 0.422982
+0.7015 0.460905
+0.702 0.496502
+0.7025 0.529549
+0.703 0.559849
+0.7035 0.5872
+0.704 0.611431
+0.7045 0.63238
+0.705 0.649901
+0.7055 0.663873
+0.706 0.674188
+0.7065 0.680762
+0.707 0.683529
+0.7075 0.682445
+0.708 0.677489
+0.7085 0.66866
+0.709 0.655982
+0.7095 0.639494
+0.71 0.619269
+0.7105 0.595386
+0.711 0.567958
+0.7115 0.537121
+0.712 0.503014
+0.7125 0.465818
+0.713 0.42571
+0.7135 0.382906
+0.714 0.337628
+0.7145 0.290109
+0.715 0.240615
+0.7155 0.189396
+0.716 0.136743
+0.7165 0.0829431
+0.717 0.0282854
+0.7175 -0.0269121
+0.718 -0.082357
+0.7185 -0.137725
+0.719 -0.192702
+0.7195 -0.246978
+0.72 -0.300241
+0.7205 -0.35217
+0.721 -0.402478
+0.7215 -0.450854
+0.722 -0.49702
+0.7225 -0.540695
+0.723 -0.581609
+0.7235 -0.61952
+0.724 -0.654184
+0.7245 -0.685388
+0.725 -0.712929
+0.7255 -0.736621
+0.726 -0.756311
+0.7265 -0.771853
+0.727 -0.783135
+0.7275 -0.790062
+0.728 -0.792565
+0.7285 -0.790599
+0.729 -0.784146
+0.7295 -0.773211
+0.73 -0.757825
+0.7305 -0.73805
+0.731 -0.71396
+0.7315 -0.685668
+0.732 -0.653309
+0.7325 -0.617031
+0.733 -0.577025
+0.7335 -0.533478
+0.734 -0.486624
+0.7345 -0.436707
+0.735 -0.38398
+0.7355 -0.328739
+0.736 -0.271263
+0.7365 -0.211874
+0.737 -0.150897
+0.7375 -0.0886603
+0.738 -0.0255159
+0.7385 0.0381943
+0.739 0.102103
+0.7395 0.165849
+0.74 0.229077
+0.7405 0.291418
+0.741 0.352519
+0.7415 0.412025
+0.742 0.469581
+0.7425 0.524855
+0.743 0.577514
+0.7435 0.627249
+0.744 0.673757
+0.7445 0.716746
+0.745 0.755962
+0.7455 0.791153
+0.746 0.822087
+0.7465 0.848573
+0.747 0.870424
+0.7475 0.887493
+0.748 0.89965
+0.7485 0.906793
+0.749 0.908853
+0.7495 0.905786
+0.75 0.897576
+0.7505 0.884236
+0.751 0.865815
+0.7515 0.842379
+0.752 0.814037
+0.7525 0.780909
+0.753 0.743159
+0.7535 0.700979
+0.754 0.654566
+0.7545 0.604174
+0.755 0.550046
+0.7555 0.492474
+0.756 0.431774
+0.7565 0.368251
+0.757 0.302261
+0.7575 0.234163
+0.758 0.164323
+0.7585 0.0931338
+0.759 0.0209795
+0.7595 -0.0517257
+0.76 -0.124573
+0.7605 -0.197158
+0.761 -0.269061
+0.7615 -0.339877
+0.762 -0.409198
+0.7625 -0.476612
+0.763 -0.541736
+0.7635 -0.604181
+0.764 -0.663583
+0.7645 -0.719588
+0.765 -0.771847
+0.7655 -0.820057
+0.766 -0.86391
+0.7665 -0.903139
+0.767 -0.937492
+0.7675 -0.966741
+0.768 -0.9907
+0.7685 -1.00919
+0.769 -1.02209
+0.7695 -1.02929
+0.77 -1.0307
+0.7705 -1.0263
+0.771 -1.01607
+0.7715 -1.00004
+0.772 -0.978266
+0.7725 -0.950838
+0.773 -0.917875
+0.7735 -0.879534
+0.774 -0.836011
+0.7745 -0.787509
+0.775 -0.734289
+0.7755 -0.67661
+0.776 -0.614785
+0.7765 -0.549141
+0.777 -0.480018
+0.7775 -0.407807
+0.778 -0.332877
+0.7785 -0.255652
+0.779 -0.176557
+0.7795 -0.0960186
+0.78 -0.0145043
+0.7805 0.0675539
+0.781 0.149678
+0.7815 0.231402
+0.782 0.312271
+0.7825 0.391821
+0.783 0.469578
+0.7835 0.545116
+0.784 0.617976
+0.7845 0.687743
+0.785 0.754002
+0.7855 0.816349
+0.786 0.874426
+0.7865 0.927868
+0.787 0.976356
+0.7875 1.01959
+0.788 1.05728
+0.7885 1.08921
+0.789 1.11515
+0.7895 1.13492
+0.79 1.14839
+0.7905 1.15544
+0.791 1.15599
+0.7915 1.15002
+0.792 1.13752
+0.7925 1.11853
+0.793 1.09312
+0.7935 1.0614
+0.794 1.02352
+0.7945 0.979661
+0.795 0.930041
+0.7955 0.874917
+0.796 0.814559
+0.7965 0.749293
+0.797 0.679468
+0.7975 0.605441
+0.798 0.527627
+0.7985 0.44643
+0.799 0.362298
+0.7995 0.275707
+0.8 0.187114
+0.8005 0.0970296
+0.801 0.00593733
+0.8015 -0.0856452
+0.802 -0.177186
+0.8025 -0.268193
+0.803 -0.358125
+0.8035 -0.446487
+0.804 -0.532762
+0.8045 -0.616443
+0.805 -0.697062
+0.8055 -0.774127
+0.806 -0.847206
+0.8065 -0.915853
+0.807 -0.979653
+0.8075 -1.03824
+0.808 -1.09124
+0.8085 -1.13833
+0.809 -1.17921
+0.8095 -1.21364
+0.81 -1.24137
+0.8105 -1.26223
+0.811 -1.27605
+0.8115 -1.28273
+0.812 -1.28221
+0.8125 -1.27443
+0.813 -1.25943
+0.8135 -1.23724
+0.814 -1.20796
+0.8145 -1.17173
+0.815 -1.1287
+0.8155 -1.07911
+0.816 -1.02319
+0.8165 -0.961235
+0.817 -0.893574
+0.8175 -0.820547
+0.818 -0.742554
+0.8185 -0.660021
+0.819 -0.573377
+0.8195 -0.483101
+0.82 -0.389702
+0.8205 -0.293667
+0.821 -0.195555
+0.8215 -0.0958884
+0.822 0.00476546
+0.8225 0.105831
+0.823 0.206761
+0.8235 0.306957
+0.824 0.405877
+0.8245 0.50294
+0.825 0.59758
+0.8255 0.689271
+0.826 0.777462
+0.8265 0.86166
+0.827 0.941356
+0.8275 1.01608
+0.828 1.08539
+0.8285 1.14887
+0.829 1.20614
+0.8295 1.25685
+0.83 1.30068
+0.8305 1.33735
+0.831 1.36663
+0.8315 1.38831
+0.832 1.40226
+0.8325 1.40834
+0.833 1.4065
+0.8335 1.39672
+0.834 1.37901
+0.8345 1.35344
+0.835 1.32013
+0.8355 1.27922
+0.836 1.23093
+0.8365 1.1755
+0.837 1.11319
+0.8375 1.04436
+0.838 0.969344
+0.8385 0.888553
+0.839 0.802429
+0.8395 0.71142
+0.84 0.616039
+0.8405 0.51679
+0.841 0.414224
+0.8415 0.308925
+0.842 0.201454
+0.8425 0.0924322
+0.843 -0.0175529
+0.8435 -0.127874
+0.844 -0.23789
+0.8445 -0.347009
+0.845 -0.454593
+0.8455 -0.560018
+0.846 -0.662701
+0.8465 -0.762031
+0.847 -0.857454
+0.8475 -0.948402
+0.848 -1.03434
+0.8485 -1.11477
+0.849 -1.18921
+0.8495 -1.25723
+0.85 -1.31841
+0.8505 -1.37238
+0.851 -1.41881
+0.8515 -1.4574
+0.852 -1.48792
+0.8525 -1.51015
+0.853 -1.52394
+0.8535 -1.52919
+0.854 -1.52583
+0.8545 -1.51384
+0.855 -1.49327
+0.8555 -1.46421
+0.856 -1.42677
+0.8565 -1.38115
+0.857 -1.32758
+0.8575 -1.26632
+0.858 -1.1977
+0.8585 -1.12207
+0.859 -1.03985
+0.8595 -0.951477
+0.86 -0.857418
+0.8605 -0.758201
+0.861 -0.654351
+0.8615 -0.546444
+0.862 -0.435094
+0.8625 -0.320894
+0.863 -0.204502
+0.8635 -0.0865447
+0.864 0.0323067
+0.8645 0.151363
+0.865 0.269987
+0.8655 0.387474
+0.866 0.503183
+0.8665 0.616442
+0.867 0.726591
+0.8675 0.833022
+0.868 0.935092
+0.8685 1.03224
+0.869 1.12388
+0.8695 1.20948
+0.87 1.28854
+0.8705 1.36059
+0.871 1.42519
+0.8715 1.48197
+0.872 1.53057
+0.8725 1.5707
+0.873 1.60209
+0.8735 1.62455
+0.874 1.63792
+0.8745 1.64209
+0.875 1.63701
+0.8755 1.62268
+0.876 1.59916
+0.8765 1.56655
+0.877 1.525
+0.8775 1.47472
+0.878 1.41597
+0.8785 1.34906
+0.879 1.27433
+0.8795 1.1922
+0.88 1.10309
+0.8805 1.00748
+0.881 0.905927
+0.8815 0.798947
+0.882 0.687141
+0.8825 0.571147
+0.883 0.451574
+0.8835 0.329119
+0.884 0.204439
+0.8845 0.0782435
+0.885 -0.048745
+0.8855 -0.17584
+0.886 -0.302289
+0.8865 -0.427414
+0.887 -0.55048
+0.8875 -0.670779
+0.888 -0.787646
+0.8885 -0.900389
+0.889 -1.00838
+0.8895 -1.11099
+0.89 -1.2076
+0.8905 -1.29769
+0.891 -1.38069
+0.8915 -1.45615
+0.892 -1.5236
+0.8925 -1.58263
+0.893 -1.63291
+0.8935 -1.67411
+0.894 -1.70599
+0.8945 -1.72833
+0.895 -1.74098
+0.8955 -1.74386
+0.896 -1.73691
+0.8965 -1.72015
+0.897 -1.69365
+0.8975 -1.65754
+0.898 -1.61198
+0.8985 -1.55722
+0.899 -1.49355
+0.8995 -1.42129
+0.9 -1.34085
+0.9005 -1.25264
+0.901 -1.15714
+0.9015 -1.0549
+0.902 -0.946445
+0.9025 -0.832403
+0.903 -0.713377
+0.9035 -0.590041
+0.904 -0.463096
+0.9045 -0.333221
+0.905 -0.201171
+0.9055 -0.0676599
+0.906 0.06655
+0.9065 0.200685
+0.907 0.334018
+0.9075 0.465778
+0.908 0.595203
+0.9085 0.721587
+0.909 0.844177
+0.9095 0.962304
+0.91 1.07527
+0.9105 1.18243
+0.911 1.28316
+0.9115 1.37688
+0.912 1.46306
+0.9125 1.54118
+0.913 1.61078
+0.9135 1.67146
+0.914 1.72285
+0.9145 1.76464
+0.915 1.79657
+0.9155 1.81845
+0.916 1.83012
+0.9165 1.83151
+0.917 1.82257
+0.9175 1.80335
+0.918 1.77392
+0.9185 1.73444
+0.919 1.6851
+0.9195 1.62617
+0.92 1.55795
+0.9205 1.48082
+0.921 1.39519
+0.9215 1.30152
+0.922 1.20035
+0.9225 1.0922
+0.923 0.977703
+0.9235 0.857461
+0.924 0.732157
+0.9245 0.602506
+0.925 0.469198
+0.9255 0.333013
+0.926 0.19468
+0.9265 0.0549945
+0.927 -0.085242
+0.9275 -0.22527
+0.928 -0.364266
+0.9285 -0.501477
+0.929 -0.636108
+0.9295 -0.767377
+0.93 -0.89457
+0.9305 -1.01693
+0.931 -1.13379
+0.9315 -1.24446
+0.932 -1.3483
+0.9325 -1.44473
+0.933 -1.53318
+0.9335 -1.61313
+0.934 -1.68414
+0.9345 -1.74577
+0.935 -1.79767
+0.9355 -1.83952
+0.936 -1.87108
+0.9365 -1.89215
+0.937 -1.90259
+0.9375 -1.90233
+0.938 -1.89135
+0.9385 -1.8697
+0.939 -1.83749
+0.9395 -1.79487
+0.94 -1.74208
+0.9405 -1.67939
+0.941 -1.60715
+0.9415 -1.52575
+0.942 -1.43564
+0.9425 -1.33731
+0.943 -1.2313
+0.9435 -1.11821
+0.944 -0.998652
+0.9445 -0.8733
+0.945 -0.74287
+0.9455 -0.608061
+0.946 -0.46966
+0.9465 -0.328409
+0.947 -0.185118
+0.9475 -0.0406129
+0.948 0.104329
+0.9485 0.248854
+0.949 0.39218
+0.9495 0.53348
+0.95 0.671937
+0.9505 0.8068
+0.951 0.937269
+0.9515 1.06263
+0.952 1.18217
+0.9525 1.29517
+0.953 1.40103
+0.9535 1.4991
+0.954 1.58886
+0.9545 1.66978
+0.955 1.74137
+0.9555 1.80324
+0.956 1.85502
+0.9565 1.89642
+0.957 1.92718
+0.9575 1.94711
+0.958 1.95611
+0.9585 1.95409
+0.959 1.94107
+0.9595 1.9171
+0.96 1.88232
+0.9605 1.83689
+0.961 1.78108
+0.9615 1.71518
+0.962 1.63956
+0.9625 1.55464
+0.963 1.46088
+0.9635 1.3588
+0.964 1.24899
+0.9645 1.13203
+0.965 1.00861
+0.9655 0.879391
+0.966 0.745105
+0.9665 0.606525
+0.967 0.464396
+0.9675 0.319552
+0.968 0.172774
+0.9685 0.0249056
+0.969 -0.123203
+0.9695 -0.270749
+0.97 -0.416884
+0.9705 -0.560763
+0.971 -0.701608
+0.9715 -0.838588
+0.972 -0.97096
+0.9725 -1.09796
+0.973 -1.21884
+0.9735 -1.33297
+0.974 -1.43964
+0.9745 -1.5383
+0.975 -1.62835
+0.9755 -1.70928
+0.976 -1.78065
+0.9765 -1.84203
+0.977 -1.89308
+0.9775 -1.9335
+0.978 -1.96305
+0.9785 -1.98156
+0.979 -1.98893
+0.9795 -1.98511
+0.98 -1.97011
+0.9805 -1.94401
+0.981 -1.90695
+0.9815 -1.85913
+0.982 -1.80084
+0.9825 -1.73237
+0.983 -1.65412
+0.9835 -1.56653
+0.984 -1.47007
+0.9845 -1.36531
+0.985 -1.25282
+0.9855 -1.13324
+0.986 -1.00722
+0.9865 -0.87549
+0.987 -0.738802
+0.9875 -0.597895
+0.988 -0.453594
+0.9885 -0.306679
+0.989 -0.157996
+0.9895 -0.00839989
+0.99 0.141301
+0.9905 0.290225
+0.991 0.437569
+0.9915 0.582483
+0.992 0.724131
+0.9925 0.861749
+0.993 0.994525
+0.9935 1.12174
+0.994 1.24266
+0.9945 1.3566
+0.995 1.46292
+0.9955 1.56102
+0.996 1.65034
+0.9965 1.73039
+0.997 1.80069
+0.9975 1.86087
+0.998 1.91058
+0.9985 1.94953
+0.999 1.97752
+0.9995 1.99437
+1 2
+1.0005 1.99437
+1.001 1.97752
+1.0015 1.94953
+1.002 1.91058
+1.0025 1.86086
+1.003 1.80069
+1.0035 1.73039
+1.004 1.65035
+1.0045 1.56101
+1.005 1.46292
+1.0055 1.35661
+1.006 1.24265
+1.0065 1.12174
+1.007 0.994541
+1.0075 0.861733
+1.008 0.724131
+1.0085 0.582483
+1.009 0.437587
+1.0095 0.290225
+1.01 0.141301
+1.0105 -0.00838203
+1.011 -0.158014
+1.0115 -0.306679
+1.012 -0.453577
+1.0125 -0.597912
+1.013 -0.738802
+1.0135 -0.87549
+1.014 -1.00724
+1.0145 -1.13324
+1.015 -1.25282
+1.0155 -1.3653
+1.016 -1.47008
+1.0165 -1.56653
+1.017 -1.65411
+1.0175 -1.73238
+1.018 -1.80084
+1.0185 -1.85913
+1.019 -1.90695
+1.0195 -1.94401
+1.02 -1.97011
+1.0205 -1.98511
+1.021 -1.98893
+1.0215 -1.98156
+1.022 -1.96305
+1.0225 -1.93349
+1.023 -1.89308
+1.0235 -1.84203
+1.024 -1.78064
+1.0245 -1.70928
+1.025 -1.62835
+1.0255 -1.53829
+1.026 -1.43964
+1.0265 -1.33297
+1.027 -1.21886
+1.0275 -1.09794
+1.028 -0.97096
+1.0285 -0.838605
+1.029 -0.701591
+1.0295 -0.560763
+1.03 -0.416884
+1.0305 -0.270731
+1.031 -0.123203
+1.0315 0.0249056
+1.032 0.172756
+1.0325 0.319552
+1.033 0.464396
+1.0335 0.606508
+1.034 0.745122
+1.0345 0.879391
+1.035 1.0086
+1.0355 1.13205
+1.036 1.24899
+1.0365 1.3588
+1.037 1.46087
+1.0375 1.55464
+1.038 1.63956
+1.0385 1.71518
+1.039 1.78108
+1.0395 1.83689
+1.04 1.88231
+1.0405 1.91711
+1.041 1.94107
+1.0415 1.95409
+1.042 1.95611
+1.0425 1.94711
+1.043 1.92718
+1.0435 1.89642
+1.044 1.85502
+1.0445 1.80324
+1.045 1.74138
+1.0455 1.66977
+1.046 1.58886
+1.0465 1.49911
+1.047 1.40101
+1.0475 1.29517
+1.048 1.18217
+1.0485 1.06265
+1.049 0.937269
+1.0495 0.8068
+1.05 0.671954
+1.0505 0.533463
+1.051 0.39218
+1.0515 0.24887
+1.052 0.104311
+1.0525 -0.0406129
+1.053 -0.185118
+1.0535 -0.328425
+1.054 -0.46966
+1.0545 -0.608061
+1.055 -0.742855
+1.0555 -0.873315
+1.056 -0.998652
+1.0565 -1.1182
+1.057 -1.23131
+1.0575 -1.33731
+1.058 -1.43563
+1.0585 -1.52576
+1.059 -1.60715
+1.0595 -1.67939
+1.06 -1.74207
+1.0605 -1.79487
+1.061 -1.83749
+1.0615 -1.8697
+1.062 -1.89135
+1.0625 -1.90233
+1.063 -1.90259
+1.0635 -1.89215
+1.064 -1.87108
+1.0645 -1.83952
+1.065 -1.79766
+1.0655 -1.74577
+1.066 -1.68414
+1.0665 -1.61314
+1.067 -1.53317
+1.0675 -1.44473
+1.068 -1.34831
+1.0685 -1.24445
+1.069 -1.13379
+1.0695 -1.01695
+1.07 -0.894556
+1.0705 -0.767377
+1.071 -0.636108
+1.0715 -0.501493
+1.072 -0.364266
+1.0725 -0.22527
+1.073 -0.0852581
+1.0735 0.0550105
+1.074 0.19468
+1.0745 0.332995
+1.075 0.469215
+1.0755 0.602506
+1.076 0.732157
+1.0765 0.857477
+1.077 0.977703
+1.0775 1.0922
+1.078 1.20033
+1.0785 1.30153
+1.079 1.39519
+1.0795 1.48081
+1.08 1.55796
+1.0805 1.62617
+1.081 1.6851
+1.0815 1.73444
+1.082 1.77392
+1.0825 1.80335
+1.083 1.82257
+1.0835 1.83151
+1.084 1.83012
+1.0845 1.81845
+1.085 1.79657
+1.0855 1.76464
+1.086 1.72285
+1.0865 1.67145
+1.087 1.61078
+1.0875 1.54118
+1.088 1.46305
+1.0885 1.37688
+1.089 1.28316
+1.0895 1.18244
+1.09 1.07526
+1.0905 0.962304
+1.091 0.844192
+1.0915 0.721572
+1.092 0.595203
+1.0925 0.465778
+1.093 0.334002
+1.0935 0.200685
+1.094 0.06655
+1.0945 -0.0676429
+1.095 -0.201171
+1.0955 -0.333221
+1.096 -0.463082
+1.0965 -0.590057
+1.097 -0.713377
+1.0975 -0.832389
+1.098 -0.946458
+1.0985 -1.0549
+1.099 -1.15714
+1.0995 -1.25262
+1.1 -1.34085
+1.1005 -1.42129
+1.101 -1.49354
+1.1015 -1.55723
+1.102 -1.61198
+1.1025 -1.65753
+1.103 -1.69365
+1.1035 -1.72015
+1.104 -1.73691
+1.1045 -1.74386
+1.105 -1.74098
+1.1055 -1.72833
+1.106 -1.70599
+1.1065 -1.67411
+1.107 -1.63291
+1.1075 -1.58264
+1.108 -1.52359
+1.1085 -1.45615
+1.109 -1.3807
+1.1095 -1.29768
+1.11 -1.2076
+1.1105 -1.11099
+1.111 -1.00839
+1.1115 -0.900389
+1.112 -0.787646
+1.1125 -0.670794
+1.113 -0.550468
+1.1135 -0.427414
+1.114 -0.302305
+1.1145 -0.175824
+1.115 -0.048745
+1.1155 0.0782435
+1.116 0.204455
+1.1165 0.329119
+1.117 0.451574
+1.1175 0.571132
+1.118 0.687155
+1.1185 0.798947
+1.119 0.905916
+1.1195 1.0075
+1.12 1.10309
+1.1205 1.19219
+1.121 1.27434
+1.1215 1.34906
+1.122 1.41597
+1.1225 1.47471
+1.123 1.525
+1.1235 1.56655
+1.124 1.59916
+1.1245 1.62268
+1.125 1.63701
+1.1255 1.64209
+1.126 1.63791
+1.1265 1.62455
+1.127 1.60209
+1.1275 1.57069
+1.128 1.53057
+1.1285 1.48197
+1.129 1.4252
+1.1295 1.36058
+1.13 1.28854
+1.1305 1.20949
+1.131 1.12387
+1.1315 1.03224
+1.132 0.935104
+1.1325 0.833009
+1.133 0.726591
+1.1335 0.616442
+1.134 0.503198
+1.1345 0.387474
+1.135 0.269987
+1.1355 0.151378
+1.136 0.0322916
+1.1365 -0.0865447
+1.137 -0.20449
+1.1375 -0.320908
+1.138 -0.435094
+1.1385 -0.546444
+1.139 -0.654361
+1.1395 -0.758201
+1.14 -0.857418
+1.1405 -0.951468
+1.141 -1.03986
+1.1415 -1.12207
+1.142 -1.19769
+1.1425 -1.26632
+1.143 -1.32758
+1.1435 -1.38115
+1.144 -1.42678
+1.1445 -1.46421
+1.145 -1.49327
+1.1455 -1.51384
+1.146 -1.52583
+1.1465 -1.52919
+1.147 -1.52395
+1.1475 -1.51015
+1.148 -1.48792
+1.1485 -1.4574
+1.149 -1.4188
+1.1495 -1.37238
+1.15 -1.31841
+1.1505 -1.25722
+1.151 -1.18921
+1.1515 -1.11477
+1.152 -1.03435
+1.1525 -0.948391
+1.153 -0.857454
+1.1535 -0.762043
+1.154 -0.662691
+1.1545 -0.560018
+1.155 -0.454593
+1.1555 -0.346996
+1.156 -0.23789
+1.1565 -0.127874
+1.157 -0.0175669
+1.1575 0.0924322
+1.158 0.201454
+1.1585 0.308915
+1.159 0.414237
+1.1595 0.51679
+1.16 0.616027
+1.1605 0.711432
+1.161 0.802429
+1.1615 0.888553
+1.162 0.969336
+1.1625 1.04436
+1.163 1.11319
+1.1635 1.17549
+1.164 1.23094
+1.1645 1.27922
+1.165 1.32012
+1.1655 1.35344
+1.166 1.37901
+1.1665 1.39672
+1.167 1.40651
+1.1675 1.40834
+1.168 1.40226
+1.1685 1.38832
+1.169 1.36663
+1.1695 1.33735
+1.17 1.30068
+1.1705 1.25684
+1.171 1.20614
+1.1715 1.14888
+1.172 1.08538
+1.1725 1.01608
+1.173 0.941356
+1.1735 0.861668
+1.174 0.777462
+1.1745 0.689271
+1.175 0.597592
+1.1755 0.50293
+1.176 0.405877
+1.1765 0.306969
+1.177 0.206749
+1.1775 0.105831
+1.178 0.00476546
+1.1785 -0.0959011
+1.179 -0.195555
+1.1795 -0.293667
+1.18 -0.38969
+1.1805 -0.483112
+1.181 -0.573377
+1.1815 -0.660012
+1.182 -0.742564
+1.1825 -0.820547
+1.183 -0.893564
+1.1835 -0.961242
+1.184 -1.02319
+1.1845 -1.07911
+1.185 -1.1287
+1.1855 -1.17173
+1.186 -1.20796
+1.1865 -1.23724
+1.187 -1.25943
+1.1875 -1.27443
+1.188 -1.28221
+1.1885 -1.28273
+1.189 -1.27605
+1.1895 -1.26223
+1.19 -1.24137
+1.1905 -1.21364
+1.191 -1.17921
+1.1915 -1.13833
+1.192 -1.09123
+1.1925 -1.03824
+1.193 -0.979661
+1.1935 -0.915846
+1.194 -0.847206
+1.1945 -0.774136
+1.195 -0.697052
+1.1955 -0.616443
+1.196 -0.532762
+1.1965 -0.446498
+1.197 -0.358125
+1.1975 -0.268193
+1.198 -0.177197
+1.1985 -0.0856335
+1.199 0.00593733
+1.1995 0.0970204
+1.2 0.187126
+1.2005 0.275707
+1.201 0.362298
+1.2015 0.446438
+1.202 0.527627
+1.2025 0.605441
+1.203 0.67946
+1.2035 0.749302
+1.204 0.814559
+1.2045 0.874909
+1.205 0.930046
+1.2055 0.979661
+1.206 1.02352
+1.2065 1.0614
+1.207 1.09312
+1.2075 1.11853
+1.208 1.13752
+1.2085 1.15002
+1.209 1.15599
+1.2095 1.15544
+1.21 1.14839
+1.2105 1.13492
+1.211 1.11515
+1.2115 1.0892
+1.212 1.05728
+1.2125 1.01959
+1.213 0.976351
+1.2135 0.927868
+1.214 0.874426
+1.2145 0.816358
+1.215 0.753996
+1.2155 0.687743
+1.216 0.617984
+1.2165 0.545109
+1.217 0.469578
+1.2175 0.391821
+1.218 0.312263
+1.2185 0.231402
+1.219 0.149678
+1.2195 0.0675623
+1.22 -0.0145043
+1.2205 -0.0960186
+1.221 -0.176549
+1.2215 -0.25566
+1.222 -0.332877
+1.2225 -0.407799
+1.223 -0.480029
+1.2235 -0.549141
+1.224 -0.614785
+1.2245 -0.676604
+1.225 -0.734289
+1.2255 -0.787509
+1.226 -0.836007
+1.2265 -0.879541
+1.227 -0.917875
+1.2275 -0.950834
+1.228 -0.97827
+1.2285 -1.00004
+1.229 -1.01607
+1.2295 -1.0263
+1.23 -1.0307
+1.2305 -1.02929
+1.231 -1.02209
+1.2315 -1.00919
+1.232 -0.9907
+1.2325 -0.966745
+1.233 -0.937489
+1.2335 -0.903139
+1.234 -0.863915
+1.2345 -0.820053
+1.235 -0.771847
+1.2355 -0.719588
+1.236 -0.663592
+1.2365 -0.604181
+1.237 -0.541736
+1.2375 -0.476619
+1.238 -0.409191
+1.2385 -0.339877
+1.239 -0.269068
+1.2395 -0.197151
+1.24 -0.124573
+1.2405 -0.0517257
+1.241 0.0209906
+1.2415 0.0931338
+1.242 0.164323
+1.2425 0.234156
+1.243 0.302268
+1.2435 0.368251
+1.244 0.431768
+1.2445 0.492483
+1.245 0.550046
+1.2455 0.604168
+1.246 0.654574
+1.2465 0.700979
+1.247 0.743159
+1.2475 0.780906
+1.248 0.814037
+1.2485 0.842379
+1.249 0.865813
+1.2495 0.884239
+1.25 0.897576
+1.2505 0.905785
+1.251 0.908853
+1.2515 0.906793
+1.252 0.89965
+1.2525 0.887492
+1.253 0.870424
+1.2535 0.848573
+1.254 0.822092
+1.2545 0.791149
+1.255 0.755962
+1.2555 0.716752
+1.256 0.673753
+1.2565 0.627249
+1.257 0.57752
+1.2575 0.52485
+1.258 0.469581
+1.2585 0.412025
+1.259 0.352528
+1.2595 0.291418
+1.26 0.229077
+1.2605 0.165856
+1.261 0.102097
+1.2615 0.0381943
+1.262 -0.0255094
+1.2625 -0.0886667
+1.263 -0.150897
+1.2635 -0.211874
+1.264 -0.271271
+1.2645 -0.328739
+1.265 -0.38398
+1.2655 -0.436701
+1.266 -0.486629
+1.2665 -0.533478
+1.267 -0.57702
+1.2675 -0.617037
+1.268 -0.653309
+1.2685 -0.685668
+1.269 -0.713963
+1.2695 -0.73805
+1.27 -0.757825
+1.2705 -0.77321
+1.271 -0.784146
+1.2715 -0.790599
+1.272 -0.792564
+1.2725 -0.790061
+1.273 -0.783135
+1.2735 -0.771855
+1.274 -0.756309
+1.2745 -0.736621
+1.275 -0.712929
+1.2755 -0.685385
+1.276 -0.654184
+1.2765 -0.61952
+1.277 -0.581615
+1.2775 -0.540691
+1.278 -0.49702
+1.2785 -0.450859
+1.279 -0.402473
+1.2795 -0.35217
+1.28 -0.300241
+1.2805 -0.246972
+1.281 -0.192702
+1.2815 -0.137725
+1.282 -0.0823626
+1.2825 -0.0269121
+1.283 0.0282854
+1.2835 0.0829376
+1.284 0.136749
+1.2845 0.189396
+1.285 0.24061
+1.2855 0.290116
+1.286 0.337628
+1.2865 0.382906
+1.287 0.425706
+1.2875 0.465818
+1.288 0.503014
+1.2885 0.537117
+1.289 0.567963
+1.2895 0.595386
+1.29 0.619265
+1.2905 0.639497
+1.291 0.655982
+1.2915 0.66866
+1.292 0.67749
+1.2925 0.682445
+1.293 0.683529
+1.2935 0.680762
+1.294 0.674188
+1.2945 0.663873
+1.295 0.649903
+1.2955 0.632378
+1.296 0.611431
+1.2965 0.587203
+1.297 0.559846
+1.2975 0.529549
+1.298 0.496502
+1.2985 0.46091
+1.299 0.422982
+1.2995 0.382966
+1.3 0.341098
+1.3005 0.297615
+1.301 0.252793
+1.3015 0.206888
+1.302 0.160153
+1.3025 0.112881
+1.303 0.0653285
+1.3035 0.0177578
+1.304 -0.0295412
+1.3045 -0.0763184
+1.305 -0.12231
+1.3055 -0.167275
+1.306 -0.210947
+1.3065 -0.253103
+1.307 -0.293522
+1.3075 -0.331972
+1.308 -0.368263
+1.3085 -0.402213
+1.309 -0.433632
+1.3095 -0.462372
+1.31 -0.488293
+1.3105 -0.511273
+1.311 -0.531196
+1.3115 -0.547979
+1.312 -0.561554
+1.3125 -0.571864
+1.313 -0.578879
+1.3135 -0.582586
+1.314 -0.582988
+1.3145 -0.58011
+1.315 -0.573992
+1.3155 -0.564696
+1.316 -0.552299
+1.3165 -0.536896
+1.317 -0.518591
+1.3175 -0.497519
+1.318 -0.473817
+1.3185 -0.447633
+1.319 -0.419146
+1.3195 -0.38853
+1.32 -0.355965
+1.3205 -0.321666
+1.321 -0.285832
+1.3215 -0.248678
+1.322 -0.210415
+1.3225 -0.171283
+1.323 -0.131504
+1.3235 -0.0912962
+1.324 -0.0509088
+1.3245 -0.010559
+1.325 0.0295323
+1.3255 0.0691231
+1.326 0.108006
+1.3265 0.145975
+1.327 0.182804
+1.3275 0.218306
+1.328 0.252293
+1.3285 0.28459
+1.329 0.315015
+1.3295 0.343422
+1.33 0.36967
+1.3305 0.393617
+1.331 0.415155
+1.3315 0.434186
+1.332 0.450615
+1.3325 0.464374
+1.333 0.475409
+1.3335 0.483681
+1.334 0.489164
+1.3345 0.491851
+1.335 0.49175
+1.3355 0.488885
+1.336 0.483296
+1.3365 0.475034
+1.337 0.464172
+1.3375 0.450793
+1.338 0.434987
+1.3385 0.416873
+1.339 0.396566
+1.3395 0.374203
+1.34 0.349919
+1.3405 0.323877
+1.341 0.296237
+1.3415 0.267158
+1.342 0.236831
+1.3425 0.205431
+1.343 0.173136
+1.3435 0.140152
+1.344 0.10666
+1.3445 0.0728565
+1.345 0.0389249
+1.3455 0.00507432
+1.346 -0.0285154
+1.3465 -0.0616621
+1.347 -0.0941679
+1.3475 -0.125865
+1.348 -0.156587
+1.3485 -0.186154
+1.349 -0.21442
+1.3495 -0.241233
+1.35 -0.266463
+1.3505 -0.289968
+1.351 -0.311639
+1.3515 -0.331373
+1.352 -0.349066
+1.3525 -0.364641
+1.353 -0.378033
+1.3535 -0.389178
+1.354 -0.398036
+1.3545 -0.404581
+1.355 -0.408791
+1.3555 -0.410665
+1.356 -0.410214
+1.3565 -0.407459
+1.357 -0.402438
+1.3575 -0.395199
+1.358 -0.385801
+1.3585 -0.374318
+1.359 -0.360833
+1.3595 -0.345436
+1.36 -0.328238
+1.3605 -0.309349
+1.361 -0.28889
+1.3615 -0.266984
+1.362 -0.243779
+1.3625 -0.219413
+1.363 -0.194027
+1.3635 -0.167785
+1.364 -0.140837
+1.3645 -0.113335
+1.365 -0.0854513
+1.3655 -0.0573394
+1.366 -0.029155
+1.3665 -0.00107051
+1.367 0.0267653
+1.3675 0.0541951
+1.368 0.081076
+1.3685 0.107248
+1.369 0.132578
+1.3695 0.156935
+1.37 0.18018
+1.3705 0.202198
+1.371 0.22288
+1.3715 0.242113
+1.372 0.259807
+1.3725 0.275877
+1.373 0.290249
+1.3735 0.302851
+1.374 0.313635
+1.3745 0.322555
+1.375 0.329577
+1.3755 0.334679
+1.376 0.337853
+1.3765 0.339096
+1.377 0.338421
+1.3775 0.335848
+1.378 0.33141
+1.3785 0.325151
+1.379 0.317123
+1.3795 0.307384
+1.38 0.29601
+1.3805 0.28308
+1.381 0.268677
+1.3815 0.252901
+1.382 0.235854
+1.3825 0.217638
+1.383 0.198376
+1.3835 0.178181
+1.384 0.157178
+1.3845 0.135485
+1.385 0.113243
+1.3855 0.0905775
+1.386 0.0676144
+1.3865 0.0444974
+1.387 0.0213512
+1.3875 -0.00169693
+1.388 -0.0245075
+1.3885 -0.0469612
+1.389 -0.0689382
+1.3895 -0.0903091
+1.39 -0.110965
+1.3905 -0.130798
+1.391 -0.149706
+1.3915 -0.167583
+1.392 -0.184345
+1.3925 -0.199909
+1.393 -0.214193
+1.3935 -0.227132
+1.394 -0.238671
+1.3945 -0.248751
+1.395 -0.257333
+1.3955 -0.264384
+1.396 -0.269879
+1.3965 -0.2738
+1.397 -0.276143
+1.3975 -0.27691
+1.398 -0.276112
+1.3985 -0.273768
+1.399 -0.269907
+1.3995 -0.264566
+1.4 -0.257791
+1.4005 -0.24963
+1.401 -0.24015
+1.4015 -0.229412
+1.402 -0.217492
+1.4025 -0.204464
+1.403 -0.190419
+1.4035 -0.175444
+1.404 -0.159629
+1.4045 -0.143078
+1.405 -0.12589
+1.4055 -0.108162
+1.406 -0.0900087
+1.4065 -0.0715316
+1.407 -0.0528399
+1.4075 -0.0340354
+1.408 -0.0152348
+1.4085 0.00346174
+1.409 0.0219525
+1.4095 0.0401271
+1.41 0.0578917
+1.4105 0.075153
+1.411 0.0918109
+1.4115 0.107783
+1.412 0.122984
+1.4125 0.137342
+1.413 0.150776
+1.4135 0.163224
+1.414 0.174628
+1.4145 0.18493
+1.415 0.194085
+1.4155 0.202056
+1.416 0.208806
+1.4165 0.214311
+1.417 0.218554
+1.4175 0.221523
+1.418 0.223215
+1.4185 0.223633
+1.419 0.222789
+1.4195 0.2207
+1.42 0.217392
+1.4205 0.212893
+1.421 0.207245
+1.4215 0.200491
+1.422 0.192677
+1.4225 0.183863
+1.423 0.174107
+1.4235 0.163474
+1.424 0.152031
+1.4245 0.139855
+1.425 0.127022
+1.4255 0.113606
+1.426 0.0996952
+1.4265 0.0853719
+1.427 0.0707171
+1.4275 0.0558222
+1.428 0.0407716
+1.4285 0.0256487
+1.429 0.0105456
+1.4295 -0.00445414
+1.43 -0.0192702
+1.4305 -0.0338223
+1.431 -0.0480254
+1.4315 -0.0618046
+1.432 -0.0750923
+1.4325 -0.0878121
+1.433 -0.099901
+1.4335 -0.1113
+1.434 -0.121947
+1.4345 -0.131792
+1.435 -0.140791
+1.4355 -0.148901
+1.436 -0.156084
+1.4365 -0.16231
+1.437 -0.167557
+1.4375 -0.171803
+1.438 -0.175036
+1.4385 -0.177249
+1.439 -0.17844
+1.4395 -0.178614
+1.44 -0.17778
+1.4405 -0.175956
+1.441 -0.173161
+1.4415 -0.169423
+1.442 -0.164771
+1.4425 -0.159244
+1.443 -0.152881
+1.4435 -0.145727
+1.444 -0.137834
+1.4445 -0.129251
+1.445 -0.120034
+1.4455 -0.110245
+1.446 -0.0999452
+1.4465 -0.0891962
+1.447 -0.0780621
+1.4475 -0.0666147
+1.448 -0.0549197
+1.4485 -0.0430435
+1.449 -0.031061
+1.4495 -0.0190362
+1.45 -0.00703624
+1.4505 0.00486666
+1.451 0.0166077
+1.4515 0.0281271
+1.452 0.0393566
+1.4525 0.0502385
+1.453 0.0607141
+1.4535 0.0707331
+1.454 0.080239
+1.4545 0.089186
+1.455 0.0975316
+1.4555 0.105232
+1.456 0.112252
+1.4565 0.118563
+1.457 0.124134
+1.4575 0.128943
+1.458 0.132971
+1.4585 0.136205
+1.459 0.138635
+1.4595 0.140258
+1.46 0.141072
+1.4605 0.141083
+1.461 0.140299
+1.4615 0.138735
+1.462 0.136408
+1.4625 0.133339
+1.463 0.129555
+1.4635 0.125086
+1.464 0.119964
+1.4645 0.114225
+1.465 0.107909
+1.4655 0.10106
+1.466 0.093721
+1.4665 0.0859376
+1.467 0.0777623
+1.4675 0.0692449
+1.468 0.0604341
+1.4685 0.0513873
+1.469 0.0421565
+1.4695 0.0327961
+1.47 0.0233583
+1.4705 0.0139021
+1.471 0.00447725
+1.4715 -0.00486436
+1.472 -0.0140672
+1.4725 -0.023082
+1.473 -0.0318637
+1.4735 -0.040361
+1.474 -0.0485311
+1.4745 -0.0563309
+1.475 -0.0637239
+1.4755 -0.0706694
+1.476 -0.0771349
+1.4765 -0.0830908
+1.477 -0.0885072
+1.4775 -0.0933606
+1.478 -0.097632
+1.4785 -0.101302
+1.479 -0.104358
+1.4795 -0.106791
+1.48 -0.108593
+1.4805 -0.109762
+1.481 -0.110299
+1.4815 -0.110208
+1.482 -0.109499
+1.4825 -0.108181
+1.483 -0.106269
+1.4835 -0.103783
+1.484 -0.100741
+1.4845 -0.0971687
+1.485 -0.0930931
+1.4855 -0.088542
+1.486 -0.0835474
+1.4865 -0.0781414
+1.487 -0.0723624
+1.4875 -0.0662454
+1.488 -0.059828
+1.4885 -0.0531529
+1.489 -0.0462602
+1.4895 -0.0391887
+1.49 -0.0319838
+1.4905 -0.0246866
+1.491 -0.0173379
+1.4915 -0.00998256
+1.492 -0.00266161
+1.4925 0.00458557
+1.493 0.0117197
+1.4935 0.018699
+1.494 0.0254867
+1.4945 0.0320496
+1.495 0.03835
+1.4955 0.044357
+1.496 0.0500414
+1.4965 0.0553728
+1.497 0.060326
+1.4975 0.0648789
+1.498 0.0690109
+1.4985 0.0727022
+1.499 0.0759381
+1.4995 0.0787071
+1.5 0.0809979
+1.5005 0.082804
+1.501 0.0841215
+1.5015 0.0849485
+1.502 0.0852869
+1.5025 0.0851406
+1.503 0.0845167
+1.5035 0.0834246
+1.504 0.0818762
+1.5045 0.0798857
+1.505 0.0774705
+1.5055 0.0746493
+1.506 0.0714423
+1.5065 0.0678742
+1.507 0.0639685
+1.5075 0.0597507
+1.508 0.0552504
+1.5085 0.0504961
+1.509 0.045517
+1.5095 0.0403434
+1.51 0.0350091
+1.5105 0.0295451
+1.511 0.0239829
+1.5115 0.0183578
+1.512 0.0127003
+1.5125 0.00704203
+1.513 0.00141726
+1.5135 -0.00414326
+1.514 -0.00961118
+1.5145 -0.014954
+1.515 -0.0201444
+1.5155 -0.0251543
+1.516 -0.0299599
+1.5165 -0.0345342
+1.517 -0.0388552
+1.5175 -0.0429026
+1.518 -0.0466555
+1.5185 -0.0500969
+1.519 -0.0532128
+1.5195 -0.055988
+1.52 -0.058412
+1.5205 -0.0604755
+1.521 -0.0621721
+1.5215 -0.0634961
+1.522 -0.0644453
+1.5225 -0.0650191
+1.523 -0.065219
+1.5235 -0.065049
+1.524 -0.0645145
+1.5245 -0.0636236
+1.525 -0.0623858
+1.5255 -0.0608123
+1.526 -0.0589172
+1.5265 -0.0567147
+1.527 -0.0542215
+1.5275 -0.0514549
+1.528 -0.0484354
+1.5285 -0.0451823
+1.529 -0.0417166
+1.5295 -0.0380621
+1.53 -0.0342415
+1.5305 -0.0302771
+1.531 -0.0261952
+1.5315 -0.0220194
+1.532 -0.0177747
+1.5325 -0.0134851
+1.533 -0.00917742
+1.5335 -0.00487467
+1.534 -0.000600586
+1.5345 0.00361934
+1.535 0.00776245
+1.5355 0.011808
+1.536 0.0157324
+1.5365 0.0195159
+1.537 0.0231387
+1.5375 0.0265838
+1.538 0.0298324
+1.5385 0.0328695
+1.539 0.0356813
+1.5395 0.0382538
+1.54 0.040576
+1.5405 0.0426391
+1.541 0.0444338
+1.5415 0.0459539
+1.542 0.0471948
+1.5425 0.0481527
+1.543 0.0488265
+1.5435 0.0492159
+1.544 0.0493228
+1.5445 0.0491501
+1.545 0.0487028
+1.5455 0.0479869
+1.546 0.0470104
+1.5465 0.0457821
+1.547 0.0443122
+1.5475 0.0426129
+1.548 0.0406963
+1.5485 0.0385765
+1.549 0.0362676
+1.5495 0.0337865
+1.55 0.0311486
+1.5505 0.0283705
+1.551 0.025471
+1.5515 0.0224679
+1.552 0.0193784
+1.5525 0.0162226
+1.553 0.0130187
+1.5535 0.00978465
+1.554 0.00654057
+1.5545 0.00330456
+1.555 9.41526e-05
+1.5555 -0.00307319
+1.556 -0.00617889
+1.5565 -0.00920658
+1.557 -0.0121414
+1.5575 -0.0149667
+1.558 -0.0176684
+1.5585 -0.0202337
+1.559 -0.0226488
+1.5595 -0.0249024
+1.56 -0.0269846
+1.5605 -0.0288861
+1.561 -0.0305979
+1.5615 -0.0321132
+1.562 -0.0334268
+1.5625 -0.0345333
+1.563 -0.0354296
+1.5635 -0.0361138
+1.564 -0.0365846
+1.5645 -0.0368427
+1.565 -0.0368893
+1.5655 -0.0367274
+1.566 -0.0363606
+1.5665 -0.035794
+1.567 -0.0350334
+1.5675 -0.034086
+1.568 -0.0329599
+1.5685 -0.0316634
+1.569 -0.0302072
+1.5695 -0.028601
+1.57 -0.026856
+1.5705 -0.0249845
+1.571 -0.0229988
+1.5715 -0.0209114
+1.572 -0.0187353
+1.5725 -0.0164848
+1.573 -0.0141734
+1.5735 -0.0118144
+1.574 -0.00942313
+1.5745 -0.00701253
+1.575 -0.00459626
+1.5755 -0.00218904
+1.576 0.000195897
+1.5765 0.00254635
+1.577 0.00484833
+1.5775 0.00709001
+1.578 0.00925935
+1.5785 0.011346
+1.579 0.0133383
+1.5795 0.0152267
+1.58 0.0170024
+1.5805 0.0186564
+1.581 0.0201811
+1.5815 0.0215704
+1.582 0.0228178
+1.5825 0.0239184
+1.583 0.0248682
+1.5835 0.0256642
+1.584 0.0263037
+1.5845 0.0267857
+1.585 0.0271096
+1.5855 0.0272758
+1.586 0.0272858
+1.5865 0.0271417
+1.587 0.0268466
+1.5875 0.0264044
+1.588 0.0258195
+1.5885 0.0250978
+1.589 0.0242449
+1.5895 0.0232678
+1.59 0.0221735
+1.5905 0.0209704
+1.591 0.0196666
+1.5915 0.0182707
+1.592 0.0167925
+1.5925 0.0152414
+1.593 0.0136266
+1.5935 0.0119591
+1.594 0.0102487
+1.5945 0.00850564
+1.595 0.00673997
+1.5955 0.00496288
+1.596 0.00318388
+1.5965 0.00141286
+1.597 -0.000339552
+1.5975 -0.00206392
+1.598 -0.00375159
+1.5985 -0.00539271
+1.599 -0.00697904
+1.5995 -0.00850226
+1.6 -0.0099553
+1.6005 -0.0113302
+1.601 -0.0126208
+1.6015 -0.0138211
+1.602 -0.0149253
+1.6025 -0.0159286
+1.603 -0.0168274
+1.6035 -0.0176176
+1.604 -0.0182966
+1.6045 -0.0188622
+1.605 -0.0193128
+1.6055 -0.0196477
+1.606 -0.0198667
+1.6065 -0.0199703
+1.607 -0.0199596
+1.6075 -0.0198365
+1.608 -0.0196032
+1.6085 -0.0192629
+1.609 -0.018819
+1.6095 -0.0182756
+1.61 -0.0176373
+1.6105 -0.0169092
+1.611 -0.0160966
+1.6115 -0.0152053
+1.612 -0.0142421
+1.6125 -0.0132129
+1.613 -0.0121247
+1.6135 -0.0109847
+1.614 -0.00980029
+1.6145 -0.0085782
+1.615 -0.00732657
+1.6155 -0.00605269
+1.616 -0.00476383
+1.6165 -0.00346804
+1.617 -0.00217263
+1.6175 -0.000884652
+1.618 0.000388846
+1.6185 0.00164037
+1.619 0.00286331
+1.6195 0.00405167
+1.62 0.00519866
+1.6205 0.00629867
+1.621 0.0073464
+1.6215 0.00833631
+1.622 0.00926381
+1.6225 0.0101248
+1.623 0.0109155
+1.6235 0.0116322
+1.624 0.0122721
+1.6245 0.012833
+1.625 0.0133127
+1.6255 0.0137097
+1.626 0.0140233
+1.6265 0.0142527
+1.627 0.0143982
+1.6275 0.0144601
+1.628 0.0144394
+1.6285 0.0143375
+1.629 0.0141563
+1.6295 0.0138979
+1.63 0.0135651
+1.6305 0.013161
+1.631 0.0126887
+1.6315 0.0121524
+1.632 0.0115558
+1.6325 0.0109032
+1.633 0.0101994
+1.6335 0.00944909
+1.634 0.00865719
+1.6345 0.00782868
+1.635 0.00696918
+1.6355 0.00608386
+1.636 0.00517796
+1.6365 0.00425738
+1.637 0.00332721
+1.6375 0.00239276
+1.638 0.00145975
+1.6385 0.000533364
+1.639 -0.000381646
+1.6395 -0.00127982
+1.64 -0.00215651
+1.6405 -0.00300703
+1.641 -0.00382731
+1.6415 -0.00461278
+1.642 -0.00535969
+1.6425 -0.00606459
+1.643 -0.00672387
+1.6435 -0.00733459
+1.644 -0.00789433
+1.6445 -0.00840043
+1.645 -0.008851
+1.6455 -0.00924433
+1.646 -0.00957927
+1.6465 -0.00985468
+1.647 -0.01007
+1.6475 -0.010225
+1.648 -0.0103198
+1.6485 -0.0103547
+1.649 -0.0103306
+1.6495 -0.0102486
+1.65 -0.01011
+1.6505 -0.00991643
+1.651 -0.00967006
+1.6515 -0.00937304
+1.652 -0.00902787
+1.6525 -0.0086372
+1.653 -0.00820419
+1.6535 -0.00773181
+1.654 -0.0072233
+1.6545 -0.00668234
+1.655 -0.00611246
+1.6555 -0.00551714
+1.656 -0.00490045
+1.6565 -0.0042661
+1.657 -0.00361798
+1.6575 -0.00295985
+1.658 -0.00229592
+1.6585 -0.00162979
+1.659 -0.000965188
+1.6595 -0.00030613
+1.66 0.000343815
+1.6605 0.000981375
+1.661 0.00160282
+1.6615 0.00220503
+1.662 0.00278484
+1.6625 0.00333958
+1.663 0.00386622
+1.6635 0.00436236
+1.664 0.00482578
+1.6645 0.00525422
+1.665 0.00564587
+1.6655 0.00599927
+1.666 0.00631287
+1.6665 0.00658563
+1.667 0.0068167
+1.6675 0.00700537
+1.668 0.00715136
+1.6685 0.00725453
+1.669 0.007315
+1.6695 0.00733311
+1.67 0.00730949
+1.6705 0.00724495
+1.671 0.00714054
+1.6715 0.00699752
+1.672 0.0068173
+1.6725 0.00660161
+1.673 0.0063522
+1.6735 0.00607104
+1.674 0.00576021
+1.6745 0.0054221
+1.675 0.00505899
+1.6755 0.00467327
+1.676 0.00426768
+1.6765 0.0038448
+1.677 0.00340716
+1.6775 0.0029577
+1.678 0.00249906
+1.6785 0.00203391
+1.679 0.00156519
+1.6795 0.00109555
+1.68 0.000627586
+1.6805 0.000163868
+1.681 -0.000292861
+1.6815 -0.000740179
+1.682 -0.00117589
+1.6825 -0.0015975
+1.683 -0.00200295
+1.6835 -0.00239029
+1.684 -0.00275748
+1.6845 -0.00310282
+1.685 -0.00342479
+1.6855 -0.003722
+1.686 -0.00399306
+1.6865 -0.00423691
+1.687 -0.00445273
+1.6875 -0.00463965
+1.688 -0.00479717
+1.6885 -0.00492489
+1.689 -0.00502256
+1.6895 -0.00509018
+1.69 -0.00512787
+1.6905 -0.00513592
+1.691 -0.00511479
+1.6915 -0.00506511
+1.692 -0.00498762
+1.6925 -0.00488328
+1.693 -0.00475312
+1.6935 -0.00459828
+1.694 -0.00442015
+1.6945 -0.00422009
+1.695 -0.00399955
+1.6955 -0.00376024
+1.696 -0.00350382
+1.6965 -0.00323199
+1.697 -0.00294652
+1.6975 -0.00264937
+1.698 -0.00234237
+1.6985 -0.00202738
+1.699 -0.00170647
+1.6995 -0.00138144
+1.7 -0.00105416
+1.7005 -0.000726663
+1.701 -0.000400775
+1.7015 -7.81849e-05
+1.702 0.000239175
+1.7025 0.000549661
+1.703 0.000851603
+1.7035 0.00114356
+1.704 0.0014239
+1.7045 0.00169129
+1.705 0.0019445
+1.7055 0.00218224
+1.706 0.00240346
+1.7065 0.00260728
+1.707 0.00279274
+1.7075 0.00295915
+1.708 0.0031059
+1.7085 0.00323254
+1.709 0.00333865
+1.7095 0.00342401
+1.71 0.00348852
+1.7105 0.00353213
+1.711 0.00355501
+1.7115 0.00355737
+1.712 0.00353956
+1.7125 0.00350205
+1.713 0.00344537
+1.7135 0.00337022
+1.714 0.00327733
+1.7145 0.00316754
+1.715 0.00304176
+1.7155 0.00290102
+1.716 0.00274636
+1.7165 0.00257887
+1.717 0.0023998
+1.7175 0.00221035
+1.718 0.0020117
+1.7185 0.00180524
+1.719 0.00159225
+1.7195 0.00137404
+1.72 0.0011519
+1.7205 0.000927272
+1.721 0.000701385
+1.7215 0.00047552
+1.722 0.000251046
+1.7225 2.91893e-05
+1.723 -0.000188927
+1.7235 -0.000402025
+1.724 -0.000609027
+1.7245 -0.000808851
+1.725 -0.00100057
+1.7255 -0.00118314
+1.726 -0.00135574
+1.7265 -0.00151759
+1.727 -0.00166791
+1.7275 -0.00180607
+1.728 -0.00193156
+1.7285 -0.00204382
+1.729 -0.0021425
+1.7295 -0.00222728
+1.73 -0.0022979
+1.7305 -0.00235424
+1.731 -0.00239625
+1.7315 -0.00242393
+1.732 -0.00243738
+1.7325 -0.0024368
+1.733 -0.00242243
+1.7335 -0.00239462
+1.734 -0.00235376
+1.7345 -0.0023003
+1.735 -0.00223481
+1.7355 -0.00215786
+1.736 -0.0020701
+1.7365 -0.0019722
+1.737 -0.00186495
+1.7375 -0.00174909
+1.738 -0.00162542
+1.7385 -0.00149484
+1.739 -0.00135819
+1.7395 -0.00121632
+1.74 -0.00107018
+1.7405 -0.000920672
+1.741 -0.000768657
+1.7415 -0.000615112
+1.742 -0.000460919
+1.7425 -0.000306936
+1.743 -0.000154016
+1.7435 -3.06876e-06
+1.744 0.000145101
+1.7445 0.000289763
+1.745 0.000430088
+1.7455 0.000565389
+1.746 0.000695016
+1.7465 0.000818285
+1.747 0.000934631
+1.7475 0.00104354
+1.748 0.00114455
+1.7485 0.00123719
+1.749 0.00132109
+1.7495 0.00139598
+1.75 0.00146156
+1.7505 0.00151765
+1.751 0.0015641
+1.7515 0.00160082
+1.752 0.0016278
+1.7525 0.00164506
+1.753 0.00165268
+1.7535 0.00165079
+1.754 0.0016396
+1.7545 0.00161932
+1.755 0.00159025
+1.7555 0.00155272
+1.756 0.00150709
+1.7565 0.00145379
+1.757 0.00139325
+1.7575 0.00132594
+1.758 0.00125239
+1.7585 0.00117314
+1.759 0.00108873
+1.7595 0.000999717
+1.76 0.000906734
+1.7605 0.000810364
+1.761 0.000711199
+1.7615 0.000609903
+1.762 0.000507054
+1.7625 0.000403251
+1.763 0.000299144
+1.7635 0.000195321
+1.764 9.23221e-05
+1.7645 -9.23019e-06
+1.765 -0.000108808
+1.7655 -0.000205873
+1.766 -0.000299961
+1.7665 -0.000390545
+1.767 -0.000477198
+1.7675 -0.000559518
+1.768 -0.000637087
+1.7685 -0.000709563
+1.769 -0.000776661
+1.7695 -0.000838068
+1.77 -0.000893556
+1.7705 -0.000942918
+1.771 -0.000986009
+1.7715 -0.00102268
+1.772 -0.00105286
+1.7725 -0.0010765
+1.773 -0.00109358
+1.7735 -0.00110414
+1.774 -0.00110824
+1.7745 -0.00110598
+1.775 -0.00109749
+1.7755 -0.00108295
+1.776 -0.00106255
+1.7765 -0.00103652
+1.777 -0.00100512
+1.7775 -0.00096862
+1.778 -0.000927342
+1.7785 -0.0008816
+1.779 -0.000831732
+1.7795 -0.000778123
+1.78 -0.000721143
+1.7805 -0.000661158
+1.781 -0.000598597
+1.7815 -0.000533853
+1.782 -0.000467336
+1.7825 -0.000399443
+1.783 -0.000330622
+1.7835 -0.000261255
+1.784 -0.000191737
+1.7845 -0.000122496
+1.785 -5.39127e-05
+1.7855 1.36643e-05
+1.786 7.98362e-05
+1.7865 0.000144268
+1.787 0.000206621
+1.7875 0.000266607
+1.788 0.000323899
+1.7885 0.000378238
+1.789 0.000429382
+1.7895 0.000477082
+1.79 0.000521141
+1.7905 0.000561396
+1.791 0.000597673
+1.7915 0.00062985
+1.792 0.000657832
+1.7925 0.000681526
+1.793 0.000700895
+1.7935 0.000715909
+1.794 0.000726571
+1.7945 0.0007329
+1.795 0.000734951
+1.7955 0.000732793
+1.796 0.000726522
+1.7965 0.000716255
+1.797 0.000702125
+1.7975 0.000684297
+1.798 0.000662939
+1.7985 0.000638244
+1.799 0.000610412
+1.7995 0.000579676
+1.8 0.000546258
+1.8005 0.000510397
+1.801 0.000472359
+1.8015 0.0004324
+1.802 0.000390768
+1.8025 0.000347756
+1.803 0.000303625
+1.8035 0.00025864
+1.804 0.000213091
+1.8045 0.000167245
+1.805 0.000121358
+1.8055 7.56883e-05
+1.806 3.05086e-05
+1.8065 -1.39384e-05
+1.807 -5.74324e-05
+1.8075 -9.97231e-05
+1.808 -0.000140603
+1.8085 -0.000179876
+1.809 -0.000217334
+1.8095 -0.000252807
+1.81 -0.000286138
+1.8105 -0.000317184
+1.811 -0.000345801
+1.8115 -0.000371879
+1.812 -0.000395332
+1.8125 -0.000416065
+1.813 -0.000434021
+1.8135 -0.000449157
+1.814 -0.000461434
+1.8145 -0.000470848
+1.815 -0.000477401
+1.8155 -0.000481113
+1.816 -0.000482019
+1.8165 -0.000480173
+1.817 -0.000475638
+1.8175 -0.000468496
+1.818 -0.000458841
+1.8185 -0.000446775
+1.819 -0.000432421
+1.8195 -0.000415904
+1.82 -0.000397357
+1.8205 -0.000376935
+1.821 -0.000354791
+1.8215 -0.000331082
+1.822 -0.00030597
+1.8225 -0.000279638
+1.823 -0.000252254
+1.8235 -0.000223991
+1.824 -0.00019504
+1.8245 -0.00016557
+1.825 -0.000135756
+1.8255 -0.000105786
+1.826 -7.58303e-05
+1.8265 -4.60475e-05
+1.827 -1.66184e-05
+1.8275 1.23028e-05
+1.828 4.05593e-05
+1.8285 6.8015e-05
+1.829 9.45162e-05
+1.8295 0.000119937
+1.83 0.000144161
+1.8305 0.000167064
+1.831 0.000188545
+1.8315 0.000208521
+1.832 0.000226898
+1.8325 0.000243609
+1.833 0.000258591
+1.8335 0.0002718
+1.834 0.000283191
+1.8345 0.000292739
+1.835 0.00030043
+1.8355 0.000306253
+1.836 0.000310218
+1.8365 0.000312341
+1.837 0.000312645
+1.8375 0.000311168
+1.838 0.000307953
+1.8385 0.000303058
+1.839 0.000296543
+1.8395 0.00028848
+1.84 0.000278943
+1.8405 0.000268024
+1.841 0.000255809
+1.8415 0.000242393
+1.842 0.000227882
+1.8425 0.00021238
+1.843 0.000195991
+1.8435 0.000178834
+1.844 0.000161019
+1.8445 0.000142662
+1.845 0.000123874
+1.8455 0.000104781
+1.846 8.54898e-05
+1.8465 6.61132e-05
+1.847 4.67707e-05
+1.8475 2.75697e-05
+1.848 8.60894e-06
+1.8485 -9.9992e-06
+1.849 -2.816e-05
+1.8495 -4.57777e-05
+1.85 -6.27703e-05
+1.8505 -7.90457e-05
+1.851 -9.45297e-05
+1.8515 -0.000109154
+1.852 -0.000122847
+1.8525 -0.000135552
+1.853 -0.000147222
+1.8535 -0.000157807
+1.854 -0.000167273
+1.8545 -0.00017559
+1.855 -0.000182733
+1.8555 -0.000188686
+1.856 -0.000193441
+1.8565 -0.000196997
+1.857 -0.000199357
+1.8575 -0.000200535
+1.858 -0.000200548
+1.8585 -0.000199421
+1.859 -0.000197186
+1.8595 -0.000193877
+1.86 -0.000189537
+1.8605 -0.000184212
+1.861 -0.000177954
+1.8615 -0.000170816
+1.862 -0.000162861
+1.8625 -0.000154151
+1.863 -0.000144748
+1.8635 -0.000134726
+1.864 -0.000124152
+1.8645 -0.000113095
+1.865 -0.000101635
+1.8655 -8.98416e-05
+1.866 -7.77878e-05
+1.8665 -6.55524e-05
+1.867 -5.32067e-05
+1.8675 -4.08257e-05
+1.868 -2.8471e-05
+1.8685 -1.62269e-05
+1.869 -4.15112e-06
+1.8695 7.69111e-06
+1.87 1.92326e-05
+1.8705 3.04165e-05
+1.871 4.11889e-05
+1.8715 5.14929e-05
+1.872 6.12822e-05
+1.8725 7.051e-05
+1.873 7.91416e-05
+1.8735 8.71353e-05
+1.874 9.44609e-05
+1.8745 0.000101092
+1.875 0.000107004
+1.8755 0.00011218
+1.876 0.000116607
+1.8765 0.000120274
+1.877 0.000123178
+1.8775 0.000125318
+1.878 0.000126699
+1.8785 0.00012733
+1.879 0.000127223
+1.8795 0.000126395
+1.88 0.000124867
+1.8805 0.000122661
+1.881 0.000119806
+1.8815 0.000116332
+1.882 0.000112273
+1.8825 0.000107661
+1.883 0.000102541
+1.8835 9.69478e-05
+1.884 9.0926e-05
+1.8845 8.45172e-05
+1.885 7.77691e-05
+1.8855 7.07265e-05
+1.886 6.34342e-05
+1.8865 5.59424e-05
+1.887 4.82981e-05
+1.8875 4.05437e-05
+1.888 3.27304e-05
+1.8885 2.49024e-05
+1.889 1.71032e-05
+1.8895 9.37968e-06
+1.89 1.77265e-06
+1.8905 -5.67709e-06
+1.891 -1.2932e-05
+1.8915 -1.9952e-05
+1.892 -2.67025e-05
+1.8925 -3.31548e-05
+1.893 -3.92749e-05
+1.8935 -4.50365e-05
+1.894 -5.04156e-05
+1.8945 -5.53879e-05
+1.895 -5.99352e-05
+1.8955 -6.40408e-05
+1.896 -6.76919e-05
+1.8965 -7.08762e-05
+1.897 -7.35861e-05
+1.8975 -7.58183e-05
+1.898 -7.75691e-05
+1.8985 -7.88397e-05
+1.899 -7.96335e-05
+1.8995 -7.99564e-05
+1.9 -7.98172e-05
+1.9005 -7.92267e-05
+1.901 -7.81986e-05
+1.9015 -7.67485e-05
+1.902 -7.4894e-05
+1.9025 -7.26541e-05
+1.903 -7.00511e-05
+1.9035 -6.71076e-05
+1.904 -6.38472e-05
+1.9045 -6.02969e-05
+1.905 -5.64828e-05
+1.9055 -5.24317e-05
+1.906 -4.81737e-05
+1.9065 -4.37376e-05
+1.907 -3.91513e-05
+1.9075 -3.44439e-05
+1.908 -2.96471e-05
+1.9085 -2.47891e-05
+1.909 -1.98981e-05
+1.9095 -1.50047e-05
+1.91 -1.01359e-05
+1.9105 -5.31799e-06
+1.911 -5.79145e-07
+1.9115 4.05536e-06
+1.912 8.56329e-06
+1.9125 1.29217e-05
+1.913 1.71074e-05
+1.9135 2.11013e-05
+1.914 2.48856e-05
+1.9145 2.8442e-05
+1.915 3.1756e-05
+1.9155 3.48149e-05
+1.916 3.76052e-05
+1.9165 4.01187e-05
+1.917 4.23474e-05
+1.9175 4.4284e-05
+1.918 4.59245e-05
+1.9185 4.72662e-05
+1.919 4.83086e-05
+1.9195 4.90519e-05
+1.92 4.94991e-05
+1.9205 4.96542e-05
+1.921 4.95229e-05
+1.9215 4.91127e-05
+1.922 4.8432e-05
+1.9225 4.74911e-05
+1.923 4.63011e-05
+1.9235 4.48746e-05
+1.924 4.32248e-05
+1.9245 4.13667e-05
+1.925 3.93155e-05
+1.9255 3.70868e-05
+1.926 3.46986e-05
+1.9265 3.21671e-05
+1.927 2.95098e-05
+1.9275 2.67458e-05
+1.928 2.38928e-05
+1.9285 2.09685e-05
+1.929 1.79924e-05
+1.9295 1.49822e-05
+1.93 1.19563e-05
+1.9305 8.93009e-06
+1.931 5.92437e-06
+1.9315 2.95345e-06
+1.932 3.35029e-08
+1.9325 -2.8188e-06
+1.933 -5.58933e-06
+1.9335 -8.26467e-06
+1.934 -1.08307e-05
+1.9345 -1.32758e-05
+1.935 -1.55883e-05
+1.9355 -1.77594e-05
+1.936 -1.97788e-05
+1.9365 -2.16387e-05
+1.937 -2.33327e-05
+1.9375 -2.48541e-05
+1.938 -2.61987e-05
+1.9385 -2.7363e-05
+1.939 -2.83441e-05
+1.9395 -2.9141e-05
+1.94 -2.97534e-05
+1.9405 -3.01817e-05
+1.941 -3.04283e-05
+1.9415 -3.04957e-05
+1.942 -3.03877e-05
+1.9425 -3.0109e-05
+1.943 -2.96653e-05
+1.9435 -2.90626e-05
+1.944 -2.83084e-05
+1.9445 -2.74107e-05
+1.945 -2.63771e-05
+1.9455 -2.52179e-05
+1.946 -2.39418e-05
+1.9465 -2.2559e-05
+1.947 -2.10797e-05
+1.9475 -1.95152e-05
+1.948 -1.7876e-05
+1.9485 -1.61729e-05
+1.949 -1.44179e-05
+1.9495 -1.26222e-05
+1.95 -1.07959e-05
+1.9505 -8.95136e-06
+1.951 -7.09906e-06
+1.9515 -5.24942e-06
+1.952 -3.4137e-06
+1.9525 -1.60169e-06
+1.953 1.76813e-07
+1.9535 1.91279e-06
+1.954 3.59662e-06
+1.9545 5.21993e-06
+1.955 6.77584e-06
+1.9555 8.2561e-06
+1.956 9.65433e-06
+1.9565 1.09648e-05
+1.957 1.21814e-05
+1.9575 1.32999e-05
+1.958 1.4316e-05
+1.9585 1.52266e-05
+1.959 1.60287e-05
+1.9595 1.67201e-05
+1.96 1.73001e-05
+1.9605 1.77676e-05
+1.961 1.81226e-05
+1.9615 1.83659e-05
+1.962 1.84986e-05
+1.9625 1.85226e-05
+1.963 1.84404e-05
+1.9635 1.82549e-05
+1.964 1.79698e-05
+1.9645 1.7589e-05
+1.965 1.71167e-05
+1.9655 1.65582e-05
+1.966 1.59186e-05
+1.9665 1.52032e-05
+1.967 1.44184e-05
+1.9675 1.357e-05
+1.968 1.26642e-05
+1.9685 1.17081e-05
+1.969 1.07082e-05
+1.9695 9.67102e-06
+1.97 8.60324e-06
+1.9705 7.51217e-06
+1.971 6.40439e-06
+1.9715 5.2864e-06
+1.972 4.1653e-06
+1.9725 3.04734e-06
+1.973 1.93862e-06
+1.9735 8.45705e-07
+1.974 -2.25546e-07
+1.9745 -1.26996e-06
+1.975 -2.28218e-06
+1.9755 -3.25681e-06
+1.976 -4.18937e-06
+1.9765 -5.07572e-06
+1.977 -5.91155e-06
+1.9775 -6.69348e-06
+1.978 -7.41846e-06
+1.9785 -8.0833e-06
+1.979 -8.68609e-06
+1.9795 -9.22484e-06
+1.98 -9.69779e-06
+1.9805 -1.01039e-05
+1.981 -1.04426e-05
+1.9815 -1.07135e-05
+1.982 -1.09166e-05
+1.9825 -1.10524e-05
+1.983 -1.11219e-05
+1.9835 -1.11262e-05
+1.984 -1.10668e-05
+1.9845 -1.09457e-05
+1.985 -1.07651e-05
+1.9855 -1.05275e-05
+1.986 -1.02355e-05
+1.9865 -9.89205e-06
+1.987 -9.5006e-06
+1.9875 -9.06445e-06
+1.988 -8.58707e-06
+1.9885 -8.07249e-06
+1.989 -7.5243e-06
+1.9895 -6.94641e-06
+1.99 -6.34309e-06
+1.9905 -5.7183e-06
+1.991 -5.07601e-06
+1.9915 -4.42057e-06
+1.992 -3.75593e-06
+1.9925 -3.08625e-06
+1.993 -2.41497e-06
+1.9935 -1.74674e-06
+1.994 -1.08481e-06
+1.9945 -4.32789e-07
+1.995 2.0556e-07
+1.9955 8.27053e-07
+1.996 1.42867e-06
+1.9965 2.0072e-06
+1.997 2.56005e-06
+1.9975 3.08454e-06
+1.998 3.57871e-06
+1.9985 4.04017e-06
+1.999 4.46717e-06
+1.9995 4.85819e-06
+2 5.21174e-06
+&
index eb93c261a3d3ca467e12f9c415b1807a1ab6f3f5..1d7f34cb5fb027a40e219b891c8773d5dfc930cc 100644 (file)
@@ -1048,6 +1048,58 @@ rotation, torques $\ve{\tau}_{\!n}$ are calculated for each slab using the
 local rotation axis of the slab and the Gaussian-weighted positions.
 
 
+\section{\normindex{Electric fields}}
+A pulsed and oscillating electric field can be applied according to:
+\begin{equation}
+E(t) = E_0 \exp\left[-\frac{(t-t_0)^2}{2\sigma^2}\right]\cos\left[\omega (t-t_0)\right]
+\label{eq_efield}
+\end{equation}
+where $E_0$ is the field strength, the angular frequency \mbox{$\omega = 2\pi c/\lambda$}, $t_0$ is
+the time at of the peak in the field strength and $\sigma$ is the with
+of the pulse. Special cases occur when $\sigma$ = 0 (non-pulsed field)
+and for $\omega$ is 0 (static field).
+
+This simulated \normindex{laser}-pulse was applied to
+simulations of melting ice~\cite{Caleman2008a}. A pulsed electric field may
+look ike Fig.~\ref{fig:field}. In the supporting
+information of that paper the impact of an applied electric field on a
+system under periodic boundary conditions is analyzed. It is described
+that the effective electric field under PBC is larger than the applied
+field, by a factor depending on the size of the box and the dielectric
+properties of molecules in the box. For a system with static dielectric
+properties this factor can be corrected for. But for a system where
+the dielectric varies over time, for example a membrane protein with
+a pore that opens and closes during the simulatippn, this way of applying
+an electric field is not useful. In such cases one can use the computational
+electrophysiology protocol described in the next section (\secref{compel}).
+\begin{figure}[ht]
+\centerline{\includegraphics[width=8cm]{plots/field}}
+\caption {A simulated laser pulse in GROMACS.}
+\label{fig:field}
+\end{figure}
+
+Electric fields are applied when the following options are specified
+in the {\tt grompp.mdp} file. You specify, in order, $E_0$, $\omega$,
+$t_0$ and $\sigma$:
+\begin{verbatim}
+ElectricField-x = 0.04 0       0     0
+\end{verbatim}
+yields a static field with $E_0$ = 0.04 V/nm in the X-direction. In contrast,
+\begin{verbatim}
+ElectricField-x = 2.0  150     5     0
+\end{verbatim}
+yields an oscillating electric field with $E_0$ = 2 V/nm, $\omega$ = 150/ps and
+$t_0$ = 5 ps. Finally 
+\begin{verbatim}
+ElectricField-x = 2.0  150     5     1
+\end{verbatim}
+yields an pulsed-oscillating electric field with $E_0$ = 2 V/nm, $\omega$ = 150/ps and
+$t_0$ = 5 ps and $\sigma$ = 1 ps. Read more in ref.~\cite{Caleman2008a}.
+Note that the input file format is changed from the undocumented older
+version. A figure like Fig.~\ref{fig:field} may be produced by passing
+the {\tt -field} option to {\tt gmx mdrun}.
+
+
 \section{\normindex{Computational Electrophysiology}}
 \label{sec:compel}
 
index b92d81ba1b1a7b307e45e04441b80fe13bf1c32f..4148300c143b6e38f83e6980c74ebb0a5551b79a 100644 (file)
@@ -141,6 +141,18 @@ linked help for the new commands for a full description.
 This section lists only major changes; minor changes like additional/removed
 options or bug fixes are not typically included.
 
+Version 2017
+^^^^^^^^^^^^
+
+gmx trajectory
+..............
+
+**new**
+
+:ref:`gmx trajectory` has been introduced as a selection-enabled version of
+:ref:`gmx traj`.  It supports output of coordinates, velocities, and/or forces
+for positions calculated for selections.
+
 Version 2016
 ^^^^^^^^^^^^
 
index 597ed8f900e9f36f5ebd5cf9bf01568ee4c42213..76fd58770621590c849a86cb259a576776ba9933 100644 (file)
@@ -199,8 +199,6 @@ Performance and Run Control
 ``GMX_EMULATE_GPU``
         emulate GPU runs by using algorithmically equivalent CPU reference code instead of
         GPU-accelerated functions. As the CPU code is slow, it is intended to be used only for debugging purposes.
-        The behavior is automatically triggered if non-bonded calculations are turned off using ``GMX_NO_NONBONDED``
-        case in which the non-bonded calculations will not be called, but the CPU-GPU transfer will also be skipped.
 
 ``GMX_ENX_NO_FATAL``
         disable exiting upon encountering a corrupted frame in an :ref:`edr`
@@ -288,6 +286,7 @@ Performance and Run Control
         skip non-bonded calculations; can be used to estimate the possible
         performance gain from adding a GPU accelerator to the current hardware setup -- assuming that this is
         fast enough to complete the non-bonded calculations while the CPU does bonded force and PME computation.
+        Freezing the particles will be required to stop the system blowing up.
 
 ``GMX_NO_PULLVIR``
         when set, do not add virial contribution to COM pull forces.
@@ -356,9 +355,15 @@ Performance and Run Control
 ``MDRUN``
         the :ref:`gmx mdrun` command used by :ref:`gmx tune_pme`.
 
-``GMX_NSTLIST``
-        sets the default value for :mdp:`nstlist`, preventing it from being tuned during
-        :ref:`gmx mdrun` startup when using the Verlet cutoff scheme.
+``GMX_DISABLE_DYNAMICPRUNING``
+        disables dynamic pair-list pruning. Note that :ref:`gmx mdrun` will
+        still tune nstlist to the optimal value picked assuming dynamic pruning. Thus
+        for good performance the -nstlist option should be used.
+
+``GMX_NSTLIST_DYNAMICPRUNING``
+        overrides the dynamic pair-list pruning interval chosen heuristically
+        by mdrun. Values should be between the pruning frequency value
+        (1 for CPU and 2 for GPU) and :mdp:`nstlist - 1`.
 
 ``GMX_USE_TREEREDUCE``
         use tree reduction for nbnxn force reduction. Potentially faster for large number of
@@ -458,6 +463,11 @@ compilation of OpenCL kernels, but they are also used in device selection.
         override |Gromacs| default behavior, or if you want to test
         your own kernels.
 
+``GMX_OCL_DISABLE_COMPATIBILITY_CHECK``
+        Disables the hardware compatibility check. Useful for developers
+        and allows testing the OpenCL kernels on non-supported platforms
+        (like Intel iGPUs) without source code modification.
+
 Analysis and Core Functions
 ---------------------------
 ``GMX_QM_ACCURACY``
index 6720381b35328b8e05ab8962a5897f6547aab4cf..271abfd1db4a3e9434232ed35d4d37b8e96b1b60 100644 (file)
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.8)
+cmake_minimum_required(VERSION 3.4.3)
 
 project(template CXX)
 
index 11829495889c933dc8b9fa05e0f3af8ff8791f41..f120b01add4bf0da3db4321cc72aeafd86a88513 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, by the GROMACS development team, led by
+# Copyright (c) 2009,2010,2011,2012,2013,2014,2015,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.
@@ -55,15 +55,7 @@ if (BUILD_TESTING)
         add_subdirectory(external/gmock-1.7.0)
     endif()
     include(testutils/TestMacros.cmake)
-    if (GMX_BUILD_UNITTESTS)
-        add_subdirectory(testutils)
-    else()
-        add_custom_target(unittests-notice
-            ${CMAKE_COMMAND} -E echo "NOTE: Unit tests have not been run. You need to set GMX_BUILD_UNITTESTS=ON if you want to build and run them."
-            DEPENDS run-ctest
-            COMMENT "Unit tests disabled" VERBATIM)
-        add_dependencies(check unittests-notice)
-    endif()
+    add_subdirectory(testutils)
 endif()
 
 add_subdirectory(gromacs)
index c7bd5fb3dab936c13a5ce09708c54fcb0572acc3..b4f977b8653e3c242eb5761eac92e514b2300fd7 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
@@ -74,9 +74,6 @@
 /** Define if we are building for Cygwin */
 #cmakedefine01 GMX_CYGWIN
 
-/* GCC bug in AVX maskload/maskstore arguments - worked around internally */
-#cmakedefine01 GMX_SIMD_X86_AVX_GCC_MASKLOAD_BUG
-
 /* SSE2 was selected for SIMD instruction set level */
 #cmakedefine01 GMX_SIMD_X86_SSE2
 
@@ -92,6 +89,9 @@
 /* AVX2 256-bit SIMD instruction set level was selected */
 #cmakedefine01 GMX_SIMD_X86_AVX2_256
 
+/* AVX2 128-bit SIMD instruction set level was selected */
+#cmakedefine01 GMX_SIMD_X86_AVX2_128
+
 /* MIC (Xeon Phi) SIMD instruction set level was selected */
 #cmakedefine01 GMX_SIMD_X86_MIC
 
 #cmakedefine01 GMX_SIMD_REFERENCE
 
 /* String for SIMD instruction choice (for writing to log files and stdout) */
-#define GMX_SIMD_STRING "@GMX_SIMD@"
+#define GMX_SIMD_STRING "@GMX_SIMD_ACTIVE@"
 
 /* Calling convention string (if any) for routines with SIMD variable args */
 #define gmx_simdcall @GMX_SIMD_CALLING_CONVENTION@
 /* Define when Windows threads are used */
 #cmakedefine THREAD_WINDOWS
 
-/* Define native atomic operations are found */
-#cmakedefine TMPI_ATOMICS
-
 /* Define for busy wait option  */
 /* See gmxpre-config.h.cmakein for explanation for the #ifdef */
 #ifndef TMPI_WAIT_FOR_NO_ONE
 #cmakedefine01 HAVE_GETTIMEOFDAY
 
 /* Define to 1 if you have the rdtscp instruction. */
-#cmakedefine HAVE_RDTSCP
+#cmakedefine01 HAVE_RDTSCP
 
 /* Define to 1 if you have the fsync() function. */
 #cmakedefine01 HAVE_FSYNC
 /* Define if we have feenableexcept */
 #cmakedefine01 HAVE_FEENABLEEXCEPT
 
-/* Define if we have zlib */
-#cmakedefine01 HAVE_ZLIB
-
 /*! \endcond */
 
 #endif
index dfd884995431d72b1bf18c42e5de0515cee9e615..cddc1d2825f35e4a2eef7faca7102afb4e1e212b 100644 (file)
@@ -430,7 +430,7 @@ int main(int argc,char *argv[])
     gmx_ffclose(fo);
     gmx_ffclose(frc);
     fprintf(stderr,"\n");
-    close_trj(status);
+    close_trx(status);
     if (trxout != NULL) {
        close_trx(trxout);
     }
index fce2869ebb926dfdd4b76b03f1098ab510307429..bd44853142dec6fa24a739578e1fafb23f1187f0 100644 (file)
@@ -179,7 +179,7 @@ int main(int argc,char *argv[])
       nframe++;
     }
   } while(read_next_x(status,&t,natoms,x,box));
-  close_trj(status);
+  close_trx(status);
   gmx_ffclose(out);
   
   gmx_thanx(stderr);
index 2037f62ec2ec6e075bc756a1bec6b834f410a3c1..620caed6fa4eadb9bd8a35754edd8a788a5c43c7 100644 (file)
@@ -60,14 +60,14 @@ endif()
 
 # Set library optimizations
 set(_fftw_simd_support_level "")
-if(${GMX_SIMD} MATCHES "^(SSE|AVX)" AND APPLE)
+if(${GMX_SIMD_ACTIVE} MATCHES "^(SSE|AVX)" AND APPLE)
     # OS X and --enable-avx causes compilation issues (fftw always picks gcc by default). It's
     # not an important enough performance loss to bother warning the
     # user about.
     set(_fftw_simd_support_level "--enable-sse2")
-elseif(${GMX_SIMD} MATCHES "^(SSE)")
+elseif(${GMX_SIMD_ACTIVE} MATCHES "^(SSE)")
     set(_fftw_simd_support_level "--enable-sse2")
-elseif(${GMX_SIMD} MATCHES "^(AVX)")
+elseif(${GMX_SIMD_ACTIVE} MATCHES "^(AVX)")
     # Testing shows FFTW configured with --enable-sse2 --enable-avx is
     # slightly faster on most architectures than --enable-sse2 alone.
     # Support for --enable-avx2 was only added in 3.3.5, but
@@ -82,7 +82,7 @@ if(MSVC OR (CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.
 else()
     set(_fftw_simd_support_level --enable-sse2;--enable-avx;--enable-avx2;--enable-avx512)
 endif()
-elseif(${GMX_SIMD} MATCHES "^(VSX)")
+elseif(${GMX_SIMD_ACTIVE} MATCHES "^(VSX)")
     set(_fftw_simd_support_level --enable-vsx)
 endif()
 set(GMX_BUILD_OWN_FFTW_OPTIMIZATION_CONFIGURATION ${_fftw_simd_support_level} CACHE INTERNAL "Optimization flags for FFTW compilation")
index 725a3aeb19ba1a408cb67cde6f3013d750442116..6818a77b1b5d33f8c76ec2dcdc6e4d7a3ea0319b 100644 (file)
@@ -539,7 +539,7 @@ structure if needed */
   gmx_rmpbc_done(gpbc);
 
 
-  close_trj(status);
+  close_trx(status);
   
   sfree(x);
 
index 35acd0a7e6717c378ac0b3406624443181b51c58..fa220cf29a26299d2be310491c336a13ec0f1e1e 100644 (file)
@@ -65,6 +65,11 @@ find_package(Threads)
 set(PTHREADS_LIBRARIES)
 if (CMAKE_USE_PTHREADS_INIT)
     set(PTHREADS_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
+    list(APPEND GMOCK_COMPILE_DEFINITIONS "GTEST_HAS_PTHREAD=1")
+    set(GTEST_IS_THREADSAFE 1)
+else()
+    list(APPEND GMOCK_COMPILE_DEFINITIONS "GTEST_HAS_PTHREAD=0")
+    set(GTEST_IS_THREADSAFE 0)
 endif()
 
 # Skip variadic implementation of matchers if using GCC < 4.7 due to
@@ -101,3 +106,4 @@ set(GMOCK_INCLUDE_DIRS ${GMOCK_INCLUDE_DIRS} PARENT_SCOPE)
 set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIRS} PARENT_SCOPE)
 set(GMOCK_COMPILE_DEFINITIONS ${GMOCK_COMPILE_DEFINITIONS} PARENT_SCOPE)
 set(GMOCK_COMPILE_FLAGS "${GMOCK_COMPILE_FLAGS}" PARENT_SCOPE)
+set(GTEST_IS_THREADSAFE "${GTEST_IS_THREADSAFE}" PARENT_SCOPE)
index d6702c8f1624789dcbda525f7a28e72be627e9ef..40c6648f4f14c909c7baa1b1e6c899644584ac3a 100644 (file)
@@ -1404,7 +1404,7 @@ internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
   void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
 
 # define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \
-  ::testing::internal::ParamGenerator<test_case_name::ParamType> \
+  static ::testing::internal::ParamGenerator<test_case_name::ParamType> \
       gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
   int gtest_##prefix##test_case_name##_dummy_ = \
       ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
index 4c9bef373860f5d3509ba73455a87898c9a4ae89..4916b541253ae5118523212b50a6b52766fd677a 100644 (file)
@@ -137,8 +137,10 @@ class TMPI_EXPORT mutex
 
         /*! \brief The try_lock function.
 
-           Throws a tMPI::system_error exception upon failure.
-           \return true if the lock was locked successfully, false if not*/
+           \return true if the lock was locked successfully, false if
+           another thread owned it, and implementation-specific if
+           already held by this thread. Do not rely on the return code
+           if the calling thread could already hold this lock. */
         bool try_lock()
         {
             if (tMPI_Thread_mutex_trylock(&handle_))
index 8d8d5fd4850387d94fc23b44b61476d53e8c848e..2abd8e5430a7de99111fe6e1f0fa0fda06976a2d 100644 (file)
@@ -450,12 +450,14 @@ int tMPI_Thread_mutex_lock(tMPI_Thread_mutex_t *mtx);
 
 /** Try to lock a mutex, return if busy
  *
- *  This routine always return directly. If the mutex was available and
- *  we successfully locked it we return 0, otherwise a non-zero
- *  return code (usually meaning the mutex was already locked).
+ *  This routine always returns directly.
  *
  *  \param mtx  Pointer to the mutex to try and lock
- *  \return 0 if locked, non-zero if not locked or an error occurred.
+ *  \return If the mutex was available and we successfully locked it,
+ *     we return 0. If the mutex was unavailable because it was
+ *     already locked by another thread, we return non-zero. If the
+ *     mutex was already held by this thread, the return value is
+ *     implementation-defined (pthreads non-zero, winthreads zero).
  */
 TMPI_EXPORT
 int tMPI_Thread_mutex_trylock(tMPI_Thread_mutex_t *mtx);
index 38af58fe2426c630e14eed18fee47f2ff28a7109..5e9c472806b05ce0f50f26b3a44f6e0e39527402 100644 (file)
@@ -2,7 +2,7 @@
    This source code file is part of thread_mpi.
    Written by Sander Pronk, Erik Lindahl, and possibly others.
 
-   Copyright (c) 2009, Sander Pronk, Erik Lindahl.
+   Copyright (c) 2009,2016, Sander Pronk, Erik Lindahl.
    All rights reserved.
 
    Redistribution and use in source and binary forms, with or without
@@ -884,7 +884,7 @@ int tMPI_Type_commit(tMPI_Datatype *datatype);
     \param[in]  comm        The shared communicator.
     \return  TMPI_SUCCESS on success, TMPI_FAILURE on failure.  */
 TMPI_EXPORT
-int tMPI_Send(void* buf, int count, tMPI_Datatype datatype, int dest,
+int tMPI_Send(const void* buf, int count, tMPI_Datatype datatype, int dest,
               int tag, tMPI_Comm comm);
 
 /** Receive message; blocks until buf is filled.
@@ -919,7 +919,7 @@ int tMPI_Recv(void* buf, int count, tMPI_Datatype datatype, int source,
     \param[out] status      The received message status.
     \return  TMPI_SUCCESS on success, TMPI_FAILURE on failure.  */
 TMPI_EXPORT
-int tMPI_Sendrecv(void *sendbuf, int sendcount, tMPI_Datatype sendtype,
+int tMPI_Sendrecv(const void *sendbuf, int sendcount, tMPI_Datatype sendtype,
                   int dest, int sendtag, void *recvbuf, int recvcount,
                   tMPI_Datatype recvtype, int source, int recvtag,
                   tMPI_Comm comm, tMPI_Status *status);
@@ -945,7 +945,7 @@ int tMPI_Sendrecv(void *sendbuf, int sendcount, tMPI_Datatype sendtype,
                             tMPI_Test, etc.
     \return  TMPI_SUCCESS on success, TMPI_FAILURE on failure.  */
 TMPI_EXPORT
-int tMPI_Isend(void* buf, int count, tMPI_Datatype datatype, int dest,
+int tMPI_Isend(const void* buf, int count, tMPI_Datatype datatype, int dest,
                int tag, tMPI_Comm comm, tMPI_Request *request);
 
 /** Initiate receiving a message.
@@ -1164,7 +1164,7 @@ int tMPI_Bcast(void* buffer, int count, tMPI_Datatype datatype, int root,
 
     \return  TMPI_SUCCESS on success, TMPI_FAILURE on failure.  */
 TMPI_EXPORT
-int tMPI_Gather(void* sendbuf, int sendcount, tMPI_Datatype sendtype,
+int tMPI_Gather(const void* sendbuf, int sendcount, tMPI_Datatype sendtype,
                 void* recvbuf, int recvcount, tMPI_Datatype recvtype, int root,
                 tMPI_Comm comm);
 
@@ -1189,7 +1189,7 @@ int tMPI_Gather(void* sendbuf, int sendcount, tMPI_Datatype sendtype,
 
     \return  TMPI_SUCCESS on success, TMPI_FAILURE on failure.  */
 TMPI_EXPORT
-int tMPI_Gatherv(void* sendbuf, int sendcount, tMPI_Datatype sendtype,
+int tMPI_Gatherv(const void* sendbuf, int sendcount, tMPI_Datatype sendtype,
                  void* recvbuf, int *recvcounts, int *displs,
                  tMPI_Datatype recvtype, int root, tMPI_Comm comm);
 
@@ -1212,7 +1212,7 @@ int tMPI_Gatherv(void* sendbuf, int sendcount, tMPI_Datatype sendtype,
 
     \return  TMPI_SUCCESS on success, TMPI_FAILURE on failure.  */
 TMPI_EXPORT
-int tMPI_Scatter(void* sendbuf, int sendcount, tMPI_Datatype sendtype,
+int tMPI_Scatter(const void* sendbuf, int sendcount, tMPI_Datatype sendtype,
                  void* recvbuf, int recvcount, tMPI_Datatype recvtype, int root,
                  tMPI_Comm comm);
 
@@ -1237,7 +1237,7 @@ int tMPI_Scatter(void* sendbuf, int sendcount, tMPI_Datatype sendtype,
 
     \return  TMPI_SUCCESS on success, TMPI_FAILURE on failure.  */
 TMPI_EXPORT
-int tMPI_Scatterv(void* sendbuf, int *sendcounts, int *displs,
+int tMPI_Scatterv(const void* sendbuf, int *sendcounts, int *displs,
                   tMPI_Datatype sendtype, void* recvbuf, int recvcount,
                   tMPI_Datatype recvtype, int root, tMPI_Comm comm);
 
index 54e91bf69b64430ad336ed53cd82d0eba9b529c8..ca928a197aa1c91665616cab49f36ce1e2778255 100644 (file)
@@ -2,7 +2,7 @@
    This source code file is part of thread_mpi.
    Written by Sander Pronk, Erik Lindahl, and possibly others.
 
-   Copyright (c) 2009, Sander Pronk, Erik Lindahl.
+   Copyright (c) 2009,2016, Sander Pronk, Erik Lindahl.
    All rights reserved.
 
    Redistribution and use in source and binary forms, with or without
@@ -58,7 +58,7 @@
 #include "collective.h"
 
 
-int tMPI_Gather(void* sendbuf, int sendcount, tMPI_Datatype sendtype,
+int tMPI_Gather(const void* sendbuf, int sendcount, tMPI_Datatype sendtype,
                 void* recvbuf, int recvcount, tMPI_Datatype recvtype,
                 int root, tMPI_Comm comm)
 {
@@ -96,7 +96,7 @@ int tMPI_Gather(void* sendbuf, int sendcount, tMPI_Datatype sendtype,
             tMPI_Coll_root_xfer(comm, sendtype, recvtype,
                                 sendtype->size*sendcount,
                                 recvtype->size*recvcount,
-                                sendbuf,
+                                (void*)sendbuf,
                                 (char*)recvbuf+myrank*recvcount*recvtype->size,
                                 &ret);
         }
@@ -146,7 +146,7 @@ int tMPI_Gather(void* sendbuf, int sendcount, tMPI_Datatype sendtype,
 
         /* first set up the data just to root. */
         ret = tMPI_Post_multi(cev, myrank, 0, TMPI_GATHER_TAG, sendtype,
-                              sendcount*sendtype->size, sendbuf, 1, synct, root);
+                              sendcount*sendtype->size, (void*)sendbuf, 1, synct, root);
         if (ret != TMPI_SUCCESS)
         {
             return ret;
@@ -165,7 +165,7 @@ int tMPI_Gather(void* sendbuf, int sendcount, tMPI_Datatype sendtype,
 
 
 
-int tMPI_Gatherv(void* sendbuf, int sendcount, tMPI_Datatype sendtype,
+int tMPI_Gatherv(const void* sendbuf, int sendcount, tMPI_Datatype sendtype,
                  void* recvbuf, int *recvcounts, int *displs,
                  tMPI_Datatype recvtype, int root, tMPI_Comm comm)
 {
@@ -203,7 +203,7 @@ int tMPI_Gatherv(void* sendbuf, int sendcount, tMPI_Datatype sendtype,
             tMPI_Coll_root_xfer(comm, sendtype, recvtype,
                                 sendtype->size*sendcount,
                                 recvtype->size*recvcounts[myrank],
-                                sendbuf,
+                                (void*)sendbuf,
                                 (char*)recvbuf+displs[myrank]*recvtype->size,
                                 &ret);
         }
@@ -252,7 +252,7 @@ int tMPI_Gatherv(void* sendbuf, int sendcount, tMPI_Datatype sendtype,
 
         /* first set up the data just to root. */
         ret = tMPI_Post_multi(cev, myrank, 0, TMPI_GATHERV_TAG, sendtype,
-                              sendcount*sendtype->size, sendbuf, 1, synct, root);
+                              sendcount*sendtype->size, (void*)sendbuf, 1, synct, root);
         if (ret != TMPI_SUCCESS)
         {
             return ret;
index 3d0379cac7fc6b328dd2f930ce69ef747d9e473a..d3a2dcad7e91633690595747c0214b6d830471a3 100644 (file)
@@ -2,7 +2,7 @@
    This source code file is part of thread_mpi.
    Written by Sander Pronk, Erik Lindahl, and possibly others.
 
-   Copyright (c) 2009, Sander Pronk, Erik Lindahl.
+   Copyright (c) 2009,2016, Sander Pronk, Erik Lindahl.
    All rights reserved.
 
    Redistribution and use in source and binary forms, with or without
@@ -61,7 +61,7 @@
 
 /* point-to-point communication exported functions */
 
-int tMPI_Send(void* buf, int count, tMPI_Datatype datatype, int dest,
+int tMPI_Send(const void* buf, int count, tMPI_Datatype datatype, int dest,
               int tag, tMPI_Comm comm)
 {
     struct envelope    *sev;
@@ -86,7 +86,7 @@ int tMPI_Send(void* buf, int count, tMPI_Datatype datatype, int dest,
         return tMPI_Error(comm, TMPI_ERR_SEND_DEST);
     }
 
-    sev = tMPI_Post_send(cur, comm, send_dst, buf, count, datatype, tag, FALSE);
+    sev = tMPI_Post_send(cur, comm, send_dst, (void*)buf, count, datatype, tag, FALSE);
     if (sev == NULL)
     {
         return TMPI_ERR_ENVELOPES;
@@ -152,7 +152,7 @@ int tMPI_Recv(void* buf, int count, tMPI_Datatype datatype, int source,
 
 
 
-int tMPI_Sendrecv(void *sendbuf, int sendcount, tMPI_Datatype sendtype,
+int tMPI_Sendrecv(const void *sendbuf, int sendcount, tMPI_Datatype sendtype,
                   int dest, int sendtag, void *recvbuf, int recvcount,
                   tMPI_Datatype recvtype, int source, int recvtag,
                   tMPI_Comm comm, tMPI_Status *status)
@@ -191,7 +191,7 @@ int tMPI_Sendrecv(void *sendbuf, int sendcount, tMPI_Datatype sendtype,
     }
 
     /* we first prepare to send */
-    sev = tMPI_Post_send(cur, comm, send_dst, sendbuf, sendcount,
+    sev = tMPI_Post_send(cur, comm, send_dst, (void*)sendbuf, sendcount,
                          sendtype, sendtag, FALSE);
     if (sev == NULL)
     {
@@ -244,7 +244,7 @@ int tMPI_Sendrecv(void *sendbuf, int sendcount, tMPI_Datatype sendtype,
 
 /* async */
 
-int tMPI_Isend(void* buf, int count, tMPI_Datatype datatype, int dest,
+int tMPI_Isend(const void* buf, int count, tMPI_Datatype datatype, int dest,
                int tag, tMPI_Comm comm, tMPI_Request *request)
 {
     struct tmpi_thread *cur = tMPI_Get_current();
@@ -271,7 +271,7 @@ int tMPI_Isend(void* buf, int count, tMPI_Datatype datatype, int dest,
         tMPI_Return_req(rql, rq);
         return tMPI_Error(comm, TMPI_ERR_SEND_DEST);
     }
-    ev = tMPI_Post_send(cur, comm, send_dst, buf, count, datatype, tag, TRUE);
+    ev = tMPI_Post_send(cur, comm, send_dst, (void*)buf, count, datatype, tag, TRUE);
     if (ev == NULL)
     {
         return TMPI_ERR_ENVELOPES;
index 0c34919e7516cdd8a9123eb7d7ac3e1b06686843..9ead64079f3b342dc9feec74ff8f4d7898445fe0 100644 (file)
@@ -498,6 +498,10 @@ int tMPI_Thread_mutex_trylock(tMPI_Thread_mutex_t *mtx)
     }
 
     ret = pthread_mutex_trylock(&(mtx->mutex->mtx));
+    /* ret is zero when the lock was available and is now held, and
+       non-zero when any thread (including this one) held the lock
+       already. This is because the default pthreads mutex is not
+       re-entrant. */
     return ret;
 }
 
index 807f85a3959255e769b1bd306cf59c7dbace76aa..03117a34b977c75529c8fb0216b105ba791e65bf 100644 (file)
@@ -2,7 +2,7 @@
    This source code file is part of thread_mpi.
    Written by Sander Pronk, Erik Lindahl, and possibly others.
 
-   Copyright (c) 2009, Sander Pronk, Erik Lindahl.
+   Copyright (c) 2009,2016, Sander Pronk, Erik Lindahl.
    All rights reserved.
 
    Redistribution and use in source and binary forms, with or without
@@ -59,7 +59,7 @@
 
 
 
-int tMPI_Scatter(void* sendbuf, int sendcount, tMPI_Datatype sendtype,
+int tMPI_Scatter(const void* sendbuf, int sendcount, tMPI_Datatype sendtype,
                  void* recvbuf, int recvcount, tMPI_Datatype recvtype,
                  int root, tMPI_Comm comm)
 {
@@ -195,7 +195,7 @@ int tMPI_Scatter(void* sendbuf, int sendcount, tMPI_Datatype sendtype,
 
 
 
-int tMPI_Scatterv(void* sendbuf, int *sendcounts, int *displs,
+int tMPI_Scatterv(const void* sendbuf, int *sendcounts, int *displs,
                   tMPI_Datatype sendtype, void* recvbuf, int recvcount,
                   tMPI_Datatype recvtype, int root, tMPI_Comm comm)
 {
index 98a06ace802ffdc4f7a18cc09cd69394b117fc29..2457de652604bbb947f54051661bbf62fded09a7 100644 (file)
@@ -1044,8 +1044,11 @@ int tMPI_Thread_mutex_trylock(tMPI_Thread_mutex_t *mtx)
 
     /* The mutex is now guaranteed to be valid. */
     ret = TryEnterCriticalSection( &(mtx->mutex->cs) );
-
-    return (ret != 0);
+    /* ret is zero if another thread owns the critical section, and
+       non-zero when the critical section was available and is now
+       held OR the critical section was already owned by this
+       thread. By default Windows critical sections are re-entrant. */
+    return (ret == 0);
 }
 
 
index 7083a89a63c149027019d600f94e3a09f6fc62c7..e53ac5691c6b9a360993f76568fec8457bd46982 100755 (executable)
@@ -30,6 +30,10 @@ distribution.
 #   include <cstddef>
 #endif
 
+#if defined(__GNUC__) && __GNUC__>=7
+#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
+#endif
+
 static const char LINE_FEED                            = (char)0x0a;                   // all line endings are normalized to LF
 static const char LF = LINE_FEED;
 static const char CARRIAGE_RETURN              = (char)0x0d;                   // CR gets filtered out
index 5a7432cd8289df56f68625fa951699dae6e8287c..30d8b1935934bd8c9419a463b4ff4c29215fc96f 100644 (file)
@@ -1,13 +1,16 @@
 set(TNG_ROOT_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR})
 file(RELATIVE_PATH TNG_ROOT_BINARY_DIR ${CMAKE_SOURCE_DIR} ${TNG_ROOT_SOURCE_DIR})
+if ("${TNG_ROOT_BINARY_DIR}" MATCHES "^\.\.")
+    set(TNG_ROOT_BINARY_DIR tng)
+endif()
 set(TNG_ROOT_BINARY_DIR ${CMAKE_BINARY_DIR}/${TNG_ROOT_BINARY_DIR})
 
 function (TNG_GENERATE_VERSION_H)
     set(TNG_MAJOR_VERSION "1")
-    set(TNG_MINOR_VERSION "7")
-    set(TNG_VERSION_PATCH_LEVEL "6")
+    set(TNG_MINOR_VERSION "8")
+    set(TNG_VERSION_PATCH_LEVEL "0")
     set(TNG_IO_VERSION "${TNG_MAJOR_VERSION}.${TNG_MINOR_VERSION}.${TNG_VERSION_PATCH_LEVEL}")
-    set(TNG_API_VERSION "7")
+    set(TNG_API_VERSION "8")
     configure_file(${TNG_ROOT_SOURCE_DIR}/include/tng/version.h.in
                    ${TNG_ROOT_BINARY_DIR}/include/tng/version.h)
 
@@ -15,52 +18,86 @@ function (TNG_GENERATE_VERSION_H)
     set(TNG_IO_VERSION ${TNG_IO_VERSION} PARENT_SCOPE)
 endfunction()
 
-tng_generate_version_h()
-
 include(TestBigEndian)
 test_big_endian(TNG_INTEGER_BIG_ENDIAN)
 include(CheckIncludeFile)
 check_include_file(inttypes.h TNG_HAVE_INTTYPES_H)
+include(CMakeParseArguments)
+
+function(add_tng_io_library NAME)
+    tng_generate_version_h()
 
-macro(TNG_GET_SOURCE_LIST TNG_SOURCELIST TNG_COMPILEDEFS)
-    include_directories(BEFORE ${TNG_ROOT_SOURCE_DIR}/include)
-    include_directories(BEFORE ${TNG_ROOT_BINARY_DIR}/include)
-    set(_tng_compression_sources bwlzh.c bwt.c coder.c dict.c fixpoint.c huffman.c huffmem.c lz77.c merge_sort.c mtf.c rle.c tng_compress.c vals16.c warnmalloc.c widemuldiv.c xtc2.c xtc3.c)
+    set(_tng_compression_sources
+        bwlzh.c bwt.c coder.c dict.c fixpoint.c huffman.c huffmem.c
+        lz77.c merge_sort.c mtf.c rle.c tng_compress.c vals16.c
+        warnmalloc.c widemuldiv.c xtc2.c xtc3.c)
     set(_tng_io_sources tng_io.c md5.c)
-    set(${TNG_SOURCELIST})
-    set(${TNG_COMPILEDEFS})
+    set(_sources)
     foreach(_file ${_tng_compression_sources})
-        list(APPEND ${TNG_SOURCELIST} ${TNG_ROOT_SOURCE_DIR}/src/compression/${_file})
+        list(APPEND _sources ${TNG_ROOT_SOURCE_DIR}/src/compression/${_file})
     endforeach()
     foreach(_file ${_tng_io_sources})
-        list(APPEND ${TNG_SOURCELIST} ${TNG_ROOT_SOURCE_DIR}/src/lib/${_file})
+        list(APPEND _sources ${TNG_ROOT_SOURCE_DIR}/src/lib/${_file})
     endforeach()
     if(TNG_BUILD_FORTRAN)
-      list(APPEND ${TNG_SOURCELIST} ${TNG_ROOT_SOURCE_DIR}/src/lib/tng_io_fortran.c)
+        list(APPEND _sources ${TNG_ROOT_SOURCE_DIR}/src/lib/tng_io_fortran.c)
     endif()
-    if (TNG_HAVE_INTTYPES_H)
-        list(APPEND ${TNG_COMPILEDEFS} USE_STD_INTTYPES_H)
+
+    set(_options OBJECT OWN_ZLIB)
+    cmake_parse_arguments(ARG "${_options}" "" "" ${ARGN})
+
+    set(_build_target ${NAME})
+    set(_link_type PRIVATE)
+    if (ARG_OBJECT)
+        set(_build_target tng_io_obj)
+        set(_link_type INTERFACE)
+        add_library(${_build_target} OBJECT ${_sources})
+        # PIC is only on by default for SHARED libraries, but in case the
+        # object library is going to get used in such a library, the objects
+        # should be compiled with PIC as well.
+        if (BUILD_SHARED_LIBS)
+            set_target_properties(${_build_target} PROPERTIES POSITION_INDEPENDENT_CODE ON)
+        endif()
+        add_library(${NAME} INTERFACE)
+        target_sources(${NAME} INTERFACE $<TARGET_OBJECTS:tng_io_obj>)
+    else()
+        add_library(${NAME} ${_sources})
+        set_target_properties(${NAME} PROPERTIES
+                              VERSION ${TNG_IO_VERSION}
+                              SOVERSION ${TNG_MAJOR_VERSION})
+        target_include_directories(${NAME} INTERFACE $<INSTALL_INTERFACE:include>)
     endif()
-endmacro()
+    target_include_directories(${_build_target} PRIVATE
+                               $<BUILD_INTERFACE:${TNG_ROOT_SOURCE_DIR}/include>
+                               $<BUILD_INTERFACE:${TNG_ROOT_BINARY_DIR}/include>)
+    target_include_directories(${NAME} INTERFACE
+                               $<BUILD_INTERFACE:${TNG_ROOT_SOURCE_DIR}/include>
+                               $<BUILD_INTERFACE:${TNG_ROOT_BINARY_DIR}/include>)
 
-macro(TNG_SET_SOURCE_PROPERTIES)
-    set(_tng_with_zlib OFF)
-    set(_curr_var)
-    foreach (_arg ${ARGN})
-        if (_arg STREQUAL "WITH_ZLIB")
-            set(_curr_var with_zlib)
-        elseif (_curr_var)
-            set(_tng_${_curr_var} ${_arg})
-            set(_curr_var "")
-        else()
-            message(FATAL_ERROR "Invalid argument ${_arg} to TNG_SET_SOURCE_PROPERTIES")
+    if (UNIX)
+        target_link_libraries(${NAME} ${_link_type} m)
+    endif()
+
+    if (ARG_OWN_ZLIB)
+        set(_zlib_dir ${TNG_ROOT_SOURCE_DIR}/external/zlib)
+        set(_zlib_sources)
+        # Add minimal necessary number of TNG source files
+        foreach(_file adler32.c compress.c crc32.c deflate.c inffast.c inflate.c inftrees.c trees.c uncompr.c zutil.c)
+            list(APPEND _zlib_sources ${_zlib_dir}/${_file})
+        endforeach()
+        add_library(tng_io_zlib OBJECT ${_zlib_sources})
+        if (BUILD_SHARED_LIBS)
+            set_target_properties(tng_io_zlib PROPERTIES POSITION_INDEPENDENT_CODE ON)
         endif()
-    endforeach()
-    if (_tng_with_zlib)
-        set_property(SOURCE ${TNG_ROOT_SOURCE_DIR}/src/lib/tng_io.c
-                     APPEND PROPERTY COMPILE_DEFINITIONS USE_ZLIB)
+        target_include_directories(tng_io_zlib PUBLIC ${_zlib_dir})
+        target_include_directories(${_build_target} PRIVATE ${_zlib_dir})
+        target_sources(${NAME} ${_link_type} $<TARGET_OBJECTS:tng_io_zlib>)
+    else()
+        target_link_libraries(${NAME} ${_link_type} ZLIB::ZLIB)
     endif()
+
     if (TNG_HAVE_INTTYPES_H)
+        target_compile_definitions(${NAME} INTERFACE USE_STD_INTTYPES_H)
         set_property(SOURCE ${TNG_ROOT_SOURCE_DIR}/src/lib/tng_io.c
                      APPEND PROPERTY COMPILE_DEFINITIONS USE_STD_INTTYPES_H)
     endif()
@@ -68,4 +105,4 @@ macro(TNG_SET_SOURCE_PROPERTIES)
         set_property(SOURCE ${TNG_ROOT_SOURCE_DIR}/src/lib/md5.c
                      APPEND PROPERTY COMPILE_DEFINITIONS TNG_INTEGER_BIG_ENDIAN)
     endif()
-endmacro()
+endfunction()
index 87c10be8be43ef8f6fdda77ec6536a176f62711f..0fb5be3a9dbc8840276eca152ebb000b48f6eb53 100644 (file)
@@ -1,8 +1,7 @@
-cmake_minimum_required(VERSION 2.8.8)
+cmake_minimum_required(VERSION 3.1)
 
 project(TNG_IO)
 
-
 if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
     set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall")
 elseif(WIN32)
@@ -10,6 +9,7 @@ elseif(WIN32)
 endif()
 
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
 
 option(BUILD_SHARED_LIBS "Enable shared libraries" ON)
@@ -20,53 +20,47 @@ option(TNG_BUILD_EXAMPLES "Build examples showing usage of the TNG API" ON)
 option(TNG_BUILD_TEST "Build TNG testing binary." ON)
 option(TNG_BUILD_COMPRESSION_TESTS "Build tests of the TNG compression library" OFF)
 
-find_package(ZLIB QUIET)
-option(TNG_BUILD_WITH_ZLIB "Build TNG with zlib compression" ${ZLIB_FOUND})
+option(TNG_BUILD_OWN_ZLIB "Build and use the internal zlib library" OFF)
+if(NOT TNG_BUILD_OWN_ZLIB)
+  find_package(ZLIB QUIET)
+endif()
 
 include(CheckIncludeFile)
 check_include_file(inttypes.h   HAVE_INTTYPES_H)
 
 include(BuildTNG.cmake)
-tng_get_source_list(TNG_SOURCES TNG_COMPILE_DEFS)
-
-tng_set_source_properties(WITH_ZLIB ${ZLIB_FOUND})
-
-add_library(tng_io ${TNG_SOURCES})
-
-if (ZLIB_FOUND)
-  list(APPEND EXTRA_LIBRARIES ${ZLIB_LIBRARIES})
-  include_directories(${ZLIB_INCLUDE_DIRS})
-endif()
-
-if (UNIX)
-  list(APPEND EXTRA_LIBRARIES m)
+if (ZLIB_FOUND AND NOT TNG_BUILD_OWN_ZLIB)
+  add_tng_io_library(tng_io)
+else()
+  add_tng_io_library(tng_io OWN_ZLIB)
 endif()
 
-target_link_libraries(tng_io ${EXTRA_LIBRARIES})
-
-set_target_properties(tng_io PROPERTIES VERSION ${TNG_IO_VERSION} SOVERSION ${TNG_MAJOR_VERSION})
+# Use GNUInstallDirs to set paths on multiarch systems
+include(GNUInstallDirs)
 
 # Create the tng_ioConfig.cmake and tng_ioConfigVersion.cmake files for the install tree
-set(CONF_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/include")
 configure_file(              src/lib/tng_io-config.cmake.in
   "${CMAKE_CURRENT_BINARY_DIR}/cmake/tng_io-config.cmake" @ONLY)
 configure_file(              src/lib/tng_io-configVersion.cmake.in
   "${CMAKE_CURRENT_BINARY_DIR}/cmake/tng_io-configVersion.cmake" @ONLY)
 
-# Use GNUInstallDirst to set paths on multiarch systems
-include(GNUInstallDirs)
+install(TARGETS tng_io
+        EXPORT tng_io
+        LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+        ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
 
-# Install the tng_ioConfig.cmake and tng_ioConfigVersion.cmake
-install(FILES
-  "${CMAKE_CURRENT_BINARY_DIR}/cmake/tng_io-config.cmake"
-  "${CMAKE_CURRENT_BINARY_DIR}/cmake/tng_io-configVersion.cmake"
-  DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/tng_io")
+install(EXPORT tng_io FILE tng_io.cmake
+        NAMESPACE tng_io::
+        DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/tng_io")
 
-install(TARGETS tng_io
-        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
-        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+install(FILES
+        "${CMAKE_CURRENT_BINARY_DIR}/cmake/tng_io-config.cmake"
+        "${CMAKE_CURRENT_BINARY_DIR}/cmake/tng_io-configVersion.cmake"
+        DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/tng_io")
 
-install(FILES include/tng/tng_io.h include/tng/tng_io_fwd.h ${CMAKE_CURRENT_BINARY_DIR}/include/tng/version.h
+install(FILES
+        include/tng/tng_io.h include/tng/tng_io_fwd.h
+        ${CMAKE_CURRENT_BINARY_DIR}/include/tng/version.h
         DESTINATION include/tng)
 
 #-- Add an Option to toggle the generation of the API documentation
@@ -92,4 +86,3 @@ if(TNG_BUILD_DOCUMENTATION)
 endif()
 
 add_subdirectory(src)
-
diff --git a/src/external/tng_io/external/README b/src/external/tng_io/external/README
new file mode 100644 (file)
index 0000000..edff146
--- /dev/null
@@ -0,0 +1,10 @@
+The libraries included in the external directory are not supported by the TNG developers.
+
+zlib: version 1.2.8, with content not necessary for TNG build removed.
+
+Modifications within source files were
+* minor refactoring in crc32.c to make clear that some code should sometimes be unreachable
+* replacing some undefined behaviour (-1L << 16) with well defined value (~0xFFFFL) in inflate.c
+* commenting out unused zlibCompileFlags() declaration and definition
+* removing unnecessary configurability from zconf.h
+* removing #include of unused gzguts.h
diff --git a/src/external/tng_io/external/zlib/README b/src/external/tng_io/external/zlib/README
new file mode 100644 (file)
index 0000000..5ca9d12
--- /dev/null
@@ -0,0 +1,115 @@
+ZLIB DATA COMPRESSION LIBRARY
+
+zlib 1.2.8 is a general purpose data compression library.  All the code is
+thread safe.  The data format used by the zlib library is described by RFCs
+(Request for Comments) 1950 to 1952 in the files
+http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
+rfc1952 (gzip format).
+
+All functions of the compression library are documented in the file zlib.h
+(volunteer to write man pages welcome, contact zlib@gzip.org).  A usage example
+of the library is given in the file test/example.c which also tests that
+the library is working correctly.  Another example is given in the file
+test/minigzip.c.  The compression library itself is composed of all source
+files in the root directory.
+
+To compile all files and run the test program, follow the instructions given at
+the top of Makefile.in.  In short "./configure; make test", and if that goes
+well, "make install" should work for most flavors of Unix.  For Windows, use
+one of the special makefiles in win32/ or contrib/vstudio/ .  For VMS, use
+make_vms.com.
+
+Questions about zlib should be sent to <zlib@gzip.org>, or to Gilles Vollant
+<info@winimage.com> for the Windows DLL version.  The zlib home page is
+http://zlib.net/ .  Before reporting a problem, please check this site to
+verify that you have the latest version of zlib; otherwise get the latest
+version and check whether the problem still exists or not.
+
+PLEASE read the zlib FAQ http://zlib.net/zlib_faq.html before asking for help.
+
+Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan.  1997
+issue of Dr.  Dobb's Journal; a copy of the article is available at
+http://marknelson.us/1997/01/01/zlib-engine/ .
+
+The changes made in version 1.2.8 are documented in the file ChangeLog.
+
+Unsupported third party contributions are provided in directory contrib/ .
+
+zlib is available in Java using the java.util.zip package, documented at
+http://java.sun.com/developer/technicalArticles/Programming/compression/ .
+
+A Perl interface to zlib written by Paul Marquess <pmqs@cpan.org> is available
+at CPAN (Comprehensive Perl Archive Network) sites, including
+http://search.cpan.org/~pmqs/IO-Compress-Zlib/ .
+
+A Python interface to zlib written by A.M. Kuchling <amk@amk.ca> is
+available in Python 1.5 and later versions, see
+http://docs.python.org/library/zlib.html .
+
+zlib is built into tcl: http://wiki.tcl.tk/4610 .
+
+An experimental package to read and write files in .zip format, written on top
+of zlib by Gilles Vollant <info@winimage.com>, is available in the
+contrib/minizip directory of zlib.
+
+
+Notes for some targets:
+
+- For Windows DLL versions, please see win32/DLL_FAQ.txt
+
+- For 64-bit Irix, deflate.c must be compiled without any optimization. With
+  -O, one libpng test fails. The test works in 32 bit mode (with the -n32
+  compiler flag). The compiler bug has been reported to SGI.
+
+- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1 it works
+  when compiled with cc.
+
+- On Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1 is
+  necessary to get gzprintf working correctly. This is done by configure.
+
+- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with
+  other compilers. Use "make test" to check your compiler.
+
+- gzdopen is not supported on RISCOS or BEOS.
+
+- For PalmOs, see http://palmzlib.sourceforge.net/
+
+
+Acknowledgments:
+
+  The deflate format used by zlib was defined by Phil Katz.  The deflate and
+  zlib specifications were written by L.  Peter Deutsch.  Thanks to all the
+  people who reported problems and suggested various improvements in zlib; they
+  are too numerous to cite here.
+
+Copyright notice:
+
+ (C) 1995-2013 Jean-loup Gailly and Mark Adler
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+  Jean-loup Gailly        Mark Adler
+  jloup@gzip.org          madler@alumni.caltech.edu
+
+If you use the zlib library in a product, we would appreciate *not* receiving
+lengthy legal documents to sign.  The sources are provided for free but without
+warranty of any kind.  The library has been entirely written by Jean-loup
+Gailly and Mark Adler; it does not include third-party code.
+
+If you redistribute modified sources, we would appreciate that you include in
+the file ChangeLog history information documenting your changes.  Please read
+the FAQ for more information on the distribution of modified source versions.
diff --git a/src/external/tng_io/external/zlib/adler32.c b/src/external/tng_io/external/zlib/adler32.c
new file mode 100644 (file)
index 0000000..a868f07
--- /dev/null
@@ -0,0 +1,179 @@
+/* adler32.c -- compute the Adler-32 checksum of a data stream
+ * Copyright (C) 1995-2011 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#include "zutil.h"
+
+#define local static
+
+local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
+
+#define BASE 65521      /* largest prime smaller than 65536 */
+#define NMAX 5552
+/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
+
+#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
+#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
+#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
+#define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
+#define DO16(buf)   DO8(buf,0); DO8(buf,8);
+
+/* use NO_DIVIDE if your processor does not do division in hardware --
+   try it both ways to see which is faster */
+#ifdef NO_DIVIDE
+/* note that this assumes BASE is 65521, where 65536 % 65521 == 15
+   (thank you to John Reiser for pointing this out) */
+#  define CHOP(a) \
+    do { \
+        unsigned long tmp = a >> 16; \
+        a &= 0xffffUL; \
+        a += (tmp << 4) - tmp; \
+    } while (0)
+#  define MOD28(a) \
+    do { \
+        CHOP(a); \
+        if (a >= BASE) a -= BASE; \
+    } while (0)
+#  define MOD(a) \
+    do { \
+        CHOP(a); \
+        MOD28(a); \
+    } while (0)
+#  define MOD63(a) \
+    do { /* this assumes a is not negative */ \
+        z_off64_t tmp = a >> 32; \
+        a &= 0xffffffffL; \
+        a += (tmp << 8) - (tmp << 5) + tmp; \
+        tmp = a >> 16; \
+        a &= 0xffffL; \
+        a += (tmp << 4) - tmp; \
+        tmp = a >> 16; \
+        a &= 0xffffL; \
+        a += (tmp << 4) - tmp; \
+        if (a >= BASE) a -= BASE; \
+    } while (0)
+#else
+#  define MOD(a) a %= BASE
+#  define MOD28(a) a %= BASE
+#  define MOD63(a) a %= BASE
+#endif
+
+/* ========================================================================= */
+uLong ZEXPORT adler32(adler, buf, len)
+    uLong adler;
+    const Bytef *buf;
+    uInt len;
+{
+    unsigned long sum2;
+    unsigned n;
+
+    /* split Adler-32 into component sums */
+    sum2 = (adler >> 16) & 0xffff;
+    adler &= 0xffff;
+
+    /* in case user likes doing a byte at a time, keep it fast */
+    if (len == 1) {
+        adler += buf[0];
+        if (adler >= BASE)
+            adler -= BASE;
+        sum2 += adler;
+        if (sum2 >= BASE)
+            sum2 -= BASE;
+        return adler | (sum2 << 16);
+    }
+
+    /* initial Adler-32 value (deferred check for len == 1 speed) */
+    if (buf == Z_NULL)
+        return 1L;
+
+    /* in case short lengths are provided, keep it somewhat fast */
+    if (len < 16) {
+        while (len--) {
+            adler += *buf++;
+            sum2 += adler;
+        }
+        if (adler >= BASE)
+            adler -= BASE;
+        MOD28(sum2);            /* only added so many BASE's */
+        return adler | (sum2 << 16);
+    }
+
+    /* do length NMAX blocks -- requires just one modulo operation */
+    while (len >= NMAX) {
+        len -= NMAX;
+        n = NMAX / 16;          /* NMAX is divisible by 16 */
+        do {
+            DO16(buf);          /* 16 sums unrolled */
+            buf += 16;
+        } while (--n);
+        MOD(adler);
+        MOD(sum2);
+    }
+
+    /* do remaining bytes (less than NMAX, still just one modulo) */
+    if (len) {                  /* avoid modulos if none remaining */
+        while (len >= 16) {
+            len -= 16;
+            DO16(buf);
+            buf += 16;
+        }
+        while (len--) {
+            adler += *buf++;
+            sum2 += adler;
+        }
+        MOD(adler);
+        MOD(sum2);
+    }
+
+    /* return recombined sums */
+    return adler | (sum2 << 16);
+}
+
+/* ========================================================================= */
+local uLong adler32_combine_(adler1, adler2, len2)
+    uLong adler1;
+    uLong adler2;
+    z_off64_t len2;
+{
+    unsigned long sum1;
+    unsigned long sum2;
+    unsigned rem;
+
+    /* for negative len, return invalid adler32 as a clue for debugging */
+    if (len2 < 0)
+        return 0xffffffffUL;
+
+    /* the derivation of this formula is left as an exercise for the reader */
+    MOD63(len2);                /* assumes len2 >= 0 */
+    rem = (unsigned)len2;
+    sum1 = adler1 & 0xffff;
+    sum2 = rem * sum1;
+    MOD(sum2);
+    sum1 += (adler2 & 0xffff) + BASE - 1;
+    sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
+    if (sum1 >= BASE) sum1 -= BASE;
+    if (sum1 >= BASE) sum1 -= BASE;
+    if (sum2 >= (BASE << 1)) sum2 -= (BASE << 1);
+    if (sum2 >= BASE) sum2 -= BASE;
+    return sum1 | (sum2 << 16);
+}
+
+/* ========================================================================= */
+uLong ZEXPORT adler32_combine(adler1, adler2, len2)
+    uLong adler1;
+    uLong adler2;
+    z_off_t len2;
+{
+    return adler32_combine_(adler1, adler2, len2);
+}
+
+uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
+    uLong adler1;
+    uLong adler2;
+    z_off64_t len2;
+{
+    return adler32_combine_(adler1, adler2, len2);
+}
diff --git a/src/external/tng_io/external/zlib/compress.c b/src/external/tng_io/external/zlib/compress.c
new file mode 100644 (file)
index 0000000..6e97626
--- /dev/null
@@ -0,0 +1,80 @@
+/* compress.c -- compress a memory buffer
+ * Copyright (C) 1995-2005 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#define ZLIB_INTERNAL
+#include "zlib.h"
+
+/* ===========================================================================
+     Compresses the source buffer into the destination buffer. The level
+   parameter has the same meaning as in deflateInit.  sourceLen is the byte
+   length of the source buffer. Upon entry, destLen is the total size of the
+   destination buffer, which must be at least 0.1% larger than sourceLen plus
+   12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
+
+     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+   Z_STREAM_ERROR if the level parameter is invalid.
+*/
+int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
+    Bytef *dest;
+    uLongf *destLen;
+    const Bytef *source;
+    uLong sourceLen;
+    int level;
+{
+    z_stream stream;
+    int err;
+
+    stream.next_in = (z_const Bytef *)source;
+    stream.avail_in = (uInt)sourceLen;
+#ifdef MAXSEG_64K
+    /* Check for source > 64K on 16-bit machine: */
+    if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
+#endif
+    stream.next_out = dest;
+    stream.avail_out = (uInt)*destLen;
+    if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
+
+    stream.zalloc = (alloc_func)0;
+    stream.zfree = (free_func)0;
+    stream.opaque = (voidpf)0;
+
+    err = deflateInit(&stream, level);
+    if (err != Z_OK) return err;
+
+    err = deflate(&stream, Z_FINISH);
+    if (err != Z_STREAM_END) {
+        deflateEnd(&stream);
+        return err == Z_OK ? Z_BUF_ERROR : err;
+    }
+    *destLen = stream.total_out;
+
+    err = deflateEnd(&stream);
+    return err;
+}
+
+/* ===========================================================================
+ */
+int ZEXPORT compress (dest, destLen, source, sourceLen)
+    Bytef *dest;
+    uLongf *destLen;
+    const Bytef *source;
+    uLong sourceLen;
+{
+    return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
+}
+
+/* ===========================================================================
+     If the default memLevel or windowBits for deflateInit() is changed, then
+   this function needs to be updated.
+ */
+uLong ZEXPORT compressBound (sourceLen)
+    uLong sourceLen;
+{
+    return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
+           (sourceLen >> 25) + 13;
+}
diff --git a/src/external/tng_io/external/zlib/crc32.c b/src/external/tng_io/external/zlib/crc32.c
new file mode 100644 (file)
index 0000000..e513833
--- /dev/null
@@ -0,0 +1,430 @@
+/* crc32.c -- compute the CRC-32 of a data stream
+ * Copyright (C) 1995-2006, 2010, 2011, 2012 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ *
+ * Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster
+ * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing
+ * tables for updating the shift register in one step with three exclusive-ors
+ * instead of four steps with four exclusive-ors.  This results in about a
+ * factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3.
+ */
+
+/* @(#) $Id$ */
+
+/*
+  Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore
+  protection on the static variables used to control the first-use generation
+  of the crc tables.  Therefore, if you #define DYNAMIC_CRC_TABLE, you should
+  first call get_crc_table() to initialize the tables before allowing more than
+  one thread to use crc32().
+
+  DYNAMIC_CRC_TABLE and MAKECRCH can be #defined to write out crc32.h.
+ */
+
+#ifdef MAKECRCH
+#  include <stdio.h>
+#  ifndef DYNAMIC_CRC_TABLE
+#    define DYNAMIC_CRC_TABLE
+#  endif /* !DYNAMIC_CRC_TABLE */
+#endif /* MAKECRCH */
+
+#include "zutil.h"      /* for STDC and FAR definitions */
+
+#define local static
+
+/* Definitions for doing the crc four data bytes at a time. */
+#if !defined(NOBYFOUR) && defined(Z_U4)
+#  define BYFOUR
+#endif
+#ifdef BYFOUR
+   local unsigned long crc32_little OF((unsigned long,
+                        const unsigned char FAR *, unsigned));
+   local unsigned long crc32_big OF((unsigned long,
+                        const unsigned char FAR *, unsigned));
+#  define TBLS 8
+#else
+#  define TBLS 1
+#endif /* BYFOUR */
+
+/* Local functions for crc concatenation */
+local unsigned long gf2_matrix_times OF((unsigned long *mat,
+                                         unsigned long vec));
+local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat));
+local uLong crc32_combine_ OF((uLong crc1, uLong crc2, z_off64_t len2));
+
+
+#ifdef DYNAMIC_CRC_TABLE
+
+local volatile int crc_table_empty = 1;
+local z_crc_t FAR crc_table[TBLS][256];
+local void make_crc_table OF((void));
+#ifdef MAKECRCH
+   local void write_table OF((FILE *, const z_crc_t FAR *));
+#endif /* MAKECRCH */
+/*
+  Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:
+  x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.
+
+  Polynomials over GF(2) are represented in binary, one bit per coefficient,
+  with the lowest powers in the most significant bit.  Then adding polynomials
+  is just exclusive-or, and multiplying a polynomial by x is a right shift by
+  one.  If we call the above polynomial p, and represent a byte as the
+  polynomial q, also with the lowest power in the most significant bit (so the
+  byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
+  where a mod b means the remainder after dividing a by b.
+
+  This calculation is done using the shift-register method of multiplying and
+  taking the remainder.  The register is initialized to zero, and for each
+  incoming bit, x^32 is added mod p to the register if the bit is a one (where
+  x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by
+  x (which is shifting right by one and adding x^32 mod p if the bit shifted
+  out is a one).  We start with the highest power (least significant bit) of
+  q and repeat for all eight bits of q.
+
+  The first table is simply the CRC of all possible eight bit values.  This is
+  all the information needed to generate CRCs on data a byte at a time for all
+  combinations of CRC register values and incoming bytes.  The remaining tables
+  allow for word-at-a-time CRC calculation for both big-endian and little-
+  endian machines, where a word is four bytes.
+*/
+local void make_crc_table()
+{
+    z_crc_t c;
+    int n, k;
+    z_crc_t poly;                       /* polynomial exclusive-or pattern */
+    /* terms of polynomial defining this crc (except x^32): */
+    static volatile int first = 1;      /* flag to limit concurrent making */
+    static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
+
+    /* See if another task is already doing this (not thread-safe, but better
+       than nothing -- significantly reduces duration of vulnerability in
+       case the advice about DYNAMIC_CRC_TABLE is ignored) */
+    if (first) {
+        first = 0;
+
+        /* make exclusive-or pattern from polynomial (0xedb88320UL) */
+        poly = 0;
+        for (n = 0; n < (int)(sizeof(p)/sizeof(unsigned char)); n++)
+            poly |= (z_crc_t)1 << (31 - p[n]);
+
+        /* generate a crc for every 8-bit value */
+        for (n = 0; n < 256; n++) {
+            c = (z_crc_t)n;
+            for (k = 0; k < 8; k++)
+                c = c & 1 ? poly ^ (c >> 1) : c >> 1;
+            crc_table[0][n] = c;
+        }
+
+#ifdef BYFOUR
+        /* generate crc for each value followed by one, two, and three zeros,
+           and then the byte reversal of those as well as the first table */
+        for (n = 0; n < 256; n++) {
+            c = crc_table[0][n];
+            crc_table[4][n] = ZSWAP32(c);
+            for (k = 1; k < 4; k++) {
+                c = crc_table[0][c & 0xff] ^ (c >> 8);
+                crc_table[k][n] = c;
+                crc_table[k + 4][n] = ZSWAP32(c);
+            }
+        }
+#endif /* BYFOUR */
+
+        crc_table_empty = 0;
+    }
+    else {      /* not first */
+        /* wait for the other guy to finish (not efficient, but rare) */
+        while (crc_table_empty)
+            ;
+    }
+
+#ifdef MAKECRCH
+    /* write out CRC tables to crc32.h */
+    {
+        FILE *out;
+
+        out = fopen("crc32.h", "w");
+        if (out == NULL) return;
+        fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n");
+        fprintf(out, " * Generated automatically by crc32.c\n */\n\n");
+        fprintf(out, "local const z_crc_t FAR ");
+        fprintf(out, "crc_table[TBLS][256] =\n{\n  {\n");
+        write_table(out, crc_table[0]);
+#  ifdef BYFOUR
+        fprintf(out, "#ifdef BYFOUR\n");
+        for (k = 1; k < 8; k++) {
+            fprintf(out, "  },\n  {\n");
+            write_table(out, crc_table[k]);
+        }
+        fprintf(out, "#endif\n");
+#  endif /* BYFOUR */
+        fprintf(out, "  }\n};\n");
+        fclose(out);
+    }
+#endif /* MAKECRCH */
+}
+
+#ifdef MAKECRCH
+local void write_table(out, table)
+    FILE *out;
+    const z_crc_t FAR *table;
+{
+    int n;
+
+    for (n = 0; n < 256; n++)
+        fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : "    ",
+                (unsigned long)(table[n]),
+                n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", "));
+}
+#endif /* MAKECRCH */
+
+#else /* !DYNAMIC_CRC_TABLE */
+/* ========================================================================
+ * Tables of CRC-32s of all single-byte values, made by make_crc_table().
+ */
+#include "crc32.h"
+#endif /* DYNAMIC_CRC_TABLE */
+
+/* =========================================================================
+ * This function can be used by asm versions of crc32()
+ */
+const z_crc_t FAR * ZEXPORT get_crc_table()
+{
+#ifdef DYNAMIC_CRC_TABLE
+    if (crc_table_empty)
+        make_crc_table();
+#endif /* DYNAMIC_CRC_TABLE */
+    return (const z_crc_t FAR *)crc_table;
+}
+
+/* ========================================================================= */
+#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8)
+#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1
+
+/* ========================================================================= */
+unsigned long ZEXPORT crc32(crc, buf, len)
+    unsigned long crc;
+    const unsigned char FAR *buf;
+    uInt len;
+{
+    if (buf == Z_NULL) return 0UL;
+
+#ifdef DYNAMIC_CRC_TABLE
+    if (crc_table_empty)
+        make_crc_table();
+#endif /* DYNAMIC_CRC_TABLE */
+
+#ifdef BYFOUR
+    if (sizeof(void *) == sizeof(ptrdiff_t)) {
+        z_crc_t endian;
+
+        endian = 1;
+        if (*((unsigned char *)(&endian)))
+            return crc32_little(crc, buf, len);
+        else
+            return crc32_big(crc, buf, len);
+    }
+    /* Minor modifications follow that make clear to compilers that
+     * it is intended that some code is unreachable. */
+    else
+#endif /* BYFOUR */
+    {
+        crc = crc ^ 0xffffffffUL;
+        while (len >= 8) {
+            DO8;
+            len -= 8;
+        }
+        if (len) do {
+                DO1;
+            } while (--len);
+        return crc ^ 0xffffffffUL;
+    }
+}
+
+#ifdef BYFOUR
+
+/* ========================================================================= */
+#define DOLIT4 c ^= *buf4++; \
+        c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \
+            crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24]
+#define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4
+
+/* ========================================================================= */
+local unsigned long crc32_little(crc, buf, len)
+    unsigned long crc;
+    const unsigned char FAR *buf;
+    unsigned len;
+{
+    register z_crc_t c;
+    register const z_crc_t FAR *buf4;
+
+    c = (z_crc_t)crc;
+    c = ~c;
+    while (len && ((ptrdiff_t)buf & 3)) {
+        c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
+        len--;
+    }
+
+    buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
+    while (len >= 32) {
+        DOLIT32;
+        len -= 32;
+    }
+    while (len >= 4) {
+        DOLIT4;
+        len -= 4;
+    }
+    buf = (const unsigned char FAR *)buf4;
+
+    if (len) do {
+        c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
+    } while (--len);
+    c = ~c;
+    return (unsigned long)c;
+}
+
+/* ========================================================================= */
+#define DOBIG4 c ^= *++buf4; \
+        c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \
+            crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24]
+#define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4
+
+/* ========================================================================= */
+local unsigned long crc32_big(crc, buf, len)
+    unsigned long crc;
+    const unsigned char FAR *buf;
+    unsigned len;
+{
+    register z_crc_t c;
+    register const z_crc_t FAR *buf4;
+
+    c = ZSWAP32((z_crc_t)crc);
+    c = ~c;
+    while (len && ((ptrdiff_t)buf & 3)) {
+        c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
+        len--;
+    }
+
+    buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
+    buf4--;
+    while (len >= 32) {
+        DOBIG32;
+        len -= 32;
+    }
+    while (len >= 4) {
+        DOBIG4;
+        len -= 4;
+    }
+    buf4++;
+    buf = (const unsigned char FAR *)buf4;
+
+    if (len) do {
+        c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
+    } while (--len);
+    c = ~c;
+    return (unsigned long)(ZSWAP32(c));
+}
+
+#endif /* BYFOUR */
+
+#define GF2_DIM 32      /* dimension of GF(2) vectors (length of CRC) */
+
+/* ========================================================================= */
+local unsigned long gf2_matrix_times(mat, vec)
+    unsigned long *mat;
+    unsigned long vec;
+{
+    unsigned long sum;
+
+    sum = 0;
+    while (vec) {
+        if (vec & 1)
+            sum ^= *mat;
+        vec >>= 1;
+        mat++;
+    }
+    return sum;
+}
+
+/* ========================================================================= */
+local void gf2_matrix_square(square, mat)
+    unsigned long *square;
+    unsigned long *mat;
+{
+    int n;
+
+    for (n = 0; n < GF2_DIM; n++)
+        square[n] = gf2_matrix_times(mat, mat[n]);
+}
+
+/* ========================================================================= */
+local uLong crc32_combine_(crc1, crc2, len2)
+    uLong crc1;
+    uLong crc2;
+    z_off64_t len2;
+{
+    int n;
+    unsigned long row;
+    unsigned long even[GF2_DIM];    /* even-power-of-two zeros operator */
+    unsigned long odd[GF2_DIM];     /* odd-power-of-two zeros operator */
+
+    /* degenerate case (also disallow negative lengths) */
+    if (len2 <= 0)
+        return crc1;
+
+    /* put operator for one zero bit in odd */
+    odd[0] = 0xedb88320UL;          /* CRC-32 polynomial */
+    row = 1;
+    for (n = 1; n < GF2_DIM; n++) {
+        odd[n] = row;
+        row <<= 1;
+    }
+
+    /* put operator for two zero bits in even */
+    gf2_matrix_square(even, odd);
+
+    /* put operator for four zero bits in odd */
+    gf2_matrix_square(odd, even);
+
+    /* apply len2 zeros to crc1 (first square will put the operator for one
+       zero byte, eight zero bits, in even) */
+    do {
+        /* apply zeros operator for this bit of len2 */
+        gf2_matrix_square(even, odd);
+        if (len2 & 1)
+            crc1 = gf2_matrix_times(even, crc1);
+        len2 >>= 1;
+
+        /* if no more bits set, then done */
+        if (len2 == 0)
+            break;
+
+        /* another iteration of the loop with odd and even swapped */
+        gf2_matrix_square(odd, even);
+        if (len2 & 1)
+            crc1 = gf2_matrix_times(odd, crc1);
+        len2 >>= 1;
+
+        /* if no more bits set, then done */
+    } while (len2 != 0);
+
+    /* return combined crc */
+    crc1 ^= crc2;
+    return crc1;
+}
+
+/* ========================================================================= */
+uLong ZEXPORT crc32_combine(crc1, crc2, len2)
+    uLong crc1;
+    uLong crc2;
+    z_off_t len2;
+{
+    return crc32_combine_(crc1, crc2, len2);
+}
+
+uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
+    uLong crc1;
+    uLong crc2;
+    z_off64_t len2;
+{
+    return crc32_combine_(crc1, crc2, len2);
+}
diff --git a/src/external/tng_io/external/zlib/crc32.h b/src/external/tng_io/external/zlib/crc32.h
new file mode 100644 (file)
index 0000000..9e0c778
--- /dev/null
@@ -0,0 +1,441 @@
+/* crc32.h -- tables for rapid CRC calculation
+ * Generated automatically by crc32.c
+ */
+
+local const z_crc_t FAR crc_table[TBLS][256] =
+{
+  {
+    0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL,
+    0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL,
+    0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL,
+    0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL,
+    0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL,
+    0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL,
+    0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL,
+    0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL,
+    0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL,
+    0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL,
+    0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL,
+    0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL,
+    0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL,
+    0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL,
+    0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL,
+    0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL,
+    0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL,
+    0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL,
+    0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL,
+    0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL,
+    0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL,
+    0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL,
+    0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL,
+    0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL,
+    0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL,
+    0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL,
+    0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL,
+    0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL,
+    0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL,
+    0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL,
+    0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL,
+    0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL,
+    0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL,
+    0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL,
+    0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL,
+    0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL,
+    0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL,
+    0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL,
+    0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL,
+    0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL,
+    0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL,
+    0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL,
+    0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL,
+    0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL,
+    0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL,
+    0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL,
+    0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL,
+    0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL,
+    0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL,
+    0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL,
+    0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL,
+    0x2d02ef8dUL
+#ifdef BYFOUR
+  },
+  {
+    0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL,
+    0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL,
+    0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL,
+    0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL,
+    0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL,
+    0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL,
+    0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL,
+    0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL,
+    0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL,
+    0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL,
+    0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL,
+    0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL,
+    0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL,
+    0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL,
+    0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL,
+    0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL,
+    0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL,
+    0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL,
+    0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL,
+    0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL,
+    0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL,
+    0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL,
+    0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL,
+    0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL,
+    0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL,
+    0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL,
+    0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL,
+    0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL,
+    0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL,
+    0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL,
+    0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL,
+    0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL,
+    0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL,
+    0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL,
+    0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL,
+    0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL,
+    0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL,
+    0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL,
+    0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL,
+    0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL,
+    0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL,
+    0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL,
+    0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL,
+    0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL,
+    0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL,
+    0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL,
+    0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL,
+    0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL,
+    0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL,
+    0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL,
+    0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL,
+    0x9324fd72UL
+  },
+  {
+    0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL,
+    0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL,
+    0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL,
+    0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL,
+    0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL,
+    0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL,
+    0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL,
+    0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL,
+    0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL,
+    0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL,
+    0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL,
+    0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL,
+    0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL,
+    0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL,
+    0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL,
+    0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL,
+    0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL,
+    0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL,
+    0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL,
+    0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL,
+    0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL,
+    0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL,
+    0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL,
+    0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL,
+    0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL,
+    0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL,
+    0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL,
+    0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL,
+    0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL,
+    0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL,
+    0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL,
+    0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL,
+    0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL,
+    0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL,
+    0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL,
+    0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL,
+    0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL,
+    0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL,
+    0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL,
+    0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL,
+    0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL,
+    0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL,
+    0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL,
+    0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL,
+    0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL,
+    0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL,
+    0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL,
+    0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL,
+    0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL,
+    0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL,
+    0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL,
+    0xbe9834edUL
+  },
+  {
+    0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL,
+    0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL,
+    0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL,
+    0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL,
+    0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL,
+    0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL,
+    0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL,
+    0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL,
+    0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL,
+    0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL,
+    0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL,
+    0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL,
+    0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL,
+    0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL,
+    0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL,
+    0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL,
+    0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL,
+    0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL,
+    0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL,
+    0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL,
+    0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL,
+    0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL,
+    0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL,
+    0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL,
+    0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL,
+    0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL,
+    0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL,
+    0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL,
+    0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL,
+    0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL,
+    0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL,
+    0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL,
+    0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL,
+    0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL,
+    0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL,
+    0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL,
+    0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL,
+    0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL,
+    0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL,
+    0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL,
+    0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL,
+    0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL,
+    0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL,
+    0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL,
+    0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL,
+    0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL,
+    0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL,
+    0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL,
+    0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL,
+    0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL,
+    0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL,
+    0xde0506f1UL
+  },
+  {
+    0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL,
+    0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL,
+    0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL,
+    0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL,
+    0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL,
+    0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL,
+    0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL,
+    0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL,
+    0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL,
+    0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL,
+    0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL,
+    0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL,
+    0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL,
+    0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL,
+    0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL,
+    0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL,
+    0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL,
+    0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL,
+    0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL,
+    0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL,
+    0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL,
+    0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL,
+    0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL,
+    0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL,
+    0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL,
+    0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL,
+    0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL,
+    0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL,
+    0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL,
+    0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL,
+    0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL,
+    0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL,
+    0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL,
+    0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL,
+    0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL,
+    0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL,
+    0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL,
+    0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL,
+    0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL,
+    0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL,
+    0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL,
+    0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL,
+    0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL,
+    0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL,
+    0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL,
+    0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL,
+    0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL,
+    0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL,
+    0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL,
+    0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL,
+    0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL,
+    0x8def022dUL
+  },
+  {
+    0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL,
+    0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL,
+    0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL,
+    0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL,
+    0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL,
+    0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL,
+    0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL,
+    0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL,
+    0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL,
+    0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL,
+    0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL,
+    0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL,
+    0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL,
+    0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL,
+    0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL,
+    0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL,
+    0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL,
+    0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL,
+    0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL,
+    0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL,
+    0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL,
+    0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL,
+    0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL,
+    0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL,
+    0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL,
+    0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL,
+    0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL,
+    0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL,
+    0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL,
+    0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL,
+    0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL,
+    0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL,
+    0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL,
+    0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL,
+    0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL,
+    0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL,
+    0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL,
+    0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL,
+    0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL,
+    0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL,
+    0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL,
+    0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL,
+    0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL,
+    0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL,
+    0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL,
+    0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL,
+    0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL,
+    0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL,
+    0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL,
+    0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL,
+    0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL,
+    0x72fd2493UL
+  },
+  {
+    0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL,
+    0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL,
+    0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL,
+    0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL,
+    0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL,
+    0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL,
+    0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL,
+    0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL,
+    0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL,
+    0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL,
+    0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL,
+    0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL,
+    0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL,
+    0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL,
+    0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL,
+    0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL,
+    0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL,
+    0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL,
+    0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL,
+    0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL,
+    0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL,
+    0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL,
+    0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL,
+    0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL,
+    0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL,
+    0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL,
+    0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL,
+    0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL,
+    0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL,
+    0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL,
+    0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL,
+    0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL,
+    0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL,
+    0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL,
+    0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL,
+    0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL,
+    0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL,
+    0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL,
+    0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL,
+    0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL,
+    0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL,
+    0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL,
+    0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL,
+    0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL,
+    0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL,
+    0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL,
+    0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL,
+    0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL,
+    0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL,
+    0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL,
+    0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL,
+    0xed3498beUL
+  },
+  {
+    0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL,
+    0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL,
+    0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL,
+    0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL,
+    0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL,
+    0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL,
+    0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL,
+    0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL,
+    0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL,
+    0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL,
+    0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL,
+    0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL,
+    0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL,
+    0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL,
+    0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL,
+    0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL,
+    0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL,
+    0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL,
+    0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL,
+    0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL,
+    0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL,
+    0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL,
+    0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL,
+    0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL,
+    0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL,
+    0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL,
+    0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL,
+    0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL,
+    0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL,
+    0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL,
+    0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL,
+    0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL,
+    0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL,
+    0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL,
+    0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL,
+    0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL,
+    0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL,
+    0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL,
+    0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL,
+    0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL,
+    0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL,
+    0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL,
+    0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL,
+    0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL,
+    0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL,
+    0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL,
+    0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL,
+    0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL,
+    0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL,
+    0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL,
+    0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL,
+    0xf10605deUL
+#endif
+  }
+};
diff --git a/src/external/tng_io/external/zlib/deflate.c b/src/external/tng_io/external/zlib/deflate.c
new file mode 100644 (file)
index 0000000..6969577
--- /dev/null
@@ -0,0 +1,1967 @@
+/* deflate.c -- compress data using the deflation algorithm
+ * Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/*
+ *  ALGORITHM
+ *
+ *      The "deflation" process depends on being able to identify portions
+ *      of the input text which are identical to earlier input (within a
+ *      sliding window trailing behind the input currently being processed).
+ *
+ *      The most straightforward technique turns out to be the fastest for
+ *      most input files: try all possible matches and select the longest.
+ *      The key feature of this algorithm is that insertions into the string
+ *      dictionary are very simple and thus fast, and deletions are avoided
+ *      completely. Insertions are performed at each input character, whereas
+ *      string matches are performed only when the previous match ends. So it
+ *      is preferable to spend more time in matches to allow very fast string
+ *      insertions and avoid deletions. The matching algorithm for small
+ *      strings is inspired from that of Rabin & Karp. A brute force approach
+ *      is used to find longer strings when a small match has been found.
+ *      A similar algorithm is used in comic (by Jan-Mark Wams) and freeze
+ *      (by Leonid Broukhis).
+ *         A previous version of this file used a more sophisticated algorithm
+ *      (by Fiala and Greene) which is guaranteed to run in linear amortized
+ *      time, but has a larger average cost, uses more memory and is patented.
+ *      However the F&G algorithm may be faster for some highly redundant
+ *      files if the parameter max_chain_length (described below) is too large.
+ *
+ *  ACKNOWLEDGEMENTS
+ *
+ *      The idea of lazy evaluation of matches is due to Jan-Mark Wams, and
+ *      I found it in 'freeze' written by Leonid Broukhis.
+ *      Thanks to many people for bug reports and testing.
+ *
+ *  REFERENCES
+ *
+ *      Deutsch, L.P.,"DEFLATE Compressed Data Format Specification".
+ *      Available in http://tools.ietf.org/html/rfc1951
+ *
+ *      A description of the Rabin and Karp algorithm is given in the book
+ *         "Algorithms" by R. Sedgewick, Addison-Wesley, p252.
+ *
+ *      Fiala,E.R., and Greene,D.H.
+ *         Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595
+ *
+ */
+
+/* @(#) $Id$ */
+
+#include "deflate.h"
+
+const char deflate_copyright[] =
+   " deflate 1.2.8 Copyright 1995-2013 Jean-loup Gailly and Mark Adler ";
+/*
+  If you use the zlib library in a product, an acknowledgment is welcome
+  in the documentation of your product. If for some reason you cannot
+  include such an acknowledgment, I would appreciate that you keep this
+  copyright string in the executable of your product.
+ */
+
+/* ===========================================================================
+ *  Function prototypes.
+ */
+typedef enum {
+    need_more,      /* block not completed, need more input or more output */
+    block_done,     /* block flush performed */
+    finish_started, /* finish started, need only more output at next deflate */
+    finish_done     /* finish done, accept no more input or output */
+} block_state;
+
+typedef block_state (*compress_func) OF((deflate_state *s, int flush));
+/* Compression function. Returns the block state after the call. */
+
+local void fill_window    OF((deflate_state *s));
+local block_state deflate_stored OF((deflate_state *s, int flush));
+local block_state deflate_fast   OF((deflate_state *s, int flush));
+#ifndef FASTEST
+local block_state deflate_slow   OF((deflate_state *s, int flush));
+#endif
+local block_state deflate_rle    OF((deflate_state *s, int flush));
+local block_state deflate_huff   OF((deflate_state *s, int flush));
+local void lm_init        OF((deflate_state *s));
+local void putShortMSB    OF((deflate_state *s, uInt b));
+local void flush_pending  OF((z_streamp strm));
+local int read_buf        OF((z_streamp strm, Bytef *buf, unsigned size));
+#ifdef ASMV
+      void match_init OF((void)); /* asm code initialization */
+      uInt longest_match  OF((deflate_state *s, IPos cur_match));
+#else
+local uInt longest_match  OF((deflate_state *s, IPos cur_match));
+#endif
+
+#ifdef DEBUG
+local  void check_match OF((deflate_state *s, IPos start, IPos match,
+                            int length));
+#endif
+
+/* ===========================================================================
+ * Local data
+ */
+
+#define NIL 0
+/* Tail of hash chains */
+
+#ifndef TOO_FAR
+#  define TOO_FAR 4096
+#endif
+/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */
+
+/* Values for max_lazy_match, good_match and max_chain_length, depending on
+ * the desired pack level (0..9). The values given below have been tuned to
+ * exclude worst case performance for pathological files. Better values may be
+ * found for specific files.
+ */
+typedef struct config_s {
+   ush good_length; /* reduce lazy search above this match length */
+   ush max_lazy;    /* do not perform lazy search above this match length */
+   ush nice_length; /* quit search above this match length */
+   ush max_chain;
+   compress_func func;
+} config;
+
+#ifdef FASTEST
+local const config configuration_table[2] = {
+/*      good lazy nice chain */
+/* 0 */ {0,    0,  0,    0, deflate_stored},  /* store only */
+/* 1 */ {4,    4,  8,    4, deflate_fast}}; /* max speed, no lazy matches */
+#else
+local const config configuration_table[10] = {
+/*      good lazy nice chain */
+/* 0 */ {0,    0,  0,    0, deflate_stored},  /* store only */
+/* 1 */ {4,    4,  8,    4, deflate_fast}, /* max speed, no lazy matches */
+/* 2 */ {4,    5, 16,    8, deflate_fast},
+/* 3 */ {4,    6, 32,   32, deflate_fast},
+
+/* 4 */ {4,    4, 16,   16, deflate_slow},  /* lazy matches */
+/* 5 */ {8,   16, 32,   32, deflate_slow},
+/* 6 */ {8,   16, 128, 128, deflate_slow},
+/* 7 */ {8,   32, 128, 256, deflate_slow},
+/* 8 */ {32, 128, 258, 1024, deflate_slow},
+/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* max compression */
+#endif
+
+/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4
+ * For deflate_fast() (levels <= 3) good is ignored and lazy has a different
+ * meaning.
+ */
+
+#define EQUAL 0
+/* result of memcmp for equal strings */
+
+#ifndef NO_DUMMY_DECL
+struct static_tree_desc_s {int dummy;}; /* for buggy compilers */
+#endif
+
+/* rank Z_BLOCK between Z_NO_FLUSH and Z_PARTIAL_FLUSH */
+#define RANK(f) (((f) << 1) - ((f) > 4 ? 9 : 0))
+
+/* ===========================================================================
+ * Update a hash value with the given input byte
+ * IN  assertion: all calls to to UPDATE_HASH are made with consecutive
+ *    input characters, so that a running hash key can be computed from the
+ *    previous key instead of complete recalculation each time.
+ */
+#define UPDATE_HASH(s,h,c) (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask)
+
+
+/* ===========================================================================
+ * Insert string str in the dictionary and set match_head to the previous head
+ * of the hash chain (the most recent string with same hash key). Return
+ * the previous length of the hash chain.
+ * If this file is compiled with -DFASTEST, the compression level is forced
+ * to 1, and no hash chains are maintained.
+ * IN  assertion: all calls to to INSERT_STRING are made with consecutive
+ *    input characters and the first MIN_MATCH bytes of str are valid
+ *    (except for the last MIN_MATCH-1 bytes of the input file).
+ */
+#ifdef FASTEST
+#define INSERT_STRING(s, str, match_head) \
+   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
+    match_head = s->head[s->ins_h], \
+    s->head[s->ins_h] = (Pos)(str))
+#else
+#define INSERT_STRING(s, str, match_head) \
+   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
+    match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
+    s->head[s->ins_h] = (Pos)(str))
+#endif
+
+/* ===========================================================================
+ * Initialize the hash table (avoiding 64K overflow for 16 bit systems).
+ * prev[] will be initialized on the fly.
+ */
+#define CLEAR_HASH(s) \
+    s->head[s->hash_size-1] = NIL; \
+    zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
+
+/* ========================================================================= */
+int ZEXPORT deflateInit_(strm, level, version, stream_size)
+    z_streamp strm;
+    int level;
+    const char *version;
+    int stream_size;
+{
+    return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
+                         Z_DEFAULT_STRATEGY, version, stream_size);
+    /* To do: ignore strm->next_in if we use it as window */
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
+                  version, stream_size)
+    z_streamp strm;
+    int  level;
+    int  method;
+    int  windowBits;
+    int  memLevel;
+    int  strategy;
+    const char *version;
+    int stream_size;
+{
+    deflate_state *s;
+    int wrap = 1;
+    static const char my_version[] = ZLIB_VERSION;
+
+    ushf *overlay;
+    /* We overlay pending_buf and d_buf+l_buf. This works since the average
+     * output size for (length,distance) codes is <= 24 bits.
+     */
+
+    if (version == Z_NULL || version[0] != my_version[0] ||
+        stream_size != sizeof(z_stream)) {
+        return Z_VERSION_ERROR;
+    }
+    if (strm == Z_NULL) return Z_STREAM_ERROR;
+
+    strm->msg = Z_NULL;
+    if (strm->zalloc == (alloc_func)0) {
+#ifdef Z_SOLO
+        return Z_STREAM_ERROR;
+#else
+        strm->zalloc = zcalloc;
+        strm->opaque = (voidpf)0;
+#endif
+    }
+    if (strm->zfree == (free_func)0)
+#ifdef Z_SOLO
+        return Z_STREAM_ERROR;
+#else
+        strm->zfree = zcfree;
+#endif
+
+#ifdef FASTEST
+    if (level != 0) level = 1;
+#else
+    if (level == Z_DEFAULT_COMPRESSION) level = 6;
+#endif
+
+    if (windowBits < 0) { /* suppress zlib wrapper */
+        wrap = 0;
+        windowBits = -windowBits;
+    }
+#ifdef GZIP
+    else if (windowBits > 15) {
+        wrap = 2;       /* write gzip wrapper instead */
+        windowBits -= 16;
+    }
+#endif
+    if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
+        windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
+        strategy < 0 || strategy > Z_FIXED) {
+        return Z_STREAM_ERROR;
+    }
+    if (windowBits == 8) windowBits = 9;  /* until 256-byte window bug fixed */
+    s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));
+    if (s == Z_NULL) return Z_MEM_ERROR;
+    strm->state = (struct internal_state FAR *)s;
+    s->strm = strm;
+
+    s->wrap = wrap;
+    s->gzhead = Z_NULL;
+    s->w_bits = windowBits;
+    s->w_size = 1 << s->w_bits;
+    s->w_mask = s->w_size - 1;
+
+    s->hash_bits = memLevel + 7;
+    s->hash_size = 1 << s->hash_bits;
+    s->hash_mask = s->hash_size - 1;
+    s->hash_shift =  ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH);
+
+    s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
+    s->prev   = (Posf *)  ZALLOC(strm, s->w_size, sizeof(Pos));
+    s->head   = (Posf *)  ZALLOC(strm, s->hash_size, sizeof(Pos));
+
+    s->high_water = 0;      /* nothing written to s->window yet */
+
+    s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
+
+    overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
+    s->pending_buf = (uchf *) overlay;
+    s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);
+
+    if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
+        s->pending_buf == Z_NULL) {
+        s->status = FINISH_STATE;
+        strm->msg = ERR_MSG(Z_MEM_ERROR);
+        deflateEnd (strm);
+        return Z_MEM_ERROR;
+    }
+    s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
+    s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
+
+    s->level = level;
+    s->strategy = strategy;
+    s->method = (Byte)method;
+
+    return deflateReset(strm);
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
+    z_streamp strm;
+    const Bytef *dictionary;
+    uInt  dictLength;
+{
+    deflate_state *s;
+    uInt str, n;
+    int wrap;
+    unsigned avail;
+    z_const unsigned char *next;
+
+    if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL)
+        return Z_STREAM_ERROR;
+    s = strm->state;
+    wrap = s->wrap;
+    if (wrap == 2 || (wrap == 1 && s->status != INIT_STATE) || s->lookahead)
+        return Z_STREAM_ERROR;
+
+    /* when using zlib wrappers, compute Adler-32 for provided dictionary */
+    if (wrap == 1)
+        strm->adler = adler32(strm->adler, dictionary, dictLength);
+    s->wrap = 0;                    /* avoid computing Adler-32 in read_buf */
+
+    /* if dictionary would fill window, just replace the history */
+    if (dictLength >= s->w_size) {
+        if (wrap == 0) {            /* already empty otherwise */
+            CLEAR_HASH(s);
+            s->strstart = 0;
+            s->block_start = 0L;
+            s->insert = 0;
+        }
+        dictionary += dictLength - s->w_size;  /* use the tail */
+        dictLength = s->w_size;
+    }
+
+    /* insert dictionary into window and hash */
+    avail = strm->avail_in;
+    next = strm->next_in;
+    strm->avail_in = dictLength;
+    strm->next_in = (z_const Bytef *)dictionary;
+    fill_window(s);
+    while (s->lookahead >= MIN_MATCH) {
+        str = s->strstart;
+        n = s->lookahead - (MIN_MATCH-1);
+        do {
+            UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]);
+#ifndef FASTEST
+            s->prev[str & s->w_mask] = s->head[s->ins_h];
+#endif
+            s->head[s->ins_h] = (Pos)str;
+            str++;
+        } while (--n);
+        s->strstart = str;
+        s->lookahead = MIN_MATCH-1;
+        fill_window(s);
+    }
+    s->strstart += s->lookahead;
+    s->block_start = (long)s->strstart;
+    s->insert = s->lookahead;
+    s->lookahead = 0;
+    s->match_length = s->prev_length = MIN_MATCH-1;
+    s->match_available = 0;
+    strm->next_in = next;
+    strm->avail_in = avail;
+    s->wrap = wrap;
+    return Z_OK;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateResetKeep (strm)
+    z_streamp strm;
+{
+    deflate_state *s;
+
+    if (strm == Z_NULL || strm->state == Z_NULL ||
+        strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) {
+        return Z_STREAM_ERROR;
+    }
+
+    strm->total_in = strm->total_out = 0;
+    strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */
+    strm->data_type = Z_UNKNOWN;
+
+    s = (deflate_state *)strm->state;
+    s->pending = 0;
+    s->pending_out = s->pending_buf;
+
+    if (s->wrap < 0) {
+        s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */
+    }
+    s->status = s->wrap ? INIT_STATE : BUSY_STATE;
+    strm->adler =
+#ifdef GZIP
+        s->wrap == 2 ? crc32(0L, Z_NULL, 0) :
+#endif
+        adler32(0L, Z_NULL, 0);
+    s->last_flush = Z_NO_FLUSH;
+
+    _tr_init(s);
+
+    return Z_OK;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateReset (strm)
+    z_streamp strm;
+{
+    int ret;
+
+    ret = deflateResetKeep(strm);
+    if (ret == Z_OK)
+        lm_init(strm->state);
+    return ret;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateSetHeader (strm, head)
+    z_streamp strm;
+    gz_headerp head;
+{
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    if (strm->state->wrap != 2) return Z_STREAM_ERROR;
+    strm->state->gzhead = head;
+    return Z_OK;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflatePending (strm, pending, bits)
+    unsigned *pending;
+    int *bits;
+    z_streamp strm;
+{
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    if (pending != Z_NULL)
+        *pending = strm->state->pending;
+    if (bits != Z_NULL)
+        *bits = strm->state->bi_valid;
+    return Z_OK;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflatePrime (strm, bits, value)
+    z_streamp strm;
+    int bits;
+    int value;
+{
+    deflate_state *s;
+    int put;
+
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    s = strm->state;
+    if ((Bytef *)(s->d_buf) < s->pending_out + ((Buf_size + 7) >> 3))
+        return Z_BUF_ERROR;
+    do {
+        put = Buf_size - s->bi_valid;
+        if (put > bits)
+            put = bits;
+        s->bi_buf |= (ush)((value & ((1 << put) - 1)) << s->bi_valid);
+        s->bi_valid += put;
+        _tr_flush_bits(s);
+        value >>= put;
+        bits -= put;
+    } while (bits);
+    return Z_OK;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateParams(strm, level, strategy)
+    z_streamp strm;
+    int level;
+    int strategy;
+{
+    deflate_state *s;
+    compress_func func;
+    int err = Z_OK;
+
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    s = strm->state;
+
+#ifdef FASTEST
+    if (level != 0) level = 1;
+#else
+    if (level == Z_DEFAULT_COMPRESSION) level = 6;
+#endif
+    if (level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) {
+        return Z_STREAM_ERROR;
+    }
+    func = configuration_table[s->level].func;
+
+    if ((strategy != s->strategy || func != configuration_table[level].func) &&
+        strm->total_in != 0) {
+        /* Flush the last buffer: */
+        err = deflate(strm, Z_BLOCK);
+        if (err == Z_BUF_ERROR && s->pending == 0)
+            err = Z_OK;
+    }
+    if (s->level != level) {
+        s->level = level;
+        s->max_lazy_match   = configuration_table[level].max_lazy;
+        s->good_match       = configuration_table[level].good_length;
+        s->nice_match       = configuration_table[level].nice_length;
+        s->max_chain_length = configuration_table[level].max_chain;
+    }
+    s->strategy = strategy;
+    return err;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain)
+    z_streamp strm;
+    int good_length;
+    int max_lazy;
+    int nice_length;
+    int max_chain;
+{
+    deflate_state *s;
+
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    s = strm->state;
+    s->good_match = good_length;
+    s->max_lazy_match = max_lazy;
+    s->nice_match = nice_length;
+    s->max_chain_length = max_chain;
+    return Z_OK;
+}
+
+/* =========================================================================
+ * For the default windowBits of 15 and memLevel of 8, this function returns
+ * a close to exact, as well as small, upper bound on the compressed size.
+ * They are coded as constants here for a reason--if the #define's are
+ * changed, then this function needs to be changed as well.  The return
+ * value for 15 and 8 only works for those exact settings.
+ *
+ * For any setting other than those defaults for windowBits and memLevel,
+ * the value returned is a conservative worst case for the maximum expansion
+ * resulting from using fixed blocks instead of stored blocks, which deflate
+ * can emit on compressed data for some combinations of the parameters.
+ *
+ * This function could be more sophisticated to provide closer upper bounds for
+ * every combination of windowBits and memLevel.  But even the conservative
+ * upper bound of about 14% expansion does not seem onerous for output buffer
+ * allocation.
+ */
+uLong ZEXPORT deflateBound(strm, sourceLen)
+    z_streamp strm;
+    uLong sourceLen;
+{
+    deflate_state *s;
+    uLong complen, wraplen;
+    Bytef *str;
+
+    /* conservative upper bound for compressed data */
+    complen = sourceLen +
+              ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5;
+
+    /* if can't get parameters, return conservative bound plus zlib wrapper */
+    if (strm == Z_NULL || strm->state == Z_NULL)
+        return complen + 6;
+
+    /* compute wrapper length */
+    s = strm->state;
+    switch (s->wrap) {
+    case 0:                                 /* raw deflate */
+        wraplen = 0;
+        break;
+    case 1:                                 /* zlib wrapper */
+        wraplen = 6 + (s->strstart ? 4 : 0);
+        break;
+    case 2:                                 /* gzip wrapper */
+        wraplen = 18;
+        if (s->gzhead != Z_NULL) {          /* user-supplied gzip header */
+            if (s->gzhead->extra != Z_NULL)
+                wraplen += 2 + s->gzhead->extra_len;
+            str = s->gzhead->name;
+            if (str != Z_NULL)
+                do {
+                    wraplen++;
+                } while (*str++);
+            str = s->gzhead->comment;
+            if (str != Z_NULL)
+                do {
+                    wraplen++;
+                } while (*str++);
+            if (s->gzhead->hcrc)
+                wraplen += 2;
+        }
+        break;
+    default:                                /* for compiler happiness */
+        wraplen = 6;
+    }
+
+    /* if not default parameters, return conservative bound */
+    if (s->w_bits != 15 || s->hash_bits != 8 + 7)
+        return complen + wraplen;
+
+    /* default settings: return tight bound for that case */
+    return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
+           (sourceLen >> 25) + 13 - 6 + wraplen;
+}
+
+/* =========================================================================
+ * Put a short in the pending buffer. The 16-bit value is put in MSB order.
+ * IN assertion: the stream state is correct and there is enough room in
+ * pending_buf.
+ */
+local void putShortMSB (s, b)
+    deflate_state *s;
+    uInt b;
+{
+    put_byte(s, (Byte)(b >> 8));
+    put_byte(s, (Byte)(b & 0xff));
+}
+
+/* =========================================================================
+ * Flush as much pending output as possible. All deflate() output goes
+ * through this function so some applications may wish to modify it
+ * to avoid allocating a large strm->next_out buffer and copying into it.
+ * (See also read_buf()).
+ */
+local void flush_pending(strm)
+    z_streamp strm;
+{
+    unsigned len;
+    deflate_state *s = strm->state;
+
+    _tr_flush_bits(s);
+    len = s->pending;
+    if (len > strm->avail_out) len = strm->avail_out;
+    if (len == 0) return;
+
+    zmemcpy(strm->next_out, s->pending_out, len);
+    strm->next_out  += len;
+    s->pending_out  += len;
+    strm->total_out += len;
+    strm->avail_out  -= len;
+    s->pending -= len;
+    if (s->pending == 0) {
+        s->pending_out = s->pending_buf;
+    }
+}
+
+/* ========================================================================= */
+int ZEXPORT deflate (strm, flush)
+    z_streamp strm;
+    int flush;
+{
+    int old_flush; /* value of flush param for previous deflate call */
+    deflate_state *s;
+
+    if (strm == Z_NULL || strm->state == Z_NULL ||
+        flush > Z_BLOCK || flush < 0) {
+        return Z_STREAM_ERROR;
+    }
+    s = strm->state;
+
+    if (strm->next_out == Z_NULL ||
+        (strm->next_in == Z_NULL && strm->avail_in != 0) ||
+        (s->status == FINISH_STATE && flush != Z_FINISH)) {
+        ERR_RETURN(strm, Z_STREAM_ERROR);
+    }
+    if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);
+
+    s->strm = strm; /* just in case */
+    old_flush = s->last_flush;
+    s->last_flush = flush;
+
+    /* Write the header */
+    if (s->status == INIT_STATE) {
+#ifdef GZIP
+        if (s->wrap == 2) {
+            strm->adler = crc32(0L, Z_NULL, 0);
+            put_byte(s, 31);
+            put_byte(s, 139);
+            put_byte(s, 8);
+            if (s->gzhead == Z_NULL) {
+                put_byte(s, 0);
+                put_byte(s, 0);
+                put_byte(s, 0);
+                put_byte(s, 0);
+                put_byte(s, 0);
+                put_byte(s, s->level == 9 ? 2 :
+                            (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
+                             4 : 0));
+                put_byte(s, OS_CODE);
+                s->status = BUSY_STATE;
+            }
+            else {
+                put_byte(s, (s->gzhead->text ? 1 : 0) +
+                            (s->gzhead->hcrc ? 2 : 0) +
+                            (s->gzhead->extra == Z_NULL ? 0 : 4) +
+                            (s->gzhead->name == Z_NULL ? 0 : 8) +
+                            (s->gzhead->comment == Z_NULL ? 0 : 16)
+                        );
+                put_byte(s, (Byte)(s->gzhead->time & 0xff));
+                put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff));
+                put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff));
+                put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff));
+                put_byte(s, s->level == 9 ? 2 :
+                            (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
+                             4 : 0));
+                put_byte(s, s->gzhead->os & 0xff);
+                if (s->gzhead->extra != Z_NULL) {
+                    put_byte(s, s->gzhead->extra_len & 0xff);
+                    put_byte(s, (s->gzhead->extra_len >> 8) & 0xff);
+                }
+                if (s->gzhead->hcrc)
+                    strm->adler = crc32(strm->adler, s->pending_buf,
+                                        s->pending);
+                s->gzindex = 0;
+                s->status = EXTRA_STATE;
+            }
+        }
+        else
+#endif
+        {
+            uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8;
+            uInt level_flags;
+
+            if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2)
+                level_flags = 0;
+            else if (s->level < 6)
+                level_flags = 1;
+            else if (s->level == 6)
+                level_flags = 2;
+            else
+                level_flags = 3;
+            header |= (level_flags << 6);
+            if (s->strstart != 0) header |= PRESET_DICT;
+            header += 31 - (header % 31);
+
+            s->status = BUSY_STATE;
+            putShortMSB(s, header);
+
+            /* Save the adler32 of the preset dictionary: */
+            if (s->strstart != 0) {
+                putShortMSB(s, (uInt)(strm->adler >> 16));
+                putShortMSB(s, (uInt)(strm->adler & 0xffff));
+            }
+            strm->adler = adler32(0L, Z_NULL, 0);
+        }
+    }
+#ifdef GZIP
+    if (s->status == EXTRA_STATE) {
+        if (s->gzhead->extra != Z_NULL) {
+            uInt beg = s->pending;  /* start of bytes to update crc */
+
+            while (s->gzindex < (s->gzhead->extra_len & 0xffff)) {
+                if (s->pending == s->pending_buf_size) {
+                    if (s->gzhead->hcrc && s->pending > beg)
+                        strm->adler = crc32(strm->adler, s->pending_buf + beg,
+                                            s->pending - beg);
+                    flush_pending(strm);
+                    beg = s->pending;
+                    if (s->pending == s->pending_buf_size)
+                        break;
+                }
+                put_byte(s, s->gzhead->extra[s->gzindex]);
+                s->gzindex++;
+            }
+            if (s->gzhead->hcrc && s->pending > beg)
+                strm->adler = crc32(strm->adler, s->pending_buf + beg,
+                                    s->pending - beg);
+            if (s->gzindex == s->gzhead->extra_len) {
+                s->gzindex = 0;
+                s->status = NAME_STATE;
+            }
+        }
+        else
+            s->status = NAME_STATE;
+    }
+    if (s->status == NAME_STATE) {
+        if (s->gzhead->name != Z_NULL) {
+            uInt beg = s->pending;  /* start of bytes to update crc */
+            int val;
+
+            do {
+                if (s->pending == s->pending_buf_size) {
+                    if (s->gzhead->hcrc && s->pending > beg)
+                        strm->adler = crc32(strm->adler, s->pending_buf + beg,
+                                            s->pending - beg);
+                    flush_pending(strm);
+                    beg = s->pending;
+                    if (s->pending == s->pending_buf_size) {
+                        val = 1;
+                        break;
+                    }
+                }
+                val = s->gzhead->name[s->gzindex++];
+                put_byte(s, val);
+            } while (val != 0);
+            if (s->gzhead->hcrc && s->pending > beg)
+                strm->adler = crc32(strm->adler, s->pending_buf + beg,
+                                    s->pending - beg);
+            if (val == 0) {
+                s->gzindex = 0;
+                s->status = COMMENT_STATE;
+            }
+        }
+        else
+            s->status = COMMENT_STATE;
+    }
+    if (s->status == COMMENT_STATE) {
+        if (s->gzhead->comment != Z_NULL) {
+            uInt beg = s->pending;  /* start of bytes to update crc */
+            int val;
+
+            do {
+                if (s->pending == s->pending_buf_size) {
+                    if (s->gzhead->hcrc && s->pending > beg)
+                        strm->adler = crc32(strm->adler, s->pending_buf + beg,
+                                            s->pending - beg);
+                    flush_pending(strm);
+                    beg = s->pending;
+                    if (s->pending == s->pending_buf_size) {
+                        val = 1;
+                        break;
+                    }
+                }
+                val = s->gzhead->comment[s->gzindex++];
+                put_byte(s, val);
+            } while (val != 0);
+            if (s->gzhead->hcrc && s->pending > beg)
+                strm->adler = crc32(strm->adler, s->pending_buf + beg,
+                                    s->pending - beg);
+            if (val == 0)
+                s->status = HCRC_STATE;
+        }
+        else
+            s->status = HCRC_STATE;
+    }
+    if (s->status == HCRC_STATE) {
+        if (s->gzhead->hcrc) {
+            if (s->pending + 2 > s->pending_buf_size)
+                flush_pending(strm);
+            if (s->pending + 2 <= s->pending_buf_size) {
+                put_byte(s, (Byte)(strm->adler & 0xff));
+                put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
+                strm->adler = crc32(0L, Z_NULL, 0);
+                s->status = BUSY_STATE;
+            }
+        }
+        else
+            s->status = BUSY_STATE;
+    }
+#endif
+
+    /* Flush as much pending output as possible */
+    if (s->pending != 0) {
+        flush_pending(strm);
+        if (strm->avail_out == 0) {
+            /* Since avail_out is 0, deflate will be called again with
+             * more output space, but possibly with both pending and
+             * avail_in equal to zero. There won't be anything to do,
+             * but this is not an error situation so make sure we
+             * return OK instead of BUF_ERROR at next call of deflate:
+             */
+            s->last_flush = -1;
+            return Z_OK;
+        }
+
+    /* Make sure there is something to do and avoid duplicate consecutive
+     * flushes. For repeated and useless calls with Z_FINISH, we keep
+     * returning Z_STREAM_END instead of Z_BUF_ERROR.
+     */
+    } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) &&
+               flush != Z_FINISH) {
+        ERR_RETURN(strm, Z_BUF_ERROR);
+    }
+
+    /* User must not provide more input after the first FINISH: */
+    if (s->status == FINISH_STATE && strm->avail_in != 0) {
+        ERR_RETURN(strm, Z_BUF_ERROR);
+    }
+
+    /* Start a new block or continue the current one.
+     */
+    if (strm->avail_in != 0 || s->lookahead != 0 ||
+        (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
+        block_state bstate;
+
+        bstate = s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) :
+                    (s->strategy == Z_RLE ? deflate_rle(s, flush) :
+                        (*(configuration_table[s->level].func))(s, flush));
+
+        if (bstate == finish_started || bstate == finish_done) {
+            s->status = FINISH_STATE;
+        }
+        if (bstate == need_more || bstate == finish_started) {
+            if (strm->avail_out == 0) {
+                s->last_flush = -1; /* avoid BUF_ERROR next call, see above */
+            }
+            return Z_OK;
+            /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
+             * of deflate should use the same flush parameter to make sure
+             * that the flush is complete. So we don't have to output an
+             * empty block here, this will be done at next call. This also
+             * ensures that for a very small output buffer, we emit at most
+             * one empty block.
+             */
+        }
+        if (bstate == block_done) {
+            if (flush == Z_PARTIAL_FLUSH) {
+                _tr_align(s);
+            } else if (flush != Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */
+                _tr_stored_block(s, (char*)0, 0L, 0);
+                /* For a full flush, this empty block will be recognized
+                 * as a special marker by inflate_sync().
+                 */
+                if (flush == Z_FULL_FLUSH) {
+                    CLEAR_HASH(s);             /* forget history */
+                    if (s->lookahead == 0) {
+                        s->strstart = 0;
+                        s->block_start = 0L;
+                        s->insert = 0;
+                    }
+                }
+            }
+            flush_pending(strm);
+            if (strm->avail_out == 0) {
+              s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */
+              return Z_OK;
+            }
+        }
+    }
+    Assert(strm->avail_out > 0, "bug2");
+
+    if (flush != Z_FINISH) return Z_OK;
+    if (s->wrap <= 0) return Z_STREAM_END;
+
+    /* Write the trailer */
+#ifdef GZIP
+    if (s->wrap == 2) {
+        put_byte(s, (Byte)(strm->adler & 0xff));
+        put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
+        put_byte(s, (Byte)((strm->adler >> 16) & 0xff));
+        put_byte(s, (Byte)((strm->adler >> 24) & 0xff));
+        put_byte(s, (Byte)(strm->total_in & 0xff));
+        put_byte(s, (Byte)((strm->total_in >> 8) & 0xff));
+        put_byte(s, (Byte)((strm->total_in >> 16) & 0xff));
+        put_byte(s, (Byte)((strm->total_in >> 24) & 0xff));
+    }
+    else
+#endif
+    {
+        putShortMSB(s, (uInt)(strm->adler >> 16));
+        putShortMSB(s, (uInt)(strm->adler & 0xffff));
+    }
+    flush_pending(strm);
+    /* If avail_out is zero, the application will call deflate again
+     * to flush the rest.
+     */
+    if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */
+    return s->pending != 0 ? Z_OK : Z_STREAM_END;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateEnd (strm)
+    z_streamp strm;
+{
+    int status;
+
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+    status = strm->state->status;
+    if (status != INIT_STATE &&
+        status != EXTRA_STATE &&
+        status != NAME_STATE &&
+        status != COMMENT_STATE &&
+        status != HCRC_STATE &&
+        status != BUSY_STATE &&
+        status != FINISH_STATE) {
+      return Z_STREAM_ERROR;
+    }
+
+    /* Deallocate in reverse order of allocations: */
+    TRY_FREE(strm, strm->state->pending_buf);
+    TRY_FREE(strm, strm->state->head);
+    TRY_FREE(strm, strm->state->prev);
+    TRY_FREE(strm, strm->state->window);
+
+    ZFREE(strm, strm->state);
+    strm->state = Z_NULL;
+
+    return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
+}
+
+/* =========================================================================
+ * Copy the source state to the destination state.
+ * To simplify the source, this is not supported for 16-bit MSDOS (which
+ * doesn't have enough memory anyway to duplicate compression states).
+ */
+int ZEXPORT deflateCopy (dest, source)
+    z_streamp dest;
+    z_streamp source;
+{
+#ifdef MAXSEG_64K
+    return Z_STREAM_ERROR;
+#else
+    deflate_state *ds;
+    deflate_state *ss;
+    ushf *overlay;
+
+
+    if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) {
+        return Z_STREAM_ERROR;
+    }
+
+    ss = source->state;
+
+    zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));
+
+    ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state));
+    if (ds == Z_NULL) return Z_MEM_ERROR;
+    dest->state = (struct internal_state FAR *) ds;
+    zmemcpy((voidpf)ds, (voidpf)ss, sizeof(deflate_state));
+    ds->strm = dest;
+
+    ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
+    ds->prev   = (Posf *)  ZALLOC(dest, ds->w_size, sizeof(Pos));
+    ds->head   = (Posf *)  ZALLOC(dest, ds->hash_size, sizeof(Pos));
+    overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2);
+    ds->pending_buf = (uchf *) overlay;
+
+    if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL ||
+        ds->pending_buf == Z_NULL) {
+        deflateEnd (dest);
+        return Z_MEM_ERROR;
+    }
+    /* following zmemcpy do not work for 16-bit MSDOS */
+    zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
+    zmemcpy((voidpf)ds->prev, (voidpf)ss->prev, ds->w_size * sizeof(Pos));
+    zmemcpy((voidpf)ds->head, (voidpf)ss->head, ds->hash_size * sizeof(Pos));
+    zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
+
+    ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
+    ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush);
+    ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize;
+
+    ds->l_desc.dyn_tree = ds->dyn_ltree;
+    ds->d_desc.dyn_tree = ds->dyn_dtree;
+    ds->bl_desc.dyn_tree = ds->bl_tree;
+
+    return Z_OK;
+#endif /* MAXSEG_64K */
+}
+
+/* ===========================================================================
+ * Read a new buffer from the current input stream, update the adler32
+ * and total number of bytes read.  All deflate() input goes through
+ * this function so some applications may wish to modify it to avoid
+ * allocating a large strm->next_in buffer and copying from it.
+ * (See also flush_pending()).
+ */
+local int read_buf(strm, buf, size)
+    z_streamp strm;
+    Bytef *buf;
+    unsigned size;
+{
+    unsigned len = strm->avail_in;
+
+    if (len > size) len = size;
+    if (len == 0) return 0;
+
+    strm->avail_in  -= len;
+
+    zmemcpy(buf, strm->next_in, len);
+    if (strm->state->wrap == 1) {
+        strm->adler = adler32(strm->adler, buf, len);
+    }
+#ifdef GZIP
+    else if (strm->state->wrap == 2) {
+        strm->adler = crc32(strm->adler, buf, len);
+    }
+#endif
+    strm->next_in  += len;
+    strm->total_in += len;
+
+    return (int)len;
+}
+
+/* ===========================================================================
+ * Initialize the "longest match" routines for a new zlib stream
+ */
+local void lm_init (s)
+    deflate_state *s;
+{
+    s->window_size = (ulg)2L*s->w_size;
+
+    CLEAR_HASH(s);
+
+    /* Set the default configuration parameters:
+     */
+    s->max_lazy_match   = configuration_table[s->level].max_lazy;
+    s->good_match       = configuration_table[s->level].good_length;
+    s->nice_match       = configuration_table[s->level].nice_length;
+    s->max_chain_length = configuration_table[s->level].max_chain;
+
+    s->strstart = 0;
+    s->block_start = 0L;
+    s->lookahead = 0;
+    s->insert = 0;
+    s->match_length = s->prev_length = MIN_MATCH-1;
+    s->match_available = 0;
+    s->ins_h = 0;
+#ifndef FASTEST
+#ifdef ASMV
+    match_init(); /* initialize the asm code */
+#endif
+#endif
+}
+
+#ifndef FASTEST
+/* ===========================================================================
+ * Set match_start to the longest match starting at the given string and
+ * return its length. Matches shorter or equal to prev_length are discarded,
+ * in which case the result is equal to prev_length and match_start is
+ * garbage.
+ * IN assertions: cur_match is the head of the hash chain for the current
+ *   string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
+ * OUT assertion: the match length is not greater than s->lookahead.
+ */
+#ifndef ASMV
+/* For 80x86 and 680x0, an optimized version will be provided in match.asm or
+ * match.S. The code will be functionally equivalent.
+ */
+local uInt longest_match(s, cur_match)
+    deflate_state *s;
+    IPos cur_match;                             /* current match */
+{
+    unsigned chain_length = s->max_chain_length;/* max hash chain length */
+    register Bytef *scan = s->window + s->strstart; /* current string */
+    register Bytef *match;                       /* matched string */
+    register int len;                           /* length of current match */
+    int best_len = s->prev_length;              /* best match length so far */
+    int nice_match = s->nice_match;             /* stop if match long enough */
+    IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
+        s->strstart - (IPos)MAX_DIST(s) : NIL;
+    /* Stop when cur_match becomes <= limit. To simplify the code,
+     * we prevent matches with the string of window index 0.
+     */
+    Posf *prev = s->prev;
+    uInt wmask = s->w_mask;
+
+#ifdef UNALIGNED_OK
+    /* Compare two bytes at a time. Note: this is not always beneficial.
+     * Try with and without -DUNALIGNED_OK to check.
+     */
+    register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
+    register ush scan_start = *(ushf*)scan;
+    register ush scan_end   = *(ushf*)(scan+best_len-1);
+#else
+    register Bytef *strend = s->window + s->strstart + MAX_MATCH;
+    register Byte scan_end1  = scan[best_len-1];
+    register Byte scan_end   = scan[best_len];
+#endif
+
+    /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
+     * It is easy to get rid of this optimization if necessary.
+     */
+    Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
+
+    /* Do not waste too much time if we already have a good match: */
+    if (s->prev_length >= s->good_match) {
+        chain_length >>= 2;
+    }
+    /* Do not look for matches beyond the end of the input. This is necessary
+     * to make deflate deterministic.
+     */
+    if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
+
+    Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
+
+    do {
+        Assert(cur_match < s->strstart, "no future");
+        match = s->window + cur_match;
+
+        /* Skip to next match if the match length cannot increase
+         * or if the match length is less than 2.  Note that the checks below
+         * for insufficient lookahead only occur occasionally for performance
+         * reasons.  Therefore uninitialized memory will be accessed, and
+         * conditional jumps will be made that depend on those values.
+         * However the length of the match is limited to the lookahead, so
+         * the output of deflate is not affected by the uninitialized values.
+         */
+#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
+        /* This code assumes sizeof(unsigned short) == 2. Do not use
+         * UNALIGNED_OK if your compiler uses a different size.
+         */
+        if (*(ushf*)(match+best_len-1) != scan_end ||
+            *(ushf*)match != scan_start) continue;
+
+        /* It is not necessary to compare scan[2] and match[2] since they are
+         * always equal when the other bytes match, given that the hash keys
+         * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
+         * strstart+3, +5, ... up to strstart+257. We check for insufficient
+         * lookahead only every 4th comparison; the 128th check will be made
+         * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is
+         * necessary to put more guard bytes at the end of the window, or
+         * to check more often for insufficient lookahead.
+         */
+        Assert(scan[2] == match[2], "scan[2]?");
+        scan++, match++;
+        do {
+        } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+                 scan < strend);
+        /* The funny "do {}" generates better code on most compilers */
+
+        /* Here, scan <= window+strstart+257 */
+        Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+        if (*scan == *match) scan++;
+
+        len = (MAX_MATCH - 1) - (int)(strend-scan);
+        scan = strend - (MAX_MATCH-1);
+
+#else /* UNALIGNED_OK */
+
+        if (match[best_len]   != scan_end  ||
+            match[best_len-1] != scan_end1 ||
+            *match            != *scan     ||
+            *++match          != scan[1])      continue;
+
+        /* The check at best_len-1 can be removed because it will be made
+         * again later. (This heuristic is not always a win.)
+         * It is not necessary to compare scan[2] and match[2] since they
+         * are always equal when the other bytes match, given that
+         * the hash keys are equal and that HASH_BITS >= 8.
+         */
+        scan += 2, match++;
+        Assert(*scan == *match, "match[2]?");
+
+        /* We check for insufficient lookahead only every 8th comparison;
+         * the 256th check will be made at strstart+258.
+         */
+        do {
+        } while (*++scan == *++match && *++scan == *++match &&
+                 *++scan == *++match && *++scan == *++match &&
+                 *++scan == *++match && *++scan == *++match &&
+                 *++scan == *++match && *++scan == *++match &&
+                 scan < strend);
+
+        Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+
+        len = MAX_MATCH - (int)(strend - scan);
+        scan = strend - MAX_MATCH;
+
+#endif /* UNALIGNED_OK */
+
+        if (len > best_len) {
+            s->match_start = cur_match;
+            best_len = len;
+            if (len >= nice_match) break;
+#ifdef UNALIGNED_OK
+            scan_end = *(ushf*)(scan+best_len-1);
+#else
+            scan_end1  = scan[best_len-1];
+            scan_end   = scan[best_len];
+#endif
+        }
+    } while ((cur_match = prev[cur_match & wmask]) > limit
+             && --chain_length != 0);
+
+    if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
+    return s->lookahead;
+}
+#endif /* ASMV */
+
+#else /* FASTEST */
+
+/* ---------------------------------------------------------------------------
+ * Optimized version for FASTEST only
+ */
+local uInt longest_match(s, cur_match)
+    deflate_state *s;
+    IPos cur_match;                             /* current match */
+{
+    register Bytef *scan = s->window + s->strstart; /* current string */
+    register Bytef *match;                       /* matched string */
+    register int len;                           /* length of current match */
+    register Bytef *strend = s->window + s->strstart + MAX_MATCH;
+
+    /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
+     * It is easy to get rid of this optimization if necessary.
+     */
+    Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
+
+    Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
+
+    Assert(cur_match < s->strstart, "no future");
+
+    match = s->window + cur_match;
+
+    /* Return failure if the match length is less than 2:
+     */
+    if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;
+
+    /* The check at best_len-1 can be removed because it will be made
+     * again later. (This heuristic is not always a win.)
+     * It is not necessary to compare scan[2] and match[2] since they
+     * are always equal when the other bytes match, given that
+     * the hash keys are equal and that HASH_BITS >= 8.
+     */
+    scan += 2, match += 2;
+    Assert(*scan == *match, "match[2]?");
+
+    /* We check for insufficient lookahead only every 8th comparison;
+     * the 256th check will be made at strstart+258.
+     */
+    do {
+    } while (*++scan == *++match && *++scan == *++match &&
+             *++scan == *++match && *++scan == *++match &&
+             *++scan == *++match && *++scan == *++match &&
+             *++scan == *++match && *++scan == *++match &&
+             scan < strend);
+
+    Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+
+    len = MAX_MATCH - (int)(strend - scan);
+
+    if (len < MIN_MATCH) return MIN_MATCH - 1;
+
+    s->match_start = cur_match;
+    return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead;
+}
+
+#endif /* FASTEST */
+
+#ifdef DEBUG
+/* ===========================================================================
+ * Check that the match at match_start is indeed a match.
+ */
+local void check_match(s, start, match, length)
+    deflate_state *s;
+    IPos start, match;
+    int length;
+{
+    /* check that the match is indeed a match */
+    if (zmemcmp(s->window + match,
+                s->window + start, length) != EQUAL) {
+        fprintf(stderr, " start %u, match %u, length %d\n",
+                start, match, length);
+        do {
+            fprintf(stderr, "%c%c", s->window[match++], s->window[start++]);
+        } while (--length != 0);
+        z_error("invalid match");
+    }
+    if (z_verbose > 1) {
+        fprintf(stderr,"\\[%d,%d]", start-match, length);
+        do { putc(s->window[start++], stderr); } while (--length != 0);
+    }
+}
+#else
+#  define check_match(s, start, match, length)
+#endif /* DEBUG */
+
+/* ===========================================================================
+ * Fill the window when the lookahead becomes insufficient.
+ * Updates strstart and lookahead.
+ *
+ * IN assertion: lookahead < MIN_LOOKAHEAD
+ * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
+ *    At least one byte has been read, or avail_in == 0; reads are
+ *    performed for at least two bytes (required for the zip translate_eol
+ *    option -- not supported here).
+ */
+local void fill_window(s)
+    deflate_state *s;
+{
+    register unsigned n, m;
+    register Posf *p;
+    unsigned more;    /* Amount of free space at the end of the window. */
+    uInt wsize = s->w_size;
+
+    Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
+
+    do {
+        more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
+
+        /* Deal with !@#$% 64K limit: */
+        if (sizeof(int) <= 2) {
+            if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
+                more = wsize;
+
+            } else if (more == (unsigned)(-1)) {
+                /* Very unlikely, but possible on 16 bit machine if
+                 * strstart == 0 && lookahead == 1 (input done a byte at time)
+                 */
+                more--;
+            }
+        }
+
+        /* If the window is almost full and there is insufficient lookahead,
+         * move the upper half to the lower one to make room in the upper half.
+         */
+        if (s->strstart >= wsize+MAX_DIST(s)) {
+
+            zmemcpy(s->window, s->window+wsize, (unsigned)wsize);
+            s->match_start -= wsize;
+            s->strstart    -= wsize; /* we now have strstart >= MAX_DIST */
+            s->block_start -= (long) wsize;
+
+            /* Slide the hash table (could be avoided with 32 bit values
+               at the expense of memory usage). We slide even when level == 0
+               to keep the hash table consistent if we switch back to level > 0
+               later. (Using level 0 permanently is not an optimal usage of
+               zlib, so we don't care about this pathological case.)
+             */
+            n = s->hash_size;
+            p = &s->head[n];
+            do {
+                m = *--p;
+                *p = (Pos)(m >= wsize ? m-wsize : NIL);
+            } while (--n);
+
+            n = wsize;
+#ifndef FASTEST
+            p = &s->prev[n];
+            do {
+                m = *--p;
+                *p = (Pos)(m >= wsize ? m-wsize : NIL);
+                /* If n is not on any hash chain, prev[n] is garbage but
+                 * its value will never be used.
+                 */
+            } while (--n);
+#endif
+            more += wsize;
+        }
+        if (s->strm->avail_in == 0) break;
+
+        /* If there was no sliding:
+         *    strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
+         *    more == window_size - lookahead - strstart
+         * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
+         * => more >= window_size - 2*WSIZE + 2
+         * In the BIG_MEM or MMAP case (not yet supported),
+         *   window_size == input_size + MIN_LOOKAHEAD  &&
+         *   strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
+         * Otherwise, window_size == 2*WSIZE so more >= 2.
+         * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
+         */
+        Assert(more >= 2, "more < 2");
+
+        n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
+        s->lookahead += n;
+
+        /* Initialize the hash value now that we have some input: */
+        if (s->lookahead + s->insert >= MIN_MATCH) {
+            uInt str = s->strstart - s->insert;
+            s->ins_h = s->window[str];
+            UPDATE_HASH(s, s->ins_h, s->window[str + 1]);
+#if MIN_MATCH != 3
+            Call UPDATE_HASH() MIN_MATCH-3 more times
+#endif
+            while (s->insert) {
+                UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]);
+#ifndef FASTEST
+                s->prev[str & s->w_mask] = s->head[s->ins_h];
+#endif
+                s->head[s->ins_h] = (Pos)str;
+                str++;
+                s->insert--;
+                if (s->lookahead + s->insert < MIN_MATCH)
+                    break;
+            }
+        }
+        /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
+         * but this is not important since only literal bytes will be emitted.
+         */
+
+    } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
+
+    /* If the WIN_INIT bytes after the end of the current data have never been
+     * written, then zero those bytes in order to avoid memory check reports of
+     * the use of uninitialized (or uninitialised as Julian writes) bytes by
+     * the longest match routines.  Update the high water mark for the next
+     * time through here.  WIN_INIT is set to MAX_MATCH since the longest match
+     * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
+     */
+    if (s->high_water < s->window_size) {
+        ulg curr = s->strstart + (ulg)(s->lookahead);
+        ulg init;
+
+        if (s->high_water < curr) {
+            /* Previous high water mark below current data -- zero WIN_INIT
+             * bytes or up to end of window, whichever is less.
+             */
+            init = s->window_size - curr;
+            if (init > WIN_INIT)
+                init = WIN_INIT;
+            zmemzero(s->window + curr, (unsigned)init);
+            s->high_water = curr + init;
+        }
+        else if (s->high_water < (ulg)curr + WIN_INIT) {
+            /* High water mark at or above current data, but below current data
+             * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
+             * to end of window, whichever is less.
+             */
+            init = (ulg)curr + WIN_INIT - s->high_water;
+            if (init > s->window_size - s->high_water)
+                init = s->window_size - s->high_water;
+            zmemzero(s->window + s->high_water, (unsigned)init);
+            s->high_water += init;
+        }
+    }
+
+    Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
+           "not enough room for search");
+}
+
+/* ===========================================================================
+ * Flush the current block, with given end-of-file flag.
+ * IN assertion: strstart is set to the end of the current match.
+ */
+#define FLUSH_BLOCK_ONLY(s, last) { \
+   _tr_flush_block(s, (s->block_start >= 0L ? \
+                   (charf *)&s->window[(unsigned)s->block_start] : \
+                   (charf *)Z_NULL), \
+                (ulg)((long)s->strstart - s->block_start), \
+                (last)); \
+   s->block_start = s->strstart; \
+   flush_pending(s->strm); \
+   Tracev((stderr,"[FLUSH]")); \
+}
+
+/* Same but force premature exit if necessary. */
+#define FLUSH_BLOCK(s, last) { \
+   FLUSH_BLOCK_ONLY(s, last); \
+   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
+}
+
+/* ===========================================================================
+ * Copy without compression as much as possible from the input stream, return
+ * the current block state.
+ * This function does not insert new strings in the dictionary since
+ * uncompressible data is probably not useful. This function is used
+ * only for the level=0 compression option.
+ * NOTE: this function should be optimized to avoid extra copying from
+ * window to pending_buf.
+ */
+local block_state deflate_stored(s, flush)
+    deflate_state *s;
+    int flush;
+{
+    /* Stored blocks are limited to 0xffff bytes, pending_buf is limited
+     * to pending_buf_size, and each stored block has a 5 byte header:
+     */
+    ulg max_block_size = 0xffff;
+    ulg max_start;
+
+    if (max_block_size > s->pending_buf_size - 5) {
+        max_block_size = s->pending_buf_size - 5;
+    }
+
+    /* Copy as much as possible from input to output: */
+    for (;;) {
+        /* Fill the window as much as possible: */
+        if (s->lookahead <= 1) {
+
+            Assert(s->strstart < s->w_size+MAX_DIST(s) ||
+                   s->block_start >= (long)s->w_size, "slide too late");
+
+            fill_window(s);
+            if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more;
+
+            if (s->lookahead == 0) break; /* flush the current block */
+        }
+        Assert(s->block_start >= 0L, "block gone");
+
+        s->strstart += s->lookahead;
+        s->lookahead = 0;
+
+        /* Emit a stored block if pending_buf will be full: */
+        max_start = s->block_start + max_block_size;
+        if (s->strstart == 0 || (ulg)s->strstart >= max_start) {
+            /* strstart == 0 is possible when wraparound on 16-bit machine */
+            s->lookahead = (uInt)(s->strstart - max_start);
+            s->strstart = (uInt)max_start;
+            FLUSH_BLOCK(s, 0);
+        }
+        /* Flush if we may have to slide, otherwise block_start may become
+         * negative and the data will be gone:
+         */
+        if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) {
+            FLUSH_BLOCK(s, 0);
+        }
+    }
+    s->insert = 0;
+    if (flush == Z_FINISH) {
+        FLUSH_BLOCK(s, 1);
+        return finish_done;
+    }
+    if ((long)s->strstart > s->block_start)
+        FLUSH_BLOCK(s, 0);
+    return block_done;
+}
+
+/* ===========================================================================
+ * Compress as much as possible from the input stream, return the current
+ * block state.
+ * This function does not perform lazy evaluation of matches and inserts
+ * new strings in the dictionary only for unmatched strings or for short
+ * matches. It is used only for the fast compression options.
+ */
+local block_state deflate_fast(s, flush)
+    deflate_state *s;
+    int flush;
+{
+    IPos hash_head;       /* head of the hash chain */
+    int bflush;           /* set if current block must be flushed */
+
+    for (;;) {
+        /* Make sure that we always have enough lookahead, except
+         * at the end of the input file. We need MAX_MATCH bytes
+         * for the next match, plus MIN_MATCH bytes to insert the
+         * string following the next match.
+         */
+        if (s->lookahead < MIN_LOOKAHEAD) {
+            fill_window(s);
+            if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
+                return need_more;
+            }
+            if (s->lookahead == 0) break; /* flush the current block */
+        }
+
+        /* Insert the string window[strstart .. strstart+2] in the
+         * dictionary, and set hash_head to the head of the hash chain:
+         */
+        hash_head = NIL;
+        if (s->lookahead >= MIN_MATCH) {
+            INSERT_STRING(s, s->strstart, hash_head);
+        }
+
+        /* Find the longest match, discarding those <= prev_length.
+         * At this point we have always match_length < MIN_MATCH
+         */
+        if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) {
+            /* To simplify the code, we prevent matches with the string
+             * of window index 0 (in particular we have to avoid a match
+             * of the string with itself at the start of the input file).
+             */
+            s->match_length = longest_match (s, hash_head);
+            /* longest_match() sets match_start */
+        }
+        if (s->match_length >= MIN_MATCH) {
+            check_match(s, s->strstart, s->match_start, s->match_length);
+
+            _tr_tally_dist(s, s->strstart - s->match_start,
+                           s->match_length - MIN_MATCH, bflush);
+
+            s->lookahead -= s->match_length;
+
+            /* Insert new strings in the hash table only if the match length
+             * is not too large. This saves time but degrades compression.
+             */
+#ifndef FASTEST
+            if (s->match_length <= s->max_insert_length &&
+                s->lookahead >= MIN_MATCH) {
+                s->match_length--; /* string at strstart already in table */
+                do {
+                    s->strstart++;
+                    INSERT_STRING(s, s->strstart, hash_head);
+                    /* strstart never exceeds WSIZE-MAX_MATCH, so there are
+                     * always MIN_MATCH bytes ahead.
+                     */
+                } while (--s->match_length != 0);
+                s->strstart++;
+            } else
+#endif
+            {
+                s->strstart += s->match_length;
+                s->match_length = 0;
+                s->ins_h = s->window[s->strstart];
+                UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
+#if MIN_MATCH != 3
+                Call UPDATE_HASH() MIN_MATCH-3 more times
+#endif
+                /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
+                 * matter since it will be recomputed at next deflate call.
+                 */
+            }
+        } else {
+            /* No match, output a literal byte */
+            Tracevv((stderr,"%c", s->window[s->strstart]));
+            _tr_tally_lit (s, s->window[s->strstart], bflush);
+            s->lookahead--;
+            s->strstart++;
+        }
+        if (bflush) FLUSH_BLOCK(s, 0);
+    }
+    s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
+    if (flush == Z_FINISH) {
+        FLUSH_BLOCK(s, 1);
+        return finish_done;
+    }
+    if (s->last_lit)
+        FLUSH_BLOCK(s, 0);
+    return block_done;
+}
+
+#ifndef FASTEST
+/* ===========================================================================
+ * Same as above, but achieves better compression. We use a lazy
+ * evaluation for matches: a match is finally adopted only if there is
+ * no better match at the next window position.
+ */
+local block_state deflate_slow(s, flush)
+    deflate_state *s;
+    int flush;
+{
+    IPos hash_head;          /* head of hash chain */
+    int bflush;              /* set if current block must be flushed */
+
+    /* Process the input block. */
+    for (;;) {
+        /* Make sure that we always have enough lookahead, except
+         * at the end of the input file. We need MAX_MATCH bytes
+         * for the next match, plus MIN_MATCH bytes to insert the
+         * string following the next match.
+         */
+        if (s->lookahead < MIN_LOOKAHEAD) {
+            fill_window(s);
+            if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
+                return need_more;
+            }
+            if (s->lookahead == 0) break; /* flush the current block */
+        }
+
+        /* Insert the string window[strstart .. strstart+2] in the
+         * dictionary, and set hash_head to the head of the hash chain:
+         */
+        hash_head = NIL;
+        if (s->lookahead >= MIN_MATCH) {
+            INSERT_STRING(s, s->strstart, hash_head);
+        }
+
+        /* Find the longest match, discarding those <= prev_length.
+         */
+        s->prev_length = s->match_length, s->prev_match = s->match_start;
+        s->match_length = MIN_MATCH-1;
+
+        if (hash_head != NIL && s->prev_length < s->max_lazy_match &&
+            s->strstart - hash_head <= MAX_DIST(s)) {
+            /* To simplify the code, we prevent matches with the string
+             * of window index 0 (in particular we have to avoid a match
+             * of the string with itself at the start of the input file).
+             */
+            s->match_length = longest_match (s, hash_head);
+            /* longest_match() sets match_start */
+
+            if (s->match_length <= 5 && (s->strategy == Z_FILTERED
+#if TOO_FAR <= 32767
+                || (s->match_length == MIN_MATCH &&
+                    s->strstart - s->match_start > TOO_FAR)
+#endif
+                )) {
+
+                /* If prev_match is also MIN_MATCH, match_start is garbage
+                 * but we will ignore the current match anyway.
+                 */
+                s->match_length = MIN_MATCH-1;
+            }
+        }
+        /* If there was a match at the previous step and the current
+         * match is not better, output the previous match:
+         */
+        if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) {
+            uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
+            /* Do not insert strings in hash table beyond this. */
+
+            check_match(s, s->strstart-1, s->prev_match, s->prev_length);
+
+            _tr_tally_dist(s, s->strstart -1 - s->prev_match,
+                           s->prev_length - MIN_MATCH, bflush);
+
+            /* Insert in hash table all strings up to the end of the match.
+             * strstart-1 and strstart are already inserted. If there is not
+             * enough lookahead, the last two strings are not inserted in
+             * the hash table.
+             */
+            s->lookahead -= s->prev_length-1;
+            s->prev_length -= 2;
+            do {
+                if (++s->strstart <= max_insert) {
+                    INSERT_STRING(s, s->strstart, hash_head);
+                }
+            } while (--s->prev_length != 0);
+            s->match_available = 0;
+            s->match_length = MIN_MATCH-1;
+            s->strstart++;
+
+            if (bflush) FLUSH_BLOCK(s, 0);
+
+        } else if (s->match_available) {
+            /* If there was no match at the previous position, output a
+             * single literal. If there was a match but the current match
+             * is longer, truncate the previous match to a single literal.
+             */
+            Tracevv((stderr,"%c", s->window[s->strstart-1]));
+            _tr_tally_lit(s, s->window[s->strstart-1], bflush);
+            if (bflush) {
+                FLUSH_BLOCK_ONLY(s, 0);
+            }
+            s->strstart++;
+            s->lookahead--;
+            if (s->strm->avail_out == 0) return need_more;
+        } else {
+            /* There is no previous match to compare with, wait for
+             * the next step to decide.
+             */
+            s->match_available = 1;
+            s->strstart++;
+            s->lookahead--;
+        }
+    }
+    Assert (flush != Z_NO_FLUSH, "no flush?");
+    if (s->match_available) {
+        Tracevv((stderr,"%c", s->window[s->strstart-1]));
+        _tr_tally_lit(s, s->window[s->strstart-1], bflush);
+        s->match_available = 0;
+    }
+    s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
+    if (flush == Z_FINISH) {
+        FLUSH_BLOCK(s, 1);
+        return finish_done;
+    }
+    if (s->last_lit)
+        FLUSH_BLOCK(s, 0);
+    return block_done;
+}
+#endif /* FASTEST */
+
+/* ===========================================================================
+ * For Z_RLE, simply look for runs of bytes, generate matches only of distance
+ * one.  Do not maintain a hash table.  (It will be regenerated if this run of
+ * deflate switches away from Z_RLE.)
+ */
+local block_state deflate_rle(s, flush)
+    deflate_state *s;
+    int flush;
+{
+    int bflush;             /* set if current block must be flushed */
+    uInt prev;              /* byte at distance one to match */
+    Bytef *scan, *strend;   /* scan goes up to strend for length of run */
+
+    for (;;) {
+        /* Make sure that we always have enough lookahead, except
+         * at the end of the input file. We need MAX_MATCH bytes
+         * for the longest run, plus one for the unrolled loop.
+         */
+        if (s->lookahead <= MAX_MATCH) {
+            fill_window(s);
+            if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) {
+                return need_more;
+            }
+            if (s->lookahead == 0) break; /* flush the current block */
+        }
+
+        /* See how many times the previous byte repeats */
+        s->match_length = 0;
+        if (s->lookahead >= MIN_MATCH && s->strstart > 0) {
+            scan = s->window + s->strstart - 1;
+            prev = *scan;
+            if (prev == *++scan && prev == *++scan && prev == *++scan) {
+                strend = s->window + s->strstart + MAX_MATCH;
+                do {
+                } while (prev == *++scan && prev == *++scan &&
+                         prev == *++scan && prev == *++scan &&
+                         prev == *++scan && prev == *++scan &&
+                         prev == *++scan && prev == *++scan &&
+                         scan < strend);
+                s->match_length = MAX_MATCH - (int)(strend - scan);
+                if (s->match_length > s->lookahead)
+                    s->match_length = s->lookahead;
+            }
+            Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan");
+        }
+
+        /* Emit match if have run of MIN_MATCH or longer, else emit literal */
+        if (s->match_length >= MIN_MATCH) {
+            check_match(s, s->strstart, s->strstart - 1, s->match_length);
+
+            _tr_tally_dist(s, 1, s->match_length - MIN_MATCH, bflush);
+
+            s->lookahead -= s->match_length;
+            s->strstart += s->match_length;
+            s->match_length = 0;
+        } else {
+            /* No match, output a literal byte */
+            Tracevv((stderr,"%c", s->window[s->strstart]));
+            _tr_tally_lit (s, s->window[s->strstart], bflush);
+            s->lookahead--;
+            s->strstart++;
+        }
+        if (bflush) FLUSH_BLOCK(s, 0);
+    }
+    s->insert = 0;
+    if (flush == Z_FINISH) {
+        FLUSH_BLOCK(s, 1);
+        return finish_done;
+    }
+    if (s->last_lit)
+        FLUSH_BLOCK(s, 0);
+    return block_done;
+}
+
+/* ===========================================================================
+ * For Z_HUFFMAN_ONLY, do not look for matches.  Do not maintain a hash table.
+ * (It will be regenerated if this run of deflate switches away from Huffman.)
+ */
+local block_state deflate_huff(s, flush)
+    deflate_state *s;
+    int flush;
+{
+    int bflush;             /* set if current block must be flushed */
+
+    for (;;) {
+        /* Make sure that we have a literal to write. */
+        if (s->lookahead == 0) {
+            fill_window(s);
+            if (s->lookahead == 0) {
+                if (flush == Z_NO_FLUSH)
+                    return need_more;
+                break;      /* flush the current block */
+            }
+        }
+
+        /* Output a literal byte */
+        s->match_length = 0;
+        Tracevv((stderr,"%c", s->window[s->strstart]));
+        _tr_tally_lit (s, s->window[s->strstart], bflush);
+        s->lookahead--;
+        s->strstart++;
+        if (bflush) FLUSH_BLOCK(s, 0);
+    }
+    s->insert = 0;
+    if (flush == Z_FINISH) {
+        FLUSH_BLOCK(s, 1);
+        return finish_done;
+    }
+    if (s->last_lit)
+        FLUSH_BLOCK(s, 0);
+    return block_done;
+}
diff --git a/src/external/tng_io/external/zlib/deflate.h b/src/external/tng_io/external/zlib/deflate.h
new file mode 100644 (file)
index 0000000..ce0299e
--- /dev/null
@@ -0,0 +1,346 @@
+/* deflate.h -- internal compression state
+ * Copyright (C) 1995-2012 Jean-loup Gailly
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+   part of the implementation of the compression library and is
+   subject to change. Applications should only use zlib.h.
+ */
+
+/* @(#) $Id$ */
+
+#ifndef DEFLATE_H
+#define DEFLATE_H
+
+#include "zutil.h"
+
+/* define NO_GZIP when compiling if you want to disable gzip header and
+   trailer creation by deflate().  NO_GZIP would be used to avoid linking in
+   the crc code when it is not needed.  For shared libraries, gzip encoding
+   should be left enabled. */
+#ifndef NO_GZIP
+#  define GZIP
+#endif
+
+/* ===========================================================================
+ * Internal compression state.
+ */
+
+#define LENGTH_CODES 29
+/* number of length codes, not counting the special END_BLOCK code */
+
+#define LITERALS  256
+/* number of literal bytes 0..255 */
+
+#define L_CODES (LITERALS+1+LENGTH_CODES)
+/* number of Literal or Length codes, including the END_BLOCK code */
+
+#define D_CODES   30
+/* number of distance codes */
+
+#define BL_CODES  19
+/* number of codes used to transfer the bit lengths */
+
+#define HEAP_SIZE (2*L_CODES+1)
+/* maximum heap size */
+
+#define MAX_BITS 15
+/* All codes must not exceed MAX_BITS bits */
+
+#define Buf_size 16
+/* size of bit buffer in bi_buf */
+
+#define INIT_STATE    42
+#define EXTRA_STATE   69
+#define NAME_STATE    73
+#define COMMENT_STATE 91
+#define HCRC_STATE   103
+#define BUSY_STATE   113
+#define FINISH_STATE 666
+/* Stream status */
+
+
+/* Data structure describing a single value and its code string. */
+typedef struct ct_data_s {
+    union {
+        ush  freq;       /* frequency count */
+        ush  code;       /* bit string */
+    } fc;
+    union {
+        ush  dad;        /* father node in Huffman tree */
+        ush  len;        /* length of bit string */
+    } dl;
+} FAR ct_data;
+
+#define Freq fc.freq
+#define Code fc.code
+#define Dad  dl.dad
+#define Len  dl.len
+
+typedef struct static_tree_desc_s  static_tree_desc;
+
+typedef struct tree_desc_s {
+    ct_data *dyn_tree;           /* the dynamic tree */
+    int     max_code;            /* largest code with non zero frequency */
+    static_tree_desc *stat_desc; /* the corresponding static tree */
+} FAR tree_desc;
+
+typedef ush Pos;
+typedef Pos FAR Posf;
+typedef unsigned IPos;
+
+/* A Pos is an index in the character window. We use short instead of int to
+ * save space in the various tables. IPos is used only for parameter passing.
+ */
+
+typedef struct internal_state {
+    z_streamp strm;      /* pointer back to this zlib stream */
+    int   status;        /* as the name implies */
+    Bytef *pending_buf;  /* output still pending */
+    ulg   pending_buf_size; /* size of pending_buf */
+    Bytef *pending_out;  /* next pending byte to output to the stream */
+    uInt   pending;      /* nb of bytes in the pending buffer */
+    int   wrap;          /* bit 0 true for zlib, bit 1 true for gzip */
+    gz_headerp  gzhead;  /* gzip header information to write */
+    uInt   gzindex;      /* where in extra, name, or comment */
+    Byte  method;        /* can only be DEFLATED */
+    int   last_flush;    /* value of flush param for previous deflate call */
+
+                /* used by deflate.c: */
+
+    uInt  w_size;        /* LZ77 window size (32K by default) */
+    uInt  w_bits;        /* log2(w_size)  (8..16) */
+    uInt  w_mask;        /* w_size - 1 */
+
+    Bytef *window;
+    /* Sliding window. Input bytes are read into the second half of the window,
+     * and move to the first half later to keep a dictionary of at least wSize
+     * bytes. With this organization, matches are limited to a distance of
+     * wSize-MAX_MATCH bytes, but this ensures that IO is always
+     * performed with a length multiple of the block size. Also, it limits
+     * the window size to 64K, which is quite useful on MSDOS.
+     * To do: use the user input buffer as sliding window.
+     */
+
+    ulg window_size;
+    /* Actual size of window: 2*wSize, except when the user input buffer
+     * is directly used as sliding window.
+     */
+
+    Posf *prev;
+    /* Link to older string with same hash index. To limit the size of this
+     * array to 64K, this link is maintained only for the last 32K strings.
+     * An index in this array is thus a window index modulo 32K.
+     */
+
+    Posf *head; /* Heads of the hash chains or NIL. */
+
+    uInt  ins_h;          /* hash index of string to be inserted */
+    uInt  hash_size;      /* number of elements in hash table */
+    uInt  hash_bits;      /* log2(hash_size) */
+    uInt  hash_mask;      /* hash_size-1 */
+
+    uInt  hash_shift;
+    /* Number of bits by which ins_h must be shifted at each input
+     * step. It must be such that after MIN_MATCH steps, the oldest
+     * byte no longer takes part in the hash key, that is:
+     *   hash_shift * MIN_MATCH >= hash_bits
+     */
+
+    long block_start;
+    /* Window position at the beginning of the current output block. Gets
+     * negative when the window is moved backwards.
+     */
+
+    uInt match_length;           /* length of best match */
+    IPos prev_match;             /* previous match */
+    int match_available;         /* set if previous match exists */
+    uInt strstart;               /* start of string to insert */
+    uInt match_start;            /* start of matching string */
+    uInt lookahead;              /* number of valid bytes ahead in window */
+
+    uInt prev_length;
+    /* Length of the best match at previous step. Matches not greater than this
+     * are discarded. This is used in the lazy match evaluation.
+     */
+
+    uInt max_chain_length;
+    /* To speed up deflation, hash chains are never searched beyond this
+     * length.  A higher limit improves compression ratio but degrades the
+     * speed.
+     */
+
+    uInt max_lazy_match;
+    /* Attempt to find a better match only when the current match is strictly
+     * smaller than this value. This mechanism is used only for compression
+     * levels >= 4.
+     */
+#   define max_insert_length  max_lazy_match
+    /* Insert new strings in the hash table only if the match length is not
+     * greater than this length. This saves time but degrades compression.
+     * max_insert_length is used only for compression levels <= 3.
+     */
+
+    int level;    /* compression level (1..9) */
+    int strategy; /* favor or force Huffman coding*/
+
+    uInt good_match;
+    /* Use a faster search when the previous match is longer than this */
+
+    int nice_match; /* Stop searching when current match exceeds this */
+
+                /* used by trees.c: */
+    /* Didn't use ct_data typedef below to suppress compiler warning */
+    struct ct_data_s dyn_ltree[HEAP_SIZE];   /* literal and length tree */
+    struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
+    struct ct_data_s bl_tree[2*BL_CODES+1];  /* Huffman tree for bit lengths */
+
+    struct tree_desc_s l_desc;               /* desc. for literal tree */
+    struct tree_desc_s d_desc;               /* desc. for distance tree */
+    struct tree_desc_s bl_desc;              /* desc. for bit length tree */
+
+    ush bl_count[MAX_BITS+1];
+    /* number of codes at each bit length for an optimal tree */
+
+    int heap[2*L_CODES+1];      /* heap used to build the Huffman trees */
+    int heap_len;               /* number of elements in the heap */
+    int heap_max;               /* element of largest frequency */
+    /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
+     * The same heap array is used to build all trees.
+     */
+
+    uch depth[2*L_CODES+1];
+    /* Depth of each subtree used as tie breaker for trees of equal frequency
+     */
+
+    uchf *l_buf;          /* buffer for literals or lengths */
+
+    uInt  lit_bufsize;
+    /* Size of match buffer for literals/lengths.  There are 4 reasons for
+     * limiting lit_bufsize to 64K:
+     *   - frequencies can be kept in 16 bit counters
+     *   - if compression is not successful for the first block, all input
+     *     data is still in the window so we can still emit a stored block even
+     *     when input comes from standard input.  (This can also be done for
+     *     all blocks if lit_bufsize is not greater than 32K.)
+     *   - if compression is not successful for a file smaller than 64K, we can
+     *     even emit a stored file instead of a stored block (saving 5 bytes).
+     *     This is applicable only for zip (not gzip or zlib).
+     *   - creating new Huffman trees less frequently may not provide fast
+     *     adaptation to changes in the input data statistics. (Take for
+     *     example a binary file with poorly compressible code followed by
+     *     a highly compressible string table.) Smaller buffer sizes give
+     *     fast adaptation but have of course the overhead of transmitting
+     *     trees more frequently.
+     *   - I can't count above 4
+     */
+
+    uInt last_lit;      /* running index in l_buf */
+
+    ushf *d_buf;
+    /* Buffer for distances. To simplify the code, d_buf and l_buf have
+     * the same number of elements. To use different lengths, an extra flag
+     * array would be necessary.
+     */
+
+    ulg opt_len;        /* bit length of current block with optimal trees */
+    ulg static_len;     /* bit length of current block with static trees */
+    uInt matches;       /* number of string matches in current block */
+    uInt insert;        /* bytes at end of window left to insert */
+
+#ifdef DEBUG
+    ulg compressed_len; /* total bit length of compressed file mod 2^32 */
+    ulg bits_sent;      /* bit length of compressed data sent mod 2^32 */
+#endif
+
+    ush bi_buf;
+    /* Output buffer. bits are inserted starting at the bottom (least
+     * significant bits).
+     */
+    int bi_valid;
+    /* Number of valid bits in bi_buf.  All bits above the last valid bit
+     * are always zero.
+     */
+
+    ulg high_water;
+    /* High water mark offset in window for initialized bytes -- bytes above
+     * this are set to zero in order to avoid memory check warnings when
+     * longest match routines access bytes past the input.  This is then
+     * updated to the new high water mark.
+     */
+
+} FAR deflate_state;
+
+/* Output a byte on the stream.
+ * IN assertion: there is enough room in pending_buf.
+ */
+#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);}
+
+
+#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
+/* Minimum amount of lookahead, except at the end of the input file.
+ * See deflate.c for comments about the MIN_MATCH+1.
+ */
+
+#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
+/* In order to simplify the code, particularly on 16 bit machines, match
+ * distances are limited to MAX_DIST instead of WSIZE.
+ */
+
+#define WIN_INIT MAX_MATCH
+/* Number of bytes after end of data in window to initialize in order to avoid
+   memory checker errors from longest match routines */
+
+        /* in trees.c */
+void ZLIB_INTERNAL _tr_init OF((deflate_state *s));
+int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
+void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf,
+                        ulg stored_len, int last));
+void ZLIB_INTERNAL _tr_flush_bits OF((deflate_state *s));
+void ZLIB_INTERNAL _tr_align OF((deflate_state *s));
+void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
+                        ulg stored_len, int last));
+
+#define d_code(dist) \
+   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
+/* Mapping from a distance to a distance code. dist is the distance - 1 and
+ * must not have side effects. _dist_code[256] and _dist_code[257] are never
+ * used.
+ */
+
+#ifndef DEBUG
+/* Inline versions of _tr_tally for speed: */
+
+#if defined(GEN_TREES_H) || !defined(STDC)
+  extern uch ZLIB_INTERNAL _length_code[];
+  extern uch ZLIB_INTERNAL _dist_code[];
+#else
+  extern const uch ZLIB_INTERNAL _length_code[];
+  extern const uch ZLIB_INTERNAL _dist_code[];
+#endif
+
+# define _tr_tally_lit(s, c, flush) \
+  { uch cc = (c); \
+    s->d_buf[s->last_lit] = 0; \
+    s->l_buf[s->last_lit++] = cc; \
+    s->dyn_ltree[cc].Freq++; \
+    flush = (s->last_lit == s->lit_bufsize-1); \
+   }
+# define _tr_tally_dist(s, distance, length, flush) \
+  { uch len = (length); \
+    ush dist = (distance); \
+    s->d_buf[s->last_lit] = dist; \
+    s->l_buf[s->last_lit++] = len; \
+    dist--; \
+    s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
+    s->dyn_dtree[d_code(dist)].Freq++; \
+    flush = (s->last_lit == s->lit_bufsize-1); \
+  }
+#else
+# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
+# define _tr_tally_dist(s, distance, length, flush) \
+              flush = _tr_tally(s, distance, length)
+#endif
+
+#endif /* DEFLATE_H */
diff --git a/src/external/tng_io/external/zlib/inffast.c b/src/external/tng_io/external/zlib/inffast.c
new file mode 100644 (file)
index 0000000..bda59ce
--- /dev/null
@@ -0,0 +1,340 @@
+/* inffast.c -- fast decoding
+ * Copyright (C) 1995-2008, 2010, 2013 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+#include "inflate.h"
+#include "inffast.h"
+
+#ifndef ASMINF
+
+/* Allow machine dependent optimization for post-increment or pre-increment.
+   Based on testing to date,
+   Pre-increment preferred for:
+   - PowerPC G3 (Adler)
+   - MIPS R5000 (Randers-Pehrson)
+   Post-increment preferred for:
+   - none
+   No measurable difference:
+   - Pentium III (Anderson)
+   - M68060 (Nikl)
+ */
+#ifdef POSTINC
+#  define OFF 0
+#  define PUP(a) *(a)++
+#else
+#  define OFF 1
+#  define PUP(a) *++(a)
+#endif
+
+/*
+   Decode literal, length, and distance codes and write out the resulting
+   literal and match bytes until either not enough input or output is
+   available, an end-of-block is encountered, or a data error is encountered.
+   When large enough input and output buffers are supplied to inflate(), for
+   example, a 16K input buffer and a 64K output buffer, more than 95% of the
+   inflate execution time is spent in this routine.
+
+   Entry assumptions:
+
+        state->mode == LEN
+        strm->avail_in >= 6
+        strm->avail_out >= 258
+        start >= strm->avail_out
+        state->bits < 8
+
+   On return, state->mode is one of:
+
+        LEN -- ran out of enough output space or enough available input
+        TYPE -- reached end of block code, inflate() to interpret next block
+        BAD -- error in block data
+
+   Notes:
+
+    - The maximum input bits used by a length/distance pair is 15 bits for the
+      length code, 5 bits for the length extra, 15 bits for the distance code,
+      and 13 bits for the distance extra.  This totals 48 bits, or six bytes.
+      Therefore if strm->avail_in >= 6, then there is enough input to avoid
+      checking for available input while decoding.
+
+    - The maximum bytes that a single length/distance pair can output is 258
+      bytes, which is the maximum length that can be coded.  inflate_fast()
+      requires strm->avail_out >= 258 for each loop to avoid checking for
+      output space.
+ */
+void ZLIB_INTERNAL inflate_fast(strm, start)
+z_streamp strm;
+unsigned start;         /* inflate()'s starting value for strm->avail_out */
+{
+    struct inflate_state FAR *state;
+    z_const unsigned char FAR *in;      /* local strm->next_in */
+    z_const unsigned char FAR *last;    /* have enough input while in < last */
+    unsigned char FAR *out;     /* local strm->next_out */
+    unsigned char FAR *beg;     /* inflate()'s initial strm->next_out */
+    unsigned char FAR *end;     /* while out < end, enough space available */
+#ifdef INFLATE_STRICT
+    unsigned dmax;              /* maximum distance from zlib header */
+#endif
+    unsigned wsize;             /* window size or zero if not using window */
+    unsigned whave;             /* valid bytes in the window */
+    unsigned wnext;             /* window write index */
+    unsigned char FAR *window;  /* allocated sliding window, if wsize != 0 */
+    unsigned long hold;         /* local strm->hold */
+    unsigned bits;              /* local strm->bits */
+    code const FAR *lcode;      /* local strm->lencode */
+    code const FAR *dcode;      /* local strm->distcode */
+    unsigned lmask;             /* mask for first level of length codes */
+    unsigned dmask;             /* mask for first level of distance codes */
+    code here;                  /* retrieved table entry */
+    unsigned op;                /* code bits, operation, extra bits, or */
+                                /*  window position, window bytes to copy */
+    unsigned len;               /* match length, unused bytes */
+    unsigned dist;              /* match distance */
+    unsigned char FAR *from;    /* where to copy match from */
+
+    /* copy state to local variables */
+    state = (struct inflate_state FAR *)strm->state;
+    in = strm->next_in - OFF;
+    last = in + (strm->avail_in - 5);
+    out = strm->next_out - OFF;
+    beg = out - (start - strm->avail_out);
+    end = out + (strm->avail_out - 257);
+#ifdef INFLATE_STRICT
+    dmax = state->dmax;
+#endif
+    wsize = state->wsize;
+    whave = state->whave;
+    wnext = state->wnext;
+    window = state->window;
+    hold = state->hold;
+    bits = state->bits;
+    lcode = state->lencode;
+    dcode = state->distcode;
+    lmask = (1U << state->lenbits) - 1;
+    dmask = (1U << state->distbits) - 1;
+
+    /* decode literals and length/distances until end-of-block or not enough
+       input data or output space */
+    do {
+        if (bits < 15) {
+            hold += (unsigned long)(PUP(in)) << bits;
+            bits += 8;
+            hold += (unsigned long)(PUP(in)) << bits;
+            bits += 8;
+        }
+        here = lcode[hold & lmask];
+      dolen:
+        op = (unsigned)(here.bits);
+        hold >>= op;
+        bits -= op;
+        op = (unsigned)(here.op);
+        if (op == 0) {                          /* literal */
+            Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
+                    "inflate:         literal '%c'\n" :
+                    "inflate:         literal 0x%02x\n", here.val));
+            PUP(out) = (unsigned char)(here.val);
+        }
+        else if (op & 16) {                     /* length base */
+            len = (unsigned)(here.val);
+            op &= 15;                           /* number of extra bits */
+            if (op) {
+                if (bits < op) {
+                    hold += (unsigned long)(PUP(in)) << bits;
+                    bits += 8;
+                }
+                len += (unsigned)hold & ((1U << op) - 1);
+                hold >>= op;
+                bits -= op;
+            }
+            Tracevv((stderr, "inflate:         length %u\n", len));
+            if (bits < 15) {
+                hold += (unsigned long)(PUP(in)) << bits;
+                bits += 8;
+                hold += (unsigned long)(PUP(in)) << bits;
+                bits += 8;
+            }
+            here = dcode[hold & dmask];
+          dodist:
+            op = (unsigned)(here.bits);
+            hold >>= op;
+            bits -= op;
+            op = (unsigned)(here.op);
+            if (op & 16) {                      /* distance base */
+                dist = (unsigned)(here.val);
+                op &= 15;                       /* number of extra bits */
+                if (bits < op) {
+                    hold += (unsigned long)(PUP(in)) << bits;
+                    bits += 8;
+                    if (bits < op) {
+                        hold += (unsigned long)(PUP(in)) << bits;
+                        bits += 8;
+                    }
+                }
+                dist += (unsigned)hold & ((1U << op) - 1);
+#ifdef INFLATE_STRICT
+                if (dist > dmax) {
+                    strm->msg = (char *)"invalid distance too far back";
+                    state->mode = BAD;
+                    break;
+                }
+#endif
+                hold >>= op;
+                bits -= op;
+                Tracevv((stderr, "inflate:         distance %u\n", dist));
+                op = (unsigned)(out - beg);     /* max distance in output */
+                if (dist > op) {                /* see if copy from window */
+                    op = dist - op;             /* distance back in window */
+                    if (op > whave) {
+                        if (state->sane) {
+                            strm->msg =
+                                (char *)"invalid distance too far back";
+                            state->mode = BAD;
+                            break;
+                        }
+#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+                        if (len <= op - whave) {
+                            do {
+                                PUP(out) = 0;
+                            } while (--len);
+                            continue;
+                        }
+                        len -= op - whave;
+                        do {
+                            PUP(out) = 0;
+                        } while (--op > whave);
+                        if (op == 0) {
+                            from = out - dist;
+                            do {
+                                PUP(out) = PUP(from);
+                            } while (--len);
+                            continue;
+                        }
+#endif
+                    }
+                    from = window - OFF;
+                    if (wnext == 0) {           /* very common case */
+                        from += wsize - op;
+                        if (op < len) {         /* some from window */
+                            len -= op;
+                            do {
+                                PUP(out) = PUP(from);
+                            } while (--op);
+                            from = out - dist;  /* rest from output */
+                        }
+                    }
+                    else if (wnext < op) {      /* wrap around window */
+                        from += wsize + wnext - op;
+                        op -= wnext;
+                        if (op < len) {         /* some from end of window */
+                            len -= op;
+                            do {
+                                PUP(out) = PUP(from);
+                            } while (--op);
+                            from = window - OFF;
+                            if (wnext < len) {  /* some from start of window */
+                                op = wnext;
+                                len -= op;
+                                do {
+                                    PUP(out) = PUP(from);
+                                } while (--op);
+                                from = out - dist;      /* rest from output */
+                            }
+                        }
+                    }
+                    else {                      /* contiguous in window */
+                        from += wnext - op;
+                        if (op < len) {         /* some from window */
+                            len -= op;
+                            do {
+                                PUP(out) = PUP(from);
+                            } while (--op);
+                            from = out - dist;  /* rest from output */
+                        }
+                    }
+                    while (len > 2) {
+                        PUP(out) = PUP(from);
+                        PUP(out) = PUP(from);
+                        PUP(out) = PUP(from);
+                        len -= 3;
+                    }
+                    if (len) {
+                        PUP(out) = PUP(from);
+                        if (len > 1)
+                            PUP(out) = PUP(from);
+                    }
+                }
+                else {
+                    from = out - dist;          /* copy direct from output */
+                    do {                        /* minimum length is three */
+                        PUP(out) = PUP(from);
+                        PUP(out) = PUP(from);
+                        PUP(out) = PUP(from);
+                        len -= 3;
+                    } while (len > 2);
+                    if (len) {
+                        PUP(out) = PUP(from);
+                        if (len > 1)
+                            PUP(out) = PUP(from);
+                    }
+                }
+            }
+            else if ((op & 64) == 0) {          /* 2nd level distance code */
+                here = dcode[here.val + (hold & ((1U << op) - 1))];
+                goto dodist;
+            }
+            else {
+                strm->msg = (char *)"invalid distance code";
+                state->mode = BAD;
+                break;
+            }
+        }
+        else if ((op & 64) == 0) {              /* 2nd level length code */
+            here = lcode[here.val + (hold & ((1U << op) - 1))];
+            goto dolen;
+        }
+        else if (op & 32) {                     /* end-of-block */
+            Tracevv((stderr, "inflate:         end of block\n"));
+            state->mode = TYPE;
+            break;
+        }
+        else {
+            strm->msg = (char *)"invalid literal/length code";
+            state->mode = BAD;
+            break;
+        }
+    } while (in < last && out < end);
+
+    /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
+    len = bits >> 3;
+    in -= len;
+    bits -= len << 3;
+    hold &= (1U << bits) - 1;
+
+    /* update state and return */
+    strm->next_in = in + OFF;
+    strm->next_out = out + OFF;
+    strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last));
+    strm->avail_out = (unsigned)(out < end ?
+                                 257 + (end - out) : 257 - (out - end));
+    state->hold = hold;
+    state->bits = bits;
+    return;
+}
+
+/*
+   inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe):
+   - Using bit fields for code structure
+   - Different op definition to avoid & for extra bits (do & for table bits)
+   - Three separate decoding do-loops for direct, window, and wnext == 0
+   - Special case for distance > 1 copies to do overlapped load and store copy
+   - Explicit branch predictions (based on measured branch probabilities)
+   - Deferring match copy and interspersed it with decoding subsequent codes
+   - Swapping literal/length else
+   - Swapping window/direct else
+   - Larger unrolled copy loops (three is about right)
+   - Moving len -= 3 statement into middle of loop
+ */
+
+#endif /* !ASMINF */
diff --git a/src/external/tng_io/external/zlib/inffast.h b/src/external/tng_io/external/zlib/inffast.h
new file mode 100644 (file)
index 0000000..e5c1aa4
--- /dev/null
@@ -0,0 +1,11 @@
+/* inffast.h -- header to use inffast.c
+ * Copyright (C) 1995-2003, 2010 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+   part of the implementation of the compression library and is
+   subject to change. Applications should only use zlib.h.
+ */
+
+void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));
diff --git a/src/external/tng_io/external/zlib/inffixed.h b/src/external/tng_io/external/zlib/inffixed.h
new file mode 100644 (file)
index 0000000..d628327
--- /dev/null
@@ -0,0 +1,94 @@
+    /* inffixed.h -- table for decoding fixed codes
+     * Generated automatically by makefixed().
+     */
+
+    /* WARNING: this file should *not* be used by applications.
+       It is part of the implementation of this library and is
+       subject to change. Applications should only use zlib.h.
+     */
+
+    static const code lenfix[512] = {
+        {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48},
+        {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128},
+        {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59},
+        {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176},
+        {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20},
+        {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100},
+        {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8},
+        {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216},
+        {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76},
+        {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114},
+        {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2},
+        {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148},
+        {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42},
+        {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86},
+        {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15},
+        {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236},
+        {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62},
+        {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142},
+        {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31},
+        {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162},
+        {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25},
+        {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105},
+        {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4},
+        {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202},
+        {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69},
+        {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125},
+        {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13},
+        {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195},
+        {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35},
+        {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91},
+        {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19},
+        {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246},
+        {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55},
+        {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135},
+        {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99},
+        {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190},
+        {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16},
+        {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96},
+        {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6},
+        {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209},
+        {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72},
+        {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116},
+        {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4},
+        {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153},
+        {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44},
+        {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82},
+        {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11},
+        {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229},
+        {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58},
+        {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138},
+        {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51},
+        {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173},
+        {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30},
+        {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110},
+        {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0},
+        {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195},
+        {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65},
+        {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121},
+        {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9},
+        {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258},
+        {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37},
+        {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93},
+        {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23},
+        {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251},
+        {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51},
+        {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131},
+        {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67},
+        {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183},
+        {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23},
+        {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103},
+        {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9},
+        {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223},
+        {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79},
+        {0,9,255}
+    };
+
+    static const code distfix[32] = {
+        {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025},
+        {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193},
+        {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385},
+        {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577},
+        {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073},
+        {22,5,193},{64,5,0}
+    };
diff --git a/src/external/tng_io/external/zlib/inflate.c b/src/external/tng_io/external/zlib/inflate.c
new file mode 100644 (file)
index 0000000..09ee0bc
--- /dev/null
@@ -0,0 +1,1516 @@
+/* inflate.c -- zlib decompression
+ * Copyright (C) 1995-2012 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/*
+ * Change history:
+ *
+ * 1.2.beta0    24 Nov 2002
+ * - First version -- complete rewrite of inflate to simplify code, avoid
+ *   creation of window when not needed, minimize use of window when it is
+ *   needed, make inffast.c even faster, implement gzip decoding, and to
+ *   improve code readability and style over the previous zlib inflate code
+ *
+ * 1.2.beta1    25 Nov 2002
+ * - Use pointers for available input and output checking in inffast.c
+ * - Remove input and output counters in inffast.c
+ * - Change inffast.c entry and loop from avail_in >= 7 to >= 6
+ * - Remove unnecessary second byte pull from length extra in inffast.c
+ * - Unroll direct copy to three copies per loop in inffast.c
+ *
+ * 1.2.beta2    4 Dec 2002
+ * - Change external routine names to reduce potential conflicts
+ * - Correct filename to inffixed.h for fixed tables in inflate.c
+ * - Make hbuf[] unsigned char to match parameter type in inflate.c
+ * - Change strm->next_out[-state->offset] to *(strm->next_out - state->offset)
+ *   to avoid negation problem on Alphas (64 bit) in inflate.c
+ *
+ * 1.2.beta3    22 Dec 2002
+ * - Add comments on state->bits assertion in inffast.c
+ * - Add comments on op field in inftrees.h
+ * - Fix bug in reuse of allocated window after inflateReset()
+ * - Remove bit fields--back to byte structure for speed
+ * - Remove distance extra == 0 check in inflate_fast()--only helps for lengths
+ * - Change post-increments to pre-increments in inflate_fast(), PPC biased?
+ * - Add compile time option, POSTINC, to use post-increments instead (Intel?)
+ * - Make MATCH copy in inflate() much faster for when inflate_fast() not used
+ * - Use local copies of stream next and avail values, as well as local bit
+ *   buffer and bit count in inflate()--for speed when inflate_fast() not used
+ *
+ * 1.2.beta4    1 Jan 2003
+ * - Split ptr - 257 statements in inflate_table() to avoid compiler warnings
+ * - Move a comment on output buffer sizes from inffast.c to inflate.c
+ * - Add comments in inffast.c to introduce the inflate_fast() routine
+ * - Rearrange window copies in inflate_fast() for speed and simplification
+ * - Unroll last copy for window match in inflate_fast()
+ * - Use local copies of window variables in inflate_fast() for speed
+ * - Pull out common wnext == 0 case for speed in inflate_fast()
+ * - Make op and len in inflate_fast() unsigned for consistency
+ * - Add FAR to lcode and dcode declarations in inflate_fast()
+ * - Simplified bad distance check in inflate_fast()
+ * - Added inflateBackInit(), inflateBack(), and inflateBackEnd() in new
+ *   source file infback.c to provide a call-back interface to inflate for
+ *   programs like gzip and unzip -- uses window as output buffer to avoid
+ *   window copying
+ *
+ * 1.2.beta5    1 Jan 2003
+ * - Improved inflateBack() interface to allow the caller to provide initial
+ *   input in strm.
+ * - Fixed stored blocks bug in inflateBack()
+ *
+ * 1.2.beta6    4 Jan 2003
+ * - Added comments in inffast.c on effectiveness of POSTINC
+ * - Typecasting all around to reduce compiler warnings
+ * - Changed loops from while (1) or do {} while (1) to for (;;), again to
+ *   make compilers happy
+ * - Changed type of window in inflateBackInit() to unsigned char *
+ *
+ * 1.2.beta7    27 Jan 2003
+ * - Changed many types to unsigned or unsigned short to avoid warnings
+ * - Added inflateCopy() function
+ *
+ * 1.2.0        9 Mar 2003
+ * - Changed inflateBack() interface to provide separate opaque descriptors
+ *   for the in() and out() functions
+ * - Changed inflateBack() argument and in_func typedef to swap the length
+ *   and buffer address return values for the input function
+ * - Check next_in and next_out for Z_NULL on entry to inflate()
+ *
+ * The history for versions after 1.2.0 are in ChangeLog in zlib distribution.
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+#include "inflate.h"
+#include "inffast.h"
+
+#ifdef MAKEFIXED
+#  ifndef BUILDFIXED
+#    define BUILDFIXED
+#  endif
+#endif
+
+#if defined(__GNUC__) && __GNUC__>=7
+#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
+#endif
+
+/* function prototypes */
+local void fixedtables OF((struct inflate_state FAR *state));
+local int updatewindow OF((z_streamp strm, const unsigned char FAR *end,
+                           unsigned copy));
+#ifdef BUILDFIXED
+   void makefixed OF((void));
+#endif
+local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf,
+                              unsigned len));
+
+int ZEXPORT inflateResetKeep(strm)
+z_streamp strm;
+{
+    struct inflate_state FAR *state;
+
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    strm->total_in = strm->total_out = state->total = 0;
+    strm->msg = Z_NULL;
+    if (state->wrap)        /* to support ill-conceived Java test suite */
+        strm->adler = state->wrap & 1;
+    state->mode = HEAD;
+    state->last = 0;
+    state->havedict = 0;
+    state->dmax = 32768U;
+    state->head = Z_NULL;
+    state->hold = 0;
+    state->bits = 0;
+    state->lencode = state->distcode = state->next = state->codes;
+    state->sane = 1;
+    state->back = -1;
+    Tracev((stderr, "inflate: reset\n"));
+    return Z_OK;
+}
+
+int ZEXPORT inflateReset(strm)
+z_streamp strm;
+{
+    struct inflate_state FAR *state;
+
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    state->wsize = 0;
+    state->whave = 0;
+    state->wnext = 0;
+    return inflateResetKeep(strm);
+}
+
+int ZEXPORT inflateReset2(strm, windowBits)
+z_streamp strm;
+int windowBits;
+{
+    int wrap;
+    struct inflate_state FAR *state;
+
+    /* get the state */
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+
+    /* extract wrap request from windowBits parameter */
+    if (windowBits < 0) {
+        wrap = 0;
+        windowBits = -windowBits;
+    }
+    else {
+        wrap = (windowBits >> 4) + 1;
+#ifdef GUNZIP
+        if (windowBits < 48)
+            windowBits &= 15;
+#endif
+    }
+
+    /* set number of window bits, free window if different */
+    if (windowBits && (windowBits < 8 || windowBits > 15))
+        return Z_STREAM_ERROR;
+    if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) {
+        ZFREE(strm, state->window);
+        state->window = Z_NULL;
+    }
+
+    /* update state and reset the rest of it */
+    state->wrap = wrap;
+    state->wbits = (unsigned)windowBits;
+    return inflateReset(strm);
+}
+
+int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
+z_streamp strm;
+int windowBits;
+const char *version;
+int stream_size;
+{
+    int ret;
+    struct inflate_state FAR *state;
+
+    if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
+        stream_size != (int)(sizeof(z_stream)))
+        return Z_VERSION_ERROR;
+    if (strm == Z_NULL) return Z_STREAM_ERROR;
+    strm->msg = Z_NULL;                 /* in case we return an error */
+    if (strm->zalloc == (alloc_func)0) {
+#ifdef Z_SOLO
+        return Z_STREAM_ERROR;
+#else
+        strm->zalloc = zcalloc;
+        strm->opaque = (voidpf)0;
+#endif
+    }
+    if (strm->zfree == (free_func)0)
+#ifdef Z_SOLO
+        return Z_STREAM_ERROR;
+#else
+        strm->zfree = zcfree;
+#endif
+    state = (struct inflate_state FAR *)
+            ZALLOC(strm, 1, sizeof(struct inflate_state));
+    if (state == Z_NULL) return Z_MEM_ERROR;
+    Tracev((stderr, "inflate: allocated\n"));
+    strm->state = (struct internal_state FAR *)state;
+    state->window = Z_NULL;
+    ret = inflateReset2(strm, windowBits);
+    if (ret != Z_OK) {
+        ZFREE(strm, state);
+        strm->state = Z_NULL;
+    }
+    return ret;
+}
+
+int ZEXPORT inflateInit_(strm, version, stream_size)
+z_streamp strm;
+const char *version;
+int stream_size;
+{
+    return inflateInit2_(strm, DEF_WBITS, version, stream_size);
+}
+
+int ZEXPORT inflatePrime(strm, bits, value)
+z_streamp strm;
+int bits;
+int value;
+{
+    struct inflate_state FAR *state;
+
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    if (bits < 0) {
+        state->hold = 0;
+        state->bits = 0;
+        return Z_OK;
+    }
+    if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR;
+    value &= (1L << bits) - 1;
+    state->hold += value << state->bits;
+    state->bits += bits;
+    return Z_OK;
+}
+
+/*
+   Return state with length and distance decoding tables and index sizes set to
+   fixed code decoding.  Normally this returns fixed tables from inffixed.h.
+   If BUILDFIXED is defined, then instead this routine builds the tables the
+   first time it's called, and returns those tables the first time and
+   thereafter.  This reduces the size of the code by about 2K bytes, in
+   exchange for a little execution time.  However, BUILDFIXED should not be
+   used for threaded applications, since the rewriting of the tables and virgin
+   may not be thread-safe.
+ */
+local void fixedtables(state)
+struct inflate_state FAR *state;
+{
+#ifdef BUILDFIXED
+    static int virgin = 1;
+    static code *lenfix, *distfix;
+    static code fixed[544];
+
+    /* build fixed huffman tables if first call (may not be thread safe) */
+    if (virgin) {
+        unsigned sym, bits;
+        static code *next;
+
+        /* literal/length table */
+        sym = 0;
+        while (sym < 144) state->lens[sym++] = 8;
+        while (sym < 256) state->lens[sym++] = 9;
+        while (sym < 280) state->lens[sym++] = 7;
+        while (sym < 288) state->lens[sym++] = 8;
+        next = fixed;
+        lenfix = next;
+        bits = 9;
+        inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
+
+        /* distance table */
+        sym = 0;
+        while (sym < 32) state->lens[sym++] = 5;
+        distfix = next;
+        bits = 5;
+        inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
+
+        /* do this just once */
+        virgin = 0;
+    }
+#else /* !BUILDFIXED */
+#   include "inffixed.h"
+#endif /* BUILDFIXED */
+    state->lencode = lenfix;
+    state->lenbits = 9;
+    state->distcode = distfix;
+    state->distbits = 5;
+}
+
+#ifdef MAKEFIXED
+#include <stdio.h>
+
+/*
+   Write out the inffixed.h that is #include'd above.  Defining MAKEFIXED also
+   defines BUILDFIXED, so the tables are built on the fly.  makefixed() writes
+   those tables to stdout, which would be piped to inffixed.h.  A small program
+   can simply call makefixed to do this:
+
+    void makefixed(void);
+
+    int main(void)
+    {
+        makefixed();
+        return 0;
+    }
+
+   Then that can be linked with zlib built with MAKEFIXED defined and run:
+
+    a.out > inffixed.h
+ */
+void makefixed()
+{
+    unsigned low, size;
+    struct inflate_state state;
+
+    fixedtables(&state);
+    puts("    /* inffixed.h -- table for decoding fixed codes");
+    puts("     * Generated automatically by makefixed().");
+    puts("     */");
+    puts("");
+    puts("    /* WARNING: this file should *not* be used by applications.");
+    puts("       It is part of the implementation of this library and is");
+    puts("       subject to change. Applications should only use zlib.h.");
+    puts("     */");
+    puts("");
+    size = 1U << 9;
+    printf("    static const code lenfix[%u] = {", size);
+    low = 0;
+    for (;;) {
+        if ((low % 7) == 0) printf("\n        ");
+        printf("{%u,%u,%d}", (low & 127) == 99 ? 64 : state.lencode[low].op,
+               state.lencode[low].bits, state.lencode[low].val);
+        if (++low == size) break;
+        putchar(',');
+    }
+    puts("\n    };");
+    size = 1U << 5;
+    printf("\n    static const code distfix[%u] = {", size);
+    low = 0;
+    for (;;) {
+        if ((low % 6) == 0) printf("\n        ");
+        printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits,
+               state.distcode[low].val);
+        if (++low == size) break;
+        putchar(',');
+    }
+    puts("\n    };");
+}
+#endif /* MAKEFIXED */
+
+/*
+   Update the window with the last wsize (normally 32K) bytes written before
+   returning.  If window does not exist yet, create it.  This is only called
+   when a window is already in use, or when output has been written during this
+   inflate call, but the end of the deflate stream has not been reached yet.
+   It is also called to create a window for dictionary data when a dictionary
+   is loaded.
+
+   Providing output buffers larger than 32K to inflate() should provide a speed
+   advantage, since only the last 32K of output is copied to the sliding window
+   upon return from inflate(), and since all distances after the first 32K of
+   output will fall in the output data, making match copies simpler and faster.
+   The advantage may be dependent on the size of the processor's data caches.
+ */
+local int updatewindow(strm, end, copy)
+z_streamp strm;
+const Bytef *end;
+unsigned copy;
+{
+    struct inflate_state FAR *state;
+    unsigned dist;
+
+    state = (struct inflate_state FAR *)strm->state;
+
+    /* if it hasn't been done already, allocate space for the window */
+    if (state->window == Z_NULL) {
+        state->window = (unsigned char FAR *)
+                        ZALLOC(strm, 1U << state->wbits,
+                               sizeof(unsigned char));
+        if (state->window == Z_NULL) return 1;
+    }
+
+    /* if window not in use yet, initialize */
+    if (state->wsize == 0) {
+        state->wsize = 1U << state->wbits;
+        state->wnext = 0;
+        state->whave = 0;
+    }
+
+    /* copy state->wsize or less output bytes into the circular window */
+    if (copy >= state->wsize) {
+        zmemcpy(state->window, end - state->wsize, state->wsize);
+        state->wnext = 0;
+        state->whave = state->wsize;
+    }
+    else {
+        dist = state->wsize - state->wnext;
+        if (dist > copy) dist = copy;
+        zmemcpy(state->window + state->wnext, end - copy, dist);
+        copy -= dist;
+        if (copy) {
+            zmemcpy(state->window, end - copy, copy);
+            state->wnext = copy;
+            state->whave = state->wsize;
+        }
+        else {
+            state->wnext += dist;
+            if (state->wnext == state->wsize) state->wnext = 0;
+            if (state->whave < state->wsize) state->whave += dist;
+        }
+    }
+    return 0;
+}
+
+/* Macros for inflate(): */
+
+/* check function to use adler32() for zlib or crc32() for gzip */
+#ifdef GUNZIP
+#  define UPDATE(check, buf, len) \
+    (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
+#else
+#  define UPDATE(check, buf, len) adler32(check, buf, len)
+#endif
+
+/* check macros for header crc */
+#ifdef GUNZIP
+#  define CRC2(check, word) \
+    do { \
+        hbuf[0] = (unsigned char)(word); \
+        hbuf[1] = (unsigned char)((word) >> 8); \
+        check = crc32(check, hbuf, 2); \
+    } while (0)
+
+#  define CRC4(check, word) \
+    do { \
+        hbuf[0] = (unsigned char)(word); \
+        hbuf[1] = (unsigned char)((word) >> 8); \
+        hbuf[2] = (unsigned char)((word) >> 16); \
+        hbuf[3] = (unsigned char)((word) >> 24); \
+        check = crc32(check, hbuf, 4); \
+    } while (0)
+#endif
+
+/* Load registers with state in inflate() for speed */
+#define LOAD() \
+    do { \
+        put = strm->next_out; \
+        left = strm->avail_out; \
+        next = strm->next_in; \
+        have = strm->avail_in; \
+        hold = state->hold; \
+        bits = state->bits; \
+    } while (0)
+
+/* Restore state from registers in inflate() */
+#define RESTORE() \
+    do { \
+        strm->next_out = put; \
+        strm->avail_out = left; \
+        strm->next_in = next; \
+        strm->avail_in = have; \
+        state->hold = hold; \
+        state->bits = bits; \
+    } while (0)
+
+/* Clear the input bit accumulator */
+#define INITBITS() \
+    do { \
+        hold = 0; \
+        bits = 0; \
+    } while (0)
+
+/* Get a byte of input into the bit accumulator, or return from inflate()
+   if there is no input available. */
+#define PULLBYTE() \
+    do { \
+        if (have == 0) goto inf_leave; \
+        have--; \
+        hold += (unsigned long)(*next++) << bits; \
+        bits += 8; \
+    } while (0)
+
+/* Assure that there are at least n bits in the bit accumulator.  If there is
+   not enough available input to do that, then return from inflate(). */
+#define NEEDBITS(n) \
+    do { \
+        while (bits < (unsigned)(n)) \
+            PULLBYTE(); \
+    } while (0)
+
+/* Return the low n bits of the bit accumulator (n < 16) */
+#define BITS(n) \
+    ((unsigned)hold & ((1U << (n)) - 1))
+
+/* Remove n bits from the bit accumulator */
+#define DROPBITS(n) \
+    do { \
+        hold >>= (n); \
+        bits -= (unsigned)(n); \
+    } while (0)
+
+/* Remove zero to seven bits as needed to go to a byte boundary */
+#define BYTEBITS() \
+    do { \
+        hold >>= bits & 7; \
+        bits -= bits & 7; \
+    } while (0)
+
+/*
+   inflate() uses a state machine to process as much input data and generate as
+   much output data as possible before returning.  The state machine is
+   structured roughly as follows:
+
+    for (;;) switch (state) {
+    ...
+    case STATEn:
+        if (not enough input data or output space to make progress)
+            return;
+        ... make progress ...
+        state = STATEm;
+        break;
+    ...
+    }
+
+   so when inflate() is called again, the same case is attempted again, and
+   if the appropriate resources are provided, the machine proceeds to the
+   next state.  The NEEDBITS() macro is usually the way the state evaluates
+   whether it can proceed or should return.  NEEDBITS() does the return if
+   the requested bits are not available.  The typical use of the BITS macros
+   is:
+
+        NEEDBITS(n);
+        ... do something with BITS(n) ...
+        DROPBITS(n);
+
+   where NEEDBITS(n) either returns from inflate() if there isn't enough
+   input left to load n bits into the accumulator, or it continues.  BITS(n)
+   gives the low n bits in the accumulator.  When done, DROPBITS(n) drops
+   the low n bits off the accumulator.  INITBITS() clears the accumulator
+   and sets the number of available bits to zero.  BYTEBITS() discards just
+   enough bits to put the accumulator on a byte boundary.  After BYTEBITS()
+   and a NEEDBITS(8), then BITS(8) would return the next byte in the stream.
+
+   NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return
+   if there is no input available.  The decoding of variable length codes uses
+   PULLBYTE() directly in order to pull just enough bytes to decode the next
+   code, and no more.
+
+   Some states loop until they get enough input, making sure that enough
+   state information is maintained to continue the loop where it left off
+   if NEEDBITS() returns in the loop.  For example, want, need, and keep
+   would all have to actually be part of the saved state in case NEEDBITS()
+   returns:
+
+    case STATEw:
+        while (want < need) {
+            NEEDBITS(n);
+            keep[want++] = BITS(n);
+            DROPBITS(n);
+        }
+        state = STATEx;
+    case STATEx:
+
+   As shown above, if the next state is also the next case, then the break
+   is omitted.
+
+   A state may also return if there is not enough output space available to
+   complete that state.  Those states are copying stored data, writing a
+   literal byte, and copying a matching string.
+
+   When returning, a "goto inf_leave" is used to update the total counters,
+   update the check value, and determine whether any progress has been made
+   during that inflate() call in order to return the proper return code.
+   Progress is defined as a change in either strm->avail_in or strm->avail_out.
+   When there is a window, goto inf_leave will update the window with the last
+   output written.  If a goto inf_leave occurs in the middle of decompression
+   and there is no window currently, goto inf_leave will create one and copy
+   output to the window for the next call of inflate().
+
+   In this implementation, the flush parameter of inflate() only affects the
+   return code (per zlib.h).  inflate() always writes as much as possible to
+   strm->next_out, given the space available and the provided input--the effect
+   documented in zlib.h of Z_SYNC_FLUSH.  Furthermore, inflate() always defers
+   the allocation of and copying into a sliding window until necessary, which
+   provides the effect documented in zlib.h for Z_FINISH when the entire input
+   stream available.  So the only thing the flush parameter actually does is:
+   when flush is set to Z_FINISH, inflate() cannot return Z_OK.  Instead it
+   will return Z_BUF_ERROR if it has not reached the end of the stream.
+ */
+
+int ZEXPORT inflate(strm, flush)
+z_streamp strm;
+int flush;
+{
+    struct inflate_state FAR *state;
+    z_const unsigned char FAR *next;    /* next input */
+    unsigned char FAR *put;     /* next output */
+    unsigned have, left;        /* available input and output */
+    unsigned long hold;         /* bit buffer */
+    unsigned bits;              /* bits in bit buffer */
+    unsigned in, out;           /* save starting available input and output */
+    unsigned copy;              /* number of stored or match bytes to copy */
+    unsigned char FAR *from;    /* where to copy match bytes from */
+    code here;                  /* current decoding table entry */
+    code last;                  /* parent table entry */
+    unsigned len;               /* length to copy for repeats, bits to drop */
+    int ret;                    /* return code */
+#ifdef GUNZIP
+    unsigned char hbuf[4];      /* buffer for gzip header crc calculation */
+#endif
+    static const unsigned short order[19] = /* permutation of code lengths */
+        {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
+
+    if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL ||
+        (strm->next_in == Z_NULL && strm->avail_in != 0))
+        return Z_STREAM_ERROR;
+
+    state = (struct inflate_state FAR *)strm->state;
+    if (state->mode == TYPE) state->mode = TYPEDO;      /* skip check */
+    LOAD();
+    in = have;
+    out = left;
+    ret = Z_OK;
+    for (;;)
+        switch (state->mode) {
+        case HEAD:
+            if (state->wrap == 0) {
+                state->mode = TYPEDO;
+                break;
+            }
+            NEEDBITS(16);
+#ifdef GUNZIP
+            if ((state->wrap & 2) && hold == 0x8b1f) {  /* gzip header */
+                state->check = crc32(0L, Z_NULL, 0);
+                CRC2(state->check, hold);
+                INITBITS();
+                state->mode = FLAGS;
+                break;
+            }
+            state->flags = 0;           /* expect zlib header */
+            if (state->head != Z_NULL)
+                state->head->done = -1;
+            if (!(state->wrap & 1) ||   /* check if zlib header allowed */
+#else
+            if (
+#endif
+                ((BITS(8) << 8) + (hold >> 8)) % 31) {
+                strm->msg = (char *)"incorrect header check";
+                state->mode = BAD;
+                break;
+            }
+            if (BITS(4) != Z_DEFLATED) {
+                strm->msg = (char *)"unknown compression method";
+                state->mode = BAD;
+                break;
+            }
+            DROPBITS(4);
+            len = BITS(4) + 8;
+            if (state->wbits == 0)
+                state->wbits = len;
+            else if (len > state->wbits) {
+                strm->msg = (char *)"invalid window size";
+                state->mode = BAD;
+                break;
+            }
+            state->dmax = 1U << len;
+            Tracev((stderr, "inflate:   zlib header ok\n"));
+            strm->adler = state->check = adler32(0L, Z_NULL, 0);
+            state->mode = hold & 0x200 ? DICTID : TYPE;
+            INITBITS();
+            break;
+#ifdef GUNZIP
+        case FLAGS:
+            NEEDBITS(16);
+            state->flags = (int)(hold);
+            if ((state->flags & 0xff) != Z_DEFLATED) {
+                strm->msg = (char *)"unknown compression method";
+                state->mode = BAD;
+                break;
+            }
+            if (state->flags & 0xe000) {
+                strm->msg = (char *)"unknown header flags set";
+                state->mode = BAD;
+                break;
+            }
+            if (state->head != Z_NULL)
+                state->head->text = (int)((hold >> 8) & 1);
+            if (state->flags & 0x0200) CRC2(state->check, hold);
+            INITBITS();
+            state->mode = TIME;
+        case TIME:
+            NEEDBITS(32);
+            if (state->head != Z_NULL)
+                state->head->time = hold;
+            if (state->flags & 0x0200) CRC4(state->check, hold);
+            INITBITS();
+            state->mode = OS;
+        case OS:
+            NEEDBITS(16);
+            if (state->head != Z_NULL) {
+                state->head->xflags = (int)(hold & 0xff);
+                state->head->os = (int)(hold >> 8);
+            }
+            if (state->flags & 0x0200) CRC2(state->check, hold);
+            INITBITS();
+            state->mode = EXLEN;
+        case EXLEN:
+            if (state->flags & 0x0400) {
+                NEEDBITS(16);
+                state->length = (unsigned)(hold);
+                if (state->head != Z_NULL)
+                    state->head->extra_len = (unsigned)hold;
+                if (state->flags & 0x0200) CRC2(state->check, hold);
+                INITBITS();
+            }
+            else if (state->head != Z_NULL)
+                state->head->extra = Z_NULL;
+            state->mode = EXTRA;
+        case EXTRA:
+            if (state->flags & 0x0400) {
+                copy = state->length;
+                if (copy > have) copy = have;
+                if (copy) {
+                    if (state->head != Z_NULL &&
+                        state->head->extra != Z_NULL) {
+                        len = state->head->extra_len - state->length;
+                        zmemcpy(state->head->extra + len, next,
+                                len + copy > state->head->extra_max ?
+                                state->head->extra_max - len : copy);
+                    }
+                    if (state->flags & 0x0200)
+                        state->check = crc32(state->check, next, copy);
+                    have -= copy;
+                    next += copy;
+                    state->length -= copy;
+                }
+                if (state->length) goto inf_leave;
+            }
+            state->length = 0;
+            state->mode = NAME;
+        case NAME:
+            if (state->flags & 0x0800) {
+                if (have == 0) goto inf_leave;
+                copy = 0;
+                do {
+                    len = (unsigned)(next[copy++]);
+                    if (state->head != Z_NULL &&
+                            state->head->name != Z_NULL &&
+                            state->length < state->head->name_max)
+                        state->head->name[state->length++] = len;
+                } while (len && copy < have);
+                if (state->flags & 0x0200)
+                    state->check = crc32(state->check, next, copy);
+                have -= copy;
+                next += copy;
+                if (len) goto inf_leave;
+            }
+            else if (state->head != Z_NULL)
+                state->head->name = Z_NULL;
+            state->length = 0;
+            state->mode = COMMENT;
+        case COMMENT:
+            if (state->flags & 0x1000) {
+                if (have == 0) goto inf_leave;
+                copy = 0;
+                do {
+                    len = (unsigned)(next[copy++]);
+                    if (state->head != Z_NULL &&
+                            state->head->comment != Z_NULL &&
+                            state->length < state->head->comm_max)
+                        state->head->comment[state->length++] = len;
+                } while (len && copy < have);
+                if (state->flags & 0x0200)
+                    state->check = crc32(state->check, next, copy);
+                have -= copy;
+                next += copy;
+                if (len) goto inf_leave;
+            }
+            else if (state->head != Z_NULL)
+                state->head->comment = Z_NULL;
+            state->mode = HCRC;
+        case HCRC:
+            if (state->flags & 0x0200) {
+                NEEDBITS(16);
+                if (hold != (state->check & 0xffff)) {
+                    strm->msg = (char *)"header crc mismatch";
+                    state->mode = BAD;
+                    break;
+                }
+                INITBITS();
+            }
+            if (state->head != Z_NULL) {
+                state->head->hcrc = (int)((state->flags >> 9) & 1);
+                state->head->done = 1;
+            }
+            strm->adler = state->check = crc32(0L, Z_NULL, 0);
+            state->mode = TYPE;
+            break;
+#endif
+        case DICTID:
+            NEEDBITS(32);
+            strm->adler = state->check = ZSWAP32(hold);
+            INITBITS();
+            state->mode = DICT;
+        case DICT:
+            if (state->havedict == 0) {
+                RESTORE();
+                return Z_NEED_DICT;
+            }
+            strm->adler = state->check = adler32(0L, Z_NULL, 0);
+            state->mode = TYPE;
+        case TYPE:
+            if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
+        case TYPEDO:
+            if (state->last) {
+                BYTEBITS();
+                state->mode = CHECK;
+                break;
+            }
+            NEEDBITS(3);
+            state->last = BITS(1);
+            DROPBITS(1);
+            switch (BITS(2)) {
+            case 0:                             /* stored block */
+                Tracev((stderr, "inflate:     stored block%s\n",
+                        state->last ? " (last)" : ""));
+                state->mode = STORED;
+                break;
+            case 1:                             /* fixed block */
+                fixedtables(state);
+                Tracev((stderr, "inflate:     fixed codes block%s\n",
+                        state->last ? " (last)" : ""));
+                state->mode = LEN_;             /* decode codes */
+                if (flush == Z_TREES) {
+                    DROPBITS(2);
+                    goto inf_leave;
+                }
+                break;
+            case 2:                             /* dynamic block */
+                Tracev((stderr, "inflate:     dynamic codes block%s\n",
+                        state->last ? " (last)" : ""));
+                state->mode = TABLE;
+                break;
+            case 3:
+                strm->msg = (char *)"invalid block type";
+                state->mode = BAD;
+            }
+            DROPBITS(2);
+            break;
+        case STORED:
+            BYTEBITS();                         /* go to byte boundary */
+            NEEDBITS(32);
+            if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
+                strm->msg = (char *)"invalid stored block lengths";
+                state->mode = BAD;
+                break;
+            }
+            state->length = (unsigned)hold & 0xffff;
+            Tracev((stderr, "inflate:       stored length %u\n",
+                    state->length));
+            INITBITS();
+            state->mode = COPY_;
+            if (flush == Z_TREES) goto inf_leave;
+        case COPY_:
+            state->mode = COPY;
+        case COPY:
+            copy = state->length;
+            if (copy) {
+                if (copy > have) copy = have;
+                if (copy > left) copy = left;
+                if (copy == 0) goto inf_leave;
+                zmemcpy(put, next, copy);
+                have -= copy;
+                next += copy;
+                left -= copy;
+                put += copy;
+                state->length -= copy;
+                break;
+            }
+            Tracev((stderr, "inflate:       stored end\n"));
+            state->mode = TYPE;
+            break;
+        case TABLE:
+            NEEDBITS(14);
+            state->nlen = BITS(5) + 257;
+            DROPBITS(5);
+            state->ndist = BITS(5) + 1;
+            DROPBITS(5);
+            state->ncode = BITS(4) + 4;
+            DROPBITS(4);
+#ifndef PKZIP_BUG_WORKAROUND
+            if (state->nlen > 286 || state->ndist > 30) {
+                strm->msg = (char *)"too many length or distance symbols";
+                state->mode = BAD;
+                break;
+            }
+#endif
+            Tracev((stderr, "inflate:       table sizes ok\n"));
+            state->have = 0;
+            state->mode = LENLENS;
+        case LENLENS:
+            while (state->have < state->ncode) {
+                NEEDBITS(3);
+                state->lens[order[state->have++]] = (unsigned short)BITS(3);
+                DROPBITS(3);
+            }
+            while (state->have < 19)
+                state->lens[order[state->have++]] = 0;
+            state->next = state->codes;
+            state->lencode = (const code FAR *)(state->next);
+            state->lenbits = 7;
+            ret = inflate_table(CODES, state->lens, 19, &(state->next),
+                                &(state->lenbits), state->work);
+            if (ret) {
+                strm->msg = (char *)"invalid code lengths set";
+                state->mode = BAD;
+                break;
+            }
+            Tracev((stderr, "inflate:       code lengths ok\n"));
+            state->have = 0;
+            state->mode = CODELENS;
+        case CODELENS:
+            while (state->have < state->nlen + state->ndist) {
+                for (;;) {
+                    here = state->lencode[BITS(state->lenbits)];
+                    if ((unsigned)(here.bits) <= bits) break;
+                    PULLBYTE();
+                }
+                if (here.val < 16) {
+                    DROPBITS(here.bits);
+                    state->lens[state->have++] = here.val;
+                }
+                else {
+                    if (here.val == 16) {
+                        NEEDBITS(here.bits + 2);
+                        DROPBITS(here.bits);
+                        if (state->have == 0) {
+                            strm->msg = (char *)"invalid bit length repeat";
+                            state->mode = BAD;
+                            break;
+                        }
+                        len = state->lens[state->have - 1];
+                        copy = 3 + BITS(2);
+                        DROPBITS(2);
+                    }
+                    else if (here.val == 17) {
+                        NEEDBITS(here.bits + 3);
+                        DROPBITS(here.bits);
+                        len = 0;
+                        copy = 3 + BITS(3);
+                        DROPBITS(3);
+                    }
+                    else {
+                        NEEDBITS(here.bits + 7);
+                        DROPBITS(here.bits);
+                        len = 0;
+                        copy = 11 + BITS(7);
+                        DROPBITS(7);
+                    }
+                    if (state->have + copy > state->nlen + state->ndist) {
+                        strm->msg = (char *)"invalid bit length repeat";
+                        state->mode = BAD;
+                        break;
+                    }
+                    while (copy--)
+                        state->lens[state->have++] = (unsigned short)len;
+                }
+            }
+
+            /* handle error breaks in while */
+            if (state->mode == BAD) break;
+
+            /* check for end-of-block code (better have one) */
+            if (state->lens[256] == 0) {
+                strm->msg = (char *)"invalid code -- missing end-of-block";
+                state->mode = BAD;
+                break;
+            }
+
+            /* build code tables -- note: do not change the lenbits or distbits
+               values here (9 and 6) without reading the comments in inftrees.h
+               concerning the ENOUGH constants, which depend on those values */
+            state->next = state->codes;
+            state->lencode = (const code FAR *)(state->next);
+            state->lenbits = 9;
+            ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
+                                &(state->lenbits), state->work);
+            if (ret) {
+                strm->msg = (char *)"invalid literal/lengths set";
+                state->mode = BAD;
+                break;
+            }
+            state->distcode = (const code FAR *)(state->next);
+            state->distbits = 6;
+            ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
+                            &(state->next), &(state->distbits), state->work);
+            if (ret) {
+                strm->msg = (char *)"invalid distances set";
+                state->mode = BAD;
+                break;
+            }
+            Tracev((stderr, "inflate:       codes ok\n"));
+            state->mode = LEN_;
+            if (flush == Z_TREES) goto inf_leave;
+        case LEN_:
+            state->mode = LEN;
+        case LEN:
+            if (have >= 6 && left >= 258) {
+                RESTORE();
+                inflate_fast(strm, out);
+                LOAD();
+                if (state->mode == TYPE)
+                    state->back = -1;
+                break;
+            }
+            state->back = 0;
+            for (;;) {
+                here = state->lencode[BITS(state->lenbits)];
+                if ((unsigned)(here.bits) <= bits) break;
+                PULLBYTE();
+            }
+            if (here.op && (here.op & 0xf0) == 0) {
+                last = here;
+                for (;;) {
+                    here = state->lencode[last.val +
+                            (BITS(last.bits + last.op) >> last.bits)];
+                    if ((unsigned)(last.bits + here.bits) <= bits) break;
+                    PULLBYTE();
+                }
+                DROPBITS(last.bits);
+                state->back += last.bits;
+            }
+            DROPBITS(here.bits);
+            state->back += here.bits;
+            state->length = (unsigned)here.val;
+            if ((int)(here.op) == 0) {
+                Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
+                        "inflate:         literal '%c'\n" :
+                        "inflate:         literal 0x%02x\n", here.val));
+                state->mode = LIT;
+                break;
+            }
+            if (here.op & 32) {
+                Tracevv((stderr, "inflate:         end of block\n"));
+                state->back = -1;
+                state->mode = TYPE;
+                break;
+            }
+            if (here.op & 64) {
+                strm->msg = (char *)"invalid literal/length code";
+                state->mode = BAD;
+                break;
+            }
+            state->extra = (unsigned)(here.op) & 15;
+            state->mode = LENEXT;
+        case LENEXT:
+            if (state->extra) {
+                NEEDBITS(state->extra);
+                state->length += BITS(state->extra);
+                DROPBITS(state->extra);
+                state->back += state->extra;
+            }
+            Tracevv((stderr, "inflate:         length %u\n", state->length));
+            state->was = state->length;
+            state->mode = DIST;
+        case DIST:
+            for (;;) {
+                here = state->distcode[BITS(state->distbits)];
+                if ((unsigned)(here.bits) <= bits) break;
+                PULLBYTE();
+            }
+            if ((here.op & 0xf0) == 0) {
+                last = here;
+                for (;;) {
+                    here = state->distcode[last.val +
+                            (BITS(last.bits + last.op) >> last.bits)];
+                    if ((unsigned)(last.bits + here.bits) <= bits) break;
+                    PULLBYTE();
+                }
+                DROPBITS(last.bits);
+                state->back += last.bits;
+            }
+            DROPBITS(here.bits);
+            state->back += here.bits;
+            if (here.op & 64) {
+                strm->msg = (char *)"invalid distance code";
+                state->mode = BAD;
+                break;
+            }
+            state->offset = (unsigned)here.val;
+            state->extra = (unsigned)(here.op) & 15;
+            state->mode = DISTEXT;
+        case DISTEXT:
+            if (state->extra) {
+                NEEDBITS(state->extra);
+                state->offset += BITS(state->extra);
+                DROPBITS(state->extra);
+                state->back += state->extra;
+            }
+#ifdef INFLATE_STRICT
+            if (state->offset > state->dmax) {
+                strm->msg = (char *)"invalid distance too far back";
+                state->mode = BAD;
+                break;
+            }
+#endif
+            Tracevv((stderr, "inflate:         distance %u\n", state->offset));
+            state->mode = MATCH;
+        case MATCH:
+            if (left == 0) goto inf_leave;
+            copy = out - left;
+            if (state->offset > copy) {         /* copy from window */
+                copy = state->offset - copy;
+                if (copy > state->whave) {
+                    if (state->sane) {
+                        strm->msg = (char *)"invalid distance too far back";
+                        state->mode = BAD;
+                        break;
+                    }
+#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+                    Trace((stderr, "inflate.c too far\n"));
+                    copy -= state->whave;
+                    if (copy > state->length) copy = state->length;
+                    if (copy > left) copy = left;
+                    left -= copy;
+                    state->length -= copy;
+                    do {
+                        *put++ = 0;
+                    } while (--copy);
+                    if (state->length == 0) state->mode = LEN;
+                    break;
+#endif
+                }
+                if (copy > state->wnext) {
+                    copy -= state->wnext;
+                    from = state->window + (state->wsize - copy);
+                }
+                else
+                    from = state->window + (state->wnext - copy);
+                if (copy > state->length) copy = state->length;
+            }
+            else {                              /* copy from output */
+                from = put - state->offset;
+                copy = state->length;
+            }
+            if (copy > left) copy = left;
+            left -= copy;
+            state->length -= copy;
+            do {
+                *put++ = *from++;
+            } while (--copy);
+            if (state->length == 0) state->mode = LEN;
+            break;
+        case LIT:
+            if (left == 0) goto inf_leave;
+            *put++ = (unsigned char)(state->length);
+            left--;
+            state->mode = LEN;
+            break;
+        case CHECK:
+            if (state->wrap) {
+                NEEDBITS(32);
+                out -= left;
+                strm->total_out += out;
+                state->total += out;
+                if (out)
+                    strm->adler = state->check =
+                        UPDATE(state->check, put - out, out);
+                out = left;
+                if ((
+#ifdef GUNZIP
+                     state->flags ? hold :
+#endif
+                     ZSWAP32(hold)) != state->check) {
+                    strm->msg = (char *)"incorrect data check";
+                    state->mode = BAD;
+                    break;
+                }
+                INITBITS();
+                Tracev((stderr, "inflate:   check matches trailer\n"));
+            }
+#ifdef GUNZIP
+            state->mode = LENGTH;
+        case LENGTH:
+            if (state->wrap && state->flags) {
+                NEEDBITS(32);
+                if (hold != (state->total & 0xffffffffUL)) {
+                    strm->msg = (char *)"incorrect length check";
+                    state->mode = BAD;
+                    break;
+                }
+                INITBITS();
+                Tracev((stderr, "inflate:   length matches trailer\n"));
+            }
+#endif
+            state->mode = DONE;
+        case DONE:
+            ret = Z_STREAM_END;
+            goto inf_leave;
+        case BAD:
+            ret = Z_DATA_ERROR;
+            goto inf_leave;
+        case MEM:
+            return Z_MEM_ERROR;
+        case SYNC:
+        default:
+            return Z_STREAM_ERROR;
+        }
+
+    /*
+       Return from inflate(), updating the total counts and the check value.
+       If there was no progress during the inflate() call, return a buffer
+       error.  Call updatewindow() to create and/or update the window state.
+       Note: a memory error from inflate() is non-recoverable.
+     */
+  inf_leave:
+    RESTORE();
+    if (state->wsize || (out != strm->avail_out && state->mode < BAD &&
+            (state->mode < CHECK || flush != Z_FINISH)))
+        if (updatewindow(strm, strm->next_out, out - strm->avail_out)) {
+            state->mode = MEM;
+            return Z_MEM_ERROR;
+        }
+    in -= strm->avail_in;
+    out -= strm->avail_out;
+    strm->total_in += in;
+    strm->total_out += out;
+    state->total += out;
+    if (state->wrap && out)
+        strm->adler = state->check =
+            UPDATE(state->check, strm->next_out - out, out);
+    strm->data_type = state->bits + (state->last ? 64 : 0) +
+                      (state->mode == TYPE ? 128 : 0) +
+                      (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0);
+    if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
+        ret = Z_BUF_ERROR;
+    return ret;
+}
+
+int ZEXPORT inflateEnd(strm)
+z_streamp strm;
+{
+    struct inflate_state FAR *state;
+    if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
+        return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    if (state->window != Z_NULL) ZFREE(strm, state->window);
+    ZFREE(strm, strm->state);
+    strm->state = Z_NULL;
+    Tracev((stderr, "inflate: end\n"));
+    return Z_OK;
+}
+
+int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength)
+z_streamp strm;
+Bytef *dictionary;
+uInt *dictLength;
+{
+    struct inflate_state FAR *state;
+
+    /* check state */
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+
+    /* copy dictionary */
+    if (state->whave && dictionary != Z_NULL) {
+        zmemcpy(dictionary, state->window + state->wnext,
+                state->whave - state->wnext);
+        zmemcpy(dictionary + state->whave - state->wnext,
+                state->window, state->wnext);
+    }
+    if (dictLength != Z_NULL)
+        *dictLength = state->whave;
+    return Z_OK;
+}
+
+int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength)
+z_streamp strm;
+const Bytef *dictionary;
+uInt dictLength;
+{
+    struct inflate_state FAR *state;
+    unsigned long dictid;
+    int ret;
+
+    /* check state */
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    if (state->wrap != 0 && state->mode != DICT)
+        return Z_STREAM_ERROR;
+
+    /* check for correct dictionary identifier */
+    if (state->mode == DICT) {
+        dictid = adler32(0L, Z_NULL, 0);
+        dictid = adler32(dictid, dictionary, dictLength);
+        if (dictid != state->check)
+            return Z_DATA_ERROR;
+    }
+
+    /* copy dictionary to window using updatewindow(), which will amend the
+       existing dictionary if appropriate */
+    ret = updatewindow(strm, dictionary + dictLength, dictLength);
+    if (ret) {
+        state->mode = MEM;
+        return Z_MEM_ERROR;
+    }
+    state->havedict = 1;
+    Tracev((stderr, "inflate:   dictionary set\n"));
+    return Z_OK;
+}
+
+int ZEXPORT inflateGetHeader(strm, head)
+z_streamp strm;
+gz_headerp head;
+{
+    struct inflate_state FAR *state;
+
+    /* check state */
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    if ((state->wrap & 2) == 0) return Z_STREAM_ERROR;
+
+    /* save header structure */
+    state->head = head;
+    head->done = 0;
+    return Z_OK;
+}
+
+/*
+   Search buf[0..len-1] for the pattern: 0, 0, 0xff, 0xff.  Return when found
+   or when out of input.  When called, *have is the number of pattern bytes
+   found in order so far, in 0..3.  On return *have is updated to the new
+   state.  If on return *have equals four, then the pattern was found and the
+   return value is how many bytes were read including the last byte of the
+   pattern.  If *have is less than four, then the pattern has not been found
+   yet and the return value is len.  In the latter case, syncsearch() can be
+   called again with more data and the *have state.  *have is initialized to
+   zero for the first call.
+ */
+local unsigned syncsearch(have, buf, len)
+unsigned FAR *have;
+const unsigned char FAR *buf;
+unsigned len;
+{
+    unsigned got;
+    unsigned next;
+
+    got = *have;
+    next = 0;
+    while (next < len && got < 4) {
+        if ((int)(buf[next]) == (got < 2 ? 0 : 0xff))
+            got++;
+        else if (buf[next])
+            got = 0;
+        else
+            got = 4 - got;
+        next++;
+    }
+    *have = got;
+    return next;
+}
+
+int ZEXPORT inflateSync(strm)
+z_streamp strm;
+{
+    unsigned len;               /* number of bytes to look at or looked at */
+    unsigned long in, out;      /* temporary to save total_in and total_out */
+    unsigned char buf[4];       /* to restore bit buffer to byte string */
+    struct inflate_state FAR *state;
+
+    /* check parameters */
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR;
+
+    /* if first time, start search in bit buffer */
+    if (state->mode != SYNC) {
+        state->mode = SYNC;
+        state->hold <<= state->bits & 7;
+        state->bits -= state->bits & 7;
+        len = 0;
+        while (state->bits >= 8) {
+            buf[len++] = (unsigned char)(state->hold);
+            state->hold >>= 8;
+            state->bits -= 8;
+        }
+        state->have = 0;
+        syncsearch(&(state->have), buf, len);
+    }
+
+    /* search available input */
+    len = syncsearch(&(state->have), strm->next_in, strm->avail_in);
+    strm->avail_in -= len;
+    strm->next_in += len;
+    strm->total_in += len;
+
+    /* return no joy or set up to restart inflate() on a new block */
+    if (state->have != 4) return Z_DATA_ERROR;
+    in = strm->total_in;  out = strm->total_out;
+    inflateReset(strm);
+    strm->total_in = in;  strm->total_out = out;
+    state->mode = TYPE;
+    return Z_OK;
+}
+
+/*
+   Returns true if inflate is currently at the end of a block generated by
+   Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
+   implementation to provide an additional safety check. PPP uses
+   Z_SYNC_FLUSH but removes the length bytes of the resulting empty stored
+   block. When decompressing, PPP checks that at the end of input packet,
+   inflate is waiting for these length bytes.
+ */
+int ZEXPORT inflateSyncPoint(strm)
+z_streamp strm;
+{
+    struct inflate_state FAR *state;
+
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    return state->mode == STORED && state->bits == 0;
+}
+
+int ZEXPORT inflateCopy(dest, source)
+z_streamp dest;
+z_streamp source;
+{
+    struct inflate_state FAR *state;
+    struct inflate_state FAR *copy;
+    unsigned char FAR *window;
+    unsigned wsize;
+
+    /* check input */
+    if (dest == Z_NULL || source == Z_NULL || source->state == Z_NULL ||
+        source->zalloc == (alloc_func)0 || source->zfree == (free_func)0)
+        return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)source->state;
+
+    /* allocate space */
+    copy = (struct inflate_state FAR *)
+           ZALLOC(source, 1, sizeof(struct inflate_state));
+    if (copy == Z_NULL) return Z_MEM_ERROR;
+    window = Z_NULL;
+    if (state->window != Z_NULL) {
+        window = (unsigned char FAR *)
+                 ZALLOC(source, 1U << state->wbits, sizeof(unsigned char));
+        if (window == Z_NULL) {
+            ZFREE(source, copy);
+            return Z_MEM_ERROR;
+        }
+    }
+
+    /* copy state */
+    zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));
+    zmemcpy((voidpf)copy, (voidpf)state, sizeof(struct inflate_state));
+    if (state->lencode >= state->codes &&
+        state->lencode <= state->codes + ENOUGH - 1) {
+        copy->lencode = copy->codes + (state->lencode - state->codes);
+        copy->distcode = copy->codes + (state->distcode - state->codes);
+    }
+    copy->next = copy->codes + (state->next - state->codes);
+    if (window != Z_NULL) {
+        wsize = 1U << state->wbits;
+        zmemcpy(window, state->window, wsize);
+    }
+    copy->window = window;
+    dest->state = (struct internal_state FAR *)copy;
+    return Z_OK;
+}
+
+int ZEXPORT inflateUndermine(strm, subvert)
+z_streamp strm;
+int subvert;
+{
+    struct inflate_state FAR *state;
+
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    state->sane = !subvert;
+#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+    return Z_OK;
+#else
+    state->sane = 1;
+    return Z_DATA_ERROR;
+#endif
+}
+
+long ZEXPORT inflateMark(strm)
+z_streamp strm;
+{
+    struct inflate_state FAR *state;
+
+    if (strm == Z_NULL || strm->state == Z_NULL) return ~0xFFFFL; /* Original code returned -1L << 16, but that is undefined behaviour */
+    state = (struct inflate_state FAR *)strm->state;
+    return ((long)(state->back) << 16) +
+        (state->mode == COPY ? state->length :
+            (state->mode == MATCH ? state->was - state->length : 0));
+}
diff --git a/src/external/tng_io/external/zlib/inflate.h b/src/external/tng_io/external/zlib/inflate.h
new file mode 100644 (file)
index 0000000..95f4986
--- /dev/null
@@ -0,0 +1,122 @@
+/* inflate.h -- internal inflate state definition
+ * Copyright (C) 1995-2009 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+   part of the implementation of the compression library and is
+   subject to change. Applications should only use zlib.h.
+ */
+
+/* define NO_GZIP when compiling if you want to disable gzip header and
+   trailer decoding by inflate().  NO_GZIP would be used to avoid linking in
+   the crc code when it is not needed.  For shared libraries, gzip decoding
+   should be left enabled. */
+#ifndef NO_GZIP
+#  define GUNZIP
+#endif
+
+/* Possible inflate modes between inflate() calls */
+typedef enum {
+    HEAD,       /* i: waiting for magic header */
+    FLAGS,      /* i: waiting for method and flags (gzip) */
+    TIME,       /* i: waiting for modification time (gzip) */
+    OS,         /* i: waiting for extra flags and operating system (gzip) */
+    EXLEN,      /* i: waiting for extra length (gzip) */
+    EXTRA,      /* i: waiting for extra bytes (gzip) */
+    NAME,       /* i: waiting for end of file name (gzip) */
+    COMMENT,    /* i: waiting for end of comment (gzip) */
+    HCRC,       /* i: waiting for header crc (gzip) */
+    DICTID,     /* i: waiting for dictionary check value */
+    DICT,       /* waiting for inflateSetDictionary() call */
+        TYPE,       /* i: waiting for type bits, including last-flag bit */
+        TYPEDO,     /* i: same, but skip check to exit inflate on new block */
+        STORED,     /* i: waiting for stored size (length and complement) */
+        COPY_,      /* i/o: same as COPY below, but only first time in */
+        COPY,       /* i/o: waiting for input or output to copy stored block */
+        TABLE,      /* i: waiting for dynamic block table lengths */
+        LENLENS,    /* i: waiting for code length code lengths */
+        CODELENS,   /* i: waiting for length/lit and distance code lengths */
+            LEN_,       /* i: same as LEN below, but only first time in */
+            LEN,        /* i: waiting for length/lit/eob code */
+            LENEXT,     /* i: waiting for length extra bits */
+            DIST,       /* i: waiting for distance code */
+            DISTEXT,    /* i: waiting for distance extra bits */
+            MATCH,      /* o: waiting for output space to copy string */
+            LIT,        /* o: waiting for output space to write literal */
+    CHECK,      /* i: waiting for 32-bit check value */
+    LENGTH,     /* i: waiting for 32-bit length (gzip) */
+    DONE,       /* finished check, done -- remain here until reset */
+    BAD,        /* got a data error -- remain here until reset */
+    MEM,        /* got an inflate() memory error -- remain here until reset */
+    SYNC        /* looking for synchronization bytes to restart inflate() */
+} inflate_mode;
+
+/*
+    State transitions between above modes -
+
+    (most modes can go to BAD or MEM on error -- not shown for clarity)
+
+    Process header:
+        HEAD -> (gzip) or (zlib) or (raw)
+        (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME -> COMMENT ->
+                  HCRC -> TYPE
+        (zlib) -> DICTID or TYPE
+        DICTID -> DICT -> TYPE
+        (raw) -> TYPEDO
+    Read deflate blocks:
+            TYPE -> TYPEDO -> STORED or TABLE or LEN_ or CHECK
+            STORED -> COPY_ -> COPY -> TYPE
+            TABLE -> LENLENS -> CODELENS -> LEN_
+            LEN_ -> LEN
+    Read deflate codes in fixed or dynamic block:
+                LEN -> LENEXT or LIT or TYPE
+                LENEXT -> DIST -> DISTEXT -> MATCH -> LEN
+                LIT -> LEN
+    Process trailer:
+        CHECK -> LENGTH -> DONE
+ */
+
+/* state maintained between inflate() calls.  Approximately 10K bytes. */
+struct inflate_state {
+    inflate_mode mode;          /* current inflate mode */
+    int last;                   /* true if processing last block */
+    int wrap;                   /* bit 0 true for zlib, bit 1 true for gzip */
+    int havedict;               /* true if dictionary provided */
+    int flags;                  /* gzip header method and flags (0 if zlib) */
+    unsigned dmax;              /* zlib header max distance (INFLATE_STRICT) */
+    unsigned long check;        /* protected copy of check value */
+    unsigned long total;        /* protected copy of output count */
+    gz_headerp head;            /* where to save gzip header information */
+        /* sliding window */
+    unsigned wbits;             /* log base 2 of requested window size */
+    unsigned wsize;             /* window size or zero if not using window */
+    unsigned whave;             /* valid bytes in the window */
+    unsigned wnext;             /* window write index */
+    unsigned char FAR *window;  /* allocated sliding window, if needed */
+        /* bit accumulator */
+    unsigned long hold;         /* input bit accumulator */
+    unsigned bits;              /* number of bits in "in" */
+        /* for string and stored block copying */
+    unsigned length;            /* literal or length of data to copy */
+    unsigned offset;            /* distance back to copy string from */
+        /* for table and code decoding */
+    unsigned extra;             /* extra bits needed */
+        /* fixed and dynamic code tables */
+    code const FAR *lencode;    /* starting table for length/literal codes */
+    code const FAR *distcode;   /* starting table for distance codes */
+    unsigned lenbits;           /* index bits for lencode */
+    unsigned distbits;          /* index bits for distcode */
+        /* dynamic table building */
+    unsigned ncode;             /* number of code length code lengths */
+    unsigned nlen;              /* number of length code lengths */
+    unsigned ndist;             /* number of distance code lengths */
+    unsigned have;              /* number of code lengths in lens[] */
+    code FAR *next;             /* next available space in codes[] */
+    unsigned short lens[320];   /* temporary storage for code lengths */
+    unsigned short work[288];   /* work area for code table building */
+    code codes[ENOUGH];         /* space for code tables */
+    int sane;                   /* if false, allow invalid distance too far */
+    int back;                   /* bits back of last unprocessed length/lit */
+    unsigned was;               /* initial length of match */
+};
diff --git a/src/external/tng_io/external/zlib/inftrees.c b/src/external/tng_io/external/zlib/inftrees.c
new file mode 100644 (file)
index 0000000..44d89cf
--- /dev/null
@@ -0,0 +1,306 @@
+/* inftrees.c -- generate Huffman trees for efficient decoding
+ * Copyright (C) 1995-2013 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+
+#define MAXBITS 15
+
+const char inflate_copyright[] =
+   " inflate 1.2.8 Copyright 1995-2013 Mark Adler ";
+/*
+  If you use the zlib library in a product, an acknowledgment is welcome
+  in the documentation of your product. If for some reason you cannot
+  include such an acknowledgment, I would appreciate that you keep this
+  copyright string in the executable of your product.
+ */
+
+/*
+   Build a set of tables to decode the provided canonical Huffman code.
+   The code lengths are lens[0..codes-1].  The result starts at *table,
+   whose indices are 0..2^bits-1.  work is a writable array of at least
+   lens shorts, which is used as a work area.  type is the type of code
+   to be generated, CODES, LENS, or DISTS.  On return, zero is success,
+   -1 is an invalid code, and +1 means that ENOUGH isn't enough.  table
+   on return points to the next available entry's address.  bits is the
+   requested root table index bits, and on return it is the actual root
+   table index bits.  It will differ if the request is greater than the
+   longest code or if it is less than the shortest code.
+ */
+int ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work)
+codetype type;
+unsigned short FAR *lens;
+unsigned codes;
+code FAR * FAR *table;
+unsigned FAR *bits;
+unsigned short FAR *work;
+{
+    unsigned len;               /* a code's length in bits */
+    unsigned sym;               /* index of code symbols */
+    unsigned min, max;          /* minimum and maximum code lengths */
+    unsigned root;              /* number of index bits for root table */
+    unsigned curr;              /* number of index bits for current table */
+    unsigned drop;              /* code bits to drop for sub-table */
+    int left;                   /* number of prefix codes available */
+    unsigned used;              /* code entries in table used */
+    unsigned huff;              /* Huffman code */
+    unsigned incr;              /* for incrementing code, index */
+    unsigned fill;              /* index for replicating entries */
+    unsigned low;               /* low bits for current root entry */
+    unsigned mask;              /* mask for low root bits */
+    code here;                  /* table entry for duplication */
+    code FAR *next;             /* next available space in table */
+    const unsigned short FAR *base;     /* base value table to use */
+    const unsigned short FAR *extra;    /* extra bits table to use */
+    int end;                    /* use base and extra for symbol > end */
+    unsigned short count[MAXBITS+1];    /* number of codes of each length */
+    unsigned short offs[MAXBITS+1];     /* offsets in table for each length */
+    static const unsigned short lbase[31] = { /* Length codes 257..285 base */
+        3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
+        35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
+    static const unsigned short lext[31] = { /* Length codes 257..285 extra */
+        16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
+        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78};
+    static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
+        1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
+        257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
+        8193, 12289, 16385, 24577, 0, 0};
+    static const unsigned short dext[32] = { /* Distance codes 0..29 extra */
+        16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
+        23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
+        28, 28, 29, 29, 64, 64};
+
+    /*
+       Process a set of code lengths to create a canonical Huffman code.  The
+       code lengths are lens[0..codes-1].  Each length corresponds to the
+       symbols 0..codes-1.  The Huffman code is generated by first sorting the
+       symbols by length from short to long, and retaining the symbol order
+       for codes with equal lengths.  Then the code starts with all zero bits
+       for the first code of the shortest length, and the codes are integer
+       increments for the same length, and zeros are appended as the length
+       increases.  For the deflate format, these bits are stored backwards
+       from their more natural integer increment ordering, and so when the
+       decoding tables are built in the large loop below, the integer codes
+       are incremented backwards.
+
+       This routine assumes, but does not check, that all of the entries in
+       lens[] are in the range 0..MAXBITS.  The caller must assure this.
+       1..MAXBITS is interpreted as that code length.  zero means that that
+       symbol does not occur in this code.
+
+       The codes are sorted by computing a count of codes for each length,
+       creating from that a table of starting indices for each length in the
+       sorted table, and then entering the symbols in order in the sorted
+       table.  The sorted table is work[], with that space being provided by
+       the caller.
+
+       The length counts are used for other purposes as well, i.e. finding
+       the minimum and maximum length codes, determining if there are any
+       codes at all, checking for a valid set of lengths, and looking ahead
+       at length counts to determine sub-table sizes when building the
+       decoding tables.
+     */
+
+    /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
+    for (len = 0; len <= MAXBITS; len++)
+        count[len] = 0;
+    for (sym = 0; sym < codes; sym++)
+        count[lens[sym]]++;
+
+    /* bound code lengths, force root to be within code lengths */
+    root = *bits;
+    for (max = MAXBITS; max >= 1; max--)
+        if (count[max] != 0) break;
+    if (root > max) root = max;
+    if (max == 0) {                     /* no symbols to code at all */
+        here.op = (unsigned char)64;    /* invalid code marker */
+        here.bits = (unsigned char)1;
+        here.val = (unsigned short)0;
+        *(*table)++ = here;             /* make a table to force an error */
+        *(*table)++ = here;
+        *bits = 1;
+        return 0;     /* no symbols, but wait for decoding to report error */
+    }
+    for (min = 1; min < max; min++)
+        if (count[min] != 0) break;
+    if (root < min) root = min;
+
+    /* check for an over-subscribed or incomplete set of lengths */
+    left = 1;
+    for (len = 1; len <= MAXBITS; len++) {
+        left <<= 1;
+        left -= count[len];
+        if (left < 0) return -1;        /* over-subscribed */
+    }
+    if (left > 0 && (type == CODES || max != 1))
+        return -1;                      /* incomplete set */
+
+    /* generate offsets into symbol table for each length for sorting */
+    offs[1] = 0;
+    for (len = 1; len < MAXBITS; len++)
+        offs[len + 1] = offs[len] + count[len];
+
+    /* sort symbols by length, by symbol order within each length */
+    for (sym = 0; sym < codes; sym++)
+        if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;
+
+    /*
+       Create and fill in decoding tables.  In this loop, the table being
+       filled is at next and has curr index bits.  The code being used is huff
+       with length len.  That code is converted to an index by dropping drop
+       bits off of the bottom.  For codes where len is less than drop + curr,
+       those top drop + curr - len bits are incremented through all values to
+       fill the table with replicated entries.
+
+       root is the number of index bits for the root table.  When len exceeds
+       root, sub-tables are created pointed to by the root entry with an index
+       of the low root bits of huff.  This is saved in low to check for when a
+       new sub-table should be started.  drop is zero when the root table is
+       being filled, and drop is root when sub-tables are being filled.
+
+       When a new sub-table is needed, it is necessary to look ahead in the
+       code lengths to determine what size sub-table is needed.  The length
+       counts are used for this, and so count[] is decremented as codes are
+       entered in the tables.
+
+       used keeps track of how many table entries have been allocated from the
+       provided *table space.  It is checked for LENS and DIST tables against
+       the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
+       the initial root table size constants.  See the comments in inftrees.h
+       for more information.
+
+       sym increments through all symbols, and the loop terminates when
+       all codes of length max, i.e. all codes, have been processed.  This
+       routine permits incomplete codes, so another loop after this one fills
+       in the rest of the decoding tables with invalid code markers.
+     */
+
+    /* set up for code type */
+    switch (type) {
+    case CODES:
+        base = extra = work;    /* dummy value--not used */
+        end = 19;
+        break;
+    case LENS:
+        base = lbase;
+        base -= 257;
+        extra = lext;
+        extra -= 257;
+        end = 256;
+        break;
+    default:            /* DISTS */
+        base = dbase;
+        extra = dext;
+        end = -1;
+    }
+
+    /* initialize state for loop */
+    huff = 0;                   /* starting code */
+    sym = 0;                    /* starting code symbol */
+    len = min;                  /* starting code length */
+    next = *table;              /* current table to fill in */
+    curr = root;                /* current table index bits */
+    drop = 0;                   /* current bits to drop from code for index */
+    low = (unsigned)(-1);       /* trigger new sub-table when len > root */
+    used = 1U << root;          /* use root table entries */
+    mask = used - 1;            /* mask for comparing low */
+
+    /* check available table space */
+    if ((type == LENS && used > ENOUGH_LENS) ||
+        (type == DISTS && used > ENOUGH_DISTS))
+        return 1;
+
+    /* process all codes and make table entries */
+    for (;;) {
+        /* create table entry */
+        here.bits = (unsigned char)(len - drop);
+        if ((int)(work[sym]) < end) {
+            here.op = (unsigned char)0;
+            here.val = work[sym];
+        }
+        else if ((int)(work[sym]) > end) {
+            here.op = (unsigned char)(extra[work[sym]]);
+            here.val = base[work[sym]];
+        }
+        else {
+            here.op = (unsigned char)(32 + 64);         /* end of block */
+            here.val = 0;
+        }
+
+        /* replicate for those indices with low len bits equal to huff */
+        incr = 1U << (len - drop);
+        fill = 1U << curr;
+        min = fill;                 /* save offset to next table */
+        do {
+            fill -= incr;
+            next[(huff >> drop) + fill] = here;
+        } while (fill != 0);
+
+        /* backwards increment the len-bit code huff */
+        incr = 1U << (len - 1);
+        while (huff & incr)
+            incr >>= 1;
+        if (incr != 0) {
+            huff &= incr - 1;
+            huff += incr;
+        }
+        else
+            huff = 0;
+
+        /* go to next symbol, update count, len */
+        sym++;
+        if (--(count[len]) == 0) {
+            if (len == max) break;
+            len = lens[work[sym]];
+        }
+
+        /* create new sub-table if needed */
+        if (len > root && (huff & mask) != low) {
+            /* if first time, transition to sub-tables */
+            if (drop == 0)
+                drop = root;
+
+            /* increment past last table */
+            next += min;            /* here min is 1 << curr */
+
+            /* determine length of next table */
+            curr = len - drop;
+            left = (int)(1 << curr);
+            while (curr + drop < max) {
+                left -= count[curr + drop];
+                if (left <= 0) break;
+                curr++;
+                left <<= 1;
+            }
+
+            /* check for enough space */
+            used += 1U << curr;
+            if ((type == LENS && used > ENOUGH_LENS) ||
+                (type == DISTS && used > ENOUGH_DISTS))
+                return 1;
+
+            /* point entry in root table to sub-table */
+            low = huff & mask;
+            (*table)[low].op = (unsigned char)curr;
+            (*table)[low].bits = (unsigned char)root;
+            (*table)[low].val = (unsigned short)(next - *table);
+        }
+    }
+
+    /* fill in remaining table entry if code is incomplete (guaranteed to have
+       at most one remaining entry, since if the code is incomplete, the
+       maximum code length that was allowed to get this far is one bit) */
+    if (huff != 0) {
+        here.op = (unsigned char)64;            /* invalid code marker */
+        here.bits = (unsigned char)(len - drop);
+        here.val = (unsigned short)0;
+        next[huff] = here;
+    }
+
+    /* set return parameters */
+    *table += used;
+    *bits = root;
+    return 0;
+}
diff --git a/src/external/tng_io/external/zlib/inftrees.h b/src/external/tng_io/external/zlib/inftrees.h
new file mode 100644 (file)
index 0000000..baa53a0
--- /dev/null
@@ -0,0 +1,62 @@
+/* inftrees.h -- header to use inftrees.c
+ * Copyright (C) 1995-2005, 2010 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+   part of the implementation of the compression library and is
+   subject to change. Applications should only use zlib.h.
+ */
+
+/* Structure for decoding tables.  Each entry provides either the
+   information needed to do the operation requested by the code that
+   indexed that table entry, or it provides a pointer to another
+   table that indexes more bits of the code.  op indicates whether
+   the entry is a pointer to another table, a literal, a length or
+   distance, an end-of-block, or an invalid code.  For a table
+   pointer, the low four bits of op is the number of index bits of
+   that table.  For a length or distance, the low four bits of op
+   is the number of extra bits to get after the code.  bits is
+   the number of bits in this code or part of the code to drop off
+   of the bit buffer.  val is the actual byte to output in the case
+   of a literal, the base length or distance, or the offset from
+   the current table to the next table.  Each entry is four bytes. */
+typedef struct {
+    unsigned char op;           /* operation, extra bits, table bits */
+    unsigned char bits;         /* bits in this part of the code */
+    unsigned short val;         /* offset in table or code value */
+} code;
+
+/* op values as set by inflate_table():
+    00000000 - literal
+    0000tttt - table link, tttt != 0 is the number of table index bits
+    0001eeee - length or distance, eeee is the number of extra bits
+    01100000 - end of block
+    01000000 - invalid code
+ */
+
+/* Maximum size of the dynamic table.  The maximum number of code structures is
+   1444, which is the sum of 852 for literal/length codes and 592 for distance
+   codes.  These values were found by exhaustive searches using the program
+   examples/enough.c found in the zlib distribtution.  The arguments to that
+   program are the number of symbols, the initial root table size, and the
+   maximum bit length of a code.  "enough 286 9 15" for literal/length codes
+   returns returns 852, and "enough 30 6 15" for distance codes returns 592.
+   The initial root table size (9 or 6) is found in the fifth argument of the
+   inflate_table() calls in inflate.c and infback.c.  If the root table size is
+   changed, then these maximum sizes would be need to be recalculated and
+   updated. */
+#define ENOUGH_LENS 852
+#define ENOUGH_DISTS 592
+#define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS)
+
+/* Type of code to build for inflate_table() */
+typedef enum {
+    CODES,
+    LENS,
+    DISTS
+} codetype;
+
+int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
+                             unsigned codes, code FAR * FAR *table,
+                             unsigned FAR *bits, unsigned short FAR *work));
diff --git a/src/external/tng_io/external/zlib/trees.c b/src/external/tng_io/external/zlib/trees.c
new file mode 100644 (file)
index 0000000..1fd7759
--- /dev/null
@@ -0,0 +1,1226 @@
+/* trees.c -- output deflated data using Huffman coding
+ * Copyright (C) 1995-2012 Jean-loup Gailly
+ * detect_data_type() function provided freely by Cosmin Truta, 2006
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/*
+ *  ALGORITHM
+ *
+ *      The "deflation" process uses several Huffman trees. The more
+ *      common source values are represented by shorter bit sequences.
+ *
+ *      Each code tree is stored in a compressed form which is itself
+ * a Huffman encoding of the lengths of all the code strings (in
+ * ascending order by source values).  The actual code strings are
+ * reconstructed from the lengths in the inflate process, as described
+ * in the deflate specification.
+ *
+ *  REFERENCES
+ *
+ *      Deutsch, L.P.,"'Deflate' Compressed Data Format Specification".
+ *      Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc
+ *
+ *      Storer, James A.
+ *          Data Compression:  Methods and Theory, pp. 49-50.
+ *          Computer Science Press, 1988.  ISBN 0-7167-8156-5.
+ *
+ *      Sedgewick, R.
+ *          Algorithms, p290.
+ *          Addison-Wesley, 1983. ISBN 0-201-06672-6.
+ */
+
+/* @(#) $Id$ */
+
+/* #define GEN_TREES_H */
+
+#include "deflate.h"
+
+#ifdef DEBUG
+#  include <ctype.h>
+#endif
+
+/* ===========================================================================
+ * Constants
+ */
+
+#define MAX_BL_BITS 7
+/* Bit length codes must not exceed MAX_BL_BITS bits */
+
+#define END_BLOCK 256
+/* end of block literal code */
+
+#define REP_3_6      16
+/* repeat previous bit length 3-6 times (2 bits of repeat count) */
+
+#define REPZ_3_10    17
+/* repeat a zero length 3-10 times  (3 bits of repeat count) */
+
+#define REPZ_11_138  18
+/* repeat a zero length 11-138 times  (7 bits of repeat count) */
+
+local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */
+   = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0};
+
+local const int extra_dbits[D_CODES] /* extra bits for each distance code */
+   = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};
+
+local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */
+   = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7};
+
+local const uch bl_order[BL_CODES]
+   = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15};
+/* The lengths of the bit length codes are sent in order of decreasing
+ * probability, to avoid transmitting the lengths for unused bit length codes.
+ */
+
+/* ===========================================================================
+ * Local data. These are initialized only once.
+ */
+
+#define DIST_CODE_LEN  512 /* see definition of array dist_code below */
+
+#if defined(GEN_TREES_H) || !defined(STDC)
+/* non ANSI compilers may not accept trees.h */
+
+local ct_data static_ltree[L_CODES+2];
+/* The static literal tree. Since the bit lengths are imposed, there is no
+ * need for the L_CODES extra codes used during heap construction. However
+ * The codes 286 and 287 are needed to build a canonical tree (see _tr_init
+ * below).
+ */
+
+local ct_data static_dtree[D_CODES];
+/* The static distance tree. (Actually a trivial tree since all codes use
+ * 5 bits.)
+ */
+
+uch _dist_code[DIST_CODE_LEN];
+/* Distance codes. The first 256 values correspond to the distances
+ * 3 .. 258, the last 256 values correspond to the top 8 bits of
+ * the 15 bit distances.
+ */
+
+uch _length_code[MAX_MATCH-MIN_MATCH+1];
+/* length code for each normalized match length (0 == MIN_MATCH) */
+
+local int base_length[LENGTH_CODES];
+/* First normalized length for each code (0 = MIN_MATCH) */
+
+local int base_dist[D_CODES];
+/* First normalized distance for each code (0 = distance of 1) */
+
+#else
+#  include "trees.h"
+#endif /* GEN_TREES_H */
+
+struct static_tree_desc_s {
+    const ct_data *static_tree;  /* static tree or NULL */
+    const intf *extra_bits;      /* extra bits for each code or NULL */
+    int     extra_base;          /* base index for extra_bits */
+    int     elems;               /* max number of elements in the tree */
+    int     max_length;          /* max bit length for the codes */
+};
+
+local static_tree_desc  static_l_desc =
+{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS};
+
+local static_tree_desc  static_d_desc =
+{static_dtree, extra_dbits, 0,          D_CODES, MAX_BITS};
+
+local static_tree_desc  static_bl_desc =
+{(const ct_data *)0, extra_blbits, 0,   BL_CODES, MAX_BL_BITS};
+
+/* ===========================================================================
+ * Local (static) routines in this file.
+ */
+
+local void tr_static_init OF((void));
+local void init_block     OF((deflate_state *s));
+local void pqdownheap     OF((deflate_state *s, ct_data *tree, int k));
+local void gen_bitlen     OF((deflate_state *s, tree_desc *desc));
+local void gen_codes      OF((ct_data *tree, int max_code, ushf *bl_count));
+local void build_tree     OF((deflate_state *s, tree_desc *desc));
+local void scan_tree      OF((deflate_state *s, ct_data *tree, int max_code));
+local void send_tree      OF((deflate_state *s, ct_data *tree, int max_code));
+local int  build_bl_tree  OF((deflate_state *s));
+local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes,
+                              int blcodes));
+local void compress_block OF((deflate_state *s, const ct_data *ltree,
+                              const ct_data *dtree));
+local int  detect_data_type OF((deflate_state *s));
+local unsigned bi_reverse OF((unsigned value, int length));
+local void bi_windup      OF((deflate_state *s));
+local void bi_flush       OF((deflate_state *s));
+local void copy_block     OF((deflate_state *s, charf *buf, unsigned len,
+                              int header));
+
+#ifdef GEN_TREES_H
+local void gen_trees_header OF((void));
+#endif
+
+#ifndef DEBUG
+#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
+   /* Send a code of the given tree. c and tree must not have side effects */
+
+#else /* DEBUG */
+#  define send_code(s, c, tree) \
+     { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \
+       send_bits(s, tree[c].Code, tree[c].Len); }
+#endif
+
+/* ===========================================================================
+ * Output a short LSB first on the stream.
+ * IN assertion: there is enough room in pendingBuf.
+ */
+#define put_short(s, w) { \
+    put_byte(s, (uch)((w) & 0xff)); \
+    put_byte(s, (uch)((ush)(w) >> 8)); \
+}
+
+/* ===========================================================================
+ * Send a value on a given number of bits.
+ * IN assertion: length <= 16 and value fits in length bits.
+ */
+#ifdef DEBUG
+local void send_bits      OF((deflate_state *s, int value, int length));
+
+local void send_bits(s, value, length)
+    deflate_state *s;
+    int value;  /* value to send */
+    int length; /* number of bits */
+{
+    Tracevv((stderr," l %2d v %4x ", length, value));
+    Assert(length > 0 && length <= 15, "invalid length");
+    s->bits_sent += (ulg)length;
+
+    /* If not enough room in bi_buf, use (valid) bits from bi_buf and
+     * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))
+     * unused bits in value.
+     */
+    if (s->bi_valid > (int)Buf_size - length) {
+        s->bi_buf |= (ush)value << s->bi_valid;
+        put_short(s, s->bi_buf);
+        s->bi_buf = (ush)value >> (Buf_size - s->bi_valid);
+        s->bi_valid += length - Buf_size;
+    } else {
+        s->bi_buf |= (ush)value << s->bi_valid;
+        s->bi_valid += length;
+    }
+}
+#else /* !DEBUG */
+
+#define send_bits(s, value, length) \
+{ int len = length;\
+  if (s->bi_valid > (int)Buf_size - len) {\
+    int val = value;\
+    s->bi_buf |= (ush)val << s->bi_valid;\
+    put_short(s, s->bi_buf);\
+    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
+    s->bi_valid += len - Buf_size;\
+  } else {\
+    s->bi_buf |= (ush)(value) << s->bi_valid;\
+    s->bi_valid += len;\
+  }\
+}
+#endif /* DEBUG */
+
+
+/* the arguments must not have side effects */
+
+/* ===========================================================================
+ * Initialize the various 'constant' tables.
+ */
+local void tr_static_init()
+{
+#if defined(GEN_TREES_H) || !defined(STDC)
+    static int static_init_done = 0;
+    int n;        /* iterates over tree elements */
+    int bits;     /* bit counter */
+    int length;   /* length value */
+    int code;     /* code value */
+    int dist;     /* distance index */
+    ush bl_count[MAX_BITS+1];
+    /* number of codes at each bit length for an optimal tree */
+
+    if (static_init_done) return;
+
+    /* For some embedded targets, global variables are not initialized: */
+#ifdef NO_INIT_GLOBAL_POINTERS
+    static_l_desc.static_tree = static_ltree;
+    static_l_desc.extra_bits = extra_lbits;
+    static_d_desc.static_tree = static_dtree;
+    static_d_desc.extra_bits = extra_dbits;
+    static_bl_desc.extra_bits = extra_blbits;
+#endif
+
+    /* Initialize the mapping length (0..255) -> length code (0..28) */
+    length = 0;
+    for (code = 0; code < LENGTH_CODES-1; code++) {
+        base_length[code] = length;
+        for (n = 0; n < (1<<extra_lbits[code]); n++) {
+            _length_code[length++] = (uch)code;
+        }
+    }
+    Assert (length == 256, "tr_static_init: length != 256");
+    /* Note that the length 255 (match length 258) can be represented
+     * in two different ways: code 284 + 5 bits or code 285, so we
+     * overwrite length_code[255] to use the best encoding:
+     */
+    _length_code[length-1] = (uch)code;
+
+    /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
+    dist = 0;
+    for (code = 0 ; code < 16; code++) {
+        base_dist[code] = dist;
+        for (n = 0; n < (1<<extra_dbits[code]); n++) {
+            _dist_code[dist++] = (uch)code;
+        }
+    }
+    Assert (dist == 256, "tr_static_init: dist != 256");
+    dist >>= 7; /* from now on, all distances are divided by 128 */
+    for ( ; code < D_CODES; code++) {
+        base_dist[code] = dist << 7;
+        for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {
+            _dist_code[256 + dist++] = (uch)code;
+        }
+    }
+    Assert (dist == 256, "tr_static_init: 256+dist != 512");
+
+    /* Construct the codes of the static literal tree */
+    for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0;
+    n = 0;
+    while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++;
+    while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++;
+    while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++;
+    while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++;
+    /* Codes 286 and 287 do not exist, but we must include them in the
+     * tree construction to get a canonical Huffman tree (longest code
+     * all ones)
+     */
+    gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count);
+
+    /* The static distance tree is trivial: */
+    for (n = 0; n < D_CODES; n++) {
+        static_dtree[n].Len = 5;
+        static_dtree[n].Code = bi_reverse((unsigned)n, 5);
+    }
+    static_init_done = 1;
+
+#  ifdef GEN_TREES_H
+    gen_trees_header();
+#  endif
+#endif /* defined(GEN_TREES_H) || !defined(STDC) */
+}
+
+/* ===========================================================================
+ * Genererate the file trees.h describing the static trees.
+ */
+#ifdef GEN_TREES_H
+#  ifndef DEBUG
+#    include <stdio.h>
+#  endif
+
+#  define SEPARATOR(i, last, width) \
+      ((i) == (last)? "\n};\n\n" :    \
+       ((i) % (width) == (width)-1 ? ",\n" : ", "))
+
+void gen_trees_header()
+{
+    FILE *header = fopen("trees.h", "w");
+    int i;
+
+    Assert (header != NULL, "Can't open trees.h");
+    fprintf(header,
+            "/* header created automatically with -DGEN_TREES_H */\n\n");
+
+    fprintf(header, "local const ct_data static_ltree[L_CODES+2] = {\n");
+    for (i = 0; i < L_CODES+2; i++) {
+        fprintf(header, "{{%3u},{%3u}}%s", static_ltree[i].Code,
+                static_ltree[i].Len, SEPARATOR(i, L_CODES+1, 5));
+    }
+
+    fprintf(header, "local const ct_data static_dtree[D_CODES] = {\n");
+    for (i = 0; i < D_CODES; i++) {
+        fprintf(header, "{{%2u},{%2u}}%s", static_dtree[i].Code,
+                static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5));
+    }
+
+    fprintf(header, "const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {\n");
+    for (i = 0; i < DIST_CODE_LEN; i++) {
+        fprintf(header, "%2u%s", _dist_code[i],
+                SEPARATOR(i, DIST_CODE_LEN-1, 20));
+    }
+
+    fprintf(header,
+        "const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {\n");
+    for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) {
+        fprintf(header, "%2u%s", _length_code[i],
+                SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20));
+    }
+
+    fprintf(header, "local const int base_length[LENGTH_CODES] = {\n");
+    for (i = 0; i < LENGTH_CODES; i++) {
+        fprintf(header, "%1u%s", base_length[i],
+                SEPARATOR(i, LENGTH_CODES-1, 20));
+    }
+
+    fprintf(header, "local const int base_dist[D_CODES] = {\n");
+    for (i = 0; i < D_CODES; i++) {
+        fprintf(header, "%5u%s", base_dist[i],
+                SEPARATOR(i, D_CODES-1, 10));
+    }
+
+    fclose(header);
+}
+#endif /* GEN_TREES_H */
+
+/* ===========================================================================
+ * Initialize the tree data structures for a new zlib stream.
+ */
+void ZLIB_INTERNAL _tr_init(s)
+    deflate_state *s;
+{
+    tr_static_init();
+
+    s->l_desc.dyn_tree = s->dyn_ltree;
+    s->l_desc.stat_desc = &static_l_desc;
+
+    s->d_desc.dyn_tree = s->dyn_dtree;
+    s->d_desc.stat_desc = &static_d_desc;
+
+    s->bl_desc.dyn_tree = s->bl_tree;
+    s->bl_desc.stat_desc = &static_bl_desc;
+
+    s->bi_buf = 0;
+    s->bi_valid = 0;
+#ifdef DEBUG
+    s->compressed_len = 0L;
+    s->bits_sent = 0L;
+#endif
+
+    /* Initialize the first block of the first file: */
+    init_block(s);
+}
+
+/* ===========================================================================
+ * Initialize a new block.
+ */
+local void init_block(s)
+    deflate_state *s;
+{
+    int n; /* iterates over tree elements */
+
+    /* Initialize the trees. */
+    for (n = 0; n < L_CODES;  n++) s->dyn_ltree[n].Freq = 0;
+    for (n = 0; n < D_CODES;  n++) s->dyn_dtree[n].Freq = 0;
+    for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
+
+    s->dyn_ltree[END_BLOCK].Freq = 1;
+    s->opt_len = s->static_len = 0L;
+    s->last_lit = s->matches = 0;
+}
+
+#define SMALLEST 1
+/* Index within the heap array of least frequent node in the Huffman tree */
+
+
+/* ===========================================================================
+ * Remove the smallest element from the heap and recreate the heap with
+ * one less element. Updates heap and heap_len.
+ */
+#define pqremove(s, tree, top) \
+{\
+    top = s->heap[SMALLEST]; \
+    s->heap[SMALLEST] = s->heap[s->heap_len--]; \
+    pqdownheap(s, tree, SMALLEST); \
+}
+
+/* ===========================================================================
+ * Compares to subtrees, using the tree depth as tie breaker when
+ * the subtrees have equal frequency. This minimizes the worst case length.
+ */
+#define smaller(tree, n, m, depth) \
+   (tree[n].Freq < tree[m].Freq || \
+   (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
+
+/* ===========================================================================
+ * Restore the heap property by moving down the tree starting at node k,
+ * exchanging a node with the smallest of its two sons if necessary, stopping
+ * when the heap property is re-established (each father smaller than its
+ * two sons).
+ */
+local void pqdownheap(s, tree, k)
+    deflate_state *s;
+    ct_data *tree;  /* the tree to restore */
+    int k;               /* node to move down */
+{
+    int v = s->heap[k];
+    int j = k << 1;  /* left son of k */
+    while (j <= s->heap_len) {
+        /* Set j to the smallest of the two sons: */
+        if (j < s->heap_len &&
+            smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
+            j++;
+        }
+        /* Exit if v is smaller than both sons */
+        if (smaller(tree, v, s->heap[j], s->depth)) break;
+
+        /* Exchange v with the smallest son */
+        s->heap[k] = s->heap[j];  k = j;
+
+        /* And continue down the tree, setting j to the left son of k */
+        j <<= 1;
+    }
+    s->heap[k] = v;
+}
+
+/* ===========================================================================
+ * Compute the optimal bit lengths for a tree and update the total bit length
+ * for the current block.
+ * IN assertion: the fields freq and dad are set, heap[heap_max] and
+ *    above are the tree nodes sorted by increasing frequency.
+ * OUT assertions: the field len is set to the optimal bit length, the
+ *     array bl_count contains the frequencies for each bit length.
+ *     The length opt_len is updated; static_len is also updated if stree is
+ *     not null.
+ */
+local void gen_bitlen(s, desc)
+    deflate_state *s;
+    tree_desc *desc;    /* the tree descriptor */
+{
+    ct_data *tree        = desc->dyn_tree;
+    int max_code         = desc->max_code;
+    const ct_data *stree = desc->stat_desc->static_tree;
+    const intf *extra    = desc->stat_desc->extra_bits;
+    int base             = desc->stat_desc->extra_base;
+    int max_length       = desc->stat_desc->max_length;
+    int h;              /* heap index */
+    int n, m;           /* iterate over the tree elements */
+    int bits;           /* bit length */
+    int xbits;          /* extra bits */
+    ush f;              /* frequency */
+    int overflow = 0;   /* number of elements with bit length too large */
+
+    for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
+
+    /* In a first pass, compute the optimal bit lengths (which may
+     * overflow in the case of the bit length tree).
+     */
+    tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
+
+    for (h = s->heap_max+1; h < HEAP_SIZE; h++) {
+        n = s->heap[h];
+        bits = tree[tree[n].Dad].Len + 1;
+        if (bits > max_length) bits = max_length, overflow++;
+        tree[n].Len = (ush)bits;
+        /* We overwrite tree[n].Dad which is no longer needed */
+
+        if (n > max_code) continue; /* not a leaf node */
+
+        s->bl_count[bits]++;
+        xbits = 0;
+        if (n >= base) xbits = extra[n-base];
+        f = tree[n].Freq;
+        s->opt_len += (ulg)f * (bits + xbits);
+        if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits);
+    }
+    if (overflow == 0) return;
+
+    Trace((stderr,"\nbit length overflow\n"));
+    /* This happens for example on obj2 and pic of the Calgary corpus */
+
+    /* Find the first bit length which could increase: */
+    do {
+        bits = max_length-1;
+        while (s->bl_count[bits] == 0) bits--;
+        s->bl_count[bits]--;      /* move one leaf down the tree */
+        s->bl_count[bits+1] += 2; /* move one overflow item as its brother */
+        s->bl_count[max_length]--;
+        /* The brother of the overflow item also moves one step up,
+         * but this does not affect bl_count[max_length]
+         */
+        overflow -= 2;
+    } while (overflow > 0);
+
+    /* Now recompute all bit lengths, scanning in increasing frequency.
+     * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
+     * lengths instead of fixing only the wrong ones. This idea is taken
+     * from 'ar' written by Haruhiko Okumura.)
+     */
+    for (bits = max_length; bits != 0; bits--) {
+        n = s->bl_count[bits];
+        while (n != 0) {
+            m = s->heap[--h];
+            if (m > max_code) continue;
+            if ((unsigned) tree[m].Len != (unsigned) bits) {
+                Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
+                s->opt_len += ((long)bits - (long)tree[m].Len)
+                              *(long)tree[m].Freq;
+                tree[m].Len = (ush)bits;
+            }
+            n--;
+        }
+    }
+}
+
+/* ===========================================================================
+ * Generate the codes for a given tree and bit counts (which need not be
+ * optimal).
+ * IN assertion: the array bl_count contains the bit length statistics for
+ * the given tree and the field len is set for all tree elements.
+ * OUT assertion: the field code is set for all tree elements of non
+ *     zero code length.
+ */
+local void gen_codes (tree, max_code, bl_count)
+    ct_data *tree;             /* the tree to decorate */
+    int max_code;              /* largest code with non zero frequency */
+    ushf *bl_count;            /* number of codes at each bit length */
+{
+    ush next_code[MAX_BITS+1]; /* next code value for each bit length */
+    ush code = 0;              /* running code value */
+    int bits;                  /* bit index */
+    int n;                     /* code index */
+
+    /* The distribution counts are first used to generate the code values
+     * without bit reversal.
+     */
+    for (bits = 1; bits <= MAX_BITS; bits++) {
+        next_code[bits] = code = (code + bl_count[bits-1]) << 1;
+    }
+    /* Check that the bit counts in bl_count are consistent. The last code
+     * must be all ones.
+     */
+    Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
+            "inconsistent bit counts");
+    Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
+
+    for (n = 0;  n <= max_code; n++) {
+        int len = tree[n].Len;
+        if (len == 0) continue;
+        /* Now reverse the bits */
+        tree[n].Code = bi_reverse(next_code[len]++, len);
+
+        Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
+             n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
+    }
+}
+
+/* ===========================================================================
+ * Construct one Huffman tree and assigns the code bit strings and lengths.
+ * Update the total bit length for the current block.
+ * IN assertion: the field freq is set for all tree elements.
+ * OUT assertions: the fields len and code are set to the optimal bit length
+ *     and corresponding code. The length opt_len is updated; static_len is
+ *     also updated if stree is not null. The field max_code is set.
+ */
+local void build_tree(s, desc)
+    deflate_state *s;
+    tree_desc *desc; /* the tree descriptor */
+{
+    ct_data *tree         = desc->dyn_tree;
+    const ct_data *stree  = desc->stat_desc->static_tree;
+    int elems             = desc->stat_desc->elems;
+    int n, m;          /* iterate over heap elements */
+    int max_code = -1; /* largest code with non zero frequency */
+    int node;          /* new node being created */
+
+    /* Construct the initial heap, with least frequent element in
+     * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
+     * heap[0] is not used.
+     */
+    s->heap_len = 0, s->heap_max = HEAP_SIZE;
+
+    for (n = 0; n < elems; n++) {
+        if (tree[n].Freq != 0) {
+            s->heap[++(s->heap_len)] = max_code = n;
+            s->depth[n] = 0;
+        } else {
+            tree[n].Len = 0;
+        }
+    }
+
+    /* The pkzip format requires that at least one distance code exists,
+     * and that at least one bit should be sent even if there is only one
+     * possible code. So to avoid special checks later on we force at least
+     * two codes of non zero frequency.
+     */
+    while (s->heap_len < 2) {
+        node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
+        tree[node].Freq = 1;
+        s->depth[node] = 0;
+        s->opt_len--; if (stree) s->static_len -= stree[node].Len;
+        /* node is 0 or 1 so it does not have extra bits */
+    }
+    desc->max_code = max_code;
+
+    /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
+     * establish sub-heaps of increasing lengths:
+     */
+    for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
+
+    /* Construct the Huffman tree by repeatedly combining the least two
+     * frequent nodes.
+     */
+    node = elems;              /* next internal node of the tree */
+    do {
+        pqremove(s, tree, n);  /* n = node of least frequency */
+        m = s->heap[SMALLEST]; /* m = node of next least frequency */
+
+        s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */
+        s->heap[--(s->heap_max)] = m;
+
+        /* Create a new node father of n and m */
+        tree[node].Freq = tree[n].Freq + tree[m].Freq;
+        s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ?
+                                s->depth[n] : s->depth[m]) + 1);
+        tree[n].Dad = tree[m].Dad = (ush)node;
+#ifdef DUMP_BL_TREE
+        if (tree == s->bl_tree) {
+            fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)",
+                    node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq);
+        }
+#endif
+        /* and insert the new node in the heap */
+        s->heap[SMALLEST] = node++;
+        pqdownheap(s, tree, SMALLEST);
+
+    } while (s->heap_len >= 2);
+
+    s->heap[--(s->heap_max)] = s->heap[SMALLEST];
+
+    /* At this point, the fields freq and dad are set. We can now
+     * generate the bit lengths.
+     */
+    gen_bitlen(s, (tree_desc *)desc);
+
+    /* The field len is now set, we can generate the bit codes */
+    gen_codes ((ct_data *)tree, max_code, s->bl_count);
+}
+
+/* ===========================================================================
+ * Scan a literal or distance tree to determine the frequencies of the codes
+ * in the bit length tree.
+ */
+local void scan_tree (s, tree, max_code)
+    deflate_state *s;
+    ct_data *tree;   /* the tree to be scanned */
+    int max_code;    /* and its largest code of non zero frequency */
+{
+    int n;                     /* iterates over all tree elements */
+    int prevlen = -1;          /* last emitted length */
+    int curlen;                /* length of current code */
+    int nextlen = tree[0].Len; /* length of next code */
+    int count = 0;             /* repeat count of the current code */
+    int max_count = 7;         /* max repeat count */
+    int min_count = 4;         /* min repeat count */
+
+    if (nextlen == 0) max_count = 138, min_count = 3;
+    tree[max_code+1].Len = (ush)0xffff; /* guard */
+
+    for (n = 0; n <= max_code; n++) {
+        curlen = nextlen; nextlen = tree[n+1].Len;
+        if (++count < max_count && curlen == nextlen) {
+            continue;
+        } else if (count < min_count) {
+            s->bl_tree[curlen].Freq += count;
+        } else if (curlen != 0) {
+            if (curlen != prevlen) s->bl_tree[curlen].Freq++;
+            s->bl_tree[REP_3_6].Freq++;
+        } else if (count <= 10) {
+            s->bl_tree[REPZ_3_10].Freq++;
+        } else {
+            s->bl_tree[REPZ_11_138].Freq++;
+        }
+        count = 0; prevlen = curlen;
+        if (nextlen == 0) {
+            max_count = 138, min_count = 3;
+        } else if (curlen == nextlen) {
+            max_count = 6, min_count = 3;
+        } else {
+            max_count = 7, min_count = 4;
+        }
+    }
+}
+
+/* ===========================================================================
+ * Send a literal or distance tree in compressed form, using the codes in
+ * bl_tree.
+ */
+local void send_tree (s, tree, max_code)
+    deflate_state *s;
+    ct_data *tree; /* the tree to be scanned */
+    int max_code;       /* and its largest code of non zero frequency */
+{
+    int n;                     /* iterates over all tree elements */
+    int prevlen = -1;          /* last emitted length */
+    int curlen;                /* length of current code */
+    int nextlen = tree[0].Len; /* length of next code */
+    int count = 0;             /* repeat count of the current code */
+    int max_count = 7;         /* max repeat count */
+    int min_count = 4;         /* min repeat count */
+
+    /* tree[max_code+1].Len = -1; */  /* guard already set */
+    if (nextlen == 0) max_count = 138, min_count = 3;
+
+    for (n = 0; n <= max_code; n++) {
+        curlen = nextlen; nextlen = tree[n+1].Len;
+        if (++count < max_count && curlen == nextlen) {
+            continue;
+        } else if (count < min_count) {
+            do { send_code(s, curlen, s->bl_tree); } while (--count != 0);
+
+        } else if (curlen != 0) {
+            if (curlen != prevlen) {
+                send_code(s, curlen, s->bl_tree); count--;
+            }
+            Assert(count >= 3 && count <= 6, " 3_6?");
+            send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2);
+
+        } else if (count <= 10) {
+            send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3);
+
+        } else {
+            send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7);
+        }
+        count = 0; prevlen = curlen;
+        if (nextlen == 0) {
+            max_count = 138, min_count = 3;
+        } else if (curlen == nextlen) {
+            max_count = 6, min_count = 3;
+        } else {
+            max_count = 7, min_count = 4;
+        }
+    }
+}
+
+/* ===========================================================================
+ * Construct the Huffman tree for the bit lengths and return the index in
+ * bl_order of the last bit length code to send.
+ */
+local int build_bl_tree(s)
+    deflate_state *s;
+{
+    int max_blindex;  /* index of last bit length code of non zero freq */
+
+    /* Determine the bit length frequencies for literal and distance trees */
+    scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code);
+    scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code);
+
+    /* Build the bit length tree: */
+    build_tree(s, (tree_desc *)(&(s->bl_desc)));
+    /* opt_len now includes the length of the tree representations, except
+     * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
+     */
+
+    /* Determine the number of bit length codes to send. The pkzip format
+     * requires that at least 4 bit length codes be sent. (appnote.txt says
+     * 3 but the actual value used is 4.)
+     */
+    for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
+        if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
+    }
+    /* Update opt_len to include the bit length tree and counts */
+    s->opt_len += 3*(max_blindex+1) + 5+5+4;
+    Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
+            s->opt_len, s->static_len));
+
+    return max_blindex;
+}
+
+/* ===========================================================================
+ * Send the header for a block using dynamic Huffman trees: the counts, the
+ * lengths of the bit length codes, the literal tree and the distance tree.
+ * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
+ */
+local void send_all_trees(s, lcodes, dcodes, blcodes)
+    deflate_state *s;
+    int lcodes, dcodes, blcodes; /* number of codes for each tree */
+{
+    int rank;                    /* index in bl_order */
+
+    Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
+    Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
+            "too many codes");
+    Tracev((stderr, "\nbl counts: "));
+    send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */
+    send_bits(s, dcodes-1,   5);
+    send_bits(s, blcodes-4,  4); /* not -3 as stated in appnote.txt */
+    for (rank = 0; rank < blcodes; rank++) {
+        Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
+        send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
+    }
+    Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
+
+    send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */
+    Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
+
+    send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */
+    Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
+}
+
+/* ===========================================================================
+ * Send a stored block
+ */
+void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last)
+    deflate_state *s;
+    charf *buf;       /* input block */
+    ulg stored_len;   /* length of input block */
+    int last;         /* one if this is the last block for a file */
+{
+    send_bits(s, (STORED_BLOCK<<1)+last, 3);    /* send block type */
+#ifdef DEBUG
+    s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
+    s->compressed_len += (stored_len + 4) << 3;
+#endif
+    copy_block(s, buf, (unsigned)stored_len, 1); /* with header */
+}
+
+/* ===========================================================================
+ * Flush the bits in the bit buffer to pending output (leaves at most 7 bits)
+ */
+void ZLIB_INTERNAL _tr_flush_bits(s)
+    deflate_state *s;
+{
+    bi_flush(s);
+}
+
+/* ===========================================================================
+ * Send one empty static block to give enough lookahead for inflate.
+ * This takes 10 bits, of which 7 may remain in the bit buffer.
+ */
+void ZLIB_INTERNAL _tr_align(s)
+    deflate_state *s;
+{
+    send_bits(s, STATIC_TREES<<1, 3);
+    send_code(s, END_BLOCK, static_ltree);
+#ifdef DEBUG
+    s->compressed_len += 10L; /* 3 for block type, 7 for EOB */
+#endif
+    bi_flush(s);
+}
+
+/* ===========================================================================
+ * Determine the best encoding for the current block: dynamic trees, static
+ * trees or store, and output the encoded block to the zip file.
+ */
+void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
+    deflate_state *s;
+    charf *buf;       /* input block, or NULL if too old */
+    ulg stored_len;   /* length of input block */
+    int last;         /* one if this is the last block for a file */
+{
+    ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
+    int max_blindex = 0;  /* index of last bit length code of non zero freq */
+
+    /* Build the Huffman trees unless a stored block is forced */
+    if (s->level > 0) {
+
+        /* Check if the file is binary or text */
+        if (s->strm->data_type == Z_UNKNOWN)
+            s->strm->data_type = detect_data_type(s);
+
+        /* Construct the literal and distance trees */
+        build_tree(s, (tree_desc *)(&(s->l_desc)));
+        Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
+                s->static_len));
+
+        build_tree(s, (tree_desc *)(&(s->d_desc)));
+        Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
+                s->static_len));
+        /* At this point, opt_len and static_len are the total bit lengths of
+         * the compressed block data, excluding the tree representations.
+         */
+
+        /* Build the bit length tree for the above two trees, and get the index
+         * in bl_order of the last bit length code to send.
+         */
+        max_blindex = build_bl_tree(s);
+
+        /* Determine the best encoding. Compute the block lengths in bytes. */
+        opt_lenb = (s->opt_len+3+7)>>3;
+        static_lenb = (s->static_len+3+7)>>3;
+
+        Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
+                opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
+                s->last_lit));
+
+        if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
+
+    } else {
+        Assert(buf != (char*)0, "lost buf");
+        opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
+    }
+
+#ifdef FORCE_STORED
+    if (buf != (char*)0) { /* force stored block */
+#else
+    if (stored_len+4 <= opt_lenb && buf != (char*)0) {
+                       /* 4: two words for the lengths */
+#endif
+        /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
+         * Otherwise we can't have processed more than WSIZE input bytes since
+         * the last block flush, because compression would have been
+         * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
+         * transform a block into a stored block.
+         */
+        _tr_stored_block(s, buf, stored_len, last);
+
+#ifdef FORCE_STATIC
+    } else if (static_lenb >= 0) { /* force static trees */
+#else
+    } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) {
+#endif
+        send_bits(s, (STATIC_TREES<<1)+last, 3);
+        compress_block(s, (const ct_data *)static_ltree,
+                       (const ct_data *)static_dtree);
+#ifdef DEBUG
+        s->compressed_len += 3 + s->static_len;
+#endif
+    } else {
+        send_bits(s, (DYN_TREES<<1)+last, 3);
+        send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
+                       max_blindex+1);
+        compress_block(s, (const ct_data *)s->dyn_ltree,
+                       (const ct_data *)s->dyn_dtree);
+#ifdef DEBUG
+        s->compressed_len += 3 + s->opt_len;
+#endif
+    }
+    Assert (s->compressed_len == s->bits_sent, "bad compressed size");
+    /* The above check is made mod 2^32, for files larger than 512 MB
+     * and uLong implemented on 32 bits.
+     */
+    init_block(s);
+
+    if (last) {
+        bi_windup(s);
+#ifdef DEBUG
+        s->compressed_len += 7;  /* align on byte boundary */
+#endif
+    }
+    Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
+           s->compressed_len-7*last));
+}
+
+/* ===========================================================================
+ * Save the match info and tally the frequency counts. Return true if
+ * the current block must be flushed.
+ */
+int ZLIB_INTERNAL _tr_tally (s, dist, lc)
+    deflate_state *s;
+    unsigned dist;  /* distance of matched string */
+    unsigned lc;    /* match length-MIN_MATCH or unmatched char (if dist==0) */
+{
+    s->d_buf[s->last_lit] = (ush)dist;
+    s->l_buf[s->last_lit++] = (uch)lc;
+    if (dist == 0) {
+        /* lc is the unmatched char */
+        s->dyn_ltree[lc].Freq++;
+    } else {
+        s->matches++;
+        /* Here, lc is the match length - MIN_MATCH */
+        dist--;             /* dist = match distance - 1 */
+        Assert((ush)dist < (ush)MAX_DIST(s) &&
+               (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
+               (ush)d_code(dist) < (ush)D_CODES,  "_tr_tally: bad match");
+
+        s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++;
+        s->dyn_dtree[d_code(dist)].Freq++;
+    }
+
+#ifdef TRUNCATE_BLOCK
+    /* Try to guess if it is profitable to stop the current block here */
+    if ((s->last_lit & 0x1fff) == 0 && s->level > 2) {
+        /* Compute an upper bound for the compressed length */
+        ulg out_length = (ulg)s->last_lit*8L;
+        ulg in_length = (ulg)((long)s->strstart - s->block_start);
+        int dcode;
+        for (dcode = 0; dcode < D_CODES; dcode++) {
+            out_length += (ulg)s->dyn_dtree[dcode].Freq *
+                (5L+extra_dbits[dcode]);
+        }
+        out_length >>= 3;
+        Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
+               s->last_lit, in_length, out_length,
+               100L - out_length*100L/in_length));
+        if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1;
+    }
+#endif
+    return (s->last_lit == s->lit_bufsize-1);
+    /* We avoid equality with lit_bufsize because of wraparound at 64K
+     * on 16 bit machines and because stored blocks are restricted to
+     * 64K-1 bytes.
+     */
+}
+
+/* ===========================================================================
+ * Send the block data compressed using the given Huffman trees
+ */
+local void compress_block(s, ltree, dtree)
+    deflate_state *s;
+    const ct_data *ltree; /* literal tree */
+    const ct_data *dtree; /* distance tree */
+{
+    unsigned dist;      /* distance of matched string */
+    int lc;             /* match length or unmatched char (if dist == 0) */
+    unsigned lx = 0;    /* running index in l_buf */
+    unsigned code;      /* the code to send */
+    int extra;          /* number of extra bits to send */
+
+    if (s->last_lit != 0) do {
+        dist = s->d_buf[lx];
+        lc = s->l_buf[lx++];
+        if (dist == 0) {
+            send_code(s, lc, ltree); /* send a literal byte */
+            Tracecv(isgraph(lc), (stderr," '%c' ", lc));
+        } else {
+            /* Here, lc is the match length - MIN_MATCH */
+            code = _length_code[lc];
+            send_code(s, code+LITERALS+1, ltree); /* send the length code */
+            extra = extra_lbits[code];
+            if (extra != 0) {
+                lc -= base_length[code];
+                send_bits(s, lc, extra);       /* send the extra length bits */
+            }
+            dist--; /* dist is now the match distance - 1 */
+            code = d_code(dist);
+            Assert (code < D_CODES, "bad d_code");
+
+            send_code(s, code, dtree);       /* send the distance code */
+            extra = extra_dbits[code];
+            if (extra != 0) {
+                dist -= base_dist[code];
+                send_bits(s, dist, extra);   /* send the extra distance bits */
+            }
+        } /* literal or match pair ? */
+
+        /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
+        Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
+               "pendingBuf overflow");
+
+    } while (lx < s->last_lit);
+
+    send_code(s, END_BLOCK, ltree);
+}
+
+/* ===========================================================================
+ * Check if the data type is TEXT or BINARY, using the following algorithm:
+ * - TEXT if the two conditions below are satisfied:
+ *    a) There are no non-portable control characters belonging to the
+ *       "black list" (0..6, 14..25, 28..31).
+ *    b) There is at least one printable character belonging to the
+ *       "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
+ * - BINARY otherwise.
+ * - The following partially-portable control characters form a
+ *   "gray list" that is ignored in this detection algorithm:
+ *   (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
+ * IN assertion: the fields Freq of dyn_ltree are set.
+ */
+local int detect_data_type(s)
+    deflate_state *s;
+{
+    /* black_mask is the bit mask of black-listed bytes
+     * set bits 0..6, 14..25, and 28..31
+     * 0xf3ffc07f = binary 11110011111111111100000001111111
+     */
+    unsigned long black_mask = 0xf3ffc07fUL;
+    int n;
+
+    /* Check for non-textual ("black-listed") bytes. */
+    for (n = 0; n <= 31; n++, black_mask >>= 1)
+        if ((black_mask & 1) && (s->dyn_ltree[n].Freq != 0))
+            return Z_BINARY;
+
+    /* Check for textual ("white-listed") bytes. */
+    if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
+            || s->dyn_ltree[13].Freq != 0)
+        return Z_TEXT;
+    for (n = 32; n < LITERALS; n++)
+        if (s->dyn_ltree[n].Freq != 0)
+            return Z_TEXT;
+
+    /* There are no "black-listed" or "white-listed" bytes:
+     * this stream either is empty or has tolerated ("gray-listed") bytes only.
+     */
+    return Z_BINARY;
+}
+
+/* ===========================================================================
+ * Reverse the first len bits of a code, using straightforward code (a faster
+ * method would use a table)
+ * IN assertion: 1 <= len <= 15
+ */
+local unsigned bi_reverse(code, len)
+    unsigned code; /* the value to invert */
+    int len;       /* its bit length */
+{
+    register unsigned res = 0;
+    do {
+        res |= code & 1;
+        code >>= 1, res <<= 1;
+    } while (--len > 0);
+    return res >> 1;
+}
+
+/* ===========================================================================
+ * Flush the bit buffer, keeping at most 7 bits in it.
+ */
+local void bi_flush(s)
+    deflate_state *s;
+{
+    if (s->bi_valid == 16) {
+        put_short(s, s->bi_buf);
+        s->bi_buf = 0;
+        s->bi_valid = 0;
+    } else if (s->bi_valid >= 8) {
+        put_byte(s, (Byte)s->bi_buf);
+        s->bi_buf >>= 8;
+        s->bi_valid -= 8;
+    }
+}
+
+/* ===========================================================================
+ * Flush the bit buffer and align the output on a byte boundary
+ */
+local void bi_windup(s)
+    deflate_state *s;
+{
+    if (s->bi_valid > 8) {
+        put_short(s, s->bi_buf);
+    } else if (s->bi_valid > 0) {
+        put_byte(s, (Byte)s->bi_buf);
+    }
+    s->bi_buf = 0;
+    s->bi_valid = 0;
+#ifdef DEBUG
+    s->bits_sent = (s->bits_sent+7) & ~7;
+#endif
+}
+
+/* ===========================================================================
+ * Copy a stored block, storing first the length and its
+ * one's complement if requested.
+ */
+local void copy_block(s, buf, len, header)
+    deflate_state *s;
+    charf    *buf;    /* the input data */
+    unsigned len;     /* its length */
+    int      header;  /* true if block header must be written */
+{
+    bi_windup(s);        /* align on byte boundary */
+
+    if (header) {
+        put_short(s, (ush)len);
+        put_short(s, (ush)~len);
+#ifdef DEBUG
+        s->bits_sent += 2*16;
+#endif
+    }
+#ifdef DEBUG
+    s->bits_sent += (ulg)len<<3;
+#endif
+    while (len--) {
+        put_byte(s, *buf++);
+    }
+}
diff --git a/src/external/tng_io/external/zlib/trees.h b/src/external/tng_io/external/zlib/trees.h
new file mode 100644 (file)
index 0000000..d35639d
--- /dev/null
@@ -0,0 +1,128 @@
+/* header created automatically with -DGEN_TREES_H */
+
+local const ct_data static_ltree[L_CODES+2] = {
+{{ 12},{  8}}, {{140},{  8}}, {{ 76},{  8}}, {{204},{  8}}, {{ 44},{  8}},
+{{172},{  8}}, {{108},{  8}}, {{236},{  8}}, {{ 28},{  8}}, {{156},{  8}},
+{{ 92},{  8}}, {{220},{  8}}, {{ 60},{  8}}, {{188},{  8}}, {{124},{  8}},
+{{252},{  8}}, {{  2},{  8}}, {{130},{  8}}, {{ 66},{  8}}, {{194},{  8}},
+{{ 34},{  8}}, {{162},{  8}}, {{ 98},{  8}}, {{226},{  8}}, {{ 18},{  8}},
+{{146},{  8}}, {{ 82},{  8}}, {{210},{  8}}, {{ 50},{  8}}, {{178},{  8}},
+{{114},{  8}}, {{242},{  8}}, {{ 10},{  8}}, {{138},{  8}}, {{ 74},{  8}},
+{{202},{  8}}, {{ 42},{  8}}, {{170},{  8}}, {{106},{  8}}, {{234},{  8}},
+{{ 26},{  8}}, {{154},{  8}}, {{ 90},{  8}}, {{218},{  8}}, {{ 58},{  8}},
+{{186},{  8}}, {{122},{  8}}, {{250},{  8}}, {{  6},{  8}}, {{134},{  8}},
+{{ 70},{  8}}, {{198},{  8}}, {{ 38},{  8}}, {{166},{  8}}, {{102},{  8}},
+{{230},{  8}}, {{ 22},{  8}}, {{150},{  8}}, {{ 86},{  8}}, {{214},{  8}},
+{{ 54},{  8}}, {{182},{  8}}, {{118},{  8}}, {{246},{  8}}, {{ 14},{  8}},
+{{142},{  8}}, {{ 78},{  8}}, {{206},{  8}}, {{ 46},{  8}}, {{174},{  8}},
+{{110},{  8}}, {{238},{  8}}, {{ 30},{  8}}, {{158},{  8}}, {{ 94},{  8}},
+{{222},{  8}}, {{ 62},{  8}}, {{190},{  8}}, {{126},{  8}}, {{254},{  8}},
+{{  1},{  8}}, {{129},{  8}}, {{ 65},{  8}}, {{193},{  8}}, {{ 33},{  8}},
+{{161},{  8}}, {{ 97},{  8}}, {{225},{  8}}, {{ 17},{  8}}, {{145},{  8}},
+{{ 81},{  8}}, {{209},{  8}}, {{ 49},{  8}}, {{177},{  8}}, {{113},{  8}},
+{{241},{  8}}, {{  9},{  8}}, {{137},{  8}}, {{ 73},{  8}}, {{201},{  8}},
+{{ 41},{  8}}, {{169},{  8}}, {{105},{  8}}, {{233},{  8}}, {{ 25},{  8}},
+{{153},{  8}}, {{ 89},{  8}}, {{217},{  8}}, {{ 57},{  8}}, {{185},{  8}},
+{{121},{  8}}, {{249},{  8}}, {{  5},{  8}}, {{133},{  8}}, {{ 69},{  8}},
+{{197},{  8}}, {{ 37},{  8}}, {{165},{  8}}, {{101},{  8}}, {{229},{  8}},
+{{ 21},{  8}}, {{149},{  8}}, {{ 85},{  8}}, {{213},{  8}}, {{ 53},{  8}},
+{{181},{  8}}, {{117},{  8}}, {{245},{  8}}, {{ 13},{  8}}, {{141},{  8}},
+{{ 77},{  8}}, {{205},{  8}}, {{ 45},{  8}}, {{173},{  8}}, {{109},{  8}},
+{{237},{  8}}, {{ 29},{  8}}, {{157},{  8}}, {{ 93},{  8}}, {{221},{  8}},
+{{ 61},{  8}}, {{189},{  8}}, {{125},{  8}}, {{253},{  8}}, {{ 19},{  9}},
+{{275},{  9}}, {{147},{  9}}, {{403},{  9}}, {{ 83},{  9}}, {{339},{  9}},
+{{211},{  9}}, {{467},{  9}}, {{ 51},{  9}}, {{307},{  9}}, {{179},{  9}},
+{{435},{  9}}, {{115},{  9}}, {{371},{  9}}, {{243},{  9}}, {{499},{  9}},
+{{ 11},{  9}}, {{267},{  9}}, {{139},{  9}}, {{395},{  9}}, {{ 75},{  9}},
+{{331},{  9}}, {{203},{  9}}, {{459},{  9}}, {{ 43},{  9}}, {{299},{  9}},
+{{171},{  9}}, {{427},{  9}}, {{107},{  9}}, {{363},{  9}}, {{235},{  9}},
+{{491},{  9}}, {{ 27},{  9}}, {{283},{  9}}, {{155},{  9}}, {{411},{  9}},
+{{ 91},{  9}}, {{347},{  9}}, {{219},{  9}}, {{475},{  9}}, {{ 59},{  9}},
+{{315},{  9}}, {{187},{  9}}, {{443},{  9}}, {{123},{  9}}, {{379},{  9}},
+{{251},{  9}}, {{507},{  9}}, {{  7},{  9}}, {{263},{  9}}, {{135},{  9}},
+{{391},{  9}}, {{ 71},{  9}}, {{327},{  9}}, {{199},{  9}}, {{455},{  9}},
+{{ 39},{  9}}, {{295},{  9}}, {{167},{  9}}, {{423},{  9}}, {{103},{  9}},
+{{359},{  9}}, {{231},{  9}}, {{487},{  9}}, {{ 23},{  9}}, {{279},{  9}},
+{{151},{  9}}, {{407},{  9}}, {{ 87},{  9}}, {{343},{  9}}, {{215},{  9}},
+{{471},{  9}}, {{ 55},{  9}}, {{311},{  9}}, {{183},{  9}}, {{439},{  9}},
+{{119},{  9}}, {{375},{  9}}, {{247},{  9}}, {{503},{  9}}, {{ 15},{  9}},
+{{271},{  9}}, {{143},{  9}}, {{399},{  9}}, {{ 79},{  9}}, {{335},{  9}},
+{{207},{  9}}, {{463},{  9}}, {{ 47},{  9}}, {{303},{  9}}, {{175},{  9}},
+{{431},{  9}}, {{111},{  9}}, {{367},{  9}}, {{239},{  9}}, {{495},{  9}},
+{{ 31},{  9}}, {{287},{  9}}, {{159},{  9}}, {{415},{  9}}, {{ 95},{  9}},
+{{351},{  9}}, {{223},{  9}}, {{479},{  9}}, {{ 63},{  9}}, {{319},{  9}},
+{{191},{  9}}, {{447},{  9}}, {{127},{  9}}, {{383},{  9}}, {{255},{  9}},
+{{511},{  9}}, {{  0},{  7}}, {{ 64},{  7}}, {{ 32},{  7}}, {{ 96},{  7}},
+{{ 16},{  7}}, {{ 80},{  7}}, {{ 48},{  7}}, {{112},{  7}}, {{  8},{  7}},
+{{ 72},{  7}}, {{ 40},{  7}}, {{104},{  7}}, {{ 24},{  7}}, {{ 88},{  7}},
+{{ 56},{  7}}, {{120},{  7}}, {{  4},{  7}}, {{ 68},{  7}}, {{ 36},{  7}},
+{{100},{  7}}, {{ 20},{  7}}, {{ 84},{  7}}, {{ 52},{  7}}, {{116},{  7}},
+{{  3},{  8}}, {{131},{  8}}, {{ 67},{  8}}, {{195},{  8}}, {{ 35},{  8}},
+{{163},{  8}}, {{ 99},{  8}}, {{227},{  8}}
+};
+
+local const ct_data static_dtree[D_CODES] = {
+{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}},
+{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}},
+{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}},
+{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}},
+{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}},
+{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}
+};
+
+const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {
+ 0,  1,  2,  3,  4,  4,  5,  5,  6,  6,  6,  6,  7,  7,  7,  7,  8,  8,  8,  8,
+ 8,  8,  8,  8,  9,  9,  9,  9,  9,  9,  9,  9, 10, 10, 10, 10, 10, 10, 10, 10,
+10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13,
+13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
+15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  0,  0, 16, 17,
+18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22,
+23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27,
+27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
+};
+
+const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {
+ 0,  1,  2,  3,  4,  5,  6,  7,  8,  8,  9,  9, 10, 10, 11, 11, 12, 12, 12, 12,
+13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
+17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,
+19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22,
+22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,
+23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26,
+26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28
+};
+
+local const int base_length[LENGTH_CODES] = {
+0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56,
+64, 80, 96, 112, 128, 160, 192, 224, 0
+};
+
+local const int base_dist[D_CODES] = {
+    0,     1,     2,     3,     4,     6,     8,    12,    16,    24,
+   32,    48,    64,    96,   128,   192,   256,   384,   512,   768,
+ 1024,  1536,  2048,  3072,  4096,  6144,  8192, 12288, 16384, 24576
+};
+
diff --git a/src/external/tng_io/external/zlib/uncompr.c b/src/external/tng_io/external/zlib/uncompr.c
new file mode 100644 (file)
index 0000000..242e949
--- /dev/null
@@ -0,0 +1,59 @@
+/* uncompr.c -- decompress a memory buffer
+ * Copyright (C) 1995-2003, 2010 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#define ZLIB_INTERNAL
+#include "zlib.h"
+
+/* ===========================================================================
+     Decompresses the source buffer into the destination buffer.  sourceLen is
+   the byte length of the source buffer. Upon entry, destLen is the total
+   size of the destination buffer, which must be large enough to hold the
+   entire uncompressed data. (The size of the uncompressed data must have
+   been saved previously by the compressor and transmitted to the decompressor
+   by some mechanism outside the scope of this compression library.)
+   Upon exit, destLen is the actual size of the compressed buffer.
+
+     uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_BUF_ERROR if there was not enough room in the output
+   buffer, or Z_DATA_ERROR if the input data was corrupted.
+*/
+int ZEXPORT uncompress (dest, destLen, source, sourceLen)
+    Bytef *dest;
+    uLongf *destLen;
+    const Bytef *source;
+    uLong sourceLen;
+{
+    z_stream stream;
+    int err;
+
+    stream.next_in = (z_const Bytef *)source;
+    stream.avail_in = (uInt)sourceLen;
+    /* Check for source > 64K on 16-bit machine: */
+    if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
+
+    stream.next_out = dest;
+    stream.avail_out = (uInt)*destLen;
+    if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
+
+    stream.zalloc = (alloc_func)0;
+    stream.zfree = (free_func)0;
+
+    err = inflateInit(&stream);
+    if (err != Z_OK) return err;
+
+    err = inflate(&stream, Z_FINISH);
+    if (err != Z_STREAM_END) {
+        inflateEnd(&stream);
+        if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0))
+            return Z_DATA_ERROR;
+        return err;
+    }
+    *destLen = stream.total_out;
+
+    err = inflateEnd(&stream);
+    return err;
+}
diff --git a/src/external/tng_io/external/zlib/zconf.h b/src/external/tng_io/external/zlib/zconf.h
new file mode 100644 (file)
index 0000000..c90fb53
--- /dev/null
@@ -0,0 +1,367 @@
+/* zconf.h -- configuration of the zlib compression library
+ * Copyright (C) 1995-2013 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#ifndef ZCONF_H
+#define ZCONF_H
+
+#if defined(__MSDOS__) && !defined(MSDOS)
+#  define MSDOS
+#endif
+#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
+#  define OS2
+#endif
+#if defined(_WINDOWS) && !defined(WINDOWS)
+#  define WINDOWS
+#endif
+#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
+#  ifndef WIN32
+#    define WIN32
+#  endif
+#endif
+#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
+#  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
+#    ifndef SYS16BIT
+#      define SYS16BIT
+#    endif
+#  endif
+#endif
+
+/*
+ * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
+ * than 64k bytes at a time (needed on systems with 16-bit int).
+ */
+#ifdef SYS16BIT
+#  define MAXSEG_64K
+#endif
+#ifdef MSDOS
+#  define UNALIGNED_OK
+#endif
+
+#ifdef __STDC_VERSION__
+#  ifndef STDC
+#    define STDC
+#  endif
+#  if __STDC_VERSION__ >= 199901L
+#    ifndef STDC99
+#      define STDC99
+#    endif
+#  endif
+#endif
+#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
+#  define STDC
+#endif
+#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
+#  define STDC
+#endif
+#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
+#  define STDC
+#endif
+#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
+#  define STDC
+#endif
+
+#if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
+#  define STDC
+#endif
+
+#ifndef STDC
+#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
+#    define const       /* note: need a more gentle solution here */
+#  endif
+#endif
+
+#if defined(ZLIB_CONST) && !defined(z_const)
+#  define z_const const
+#else
+#  define z_const
+#endif
+
+/* Some Mac compilers merge all .h files incorrectly: */
+#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
+#  define NO_DUMMY_DECL
+#endif
+
+/* Maximum value for memLevel in deflateInit2 */
+#ifndef MAX_MEM_LEVEL
+#  ifdef MAXSEG_64K
+#    define MAX_MEM_LEVEL 8
+#  else
+#    define MAX_MEM_LEVEL 9
+#  endif
+#endif
+
+/* Maximum value for windowBits in deflateInit2 and inflateInit2.
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
+ * created by gzip. (Files created by minigzip can still be extracted by
+ * gzip.)
+ */
+#ifndef MAX_WBITS
+#  define MAX_WBITS   15 /* 32K LZ77 window */
+#endif
+
+/* The memory requirements for deflate are (in bytes):
+            (1 << (windowBits+2)) +  (1 << (memLevel+9))
+ that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
+ plus a few kilobytes for small objects. For example, if you want to reduce
+ the default memory requirements from 256K to 128K, compile with
+     make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
+ Of course this will generally degrade compression (there's no free lunch).
+
+   The memory requirements for inflate are (in bytes) 1 << windowBits
+ that is, 32K for windowBits=15 (default value) plus a few kilobytes
+ for small objects.
+*/
+
+                        /* Type declarations */
+
+#ifndef OF /* function prototypes */
+#  ifdef STDC
+#    define OF(args)  args
+#  else
+#    define OF(args)  ()
+#  endif
+#endif
+
+#ifndef Z_ARG /* function prototypes for stdarg */
+#  if defined(STDC) || defined(Z_HAVE_STDARG_H)
+#    define Z_ARG(args)  args
+#  else
+#    define Z_ARG(args)  ()
+#  endif
+#endif
+
+/* The following definitions for FAR are needed only for MSDOS mixed
+ * model programming (small or medium model with some far allocations).
+ * This was tested only with MSC; for other MSDOS compilers you may have
+ * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
+ * just define FAR to be empty.
+ */
+#ifdef SYS16BIT
+#  if defined(M_I86SM) || defined(M_I86MM)
+     /* MSC small or medium model */
+#    define SMALL_MEDIUM
+#    ifdef _MSC_VER
+#      define FAR _far
+#    else
+#      define FAR far
+#    endif
+#  endif
+#  if (defined(__SMALL__) || defined(__MEDIUM__))
+     /* Turbo C small or medium model */
+#    define SMALL_MEDIUM
+#    ifdef __BORLANDC__
+#      define FAR _far
+#    else
+#      define FAR far
+#    endif
+#  endif
+#endif
+
+#if defined(WINDOWS) || defined(WIN32)
+   /* If building or using zlib as a DLL, define ZLIB_DLL.
+    * This is not mandatory, but it offers a little performance increase.
+    */
+#  ifdef ZLIB_DLL
+#    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
+#      ifdef ZLIB_INTERNAL
+#        define ZEXTERN extern __declspec(dllexport)
+#      else
+#        define ZEXTERN extern __declspec(dllimport)
+#      endif
+#    endif
+#  endif  /* ZLIB_DLL */
+   /* If building or using zlib with the WINAPI/WINAPIV calling convention,
+    * define ZLIB_WINAPI.
+    * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
+    */
+#  ifdef ZLIB_WINAPI
+#    ifdef FAR
+#      undef FAR
+#    endif
+#    include <windows.h>
+     /* No need for _export, use ZLIB.DEF instead. */
+     /* For complete Windows compatibility, use WINAPI, not __stdcall. */
+#    define ZEXPORT WINAPI
+#    ifdef WIN32
+#      define ZEXPORTVA WINAPIV
+#    else
+#      define ZEXPORTVA FAR CDECL
+#    endif
+#  endif
+#endif
+
+#if defined (__BEOS__)
+#  ifdef ZLIB_DLL
+#    ifdef ZLIB_INTERNAL
+#      define ZEXPORT   __declspec(dllexport)
+#      define ZEXPORTVA __declspec(dllexport)
+#    else
+#      define ZEXPORT   __declspec(dllimport)
+#      define ZEXPORTVA __declspec(dllimport)
+#    endif
+#  endif
+#endif
+
+#ifndef ZEXTERN
+#  define ZEXTERN extern
+#endif
+#ifndef ZEXPORT
+#  define ZEXPORT
+#endif
+#ifndef ZEXPORTVA
+#  define ZEXPORTVA
+#endif
+
+#ifndef FAR
+#  define FAR
+#endif
+
+#if !defined(__MACTYPES__)
+typedef unsigned char  Byte;  /* 8 bits */
+#endif
+typedef unsigned int   uInt;  /* 16 bits or more */
+typedef unsigned long  uLong; /* 32 bits or more */
+
+#ifdef SMALL_MEDIUM
+   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
+#  define Bytef Byte FAR
+#else
+   typedef Byte  FAR Bytef;
+#endif
+typedef char  FAR charf;
+typedef int   FAR intf;
+typedef uInt  FAR uIntf;
+typedef uLong FAR uLongf;
+
+#ifdef STDC
+   typedef void const *voidpc;
+   typedef void FAR   *voidpf;
+   typedef void       *voidp;
+#else
+   typedef Byte const *voidpc;
+   typedef Byte FAR   *voidpf;
+   typedef Byte       *voidp;
+#endif
+
+#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
+#  include <limits.h>
+#  if (UINT_MAX == 0xffffffffUL)
+#    define Z_U4 unsigned
+#  elif (ULONG_MAX == 0xffffffffUL)
+#    define Z_U4 unsigned long
+#  elif (USHRT_MAX == 0xffffffffUL)
+#    define Z_U4 unsigned short
+#  endif
+#endif
+
+#ifdef Z_U4
+   typedef Z_U4 z_crc_t;
+#else
+   typedef unsigned long z_crc_t;
+#endif
+
+#ifdef HAVE_UNISTD_H    /* may be set to #if 1 by ./configure */
+#  define Z_HAVE_UNISTD_H
+#endif
+
+#ifdef HAVE_STDARG_H    /* may be set to #if 1 by ./configure */
+#  define Z_HAVE_STDARG_H
+#endif
+
+#ifdef STDC
+#  ifndef Z_SOLO
+#    include <sys/types.h>      /* for off_t */
+#  endif
+#endif
+
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
+#  ifndef Z_SOLO
+#    include <stdarg.h>         /* for va_list */
+#  endif
+#endif
+
+#ifdef _WIN32
+#  ifndef Z_SOLO
+#    include <stddef.h>         /* for wchar_t */
+#  endif
+#endif
+
+/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
+ * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
+ * though the former does not conform to the LFS document), but considering
+ * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
+ * equivalently requesting no 64-bit operations
+ */
+#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
+#  undef _LARGEFILE64_SOURCE
+#endif
+
+#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
+#  define Z_HAVE_UNISTD_H
+#endif
+#ifndef Z_SOLO
+#  if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
+#    include <unistd.h>         /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
+#    ifdef VMS
+#      include <unixio.h>       /* for off_t */
+#    endif
+#    ifndef z_off_t
+#      define z_off_t off_t
+#    endif
+#  endif
+#endif
+
+#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
+#  define Z_LFS64
+#endif
+
+#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
+#  define Z_LARGE64
+#endif
+
+#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
+#  define Z_WANT64
+#endif
+
+#if !defined(SEEK_SET) && !defined(Z_SOLO)
+#  define SEEK_SET        0       /* Seek from beginning of file.  */
+#  define SEEK_CUR        1       /* Seek from current position.  */
+#  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
+#endif
+
+#ifndef z_off_t
+#  define z_off_t long
+#endif
+
+#if !defined(_WIN32) && defined(Z_LARGE64)
+#  define z_off64_t off64_t
+#else
+#  if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
+#    define z_off64_t __int64
+#  else
+#    define z_off64_t z_off_t
+#  endif
+#endif
+
+/* MVS linker does not support external names larger than 8 bytes */
+#if defined(__MVS__)
+  #pragma map(deflateInit_,"DEIN")
+  #pragma map(deflateInit2_,"DEIN2")
+  #pragma map(deflateEnd,"DEEND")
+  #pragma map(deflateBound,"DEBND")
+  #pragma map(inflateInit_,"ININ")
+  #pragma map(inflateInit2_,"ININ2")
+  #pragma map(inflateEnd,"INEND")
+  #pragma map(inflateSync,"INSY")
+  #pragma map(inflateSetDictionary,"INSEDI")
+  #pragma map(compressBound,"CMBND")
+  #pragma map(inflate_table,"INTABL")
+  #pragma map(inflate_fast,"INFA")
+  #pragma map(inflate_copyright,"INCOPY")
+#endif
+
+#endif /* ZCONF_H */
diff --git a/src/external/tng_io/external/zlib/zlib.h b/src/external/tng_io/external/zlib/zlib.h
new file mode 100644 (file)
index 0000000..565d0ed
--- /dev/null
@@ -0,0 +1,1769 @@
+/* zlib.h -- interface of the 'zlib' general purpose compression library
+  version 1.2.8, April 28th, 2013
+
+  Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+  Jean-loup Gailly        Mark Adler
+  jloup@gzip.org          madler@alumni.caltech.edu
+
+
+  The data format used by the zlib library is described by RFCs (Request for
+  Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950
+  (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).
+*/
+
+#ifndef ZLIB_H
+#define ZLIB_H
+
+#include "zconf.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ZLIB_VERSION "1.2.8"
+#define ZLIB_VERNUM 0x1280
+#define ZLIB_VER_MAJOR 1
+#define ZLIB_VER_MINOR 2
+#define ZLIB_VER_REVISION 8
+#define ZLIB_VER_SUBREVISION 0
+
+/*
+    The 'zlib' compression library provides in-memory compression and
+  decompression functions, including integrity checks of the uncompressed data.
+  This version of the library supports only one compression method (deflation)
+  but other algorithms will be added later and will have the same stream
+  interface.
+
+    Compression can be done in a single step if the buffers are large enough,
+  or can be done by repeated calls of the compression function.  In the latter
+  case, the application must provide more input and/or consume the output
+  (providing more output space) before each call.
+
+    The compressed data format used by default by the in-memory functions is
+  the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
+  around a deflate stream, which is itself documented in RFC 1951.
+
+    The library also supports reading and writing files in gzip (.gz) format
+  with an interface similar to that of stdio using the functions that start
+  with "gz".  The gzip format is different from the zlib format.  gzip is a
+  gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
+
+    This library can optionally read and write gzip streams in memory as well.
+
+    The zlib format was designed to be compact and fast for use in memory
+  and on communications channels.  The gzip format was designed for single-
+  file compression on file systems, has a larger header than zlib to maintain
+  directory information, and uses a different, slower check method than zlib.
+
+    The library does not install any signal handler.  The decoder checks
+  the consistency of the compressed data, so the library should never crash
+  even in case of corrupted input.
+*/
+
+typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
+typedef void   (*free_func)  OF((voidpf opaque, voidpf address));
+
+struct internal_state;
+
+typedef struct z_stream_s {
+    z_const Bytef *next_in;     /* next input byte */
+    uInt     avail_in;  /* number of bytes available at next_in */
+    uLong    total_in;  /* total number of input bytes read so far */
+
+    Bytef    *next_out; /* next output byte should be put there */
+    uInt     avail_out; /* remaining free space at next_out */
+    uLong    total_out; /* total number of bytes output so far */
+
+    z_const char *msg;  /* last error message, NULL if no error */
+    struct internal_state FAR *state; /* not visible by applications */
+
+    alloc_func zalloc;  /* used to allocate the internal state */
+    free_func  zfree;   /* used to free the internal state */
+    voidpf     opaque;  /* private data object passed to zalloc and zfree */
+
+    int     data_type;  /* best guess about the data type: binary or text */
+    uLong   adler;      /* adler32 value of the uncompressed data */
+    uLong   reserved;   /* reserved for future use */
+} z_stream;
+
+typedef z_stream FAR *z_streamp;
+
+/*
+     gzip header information passed to and from zlib routines.  See RFC 1952
+  for more details on the meanings of these fields.
+*/
+typedef struct gz_header_s {
+    int     text;       /* true if compressed data believed to be text */
+    uLong   time;       /* modification time */
+    int     xflags;     /* extra flags (not used when writing a gzip file) */
+    int     os;         /* operating system */
+    Bytef   *extra;     /* pointer to extra field or Z_NULL if none */
+    uInt    extra_len;  /* extra field length (valid if extra != Z_NULL) */
+    uInt    extra_max;  /* space at extra (only when reading header) */
+    Bytef   *name;      /* pointer to zero-terminated file name or Z_NULL */
+    uInt    name_max;   /* space at name (only when reading header) */
+    Bytef   *comment;   /* pointer to zero-terminated comment or Z_NULL */
+    uInt    comm_max;   /* space at comment (only when reading header) */
+    int     hcrc;       /* true if there was or will be a header crc */
+    int     done;       /* true when done reading gzip header (not used
+                           when writing a gzip file) */
+} gz_header;
+
+typedef gz_header FAR *gz_headerp;
+
+/*
+     The application must update next_in and avail_in when avail_in has dropped
+   to zero.  It must update next_out and avail_out when avail_out has dropped
+   to zero.  The application must initialize zalloc, zfree and opaque before
+   calling the init function.  All other fields are set by the compression
+   library and must not be updated by the application.
+
+     The opaque value provided by the application will be passed as the first
+   parameter for calls of zalloc and zfree.  This can be useful for custom
+   memory management.  The compression library attaches no meaning to the
+   opaque value.
+
+     zalloc must return Z_NULL if there is not enough memory for the object.
+   If zlib is used in a multi-threaded application, zalloc and zfree must be
+   thread safe.
+
+     On 16-bit systems, the functions zalloc and zfree must be able to allocate
+   exactly 65536 bytes, but will not be required to allocate more than this if
+   the symbol MAXSEG_64K is defined (see zconf.h).  WARNING: On MSDOS, pointers
+   returned by zalloc for objects of exactly 65536 bytes *must* have their
+   offset normalized to zero.  The default allocation function provided by this
+   library ensures this (see zutil.c).  To reduce memory requirements and avoid
+   any allocation of 64K objects, at the expense of compression ratio, compile
+   the library with -DMAX_WBITS=14 (see zconf.h).
+
+     The fields total_in and total_out can be used for statistics or progress
+   reports.  After compression, total_in holds the total size of the
+   uncompressed data and may be saved for use in the decompressor (particularly
+   if the decompressor wants to decompress everything in a single step).
+*/
+
+                        /* constants */
+
+#define Z_NO_FLUSH      0
+#define Z_PARTIAL_FLUSH 1
+#define Z_SYNC_FLUSH    2
+#define Z_FULL_FLUSH    3
+#define Z_FINISH        4
+#define Z_BLOCK         5
+#define Z_TREES         6
+/* Allowed flush values; see deflate() and inflate() below for details */
+
+#define Z_OK            0
+#define Z_STREAM_END    1
+#define Z_NEED_DICT     2
+#define Z_ERRNO        (-1)
+#define Z_STREAM_ERROR (-2)
+#define Z_DATA_ERROR   (-3)
+#define Z_MEM_ERROR    (-4)
+#define Z_BUF_ERROR    (-5)
+#define Z_VERSION_ERROR (-6)
+/* Return codes for the compression/decompression functions. Negative values
+ * are errors, positive values are used for special but normal events.
+ */
+
+#define Z_NO_COMPRESSION         0
+#define Z_BEST_SPEED             1
+#define Z_BEST_COMPRESSION       9
+#define Z_DEFAULT_COMPRESSION  (-1)
+/* compression levels */
+
+#define Z_FILTERED            1
+#define Z_HUFFMAN_ONLY        2
+#define Z_RLE                 3
+#define Z_FIXED               4
+#define Z_DEFAULT_STRATEGY    0
+/* compression strategy; see deflateInit2() below for details */
+
+#define Z_BINARY   0
+#define Z_TEXT     1
+#define Z_ASCII    Z_TEXT   /* for compatibility with 1.2.2 and earlier */
+#define Z_UNKNOWN  2
+/* Possible values of the data_type field (though see inflate()) */
+
+#define Z_DEFLATED   8
+/* The deflate compression method (the only one supported in this version) */
+
+#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
+
+#define zlib_version zlibVersion()
+/* for compatibility with versions < 1.0.2 */
+
+
+                        /* basic functions */
+
+ZEXTERN const char * ZEXPORT zlibVersion OF((void));
+/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
+   If the first character differs, the library code actually used is not
+   compatible with the zlib.h header file used by the application.  This check
+   is automatically made by deflateInit and inflateInit.
+ */
+
+/*
+ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
+
+     Initializes the internal stream state for compression.  The fields
+   zalloc, zfree and opaque must be initialized before by the caller.  If
+   zalloc and zfree are set to Z_NULL, deflateInit updates them to use default
+   allocation functions.
+
+     The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
+   1 gives best speed, 9 gives best compression, 0 gives no compression at all
+   (the input data is simply copied a block at a time).  Z_DEFAULT_COMPRESSION
+   requests a default compromise between speed and compression (currently
+   equivalent to level 6).
+
+     deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_STREAM_ERROR if level is not a valid compression level, or
+   Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
+   with the version assumed by the caller (ZLIB_VERSION).  msg is set to null
+   if there is no error message.  deflateInit does not perform any compression:
+   this will be done by deflate().
+*/
+
+
+ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
+/*
+    deflate compresses as much data as possible, and stops when the input
+  buffer becomes empty or the output buffer becomes full.  It may introduce
+  some output latency (reading input without producing any output) except when
+  forced to flush.
+
+    The detailed semantics are as follows.  deflate performs one or both of the
+  following actions:
+
+  - Compress more input starting at next_in and update next_in and avail_in
+    accordingly.  If not all input can be processed (because there is not
+    enough room in the output buffer), next_in and avail_in are updated and
+    processing will resume at this point for the next call of deflate().
+
+  - Provide more output starting at next_out and update next_out and avail_out
+    accordingly.  This action is forced if the parameter flush is non zero.
+    Forcing flush frequently degrades the compression ratio, so this parameter
+    should be set only when necessary (in interactive applications).  Some
+    output may be provided even if flush is not set.
+
+    Before the call of deflate(), the application should ensure that at least
+  one of the actions is possible, by providing more input and/or consuming more
+  output, and updating avail_in or avail_out accordingly; avail_out should
+  never be zero before the call.  The application can consume the compressed
+  output when it wants, for example when the output buffer is full (avail_out
+  == 0), or after each call of deflate().  If deflate returns Z_OK and with
+  zero avail_out, it must be called again after making room in the output
+  buffer because there might be more output pending.
+
+    Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
+  decide how much data to accumulate before producing output, in order to
+  maximize compression.
+
+    If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
+  flushed to the output buffer and the output is aligned on a byte boundary, so
+  that the decompressor can get all input data available so far.  (In
+  particular avail_in is zero after the call if enough output space has been
+  provided before the call.) Flushing may degrade compression for some
+  compression algorithms and so it should be used only when necessary.  This
+  completes the current deflate block and follows it with an empty stored block
+  that is three bits plus filler bits to the next byte, followed by four bytes
+  (00 00 ff ff).
+
+    If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the
+  output buffer, but the output is not aligned to a byte boundary.  All of the
+  input data so far will be available to the decompressor, as for Z_SYNC_FLUSH.
+  This completes the current deflate block and follows it with an empty fixed
+  codes block that is 10 bits long.  This assures that enough bytes are output
+  in order for the decompressor to finish the block before the empty fixed code
+  block.
+
+    If flush is set to Z_BLOCK, a deflate block is completed and emitted, as
+  for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to
+  seven bits of the current block are held to be written as the next byte after
+  the next deflate block is completed.  In this case, the decompressor may not
+  be provided enough bits at this point in order to complete decompression of
+  the data provided so far to the compressor.  It may need to wait for the next
+  block to be emitted.  This is for advanced applications that need to control
+  the emission of deflate blocks.
+
+    If flush is set to Z_FULL_FLUSH, all output is flushed as with
+  Z_SYNC_FLUSH, and the compression state is reset so that decompression can
+  restart from this point if previous compressed data has been damaged or if
+  random access is desired.  Using Z_FULL_FLUSH too often can seriously degrade
+  compression.
+
+    If deflate returns with avail_out == 0, this function must be called again
+  with the same value of the flush parameter and more output space (updated
+  avail_out), until the flush is complete (deflate returns with non-zero
+  avail_out).  In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
+  avail_out is greater than six to avoid repeated flush markers due to
+  avail_out == 0 on return.
+
+    If the parameter flush is set to Z_FINISH, pending input is processed,
+  pending output is flushed and deflate returns with Z_STREAM_END if there was
+  enough output space; if deflate returns with Z_OK, this function must be
+  called again with Z_FINISH and more output space (updated avail_out) but no
+  more input data, until it returns with Z_STREAM_END or an error.  After
+  deflate has returned Z_STREAM_END, the only possible operations on the stream
+  are deflateReset or deflateEnd.
+
+    Z_FINISH can be used immediately after deflateInit if all the compression
+  is to be done in a single step.  In this case, avail_out must be at least the
+  value returned by deflateBound (see below).  Then deflate is guaranteed to
+  return Z_STREAM_END.  If not enough output space is provided, deflate will
+  not return Z_STREAM_END, and it must be called again as described above.
+
+    deflate() sets strm->adler to the adler32 checksum of all input read
+  so far (that is, total_in bytes).
+
+    deflate() may update strm->data_type if it can make a good guess about
+  the input data type (Z_BINARY or Z_TEXT).  In doubt, the data is considered
+  binary.  This field is only for information purposes and does not affect the
+  compression algorithm in any manner.
+
+    deflate() returns Z_OK if some progress has been made (more input
+  processed or more output produced), Z_STREAM_END if all input has been
+  consumed and all output has been produced (only when flush is set to
+  Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
+  if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible
+  (for example avail_in or avail_out was zero).  Note that Z_BUF_ERROR is not
+  fatal, and deflate() can be called again with more input and more output
+  space to continue compressing.
+*/
+
+
+ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
+/*
+     All dynamically allocated data structures for this stream are freed.
+   This function discards any unprocessed input and does not flush any pending
+   output.
+
+     deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
+   stream state was inconsistent, Z_DATA_ERROR if the stream was freed
+   prematurely (some input or output was discarded).  In the error case, msg
+   may be set but then points to a static string (which must not be
+   deallocated).
+*/
+
+
+/*
+ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
+
+     Initializes the internal stream state for decompression.  The fields
+   next_in, avail_in, zalloc, zfree and opaque must be initialized before by
+   the caller.  If next_in is not Z_NULL and avail_in is large enough (the
+   exact value depends on the compression method), inflateInit determines the
+   compression method from the zlib header and allocates all data structures
+   accordingly; otherwise the allocation will be deferred to the first call of
+   inflate.  If zalloc and zfree are set to Z_NULL, inflateInit updates them to
+   use default allocation functions.
+
+     inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+   version assumed by the caller, or Z_STREAM_ERROR if the parameters are
+   invalid, such as a null pointer to the structure.  msg is set to null if
+   there is no error message.  inflateInit does not perform any decompression
+   apart from possibly reading the zlib header if present: actual decompression
+   will be done by inflate().  (So next_in and avail_in may be modified, but
+   next_out and avail_out are unused and unchanged.) The current implementation
+   of inflateInit() does not process any header information -- that is deferred
+   until inflate() is called.
+*/
+
+
+ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
+/*
+    inflate decompresses as much data as possible, and stops when the input
+  buffer becomes empty or the output buffer becomes full.  It may introduce
+  some output latency (reading input without producing any output) except when
+  forced to flush.
+
+  The detailed semantics are as follows.  inflate performs one or both of the
+  following actions:
+
+  - Decompress more input starting at next_in and update next_in and avail_in
+    accordingly.  If not all input can be processed (because there is not
+    enough room in the output buffer), next_in is updated and processing will
+    resume at this point for the next call of inflate().
+
+  - Provide more output starting at next_out and update next_out and avail_out
+    accordingly.  inflate() provides as much output as possible, until there is
+    no more input data or no more space in the output buffer (see below about
+    the flush parameter).
+
+    Before the call of inflate(), the application should ensure that at least
+  one of the actions is possible, by providing more input and/or consuming more
+  output, and updating the next_* and avail_* values accordingly.  The
+  application can consume the uncompressed output when it wants, for example
+  when the output buffer is full (avail_out == 0), or after each call of
+  inflate().  If inflate returns Z_OK and with zero avail_out, it must be
+  called again after making room in the output buffer because there might be
+  more output pending.
+
+    The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH,
+  Z_BLOCK, or Z_TREES.  Z_SYNC_FLUSH requests that inflate() flush as much
+  output as possible to the output buffer.  Z_BLOCK requests that inflate()
+  stop if and when it gets to the next deflate block boundary.  When decoding
+  the zlib or gzip format, this will cause inflate() to return immediately
+  after the header and before the first block.  When doing a raw inflate,
+  inflate() will go ahead and process the first block, and will return when it
+  gets to the end of that block, or when it runs out of data.
+
+    The Z_BLOCK option assists in appending to or combining deflate streams.
+  Also to assist in this, on return inflate() will set strm->data_type to the
+  number of unused bits in the last byte taken from strm->next_in, plus 64 if
+  inflate() is currently decoding the last block in the deflate stream, plus
+  128 if inflate() returned immediately after decoding an end-of-block code or
+  decoding the complete header up to just before the first byte of the deflate
+  stream.  The end-of-block will not be indicated until all of the uncompressed
+  data from that block has been written to strm->next_out.  The number of
+  unused bits may in general be greater than seven, except when bit 7 of
+  data_type is set, in which case the number of unused bits will be less than
+  eight.  data_type is set as noted here every time inflate() returns for all
+  flush options, and so can be used to determine the amount of currently
+  consumed input in bits.
+
+    The Z_TREES option behaves as Z_BLOCK does, but it also returns when the
+  end of each deflate block header is reached, before any actual data in that
+  block is decoded.  This allows the caller to determine the length of the
+  deflate block header for later use in random access within a deflate block.
+  256 is added to the value of strm->data_type when inflate() returns
+  immediately after reaching the end of the deflate block header.
+
+    inflate() should normally be called until it returns Z_STREAM_END or an
+  error.  However if all decompression is to be performed in a single step (a
+  single call of inflate), the parameter flush should be set to Z_FINISH.  In
+  this case all pending input is processed and all pending output is flushed;
+  avail_out must be large enough to hold all of the uncompressed data for the
+  operation to complete.  (The size of the uncompressed data may have been
+  saved by the compressor for this purpose.) The use of Z_FINISH is not
+  required to perform an inflation in one step.  However it may be used to
+  inform inflate that a faster approach can be used for the single inflate()
+  call.  Z_FINISH also informs inflate to not maintain a sliding window if the
+  stream completes, which reduces inflate's memory footprint.  If the stream
+  does not complete, either because not all of the stream is provided or not
+  enough output space is provided, then a sliding window will be allocated and
+  inflate() can be called again to continue the operation as if Z_NO_FLUSH had
+  been used.
+
+     In this implementation, inflate() always flushes as much output as
+  possible to the output buffer, and always uses the faster approach on the
+  first call.  So the effects of the flush parameter in this implementation are
+  on the return value of inflate() as noted below, when inflate() returns early
+  when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of
+  memory for a sliding window when Z_FINISH is used.
+
+     If a preset dictionary is needed after this call (see inflateSetDictionary
+  below), inflate sets strm->adler to the Adler-32 checksum of the dictionary
+  chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
+  strm->adler to the Adler-32 checksum of all output produced so far (that is,
+  total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
+  below.  At the end of the stream, inflate() checks that its computed adler32
+  checksum is equal to that saved by the compressor and returns Z_STREAM_END
+  only if the checksum is correct.
+
+    inflate() can decompress and check either zlib-wrapped or gzip-wrapped
+  deflate data.  The header type is detected automatically, if requested when
+  initializing with inflateInit2().  Any information contained in the gzip
+  header is not retained, so applications that need that information should
+  instead use raw inflate, see inflateInit2() below, or inflateBack() and
+  perform their own processing of the gzip header and trailer.  When processing
+  gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output
+  producted so far.  The CRC-32 is checked against the gzip trailer.
+
+    inflate() returns Z_OK if some progress has been made (more input processed
+  or more output produced), Z_STREAM_END if the end of the compressed data has
+  been reached and all uncompressed output has been produced, Z_NEED_DICT if a
+  preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
+  corrupted (input stream not conforming to the zlib format or incorrect check
+  value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
+  next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory,
+  Z_BUF_ERROR if no progress is possible or if there was not enough room in the
+  output buffer when Z_FINISH is used.  Note that Z_BUF_ERROR is not fatal, and
+  inflate() can be called again with more input and more output space to
+  continue decompressing.  If Z_DATA_ERROR is returned, the application may
+  then call inflateSync() to look for a good compression block if a partial
+  recovery of the data is desired.
+*/
+
+
+ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
+/*
+     All dynamically allocated data structures for this stream are freed.
+   This function discards any unprocessed input and does not flush any pending
+   output.
+
+     inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
+   was inconsistent.  In the error case, msg may be set but then points to a
+   static string (which must not be deallocated).
+*/
+
+
+                        /* Advanced functions */
+
+/*
+    The following functions are needed only in some special applications.
+*/
+
+/*
+ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
+                                     int  level,
+                                     int  method,
+                                     int  windowBits,
+                                     int  memLevel,
+                                     int  strategy));
+
+     This is another version of deflateInit with more compression options.  The
+   fields next_in, zalloc, zfree and opaque must be initialized before by the
+   caller.
+
+     The method parameter is the compression method.  It must be Z_DEFLATED in
+   this version of the library.
+
+     The windowBits parameter is the base two logarithm of the window size
+   (the size of the history buffer).  It should be in the range 8..15 for this
+   version of the library.  Larger values of this parameter result in better
+   compression at the expense of memory usage.  The default value is 15 if
+   deflateInit is used instead.
+
+     windowBits can also be -8..-15 for raw deflate.  In this case, -windowBits
+   determines the window size.  deflate() will then generate raw deflate data
+   with no zlib header or trailer, and will not compute an adler32 check value.
+
+     windowBits can also be greater than 15 for optional gzip encoding.  Add
+   16 to windowBits to write a simple gzip header and trailer around the
+   compressed data instead of a zlib wrapper.  The gzip header will have no
+   file name, no extra data, no comment, no modification time (set to zero), no
+   header crc, and the operating system will be set to 255 (unknown).  If a
+   gzip stream is being written, strm->adler is a crc32 instead of an adler32.
+
+     The memLevel parameter specifies how much memory should be allocated
+   for the internal compression state.  memLevel=1 uses minimum memory but is
+   slow and reduces compression ratio; memLevel=9 uses maximum memory for
+   optimal speed.  The default value is 8.  See zconf.h for total memory usage
+   as a function of windowBits and memLevel.
+
+     The strategy parameter is used to tune the compression algorithm.  Use the
+   value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
+   filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
+   string match), or Z_RLE to limit match distances to one (run-length
+   encoding).  Filtered data consists mostly of small values with a somewhat
+   random distribution.  In this case, the compression algorithm is tuned to
+   compress them better.  The effect of Z_FILTERED is to force more Huffman
+   coding and less string matching; it is somewhat intermediate between
+   Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY.  Z_RLE is designed to be almost as
+   fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data.  The
+   strategy parameter only affects the compression ratio but not the
+   correctness of the compressed output even if it is not set appropriately.
+   Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler
+   decoder for special applications.
+
+     deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid
+   method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is
+   incompatible with the version assumed by the caller (ZLIB_VERSION).  msg is
+   set to null if there is no error message.  deflateInit2 does not perform any
+   compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
+                                             const Bytef *dictionary,
+                                             uInt  dictLength));
+/*
+     Initializes the compression dictionary from the given byte sequence
+   without producing any compressed output.  When using the zlib format, this
+   function must be called immediately after deflateInit, deflateInit2 or
+   deflateReset, and before any call of deflate.  When doing raw deflate, this
+   function must be called either before any call of deflate, or immediately
+   after the completion of a deflate block, i.e. after all input has been
+   consumed and all output has been delivered when using any of the flush
+   options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH.  The
+   compressor and decompressor must use exactly the same dictionary (see
+   inflateSetDictionary).
+
+     The dictionary should consist of strings (byte sequences) that are likely
+   to be encountered later in the data to be compressed, with the most commonly
+   used strings preferably put towards the end of the dictionary.  Using a
+   dictionary is most useful when the data to be compressed is short and can be
+   predicted with good accuracy; the data can then be compressed better than
+   with the default empty dictionary.
+
+     Depending on the size of the compression data structures selected by
+   deflateInit or deflateInit2, a part of the dictionary may in effect be
+   discarded, for example if the dictionary is larger than the window size
+   provided in deflateInit or deflateInit2.  Thus the strings most likely to be
+   useful should be put at the end of the dictionary, not at the front.  In
+   addition, the current implementation of deflate will use at most the window
+   size minus 262 bytes of the provided dictionary.
+
+     Upon return of this function, strm->adler is set to the adler32 value
+   of the dictionary; the decompressor may later use this value to determine
+   which dictionary has been used by the compressor.  (The adler32 value
+   applies to the whole dictionary even if only a subset of the dictionary is
+   actually used by the compressor.) If a raw deflate was requested, then the
+   adler32 value is not computed and strm->adler is not set.
+
+     deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
+   parameter is invalid (e.g.  dictionary being Z_NULL) or the stream state is
+   inconsistent (for example if deflate has already been called for this stream
+   or if not at a block boundary for raw deflate).  deflateSetDictionary does
+   not perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
+                                    z_streamp source));
+/*
+     Sets the destination stream as a complete copy of the source stream.
+
+     This function can be useful when several compression strategies will be
+   tried, for example when there are several ways of pre-processing the input
+   data with a filter.  The streams that will be discarded should then be freed
+   by calling deflateEnd.  Note that deflateCopy duplicates the internal
+   compression state which can be quite large, so this strategy is slow and can
+   consume lots of memory.
+
+     deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+   (such as zalloc being Z_NULL).  msg is left unchanged in both source and
+   destination.
+*/
+
+ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
+/*
+     This function is equivalent to deflateEnd followed by deflateInit,
+   but does not free and reallocate all the internal compression state.  The
+   stream will keep the same compression level and any other attributes that
+   may have been set by deflateInit2.
+
+     deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent (such as zalloc or state being Z_NULL).
+*/
+
+ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
+                                      int level,
+                                      int strategy));
+/*
+     Dynamically update the compression level and compression strategy.  The
+   interpretation of level and strategy is as in deflateInit2.  This can be
+   used to switch between compression and straight copy of the input data, or
+   to switch to a different kind of input data requiring a different strategy.
+   If the compression level is changed, the input available so far is
+   compressed with the old level (and may be flushed); the new level will take
+   effect only at the next call of deflate().
+
+     Before the call of deflateParams, the stream state must be set as for
+   a call of deflate(), since the currently available input may have to be
+   compressed and flushed.  In particular, strm->avail_out must be non-zero.
+
+     deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
+   stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if
+   strm->avail_out was zero.
+*/
+
+ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
+                                    int good_length,
+                                    int max_lazy,
+                                    int nice_length,
+                                    int max_chain));
+/*
+     Fine tune deflate's internal compression parameters.  This should only be
+   used by someone who understands the algorithm used by zlib's deflate for
+   searching for the best matching string, and even then only by the most
+   fanatic optimizer trying to squeeze out the last compressed bit for their
+   specific input data.  Read the deflate.c source code for the meaning of the
+   max_lazy, good_length, nice_length, and max_chain parameters.
+
+     deflateTune() can be called after deflateInit() or deflateInit2(), and
+   returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
+ */
+
+ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
+                                       uLong sourceLen));
+/*
+     deflateBound() returns an upper bound on the compressed size after
+   deflation of sourceLen bytes.  It must be called after deflateInit() or
+   deflateInit2(), and after deflateSetHeader(), if used.  This would be used
+   to allocate an output buffer for deflation in a single pass, and so would be
+   called before deflate().  If that first deflate() call is provided the
+   sourceLen input bytes, an output buffer allocated to the size returned by
+   deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed
+   to return Z_STREAM_END.  Note that it is possible for the compressed size to
+   be larger than the value returned by deflateBound() if flush options other
+   than Z_FINISH or Z_NO_FLUSH are used.
+*/
+
+ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm,
+                                       unsigned *pending,
+                                       int *bits));
+/*
+     deflatePending() returns the number of bytes and bits of output that have
+   been generated, but not yet provided in the available output.  The bytes not
+   provided would be due to the available output space having being consumed.
+   The number of bits of output not provided are between 0 and 7, where they
+   await more bits to join them in order to fill out a full byte.  If pending
+   or bits are Z_NULL, then those values are not set.
+
+     deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+ */
+
+ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
+                                     int bits,
+                                     int value));
+/*
+     deflatePrime() inserts bits in the deflate output stream.  The intent
+   is that this function is used to start off the deflate output with the bits
+   leftover from a previous deflate stream when appending to it.  As such, this
+   function can only be used for raw deflate, and must be used before the first
+   deflate() call after a deflateInit2() or deflateReset().  bits must be less
+   than or equal to 16, and that many of the least significant bits of value
+   will be inserted in the output.
+
+     deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough
+   room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the
+   source stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
+                                         gz_headerp head));
+/*
+     deflateSetHeader() provides gzip header information for when a gzip
+   stream is requested by deflateInit2().  deflateSetHeader() may be called
+   after deflateInit2() or deflateReset() and before the first call of
+   deflate().  The text, time, os, extra field, name, and comment information
+   in the provided gz_header structure are written to the gzip header (xflag is
+   ignored -- the extra flags are set according to the compression level).  The
+   caller must assure that, if not Z_NULL, name and comment are terminated with
+   a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
+   available there.  If hcrc is true, a gzip header crc is included.  Note that
+   the current versions of the command-line version of gzip (up through version
+   1.3.x) do not support header crc's, and will report that it is a "multi-part
+   gzip file" and give up.
+
+     If deflateSetHeader is not used, the default gzip header has text false,
+   the time set to zero, and os set to 255, with no extra, name, or comment
+   fields.  The gzip header is returned to the default state by deflateReset().
+
+     deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
+                                     int  windowBits));
+
+     This is another version of inflateInit with an extra parameter.  The
+   fields next_in, avail_in, zalloc, zfree and opaque must be initialized
+   before by the caller.
+
+     The windowBits parameter is the base two logarithm of the maximum window
+   size (the size of the history buffer).  It should be in the range 8..15 for
+   this version of the library.  The default value is 15 if inflateInit is used
+   instead.  windowBits must be greater than or equal to the windowBits value
+   provided to deflateInit2() while compressing, or it must be equal to 15 if
+   deflateInit2() was not used.  If a compressed stream with a larger window
+   size is given as input, inflate() will return with the error code
+   Z_DATA_ERROR instead of trying to allocate a larger window.
+
+     windowBits can also be zero to request that inflate use the window size in
+   the zlib header of the compressed stream.
+
+     windowBits can also be -8..-15 for raw inflate.  In this case, -windowBits
+   determines the window size.  inflate() will then process raw deflate data,
+   not looking for a zlib or gzip header, not generating a check value, and not
+   looking for any check values for comparison at the end of the stream.  This
+   is for use with other formats that use the deflate compressed data format
+   such as zip.  Those formats provide their own check values.  If a custom
+   format is developed using the raw deflate format for compressed data, it is
+   recommended that a check value such as an adler32 or a crc32 be applied to
+   the uncompressed data as is done in the zlib, gzip, and zip formats.  For
+   most applications, the zlib format should be used as is.  Note that comments
+   above on the use in deflateInit2() applies to the magnitude of windowBits.
+
+     windowBits can also be greater than 15 for optional gzip decoding.  Add
+   32 to windowBits to enable zlib and gzip decoding with automatic header
+   detection, or add 16 to decode only the gzip format (the zlib format will
+   return a Z_DATA_ERROR).  If a gzip stream is being decoded, strm->adler is a
+   crc32 instead of an adler32.
+
+     inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+   version assumed by the caller, or Z_STREAM_ERROR if the parameters are
+   invalid, such as a null pointer to the structure.  msg is set to null if
+   there is no error message.  inflateInit2 does not perform any decompression
+   apart from possibly reading the zlib header if present: actual decompression
+   will be done by inflate().  (So next_in and avail_in may be modified, but
+   next_out and avail_out are unused and unchanged.) The current implementation
+   of inflateInit2() does not process any header information -- that is
+   deferred until inflate() is called.
+*/
+
+ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
+                                             const Bytef *dictionary,
+                                             uInt  dictLength));
+/*
+     Initializes the decompression dictionary from the given uncompressed byte
+   sequence.  This function must be called immediately after a call of inflate,
+   if that call returned Z_NEED_DICT.  The dictionary chosen by the compressor
+   can be determined from the adler32 value returned by that call of inflate.
+   The compressor and decompressor must use exactly the same dictionary (see
+   deflateSetDictionary).  For raw inflate, this function can be called at any
+   time to set the dictionary.  If the provided dictionary is smaller than the
+   window and there is already data in the window, then the provided dictionary
+   will amend what's there.  The application must insure that the dictionary
+   that was used for compression is provided.
+
+     inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
+   parameter is invalid (e.g.  dictionary being Z_NULL) or the stream state is
+   inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
+   expected one (incorrect adler32 value).  inflateSetDictionary does not
+   perform any decompression: this will be done by subsequent calls of
+   inflate().
+*/
+
+ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm,
+                                             Bytef *dictionary,
+                                             uInt  *dictLength));
+/*
+     Returns the sliding dictionary being maintained by inflate.  dictLength is
+   set to the number of bytes in the dictionary, and that many bytes are copied
+   to dictionary.  dictionary must have enough space, where 32768 bytes is
+   always enough.  If inflateGetDictionary() is called with dictionary equal to
+   Z_NULL, then only the dictionary length is returned, and nothing is copied.
+   Similary, if dictLength is Z_NULL, then it is not set.
+
+     inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the
+   stream state is inconsistent.
+*/
+
+ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
+/*
+     Skips invalid compressed data until a possible full flush point (see above
+   for the description of deflate with Z_FULL_FLUSH) can be found, or until all
+   available input is skipped.  No output is provided.
+
+     inflateSync searches for a 00 00 FF FF pattern in the compressed data.
+   All full flush points have this pattern, but not all occurrences of this
+   pattern are full flush points.
+
+     inflateSync returns Z_OK if a possible full flush point has been found,
+   Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point
+   has been found, or Z_STREAM_ERROR if the stream structure was inconsistent.
+   In the success case, the application may save the current current value of
+   total_in which indicates where valid compressed data was found.  In the
+   error case, the application may repeatedly call inflateSync, providing more
+   input each time, until success or end of the input data.
+*/
+
+ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
+                                    z_streamp source));
+/*
+     Sets the destination stream as a complete copy of the source stream.
+
+     This function can be useful when randomly accessing a large stream.  The
+   first pass through the stream can periodically record the inflate state,
+   allowing restarting inflate at those points when randomly accessing the
+   stream.
+
+     inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+   (such as zalloc being Z_NULL).  msg is left unchanged in both source and
+   destination.
+*/
+
+ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
+/*
+     This function is equivalent to inflateEnd followed by inflateInit,
+   but does not free and reallocate all the internal decompression state.  The
+   stream will keep attributes that may have been set by inflateInit2.
+
+     inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent (such as zalloc or state being Z_NULL).
+*/
+
+ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
+                                      int windowBits));
+/*
+     This function is the same as inflateReset, but it also permits changing
+   the wrap and window size requests.  The windowBits parameter is interpreted
+   the same as it is for inflateInit2.
+
+     inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent (such as zalloc or state being Z_NULL), or if
+   the windowBits parameter is invalid.
+*/
+
+ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
+                                     int bits,
+                                     int value));
+/*
+     This function inserts bits in the inflate input stream.  The intent is
+   that this function is used to start inflating at a bit position in the
+   middle of a byte.  The provided bits will be used before any bytes are used
+   from next_in.  This function should only be used with raw inflate, and
+   should be used before the first inflate() call after inflateInit2() or
+   inflateReset().  bits must be less than or equal to 16, and that many of the
+   least significant bits of value will be inserted in the input.
+
+     If bits is negative, then the input stream bit buffer is emptied.  Then
+   inflatePrime() can be called again to put bits in the buffer.  This is used
+   to clear out bits leftover after feeding inflate a block description prior
+   to feeding inflate codes.
+
+     inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));
+/*
+     This function returns two values, one in the lower 16 bits of the return
+   value, and the other in the remaining upper bits, obtained by shifting the
+   return value down 16 bits.  If the upper value is -1 and the lower value is
+   zero, then inflate() is currently decoding information outside of a block.
+   If the upper value is -1 and the lower value is non-zero, then inflate is in
+   the middle of a stored block, with the lower value equaling the number of
+   bytes from the input remaining to copy.  If the upper value is not -1, then
+   it is the number of bits back from the current bit position in the input of
+   the code (literal or length/distance pair) currently being processed.  In
+   that case the lower value is the number of bytes already emitted for that
+   code.
+
+     A code is being processed if inflate is waiting for more input to complete
+   decoding of the code, or if it has completed decoding but is waiting for
+   more output space to write the literal or match data.
+
+     inflateMark() is used to mark locations in the input data for random
+   access, which may be at bit positions, and to note those cases where the
+   output of a code may span boundaries of random access blocks.  The current
+   location in the input stream can be determined from avail_in and data_type
+   as noted in the description for the Z_BLOCK flush parameter for inflate.
+
+     inflateMark returns the value noted above or -1 << 16 if the provided
+   source stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
+                                         gz_headerp head));
+/*
+     inflateGetHeader() requests that gzip header information be stored in the
+   provided gz_header structure.  inflateGetHeader() may be called after
+   inflateInit2() or inflateReset(), and before the first call of inflate().
+   As inflate() processes the gzip stream, head->done is zero until the header
+   is completed, at which time head->done is set to one.  If a zlib stream is
+   being decoded, then head->done is set to -1 to indicate that there will be
+   no gzip header information forthcoming.  Note that Z_BLOCK or Z_TREES can be
+   used to force inflate() to return immediately after header processing is
+   complete and before any actual data is decompressed.
+
+     The text, time, xflags, and os fields are filled in with the gzip header
+   contents.  hcrc is set to true if there is a header CRC.  (The header CRC
+   was valid if done is set to one.) If extra is not Z_NULL, then extra_max
+   contains the maximum number of bytes to write to extra.  Once done is true,
+   extra_len contains the actual extra field length, and extra contains the
+   extra field, or that field truncated if extra_max is less than extra_len.
+   If name is not Z_NULL, then up to name_max characters are written there,
+   terminated with a zero unless the length is greater than name_max.  If
+   comment is not Z_NULL, then up to comm_max characters are written there,
+   terminated with a zero unless the length is greater than comm_max.  When any
+   of extra, name, or comment are not Z_NULL and the respective field is not
+   present in the header, then that field is set to Z_NULL to signal its
+   absence.  This allows the use of deflateSetHeader() with the returned
+   structure to duplicate the header.  However if those fields are set to
+   allocated memory, then the application will need to save those pointers
+   elsewhere so that they can be eventually freed.
+
+     If inflateGetHeader is not used, then the header information is simply
+   discarded.  The header is always checked for validity, including the header
+   CRC if present.  inflateReset() will reset the process to discard the header
+   information.  The application would need to call inflateGetHeader() again to
+   retrieve the header from the next gzip stream.
+
+     inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
+                                        unsigned char FAR *window));
+
+     Initialize the internal stream state for decompression using inflateBack()
+   calls.  The fields zalloc, zfree and opaque in strm must be initialized
+   before the call.  If zalloc and zfree are Z_NULL, then the default library-
+   derived memory allocation routines are used.  windowBits is the base two
+   logarithm of the window size, in the range 8..15.  window is a caller
+   supplied buffer of that size.  Except for special applications where it is
+   assured that deflate was used with small window sizes, windowBits must be 15
+   and a 32K byte window must be supplied to be able to decompress general
+   deflate streams.
+
+     See inflateBack() for the usage of these routines.
+
+     inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
+   the parameters are invalid, Z_MEM_ERROR if the internal state could not be
+   allocated, or Z_VERSION_ERROR if the version of the library does not match
+   the version of the header file.
+*/
+
+typedef unsigned (*in_func) OF((void FAR *,
+                                z_const unsigned char FAR * FAR *));
+typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
+
+ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
+                                    in_func in, void FAR *in_desc,
+                                    out_func out, void FAR *out_desc));
+/*
+     inflateBack() does a raw inflate with a single call using a call-back
+   interface for input and output.  This is potentially more efficient than
+   inflate() for file i/o applications, in that it avoids copying between the
+   output and the sliding window by simply making the window itself the output
+   buffer.  inflate() can be faster on modern CPUs when used with large
+   buffers.  inflateBack() trusts the application to not change the output
+   buffer passed by the output function, at least until inflateBack() returns.
+
+     inflateBackInit() must be called first to allocate the internal state
+   and to initialize the state with the user-provided window buffer.
+   inflateBack() may then be used multiple times to inflate a complete, raw
+   deflate stream with each call.  inflateBackEnd() is then called to free the
+   allocated state.
+
+     A raw deflate stream is one with no zlib or gzip header or trailer.
+   This routine would normally be used in a utility that reads zip or gzip
+   files and writes out uncompressed files.  The utility would decode the
+   header and process the trailer on its own, hence this routine expects only
+   the raw deflate stream to decompress.  This is different from the normal
+   behavior of inflate(), which expects either a zlib or gzip header and
+   trailer around the deflate stream.
+
+     inflateBack() uses two subroutines supplied by the caller that are then
+   called by inflateBack() for input and output.  inflateBack() calls those
+   routines until it reads a complete deflate stream and writes out all of the
+   uncompressed data, or until it encounters an error.  The function's
+   parameters and return types are defined above in the in_func and out_func
+   typedefs.  inflateBack() will call in(in_desc, &buf) which should return the
+   number of bytes of provided input, and a pointer to that input in buf.  If
+   there is no input available, in() must return zero--buf is ignored in that
+   case--and inflateBack() will return a buffer error.  inflateBack() will call
+   out(out_desc, buf, len) to write the uncompressed data buf[0..len-1].  out()
+   should return zero on success, or non-zero on failure.  If out() returns
+   non-zero, inflateBack() will return with an error.  Neither in() nor out()
+   are permitted to change the contents of the window provided to
+   inflateBackInit(), which is also the buffer that out() uses to write from.
+   The length written by out() will be at most the window size.  Any non-zero
+   amount of input may be provided by in().
+
+     For convenience, inflateBack() can be provided input on the first call by
+   setting strm->next_in and strm->avail_in.  If that input is exhausted, then
+   in() will be called.  Therefore strm->next_in must be initialized before
+   calling inflateBack().  If strm->next_in is Z_NULL, then in() will be called
+   immediately for input.  If strm->next_in is not Z_NULL, then strm->avail_in
+   must also be initialized, and then if strm->avail_in is not zero, input will
+   initially be taken from strm->next_in[0 ..  strm->avail_in - 1].
+
+     The in_desc and out_desc parameters of inflateBack() is passed as the
+   first parameter of in() and out() respectively when they are called.  These
+   descriptors can be optionally used to pass any information that the caller-
+   supplied in() and out() functions need to do their job.
+
+     On return, inflateBack() will set strm->next_in and strm->avail_in to
+   pass back any unused input that was provided by the last in() call.  The
+   return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
+   if in() or out() returned an error, Z_DATA_ERROR if there was a format error
+   in the deflate stream (in which case strm->msg is set to indicate the nature
+   of the error), or Z_STREAM_ERROR if the stream was not properly initialized.
+   In the case of Z_BUF_ERROR, an input or output error can be distinguished
+   using strm->next_in which will be Z_NULL only if in() returned an error.  If
+   strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning
+   non-zero.  (in() will always be called before out(), so strm->next_in is
+   assured to be defined if out() returns non-zero.) Note that inflateBack()
+   cannot return Z_OK.
+*/
+
+ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
+/*
+     All memory allocated by inflateBackInit() is freed.
+
+     inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
+   state was inconsistent.
+*/
+
+/* Declaration not used by TNG is not available */
+/*ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));*/
+/* Return flags indicating compile-time options.
+
+    Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
+     1.0: size of uInt
+     3.2: size of uLong
+     5.4: size of voidpf (pointer)
+     7.6: size of z_off_t
+
+    Compiler, assembler, and debug options:
+     8: DEBUG
+     9: ASMV or ASMINF -- use ASM code
+     10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
+     11: 0 (reserved)
+
+    One-time table building (smaller code, but not thread-safe if true):
+     12: BUILDFIXED -- build static block decoding tables when needed
+     13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
+     14,15: 0 (reserved)
+
+    Library content (indicates missing functionality):
+     16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
+                          deflate code when not needed)
+     17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
+                    and decode gzip streams (to avoid linking crc code)
+     18-19: 0 (reserved)
+
+    Operation variations (changes in library functionality):
+     20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
+     21: FASTEST -- deflate algorithm with only one, lowest compression level
+     22,23: 0 (reserved)
+
+    The sprintf variant used by gzprintf (zero is best):
+     24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
+     25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
+     26: 0 = returns value, 1 = void -- 1 means inferred string length returned
+
+    Remainder:
+     27-31: 0 (reserved)
+ */
+
+#ifndef Z_SOLO
+
+                        /* utility functions */
+
+/*
+     The following utility functions are implemented on top of the basic
+   stream-oriented functions.  To simplify the interface, some default options
+   are assumed (compression level and memory usage, standard memory allocation
+   functions).  The source code of these utility functions can be modified if
+   you need special options.
+*/
+
+ZEXTERN int ZEXPORT compress OF((Bytef *dest,   uLongf *destLen,
+                                 const Bytef *source, uLong sourceLen));
+/*
+     Compresses the source buffer into the destination buffer.  sourceLen is
+   the byte length of the source buffer.  Upon entry, destLen is the total size
+   of the destination buffer, which must be at least the value returned by
+   compressBound(sourceLen).  Upon exit, destLen is the actual size of the
+   compressed buffer.
+
+     compress returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_BUF_ERROR if there was not enough room in the output
+   buffer.
+*/
+
+ZEXTERN int ZEXPORT compress2 OF((Bytef *dest,   uLongf *destLen,
+                                  const Bytef *source, uLong sourceLen,
+                                  int level));
+/*
+     Compresses the source buffer into the destination buffer.  The level
+   parameter has the same meaning as in deflateInit.  sourceLen is the byte
+   length of the source buffer.  Upon entry, destLen is the total size of the
+   destination buffer, which must be at least the value returned by
+   compressBound(sourceLen).  Upon exit, destLen is the actual size of the
+   compressed buffer.
+
+     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+   Z_STREAM_ERROR if the level parameter is invalid.
+*/
+
+ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
+/*
+     compressBound() returns an upper bound on the compressed size after
+   compress() or compress2() on sourceLen bytes.  It would be used before a
+   compress() or compress2() call to allocate the destination buffer.
+*/
+
+ZEXTERN int ZEXPORT uncompress OF((Bytef *dest,   uLongf *destLen,
+                                   const Bytef *source, uLong sourceLen));
+/*
+     Decompresses the source buffer into the destination buffer.  sourceLen is
+   the byte length of the source buffer.  Upon entry, destLen is the total size
+   of the destination buffer, which must be large enough to hold the entire
+   uncompressed data.  (The size of the uncompressed data must have been saved
+   previously by the compressor and transmitted to the decompressor by some
+   mechanism outside the scope of this compression library.) Upon exit, destLen
+   is the actual size of the uncompressed buffer.
+
+     uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_BUF_ERROR if there was not enough room in the output
+   buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.  In
+   the case where there is not enough room, uncompress() will fill the output
+   buffer with the uncompressed data up to that point.
+*/
+
+                        /* gzip file access functions */
+
+/*
+     This library supports reading and writing files in gzip (.gz) format with
+   an interface similar to that of stdio, using the functions that start with
+   "gz".  The gzip format is different from the zlib format.  gzip is a gzip
+   wrapper, documented in RFC 1952, wrapped around a deflate stream.
+*/
+
+typedef struct gzFile_s *gzFile;    /* semi-opaque gzip file descriptor */
+
+/*
+ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
+
+     Opens a gzip (.gz) file for reading or writing.  The mode parameter is as
+   in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
+   a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
+   compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
+   for fixed code compression as in "wb9F".  (See the description of
+   deflateInit2 for more information about the strategy parameter.)  'T' will
+   request transparent writing or appending with no compression and not using
+   the gzip format.
+
+     "a" can be used instead of "w" to request that the gzip stream that will
+   be written be appended to the file.  "+" will result in an error, since
+   reading and writing to the same gzip file is not supported.  The addition of
+   "x" when writing will create the file exclusively, which fails if the file
+   already exists.  On systems that support it, the addition of "e" when
+   reading or writing will set the flag to close the file on an execve() call.
+
+     These functions, as well as gzip, will read and decode a sequence of gzip
+   streams in a file.  The append function of gzopen() can be used to create
+   such a file.  (Also see gzflush() for another way to do this.)  When
+   appending, gzopen does not test whether the file begins with a gzip stream,
+   nor does it look for the end of the gzip streams to begin appending.  gzopen
+   will simply append a gzip stream to the existing file.
+
+     gzopen can be used to read a file which is not in gzip format; in this
+   case gzread will directly read from the file without decompression.  When
+   reading, this will be detected automatically by looking for the magic two-
+   byte gzip header.
+
+     gzopen returns NULL if the file could not be opened, if there was
+   insufficient memory to allocate the gzFile state, or if an invalid mode was
+   specified (an 'r', 'w', or 'a' was not provided, or '+' was provided).
+   errno can be checked to determine if the reason gzopen failed was that the
+   file could not be opened.
+*/
+
+ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
+/*
+     gzdopen associates a gzFile with the file descriptor fd.  File descriptors
+   are obtained from calls like open, dup, creat, pipe or fileno (if the file
+   has been previously opened with fopen).  The mode parameter is as in gzopen.
+
+     The next call of gzclose on the returned gzFile will also close the file
+   descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
+   fd.  If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,
+   mode);.  The duplicated descriptor should be saved to avoid a leak, since
+   gzdopen does not close fd if it fails.  If you are using fileno() to get the
+   file descriptor from a FILE *, then you will have to use dup() to avoid
+   double-close()ing the file descriptor.  Both gzclose() and fclose() will
+   close the associated file descriptor, so they need to have different file
+   descriptors.
+
+     gzdopen returns NULL if there was insufficient memory to allocate the
+   gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not
+   provided, or '+' was provided), or if fd is -1.  The file descriptor is not
+   used until the next gz* read, write, seek, or close operation, so gzdopen
+   will not detect if fd is invalid (unless fd is -1).
+*/
+
+ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
+/*
+     Set the internal buffer size used by this library's functions.  The
+   default buffer size is 8192 bytes.  This function must be called after
+   gzopen() or gzdopen(), and before any other calls that read or write the
+   file.  The buffer memory allocation is always deferred to the first read or
+   write.  Two buffers are allocated, either both of the specified size when
+   writing, or one of the specified size and the other twice that size when
+   reading.  A larger buffer size of, for example, 64K or 128K bytes will
+   noticeably increase the speed of decompression (reading).
+
+     The new buffer size also affects the maximum length for gzprintf().
+
+     gzbuffer() returns 0 on success, or -1 on failure, such as being called
+   too late.
+*/
+
+ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
+/*
+     Dynamically update the compression level or strategy.  See the description
+   of deflateInit2 for the meaning of these parameters.
+
+     gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
+   opened for writing.
+*/
+
+ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
+/*
+     Reads the given number of uncompressed bytes from the compressed file.  If
+   the input file is not in gzip format, gzread copies the given number of
+   bytes into the buffer directly from the file.
+
+     After reaching the end of a gzip stream in the input, gzread will continue
+   to read, looking for another gzip stream.  Any number of gzip streams may be
+   concatenated in the input file, and will all be decompressed by gzread().
+   If something other than a gzip stream is encountered after a gzip stream,
+   that remaining trailing garbage is ignored (and no error is returned).
+
+     gzread can be used to read a gzip file that is being concurrently written.
+   Upon reaching the end of the input, gzread will return with the available
+   data.  If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then
+   gzclearerr can be used to clear the end of file indicator in order to permit
+   gzread to be tried again.  Z_OK indicates that a gzip stream was completed
+   on the last gzread.  Z_BUF_ERROR indicates that the input file ended in the
+   middle of a gzip stream.  Note that gzread does not return -1 in the event
+   of an incomplete gzip stream.  This error is deferred until gzclose(), which
+   will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip
+   stream.  Alternatively, gzerror can be used before gzclose to detect this
+   case.
+
+     gzread returns the number of uncompressed bytes actually read, less than
+   len for end of file, or -1 for error.
+*/
+
+ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
+                                voidpc buf, unsigned len));
+/*
+     Writes the given number of uncompressed bytes into the compressed file.
+   gzwrite returns the number of uncompressed bytes written or 0 in case of
+   error.
+*/
+
+ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
+/*
+     Converts, formats, and writes the arguments to the compressed file under
+   control of the format string, as in fprintf.  gzprintf returns the number of
+   uncompressed bytes actually written, or 0 in case of error.  The number of
+   uncompressed bytes written is limited to 8191, or one less than the buffer
+   size given to gzbuffer().  The caller should assure that this limit is not
+   exceeded.  If it is exceeded, then gzprintf() will return an error (0) with
+   nothing written.  In this case, there may also be a buffer overflow with
+   unpredictable consequences, which is possible only if zlib was compiled with
+   the insecure functions sprintf() or vsprintf() because the secure snprintf()
+   or vsnprintf() functions were not available.  This can be determined using
+   zlibCompileFlags().
+*/
+
+ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
+/*
+     Writes the given null-terminated string to the compressed file, excluding
+   the terminating null character.
+
+     gzputs returns the number of characters written, or -1 in case of error.
+*/
+
+ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
+/*
+     Reads bytes from the compressed file until len-1 characters are read, or a
+   newline character is read and transferred to buf, or an end-of-file
+   condition is encountered.  If any characters are read or if len == 1, the
+   string is terminated with a null character.  If no characters are read due
+   to an end-of-file or len < 1, then the buffer is left untouched.
+
+     gzgets returns buf which is a null-terminated string, or it returns NULL
+   for end-of-file or in case of error.  If there was an error, the contents at
+   buf are indeterminate.
+*/
+
+ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
+/*
+     Writes c, converted to an unsigned char, into the compressed file.  gzputc
+   returns the value that was written, or -1 in case of error.
+*/
+
+ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
+/*
+     Reads one byte from the compressed file.  gzgetc returns this byte or -1
+   in case of end of file or error.  This is implemented as a macro for speed.
+   As such, it does not do all of the checking the other functions do.  I.e.
+   it does not check to see if file is NULL, nor whether the structure file
+   points to has been clobbered or not.
+*/
+
+ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
+/*
+     Push one character back onto the stream to be read as the first character
+   on the next read.  At least one character of push-back is allowed.
+   gzungetc() returns the character pushed, or -1 on failure.  gzungetc() will
+   fail if c is -1, and may fail if a character has been pushed but not read
+   yet.  If gzungetc is used immediately after gzopen or gzdopen, at least the
+   output buffer size of pushed characters is allowed.  (See gzbuffer above.)
+   The pushed character will be discarded if the stream is repositioned with
+   gzseek() or gzrewind().
+*/
+
+ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
+/*
+     Flushes all pending output into the compressed file.  The parameter flush
+   is as in the deflate() function.  The return value is the zlib error number
+   (see function gzerror below).  gzflush is only permitted when writing.
+
+     If the flush parameter is Z_FINISH, the remaining data is written and the
+   gzip stream is completed in the output.  If gzwrite() is called again, a new
+   gzip stream will be started in the output.  gzread() is able to read such
+   concatented gzip streams.
+
+     gzflush should be called only when strictly necessary because it will
+   degrade compression if called too often.
+*/
+
+/*
+ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
+                                   z_off_t offset, int whence));
+
+     Sets the starting position for the next gzread or gzwrite on the given
+   compressed file.  The offset represents a number of bytes in the
+   uncompressed data stream.  The whence parameter is defined as in lseek(2);
+   the value SEEK_END is not supported.
+
+     If the file is opened for reading, this function is emulated but can be
+   extremely slow.  If the file is opened for writing, only forward seeks are
+   supported; gzseek then compresses a sequence of zeroes up to the new
+   starting position.
+
+     gzseek returns the resulting offset location as measured in bytes from
+   the beginning of the uncompressed stream, or -1 in case of error, in
+   particular if the file is opened for writing and the new starting position
+   would be before the current position.
+*/
+
+ZEXTERN int ZEXPORT    gzrewind OF((gzFile file));
+/*
+     Rewinds the given file. This function is supported only for reading.
+
+     gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
+*/
+
+/*
+ZEXTERN z_off_t ZEXPORT    gztell OF((gzFile file));
+
+     Returns the starting position for the next gzread or gzwrite on the given
+   compressed file.  This position represents a number of bytes in the
+   uncompressed data stream, and is zero when starting, even if appending or
+   reading a gzip stream from the middle of a file using gzdopen().
+
+     gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
+*/
+
+/*
+ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
+
+     Returns the current offset in the file being read or written.  This offset
+   includes the count of bytes that precede the gzip stream, for example when
+   appending or when using gzdopen() for reading.  When reading, the offset
+   does not include as yet unused buffered input.  This information can be used
+   for a progress indicator.  On error, gzoffset() returns -1.
+*/
+
+ZEXTERN int ZEXPORT gzeof OF((gzFile file));
+/*
+     Returns true (1) if the end-of-file indicator has been set while reading,
+   false (0) otherwise.  Note that the end-of-file indicator is set only if the
+   read tried to go past the end of the input, but came up short.  Therefore,
+   just like feof(), gzeof() may return false even if there is no more data to
+   read, in the event that the last read request was for the exact number of
+   bytes remaining in the input file.  This will happen if the input file size
+   is an exact multiple of the buffer size.
+
+     If gzeof() returns true, then the read functions will return no more data,
+   unless the end-of-file indicator is reset by gzclearerr() and the input file
+   has grown since the previous end of file was detected.
+*/
+
+ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
+/*
+     Returns true (1) if file is being copied directly while reading, or false
+   (0) if file is a gzip stream being decompressed.
+
+     If the input file is empty, gzdirect() will return true, since the input
+   does not contain a gzip stream.
+
+     If gzdirect() is used immediately after gzopen() or gzdopen() it will
+   cause buffers to be allocated to allow reading the file to determine if it
+   is a gzip file.  Therefore if gzbuffer() is used, it should be called before
+   gzdirect().
+
+     When writing, gzdirect() returns true (1) if transparent writing was
+   requested ("wT" for the gzopen() mode), or false (0) otherwise.  (Note:
+   gzdirect() is not needed when writing.  Transparent writing must be
+   explicitly requested, so the application already knows the answer.  When
+   linking statically, using gzdirect() will include all of the zlib code for
+   gzip file reading and decompression, which may not be desired.)
+*/
+
+ZEXTERN int ZEXPORT    gzclose OF((gzFile file));
+/*
+     Flushes all pending output if necessary, closes the compressed file and
+   deallocates the (de)compression state.  Note that once file is closed, you
+   cannot call gzerror with file, since its structures have been deallocated.
+   gzclose must not be called more than once on the same file, just as free
+   must not be called more than once on the same allocation.
+
+     gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a
+   file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the
+   last read ended in the middle of a gzip stream, or Z_OK on success.
+*/
+
+ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
+ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
+/*
+     Same as gzclose(), but gzclose_r() is only for use when reading, and
+   gzclose_w() is only for use when writing or appending.  The advantage to
+   using these instead of gzclose() is that they avoid linking in zlib
+   compression or decompression code that is not used when only reading or only
+   writing respectively.  If gzclose() is used, then both compression and
+   decompression code will be included the application when linking to a static
+   zlib library.
+*/
+
+ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
+/*
+     Returns the error message for the last error which occurred on the given
+   compressed file.  errnum is set to zlib error number.  If an error occurred
+   in the file system and not in the compression library, errnum is set to
+   Z_ERRNO and the application may consult errno to get the exact error code.
+
+     The application must not modify the returned string.  Future calls to
+   this function may invalidate the previously returned string.  If file is
+   closed, then the string previously returned by gzerror will no longer be
+   available.
+
+     gzerror() should be used to distinguish errors from end-of-file for those
+   functions above that do not distinguish those cases in their return values.
+*/
+
+ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
+/*
+     Clears the error and end-of-file flags for file.  This is analogous to the
+   clearerr() function in stdio.  This is useful for continuing to read a gzip
+   file that is being written concurrently.
+*/
+
+#endif /* !Z_SOLO */
+
+                        /* checksum functions */
+
+/*
+     These functions are not related to compression but are exported
+   anyway because they might be useful in applications using the compression
+   library.
+*/
+
+ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
+/*
+     Update a running Adler-32 checksum with the bytes buf[0..len-1] and
+   return the updated checksum.  If buf is Z_NULL, this function returns the
+   required initial value for the checksum.
+
+     An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
+   much faster.
+
+   Usage example:
+
+     uLong adler = adler32(0L, Z_NULL, 0);
+
+     while (read_buffer(buffer, length) != EOF) {
+       adler = adler32(adler, buffer, length);
+     }
+     if (adler != original_adler) error();
+*/
+
+/*
+ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
+                                          z_off_t len2));
+
+     Combine two Adler-32 checksums into one.  For two sequences of bytes, seq1
+   and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
+   each, adler1 and adler2.  adler32_combine() returns the Adler-32 checksum of
+   seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.  Note
+   that the z_off_t type (like off_t) is a signed integer.  If len2 is
+   negative, the result has no meaning or utility.
+*/
+
+ZEXTERN uLong ZEXPORT crc32   OF((uLong crc, const Bytef *buf, uInt len));
+/*
+     Update a running CRC-32 with the bytes buf[0..len-1] and return the
+   updated CRC-32.  If buf is Z_NULL, this function returns the required
+   initial value for the crc.  Pre- and post-conditioning (one's complement) is
+   performed within this function so it shouldn't be done by the application.
+
+   Usage example:
+
+     uLong crc = crc32(0L, Z_NULL, 0);
+
+     while (read_buffer(buffer, length) != EOF) {
+       crc = crc32(crc, buffer, length);
+     }
+     if (crc != original_crc) error();
+*/
+
+/*
+ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
+
+     Combine two CRC-32 check values into one.  For two sequences of bytes,
+   seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
+   calculated for each, crc1 and crc2.  crc32_combine() returns the CRC-32
+   check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
+   len2.
+*/
+
+
+                        /* various hacks, don't look :) */
+
+/* deflateInit and inflateInit are macros to allow checking the zlib version
+ * and the compiler's view of z_stream:
+ */
+ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
+                                     const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
+                                     const char *version, int stream_size));
+ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int  level, int  method,
+                                      int windowBits, int memLevel,
+                                      int strategy, const char *version,
+                                      int stream_size));
+ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int  windowBits,
+                                      const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
+                                         unsigned char FAR *window,
+                                         const char *version,
+                                         int stream_size));
+#define deflateInit(strm, level) \
+        deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
+#define inflateInit(strm) \
+        inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
+#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
+        deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
+                      (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
+#define inflateInit2(strm, windowBits) \
+        inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
+                      (int)sizeof(z_stream))
+#define inflateBackInit(strm, windowBits, window) \
+        inflateBackInit_((strm), (windowBits), (window), \
+                      ZLIB_VERSION, (int)sizeof(z_stream))
+
+#ifndef Z_SOLO
+
+/* gzgetc() macro and its supporting function and exposed data structure.  Note
+ * that the real internal state is much larger than the exposed structure.
+ * This abbreviated structure exposes just enough for the gzgetc() macro.  The
+ * user should not mess with these exposed elements, since their names or
+ * behavior could change in the future, perhaps even capriciously.  They can
+ * only be used by the gzgetc() macro.  You have been warned.
+ */
+struct gzFile_s {
+    unsigned have;
+    unsigned char *next;
+    z_off64_t pos;
+};
+ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file));  /* backward compatibility */
+#ifdef Z_PREFIX_SET
+#  undef z_gzgetc
+#  define z_gzgetc(g) \
+          ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))
+#else
+#  define gzgetc(g) \
+          ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))
+#endif
+
+/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
+ * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if
+ * both are true, the application gets the *64 functions, and the regular
+ * functions are changed to 64 bits) -- in case these are set on systems
+ * without large file support, _LFS64_LARGEFILE must also be true
+ */
+#ifdef Z_LARGE64
+   ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+   ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
+   ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
+   ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
+   ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
+   ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
+#endif
+
+#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
+#  ifdef Z_PREFIX_SET
+#    define z_gzopen z_gzopen64
+#    define z_gzseek z_gzseek64
+#    define z_gztell z_gztell64
+#    define z_gzoffset z_gzoffset64
+#    define z_adler32_combine z_adler32_combine64
+#    define z_crc32_combine z_crc32_combine64
+#  else
+#    define gzopen gzopen64
+#    define gzseek gzseek64
+#    define gztell gztell64
+#    define gzoffset gzoffset64
+#    define adler32_combine adler32_combine64
+#    define crc32_combine crc32_combine64
+#  endif
+#  ifndef Z_LARGE64
+     ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+     ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
+     ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));
+     ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
+     ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
+     ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
+#  endif
+#else
+   ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
+   ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int));
+   ZEXTERN z_off_t ZEXPORT gztell OF((gzFile));
+   ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
+   ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
+   ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
+#endif
+
+#else /* Z_SOLO */
+
+   ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
+   ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
+
+#endif /* !Z_SOLO */
+
+/* hack for buggy compilers */
+#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
+    struct internal_state {int dummy;};
+#endif
+
+/* undocumented functions */
+ZEXTERN const char   * ZEXPORT zError           OF((int));
+ZEXTERN int            ZEXPORT inflateSyncPoint OF((z_streamp));
+ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table    OF((void));
+ZEXTERN int            ZEXPORT inflateUndermine OF((z_streamp, int));
+ZEXTERN int            ZEXPORT inflateResetKeep OF((z_streamp));
+ZEXTERN int            ZEXPORT deflateResetKeep OF((z_streamp));
+#if defined(_WIN32) && !defined(Z_SOLO)
+ZEXTERN gzFile         ZEXPORT gzopen_w OF((const wchar_t *path,
+                                            const char *mode));
+#endif
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
+#  ifndef Z_SOLO
+ZEXTERN int            ZEXPORTVA gzvprintf Z_ARG((gzFile file,
+                                                  const char *format,
+                                                  va_list va));
+#  endif
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ZLIB_H */
diff --git a/src/external/tng_io/external/zlib/zutil.c b/src/external/tng_io/external/zlib/zutil.c
new file mode 100644 (file)
index 0000000..fbd3587
--- /dev/null
@@ -0,0 +1,323 @@
+/* zutil.c -- target dependent utility functions for the compression library
+ * Copyright (C) 1995-2005, 2010, 2011, 2012 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#include "zutil.h"
+
+#ifndef NO_DUMMY_DECL
+struct internal_state      {int dummy;}; /* for buggy compilers */
+#endif
+
+z_const char * const z_errmsg[10] = {
+"need dictionary",     /* Z_NEED_DICT       2  */
+"stream end",          /* Z_STREAM_END      1  */
+"",                    /* Z_OK              0  */
+"file error",          /* Z_ERRNO         (-1) */
+"stream error",        /* Z_STREAM_ERROR  (-2) */
+"data error",          /* Z_DATA_ERROR    (-3) */
+"insufficient memory", /* Z_MEM_ERROR     (-4) */
+"buffer error",        /* Z_BUF_ERROR     (-5) */
+"incompatible version",/* Z_VERSION_ERROR (-6) */
+""};
+
+
+const char * ZEXPORT zlibVersion()
+{
+    return ZLIB_VERSION;
+}
+
+/* This function is not used by TNG
+uLong ZEXPORT zlibCompileFlags()
+{
+    uLong flags;
+
+    flags = 0;
+    switch ((int)(sizeof(uInt))) {
+    case 2:     break;
+    case 4:     flags += 1;     break;
+    case 8:     flags += 2;     break;
+    default:    flags += 3;
+    }
+    switch ((int)(sizeof(uLong))) {
+    case 2:     break;
+    case 4:     flags += 1 << 2;        break;
+    case 8:     flags += 2 << 2;        break;
+    default:    flags += 3 << 2;
+    }
+    switch ((int)(sizeof(voidpf))) {
+    case 2:     break;
+    case 4:     flags += 1 << 4;        break;
+    case 8:     flags += 2 << 4;        break;
+    default:    flags += 3 << 4;
+    }
+    switch ((int)(sizeof(z_off_t))) {
+    case 2:     break;
+    case 4:     flags += 1 << 6;        break;
+    case 8:     flags += 2 << 6;        break;
+    default:    flags += 3 << 6;
+    }
+#ifdef DEBUG
+    flags += 1 << 8;
+#endif
+#if defined(ASMV) || defined(ASMINF)
+    flags += 1 << 9;
+#endif
+#ifdef ZLIB_WINAPI
+    flags += 1 << 10;
+#endif
+#ifdef BUILDFIXED
+    flags += 1 << 12;
+#endif
+#ifdef DYNAMIC_CRC_TABLE
+    flags += 1 << 13;
+#endif
+#ifdef NO_GZCOMPRESS
+    flags += 1L << 16;
+#endif
+#ifdef NO_GZIP
+    flags += 1L << 17;
+#endif
+#ifdef PKZIP_BUG_WORKAROUND
+    flags += 1L << 20;
+#endif
+#ifdef FASTEST
+    flags += 1L << 21;
+#endif
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
+#  ifdef NO_vsnprintf
+    flags += 1L << 25;
+#    ifdef HAS_vsprintf_void
+    flags += 1L << 26;
+#    endif
+#  else
+#    ifdef HAS_vsnprintf_void
+    flags += 1L << 26;
+#    endif
+#  endif
+#else
+    flags += 1L << 24;
+#  ifdef NO_snprintf
+    flags += 1L << 25;
+#    ifdef HAS_sprintf_void
+    flags += 1L << 26;
+#    endif
+#  else
+#    ifdef HAS_snprintf_void
+    flags += 1L << 26;
+#    endif
+#  endif
+#endif
+    return flags;
+}
+*/
+
+#ifdef DEBUG
+
+#  ifndef verbose
+#    define verbose 0
+#  endif
+int ZLIB_INTERNAL z_verbose = verbose;
+
+void ZLIB_INTERNAL z_error (m)
+    char *m;
+{
+    fprintf(stderr, "%s\n", m);
+    exit(1);
+}
+#endif
+
+/* exported to allow conversion of error code to string for compress() and
+ * uncompress()
+ */
+const char * ZEXPORT zError(err)
+    int err;
+{
+    return ERR_MSG(err);
+}
+
+#if defined(_WIN32_WCE)
+    /* The Microsoft C Run-Time Library for Windows CE doesn't have
+     * errno.  We define it as a global variable to simplify porting.
+     * Its value is always 0 and should not be used.
+     */
+    int errno = 0;
+#endif
+
+#ifndef HAVE_MEMCPY
+
+void ZLIB_INTERNAL zmemcpy(dest, source, len)
+    Bytef* dest;
+    const Bytef* source;
+    uInt  len;
+{
+    if (len == 0) return;
+    do {
+        *dest++ = *source++; /* ??? to be unrolled */
+    } while (--len != 0);
+}
+
+int ZLIB_INTERNAL zmemcmp(s1, s2, len)
+    const Bytef* s1;
+    const Bytef* s2;
+    uInt  len;
+{
+    uInt j;
+
+    for (j = 0; j < len; j++) {
+        if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
+    }
+    return 0;
+}
+
+void ZLIB_INTERNAL zmemzero(dest, len)
+    Bytef* dest;
+    uInt  len;
+{
+    if (len == 0) return;
+    do {
+        *dest++ = 0;  /* ??? to be unrolled */
+    } while (--len != 0);
+}
+#endif
+
+#ifndef Z_SOLO
+
+#ifdef SYS16BIT
+
+#ifdef __TURBOC__
+/* Turbo C in 16-bit mode */
+
+#  define MY_ZCALLOC
+
+/* Turbo C malloc() does not allow dynamic allocation of 64K bytes
+ * and farmalloc(64K) returns a pointer with an offset of 8, so we
+ * must fix the pointer. Warning: the pointer must be put back to its
+ * original form in order to free it, use zcfree().
+ */
+
+#define MAX_PTR 10
+/* 10*64K = 640K */
+
+local int next_ptr = 0;
+
+typedef struct ptr_table_s {
+    voidpf org_ptr;
+    voidpf new_ptr;
+} ptr_table;
+
+local ptr_table table[MAX_PTR];
+/* This table is used to remember the original form of pointers
+ * to large buffers (64K). Such pointers are normalized with a zero offset.
+ * Since MSDOS is not a preemptive multitasking OS, this table is not
+ * protected from concurrent access. This hack doesn't work anyway on
+ * a protected system like OS/2. Use Microsoft C instead.
+ */
+
+voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size)
+{
+    voidpf buf = opaque; /* just to make some compilers happy */
+    ulg bsize = (ulg)items*size;
+
+    /* If we allocate less than 65520 bytes, we assume that farmalloc
+     * will return a usable pointer which doesn't have to be normalized.
+     */
+    if (bsize < 65520L) {
+        buf = farmalloc(bsize);
+        if (*(ush*)&buf != 0) return buf;
+    } else {
+        buf = farmalloc(bsize + 16L);
+    }
+    if (buf == NULL || next_ptr >= MAX_PTR) return NULL;
+    table[next_ptr].org_ptr = buf;
+
+    /* Normalize the pointer to seg:0 */
+    *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4;
+    *(ush*)&buf = 0;
+    table[next_ptr++].new_ptr = buf;
+    return buf;
+}
+
+void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
+{
+    int n;
+    if (*(ush*)&ptr != 0) { /* object < 64K */
+        farfree(ptr);
+        return;
+    }
+    /* Find the original pointer */
+    for (n = 0; n < next_ptr; n++) {
+        if (ptr != table[n].new_ptr) continue;
+
+        farfree(table[n].org_ptr);
+        while (++n < next_ptr) {
+            table[n-1] = table[n];
+        }
+        next_ptr--;
+        return;
+    }
+    ptr = opaque; /* just to make some compilers happy */
+    Assert(0, "zcfree: ptr not found");
+}
+
+#endif /* __TURBOC__ */
+
+
+#ifdef M_I86
+/* Microsoft C in 16-bit mode */
+
+#  define MY_ZCALLOC
+
+#if (!defined(_MSC_VER) || (_MSC_VER <= 600))
+#  define _halloc  halloc
+#  define _hfree   hfree
+#endif
+
+voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size)
+{
+    if (opaque) opaque = 0; /* to make compiler happy */
+    return _halloc((long)items, size);
+}
+
+void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
+{
+    if (opaque) opaque = 0; /* to make compiler happy */
+    _hfree(ptr);
+}
+
+#endif /* M_I86 */
+
+#endif /* SYS16BIT */
+
+
+#ifndef MY_ZCALLOC /* Any system without a special alloc function */
+
+#ifndef STDC
+extern voidp  malloc OF((uInt size));
+extern voidp  calloc OF((uInt items, uInt size));
+extern void   free   OF((voidpf ptr));
+#endif
+
+voidpf ZLIB_INTERNAL zcalloc (opaque, items, size)
+    voidpf opaque;
+    unsigned items;
+    unsigned size;
+{
+    if (opaque) items += size - size; /* make compiler happy */
+    return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
+                              (voidpf)calloc(items, size);
+}
+
+void ZLIB_INTERNAL zcfree (opaque, ptr)
+    voidpf opaque;
+    voidpf ptr;
+{
+    free(ptr);
+    if (opaque) return; /* make compiler happy */
+}
+
+#endif /* MY_ZCALLOC */
+
+#endif /* !Z_SOLO */
diff --git a/src/external/tng_io/external/zlib/zutil.h b/src/external/tng_io/external/zlib/zutil.h
new file mode 100644 (file)
index 0000000..24ab06b
--- /dev/null
@@ -0,0 +1,253 @@
+/* zutil.h -- internal interface and configuration of the compression library
+ * Copyright (C) 1995-2013 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+   part of the implementation of the compression library and is
+   subject to change. Applications should only use zlib.h.
+ */
+
+/* @(#) $Id$ */
+
+#ifndef ZUTIL_H
+#define ZUTIL_H
+
+#ifdef HAVE_HIDDEN
+#  define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
+#else
+#  define ZLIB_INTERNAL
+#endif
+
+#include "zlib.h"
+
+#if defined(STDC) && !defined(Z_SOLO)
+#  if !(defined(_WIN32_WCE) && defined(_MSC_VER))
+#    include <stddef.h>
+#  endif
+#  include <string.h>
+#  include <stdlib.h>
+#endif
+
+#ifdef Z_SOLO
+   typedef long ptrdiff_t;  /* guess -- will be caught if guess is wrong */
+#endif
+
+#ifndef local
+#  define local static
+#endif
+/* compile with -Dlocal if your debugger can't find static symbols */
+
+typedef unsigned char  uch;
+typedef uch FAR uchf;
+typedef unsigned short ush;
+typedef ush FAR ushf;
+typedef unsigned long  ulg;
+
+extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
+/* (size given to avoid silly warnings with Visual C++) */
+
+#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
+
+#define ERR_RETURN(strm,err) \
+  return (strm->msg = ERR_MSG(err), (err))
+/* To be used only when the state is known to be valid */
+
+        /* common constants */
+
+#ifndef DEF_WBITS
+#  define DEF_WBITS MAX_WBITS
+#endif
+/* default windowBits for decompression. MAX_WBITS is for compression only */
+
+#if MAX_MEM_LEVEL >= 8
+#  define DEF_MEM_LEVEL 8
+#else
+#  define DEF_MEM_LEVEL  MAX_MEM_LEVEL
+#endif
+/* default memLevel */
+
+#define STORED_BLOCK 0
+#define STATIC_TREES 1
+#define DYN_TREES    2
+/* The three kinds of block type */
+
+#define MIN_MATCH  3
+#define MAX_MATCH  258
+/* The minimum and maximum match lengths */
+
+#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
+
+        /* target dependencies */
+
+#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
+#  define OS_CODE  0x00
+#  ifndef Z_SOLO
+#    if defined(__TURBOC__) || defined(__BORLANDC__)
+#      if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
+         /* Allow compilation with ANSI keywords only enabled */
+         void _Cdecl farfree( void *block );
+         void *_Cdecl farmalloc( unsigned long nbytes );
+#      else
+#        include <alloc.h>
+#      endif
+#    else /* MSC or DJGPP */
+#      include <malloc.h>
+#    endif
+#  endif
+#endif
+
+#ifdef AMIGA
+#  define OS_CODE  0x01
+#endif
+
+#if defined(VAXC) || defined(VMS)
+#  define OS_CODE  0x02
+#  define F_OPEN(name, mode) \
+     fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
+#endif
+
+#if defined(ATARI) || defined(atarist)
+#  define OS_CODE  0x05
+#endif
+
+#ifdef OS2
+#  define OS_CODE  0x06
+#  if defined(M_I86) && !defined(Z_SOLO)
+#    include <malloc.h>
+#  endif
+#endif
+
+#if defined(MACOS) || defined(TARGET_OS_MAC)
+#  define OS_CODE  0x07
+#  ifndef Z_SOLO
+#    if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
+#      include <unix.h> /* for fdopen */
+#    else
+#      ifndef fdopen
+#        define fdopen(fd,mode) NULL /* No fdopen() */
+#      endif
+#    endif
+#  endif
+#endif
+
+#ifdef TOPS20
+#  define OS_CODE  0x0a
+#endif
+
+#ifdef WIN32
+#  ifndef __CYGWIN__  /* Cygwin is Unix, not Win32 */
+#    define OS_CODE  0x0b
+#  endif
+#endif
+
+#ifdef __50SERIES /* Prime/PRIMOS */
+#  define OS_CODE  0x0f
+#endif
+
+#if defined(_BEOS_) || defined(RISCOS)
+#  define fdopen(fd,mode) NULL /* No fdopen() */
+#endif
+
+#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
+#  if defined(_WIN32_WCE)
+#    define fdopen(fd,mode) NULL /* No fdopen() */
+#    ifndef _PTRDIFF_T_DEFINED
+       typedef int ptrdiff_t;
+#      define _PTRDIFF_T_DEFINED
+#    endif
+#  else
+#    define fdopen(fd,type)  _fdopen(fd,type)
+#  endif
+#endif
+
+#if defined(__BORLANDC__) && !defined(MSDOS)
+  #pragma warn -8004
+  #pragma warn -8008
+  #pragma warn -8066
+#endif
+
+/* provide prototypes for these when building zlib without LFS */
+#if !defined(_WIN32) && \
+    (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
+    ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
+    ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
+#endif
+
+        /* common defaults */
+
+#ifndef OS_CODE
+#  define OS_CODE  0x03  /* assume Unix */
+#endif
+
+#ifndef F_OPEN
+#  define F_OPEN(name, mode) fopen((name), (mode))
+#endif
+
+         /* functions */
+
+#if defined(pyr) || defined(Z_SOLO)
+#  define NO_MEMCPY
+#endif
+#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
+ /* Use our own functions for small and medium model with MSC <= 5.0.
+  * You may have to use the same strategy for Borland C (untested).
+  * The __SC__ check is for Symantec.
+  */
+#  define NO_MEMCPY
+#endif
+#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
+#  define HAVE_MEMCPY
+#endif
+#ifdef HAVE_MEMCPY
+#  ifdef SMALL_MEDIUM /* MSDOS small or medium model */
+#    define zmemcpy _fmemcpy
+#    define zmemcmp _fmemcmp
+#    define zmemzero(dest, len) _fmemset(dest, 0, len)
+#  else
+#    define zmemcpy memcpy
+#    define zmemcmp memcmp
+#    define zmemzero(dest, len) memset(dest, 0, len)
+#  endif
+#else
+   void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
+   int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
+   void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len));
+#endif
+
+/* Diagnostic functions */
+#ifdef DEBUG
+#  include <stdio.h>
+   extern int ZLIB_INTERNAL z_verbose;
+   extern void ZLIB_INTERNAL z_error OF((char *m));
+#  define Assert(cond,msg) {if(!(cond)) z_error(msg);}
+#  define Trace(x) {if (z_verbose>=0) fprintf x ;}
+#  define Tracev(x) {if (z_verbose>0) fprintf x ;}
+#  define Tracevv(x) {if (z_verbose>1) fprintf x ;}
+#  define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
+#  define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
+#else
+#  define Assert(cond,msg)
+#  define Trace(x)
+#  define Tracev(x)
+#  define Tracevv(x)
+#  define Tracec(c,x)
+#  define Tracecv(c,x)
+#endif
+
+#ifndef Z_SOLO
+   voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
+                                    unsigned size));
+   void ZLIB_INTERNAL zcfree  OF((voidpf opaque, voidpf ptr));
+#endif
+
+#define ZALLOC(strm, items, size) \
+           (*((strm)->zalloc))((strm)->opaque, (items), (size))
+#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
+#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
+
+/* Reverse the bytes in a 32-bit value */
+#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
+                    (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
+
+#endif /* ZUTIL_H */
index d8ff0fea228500478f0a132b1e7256bf5ed49666..167cca6adaaab383d246dd0ddc0e2675807d96d2 100644 (file)
@@ -1,7 +1,7 @@
 /* This code is part of the tng binary trajectory format.
  *
  * Written by Magnus Lundborg
- * Copyright (c) 2012-2014, The GROMACS development team.
+ * Copyright (c) 2012-2017, The GROMACS development team.
  * Check out http://www.gromacs.org for more information.
  *
  *
  * See git log for full revision history.
  *
  * Revisions
+ * 
+ * v. 1.8 - Added GROMACS energy block IDs.
+ *        - Rewritten build system for the main library.
+ *        - Added block ID for atom (or generic particle) mass.
+ *        - Fixed bugs, such as:
+ *           - Do not switch endianness when reading and writing TNG compressed data.
+ *           - Update pointers to residues in the chain when writing multiple chains in one molecule.
+ *           - Update frame set pointers when appending to file.
  *
  * v. 1.7 - Fifth stable release of the API
  *
@@ -438,6 +446,7 @@ typedef enum {TNG_NON_TRAJECTORY_BLOCK, TNG_TRAJECTORY_BLOCK} tng_block_type;
 #define TNG_TRAJ_ANISOTROPIC_B_FACTORS  0x0000000010000007LL
 #define TNG_TRAJ_OCCUPANCY              0x0000000010000008LL
 #define TNG_TRAJ_GENERAL_COMMENTS       0x0000000010000009LL
+#define TNG_TRAJ_MASSES                 0x0000000010000010LL
 /** @} */
 
 
@@ -459,36 +468,73 @@ typedef enum {TNG_NON_TRAJECTORY_BLOCK, TNG_TRAJECTORY_BLOCK} tng_block_type;
 #define TNG_GMX_ENERGY_TEMPERATURE      0x1000000010000011LL
 #define TNG_GMX_ENERGY_PRESSURE         0x1000000010000012LL
 #define TNG_GMX_ENERGY_CONSTR_RMSD      0x1000000010000013LL
-#define TNG_GMX_ENERGY_BOX_X            0x1000000010000014LL
-#define TNG_GMX_ENERGY_BOX_Y            0x1000000010000015LL
-#define TNG_GMX_ENERGY_BOX_Z            0x1000000010000016LL
-#define TNG_GMX_ENERGY_VOLUME           0x1000000010000017LL
-#define TNG_GMX_ENERGY_DENSITY          0x1000000010000018LL
-#define TNG_GMX_ENERGY_PV               0x1000000010000019LL
-#define TNG_GMX_ENERGY_ENTHALPY         0x1000000010000020LL
-#define TNG_GMX_ENERGY_VIR_XX           0x1000000010000021LL
-#define TNG_GMX_ENERGY_VIR_XY           0x1000000010000022LL
-#define TNG_GMX_ENERGY_VIR_XZ           0x1000000010000023LL
-#define TNG_GMX_ENERGY_VIR_YX           0x1000000010000024LL
-#define TNG_GMX_ENERGY_VIR_YY           0x1000000010000025LL
-#define TNG_GMX_ENERGY_VIR_YZ           0x1000000010000026LL
-#define TNG_GMX_ENERGY_VIR_ZX           0x1000000010000027LL
-#define TNG_GMX_ENERGY_VIR_ZY           0x1000000010000028LL
-#define TNG_GMX_ENERGY_VIR_ZZ           0x1000000010000029LL
-#define TNG_GMX_ENERGY_PRES_XX          0x1000000010000030LL
-#define TNG_GMX_ENERGY_PRES_XY          0x1000000010000031LL
-#define TNG_GMX_ENERGY_PRES_XZ          0x1000000010000032LL
-#define TNG_GMX_ENERGY_PRES_YX          0x1000000010000033LL
-#define TNG_GMX_ENERGY_PRES_YY          0x1000000010000034LL
-#define TNG_GMX_ENERGY_PRES_YZ          0x1000000010000035LL
-#define TNG_GMX_ENERGY_PRES_ZX          0x1000000010000036LL
-#define TNG_GMX_ENERGY_PRES_ZY          0x1000000010000037LL
-#define TNG_GMX_ENERGY_PRES_ZZ          0x1000000010000038LL
-#define TNG_GMX_ENERGY_SURFXSURFTEN     0x1000000010000039LL
-#define TNG_GMX_ENERGY_T_SYSTEM         0x1000000010000040LL
-#define TNG_GMX_ENERGY_LAMB_SYSTEM      0x1000000010000041LL
-#define TNG_GMX_SELECTION_GROUP_NAMES   0x1000000010000042LL
-#define TNG_GMX_ATOM_SELECTION_GROUP    0x1000000010000043LL
+#define TNG_GMX_ENERGY_CONSTR2_RMSD     0x1000000010000014LL
+#define TNG_GMX_ENERGY_BOX_X            0x1000000010000015LL
+#define TNG_GMX_ENERGY_BOX_Y            0x1000000010000016LL
+#define TNG_GMX_ENERGY_BOX_Z            0x1000000010000017LL
+#define TNG_GMX_ENERGY_BOXXX            0x1000000010000018LL
+#define TNG_GMX_ENERGY_BOXYY            0x1000000010000019LL
+#define TNG_GMX_ENERGY_BOXZZ            0x1000000010000020LL
+#define TNG_GMX_ENERGY_BOXYX            0x1000000010000021LL
+#define TNG_GMX_ENERGY_BOXZX            0x1000000010000022LL
+#define TNG_GMX_ENERGY_BOXZY            0x1000000010000023LL
+#define TNG_GMX_ENERGY_BOXVELXX         0x1000000010000024LL
+#define TNG_GMX_ENERGY_BOXVELYY         0x1000000010000025LL
+#define TNG_GMX_ENERGY_BOXVELZZ         0x1000000010000026LL
+#define TNG_GMX_ENERGY_BOXVELYX         0x1000000010000027LL
+#define TNG_GMX_ENERGY_BOXVELZX         0x1000000010000028LL
+#define TNG_GMX_ENERGY_BOXVELZY         0x1000000010000029LL
+#define TNG_GMX_ENERGY_VOLUME           0x1000000010000030LL
+#define TNG_GMX_ENERGY_DENSITY          0x1000000010000031LL
+#define TNG_GMX_ENERGY_PV               0x1000000010000032LL
+#define TNG_GMX_ENERGY_ENTHALPY         0x1000000010000033LL
+#define TNG_GMX_ENERGY_VIR_XX           0x1000000010000034LL
+#define TNG_GMX_ENERGY_VIR_XY           0x1000000010000035LL
+#define TNG_GMX_ENERGY_VIR_XZ           0x1000000010000036LL
+#define TNG_GMX_ENERGY_VIR_YX           0x1000000010000037LL
+#define TNG_GMX_ENERGY_VIR_YY           0x1000000010000038LL
+#define TNG_GMX_ENERGY_VIR_YZ           0x1000000010000039LL
+#define TNG_GMX_ENERGY_VIR_ZX           0x1000000010000040LL
+#define TNG_GMX_ENERGY_VIR_ZY           0x1000000010000041LL
+#define TNG_GMX_ENERGY_VIR_ZZ           0x1000000010000042LL
+#define TNG_GMX_ENERGY_SHAKEVIR_XX      0x1000000010000043LL
+#define TNG_GMX_ENERGY_SHAKEVIR_XY      0x1000000010000044LL
+#define TNG_GMX_ENERGY_SHAKEVIR_XZ      0x1000000010000045LL
+#define TNG_GMX_ENERGY_SHAKEVIR_YX      0x1000000010000046LL
+#define TNG_GMX_ENERGY_SHAKEVIR_YY      0x1000000010000047LL
+#define TNG_GMX_ENERGY_SHAKEVIR_YZ      0x1000000010000048LL
+#define TNG_GMX_ENERGY_SHAKEVIR_ZX      0x1000000010000049LL
+#define TNG_GMX_ENERGY_SHAKEVIR_ZY      0x1000000010000050LL
+#define TNG_GMX_ENERGY_SHAKEVIR_ZZ      0x1000000010000051LL
+#define TNG_GMX_ENERGY_FORCEVIR_XX      0x1000000010000052LL
+#define TNG_GMX_ENERGY_FORCEVIR_XY      0x1000000010000053LL
+#define TNG_GMX_ENERGY_FORCEVIR_XZ      0x1000000010000054LL
+#define TNG_GMX_ENERGY_FORCEVIR_YX      0x1000000010000055LL
+#define TNG_GMX_ENERGY_FORCEVIR_YY      0x1000000010000056LL
+#define TNG_GMX_ENERGY_FORCEVIR_YZ      0x1000000010000057LL
+#define TNG_GMX_ENERGY_FORCEVIR_ZX      0x1000000010000058LL
+#define TNG_GMX_ENERGY_FORCEVIR_ZY      0x1000000010000059LL
+#define TNG_GMX_ENERGY_FORCEVIR_ZZ      0x1000000010000060LL
+#define TNG_GMX_ENERGY_PRES_XX          0x1000000010000061LL
+#define TNG_GMX_ENERGY_PRES_XY          0x1000000010000062LL
+#define TNG_GMX_ENERGY_PRES_XZ          0x1000000010000063LL
+#define TNG_GMX_ENERGY_PRES_YX          0x1000000010000064LL
+#define TNG_GMX_ENERGY_PRES_YY          0x1000000010000065LL
+#define TNG_GMX_ENERGY_PRES_YZ          0x1000000010000066LL
+#define TNG_GMX_ENERGY_PRES_ZX          0x1000000010000067LL
+#define TNG_GMX_ENERGY_PRES_ZY          0x1000000010000068LL
+#define TNG_GMX_ENERGY_PRES_ZZ          0x1000000010000069LL
+#define TNG_GMX_ENERGY_SURFXSURFTEN     0x1000000010000070LL
+#define TNG_GMX_ENERGY_MUX              0x1000000010000071LL
+#define TNG_GMX_ENERGY_MUY              0x1000000010000072LL
+#define TNG_GMX_ENERGY_MUZ              0x1000000010000073LL
+#define TNG_GMX_ENERGY_VCOS             0x1000000010000074LL
+#define TNG_GMX_ENERGY_VISC             0x1000000010000075LL
+#define TNG_GMX_ENERGY_BAROSTAT         0x1000000010000076LL
+#define TNG_GMX_ENERGY_T_SYSTEM         0x1000000010000077LL
+#define TNG_GMX_ENERGY_LAMB_SYSTEM      0x1000000010000078LL
+#define TNG_GMX_SELECTION_GROUP_NAMES   0x1000000010000079LL
+#define TNG_GMX_ATOM_SELECTION_GROUP    0x1000000010000080LL
 /** @} */
 
 /** Flag to specify if a data block contains data related to particles or not.*/
@@ -2976,7 +3022,8 @@ tng_function_status DECLSPECDLLEXPORT tng_data_get(const tng_trajectory_t tng_da
  * opened.
  * @param block_id is the id number of the particle data block to read.
  * @param values is a pointer to a 1-dimensional array (memory unallocated), which
- * will be filled with data. The length of the array will be (n_frames * n_values_per_frame).
+ * will be filled with data. The length of the array will be
+ * (n_frames_with_data (see stride_length) * n_values_per_frame).
  * Since **values is allocated in this function it is the callers
  * responsibility to free the memory.
  * @param n_frames is set to the number of particles in the returned data. This is
@@ -3063,7 +3110,8 @@ tng_function_status DECLSPECDLLEXPORT tng_data_interval_get
  * If hash_mode == TNG_USE_HASH the md5 hash in the file will be
  * compared to the md5 hash of the read contents to ensure valid data.
  * @param values is a pointer to a 1-dimensional array (memory unallocated), which
- * will be filled with data. The length of the array will be (n_frames * n_values_per_frame).
+ * will be filled with data. The length of the array will be
+ * (n_frames_with_data (see stride_length) * n_values_per_frame).
  * Since **values is allocated in this function it is the callers
  * responsibility to free the memory.
  * @param stride_length is set to the stride length (writing interval) of
@@ -3152,7 +3200,7 @@ tng_function_status DECLSPECDLLEXPORT tng_particle_data_get
  * @param block_id is the id number of the particle data block to read.
  * @param values is a pointer to a 1-dimensional array (memory unallocated), which
  * will be filled with data. The length of the array will be
- * (n_frames * n_particles * n_values_per_frame).
+ * (n_frames_with_data (see stride_length) * n_particles * n_values_per_frame).
  * Since **values is allocated in this function it is the callers
  * responsibility to free the memory.
  * @param n_frames is set to the number of frames in the returned data. This is
@@ -3256,7 +3304,7 @@ tng_function_status DECLSPECDLLEXPORT tng_particle_data_interval_get
  * compared to the md5 hash of the read contents to ensure valid data.
  * @param values is a pointer to a 1-dimensional array (memory unallocated), which
  * will be filled with data. The length of the array will be
- * (n_frames * n_particles * n_values_per_frame).
+ * (n_frames_with_data (see stride_length) * n_particles * n_values_per_frame).
  * Since **values is allocated in this function it is the callers
  * responsibility to free the memory.
  * @param stride_length is set to the stride length (writing interval) of
@@ -3552,8 +3600,9 @@ tng_function_status DECLSPECDLLEXPORT tng_util_box_shape_read
  * @param tng_data is the trajectory to read from.
  * @param block_id is the ID number of the block containing the data of interest.
  * @param values will be set to point at a 1-dimensional array containing the
- * requested data. The variable may point at already allocated memory or be a
- * NULL pointer. The memory must be freed afterwards.
+ * requested data. The variable may point at already allocated memory (which will
+ * be reallocated with realloc()), or be a
+ * NULL pointer. The calling code must free the memory afterwards.
  * @param data_type will be pointing to a character indicating the size of the
  * data of the returned values, e.g. TNG_INT_DATA, TNG_FLOAT_DATA or TNG_DOUBLE_DATA.
  * @param retrieved_frame_number will be pointing at the frame number of the
@@ -4779,7 +4828,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_frame_current_compression_get
  * @param data_block_ids_in_next_frame is set to an array (of length
  * n_data_blocks_in_next_frame) that lists the data block IDs with data for
  * next_frame. It must be pointing at NULL or previously allocated memory.
- * Memory for the array is allocated by this function.
+ * Memory for the array is reallocated by this function using realloc().
  * The memory must be freed by the client afterwards or
  * there will be a memory leak.
  * @pre \code tng_data != 0 \endcode The trajectory container (tng_data)
index 06c0470677a980f64aa71b0a8182b75aa68d0dab..537510fbb35829bbd55a3e541001f20c1d462569 100644 (file)
@@ -1,13 +1,15 @@
 # - Config file for the TNG_IO package
-# It defines the following variables
-#  TNG_IO_INCLUDE_DIRS - include directories for TNG_IO
-#  TNG_IO_LIBRARIES    - libraries to link against
-#  TNG_IO_DEFINITIONS - definitions used when compiling
 
-# Compute paths
-get_filename_component(TNG_IO_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
-set(TNG_IO_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@")
-set(TNG_IO_DEFINITIONS "@TNG_COMPILE_DEFS@")
+include(${CMAKE_CURRENT_LIST_DIR}/tng_io.cmake)
 
-set(TNG_IO_LIBRARIES tng_io)
+get_target_property(_libs tng_io::tng_io INTERFACE_LINK_LIBRARIES)
+if (_libs MATCHES "ZLIB::")
+    include(CMakeFindDependencyMacro)
+    find_dependency(ZLIB)
+endif()
+unset(_libs)
 
+# Provide information in variables as well for backwards compatibility
+set(TNG_IO_LIBRARIES tng_io::tng_io)
+get_target_property(TNG_IO_INCLUDE_DIRS tng_io::tng_io INTERFACE_INCLUDE_DIRECTORIES)
+get_target_property(TNG_IO_DEFINITIONS tng_io::tng_io INTERFACE_COMPILE_DEFINITIONS)
index f0ed8d60b7768799f3312c7f8390fb2db1c3deed..d5e14a64804d06ae299fa679b99a31d3fdda884f 100644 (file)
@@ -1,7 +1,7 @@
 /* This code is part of the tng binary trajectory format.
  *
  * Written by Magnus Lundborg
- * Copyright (c) 2012-2015, The GROMACS development team.
+ * Copyright (c) 2012-2017, The GROMACS development team.
  * Check out http://www.gromacs.org for more information.
  *
  *
@@ -28,9 +28,7 @@
 #include <string.h>
 #include <time.h>
 #include <math.h>
-#ifdef USE_ZLIB
 #include <zlib.h>
-#endif
 
 #include "tng/md5.h"
 #include "compression/tng_compress.h"
@@ -258,16 +256,16 @@ struct tng_trajectory {
     FILE *output_file;
     /** Function to swap 32 bit values to and from the endianness of the
      * input file */
-    tng_function_status (*input_endianness_swap_func_32)(const tng_trajectory_t, int32_t *);
+    tng_function_status (*input_endianness_swap_func_32)(const tng_trajectory_t, uint32_t *);
     /** Function to swap 64 bit values to and from the endianness of the
      * input file */
-    tng_function_status (*input_endianness_swap_func_64)(const tng_trajectory_t, int64_t *);
+    tng_function_status (*input_endianness_swap_func_64)(const tng_trajectory_t, uint64_t *);
     /** Function to swap 32 bit values to and from the endianness of the
      * input file */
-    tng_function_status (*output_endianness_swap_func_32)(const tng_trajectory_t, int32_t *);
+    tng_function_status (*output_endianness_swap_func_32)(const tng_trajectory_t, uint32_t *);
     /** Function to swap 64 bit values to and from the endianness of the
      * input file */
-    tng_function_status (*output_endianness_swap_func_64)(const tng_trajectory_t, int64_t *);
+    tng_function_status (*output_endianness_swap_func_64)(const tng_trajectory_t, uint64_t *);
     /** The endianness of 32 bit values of the current computer */
     char endianness_32;
     /** The endianness of 64 bit values of the current computer */
@@ -402,7 +400,7 @@ static TNG_INLINE int64_t tng_max_i64(const int64_t a, const int64_t b)
  * byte order is not recognised.
  */
 static tng_function_status tng_swap_byte_order_big_endian_32
-                (const tng_trajectory_t tng_data, int32_t *v)
+                (const tng_trajectory_t tng_data, uint32_t *v)
 {
     switch(tng_data->endianness_32)
     {
@@ -441,7 +439,7 @@ static tng_function_status tng_swap_byte_order_big_endian_32
  * byte order is not recognised.
  */
 static tng_function_status tng_swap_byte_order_big_endian_64
-                (const tng_trajectory_t tng_data, int64_t *v)
+                (const tng_trajectory_t tng_data, uint64_t *v)
 {
     switch(tng_data->endianness_64)
     {
@@ -494,7 +492,7 @@ static tng_function_status tng_swap_byte_order_big_endian_64
  * byte order is not recognised.
  */
 static tng_function_status tng_swap_byte_order_little_endian_32
-                (const tng_trajectory_t tng_data, int32_t *v)
+                (const tng_trajectory_t tng_data, uint32_t *v)
 {
     switch(tng_data->endianness_32)
     {
@@ -533,7 +531,7 @@ static tng_function_status tng_swap_byte_order_little_endian_32
  * byte order is not recognised.
  */
 static tng_function_status tng_swap_byte_order_little_endian_64
-                (const tng_trajectory_t tng_data, int64_t *v)
+                (const tng_trajectory_t tng_data, uint64_t *v)
 {
     switch(tng_data->endianness_64)
     {
@@ -619,11 +617,10 @@ static tng_function_status tng_freadstr(const tng_trajectory_t tng_data,
         }
     } while ((temp[count-1] != '\0') && (count < TNG_MAX_STR_LEN));
 
-    temp_alloc = realloc(*str, count);
+    temp_alloc = (char *)realloc(*str, count);
     if(!temp_alloc)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%d bytes). %s: %d\n", count,
-               __FILE__, line_nr);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n", __FILE__, line_nr);
         free(*str);
         *str = 0;
         return TNG_FAILURE;
@@ -708,7 +705,7 @@ static TNG_INLINE tng_function_status tng_file_input_numerical
     {
     case 8:
         if(tng_data->input_endianness_swap_func_64 &&
-           tng_data->input_endianness_swap_func_64(tng_data, dest) != TNG_SUCCESS)
+           tng_data->input_endianness_swap_func_64(tng_data, (uint64_t *)dest) != TNG_SUCCESS)
         {
             fprintf(stderr, "TNG library: Cannot swap byte order. %s: %d\n",
                     __FILE__, line_nr);
@@ -716,7 +713,7 @@ static TNG_INLINE tng_function_status tng_file_input_numerical
         break;
     case 4:
         if(tng_data->input_endianness_swap_func_32 &&
-           tng_data->input_endianness_swap_func_32(tng_data, dest) != TNG_SUCCESS)
+           tng_data->input_endianness_swap_func_32(tng_data, (uint32_t *)dest) != TNG_SUCCESS)
         {
             fprintf(stderr, "TNG library: Cannot swap byte order. %s: %d\n",
                     __FILE__, line_nr);
@@ -750,13 +747,13 @@ static TNG_INLINE tng_function_status tng_file_output_numerical
                  md5_state_t *md5_state,
                  const int line_nr)
 {
-    int32_t temp_i32;
-    int64_t temp_i64;
+    uint32_t temp_i32;
+    uint64_t temp_i64;
 
     switch(len)
     {
         case 8:
-            temp_i64 = *((int64_t *)src);
+            temp_i64 = *((uint64_t *)src);
             if(tng_data->output_endianness_swap_func_64 &&
             tng_data->output_endianness_swap_func_64(tng_data, &temp_i64) != TNG_SUCCESS)
             {
@@ -774,7 +771,7 @@ static TNG_INLINE tng_function_status tng_file_output_numerical
             }
             break;
         case 4:
-            temp_i32 = *((int32_t *)src);
+            temp_i32 = *((uint32_t *)src);
             if(tng_data->output_endianness_swap_func_32 &&
             tng_data->output_endianness_swap_func_32(tng_data, &temp_i32) != TNG_SUCCESS)
             {
@@ -846,11 +843,11 @@ static tng_function_status tng_md5_remaining_append(const tng_trajectory_t tng_d
     curr_file_pos = ftello(tng_data->input_file);
     if(curr_file_pos < start_pos + block->block_contents_size)
     {
-        temp_data = malloc(start_pos + block->block_contents_size - curr_file_pos);
+        temp_data = (char *)malloc(start_pos + block->block_contents_size - curr_file_pos);
         if(!temp_data)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
-                    start_pos + block->block_contents_size - curr_file_pos, __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
         if(fread(temp_data, start_pos + block->block_contents_size - curr_file_pos,
@@ -946,11 +943,10 @@ static tng_function_status tng_block_init(struct tng_gen_block **block_p)
 {
     tng_gen_block_t block;
 
-    *block_p = malloc(sizeof(struct tng_gen_block));
+    *block_p = (struct tng_gen_block *)malloc(sizeof(struct tng_gen_block));
     if(!*block_p)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIuPTR" bytes). %s: %d\n",
-               sizeof(struct tng_gen_block), __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n", __FILE__, __LINE__);
         return(TNG_CRITICAL);
     }
 
@@ -1102,7 +1098,7 @@ static tng_function_status tng_block_header_read
     }
 
     if(tng_data->input_endianness_swap_func_64 &&
-       tng_data->input_endianness_swap_func_64(tng_data, &block->header_contents_size) != TNG_SUCCESS)
+       tng_data->input_endianness_swap_func_64(tng_data, (uint64_t *)&block->header_contents_size) != TNG_SUCCESS)
     {
         fprintf(stderr, "TNG library: Cannot swap byte order. %s: %d\n",
                 __FILE__, __LINE__);
@@ -1204,11 +1200,10 @@ static tng_function_status tng_md5_hash_update(const tng_trajectory_t tng_data,
         free(block->block_contents);
     }
 
-    block->block_contents = malloc(block->block_contents_size);
+    block->block_contents = (char *)malloc(block->block_contents_size);
     if(!block->block_contents)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
-               block->block_contents_size, __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n", __FILE__, __LINE__);
         return(TNG_CRITICAL);
     }
 
@@ -1243,7 +1238,7 @@ static tng_function_status tng_header_pointers_update
 {
     tng_gen_block_t block;
     FILE *temp = tng_data->input_file;
-    int64_t output_file_pos, pos, contents_start_pos;
+    uint64_t output_file_pos, pos, contents_start_pos;
 
     if(tng_output_file_init(tng_data) != TNG_SUCCESS)
     {
@@ -1342,7 +1337,7 @@ static tng_function_status tng_frame_set_pointers_update
     tng_gen_block_t block;
     tng_trajectory_frame_set_t frame_set;
     FILE *temp = tng_data->input_file;
-    int64_t pos, output_file_pos, contents_start_pos;
+    uint64_t pos, output_file_pos, contents_start_pos;
 
     if(tng_output_file_init(tng_data) != TNG_SUCCESS)
     {
@@ -1658,7 +1653,7 @@ static tng_function_status tng_reread_frame_set_at_file_pos
         stat = tng_block_header_read(tng_data, block);
         if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
         {
-            fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n", pos,
+            fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n", pos,
                     __FILE__, __LINE__);
             tng_block_destroy(&block);
             return(TNG_FAILURE);
@@ -1704,7 +1699,7 @@ static tng_function_status tng_file_pos_of_subsequent_trajectory_block_get
     stat = tng_block_header_read(tng_data, block);
     if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
     {
-        fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n", *pos,
+        fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n", *pos,
                 __FILE__, __LINE__);
         tng_block_destroy(&block);
         return(TNG_FAILURE);
@@ -1724,7 +1719,7 @@ static tng_function_status tng_file_pos_of_subsequent_trajectory_block_get
         stat = tng_block_header_read(tng_data, block);
         if(stat == TNG_CRITICAL)
         {
-            fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n", *pos,
+            fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n", *pos,
                     __FILE__, __LINE__);
             tng_block_destroy(&block);
             return(TNG_CRITICAL);
@@ -1784,11 +1779,10 @@ static tng_function_status tng_frame_set_complete_migrate
 
     fseeko(tng_data->input_file, block_start_pos, SEEK_SET);
 
-    contents = malloc(block_len);
+    contents = (char *)malloc(block_len);
     if(!contents)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
-                block_len, __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n", __FILE__, __LINE__);
         return(TNG_CRITICAL);
     }
 
@@ -1810,6 +1804,10 @@ static tng_function_status tng_frame_set_complete_migrate
     }
 
     tng_data->current_trajectory_frame_set_output_file_pos = new_pos;
+    if(tng_data->input_file == tng_data->output_file)
+    {
+        tng_data->current_trajectory_frame_set_input_file_pos = new_pos;
+    }
 
     tng_frame_set_pointers_update(tng_data, hash_mode);
 
@@ -1861,7 +1859,7 @@ static tng_function_status tng_length_of_current_frame_set_contents_get
     stat = tng_block_header_read(tng_data, block);
     if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
     {
-        fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                 curr_frame_set_pos, __FILE__, __LINE__);
         tng_block_destroy(&block);
         return(TNG_FAILURE);
@@ -1991,10 +1989,10 @@ static tng_function_status tng_block_header_len_calculate
      * termination */
     if(!block->name)
     {
-        block->name = malloc(1);
+        block->name = (char *)malloc(1);
         if(!block->name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (1 byte). %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
@@ -2100,10 +2098,10 @@ static tng_function_status tng_general_info_block_len_calculate
      * termination */
     if(!tng_data->first_program_name)
     {
-        tng_data->first_program_name = malloc(1);
+        tng_data->first_program_name = (char *)malloc(1);
         if(!tng_data->first_program_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (1 byte). %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
@@ -2111,10 +2109,10 @@ static tng_function_status tng_general_info_block_len_calculate
     }
     if(!tng_data->last_program_name)
     {
-        tng_data->last_program_name = malloc(1);
+        tng_data->last_program_name = (char *)malloc(1);
         if(!tng_data->last_program_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (1 byte). %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
@@ -2122,10 +2120,10 @@ static tng_function_status tng_general_info_block_len_calculate
     }
     if(!tng_data->first_user_name)
     {
-        tng_data->first_user_name = malloc(1);
+        tng_data->first_user_name = (char *)malloc(1);
         if(!tng_data->first_user_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (1 byte). %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
@@ -2133,10 +2131,10 @@ static tng_function_status tng_general_info_block_len_calculate
     }
     if(!tng_data->last_user_name)
     {
-        tng_data->last_user_name = malloc(1);
+        tng_data->last_user_name = (char *)malloc(1);
         if(!tng_data->last_user_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (1 byte). %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
@@ -2144,10 +2142,10 @@ static tng_function_status tng_general_info_block_len_calculate
     }
     if(!tng_data->first_computer_name)
     {
-        tng_data->first_computer_name = malloc(1);
+        tng_data->first_computer_name = (char *)malloc(1);
         if(!tng_data->first_computer_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (1 byte). %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
@@ -2155,10 +2153,10 @@ static tng_function_status tng_general_info_block_len_calculate
     }
     if(!tng_data->last_computer_name)
     {
-        tng_data->last_computer_name = malloc(1);
+        tng_data->last_computer_name = (char *)malloc(1);
         if(!tng_data->last_computer_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (1 byte). %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
@@ -2166,10 +2164,10 @@ static tng_function_status tng_general_info_block_len_calculate
     }
     if(!tng_data->first_pgp_signature)
     {
-        tng_data->first_pgp_signature = malloc(1);
+        tng_data->first_pgp_signature = (char *)malloc(1);
         if(!tng_data->first_pgp_signature)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (1 byte). %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
@@ -2177,10 +2175,10 @@ static tng_function_status tng_general_info_block_len_calculate
     }
     if(!tng_data->last_pgp_signature)
     {
-        tng_data->last_pgp_signature = malloc(1);
+        tng_data->last_pgp_signature = (char *)malloc(1);
         if(!tng_data->last_pgp_signature)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (1 byte). %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
@@ -2188,10 +2186,10 @@ static tng_function_status tng_general_info_block_len_calculate
     }
     if(!tng_data->forcefield_name)
     {
-        tng_data->forcefield_name = malloc(1);
+        tng_data->forcefield_name = (char *)malloc(1);
         if(!tng_data->forcefield_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (1 byte). %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
@@ -2410,11 +2408,10 @@ static tng_function_status tng_general_info_block_write
 
     name_len = strlen("GENERAL INFO");
 
-    block->name = malloc(name_len + 1);
+    block->name = (char *)malloc(name_len + 1);
     if(!block->name)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%u bytes). %s: %d\n",
-                (unsigned int)(name_len+1), __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n", __FILE__, __LINE__);
         tng_block_destroy(&block);
         return(TNG_CRITICAL);
     }
@@ -2797,10 +2794,10 @@ static tng_function_status tng_molecules_block_len_calculate
         molecule = &tng_data->molecules[i];
         if(!molecule->name)
         {
-            molecule->name = malloc(1);
+            molecule->name = (char *)malloc(1);
             if(!molecule->name)
             {
-                fprintf(stderr, "TNG library: Cannot allocate memory (1 byte). %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
                        __FILE__, __LINE__);
                 return(TNG_CRITICAL);
             }
@@ -2815,10 +2812,10 @@ static tng_function_status tng_molecules_block_len_calculate
 
             if(!chain->name)
             {
-                chain->name = malloc(1);
+                chain->name = (char *)malloc(1);
                 if(!chain->name)
                 {
-                    fprintf(stderr, "TNG library: Cannot allocate memory (1 byte). %s: %d\n",
+                    fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
                            __FILE__, __LINE__);
                     return(TNG_CRITICAL);
                 }
@@ -2838,10 +2835,10 @@ static tng_function_status tng_molecules_block_len_calculate
 
             if(!residue->name)
             {
-                residue->name = malloc(1);
+                residue->name = (char *)malloc(1);
                 if(!residue->name)
                 {
-                    fprintf(stderr, "TNG library: Cannot allocate memory (1 byte). %s: %d\n",
+                    fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
                            __FILE__, __LINE__);
                     return(TNG_CRITICAL);
                 }
@@ -2860,10 +2857,10 @@ static tng_function_status tng_molecules_block_len_calculate
             *len += sizeof(atom->id);
             if(!atom->name)
             {
-                atom->name = malloc(1);
+                atom->name = (char *)malloc(1);
                 if(!atom->name)
                 {
-                    fprintf(stderr, "TNG library: Cannot allocate memory (1 byte). %s: %d\n",
+                    fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
                            __FILE__, __LINE__);
                     return(TNG_CRITICAL);
                 }
@@ -2873,10 +2870,10 @@ static tng_function_status tng_molecules_block_len_calculate
 
             if(!atom->atom_type)
             {
-                atom->atom_type = malloc(1);
+                atom->atom_type = (char *)malloc(1);
                 if(!atom->atom_type)
                 {
-                    fprintf(stderr, "TNG library: Cannot allocate memory (1 byte). %s: %d\n",
+                    fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
                            __FILE__, __LINE__);
                     return(TNG_CRITICAL);
                 }
@@ -2973,13 +2970,11 @@ static tng_function_status tng_molecules_block_read
 
     tng_data->n_particles = 0;
 
-    tng_data->molecules = malloc(tng_data->n_molecules *
-                          sizeof(struct tng_molecule));
+    tng_data->molecules = (struct tng_molecule *)malloc(tng_data->n_molecules *
+                                                        sizeof(struct tng_molecule));
     if(!tng_data->molecules)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-               tng_data->n_molecules * sizeof(struct tng_molecule),
-               __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n", __FILE__, __LINE__);
         return(TNG_CRITICAL);
     }
 
@@ -2989,13 +2984,11 @@ static tng_function_status tng_molecules_block_read
         {
             free(tng_data->molecule_cnt_list);
         }
-        tng_data->molecule_cnt_list = malloc(sizeof(int64_t) *
-                                      tng_data->n_molecules);
+        tng_data->molecule_cnt_list = (int64_t *)malloc(sizeof(int64_t) *
+                                                        tng_data->n_molecules);
         if(!tng_data->molecule_cnt_list)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-                   tng_data->n_molecules * sizeof(struct tng_molecule),
-                   __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n", __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
     }
@@ -3014,7 +3007,7 @@ static tng_function_status tng_molecules_block_read
             return(TNG_CRITICAL);
         }
 
-/*         fprintf(stderr, "TNG library: Read id: %"PRId64" offset: %d\n", molecule->id, offset);*/
+/*         fprintf(stderr, "TNG library: Read id: %" PRId64 " offset: %d\n", molecule->id, offset);*/
         tng_freadstr(tng_data, &molecule->name, hash_mode, &md5_state, __LINE__);
 
         if(tng_file_input_numerical(tng_data, &molecule->quaternary_str,
@@ -3060,13 +3053,12 @@ static tng_function_status tng_molecules_block_read
 
         if(molecule->n_chains > 0)
         {
-            molecule->chains = malloc(molecule->n_chains *
-                                    sizeof(struct tng_chain));
+            molecule->chains = (struct tng_chain *)malloc(molecule->n_chains *
+                                                          sizeof(struct tng_chain));
             if(!molecule->chains)
             {
-                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-                    molecule->n_chains * sizeof(struct tng_chain),
-                    __FILE__, __LINE__);
+                fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                        __FILE__, __LINE__);
                 return(TNG_CRITICAL);
             }
 
@@ -3079,13 +3071,12 @@ static tng_function_status tng_molecules_block_read
 
         if(molecule->n_residues > 0)
         {
-            molecule->residues = malloc(molecule->n_residues *
-                                        sizeof(struct tng_residue));
+            molecule->residues = (struct tng_residue *)malloc(molecule->n_residues *
+                                                              sizeof(struct tng_residue));
             if(!molecule->residues)
             {
-                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-                    molecule->n_residues * sizeof(struct tng_residue),
-                    __FILE__, __LINE__);
+                fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                        __FILE__, __LINE__);
                 if(molecule->chains)
                 {
                     free(molecule->chains);
@@ -3101,13 +3092,12 @@ static tng_function_status tng_molecules_block_read
             residue = 0;
         }
 
-        molecule->atoms = malloc(molecule->n_atoms *
-                                 sizeof(struct tng_atom));
+        molecule->atoms = (struct tng_atom *)malloc(molecule->n_atoms *
+                                                 sizeof(struct tng_atom));
         if(!molecule->atoms)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-                   molecule->n_atoms * sizeof(struct tng_atom),
-                   __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             if(molecule->chains)
             {
                 free(molecule->chains);
@@ -3221,13 +3211,12 @@ static tng_function_status tng_molecules_block_read
 
         if(molecule->n_bonds > 0)
         {
-            tng_data->molecules[i].bonds = malloc(molecule->n_bonds *
-                                           sizeof(struct tng_bond));
+            tng_data->molecules[i].bonds = (struct tng_bond *)malloc(molecule->n_bonds *
+                                                                     sizeof(struct tng_bond));
             if(!molecule->bonds)
             {
-                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-                       molecule->n_bonds * sizeof(struct tng_bond),
-                       __FILE__, __LINE__);
+                fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                        __FILE__, __LINE__);
                 if(molecule->chains)
                 {
                     free(molecule->chains);
@@ -3330,11 +3319,10 @@ static tng_function_status tng_molecules_block_write
 
     name_len = (unsigned int)strlen("MOLECULES");
 
-    block->name = malloc(name_len + 1);
+    block->name = (char *)malloc(name_len + 1);
     if(!block->name)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%d bytes). %s: %d\n",
-                name_len+1, __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n", __FILE__, __LINE__);
         tng_block_destroy(&block);
         return(TNG_CRITICAL);
     }
@@ -3607,13 +3595,12 @@ static tng_function_status tng_frame_set_block_read
         if(!frame_set->molecule_cnt_list)
         {
                 frame_set->molecule_cnt_list =
-                malloc(sizeof(int64_t) * tng_data->n_molecules);
+                (int64_t *)malloc(sizeof(int64_t) * tng_data->n_molecules);
 
                 if(!frame_set->molecule_cnt_list)
                 {
-                    fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-                           sizeof(int64_t) * tng_data->n_molecules,
-                           __FILE__, __LINE__);
+                    fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                            __FILE__, __LINE__);
                     return(TNG_CRITICAL);
                 }
         }
@@ -3710,7 +3697,7 @@ static tng_function_status tng_frame_set_block_read
         {
             if(strncmp(block->md5_hash, hash, TNG_MD5_HASH_LEN) != 0)
             {
-                fprintf(stderr, "TNG library: Frame set block contents corrupt (first frame %"PRId64"). Hashes do not match. "
+                fprintf(stderr, "TNG library: Frame set block contents corrupt (first frame %" PRId64 "). Hashes do not match. "
                         "%s: %d\n", frame_set->first_frame, __FILE__, __LINE__);
             }
         }
@@ -3763,11 +3750,11 @@ static tng_function_status tng_frame_set_block_write
 
     if(!block->name || strlen(block->name) < name_len)
     {
-        temp_name = realloc(block->name, name_len + 1);
+        temp_name = (char *)realloc(block->name, name_len + 1);
         if(!temp_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%u bytes). %s: %d\n",
-                   name_len+1, __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             free(block->name);
             block->name = 0;
             return(TNG_CRITICAL);
@@ -3943,13 +3930,13 @@ static tng_function_status tng_trajectory_mapping_block_read
      * size or if the contents can be read. */
 
     frame_set->n_mapping_blocks++;
-    mappings = realloc(frame_set->mappings,
-                       sizeof(struct tng_particle_mapping) *
-                       frame_set->n_mapping_blocks);
+    mappings = (tng_particle_mapping_t)realloc(frame_set->mappings,
+                                               sizeof(struct tng_particle_mapping) *
+                                               frame_set->n_mapping_blocks);
     if(!mappings)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
-               block->block_contents_size, __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         free(frame_set->mappings);
         frame_set->mappings = 0;
         return(TNG_CRITICAL);
@@ -3977,12 +3964,12 @@ static tng_function_status tng_trajectory_mapping_block_read
         return(TNG_CRITICAL);
     }
 
-    mapping->real_particle_numbers = malloc(mapping->n_particles *
-                                            sizeof(int64_t));
+    mapping->real_particle_numbers = (int64_t *)malloc(mapping->n_particles *
+                                                       sizeof(int64_t));
     if(!mapping->real_particle_numbers)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-                mapping->n_particles * sizeof(int64_t), __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         return(TNG_CRITICAL);
     }
 
@@ -4081,11 +4068,11 @@ static tng_function_status tng_trajectory_mapping_block_write
 
     if(!block->name || strlen(block->name) < name_len)
     {
-        temp_name = realloc(block->name, name_len + 1);
+        temp_name = (char *)realloc(block->name, name_len + 1);
         if(!temp_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%u bytes). %s: %d\n",
-                   name_len+1, __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             free(block->name);
             block->name = 0;
             return(TNG_CRITICAL);
@@ -4198,15 +4185,13 @@ static tng_function_status tng_particle_data_block_create
     if(block_type_flag == TNG_TRAJECTORY_BLOCK)
     {
         frame_set->n_particle_data_blocks++;
-        data = realloc(frame_set->tr_particle_data,
-                    sizeof(struct tng_data) *
-                    frame_set->n_particle_data_blocks);
+        data = (tng_data_t)realloc(frame_set->tr_particle_data,
+                                   sizeof(struct tng_data) *
+                                   frame_set->n_particle_data_blocks);
         if(!data)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIuPTR" bytes). %s: %d\n",
-                sizeof(struct tng_data) *
-                frame_set->n_particle_data_blocks,
-                __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             free(frame_set->tr_particle_data);
             frame_set->tr_particle_data = 0;
             return(TNG_CRITICAL);
@@ -4216,14 +4201,12 @@ static tng_function_status tng_particle_data_block_create
     else
     {
         tng_data->n_particle_data_blocks++;
-        data = realloc(tng_data->non_tr_particle_data,
-                        sizeof(struct tng_data) *
-                        tng_data->n_particle_data_blocks);
+        data = (tng_data_t)realloc(tng_data->non_tr_particle_data,
+                                   sizeof(struct tng_data) *
+                                   tng_data->n_particle_data_blocks);
         if(!data)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIuPTR" bytes). %s: %d\n",
-                    sizeof(struct tng_data) *
-                    tng_data->n_particle_data_blocks,
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
                     __FILE__, __LINE__);
             free(tng_data->non_tr_particle_data);
             tng_data->non_tr_particle_data = 0;
@@ -4282,7 +4265,7 @@ static tng_function_status tng_compress(const tng_trajectory_t tng_data,
         if(n_frames == 1 && tng_data->frame_set_n_frames > 1)
         {
             nalgo = tng_compress_nalgo();
-            alt_algo = malloc(nalgo * sizeof *tng_data->compress_algo_pos);
+            alt_algo = (int *)malloc(nalgo * sizeof *tng_data->compress_algo_pos);
 
             /* If we have already determined the initial coding and
              * initial coding parameter do not determine them again. */
@@ -4325,8 +4308,8 @@ static tng_function_status tng_compress(const tng_trajectory_t tng_data,
             if(!tng_data->compress_algo_pos)
             {
                 nalgo = tng_compress_nalgo();
-                tng_data->compress_algo_pos=malloc(nalgo *
-                                                   sizeof *tng_data->compress_algo_pos);
+                tng_data->compress_algo_pos = (int *)malloc(nalgo *
+                                                            sizeof *tng_data->compress_algo_pos);
                 tng_data->compress_algo_pos[0] = alt_algo[0];
                 tng_data->compress_algo_pos[1] = alt_algo[1];
                 tng_data->compress_algo_pos[2] = -1;
@@ -4350,8 +4333,8 @@ static tng_function_status tng_compress(const tng_trajectory_t tng_data,
             if(!tng_data->compress_algo_pos)
             {
                 nalgo = tng_compress_nalgo();
-                tng_data->compress_algo_pos=malloc(nalgo *
-                                                   sizeof *tng_data->compress_algo_pos);
+                tng_data->compress_algo_pos = (int *)malloc(nalgo *
+                                                            sizeof *tng_data->compress_algo_pos);
                 tng_data->compress_algo_pos[0] = -1;
                 tng_data->compress_algo_pos[1] = -1;
                 tng_data->compress_algo_pos[2] = -1;
@@ -4423,7 +4406,7 @@ static tng_function_status tng_compress(const tng_trajectory_t tng_data,
         if(n_frames == 1 && tng_data->frame_set_n_frames > 1)
         {
             nalgo = tng_compress_nalgo();
-            alt_algo=malloc(nalgo * sizeof *tng_data->compress_algo_vel);
+            alt_algo = (int *)malloc(nalgo * sizeof *tng_data->compress_algo_vel);
 
             /* If we have already determined the initial coding and
              * initial coding parameter do not determine them again. */
@@ -4466,8 +4449,8 @@ static tng_function_status tng_compress(const tng_trajectory_t tng_data,
             if(!tng_data->compress_algo_vel)
             {
                 nalgo = tng_compress_nalgo();
-                tng_data->compress_algo_vel=malloc(nalgo *
-                                                   sizeof *tng_data->compress_algo_vel);
+                tng_data->compress_algo_vel = (int *)malloc(nalgo *
+                                                            sizeof *tng_data->compress_algo_vel);
                 tng_data->compress_algo_vel[0] = alt_algo[0];
                 tng_data->compress_algo_vel[1] = alt_algo[1];
                 tng_data->compress_algo_vel[2] = -1;
@@ -4491,8 +4474,8 @@ static tng_function_status tng_compress(const tng_trajectory_t tng_data,
             if(!tng_data->compress_algo_vel)
             {
                 nalgo = tng_compress_nalgo();
-                tng_data->compress_algo_vel=malloc(nalgo *
-                                                   sizeof *tng_data->compress_algo_vel);
+                tng_data->compress_algo_vel = (int *)malloc(nalgo *
+                                                            sizeof *tng_data->compress_algo_vel);
                 tng_data->compress_algo_vel[0] = -1;
                 tng_data->compress_algo_vel[1] = -1;
                 tng_data->compress_algo_vel[2] = -1;
@@ -4605,11 +4588,11 @@ static tng_function_status tng_uncompress(const tng_trajectory_t tng_data,
 
     if(type == TNG_FLOAT_DATA)
     {
-        f_dest = malloc(uncompressed_len);
+        f_dest = (float *)malloc(uncompressed_len);
         if(!f_dest)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
-                uncompressed_len, __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
         result = tng_compress_uncompress_float(*data, f_dest);
@@ -4620,11 +4603,11 @@ static tng_function_status tng_uncompress(const tng_trajectory_t tng_data,
     }
     else
     {
-        d_dest = malloc(uncompressed_len);
+        d_dest = (double *)malloc(uncompressed_len);
         if(!d_dest)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
-                uncompressed_len, __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
         result = tng_compress_uncompress(*data, d_dest);
@@ -4643,7 +4626,6 @@ static tng_function_status tng_uncompress(const tng_trajectory_t tng_data,
     return(TNG_SUCCESS);
 }
 
-#ifdef USE_ZLIB
 static tng_function_status tng_gzip_compress(const tng_trajectory_t tng_data,
                                              char **data, const int64_t len,
                                              int64_t *new_len)
@@ -4653,11 +4635,11 @@ static tng_function_status tng_gzip_compress(const tng_trajectory_t tng_data,
     (void)tng_data;
 
     max_len = compressBound(len);
-    dest = malloc(max_len);
+    dest = (Bytef *)malloc(max_len);
     if(!dest)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%lu bytes). %s: %d\n",
-               max_len, __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         return(TNG_CRITICAL);
     }
 
@@ -4696,11 +4678,11 @@ static tng_function_status tng_gzip_uncompress(const tng_trajectory_t tng_data,
     (void)tng_data;
     uLongf new_len = uncompressed_len;
 
-    dest = malloc(uncompressed_len);
+    dest = (Bytef *)malloc(uncompressed_len);
     if(!dest)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
-               uncompressed_len, __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         return(TNG_CRITICAL);
     }
 
@@ -4733,7 +4715,6 @@ static tng_function_status tng_gzip_uncompress(const tng_trajectory_t tng_data,
 
     return(TNG_SUCCESS);
 }
-#endif
 
 /**
  * @brief Allocate memory for storing particle data.
@@ -4792,27 +4773,25 @@ static tng_function_status tng_allocate_particle_data_mem
 
     if(data->datatype == TNG_CHAR_DATA)
     {
-        data->strings = malloc(sizeof(char ***) * frame_alloc);
+        data->strings = (char ****)malloc(sizeof(char ***) * frame_alloc);
         for(i = 0; i < frame_alloc; i++)
         {
-            data->strings[i] = malloc(sizeof(char **) *
+            data->strings[i] = (char ***)malloc(sizeof(char **) *
                                     n_particles);
             if(!data->strings[i])
             {
-                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-                    sizeof(union data_values *) * n_particles,
-                    __FILE__, __LINE__);
+                fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                        __FILE__, __LINE__);
                 return(TNG_CRITICAL);
             }
             for(j = 0; j < n_particles; j++)
             {
-                data->strings[i][j] = malloc(sizeof(char *) *
+                data->strings[i][j] = (char **)malloc(sizeof(char *) *
                                             n_values_per_frame);
                 if(!data->strings[i][j])
                 {
-                    fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-                        sizeof(union data_values) * n_values_per_frame,
-                        __FILE__, __LINE__);
+                    fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                            __FILE__, __LINE__);
                     return(TNG_CRITICAL);
                 }
                 for(k = 0; k < n_values_per_frame; k++)
@@ -4837,15 +4816,13 @@ static tng_function_status tng_allocate_particle_data_mem
             size = sizeof(double);
         }
 
-        values = realloc(data->values,
-                         size * frame_alloc *
-                         n_particles * n_values_per_frame);
+        values = (void ***)realloc(data->values,
+                                   size * frame_alloc *
+                                   n_particles * n_values_per_frame);
         if(!values)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
-                   size * frame_alloc *
-                   n_particles * n_values_per_frame,
-                   __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             free(data->values);
             data->values = 0;
             return(TNG_CRITICAL);
@@ -5093,13 +5070,12 @@ static tng_function_status tng_data_block_create
     if(block_type_flag == TNG_TRAJECTORY_BLOCK)
     {
         frame_set->n_data_blocks++;
-        data = realloc(frame_set->tr_data, sizeof(struct tng_data) *
-                       frame_set->n_data_blocks);
+        data = (tng_data_t)realloc(frame_set->tr_data, sizeof(struct tng_data) *
+                                   frame_set->n_data_blocks);
         if(!data)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIuPTR" bytes). %s: %d\n",
-                sizeof(struct tng_data) * frame_set->n_data_blocks,
-                __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             free(frame_set->tr_data);
             frame_set->tr_data = 0;
             return(TNG_CRITICAL);
@@ -5109,13 +5085,12 @@ static tng_function_status tng_data_block_create
     else
     {
         tng_data->n_data_blocks++;
-        data = realloc(tng_data->non_tr_data, sizeof(struct tng_data) *
-                        tng_data->n_data_blocks);
+        data = (tng_data_t)realloc(tng_data->non_tr_data, sizeof(struct tng_data) *
+                                   tng_data->n_data_blocks);
         if(!data)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIuPTR" bytes). %s: %d\n",
-                sizeof(struct tng_data) * tng_data->n_data_blocks,
-                __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             free(tng_data->non_tr_data);
             tng_data->non_tr_data = 0;
             return(TNG_CRITICAL);
@@ -5181,16 +5156,15 @@ static tng_function_status tng_allocate_data_mem
 
     if(data->datatype == TNG_CHAR_DATA)
     {
-        data->strings = malloc(sizeof(char ***));
-        data->strings[0] = malloc(sizeof(char **) * frame_alloc);
+        data->strings = (char ****)malloc(sizeof(char ***));
+        data->strings[0] = (char ***)malloc(sizeof(char **) * frame_alloc);
         for(i = 0; i < frame_alloc; i++)
         {
-            data->strings[0][i] = malloc(sizeof(char *) * n_values_per_frame);
+            data->strings[0][i] = (char **)malloc(sizeof(char *) * n_values_per_frame);
             if(!data->strings[0][i])
             {
-                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
-                       n_values_per_frame,
-                       __FILE__, __LINE__);
+                fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                        __FILE__, __LINE__);
                 return(TNG_CRITICAL);
             }
             for(j = 0; j < n_values_per_frame; j++)
@@ -5214,15 +5188,13 @@ static tng_function_status tng_allocate_data_mem
             size = sizeof(double);
         }
 
-        values = realloc(data->values,
-                         size * frame_alloc *
-                         n_values_per_frame);
+        values = (void **)realloc(data->values,
+                                  size * frame_alloc *
+                                  n_values_per_frame);
         if(!values)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
-                   size * frame_alloc *
-                   n_values_per_frame,
-                   __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             free(data->values);
             data->values = 0;
             return(TNG_CRITICAL);
@@ -5290,16 +5262,6 @@ static tng_function_status tng_data_read(const tng_trajectory_t tng_data,
 
 /*     fprintf(stderr, "TNG library: %s\n", block->name);*/
 
-    /* This must be caught early to avoid creating a data block if not necessary. */
-#ifndef USE_ZLIB
-    if(codec_id == TNG_GZIP_COMPRESSION)
-    {
-        fprintf(stderr, "TNG library: Cannot uncompress data block. %s: %d\n", __FILE__,
-                __LINE__);
-        return(TNG_FAILURE);
-    }
-#endif
-
     switch(datatype)
     {
     case TNG_CHAR_DATA:
@@ -5395,11 +5357,11 @@ static tng_function_status tng_data_read(const tng_trajectory_t tng_data,
 
         data->block_id = block->id;
 
-        data->block_name = malloc(strlen(block->name) + 1);
+        data->block_name = (char *)malloc(strlen(block->name) + 1);
         if(!data->block_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%ud bytes). %s: %d\n",
-                   (unsigned int)strlen(block->name)+1, __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
         strcpy(data->block_name, block->name);
@@ -5448,11 +5410,11 @@ static tng_function_status tng_data_read(const tng_trajectory_t tng_data,
 
     n_frames_div = (n_frames % stride_length) ? n_frames / stride_length + 1 : n_frames / stride_length;
 
-    contents = malloc(block_data_len);
+    contents = (char *)malloc(block_data_len);
     if(!contents)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
-                block_data_len, __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         return(TNG_CRITICAL);
     }
 
@@ -5480,7 +5442,7 @@ static tng_function_status tng_data_read(const tng_trajectory_t tng_data,
             fprintf(stderr, "TNG library: XTC compression not implemented yet.\n");
             break;
         case TNG_TNG_COMPRESSION:
-/*            fprintf(stderr, "TNG library: Before TNG uncompression: %"PRId64"\n", block->block_contents_size);*/
+/*            fprintf(stderr, "TNG library: Before TNG uncompression: %" PRId64 "\n", block->block_contents_size);*/
             if(tng_uncompress(tng_data, block, datatype,
                               &contents, full_data_len) != TNG_SUCCESS)
             {
@@ -5489,11 +5451,10 @@ static tng_function_status tng_data_read(const tng_trajectory_t tng_data,
                 free(contents);
                 return(TNG_CRITICAL);
             }
-/*            fprintf(stderr, "TNG library: After TNG uncompression: %"PRId64"\n", block->block_contents_size);*/
+/*            fprintf(stderr, "TNG library: After TNG uncompression: %" PRId64 "\n", block->block_contents_size);*/
             break;
-#ifdef USE_ZLIB
         case TNG_GZIP_COMPRESSION:
-    /*         fprintf(stderr, "TNG library: Before compression: %"PRId64"\n", block->block_contents_size); */
+    /*         fprintf(stderr, "TNG library: Before compression: %" PRId64 "\n", block->block_contents_size); */
             if(tng_gzip_uncompress(tng_data, &contents,
                                    block_data_len, full_data_len) != TNG_SUCCESS)
             {
@@ -5502,9 +5463,8 @@ static tng_function_status tng_data_read(const tng_trajectory_t tng_data,
                 free(contents);
                 return(TNG_CRITICAL);
             }
-    /*         fprintf(stderr, "TNG library: After compression: %"PRId64"\n", block->block_contents_size); */
+    /*         fprintf(stderr, "TNG library: After compression: %" PRId64 "\n", block->block_contents_size); */
             break;
-#endif
         }
     }
     else
@@ -5560,11 +5520,11 @@ static tng_function_status tng_data_read(const tng_trajectory_t tng_data,
                         {
                             free(second_dim_values[k]);
                         }
-                        second_dim_values[k] = malloc(len);
+                        second_dim_values[k] = (char *)malloc(len);
                         if(!second_dim_values[k])
                         {
-                            fprintf(stderr, "TNG library: Cannot allocate memory (%d bytes). %s: %d\n",
-                                len, __FILE__, __LINE__);
+                            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                                    __FILE__, __LINE__);
                             free(contents);
                             return(TNG_CRITICAL);
                         }
@@ -5586,11 +5546,11 @@ static tng_function_status tng_data_read(const tng_trajectory_t tng_data,
                     {
                         free(data->strings[0][i][j]);
                     }
-                    data->strings[0][i][j] = malloc(len);
+                    data->strings[0][i][j] = (char *)malloc(len);
                     if(!data->strings[0][i][j])
                     {
-                        fprintf(stderr, "TNG library: Cannot allocate memory (%d bytes). %s: %d\n",
-                               len, __FILE__, __LINE__);
+                        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                                __FILE__, __LINE__);
                         free(contents);
                         return(TNG_CRITICAL);
                     }
@@ -5623,7 +5583,7 @@ static tng_function_status tng_data_read(const tng_trajectory_t tng_data,
                     for(i = 0; i < full_data_len; i+=size)
                     {
                         if(tng_data->input_endianness_swap_func_32(tng_data,
-                            (int32_t *)((char *)data->values + i))
+                            (uint32_t *)((char *)data->values + i))
                             != TNG_SUCCESS)
                         {
                             fprintf(stderr, "TNG library: Cannot swap byte order. %s: %d\n",
@@ -5639,7 +5599,7 @@ static tng_function_status tng_data_read(const tng_trajectory_t tng_data,
                     for(i = 0; i < full_data_len; i+=size)
                     {
                         if(tng_data->input_endianness_swap_func_64(tng_data,
-                            (int64_t *)((char *)data->values + i))
+                            (uint64_t *)((char *)data->values + i))
                             != TNG_SUCCESS)
                         {
                             fprintf(stderr, "TNG library: Cannot swap byte order. %s: %d\n",
@@ -5774,10 +5734,10 @@ static tng_function_status tng_data_block_write(const tng_trajectory_t tng_data,
 
     if(!block->name || strlen(block->name) < len)
     {
-        temp_name = realloc(block->name, len);
+        temp_name = (char *)realloc(block->name, len);
         if(!temp_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIuPTR" bytes). %s: %d\n", len+1,
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
                    __FILE__, __LINE__);
             free(block->name);
             block->name = 0;
@@ -5839,6 +5799,15 @@ static tng_function_status tng_data_block_write(const tng_trajectory_t tng_data,
             }
         }
     }
+    else
+    {
+        /* This just appeases gcc-7 -Wmaybe-uninitialized.
+         * FIXME: It would be better to refactor so that
+         * TNG_PARTICLE_DEPENDENT triggers two distinct code paths.
+         */
+        num_first_particle = -1;
+        n_particles = -1;
+    }
 
     if(data->dependency & TNG_PARTICLE_DEPENDENT)
     {
@@ -6024,11 +5993,11 @@ static tng_function_status tng_data_block_write(const tng_trajectory_t tng_data,
         {
             full_data_len = size * frame_step * data->n_values_per_frame;
         }
-        contents = malloc(full_data_len);
+        contents = (char *)malloc(full_data_len);
         if(!contents)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
-                    full_data_len, __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
 
@@ -6049,7 +6018,7 @@ static tng_function_status tng_data_block_write(const tng_trajectory_t tng_data,
                             for(i = 0; i < full_data_len; i+=size)
                             {
                                 if(tng_data->output_endianness_swap_func_32(tng_data,
-                                (int32_t *)(contents + i))
+                                (uint32_t *)(contents + i))
                                 != TNG_SUCCESS)
                                 {
                                     fprintf(stderr, "TNG library: Cannot swap byte order. %s: %d\n",
@@ -6064,12 +6033,12 @@ static tng_function_status tng_data_block_write(const tng_trajectory_t tng_data,
                         if(fabs(multiplier - 1.0) > 0.00001 ||
                         tng_data->output_endianness_swap_func_32)
                         {
-                            for(i = 0; full_data_len; i+=size)
+                            for(i = 0; i < full_data_len; i+=size)
                             {
                                 *(float *)(contents + i) *= (float)multiplier;
                                 if(tng_data->output_endianness_swap_func_32 &&
                                 tng_data->output_endianness_swap_func_32(tng_data,
-                                (int32_t *)(contents + i))
+                                (uint32_t *)(contents + i))
                                 != TNG_SUCCESS)
                                 {
                                     fprintf(stderr, "TNG library: Cannot swap byte order. %s: %d\n",
@@ -6085,7 +6054,7 @@ static tng_function_status tng_data_block_write(const tng_trajectory_t tng_data,
                         for(i = 0; i < full_data_len; i+=size)
                         {
                             if(tng_data->output_endianness_swap_func_64(tng_data,
-                            (int64_t *)(contents + i))
+                            (uint64_t *)(contents + i))
                             != TNG_SUCCESS)
                             {
                                 fprintf(stderr, "TNG library: Cannot swap byte order. %s: %d\n",
@@ -6102,7 +6071,7 @@ static tng_function_status tng_data_block_write(const tng_trajectory_t tng_data,
                             for(i = 0; i < full_data_len; i+=size)
                             {
                                 if(tng_data->output_endianness_swap_func_64(tng_data,
-                                (int64_t *)(contents + i))
+                                (uint64_t *)(contents + i))
                                 != TNG_SUCCESS)
                                 {
                                     fprintf(stderr, "TNG library: Cannot swap byte order. %s: %d\n",
@@ -6122,7 +6091,7 @@ static tng_function_status tng_data_block_write(const tng_trajectory_t tng_data,
                                 *(double *)(contents + i) *= multiplier;
                                 if(tng_data->output_endianness_swap_func_64 &&
                                 tng_data->output_endianness_swap_func_64(tng_data,
-                                (int64_t *)(contents + i))
+                                (uint64_t *)(contents + i))
                                 != TNG_SUCCESS)
                                 {
                                     fprintf(stderr, "TNG library: Cannot swap byte order. %s: %d\n",
@@ -6172,9 +6141,8 @@ static tng_function_status tng_data_block_write(const tng_trajectory_t tng_data,
                 return(stat);
             }
             break;
-#ifdef USE_ZLIB
         case TNG_GZIP_COMPRESSION:
-    /*         fprintf(stderr, "TNG library: Before compression: %"PRId64"\n", block->block_contents_size); */
+    /*         fprintf(stderr, "TNG library: Before compression: %" PRId64 "\n", block->block_contents_size); */
             stat = tng_gzip_compress(tng_data,
                                      &contents,
                                      full_data_len,
@@ -6189,9 +6157,8 @@ static tng_function_status tng_data_block_write(const tng_trajectory_t tng_data,
                 }
                 data->codec_id = TNG_UNCOMPRESSED;
             }
-    /*         fprintf(stderr, "TNG library: After compression: %"PRId64"\n", block->block_contents_size); */
+    /*         fprintf(stderr, "TNG library: After compression: %" PRId64 "\n", block->block_contents_size); */
             break;
-#endif
         }
         if(block_data_len != full_data_len)
         {
@@ -6554,7 +6521,7 @@ static tng_function_status tng_data_block_contents_read
 //     {
 //         if(tng_block_header_read(tng_data, block) != TNG_SUCCESS)
 //         {
-//             fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n", pos,
+//             fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n", pos,
 //                    __FILE__, __LINE__);
 //             tng_data->input_file = temp;
 //             tng_block_destroy(&block);
@@ -6671,10 +6638,10 @@ static tng_function_status tng_frame_set_finalize
 //     }
 //     if(!block->name)
 //     {
-//         block->name = malloc(len);
+//         block->name = (char *)malloc(len);
 //         if(!block->name)
 //         {
-//             fprintf(stderr, "TNG library: Cannot allocate memory (%d bytes). %s: %d\n", len,
+//             fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
 //                    __FILE__, __LINE__);
 //             return(TNG_CRITICAL);
 //         }
@@ -6742,11 +6709,11 @@ tng_function_status DECLSPECDLLEXPORT tng_atom_name_set
     }
     if(!atom->name)
     {
-        atom->name = malloc(len);
+        atom->name = (char *)malloc(len);
         if(!atom->name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%ud bytes). %s: %d\n", len,
-                   __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
     }
@@ -6798,11 +6765,11 @@ tng_function_status DECLSPECDLLEXPORT tng_atom_type_set
     }
     if(!atom->atom_type)
     {
-        atom->atom_type = malloc(len);
+        atom->atom_type = (char *)malloc(len);
         if(!atom->atom_type)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%ud bytes). %s: %d\n", len,
-                   __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
     }
@@ -6953,29 +6920,27 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_w_id_add
     TNG_ASSERT(tng_data, "TNG library: Trajectory container not properly setup.");
     TNG_ASSERT(name, "TNG library: name must not be a NULL pointer.");
 
-    new_molecules = realloc(tng_data->molecules,
-                            sizeof(struct tng_molecule) *
-                            (tng_data->n_molecules + 1));
+    new_molecules = (tng_molecule_t)realloc(tng_data->molecules,
+                                            sizeof(struct tng_molecule) *
+                                            (tng_data->n_molecules + 1));
 
     if(!new_molecules)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-               sizeof(struct tng_molecule) * (tng_data->n_molecules + 1),
-               __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         free(tng_data->molecules);
         tng_data->molecules = 0;
         return(TNG_CRITICAL);
     }
 
-    new_molecule_cnt_list = realloc(tng_data->molecule_cnt_list,
-                                    sizeof(int64_t) *
-                                    (tng_data->n_molecules + 1));
+    new_molecule_cnt_list = (int64_t *)realloc(tng_data->molecule_cnt_list,
+                                               sizeof(int64_t) *
+                                               (tng_data->n_molecules + 1));
 
     if(!new_molecule_cnt_list)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-               sizeof(int64_t) * (tng_data->n_molecules + 1),
-               __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         free(tng_data->molecule_cnt_list);
         tng_data->molecule_cnt_list = 0;
         free(new_molecules);
@@ -7019,29 +6984,27 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_existing_add
         id = 1;
     }
 
-    new_molecules = realloc(tng_data->molecules,
-                            sizeof(struct tng_molecule) *
-                            (tng_data->n_molecules + 1));
+    new_molecules = (tng_molecule_t)realloc(tng_data->molecules,
+                                            sizeof(struct tng_molecule) *
+                                            (tng_data->n_molecules + 1));
 
     if(!new_molecules)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-               sizeof(struct tng_molecule) * (tng_data->n_molecules + 1),
-               __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         free(tng_data->molecules);
         tng_data->molecules = 0;
         return(TNG_CRITICAL);
     }
 
-    new_molecule_cnt_list = realloc(tng_data->molecule_cnt_list,
-                                    sizeof(int64_t) *
-                                    (tng_data->n_molecules + 1));
+    new_molecule_cnt_list = (int64_t *)realloc(tng_data->molecule_cnt_list,
+                                               sizeof(int64_t) *
+                                               (tng_data->n_molecules + 1));
 
     if(!new_molecule_cnt_list)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-               sizeof(int64_t) * (tng_data->n_molecules + 1),
-               __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         free(tng_data->molecule_cnt_list);
         tng_data->molecule_cnt_list = 0;
         free(new_molecules);
@@ -7111,11 +7074,11 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_name_set
     }
     if(!molecule->name)
     {
-        molecule->name = malloc(len);
+        molecule->name = (char *)malloc(len);
         if(!molecule->name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%ud bytes). %s: %d\n", len,
-                   __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
     }
@@ -7266,24 +7229,22 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_system_copy(const tng_traject
     tng_data_dest->n_molecules = 0;
     tng_data_dest->n_particles = 0;
 
-    molecule_temp = realloc(tng_data_dest->molecules,
-                    sizeof(struct tng_molecule) * tng_data_src->n_molecules);
+    molecule_temp = (tng_molecule_t)realloc(tng_data_dest->molecules,
+                                            sizeof(struct tng_molecule) * tng_data_src->n_molecules);
     if(!molecule_temp)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-               sizeof(struct tng_molecule) * tng_data_src->n_molecules,
-               __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         free(tng_data_dest->molecules);
         tng_data_dest->molecules = 0;
         return(TNG_CRITICAL);
     }
-    list_temp = realloc(tng_data_dest->molecule_cnt_list,
-                                     sizeof(int64_t) * tng_data_src->n_molecules);
+    list_temp = (int64_t *)realloc(tng_data_dest->molecule_cnt_list,
+                                   sizeof(int64_t) * tng_data_src->n_molecules);
     if(!list_temp)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-               sizeof(int64_t) * tng_data_src->n_molecules,
-               __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         free(tng_data_dest->molecule_cnt_list);
         tng_data_dest->molecule_cnt_list = 0;
         free(molecule_temp);
@@ -7347,13 +7308,12 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_system_copy(const tng_traject
         molecule_temp->n_bonds = molecule->n_bonds;
         if(molecule->n_bonds > 0)
         {
-            bond_temp = realloc(molecule_temp->bonds, sizeof(struct tng_bond) *
-                                molecule->n_bonds);
+            bond_temp = (tng_bond_t)realloc(molecule_temp->bonds, sizeof(struct tng_bond) *
+                                            molecule->n_bonds);
             if(!bond_temp)
             {
-                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-                       sizeof(struct tng_bond) * molecule->n_bonds,
-                       __FILE__, __LINE__);
+                fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                        __FILE__, __LINE__);
                 free(molecule_temp->bonds);
                 molecule_temp->n_bonds = 0;
                 return(TNG_CRITICAL);
@@ -7545,15 +7505,14 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_chain_w_id_add
     TNG_ASSERT(tng_data, "TNG library: Trajectory container not properly setup.");
     TNG_ASSERT(name, "TNG library: name must not be a NULL pointer.");
 
-    new_chains = realloc(molecule->chains,
-                         sizeof(struct tng_chain) *
-                         (molecule->n_chains + 1));
+    new_chains = (tng_chain_t)realloc(molecule->chains,
+                                      sizeof(struct tng_chain) *
+                                      (molecule->n_chains + 1));
 
     if(!new_chains)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-               sizeof(struct tng_chain) * (molecule->n_chains + 1),
-               __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         free(molecule->chains);
         molecule->chains = 0;
         return(TNG_CRITICAL);
@@ -7586,15 +7545,14 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_bond_add
     tng_bond_t new_bonds;
     (void)tng_data;
 
-    new_bonds = realloc(molecule->bonds,
-                        sizeof(struct tng_bond) *
-                        (molecule->n_bonds + 1));
+    new_bonds = (tng_bond_t)realloc(molecule->bonds,
+                                    sizeof(struct tng_bond) *
+                                    (molecule->n_bonds + 1));
 
     if(!new_bonds)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-               sizeof(struct tng_bond) * (molecule->n_bonds + 1),
-               __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         *bond = 0;
         free(molecule->bonds);
         molecule->bonds = 0;
@@ -7684,11 +7642,11 @@ tng_function_status DECLSPECDLLEXPORT tng_chain_name_set
     }
     if(!chain->name)
     {
-        chain->name = malloc(len);
+        chain->name = (char *)malloc(len);
         if(!chain->name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%ud bytes). %s: %d\n", len,
-                   __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
     }
@@ -7811,15 +7769,14 @@ tng_function_status DECLSPECDLLEXPORT tng_chain_residue_w_id_add
         curr_index = -1;
     }
 
-    new_residues = realloc(molecule->residues,
-                           sizeof(struct tng_residue) *
-                           (molecule->n_residues + 1));
+    new_residues = (tng_residue_t)realloc(molecule->residues,
+                                          sizeof(struct tng_residue) *
+                                          (molecule->n_residues + 1));
 
     if(!new_residues)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-               sizeof(struct tng_residue) * (molecule->n_residues + 1),
-               __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         free(molecule->residues);
         molecule->residues = 0;
         return(TNG_CRITICAL);
@@ -7909,11 +7866,11 @@ tng_function_status DECLSPECDLLEXPORT tng_residue_name_set(const tng_trajectory_
     }
     if(!residue->name)
     {
-        residue->name = malloc(len);
+        residue->name = (char *)malloc(len);
         if(!residue->name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%ud bytes). %s: %d\n", len,
-                   __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
     }
@@ -8016,15 +7973,14 @@ tng_function_status DECLSPECDLLEXPORT tng_residue_atom_w_id_add
         residue->atoms_offset = molecule->n_atoms;
     }
 
-    new_atoms = realloc(molecule->atoms,
-                        sizeof(struct tng_atom) *
-                        (molecule->n_atoms + 1));
+    new_atoms = (tng_atom_t)realloc(molecule->atoms,
+                                    sizeof(struct tng_atom) *
+                                    (molecule->n_atoms + 1));
 
     if(!new_atoms)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-               sizeof(struct tng_atom) * (molecule->n_atoms + 1),
-               __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         free(molecule->atoms);
         molecule->atoms = 0;
         return(TNG_CRITICAL);
@@ -8051,11 +8007,11 @@ tng_function_status DECLSPECDLLEXPORT tng_residue_atom_w_id_add
 tng_function_status DECLSPECDLLEXPORT tng_molecule_alloc(const tng_trajectory_t tng_data,
                                                          tng_molecule_t *molecule_p)
 {
-    *molecule_p = malloc(sizeof(struct tng_molecule));
+    *molecule_p = (tng_molecule_t)malloc(sizeof(struct tng_molecule));
     if(!*molecule_p)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIuPTR" bytes). %s: %d\n",
-               sizeof(struct tng_molecule), __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         return(TNG_CRITICAL);
     }
 
@@ -8283,18 +8239,18 @@ tng_function_status DECLSPECDLLEXPORT tng_molsystem_bonds_get
         return(TNG_SUCCESS);
     }
 
-    *from_atoms = malloc(sizeof(int64_t) * (*n_bonds));
+    *from_atoms = (int64_t *)malloc(sizeof(int64_t) * (*n_bonds));
     if(!*from_atoms)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-               sizeof(int64_t) * (*n_bonds), __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         return(TNG_CRITICAL);
     }
-    *to_atoms = malloc(sizeof(int64_t) * (*n_bonds));
+    *to_atoms = (int64_t *)malloc(sizeof(int64_t) * (*n_bonds));
     if(!*to_atoms)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-               sizeof(int64_t) * (*n_bonds), __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         free(*from_atoms);
         *from_atoms = 0;
         return(TNG_CRITICAL);
@@ -8670,14 +8626,13 @@ tng_function_status DECLSPECDLLEXPORT tng_particle_mapping_add
 
     frame_set->n_mapping_blocks++;
 
-    mapping = realloc(frame_set->mappings, sizeof(struct tng_particle_mapping) *
-                      frame_set->n_mapping_blocks);
+    mapping = (tng_particle_mapping_t)realloc(frame_set->mappings, sizeof(struct tng_particle_mapping) *
+                                              frame_set->n_mapping_blocks);
 
     if(!mapping)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-               sizeof(struct tng_particle_mapping)*frame_set->n_mapping_blocks,
-               __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         free(frame_set->mappings);
         frame_set->mappings = 0;
         return(TNG_CRITICAL);
@@ -8687,11 +8642,11 @@ tng_function_status DECLSPECDLLEXPORT tng_particle_mapping_add
     frame_set->mappings[frame_set->n_mapping_blocks - 1].num_first_particle = num_first_particle;
     frame_set->mappings[frame_set->n_mapping_blocks - 1].n_particles = n_particles;
 
-    frame_set->mappings[frame_set->n_mapping_blocks - 1].real_particle_numbers = malloc(sizeof(int64_t) * n_particles);
+    frame_set->mappings[frame_set->n_mapping_blocks - 1].real_particle_numbers = (int64_t *)malloc(sizeof(int64_t) * n_particles);
     if(!frame_set->mappings[frame_set->n_mapping_blocks - 1].real_particle_numbers)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-               sizeof(int64_t) * n_particles, __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         return(TNG_CRITICAL);
     }
 
@@ -8738,11 +8693,11 @@ tng_function_status DECLSPECDLLEXPORT tng_trajectory_init(tng_trajectory_t *tng_
     tng_trajectory_frame_set_t frame_set;
     tng_trajectory_t tng_data;
 
-    *tng_data_p = malloc(sizeof(struct tng_trajectory));
+    *tng_data_p = (tng_trajectory_t)malloc(sizeof(struct tng_trajectory));
     if(!*tng_data_p)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIuPTR" bytes). %s: %d\n",
-               sizeof(struct tng_trajectory), __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         return(TNG_CRITICAL);
     }
 
@@ -9262,11 +9217,11 @@ tng_function_status DECLSPECDLLEXPORT tng_trajectory_init_from_src
 
     TNG_ASSERT(src != 0, "TNG library: Source trajectory must not be NULL.");
 
-    *dest_p = malloc(sizeof(struct tng_trajectory));
+    *dest_p = (tng_trajectory_t)malloc(sizeof(struct tng_trajectory));
     if(!*dest_p)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIuPTR" bytes). %s: %d\n",
-               sizeof(struct tng_trajectory), __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         return(TNG_CRITICAL);
     }
 
@@ -9276,11 +9231,11 @@ tng_function_status DECLSPECDLLEXPORT tng_trajectory_init_from_src
 
     if(src->input_file_path)
     {
-        dest->input_file_path = malloc(strlen(src->input_file_path) + 1);
+        dest->input_file_path = (char *)malloc(strlen(src->input_file_path) + 1);
         if(!dest->input_file_path)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%ud bytes). %s: %d\n",
-                   (unsigned int)strlen(src->input_file_path) + 1, __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
         strcpy(dest->input_file_path, src->input_file_path);
@@ -9293,11 +9248,11 @@ tng_function_status DECLSPECDLLEXPORT tng_trajectory_init_from_src
     dest->input_file = 0;
     if(src->output_file_path)
     {
-        dest->output_file_path = malloc(strlen(src->output_file_path) + 1);
+        dest->output_file_path = (char *)malloc(strlen(src->output_file_path) + 1);
         if(!dest->output_file_path)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%ud bytes). %s: %d\n",
-                   (unsigned int)strlen(src->output_file_path) + 1, __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
         strcpy(dest->output_file_path, src->output_file_path);
@@ -9431,11 +9386,11 @@ tng_function_status DECLSPECDLLEXPORT tng_input_file_set
     }
 
     len = tng_min_size(strlen(file_name) + 1, TNG_MAX_STR_LEN);
-    temp = realloc(tng_data->input_file_path, len);
+    temp = (char *)realloc(tng_data->input_file_path, len);
     if(!temp)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%ud bytes). %s: %d\n", len,
-               __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         free(tng_data->input_file_path);
         tng_data->input_file_path = 0;
         return(TNG_CRITICAL);
@@ -9487,11 +9442,11 @@ tng_function_status DECLSPECDLLEXPORT tng_output_file_set
     }
 
     len = tng_min_size(strlen(file_name) + 1, TNG_MAX_STR_LEN);
-    temp = realloc(tng_data->output_file_path, len);
+    temp = (char *)realloc(tng_data->output_file_path, len);
     if(!temp)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%d bytes). %s: %d\n", len,
-               __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         free(tng_data->output_file_path);
         tng_data->output_file_path = 0;
         return(TNG_CRITICAL);
@@ -9525,11 +9480,11 @@ tng_function_status DECLSPECDLLEXPORT tng_output_append_file_set
     }
 
     len = tng_min_size(strlen(file_name) + 1, TNG_MAX_STR_LEN);
-    temp = realloc(tng_data->output_file_path, len);
+    temp = (char *)realloc(tng_data->output_file_path, len);
     if(!temp)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%d bytes). %s: %d\n", len,
-               __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         free(tng_data->output_file_path);
         tng_data->output_file_path = 0;
         return(TNG_CRITICAL);
@@ -9726,11 +9681,11 @@ tng_function_status DECLSPECDLLEXPORT tng_first_program_name_set
     }
     if(!tng_data->first_program_name)
     {
-        tng_data->first_program_name = malloc(len);
+        tng_data->first_program_name = (char *)malloc(len);
         if(!tng_data->first_program_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%ud bytes). %s: %d\n", len,
-                   __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
     }
@@ -9775,11 +9730,11 @@ tng_function_status DECLSPECDLLEXPORT tng_last_program_name_set
     }
     if(!tng_data->last_program_name)
     {
-        tng_data->last_program_name = malloc(len);
+        tng_data->last_program_name = (char *)malloc(len);
         if(!tng_data->last_program_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%ud bytes). %s: %d\n", len,
-                   __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
     }
@@ -9826,11 +9781,11 @@ tng_function_status DECLSPECDLLEXPORT tng_first_user_name_set
     }
     if(!tng_data->first_user_name)
     {
-        tng_data->first_user_name = malloc(len);
+        tng_data->first_user_name = (char *)malloc(len);
         if(!tng_data->first_user_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%ud bytes). %s: %d\n", len,
-                   __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
     }
@@ -9877,11 +9832,11 @@ tng_function_status DECLSPECDLLEXPORT tng_last_user_name_set
     }
     if(!tng_data->last_user_name)
     {
-        tng_data->last_user_name = malloc(len);
+        tng_data->last_user_name = (char *)malloc(len);
         if(!tng_data->last_user_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%ud bytes). %s: %d\n", len,
-                   __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
     }
@@ -9928,11 +9883,11 @@ tng_function_status DECLSPECDLLEXPORT tng_first_computer_name_set
     }
     if(!tng_data->first_computer_name)
     {
-        tng_data->first_computer_name = malloc(len);
+        tng_data->first_computer_name = (char *)malloc(len);
         if(!tng_data->first_computer_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%ud bytes). %s: %d\n", len,
-                   __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
     }
@@ -9980,11 +9935,11 @@ tng_function_status DECLSPECDLLEXPORT tng_last_computer_name_set
     }
     if(!tng_data->last_computer_name)
     {
-        tng_data->last_computer_name = malloc(len);
+        tng_data->last_computer_name = (char *)malloc(len);
         if(!tng_data->last_computer_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%ud bytes). %s: %d\n", len,
-                   __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
     }
@@ -10032,11 +9987,11 @@ tng_function_status DECLSPECDLLEXPORT tng_first_signature_set
     }
     if(!tng_data->first_pgp_signature)
     {
-        tng_data->first_pgp_signature = malloc(len);
+        tng_data->first_pgp_signature = (char *)malloc(len);
         if(!tng_data->first_pgp_signature)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%ud bytes). %s: %d\n", len,
-                   __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
     }
@@ -10084,11 +10039,11 @@ tng_function_status DECLSPECDLLEXPORT tng_last_signature_set
     }
     if(!tng_data->last_pgp_signature)
     {
-        tng_data->last_pgp_signature = malloc(len);
+        tng_data->last_pgp_signature = (char *)malloc(len);
         if(!tng_data->last_pgp_signature)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%ud bytes). %s: %d\n", len,
-                   __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
     }
@@ -10135,11 +10090,11 @@ tng_function_status DECLSPECDLLEXPORT tng_forcefield_name_set
     }
     if(!tng_data->forcefield_name)
     {
-        tng_data->forcefield_name = malloc(len);
+        tng_data->forcefield_name = (char *)malloc(len);
         if(!tng_data->forcefield_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%ud bytes). %s: %d\n", len,
-                   __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
     }
@@ -10283,7 +10238,7 @@ tng_function_status DECLSPECDLLEXPORT tng_num_frames_get
     stat = tng_block_header_read(tng_data, block);
     if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
     {
-        fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n", last_file_pos,
+        fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n", last_file_pos,
                 __FILE__, __LINE__);
         tng_block_destroy(&block);
         return(TNG_FAILURE);
@@ -10605,7 +10560,7 @@ tng_function_status DECLSPECDLLEXPORT tng_num_frame_sets_get
     stat = tng_block_header_read(tng_data, block);
     if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
     {
-        fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n", file_pos,
+        fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n", file_pos,
                 __FILE__, __LINE__);
         tng_block_destroy(&block);
         return(TNG_CRITICAL);
@@ -10636,7 +10591,7 @@ tng_function_status DECLSPECDLLEXPORT tng_num_frame_sets_get
             stat = tng_block_header_read(tng_data, block);
             if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
             {
-                fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                        file_pos, __FILE__, __LINE__);
                 tng_block_destroy(&block);
                 return(TNG_CRITICAL);
@@ -10667,7 +10622,7 @@ tng_function_status DECLSPECDLLEXPORT tng_num_frame_sets_get
             stat = tng_block_header_read(tng_data, block);
             if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
             {
-                fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                        file_pos, __FILE__, __LINE__);
                 tng_block_destroy(&block);
                 return(TNG_CRITICAL);
@@ -10697,7 +10652,7 @@ tng_function_status DECLSPECDLLEXPORT tng_num_frame_sets_get
             stat = tng_block_header_read(tng_data, block);
             if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
             {
-                fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                        file_pos, __FILE__, __LINE__);
                 tng_block_destroy(&block);
                 return(TNG_CRITICAL);
@@ -10800,7 +10755,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_nr_find
     stat = tng_block_header_read(tng_data, block);
     if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
     {
-        fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n", file_pos,
+        fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n", file_pos,
                 __FILE__, __LINE__);
         tng_block_destroy(&block);
         return(TNG_CRITICAL);
@@ -10834,7 +10789,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_nr_find
             stat = tng_block_header_read(tng_data, block);
             if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
             {
-                fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                        file_pos,  __FILE__, __LINE__);
                 tng_block_destroy(&block);
                 return(TNG_CRITICAL);
@@ -10869,7 +10824,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_nr_find
             stat = tng_block_header_read(tng_data, block);
             if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
             {
-                fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                        file_pos, __FILE__, __LINE__);
                 tng_block_destroy(&block);
                 return(TNG_CRITICAL);
@@ -10904,7 +10859,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_nr_find
             stat = tng_block_header_read(tng_data, block);
             if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
             {
-                fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                        file_pos, __FILE__, __LINE__);
                 tng_block_destroy(&block);
                 return(TNG_CRITICAL);
@@ -10939,7 +10894,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_nr_find
             stat = tng_block_header_read(tng_data, block);
             if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
             {
-                fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                        file_pos, __FILE__, __LINE__);
                 tng_block_destroy(&block);
                 return(TNG_CRITICAL);
@@ -10974,7 +10929,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_nr_find
             stat = tng_block_header_read(tng_data, block);
             if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
             {
-                fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                        file_pos, __FILE__, __LINE__);
                 tng_block_destroy(&block);
                 return(TNG_CRITICAL);
@@ -11008,7 +10963,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_nr_find
             stat = tng_block_header_read(tng_data, block);
             if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
             {
-                fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                        file_pos, __FILE__, __LINE__);
                 tng_block_destroy(&block);
                 return(TNG_CRITICAL);
@@ -11043,7 +10998,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_nr_find
             stat = tng_block_header_read(tng_data, block);
             if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
             {
-                fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                        file_pos, __FILE__, __LINE__);
                 tng_block_destroy(&block);
                 return(TNG_CRITICAL);
@@ -11096,7 +11051,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_of_frame_find
         stat = tng_block_header_read(tng_data, block);
         if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
         {
-            fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                     file_pos, __FILE__, __LINE__);
             tng_block_destroy(&block);
             return(TNG_CRITICAL);
@@ -11179,7 +11134,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_of_frame_find
             stat = tng_block_header_read(tng_data, block);
             if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
             {
-                fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                        file_pos, __FILE__, __LINE__);
                 tng_block_destroy(&block);
                 return(TNG_CRITICAL);
@@ -11218,7 +11173,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_of_frame_find
             stat = tng_block_header_read(tng_data, block);
             if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
             {
-                fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                        file_pos, __FILE__, __LINE__);
                 tng_block_destroy(&block);
                 return(TNG_CRITICAL);
@@ -11255,7 +11210,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_of_frame_find
             stat = tng_block_header_read(tng_data, block);
             if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
             {
-                fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                        file_pos, __FILE__, __LINE__);
                 tng_block_destroy(&block);
                 return(TNG_CRITICAL);
@@ -11290,7 +11245,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_of_frame_find
             stat = tng_block_header_read(tng_data, block);
             if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
             {
-                fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                        file_pos, __FILE__, __LINE__);
                 tng_block_destroy(&block);
                 return(TNG_CRITICAL);
@@ -11327,7 +11282,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_of_frame_find
             stat = tng_block_header_read(tng_data, block);
             if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
             {
-                fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                        file_pos, __FILE__, __LINE__);
                 tng_block_destroy(&block);
                 return(TNG_CRITICAL);
@@ -11364,7 +11319,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_of_frame_find
             stat = tng_block_header_read(tng_data, block);
             if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
             {
-                fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                        file_pos, __FILE__, __LINE__);
                 tng_block_destroy(&block);
                 return(TNG_CRITICAL);
@@ -11399,7 +11354,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_of_frame_find
             stat = tng_block_header_read(tng_data, block);
             if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
             {
-                fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                        file_pos, __FILE__, __LINE__);
                 tng_block_destroy(&block);
                 return(TNG_CRITICAL);
@@ -11435,7 +11390,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_of_frame_find
             stat = tng_block_header_read(tng_data, block);
             if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
             {
-                fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                        file_pos, __FILE__, __LINE__);
                 tng_block_destroy(&block);
                 return(TNG_CRITICAL);
@@ -11688,11 +11643,11 @@ tng_function_status DECLSPECDLLEXPORT tng_file_headers_write
         }
 
         tng_block_init(&block);
-        block->name = malloc(TNG_MAX_STR_LEN);
+        block->name = (char *)malloc(TNG_MAX_STR_LEN);
         if(!block->name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%d bytes). %s: %d\n",
-                    TNG_MAX_STR_LEN, __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             tng_block_destroy(&block);
             return(TNG_CRITICAL);
         }
@@ -11737,6 +11692,7 @@ tng_function_status DECLSPECDLLEXPORT tng_file_headers_write
         if(tot_len > orig_len)
         {
             tng_migrate_data_in_file(tng_data, orig_len+1, tot_len - orig_len, hash_mode);
+            tng_data->last_trajectory_frame_set_input_file_pos = tng_data->last_trajectory_frame_set_output_file_pos;
         }
 
         stat = tng_reread_frame_set_at_file_pos(tng_data, tng_data->last_trajectory_frame_set_input_file_pos);
@@ -11854,7 +11810,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_read
     if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET ||
        block->id == -1)
     {
-        fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                file_pos, __FILE__, __LINE__);
         tng_block_destroy(&block);
         return(TNG_CRITICAL);
@@ -11887,7 +11843,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_read
         }
         if(stat == TNG_CRITICAL)
         {
-            fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                    file_pos, __FILE__, __LINE__);
             tng_block_destroy(&block);
             return(stat);
@@ -11949,7 +11905,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_read_current_only_data_from_
     stat = tng_block_header_read(tng_data, block);
     if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
     {
-        fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                file_pos, __FILE__, __LINE__);
         tng_block_destroy(&block);
         return(TNG_CRITICAL);
@@ -12009,7 +11965,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_read_current_only_data_from_
     }
     if(stat == TNG_CRITICAL)
     {
-        fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                 file_pos, __FILE__, __LINE__);
         tng_block_destroy(&block);
         return(stat);
@@ -12106,7 +12062,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_read_next_only_data_from_blo
     stat = tng_block_header_read(tng_data, block);
     if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
     {
-        fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                 file_pos, __FILE__, __LINE__);
         tng_block_destroy(&block);
         return(TNG_CRITICAL);
@@ -12326,7 +12282,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_new
             if(tng_data->input_endianness_swap_func_64)
             {
                 if(tng_data->input_endianness_swap_func_64(tng_data,
-                   &frame_set->medium_stride_prev_frame_set_file_pos)
+                   (uint64_t *)&frame_set->medium_stride_prev_frame_set_file_pos)
                     != TNG_SUCCESS)
                 {
                     fprintf(stderr, "TNG library: Cannot swap byte order. %s: %d\n",
@@ -12384,7 +12340,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_new
                     if(tng_data->input_endianness_swap_func_64)
                     {
                         if(tng_data->input_endianness_swap_func_64(tng_data,
-                           &frame_set->long_stride_prev_frame_set_file_pos)
+                           (uint64_t *)&frame_set->long_stride_prev_frame_set_file_pos)
                             != TNG_SUCCESS)
                         {
                             fprintf(stderr, "TNG library: Cannot swap byte order. %s: %d\n",
@@ -12499,7 +12455,7 @@ tng_function_status DECLSPECDLLEXPORT tng_first_frame_nr_of_next_frame_set_get
     stat = tng_block_header_read(tng_data, block);
     if(stat == TNG_CRITICAL || block->id != TNG_TRAJECTORY_FRAME_SET)
     {
-        fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                file_pos, __FILE__, __LINE__);
         return(TNG_CRITICAL);
     }
@@ -12541,7 +12497,7 @@ static tng_function_status tng_gen_data_block_add
     char ***first_dim_values, **second_dim_values;
     tng_trajectory_frame_set_t frame_set;
     tng_data_t data;
-    char *new_data_c=new_data;
+    char *new_data_c = (char *)new_data;
     tng_function_status stat;
 
     frame_set = &tng_data->current_trajectory_frame_set;
@@ -12603,11 +12559,11 @@ static tng_function_status tng_gen_data_block_add
         }
         data->block_id = id;
 
-        data->block_name = malloc(strlen(block_name) + 1);
+        data->block_name = (char *)malloc(strlen(block_name) + 1);
         if(!data->block_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%ud bytes). %s: %d\n",
-                   (unsigned int)strlen(block_name)+1, __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
         }
         strncpy(data->block_name, block_name, strlen(block_name) + 1);
@@ -12710,11 +12666,11 @@ static tng_function_status tng_gen_data_block_add
                             {
                                 free(second_dim_values[k]);
                             }
-                            second_dim_values[k] = malloc(len);
+                            second_dim_values[k] = (char *)malloc(len);
                             if(!second_dim_values[k])
                             {
-                                fprintf(stderr, "TNG library: Cannot allocate memory (%d bytes). %s: %d\n",
-                                    len, __FILE__, __LINE__);
+                                fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                                        __FILE__, __LINE__);
                                 return(TNG_CRITICAL);
                             }
                             strncpy(second_dim_values[k],
@@ -12737,11 +12693,11 @@ static tng_function_status tng_gen_data_block_add
                         {
                             free(second_dim_values[j]);
                         }
-                        second_dim_values[j] = malloc(len);
+                        second_dim_values[j] = (char *)malloc(len);
                         if(!second_dim_values[j])
                         {
-                            fprintf(stderr, "TNG library: Cannot allocate memory (%d bytes). %s: %d\n",
-                                len, __FILE__, __LINE__);
+                            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                                    __FILE__, __LINE__);
                             return(TNG_CRITICAL);
                         }
                         strncpy(second_dim_values[j],
@@ -13285,7 +13241,7 @@ static tng_function_status tng_frame_gen_data_write
     stat = tng_block_header_read(tng_data, block);
     if(stat == TNG_CRITICAL)
     {
-        fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                file_pos, __FILE__, __LINE__);
         tng_block_destroy(&block);
         tng_data->input_file = temp;
@@ -13348,7 +13304,7 @@ static tng_function_status tng_frame_gen_data_write
             }
             if(stat == TNG_CRITICAL)
             {
-                fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                        file_pos, __FILE__, __LINE__);
                 tng_block_destroy(&block);
                 tng_data->input_file = temp;
@@ -13391,7 +13347,7 @@ static tng_function_status tng_frame_gen_data_write
     }
     if(stat == TNG_CRITICAL)
     {
-        fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                file_pos, __FILE__, __LINE__);
         tng_block_destroy(&block);
         tng_data->input_file = temp;
@@ -13581,12 +13537,12 @@ static tng_function_status tng_frame_gen_data_write
         data.datatype == TNG_DOUBLE_DATA) &&
        tng_data->output_endianness_swap_func_64)
     {
-        copy = malloc(write_n_particles * n_values_per_frame * size);
+        copy = (char *)malloc(write_n_particles * n_values_per_frame * size);
         memcpy(copy, values, write_n_particles * n_values_per_frame * size);
         for(i = 0; i < write_n_particles * n_values_per_frame; i++)
         {
             if(tng_data->output_endianness_swap_func_64(tng_data,
-                (int64_t *) copy+i)
+                (uint64_t *) copy+i)
                 != TNG_SUCCESS)
             {
                 fprintf(stderr, "TNG library: Cannot swap byte order. %s: %d\n",
@@ -13600,12 +13556,12 @@ static tng_function_status tng_frame_gen_data_write
     else if(data.datatype == TNG_FLOAT_DATA &&
             tng_data->output_endianness_swap_func_32)
     {
-        copy = malloc(write_n_particles * n_values_per_frame * size);
+        copy = (char *)malloc(write_n_particles * n_values_per_frame * size);
         memcpy(copy, values, write_n_particles * n_values_per_frame * size);
         for(i = 0; i < write_n_particles * n_values_per_frame; i++)
         {
             if(tng_data->output_endianness_swap_func_32(tng_data,
-                (int32_t *) copy+i)
+                (uint32_t *) copy+i)
                 != TNG_SUCCESS)
             {
                 fprintf(stderr, "TNG library: Cannot swap byte order. %s: %d\n",
@@ -13712,25 +13668,23 @@ static tng_function_status tng_data_values_alloc
             return(stat);
         }
     }
-    *values = malloc(sizeof(union data_values *) * n_frames);
+    *values = (union data_values **)malloc(sizeof(union data_values *) * n_frames);
     if(!*values)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-               sizeof(union data_values **) * n_frames,
-               __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         return(TNG_CRITICAL);
 
     }
 
     for(i = 0; i < n_frames; i++)
     {
-        (*values)[i] = malloc(sizeof(union data_values) *
+        (*values)[i] = (union data_values *)malloc(sizeof(union data_values) *
                            n_values_per_frame);
         if(!(*values)[i])
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-                   sizeof(union data_values) * n_values_per_frame,
-                   __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             free(values);
             values = 0;
             return(TNG_CRITICAL);
@@ -13806,38 +13760,35 @@ static tng_function_status tng_particle_data_values_alloc
             return(stat);
         }
     }
-    *values = malloc(sizeof(union data_values **) * n_frames);
+    *values = (union data_values ***)malloc(sizeof(union data_values **) * n_frames);
     if(!*values)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-               sizeof(union data_values **) * n_frames,
-               __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         return(TNG_CRITICAL);
 
     }
 
     for(i = 0; i < n_frames; i++)
     {
-        (*values)[i] = malloc(sizeof(union data_values *) *
+        (*values)[i] = (union data_values **)malloc(sizeof(union data_values *) *
                            n_particles);
         if(!(*values)[i])
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-                   sizeof(union data_values *) * n_particles,
-                   __FILE__, __LINE__);
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                    __FILE__, __LINE__);
             free(*values);
             *values = 0;
             return(TNG_CRITICAL);
         }
         for(j = 0; j < n_particles; j++)
         {
-            (*values)[i][j] = malloc(sizeof(union data_values) *
+            (*values)[i][j] = (union data_values *)malloc(sizeof(union data_values) *
                                   n_values_per_frame);
             if(!(*values)[i][j])
             {
-                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-                    sizeof(union data_values *) * n_particles,
-                    __FILE__, __LINE__);
+                fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                        __FILE__, __LINE__);
                 tng_particle_data_values_free(tng_data, *values, n_frames,
                                               n_particles, n_values_per_frame,
                                               type);
@@ -13962,7 +13913,7 @@ static tng_function_status tng_gen_data_get
         tng_block_destroy(&block);
         if(stat == TNG_CRITICAL)
         {
-            fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                     file_pos, __FILE__, __LINE__);
             return(stat);
         }
@@ -14043,7 +13994,7 @@ static tng_function_status tng_gen_data_get
                     for(k = 0; k < *n_values_per_frame; k++)
                     {
                         len = strlen(data->strings[i][j][k]) + 1;
-                        (*values)[i][mapping][k].c = malloc(len);
+                        (*values)[i][mapping][k].c = (char *)malloc(len);
                         strncpy((*values)[i][mapping][k].c,
                                 data->strings[i][j][k], len);
                     }
@@ -14122,7 +14073,7 @@ static tng_function_status tng_gen_data_get
                 for(j = 0; j < *n_values_per_frame; j++)
                 {
                     len = strlen(data->strings[0][i][j]) + 1;
-                    (*values)[0][i][j].c = malloc(len);
+                    (*values)[0][i][j].c = (char *)malloc(len);
                     strncpy((*values)[0][i][j].c, data->strings[0][i][j], len);
                 }
             }
@@ -14246,7 +14197,7 @@ static tng_function_status tng_gen_data_vector_get
         tng_block_destroy(&block);
         if(stat == TNG_CRITICAL)
         {
-            fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                     file_pos, __FILE__, __LINE__);
             return(stat);
         }
@@ -14320,11 +14271,11 @@ static tng_function_status tng_gen_data_vector_get
         full_data_len *= (*n_particles);
     }
 
-    temp = realloc(*values, full_data_len);
+    temp = (char *)realloc(*values, full_data_len);
     if(!temp)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
-               full_data_len, __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         free(*values);
         *values = 0;
         return(TNG_CRITICAL);
@@ -14442,7 +14393,7 @@ static tng_function_status tng_gen_data_interval_get
         tng_block_destroy(&block);
         if(stat == TNG_CRITICAL)
         {
-            fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                     file_pos, __FILE__, __LINE__);
             return(stat);
         }
@@ -14478,7 +14429,7 @@ static tng_function_status tng_gen_data_interval_get
 
     if(block_index < 0)
     {
-        fprintf(stderr, "TNG library: Could not find particle data block with id %"PRId64". %s: %d\n",
+        fprintf(stderr, "TNG library: Could not find particle data block with id %" PRId64 ". %s: %d\n",
                 block_id, __FILE__, __LINE__);
         return(TNG_FAILURE);
     }
@@ -14557,7 +14508,7 @@ static tng_function_status tng_gen_data_interval_get
                     for(k = 0; k < *n_values_per_frame; k++)
                     {
                         len = strlen(data->strings[current_frame_pos][j][k]) + 1;
-                        (*values)[i][mapping][k].c = malloc(len);
+                        (*values)[i][mapping][k].c = (char *)malloc(len);
                         strncpy((*values)[i][mapping][k].c, data->strings[current_frame_pos][j][k], len);
                     }
                 }
@@ -14567,7 +14518,7 @@ static tng_function_status tng_gen_data_interval_get
                 for(j = 0; j < *n_values_per_frame; j++)
                 {
                     len = strlen(data->strings[0][current_frame_pos][j]) + 1;
-                    (*values)[0][i][j].c = malloc(len);
+                    (*values)[0][i][j].c = (char *)malloc(len);
                     strncpy((*values)[0][i][j].c, data->strings[0][current_frame_pos][j], len);
                 }
             }
@@ -14816,7 +14767,7 @@ static tng_function_status tng_gen_data_vector_interval_get
         tng_block_destroy(&block);
         if(stat == TNG_CRITICAL)
         {
-            fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                     file_pos, __FILE__, __LINE__);
             return(stat);
         }
@@ -14881,11 +14832,11 @@ static tng_function_status tng_gen_data_vector_interval_get
         full_data_len *= (*n_particles);
     }
 
-    temp = realloc(*values, full_data_len);
+    temp = (char *)realloc(*values, full_data_len);
     if(!temp)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
-               full_data_len, __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         free(*values);
         *values = 0;
         return(TNG_CRITICAL);
@@ -15285,6 +15236,9 @@ tng_function_status DECLSPECDLLEXPORT tng_util_trajectory_open
         tng_output_append_file_set(*tng_data_p, filename);
 
         fseeko((*tng_data_p)->output_file, 0, SEEK_END);
+
+        (*tng_data_p)->output_endianness_swap_func_32 = (*tng_data_p)->input_endianness_swap_func_32;
+        (*tng_data_p)->output_endianness_swap_func_64 = (*tng_data_p)->input_endianness_swap_func_64;
     }
 
     return(stat);
@@ -15333,7 +15287,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_time_of_frame_get
     stat = tng_frame_set_of_frame_find(tng_data, frame_nr);
     if(stat != TNG_SUCCESS)
     {
-        fprintf(stderr, "TNG library: Cannot find frame nr %"PRId64". %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot find frame nr %" PRId64 ". %s: %d\n",
                frame_nr, __FILE__, __LINE__);
         return(stat);
     }
@@ -15421,25 +15375,25 @@ tng_function_status DECLSPECDLLEXPORT tng_util_molecule_particles_get
 
     *n_particles = mol->n_atoms;
 
-    *names = malloc(sizeof(char *) * *n_particles);
-    *types = malloc(sizeof(char *) * *n_particles);
-    *res_names = malloc(sizeof(char *) * *n_particles);
-    *chain_names = malloc(sizeof(char *) * *n_particles);
-    *res_ids = malloc(sizeof(int64_t) * *n_particles);
-    *chain_ids = malloc(sizeof(int64_t) * *n_particles);
+    *names = (char **)malloc(sizeof(char *) * *n_particles);
+    *types = (char **)malloc(sizeof(char *) * *n_particles);
+    *res_names = (char **)malloc(sizeof(char *) * *n_particles);
+    *chain_names = (char **)malloc(sizeof(char *) * *n_particles);
+    *res_ids = (int64_t *)malloc(sizeof(int64_t) * *n_particles);
+    *chain_ids = (int64_t *)malloc(sizeof(int64_t) * *n_particles);
 
     for(i = 0; i < *n_particles; i++)
     {
         atom = &mol->atoms[i];
         res = atom->residue;
         chain = res->chain;
-        (*names)[i] = malloc(strlen(atom->name));
+        (*names)[i] = (char *)malloc(strlen(atom->name));
         strcpy(*names[i], atom->name);
-        (*types)[i] = malloc(strlen(atom->atom_type));
+        (*types)[i] = (char *)malloc(strlen(atom->atom_type));
         strcpy(*types[i], atom->atom_type);
-        (*res_names)[i] = malloc(strlen(res->name));
+        (*res_names)[i] = (char *)malloc(strlen(res->name));
         strcpy(*res_names[i], res->name);
-        (*chain_names)[i] = malloc(strlen(chain->name));
+        (*chain_names)[i] = (char *)malloc(strlen(chain->name));
         strcpy(*chain_names[i], chain->name);
         (*res_ids)[i] = res->id;
         (*chain_ids)[i] = chain->id;
@@ -15530,6 +15484,11 @@ tng_function_status DECLSPECDLLEXPORT tng_util_pos_read
                                                  &n_values_per_frame,
                                                  &type);
 
+    if(stat == TNG_SUCCESS && type != TNG_FLOAT_DATA)
+    {
+        return(TNG_FAILURE);
+    }
+
     return(stat);
 }
 
@@ -15559,6 +15518,11 @@ tng_function_status DECLSPECDLLEXPORT tng_util_vel_read
                                                  &n_values_per_frame,
                                                  &type);
 
+    if(stat == TNG_SUCCESS && type != TNG_FLOAT_DATA)
+    {
+        return(TNG_FAILURE);
+    }
+
     return(stat);
 }
 
@@ -15588,6 +15552,11 @@ tng_function_status DECLSPECDLLEXPORT tng_util_force_read
                                                  &n_values_per_frame,
                                                  &type);
 
+    if(stat == TNG_SUCCESS && type != TNG_FLOAT_DATA)
+    {
+        return(TNG_FAILURE);
+    }
+
     return(stat);
 }
 
@@ -15617,6 +15586,11 @@ tng_function_status DECLSPECDLLEXPORT tng_util_box_shape_read
                                         &n_values_per_frame,
                                         &type);
 
+    if(stat == TNG_SUCCESS && type != TNG_FLOAT_DATA)
+    {
+        return(TNG_FAILURE);
+    }
+
     return(stat);
 }
 
@@ -15764,14 +15738,14 @@ tng_function_status DECLSPECDLLEXPORT tng_util_particle_data_next_frame_read
 
     full_data_len = size * n_particles * data->n_values_per_frame;
 
-//     fprintf(stderr, "TNG library: TEMP: i = %"PRId64", full_data_len = %"PRId64", size = %d, n_particles = %"PRId64", n_values_per_frame = %"PRId64"\n",
+//     fprintf(stderr, "TNG library: TEMP: i = %" PRId64 ", full_data_len = %" PRId64 ", size = %d, n_particles = %" PRId64 ", n_values_per_frame = %" PRId64 "\n",
 //            i, full_data_len, size, n_particles, data->n_values_per_frame);
 
-    temp = realloc(*values, full_data_len);
+    temp = (char *)realloc(*values, full_data_len);
     if(!temp)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
-               full_data_len, __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         free(*values);
         *values = 0;
         return(TNG_CRITICAL);
@@ -15926,11 +15900,11 @@ tng_function_status DECLSPECDLLEXPORT tng_util_non_particle_data_next_frame_read
 
     full_data_len = size * data->n_values_per_frame;
 
-    temp = realloc(*values, full_data_len);
+    temp = (char *)realloc(*values, full_data_len);
     if(!temp)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
-               full_data_len, __FILE__, __LINE__);
+        fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                __FILE__, __LINE__);
         free(*values);
         *values = 0;
         return(TNG_CRITICAL);
@@ -16093,7 +16067,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_generic_write_interval_set
 
     if(i <= 0)
     {
-        fprintf(stderr, "TNG library: Cannot set writing frequency to %"PRId64". %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot set writing frequency to %" PRId64 ". %s: %d\n",
                i, __FILE__, __LINE__);
         return(TNG_FAILURE);
     }
@@ -16234,7 +16208,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_generic_write_interval_double_set
 
     if(i <= 0)
     {
-        fprintf(stderr, "TNG library: Cannot set writing frequency to %"PRId64". %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot set writing frequency to %" PRId64 ". %s: %d\n",
                i, __FILE__, __LINE__);
         return(TNG_FAILURE);
     }
@@ -17468,11 +17442,10 @@ tng_function_status DECLSPECDLLEXPORT tng_util_trajectory_next_frame_present_dat
     {
         TNG_ASSERT(requested_data_block_ids, "TNG library: If the number of requested data blocks is > 0 then the array of data block IDs must not be NULL.");
         size = sizeof(int64_t) * n_requested_data_block_ids;
-        temp = realloc(*data_block_ids_in_next_frame, size);
+        temp = (int64_t *)realloc(*data_block_ids_in_next_frame, size);
         if(!temp)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-                    sizeof(int64_t) * (*n_data_blocks_in_next_frame),
+            fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
                     __FILE__, __LINE__);
             free(*data_block_ids_in_next_frame);
             *data_block_ids_in_next_frame = 0;
@@ -17532,7 +17505,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_trajectory_next_frame_present_dat
             tng_block_destroy(&block);
             if(stat == TNG_CRITICAL)
             {
-                fprintf(stderr, "TNG library: Cannot read block header at pos %"PRId64". %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot read block header at pos %" PRId64 ". %s: %d\n",
                         file_pos, __FILE__, __LINE__);
                 return(stat);
             }
@@ -17610,12 +17583,11 @@ tng_function_status DECLSPECDLLEXPORT tng_util_trajectory_next_frame_present_dat
             if(n_requested_data_block_ids <= 0)
             {
                 size = sizeof(int64_t) * (*n_data_blocks_in_next_frame);
-                temp = realloc(*data_block_ids_in_next_frame, size);
+                temp = (int64_t *)realloc(*data_block_ids_in_next_frame, size);
                 if(!temp)
                 {
-                    fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-                           sizeof(int64_t) * (*n_data_blocks_in_next_frame),
-                           __FILE__, __LINE__);
+                    fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                            __FILE__, __LINE__);
                     free(*data_block_ids_in_next_frame);
                     *data_block_ids_in_next_frame = 0;
                     return(TNG_CRITICAL);
@@ -17697,12 +17669,11 @@ tng_function_status DECLSPECDLLEXPORT tng_util_trajectory_next_frame_present_dat
             if(n_requested_data_block_ids <= 0)
             {
                 size = sizeof(int64_t) * (*n_data_blocks_in_next_frame);
-                temp = realloc(*data_block_ids_in_next_frame, size);
+                temp = (int64_t *)realloc(*data_block_ids_in_next_frame, size);
                 if(!temp)
                 {
-                    fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
-                           sizeof(int64_t) * (*n_data_blocks_in_next_frame),
-                           __FILE__, __LINE__);
+                    fprintf(stderr, "TNG library: Cannot allocate memory. %s: %d\n",
+                            __FILE__, __LINE__);
                     free(*data_block_ids_in_next_frame);
                     *data_block_ids_in_next_frame = 0;
                     return(TNG_CRITICAL);
index d53d15b07b043b8cfddb753003e22f75a1edaeca..70a6232a835846defb5e5055e889ba0ce3d811f4 100644 (file)
@@ -9,7 +9,7 @@
  * modify it under the terms of the Revised BSD License.
  */
 
-#include "../../include/tng_io.h"
+#include "tng/tng_io.h"
 
 /* The following is for calling the library from fortran */
 
index f465b6b7c00b607d8a2b226660f72e6e9328ab5a..480c6a390dd6f0056dc798cd2d21a76e7a82bf5d 100644 (file)
@@ -2,8 +2,6 @@ if(TNG_BUILD_COMPRESSION_TESTS)
   add_subdirectory(compression)
 endif()
 
-link_directories(${TNG_IO_BINARY_DIR}/src/lib)
-
 add_definitions(-DTNG_EXAMPLE_FILES_DIR="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/tests/example_files/") # Directory where to find input test files and save output files.
 
 if(TNG_BUILD_TEST)
@@ -80,7 +78,7 @@ if(TNG_BUILD_EXAMPLES)
         if(${CMAKE_Fortran_COMPILER_WORKS})
             get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)
             if (Fortran_COMPILER_NAME STREQUAL "gfortran")
-                set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fcray-pointer ${OpenMP_C_FLAGS} -std=legacy")
+                set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fcray-pointer ${OpenMP_C_FLAGS} -std=legacy -cpp -ffixed-line-length-none")
             endif()
             if(OPENMP_FOUND)
                 add_executable(md_openmp_f md_openmp.f)
index 87b00b8597644ec35ad71c7e4ebc3254905b8fc7..6399ae25d4e7a311899ded67484e5abc2eb771fa 100644 (file)
@@ -10,7 +10,7 @@ c    The program implements a simple molecular dynamics simulation.
 c
 c    The program uses Open MP directives to allow parallel computation.
 c
-c    The velocity Verlet time integration scheme is used. 
+c    The velocity Verlet time integration scheme is used.
 c
 c    The particles interact with a central pair potential.
 c
@@ -19,7 +19,7 @@ c    code is included in the TNG API release.
 c
 c  Licensing:
 c
-c    This code is distributed under the GNU LGPL license. 
+c    This code is distributed under the GNU LGPL license.
 c
 c  Modified:
 c
@@ -142,26 +142,26 @@ c
       write ( *, '(a)' ) ' '
       write ( *, '(a)' ) '  A molecular dynamics program.'
       write ( *, '(a)' ) ' '
-      write ( *, '(a,i8)' ) 
+      write ( *, '(a,i8)' )
      &  '  NP, the number of particles in the simulation is ', np
-      write ( *, '(a,i8)' ) 
+      write ( *, '(a,i8)' )
      &  '  STEP_NUM, the number of time steps, is ', step_num
-      write ( *, '(a,g14.6)' ) 
+      write ( *, '(a,g14.6)' )
      &  '  DT, the size of each time step, is ', dt
       write ( *, '(a)' ) ' '
-      write ( *, '(a,i8)' ) 
+      write ( *, '(a,i8)' )
      &  '  The number of processors = ', omp_get_num_procs ( )
-      write ( *, '(a,i8)' ) 
+      write ( *, '(a,i8)' )
      &  '  The number of threads    = ', omp_get_max_threads ( )
 
-      write ( *, '(a)' ) ' '     
+      write ( *, '(a)' ) ' '
       write ( *, '(a)' ) '  Initializing trajectory storage.'
       call tng_trajectory_init(traj_p)
 
 c
 c  N.B. The TNG output file should be modified according to needs
-c      
-      call tng_output_file_set(traj, TNG_EXAMPLE_FILES_DIR "tng_md_out_f77.tng")
+c
+      call tng_output_file_set(traj, TNG_EXAMPLE_FILES_DIR"tng_md_out_f77.tng")
 
       write ( *, '(a)' ) '  Creating molecules in trajectory.'
       tng_n_particles = np
@@ -183,20 +183,20 @@ c
 
 c
 c  Add the box shape data block
-c     
+c
       call tng_data_block_add(traj, TNG_TRAJ_BOX_SHAPE, "BOX SHAPE",
      &  TNG_DOUBLE_DATA, TNG_NON_TRAJECTORY_BLOCK, int(1, 8),
      &  int(9, 8), int(1, 8), TNG_UNCOMPRESSED, box_shape)
 
 c
 c  Write the file headers
-c    
+c
       call tng_file_headers_write(traj, TNG_USE_HASH)
-      
+
 c
 c  Set initial positions, velocities, and accelerations.
-c      
-      write ( *, '(a)' ) 
+c
+      write ( *, '(a)' )
      &  '  Initializing positions, velocities, and accelerations.'
       seed = 123456789
       call initialize ( np, nd, box, seed, pos, vel, acc )
@@ -206,7 +206,7 @@ c
       write ( *, '(a)' ) ' '
       write ( *, '(a)' ) '  Computing initial forces and energies.'
 
-      call compute ( np, nd, pos, vel, mass, force, potential, 
+      call compute ( np, nd, pos, vel, mass, force, potential,
      &  kinetic )
 
       e0 = potential + kinetic
@@ -215,7 +215,7 @@ c
 c  Saving frequency
 c
       step_save = 5
-      
+
       step_print = 0
       step_print_index = 0
       step_print_num = 10
@@ -230,29 +230,29 @@ c
      &  ' steps particle positions, velocities and forces are'
       write ( *, '(a)' ) '  saved to a TNG trajectory file.'
       write ( *, '(a)' )
-      write ( *, '(a)' ) 
+      write ( *, '(a)' )
      &  '  At each step, we report the potential and kinetic energies.'
-      write ( *, '(a)' ) 
+      write ( *, '(a)' )
      &  '  The sum of these energies should be a constant.'
-      write ( *, '(a)' ) 
+      write ( *, '(a)' )
      &  '  As an accuracy check, we also print the relative error'
       write ( *, '(a)' ) '  in the total energy.'
       write ( *, '(a)' ) ' '
-      write ( *, '(a)' ) 
+      write ( *, '(a)' )
      &  '      Step      Potential       Kinetic        (P+K-E0)/E0'
-      write ( *, '(a)' ) 
+      write ( *, '(a)' )
      &  '                Energy P        Energy K       ' //
      &  'Relative Energy Error'
       write ( *, '(a)' ) ' '
 
       step = 0
-      write ( *, '(2x,i8,2x,g14.6,2x,g14.6,2x,g14.6)' ) 
+      write ( *, '(2x,i8,2x,g14.6,2x,g14.6,2x,g14.6)' )
      &  step, potential, kinetic, ( potential + kinetic - e0 ) / e0
       step_print_index = step_print_index + 1
       step_print = ( step_print_index * step_num ) / step_print_num
 
-c      
-c  Create a frame set for writing data      
+c
+c  Create a frame set for writing data
 c
       call tng_num_frames_per_frame_set_get(traj,
      &  n_frames_per_frame_set)
@@ -265,12 +265,12 @@ c
      &  "POSITIONS", TNG_DOUBLE_DATA, TNG_TRAJECTORY_BLOCK,
      &  n_frames_per_frame_set, int(3, 8), int(1, 8), int(0, 8),
      &  tng_n_particles, TNG_UNCOMPRESSED, %VAL(int(0, 8)))
-      
+
       call tng_particle_data_block_add(traj, TNG_TRAJ_VELOCITIES,
      &  "VELOCITIES", TNG_DOUBLE_DATA, TNG_TRAJECTORY_BLOCK,
      &  n_frames_per_frame_set, int(3, 8), int(1, 8), int(0, 8),
      &  tng_n_particles, TNG_UNCOMPRESSED, %VAL(int(0, 8)))
-      
+
       call tng_particle_data_block_add(traj, TNG_TRAJ_FORCES,
      &  "FORCES", TNG_DOUBLE_DATA, TNG_TRAJECTORY_BLOCK,
      &  n_frames_per_frame_set, int(3, 8), int(1, 8), int(0, 8),
@@ -278,28 +278,28 @@ c
 
 c
 c  The potential energy data block is saved sparsely.
-c     
+c
       call tng_data_block_add(traj, int(10101, 8),
      &  "POTENTIAL ENERGY", TNG_DOUBLE_DATA, TNG_TRAJECTORY_BLOCK,
      &  n_frames_per_frame_set, int(1, 8), sparse_save,
      &  TNG_UNCOMPRESSED, %VAL(int(0, 8)))
-     
+
 
 c
 c  Write the frame set to disk
 c
       call tng_frame_set_write(traj, TNG_USE_HASH)
-      
+
       wtime = omp_get_wtime ( )
 
       do step = 1, step_num
 
-        call compute ( np, nd, pos, vel, mass, force, potential, 
+        call compute ( np, nd, pos, vel, mass, force, potential,
      &    kinetic )
 
         if ( step .eq. step_print ) then
 
-          write ( *, '(2x,i8,2x,g14.6,2x,g14.6,2x,g14.6)' ) 
+          write ( *, '(2x,i8,2x,g14.6,2x,g14.6,2x,g14.6)' )
      &      step, potential, kinetic, ( potential + kinetic - e0 ) / e0
 
           step_print_index = step_print_index + 1
@@ -321,12 +321,12 @@ c
      &    TNG_TRAJ_FORCES, int(0, 8), tng_n_particles, force,
      &    TNG_USE_HASH)
           frames_saved_cnt = frames_saved_cnt + 1
-          
+
           if (mod(step, step_save * sparse_save) .EQ. 0) then
             call tng_frame_data_write(traj, frames_saved_cnt,
      &      int(10101, 8), potential, TNG_USE_HASH)
           end if
-          
+
         end if
 
         call update ( np, nd, pos, vel, force, acc, mass, dt )
@@ -336,7 +336,7 @@ c
       wtime = omp_get_wtime ( ) - wtime
 
       write ( *, '(a)' ) ' '
-      write ( *, '(a)' ) 
+      write ( *, '(a)' )
      &  '  Elapsed time for main computation:'
       write ( *, '(2x,g14.6,a)' ) wtime, ' seconds'
 c
@@ -365,7 +365,7 @@ c    The computation of forces and energies is fully parallel.
 c
 c  Licensing:
 c
-c    This code is distributed under the GNU LGPL license. 
+c    This code is distributed under the GNU LGPL license.
 c
 c  Modified:
 c
@@ -413,9 +413,9 @@ c
       pot = 0.0D+00
       kin = 0.0D+00
 
-c$omp parallel 
-c$omp& shared ( f, nd, np, pos, vel ) 
-c$omp& private ( d, d2, i, j, k, rij ) 
+c$omp parallel
+c$omp& shared ( f, nd, np, pos, vel )
+c$omp& private ( d, d2, i, j, k, rij )
 
 c$omp do reduction ( + : pot, kin )
       do i = 1, np
@@ -458,7 +458,7 @@ c$omp end do
 c$omp end parallel
 
       kin = kin * 0.5D+00 * mass
-      
+
       return
       end
       subroutine dist ( nd, r1, r2, dr, d )
@@ -469,7 +469,7 @@ cc DIST computes the displacement (and its norm) between two particles.
 c
 c  Licensing:
 c
-c    This code is distributed under the GNU LGPL license. 
+c    This code is distributed under the GNU LGPL license.
 c
 c  Modified:
 c
@@ -520,7 +520,7 @@ cc INITIALIZE initializes the positions, velocities, and accelerations.
 c
 c  Licensing:
 c
-c    This code is distributed under the GNU LGPL license. 
+c    This code is distributed under the GNU LGPL license.
 c
 c  Modified:
 c
@@ -570,7 +570,7 @@ c
         end do
       end do
 
-c$omp parallel 
+c$omp parallel
 c$omp& shared ( acc, box, nd, np, pos, vel )
 c$omp& private ( i, j )
 
@@ -615,7 +615,7 @@ c    1790989824  2035175616  0.947702
 c
 c  Licensing:
 c
-c    This code is distributed under the GNU LGPL license. 
+c    This code is distributed under the GNU LGPL license.
 c
 c  Modified:
 c
@@ -693,7 +693,7 @@ cc TIMESTAMP prints out the current YMDHMS date as a timestamp.
 c
 c  Licensing:
 c
-c    This code is distributed under the GNU LGPL license. 
+c    This code is distributed under the GNU LGPL license.
 c
 c  Modified:
 c
@@ -724,8 +724,8 @@ c
       save month
 
       data month /
-     &  'January  ', 'February ', 'March    ', 'April    ', 
-     &  'May      ', 'June     ', 'July     ', 'August   ', 
+     &  'January  ', 'February ', 'March    ', 'April    ',
+     &  'May      ', 'June     ', 'July     ', 'August   ',
      &  'September', 'October  ', 'November ', 'December ' /
 
       call date_and_time ( date, time )
@@ -754,8 +754,8 @@ c
         end if
       end if
 
-      write ( *, 
-     &  '(i2,1x,a,1x,i4,2x,i2,a1,i2.2,a1,i2.2,a1,i3.3,1x,a)' ) 
+      write ( *,
+     &  '(i2,1x,a,1x,i4,2x,i2,a1,i2.2,a1,i2.2,a1,i3.3,1x,a)' )
      &  d, month(m), y, h, ':', n, ':', s, '.', mm, ampm
 
       return
@@ -772,7 +772,7 @@ c    The time integration is fully parallel.
 c
 c  Licensing:
 c
-c    This code is distributed under the GNU LGPL license. 
+c    This code is distributed under the GNU LGPL license.
 c
 c  Modified:
 c
@@ -815,7 +815,7 @@ c
 
       rmass = 1.0D+00 / mass
 
-c$omp parallel 
+c$omp parallel
 c$omp& shared ( acc, dt, f, nd, np, pos, rmass, vel )
 c$omp& private ( i, j )
 
@@ -823,10 +823,10 @@ c$omp do
       do j = 1, np
         do i = 1, nd
 
-          pos(i,j) = pos(i,j) 
+          pos(i,j) = pos(i,j)
      &      + vel(i,j) * dt + 0.5D+00 * acc(i,j) * dt * dt
 
-          vel(i,j) = vel(i,j) 
+          vel(i,j) = vel(i,j)
      &      + 0.5D+00 * dt * ( f(i,j) * rmass + acc(i,j) )
 
           acc(i,j) = f(i,j) * rmass
index 28f8f4777eb78c9df311e91d44c47c0f1af924eb..70d2e5a6c57966cfd77f16df9b1ce581a26f8d1b 100644 (file)
@@ -452,14 +452,17 @@ static tng_function_status tng_test_write_and_read_traj(tng_trajectory_t *traj,
                                                         const char hash_mode)
 {
     int i, j, k, nr, cnt, dependency;
-    float *data, *molpos, *charges;
-    int64_t mapping[300], n_particles, n_frames_per_frame_set, tot_n_mols;
+    float *data, *molpos, *charges, *masses;
+    int64_t mapping[300], n_particles;
+    int64_t read_n_frames, read_stride_length, read_n_particles, read_n_values_per_frame;
+    int64_t n_frames_per_frame_set, tot_n_mols;
     int64_t codec_id;
     int64_t dist_exp = -9, temp_int, temp_int2;
 //     int64_t frame_nr;
     double box_shape[9], temp_double;
     char atom_type[16], annotation[128];
     char temp_str[TNG_MAX_STR_LEN];
+    char read_data_type;
     tng_trajectory_frame_set_t frame_set;
     tng_function_status stat = TNG_SUCCESS;
 
@@ -498,7 +501,7 @@ static tng_function_status tng_test_write_and_read_traj(tng_trajectory_t *traj,
         exit(1);
     }
 
-    /* Set partial charges (treat the water as TIP3P. */
+    /* Set partial charges (treat the water as TIP3P). */
     tng_num_particles_get(*traj, &n_particles);
     charges = malloc(sizeof(float) * n_particles);
     for(i = 0; i < n_particles; i++)
@@ -509,13 +512,21 @@ static tng_function_status tng_test_write_and_read_traj(tng_trajectory_t *traj,
         {
             break;
         }
-        if(atom_type[0] == 'O')
+        /* We only have water in the system. If the atom is oxygen set its
+         * partial charge to -0.834, if it's a hydrogen set its partial charge to
+         * 0.417. */
+        switch(atom_type[0])
         {
-            charges[i] = -0.834;
-        }
-        else if(atom_type[0] == 'H')
-        {
-            charges[i] = 0.417;
+            case 'O':
+                charges[i] = -0.834;
+                break;
+            case 'H':
+                charges[i] = 0.417;
+                break;
+            default:
+                printf("Failed setting partial charges. %s: %d\n",
+                       __FILE__, __LINE__);
+                return(TNG_CRITICAL);
         }
     }
     if(stat == TNG_CRITICAL)
@@ -531,6 +542,7 @@ static tng_function_status tng_test_write_and_read_traj(tng_trajectory_t *traj,
                                        1, 1, 1, 0, n_particles,
                                        TNG_UNCOMPRESSED, charges);
     free(charges);
+    charges = 0;
     if(stat != TNG_SUCCESS)
     {
         printf("Failed adding partial charges. %s: %d\n",
@@ -538,6 +550,53 @@ static tng_function_status tng_test_write_and_read_traj(tng_trajectory_t *traj,
         return(TNG_CRITICAL);
     }
 
+    /* Set atom masses. */
+    masses = malloc(sizeof(float) * n_particles);
+    for(i = 0; i < n_particles; i++)
+    {
+        stat = tng_atom_type_of_particle_nr_get(*traj, i, atom_type,
+                                                sizeof(atom_type));
+        if(stat == TNG_CRITICAL)
+        {
+            break;
+        }
+        /* We only have water in the system. If the atom is oxygen set its
+         * mass to 16.00000, if it's a hydrogen set its mass to
+         * 1.00800. */
+        switch(atom_type[0])
+        {
+            case 'O':
+                masses[i] = 16.00000;
+                break;
+            case 'H':
+                masses[i] = 1.00800;
+                break;
+            default:
+                printf("Failed setting atom masses. %s: %d\n",
+                       __FILE__, __LINE__);
+                return(TNG_CRITICAL);
+        }
+    }
+    if(stat == TNG_CRITICAL)
+    {
+        free(masses);
+        printf("Failed setting atom masses. %s: %d\n",
+               __FILE__, __LINE__);
+        return(TNG_CRITICAL);
+    }
+
+    stat = tng_particle_data_block_add(*traj, TNG_TRAJ_MASSES, "ATOM MASSES",
+                                       TNG_FLOAT_DATA, TNG_NON_TRAJECTORY_BLOCK,
+                                       1, 1, 1, 0, n_particles,
+                                       TNG_GZIP_COMPRESSION, masses);
+    free(masses);
+    masses = 0;
+    if(stat != TNG_SUCCESS)
+    {
+        printf("Failed adding atom masses. %s: %d\n",
+               __FILE__, __LINE__);
+        return(TNG_CRITICAL);
+    }
 
     /* Generate a custom annotation data block */
     strcpy(annotation, "This trajectory was generated from tng_io_testing. "
@@ -784,6 +843,33 @@ static tng_function_status tng_test_write_and_read_traj(tng_trajectory_t *traj,
         return(stat);
     }
 
+    stat = tng_particle_data_vector_get(*traj, TNG_TRAJ_MASSES, (void **)&masses, &read_n_frames,
+                                        &read_stride_length, &read_n_particles,
+                                        &read_n_values_per_frame, &read_data_type);
+    if(stat != TNG_SUCCESS)
+    {
+        free(masses);
+        return(stat);
+    }
+    if(read_n_particles != n_particles)
+    {
+        printf("Number of particles does not match when reading atom masses. %s: %d\n",
+               __FILE__, __LINE__);
+        return(TNG_FAILURE);
+    }
+
+    /* Above we have written only water molecules (in the order oxygen, hydrogen, hydrogen ...).
+     * Test that the first and second as well as the very last atoms (oxygen, hydrogen and hydrogen)
+     * have the correct atom masses. */
+    if(fabs(masses[0] - 16.00000) > 0.0001 || fabs(masses[1] - 1.00800) > 0.0001 ||
+       fabs(masses[read_n_particles-1] - 1.00800) > 0.0001)
+    {
+        printf("Atom masses do not match when reading written file. %s: %d\n",
+               __FILE__, __LINE__);
+        return(TNG_FAILURE);
+    }
+    free(masses);
+    
     i = 0;
     while(stat == TNG_SUCCESS)
     {
@@ -1134,7 +1220,6 @@ tng_function_status tng_test_utility_functions(tng_trajectory_t traj, const char
                __FILE__, __LINE__);
         return(TNG_FAILURE);
     }
-
     stat = tng_util_trajectory_close(&traj);
     if(stat != TNG_SUCCESS)
     {
@@ -1276,7 +1361,7 @@ tng_function_status tng_test_copy_container(tng_trajectory_t traj, const char ha
 
 int main()
 {
-    tng_trajectory_t traj;
+    tng_trajectory_t traj = 0;
     char time_str[TNG_MAX_DATE_STR_LEN];
     char version_str[TNG_MAX_STR_LEN];
     char hash_mode = TNG_USE_HASH;
diff --git a/src/external/tng_io/src/tests/using/CMakeLists.txt b/src/external/tng_io/src/tests/using/CMakeLists.txt
new file mode 100644 (file)
index 0000000..35dcfcf
--- /dev/null
@@ -0,0 +1,96 @@
+# Test project to test building with libtng_io
+#
+# Combinations to test for full coverage:
+#   TEST_ZLIB=ON (22 combinations)
+#     ZLIB_LIBRARY=shared/static
+#     TEST_BUNDLING=ON (4 combinations)
+#       BUILD_SHARED_LIBS=ON/OFF
+#       TEST_EXECUTABLE=ON/OFF
+#     TEST_BUNDLING=OFF (7 combinations)
+#       TEST_EXECUTABLE=ON
+#         TNG_IO_DIR=sh.sh/st.sh/st.st
+#       TEST_EXECUTABLE=OFF
+#         BUILD_SHARED_LIBS=ON
+#           TNG_IO_DIR=sh.sh/st.sh/st.st
+#         BUILD_SHARED_LIBS=OFF
+#           TNG_IO_DIR=sh.sh
+#   TEST_ZLIB=OFF (27 combinations)
+#     TEST_BUNDLING=ON (12 combinations)
+#       ZLIB_LIBRARY=shared/static/none
+#       BUILD_SHARED_LIBS=ON/OFF
+#       TEST_EXECUTABLE=ON/OFF
+#     TEST_BUNDLING=OFF (15 combinations)
+#       TEST_EXECUTABLE=ON
+#         TNG_IO_DIR=sh.sh/sh.st/sh.int/st.sh/st.st/st.int
+#       TEST_EXECUTABLE=OFF
+#         BUILD_SHARED_LIBS=ON
+#           TNG_IO_DIR=sh.sh/sh.st/sh.int/st.sh/st.st/st.int
+#         BUILD_SHARED_LIBS=OFF
+#           TNG_IO_DIR=sh.sh/sh.st/sh.int
+#
+# Combinations that cannot work:
+#   TEST_ZLIB=ON, tng built with internal zlib
+#   TEST_ZLIB=ON, tng built with BUILD_SHARED_LIBS=ON + static zlib
+#   BUILD_SHARED_LIBS=ON, tng built as static (unless compiled with PIC)
+
+cmake_minimum_required(VERSION 3.1)
+
+project(tng_io_test)
+
+option(BUILD_SHARED_LIBS "Test building a shared library" ON)
+option(TEST_EXECUTABLE "Test building an executable instead of a library" OFF)
+option(TEST_BUNDLING "Test bundling tng" OFF)
+option(TEST_ZLIB "Test with zlib in using code" OFF)
+option(TEST_BUNDLED_ZLIB "Test bundling zlib with tng" OFF)
+if (NOT TEST_BUNDLING)
+    set(TEST_BUNDLED_ZLIB OFF)
+endif()
+
+if (TEST_ZLIB OR NOT TEST_BUNDLED_ZLIB)
+    find_package(ZLIB REQUIRED)
+endif()
+
+if (TEST_BUNDLING)
+    include(../../../BuildTNG.cmake)
+    if (TEST_BUNDLED_ZLIB)
+        message(STATUS "Bundling tng_io with internal ZLIB")
+        add_tng_io_library(tng_io OBJECT OWN_ZLIB)
+    else()
+        message(STATUS "Bundling tng_io with external ZLIB")
+        add_tng_io_library(tng_io OBJECT)
+    endif()
+    add_library(tng_io::tng_io ALIAS tng_io)
+else()
+    message(STATUS "Using external tng_io")
+    find_package(TNG_IO REQUIRED)
+endif()
+
+set(SOURCES use_tng.c)
+if (TEST_ZLIB)
+    message(STATUS "Using zlib in test application")
+    list(APPEND SOURCES use_zlib.c)
+else()
+    message(STATUS "Not using zlib in test application")
+    list(APPEND SOURCES dummy_zlib.c)
+endif()
+
+if (TEST_EXECUTABLE)
+    message(STATUS "Building an executable linked against tng_io")
+    add_executable(test_target main.c ${SOURCES})
+else()
+    message(STATUS "Building a library linked against tng_io")
+    add_library(test_target ${SOURCES})
+    install(TARGETS test_target EXPORT test DESTINATION lib)
+    install(EXPORT test DESTINATION lib/cmake/test)
+    add_executable(test_exe main.c)
+    target_link_libraries(test_exe PRIVATE test_target)
+endif()
+
+if (TEST_BUNDLING)
+    target_link_libraries(test_target PRIVATE $<BUILD_INTERFACE:tng_io::tng_io>)
+else()
+    target_link_libraries(test_target PRIVATE tng_io::tng_io)
+endif()
+if (TEST_ZLIB)
+    target_link_libraries(test_target PRIVATE ZLIB::ZLIB)
+endif()
diff --git a/src/external/tng_io/src/tests/using/dummy_zlib.c b/src/external/tng_io/src/tests/using/dummy_zlib.c
new file mode 100644 (file)
index 0000000..e28d040
--- /dev/null
@@ -0,0 +1,3 @@
+void test_zlib(void)
+{
+}
diff --git a/src/external/tng_io/src/tests/using/main.c b/src/external/tng_io/src/tests/using/main.c
new file mode 100644 (file)
index 0000000..a634fb3
--- /dev/null
@@ -0,0 +1,9 @@
+extern void test_tng(void);
+extern void test_zlib(void);
+
+int main(int argc, char *argv[])
+{
+    test_tng();
+    test_zlib();
+    return 0;
+}
diff --git a/src/external/tng_io/src/tests/using/use_tng.c b/src/external/tng_io/src/tests/using/use_tng.c
new file mode 100644 (file)
index 0000000..9fdd10f
--- /dev/null
@@ -0,0 +1,8 @@
+#include "tng/tng_io.h"
+
+void test_tng(void)
+{
+    tng_trajectory_t data;
+    char             buf[256];
+    tng_version(data, buf, 256);
+}
diff --git a/src/external/tng_io/src/tests/using/use_zlib.c b/src/external/tng_io/src/tests/using/use_zlib.c
new file mode 100644 (file)
index 0000000..f7958bd
--- /dev/null
@@ -0,0 +1,6 @@
+#include "zlib.h"
+
+void test_zlib(void)
+{
+    zlibVersion();
+}
index a42e624e1d6d6ac7711d909d84f0feaa7a5d0bc2..087632106db2af807bd3ea2149e66fcda19bfb4c 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, by the GROMACS development team, led by
+# Copyright (c) 2010,2011,2012,2013,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.
@@ -71,6 +71,7 @@ endfunction()
 
 add_subdirectory(gmxlib)
 add_subdirectory(mdlib)
+add_subdirectory(applied-forces)
 add_subdirectory(listed-forces)
 add_subdirectory(commandline)
 add_subdirectory(domdec)
@@ -105,6 +106,7 @@ if (NOT GMX_BUILD_MDRUN_ONLY)
     add_subdirectory(analysisdata)
     add_subdirectory(selection)
     add_subdirectory(trajectoryanalysis)
+    add_subdirectory(energyanalysis)
     add_subdirectory(tools)
 endif()
 
@@ -121,13 +123,6 @@ list(APPEND LIBGROMACS_SOURCES ${GMXLIB_SOURCES} ${MDLIB_SOURCES} ${PROPERTY_SOU
 tmpi_get_source_list(THREAD_MPI_SOURCES ${CMAKE_SOURCE_DIR}/src/external/thread_mpi/src)
 list(APPEND LIBGROMACS_SOURCES ${THREAD_MPI_SOURCES})
 
-if(GMX_USE_TNG)
-    list(APPEND LIBGROMACS_SOURCES ${TNG_SOURCES})
-    if (NOT GMX_EXTERNAL_TNG)
-        tng_set_source_properties(WITH_ZLIB ${HAVE_ZLIB})
-    endif()
-endif()
-
 get_lmfit_properties(LMFIT_SOURCES LMFIT_LIBRARIES_TO_LINK LMFIT_INCLUDE_DIRECTORY LMFIT_INCLUDE_DIR_ORDER)
 include_directories(${LMFIT_INCLUDE_DIR_ORDER} SYSTEM "${LMFIT_INCLUDE_DIRECTORY}")
 list(APPEND LIBGROMACS_SOURCES ${LMFIT_SOURCES})
@@ -152,10 +147,13 @@ gmx_install_headers(
 set(GENERATED_VERSION_FILE utility/baseversion-gen.c)
 gmx_configure_version_file(
     utility/baseversion-gen.c.cmakein ${GENERATED_VERSION_FILE}
-    REMOTE_HASH SOURCE_FILE)
+    REMOTE_HASH)
 list(APPEND LIBGROMACS_SOURCES ${GENERATED_VERSION_FILE})
 
 if (GMX_USE_CUDA)
+    # Work around FindCUDA that prevents using target_link_libraries()
+    # with keywords otherwise...
+    set(CUDA_LIBRARIES PRIVATE ${CUDA_LIBRARIES})
     cuda_add_library(libgromacs ${LIBGROMACS_SOURCES})
 else()
     add_library(libgromacs ${LIBGROMACS_SOURCES})
@@ -166,21 +164,26 @@ endif()
 # we do it in the compilation command (after testing that the compiler
 # supports the suppressions).
 include(CheckCXXCompilerFlag)
-check_cxx_compiler_flag(-Wno-unused-parameter HAS_NO_UNUSED_PARAMETER)
-if (HAS_NO_UNUSED_PARAMETER)
-    set(_scanner_cpp_compiler_flags "${_scanner_cpp_compiler_flags} -Wno-unused-parameter")
+check_cxx_compiler_flag(-Wno-unused HAS_NO_UNUSED)
+if (HAS_NO_UNUSED)
+    set(_scanner_cpp_compiler_flags "${_scanner_cpp_compiler_flags} -Wno-unused-parameter -Wno-unused-function")
 endif()
 set_source_files_properties(selection/scanner.cpp PROPERTIES COMPILE_FLAGS "${_scanner_cpp_compiler_flags}")
 
+gmx_setup_tng_for_libgromacs()
+
 target_link_libraries(libgromacs
+                      PRIVATE
                       ${EXTRAE_LIBRARIES}
                       ${GMX_EXTRA_LIBRARIES}
-                      ${TNG_IO_LIBRARIES}
+                      ${GMX_COMMON_LIBRARIES}
                       ${FFT_LIBRARIES} ${LINEAR_ALGEBRA_LIBRARIES}
-                      ${XML_LIBRARIES}
                       ${LMFIT_LIBRARIES_TO_LINK}
                       ${THREAD_LIB} ${GMX_SHARED_LINKER_FLAGS} ${OPENCL_LIBRARIES}
-                      ${GMX_STDLIB_LIBRARIES})
+                      ${GMX_STDLIB_LIBRARIES}
+                      PUBLIC
+                      ${GMX_PUBLIC_LIBRARIES}
+                      )
 set_target_properties(libgromacs PROPERTIES
                       OUTPUT_NAME "gromacs${GMX_LIBS_SUFFIX}"
                       SOVERSION ${LIBRARY_SOVERSION_MAJOR}
@@ -229,3 +232,7 @@ if(GMX_USE_OPENCL)
     install(FILES ${OPENCL_KERNELS} DESTINATION
         ${OCL_INSTALL_DIR} COMPONENT libraries)
 endif()
+
+if (BUILD_TESTING)
+    add_subdirectory(compat/tests)
+endif()
index 2b0e0c1b56fd6986ee7818887acf9c16e09e3c6d..9ad7136a43893b73beb42ebe0fbc011fc485ab2c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -71,7 +71,7 @@ class AnalysisDataHandleImpl
     public:
         //! Creates a handle associated with the given data object.
         explicit AnalysisDataHandleImpl(AnalysisData *data)
-            : data_(*data), currentFrame_(NULL)
+            : data_(*data), currentFrame_(nullptr)
         {
         }
 
@@ -227,7 +227,7 @@ AnalysisData::requestStorageInternal(int nframes)
  */
 
 AnalysisDataHandle::AnalysisDataHandle()
-    : impl_(NULL)
+    : impl_(nullptr)
 {
 }
 
@@ -241,8 +241,8 @@ AnalysisDataHandle::AnalysisDataHandle(internal::AnalysisDataHandleImpl *impl)
 void
 AnalysisDataHandle::startFrame(int index, real x, real dx)
 {
-    GMX_RELEASE_ASSERT(impl_ != NULL, "Invalid data handle used");
-    GMX_RELEASE_ASSERT(impl_->currentFrame_ == NULL,
+    GMX_RELEASE_ASSERT(impl_ != nullptr, "Invalid data handle used");
+    GMX_RELEASE_ASSERT(impl_->currentFrame_ == nullptr,
                        "startFrame() called twice without calling finishFrame()");
     impl_->currentFrame_ =
         &impl_->data_.impl_->storage_.startFrame(index, x, dx);
@@ -252,8 +252,8 @@ AnalysisDataHandle::startFrame(int index, real x, real dx)
 void
 AnalysisDataHandle::selectDataSet(int index)
 {
-    GMX_RELEASE_ASSERT(impl_ != NULL, "Invalid data handle used");
-    GMX_RELEASE_ASSERT(impl_->currentFrame_ != NULL,
+    GMX_RELEASE_ASSERT(impl_ != nullptr, "Invalid data handle used");
+    GMX_RELEASE_ASSERT(impl_->currentFrame_ != nullptr,
                        "selectDataSet() called without calling startFrame()");
     impl_->currentFrame_->selectDataSet(index);
 }
@@ -262,8 +262,8 @@ AnalysisDataHandle::selectDataSet(int index)
 void
 AnalysisDataHandle::setPoint(int column, real value, bool bPresent)
 {
-    GMX_RELEASE_ASSERT(impl_ != NULL, "Invalid data handle used");
-    GMX_RELEASE_ASSERT(impl_->currentFrame_ != NULL,
+    GMX_RELEASE_ASSERT(impl_ != nullptr, "Invalid data handle used");
+    GMX_RELEASE_ASSERT(impl_->currentFrame_ != nullptr,
                        "setPoint() called without calling startFrame()");
     impl_->currentFrame_->setValue(column, value, bPresent);
 }
@@ -272,22 +272,23 @@ AnalysisDataHandle::setPoint(int column, real value, bool bPresent)
 void
 AnalysisDataHandle::setPoint(int column, real value, real error, bool bPresent)
 {
-    GMX_RELEASE_ASSERT(impl_ != NULL, "Invalid data handle used");
-    GMX_RELEASE_ASSERT(impl_->currentFrame_ != NULL,
+    GMX_RELEASE_ASSERT(impl_ != nullptr, "Invalid data handle used");
+    GMX_RELEASE_ASSERT(impl_->currentFrame_ != nullptr,
                        "setPoint() called without calling startFrame()");
     impl_->currentFrame_->setValue(column, value, error, bPresent);
 }
 
 
 void
-AnalysisDataHandle::setPoints(int firstColumn, int count, const real *values)
+AnalysisDataHandle::setPoints(int firstColumn, int count, const real *values,
+                              bool bPresent)
 {
-    GMX_RELEASE_ASSERT(impl_ != NULL, "Invalid data handle used");
-    GMX_RELEASE_ASSERT(impl_->currentFrame_ != NULL,
+    GMX_RELEASE_ASSERT(impl_ != nullptr, "Invalid data handle used");
+    GMX_RELEASE_ASSERT(impl_->currentFrame_ != nullptr,
                        "setPoints() called without calling startFrame()");
     for (int i = 0; i < count; ++i)
     {
-        impl_->currentFrame_->setValue(firstColumn + i, values[i]);
+        impl_->currentFrame_->setValue(firstColumn + i, values[i], bPresent);
     }
 }
 
@@ -295,10 +296,10 @@ AnalysisDataHandle::setPoints(int firstColumn, int count, const real *values)
 void
 AnalysisDataHandle::finishPointSet()
 {
-    GMX_RELEASE_ASSERT(impl_ != NULL, "Invalid data handle used");
+    GMX_RELEASE_ASSERT(impl_ != nullptr, "Invalid data handle used");
     GMX_RELEASE_ASSERT(impl_->data_.isMultipoint(),
                        "finishPointSet() called for non-multipoint data");
-    GMX_RELEASE_ASSERT(impl_->currentFrame_ != NULL,
+    GMX_RELEASE_ASSERT(impl_->currentFrame_ != nullptr,
                        "finishPointSet() called without calling startFrame()");
     impl_->currentFrame_->finishPointSet();
 }
@@ -307,11 +308,11 @@ AnalysisDataHandle::finishPointSet()
 void
 AnalysisDataHandle::finishFrame()
 {
-    GMX_RELEASE_ASSERT(impl_ != NULL, "Invalid data handle used");
-    GMX_RELEASE_ASSERT(impl_->currentFrame_ != NULL,
+    GMX_RELEASE_ASSERT(impl_ != nullptr, "Invalid data handle used");
+    GMX_RELEASE_ASSERT(impl_->currentFrame_ != nullptr,
                        "finishFrame() called without calling startFrame()");
     AnalysisDataStorageFrame *frame = impl_->currentFrame_;
-    impl_->currentFrame_ = NULL;
+    impl_->currentFrame_ = nullptr;
     frame->finishFrame();
 }
 
@@ -319,10 +320,10 @@ AnalysisDataHandle::finishFrame()
 void
 AnalysisDataHandle::finishData()
 {
-    GMX_RELEASE_ASSERT(impl_ != NULL, "Invalid data handle used");
+    GMX_RELEASE_ASSERT(impl_ != nullptr, "Invalid data handle used");
     // Deletes the implementation pointer.
     impl_->data_.finishData(*this);
-    impl_ = NULL;
+    impl_ = nullptr;
 }
 
 } // namespace gmx
index 7d1b1997ed569fab2208f49a7030c3c3b9977814..09e8733da10cc089ead0bbe8e77d169d4d0b4b7f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -260,7 +260,7 @@ class AnalysisDataHandle
         AnalysisDataHandle();
 
         //! Returns whether this data handle is valid.
-        bool isValid() const { return impl_ != NULL; }
+        bool isValid() const { return impl_ != nullptr; }
 
         /*! \brief
          * Start data for a new frame.
@@ -326,13 +326,14 @@ class AnalysisDataHandle
          * \param[in] firstColumn  Zero-based column index.
          * \param[in] count        Number of columns to set.
          * \param[in] values       Value array of \p column items.
+         * \param[in] bPresent     Present flag to set for the column.
          *
-         * Equivalent to calling setPoint(firstColumn + i, values[i]) for
+         * Equivalent to calling setPoint(firstColumn + i, values[i], bPresent) for
          * i from 0 to count.
          *
          * Does not throw.
          */
-        void setPoints(int firstColumn, int count, const real *values);
+        void setPoints(int firstColumn, int count, const real *values, bool bPresent = true);
         /*! \brief
          * Finish data for the current point set.
          *
index f9e4d8dbb3919b8d5be36f2d2b9fb3e7afeffa30..4eb0a4afafc7c23c32a9c77977a80d5e23ecbf06 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,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.
@@ -302,7 +302,7 @@ AnalysisDataModuleManager::addModule(AbstractAnalysisData      *data,
     {
         impl_->bAllowMissing_ = false;
     }
-    impl_->modules_.push_back(Impl::ModuleInfo(module));
+    impl_->modules_.emplace_back(module);
 }
 
 void
index c495aa93989a7968c098d47a79dba8e6e9726b53..614f84d00efbfa5cea3db891572d83169bfcb86b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,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.
@@ -55,7 +55,7 @@ AnalysisDataProxy::AnalysisDataProxy(int firstColumn, int columnSpan,
     : source_(*data), firstColumn_(firstColumn), columnSpan_(columnSpan),
       bParallel_(false)
 {
-    GMX_RELEASE_ASSERT(data != NULL, "Source data must not be NULL");
+    GMX_RELEASE_ASSERT(data != nullptr, "Source data must not be NULL");
     GMX_RELEASE_ASSERT(firstColumn >= 0 && columnSpan > 0, "Invalid proxy column");
     setMultipoint(source_.isMultipoint());
 }
index 41ffc5f35c233263b5069c704949ac2e5147b585..dc3db91b02f0d81c8fba2eff2ba0beb7cf85941c 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,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.
@@ -399,7 +399,7 @@ class AnalysisDataStorageFrameData
  */
 
 AnalysisDataStorageImpl::AnalysisDataStorageImpl()
-    : data_(NULL), modules_(NULL),
+    : data_(nullptr), modules_(nullptr),
       storageLimit_(0), pendingLimit_(1),
       firstFrameLocation_(0), firstUnnotifiedIndex_(0), nextIndex_(0)
 {
@@ -564,7 +564,7 @@ AnalysisDataStorageFrameData::AnalysisDataStorageFrameData(
         int                      index)
     : storageImpl_(*storageImpl), header_(index, 0.0, 0.0), status_(eMissing)
 {
-    GMX_RELEASE_ASSERT(storageImpl->data_ != NULL,
+    GMX_RELEASE_ASSERT(storageImpl->data_ != nullptr,
                        "Storage frame constructed before data started");
     // With non-multipoint data, the point set structure is static,
     // so initialize it only once here.
@@ -574,8 +574,7 @@ AnalysisDataStorageFrameData::AnalysisDataStorageFrameData(
         for (int i = 0; i < baseData().dataSetCount(); ++i)
         {
             int columnCount = baseData().columnCount(i);
-            pointSets_.push_back(
-                    AnalysisDataPointSetInfo(offset, columnCount, i, 0));
+            pointSets_.emplace_back(offset, columnCount, i, 0);
             offset += columnCount;
         }
     }
@@ -625,9 +624,8 @@ AnalysisDataStorageFrameData::addPointSet(int dataSetIndex, int firstColumn,
     }
     else if (storageImpl().needStorage())
     {
-        pointSets_.push_back(
-                AnalysisDataPointSetInfo(values_.size(), valueCount,
-                                         dataSetIndex, firstColumn));
+        pointSets_.emplace_back(values_.size(), valueCount,
+                                dataSetIndex, firstColumn);
         std::copy(begin, end, std::back_inserter(values_));
     }
 }
@@ -677,7 +675,7 @@ AnalysisDataStorageFrameData::pointSet(int index) const
 
 AnalysisDataStorageFrame::AnalysisDataStorageFrame(
         const AbstractAnalysisData &data)
-    : data_(NULL), currentDataSet_(0), currentOffset_(0),
+    : data_(nullptr), currentDataSet_(0), currentOffset_(0),
       columnCount_(data.columnCount(0)), bPointSetInProgress_(false)
 {
     int totalColumnCount = 0;
@@ -712,7 +710,7 @@ AnalysisDataStorageFrame::clearValues()
 void
 AnalysisDataStorageFrame::selectDataSet(int index)
 {
-    GMX_RELEASE_ASSERT(data_ != NULL, "Invalid frame accessed");
+    GMX_RELEASE_ASSERT(data_ != nullptr, "Invalid frame accessed");
     const AbstractAnalysisData &baseData = data_->baseData();
     GMX_RELEASE_ASSERT(index >= 0 && index < baseData.dataSetCount(),
                        "Out of range data set index");
@@ -732,7 +730,7 @@ AnalysisDataStorageFrame::selectDataSet(int index)
 void
 AnalysisDataStorageFrame::finishPointSet()
 {
-    GMX_RELEASE_ASSERT(data_ != NULL, "Invalid frame accessed");
+    GMX_RELEASE_ASSERT(data_ != nullptr, "Invalid frame accessed");
     GMX_RELEASE_ASSERT(data_->baseData().isMultipoint(),
                        "Should not be called for non-multipoint data");
     if (bPointSetInProgress_)
@@ -764,7 +762,7 @@ AnalysisDataStorageFrame::finishPointSet()
 void
 AnalysisDataStorageFrame::finishFrame()
 {
-    GMX_RELEASE_ASSERT(data_ != NULL, "Invalid frame accessed");
+    GMX_RELEASE_ASSERT(data_ != nullptr, "Invalid frame accessed");
     data_->storageImpl().finishFrame(data_->frameIndex());
 }
 
index 9b9b2f468d142476098947a1fc85a9f169308264..d8db1660c3f5d1de8f4adf718a128dc994e590e4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,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.
@@ -103,8 +103,8 @@ class AnalysisDataDisplacementModule::Impl
 AnalysisDataDisplacementModule::Impl::Impl()
     : nmax(0), tmax(0.0), ndim(3),
       bFirst(true), t0(0.0), dt(0.0), t(0.0), ci(0),
-      max_store(-1), nstored(0), oldval(NULL),
-      histm(NULL)
+      max_store(-1), nstored(0), oldval(nullptr),
+      histm(nullptr)
 {
 }
 
@@ -140,7 +140,7 @@ void
 AnalysisDataDisplacementModule::setMSDHistogram(
         AnalysisDataBinAverageModulePointer histm)
 {
-    GMX_RELEASE_ASSERT(_impl->histm == NULL, "Can only set MSD histogram once");
+    GMX_RELEASE_ASSERT(_impl->histm == nullptr, "Can only set MSD histogram once");
     _impl->histm = histm.get();
     addModule(histm);
 }
@@ -280,7 +280,7 @@ AnalysisDataDisplacementModule::frameFinished(const AnalysisDataFrameHeader & /*
             i += _impl->max_store;
         }
         _impl->currValues_.clear();
-        _impl->currValues_.push_back(AnalysisDataValue(step * _impl->dt));
+        _impl->currValues_.emplace_back(step * _impl->dt);
         int k = 1;
         for (int j = 0; j < _impl->nmax; j += _impl->ndim, ++k)
         {
@@ -292,7 +292,7 @@ AnalysisDataDisplacementModule::frameFinished(const AnalysisDataFrameHeader & /*
                     - _impl->oldval[i + j + d];
                 dist2 += displ * displ;
             }
-            _impl->currValues_.push_back(AnalysisDataValue(dist2));
+            _impl->currValues_.emplace_back(dist2);
         }
         moduleManager().notifyPointsAdd(AnalysisDataPointSetRef(header, _impl->currValues_));
     }
index 1c64c4d5172f489a8f3fa0e7132cc4f3ac9e0a3a..9278d288c81c9c947fc73c368942fa9f31b4d2af 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,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.
@@ -142,8 +142,8 @@ AnalysisDataLifetimeModule::dataStarted(AbstractAnalysisData *data)
     impl_->lifetimeHistograms_.reserve(data->dataSetCount());
     for (int i = 0; i < data->dataSetCount(); ++i)
     {
-        impl_->currentLifetimes_.push_back(std::vector<int>(data->columnCount(i), 0));
-        impl_->lifetimeHistograms_.push_back(std::deque<int>());
+        impl_->currentLifetimes_.emplace_back(data->columnCount(i), 0);
+        impl_->lifetimeHistograms_.emplace_back();
     }
 }
 
index e24160f28feec6d8e0342e26ed5d8a136acab2cc..f61b34e366d86f9971b04d98aa8ef87e47804c9d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -61,8 +61,8 @@
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/programcontext.h"
-#include "gromacs/utility/scoped_cptr.h"
 #include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/unique_cptr.h"
 
 namespace
 {
@@ -82,7 +82,7 @@ namespace gmx
  */
 
 AnalysisDataPlotSettings::AnalysisDataPlotSettings()
-    : selections_(NULL), timeUnit_(TimeUnit_Default), plotFormat_(1)
+    : selections_(nullptr), timeUnit_(TimeUnit_Default), plotFormat_(1)
 {
 }
 
@@ -132,7 +132,7 @@ class AbstractPlotModule::Impl
 };
 
 AbstractPlotModule::Impl::Impl(const AnalysisDataPlotSettings &settings)
-    : settings_(settings), fp_(NULL), bPlain_(false), bOmitX_(false),
+    : settings_(settings), fp_(nullptr), bPlain_(false), bOmitX_(false),
       bErrorsAsSeparateColumn_(false), xscale_(1.0)
 {
     strcpy(xformat_, "%11.3f");
@@ -148,7 +148,7 @@ AbstractPlotModule::Impl::~Impl()
 void
 AbstractPlotModule::Impl::closeFile()
 {
-    if (fp_ != NULL)
+    if (fp_ != nullptr)
     {
         if (bPlain_)
         {
@@ -158,7 +158,7 @@ AbstractPlotModule::Impl::closeFile()
         {
             xvgrclose(fp_);
         }
-        fp_ = NULL;
+        fp_ = nullptr;
     }
 }
 
@@ -282,7 +282,7 @@ AbstractPlotModule::setLegend(int nsets, const char * const *setname)
 void
 AbstractPlotModule::appendLegend(const char *setname)
 {
-    impl_->legend_.push_back(setname);
+    impl_->legend_.emplace_back(setname);
 }
 
 
@@ -299,7 +299,7 @@ AbstractPlotModule::setXFormat(int width, int precision, char format)
     GMX_RELEASE_ASSERT(width >= 0 && precision >= 0
                        && width <= 99 && precision <= 99,
                        "Invalid width or precision");
-    GMX_RELEASE_ASSERT(strchr("eEfFgG", format) != NULL,
+    GMX_RELEASE_ASSERT(strchr("eEfFgG", format) != nullptr,
                        "Invalid format specifier");
     sprintf(impl_->xformat_, "%%%d.%d%c", width, precision, format);
 }
@@ -311,7 +311,7 @@ AbstractPlotModule::setYFormat(int width, int precision, char format)
     GMX_RELEASE_ASSERT(width >= 0 && precision >= 0
                        && width <= 99 && precision <= 99,
                        "Invalid width or precision");
-    GMX_RELEASE_ASSERT(strchr("eEfFgG", format) != NULL,
+    GMX_RELEASE_ASSERT(strchr("eEfFgG", format) != nullptr,
                        "Invalid format specifier");
     sprintf(impl_->yformat_, " %%%d.%d%c", width, precision, format);
 }
@@ -342,15 +342,15 @@ AbstractPlotModule::dataStarted(AbstractAnalysisData * /* data */)
                 = (impl_->settings_.plotFormat() > 0
                    ? static_cast<xvg_format_t>(impl_->settings_.plotFormat())
                    : exvgNONE);
-            gmx_output_env_t                              *oenv;
+            gmx_output_env_t                                    *oenv;
             output_env_init(&oenv, getProgramContext(), time_unit, FALSE, xvg_format, 0);
-            scoped_cptr<gmx_output_env_t, output_env_done> oenvGuard(oenv);
+            const unique_cptr<gmx_output_env_t, output_env_done> oenvGuard(oenv);
             impl_->fp_ = xvgropen(impl_->filename_.c_str(), impl_->title_.c_str(),
                                   impl_->xlabel_.c_str(), impl_->ylabel_.c_str(),
                                   oenv);
             const SelectionCollection *selections
                 = impl_->settings_.selectionCollection();
-            if (selections != NULL && output_env_get_xvg_format(oenv) != exvgNONE)
+            if (selections != nullptr && output_env_get_xvg_format(oenv) != exvgNONE)
             {
                 selections->printXvgrInfo(impl_->fp_);
             }
@@ -409,7 +409,7 @@ AbstractPlotModule::dataFinished()
 bool
 AbstractPlotModule::isFileOpen() const
 {
-    return impl_->fp_ != NULL;
+    return impl_->fp_ != nullptr;
 }
 
 
@@ -535,7 +535,7 @@ AnalysisDataVectorPlotModule::pointsAdded(const AnalysisDataPointSetRef &points)
     {
         for (int d = 0; d < DIM; ++d)
         {
-            if (bWrite_[i])
+            if (bWrite_[d])
             {
                 writeValue(points.values()[i + d]);
             }
index 28abff7f0c7b841c03ee9af80bf23a45f22e8c4d..5ac37f1921a7137e081104d2b01af5841226b52e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,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.
@@ -115,11 +115,11 @@ class AnalysisDataTestInputPointSet
         }
 
         //! Appends a value to this point set.
-        void addValue(real y) { values_.push_back(Value(y)); }
+        void addValue(real y) { values_.emplace_back(y); }
         //! Appends a value with an error estimate to this point set.
         void addValueWithError(real y, real error)
         {
-            values_.push_back(Value(y, error));
+            values_.emplace_back(y, error);
         }
 
     private:
index 1871e0537014279af1969e75cfa95cd9f29e119d..7fdd647eb6349137bad72480e0ec616da13fecd9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2011,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.
@@ -143,7 +143,7 @@ namespace
 void checkReferenceDataPoint(TestReferenceChecker    *checker,
                              const AnalysisDataValue &value)
 {
-    TestReferenceChecker compound(checker->checkCompound("DataValue", NULL));
+    TestReferenceChecker compound(checker->checkCompound("DataValue", nullptr));
     compound.checkReal(value.value(), "Value");
     if (compound.checkPresent(value.hasError(), "Error"))
     {
@@ -158,7 +158,7 @@ void checkReferenceDataPoint(TestReferenceChecker    *checker,
 }       // namespace
 
 MockAnalysisDataModule::Impl::Impl(int flags)
-    : source_(NULL), flags_(flags), frameIndex_(0)
+    : source_(nullptr), flags_(flags), frameIndex_(0)
 {
 }
 
@@ -192,7 +192,7 @@ MockAnalysisDataModule::Impl::checkReferencePoints(
     if (frameChecker_)
     {
         TestReferenceChecker checker(
-                frameChecker_.checkCompound("DataValues", NULL));
+                frameChecker_.checkCompound("DataValues", nullptr));
         checker.checkInteger(points.columnCount(), "Count");
         if (checker.checkPresent(source_->dataSetCount() > 1, "DataSet"))
         {
diff --git a/src/gromacs/applied-forces/CMakeLists.txt b/src/gromacs/applied-forces/CMakeLists.txt
new file mode 100644 (file)
index 0000000..702e776
--- /dev/null
@@ -0,0 +1,41 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2015,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.
+
+gmx_add_libgromacs_sources(
+    electricfield.cpp
+    )
+
+if (BUILD_TESTING)
+    add_subdirectory(tests)
+endif()
diff --git a/src/gromacs/applied-forces/electricfield.cpp b/src/gromacs/applied-forces/electricfield.cpp
new file mode 100644 (file)
index 0000000..b5328ad
--- /dev/null
@@ -0,0 +1,447 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Declares data structure and utilities for electric fields
+ *
+ * \author David van der Spoel <david.vanderspoel@icm.uu.se>
+ * \ingroup module_applied_forces
+ */
+#include "gmxpre.h"
+
+#include "electricfield.h"
+
+#include <cmath>
+
+#include <string>
+
+#include "gromacs/commandline/filenm.h"
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/mdtypes/commrec.h"
+#include "gromacs/mdtypes/forcerec.h"
+#include "gromacs/mdtypes/iforceprovider.h"
+#include "gromacs/mdtypes/imdmodule.h"
+#include "gromacs/mdtypes/imdoutputprovider.h"
+#include "gromacs/mdtypes/imdpoptionprovider.h"
+#include "gromacs/mdtypes/mdatom.h"
+#include "gromacs/options/basicoptions.h"
+#include "gromacs/options/ioptionscontainerwithsections.h"
+#include "gromacs/options/optionsection.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/keyvaluetreebuilder.h"
+#include "gromacs/utility/keyvaluetreetransform.h"
+#include "gromacs/utility/pleasecite.h"
+#include "gromacs/utility/strconvert.h"
+#include "gromacs/utility/stringutil.h"
+
+namespace gmx
+{
+
+namespace
+{
+
+/*! \internal
+ * \brief Declaration of storage unit for fields
+ */
+class ElectricFieldData
+{
+    public:
+        ElectricFieldData() : a_(0), omega_(0), t0_(0), sigma_(0)
+        {
+        }
+
+        /*! \brief
+         * Adds an option section to specify parameters for this field component.
+         */
+        void initMdpOptions(IOptionsContainerWithSections *options, const char *sectionName)
+        {
+            auto section = options->addSection(OptionSection(sectionName));
+            section.addOption(RealOption("E0").store(&a_));
+            section.addOption(RealOption("omega").store(&omega_));
+            section.addOption(RealOption("t0").store(&t0_));
+            section.addOption(RealOption("sigma").store(&sigma_));
+        }
+        /*! \brief
+         * Creates mdp parameters for this field component.
+         */
+        void buildMdpOutput(KeyValueTreeObjectBuilder *builder, const std::string &name) const
+        {
+            builder->addUniformArray<real>("E-" + name, {1, a_, -1});
+            builder->addUniformArray<real>("E-" + name + "t", {omega_, t0_, sigma_});
+        }
+
+        /*! \brief Evaluates this field component at given time.
+         *
+         * \param[in] t The time to evualate at
+         * \return The electric field
+         */
+        real evaluate(real t) const
+        {
+            if (sigma_ > 0)
+            {
+                return a_ * (std::cos(omega_*(t-t0_))
+                             * std::exp(-square(t-t0_)/(2.0*square(sigma_))));
+            }
+            else
+            {
+                return a_ * std::cos(omega_*t);
+            }
+        }
+
+        /*! \brief Initiate the field values
+         *
+         * \param[in] a     Amplitude
+         * \param[in] omega Frequency
+         * \param[in] t0    Peak of the pulse
+         * \param[in] sigma Width of the pulse
+         */
+        void setField(real a, real omega, real t0, real sigma)
+        {
+            a_     = a;
+            omega_ = omega;
+            t0_    = t0;
+            sigma_ = sigma;
+        }
+
+        //! Return the amplitude
+        real a()     const { return a_; }
+        //! Return the frequency
+        real omega() const { return omega_; }
+        //! Return the time for the peak of the pulse
+        real t0()    const { return t0_; }
+        //! Return the width of the pulse (0 means inifinite)
+        real sigma() const { return sigma_; }
+
+    private:
+        //! Coeffient (V / nm)
+        real a_;
+        //! Frequency (1/ps)
+        real omega_;
+        //! Central time point (ps) for pulse
+        real t0_;
+        //! Width of pulse (ps, if zero there is no pulse)
+        real sigma_;
+};
+
+/*! \internal
+ * \brief Describe time dependent electric field
+ *
+ * Class that implements a force to be evaluated in mdrun.
+ * The electric field can be pulsed and oscillating, simply
+ * oscillating, or static, in each of X,Y,Z directions.
+ */
+class ElectricField final : public IMDModule,
+                            public IMdpOptionProvider, public IMDOutputProvider,
+                            public IForceProvider
+{
+    public:
+        ElectricField() : fpField_(nullptr) {}
+
+        // From IMDModule
+        IMdpOptionProvider *mdpOptionProvider() override { return this; }
+        IMDOutputProvider *outputProvider() override { return this; }
+        void initForceProviders(ForceProviders *forceProviders) override
+        {
+            if (isActive())
+            {
+                forceProviders->addForceProviderWithoutVirialContribution(this);
+            }
+        }
+
+        // From IMdpOptionProvider
+        void initMdpTransform(IKeyValueTreeTransformRules *transform) override;
+        void initMdpOptions(IOptionsContainerWithSections *options) override;
+        void buildMdpOutput(KeyValueTreeObjectBuilder *builder) const override;
+
+        // From IMDOutputProvider
+        void initOutput(FILE *fplog, int nfile, const t_filenm fnm[],
+                        bool bAppendFiles, const gmx_output_env_t *oenv) override;
+        void finishOutput() override;
+
+        // From IForceProvider
+        //! \copydoc IForceProvider::calculateForces()
+        void calculateForces(const t_commrec  *cr,
+                             const t_mdatoms  *mdatoms,
+                             const matrix      box,
+                             double            t,
+                             const rvec       *x,
+                             ArrayRef<RVec>    force) override;
+
+    private:
+        //! Return whether or not to apply a field
+        bool isActive() const;
+
+        /*! \brief Return the field strength
+         *
+         * \param[in] dim The spatial direction
+         * \param[in] t   The time (ps)
+         * \return The field strength in V/nm units
+         */
+        real field(int dim, real t) const;
+
+        /*! \brief Return amplitude of field
+         *
+         * \param[in] dim Direction of the field (XX, YY, ZZ)
+         * \return Amplitude of the field
+         */
+        real a(int dim)     const { return efield_[dim].a(); }
+        /*! \brief Return frequency of field (1/ps)
+         *
+         * \param[in] dim Direction of the field (XX, YY, ZZ)
+         * \return Frequency of the field
+         */
+        real omega(int dim) const { return efield_[dim].omega(); }
+        /*! \brief Return time of pulse peak
+         *
+         * \param[in] dim Direction of the field (XX, YY, ZZ)
+         * \return Time of pulse peak
+         */
+        real t0(int dim) const { return efield_[dim].t0(); }
+        /*! \brief Return width of the pulse
+         *
+         * \param[in] dim Direction of the field (XX, YY, ZZ)
+         * \return Width of the pulse
+         */
+        real sigma(int dim) const { return efield_[dim].sigma(); }
+
+        /*! \brief Print the field components to a file
+         *
+         * \param[in] t   The time
+         * Will throw and exit with fatal error if file is not open.
+         */
+        void printComponents(double t) const;
+
+        //! The field strength in each dimension
+        ElectricFieldData efield_[DIM];
+        //! File pointer for electric field
+        FILE             *fpField_;
+};
+
+//! Converts static parameters from mdp format to E0.
+real convertStaticParameters(const std::string &value)
+{
+    // TODO: Better context for the exceptions here (possibly
+    // also convert them to warning_errors or such).
+    const std::vector<std::string> sx = splitString(value);
+    if (sx.empty())
+    {
+        return 0.0;
+    }
+    const int n = fromString<int>(sx[0]);
+    if (n <= 0)
+    {
+        return 0.0;
+    }
+    if (n != 1)
+    {
+        GMX_THROW(InvalidInputError("Only one electric field term supported for each dimension"));
+    }
+    if (sx.size() != 3)
+    {
+        GMX_THROW(InvalidInputError("Expected exactly one electric field amplitude value"));
+    }
+    return fromString<real>(sx[1]);
+}
+
+//! Converts dynamic parameters from mdp format to (omega, t0, sigma).
+void convertDynamicParameters(gmx::KeyValueTreeObjectBuilder *builder,
+                              const std::string              &value)
+{
+    const std::vector<std::string> sxt = splitString(value);
+    if (sxt.empty())
+    {
+        return;
+    }
+    const int n = fromString<int>(sxt[0]);
+    switch (n)
+    {
+        case 1:
+            if (sxt.size() != 3)
+            {
+                GMX_THROW(InvalidInputError("Please specify 1 omega 0 for non-pulsed fields"));
+            }
+            builder->addValue<real>("omega", fromString<real>(sxt[1]));
+            break;
+        case 3:
+            if (sxt.size() != 7)
+            {
+                GMX_THROW(InvalidInputError("Please specify 1 omega 0 t0 0 sigma 0 for pulsed fields"));
+            }
+            builder->addValue<real>("omega", fromString<real>(sxt[1]));
+            builder->addValue<real>("t0", fromString<real>(sxt[3]));
+            builder->addValue<real>("sigma", fromString<real>(sxt[5]));
+            break;
+        default:
+            GMX_THROW(InvalidInputError("Incomprehensible input for electric field"));
+    }
+}
+
+void ElectricField::initMdpTransform(IKeyValueTreeTransformRules *rules)
+{
+    rules->addRule().from<std::string>("/E-x").to<real>("/electric-field/x/E0")
+        .transformWith(&convertStaticParameters);
+    rules->addRule().from<std::string>("/E-xt").toObject("/electric-field/x")
+        .transformWith(&convertDynamicParameters);
+    rules->addRule().from<std::string>("/E-y").to<real>("/electric-field/y/E0")
+        .transformWith(&convertStaticParameters);
+    rules->addRule().from<std::string>("/E-yt").toObject("/electric-field/y")
+        .transformWith(&convertDynamicParameters);
+    rules->addRule().from<std::string>("/E-z").to<real>("/electric-field/z/E0")
+        .transformWith(&convertStaticParameters);
+    rules->addRule().from<std::string>("/E-zt").toObject("/electric-field/z")
+        .transformWith(&convertDynamicParameters);
+}
+
+void ElectricField::initMdpOptions(IOptionsContainerWithSections *options)
+{
+    auto section = options->addSection(OptionSection("electric-field"));
+    efield_[XX].initMdpOptions(&section, "x");
+    efield_[YY].initMdpOptions(&section, "y");
+    efield_[ZZ].initMdpOptions(&section, "z");
+}
+
+void ElectricField::buildMdpOutput(KeyValueTreeObjectBuilder *builder) const
+{
+    const char *const comment[] = {
+        "; Electric fields",
+        "; Format for E-x, etc. is: number of cosines (int; only 1 is supported),",
+        "; amplitude (real; V/nm), and phase (real; value is meaningless",
+        "; for a cosine of frequency 0.",
+        "; Format for E-xt, etc. is: omega (1/ps), time for the pulse peak (ps),",
+        "; and sigma (ps) width of the pulse. Sigma = 0 removes the pulse,",
+        "; leaving the field to be a cosine function."
+    };
+    builder->addValue<std::string>("comment-electric-field", joinStrings(comment, "\n"));
+    efield_[XX].buildMdpOutput(builder, "x");
+    efield_[YY].buildMdpOutput(builder, "y");
+    efield_[ZZ].buildMdpOutput(builder, "z");
+}
+
+void ElectricField::initOutput(FILE *fplog, int nfile, const t_filenm fnm[],
+                               bool bAppendFiles, const gmx_output_env_t *oenv)
+{
+    if (isActive())
+    {
+        please_cite(fplog, "Caleman2008a");
+
+        // Optional outpuf file showing the field, see manual.
+        if (opt2bSet("-field", nfile, fnm))
+        {
+            if (bAppendFiles)
+            {
+                fpField_ = gmx_fio_fopen(opt2fn("-field", nfile, fnm), "a+");
+            }
+            else
+            {
+                fpField_ = xvgropen(opt2fn("-field", nfile, fnm),
+                                    "Applied electric field", "Time (ps)",
+                                    "E (V/nm)", oenv);
+            }
+        }
+    }
+}
+
+void ElectricField::finishOutput()
+{
+    if (fpField_ != nullptr)
+    {
+        // This is opened sometimes with xvgropen, sometimes with
+        // gmx_fio_fopen, so we use the least common denominator for closing.
+        gmx_fio_fclose(fpField_);
+        fpField_ = nullptr;
+    }
+}
+
+real ElectricField::field(int dim, real t) const
+{
+    return efield_[dim].evaluate(t);
+}
+
+bool ElectricField::isActive() const
+{
+    return (efield_[XX].a() != 0 ||
+            efield_[YY].a() != 0 ||
+            efield_[ZZ].a() != 0);
+}
+
+void ElectricField::printComponents(double t) const
+{
+    fprintf(fpField_, "%10g  %10g  %10g  %10g\n", t,
+            field(XX, t), field(YY, t), field(ZZ, t));
+}
+
+void ElectricField::calculateForces(const t_commrec  *cr,
+                                    const t_mdatoms  *mdatoms,
+                                    const matrix      /* box */,
+                                    double            t,
+                                    const rvec        * /* x */,
+                                    ArrayRef<RVec>    force)
+{
+    if (isActive())
+    {
+        rvec *f = as_rvec_array(force.data());
+
+        for (int m = 0; (m < DIM); m++)
+        {
+            real Ext = FIELDFAC*field(m, t);
+
+            if (Ext != 0)
+            {
+                // TODO: Check parallellism
+                for (int i = 0; i < mdatoms->homenr; ++i)
+                {
+                    // NOTE: Not correct with perturbed charges
+                    f[i][m] += mdatoms->chargeA[i]*Ext;
+                }
+            }
+        }
+        if (MASTER(cr) && fpField_ != nullptr)
+        {
+            printComponents(t);
+        }
+    }
+}
+
+}   // namespace
+
+std::unique_ptr<IMDModule> createElectricFieldModule()
+{
+    return std::unique_ptr<IMDModule>(new ElectricField());
+}
+
+} // namespace gmx
diff --git a/src/gromacs/applied-forces/electricfield.h b/src/gromacs/applied-forces/electricfield.h
new file mode 100644 (file)
index 0000000..a5d0f8f
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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_APPLIED_FORCES_ELECTRICFIELD_H
+#define GMX_APPLIED_FORCES_ELECTRICFIELD_H
+
+#include <memory>
+
+namespace gmx
+{
+
+class IMDModule;
+
+/*! \brief
+ * Creates a module for an external electric field.
+ *
+ * The returned class describes the time dependent electric field that can
+ * be applied to all charges in a simulation. The field is described
+ * by the following:
+ *     E(t) = A cos(omega*(t-t0))*exp(-sqr(t-t0)/(2.0*sqr(sigma)));
+ * If sigma = 0 there is no pulse and we have instead
+ *     E(t) = A cos(omega*t)
+ *
+ * force is kJ mol^-1 nm^-1 = e * kJ mol^-1 nm^-1 / e
+ *
+ * WARNING:
+ * There can be problems with the virial.
+ * Since the field is not self-consistent this is unavoidable.
+ * For neutral molecules the virial is correct within this approximation.
+ * For neutral systems with many charged molecules the error is small.
+ * But for systems with a net charge or a few charged molecules
+ * the error can be significant when the field is high.
+ * Solution: implement a self-consistent electric field into PME.
+ */
+std::unique_ptr<IMDModule> createElectricFieldModule();
+
+} // namespace gmx
+
+#endif
diff --git a/src/gromacs/applied-forces/tests/CMakeLists.txt b/src/gromacs/applied-forces/tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..3788986
--- /dev/null
@@ -0,0 +1,37 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2015,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.
+
+gmx_add_unit_test(AppliedForcesUnitTest applied-forces-test
+                  electricfield.cpp
+                )
diff --git a/src/gromacs/applied-forces/tests/electricfield.cpp b/src/gromacs/applied-forces/tests/electricfield.cpp
new file mode 100644 (file)
index 0000000..b2ab943
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Tests for functionality of the "angle" trajectory analysis module.
+ *
+ * \author David van der Spoel <david.vanderspoel@icm.uu.se>
+ * \ingroup module_applied_forces
+ */
+#include "gmxpre.h"
+
+#include "gromacs/applied-forces/electricfield.h"
+
+#include <gtest/gtest.h>
+
+#include "gromacs/gmxlib/network.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/mdlib/forcerec.h"
+#include "gromacs/mdtypes/forcerec.h"
+#include "gromacs/mdtypes/iforceprovider.h"
+#include "gromacs/mdtypes/imdmodule.h"
+#include "gromacs/mdtypes/imdpoptionprovider.h"
+#include "gromacs/mdtypes/inputrec.h"
+#include "gromacs/mdtypes/mdatom.h"
+#include "gromacs/options/options.h"
+#include "gromacs/options/treesupport.h"
+#include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/keyvaluetreebuilder.h"
+#include "gromacs/utility/keyvaluetreetransform.h"
+#include "gromacs/utility/real.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/stringcompare.h"
+#include "gromacs/utility/stringutil.h"
+
+#include "testutils/testasserts.h"
+
+namespace
+{
+
+/********************************************************************
+ * ElectricFieldTest
+ */
+
+class ElectricFieldTest : public ::testing::Test
+{
+    public:
+        void test(int  dim,
+                  real E0,
+                  real omega,
+                  real t0,
+                  real sigma,
+                  real expectedValue)
+        {
+            gmx::test::FloatingPointTolerance tolerance(
+                    gmx::test::relativeToleranceAsFloatingPoint(1.0, 0.005));
+            auto                              module(gmx::createElectricFieldModule());
+
+            // Prepare MDP inputs
+            const char *dimXYZ[3] = { "x", "y", "z" };
+            GMX_RELEASE_ASSERT(dim >= 0 && dim < DIM, "Dimension should be 0, 1 or 2");
+
+            gmx::KeyValueTreeBuilder     mdpValues;
+            mdpValues.rootObject().addValue(gmx::formatString("E%s", dimXYZ[dim]),
+                                            gmx::formatString("1 %g 0", E0));
+            mdpValues.rootObject().addValue(gmx::formatString("E%s-t", dimXYZ[dim]),
+                                            gmx::formatString("3 %g 0 %g 0 %g 0", omega, t0, sigma));
+
+            gmx::KeyValueTreeTransformer transform;
+            transform.rules()->addRule()
+                .keyMatchType("/", gmx::StringCompareType::CaseAndDashInsensitive);
+            module->mdpOptionProvider()->initMdpTransform(transform.rules());
+            auto         result = transform.transform(mdpValues.build(), nullptr);
+            gmx::Options moduleOptions;
+            module->mdpOptionProvider()->initMdpOptions(&moduleOptions);
+            gmx::assignOptionsFromKeyValueTree(&moduleOptions, result.object(), nullptr);
+
+            ForceProviders forceProviders;
+            module->initForceProviders(&forceProviders);
+
+            t_mdatoms        md;
+            PaddedRVecVector f = { { 0, 0, 0 } };
+            md.homenr = 1;
+            snew(md.chargeA, md.homenr);
+            md.chargeA[0] = 1;
+
+            t_commrec  *cr = init_commrec();
+            forceProviders.calculateForces(cr, &md, nullptr, 0, nullptr,
+                                           gmx::EmptyArrayRef(), f);
+            done_commrec(cr);
+
+            EXPECT_REAL_EQ_TOL(f[0][dim], expectedValue, tolerance);
+            sfree(md.chargeA);
+        }
+};
+
+TEST_F(ElectricFieldTest, Static)
+{
+    test(0, 1, 0, 0, 0, 96.4853363);
+}
+
+TEST_F(ElectricFieldTest, Oscillating)
+{
+    test(0, 1, 5, 0.2, 0, 96.4853363);
+}
+
+TEST_F(ElectricFieldTest, Pulsed)
+{
+    test(0, 1, 5, 0.5, 1, -68.215782);
+}
+
+} // namespace
index 59d776e4d10f9ba12462d96d521f142190dbe840..5d81d9a878bd052c9c3806128c05eed6eff6854e 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,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.
@@ -61,7 +61,7 @@ namespace
  *
  * \ingroup module_commandline
  */
-const CommandLineHelpContext *g_globalContext = NULL;
+const CommandLineHelpContext *g_globalContext = nullptr;
 
 }   // namespace
 
@@ -77,13 +77,13 @@ class CommandLineHelpContext::Impl
         Impl(TextWriter *writer, HelpOutputFormat format,
              const HelpLinks *links)
             : writerContext_(writer, format, links), moduleDisplayName_("gmx"),
-              completionWriter_(NULL), bHidden_(false)
+              completionWriter_(nullptr), bHidden_(false)
         {
         }
         //! Creates an implementation class from a low-level context.
         explicit Impl(const HelpWriterContext &writerContext)
             : writerContext_(writerContext),
-              completionWriter_(NULL), bHidden_(false)
+              completionWriter_(nullptr), bHidden_(false)
         {
         }
 
@@ -113,7 +113,7 @@ CommandLineHelpContext::CommandLineHelpContext(
 
 CommandLineHelpContext::CommandLineHelpContext(
         ShellCompletionWriter *writer)
-    : impl_(new Impl(&writer->outputWriter(), eHelpOutputFormat_Other, NULL))
+    : impl_(new Impl(&writer->outputWriter(), eHelpOutputFormat_Other, nullptr))
 {
     impl_->completionWriter_ = writer;
 }
@@ -173,7 +173,7 @@ bool CommandLineHelpContext::showHidden() const
 
 bool CommandLineHelpContext::isCompletionExport() const
 {
-    return impl_->completionWriter_ != NULL;
+    return impl_->completionWriter_ != nullptr;
 }
 
 ShellCompletionWriter &CommandLineHelpContext::shellCompletionWriter() const
@@ -196,14 +196,14 @@ const CommandLineHelpContext *GlobalCommandLineHelpContext::get()
 GlobalCommandLineHelpContext::GlobalCommandLineHelpContext(
         const CommandLineHelpContext &context)
 {
-    GMX_RELEASE_ASSERT(g_globalContext == NULL,
+    GMX_RELEASE_ASSERT(g_globalContext == nullptr,
                        "Global context set more than once");
     g_globalContext = &context;
 }
 
 GlobalCommandLineHelpContext::~GlobalCommandLineHelpContext()
 {
-    g_globalContext = NULL;
+    g_globalContext = nullptr;
 }
 
 } // namespace gmx
index 054b5b3530ee4b2a37f7ff8b9907c7d07a9b9b17..3157da330549b06e9e08833fe6d1f8b1286d1747 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,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.
@@ -108,7 +108,7 @@ class RootHelpTopic : public AbstractCompositeHelpTopic
         {
             if (bExported)
             {
-                exportedTopics_.push_back(topic->name());
+                exportedTopics_.emplace_back(topic->name());
             }
             addSubTopic(std::move(topic));
         }
@@ -277,7 +277,7 @@ void RootHelpTopic::exportHelp(IHelpExport *exporter)
          ++topicName)
     {
         const IHelpTopic *topic = findSubTopic(topicName->c_str());
-        GMX_RELEASE_ASSERT(topic != NULL, "Exported help topic no longer found");
+        GMX_RELEASE_ASSERT(topic != nullptr, "Exported help topic no longer found");
         exporter->exportTopic(*topic);
     }
     // For now, the title is only set for the export to make it not appear in
@@ -331,7 +331,7 @@ void RootHelpTopic::writeHelp(const HelpWriterContext &context) const
 CommandLineHelpContext
 RootHelpTopic::createContext(const HelpWriterContext &context) const
 {
-    if (helpModule_.context_ != NULL)
+    if (helpModule_.context_ != nullptr)
     {
         return CommandLineHelpContext(*helpModule_.context_);
     }
@@ -370,7 +370,7 @@ class CommandsHelpTopic : public IHelpTopic
         virtual bool hasSubTopics() const { return false; }
         virtual const IHelpTopic *findSubTopic(const char * /*name*/) const
         {
-            return NULL;
+            return nullptr;
         }
 
         virtual void writeHelp(const HelpWriterContext &context) const;
@@ -394,7 +394,7 @@ void CommandsHelpTopic::writeHelp(const HelpWriterContext &context) const
     for (module = modules.begin(); module != modules.end(); ++module)
     {
         int nameLength = static_cast<int>(module->first.length());
-        if (module->second->shortDescription() != NULL
+        if (module->second->shortDescription() != nullptr
             && nameLength > maxNameLength)
         {
             maxNameLength = nameLength;
@@ -405,14 +405,14 @@ void CommandsHelpTopic::writeHelp(const HelpWriterContext &context) const
             "Available commands:");
     TextWriter        &file = context.outputFile();
     TextTableFormatter formatter;
-    formatter.addColumn(NULL, maxNameLength + 1, false);
-    formatter.addColumn(NULL, 72 - maxNameLength, true);
+    formatter.addColumn(nullptr, maxNameLength + 1, false);
+    formatter.addColumn(nullptr, 72 - maxNameLength, true);
     formatter.setFirstColumnIndent(4);
     for (module = modules.begin(); module != modules.end(); ++module)
     {
         const char *name        = module->first.c_str();
         const char *description = module->second->shortDescription();
-        if (description != NULL)
+        if (description != nullptr)
         {
             formatter.clear();
             formatter.addColumnLine(0, name);
@@ -448,11 +448,11 @@ class ModuleHelpTopic : public IHelpTopic
         }
 
         virtual const char *name() const { return module_.name(); }
-        virtual const char *title() const { return NULL; }
+        virtual const char *title() const { return nullptr; }
         virtual bool hasSubTopics() const { return false; }
         virtual const IHelpTopic *findSubTopic(const char * /*name*/) const
         {
-            return NULL;
+            return nullptr;
         }
         virtual void writeHelp(const HelpWriterContext &context) const;
 
@@ -495,7 +495,7 @@ void initProgramLinks(HelpLinks *links, const CommandLineHelpModuleImpl &helpMod
          module != helpModule.modules_.end();
          ++module)
     {
-        if (module->second->shortDescription() != NULL)
+        if (module->second->shortDescription() != nullptr)
         {
             std::string linkName("[gmx-" + module->first + "]");
             const char *name = module->first.c_str();
@@ -553,7 +553,8 @@ HelpExportReStructuredText::HelpExportReStructuredText(
 {
     TextReader   linksFile("links.dat");
     std::string  line;
-    while (linksFile.readLineTrimmed(&line))
+    linksFile.setTrimTrailingWhiteSpace(true);
+    while (linksFile.readLine(&line))
     {
         links_.addLink("[REF]." + line + "[ref]",
                        formatString(":ref:`.%s <%s>`", line.c_str(), line.c_str()),
@@ -743,7 +744,7 @@ void HelpExportCompletion::exportModuleHelp(
         const std::string                 & /*tag*/,
         const std::string                 & /*displayName*/)
 {
-    modules_.push_back(module.name());
+    modules_.emplace_back(module.name());
     {
         CommandLineHelpContext context(&bashWriter_);
         // We use the display name to pass the name of the module to the
@@ -774,7 +775,7 @@ CommandLineHelpModuleImpl::CommandLineHelpModuleImpl(
         const CommandLineModuleGroupList &groups)
     : rootTopic_(*this), programContext_(programContext),
       binaryName_(binaryName), modules_(modules), groups_(groups),
-      context_(NULL), moduleOverride_(NULL), bHidden_(false),
+      context_(nullptr), moduleOverride_(nullptr), bHidden_(false),
       outputRedirector_(&defaultFileOutputRedirector())
 {
 }
@@ -806,7 +807,7 @@ void CommandLineHelpModuleImpl::exportHelp(IHelpExport *exporter)
     CommandLineModuleMap::const_iterator module;
     for (module = modules_.begin(); module != modules_.end(); ++module)
     {
-        if (module->second->shortDescription() != NULL)
+        if (module->second->shortDescription() != nullptr)
         {
             const char *const moduleName = module->first.c_str();
             std::string       tag(formatString("%s-%s", program, moduleName));
@@ -949,7 +950,7 @@ int CommandLineHelpModule::run(int argc, char *argv[])
 
     const char *const exportFormats[] = { "rst", "completion" };
     std::string       exportFormat;
-    Options           options(NULL, NULL);
+    Options           options;
     options.addOption(StringOption("export").store(&exportFormat)
                           .enumValue(exportFormats));
     CommandLineParser(&options).parse(&argc, argv);
@@ -969,7 +970,7 @@ int CommandLineHelpModule::run(int argc, char *argv[])
     CommandLineHelpContext context(&writer, eHelpOutputFormat_Console, &links,
                                    impl_->binaryName_);
     context.setShowHidden(impl_->bHidden_);
-    if (impl_->moduleOverride_ != NULL)
+    if (impl_->moduleOverride_ != nullptr)
     {
         context.setModuleDisplayName(impl_->programContext_.displayName());
         impl_->moduleOverride_->writeHelp(context);
index 275f70fb9d4fe1363b27ef483b1b46cbd413a384..43151ce5fc4145451ff5ddc88b829d8474a22816 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -120,7 +120,7 @@ class OptionsFilter : public OptionsVisitor
          * Does not throw.
          */
         OptionsFilter()
-            : formatter_(NULL), filterType_(eSelectOtherOptions),
+            : formatter_(nullptr), filterType_(eSelectOtherOptions),
               bShowHidden_(false)
         {
         }
@@ -136,7 +136,7 @@ class OptionsFilter : public OptionsVisitor
                             IOptionsFormatter         *formatter,
                             const Options             &options);
 
-        virtual void visitSubSection(const Options &section);
+        virtual void visitSection(const OptionSectionInfo &section);
         virtual void visitOption(const OptionInfo &option);
 
     private:
@@ -153,13 +153,13 @@ void OptionsFilter::formatSelected(FilterType                 type,
 {
     formatter_  = formatter;
     filterType_ = type;
-    visitSubSection(options);
+    visitSection(options.rootSection());
 }
 
-void OptionsFilter::visitSubSection(const Options &section)
+void OptionsFilter::visitSection(const OptionSectionInfo &section)
 {
     OptionsIterator iterator(section);
-    iterator.acceptSubSections(this);
+    iterator.acceptSections(this);
     iterator.acceptOptions(this);
 }
 
@@ -170,7 +170,7 @@ void OptionsFilter::visitOption(const OptionInfo &option)
         return;
     }
     const FileNameOptionInfo *const fileOption = option.toType<FileNameOptionInfo>();
-    if (fileOption != NULL && fileOption->isInputFile())
+    if (fileOption != nullptr && fileOption->isInputFile())
     {
         if (filterType_ == eSelectInputFileOptions)
         {
@@ -178,7 +178,7 @@ void OptionsFilter::visitOption(const OptionInfo &option)
         }
         return;
     }
-    if (fileOption != NULL && fileOption->isInputOutputFile())
+    if (fileOption != nullptr && fileOption->isInputOutputFile())
     {
         if (filterType_ == eSelectInputOutputFileOptions)
         {
@@ -186,7 +186,7 @@ void OptionsFilter::visitOption(const OptionInfo &option)
         }
         return;
     }
-    if (fileOption != NULL && fileOption->isOutputFile())
+    if (fileOption != nullptr && fileOption->isOutputFile())
     {
         if (filterType_ == eSelectOutputFileOptions)
         {
@@ -248,27 +248,9 @@ void formatOptionNameAndValue(const OptionInfo &option, std::string *name,
 }
 
 //! Formats the default option value as a string.
-std::string
-defaultOptionValue(const OptionInfo &option)
+std::string defaultOptionValue(const OptionInfo &option)
 {
-    if (option.valueCount() == 0
-        || (option.valueCount() == 1 && option.formatValue(0).empty()))
-    {
-        return option.formatDefaultValueIfSet();
-    }
-    else
-    {
-        std::string result;
-        for (int i = 0; i < option.valueCount(); ++i)
-        {
-            if (i != 0)
-            {
-                result.append(" ");
-            }
-            result.append(option.formatValue(i));
-        }
-        return result;
-    }
+    return joinStrings(option.defaultValuesAsStrings(), " ");
 }
 
 //! Formats the flags for a file option as a string.
@@ -300,8 +282,8 @@ descriptionWithOptionDetails(const CommonFormatterData &common,
 
     const FloatOptionInfo  *floatOption  = option.toType<FloatOptionInfo>();
     const DoubleOptionInfo *doubleOption = option.toType<DoubleOptionInfo>();
-    if ((floatOption != NULL && floatOption->isTime())
-        || (doubleOption != NULL && doubleOption->isTime()))
+    if ((floatOption != nullptr && floatOption->isTime())
+        || (doubleOption != nullptr && doubleOption->isTime()))
     {
         // TODO: It could be nicer to have this in basicoptions.cpp.
         description = replaceAll(description, "%t", common.timeUnit);
@@ -434,14 +416,14 @@ class OptionsListFormatter : public IOptionsFormatter
     private:
         void writeSectionStartIfNecessary()
         {
-            if (title_ != NULL)
+            if (title_ != nullptr)
             {
                 context_.writeTitle(title_);
-                title_ = NULL;
+                title_ = nullptr;
             }
             if (!bDidOutput_)
             {
-                if (header_ != NULL)
+                if (header_ != nullptr)
                 {
                     context_.paragraphBreak();
                     context_.writeTextBlock(header_);
@@ -466,7 +448,7 @@ OptionsListFormatter::OptionsListFormatter(
         const CommonFormatterData &common,
         const char                *title)
     : context_(context), common_(common),
-      title_(title), header_(NULL), bDidOutput_(false)
+      title_(title), header_(nullptr), bDidOutput_(false)
 {
 }
 
@@ -478,7 +460,7 @@ void OptionsListFormatter::formatOption(const OptionInfo &option)
     std::string               defaultValue(defaultOptionValue(option));
     std::string               info;
     const FileNameOptionInfo *fileOption = option.toType<FileNameOptionInfo>();
-    if (fileOption != NULL)
+    if (fileOption != nullptr)
     {
         const bool bAbbrev = (context_.outputFormat() == eHelpOutputFormat_Console);
         info = fileOptionFlagsAsString(*fileOption, bAbbrev);
index 2915f0aacbf5aae8fab6d1b6defd301e920ae82c..e59cb866248ee664ddbf57260a662daf8834c0d1 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,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.
@@ -141,9 +141,9 @@ CommandLineProgramContext &initForCommandLine(int *argc, char ***argv)
 void finalizeForCommandLine()
 {
     gmx::finalize();
-    setLibraryFileFinder(NULL);
+    setLibraryFileFinder(nullptr);
     g_libFileFinder.reset();
-    setProgramContext(NULL);
+    setProgramContext(nullptr);
     g_commandLineContext.reset();
 }
 
index 0019a324da66df3b0408b503471c01e5d86a34ca..9050a5a6901c0ed8eaaa1f57df1ef0b91a9af230 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,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.
@@ -84,7 +84,7 @@ void writeCommandLineHelpCMain(
     int   argc = 1;
     // TODO: The constness should not be cast away.
     argv[0] = const_cast<char *>(name);
-    argv[1] = NULL;
+    argv[1] = nullptr;
     GlobalCommandLineHelpContext global(context);
     mainFunction(argc, argv);
 }
index 71180bfbb52eb2483d8e412fda0536fe3d720738..45a06cef72e12ea7262b91396d1791fce2a71711 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,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.
@@ -153,7 +153,7 @@ class CMainCommandLineModule : public ICommandLineModule
  */
 
 CommandLineCommonOptionsHolder::CommandLineCommonOptionsHolder()
-    : options_(NULL, NULL), bHelp_(false), bHidden_(false),
+    : bHelp_(false), bHidden_(false),
       bQuiet_(false), bVersion_(false), bCopyright_(true),
       niceLevel_(19), bNiceSet_(false), bBackup_(true), bFpexcept_(false),
       debugLevel_(0)
@@ -316,8 +316,8 @@ class CommandLineModuleManager::Impl
 CommandLineModuleManager::Impl::Impl(const char                *binaryName,
                                      CommandLineProgramContext *programContext)
     : programContext_(*programContext),
-      binaryName_(binaryName != NULL ? binaryName : ""),
-      helpModule_(NULL), singleModule_(NULL),
+      binaryName_(binaryName != nullptr ? binaryName : ""),
+      helpModule_(nullptr), singleModule_(nullptr),
       bQuiet_(false)
 {
     GMX_RELEASE_ASSERT(binaryName_.find('-') == std::string::npos,
@@ -337,7 +337,7 @@ void CommandLineModuleManager::Impl::addModule(CommandLineModulePointer module)
 
 void CommandLineModuleManager::Impl::ensureHelpModuleExists()
 {
-    if (helpModule_ == NULL)
+    if (helpModule_ == nullptr)
     {
         helpModule_ = new CommandLineHelpModule(programContext_, binaryName_,
                                                 modules_, moduleGroups_);
@@ -362,7 +362,7 @@ CommandLineModuleManager::Impl::processCommonOptions(
     // TODO: It would be nice to propagate at least the -quiet option to
     // the modules so that they can also be quiet in response to this.
 
-    if (module == NULL)
+    if (module == nullptr)
     {
         // If not in single-module mode, process options to the wrapper binary.
         // TODO: Ideally, this could be done by CommandLineParser.
@@ -395,9 +395,9 @@ CommandLineModuleManager::Impl::processCommonOptions(
             // which path is taken: (*argv)[0] is the module name.
         }
     }
-    if (module != NULL)
+    if (module != nullptr)
     {
-        if (singleModule_ == NULL)
+        if (singleModule_ == nullptr)
         {
             programContext_.setDisplayName(binaryName_ + " " + module->name());
         }
@@ -409,14 +409,14 @@ CommandLineModuleManager::Impl::processCommonOptions(
     }
     if (!optionsHolder->finishOptions())
     {
-        return NULL;
+        return nullptr;
     }
     // If no module specified and no other action, show the help.
     // Also explicitly specifying -h for the wrapper binary goes here.
-    if (module == NULL || optionsHolder->shouldShowHelp())
+    if (module == nullptr || optionsHolder->shouldShowHelp())
     {
         ensureHelpModuleExists();
-        if (module != NULL)
+        if (module != nullptr)
         {
             helpModule_->setModuleOverride(*module);
         }
@@ -536,7 +536,7 @@ int CommandLineModuleManager::run(int argc, char *argv[])
                                optionsHolder.binaryInfoSettings());
         fprintf(out, "\n");
     }
-    if (module == NULL)
+    if (module == nullptr)
     {
         return 0;
     }
@@ -596,7 +596,7 @@ int CommandLineModuleManager::runAsMainSingleModule(
     CommandLineProgramContext &programContext = gmx::initForCommandLine(&argc, &argv);
     try
     {
-        CommandLineModuleManager manager(NULL, &programContext);
+        CommandLineModuleManager manager(nullptr, &programContext);
         manager.setSingleModule(module);
         int rc = manager.run(argc, argv);
         gmx::finalizeForCommandLine();
@@ -636,10 +636,10 @@ void CommandLineModuleGroupData::addModule(const char *name,
     CommandLineModuleMap::const_iterator moduleIter = allModules_.find(name);
     GMX_RELEASE_ASSERT(moduleIter != allModules_.end(),
                        "Non-existent module added to a group");
-    if (description == NULL)
+    if (description == nullptr)
     {
         description = moduleIter->second->shortDescription();
-        GMX_RELEASE_ASSERT(description != NULL,
+        GMX_RELEASE_ASSERT(description != nullptr,
                            "Module without a description added to a group");
     }
     std::string       tag(formatString("%s-%s", binaryName_, name));
@@ -652,7 +652,7 @@ void CommandLineModuleGroupData::addModule(const char *name,
 
 void CommandLineModuleGroup::addModule(const char *name)
 {
-    impl_->addModule(name, NULL);
+    impl_->addModule(name, nullptr);
 }
 
 void CommandLineModuleGroup::addModuleWithDescription(const char *name,
index ed87db95422c6780692fc6c42238c2367ba97836..f0e6db73a3618fe08bbd12d12e22475f13e4875c 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,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.
@@ -131,7 +131,7 @@ void CommandLineOptionsModule::init(CommandLineModuleSettings *settings)
 {
     if (!module_)
     {
-        GMX_RELEASE_ASSERT(factory_ != NULL, "Neither factory nor module provided");
+        GMX_RELEASE_ASSERT(factory_ != nullptr, "Neither factory nor module provided");
         module_ = factory_();
     }
     module_->init(settings);
@@ -150,11 +150,11 @@ void CommandLineOptionsModule::writeHelp(const CommandLineHelpContext &context)
     ICommandLineOptionsModule        *module = module_.get();
     if (!module)
     {
-        GMX_RELEASE_ASSERT(factory_ != NULL, "Neither factory nor module provided");
+        GMX_RELEASE_ASSERT(factory_ != nullptr, "Neither factory nor module provided");
         moduleGuard = factory_();
         module      = moduleGuard.get();
     }
-    Options                          options(name(), shortDescription());
+    Options                          options;
     OptionsBehaviorCollection        behaviors(&options);
     CommandLineOptionsModuleSettings settings(&behaviors);
     module->initOptions(&options, &settings);
@@ -166,7 +166,7 @@ void CommandLineOptionsModule::writeHelp(const CommandLineHelpContext &context)
 void CommandLineOptionsModule::parseOptions(int argc, char *argv[])
 {
     FileNameOptionManager fileoptManager;
-    Options               options(name_, description_);
+    Options               options;
 
     options.addManager(&fileoptManager);
 
index 2db9afd01666db2d72928446d0a6bef83241cfb7..91b48717e4904a1021597664893c8087737714c8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,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.
@@ -97,7 +97,7 @@ const char *CommandLineParser::Impl::toOptionName(const char *arg) const
     // Lone '-' or '--' is not an option.
     if (arg[0] != '-' || arg[1] == '\0' || (arg[1] == '-' && arg[2] == '\0'))
     {
-        return NULL;
+        return nullptr;
     }
     // Something starting with '--' is always an option.
     if (arg[1] == '-')
@@ -110,7 +110,7 @@ const char *CommandLineParser::Impl::toOptionName(const char *arg) const
     GMX_IGNORE_RETURN_VALUE(std::strtod(arg, &endptr));
     if (*endptr == '\0')
     {
-        return NULL;
+        return nullptr;
     }
     return arg + 1;
 }
@@ -142,11 +142,11 @@ void CommandLineParser::parse(int *argc, char *argv[])
 
     impl_->assigner_.start();
     int newi = 1;
-    for (int i = 1; i != *argc; ++i)
+    for (int i = 1; i < *argc; ++i)
     {
         const char *const arg        = argv[i];
         const char *const optionName = impl_->toOptionName(arg);
-        if (optionName != NULL)
+        if (optionName != nullptr)
         {
             if (bInOption)
             {
@@ -213,7 +213,7 @@ void CommandLineParser::parse(int *argc, char *argv[])
     if (impl_->bSkipUnknown_)
     {
         *argc      = newi;
-        argv[newi] = NULL;
+        argv[newi] = nullptr;
     }
     // Finish the last option.
     if (bInOption)
index 7d61b0c0715bfb4a769ecbfc5037e47046d65985..dc15cd2df794c62a54e233beb15f78305302e9c1 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,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.
@@ -75,7 +75,7 @@ namespace
  */
 std::string quoteIfNecessary(const char *str)
 {
-    const bool bSpaces = (std::strchr(str, ' ') != NULL);
+    const bool bSpaces = (std::strchr(str, ' ') != nullptr);
     if (bSpaces)
     {
         return formatString("'%s'", str);
index f8b5e55282807846ec925b42e2ab0150194ee19b..cbda55311ff5e91b4d9435ee27bb6666288015ff 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,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.
@@ -62,7 +62,7 @@ const t_filenm *getFilenm(const char *opt, int nfile, const t_filenm fnm[])
         }
     }
 
-    return NULL;
+    return nullptr;
 }
 
 const char *opt2fn(const char *opt, int nfile, const t_filenm fnm[])
@@ -79,7 +79,7 @@ const char *opt2fn(const char *opt, int nfile, const t_filenm fnm[])
 
     fprintf(stderr, "No option %s\n", opt);
 
-    return NULL;
+    return nullptr;
 }
 
 int opt2fns(char **fns[], const char *opt, int nfile, const t_filenm fnm[])
@@ -112,7 +112,7 @@ const char *ftp2fn(int ftp, int nfile, const t_filenm fnm[])
     }
 
     fprintf(stderr, "ftp2fn: No filetype %s\n", ftp2ext_with_dot(ftp));
-    return NULL;
+    return nullptr;
 }
 
 int ftp2fns(char **fns[], int ftp, int nfile, const t_filenm fnm[])
@@ -176,7 +176,7 @@ const char *opt2fn_null(const char *opt, int nfile, const t_filenm fnm[])
         {
             if (IS_OPT(fnm[i]) && !IS_SET(fnm[i]))
             {
-                return NULL;
+                return nullptr;
             }
             else
             {
@@ -185,7 +185,7 @@ const char *opt2fn_null(const char *opt, int nfile, const t_filenm fnm[])
         }
     }
     fprintf(stderr, "No option %s\n", opt);
-    return NULL;
+    return nullptr;
 }
 
 const char *ftp2fn_null(int ftp, int nfile, const t_filenm fnm[])
@@ -198,7 +198,7 @@ const char *ftp2fn_null(int ftp, int nfile, const t_filenm fnm[])
         {
             if (IS_OPT(fnm[i]) && !IS_SET(fnm[i]))
             {
-                return NULL;
+                return nullptr;
             }
             else
             {
@@ -207,7 +207,7 @@ const char *ftp2fn_null(int ftp, int nfile, const t_filenm fnm[])
         }
     }
     fprintf(stderr, "ftp2fn: No filetype %s\n", ftp2ext_with_dot(ftp));
-    return NULL;
+    return nullptr;
 }
 
 gmx_bool is_optional(const t_filenm *fnm)
@@ -266,7 +266,7 @@ t_filenm *dup_tfn(int nf, const t_filenm tfn[])
         }
         else
         {
-            ret[i].opt = NULL;
+            ret[i].opt = nullptr;
         }
 
         if (tfn[i].fn)
@@ -275,7 +275,7 @@ t_filenm *dup_tfn(int nf, const t_filenm tfn[])
         }
         else
         {
-            ret[i].fn = NULL;
+            ret[i].fn = nullptr;
         }
 
         if (tfn[i].nfiles > 0)
@@ -301,6 +301,6 @@ void done_filenms(int nf, t_filenm fnm[])
             sfree(fnm[i].fns[j]);
         }
         sfree(fnm[i].fns);
-        fnm[i].fns = NULL;
+        fnm[i].fns = nullptr;
     }
 }
index 1ca8470663085dac0d7b56f5a09ddad402d11221..68b0fe3d478cf42f67610c64669eac85d56b2052 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,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.
@@ -47,7 +47,6 @@
 #include "gromacs/fileio/filetypes.h"
 #include "gromacs/utility/basedefinitions.h"
 
-struct t_commrec;
 
 //! \addtogroup module_commandline
 //! \{
index 8fd3da8f470efc9d4d7b8f477524192962d26afb..71ea05b52ca6f05c5341ecfc0dbabed71f95c965 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,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.
@@ -149,10 +149,10 @@ const char *opt2parg_str(const char *option, int nparg, t_pargs pa[])
 
     gmx_fatal(FARGS, "No string option %s in pargs", option);
 
-    return NULL;
+    return nullptr;
 }
 
-gmx_bool opt2parg_bSet(const char *option, int nparg, t_pargs pa[])
+gmx_bool opt2parg_bSet(const char *option, int nparg, const t_pargs *pa)
 {
     int i;
 
@@ -183,7 +183,7 @@ const char *opt2parg_enum(const char *option, int nparg, t_pargs pa[])
 
     gmx_fatal(FARGS, "No such option %s in pargs", option);
 
-    return NULL;
+    return nullptr;
 }
 
 /********************************************************************
@@ -204,13 +204,13 @@ namespace
 int getDefaultXvgFormat(gmx::ConstArrayRef<const char *> xvgFormats)
 {
     const char *const select = getenv("GMX_VIEW_XVG");
-    if (select != NULL)
+    if (select != nullptr)
     {
         ConstArrayRef<const char *>::const_iterator i =
             std::find(xvgFormats.begin(), xvgFormats.end(), std::string(select));
         if (i != xvgFormats.end())
         {
-            return i - xvgFormats.begin();
+            return std::distance(xvgFormats.begin(), i);
         }
         else
         {
@@ -272,7 +272,7 @@ class OptionsAdapter
         struct FileNameData
         {
             //! Creates a conversion helper for a given `t_filenm` struct.
-            explicit FileNameData(t_filenm *fnm) : fnm(fnm), optionInfo(NULL)
+            explicit FileNameData(t_filenm *fnm) : fnm(fnm), optionInfo(nullptr)
             {
             }
 
@@ -287,7 +287,7 @@ class OptionsAdapter
         {
             //! Creates a conversion helper for a given `t_pargs` struct.
             explicit ProgramArgData(t_pargs *pa)
-                : pa(pa), optionInfo(NULL), enumIndex(0), boolValue(false)
+                : pa(pa), optionInfo(nullptr), enumIndex(0), boolValue(false)
             {
             }
 
@@ -316,7 +316,7 @@ class OptionsAdapter
 
 void OptionsAdapter::filenmToOptions(Options *options, t_filenm *fnm)
 {
-    if (fnm->opt == NULL)
+    if (fnm->opt == nullptr)
     {
         // Existing code may use opt2fn() instead of ftp2fn() for
         // options that use the default option name, so we need to
@@ -334,7 +334,7 @@ void OptionsAdapter::filenmToOptions(Options *options, t_filenm *fnm)
     const char *const name      = &fnm->opt[1];
     const char *      defName   = fnm->fn;
     int               defType   = -1;
-    if (defName == NULL)
+    if (defName == nullptr)
     {
         defName = ftp2defnm(fnm->ftp);
     }
@@ -344,7 +344,7 @@ void OptionsAdapter::filenmToOptions(Options *options, t_filenm *fnm)
         GMX_RELEASE_ASSERT(defType != efNR,
                            "File name option specifies an invalid extension");
     }
-    fileNameOptions_.push_back(FileNameData(fnm));
+    fileNameOptions_.emplace_back(fnm);
     FileNameData &data = fileNameOptions_.back();
     data.optionInfo = options->addOption(
                 FileNameOption(name).storeVector(&data.values)
@@ -361,7 +361,7 @@ void OptionsAdapter::pargsToOptions(Options *options, t_pargs *pa)
     const bool        bHidden = startsWith(pa->desc, "HIDDEN");
     const char *const name    = &pa->option[1];
     const char *const desc    = (bHidden ? &pa->desc[6] : pa->desc);
-    programArgs_.push_back(ProgramArgData(pa));
+    programArgs_.emplace_back(pa);
     ProgramArgData   &data = programArgs_.back();
     switch (pa->type)
     {
@@ -387,7 +387,7 @@ void OptionsAdapter::pargsToOptions(Options *options, t_pargs *pa)
             return;
         case etSTR:
         {
-            const char *const defValue = (*pa->u.c != NULL ? *pa->u.c : "");
+            const char *const defValue = (*pa->u.c != nullptr ? *pa->u.c : "");
             data.optionInfo = options->addOption(
                         StringOption(name).store(&data.stringValue)
                             .defaultValue(defValue)
@@ -407,7 +407,7 @@ void OptionsAdapter::pargsToOptions(Options *options, t_pargs *pa)
             return;
         case etENUM:
         {
-            const int defaultIndex = (pa->u.c[0] != NULL ? nenum(pa->u.c) - 1 : 0);
+            const int defaultIndex = (pa->u.c[0] != nullptr ? nenum(pa->u.c) - 1 : 0);
             data.optionInfo = options->addOption(
                         EnumIntOption(name).store(&data.enumIndex)
                             .defaultValue(defaultIndex)
@@ -483,9 +483,10 @@ gmx_bool parse_common_args(int *argc, char *argv[], unsigned long Flags,
     /* This array should match the order of the enum in oenv.h */
     const char *const xvg_formats[] = { "xmgrace", "xmgr", "none" };
 
-    // Handle the flags argument, which is a bit field
-    // The FF macro returns whether or not the bit is set
-#define FF(arg) ((Flags & arg) == arg)
+    // Lambda function to test the (local) Flags parameter against a bit mask.
+    auto isFlagSet = [Flags](unsigned long bits) {
+            return (Flags & bits) == bits;
+        };
 
     try
     {
@@ -494,33 +495,33 @@ gmx_bool parse_common_args(int *argc, char *argv[], unsigned long Flags,
         bool                            bView         = false;
         int                             xvgFormat     = 0;
         gmx::OptionsAdapter             adapter(*argc, argv);
-        gmx::Options                    options(NULL, NULL);
+        gmx::Options                    options;
         gmx::OptionsBehaviorCollection  behaviors(&options);
         gmx::FileNameOptionManager      fileOptManager;
 
         fileOptManager.disableInputOptionChecking(
-                FF(PCA_NOT_READ_NODE) || FF(PCA_DISABLE_INPUT_FILE_CHECKING));
+                isFlagSet(PCA_NOT_READ_NODE) || isFlagSet(PCA_DISABLE_INPUT_FILE_CHECKING));
         options.addManager(&fileOptManager);
 
-        if (FF(PCA_CAN_SET_DEFFNM))
+        if (isFlagSet(PCA_CAN_SET_DEFFNM))
         {
             fileOptManager.addDefaultFileNameOption(&options, "deffnm");
         }
-        if (FF(PCA_CAN_BEGIN))
+        if (isFlagSet(PCA_CAN_BEGIN))
         {
             options.addOption(
                     gmx::DoubleOption("b")
                         .store(&tbegin).storeIsSet(&bBeginTimeSet).timeValue()
                         .description("First frame (%t) to read from trajectory"));
         }
-        if (FF(PCA_CAN_END))
+        if (isFlagSet(PCA_CAN_END))
         {
             options.addOption(
                     gmx::DoubleOption("e")
                         .store(&tend).storeIsSet(&bEndTimeSet).timeValue()
                         .description("Last frame (%t) to read from trajectory"));
         }
-        if (FF(PCA_CAN_DT))
+        if (isFlagSet(PCA_CAN_DT))
         {
             options.addOption(
                     gmx::DoubleOption("dt")
@@ -528,7 +529,7 @@ gmx_bool parse_common_args(int *argc, char *argv[], unsigned long Flags,
                         .description("Only use frame when t MOD dt = first time (%t)"));
         }
         gmx::TimeUnit  timeUnit = gmx::TimeUnit_Default;
-        if (FF(PCA_TIME_UNIT))
+        if (isFlagSet(PCA_TIME_UNIT))
         {
             std::shared_ptr<gmx::TimeUnitBehavior> timeUnitBehavior(
                     new gmx::TimeUnitBehavior());
@@ -537,7 +538,7 @@ gmx_bool parse_common_args(int *argc, char *argv[], unsigned long Flags,
             timeUnitBehavior->addTimeUnitOption(&options, "tu");
             behaviors.addBehavior(timeUnitBehavior);
         }
-        if (FF(PCA_CAN_VIEW))
+        if (isFlagSet(PCA_CAN_VIEW))
         {
             options.addOption(
                     gmx::BooleanOption("w").store(&bView)
@@ -571,7 +572,7 @@ gmx_bool parse_common_args(int *argc, char *argv[], unsigned long Flags,
 
         const gmx::CommandLineHelpContext *context =
             gmx::GlobalCommandLineHelpContext::get();
-        if (context != NULL)
+        if (context != nullptr)
         {
             GMX_RELEASE_ASSERT(gmx_node_rank() == 0,
                                "Help output should be handled higher up and "
@@ -584,7 +585,7 @@ gmx_bool parse_common_args(int *argc, char *argv[], unsigned long Flags,
         }
 
         /* Now parse all the command-line options */
-        gmx::CommandLineParser(&options).skipUnknown(FF(PCA_NOEXIT_ON_ARGS))
+        gmx::CommandLineParser(&options).skipUnknown(isFlagSet(PCA_NOEXIT_ON_ARGS))
             .parse(argc, argv);
         behaviors.optionsFinishing();
         options.finish();
@@ -608,10 +609,9 @@ gmx_bool parse_common_args(int *argc, char *argv[], unsigned long Flags,
             setTimeValue(TDELTA, tdelta);
         }
 
-        adapter.copyValues(!FF(PCA_NOT_READ_NODE));
+        adapter.copyValues(!isFlagSet(PCA_NOT_READ_NODE));
 
         return TRUE;
     }
     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
-#undef FF
 }
index 9059d8519da4956450bf9bcaae84a71069413271..915f21cf4226d2421be1ef551c386205de3b7157 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,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.
@@ -50,7 +50,6 @@
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/real.h"
 
-struct t_commrec;
 struct gmx_output_env_t;
 
 #ifdef __cplusplus
@@ -214,7 +213,7 @@ const char *opt2parg_enum(const char *option, int nparg, t_pargs pa[]);
  *
  * \p option must specify a valid argument in \p pa.
  */
-gmx_bool opt2parg_bSet(const char *option, int nparg, t_pargs pa[]);
+gmx_bool opt2parg_bSet(const char *option, int nparg, const t_pargs *pa);
 
 
 /** Add option -w to view output files (must be implemented in program). */
index be1cd70d97fcfa30844436087c35ef19e4c2cf11..7a8e23da57cf34f292de98b1744e40c555ea4575 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,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.
@@ -56,6 +56,7 @@
 #include "gromacs/fileio/filetypes.h"
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/filenameoption.h"
+#include "gromacs/options/options.h"
 #include "gromacs/options/optionsvisitor.h"
 #include "gromacs/utility/arrayref.h"
 #include "gromacs/utility/exceptions.h"
@@ -74,10 +75,10 @@ class OptionsListWriter : public OptionsVisitor
     public:
         const std::string &optionList() const { return optionList_; }
 
-        virtual void visitSubSection(const Options &section)
+        virtual void visitSection(const OptionSectionInfo &section)
         {
             OptionsIterator iterator(section);
-            iterator.acceptSubSections(this);
+            iterator.acceptSections(this);
             iterator.acceptOptions(this);
         }
         virtual void visitOption(const OptionInfo &option)
@@ -93,7 +94,7 @@ class OptionsListWriter : public OptionsVisitor
             optionList_.append("-");
             const BooleanOptionInfo *booleanOption
                 = option.toType<BooleanOptionInfo>();
-            if (booleanOption != NULL && booleanOption->defaultValue())
+            if (booleanOption != nullptr && booleanOption->defaultValue())
             {
                 optionList_.append("no");
             }
@@ -109,10 +110,10 @@ class OptionCompletionWriter : public OptionsVisitor
     public:
         explicit OptionCompletionWriter(TextWriter *out) : out_(*out) {}
 
-        virtual void visitSubSection(const Options &section)
+        virtual void visitSection(const OptionSectionInfo &section)
         {
             OptionsIterator iterator(section);
-            iterator.acceptSubSections(this);
+            iterator.acceptSections(this);
             iterator.acceptOptions(this);
         }
         virtual void visitOption(const OptionInfo &option);
@@ -131,7 +132,7 @@ void OptionCompletionWriter::visitOption(const OptionInfo &option)
         return;
     }
     const FileNameOptionInfo *fileOption = option.toType<FileNameOptionInfo>();
-    if (fileOption != NULL)
+    if (fileOption != nullptr)
     {
         if (fileOption->isDirectoryOption())
         {
@@ -156,7 +157,7 @@ void OptionCompletionWriter::visitOption(const OptionInfo &option)
         return;
     }
     const StringOptionInfo *stringOption = option.toType<StringOptionInfo>();
-    if (stringOption != NULL && stringOption->isEnumerated())
+    if (stringOption != nullptr && stringOption->isEnumerated())
     {
         std::string completion("compgen -S ' ' -W $'");
         completion.append(joinStrings(stringOption->allowedValues(), "\\n"));
@@ -237,12 +238,12 @@ void ShellCompletionWriter::writeModuleCompletions(
     out.writeLine("COMPREPLY=()");
 
     OptionsListWriter listWriter;
-    listWriter.visitSubSection(options);
+    listWriter.visitSection(options.rootSection());
     out.writeLine(formatString("if (( $COMP_CWORD <= 1 )) || [[ $c == -* ]]; then COMPREPLY=( $(compgen -S ' '  -W $'%s' -- $c)); return 0; fi", listWriter.optionList().c_str()));
 
     out.writeLine("case \"$p\" in");
     OptionCompletionWriter optionWriter(&out);
-    optionWriter.visitSubSection(options);
+    optionWriter.visitSection(options.rootSection());
     out.writeLine("esac }");
 }
 
@@ -261,7 +262,7 @@ void ShellCompletionWriter::writeWrapperCompletions(
     impl_->file_->writeLine("if (( i == COMP_CWORD )); then");
     impl_->file_->writeLine("c=${COMP_WORDS[COMP_CWORD]}");
     OptionsListWriter lister;
-    lister.visitSubSection(options);
+    lister.visitSection(options.rootSection());
     std::string       completions(lister.optionList());
     for (ModuleNameList::const_iterator i = modules.begin();
          i != modules.end(); ++i)
index 2e9be1a9086bf9c5ab148b9939adc5c765cae608..c05cc559b84288c353640f9f8d690f04e69921ac 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,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.
@@ -60,11 +60,3 @@ gmx_add_unit_test(CommandLineUnitTests commandline-test
                   cmdlineprogramcontext.cpp
                   pargs.cpp
                   $<TARGET_OBJECTS:onlinehelp-test-shared>)
-
-if (CMAKE_CXX_COMPILER_ID MATCHES "XL")
-    # This suppression stops a very verbose cascade of messages about the
-    # mocks, which is probably a compiler issue.
-    #   1540-2924 (W) Cannot pass an argument of non-POD class type "const gmx::CommandLineHelpContext" through ellipsis.
-    set_property(SOURCE cmdlinehelpmodule.cpp cmdlinemodulemanager.cpp cmdlinemodulemanagertest.cpp
-                 PROPERTY COMPILE_FLAGS "-qsuppress=1540-2924")
-endif()
index ae34edf40f6dcae859d0dabda4cce221c2498558..055be24bcb51c000eb38b4b0c85fd89dc8284f26 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,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.
@@ -80,7 +80,7 @@ void CommandLineHelpWriterTest::checkHelp(gmx::CommandLineHelpWriter *writer)
     gmx::StringOutputStream     stream;
     gmx::TextWriter             streamWriter(&stream);
     gmx::CommandLineHelpContext context(&streamWriter, gmx::eHelpOutputFormat_Console,
-                                        NULL, "test");
+                                        nullptr, "test");
     context.setShowHidden(bHidden_);
     writer->writeHelp(context);
     stream.close();
@@ -101,7 +101,7 @@ TEST_F(CommandLineHelpWriterTest, HandlesOptionTypes)
 {
     using namespace gmx;
 
-    Options options("test", "Short Description");
+    Options options;
     options.addOption(BooleanOption("bool").description("Boolean option")
                           .defaultValue(true));
     options.addOption(BooleanOption("hidden").description("Hidden option")
@@ -166,7 +166,7 @@ TEST_F(CommandLineHelpWriterTest, HandlesDefaultValuesFromVariables)
 {
     using namespace gmx;
 
-    Options options("test", "Short Description");
+    Options options;
 
     bool    bValue = true;
     options.addOption(BooleanOption("bool").description("Boolean option")
@@ -181,7 +181,7 @@ TEST_F(CommandLineHelpWriterTest, HandlesDefaultValuesFromVariables)
                           .store(iavalue).valueCount(2));
 
     std::vector<std::string> svalues;
-    svalues.push_back("foo");
+    svalues.emplace_back("foo");
     options.addOption(StringOption("str").description("String option")
                           .storeVector(&svalues).multiValue());
 
@@ -204,7 +204,7 @@ TEST_F(CommandLineHelpWriterTest, HandlesLongFileOptions)
     using gmx::eftGenericData;
     using gmx::eftTrajectory;
 
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     options.addOption(FileNameOption("f")
                           .description("File name option with a long value")
                           .filetype(eftTrajectory).inputFile().required()
@@ -240,7 +240,7 @@ TEST_F(CommandLineHelpWriterTest, HandlesLongOptions)
     using gmx::DoubleOption;
     using gmx::StringOption;
 
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     options.addOption(BooleanOption("longboolean")
                           .description("Boolean option with a long name")
                           .defaultValue(true));
@@ -248,8 +248,8 @@ TEST_F(CommandLineHelpWriterTest, HandlesLongOptions)
     options.addOption(DoubleOption("dvec").description("Double vector option")
                           .vector().store(dblvec));
     std::vector<std::string> values;
-    values.push_back("A very long string value that overflows even the description column");
-    values.push_back("Another very long string value that overflows even the description column");
+    values.emplace_back("A very long string value that overflows even the description column");
+    values.emplace_back("Another very long string value that overflows even the description column");
     options.addOption(StringOption("string")
                           .description("String option with very long values (may "
                                        "be less relevant with selections having "
@@ -270,7 +270,7 @@ TEST_F(CommandLineHelpWriterTest, HandlesSelectionOptions)
     using gmx::SelectionFileOption;
     using gmx::SelectionOption;
 
-    gmx::Options                options(NULL, NULL);
+    gmx::Options                options;
     gmx::SelectionCollection    selections;
     gmx::SelectionOptionManager manager(&selections);
     options.addManager(&manager);
@@ -298,7 +298,7 @@ TEST_F(CommandLineHelpWriterTest, HandlesOptionGroups)
 {
     using gmx::IntegerOption;
 
-    gmx::Options            options(NULL, NULL);
+    gmx::Options            options;
     gmx::IOptionsContainer &group1 = options.addGroup();
     gmx::IOptionsContainer &group2 = options.addGroup();
     group2.addOption(IntegerOption("sub2").description("Option in group 2"));
@@ -321,7 +321,7 @@ TEST_F(CommandLineHelpWriterTest, HandlesHelpText)
     };
     using gmx::IntegerOption;
 
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     options.addOption(IntegerOption("int").description("Integer option")
                           .defaultValue(2));
 
index b32791630b2cf1dfd94477be03b2010019c5c4a3..6e619dc68dcc772c38bde66cc91b705070d5bd03 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,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.
@@ -120,7 +120,7 @@ TEST_F(CommandLineModuleManagerTest, RunsModuleHelpWithDashHWithSingleModule)
     };
     CommandLine       args(cmdline);
     initManager(args, "g_module");
-    MockModule        mod(NULL, NULL);
+    MockModule        mod(nullptr, nullptr);
     manager().setSingleModule(&mod);
     using ::testing::_;
     EXPECT_CALL(mod, writeHelp(_));
index 719e69d34f71917e67a1c1a2198387b44eee4e99..a1ad8871a06b5dd1053f44e23034fe67038634c5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,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.
@@ -76,8 +76,7 @@ class CommandLineParserTest : public ::testing::Test
 };
 
 CommandLineParserTest::CommandLineParserTest()
-    : options_(NULL, NULL), parser_(&options_),
-      flag_(false), ivalue1p_(0), ivalue12_(0)
+    : parser_(&options_), flag_(false), ivalue1p_(0), ivalue12_(0)
 {
     using gmx::BooleanOption;
     using gmx::IntegerOption;
@@ -166,7 +165,7 @@ TEST_F(CommandLineParserTest, HandlesSkipUnknown)
     EXPECT_STREQ("-opt2", args.arg(2));
     EXPECT_STREQ("value", args.arg(3));
     EXPECT_STREQ("-opt3", args.arg(4));
-    EXPECT_TRUE(args.arg(5) == NULL);
+    EXPECT_TRUE(args.arg(5) == nullptr);
 
     EXPECT_TRUE(flag_);
     ASSERT_EQ(1U, ivalues_.size());
index 376908bdb03ab9ea391d7bf987fe487980f9d628..0bb6864c6e82690b0ada468076355892e08c53a8 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,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.
@@ -114,7 +114,7 @@ class CommandLineProgramContextTest : public ::testing::Test
 
         void testBinaryPathSearch(const char *argv0)
         {
-            ASSERT_TRUE(env_.get() != NULL);
+            ASSERT_TRUE(env_.get() != nullptr);
             gmx::CommandLineProgramContext  info(1, &argv0, move(env_));
             EXPECT_EQ(expectedExecutable_, info.fullBinaryPath());
         }
@@ -146,7 +146,7 @@ TEST_F(CommandLineProgramContextTest, FindsBinaryFromPath)
 TEST_F(CommandLineProgramContextTest, FindsBinaryFromCurrentDirectory)
 {
     env_->workingDirectory_ = Path::join(env_->getWorkingDirectory(), "bin");
-    env_->path_.push_back("");
+    env_->path_.emplace_back("");
     testBinaryPathSearch("test-exe");
 }
 
index cf6edc3d04f1a8f82885ff7841dfce05e4824c0c..876862acf9c674b8ccfa90779bf70e79dea301a9 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,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.
@@ -75,7 +75,7 @@ class ParseCommonArgsTest : public ::testing::Test
         };
 
         ParseCommonArgsTest()
-            : oenv_(NULL), fileCount_(0)
+            : oenv_(nullptr), fileCount_(0)
         {
         }
         virtual ~ParseCommonArgsTest()
@@ -93,7 +93,7 @@ class ParseCommonArgsTest : public ::testing::Test
             bool bOk = parse_common_args(&args_.argc(), args_.argv(), flags,
                                          fnm.size(), fnm.data(),
                                          pa.size(), pa.data(),
-                                         0, NULL, 0, NULL, &oenv_);
+                                         0, nullptr, 0, nullptr, &oenv_);
             EXPECT_TRUE(bOk);
         }
         void parseFromArray(gmx::ConstArrayRef<const char *> cmdline,
@@ -109,7 +109,7 @@ class ParseCommonArgsTest : public ::testing::Test
         {
             std::string filename(tempFiles_.getTemporaryFilePath(extension));
             gmx::TextWriter::writeFileFromString(filename, "Dummy file");
-            if (name != NULL)
+            if (name != nullptr)
             {
                 args_.append(name);
                 switch (type)
@@ -285,9 +285,9 @@ TEST_F(ParseCommonArgsTest, ParsesTimeArgsWithTimeUnit)
 
 TEST_F(ParseCommonArgsTest, ParsesEnumArgs)
 {
-    const char       *value1[] = {NULL, "none", "on", "off", NULL };
-    const char       *value2[] = {NULL, "def", "value", "value_other", NULL };
-    const char       *value3[] = {NULL, "default", "value", NULL };
+    const char       *value1[] = {nullptr, "none", "on", "off", nullptr };
+    const char       *value2[] = {nullptr, "def", "value", "value_other", nullptr };
+    const char       *value3[] = {nullptr, "default", "value", nullptr };
     t_pargs           pa[]     = {
         { "-s1", FALSE, etENUM, {value1}, "Description" },
         { "-s2", FALSE, etENUM, {value2}, "Description" },
@@ -325,8 +325,8 @@ TEST_F(ParseCommonArgsTest, ParsesFileArgs)
     EXPECT_STREQ("test.xvg", opt2fn_null("-o2", nfile(), fnm));
     char **files;
     EXPECT_EQ(2, opt2fns(&files, "-om", nfile(), fnm));
-    EXPECT_TRUE(files != NULL);
-    if (files != NULL)
+    EXPECT_TRUE(files != nullptr);
+    if (files != nullptr)
     {
         EXPECT_STREQ("test1.xvg", files[0]);
         EXPECT_STREQ("test2.xvg", files[1]);
@@ -338,8 +338,8 @@ TEST_F(ParseCommonArgsTest, ParsesFileArgs)
 TEST_F(ParseCommonArgsTest, ParsesFileArgsWithDefaults)
 {
     t_filenm          fnm[] = {
-        { efTPS, NULL,  NULL,   ffWRITE },
-        { efTRX, "-f2", NULL,   ffOPTWR },
+        { efTPS, nullptr,  nullptr,   ffWRITE },
+        { efTRX, "-f2", nullptr,   ffOPTWR },
         { efTRX, "-f3", "trj3", ffWRITE },
         { efXVG, "-o",  "out",  ffWRITE },
         { efXVG, "-om", "outm", ffWRMULT }
@@ -350,7 +350,7 @@ TEST_F(ParseCommonArgsTest, ParsesFileArgsWithDefaults)
     parseFromArray(cmdline, 0, fnm, gmx::EmptyArrayRef());
     EXPECT_STREQ("topol.tpr", ftp2fn(efTPS, nfile(), fnm));
     EXPECT_STREQ("traj.xtc", opt2fn("-f2", nfile(), fnm));
-    EXPECT_NULL(opt2fn_null("-f2", nfile(), fnm));
+    EXPECT_EQ(nullptr, opt2fn_null("-f2", nfile(), fnm));
     EXPECT_STREQ("trj3.xtc", opt2fn("-f3", nfile(), fnm));
     EXPECT_STREQ("out.xvg", opt2fn("-o", nfile(), fnm));
     EXPECT_STREQ("outm.xvg", opt2fn("-om", nfile(), fnm));
@@ -360,8 +360,8 @@ TEST_F(ParseCommonArgsTest, ParsesFileArgsWithDefaults)
 TEST_F(ParseCommonArgsTest, ParsesFileArgsWithDefaultFileName)
 {
     t_filenm          fnm[] = {
-        { efTPS, "-s",  NULL,   ffWRITE },
-        { efTRX, "-f2", NULL,   ffWRITE },
+        { efTPS, "-s",  nullptr,   ffWRITE },
+        { efTRX, "-f2", nullptr,   ffWRITE },
         { efTRX, "-f3", "trj3", ffWRITE },
         { efXVG, "-o",  "out",  ffWRITE },
         { efXVG, "-om", "outm", ffWRMULT }
@@ -402,7 +402,7 @@ TEST_F(ParseCommonArgsTest, ParseFileArgsWithCustomDefaultExtension)
 TEST_F(ParseCommonArgsTest, HandlesNonExistentInputFiles)
 {
     t_filenm          fnm[] = {
-        { efTPS, "-s",  NULL,   ffREAD },
+        { efTPS, "-s",  nullptr,   ffREAD },
         { efTRX, "-f",  "trj",  ffREAD },
         { efTRX, "-f2", "trj2", ffREAD },
         { efTRX, "-f3", "trj3", ffREAD },
@@ -427,7 +427,7 @@ TEST_F(ParseCommonArgsTest, HandlesNonExistentInputFiles)
 TEST_F(ParseCommonArgsTest, HandlesNonExistentOptionalInputFiles)
 {
     t_filenm          fnm[] = {
-        { efTPS, "-s",  NULL,   ffOPTRD },
+        { efTPS, "-s",  nullptr,   ffOPTRD },
         { efTRX, "-f",  "trj",  ffOPTRD }
     };
     const char *const cmdline[] = {
@@ -463,8 +463,8 @@ TEST_F(ParseCommonArgsTest, AcceptsNonExistentInputFilesIfSpecified)
 TEST_F(ParseCommonArgsTest, HandlesCompressedFiles)
 {
     t_filenm          fnm[] = {
-        { efTRX, "-f", NULL, ffREAD },
-        { efGRO, "-g", NULL, ffREAD }
+        { efTRX, "-f", nullptr, ffREAD },
+        { efGRO, "-g", nullptr, ffREAD }
     };
     args_.append("test");
     std::string       expectedF = addFileArg("-f", ".pdb.gz", efFull);
@@ -480,7 +480,7 @@ TEST_F(ParseCommonArgsTest, HandlesCompressedFiles)
 TEST_F(ParseCommonArgsTest, AcceptsUnknownTrajectoryExtension)
 {
     t_filenm          fnm[] = {
-        { efTRX, "-f", NULL, ffREAD }
+        { efTRX, "-f", nullptr, ffREAD }
     };
     args_.append("test");
     std::string       expected = addFileArg("-f", ".foo", efFull);
@@ -492,10 +492,10 @@ TEST_F(ParseCommonArgsTest, AcceptsUnknownTrajectoryExtension)
 TEST_F(ParseCommonArgsTest, CompletesExtensionFromExistingFile)
 {
     t_filenm          fnm[] = {
-        { efTRX, "-f1", NULL, ffREAD },
-        { efTRX, "-f2", NULL, ffREAD },
-        { efTRX, "-f3", NULL, ffREAD },
-        { efTRX, "-f4", NULL, ffREAD }
+        { efTRX, "-f1", nullptr, ffREAD },
+        { efTRX, "-f2", nullptr, ffREAD },
+        { efTRX, "-f3", nullptr, ffREAD },
+        { efTRX, "-f4", nullptr, ffREAD }
     };
     args_.append("test");
     std::string       expected1 = addFileArg("-f1", "1.xtc", efNoExtension);
@@ -515,16 +515,16 @@ TEST_F(ParseCommonArgsTest, CompletesExtensionFromExistingFile)
 TEST_F(ParseCommonArgsTest, CompletesExtensionFromExistingFileWithDefaultFileName)
 {
     t_filenm          fnm[] = {
-        { efTRX, "-f1", NULL,  ffREAD },
+        { efTRX, "-f1", nullptr,  ffREAD },
         { efSTO, "-f2", "foo", ffREAD },
-        { efTRX, "-f3", NULL,  ffREAD },
-        { efSTX, "-f4", NULL,  ffREAD }
+        { efTRX, "-f3", nullptr,  ffREAD },
+        { efSTX, "-f4", nullptr,  ffREAD }
     };
     args_.append("test");
     std::string       expected1 = addFileArg("-f1", "1.trr", efNoExtension);
     std::string       expected2 = addFileArg("-f2", ".pdb", efEmptyValue);
     std::string       expected3 = addFileArg("-f3", ".trr", efEmptyValue);
-    std::string       expected4 = addFileArg(NULL, ".pdb", efEmptyValue);
+    std::string       expected4 = addFileArg(nullptr, ".pdb", efEmptyValue);
     std::string       deffnm    = gmx::Path::stripExtension(expected3);
     args_.append("-deffnm");
     args_.append(deffnm);
@@ -543,34 +543,34 @@ TEST_F(ParseCommonArgsTest, CompletesExtensionFromExistingFileWithDefaultFileNam
 TEST_F(ParseCommonArgsTest, HandlesNonReadNode)
 {
     t_filenm          fnm[] = {
-        { efTPS, "-s",  NULL,  ffREAD },
-        { efTRX, "-f",  NULL,  ffREAD },
-        { efTRX, "-f2", NULL,  ffREAD }
+        { 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_NULL(fnm[0].fns);
-    EXPECT_NULL(fnm[1].fns);
-    EXPECT_NULL(fnm[2].fns);
+    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",  NULL,  ffREAD },
-        { efTRX, "-f",  NULL,  ffREAD },
-        { efTRX, "-f2", NULL,  ffREAD }
+        { 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_NULL(fnm[0].fns);
-    EXPECT_NULL(fnm[1].fns);
-    EXPECT_NULL(fnm[2].fns);
+    EXPECT_EQ(nullptr, fnm[0].fns);
+    EXPECT_EQ(nullptr, fnm[1].fns);
+    EXPECT_EQ(nullptr, fnm[2].fns);
     done_filenms(nfile(), fnm);
 }
 
index 6ba6c60e85ebe9186eb47259a4a48eb265c45415..87a8ebf76933c768866069f5b5fc1387a9588081 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,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.
@@ -54,8 +54,8 @@ static const int   can_view_ftp[] = {
 };
 #define NVIEW asize(can_view_ftp)
 static const char* view_program[] = {
-    NULL,
-    "ghostview",    "display",      NULL,           "xterm -e rasmol"
+    nullptr,
+    "ghostview",    "display",      nullptr,           "xterm -e rasmol"
 };
 
 static int can_view(int ftp)
@@ -81,7 +81,7 @@ void do_view(const gmx_output_env_t *oenv, const char *fn, const char *opts)
 
     if (output_env_get_view(oenv) && fn)
     {
-        if (getenv("DISPLAY") == NULL)
+        if (getenv("DISPLAY") == nullptr)
         {
             fprintf(stderr, "Can not view %s, no DISPLAY environment variable.\n", fn);
         }
@@ -141,7 +141,7 @@ void view_all(const gmx_output_env_t *oenv, int nf, t_filenm fnm[])
         if (can_view(fnm[i].ftp) && is_output(&(fnm[i])) &&
             ( !is_optional(&(fnm[i])) || is_set(&(fnm[i])) ) )
         {
-            do_view(oenv, fnm[i].fns[0], NULL);
+            do_view(oenv, fnm[i].fns[0], nullptr);
         }
     }
 }
diff --git a/src/gromacs/compat/make_unique.h b/src/gromacs/compat/make_unique.h
new file mode 100644 (file)
index 0000000..0736663
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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_COMPAT_MAKE_UNIQUE_H
+#define GMX_COMPAT_MAKE_UNIQUE_H
+/*! \libinternal
+ * \file
+ * \brief Provides template gmx::compat::make_unique
+ *
+ * The implementation of gmx::compat::make_unique is copied with little
+ * modification from C++ standardization doc N3656
+ * at http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3656.htm
+ * though additional wrapping has been added for use in \Gromacs.
+ *
+ * \author M. Eric Irrgang <ericirrgang@gmail.com>
+ * \ingroup group_compatibility
+ */
+/*! \addtogroup group_compatibility
+ * ### gmx::compat::make_unique
+ *
+ * Provide a trivially adapted implementation of the C++ standard library `make_unique` function template.
+ * When All supported \Gromacs build platforms provide `std::make_unique`, this should be removed.
+ *
+ */
+#include <cstddef>
+
+#include <memory>
+#include <type_traits>
+#include <utility>
+
+namespace gmx
+{
+namespace compat
+{
+
+///\cond
+
+// All gmx::compat code should use std::unique_ptr
+using ::std::unique_ptr;
+
+template<class T> struct Unique_if {
+    typedef unique_ptr<T> Single_object;
+};
+
+template<class T> struct Unique_if<T[]> {
+    typedef unique_ptr<T[]> Unknown_bound;
+};
+
+template<class T, size_t N> struct Unique_if<T[N]> {
+    typedef void Known_bound;
+};
+
+template<class T, class ... Args>
+typename Unique_if<T>::Single_object
+make_unique(Args && ... args)
+{
+    return unique_ptr<T>(new T(::std::forward<Args>(args) ...));
+}
+
+template<class T>
+typename Unique_if<T>::Unknown_bound
+make_unique(size_t n)
+{
+    typedef typename ::std::remove_extent<T>::type U;
+    return unique_ptr<T>(new U[n]());
+}
+
+template<class T, class ... Args>
+typename Unique_if<T>::Known_bound
+make_unique(Args && ...) = delete;
+
+///\endcond
+
+}      // namespace gmx::compat
+}      // namespace gmx
+
+#endif // header guard
diff --git a/src/gromacs/compat/tests/CMakeLists.txt b/src/gromacs/compat/tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..35e9d0f
--- /dev/null
@@ -0,0 +1,39 @@
+#
+# 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
+# Mark Abraham, David van der Spoel, Berk Hess, and 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.
+
+if (GMX_BUILD_UNITTESTS)
+    gmx_add_unit_test(CompatibilityHelpersTests compat-test
+                     make_unique.cpp
+                     )
+endif()
diff --git a/src/gromacs/compat/tests/make_unique.cpp b/src/gromacs/compat/tests/make_unique.cpp
new file mode 100644 (file)
index 0000000..d60c1ad
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief Tests for gmx::compat::make_unique
+ *
+ * \author M. Eric Irrgang <ericirrgang@gmail.com>
+ * \ingroup group_compatibility
+ */
+#include "gmxpre.h"
+
+#include "gromacs/compat/make_unique.h"
+
+#include <gtest/gtest.h>
+
+namespace gmx
+{
+
+namespace
+{
+
+struct dummy
+{
+    char foo;
+    char bar;
+    dummy() :
+        foo {0},
+    bar {0}
+    {};
+    dummy(const char a, const char b) :
+        foo {a},
+    bar {b}
+    {};
+};
+
+TEST(CompatibilityHelper, MakeUniqueCompiles)
+{
+    // Check template parameters
+    auto ptr = gmx::compat::make_unique<dummy>();
+    ASSERT_NE(ptr, nullptr);
+    ASSERT_NE(ptr.get(), nullptr);
+    constexpr bool is_dummy = std::is_same < decltype(ptr), std::unique_ptr < dummy>>::value;
+    ASSERT_TRUE(is_dummy);
+
+    // Check template and function parameters
+    ptr = gmx::compat::make_unique<dummy>('a', 'b');
+    ASSERT_EQ(ptr->foo, 'a');
+}
+
+
+} // anonymous namespace
+} // namespace gmx
index 97d4a8c62d641ad5517816823258d99cbae1fa6a..b61ad45bc51057102231ceb13d3f5b3548e95905 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,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.
@@ -64,7 +64,7 @@
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/real.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/strconvert.h"
 
 /*! \brief Shortcut macro to select modes. */
 #define MODE(x) ((mode & (x)) == (x))
@@ -87,36 +87,42 @@ enum {
 };
 
 /*! \brief Routine to compute ACF using FFT. */
-static void low_do_four_core(int nfour, int nframes, real c1[], real cfour[],
+static void low_do_four_core(int nframes, real c1[], real cfour[],
                              int nCos)
 {
     int  i = 0;
-
+    std::vector<std::vector<real> > data;
+    data.resize(1);
+    data[0].resize(nframes, 0);
     switch (nCos)
     {
         case enNorm:
             for (i = 0; (i < nframes); i++)
             {
-                cfour[i] = c1[i];
+                data[0][i] = c1[i];
             }
             break;
         case enCos:
             for (i = 0; (i < nframes); i++)
             {
-                cfour[i] = cos(c1[i]);
+                data[0][i] = cos(c1[i]);
             }
             break;
         case enSin:
             for (i = 0; (i < nframes); i++)
             {
-                cfour[i] = sin(c1[i]);
+                data[0][i] = sin(c1[i]);
             }
             break;
         default:
             gmx_fatal(FARGS, "nCos = %d, %s %d", nCos, __FILE__, __LINE__);
     }
 
-    many_auto_correl(1, nframes, nfour, &cfour);
+    many_auto_correl(&data);
+    for (i = 0; (i < nframes); i++)
+    {
+        cfour[i] = data[0][i];
+    }
 }
 
 /*! \brief Routine to comput ACF without FFT. */
@@ -238,7 +244,7 @@ static void do_ac_core(int nframes, int nout,
 }
 
 /*! \brief Routine to normalize ACF, dividing by corr[0]. */
-void normalize_acf(int nout, real corr[])
+static void normalize_acf(int nout, real corr[])
 {
     int    j;
     double c0;
@@ -279,7 +285,7 @@ void normalize_acf(int nout, real corr[])
 }
 
 /*! \brief Routine that averages ACFs. */
-void average_acf(gmx_bool bVerbose, int n, int nitem, real **c1)
+static void average_acf(gmx_bool bVerbose, int n, int nitem, real **c1)
 {
     real c0;
     int  i, j;
@@ -301,7 +307,7 @@ void average_acf(gmx_bool bVerbose, int n, int nitem, real **c1)
 }
 
 /*! \brief Normalize ACFs. */
-void norm_and_scale_vectors(int nframes, real c1[], real scale)
+static void norm_and_scale_vectors(int nframes, real c1[], real scale)
 {
     int   j, m;
     real *rij;
@@ -332,22 +338,22 @@ static void dump_tmp(char *s, int n, real c[])
 }
 
 /*! \brief High level ACF routine. */
-void do_four_core(unsigned long mode, int nfour, int nf2, int nframes,
-                  real c1[], real csum[], real ctmp[])
+static void do_four_core(unsigned long mode, int nframes,
+                         real c1[], real csum[], real ctmp[])
 {
     real   *cfour;
     char    buf[32];
     real    fac;
     int     j, m, m1;
 
-    snew(cfour, nfour);
+    snew(cfour, nframes);
 
     if (MODE(eacNormal))
     {
         /********************************************
          *  N O R M A L
          ********************************************/
-        low_do_four_core(nfour, nf2, c1, csum, enNorm);
+        low_do_four_core(nframes, c1, csum, enNorm);
     }
     else if (MODE(eacCos))
     {
@@ -357,21 +363,21 @@ void do_four_core(unsigned long mode, int nfour, int nf2, int nframes,
         /* Copy the data to temp array. Since we need it twice
          * we can't overwrite original.
          */
-        for (j = 0; (j < nf2); j++)
+        for (j = 0; (j < nframes); j++)
         {
             ctmp[j] = c1[j];
         }
 
         /* Cosine term of AC function */
-        low_do_four_core(nfour, nf2, ctmp, cfour, enCos);
-        for (j = 0; (j < nf2); j++)
+        low_do_four_core(nframes, ctmp, cfour, enCos);
+        for (j = 0; (j < nframes); j++)
         {
             c1[j]  = cfour[j];
         }
 
         /* Sine term of AC function */
-        low_do_four_core(nfour, nf2, ctmp, cfour, enSin);
-        for (j = 0; (j < nf2); j++)
+        low_do_four_core(nframes, ctmp, cfour, enSin);
+        for (j = 0; (j < nframes); j++)
         {
             c1[j]  += cfour[j];
             csum[j] = c1[j];
@@ -418,34 +424,34 @@ void do_four_core(unsigned long mode, int nfour, int nf2, int nframes,
         /* Because of normalization the number of -0.5 to subtract
          * depends on the number of data points!
          */
-        for (j = 0; (j < nf2); j++)
+        for (j = 0; (j < nframes); j++)
         {
-            csum[j]  = -0.5*(nf2-j);
+            csum[j]  = -0.5*(nframes-j);
         }
 
         /***** DIAGONAL ELEMENTS ************/
         for (m = 0; (m < DIM); m++)
         {
             /* Copy the vector data in a linear array */
-            for (j = 0; (j < nf2); j++)
+            for (j = 0; (j < nframes); j++)
             {
                 ctmp[j]  = gmx::square(c1[DIM*j+m]);
             }
             if (debug)
             {
                 sprintf(buf, "c1diag%d.xvg", m);
-                dump_tmp(buf, nf2, ctmp);
+                dump_tmp(buf, nframes, ctmp);
             }
 
-            low_do_four_core(nfour, nf2, ctmp, cfour, enNorm);
+            low_do_four_core(nframes, ctmp, cfour, enNorm);
 
             if (debug)
             {
                 sprintf(buf, "c1dfout%d.xvg", m);
-                dump_tmp(buf, nf2, cfour);
+                dump_tmp(buf, nframes, cfour);
             }
             fac = 1.5;
-            for (j = 0; (j < nf2); j++)
+            for (j = 0; (j < nframes); j++)
             {
                 csum[j] += fac*(cfour[j]);
             }
@@ -455,7 +461,7 @@ void do_four_core(unsigned long mode, int nfour, int nf2, int nframes,
         {
             /* Copy the vector data in a linear array */
             m1 = (m+1) % DIM;
-            for (j = 0; (j < nf2); j++)
+            for (j = 0; (j < nframes); j++)
             {
                 ctmp[j] = c1[DIM*j+m]*c1[DIM*j+m1];
             }
@@ -463,16 +469,16 @@ void do_four_core(unsigned long mode, int nfour, int nf2, int nframes,
             if (debug)
             {
                 sprintf(buf, "c1off%d.xvg", m);
-                dump_tmp(buf, nf2, ctmp);
+                dump_tmp(buf, nframes, ctmp);
             }
-            low_do_four_core(nfour, nf2, ctmp, cfour, enNorm);
+            low_do_four_core(nframes, ctmp, cfour, enNorm);
             if (debug)
             {
                 sprintf(buf, "c1ofout%d.xvg", m);
-                dump_tmp(buf, nf2, cfour);
+                dump_tmp(buf, nframes, cfour);
             }
             fac = 3.0;
-            for (j = 0; (j < nf2); j++)
+            for (j = 0; (j < nframes); j++)
             {
                 csum[j] += fac*cfour[j];
             }
@@ -493,19 +499,19 @@ void do_four_core(unsigned long mode, int nfour, int nf2, int nframes,
          * First for XX, then for YY, then for ZZ
          * After that we sum them and normalise
          */
-        for (j = 0; (j < nf2); j++)
+        for (j = 0; (j < nframes); j++)
         {
             csum[j] = 0.0;
         }
         for (m = 0; (m < DIM); m++)
         {
             /* Copy the vector data in a linear array */
-            for (j = 0; (j < nf2); j++)
+            for (j = 0; (j < nframes); j++)
             {
                 ctmp[j] = c1[DIM*j+m];
             }
-            low_do_four_core(nfour, nf2, ctmp, cfour, enNorm);
-            for (j = 0; (j < nf2); j++)
+            low_do_four_core(nframes, ctmp, cfour, enNorm);
+            for (j = 0; (j < nframes); j++)
             {
                 csum[j] += cfour[j];
             }
@@ -517,7 +523,7 @@ void do_four_core(unsigned long mode, int nfour, int nf2, int nframes,
     }
 
     sfree(cfour);
-    for (j = 0; (j < nf2); j++)
+    for (j = 0; (j < nframes); j++)
     {
         c1[j] = csum[j]/(real)(nframes-j);
     }
@@ -530,8 +536,8 @@ void low_do_autocorr(const char *fn, const gmx_output_env_t *oenv, const char *t
                      gmx_bool bVerbose, real tbeginfit, real tendfit,
                      int eFitFn)
 {
-    FILE       *fp, *gp = NULL;
-    int         i, nfour;
+    FILE       *fp, *gp = nullptr;
+    int         i;
     real       *csum;
     real       *ctmp, *fit;
     real        sum, Ct2av, Ctav;
@@ -576,30 +582,9 @@ void low_do_autocorr(const char *fn, const gmx_output_env_t *oenv, const char *t
                gmx::boolToString(bNormalize));
         printf("mode = %lu, dt = %g, nrestart = %d\n", mode, dt, nrestart);
     }
-    if (bFour)
-    {
-        /* For FTT corr., we need to pad the data with at least nframes zeros */
-        nfour = 2;
-        while (2*nframes > nfour)
-        {
-            nfour *= 2;
-        }
-        if (debug)
-        {
-            fprintf(debug, "Using FFT to calculate %s, #points for FFT = %d\n",
-                    title, nfour);
-        }
-
-        /* Allocate temp arrays */
-        snew(csum, nfour);
-        snew(ctmp, nfour);
-    }
-    else
-    {
-        nfour = 0; /* To keep the compiler happy */
-        snew(csum, nframes);
-        snew(ctmp, nframes);
-    }
+    /* Allocate temp arrays */
+    snew(csum, nframes);
+    snew(ctmp, nframes);
 
     /* Loop over items (e.g. molecules or dihedrals)
      * In this loop the actual correlation functions are computed, but without
@@ -615,7 +600,7 @@ void low_do_autocorr(const char *fn, const gmx_output_env_t *oenv, const char *t
 
         if (bFour)
         {
-            do_four_core(mode, nfour, nframes, nframes, c1[i], csum, ctmp);
+            do_four_core(mode, nframes, c1[i], csum, ctmp);
         }
         else
         {
@@ -636,8 +621,8 @@ void low_do_autocorr(const char *fn, const gmx_output_env_t *oenv, const char *t
     }
     else
     {
-        fit = NULL;
-        fp  = NULL;
+        fit = nullptr;
+        fp  = nullptr;
     }
     if (bAver)
     {
@@ -653,12 +638,12 @@ void low_do_autocorr(const char *fn, const gmx_output_env_t *oenv, const char *t
 
         if (eFitFn != effnNONE)
         {
-            fit_acf(nout, eFitFn, oenv, fn != NULL, tbeginfit, tendfit, dt, c1[0], fit);
+            fit_acf(nout, eFitFn, oenv, fn != nullptr, tbeginfit, tendfit, dt, c1[0], fit);
             sum = print_and_integrate(fp, nout, dt, c1[0], fit, 1);
         }
         else
         {
-            sum = print_and_integrate(fp, nout, dt, c1[0], NULL, 1);
+            sum = print_and_integrate(fp, nout, dt, c1[0], nullptr, 1);
         }
         if (bVerbose)
         {
@@ -681,12 +666,12 @@ void low_do_autocorr(const char *fn, const gmx_output_env_t *oenv, const char *t
             }
             if (eFitFn != effnNONE)
             {
-                fit_acf(nout, eFitFn, oenv, fn != NULL, tbeginfit, tendfit, dt, c1[i], fit);
+                fit_acf(nout, eFitFn, oenv, fn != nullptr, tbeginfit, tendfit, dt, c1[i], fit);
                 sum = print_and_integrate(fp, nout, dt, c1[i], fit, 1);
             }
             else
             {
-                sum = print_and_integrate(fp, nout, dt, c1[i], NULL, 1);
+                sum = print_and_integrate(fp, nout, dt, c1[i], nullptr, 1);
                 if (debug)
                 {
                     fprintf(debug,
@@ -722,7 +707,7 @@ void low_do_autocorr(const char *fn, const gmx_output_env_t *oenv, const char *t
 }
 
 /*! \brief Legend for selecting Legendre polynomials. */
-static const char *Leg[]   = { NULL, "0", "1", "2", "3", NULL };
+static const char *Leg[]   = { nullptr, "0", "1", "2", "3", nullptr };
 
 t_pargs *add_acf_pargs(int *npargs, t_pargs *pa)
 {
index 9eac51beae7037edd469542561bb48b78f2491e0..4fc9fd425effcc48538eb8275577919df81a699d 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,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.
@@ -75,9 +75,9 @@ static const int nfp_ffn[effnNR] = { 0, 1, 2, 3, 5, 7, 9, 2, 4, 3, 6 };
  * the array).
  */
 const char      *s_ffn[effnNR+2] = {
-    NULL, "none", "exp", "aexp", "exp_exp",
+    nullptr, "none", "exp", "aexp", "exp_exp",
     "exp5", "exp7", "exp9",
-    NULL, NULL, NULL, NULL, NULL
+    nullptr, nullptr, nullptr, nullptr, nullptr
 };
 
 /*! \brief Long description for each fitting function type */
@@ -115,7 +115,7 @@ const char *effnDescription(int effn)
     }
     else
     {
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -725,7 +725,7 @@ real do_lmfit(int ndata, real c1[], real sig[], real dt, real *x0,
         {
             x[j]  = ttt;
             y[j]  = c1[i];
-            if (NULL == sig)
+            if (nullptr == sig)
             {
                 // No weighting if all values are divided by 1.
                 dy[j] = 1;
@@ -814,7 +814,7 @@ real do_lmfit(int ndata, real c1[], real sig[], real dt, real *x0,
                 }
             }
             /* Generate debug output */
-            if (NULL != fn_fitted)
+            if (nullptr != fn_fitted)
             {
                 fp = xvgropen(fn_fitted, "Data + Fit", "Time (ps)",
                               "Data (t)", oenv);
@@ -861,7 +861,7 @@ real fit_acf(int ncorr, int fitfn, const gmx_output_env_t *oenv, gmx_bool bVerbo
         tendfit = ncorr*dt;
     }
     nf_int = std::min(ncorr, (int)(tendfit/dt));
-    sum    = print_and_integrate(debug, nf_int, dt, c1, NULL, 1);
+    sum    = print_and_integrate(debug, nf_int, dt, c1, nullptr, 1);
 
     if (bPrint)
     {
@@ -946,9 +946,9 @@ real fit_acf(int ncorr, int fitfn, const gmx_output_env_t *oenv, gmx_bool bVerbo
         }
 
         nf_int    = std::min(ncorr, (int)((tStart+1e-4)/dt));
-        sum       = print_and_integrate(debug, nf_int, dt, c1, NULL, 1);
-        tail_corr = do_lmfit(ncorr, c1, sig, dt, NULL, tStart, tendfit, oenv,
-                             bDebugMode(), fitfn, fitparm, 0, NULL);
+        sum       = print_and_integrate(debug, nf_int, dt, c1, nullptr, 1);
+        tail_corr = do_lmfit(ncorr, c1, sig, dt, nullptr, tStart, tendfit, oenv,
+                             bDebugMode(), fitfn, fitparm, 0, nullptr);
         sumtot = sum+tail_corr;
         if (fit && ((jmax == 1) || (j == 1)))
         {
index b05dd6619068df6a1a2a675d3ce3be052f21c772..e1df9220e967daace00571c18e9f290f1f028bc5 100644 (file)
 
 #include "manyautocorrelation.h"
 
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <cmath>
-
 #include <algorithm>
 
 #include "gromacs/fft/fft.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxomp.h"
-#include "gromacs/utility/smalloc.h"
 
-int many_auto_correl(int nfunc, int ndata, int nfft, real **c)
+int many_auto_correl(std::vector<std::vector<real> > *c)
 {
+    size_t nfunc = (*c).size();
+    if (nfunc == 0)
+    {
+        GMX_THROW(gmx::InconsistentInputError("Empty array of vectors supplied"));
+    }
+    size_t ndata = (*c)[0].size();
+    if (ndata == 0)
+    {
+        GMX_THROW(gmx::InconsistentInputError("Empty vector supplied"));
+    }
+#ifndef NDEBUG
+    for (size_t i = 1; i < nfunc; i++)
+    {
+        if ((*c)[i].size() != ndata)
+        {
+            char buf[256];
+            snprintf(buf, sizeof(buf), "Vectors of different lengths supplied (%d %d)",
+                     static_cast<int>((*c)[i].size()),
+                     static_cast<int>(ndata));
+            GMX_THROW(gmx::InconsistentInputError(buf));
+        }
+    }
+#endif
+    // Add buffer size to the arrays.
+    size_t nfft = (3*ndata/2) + 1;
+    // Pad arrays with zeros
+    for (auto &i : *c)
+    {
+        i.resize(nfft, 0);
+    }
     #pragma omp parallel
     {
         try
         {
-            typedef real complex[2];
-            int          i, j;
-            gmx_fft_t    fft1;
-            complex     *in, *out;
-            int          i0, i1;
-            int          nthreads, thread_id;
+            gmx_fft_t         fft1;
+            std::vector<real> in, out;
 
-            nthreads  = gmx_omp_get_max_threads();
-            thread_id = gmx_omp_get_thread_num();
-            if ((0 == thread_id))
-            {
-                // fprintf(stderr, "There are %d threads for correlation functions\n", nthreads);
-            }
-            i0 = thread_id*nfunc/nthreads;
-            i1 = std::min(nfunc, (thread_id+1)*nfunc/nthreads);
+            int               nthreads  = gmx_omp_get_max_threads();
+            int               thread_id = gmx_omp_get_thread_num();
+            int               i0        = (thread_id*nfunc)/nthreads;
+            int               i1        = std::min(nfunc, ((thread_id+1)*nfunc)/nthreads);
 
             gmx_fft_init_1d(&fft1, nfft, GMX_FFT_FLAG_CONSERVATIVE);
             /* Allocate temporary arrays */
-            snew(in, nfft);
-            snew(out, nfft);
-            for (i = i0; (i < i1); i++)
+            in.resize(2*nfft, 0);
+            out.resize(2*nfft, 0);
+            for (int i = i0; (i < i1); i++)
             {
-                for (j = 0; j < ndata; j++)
-                {
-                    in[j][0] = c[i][j];
-                    in[j][1] = 0;
-                }
-                for (; (j < nfft); j++)
+                for (size_t j = 0; j < ndata; j++)
                 {
-                    in[j][0] = in[j][1] = 0;
+                    in[2*j+0] = (*c)[i][j];
+                    in[2*j+1] = 0;
                 }
-
-                gmx_fft_1d(fft1, GMX_FFT_BACKWARD, (void *)in, (void *)out);
-                for (j = 0; j < nfft; j++)
+                gmx_fft_1d(fft1, GMX_FFT_BACKWARD, (void *)in.data(), (void *)out.data());
+                for (size_t j = 0; j < nfft; j++)
                 {
-                    in[j][0] = (out[j][0]*out[j][0] + out[j][1]*out[j][1])/nfft;
-                    in[j][1] = 0;
+                    in[2*j+0] = (out[2*j+0]*out[2*j+0] + out[2*j+1]*out[2*j+1])/nfft;
+                    in[2*j+1] = 0;
                 }
-                for (; (j < nfft); j++)
+                gmx_fft_1d(fft1, GMX_FFT_FORWARD, (void *)in.data(), (void *)out.data());
+                for (size_t j = 0; (j < nfft); j++)
                 {
-                    in[j][0] = in[j][1] = 0;
-                }
-
-                gmx_fft_1d(fft1, GMX_FFT_FORWARD, (void *)in, (void *)out);
-                for (j = 0; (j < nfft); j++)
-                {
-                    c[i][j] = out[j][0];
+                    (*c)[i][j] = out[2*j+0];
                 }
             }
             /* Free the memory */
             gmx_fft_destroy(fft1);
-            sfree(in);
-            sfree(out);
         }
         GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
     }
-    // gmx_fft_cleanup();
+    for (auto &i : *c)
+    {
+        i.resize(ndata);
+    }
+
     return 0;
 }
index 160f2da71a2b1446104a3cd24cd6ade94f64a549..63409bcef5415e347d254611d3ed0b97ce2fbd5b 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,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.
 #ifndef GMX_MANYAUTOCORRELATION_H
 #define GMX_MANYAUTOCORRELATION_H
 
+#include <vector>
+
 #include "gromacs/fft/fft.h"
 #include "gromacs/utility/real.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /*! \brief
  * Perform many autocorrelation calculations.
  *
  * This routine performs many autocorrelation function calculations using FFTs.
- * The GROMACS FFT library wrapper is employed. On return the c[] arrays contain
+ * The GROMACS FFT library wrapper is employed. On return the c vector contain
  * a symmetric function that is useful for further FFT:ing, for instance in order to
  * compute spectra.
  *
+ * The vectors c[i] should all have the same length, but this is not checked for.
+ *
+ * The c arrays will be extend and filled with zero beyond ndata before
+ * computing the correlation.
+ *
  * The functions uses OpenMP parallellization.
  *
- * \param[in] nfunc   Number of data functions to autocorrelate
- * \param[in] ndata   Number of valid data points in the data
- * \param[in] nfft    Length of the data arrays, this should at least be 50% larger than ndata. The c arrays will filled with zero beyond ndata before computing the correlation.
- * \param[inout] c    Data array of size nfunc x nfft, will also be used for output
+ * \param[inout] c Data array
  * \return fft error code, or zero if everything went fine (see fft/fft.h)
+ * \throws gmx::InconsistentInputError if the input is inconsistent.
  */
-int many_auto_correl(int nfunc, int ndata, int nfft, real **c);
-
-#ifdef __cplusplus
-}
-#endif
+int many_auto_correl(std::vector<std::vector<real> > *c);
 
 #endif
index 5bb3ad4fef67348779e1d49ab93abe9bd3b6ad6a..1bcb355f5cab07323a4114ff9c84c9e1169bd1ea 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,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.
@@ -34,6 +34,7 @@
 
 gmx_add_unit_test(CorrelationsTest  correlations-test
   autocorr.cpp
+  manyautocorrelation.cpp
   correlationdataset.cpp
   expfit.cpp)
 
index 561ecb99e68ddaf86cf5aca407ba176884bbb05a..2d7053b4d9df635b8a300f9697562b73374aa10f 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) 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.
@@ -99,13 +99,13 @@ class AutocorrTest : public ::testing::Test
             std::string fileName = "testCOS3.xvg";
             data_                = CorrelationDataSetPointer(new CorrelationDataSet(fileName));
             nrFrames_            = data_->getNrLines();
-            tempArgs_            = add_acf_pargs(&n, NULL);
+            tempArgs_            = add_acf_pargs(&n, nullptr);
         }
 
         static void TearDownTestCase()
         {
             sfree(tempArgs_);
-            tempArgs_ = NULL;
+            tempArgs_ = nullptr;
             gmx_fft_cleanup();
         }
 
@@ -125,7 +125,7 @@ class AutocorrTest : public ::testing::Test
                 }
             }
             real *ptr = result.data();
-            low_do_autocorr(0, 0, 0,   nrFrames_, 1,
+            low_do_autocorr(nullptr, nullptr, nullptr,   nrFrames_, 1,
                             get_acfnout(), &ptr, data_->getDt(), mode,
                             nrRestart, bAverage, bNormalize,
                             bVerbose, data_->getStartTime(), data_->getEndTime(),
index 8eb263601503d5f8c4838b9fe50a03b8523eb7d7..593b6064432c51f2b3bd7c50043fc4920611e09d 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,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.
@@ -68,10 +68,10 @@ CorrelationDataSet::~CorrelationDataSet()
     for (int i = 0; i < nrColumns_; i++)
     {
         sfree(tempValues_[i]);
-        tempValues_[i] = NULL;
+        tempValues_[i] = nullptr;
     }
     sfree(tempValues_);
-    tempValues_ = NULL;
+    tempValues_ = nullptr;
 }
 
 real CorrelationDataSet::getValue(int set, int time) const
index a4e66a578df4538f98c813dd8407260296454086..eb93463fd9ced3b794b38bb0000d1f6969cc49c0 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,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.
@@ -85,7 +85,7 @@ class ExpfitTest : public ::testing::Test
         // Static initiation, only run once every test.
         static void SetUpTestCase()
         {
-            double                ** tempValues = NULL;
+            double                ** tempValues = nullptr;
             std::vector<std::string> fileName;
             fileName.push_back(test::TestFileManager::getInputFilePath("testINVEXP.xvg"));
             fileName.push_back(test::TestFileManager::getInputFilePath("testPRES.xvg"));
@@ -112,10 +112,10 @@ class ExpfitTest : public ::testing::Test
                 for (int j = 0; j < nrColumns; j++)
                 {
                     sfree(tempValues[j]);
-                    tempValues[j] = NULL;
+                    tempValues[j] = nullptr;
                 }
                 sfree(tempValues);
-                tempValues = NULL;
+                tempValues = nullptr;
             }
         }
 
@@ -136,12 +136,12 @@ class ExpfitTest : public ::testing::Test
             output_env_init_default(&oenv);
             do_lmfit(data_[testType].nrLines_,
                      &(data_[testType].y_[0]),
-                     NULL,
+                     nullptr,
                      data_[testType].dt_,
                      &(data_[testType].x_[0]),
                      data_[testType].startTime_,
                      data_[testType].endTime_,
-                     oenv, false, type, result, 0, NULL);
+                     oenv, false, type, result, 0, nullptr);
             output_env_done(oenv);
             checker_.setDefaultTolerance(test::relativeToleranceAsFloatingPoint(1, tolerance));
             checker_.checkSequenceArray(nfitparm, result, "result");
diff --git a/src/gromacs/correlationfunctions/tests/manyautocorrelation.cpp b/src/gromacs/correlationfunctions/tests/manyautocorrelation.cpp
new file mode 100644 (file)
index 0000000..92a8e85
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014,2015,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.
+ */
+/*! \internal \file
+ * \brief
+ * Implements low level test of manyautocorrelation routines
+ *
+ * \author David van der Spoel <david.vanderspoel@icm.uu.se>
+ * \ingroup module_correlationfunctions
+ */
+#include "gmxpre.h"
+
+#include "gromacs/correlationfunctions/manyautocorrelation.h"
+
+#include <cmath>
+
+#include <memory>
+
+#include <gtest/gtest.h>
+
+#include "gromacs/utility/exceptions.h"
+
+#include "testutils/testasserts.h"
+#include "testutils/testfilemanager.h"
+
+namespace gmx
+{
+namespace
+{
+
+class ManyAutocorrelationTest : public ::testing::Test
+{
+};
+
+TEST_F (ManyAutocorrelationTest, Empty)
+{
+    std::vector<std::vector<real> > c;
+    EXPECT_THROW_GMX(many_auto_correl(&c), gmx::InconsistentInputError);
+}
+
+#ifndef NDEBUG
+TEST_F (ManyAutocorrelationTest, DifferentLength)
+{
+    std::vector<std::vector<real> > c;
+    c.resize(3);
+    c[0].resize(10);
+    c[1].resize(10);
+    c[2].resize(8);
+    EXPECT_THROW_GMX(many_auto_correl(&c), gmx::InconsistentInputError);
+}
+#endif
+
+}
+
+}
diff --git a/src/gromacs/domdec/dlbtiming.cpp b/src/gromacs/domdec/dlbtiming.cpp
new file mode 100644 (file)
index 0000000..ebf3c9f
--- /dev/null
@@ -0,0 +1,172 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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 "dlbtiming.h"
+
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/utility/gmxassert.h"
+
+#include "domdec_internal.h"
+
+/*! \brief Struct for timing the region for dynamic load balancing */
+struct BalanceRegion
+{
+    /*! \brief Constructor */
+    BalanceRegion() :
+        isOpen(false),
+        isOpenOnCpu(false),
+        isOpenOnGpu(false),
+        cyclesOpenCpu(0),
+        cyclesLastCpu(0)
+    {
+    }
+
+    bool         isOpen;         /**< Are we in an open balancing region? */
+    bool         isOpenOnCpu;    /**< Is the, currently open, region still open on the CPU side? */
+    bool         isOpenOnGpu;    /**< Is the, currently open, region open on the GPU side? */
+    gmx_cycles_t cyclesOpenCpu;  /**< Cycle count when opening the CPU region */
+    gmx_cycles_t cyclesLastCpu;  /**< Cycle count at the last call to \p ddCloseBalanceRegionCpu() */
+};
+
+BalanceRegion *ddBalanceRegionAllocate()
+{
+    return new BalanceRegion;
+}
+
+/*! \brief Returns the pointer to the balance region.
+ *
+ * This should be replaced by a properly managed BalanceRegion class,
+ * but that requires a lot of refactoring in domdec.cpp.
+ */
+static BalanceRegion *getBalanceRegion(const gmx_domdec_t *dd)
+{
+    GMX_ASSERT(dd != nullptr && dd->comm != nullptr, "Balance regions should only be used with DD");
+    BalanceRegion *region = dd->comm->balanceRegion;
+    GMX_ASSERT(region != nullptr, "Balance region should be initialized before use");
+    return region;
+}
+
+void ddOpenBalanceRegionCpu(const gmx_domdec_t                    *dd,
+                            DdAllowBalanceRegionReopen gmx_unused  allowReopen)
+{
+    BalanceRegion *reg = getBalanceRegion(dd);
+    if (dd->comm->bRecordLoad)
+    {
+        GMX_ASSERT(allowReopen == DdAllowBalanceRegionReopen::yes || !reg->isOpen, "Should not open an already opened region");
+
+        reg->cyclesOpenCpu = gmx_cycles_read();
+        reg->isOpen        = true;
+        reg->isOpenOnCpu   = true;
+        reg->isOpenOnGpu   = false;
+    }
+}
+
+void ddOpenBalanceRegionGpu(const gmx_domdec_t *dd)
+{
+    BalanceRegion *reg = getBalanceRegion(dd);
+    if (reg->isOpen)
+    {
+        GMX_ASSERT(!reg->isOpenOnGpu, "Can not re-open a GPU balance region");
+        reg->isOpenOnGpu = true;
+    }
+}
+
+void ddReopenBalanceRegionCpu(const gmx_domdec_t *dd)
+{
+    BalanceRegion *reg = getBalanceRegion(dd);
+    /* If the GPU is busy, don't reopen as we are overlapping with work */
+    if (reg->isOpen && !reg->isOpenOnGpu)
+    {
+        reg->cyclesOpenCpu = gmx_cycles_read();
+    }
+}
+
+void ddCloseBalanceRegionCpu(const gmx_domdec_t *dd)
+{
+    BalanceRegion *reg = getBalanceRegion(dd);
+    if (reg->isOpen && reg->isOpenOnCpu)
+    {
+        GMX_ASSERT(reg->isOpenOnCpu, "Can only close an open region");
+        gmx_cycles_t cycles = gmx_cycles_read();
+        reg->isOpenOnCpu    = false;
+
+        if (reg->isOpenOnGpu)
+        {
+            /* Store the cycles for estimating the GPU/CPU overlap time */
+            reg->cyclesLastCpu = cycles;
+        }
+        else
+        {
+            /* We can close the region */
+            float cyclesCpu   = cycles - reg->cyclesOpenCpu;
+            dd_cycles_add(dd, cyclesCpu, ddCyclF);
+            reg->isOpen       = false;
+        }
+    }
+}
+
+void ddCloseBalanceRegionGpu(const gmx_domdec_t          *dd,
+                             float                        waitGpuCyclesInCpuRegion,
+                             DdBalanceRegionWaitedForGpu  waitedForGpu)
+{
+    BalanceRegion *reg = getBalanceRegion(dd);
+    if (reg->isOpen)
+    {
+        GMX_ASSERT(reg->isOpenOnGpu, "Can not close a non-open GPU balance region");
+        GMX_ASSERT(!reg->isOpenOnCpu, "The GPU region should be closed after closing the CPU region");
+
+        float waitGpuCyclesEstimate = gmx_cycles_read() - reg->cyclesLastCpu;
+        if (waitedForGpu == DdBalanceRegionWaitedForGpu::no)
+        {
+            /* The actual time could be anywhere between 0 and
+             * waitCyclesEstimate. Using half is the best we can do.
+             */
+            const float unknownWaitEstimateFactor = 0.5f;
+            waitGpuCyclesEstimate *= unknownWaitEstimateFactor;
+        }
+
+        float cyclesCpu = reg->cyclesLastCpu - reg->cyclesOpenCpu;
+        dd_cycles_add(dd, cyclesCpu + waitGpuCyclesEstimate, ddCyclF);
+
+        /* Register the total GPU wait time, to redistribute with GPU sharing */
+        dd_cycles_add(dd, waitGpuCyclesInCpuRegion + waitGpuCyclesEstimate, ddCyclWaitGPU);
+
+        /* Close the region */
+        reg->isOpenOnGpu = false;
+        reg->isOpen      = false;
+    }
+}
diff --git a/src/gromacs/domdec/dlbtiming.h b/src/gromacs/domdec/dlbtiming.h
new file mode 100644 (file)
index 0000000..b7e1d9f
--- /dev/null
@@ -0,0 +1,142 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+
+/*! \libinternal \file
+ *
+ * \brief This file declares functions for timing the load imbalance due to domain decomposition.
+ *
+ * \author Berk Hess <hess@kth.se>
+ * \inlibraryapi
+ * \ingroup module_domdec
+ */
+
+#ifndef GMX_DOMDEC_DLBTIMING_H
+#define GMX_DOMDEC_DLBTIMING_H
+
+struct BalanceRegion;
+struct gmx_domdec_t;
+
+/*! \brief Tells if we should open the balancing region */
+enum class DdOpenBalanceRegionBeforeForceComputation
+{
+    no,  //!< Do not open a balancing region
+    yes  //!< Open the balancing region before update or after pair-search
+};
+
+/*! \brief Tells if we should close the balancing region after the force computation has completed */
+enum class DdCloseBalanceRegionAfterForceComputation
+{
+    no,  //!< Do not close a balancing region
+    yes  //!< Close the balancing region after computation completed
+};
+
+/*! \brief Tells if we should open the balancing region */
+enum class DdAllowBalanceRegionReopen
+{
+    no,  //!< Do not allow opening an already open region
+    yes  //!< Allow opening an already open region
+};
+
+/*! \brief Tells if we had to wait for a GPU to finish computation */
+enum class DdBalanceRegionWaitedForGpu
+{
+    no,  //!< The GPU finished computation before the CPU needed the result
+    yes  //!< We had to wait for the GPU to finish computation
+};
+
+/*! \brief Returns a pointer to a constructed \p BalanceRegion struct
+ *
+ * Should be replaced by a proper constructor once BalanceRegion is a proper
+ * class (requires restructering in domdec.cpp).
+ */
+BalanceRegion *ddBalanceRegionAllocate();
+
+/*! \brief Open the load balance timing region on the CPU
+ *
+ * Opens the balancing region for timing how much time it takes to perform
+ * the (balancable part of) the MD step. This should be called right after
+ * the last communication during the previous step to maximize the region.
+ * In practice this means right after the force communication finished
+ * or just before neighbor search at search steps.
+ * It is assumed that computation done in the region either scales along
+ * with the domain size or takes constant time.
+ *
+ * \param[in,out] dd           The domain decomposition struct
+ * \param[in]     allowReopen  Allows calling with a potentially already opened region
+ */
+void ddOpenBalanceRegionCpu(const gmx_domdec_t         *dd,
+                            DdAllowBalanceRegionReopen  allowReopen);
+
+/*! \brief Open the load balance timing region for the CPU
+ *
+ * This can only be called within a region that is open on the CPU side.
+ */
+void ddOpenBalanceRegionGpu(const gmx_domdec_t *dd);
+
+/*! \brief Re-open the, already opened, load balance timing region
+ *
+ * This function should be called after every MPI communication that occurs
+ * in the main MD loop.
+ * Note that the current setup assumes that all MPI communication acts like
+ * a global barrier. But if some ranks don't participate in communication
+ * or if some ranks communicate faster with neighbors than others,
+ * the obtained timings might not accurately reflect the computation time.
+ *
+ * \param[in,out] dd  The domain decomposition struct
+ */
+void ddReopenBalanceRegionCpu(const gmx_domdec_t *dd);
+
+/*! \brief Close the load balance timing region on the CPU side
+ *
+ * \param[in,out] dd  The domain decomposition struct
+ */
+void ddCloseBalanceRegionCpu(const gmx_domdec_t *dd);
+
+/*! \brief Close the load balance timing region on the GPU side
+ *
+ * This should be called after the CPU receives the last (local) results
+ * from the GPU. The wait time for these results is estimated, depending
+ * on the \p waitedForGpu parameter.
+ * If called on an already closed region, this call does nothing.
+ *
+ * \param[in,out] dd                        The domain decomposition struct
+ * \param[in]     waitCyclesGpuInCpuRegion  The time we waited for the GPU earlier, overlapping completely with the open CPU region
+ * \param[in]     waitedForGpu              Tells if we waited for the GPU to finish now
+ */
+void ddCloseBalanceRegionGpu(const gmx_domdec_t          *dd,
+                             float                        waitCyclesGpuInCpuRegion,
+                             DdBalanceRegionWaitedForGpu  waitedForGpu);
+
+#endif
index 1d0d81eaf272c34d2775bdfe0e636e571549bc98..40ed1e789d3c4c3a3aa0ddf325d8ad5511518b6c 100644 (file)
@@ -70,6 +70,7 @@
 #include "gromacs/mdlib/gmx_omp_nthreads.h"
 #include "gromacs/mdlib/mdatoms.h"
 #include "gromacs/mdlib/mdrun.h"
+#include "gromacs/mdlib/mdsetup.h"
 #include "gromacs/mdlib/nb_verlet.h"
 #include "gromacs/mdlib/nbnxn_grid.h"
 #include "gromacs/mdlib/nsgrid.h"
@@ -91,6 +92,7 @@
 #include "gromacs/topology/block.h"
 #include "gromacs/topology/idef.h"
 #include "gromacs/topology/ifunc.h"
+#include "gromacs/topology/mtop_lookup.h"
 #include "gromacs/topology/mtop_util.h"
 #include "gromacs/topology/topology.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/qsort_threadsafe.h"
 #include "gromacs/utility/real.h"
 #include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/stringutil.h"
 
 #include "domdec_constraints.h"
 #include "domdec_internal.h"
@@ -250,7 +253,7 @@ int ddglatnr(const gmx_domdec_t *dd, int i)
 {
     int atnr;
 
-    if (dd == NULL)
+    if (dd == nullptr)
     {
         atnr = i + 1;
     }
@@ -271,16 +274,24 @@ t_block *dd_charge_groups_global(gmx_domdec_t *dd)
     return &dd->comm->cgs_gl;
 }
 
-static bool dlbIsOn(const gmx_domdec_comm_t *comm)
+/*! \brief Returns true if the DLB state indicates that the balancer is on. */
+static bool isDlbOn(const gmx_domdec_comm_t *comm)
 {
     return (comm->dlbState == edlbsOnCanTurnOff ||
-            comm->dlbState == edlbsOnForever);
+            comm->dlbState == edlbsOnUser);
+}
+/*! \brief Returns true if the DLB state indicates that the balancer is off/disabled.
+ */
+static bool isDlbDisabled(const gmx_domdec_comm_t *comm)
+{
+    return (comm->dlbState == edlbsOffUser ||
+            comm->dlbState == edlbsOffForever);
 }
 
 static void vec_rvec_init(vec_rvec_t *v)
 {
     v->nalloc = 0;
-    v->v      = NULL;
+    v->v      = nullptr;
 }
 
 static void vec_rvec_check_alloc(vec_rvec_t *v, int n)
@@ -298,16 +309,11 @@ void dd_store_state(gmx_domdec_t *dd, t_state *state)
 
     if (state->ddp_count != dd->ddp_count)
     {
-        gmx_incons("The state does not the domain decomposition state");
+        gmx_incons("The MD state does not match the domain decomposition state");
     }
 
-    state->ncg_gl = dd->ncg_home;
-    if (state->ncg_gl > state->cg_gl_nalloc)
-    {
-        state->cg_gl_nalloc = over_alloc_dd(state->ncg_gl);
-        srenew(state->cg_gl, state->cg_gl_nalloc);
-    }
-    for (i = 0; i < state->ncg_gl; i++)
+    state->cg_gl.resize(dd->ncg_home);
+    for (i = 0; i < dd->ncg_home; i++)
     {
         state->cg_gl[i] = dd->index_gl[i];
     }
@@ -355,7 +361,7 @@ void dd_get_ns_ranges(const gmx_domdec_t *dd, int icg,
         dim         = dd->dim[d];
         shift0[dim] = zones->izone[izone].shift0[dim];
         shift1[dim] = zones->izone[izone].shift1[dim];
-        if (dd->comm->tric_dir[dim] || (dlbIsOn(dd->comm) && d > 0))
+        if (dd->comm->tric_dir[dim] || (isDlbOn(dd->comm) && d > 0))
         {
             /* A conservative approach, this can be optimized */
             shift0[dim] -= 1;
@@ -364,6 +370,15 @@ void dd_get_ns_ranges(const gmx_domdec_t *dd, int icg,
     }
 }
 
+int dd_natoms_mdatoms(const gmx_domdec_t *dd)
+{
+    /* We currently set mdatoms entries for all atoms:
+     * local + non-local + communicated for vsite + constraints
+     */
+
+    return dd->comm->nat[ddnatNR - 1];
+}
+
 int dd_natoms_vsite(const gmx_domdec_t *dd)
 {
     return dd->comm->nat[ddnatVSITE];
@@ -511,7 +526,7 @@ void dd_move_f(gmx_domdec_t *dd, rvec f[], rvec *fshift)
            consider PBC in the treatment of fshift */
         bShiftForcesNeedPbc   = (dd->ci[dd->dim[d]] == 0);
         bScrew                = (bShiftForcesNeedPbc && dd->bScrewPBC && dd->dim[d] == XX);
-        if (fshift == NULL && !bScrew)
+        if (fshift == nullptr && !bScrew)
         {
             bShiftForcesNeedPbc = FALSE;
         }
@@ -1050,8 +1065,8 @@ static void dd_move_cellx(gmx_domdec_t *dd, gmx_ddbox_t *ddbox,
 static void dd_collect_cg(gmx_domdec_t *dd,
                           t_state      *state_local)
 {
-    gmx_domdec_master_t *ma = NULL;
-    int                  buf2[2], *ibuf, i, ncg_home = 0, *cg = NULL, nat_home = 0;
+    gmx_domdec_master_t *ma = nullptr;
+    int                  buf2[2], *ibuf, i, ncg_home = 0, *cg = nullptr, nat_home = 0;
 
     if (state_local->ddp_count == dd->comm->master_cg_ddp_count)
     {
@@ -1075,8 +1090,8 @@ static void dd_collect_cg(gmx_domdec_t *dd,
 
         cgs_gl = &dd->comm->cgs_gl;
 
-        ncg_home = state_local->ncg_gl;
-        cg       = state_local->cg_gl;
+        ncg_home = state_local->cg_gl.size();
+        cg       = state_local->cg_gl.data();
         nat_home = 0;
         for (i = 0; i < ncg_home; i++)
         {
@@ -1097,7 +1112,7 @@ static void dd_collect_cg(gmx_domdec_t *dd,
     }
     else
     {
-        ibuf = NULL;
+        ibuf = nullptr;
     }
     /* Collect the charge group and atom counts on the master */
     dd_gather(dd, 2*sizeof(int), buf2, ibuf);
@@ -1132,19 +1147,19 @@ static void dd_collect_cg(gmx_domdec_t *dd,
     /* Collect the charge group indices on the master */
     dd_gatherv(dd,
                ncg_home*sizeof(int), cg,
-               DDMASTER(dd) ? ma->ibuf : NULL,
-               DDMASTER(dd) ? ma->ibuf+dd->nnodes : NULL,
-               DDMASTER(dd) ? ma->cg : NULL);
+               DDMASTER(dd) ? ma->ibuf : nullptr,
+               DDMASTER(dd) ? ma->ibuf+dd->nnodes : nullptr,
+               DDMASTER(dd) ? ma->cg : nullptr);
 
     dd->comm->master_cg_ddp_count = state_local->ddp_count;
 }
 
 static void dd_collect_vec_sendrecv(gmx_domdec_t *dd,
-                                    rvec *lv, rvec *v)
+                                    const rvec *lv, rvec *v)
 {
     gmx_domdec_master_t *ma;
     int                  n, i, c, a, nalloc = 0;
-    rvec                *buf = NULL;
+    rvec                *buf = nullptr;
     t_block             *cgs_gl;
 
     ma = dd->ma;
@@ -1152,8 +1167,8 @@ static void dd_collect_vec_sendrecv(gmx_domdec_t *dd,
     if (!DDMASTER(dd))
     {
 #if GMX_MPI
-        MPI_Send(lv, dd->nat_home*sizeof(rvec), MPI_BYTE, DDMASTERRANK(dd),
-                 dd->rank, dd->mpi_comm_all);
+        MPI_Send(const_cast<void *>(static_cast<const void *>(lv)), dd->nat_home*sizeof(rvec), MPI_BYTE,
+                 DDMASTERRANK(dd), dd->rank, dd->mpi_comm_all);
 #endif
     }
     else
@@ -1217,12 +1232,12 @@ static void get_commbuffer_counts(gmx_domdec_t *dd,
 }
 
 static void dd_collect_vec_gatherv(gmx_domdec_t *dd,
-                                   rvec *lv, rvec *v)
+                                   const rvec *lv, rvec *v)
 {
     gmx_domdec_master_t *ma;
-    int                 *rcounts = NULL, *disps = NULL;
+    int                 *rcounts = nullptr, *disps = nullptr;
     int                  n, i, c, a;
-    rvec                *buf = NULL;
+    rvec                *buf = nullptr;
     t_block             *cgs_gl;
 
     ma = dd->ma;
@@ -1254,11 +1269,15 @@ static void dd_collect_vec_gatherv(gmx_domdec_t *dd,
     }
 }
 
-void dd_collect_vec(gmx_domdec_t *dd,
-                    t_state *state_local, rvec *lv, rvec *v)
+void dd_collect_vec(gmx_domdec_t           *dd,
+                    t_state                *state_local,
+                    const PaddedRVecVector *localVector,
+                    rvec                   *v)
 {
     dd_collect_cg(dd, state_local);
 
+    const rvec *lv = as_rvec_array(localVector->data());
+
     if (dd->nnodes <= GMX_DD_NNODES_SENDRECV)
     {
         dd_collect_vec_sendrecv(dd, lv, v);
@@ -1269,17 +1288,23 @@ void dd_collect_vec(gmx_domdec_t *dd,
     }
 }
 
+void dd_collect_vec(gmx_domdec_t           *dd,
+                    t_state                *state_local,
+                    const PaddedRVecVector *localVector,
+                    PaddedRVecVector       *vector)
+{
+    dd_collect_vec(dd, state_local, localVector, as_rvec_array(vector->data()));
+}
+
 
 void dd_collect_state(gmx_domdec_t *dd,
                       t_state *state_local, t_state *state)
 {
-    int est, i, j, nh;
-
-    nh = state->nhchainlength;
+    int nh = state->nhchainlength;
 
     if (DDMASTER(dd))
     {
-        for (i = 0; i < efptNR; i++)
+        for (int i = 0; i < efptNR; i++)
         {
             state->lambda[i] = state_local->lambda[i];
         }
@@ -1292,124 +1317,81 @@ void dd_collect_state(gmx_domdec_t *dd,
         copy_mat(state_local->fvir_prev, state->fvir_prev);
         copy_mat(state_local->pres_prev, state->pres_prev);
 
-        for (i = 0; i < state_local->ngtc; i++)
+        for (int i = 0; i < state_local->ngtc; i++)
         {
-            for (j = 0; j < nh; j++)
+            for (int j = 0; j < nh; j++)
             {
                 state->nosehoover_xi[i*nh+j]        = state_local->nosehoover_xi[i*nh+j];
                 state->nosehoover_vxi[i*nh+j]       = state_local->nosehoover_vxi[i*nh+j];
             }
             state->therm_integral[i] = state_local->therm_integral[i];
         }
-        for (i = 0; i < state_local->nnhpres; i++)
+        for (int i = 0; i < state_local->nnhpres; i++)
         {
-            for (j = 0; j < nh; j++)
+            for (int j = 0; j < nh; j++)
             {
                 state->nhpres_xi[i*nh+j]        = state_local->nhpres_xi[i*nh+j];
                 state->nhpres_vxi[i*nh+j]       = state_local->nhpres_vxi[i*nh+j];
             }
         }
+        state->baros_integral = state_local->baros_integral;
     }
-    for (est = 0; est < estNR; est++)
+    if (state_local->flags & (1 << estX))
     {
-        if (EST_DISTR(est) && (state_local->flags & (1<<est)))
-        {
-            switch (est)
-            {
-                case estX:
-                    dd_collect_vec(dd, state_local, state_local->x, state->x);
-                    break;
-                case estV:
-                    dd_collect_vec(dd, state_local, state_local->v, state->v);
-                    break;
-                case est_SDX_NOTSUPPORTED:
-                    break;
-                case estCGP:
-                    dd_collect_vec(dd, state_local, state_local->cg_p, state->cg_p);
-                    break;
-                case estDISRE_INITF:
-                case estDISRE_RM3TAV:
-                case estORIRE_INITF:
-                case estORIRE_DTAV:
-                    break;
-                default:
-                    gmx_incons("Unknown state entry encountered in dd_collect_state");
-            }
-        }
+        dd_collect_vec(dd, state_local, &state_local->x, &state->x);
+    }
+    if (state_local->flags & (1 << estV))
+    {
+        dd_collect_vec(dd, state_local, &state_local->v, &state->v);
+    }
+    if (state_local->flags & (1 << estCGP))
+    {
+        dd_collect_vec(dd, state_local, &state_local->cg_p, &state->cg_p);
     }
 }
 
-static void dd_realloc_state(t_state *state, rvec **f, int nalloc)
+static void dd_resize_state(t_state *state, PaddedRVecVector *f, int natoms)
 {
-    int est;
-
     if (debug)
     {
-        fprintf(debug, "Reallocating state: currently %d, required %d, allocating %d\n", state->nalloc, nalloc, over_alloc_dd(nalloc));
+        fprintf(debug, "Resizing state: currently %d, required %d\n", state->natoms, natoms);
     }
 
-    state->nalloc = over_alloc_dd(nalloc);
-
-    for (est = 0; est < estNR; est++)
-    {
-        if (EST_DISTR(est) && (state->flags & (1<<est)))
-        {
-            /* We need to allocate one element extra, since we might use
-             * (unaligned) 4-wide SIMD loads to access rvec entries.
-             */
-            switch (est)
-            {
-                case estX:
-                    srenew(state->x, state->nalloc + 1);
-                    break;
-                case estV:
-                    srenew(state->v, state->nalloc + 1);
-                    break;
-                case est_SDX_NOTSUPPORTED:
-                    break;
-                case estCGP:
-                    srenew(state->cg_p, state->nalloc + 1);
-                    break;
-                case estDISRE_INITF:
-                case estDISRE_RM3TAV:
-                case estORIRE_INITF:
-                case estORIRE_DTAV:
-                    /* No reallocation required */
-                    break;
-                default:
-                    gmx_incons("Unknown state entry encountered in dd_realloc_state");
-            }
-        }
-    }
+    state_change_natoms(state, natoms);
 
-    if (f != NULL)
+    if (f != nullptr)
     {
-        srenew(*f, state->nalloc);
+        /* We need to allocate one element extra, since we might use
+         * (unaligned) 4-wide SIMD loads to access rvec entries.
+         */
+        f->resize(natoms + 1);
     }
 }
 
-static void dd_check_alloc_ncg(t_forcerec *fr, t_state *state, rvec **f,
-                               int nalloc)
+static void dd_check_alloc_ncg(t_forcerec       *fr,
+                               t_state          *state,
+                               PaddedRVecVector *f,
+                               int               numChargeGroups)
 {
-    if (nalloc > fr->cg_nalloc)
+    if (numChargeGroups > fr->cg_nalloc)
     {
         if (debug)
         {
-            fprintf(debug, "Reallocating forcerec: currently %d, required %d, allocating %d\n", fr->cg_nalloc, nalloc, over_alloc_dd(nalloc));
+            fprintf(debug, "Reallocating forcerec: currently %d, required %d, allocating %d\n", fr->cg_nalloc, numChargeGroups, over_alloc_dd(numChargeGroups));
         }
-        fr->cg_nalloc = over_alloc_dd(nalloc);
+        fr->cg_nalloc = over_alloc_dd(numChargeGroups);
         srenew(fr->cginfo, fr->cg_nalloc);
         if (fr->cutoff_scheme == ecutsGROUP)
         {
             srenew(fr->cg_cm, fr->cg_nalloc);
         }
     }
-    if (fr->cutoff_scheme == ecutsVERLET && nalloc > state->nalloc)
+    if (fr->cutoff_scheme == ecutsVERLET)
     {
         /* We don't use charge groups, we use x in state to set up
          * the atom communication.
          */
-        dd_realloc_state(state, f, nalloc);
+        dd_resize_state(state, f, numChargeGroups);
     }
 }
 
@@ -1418,7 +1400,7 @@ static void dd_distribute_vec_sendrecv(gmx_domdec_t *dd, t_block *cgs,
 {
     gmx_domdec_master_t *ma;
     int                  n, i, c, a, nalloc = 0;
-    rvec                *buf = NULL;
+    rvec                *buf = nullptr;
 
     if (DDMASTER(dd))
     {
@@ -1478,9 +1460,9 @@ static void dd_distribute_vec_scatterv(gmx_domdec_t *dd, t_block *cgs,
                                        rvec *v, rvec *lv)
 {
     gmx_domdec_master_t *ma;
-    int                 *scounts = NULL, *disps = NULL;
+    int                 *scounts = nullptr, *disps = nullptr;
     int                  n, i, c, a;
-    rvec                *buf = NULL;
+    rvec                *buf = nullptr;
 
     if (DDMASTER(dd))
     {
@@ -1519,7 +1501,11 @@ static void dd_distribute_vec(gmx_domdec_t *dd, t_block *cgs, rvec *v, rvec *lv)
 
 static void dd_distribute_dfhist(gmx_domdec_t *dd, df_history_t *dfhist)
 {
-    int i;
+    if (dfhist == nullptr)
+    {
+        return;
+    }
+
     dd_bcast(dd, sizeof(int), &dfhist->bEquil);
     dd_bcast(dd, sizeof(int), &dfhist->nlambda);
     dd_bcast(dd, sizeof(real), &dfhist->wl_delta);
@@ -1534,7 +1520,7 @@ static void dd_distribute_dfhist(gmx_domdec_t *dd, df_history_t *dfhist)
         dd_bcast(dd, sizeof(real)*nlam, dfhist->sum_minvar);
         dd_bcast(dd, sizeof(real)*nlam, dfhist->sum_variance);
 
-        for (i = 0; i < nlam; i++)
+        for (int i = 0; i < nlam; i++)
         {
             dd_bcast(dd, sizeof(real)*nlam, dfhist->accum_p[i]);
             dd_bcast(dd, sizeof(real)*nlam, dfhist->accum_m[i]);
@@ -1548,15 +1534,13 @@ static void dd_distribute_dfhist(gmx_domdec_t *dd, df_history_t *dfhist)
 
 static void dd_distribute_state(gmx_domdec_t *dd, t_block *cgs,
                                 t_state *state, t_state *state_local,
-                                rvec **f)
+                                PaddedRVecVector *f)
 {
-    int  i, j, nh;
-
-    nh = state->nhchainlength;
+    int nh = state->nhchainlength;
 
     if (DDMASTER(dd))
     {
-        for (i = 0; i < efptNR; i++)
+        for (int i = 0; i < efptNR; i++)
         {
             state_local->lambda[i] = state->lambda[i];
         }
@@ -1568,26 +1552,30 @@ static void dd_distribute_state(gmx_domdec_t *dd, t_block *cgs,
         copy_mat(state->boxv, state_local->boxv);
         copy_mat(state->svir_prev, state_local->svir_prev);
         copy_mat(state->fvir_prev, state_local->fvir_prev);
-        copy_df_history(&state_local->dfhist, &state->dfhist);
-        for (i = 0; i < state_local->ngtc; i++)
+        if (state->dfhist != nullptr)
         {
-            for (j = 0; j < nh; j++)
+            copy_df_history(state_local->dfhist, state->dfhist);
+        }
+        for (int i = 0; i < state_local->ngtc; i++)
+        {
+            for (int j = 0; j < nh; j++)
             {
                 state_local->nosehoover_xi[i*nh+j]        = state->nosehoover_xi[i*nh+j];
                 state_local->nosehoover_vxi[i*nh+j]       = state->nosehoover_vxi[i*nh+j];
             }
             state_local->therm_integral[i] = state->therm_integral[i];
         }
-        for (i = 0; i < state_local->nnhpres; i++)
+        for (int i = 0; i < state_local->nnhpres; i++)
         {
-            for (j = 0; j < nh; j++)
+            for (int j = 0; j < nh; j++)
             {
                 state_local->nhpres_xi[i*nh+j]        = state->nhpres_xi[i*nh+j];
                 state_local->nhpres_vxi[i*nh+j]       = state->nhpres_vxi[i*nh+j];
             }
         }
+        state_local->baros_integral = state->baros_integral;
     }
-    dd_bcast(dd, ((efptNR)*sizeof(real)), state_local->lambda);
+    dd_bcast(dd, ((efptNR)*sizeof(real)), state_local->lambda.data());
     dd_bcast(dd, sizeof(int), &state_local->fep_state);
     dd_bcast(dd, sizeof(real), &state_local->veta);
     dd_bcast(dd, sizeof(real), &state_local->vol0);
@@ -1596,46 +1584,28 @@ static void dd_distribute_state(gmx_domdec_t *dd, t_block *cgs,
     dd_bcast(dd, sizeof(state_local->boxv), state_local->boxv);
     dd_bcast(dd, sizeof(state_local->svir_prev), state_local->svir_prev);
     dd_bcast(dd, sizeof(state_local->fvir_prev), state_local->fvir_prev);
-    dd_bcast(dd, ((state_local->ngtc*nh)*sizeof(double)), state_local->nosehoover_xi);
-    dd_bcast(dd, ((state_local->ngtc*nh)*sizeof(double)), state_local->nosehoover_vxi);
-    dd_bcast(dd, state_local->ngtc*sizeof(double), state_local->therm_integral);
-    dd_bcast(dd, ((state_local->nnhpres*nh)*sizeof(double)), state_local->nhpres_xi);
-    dd_bcast(dd, ((state_local->nnhpres*nh)*sizeof(double)), state_local->nhpres_vxi);
+    dd_bcast(dd, ((state_local->ngtc*nh)*sizeof(double)), state_local->nosehoover_xi.data());
+    dd_bcast(dd, ((state_local->ngtc*nh)*sizeof(double)), state_local->nosehoover_vxi.data());
+    dd_bcast(dd, state_local->ngtc*sizeof(double), state_local->therm_integral.data());
+    dd_bcast(dd, ((state_local->nnhpres*nh)*sizeof(double)), state_local->nhpres_xi.data());
+    dd_bcast(dd, ((state_local->nnhpres*nh)*sizeof(double)), state_local->nhpres_vxi.data());
 
     /* communicate df_history -- required for restarting from checkpoint */
-    dd_distribute_dfhist(dd, &state_local->dfhist);
+    dd_distribute_dfhist(dd, state_local->dfhist);
+
+    dd_resize_state(state_local, f, dd->nat_home);
 
-    if (dd->nat_home > state_local->nalloc)
+    if (state_local->flags & (1 << estX))
     {
-        dd_realloc_state(state_local, f, dd->nat_home);
+        dd_distribute_vec(dd, cgs, as_rvec_array(state->x.data()), as_rvec_array(state_local->x.data()));
     }
-    for (i = 0; i < estNR; i++)
+    if (state_local->flags & (1 << estV))
     {
-        if (EST_DISTR(i) && (state_local->flags & (1<<i)))
-        {
-            switch (i)
-            {
-                case estX:
-                    dd_distribute_vec(dd, cgs, state->x, state_local->x);
-                    break;
-                case estV:
-                    dd_distribute_vec(dd, cgs, state->v, state_local->v);
-                    break;
-                case est_SDX_NOTSUPPORTED:
-                    break;
-                case estCGP:
-                    dd_distribute_vec(dd, cgs, state->cg_p, state_local->cg_p);
-                    break;
-                case estDISRE_INITF:
-                case estDISRE_RM3TAV:
-                case estORIRE_INITF:
-                case estORIRE_DTAV:
-                    /* Not implemented yet */
-                    break;
-                default:
-                    gmx_incons("Unknown state entry encountered in dd_distribute_state");
-            }
-        }
+        dd_distribute_vec(dd, cgs, as_rvec_array(state->v.data()), as_rvec_array(state_local->v.data()));
+    }
+    if (state_local->flags & (1 << estCGP))
+    {
+        dd_distribute_vec(dd, cgs, as_rvec_array(state->cg_p.data()), as_rvec_array(state_local->cg_p.data()));
     }
 }
 
@@ -1657,7 +1627,7 @@ static char dim2char(int dim)
 static void write_dd_grid_pdb(const char *fn, gmx_int64_t step,
                               gmx_domdec_t *dd, matrix box, gmx_ddbox_t *ddbox)
 {
-    rvec   grid_s[2], *grid_r = NULL, cx, r;
+    rvec   grid_s[2], *grid_r = nullptr, cx, r;
     char   fname[STRLEN], buf[22];
     FILE  *out;
     int    a, i, d, z, y, x;
@@ -1672,7 +1642,7 @@ static void write_dd_grid_pdb(const char *fn, gmx_int64_t step,
         snew(grid_r, 2*dd->nnodes);
     }
 
-    dd_gather(dd, 2*sizeof(rvec), grid_s, DDMASTER(dd) ? grid_r : NULL);
+    dd_gather(dd, 2*sizeof(rvec), grid_s, DDMASTER(dd) ? grid_r : nullptr);
 
     if (DDMASTER(dd))
     {
@@ -1749,7 +1719,7 @@ void write_dd_pdb(const char *fn, gmx_int64_t step, const char *title,
     char          fname[STRLEN], buf[22];
     FILE         *out;
     int           i, ii, resnr, c;
-    char         *atomname, *resname;
+    const char   *atomname, *resname;
     real          b;
     gmx_domdec_t *dd;
 
@@ -1765,10 +1735,11 @@ void write_dd_pdb(const char *fn, gmx_int64_t step, const char *title,
 
     fprintf(out, "TITLE     %s\n", title);
     gmx_write_pdb_box(out, dd->bScrewPBC ? epbcSCREW : epbcXYZ, box);
+    int molb = 0;
     for (i = 0; i < natoms; i++)
     {
         ii = dd->gatindex[i];
-        gmx_mtop_atominfo_global(mtop, ii, &atomname, &resnr, &resname);
+        mtopGetAtomAndResidueName(mtop, ii, &molb, &atomname, &resnr, &resname, nullptr);
         if (i < dd->comm->nat[ddnatZONE])
         {
             c = 0;
@@ -1994,7 +1965,7 @@ static int dd_simnode2pmenode(const gmx_domdec_t         *dd,
         /* This assumes DD cells with identical x coordinates
          * are numbered sequentially.
          */
-        if (dd->comm->pmenodes == NULL)
+        if (dd->comm->pmenodes == nullptr)
         {
             if (sim_nodeid < dd->nnodes)
             {
@@ -2022,7 +1993,7 @@ static int dd_simnode2pmenode(const gmx_domdec_t         *dd,
 void get_pme_nnodes(const gmx_domdec_t *dd,
                     int *npmenodes_x, int *npmenodes_y)
 {
-    if (dd != NULL)
+    if (dd != nullptr)
     {
         *npmenodes_x = dd->comm->npmenodes_x;
         *npmenodes_y = dd->comm->npmenodes_y;
@@ -2151,25 +2122,26 @@ static void set_zones_ncg_home(gmx_domdec_t *dd)
 }
 
 static void rebuild_cgindex(gmx_domdec_t *dd,
-                            const int *gcgs_index, t_state *state)
+                            const int *gcgs_index, const t_state *state)
 {
-    int nat, i, *ind, *dd_cg_gl, *cgindex, cg_gl;
+    int * gmx_restrict dd_cg_gl = dd->index_gl;
+    int * gmx_restrict cgindex  = dd->cgindex;
+    int                nat      = 0;
 
-    ind        = state->cg_gl;
-    dd_cg_gl   = dd->index_gl;
-    cgindex    = dd->cgindex;
-    nat        = 0;
+    /* Copy back the global charge group indices from state
+     * and rebuild the local charge group to atom index.
+     */
     cgindex[0] = nat;
-    for (i = 0; i < state->ncg_gl; i++)
+    for (unsigned int i = 0; i < state->cg_gl.size(); i++)
     {
         cgindex[i]  = nat;
-        cg_gl       = ind[i];
+        int cg_gl   = state->cg_gl[i];
         dd_cg_gl[i] = cg_gl;
         nat        += gcgs_index[cg_gl+1] - gcgs_index[cg_gl];
     }
-    cgindex[i] = nat;
+    cgindex[state->cg_gl.size()] = nat;
 
-    dd->ncg_home = state->ncg_gl;
+    dd->ncg_home = state->cg_gl.size();
     dd->nat_home = nat;
 
     set_zones_ncg_home(dd);
@@ -2192,7 +2164,7 @@ static void dd_set_cginfo(int *index_gl, int cg0, int cg1,
     int         *cginfo;
     int          cg;
 
-    if (fr != NULL)
+    if (fr != nullptr)
     {
         cginfo_mb = fr->cginfo_mb;
         cginfo    = fr->cginfo;
@@ -2203,7 +2175,7 @@ static void dd_set_cginfo(int *index_gl, int cg0, int cg1,
         }
     }
 
-    if (bLocalCG != NULL)
+    if (bLocalCG != nullptr)
     {
         for (cg = cg0; cg < cg1; cg++)
         {
@@ -2286,7 +2258,7 @@ static int check_bLocalCG(gmx_domdec_t *dd, int ncg_sys, const char *bLocalCG,
     int i, ngl, nerr;
 
     nerr = 0;
-    if (bLocalCG == NULL)
+    if (bLocalCG == nullptr)
     {
         return nerr;
     }
@@ -2812,7 +2784,7 @@ static void set_dd_cell_sizes_slb(gmx_domdec_t *dd, const gmx_ddbox_t *ddbox,
     {
         cellsize_min[d] = ddbox->box_size[d]*ddbox->skew_fac[d];
         npulse[d]       = 1;
-        if (dd->nc[d] == 1 || comm->slb_frac[d] == NULL)
+        if (dd->nc[d] == 1 || comm->slb_frac[d] == nullptr)
         {
             /* Uniform grid */
             cell_dx = ddbox->box_size[d]/dd->nc[d];
@@ -2904,7 +2876,7 @@ static void set_dd_cell_sizes_slb(gmx_domdec_t *dd, const gmx_ddbox_t *ddbox,
         }
     }
 
-    if (!dlbIsOn(comm))
+    if (!isDlbOn(comm))
     {
         copy_rvec(cellsize_min, comm->cellsize_min);
     }
@@ -2912,7 +2884,7 @@ static void set_dd_cell_sizes_slb(gmx_domdec_t *dd, const gmx_ddbox_t *ddbox,
     for (d = 0; d < comm->npmedecompdim; d++)
     {
         set_pme_maxshift(dd, &comm->ddpme[d],
-                         comm->slb_frac[dd->dim[d]] == NULL, ddbox,
+                         comm->slb_frac[dd->dim[d]] == nullptr, ddbox,
                          comm->ddpme[d].slb_dim_f);
     }
 }
@@ -3479,7 +3451,7 @@ static void realloc_comm_ind(gmx_domdec_t *dd, ivec npulse)
             srenew(cd->ind, np);
             for (i = cd->np_nalloc; i < np; i++)
             {
-                cd->ind[i].index  = NULL;
+                cd->ind[i].index  = nullptr;
                 cd->ind[i].nalloc = 0;
             }
             cd->np_nalloc = np;
@@ -3504,7 +3476,7 @@ static void set_dd_cell_sizes(gmx_domdec_t *dd,
     copy_rvec(comm->cell_x0, comm->old_cell_x0);
     copy_rvec(comm->cell_x1, comm->old_cell_x1);
 
-    if (dlbIsOn(comm))
+    if (isDlbOn(comm))
     {
         if (DDMASTER(dd))
         {
@@ -3545,7 +3517,7 @@ static void comm_dd_ns_cell_sizes(gmx_domdec_t *dd,
         /* Without PBC we don't have restrictions on the outer cells */
         if (!(dim >= ddbox->npbcdim &&
               (dd->ci[dim] == 0 || dd->ci[dim] == dd->nc[dim] - 1)) &&
-            dlbIsOn(comm) &&
+            isDlbOn(comm) &&
             (comm->cell_x1[dim] - comm->cell_x0[dim])*ddbox->skew_fac[dim] <
             comm->cellsize_min[dim])
         {
@@ -3559,11 +3531,11 @@ static void comm_dd_ns_cell_sizes(gmx_domdec_t *dd,
         }
     }
 
-    if ((dlbIsOn(dd->comm) && dd->ndim > 1) || ddbox->nboundeddim < DIM)
+    if ((isDlbOn(dd->comm) && dd->ndim > 1) || ddbox->nboundeddim < DIM)
     {
         /* Communicate the boundaries and update cell_ns_x0/1 */
         dd_move_cellx(dd, ddbox, cell_ns_x0, cell_ns_x1);
-        if (dlbIsOn(dd->comm) && dd->ndim > 1)
+        if (isDlbOn(dd->comm) && dd->ndim > 1)
         {
             check_grid_jump(step, dd, dd->comm->cutoff, ddbox, TRUE);
         }
@@ -3612,7 +3584,7 @@ static void distribute_cg(FILE *fplog,
                           gmx_domdec_t *dd)
 {
     gmx_domdec_master_t *ma;
-    int                **tmp_ind = NULL, *tmp_nalloc = NULL;
+    int                **tmp_ind = nullptr, *tmp_nalloc = nullptr;
     int                  i, icg, j, k, k0, k1, d;
     matrix               tcm;
     rvec                 cg_cm;
@@ -3790,7 +3762,7 @@ static void get_cg_distribution(FILE *fplog, gmx_domdec_t *dd,
                                 t_block *cgs, matrix box, gmx_ddbox_t *ddbox,
                                 rvec pos[])
 {
-    gmx_domdec_master_t *ma = NULL;
+    gmx_domdec_master_t *ma = nullptr;
     ivec                 npulse;
     int                  i, cg_gl;
     int                 *ibuf, buf2[2] = { 0, 0 };
@@ -3817,7 +3789,7 @@ static void get_cg_distribution(FILE *fplog, gmx_domdec_t *dd,
     }
     else
     {
-        ibuf = NULL;
+        ibuf = nullptr;
     }
     dd_scatter(dd, 2*sizeof(int), ibuf, buf2);
 
@@ -3841,9 +3813,9 @@ static void get_cg_distribution(FILE *fplog, gmx_domdec_t *dd,
     }
 
     dd_scatterv(dd,
-                bMaster ? ma->ibuf : NULL,
-                bMaster ? ma->ibuf+dd->nnodes : NULL,
-                bMaster ? ma->cg : NULL,
+                bMaster ? ma->ibuf : nullptr,
+                bMaster ? ma->ibuf+dd->nnodes : nullptr,
+                bMaster ? ma->cg : nullptr,
                 dd->ncg_home*sizeof(int), dd->index_gl);
 
     /* Determine the home charge group sizes */
@@ -4116,39 +4088,21 @@ static void cg_move_error(FILE *fplog,
 
 static void rotate_state_atom(t_state *state, int a)
 {
-    int est;
-
-    for (est = 0; est < estNR; est++)
+    if (state->flags & (1 << estX))
     {
-        if (EST_DISTR(est) && (state->flags & (1<<est)))
-        {
-            switch (est)
-            {
-                case estX:
-                    /* Rotate the complete state; for a rectangular box only */
-                    state->x[a][YY] = state->box[YY][YY] - state->x[a][YY];
-                    state->x[a][ZZ] = state->box[ZZ][ZZ] - state->x[a][ZZ];
-                    break;
-                case estV:
-                    state->v[a][YY] = -state->v[a][YY];
-                    state->v[a][ZZ] = -state->v[a][ZZ];
-                    break;
-                case est_SDX_NOTSUPPORTED:
-                    break;
-                case estCGP:
-                    state->cg_p[a][YY] = -state->cg_p[a][YY];
-                    state->cg_p[a][ZZ] = -state->cg_p[a][ZZ];
-                    break;
-                case estDISRE_INITF:
-                case estDISRE_RM3TAV:
-                case estORIRE_INITF:
-                case estORIRE_DTAV:
-                    /* These are distances, so not affected by rotation */
-                    break;
-                default:
-                    gmx_incons("Unknown state entry encountered in rotate_state_atom");
-            }
-        }
+        /* Rotate the complete state; for a rectangular box only */
+        state->x[a][YY] = state->box[YY][YY] - state->x[a][YY];
+        state->x[a][ZZ] = state->box[ZZ][ZZ] - state->x[a][ZZ];
+    }
+    if (state->flags & (1 << estV))
+    {
+        state->v[a][YY] = -state->v[a][YY];
+        state->v[a][ZZ] = -state->v[a][ZZ];
+    }
+    if (state->flags & (1 << estCGP))
+    {
+        state->cg_p[a][YY] = -state->cg_p[a][YY];
+        state->cg_p[a][ZZ] = -state->cg_p[a][ZZ];
     }
 }
 
@@ -4232,7 +4186,7 @@ static void calc_cg_move(FILE *fplog, gmx_int64_t step,
                     if (pos_d >= limit1[d])
                     {
                         cg_move_error(fplog, dd, step, cg, d, 1,
-                                      cg_cm != state->x, limitd[d],
+                                      cg_cm != as_rvec_array(state->x.data()), limitd[d],
                                       cg_cm[cg], cm_new, pos_d);
                     }
                     dev[d] = 1;
@@ -4259,7 +4213,7 @@ static void calc_cg_move(FILE *fplog, gmx_int64_t step,
                     if (pos_d < limit0[d])
                     {
                         cg_move_error(fplog, dd, step, cg, d, -1,
-                                      cg_cm != state->x, limitd[d],
+                                      cg_cm != as_rvec_array(state->x.data()), limitd[d],
                                       cg_cm[cg], cm_new, pos_d);
                     }
                     dev[d] = -1;
@@ -4343,7 +4297,7 @@ static void calc_cg_move(FILE *fplog, gmx_int64_t step,
 
 static void dd_redistribute_cg(FILE *fplog, gmx_int64_t step,
                                gmx_domdec_t *dd, ivec tric_dir,
-                               t_state *state, rvec **f,
+                               t_state *state, PaddedRVecVector *f,
                                t_forcerec *fr,
                                gmx_bool bCompact,
                                t_nrnb *nrnb,
@@ -4352,16 +4306,15 @@ static void dd_redistribute_cg(FILE *fplog, gmx_int64_t step,
 {
     int               *move;
     int                npbcdim;
-    int                ncg[DIM*2], nat[DIM*2];
-    int                c, i, cg, k, d, dim, dim2, dir, d2, d3;
+    int                ncg[DIM*2] = { 0 }, nat[DIM*2] = { 0 };
+    int                i, cg, k, d, dim, dim2, dir, d2, d3;
     int                mc, cdd, nrcg, ncg_recv, nvs, nvr, nvec, vec;
     int                sbuf[2], rbuf[2];
     int                home_pos_cg, home_pos_at, buf_pos;
     int                flag;
-    gmx_bool           bV = FALSE, bCGP = FALSE;
     real               pos_d;
     matrix             tcm;
-    rvec              *cg_cm = NULL, cell_x0, cell_x1, limitd, limit0, limit1;
+    rvec              *cg_cm = nullptr, cell_x0, cell_x1, limitd, limit0, limit1;
     int               *cgindex;
     cginfo_mb_t       *cginfo_mb;
     gmx_domdec_comm_t *comm;
@@ -4379,29 +4332,9 @@ static void dd_redistribute_cg(FILE *fplog, gmx_int64_t step,
         cg_cm = fr->cg_cm;
     }
 
-    for (i = 0; i < estNR; i++)
-    {
-        if (EST_DISTR(i))
-        {
-            switch (i)
-            {
-                case estX: /* Always present */ break;
-                case estV:   bV   = (state->flags & (1<<i)); break;
-                case est_SDX_NOTSUPPORTED: break;
-                case estCGP: bCGP = (state->flags & (1<<i)); break;
-                case estLD_RNG:
-                case estLD_RNGI:
-                case estDISRE_INITF:
-                case estDISRE_RM3TAV:
-                case estORIRE_INITF:
-                case estORIRE_DTAV:
-                    /* No processing required */
-                    break;
-                default:
-                    gmx_incons("Unknown state entry encountered in dd_redistribute_cg");
-            }
-        }
-    }
+    // Positions are always present, so there's nothing to flag
+    bool bV   = state->flags & (1<<estV);
+    bool bCGP = state->flags & (1<<estCGP);
 
     if (dd->ncg_tot > comm->nalloc_int)
     {
@@ -4410,13 +4343,6 @@ static void dd_redistribute_cg(FILE *fplog, gmx_int64_t step,
     }
     move = comm->buf_int;
 
-    /* Clear the count */
-    for (c = 0; c < dd->ndim*2; c++)
-    {
-        ncg[c] = 0;
-        nat[c] = 0;
-    }
-
     npbcdim = dd->npbcdim;
 
     for (d = 0; (d < DIM); d++)
@@ -4472,7 +4398,7 @@ static void dd_redistribute_cg(FILE *fplog, gmx_int64_t step,
                          cgindex,
                          ( thread   *dd->ncg_home)/nthread,
                          ((thread+1)*dd->ncg_home)/nthread,
-                         fr->cutoff_scheme == ecutsGROUP ? cg_cm : state->x,
+                         fr->cutoff_scheme == ecutsGROUP ? cg_cm : as_rvec_array(state->x.data()),
                          move);
         }
         GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
@@ -4551,7 +4477,7 @@ static void dd_redistribute_cg(FILE *fplog, gmx_int64_t step,
              */
             home_pos_cg =
                 compact_and_copy_vec_cg(dd->ncg_home, move, cgindex,
-                                        nvec, state->x, comm, FALSE);
+                                        nvec, as_rvec_array(state->x.data()), comm, FALSE);
             if (bCompact)
             {
                 home_pos_cg -= *ncg_moved;
@@ -4565,16 +4491,19 @@ static void dd_redistribute_cg(FILE *fplog, gmx_int64_t step,
     vec         = 0;
     home_pos_at =
         compact_and_copy_vec_at(dd->ncg_home, move, cgindex,
-                                nvec, vec++, state->x, comm, bCompact);
+                                nvec, vec++, as_rvec_array(state->x.data()),
+                                comm, bCompact);
     if (bV)
     {
         compact_and_copy_vec_at(dd->ncg_home, move, cgindex,
-                                nvec, vec++, state->v, comm, bCompact);
+                                nvec, vec++, as_rvec_array(state->v.data()),
+                                comm, bCompact);
     }
     if (bCGP)
     {
         compact_and_copy_vec_at(dd->ncg_home, move, cgindex,
-                                nvec, vec++, state->cg_p, comm, bCompact);
+                                nvec, vec++, as_rvec_array(state->cg_p.data()),
+                                comm, bCompact);
     }
 
     if (bCompact)
@@ -4650,6 +4579,13 @@ static void dd_redistribute_cg(FILE *fplog, gmx_int64_t step,
             nvr      += i;
         }
 
+        dd_check_alloc_ncg(fr, state, f, home_pos_cg + ncg_recv);
+        if (fr->cutoff_scheme == ecutsGROUP)
+        {
+            /* Here we resize to more than necessary and shrink later */
+            dd_resize_state(state, f, home_pos_at + ncg_recv*MAX_CGCGSIZE);
+        }
+
         /* Process the received charge groups */
         buf_pos = 0;
         for (cg = 0; cg < ncg_recv; cg++)
@@ -4681,7 +4617,7 @@ static void dd_redistribute_cg(FILE *fplog, gmx_int64_t step,
                 /* Check which direction this cg should go */
                 for (d2 = d+1; (d2 < dd->ndim && mc == -1); d2++)
                 {
-                    if (dlbIsOn(dd->comm))
+                    if (isDlbOn(dd->comm))
                     {
                         /* The cell boundaries for dimension d2 are not equal
                          * for each cell row of the lower dimension(s),
@@ -4762,7 +4698,6 @@ static void dd_redistribute_cg(FILE *fplog, gmx_int64_t step,
                 dd->index_gl[home_pos_cg]  = comm->buf_int[cg*DD_CGIBS];
                 dd->cgindex[home_pos_cg+1] = dd->cgindex[home_pos_cg] + nrcg;
                 /* Copy the state from the buffer */
-                dd_check_alloc_ncg(fr, state, f, home_pos_cg+1);
                 if (fr->cutoff_scheme == ecutsGROUP)
                 {
                     cg_cm = fr->cg_cm;
@@ -4778,10 +4713,6 @@ static void dd_redistribute_cg(FILE *fplog, gmx_int64_t step,
                     comm->bLocalCG[dd->index_gl[home_pos_cg]] = TRUE;
                 }
 
-                if (home_pos_at+nrcg > state->nalloc)
-                {
-                    dd_realloc_state(state, f, home_pos_at+nrcg);
-                }
                 for (i = 0; i < nrcg; i++)
                 {
                     copy_rvec(comm->vbuf.v[buf_pos++],
@@ -4850,6 +4781,12 @@ static void dd_redistribute_cg(FILE *fplog, gmx_int64_t step,
     dd->ncg_home = home_pos_cg;
     dd->nat_home = home_pos_at;
 
+    if (fr->cutoff_scheme == ecutsGROUP && !bCompact)
+    {
+        /* We overallocated before, we need to set the right size here */
+        dd_resize_state(state, f, dd->nat_home);
+    }
+
     if (debug)
     {
         fprintf(debug,
@@ -4859,7 +4796,7 @@ static void dd_redistribute_cg(FILE *fplog, gmx_int64_t step,
     }
 }
 
-void dd_cycles_add(gmx_domdec_t *dd, float cycles, int ddCycl)
+void dd_cycles_add(const gmx_domdec_t *dd, float cycles, int ddCycl)
 {
     /* Note that the cycles value can be incorrect, either 0 or some
      * extremely large value, when our thread migrated to another core
@@ -4892,7 +4829,7 @@ static double force_flop_count(t_nrnb *nrnb)
          * for the normal loops and again half it for water loops.
          */
         name = nrnb_str(i);
-        if (strstr(name, "W3") != NULL || strstr(name, "W4") != NULL)
+        if (strstr(name, "W3") != nullptr || strstr(name, "W4") != nullptr)
         {
             sum += nrnb->n[i]*0.25*cost_nrnb(i);
         }
@@ -4904,7 +4841,7 @@ static double force_flop_count(t_nrnb *nrnb)
     for (i = eNR_NBKERNEL_FREE_ENERGY; i <= eNR_NB14; i++)
     {
         name = nrnb_str(i);
-        if (strstr(name, "W3") != NULL || strstr(name, "W4") != NULL)
+        if (strstr(name, "W3") != nullptr || strstr(name, "W4") != nullptr)
         {
             sum += nrnb->n[i]*cost_nrnb(i);
         }
@@ -4951,7 +4888,7 @@ static void get_load_distribution(gmx_domdec_t *dd, gmx_wallcycle_t wcycle)
 {
     gmx_domdec_comm_t *comm;
     domdec_load_t     *load;
-    domdec_root_t     *root = NULL;
+    domdec_root_t     *root = nullptr;
     int                d, dim, i, pos;
     float              cell_frac = 0, sbuf[DD_NLOAD_MAX];
     gmx_bool           bSepPME;
@@ -4982,7 +4919,7 @@ static void get_load_distribution(gmx_domdec_t *dd, gmx_wallcycle_t wcycle)
             (dd->ci[dd->dim[d+1]] == 0 && dd->ci[dd->dim[dd->ndim-1]] == 0))
         {
             load = &comm->load[d];
-            if (dlbIsOn(dd->comm))
+            if (isDlbOn(dd->comm))
             {
                 cell_frac = comm->cell_f1[d] - comm->cell_f0[d];
             }
@@ -4991,7 +4928,7 @@ static void get_load_distribution(gmx_domdec_t *dd, gmx_wallcycle_t wcycle)
             {
                 sbuf[pos++] = dd_force_load(comm);
                 sbuf[pos++] = sbuf[0];
-                if (dlbIsOn(dd->comm))
+                if (isDlbOn(dd->comm))
                 {
                     sbuf[pos++] = sbuf[0];
                     sbuf[pos++] = cell_frac;
@@ -5011,7 +4948,7 @@ static void get_load_distribution(gmx_domdec_t *dd, gmx_wallcycle_t wcycle)
             {
                 sbuf[pos++] = comm->load[d+1].sum;
                 sbuf[pos++] = comm->load[d+1].max;
-                if (dlbIsOn(dd->comm))
+                if (isDlbOn(dd->comm))
                 {
                     sbuf[pos++] = comm->load[d+1].sum_m;
                     sbuf[pos++] = comm->load[d+1].cvol_min*cell_frac;
@@ -5040,7 +4977,7 @@ static void get_load_distribution(gmx_domdec_t *dd, gmx_wallcycle_t wcycle)
             if (dd->ci[dim] == dd->master_ci[dim])
             {
                 /* We are the root, process this row */
-                if (dlbIsOn(comm))
+                if (isDlbOn(comm))
                 {
                     root = comm->root[d];
                 }
@@ -5057,7 +4994,7 @@ static void get_load_distribution(gmx_domdec_t *dd, gmx_wallcycle_t wcycle)
                     load->sum += load->load[pos++];
                     load->max  = std::max(load->max, load->load[pos]);
                     pos++;
-                    if (dlbIsOn(dd->comm))
+                    if (isDlbOn(dd->comm))
                     {
                         if (root->bLimited)
                         {
@@ -5091,7 +5028,7 @@ static void get_load_distribution(gmx_domdec_t *dd, gmx_wallcycle_t wcycle)
                         pos++;
                     }
                 }
-                if (dlbIsOn(comm) && root->bLimited)
+                if (isDlbOn(comm) && root->bLimited)
                 {
                     load->sum_m *= dd->nc[dim];
                     load->flags |= (1<<d);
@@ -5106,7 +5043,7 @@ static void get_load_distribution(gmx_domdec_t *dd, gmx_wallcycle_t wcycle)
         comm->load_step  += comm->cycl[ddCyclStep];
         comm->load_sum   += comm->load[0].sum;
         comm->load_max   += comm->load[0].max;
-        if (dlbIsOn(comm))
+        if (isDlbOn(comm))
         {
             for (d = 0; d < dd->ndim; d++)
             {
@@ -5131,6 +5068,21 @@ static void get_load_distribution(gmx_domdec_t *dd, gmx_wallcycle_t wcycle)
     }
 }
 
+static float dd_force_load_fraction(gmx_domdec_t *dd)
+{
+    /* Return the relative performance loss on the total run time
+     * due to the force calculation load imbalance.
+     */
+    if (dd->comm->nload > 0 && dd->comm->load_step > 0)
+    {
+        return dd->comm->load_sum/(dd->comm->load_step*dd->nnodes);
+    }
+    else
+    {
+        return 0;
+    }
+}
+
 static float dd_force_imb_perf_loss(gmx_domdec_t *dd)
 {
     /* Return the relative performance loss on the total run time
@@ -5150,99 +5102,139 @@ static float dd_force_imb_perf_loss(gmx_domdec_t *dd)
 
 static void print_dd_load_av(FILE *fplog, gmx_domdec_t *dd)
 {
-    char               buf[STRLEN];
-    int                npp, npme, nnodes, d, limp;
-    float              imbal, pme_f_ratio, lossf = 0, lossp = 0;
-    gmx_bool           bLim;
-    gmx_domdec_comm_t *comm;
+    gmx_domdec_comm_t *comm = dd->comm;
 
-    comm = dd->comm;
-    if (DDMASTER(dd) && comm->nload > 0)
-    {
-        npp    = dd->nnodes;
-        npme   = (dd->pme_nodeid >= 0) ? comm->npmenodes : 0;
-        nnodes = npp + npme;
-        if (dd->nnodes > 1 && comm->load_sum > 0)
-        {
-            imbal  = comm->load_max*npp/comm->load_sum - 1;
-            lossf  = dd_force_imb_perf_loss(dd);
-            sprintf(buf, " Average load imbalance: %.1f %%\n", imbal*100);
-            fprintf(fplog, "%s", buf);
-            fprintf(stderr, "\n");
-            fprintf(stderr, "%s", buf);
-            sprintf(buf, " Part of the total run time spent waiting due to load imbalance: %.1f %%\n", lossf*100);
-            fprintf(fplog, "%s", buf);
-            fprintf(stderr, "%s", buf);
-        }
-        bLim = FALSE;
-        if (dlbIsOn(comm))
-        {
-            sprintf(buf, " Steps where the load balancing was limited by -rdd, -rcon and/or -dds:");
-            for (d = 0; d < dd->ndim; d++)
-            {
-                limp = (200*comm->load_lim[d]+1)/(2*comm->nload);
-                sprintf(buf+strlen(buf), " %c %d %%", dim2char(dd->dim[d]), limp);
-                if (limp >= 50)
-                {
-                    bLim = TRUE;
-                }
-            }
-            sprintf(buf+strlen(buf), "\n");
-            fprintf(fplog, "%s", buf);
-            fprintf(stderr, "%s", buf);
+    /* Only the master rank prints loads and only if we measured loads */
+    if (!DDMASTER(dd) || comm->nload == 0)
+    {
+        return;
+    }
+
+    char  buf[STRLEN];
+    int   numPpRanks   = dd->nnodes;
+    int   numPmeRanks  = (dd->pme_nodeid >= 0) ? comm->npmenodes : 0;
+    int   numRanks     = numPpRanks + numPmeRanks;
+    float lossFraction = 0;
+
+    /* Print the average load imbalance and performance loss */
+    if (dd->nnodes > 1 && comm->load_sum > 0)
+    {
+        float imbalance = comm->load_max*numPpRanks/comm->load_sum - 1;
+        lossFraction    = dd_force_imb_perf_loss(dd);
+
+        std::string msg         = "\n Dynamic load balancing report:\n";
+        std::string dlbStateStr = "";
+
+        switch (dd->comm->dlbState)
+        {
+            case edlbsOffUser:
+                dlbStateStr = "DLB was off during the run per user request.";
+                break;
+            case edlbsOffForever:
+                /* Currectly this can happen due to performance loss observed, cell size
+                 * limitations or incompatibility with other settings observed during
+                 * determineInitialDlbState(). */
+                dlbStateStr = "DLB got disabled because it was unsuitable to use.";
+                break;
+            case edlbsOffCanTurnOn:
+                dlbStateStr = "DLB was off during the run due to low measured imbalance.";
+                break;
+            case edlbsOffTemporarilyLocked:
+                dlbStateStr = "DLB was locked at the end of the run due to unfinished PP-PME balancing.";
+                break;
+            case edlbsOnCanTurnOff:
+                dlbStateStr = "DLB was turned on during the run due to measured imbalance.";
+                break;
+            case edlbsOnUser:
+                dlbStateStr = "DLB was permanently on during the run per user request.";
+                break;
+            default:
+                GMX_ASSERT(false, "Undocumented DLB state");
         }
-        if (npme > 0 && comm->load_mdf > 0 && comm->load_step > 0)
+
+        msg += " " + dlbStateStr + "\n";
+        msg += gmx::formatString(" Average load imbalance: %.1f%%.\n", imbalance*100);
+        msg += gmx::formatString(" The balanceable part of the MD step is %d%%, load imbalance is computed from this.\n",
+                                 static_cast<int>(dd_force_load_fraction(dd)*100 + 0.5));
+        msg += gmx::formatString(" Part of the total run time spent waiting due to load imbalance: %.1f%%.\n",
+                                 lossFraction*100);
+        fprintf(fplog, "%s", msg.c_str());
+        fprintf(stderr, "%s", msg.c_str());
+    }
+
+    /* Print during what percentage of steps the  load balancing was limited */
+    bool dlbWasLimited = false;
+    if (isDlbOn(comm))
+    {
+        sprintf(buf, " Steps where the load balancing was limited by -rdd, -rcon and/or -dds:");
+        for (int d = 0; d < dd->ndim; d++)
         {
-            pme_f_ratio = comm->load_pme/comm->load_mdf;
-            lossp       = (comm->load_pme - comm->load_mdf)/comm->load_step;
-            if (lossp <= 0)
+            int limitPercentage = (200*comm->load_lim[d] + 1)/(2*comm->nload);
+            sprintf(buf+strlen(buf), " %c %d %%",
+                    dim2char(dd->dim[d]), limitPercentage);
+            if (limitPercentage >= 50)
             {
-                lossp *= (float)npme/(float)nnodes;
+                dlbWasLimited = true;
             }
-            else
-            {
-                lossp *= (float)npp/(float)nnodes;
-            }
-            sprintf(buf, " Average PME mesh/force load: %5.3f\n", pme_f_ratio);
-            fprintf(fplog, "%s", buf);
-            fprintf(stderr, "%s", buf);
-            sprintf(buf, " Part of the total run time spent waiting due to PP/PME imbalance: %.1f %%\n", fabs(lossp)*100);
-            fprintf(fplog, "%s", buf);
-            fprintf(stderr, "%s", buf);
         }
-        fprintf(fplog, "\n");
-        fprintf(stderr, "\n");
+        sprintf(buf + strlen(buf), "\n");
+        fprintf(fplog, "%s", buf);
+        fprintf(stderr, "%s", buf);
+    }
 
-        if (lossf >= DD_PERF_LOSS_WARN)
+    /* Print the performance loss due to separate PME - PP rank imbalance */
+    float lossFractionPme = 0;
+    if (numPmeRanks > 0 && comm->load_mdf > 0 && comm->load_step > 0)
+    {
+        float pmeForceRatio = comm->load_pme/comm->load_mdf;
+        lossFractionPme     = (comm->load_pme - comm->load_mdf)/comm->load_step;
+        if (lossFractionPme <= 0)
         {
-            sprintf(buf,
-                    "NOTE: %.1f %% of the available CPU time was lost due to load imbalance\n"
-                    "      in the domain decomposition.\n", lossf*100);
-            if (!dlbIsOn(comm))
-            {
-                sprintf(buf+strlen(buf), "      You might want to use dynamic load balancing (option -dlb.)\n");
-            }
-            else if (bLim)
-            {
-                sprintf(buf+strlen(buf), "      You might want to decrease the cell size limit (options -rdd, -rcon and/or -dds).\n");
-            }
-            fprintf(fplog, "%s\n", buf);
-            fprintf(stderr, "%s\n", buf);
+            lossFractionPme *= numPmeRanks/static_cast<float>(numRanks);
+        }
+        else
+        {
+            lossFractionPme *= numPpRanks/static_cast<float>(numRanks);
+        }
+        sprintf(buf, " Average PME mesh/force load: %5.3f\n", pmeForceRatio);
+        fprintf(fplog, "%s", buf);
+        fprintf(stderr, "%s", buf);
+        sprintf(buf, " Part of the total run time spent waiting due to PP/PME imbalance: %.1f %%\n", fabs(lossFractionPme)*100);
+        fprintf(fplog, "%s", buf);
+        fprintf(stderr, "%s", buf);
+    }
+    fprintf(fplog, "\n");
+    fprintf(stderr, "\n");
+
+    if (lossFraction >= DD_PERF_LOSS_WARN)
+    {
+        sprintf(buf,
+                "NOTE: %.1f %% of the available CPU time was lost due to load imbalance\n"
+                "      in the domain decomposition.\n", lossFraction*100);
+        if (!isDlbOn(comm))
+        {
+            sprintf(buf+strlen(buf), "      You might want to use dynamic load balancing (option -dlb.)\n");
         }
-        if (npme > 0 && fabs(lossp) >= DD_PERF_LOSS_WARN)
+        else if (dlbWasLimited)
         {
-            sprintf(buf,
-                    "NOTE: %.1f %% performance was lost because the PME ranks\n"
-                    "      had %s work to do than the PP ranks.\n"
-                    "      You might want to %s the number of PME ranks\n"
-                    "      or %s the cut-off and the grid spacing.\n",
-                    fabs(lossp*100),
-                    (lossp < 0) ? "less"     : "more",
-                    (lossp < 0) ? "decrease" : "increase",
-                    (lossp < 0) ? "decrease" : "increase");
-            fprintf(fplog, "%s\n", buf);
-            fprintf(stderr, "%s\n", buf);
+            sprintf(buf+strlen(buf), "      You might want to decrease the cell size limit (options -rdd, -rcon and/or -dds).\n");
         }
+        fprintf(fplog, "%s\n", buf);
+        fprintf(stderr, "%s\n", buf);
+    }
+    if (numPmeRanks > 0 && fabs(lossFractionPme) >= DD_PERF_LOSS_WARN)
+    {
+        sprintf(buf,
+                "NOTE: %.1f %% performance was lost because the PME ranks\n"
+                "      had %s work to do than the PP ranks.\n"
+                "      You might want to %s the number of PME ranks\n"
+                "      or %s the cut-off and the grid spacing.\n",
+                fabs(lossFractionPme*100),
+                (lossFractionPme < 0) ? "less"     : "more",
+                (lossFractionPme < 0) ? "decrease" : "increase",
+                (lossFractionPme < 0) ? "decrease" : "increase");
+        fprintf(fplog, "%s\n", buf);
+        fprintf(stderr, "%s\n", buf);
     }
 }
 
@@ -5304,7 +5296,7 @@ static void dd_print_load(FILE *fplog, gmx_domdec_t *dd, gmx_int64_t step)
         fprintf(fplog, "\n");
     }
     fprintf(fplog, "DD  step %s", gmx_step_str(step, buf));
-    if (dlbIsOn(dd->comm))
+    if (isDlbOn(dd->comm))
     {
         fprintf(fplog, "  vol min/aver %5.3f%c",
                 dd_vol_min(dd), flags ? '!' : ' ');
@@ -5322,7 +5314,7 @@ static void dd_print_load(FILE *fplog, gmx_domdec_t *dd, gmx_int64_t step)
 
 static void dd_print_load_verbose(gmx_domdec_t *dd)
 {
-    if (dlbIsOn(dd->comm))
+    if (isDlbOn(dd->comm))
     {
         fprintf(stderr, "vol %4.2f%c ",
                 dd_vol_min(dd), dd_load_flags(dd) ? '!' : ' ');
@@ -5363,7 +5355,7 @@ static void make_load_communicator(gmx_domdec_t *dd, int dim_ind, ivec loc)
     if (bPartOfGroup)
     {
         dd->comm->mpi_comm_load[dim_ind] = c_row;
-        if (dd->comm->dlbState != edlbsOffForever)
+        if (!isDlbDisabled(dd->comm))
         {
             if (dd->ci[dim] == dd->master_ci[dim])
             {
@@ -5396,28 +5388,24 @@ static void make_load_communicator(gmx_domdec_t *dd, int dim_ind, ivec loc)
 }
 #endif
 
-void dd_setup_dlb_resource_sharing(t_commrec           gmx_unused *cr,
-                                   const gmx_hw_info_t gmx_unused *hwinfo,
-                                   const gmx_hw_opt_t  gmx_unused *hw_opt)
+void dd_setup_dlb_resource_sharing(t_commrec            *cr,
+                                   int                   gpu_id)
 {
 #if GMX_MPI
     int           physicalnode_id_hash;
-    int           gpu_id;
     gmx_domdec_t *dd;
     MPI_Comm      mpi_comm_pp_physicalnode;
 
-    if (!(cr->duty & DUTY_PP) || hw_opt->gpu_opt.n_dev_use == 0)
+    if (!(cr->duty & DUTY_PP) || gpu_id < 0)
     {
-        /* Only PP nodes (currently) use GPUs.
-         * If we don't have GPUs, there are no resources to share.
+        /* Only ranks with short-ranged tasks (currently) use GPUs.
+         * If we don't have GPUs assigned, there are no resources to share.
          */
         return;
     }
 
     physicalnode_id_hash = gmx_physicalnode_id_hash();
 
-    gpu_id = get_gpu_device_id(&hwinfo->gpu_info, &hw_opt->gpu_opt, cr->rank_pp_intranode);
-
     dd = cr->dd;
 
     if (debug)
@@ -5448,6 +5436,9 @@ void dd_setup_dlb_resource_sharing(t_commrec           gmx_unused *cr,
     {
         MPI_Comm_free(&dd->comm->mpi_comm_gpu_shared);
     }
+#else
+    GMX_UNUSED_VALUE(cr);
+    GMX_UNUSED_VALUE(gpu_id);
 #endif
 }
 
@@ -5601,7 +5592,7 @@ static void setup_neighbor_relations(gmx_domdec_t *dd)
         }
     }
 
-    if (dd->comm->dlbState != edlbsOffForever)
+    if (!isDlbDisabled(dd->comm))
     {
         snew(dd->comm->root, dd->ndim);
     }
@@ -5783,7 +5774,7 @@ static gmx_domdec_master_t *init_gmx_domdec_master_t(gmx_domdec_t *dd,
 
     if (dd->nnodes <= GMX_DD_NNODES_SENDRECV)
     {
-        ma->vbuf = NULL;
+        ma->vbuf = nullptr;
     }
     else
     {
@@ -5794,7 +5785,7 @@ static gmx_domdec_master_t *init_gmx_domdec_master_t(gmx_domdec_t *dd,
 }
 
 static void split_communicator(FILE *fplog, t_commrec *cr, gmx_domdec_t *dd,
-                               int gmx_unused dd_rank_order,
+                               DdRankOrder gmx_unused rankOrder,
                                int gmx_unused reorder)
 {
     gmx_domdec_comm_t *comm;
@@ -5898,15 +5889,15 @@ static void split_communicator(FILE *fplog, t_commrec *cr, gmx_domdec_t *dd,
     }
     else
     {
-        switch (dd_rank_order)
+        switch (rankOrder)
         {
-            case ddrankorderPP_PME:
+            case DdRankOrder::pp_pme:
                 if (fplog)
                 {
                     fprintf(fplog, "Order of the ranks: PP first, PME last\n");
                 }
                 break;
-            case ddrankorderINTERLEAVE:
+            case DdRankOrder::interleave:
                 /* Interleave the PP-only and PME-only ranks */
                 if (fplog)
                 {
@@ -5914,10 +5905,10 @@ static void split_communicator(FILE *fplog, t_commrec *cr, gmx_domdec_t *dd,
                 }
                 comm->pmenodes = dd_interleaved_pme_ranks(dd);
                 break;
-            case ddrankorderCARTESIAN:
+            case DdRankOrder::cartesian:
                 break;
             default:
-                gmx_fatal(FARGS, "Unknown dd_rank_order=%d", dd_rank_order);
+                gmx_fatal(FARGS, "Invalid ddRankOrder=%d", static_cast<int>(rankOrder));
         }
 
         if (dd_simnode2pmenode(dd, cr, cr->sim_nodeid) == -1)
@@ -5947,7 +5938,7 @@ static void split_communicator(FILE *fplog, t_commrec *cr, gmx_domdec_t *dd,
 
 /*! \brief Generates the MPI communicators for domain decomposition */
 static void make_dd_communicators(FILE *fplog, t_commrec *cr,
-                                  gmx_domdec_t *dd, int dd_rank_order)
+                                  gmx_domdec_t *dd, DdRankOrder ddRankOrder)
 {
     gmx_domdec_comm_t *comm;
     int                CartReorder;
@@ -5956,19 +5947,19 @@ static void make_dd_communicators(FILE *fplog, t_commrec *cr,
 
     copy_ivec(dd->nc, comm->ntot);
 
-    comm->bCartesianPP     = (dd_rank_order == ddrankorderCARTESIAN);
+    comm->bCartesianPP     = (ddRankOrder == DdRankOrder::cartesian);
     comm->bCartesianPP_PME = FALSE;
 
     /* Reorder the nodes by default. This might change the MPI ranks.
      * Real reordering is only supported on very few architectures,
      * Blue Gene is one of them.
      */
-    CartReorder = (getenv("GMX_NO_CART_REORDER") == NULL);
+    CartReorder = (getenv("GMX_NO_CART_REORDER") == nullptr);
 
     if (cr->npmenodes > 0)
     {
         /* Split the communicator into a PP and PME part */
-        split_communicator(fplog, cr, dd, dd_rank_order, CartReorder);
+        split_communicator(fplog, cr, dd, ddRankOrder, CartReorder);
         if (comm->bCartesianPP_PME)
         {
             /* We (possibly) reordered the nodes in split_communicator,
@@ -6026,8 +6017,8 @@ static real *get_slb_frac(FILE *fplog, const char *dir, int nc, const char *size
     int    i, n;
     double dbl;
 
-    slb_frac = NULL;
-    if (nc > 1 && size_string != NULL)
+    slb_frac = nullptr;
+    if (nc > 1 && size_string != nullptr)
     {
         if (fplog)
         {
@@ -6169,56 +6160,96 @@ static real average_cellsize_min(gmx_domdec_t *dd, gmx_ddbox_t *ddbox)
     return r;
 }
 
-static int check_dlb_support(FILE *fplog, t_commrec *cr,
-                             const char *dlb_opt, gmx_bool bRecordLoad,
-                             unsigned long Flags, const t_inputrec *ir)
+/*! \brief Depending on the DLB initial value return the DLB switched off state or issue an error.
+ */
+static int forceDlbOffOrBail(int                cmdlineDlbState,
+                             const std::string &reasonStr,
+                             t_commrec         *cr,
+                             FILE              *fplog)
 {
-    int           dlbState = -1;
-    char          buf[STRLEN];
+    std::string dlbNotSupportedErr  = "Dynamic load balancing requested, but ";
+    std::string dlbDisableNote      = "NOTE: disabling dynamic load balancing as ";
+
+    if (cmdlineDlbState == edlbsOnUser)
+    {
+        gmx_fatal(FARGS, (dlbNotSupportedErr + reasonStr).c_str());
+    }
+    else if (cmdlineDlbState == edlbsOffCanTurnOn)
+    {
+        dd_warning(cr, fplog, (dlbDisableNote + reasonStr + "\n").c_str());
+    }
+    return edlbsOffForever;
+}
+
+/*! \brief Return the dynamic load balancer's initial state based on initial conditions and user inputs.
+ *
+ * This function parses the parameters of "-dlb" command line option setting
+ * corresponding state values. Then it checks the consistency of the determined
+ * state with other run parameters and settings. As a result, the initial state
+ * may be altered or an error may be thrown if incompatibility of options is detected.
+ *
+ * \param [in] fplog       Pointer to mdrun log file.
+ * \param [in] cr          Pointer to MPI communication object.
+ * \param [in] dlbOption   Enum value for the DLB option.
+ * \param [in] bRecordLoad True if the load balancer is recording load information.
+ * \param [in] mdrunOptions  Options for mdrun.
+ * \param [in] ir          Pointer mdrun to input parameters.
+ * \returns                DLB initial/startup state.
+ */
+static int determineInitialDlbState(FILE *fplog, t_commrec *cr,
+                                    DlbOption dlbOption, gmx_bool bRecordLoad,
+                                    const MdrunOptions &mdrunOptions,
+                                    const t_inputrec *ir)
+{
+    int dlbState = edlbsOffCanTurnOn;
 
-    switch (dlb_opt[0])
+    switch (dlbOption)
     {
-        case 'a': dlbState = edlbsOffCanTurnOn; break;
-        case 'n': dlbState = edlbsOffForever;   break;
-        case 'y': dlbState = edlbsOnForever;    break;
-        default: gmx_incons("Unknown dlb_opt");
+        case DlbOption::turnOnWhenUseful: dlbState = edlbsOffCanTurnOn; break;
+        case DlbOption::no:               dlbState = edlbsOffUser;      break;
+        case DlbOption::yes:              dlbState = edlbsOnUser;       break;
+        default: gmx_incons("Invalid dlbOption enum value");
     }
 
-    if (Flags & MD_RERUN)
+    /* Reruns don't support DLB: bail or override auto mode */
+    if (mdrunOptions.rerun)
     {
-        return edlbsOffForever;
+        std::string reasonStr = "it is not supported in reruns.";
+        return forceDlbOffOrBail(dlbState, reasonStr, cr, fplog);
     }
 
+    /* Unsupported integrators */
     if (!EI_DYNAMICS(ir->eI))
     {
-        if (dlbState == edlbsOnForever)
-        {
-            sprintf(buf, "NOTE: dynamic load balancing is only supported with dynamics, not with integrator '%s'\n", EI(ir->eI));
-            dd_warning(cr, fplog, buf);
-        }
-
-        return edlbsOffForever;
+        auto reasonStr = gmx::formatString("it is only supported with dynamics, not with integrator '%s'.", EI(ir->eI));
+        return forceDlbOffOrBail(dlbState, reasonStr, cr, fplog);
     }
 
+    /* Without cycle counters we can't time work to balance on */
     if (!bRecordLoad)
     {
-        dd_warning(cr, fplog, "NOTE: Cycle counters unsupported or not enabled in kernel. Cannot use dynamic load balancing.\n");
-        return edlbsOffForever;
+        std::string reasonStr = "cycle counters unsupported or not enabled in the operating system kernel.";
+        return forceDlbOffOrBail(dlbState, reasonStr, cr, fplog);
     }
 
-    if (Flags & MD_REPRODUCIBLE)
+    if (mdrunOptions.reproducible)
     {
+        std::string reasonStr = "you started a reproducible run.";
         switch (dlbState)
         {
+            case edlbsOffUser:
+                break;
             case edlbsOffForever:
+                GMX_RELEASE_ASSERT(false, "edlbsOffForever is not a valid initial state");
                 break;
             case edlbsOffCanTurnOn:
+                return forceDlbOffOrBail(dlbState, reasonStr, cr, fplog);
+                break;
             case edlbsOnCanTurnOff:
-                dd_warning(cr, fplog, "NOTE: reproducibility requested, will not use dynamic load balancing\n");
-                dlbState = edlbsOffForever;
+                GMX_RELEASE_ASSERT(false, "edlbsOffCanTurnOff is not a valid initial state");
                 break;
-            case edlbsOnForever:
-                dd_warning(cr, fplog, "WARNING: reproducibility requested with dynamic load balancing, the simulation will NOT be binary reproducible\n");
+            case edlbsOnUser:
+                return forceDlbOffOrBail(dlbState, reasonStr + " In load balanced runs binary reproducibility cannot be ensured.", cr, fplog);
                 break;
             default:
                 gmx_fatal(FARGS, "Death horror: undefined case (%d) for load balancing choice", dlbState);
@@ -6234,7 +6265,7 @@ static void set_dd_dim(FILE *fplog, gmx_domdec_t *dd)
     int dim;
 
     dd->ndim = 0;
-    if (getenv("GMX_DD_ORDER_ZYX") != NULL)
+    if (getenv("GMX_DD_ORDER_ZYX") != nullptr)
     {
         /* Decomposition order z,y,x */
         if (fplog)
@@ -6277,7 +6308,7 @@ static gmx_domdec_comm_t *init_dd_comm()
     }
 
     comm->nalloc_int = 0;
-    comm->buf_int    = NULL;
+    comm->buf_int    = nullptr;
 
     vec_rvec_init(&comm->vbuf);
 
@@ -6297,16 +6328,16 @@ static gmx_domdec_comm_t *init_dd_comm()
     comm->load_mdf  = 0;
     comm->load_pme  = 0;
 
+    /* This should be replaced by a unique pointer */
+    comm->balanceRegion = ddBalanceRegionAllocate();
+
     return comm;
 }
 
 /*! \brief Set the cell size and interaction limits, as well as the DD grid */
 static void set_dd_limits_and_grid(FILE *fplog, t_commrec *cr, gmx_domdec_t *dd,
-                                   unsigned long Flags,
-                                   ivec nc, int nPmeRanks,
-                                   real comm_distance_min, real rconstr,
-                                   const char *dlb_opt, real dlb_scale,
-                                   const char *sizex, const char *sizey, const char *sizez,
+                                   const DomdecOptions &options,
+                                   const MdrunOptions &mdrunOptions,
                                    const gmx_mtop_t *mtop,
                                    const t_inputrec *ir,
                                    matrix box, const rvec *x,
@@ -6325,12 +6356,12 @@ static void set_dd_limits_and_grid(FILE *fplog, t_commrec *cr, gmx_domdec_t *dd,
     dd->bScrewPBC = (ir->ePBC == epbcSCREW);
 
     dd->pme_recv_f_alloc = 0;
-    dd->pme_recv_f_buf   = NULL;
+    dd->pme_recv_f_buf   = nullptr;
 
     /* Initialize to GPU share count to 0, might change later */
     comm->nrank_gpu_shared = 0;
 
-    comm->dlbState         = check_dlb_support(fplog, cr, dlb_opt, comm->bRecordLoad, Flags, ir);
+    comm->dlbState         = determineInitialDlbState(fplog, cr, options.dlbOption, comm->bRecordLoad, mdrunOptions, ir);
     dd_dlb_set_should_check_whether_to_turn_dlb_on(dd, TRUE);
     /* To consider turning DLB on after 2*nstlist steps we need to check
      * at partitioning count 3. Thus we need to increase the first count by 2.
@@ -6389,10 +6420,10 @@ static void set_dd_limits_and_grid(FILE *fplog, t_commrec *cr, gmx_domdec_t *dd,
 
     if (comm->bInterCGBondeds)
     {
-        if (comm_distance_min > 0)
+        if (options.minimumCommunicationRange > 0)
         {
-            comm->cutoff_mbody = comm_distance_min;
-            if (Flags & MD_DDBONDCOMM)
+            comm->cutoff_mbody = options.minimumCommunicationRange;
+            if (options.useBondedCommunication)
             {
                 comm->bBondComm = (comm->cutoff_mbody > comm->cutoff);
             }
@@ -6416,7 +6447,8 @@ static void set_dd_limits_and_grid(FILE *fplog, t_commrec *cr, gmx_domdec_t *dd,
             if (MASTER(cr))
             {
                 dd_bonded_cg_distance(fplog, mtop, ir, x, box,
-                                      Flags & MD_DDBONDCHECK, &r_2b, &r_mb);
+                                      options.checkBondedInteractions,
+                                      &r_2b, &r_mb);
             }
             gmx_bcast(sizeof(r_2b), &r_2b, cr);
             gmx_bcast(sizeof(r_mb), &r_mb, cr);
@@ -6424,7 +6456,7 @@ static void set_dd_limits_and_grid(FILE *fplog, t_commrec *cr, gmx_domdec_t *dd,
             /* We use an initial margin of 10% for the minimum cell size,
              * except when we are just below the non-bonded cut-off.
              */
-            if (Flags & MD_DDBONDCOMM)
+            if (options.useBondedCommunication)
             {
                 if (std::max(r_2b, r_mb) > comm->cutoff)
                 {
@@ -6458,7 +6490,8 @@ static void set_dd_limits_and_grid(FILE *fplog, t_commrec *cr, gmx_domdec_t *dd,
         comm->cellsize_limit = std::max(comm->cellsize_limit, r_bonded_limit);
     }
 
-    if (dd->bInterCGcons && rconstr <= 0)
+    real rconstr = 0;
+    if (dd->bInterCGcons && options.constraintCommunicationRange <= 0)
     {
         /* There is a cell size limit due to the constraints (P-LINCS) */
         rconstr = constr_r_max(fplog, mtop, ir);
@@ -6473,7 +6506,7 @@ static void set_dd_limits_and_grid(FILE *fplog, t_commrec *cr, gmx_domdec_t *dd,
             }
         }
     }
-    else if (rconstr > 0 && fplog)
+    else if (options.constraintCommunicationRange > 0 && fplog)
     {
         /* Here we do not check for dd->bInterCGcons,
          * because one can also set a cell size limit for virtual sites only
@@ -6481,21 +6514,22 @@ static void set_dd_limits_and_grid(FILE *fplog, t_commrec *cr, gmx_domdec_t *dd,
          */
         fprintf(fplog,
                 "User supplied maximum distance required for P-LINCS: %.3f nm\n",
-                rconstr);
+                options.constraintCommunicationRange);
+        rconstr = options.constraintCommunicationRange;
     }
     comm->cellsize_limit = std::max(comm->cellsize_limit, rconstr);
 
     comm->cgs_gl = gmx_mtop_global_cgs(mtop);
 
-    if (nc[XX] > 0)
+    if (options.numCells[XX] > 0)
     {
-        copy_ivec(nc, dd->nc);
+        copy_ivec(options.numCells, dd->nc);
         set_dd_dim(fplog, dd);
         set_ddbox_cr(cr, &dd->nc, ir, box, &comm->cgs_gl, x, ddbox);
 
-        if (nPmeRanks >= 0)
+        if (options.numPmeRanks >= 0)
         {
-            cr->npmenodes = nPmeRanks;
+            cr->npmenodes = options.numPmeRanks;
         }
         else
         {
@@ -6520,13 +6554,14 @@ static void set_dd_limits_and_grid(FILE *fplog, t_commrec *cr, gmx_domdec_t *dd,
     }
     else
     {
-        set_ddbox_cr(cr, NULL, ir, box, &comm->cgs_gl, x, ddbox);
+        set_ddbox_cr(cr, nullptr, ir, box, &comm->cgs_gl, x, ddbox);
 
         /* We need to choose the optimal DD grid and possibly PME nodes */
         real limit =
             dd_choose_grid(fplog, cr, dd, ir, mtop, box, ddbox,
-                           nPmeRanks,
-                           comm->dlbState != edlbsOffForever, dlb_scale,
+                           options.numPmeRanks,
+                           !isDlbDisabled(comm),
+                           options.dlbScaling,
                            comm->cellsize_limit, comm->cutoff,
                            comm->bInterCGBondeds);
 
@@ -6536,7 +6571,7 @@ static void set_dd_limits_and_grid(FILE *fplog, t_commrec *cr, gmx_domdec_t *dd,
             gmx_bool bC = (dd->bInterCGcons && rconstr > r_bonded_limit);
             sprintf(buf, "Change the number of ranks or mdrun option %s%s%s",
                     !bC ? "-rdd" : "-rcon",
-                    comm->dlbState != edlbsOffForever ? " or -dds" : "",
+                    comm->dlbState != edlbsOffUser ? " or -dds" : "",
                     bC ? " or your LINCS settings" : "");
 
             gmx_fatal_collective(FARGS, cr->mpi_comm_mysim, MASTER(cr),
@@ -6588,7 +6623,7 @@ static void set_dd_limits_and_grid(FILE *fplog, t_commrec *cr, gmx_domdec_t *dd,
          */
         if (dd->ndim >= 2 && dd->dim[0] == XX && dd->dim[1] == YY &&
             comm->npmenodes > dd->nc[XX] && comm->npmenodes % dd->nc[XX] == 0 &&
-            getenv("GMX_PMEONEDD") == NULL)
+            getenv("GMX_PMEONEDD") == nullptr)
         {
             comm->npmedecompdim = 2;
             comm->npmenodes_x   = dd->nc[XX];
@@ -6631,16 +6666,16 @@ static void set_dd_limits_and_grid(FILE *fplog, t_commrec *cr, gmx_domdec_t *dd,
     *npme_y = comm->npmenodes_y;
 
     snew(comm->slb_frac, DIM);
-    if (comm->dlbState == edlbsOffForever)
+    if (isDlbDisabled(comm))
     {
-        comm->slb_frac[XX] = get_slb_frac(fplog, "x", dd->nc[XX], sizex);
-        comm->slb_frac[YY] = get_slb_frac(fplog, "y", dd->nc[YY], sizey);
-        comm->slb_frac[ZZ] = get_slb_frac(fplog, "z", dd->nc[ZZ], sizez);
+        comm->slb_frac[XX] = get_slb_frac(fplog, "x", dd->nc[XX], options.cellSizeX);
+        comm->slb_frac[YY] = get_slb_frac(fplog, "y", dd->nc[YY], options.cellSizeY);
+        comm->slb_frac[ZZ] = get_slb_frac(fplog, "z", dd->nc[ZZ], options.cellSizeZ);
     }
 
     if (comm->bInterCGBondeds && comm->cutoff_mbody == 0)
     {
-        if (comm->bBondComm || comm->dlbState != edlbsOffForever)
+        if (comm->bBondComm || !isDlbDisabled(comm))
         {
             /* Set the bonded communication distance to halfway
              * the minimum and the maximum,
@@ -6648,10 +6683,11 @@ static void set_dd_limits_and_grid(FILE *fplog, t_commrec *cr, gmx_domdec_t *dd,
              */
             real acs           = average_cellsize_min(dd, ddbox);
             comm->cutoff_mbody = 0.5*(r_bonded + acs);
-            if (comm->dlbState != edlbsOffForever)
+            if (!isDlbDisabled(comm))
             {
                 /* Check if this does not limit the scaling */
-                comm->cutoff_mbody = std::min(comm->cutoff_mbody, dlb_scale*acs);
+                comm->cutoff_mbody = std::min(comm->cutoff_mbody,
+                                              options.dlbScaling*acs);
             }
             if (!comm->bBondComm)
             {
@@ -6721,15 +6757,15 @@ static void turn_on_dlb(FILE *fplog, t_commrec *cr, gmx_int64_t step)
         cellsize_min = std::min(cellsize_min, comm->cellsize_min[dd->dim[d]]);
     }
 
+    /* Turn off DLB if we're too close to the cell size limit. */
     if (cellsize_min < comm->cellsize_limit*1.05)
     {
-        char buf[STRLEN];
-        sprintf(buf, "step %" GMX_PRId64 " Measured %.1f %% performance loss due to load imbalance, but the minimum cell size is smaller than 1.05 times the cell size limit. Will no longer try dynamic load balancing.\n", step, dd_force_imb_perf_loss(dd)*100);
-        dd_warning(cr, fplog, buf);
+        auto str = gmx::formatString("step %" GMX_PRId64 " Measured %.1f %% performance loss due to load imbalance, "
+                                     "but the minimum cell size is smaller than 1.05 times the cell size limit."
+                                     "Will no longer try dynamic load balancing.\n", step, dd_force_imb_perf_loss(dd)*100);
+        dd_warning(cr, fplog, str.c_str());
 
-        /* Change DLB from "auto" to "no". */
         comm->dlbState = edlbsOffForever;
-
         return;
     }
 
@@ -6832,8 +6868,8 @@ void dd_init_bondeds(FILE *fplog,
     else
     {
         /* Only communicate atoms based on cut-off */
-        comm->cglink   = NULL;
-        comm->bLocalCG = NULL;
+        comm->cglink   = nullptr;
+        comm->bLocalCG = nullptr;
     }
 }
 
@@ -6848,7 +6884,7 @@ static void print_dd_settings(FILE *fplog, gmx_domdec_t *dd,
     real               limit, shrink;
     char               buf[64];
 
-    if (fplog == NULL)
+    if (fplog == nullptr)
     {
         return;
     }
@@ -6940,7 +6976,7 @@ static void print_dd_settings(FILE *fplog, gmx_domdec_t *dd,
                     std::max(comm->cutoff, comm->cutoff_mbody));
             fprintf(fplog, "%40s  %-7s %6.3f nm\n",
                     "multi-body bonded interactions", "(-rdd)",
-                    (comm->bBondComm || dlbIsOn(dd->comm)) ? comm->cutoff_mbody : std::min(comm->cutoff, limit));
+                    (comm->bBondComm || isDlbOn(dd->comm)) ? comm->cutoff_mbody : std::min(comm->cutoff, limit));
         }
         if (bInterCGVsites)
         {
@@ -7059,7 +7095,7 @@ static void set_cell_limits_dlb(gmx_domdec_t      *dd,
     {
         comm->cutoff_mbody = std::min(comm->cutoff, comm->cellsize_limit);
     }
-    if (dlbIsOn(comm))
+    if (isDlbOn(comm))
     {
         set_dlb_limits(dd);
     }
@@ -7110,12 +7146,12 @@ static void set_ddgrid_parameters(FILE *fplog, gmx_domdec_t *dd, real dlb_scale,
     {
         fprintf(debug, "The DD cut-off is %f\n", comm->cutoff);
     }
-    if (comm->dlbState != edlbsOffForever)
+    if (!isDlbDisabled(comm))
     {
         set_cell_limits_dlb(dd, dlb_scale, ir, ddbox);
     }
 
-    print_dd_settings(fplog, dd, mtop, ir, dlbIsOn(comm), dlb_scale, ddbox);
+    print_dd_settings(fplog, dd, mtop, ir, isDlbOn(comm), dlb_scale, ddbox);
     if (comm->dlbState == edlbsOffCanTurnOn)
     {
         if (fplog)
@@ -7179,13 +7215,25 @@ static void set_dd_envvar_options(FILE *fplog, gmx_domdec_t *dd, int rank_mysim)
     }
 }
 
+DomdecOptions::DomdecOptions() :
+    checkBondedInteractions(TRUE),
+    useBondedCommunication(TRUE),
+    numPmeRanks(-1),
+    rankOrder(DdRankOrder::pp_pme),
+    minimumCommunicationRange(0),
+    constraintCommunicationRange(0),
+    dlbOption(DlbOption::turnOnWhenUseful),
+    dlbScaling(0.8),
+    cellSizeX(nullptr),
+    cellSizeY(nullptr),
+    cellSizeZ(nullptr)
+{
+    clear_ivec(numCells);
+}
+
 gmx_domdec_t *init_domain_decomposition(FILE *fplog, t_commrec *cr,
-                                        unsigned long Flags,
-                                        ivec nc, int nPmeRanks,
-                                        int dd_rank_order,
-                                        real comm_distance_min, real rconstr,
-                                        const char *dlb_opt, real dlb_scale,
-                                        const char *sizex, const char *sizey, const char *sizez,
+                                        const DomdecOptions &options,
+                                        const MdrunOptions &mdrunOptions,
                                         const gmx_mtop_t *mtop,
                                         const t_inputrec *ir,
                                         matrix box, rvec *x,
@@ -7206,21 +7254,17 @@ gmx_domdec_t *init_domain_decomposition(FILE *fplog, t_commrec *cr,
 
     set_dd_envvar_options(fplog, dd, cr->nodeid);
 
-    set_dd_limits_and_grid(fplog, cr, dd, Flags,
-                           nc, nPmeRanks,
-                           comm_distance_min, rconstr,
-                           dlb_opt, dlb_scale,
-                           sizex, sizey, sizez,
+    set_dd_limits_and_grid(fplog, cr, dd, options, mdrunOptions,
                            mtop, ir,
                            box, x,
                            ddbox,
                            npme_x, npme_y);
 
-    make_dd_communicators(fplog, cr, dd, dd_rank_order);
+    make_dd_communicators(fplog, cr, dd, options.rankOrder);
 
     if (cr->duty & DUTY_PP)
     {
-        set_ddgrid_parameters(fplog, dd, dlb_scale, mtop, ir, ddbox);
+        set_ddgrid_parameters(fplog, dd, options.dlbScaling, mtop, ir, ddbox);
 
         setup_neighbor_relations(dd);
     }
@@ -7253,7 +7297,7 @@ static gmx_bool test_dd_cutoff(t_commrec *cr,
     dd = cr->dd;
 
     set_ddbox(dd, FALSE, cr, ir, state->box,
-              TRUE, &dd->comm->cgs_gl, state->x, &ddbox);
+              TRUE, &dd->comm->cgs_gl, as_rvec_array(state->x.data()), &ddbox);
 
     LocallyLimited = 0;
 
@@ -7269,8 +7313,7 @@ static gmx_bool test_dd_cutoff(t_commrec *cr,
 
         np = 1 + (int)(cutoff_req*inv_cell_size*ddbox.skew_fac[dim]);
 
-        if (dd->comm->dlbState != edlbsOffForever && dim < ddbox.npbcdim &&
-            dd->comm->cd[d].np_dlb > 0)
+        if (!isDlbDisabled(dd->comm) && (dim < ddbox.npbcdim) && (dd->comm->cd[d].np_dlb > 0))
         {
             if (np > dd->comm->cd[d].np_dlb)
             {
@@ -7288,12 +7331,12 @@ static gmx_bool test_dd_cutoff(t_commrec *cr,
         }
     }
 
-    if (dd->comm->dlbState != edlbsOffForever)
+    if (!isDlbDisabled(dd->comm))
     {
         /* If DLB is not active yet, we don't need to check the grid jumps.
          * Actually we shouldn't, because then the grid jump data is not set.
          */
-        if (dlbIsOn(dd->comm) &&
+        if (isDlbOn(dd->comm) &&
             check_grid_jump(0, dd, cutoff_req, &ddbox, FALSE))
         {
             LocallyLimited = 1;
@@ -7408,7 +7451,7 @@ static gmx_bool dd_dlb_get_should_check_whether_to_turn_dlb_on(gmx_domdec_t *dd)
 
 gmx_bool dd_dlb_is_on(const gmx_domdec_t *dd)
 {
-    return dlbIsOn(dd->comm);
+    return isDlbOn(dd->comm);
 }
 
 gmx_bool dd_dlb_is_locked(const gmx_domdec_t *dd)
@@ -7596,7 +7639,7 @@ set_dd_corners(const gmx_domdec_t *dd,
         c->c[1][0] = comm->cell_x0[dim1];
         /* All rows can see this row */
         c->c[1][1] = comm->cell_x0[dim1];
-        if (dlbIsOn(dd->comm))
+        if (isDlbOn(dd->comm))
         {
             c->c[1][1] = std::max(comm->cell_x0[dim1], comm->zone_d1[1].mch0);
             if (bDistMB)
@@ -7615,7 +7658,7 @@ set_dd_corners(const gmx_domdec_t *dd,
             {
                 c->c[2][j] = comm->cell_x0[dim2];
             }
-            if (dlbIsOn(dd->comm))
+            if (isDlbOn(dd->comm))
             {
                 /* Use the maximum of the i-cells that see a j-cell */
                 for (i = 0; i < zones->nizone; i++)
@@ -7650,7 +7693,7 @@ set_dd_corners(const gmx_domdec_t *dd,
              */
             c->cr1[0] = comm->cell_x1[dim1];
             c->cr1[3] = comm->cell_x1[dim1];
-            if (dlbIsOn(dd->comm))
+            if (isDlbOn(dd->comm))
             {
                 c->cr1[0] = std::max(comm->cell_x1[dim1], comm->zone_d1[1].mch1);
                 if (bDistMB)
@@ -7932,7 +7975,8 @@ get_zone_pulse_cgs(gmx_domdec_t *dd,
 
 static void setup_dd_communication(gmx_domdec_t *dd,
                                    matrix box, gmx_ddbox_t *ddbox,
-                                   t_forcerec *fr, t_state *state, rvec **f)
+                                   t_forcerec *fr,
+                                   t_state *state, PaddedRVecVector *f)
 {
     int                    dim_ind, dim, dim0, dim1, dim2, dimd, p, nat_tot;
     int                    nzone, nzone_send, zone, zonei, cg0, cg1;
@@ -7947,7 +7991,7 @@ static void setup_dd_communication(gmx_domdec_t *dd,
     real                   r_comm2, r_bcomm2;
     dd_corners_t           corners;
     ivec                   tric_dist;
-    rvec                  *cg_cm, *normal, *v_d, *v_0 = NULL, *v_1 = NULL, *recv_vr;
+    rvec                  *cg_cm, *normal, *v_d, *v_0 = nullptr, *v_1 = nullptr, *recv_vr;
     real                   skew_fac2_d, skew_fac_01;
     rvec                   sf2_round;
     int                    nsend, nat;
@@ -7979,11 +8023,11 @@ static void setup_dd_communication(gmx_domdec_t *dd,
             cg_cm = fr->cg_cm;
             break;
         case ecutsVERLET:
-            cg_cm = state->x;
+            cg_cm = as_rvec_array(state->x.data());
             break;
         default:
             gmx_incons("unimplemented");
-            cg_cm = NULL;
+            cg_cm = nullptr;
     }
 
     for (dim_ind = 0; dim_ind < dd->ndim; dim_ind++)
@@ -8002,7 +8046,7 @@ static void setup_dd_communication(gmx_domdec_t *dd,
     bBondComm = comm->bBondComm;
 
     /* Do we need to determine extra distances for multi-body bondeds? */
-    bDistMB = (comm->bInterCGMultiBody && dlbIsOn(dd->comm) && dd->ndim > 1);
+    bDistMB = (comm->bInterCGMultiBody && isDlbOn(dd->comm) && dd->ndim > 1);
 
     /* Do we need to determine extra distances for only two-body bondeds? */
     bDist2B = (bBondComm && !bDistMB);
@@ -8317,7 +8361,7 @@ static void setup_dd_communication(gmx_domdec_t *dd,
             }
             else
             {
-                cg_cm = state->x;
+                cg_cm = as_rvec_array(state->x.data());
             }
             /* Communicate cg_cm */
             if (cd->bInPlace)
@@ -8395,7 +8439,7 @@ static void setup_dd_communication(gmx_domdec_t *dd,
          * So we pass NULL for the forcerec.
          */
         dd_set_cginfo(dd->index_gl, dd->ncg_home, dd->ncg_tot,
-                      NULL, comm->bLocalCG);
+                      nullptr, comm->bLocalCG);
     }
 
     if (debug)
@@ -8438,7 +8482,7 @@ static void set_zones_size(gmx_domdec_t *dd,
     zones = &comm->zones;
 
     /* Do we need to determine extra distances for multi-body bondeds? */
-    bDistMB = (comm->bInterCGMultiBody && dlbIsOn(dd->comm) && dd->ndim > 1);
+    bDistMB = (comm->bInterCGMultiBody && isDlbOn(dd->comm) && dd->ndim > 1);
 
     for (z = zone_start; z < zone_end; z++)
     {
@@ -8458,7 +8502,7 @@ static void set_zones_size(gmx_domdec_t *dd,
             /* With a staggered grid we have different sizes
              * for non-shifted dimensions.
              */
-            if (dlbIsOn(dd->comm) && zones->shift[z][dim] == 0)
+            if (isDlbOn(dd->comm) && zones->shift[z][dim] == 0)
             {
                 if (d == 1)
                 {
@@ -8487,7 +8531,7 @@ static void set_zones_size(gmx_domdec_t *dd,
             if (zones->shift[z][dim] > 0)
             {
                 dim = dd->dim[d];
-                if (!dlbIsOn(dd->comm) || d == 0)
+                if (!isDlbOn(dd->comm) || d == 0)
                 {
                     zones->size[z].x0[dim] = comm->cell_x1[dim];
                     zones->size[z].x1[dim] = comm->cell_x1[dim] + rcs;
@@ -8721,7 +8765,7 @@ static void order_vec_atom(int ncg, const int *cgindex, const gmx_cgsort_t *sort
 {
     int a, atot, cg, cg0, cg1, i;
 
-    if (cgindex == NULL)
+    if (cgindex == nullptr)
     {
         /* Avoid the useless loop of the atoms within a cg */
         order_vec_cg(ncg, sort, v, buf);
@@ -8940,7 +8984,7 @@ static void dd_sort_state(gmx_domdec_t *dd, rvec *cgcm, t_forcerec *fr, t_state
     }
     else
     {
-        cgindex = NULL;
+        cgindex = nullptr;
     }
 
     /* Remove the charge groups which are no longer at home here */
@@ -8952,37 +8996,19 @@ static void dd_sort_state(gmx_domdec_t *dd, rvec *cgcm, t_forcerec *fr, t_state
     }
 
     /* Reorder the state */
-    for (i = 0; i < estNR; i++)
+    if (state->flags & (1 << estX))
     {
-        if (EST_DISTR(i) && (state->flags & (1<<i)))
-        {
-            switch (i)
-            {
-                case estX:
-                    order_vec_atom(dd->ncg_home, cgindex, cgsort, state->x, vbuf);
-                    break;
-                case estV:
-                    order_vec_atom(dd->ncg_home, cgindex, cgsort, state->v, vbuf);
-                    break;
-                case est_SDX_NOTSUPPORTED:
-                    break;
-                case estCGP:
-                    order_vec_atom(dd->ncg_home, cgindex, cgsort, state->cg_p, vbuf);
-                    break;
-                case estLD_RNG:
-                case estLD_RNGI:
-                case estDISRE_INITF:
-                case estDISRE_RM3TAV:
-                case estORIRE_INITF:
-                case estORIRE_DTAV:
-                    /* No ordering required */
-                    break;
-                default:
-                    gmx_incons("Unknown state entry encountered in dd_sort_state");
-                    break;
-            }
-        }
+        order_vec_atom(dd->ncg_home, cgindex, cgsort, as_rvec_array(state->x.data()), vbuf);
     }
+    if (state->flags & (1 << estV))
+    {
+        order_vec_atom(dd->ncg_home, cgindex, cgsort, as_rvec_array(state->v.data()), vbuf);
+    }
+    if (state->flags & (1 << estCGP))
+    {
+        order_vec_atom(dd->ncg_home, cgindex, cgsort, as_rvec_array(state->cg_p.data()), vbuf);
+    }
+
     if (fr->cutoff_scheme == ecutsGROUP)
     {
         /* Reorder cgcm */
@@ -9076,7 +9102,7 @@ void reset_dd_statistics_counters(gmx_domdec_t *dd)
     comm->load_pme = 0;
 }
 
-void print_dd_statistics(t_commrec *cr, t_inputrec *ir, FILE *fplog)
+void print_dd_statistics(t_commrec *cr, const t_inputrec *ir, FILE *fplog)
 {
     gmx_domdec_comm_t *comm;
     int                ddnat;
@@ -9086,7 +9112,7 @@ void print_dd_statistics(t_commrec *cr, t_inputrec *ir, FILE *fplog)
 
     gmx_sumd(ddnatNR-ddnatZONE, comm->sum_nat, cr);
 
-    if (fplog == NULL)
+    if (fplog == nullptr)
     {
         return;
     }
@@ -9141,7 +9167,7 @@ void dd_partition_system(FILE                *fplog,
                          const gmx_mtop_t    *top_global,
                          const t_inputrec    *ir,
                          t_state             *state_local,
-                         rvec               **f,
+                         PaddedRVecVector    *f,
                          t_mdatoms           *mdatoms,
                          gmx_localtop_t      *top_local,
                          t_forcerec          *fr,
@@ -9198,7 +9224,7 @@ void dd_partition_system(FILE                *fplog,
 
     bNStGlobalComm = (step % nstglobalcomm == 0);
 
-    if (!dlbIsOn(comm))
+    if (!isDlbOn(comm))
     {
         bDoDLB = FALSE;
     }
@@ -9249,7 +9275,7 @@ void dd_partition_system(FILE                *fplog,
             }
             comm->n_load_collect++;
 
-            if (dlbIsOn(comm))
+            if (isDlbOn(comm))
             {
                 if (DDMASTER(dd))
                 {
@@ -9371,10 +9397,10 @@ void dd_partition_system(FILE                *fplog,
         ncgindex_set = 0;
 
         set_ddbox(dd, bMasterState, cr, ir, state_global->box,
-                  TRUE, cgs_gl, state_global->x, &ddbox);
+                  TRUE, cgs_gl, as_rvec_array(state_global->x.data()), &ddbox);
 
         get_cg_distribution(fplog, dd, cgs_gl,
-                            state_global->box, &ddbox, state_global->x);
+                            state_global->box, &ddbox, as_rvec_array(state_global->x.data()));
 
         dd_distribute_state(dd, cgs_gl,
                             state_global, state_local, f);
@@ -9387,7 +9413,7 @@ void dd_partition_system(FILE                *fplog,
         if (fr->cutoff_scheme == ecutsGROUP)
         {
             calc_cgcm(fplog, 0, dd->ncg_home,
-                      &top_local->cgs, state_local->x, fr->cg_cm);
+                      &top_local->cgs, as_rvec_array(state_local->x.data()), fr->cg_cm);
         }
 
         inc_nrnb(nrnb, eNR_CGCM, dd->nat_home);
@@ -9418,7 +9444,7 @@ void dd_partition_system(FILE                *fplog,
         {
             /* Redetermine the cg COMs */
             calc_cgcm(fplog, 0, dd->ncg_home,
-                      &top_local->cgs, state_local->x, fr->cg_cm);
+                      &top_local->cgs, as_rvec_array(state_local->x.data()), fr->cg_cm);
         }
 
         inc_nrnb(nrnb, eNR_CGCM, dd->nat_home);
@@ -9426,9 +9452,9 @@ void dd_partition_system(FILE                *fplog,
         dd_set_cginfo(dd->index_gl, 0, dd->ncg_home, fr, comm->bLocalCG);
 
         set_ddbox(dd, bMasterState, cr, ir, state_local->box,
-                  TRUE, &top_local->cgs, state_local->x, &ddbox);
+                  TRUE, &top_local->cgs, as_rvec_array(state_local->x.data()), &ddbox);
 
-        bRedist = dlbIsOn(comm);
+        bRedist = isDlbOn(comm);
     }
     else
     {
@@ -9445,7 +9471,7 @@ void dd_partition_system(FILE                *fplog,
             copy_rvec(comm->box_size, ddbox.box_size);
         }
         set_ddbox(dd, bMasterState, cr, ir, state_local->box,
-                  bNStGlobalComm, &top_local->cgs, state_local->x, &ddbox);
+                  bNStGlobalComm, &top_local->cgs, as_rvec_array(state_local->x.data()), &ddbox);
 
         bBoxChanged = TRUE;
         bRedist     = TRUE;
@@ -9534,8 +9560,8 @@ void dd_partition_system(FILE                *fplog,
                                   0, dd->ncg_home,
                                   comm->zones.dens_zone0,
                                   fr->cginfo,
-                                  state_local->x,
-                                  ncg_moved, bRedist ? comm->moved : NULL,
+                                  as_rvec_array(state_local->x.data()),
+                                  ncg_moved, bRedist ? comm->moved : nullptr,
                                   fr->nbv->grp[eintLocal].kernel_type,
                                   fr->nbv->grp[eintLocal].nbat);
 
@@ -9570,6 +9596,10 @@ void dd_partition_system(FILE                *fplog,
         }
         dd_sort_state(dd, fr->cg_cm, fr, state_local,
                       bResortAll ? -1 : ncg_home_old);
+
+        /* After sorting and compacting we set the correct size */
+        dd_resize_state(state_local, f, dd->nat_home);
+
         /* Rebuild all the indices */
         ga2la_clear(dd->ga2la);
         ncgindex_set = 0;
@@ -9598,7 +9628,7 @@ void dd_partition_system(FILE                *fplog,
 
     /*
        write_dd_pdb("dd_home",step,"dump",top_global,cr,
-                 -1,state_local->x,state_local->box);
+                 -1,as_rvec_array(state_local->x.data()),state_local->box);
      */
 
     wallcycle_sub_start(wcycle, ewcsDD_MAKETOP);
@@ -9611,7 +9641,7 @@ void dd_partition_system(FILE                *fplog,
     dd_make_local_top(dd, &comm->zones, dd->npbcdim, state_local->box,
                       comm->cellsize_min, np,
                       fr,
-                      fr->cutoff_scheme == ecutsGROUP ? fr->cg_cm : state_local->x,
+                      fr->cutoff_scheme == ecutsGROUP ? fr->cg_cm : as_rvec_array(state_local->x.data()),
                       vsite, top_global, top_local);
 
     wallcycle_sub_stop(wcycle, ewcsDD_MAKETOP);
@@ -9653,10 +9683,8 @@ void dd_partition_system(FILE                *fplog,
      * or constraint communication.
      */
     state_local->natoms = comm->nat[ddnatNR-1];
-    if (state_local->natoms > state_local->nalloc)
-    {
-        dd_realloc_state(state_local, f, state_local->natoms);
-    }
+
+    dd_resize_state(state_local, f, state_local->natoms);
 
     if (fr->bF_NoVirSum)
     {
@@ -9690,31 +9718,15 @@ void dd_partition_system(FILE                *fplog,
     forcerec_set_ranges(fr, dd->ncg_home, dd->ncg_tot,
                         dd->nat_tot, comm->nat[ddnatCON], nat_f_novirsum);
 
-    /* We make the all mdatoms up to nat_tot_con.
-     * We could save some work by only setting invmass
-     * between nat_tot and nat_tot_con.
-     */
-    /* This call also sets the new number of home particles to dd->nat_home */
-    atoms2md(top_global, ir,
-             comm->nat[ddnatCON], dd->gatindex, dd->nat_home, mdatoms);
-
-    /* Now we have the charges we can sort the FE interactions */
-    dd_sort_local_top(dd, mdatoms, top_local);
-
-    if (vsite != NULL)
-    {
-        /* Now we have updated mdatoms, we can do the last vsite bookkeeping */
-        split_vsites_over_threads(top_local->idef.il, top_local->idef.iparams,
-                                  mdatoms, FALSE, vsite);
-    }
+    /* Update atom data for mdatoms and several algorithms */
+    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);
     }
 
-    setup_bonded_threading(fr, &top_local->idef);
-
     if (!(cr->duty & DUTY_PME))
     {
         /* Send the charges and/or c6/sigmas to our PME only node */
@@ -9762,15 +9774,15 @@ void dd_partition_system(FILE                *fplog,
      * the last vsite construction, we need to communicate the constructing
      * atom coordinates again (for spreading the forces this MD step).
      */
-    dd_move_x_vsites(dd, state_local->box, state_local->x);
+    dd_move_x_vsites(dd, state_local->box, as_rvec_array(state_local->x.data()));
 
     wallcycle_sub_stop(wcycle, ewcsDD_TOPOTHER);
 
     if (comm->nstDDDump > 0 && step % comm->nstDDDump == 0)
     {
-        dd_move_x(dd, state_local->box, state_local->x);
+        dd_move_x(dd, state_local->box, as_rvec_array(state_local->x.data()));
         write_dd_pdb("dd_dump", step, "dump", top_global, cr,
-                     -1, state_local->x, state_local->box);
+                     -1, as_rvec_array(state_local->x.data()), state_local->box);
     }
 
     /* Store the partitioning step */
index a2d772a2214273c9bf43f7c2d7c15f1d0d0f7e01..a64cbbef420814affacc896e1b8280dc0f2cf23c 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, by the GROMACS development team, led by
+ * Copyright (c) 2005,2006,2007,2008,2009,2010,2012,2013,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.
 #include <stdio.h>
 
 #include "gromacs/gmxlib/nrnb.h"
-#include "gromacs/hardware/hw_info.h"
 #include "gromacs/math/vectypes.h"
-#include "gromacs/mdlib/constr.h"
 #include "gromacs/mdlib/vsite.h"
 #include "gromacs/mdtypes/forcerec.h"
 #include "gromacs/mdtypes/mdatom.h"
-#include "gromacs/mdtypes/state.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/topology/block.h"
 #include "gromacs/topology/idef.h"
 struct gmx_domdec_t;
 struct gmx_ddbox_t;
 struct gmx_domdec_zones_t;
+struct MdrunOptions;
 struct t_commrec;
 struct t_inputrec;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
+class t_state;
 
 /*! \brief Returns the global topology atom number belonging to local atom index i.
  *
@@ -109,6 +104,9 @@ struct gmx_domdec_zones_t *domdec_zones(struct gmx_domdec_t *dd);
 void dd_get_ns_ranges(const gmx_domdec_t *dd, int icg,
                       int *jcg0, int *jcg1, ivec shift0, ivec shift1);
 
+/*! \brief Returns the atom range in the local state for atoms that need to be present in mdatoms */
+int dd_natoms_mdatoms(const gmx_domdec_t *dd);
+
 /*! \brief Returns the atom range in the local state for atoms involved in virtual sites */
 int dd_natoms_vsite(const gmx_domdec_t *dd);
 
@@ -130,27 +128,73 @@ int dd_pme_maxshift_x(const gmx_domdec_t *dd);
 /*! \brief Returns the maximum shift for coordinate communication in PME, dim y */
 int dd_pme_maxshift_y(const gmx_domdec_t *dd);
 
+/*! \brief The options for the domain decomposition MPI task ordering. */
+enum class DdRankOrder
+{
+    select,     //!< First value (needed to cope with command-line parsing)
+    interleave, //!< Interleave the PP and PME ranks
+    pp_pme,     //!< First all PP ranks, all PME rank at the end
+    cartesian,  //!< Use Cartesian communicators for PP, PME and PP-PME
+    nr          //!< The number of options
+};
+
+/*! \brief The options for the dynamic load balancing. */
+enum class DlbOption
+{
+    select,           //!< First value (needed to cope with command-line parsing)
+    turnOnWhenUseful, //!< Turn on DLB when we think it would improve performance
+    no,               //!< Never turn on DLB
+    yes,              //!< Turn on DLB from the start and keep it on
+    nr                //!< The number of options
+};
+
+/*! \libinternal \brief Structure containing all (command line) options for the domain decomposition */
+struct DomdecOptions
+{
+    /*! \brief Constructor */
+    DomdecOptions();
+
+    //! If true, check that all bonded interactions have been assigned to exactly one domain/rank.
+    gmx_bool          checkBondedInteractions;
+    //! If true, don't communicate all atoms between the non-bonded cut-off and the larger bonded cut-off, but only those that have non-local bonded interactions. This significantly reduces the communication volume.
+    gmx_bool          useBondedCommunication;
+    //! The domain decomposition grid cell count, 0 means let domdec choose based on the number of ranks.
+    ivec              numCells;
+    //! The number of separate PME ranks requested, -1 = auto.
+    int               numPmeRanks;
+    //! Ordering of the PP and PME ranks, values from enum above.
+    DdRankOrder       rankOrder;
+    //! The minimum communication range, used for extended the communication range for bonded interactions (nm).
+    real              minimumCommunicationRange;
+    //! Communication range for atom involved in constraints (P-LINCS) (nm).
+    real              constraintCommunicationRange;
+    //! Dynamic load balancing option, values from enum above.
+    DlbOption         dlbOption;
+    /*! \brief Fraction in (0,1) by whose reciprocal the initial
+     * DD cell size will be increased in order to provide a margin
+     * in which dynamic load balancing can act, while preserving
+     * the minimum cell size. */
+    real              dlbScaling;
+    //! String containing a vector of the relative sizes in the x direction of the corresponding DD cells.
+    const char       *cellSizeX;
+    //! String containing a vector of the relative sizes in the y direction of the corresponding DD cells.
+    const char       *cellSizeY;
+    //! String containing a vector of the relative sizes in the z direction of the corresponding DD cells.
+    const char       *cellSizeZ;
+};
+
 /*! \brief Initialized the domain decomposition, chooses the DD grid and PME ranks, return the DD struct */
-gmx_domdec_t *init_domain_decomposition(FILE             *fplog,
-                                        t_commrec        *cr,
-                                        unsigned long     Flags,
-                                        ivec              nc,
-                                        int               nPmeRanks,
-                                        int               dd_node_order,
-                                        real              comm_distance_min,
-                                        real              rconstr,
-                                        const char       *dlb_opt,
-                                        real              dlb_scale,
-                                        const char       *sizex,
-                                        const char       *sizey,
-                                        const char       *sizez,
-                                        const gmx_mtop_t *mtop,
-                                        const t_inputrec *ir,
-                                        matrix            box,
-                                        rvec             *x,
-                                        gmx_ddbox_t      *ddbox,
-                                        int              *npme_x,
-                                        int              *npme_y);
+gmx_domdec_t *init_domain_decomposition(FILE                *fplog,
+                                        t_commrec           *cr,
+                                        const DomdecOptions &options,
+                                        const MdrunOptions  &mdrunOptions,
+                                        const gmx_mtop_t    *mtop,
+                                        const t_inputrec    *ir,
+                                        matrix               box,
+                                        rvec                *x,
+                                        gmx_ddbox_t         *ddbox,
+                                        int                 *npme_x,
+                                        int                 *npme_y);
 
 /*! \brief Initialize data structures for bonded interactions */
 void dd_init_bondeds(FILE              *fplog,
@@ -195,20 +239,23 @@ void dd_dlb_lock(struct gmx_domdec_t *dd);
 /*! \brief Clear a lock such that with DLB=auto DLB may get turned on later */
 void dd_dlb_unlock(struct gmx_domdec_t *dd);
 
-/*! \brief Set up communication for averaging GPU wait times over ranks
+/*! \brief Set up communication for averaging GPU wait times over domains
  *
  * When domains (PP MPI ranks) share a GPU, the individual GPU wait times
  * are meaningless, as it depends on the order in which tasks on the same
  * GPU finish. Therefore there wait times need to be averaged over the ranks
  * sharing the same GPU. This function sets up the communication for that.
  */
-void dd_setup_dlb_resource_sharing(struct t_commrec           *cr,
-                                   const gmx_hw_info_t        *hwinfo,
-                                   const gmx_hw_opt_t         *hw_opt);
+void dd_setup_dlb_resource_sharing(t_commrec           *cr,
+                                   int                  gpu_id);
 
 /*! \brief Collects local rvec arrays \p lv to \p v on the master rank */
 void dd_collect_vec(struct gmx_domdec_t *dd,
-                    t_state *state_local, rvec *lv, rvec *v);
+                    t_state *state_local, const PaddedRVecVector *lv, rvec *v);
+
+/*! \brief Collects local rvec arrays \p lv to \p v on the master rank */
+void dd_collect_vec(struct gmx_domdec_t *dd,
+                    t_state *state_local, const PaddedRVecVector *lv, PaddedRVecVector *v);
 
 /*! \brief Collects the local state \p state_local to \p state on the master rank */
 void dd_collect_state(struct gmx_domdec_t *dd,
@@ -220,7 +267,7 @@ enum {
 };
 
 /*! \brief Add the wallcycle count to the DD counter */
-void dd_cycles_add(struct gmx_domdec_t *dd, float cycles, int ddCycl);
+void dd_cycles_add(const gmx_domdec_t *dd, float cycles, int ddCycl);
 
 /*! \brief Start the force flop count */
 void dd_force_flop_start(struct gmx_domdec_t *dd, t_nrnb *nrnb);
@@ -266,12 +313,12 @@ void dd_partition_system(FILE                *fplog,
                          const gmx_mtop_t    *top_global,
                          const t_inputrec    *ir,
                          t_state             *state_local,
-                         rvec               **f,
+                         PaddedRVecVector    *f,
                          t_mdatoms           *mdatoms,
                          gmx_localtop_t      *top_local,
                          t_forcerec          *fr,
                          gmx_vsite_t         *vsite,
-                         gmx_constr_t         constr,
+                         struct gmx_constr   *constr,
                          t_nrnb              *nrnb,
                          gmx_wallcycle_t      wcycle,
                          gmx_bool             bVerbose);
@@ -280,7 +327,7 @@ void dd_partition_system(FILE                *fplog,
 void reset_dd_statistics_counters(struct gmx_domdec_t *dd);
 
 /*! \brief Print statistics for domain decomposition communication */
-void print_dd_statistics(struct t_commrec *cr, t_inputrec *ir, FILE *fplog);
+void print_dd_statistics(struct t_commrec *cr, const t_inputrec *ir, FILE *fplog);
 
 /* In domdec_con.c */
 
@@ -399,8 +446,4 @@ void set_ddbox_cr(t_commrec *cr, const ivec *dd_nc,
                   const t_block *cgs, const rvec *x,
                   gmx_ddbox_t *ddbox);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif
index 684509aabd51063c3cacfea2306b23aa84e31dcd..43baf199539e7789273009b15f02049f95f13b79 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2009,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.
@@ -102,7 +102,7 @@ static void calc_cgcm_av_stddev(const t_block *cgs, int n, const rvec *x,
         }
     }
 
-    if (cr_sum != NULL)
+    if (cr_sum != nullptr)
     {
         for (d = 0; d < DIM; d++)
         {
@@ -146,7 +146,7 @@ static void set_tric_dir(const ivec *dd_nc, gmx_ddbox_t *ddbox, const matrix box
             if (box[j][d] != 0)
             {
                 ddbox->tric_dir[d] = 1;
-                if (dd_nc != NULL && (*dd_nc)[j] > 1 && (*dd_nc)[d] == 1)
+                if (dd_nc != nullptr && (*dd_nc)[j] > 1 && (*dd_nc)[d] == 1)
                 {
                     gmx_fatal(FARGS, "Domain decomposition has not been implemented for box vectors that have non-zero components in directions that do not use domain decomposition: ncells = %d %d %d, box vector[%d] = %f %f %f",
                               (*dd_nc)[XX], (*dd_nc)[YY], (*dd_nc)[ZZ],
@@ -292,7 +292,7 @@ void set_ddbox(gmx_domdec_t *dd, gmx_bool bMasterState, t_commrec *cr_sum,
     {
         low_set_ddbox(ir, &dd->nc, box, bCalcUnboundedSize,
                       bMasterState ? cgs->nr : dd->ncg_home, cgs, x,
-                      bMasterState ? NULL : cr_sum,
+                      bMasterState ? nullptr : cr_sum,
                       ddbox);
     }
 
@@ -309,7 +309,7 @@ void set_ddbox_cr(t_commrec *cr, const ivec *dd_nc,
 {
     if (MASTER(cr))
     {
-        low_set_ddbox(ir, dd_nc, box, TRUE, cgs->nr, cgs, x, NULL, ddbox);
+        low_set_ddbox(ir, dd_nc, box, TRUE, cgs->nr, cgs, x, nullptr, ddbox);
     }
 
     gmx_bcast(sizeof(gmx_ddbox_t), ddbox, cr);
index 5cece422a6e8e294fee875c2480bbcadc6b158a1..c20440a276632211f0d628470c58ed7319d76b85 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, by the GROMACS development team, led by
+ * Copyright (c) 2006,2007,2008,2009,2010,2012,2013,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.
@@ -50,6 +50,7 @@
 
 #include <algorithm>
 
+#include "gromacs/domdec/dlbtiming.h"
 #include "gromacs/domdec/domdec.h"
 #include "gromacs/domdec/domdec_struct.h"
 #include "gromacs/domdec/ga2la.h"
 #include "gromacs/mdlib/gmx_omp_nthreads.h"
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/pbcutil/ishift.h"
-#include "gromacs/topology/mtop_util.h"
+#include "gromacs/topology/mtop_lookup.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
 
 #include "domdec_specatomcomm.h"
+#include "domdec_vsite.h"
 #include "hash.h"
 
 /*! \brief Struct used during constraint setup with domain decomposition */
@@ -94,6 +96,8 @@ void dd_move_x_constraints(gmx_domdec_t *dd, matrix box,
     if (dd->constraint_comm)
     {
         dd_move_x_specat(dd, dd->constraint_comm, box, x0, x1, bX1IsCoord);
+
+        ddReopenBalanceRegionCpu(dd);
     }
 }
 
@@ -105,7 +109,7 @@ int *dd_constraints_nlocalatoms(gmx_domdec_t *dd)
     }
     else
     {
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -242,51 +246,37 @@ static void atoms_to_settles(gmx_domdec_t *dd,
                              t_ilist *ils_local,
                              ind_req_t *ireq)
 {
-    gmx_ga2la_t            *ga2la;
-    gmx_mtop_atomlookup_t   alook;
-    int                     settle;
-    int                     nral, sa;
-    int                     cg, a, a_gl, a_glsa, a_gls[3], a_locs[3];
-    int                     mb, molnr, a_mol, offset;
-    const gmx_molblock_t   *molb;
-    const t_iatom          *ia1;
-    gmx_bool                a_home[3];
-    int                     nlocal;
-    gmx_bool                bAssign;
-
-    ga2la  = dd->ga2la;
-
-    alook = gmx_mtop_atomlookup_settle_init(mtop);
+    gmx_ga2la_t *ga2la = dd->ga2la;
+    int          nral  = NRAL(F_SETTLE);
 
-    nral = NRAL(F_SETTLE);
-
-    for (cg = cg_start; cg < cg_end; cg++)
+    int          mb    = 0;
+    for (int cg = cg_start; cg < cg_end; cg++)
     {
         if (GET_CGINFO_SETTLE(cginfo[cg]))
         {
-            for (a = dd->cgindex[cg]; a < dd->cgindex[cg+1]; a++)
+            for (int a = dd->cgindex[cg]; a < dd->cgindex[cg+1]; a++)
             {
-                a_gl = dd->gatindex[a];
-
-                gmx_mtop_atomnr_to_molblock_ind(alook, a_gl, &mb, &molnr, &a_mol);
-                molb = &mtop->molblock[mb];
+                int a_gl = dd->gatindex[a];
+                int a_mol;
+                mtopGetMolblockIndex(mtop, a_gl, &mb, nullptr, &a_mol);
 
-                settle = at2settle_mt[molb->type][a_mol];
+                const gmx_molblock_t *molb   = &mtop->molblock[mb];
+                int                   settle = at2settle_mt[molb->type][a_mol];
 
                 if (settle >= 0)
                 {
-                    offset = a_gl - a_mol;
+                    int      offset  = a_gl - a_mol;
 
-                    ia1 = mtop->moltype[molb->type].ilist[F_SETTLE].iatoms;
+                    t_iatom *ia1     = mtop->moltype[molb->type].ilist[F_SETTLE].iatoms;
 
-                    bAssign = FALSE;
-                    nlocal  = 0;
-                    for (sa = 0; sa < nral; sa++)
+                    int      a_gls[3], a_locs[3];
+                    gmx_bool bAssign = FALSE;
+                    int      nlocal  = 0;
+                    for (int sa = 0; sa < nral; sa++)
                     {
-                        a_glsa     = offset + ia1[settle*(1+nral)+1+sa];
+                        int a_glsa = offset + ia1[settle*(1+nral)+1+sa];
                         a_gls[sa]  = a_glsa;
-                        a_home[sa] = ga2la_get_home(ga2la, a_glsa, &a_locs[sa]);
-                        if (a_home[sa])
+                        if (ga2la_get_home(ga2la, a_glsa, &a_locs[sa]))
                         {
                             if (nlocal == 0 && a_gl == a_glsa)
                             {
@@ -306,7 +296,7 @@ static void atoms_to_settles(gmx_domdec_t *dd,
 
                         ils_local->iatoms[ils_local->nr++] = ia1[settle*4];
 
-                        for (sa = 0; sa < nral; sa++)
+                        for (int sa = 0; sa < nral; sa++)
                         {
                             if (ga2la_get_home(ga2la, a_gls[sa], &a_locs[sa]))
                             {
@@ -332,8 +322,6 @@ static void atoms_to_settles(gmx_domdec_t *dd,
             }
         }
     }
-
-    gmx_mtop_atomlookup_destroy(alook);
 }
 
 /*! \brief Looks up constraint for the local atoms */
@@ -345,33 +333,28 @@ static void atoms_to_constraints(gmx_domdec_t *dd,
                                  ind_req_t *ireq)
 {
     const t_blocka             *at2con;
-    gmx_ga2la_t                *ga2la;
-    gmx_mtop_atomlookup_t       alook;
     int                         ncon1;
-    gmx_molblock_t             *molb;
     t_iatom                    *ia1, *ia2, *iap;
-    int                         nhome, cg, a, a_gl, a_mol, a_loc, b_lo, offset, mb, molnr, b_mol, i, con, con_offset;
-    gmx_domdec_constraints_t   *dc;
-    gmx_domdec_specat_comm_t   *dcc;
+    int                         a_loc, b_lo, offset, b_mol, i, con, con_offset;
 
-    dc  = dd->constraints;
-    dcc = dd->constraint_comm;
+    gmx_domdec_constraints_t   *dc     = dd->constraints;
+    gmx_domdec_specat_comm_t   *dcc    = dd->constraint_comm;
 
-    ga2la  = dd->ga2la;
+    gmx_ga2la_t                *ga2la  = dd->ga2la;
 
-    alook = gmx_mtop_atomlookup_init(mtop);
-
-    nhome = 0;
-    for (cg = 0; cg < dd->ncg_home; cg++)
+    int mb    = 0;
+    int nhome = 0;
+    for (int cg = 0; cg < dd->ncg_home; cg++)
     {
         if (GET_CGINFO_CONSTR(cginfo[cg]))
         {
-            for (a = dd->cgindex[cg]; a < dd->cgindex[cg+1]; a++)
+            for (int a = dd->cgindex[cg]; a < dd->cgindex[cg+1]; a++)
             {
-                a_gl = dd->gatindex[a];
+                int a_gl = dd->gatindex[a];
+                int molnr, a_mol;
+                mtopGetMolblockIndex(mtop, a_gl, &mb, &molnr, &a_mol);
 
-                gmx_mtop_atomnr_to_molblock_ind(alook, a_gl, &mb, &molnr, &a_mol);
-                molb = &mtop->molblock[mb];
+                const gmx_molblock_t *molb = &mtop->molblock[mb];
 
                 ncon1 = mtop->moltype[molb->type].ilist[F_CONSTR].nr/NRAL(F_SETTLE);
 
@@ -443,8 +426,6 @@ static void atoms_to_constraints(gmx_domdec_t *dd,
         }
     }
 
-    gmx_mtop_atomlookup_destroy(alook);
-
     if (debug)
     {
         fprintf(debug,
@@ -497,8 +478,8 @@ int dd_make_local_constraints(gmx_domdec_t *dd, int at_start,
     else
     {
         // Currently unreachable
-        at2con_mt = NULL;
-        ireq      = NULL;
+        at2con_mt = nullptr;
+        ireq      = nullptr;
     }
 
     if (dd->bInterCGsettles)
@@ -509,10 +490,10 @@ int dd_make_local_constraints(gmx_domdec_t *dd, int at_start,
     else
     {
         /* Settle works inside charge groups, we assigned them already */
-        at2settle_mt = NULL;
+        at2settle_mt = nullptr;
     }
 
-    if (at2settle_mt == NULL)
+    if (at2settle_mt == nullptr)
     {
         atoms_to_constraints(dd, mtop, cginfo, at2con_mt, nrec,
                              ilc_local, ireq);
@@ -525,7 +506,7 @@ int dd_make_local_constraints(gmx_domdec_t *dd, int at_start,
         /* Do the constraints, if present, on the first thread.
          * Do the settles on all other threads.
          */
-        t0_set = ((at2con_mt != NULL && dc->nthread > 1) ? 1 : 0);
+        t0_set = ((at2con_mt != nullptr && dc->nthread > 1) ? 1 : 0);
 
 #pragma omp parallel for num_threads(dc->nthread) schedule(static)
         for (thread = 0; thread < dc->nthread; thread++)
index 08697fb20c69744c29af9b04e2916eefd5b1bf08..f26700fbe59600bfceec8f985fbbde95a78ae514 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) 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.
 #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"
 
 /*! \cond INTERNAL */
 
+struct BalanceRegion;
+
 typedef struct
 {
     /* The numbers of charge groups to send and receive for each cell
@@ -144,23 +147,30 @@ enum {
     ddnatHOME, ddnatZONE, ddnatVSITE, ddnatCON, ddnatNR
 };
 
-/*! \brief Enum of dynamic load balancing states */
-enum {
-    edlbsOffForever,           /**< DLB is off and will never be turned on */
-    edlbsOffCanTurnOn,         /**< DLB is off and will turn on on imbalance */
-    edlbsOffTemporarilyLocked, /**< DLB is off and temporarily can't turn on */
-    edlbsOnCanTurnOff,         /**< DLB is on and can turn off when slow */
-    edlbsOnForever,            /**< DLB is on and will stay on forever, because the user chose this */
-    edlbsNR                    /**< The number of DLB states */
-};
-
-/* Allowed DLB state transitions in automatic mode:
+/*! \brief Enum of dynamic load balancing states
+ *
+ * Allowed DLB states and transitions
+ * - intialization at startup:
+ *                             -> edlbsOffUser ("-dlb no")
+ *                             -> edlbsOnUser  ("-dlb yes")
+ *                             -> edlbsOffCanTurnOn ("-dlb auto")
+ *
+ * - in automatic mode (i.e. initial state edlbsOffCanTurnOn):
  *   edlbsOffCanTurnOn         -> edlbsOnCanTurnOff
  *   edlbsOffCanTurnOn         -> edlbsOffForever
  *   edlbsOffCanTurnOn         -> edlbsOffTemporarilyLocked
  *   edlbsOffTemporarilyLocked -> edlbsOffCanTurnOn
  *   edlbsOnCanTurnOff         -> edlbsOffCanTurnOn
  */
+enum {
+    edlbsOffUser,              /**< DLB is permanently off per user request */
+    edlbsOffForever,           /**< DLB is off due to a runtime condition (not supported or causes performance loss) and will never be turned on */
+    edlbsOffCanTurnOn,         /**< DLB is off and will turn on on imbalance */
+    edlbsOffTemporarilyLocked, /**< DLB is off and temporarily can't turn on */
+    edlbsOnCanTurnOff,         /**< DLB is on and can turn off when slow */
+    edlbsOnUser,               /**< DLB is permanently on per user request */
+    edlbsNR                    /**< The number of DLB states */
+};
 
 /*! \brief The PME domain decomposition for one dimension */
 typedef struct
@@ -345,10 +355,12 @@ struct gmx_domdec_comm_t
     MPI_Comm        mpi_comm_gpu_shared; /**< The MPI load communicator for ranks sharing a GPU */
 #endif
 
-    /** Maximum DLB scaling per load balancing step in percent */
-    int dlb_scale_lim;
+    /* Information for managing the dynamic load balancing */
+    int            dlb_scale_lim;      /**< Maximum DLB scaling per load balancing step in percent */
+
+    BalanceRegion *balanceRegion;      /**< Struct for timing the force load balancing region */
 
-    /* Cycle counters */
+    /* Cycle counters over nstlist steps */
     float  cycl[ddCyclNr];             /**< Total cycles counted */
     int    cycl_n[ddCyclNr];           /**< The number of cycle recordings */
     float  cycl_max[ddCyclNr];         /**< The maximum cycle count */
index 907e60c5f947398ab2f4d7cd8fc27f3eb653642a..452c0abaed9d24c1ade4f299736acbd6ab6d257d 100644 (file)
@@ -223,26 +223,13 @@ void dd_sendrecv2_rvec(const struct gmx_domdec_t gmx_unused *dd,
 #endif
 }
 
-/* IBM's BlueGene(/L) MPI_Bcast dereferences the data pointer
- * even when 0 == nbytes, so we protect calls to it on BlueGene.
- * Fortunately dd_bcast() and dd_bcastc() are only
- * called during DD setup and partition.
- */
-
 void dd_bcast(gmx_domdec_t gmx_unused *dd, int gmx_unused nbytes, void gmx_unused *data)
 {
 #if GMX_MPI
     if (dd->nnodes > 1)
     {
-#ifdef GMX_BLUEGENE
-        if (nbytes > 0)
-        {
-#endif
         MPI_Bcast(data, nbytes, MPI_BYTE,
                   DDMASTERRANK(dd), dd->mpi_comm_all);
-#ifdef GMX_BLUEGENE
-    }
-#endif
     }
 #endif
 }
@@ -256,25 +243,19 @@ void dd_bcastc(gmx_domdec_t *dd, int nbytes, void *src, void *dest)
 #if GMX_MPI
     if (dd->nnodes > 1)
     {
-#ifdef GMX_BLUEGENE
-        if (nbytes > 0)
-        {
-#endif
         MPI_Bcast(dest, nbytes, MPI_BYTE,
                   DDMASTERRANK(dd), dd->mpi_comm_all);
-#ifdef GMX_BLUEGENE
-    }
-#endif
     }
 #endif
 }
 
-void dd_scatter(gmx_domdec_t gmx_unused *dd, int gmx_unused nbytes, void gmx_unused *src, void *dest)
+void dd_scatter(gmx_domdec_t gmx_unused *dd, int gmx_unused nbytes, const void gmx_unused *src, void *dest)
 {
 #if GMX_MPI
     if (dd->nnodes > 1)
     {
-        MPI_Scatter(src, nbytes, MPI_BYTE,
+        /* Some MPI implementions don't specify const */
+        MPI_Scatter(const_cast<void *>(src), nbytes, MPI_BYTE,
                     dest, nbytes, MPI_BYTE,
                     DDMASTERRANK(dd), dd->mpi_comm_all);
     }
@@ -289,17 +270,18 @@ void dd_scatter(gmx_domdec_t gmx_unused *dd, int gmx_unused nbytes, void gmx_unu
     }
 }
 
-void dd_gather(gmx_domdec_t gmx_unused *dd, int gmx_unused nbytes, void gmx_unused *src, void gmx_unused *dest)
+void dd_gather(gmx_domdec_t gmx_unused *dd, int gmx_unused nbytes, const void gmx_unused *src, void gmx_unused *dest)
 {
 #if GMX_MPI
-    MPI_Gather(src, nbytes, MPI_BYTE,
+    /* Some MPI implementions don't specify const */
+    MPI_Gather(const_cast<void *>(src), nbytes, MPI_BYTE,
                dest, nbytes, MPI_BYTE,
                DDMASTERRANK(dd), dd->mpi_comm_all);
 #endif
 }
 
 void dd_scatterv(gmx_domdec_t gmx_unused *dd,
-                 int gmx_unused *scounts, int gmx_unused *disps, void *sbuf,
+                 int gmx_unused *scounts, int gmx_unused *disps, const void *sbuf,
                  int rcount, void *rbuf)
 {
 #if GMX_MPI
@@ -312,7 +294,8 @@ void dd_scatterv(gmx_domdec_t gmx_unused *dd,
             /* MPI does not allow NULL pointers */
             rbuf = &dum;
         }
-        MPI_Scatterv(sbuf, scounts, disps, MPI_BYTE,
+        /* Some MPI implementions don't specify const */
+        MPI_Scatterv(const_cast<void *>(sbuf), scounts, disps, MPI_BYTE,
                      rbuf, rcount, MPI_BYTE,
                      DDMASTERRANK(dd), dd->mpi_comm_all);
     }
@@ -328,7 +311,7 @@ void dd_scatterv(gmx_domdec_t gmx_unused *dd,
 }
 
 void dd_gatherv(gmx_domdec_t gmx_unused *dd,
-                int gmx_unused scount, void gmx_unused *sbuf,
+                int gmx_unused scount, const void gmx_unused *sbuf,
                 int gmx_unused *rcounts, int gmx_unused *disps, void gmx_unused *rbuf)
 {
 #if GMX_MPI
@@ -339,7 +322,8 @@ void dd_gatherv(gmx_domdec_t gmx_unused *dd,
         /* MPI does not allow NULL pointers */
         sbuf = &dum;
     }
-    MPI_Gatherv(sbuf, scount, MPI_BYTE,
+    /* Some MPI implementions don't specify const */
+    MPI_Gatherv(const_cast<void *>(sbuf), scount, MPI_BYTE,
                 rbuf, rcounts, disps, MPI_BYTE,
                 DDMASTERRANK(dd), dd->mpi_comm_all);
 #endif
index faf224c47089c50d31ec61acebbf699b7266bf32..7223336a8ec9220c4fdefe9589f1d11d2b2f561a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2008,2009,2010,2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2008,2009,2010,2012,2014,2015,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.
@@ -123,11 +123,11 @@ dd_bcastc(struct gmx_domdec_t *dd, int nbytes, void *src, void *dest);
 
 /*! \brief Scatters \p nbytes from \p src on \p DDMASTERRANK to all PP ranks, received in \p dest */
 void
-dd_scatter(struct gmx_domdec_t *dd, int nbytes, void *src, void *dest);
+dd_scatter(struct gmx_domdec_t *dd, int nbytes, const void *src, void *dest);
 
 /*! \brief Gathers \p nbytes from \p src on all PP ranks, received in \p dest on \p DDMASTERRANK */
 void
-dd_gather(struct gmx_domdec_t *dd, int nbytes, void *src, void *dest);
+dd_gather(struct gmx_domdec_t *dd, int nbytes, const void *src, void *dest);
 
 /*! \brief Scatters \p scounts bytes from \p src on \p DDMASTERRANK to all PP ranks, receiving \p rcount bytes in \p dest.
  *
@@ -135,7 +135,7 @@ dd_gather(struct gmx_domdec_t *dd, int nbytes, void *src, void *dest);
  * If rcount==0, rbuf is allowed to be NULL */
 void
 dd_scatterv(struct gmx_domdec_t *dd,
-            int *scounts, int *disps, void *sbuf,
+            int *scounts, int *disps, const void *sbuf,
             int rcount, void *rbuf);
 
 /*! \brief Gathers \p rcount bytes from \p src on all PP ranks, received in \p scounts bytes in \p dest on \p DDMASTERRANK.
@@ -145,7 +145,7 @@ dd_scatterv(struct gmx_domdec_t *dd,
  * If scount==0, sbuf is allowed to be NULL */
 void
 dd_gatherv(struct gmx_domdec_t *dd,
-           int scount, void *sbuf,
+           int scount, const void *sbuf,
            int *rcounts, int *disps, void *rbuf);
 
 #endif
index 7f3ccc5cc5983f22a6aa53cb13387895d8902beb..5b1a2c0610e0b8f121b6b49c94d729e514d90ed0 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, by the GROMACS development team, led by
+ * Copyright (c) 2008,2009,2010,2011,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.
@@ -51,6 +51,7 @@
 
 #include "gromacs/domdec/domdec.h"
 #include "gromacs/domdec/domdec_struct.h"
+#include "gromacs/ewald/pme.h"
 #include "gromacs/gmxlib/network.h"
 #include "gromacs/math/utilities.h"
 #include "gromacs/math/vec.h"
@@ -428,6 +429,28 @@ static float comm_cost_est(real limit, real cutoff,
         }
     }
 
+    if (EEL_PME(ir->coulombtype) || EVDW_PME(ir->vdwtype))
+    {
+        /* Check the PME grid restrictions.
+         * Currently these can only be invalid here with too few grid lines
+         * along the x dimension per rank doing PME.
+         */
+        int npme_x = (npme_tot > 1 ? npme[XX] : nc[XX]);
+
+        /* Currently we don't have the OpenMP thread count available here.
+         * But with threads we have only tighter restrictions and it's
+         * probably better anyhow to avoid settings where we need to reduce
+         * grid lines over multiple ranks, as the thread check will do.
+         */
+        bool useThreads     = true;
+        bool errorsAreFatal = false;
+        if (!gmx_pme_check_restrictions(ir->pme_order, ir->nkx, ir->nky, ir->nkz,
+                                        npme_x, useThreads, errorsAreFatal))
+        {
+            return -1;
+        }
+    }
+
     /* When two dimensions are (nearly) equal, use more cells
      * for the smallest index, so the decomposition does not
      * depend sensitively on the rounding of the box elements.
@@ -631,7 +654,7 @@ static real optimize_ncells(FILE *fplog,
          * we can save some time (e.g. 3D DD with pbc=xyz).
          * Here we ignore SIMD bondeds as they always do (fast) PBC.
          */
-        count_bonded_distances(mtop, ir, &pbcdxr, NULL);
+        count_bonded_distances(mtop, ir, &pbcdxr, nullptr);
         pbcdxr /= (double)mtop->natoms;
     }
     else
index 8d86f5f15644d42cc4b0571f95ce2b989da6881d..f7c143a9cb5a4c6e20b5f4264991449d07b05259 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, by the GROMACS development team, led by
+ * Copyright (c) 2006,2007,2008,2009,2010,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.
@@ -97,7 +97,7 @@ void dd_move_f_specat(gmx_domdec_t *dd, gmx_domdec_specat_comm_t *spac,
 
                 spas = &spac->spas[d][dir];
                 /* Sum the buffer into the required forces */
-                if (!bPBC || (!bScrew && fshift == NULL))
+                if (!bPBC || (!bScrew && fshift == nullptr))
                 {
                     for (i = 0; i < spas->nsend; i++)
                     {
@@ -182,7 +182,7 @@ void dd_move_x_specat(gmx_domdec_t *dd, gmx_domdec_specat_comm_t *spac,
     rvec              shift = {0, 0, 0};
 
     nvec = 1;
-    if (x1 != NULL)
+    if (x1 != nullptr)
     {
         nvec++;
     }
index 6ef54dca4c72992af51fe82b286f1754f64a1606..7ee58b3e002980fd0659cfa37dc66a2c94ed2c2c 100644 (file)
@@ -49,6 +49,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include <cassert>
+
 #include <algorithm>
 #include <string>
 
@@ -419,7 +421,7 @@ void dd_print_missing_interactions(FILE *fplog, t_commrec *cr,
 
     print_missing_interactions_atoms(fplog, cr, top_global, &top_local->idef);
     write_dd_pdb("dd_dump_err", 0, "dump", top_global, cr,
-                 -1, state_local->x, state_local->box);
+                 -1, as_rvec_array(state_local->x.data()), state_local->box);
 
     std::string errorMessage;
 
@@ -503,7 +505,7 @@ static void count_excls(const t_block *cgs, const t_blocka *excls,
     }
 }
 
-/*! \brief Run the reverse ilist generation and store it when \p bAssign = TRUE */
+/*! \brief Run the reverse ilist generation and store it in r_il when \p bAssign = TRUE */
 static int low_make_reverse_ilist(const t_ilist *il_mt, const t_atom *atom,
                                   const int * const * vsite_pbc,
                                   int *count,
@@ -555,6 +557,8 @@ static int low_make_reverse_ilist(const t_ilist *il_mt, const t_atom *atom,
                     a = ia[1+link];
                     if (bAssign)
                     {
+                        assert(r_il); //with bAssign not allowed to be null
+                        assert(r_index);
                         r_il[r_index[a]+count[a]] =
                             (ftype == F_CONSTRNC ? F_CONSTR : ftype);
                         r_il[r_index[a]+count[a]+1] = ia[0];
@@ -622,7 +626,7 @@ static int make_reverse_ilist(const t_ilist *ilist,
     snew(count, nat_mt);
     low_make_reverse_ilist(ilist, atoms->atom, vsite_pbc,
                            count,
-                           bConstr, bSettle, bBCheck, NULL, NULL,
+                           bConstr, bSettle, bBCheck, nullptr, nullptr,
                            bLinkToAllAtoms, FALSE);
 
     snew(ril_mt->index, nat_mt+1);
@@ -688,7 +692,7 @@ static gmx_reverse_top_t *make_reverse_top(const gmx_mtop_t *mtop, gmx_bool bFE,
         /* Make the atom to interaction list for this molecule type */
         nint_mt[mt] =
             make_reverse_ilist(molt->ilist, &molt->atoms,
-                               vsite_pbc_molt ? vsite_pbc_molt[mt] : NULL,
+                               vsite_pbc_molt ? vsite_pbc_molt[mt] : nullptr,
                                rt->bConstr, rt->bSettle, rt->bBCheck, FALSE,
                                &rt->ril_mt[mt]);
 
@@ -712,15 +716,15 @@ static gmx_reverse_top_t *make_reverse_top(const gmx_mtop_t *mtop, gmx_bool bFE,
     {
         t_atoms atoms_global;
 
-        rt->ril_intermol.index = NULL;
-        rt->ril_intermol.il    = NULL;
+        rt->ril_intermol.index = nullptr;
+        rt->ril_intermol.il    = nullptr;
 
         atoms_global.nr   = mtop->natoms;
-        atoms_global.atom = NULL; /* Only used with virtual sites */
+        atoms_global.atom = nullptr; /* Only used with virtual sites */
 
         *nint +=
             make_reverse_ilist(mtop->intermolecular_ilist, &atoms_global,
-                               NULL,
+                               nullptr,
                                rt->bConstr, rt->bSettle, rt->bBCheck, FALSE,
                                &rt->ril_intermol);
     }
@@ -749,7 +753,7 @@ static gmx_reverse_top_t *make_reverse_top(const gmx_mtop_t *mtop, gmx_bool bFE,
 
     rt->nthread = gmx_omp_nthreads_get(emntDomdec);
     snew(rt->th_work, rt->nthread);
-    if (vsite_pbc_molt != NULL)
+    if (vsite_pbc_molt != nullptr)
     {
         for (thread = 0; thread < rt->nthread; thread++)
         {
@@ -778,7 +782,7 @@ void dd_make_reverse_top(FILE *fplog,
      */
 
     dd->reverse_top = make_reverse_top(mtop, ir->efep != efepNO,
-                                       vsite ? vsite->vsite_pbc_molt : NULL,
+                                       vsite ? vsite->vsite_pbc_molt : nullptr,
                                        !dd->bInterCGcons, !dd->bInterCGsettles,
                                        bBCheck, &dd->nbonded_global);
 
@@ -1223,7 +1227,7 @@ static void combine_idef(t_idef *dest, const thread_work_t *src, int nsrc,
             int      nral1 = 0, ftv = 0;
 
             vpbc = ((interaction_function[ftype].flags & IF_VSITE) &&
-                    vsite->vsite_pbc_loc != NULL);
+                    vsite->vsite_pbc_loc != nullptr);
             if (vpbc)
             {
                 nral1 = 1 + NRAL(ftype);
@@ -2021,8 +2025,8 @@ static int make_local_bondeds_excls(gmx_domdec_t *dd,
                 }
                 else
                 {
-                    vsite_pbc        = NULL;
-                    vsite_pbc_nalloc = NULL;
+                    vsite_pbc        = nullptr;
+                    vsite_pbc_nalloc = nullptr;
                 }
 
                 rt->th_work[thread].nbonded =
@@ -2133,7 +2137,7 @@ void dd_make_local_top(gmx_domdec_t *dd, gmx_domdec_zones_t *zones,
     real     rc = -1;
     ivec     rcheck;
     int      d, nexcl;
-    t_pbc    pbc, *pbc_null = NULL;
+    t_pbc    pbc, *pbc_null = nullptr;
 
     if (debug)
     {
@@ -2191,7 +2195,7 @@ void dd_make_local_top(gmx_domdec_t *dd, gmx_domdec_zones_t *zones,
             }
             else
             {
-                pbc_null = NULL;
+                pbc_null = nullptr;
             }
         }
     }
@@ -2246,7 +2250,7 @@ gmx_localtop_t *dd_init_local_top(const gmx_mtop_t *top_global)
 
     for (i = 0; i < F_NRE; i++)
     {
-        top->idef.il[i].iatoms = NULL;
+        top->idef.il[i].iatoms = nullptr;
         top->idef.il[i].nalloc = 0;
     }
     top->idef.ilsort   = ilsortUNKNOWN;
@@ -2265,11 +2269,12 @@ void dd_init_local_state(gmx_domdec_t *dd,
         buf[1] = state_global->ngtc;
         buf[2] = state_global->nnhpres;
         buf[3] = state_global->nhchainlength;
-        buf[4] = state_global->dfhist.nlambda;
+        buf[4] = state_global->dfhist ? state_global->dfhist->nlambda : 0;
     }
     dd_bcast(dd, NITEM_DD_INIT_LOCAL_STATE*sizeof(int), buf);
 
-    init_state(state_local, 0, buf[1], buf[2], buf[3], buf[4]);
+    init_gtc_state(state_local, buf[1], buf[2], buf[3]);
+    init_dfhist_state(state_local, buf[4]);
     state_local->flags = buf[0];
 }
 
@@ -2351,16 +2356,16 @@ t_blocka *make_charge_group_links(const gmx_mtop_t *mtop, gmx_domdec_t *dd,
         t_atoms atoms;
 
         atoms.nr   = mtop->natoms;
-        atoms.atom = NULL;
+        atoms.atom = nullptr;
 
         make_reverse_ilist(mtop->intermolecular_ilist, &atoms,
-                           NULL, FALSE, FALSE, FALSE, TRUE, &ril_intermol);
+                           nullptr, FALSE, FALSE, FALSE, TRUE, &ril_intermol);
     }
 
     snew(link, 1);
     snew(link->index, ncg_mtop(mtop)+1);
     link->nalloc_a = 0;
-    link->a        = NULL;
+    link->a        = nullptr;
 
     link->index[0] = 0;
     cg_offset      = 0;
@@ -2381,7 +2386,7 @@ t_blocka *make_charge_group_links(const gmx_mtop_t *mtop, gmx_domdec_t *dd,
          * The constraints are discarded here.
          */
         make_reverse_ilist(molt->ilist, &molt->atoms,
-                           NULL, FALSE, FALSE, FALSE, TRUE, &ril);
+                           nullptr, FALSE, FALSE, FALSE, TRUE, &ril);
 
         cgi_mb = &cginfo_mb[mb];
 
@@ -2641,7 +2646,7 @@ static void get_cgcm_mol(const gmx_moltype_t *molt,
 
     if (ePBC != epbcNONE)
     {
-        mk_mshift(NULL, graph, ePBC, box, x);
+        mk_mshift(nullptr, graph, ePBC, box, x);
 
         shift_x(graph, box, x, xs);
         /* By doing an extra mk_mshift the molecules that are broken
@@ -2649,7 +2654,7 @@ static void get_cgcm_mol(const gmx_moltype_t *molt,
          * will be made whole again. Such are the healing powers
          * of GROMACS.
          */
-        mk_mshift(NULL, graph, ePBC, box, xs);
+        mk_mshift(nullptr, graph, ePBC, box, xs);
     }
     else
     {
@@ -2666,12 +2671,12 @@ static void get_cgcm_mol(const gmx_moltype_t *molt,
 
     if (vsite)
     {
-        construct_vsites(vsite, xs, 0.0, NULL,
+        construct_vsites(vsite, xs, 0.0, nullptr,
                          ffparams->iparams, molt->ilist,
-                         epbcNONE, TRUE, NULL, NULL);
+                         epbcNONE, TRUE, nullptr, nullptr);
     }
 
-    calc_cgcm(NULL, 0, molt->cgs.nr, &molt->cgs, xs, cg_cm);
+    calc_cgcm(nullptr, 0, molt->cgs.nr, &molt->cgs, xs, cg_cm);
 }
 
 //! Returns whether \p molt has a virtual site
@@ -2712,7 +2717,7 @@ void dd_bonded_cg_distance(FILE *fplog,
 
     bExclRequired = inputrecExclForces(ir);
 
-    vsite = init_vsite(mtop, NULL, TRUE);
+    vsite = init_vsite(mtop, nullptr, TRUE);
 
     *r_2b     = 0;
     *r_mb     = 0;
@@ -2729,7 +2734,7 @@ void dd_bonded_cg_distance(FILE *fplog,
         {
             if (ir->ePBC != epbcNONE)
             {
-                mk_graph_ilist(NULL, molt->ilist, 0, molt->atoms.nr, FALSE, FALSE,
+                mk_graph_ilist(nullptr, molt->ilist, 0, molt->atoms.nr, FALSE, FALSE,
                                &graph);
             }
 
@@ -2739,7 +2744,7 @@ void dd_bonded_cg_distance(FILE *fplog,
             for (mol = 0; mol < molb->nmol; mol++)
             {
                 get_cgcm_mol(molt, &mtop->ffparams, ir->ePBC, &graph, box,
-                             have_vsite_molt(molt) ? vsite : NULL,
+                             have_vsite_molt(molt) ? vsite : nullptr,
                              x+at_offset, xs, cg_cm);
 
                 bonded_distance_t bd_mol_2b = { 0, -1, -1, -1 };
index d9848505351dec80dd19960b097f3ecfa0c667ca..512b94e5ed8128db49884fc0dbae082394999c5a 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, by the GROMACS development team, led by
+ * Copyright (c) 2006,2007,2008,2009,2010,2012,2013,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.
@@ -56,6 +56,7 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/pbcutil/ishift.h"
+#include "gromacs/topology/ifunc.h"
 #include "gromacs/topology/mtop_util.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxassert.h"
@@ -89,7 +90,7 @@ void dd_move_x_vsites(gmx_domdec_t *dd, matrix box, rvec *x)
 {
     if (dd->vsite_comm)
     {
-        dd_move_x_specat(dd, dd->vsite_comm, box, x, NULL, FALSE);
+        dd_move_x_specat(dd, dd->vsite_comm, box, x, nullptr, FALSE);
     }
 }
 
index 424c115cf37ade84309b6a3d559e41171ed66e25..f8faac4d34f7a43617c2b73d07e4780bb7e8a3f2 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, by the GROMACS development team, led by
+ * 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.
@@ -108,7 +108,7 @@ static void ga2la_clear(gmx_ga2la_t *ga2la)
  * \param[in] natoms_local  An estimate of the number of home+communicated atoms
  * \return a pointer to an initialized gmx_ga2la_t struct
  */
-static gmx_ga2la_t *ga2la_init(int natoms_total, int natoms_local)
+static inline gmx_ga2la_t *ga2la_init(int natoms_total, int natoms_local)
 {
     gmx_ga2la_t *ga2la;
 
@@ -160,7 +160,7 @@ static gmx_ga2la_t *ga2la_init(int natoms_total, int natoms_local)
  * \param[in]     a_loc The local atom index
  * \param[in]     cell  The cell index
  */
-static void ga2la_set(gmx_ga2la_t *ga2la, int a_gl, int a_loc, int cell)
+static inline void ga2la_set(gmx_ga2la_t *ga2la, int a_gl, int a_loc, int cell)
 {
     int ind, ind_prev, i;
 
@@ -213,7 +213,7 @@ static void ga2la_set(gmx_ga2la_t *ga2la, int a_gl, int a_loc, int cell)
  * \param[in,out] ga2la The global to local atom struct
  * \param[in]     a_gl  The global atom index
  */
-static void ga2la_del(gmx_ga2la_t *ga2la, int a_gl)
+static inline void ga2la_del(gmx_ga2la_t *ga2la, int a_gl)
 {
     int ind, ind_prev;
 
@@ -262,7 +262,7 @@ static void ga2la_del(gmx_ga2la_t *ga2la, int a_gl)
  * \param[in]     a_gl  The global atom index
  * \param[in]     a_loc The new local atom index
  */
-static void ga2la_change_la(gmx_ga2la_t *ga2la, int a_gl, int a_loc)
+static inline void ga2la_change_la(gmx_ga2la_t *ga2la, int a_gl, int a_loc)
 {
     int ind;
 
@@ -297,7 +297,7 @@ static void ga2la_change_la(gmx_ga2la_t *ga2la, int a_gl, int a_loc)
  * \param[out] cell  If the return value is TRUE, the zone or for atoms more than one cell away zone+nzone
  * \return if the global atom a_gl available locally
  */
-static gmx_bool ga2la_get(const gmx_ga2la_t *ga2la, int a_gl, int *a_loc, int *cell)
+static inline gmx_bool ga2la_get(const gmx_ga2la_t *ga2la, int a_gl, int *a_loc, int *cell)
 {
     int ind;
 
@@ -333,7 +333,7 @@ static gmx_bool ga2la_get(const gmx_ga2la_t *ga2la, int a_gl, int *a_loc, int *c
  * \param[out] a_loc If the return value is TRUE, the local atom index
  * \return if the global atom a_gl is a home atom
  */
-static gmx_bool ga2la_get_home(const gmx_ga2la_t *ga2la, int a_gl, int *a_loc)
+static inline gmx_bool ga2la_get_home(const gmx_ga2la_t *ga2la, int a_gl, int *a_loc)
 {
     int ind;
 
@@ -373,7 +373,7 @@ static gmx_bool ga2la_get_home(const gmx_ga2la_t *ga2la, int a_gl, int *a_loc)
  * \param[in]  a_gl  The global atom index
  * \return if the global atom a_gl is a home atom
  */
-static gmx_bool ga2la_is_home(const gmx_ga2la_t *ga2la, int a_gl)
+static inline gmx_bool ga2la_is_home(const gmx_ga2la_t *ga2la, int a_gl)
 {
     int ind;
 
index 9aa0b2c54c9b5c210df1ab2bcf44f10fb6974725..3d3b8f15f839a4d93cda5df50af69c42a202382d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * 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.
@@ -124,7 +124,7 @@ static void gmx_hash_realloc(gmx_hash_t *hash, int nkey_used_estimate)
     hash->nalloc = over_alloc_dd(hash->mod);
     srenew(hash->hash, hash->nalloc);
 
-    if (debug != NULL)
+    if (debug != nullptr)
     {
         fprintf(debug, "Hash table mod %d nalloc %d\n", hash->mod, hash->nalloc);
     }
@@ -135,13 +135,13 @@ static void gmx_hash_realloc(gmx_hash_t *hash, int nkey_used_estimate)
  * With the current number of keys check if the table size is still
  * good, if not optimize it with the current number of keys.
  */
-static void gmx_hash_clear_and_optimize(gmx_hash_t *hash)
+static inline void gmx_hash_clear_and_optimize(gmx_hash_t *hash)
 {
     /* Resize the hash table when the occupation is < 1/4 or > 2/3 */
     if (hash->nkey > 0 &&
         (4*hash->nkey < hash->mod || 3*hash->nkey > 2*hash->mod))
     {
-        if (debug != NULL)
+        if (debug != nullptr)
         {
             fprintf(debug, "Hash table size %d #key %d: resizing\n",
                     hash->mod, hash->nkey);
@@ -153,12 +153,12 @@ static void gmx_hash_clear_and_optimize(gmx_hash_t *hash)
 }
 
 //! Initialize hash table.
-static gmx_hash_t *gmx_hash_init(int nkey_used_estimate)
+static inline gmx_hash_t *gmx_hash_init(int nkey_used_estimate)
 {
     gmx_hash_t *hash;
 
     snew(hash, 1);
-    hash->hash = NULL;
+    hash->hash = nullptr;
 
     gmx_hash_realloc(hash, nkey_used_estimate);
 
@@ -210,7 +210,7 @@ static void gmx_hash_set(gmx_hash_t *hash, int key, int value)
 }
 
 //! Delete the hash entry for key.
-static void gmx_hash_del(gmx_hash_t *hash, int key)
+static inline void gmx_hash_del(gmx_hash_t *hash, int key)
 {
     int ind, ind_prev;
 
@@ -249,7 +249,7 @@ static void gmx_hash_del(gmx_hash_t *hash, int key)
 }
 
 //! Change the value for present hash entry for key.
-static void gmx_hash_change_value(gmx_hash_t *hash, int key, int value)
+static inline void gmx_hash_change_value(gmx_hash_t *hash, int key, int value)
 {
     int ind;
 
@@ -270,7 +270,7 @@ static void gmx_hash_change_value(gmx_hash_t *hash, int key, int value)
 }
 
 //! Change the hash value if already set, otherwise set the hash value.
-static void gmx_hash_change_or_set(gmx_hash_t *hash, int key, int value)
+static inline void gmx_hash_change_or_set(gmx_hash_t *hash, int key, int value)
 {
     int ind;
 
@@ -293,7 +293,7 @@ static void gmx_hash_change_or_set(gmx_hash_t *hash, int key, int value)
 }
 
 //! Returns if the key is present, if the key is present *value is set.
-static gmx_bool gmx_hash_get(const gmx_hash_t *hash, int key, int *value)
+static inline gmx_bool gmx_hash_get(const gmx_hash_t *hash, int key, int *value)
 {
     int ind;
 
diff --git a/src/gromacs/energyanalysis/CMakeLists.txt b/src/gromacs/energyanalysis/CMakeLists.txt
new file mode 100644 (file)
index 0000000..16d0fa0
--- /dev/null
@@ -0,0 +1,37 @@
+#
+# 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.
+
+if (BUILD_TESTING)
+    add_subdirectory(tests)
+endif()
diff --git a/src/gromacs/energyanalysis/tests/CMakeLists.txt b/src/gromacs/energyanalysis/tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..5665a35
--- /dev/null
@@ -0,0 +1,37 @@
+#
+# 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.
+
+gmx_add_unit_test(EnergyAnalysisUnitTests energyanalysis-test
+        legacyenergy.cpp
+)
diff --git a/src/gromacs/energyanalysis/tests/dhdl.edr b/src/gromacs/energyanalysis/tests/dhdl.edr
new file mode 100644 (file)
index 0000000..e70053f
Binary files /dev/null and b/src/gromacs/energyanalysis/tests/dhdl.edr differ
diff --git a/src/gromacs/energyanalysis/tests/dhdl.tpr b/src/gromacs/energyanalysis/tests/dhdl.tpr
new file mode 100644 (file)
index 0000000..8084b18
Binary files /dev/null and b/src/gromacs/energyanalysis/tests/dhdl.tpr differ
diff --git a/src/gromacs/energyanalysis/tests/ener.edr b/src/gromacs/energyanalysis/tests/ener.edr
new file mode 100644 (file)
index 0000000..987f81a
Binary files /dev/null and b/src/gromacs/energyanalysis/tests/ener.edr differ
diff --git a/src/gromacs/energyanalysis/tests/legacyenergy.cpp b/src/gromacs/energyanalysis/tests/legacyenergy.cpp
new file mode 100644 (file)
index 0000000..d64d706
--- /dev/null
@@ -0,0 +1,203 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Tests for gmx energy
+ *
+ * \todo These will be superseded by tests of the energyanalysis
+ * modules.
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ */
+
+#include "gmxpre.h"
+
+#include <cstring>
+
+#include <string>
+
+#include "gromacs/gmxana/gmx_ana.h"
+
+#include "testutils/cmdlinetest.h"
+#include "testutils/stdiohelper.h"
+#include "testutils/testasserts.h"
+#include "testutils/textblockmatchers.h"
+#include "testutils/xvgtest.h"
+
+namespace gmx
+{
+namespace test
+{
+namespace
+{
+
+class DhdlTest : public CommandLineTestBase
+{
+    public:
+        void runTest()
+        {
+            auto &cmdline = commandLine();
+            cmdline.append("energy");
+
+            setInputFile("-s", "dhdl.tpr");
+            setInputFile("-f", "dhdl.edr");
+            setOutputFile("-odh", "dhdl.xvg", XvgMatch());
+
+            ASSERT_EQ(0, gmx_energy(cmdline.argc(), cmdline.argv()));
+
+            checkOutputFiles();
+        }
+};
+
+TEST_F(DhdlTest, ExtractDhdl)
+{
+    runTest();
+}
+
+class OriresTest : public CommandLineTestBase
+{
+    public:
+        void runTest(const char *stringForStdin)
+        {
+            auto &cmdline = commandLine();
+            cmdline.append("energy");
+
+            setInputFile("-s", "orires.tpr");
+            setInputFile("-f", "orires.edr");
+            test::XvgMatch    xvg;
+            test::XvgMatch   &toler     = xvg.tolerance(gmx::test::relativeToleranceAsFloatingPoint(1, 1e-4));
+
+            setOutputFile("-oten", ".xvg", toler);
+            setOutputFile("-ora", ".xvg", toler);
+            setOutputFile("-ort", ".xvg", toler);
+            setOutputFile("-oda", ".xvg", toler);
+            setOutputFile("-odr", ".xvg", toler);
+
+            StdioTestHelper stdioHelper(&fileManager());
+            stdioHelper.redirectStringToStdin(stringForStdin);
+            ASSERT_EQ(0, gmx_energy(cmdline.argc(), cmdline.argv()));
+
+            checkOutputFiles();
+        }
+};
+
+TEST_F(OriresTest, ExtractOrires)
+{
+    runTest("Orient.-Rest.\nOri.-R.-RMSD\n0\n-1\n");
+}
+
+class EnergyTest : public CommandLineTestBase
+{
+    public:
+        void runTest(const char *stringForStdin)
+        {
+            auto &cmdline = commandLine();
+            cmdline.append("energy");
+
+            setInputFile("-f", "ener.edr");
+            setOutputFile("-o", "energy.xvg", XvgMatch());
+
+            StdioTestHelper stdioHelper(&fileManager());
+            stdioHelper.redirectStringToStdin(stringForStdin);
+            ASSERT_EQ(0, gmx_energy(cmdline.argc(), cmdline.argv()));
+
+            checkOutputFiles();
+        }
+};
+
+TEST_F(EnergyTest, ExtractEnergy)
+{
+    runTest("Potential\nKinetic-En.\nTotal-Energy\n");
+}
+
+TEST_F(EnergyTest, ExtractEnergyByNumber)
+{
+    runTest("4 6 9");
+}
+
+TEST_F(EnergyTest, ExtractEnergyMixed)
+{
+    runTest("Pressu\n7\nbox-z\nvol\n");
+}
+
+class ViscosityTest : public CommandLineTestBase
+{
+    public:
+        void runTest()
+        {
+            auto &cmdline = commandLine();
+            setInputFile("-f", "ener.edr");
+            setOutputFile("-vis", "visco.xvg", NoTextMatch());
+            setOutputFile("-o", "energy.xvg", NoTextMatch());
+
+            /* -vis can write a lot of non-conditional output files,
+                so we use temporary paths to clean up files that are
+                not the ones being tested in this test */
+            if (!cmdline.contains("-evisco"))
+            {
+                setOutputFile("-evisco", "evisco.xvg", NoTextMatch());
+            }
+            if (!cmdline.contains("-eviscoi"))
+            {
+                setOutputFile("-eviscoi", "eviscoi.xvg", NoTextMatch());
+            }
+            if (!cmdline.contains("-corr"))
+            {
+                setOutputFile("-corr", "corr.xvg", NoTextMatch());
+            }
+
+            ASSERT_EQ(0, gmx_energy(cmdline.argc(), cmdline.argv()));
+
+            checkOutputFiles();
+        }
+};
+
+TEST_F(ViscosityTest, EinsteinViscosity)
+{
+    auto tolerance = relativeToleranceAsFloatingPoint(1e-4, 1e-5);
+    setOutputFile("-evisco", "evisco.xvg", XvgMatch().tolerance(tolerance));
+    runTest();
+}
+
+TEST_F(ViscosityTest, EinsteinViscosityIntegral)
+{
+    auto tolerance = relativeToleranceAsFloatingPoint(1e-4, 1e-5);
+    setOutputFile("-eviscoi", "eviscoi.xvg", XvgMatch().tolerance(tolerance));
+    runTest();
+}
+
+} // namespace
+} // namespace test
+} // namespace gmx
diff --git a/src/gromacs/energyanalysis/tests/orires.edr b/src/gromacs/energyanalysis/tests/orires.edr
new file mode 100644 (file)
index 0000000..5517334
Binary files /dev/null and b/src/gromacs/energyanalysis/tests/orires.edr differ
diff --git a/src/gromacs/energyanalysis/tests/orires.tpr b/src/gromacs/energyanalysis/tests/orires.tpr
new file mode 100644 (file)
index 0000000..b8fa860
Binary files /dev/null and b/src/gromacs/energyanalysis/tests/orires.tpr differ
diff --git a/src/gromacs/energyanalysis/tests/refdata/DhdlTest_ExtractDhdl.xml b/src/gromacs/energyanalysis/tests/refdata/DhdlTest_ExtractDhdl.xml
new file mode 100644 (file)
index 0000000..f75bef2
--- /dev/null
@@ -0,0 +1,1239 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <OutputFiles Name="Files">
+    <File Name="-odh">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "dH/d\xl\f{} and \xD\f{}H"
+xaxis  label "Time (ps)"
+yaxis  label "dH/d\xl\f{} and \xD\f{}H (kJ/mol [\xl\f{}]\S-1\N)"
+TYPE xy
+subtitle "T = 300 (K) \xl\f{} state 0: (mass-lambda, coul-lambda, vdw-lambda, bonded-lambda, restraint-lambda) = (0.0000, 0.0000, 0.0000, 0.0000, 0.0000)"
+s0 legend "Total Energy (kJ/mol)"
+s1 legend "dH/d\xl\f{} mass-lambda = 0.0000"
+s2 legend "dH/d\xl\f{} coul-lambda = 0.0000"
+s3 legend "dH/d\xl\f{} vdw-lambda = 0.0000"
+s4 legend "dH/d\xl\f{} bonded-lambda = 0.0000"
+s5 legend "dH/d\xl\f{} restraint-lambda = 0.0000"
+s6 legend "\xD\f{}H \xl\f{} to (0.0000, 0.0000, 0.0000, 0.0000, 0.0000)"
+s7 legend "\xD\f{}H \xl\f{} to (0.0000, 0.0000, 0.0500, 0.0000, 0.0000)"
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">9</Int>
+          <Real>0.0000</Real>
+          <Real>18390.227</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-196.12737</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-13.036427</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">9</Int>
+          <Real>0.0100</Real>
+          <Real>21152.699</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-35.961620</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-2.2861712</Real>
+        </Sequence>
+        <Sequence Name="Row2">
+          <Int Name="Length">9</Int>
+          <Real>0.0200</Real>
+          <Real>21066.111</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>1.7135231</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.017940877</Real>
+        </Sequence>
+        <Sequence Name="Row3">
+          <Int Name="Length">9</Int>
+          <Real>0.0300</Real>
+          <Real>19459.748</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>7.3273606</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.29574844</Real>
+        </Sequence>
+        <Sequence Name="Row4">
+          <Int Name="Length">9</Int>
+          <Real>0.0400</Real>
+          <Real>19005.387</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>6.0574341</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.22905751</Real>
+        </Sequence>
+        <Sequence Name="Row5">
+          <Int Name="Length">9</Int>
+          <Real>0.0500</Real>
+          <Real>18289.822</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>5.3447599</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.19143827</Real>
+        </Sequence>
+        <Sequence Name="Row6">
+          <Int Name="Length">9</Int>
+          <Real>0.0600</Real>
+          <Real>17736.605</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-11.790483</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.82747537</Real>
+        </Sequence>
+        <Sequence Name="Row7">
+          <Int Name="Length">9</Int>
+          <Real>0.0700</Real>
+          <Real>17300.516</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-54.836746</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-3.6717050</Real>
+        </Sequence>
+        <Sequence Name="Row8">
+          <Int Name="Length">9</Int>
+          <Real>0.0800</Real>
+          <Real>16784.359</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-34.148647</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-2.3589497</Real>
+        </Sequence>
+        <Sequence Name="Row9">
+          <Int Name="Length">9</Int>
+          <Real>0.0900</Real>
+          <Real>16278.450</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-9.2076368</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.69482511</Real>
+        </Sequence>
+        <Sequence Name="Row10">
+          <Int Name="Length">9</Int>
+          <Real>0.1000</Real>
+          <Real>15822.979</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-1.9046206</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.25472176</Real>
+        </Sequence>
+        <Sequence Name="Row11">
+          <Int Name="Length">9</Int>
+          <Real>0.1100</Real>
+          <Real>15291.021</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-14.417473</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.99669981</Real>
+        </Sequence>
+        <Sequence Name="Row12">
+          <Int Name="Length">9</Int>
+          <Real>0.1200</Real>
+          <Real>14932.876</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-5.5879068</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.46490976</Real>
+        </Sequence>
+        <Sequence Name="Row13">
+          <Int Name="Length">9</Int>
+          <Real>0.1300</Real>
+          <Real>14519.196</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-24.104668</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-1.6748879</Real>
+        </Sequence>
+        <Sequence Name="Row14">
+          <Int Name="Length">9</Int>
+          <Real>0.1400</Real>
+          <Real>14052.404</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>4.2050481</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.10811933</Real>
+        </Sequence>
+        <Sequence Name="Row15">
+          <Int Name="Length">9</Int>
+          <Real>0.1500</Real>
+          <Real>13574.979</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>12.654684</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.59728938</Real>
+        </Sequence>
+        <Sequence Name="Row16">
+          <Int Name="Length">9</Int>
+          <Real>0.1600</Real>
+          <Real>13158.244</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>9.8413372</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.43559965</Real>
+        </Sequence>
+        <Sequence Name="Row17">
+          <Int Name="Length">9</Int>
+          <Real>0.1700</Real>
+          <Real>12742.010</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>8.8647861</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.37434009</Real>
+        </Sequence>
+        <Sequence Name="Row18">
+          <Int Name="Length">9</Int>
+          <Real>0.1800</Real>
+          <Real>12412.632</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-12.401940</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.94610727</Real>
+        </Sequence>
+        <Sequence Name="Row19">
+          <Int Name="Length">9</Int>
+          <Real>0.1900</Real>
+          <Real>12025.834</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-15.554813</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-1.0771699</Real>
+        </Sequence>
+        <Sequence Name="Row20">
+          <Int Name="Length">9</Int>
+          <Real>0.2000</Real>
+          <Real>11668.844</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-13.853206</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.94716883</Real>
+        </Sequence>
+        <Sequence Name="Row21">
+          <Int Name="Length">9</Int>
+          <Real>0.2100</Real>
+          <Real>11284.039</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-20.998755</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-1.4247464</Real>
+        </Sequence>
+        <Sequence Name="Row22">
+          <Int Name="Length">9</Int>
+          <Real>0.2200</Real>
+          <Real>10911.894</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-14.923985</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-1.0453514</Real>
+        </Sequence>
+        <Sequence Name="Row23">
+          <Int Name="Length">9</Int>
+          <Real>0.2300</Real>
+          <Real>10566.955</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-19.922283</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-1.4520115</Real>
+        </Sequence>
+        <Sequence Name="Row24">
+          <Int Name="Length">9</Int>
+          <Real>0.2400</Real>
+          <Real>10231.230</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>4.7994976</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.14404032</Real>
+        </Sequence>
+        <Sequence Name="Row25">
+          <Int Name="Length">9</Int>
+          <Real>0.2500</Real>
+          <Real>9968.4209</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>9.7707586</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.43524343</Real>
+        </Sequence>
+        <Sequence Name="Row26">
+          <Int Name="Length">9</Int>
+          <Real>0.2600</Real>
+          <Real>9683.9785</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>5.5255494</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.18996415</Real>
+        </Sequence>
+        <Sequence Name="Row27">
+          <Int Name="Length">9</Int>
+          <Real>0.2700</Real>
+          <Real>9378.0811</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>1.7950813</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.017419390</Real>
+        </Sequence>
+        <Sequence Name="Row28">
+          <Int Name="Length">9</Int>
+          <Real>0.2800</Real>
+          <Real>9007.4697</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-12.662108</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.87385261</Real>
+        </Sequence>
+        <Sequence Name="Row29">
+          <Int Name="Length">9</Int>
+          <Real>0.2900</Real>
+          <Real>8753.9697</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-1.3624085</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.18725003</Real>
+        </Sequence>
+        <Sequence Name="Row30">
+          <Int Name="Length">9</Int>
+          <Real>0.3000</Real>
+          <Real>8465.7949</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>1.3957028</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.027882095</Real>
+        </Sequence>
+        <Sequence Name="Row31">
+          <Int Name="Length">9</Int>
+          <Real>0.3100</Real>
+          <Real>8127.0200</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>3.6105075</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.086347379</Real>
+        </Sequence>
+        <Sequence Name="Row32">
+          <Int Name="Length">9</Int>
+          <Real>0.3200</Real>
+          <Real>7764.1157</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>11.106931</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.52358508</Real>
+        </Sequence>
+        <Sequence Name="Row33">
+          <Int Name="Length">9</Int>
+          <Real>0.3300</Real>
+          <Real>7480.6064</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>12.847497</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.62090510</Real>
+        </Sequence>
+        <Sequence Name="Row34">
+          <Int Name="Length">9</Int>
+          <Real>0.3400</Real>
+          <Real>7215.4707</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>12.040525</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.57890755</Real>
+        </Sequence>
+        <Sequence Name="Row35">
+          <Int Name="Length">9</Int>
+          <Real>0.3500</Real>
+          <Real>6892.3647</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>13.036567</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.63370013</Real>
+        </Sequence>
+        <Sequence Name="Row36">
+          <Int Name="Length">9</Int>
+          <Real>0.3600</Real>
+          <Real>6565.7085</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>10.898385</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.50941873</Real>
+        </Sequence>
+        <Sequence Name="Row37">
+          <Int Name="Length">9</Int>
+          <Real>0.3700</Real>
+          <Real>6260.1587</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>12.076806</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.57912481</Real>
+        </Sequence>
+        <Sequence Name="Row38">
+          <Int Name="Length">9</Int>
+          <Real>0.3800</Real>
+          <Real>6047.1582</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>14.722479</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.73049068</Real>
+        </Sequence>
+        <Sequence Name="Row39">
+          <Int Name="Length">9</Int>
+          <Real>0.3900</Real>
+          <Real>5769.3306</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>15.253819</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.76127720</Real>
+        </Sequence>
+        <Sequence Name="Row40">
+          <Int Name="Length">9</Int>
+          <Real>0.4000</Real>
+          <Real>5491.2158</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>15.621739</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.78124112</Real>
+        </Sequence>
+        <Sequence Name="Row41">
+          <Int Name="Length">9</Int>
+          <Real>0.4100</Real>
+          <Real>5239.2842</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>15.019732</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.74851453</Real>
+        </Sequence>
+        <Sequence Name="Row42">
+          <Int Name="Length">9</Int>
+          <Real>0.4200</Real>
+          <Real>4955.2236</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>12.970184</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.63469940</Real>
+        </Sequence>
+        <Sequence Name="Row43">
+          <Int Name="Length">9</Int>
+          <Real>0.4300</Real>
+          <Real>4695.3511</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>7.2544327</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.31172675</Real>
+        </Sequence>
+        <Sequence Name="Row44">
+          <Int Name="Length">9</Int>
+          <Real>0.4400</Real>
+          <Real>4476.2344</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>2.5105438</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.018204786</Real>
+        </Sequence>
+        <Sequence Name="Row45">
+          <Int Name="Length">9</Int>
+          <Real>0.4500</Real>
+          <Real>4234.5391</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>2.1897080</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.021179220</Real>
+        </Sequence>
+        <Sequence Name="Row46">
+          <Int Name="Length">9</Int>
+          <Real>0.4600</Real>
+          <Real>3972.7383</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>2.5433095</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.036578804</Real>
+        </Sequence>
+        <Sequence Name="Row47">
+          <Int Name="Length">9</Int>
+          <Real>0.4700</Real>
+          <Real>3675.9219</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>4.9355130</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.18048137</Real>
+        </Sequence>
+        <Sequence Name="Row48">
+          <Int Name="Length">9</Int>
+          <Real>0.4800</Real>
+          <Real>3402.2808</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>4.8340473</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.17349699</Real>
+        </Sequence>
+        <Sequence Name="Row49">
+          <Int Name="Length">9</Int>
+          <Real>0.4900</Real>
+          <Real>3210.3071</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>8.0225458</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.34982723</Real>
+        </Sequence>
+        <Sequence Name="Row50">
+          <Int Name="Length">9</Int>
+          <Real>0.5000</Real>
+          <Real>2963.7800</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>11.747848</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.56046647</Real>
+        </Sequence>
+        <Sequence Name="Row51">
+          <Int Name="Length">9</Int>
+          <Real>0.5100</Real>
+          <Real>2837.0615</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>1.7925872</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.018638892</Real>
+        </Sequence>
+        <Sequence Name="Row52">
+          <Int Name="Length">9</Int>
+          <Real>0.5200</Real>
+          <Real>2599.4478</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-10.107281</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.77151293</Real>
+        </Sequence>
+        <Sequence Name="Row53">
+          <Int Name="Length">9</Int>
+          <Real>0.5300</Real>
+          <Real>2392.7219</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-3.8234668</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.39228624</Real>
+        </Sequence>
+        <Sequence Name="Row54">
+          <Int Name="Length">9</Int>
+          <Real>0.5400</Real>
+          <Real>2141.3977</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>4.9235377</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.16121981</Real>
+        </Sequence>
+        <Sequence Name="Row55">
+          <Int Name="Length">9</Int>
+          <Real>0.5500</Real>
+          <Real>1894.3961</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>5.7242775</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.20739347</Real>
+        </Sequence>
+        <Sequence Name="Row56">
+          <Int Name="Length">9</Int>
+          <Real>0.5600</Real>
+          <Real>1650.1195</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>3.1604090</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.065963924</Real>
+        </Sequence>
+        <Sequence Name="Row57">
+          <Int Name="Length">9</Int>
+          <Real>0.5700</Real>
+          <Real>1442.5604</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-21.118731</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-1.3982593</Real>
+        </Sequence>
+        <Sequence Name="Row58">
+          <Int Name="Length">9</Int>
+          <Real>0.5800</Real>
+          <Real>1154.2802</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-11.551435</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.80686474</Real>
+        </Sequence>
+        <Sequence Name="Row59">
+          <Int Name="Length">9</Int>
+          <Real>0.5900</Real>
+          <Real>977.92596</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-19.052465</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-1.2597023</Real>
+        </Sequence>
+        <Sequence Name="Row60">
+          <Int Name="Length">9</Int>
+          <Real>0.6000</Real>
+          <Real>739.69891</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.54290044</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.15558498</Real>
+        </Sequence>
+        <Sequence Name="Row61">
+          <Int Name="Length">9</Int>
+          <Real>0.6100</Real>
+          <Real>502.32535</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>2.3928659</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.021699622</Real>
+        </Sequence>
+        <Sequence Name="Row62">
+          <Int Name="Length">9</Int>
+          <Real>0.6200</Real>
+          <Real>332.78494</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>3.9483552</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.10301653</Real>
+        </Sequence>
+        <Sequence Name="Row63">
+          <Int Name="Length">9</Int>
+          <Real>0.6300</Real>
+          <Real>117.40592</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>2.4123704</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.020102538</Real>
+        </Sequence>
+        <Sequence Name="Row64">
+          <Int Name="Length">9</Int>
+          <Real>0.6400</Real>
+          <Real>-35.941978</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-4.7306657</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.39635584</Real>
+        </Sequence>
+        <Sequence Name="Row65">
+          <Int Name="Length">9</Int>
+          <Real>0.6500</Real>
+          <Real>-246.84441</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-2.7428317</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.26893592</Real>
+        </Sequence>
+        <Sequence Name="Row66">
+          <Int Name="Length">9</Int>
+          <Real>0.6600</Real>
+          <Real>-401.82376</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-5.7742028</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.45050329</Real>
+        </Sequence>
+        <Sequence Name="Row67">
+          <Int Name="Length">9</Int>
+          <Real>0.6700</Real>
+          <Real>-515.35016</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-7.4531288</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.57305795</Real>
+        </Sequence>
+        <Sequence Name="Row68">
+          <Int Name="Length">9</Int>
+          <Real>0.6800</Real>
+          <Real>-706.58044</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>1.6042513</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.023598678</Real>
+        </Sequence>
+        <Sequence Name="Row69">
+          <Int Name="Length">9</Int>
+          <Real>0.6900</Real>
+          <Real>-890.52930</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>5.2660694</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.17871600</Real>
+        </Sequence>
+        <Sequence Name="Row70">
+          <Int Name="Length">9</Int>
+          <Real>0.7000</Real>
+          <Real>-1076.5763</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>4.0205736</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.085871026</Real>
+        </Sequence>
+        <Sequence Name="Row71">
+          <Int Name="Length">9</Int>
+          <Real>0.7100</Real>
+          <Real>-1205.3600</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>10.127654</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.45515704</Real>
+        </Sequence>
+        <Sequence Name="Row72">
+          <Int Name="Length">9</Int>
+          <Real>0.7200</Real>
+          <Real>-1401.7433</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>10.694732</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.49325097</Real>
+        </Sequence>
+        <Sequence Name="Row73">
+          <Int Name="Length">9</Int>
+          <Real>0.7300</Real>
+          <Real>-1511.8746</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>13.002579</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.62048405</Real>
+        </Sequence>
+        <Sequence Name="Row74">
+          <Int Name="Length">9</Int>
+          <Real>0.7400</Real>
+          <Real>-1686.1857</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>12.355764</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.58085251</Real>
+        </Sequence>
+        <Sequence Name="Row75">
+          <Int Name="Length">9</Int>
+          <Real>0.7500</Real>
+          <Real>-1870.8121</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>11.427918</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.52940631</Real>
+        </Sequence>
+        <Sequence Name="Row76">
+          <Int Name="Length">9</Int>
+          <Real>0.7600</Real>
+          <Real>-2049.8137</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>13.941729</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.67407155</Real>
+        </Sequence>
+        <Sequence Name="Row77">
+          <Int Name="Length">9</Int>
+          <Real>0.7700</Real>
+          <Real>-2238.1753</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>13.486353</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.64925963</Real>
+        </Sequence>
+        <Sequence Name="Row78">
+          <Int Name="Length">9</Int>
+          <Real>0.7800</Real>
+          <Real>-2392.8804</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>12.826356</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.61224586</Real>
+        </Sequence>
+        <Sequence Name="Row79">
+          <Int Name="Length">9</Int>
+          <Real>0.7900</Real>
+          <Real>-2588.4917</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>8.2970324</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.34881678</Real>
+        </Sequence>
+        <Sequence Name="Row80">
+          <Int Name="Length">9</Int>
+          <Real>0.8000</Real>
+          <Real>-2757.0720</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>11.945762</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.56193101</Real>
+        </Sequence>
+        <Sequence Name="Row81">
+          <Int Name="Length">9</Int>
+          <Real>0.8100</Real>
+          <Real>-2903.7708</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>5.3924117</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.18367814</Real>
+        </Sequence>
+        <Sequence Name="Row82">
+          <Int Name="Length">9</Int>
+          <Real>0.8200</Real>
+          <Real>-3047.7859</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>11.101733</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.51431257</Real>
+        </Sequence>
+        <Sequence Name="Row83">
+          <Int Name="Length">9</Int>
+          <Real>0.8300</Real>
+          <Real>-3161.5854</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>9.6307545</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.42988670</Real>
+        </Sequence>
+        <Sequence Name="Row84">
+          <Int Name="Length">9</Int>
+          <Real>0.8400</Real>
+          <Real>-3379.0830</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>12.023994</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.56784922</Real>
+        </Sequence>
+        <Sequence Name="Row85">
+          <Int Name="Length">9</Int>
+          <Real>0.8500</Real>
+          <Real>-3558.4021</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>11.185745</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.52070016</Real>
+        </Sequence>
+        <Sequence Name="Row86">
+          <Int Name="Length">9</Int>
+          <Real>0.8600</Real>
+          <Real>-3652.6042</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>2.8762925</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.010642702</Real>
+        </Sequence>
+        <Sequence Name="Row87">
+          <Int Name="Length">9</Int>
+          <Real>0.8700</Real>
+          <Real>-3829.2700</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>3.7260182</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.071571045</Real>
+        </Sequence>
+        <Sequence Name="Row88">
+          <Int Name="Length">9</Int>
+          <Real>0.8800</Real>
+          <Real>-3955.3086</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>6.0863285</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.22653362</Real>
+        </Sequence>
+        <Sequence Name="Row89">
+          <Int Name="Length">9</Int>
+          <Real>0.8900</Real>
+          <Real>-4086.2063</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>3.3721447</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.083420321</Real>
+        </Sequence>
+        <Sequence Name="Row90">
+          <Int Name="Length">9</Int>
+          <Real>0.9000</Real>
+          <Real>-4189.3530</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>3.2029264</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.073568165</Real>
+        </Sequence>
+        <Sequence Name="Row91">
+          <Int Name="Length">9</Int>
+          <Real>0.9100</Real>
+          <Real>-4346.2114</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>2.5930278</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.038073756</Real>
+        </Sequence>
+        <Sequence Name="Row92">
+          <Int Name="Length">9</Int>
+          <Real>0.9200</Real>
+          <Real>-4513.3115</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>5.4292865</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.20921849</Real>
+        </Sequence>
+        <Sequence Name="Row93">
+          <Int Name="Length">9</Int>
+          <Real>0.9300</Real>
+          <Real>-4716.2129</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>2.2852771</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.030672517</Real>
+        </Sequence>
+        <Sequence Name="Row94">
+          <Int Name="Length">9</Int>
+          <Real>0.9400</Real>
+          <Real>-4813.1924</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-7.1204696</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.53045851</Real>
+        </Sequence>
+        <Sequence Name="Row95">
+          <Int Name="Length">9</Int>
+          <Real>0.9500</Real>
+          <Real>-4961.3779</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.63605487</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.14009029</Real>
+        </Sequence>
+        <Sequence Name="Row96">
+          <Int Name="Length">9</Int>
+          <Real>0.9600</Real>
+          <Real>-5113.8364</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>1.3637644</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.024320509</Real>
+        </Sequence>
+        <Sequence Name="Row97">
+          <Int Name="Length">9</Int>
+          <Real>0.9700</Real>
+          <Real>-5263.4927</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.24821608</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>-0.11575874</Real>
+        </Sequence>
+        <Sequence Name="Row98">
+          <Int Name="Length">9</Int>
+          <Real>0.9800</Real>
+          <Real>-5368.6714</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>2.0372019</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0095707709</Real>
+        </Sequence>
+        <Sequence Name="Row99">
+          <Int Name="Length">9</Int>
+          <Real>0.9900</Real>
+          <Real>-5487.4829</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>4.7544155</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.15978737</Real>
+        </Sequence>
+        <Sequence Name="Row100">
+          <Int Name="Length">9</Int>
+          <Real>1.0000</Real>
+          <Real>-5616.9009</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>2.7037058</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.0000000</Real>
+          <Real>0.044261467</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/energyanalysis/tests/refdata/EnergyTest_ExtractEnergy.xml b/src/gromacs/energyanalysis/tests/refdata/EnergyTest_ExtractEnergy.xml
new file mode 100644 (file)
index 0000000..7d47bed
--- /dev/null
@@ -0,0 +1,378 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <OutputFiles Name="Files">
+    <File Name="-o">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "GROMACS Energies"
+xaxis  label "Time (ps)"
+yaxis  label "(kJ/mol)"
+TYPE xy
+s0 legend "Potential"
+s1 legend "Kinetic En."
+s2 legend "Total Energy"
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">4</Int>
+          <Real>0.000000</Real>
+          <Real>-32102.556641</Real>
+          <Real>6147.870117</Real>
+          <Real>-25954.687500</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">4</Int>
+          <Real>0.200000</Real>
+          <Real>-34450.820312</Real>
+          <Real>5885.405273</Real>
+          <Real>-28565.414062</Real>
+        </Sequence>
+        <Sequence Name="Row2">
+          <Int Name="Length">4</Int>
+          <Real>0.400000</Real>
+          <Real>-33708.703125</Real>
+          <Real>6146.063477</Real>
+          <Real>-27562.640625</Real>
+        </Sequence>
+        <Sequence Name="Row3">
+          <Int Name="Length">4</Int>
+          <Real>0.600000</Real>
+          <Real>-33897.753906</Real>
+          <Real>6079.209473</Real>
+          <Real>-27818.544922</Real>
+        </Sequence>
+        <Sequence Name="Row4">
+          <Int Name="Length">4</Int>
+          <Real>0.800000</Real>
+          <Real>-33992.132812</Real>
+          <Real>6242.735352</Real>
+          <Real>-27749.398438</Real>
+        </Sequence>
+        <Sequence Name="Row5">
+          <Int Name="Length">4</Int>
+          <Real>1.000000</Real>
+          <Real>-34110.496094</Real>
+          <Real>6005.650391</Real>
+          <Real>-28104.845703</Real>
+        </Sequence>
+        <Sequence Name="Row6">
+          <Int Name="Length">4</Int>
+          <Real>1.200000</Real>
+          <Real>-34426.128906</Real>
+          <Real>6251.612305</Real>
+          <Real>-28174.515625</Real>
+        </Sequence>
+        <Sequence Name="Row7">
+          <Int Name="Length">4</Int>
+          <Real>1.400000</Real>
+          <Real>-33967.996094</Real>
+          <Real>6241.403809</Real>
+          <Real>-27726.591797</Real>
+        </Sequence>
+        <Sequence Name="Row8">
+          <Int Name="Length">4</Int>
+          <Real>1.600000</Real>
+          <Real>-34323.785156</Real>
+          <Real>6419.104492</Real>
+          <Real>-27904.679688</Real>
+        </Sequence>
+        <Sequence Name="Row9">
+          <Int Name="Length">4</Int>
+          <Real>1.800000</Real>
+          <Real>-34305.316406</Real>
+          <Real>6256.709473</Real>
+          <Real>-28048.607422</Real>
+        </Sequence>
+        <Sequence Name="Row10">
+          <Int Name="Length">4</Int>
+          <Real>2.000000</Real>
+          <Real>-34260.628906</Real>
+          <Real>6094.508301</Real>
+          <Real>-28166.121094</Real>
+        </Sequence>
+        <Sequence Name="Row11">
+          <Int Name="Length">4</Int>
+          <Real>2.200000</Real>
+          <Real>-34596.117188</Real>
+          <Real>6014.866699</Real>
+          <Real>-28581.250000</Real>
+        </Sequence>
+        <Sequence Name="Row12">
+          <Int Name="Length">4</Int>
+          <Real>2.400000</Real>
+          <Real>-34348.128906</Real>
+          <Real>6177.041016</Real>
+          <Real>-28171.087891</Real>
+        </Sequence>
+        <Sequence Name="Row13">
+          <Int Name="Length">4</Int>
+          <Real>2.600000</Real>
+          <Real>-33940.769531</Real>
+          <Real>5990.643066</Real>
+          <Real>-27950.126953</Real>
+        </Sequence>
+        <Sequence Name="Row14">
+          <Int Name="Length">4</Int>
+          <Real>2.800000</Real>
+          <Real>-34303.445312</Real>
+          <Real>6077.416992</Real>
+          <Real>-28226.027344</Real>
+        </Sequence>
+        <Sequence Name="Row15">
+          <Int Name="Length">4</Int>
+          <Real>3.000000</Real>
+          <Real>-34235.710938</Real>
+          <Real>6137.697754</Real>
+          <Real>-28098.013672</Real>
+        </Sequence>
+        <Sequence Name="Row16">
+          <Int Name="Length">4</Int>
+          <Real>3.200000</Real>
+          <Real>-34002.332031</Real>
+          <Real>6238.207031</Real>
+          <Real>-27764.125000</Real>
+        </Sequence>
+        <Sequence Name="Row17">
+          <Int Name="Length">4</Int>
+          <Real>3.400000</Real>
+          <Real>-34057.250000</Real>
+          <Real>6159.159180</Real>
+          <Real>-27898.089844</Real>
+        </Sequence>
+        <Sequence Name="Row18">
+          <Int Name="Length">4</Int>
+          <Real>3.600000</Real>
+          <Real>-34600.128906</Real>
+          <Real>6063.009766</Real>
+          <Real>-28537.119141</Real>
+        </Sequence>
+        <Sequence Name="Row19">
+          <Int Name="Length">4</Int>
+          <Real>3.800000</Real>
+          <Real>-34239.929688</Real>
+          <Real>6266.519043</Real>
+          <Real>-27973.410156</Real>
+        </Sequence>
+        <Sequence Name="Row20">
+          <Int Name="Length">4</Int>
+          <Real>4.000000</Real>
+          <Real>-34098.769531</Real>
+          <Real>6216.680176</Real>
+          <Real>-27882.089844</Real>
+        </Sequence>
+        <Sequence Name="Row21">
+          <Int Name="Length">4</Int>
+          <Real>4.200000</Real>
+          <Real>-34068.769531</Real>
+          <Real>6327.523926</Real>
+          <Real>-27741.246094</Real>
+        </Sequence>
+        <Sequence Name="Row22">
+          <Int Name="Length">4</Int>
+          <Real>4.400000</Real>
+          <Real>-33888.636719</Real>
+          <Real>6213.844727</Real>
+          <Real>-27674.792969</Real>
+        </Sequence>
+        <Sequence Name="Row23">
+          <Int Name="Length">4</Int>
+          <Real>4.600000</Real>
+          <Real>-33936.765625</Real>
+          <Real>6261.648438</Real>
+          <Real>-27675.117188</Real>
+        </Sequence>
+        <Sequence Name="Row24">
+          <Int Name="Length">4</Int>
+          <Real>4.800000</Real>
+          <Real>-33911.062500</Real>
+          <Real>6168.812500</Real>
+          <Real>-27742.250000</Real>
+        </Sequence>
+        <Sequence Name="Row25">
+          <Int Name="Length">4</Int>
+          <Real>5.000000</Real>
+          <Real>-33947.417969</Real>
+          <Real>6095.376953</Real>
+          <Real>-27852.041016</Real>
+        </Sequence>
+        <Sequence Name="Row26">
+          <Int Name="Length">4</Int>
+          <Real>5.200000</Real>
+          <Real>-34157.207031</Real>
+          <Real>5930.162109</Real>
+          <Real>-28227.044922</Real>
+        </Sequence>
+        <Sequence Name="Row27">
+          <Int Name="Length">4</Int>
+          <Real>5.400000</Real>
+          <Real>-33914.910156</Real>
+          <Real>6003.146973</Real>
+          <Real>-27911.763672</Real>
+        </Sequence>
+        <Sequence Name="Row28">
+          <Int Name="Length">4</Int>
+          <Real>5.600000</Real>
+          <Real>-33877.945312</Real>
+          <Real>6124.571777</Real>
+          <Real>-27753.373047</Real>
+        </Sequence>
+        <Sequence Name="Row29">
+          <Int Name="Length">4</Int>
+          <Real>5.800000</Real>
+          <Real>-34020.351562</Real>
+          <Real>6162.232910</Real>
+          <Real>-27858.119141</Real>
+        </Sequence>
+        <Sequence Name="Row30">
+          <Int Name="Length">4</Int>
+          <Real>6.000000</Real>
+          <Real>-34128.800781</Real>
+          <Real>6059.147461</Real>
+          <Real>-28069.652344</Real>
+        </Sequence>
+        <Sequence Name="Row31">
+          <Int Name="Length">4</Int>
+          <Real>6.200000</Real>
+          <Real>-34273.890625</Real>
+          <Real>6066.780273</Real>
+          <Real>-28207.109375</Real>
+        </Sequence>
+        <Sequence Name="Row32">
+          <Int Name="Length">4</Int>
+          <Real>6.400000</Real>
+          <Real>-33896.531250</Real>
+          <Real>6135.265137</Real>
+          <Real>-27761.265625</Real>
+        </Sequence>
+        <Sequence Name="Row33">
+          <Int Name="Length">4</Int>
+          <Real>6.600000</Real>
+          <Real>-34351.207031</Real>
+          <Real>6222.209961</Real>
+          <Real>-28128.996094</Real>
+        </Sequence>
+        <Sequence Name="Row34">
+          <Int Name="Length">4</Int>
+          <Real>6.800000</Real>
+          <Real>-34294.121094</Real>
+          <Real>6135.084961</Real>
+          <Real>-28159.035156</Real>
+        </Sequence>
+        <Sequence Name="Row35">
+          <Int Name="Length">4</Int>
+          <Real>7.000000</Real>
+          <Real>-34033.593750</Real>
+          <Real>6281.751953</Real>
+          <Real>-27751.841797</Real>
+        </Sequence>
+        <Sequence Name="Row36">
+          <Int Name="Length">4</Int>
+          <Real>7.200000</Real>
+          <Real>-33949.714844</Real>
+          <Real>6196.525391</Real>
+          <Real>-27753.189453</Real>
+        </Sequence>
+        <Sequence Name="Row37">
+          <Int Name="Length">4</Int>
+          <Real>7.400000</Real>
+          <Real>-33534.386719</Real>
+          <Real>5933.003418</Real>
+          <Real>-27601.382812</Real>
+        </Sequence>
+        <Sequence Name="Row38">
+          <Int Name="Length">4</Int>
+          <Real>7.600000</Real>
+          <Real>-34207.582031</Real>
+          <Real>6100.635742</Real>
+          <Real>-28106.945312</Real>
+        </Sequence>
+        <Sequence Name="Row39">
+          <Int Name="Length">4</Int>
+          <Real>7.800000</Real>
+          <Real>-34221.773438</Real>
+          <Real>6173.767090</Real>
+          <Real>-28048.005859</Real>
+        </Sequence>
+        <Sequence Name="Row40">
+          <Int Name="Length">4</Int>
+          <Real>8.000000</Real>
+          <Real>-34048.535156</Real>
+          <Real>6069.120117</Real>
+          <Real>-27979.414062</Real>
+        </Sequence>
+        <Sequence Name="Row41">
+          <Int Name="Length">4</Int>
+          <Real>8.200000</Real>
+          <Real>-34067.558594</Real>
+          <Real>6030.937988</Real>
+          <Real>-28036.621094</Real>
+        </Sequence>
+        <Sequence Name="Row42">
+          <Int Name="Length">4</Int>
+          <Real>8.400000</Real>
+          <Real>-34414.148438</Real>
+          <Real>6250.905273</Real>
+          <Real>-28163.242188</Real>
+        </Sequence>
+        <Sequence Name="Row43">
+          <Int Name="Length">4</Int>
+          <Real>8.600000</Real>
+          <Real>-33985.910156</Real>
+          <Real>6157.070312</Real>
+          <Real>-27828.839844</Real>
+        </Sequence>
+        <Sequence Name="Row44">
+          <Int Name="Length">4</Int>
+          <Real>8.800000</Real>
+          <Real>-33963.457031</Real>
+          <Real>6056.696289</Real>
+          <Real>-27906.761719</Real>
+        </Sequence>
+        <Sequence Name="Row45">
+          <Int Name="Length">4</Int>
+          <Real>9.000000</Real>
+          <Real>-34317.792969</Real>
+          <Real>6261.636230</Real>
+          <Real>-28056.156250</Real>
+        </Sequence>
+        <Sequence Name="Row46">
+          <Int Name="Length">4</Int>
+          <Real>9.200000</Real>
+          <Real>-34095.843750</Real>
+          <Real>6217.412109</Real>
+          <Real>-27878.431641</Real>
+        </Sequence>
+        <Sequence Name="Row47">
+          <Int Name="Length">4</Int>
+          <Real>9.400000</Real>
+          <Real>-34211.437500</Real>
+          <Real>6132.755371</Real>
+          <Real>-28078.681641</Real>
+        </Sequence>
+        <Sequence Name="Row48">
+          <Int Name="Length">4</Int>
+          <Real>9.600000</Real>
+          <Real>-34119.976562</Real>
+          <Real>6159.531250</Real>
+          <Real>-27960.445312</Real>
+        </Sequence>
+        <Sequence Name="Row49">
+          <Int Name="Length">4</Int>
+          <Real>9.800000</Real>
+          <Real>-34448.562500</Real>
+          <Real>6217.981934</Real>
+          <Real>-28230.580078</Real>
+        </Sequence>
+        <Sequence Name="Row50">
+          <Int Name="Length">4</Int>
+          <Real>10.000000</Real>
+          <Real>-33944.414062</Real>
+          <Real>6107.636719</Real>
+          <Real>-27836.777344</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/energyanalysis/tests/refdata/EnergyTest_ExtractEnergyByNumber.xml b/src/gromacs/energyanalysis/tests/refdata/EnergyTest_ExtractEnergyByNumber.xml
new file mode 100644 (file)
index 0000000..680c560
--- /dev/null
@@ -0,0 +1,378 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <OutputFiles Name="Files">
+    <File Name="-o">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "GROMACS Energies"
+xaxis  label "Time (ps)"
+yaxis  label "(kJ/mol), (bar)"
+TYPE xy
+s0 legend "Coul. recip."
+s1 legend "Kinetic En."
+s2 legend "Pres. DC"
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">4</Int>
+          <Real>0.000000</Real>
+          <Real>412.675140</Real>
+          <Real>6147.870117</Real>
+          <Real>-277.241913</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">4</Int>
+          <Real>0.200000</Real>
+          <Real>286.838928</Real>
+          <Real>5885.405273</Real>
+          <Real>-305.226624</Real>
+        </Sequence>
+        <Sequence Name="Row2">
+          <Int Name="Length">4</Int>
+          <Real>0.400000</Real>
+          <Real>318.294525</Real>
+          <Real>6146.063477</Real>
+          <Real>-276.163300</Real>
+        </Sequence>
+        <Sequence Name="Row3">
+          <Int Name="Length">4</Int>
+          <Real>0.600000</Real>
+          <Real>316.279175</Real>
+          <Real>6079.209473</Real>
+          <Real>-271.288391</Real>
+        </Sequence>
+        <Sequence Name="Row4">
+          <Int Name="Length">4</Int>
+          <Real>0.800000</Real>
+          <Real>303.799255</Real>
+          <Real>6242.735352</Real>
+          <Real>-274.734497</Real>
+        </Sequence>
+        <Sequence Name="Row5">
+          <Int Name="Length">4</Int>
+          <Real>1.000000</Real>
+          <Real>299.513519</Real>
+          <Real>6005.650391</Real>
+          <Real>-278.492157</Real>
+        </Sequence>
+        <Sequence Name="Row6">
+          <Int Name="Length">4</Int>
+          <Real>1.200000</Real>
+          <Real>293.994965</Real>
+          <Real>6251.612305</Real>
+          <Real>-283.624084</Real>
+        </Sequence>
+        <Sequence Name="Row7">
+          <Int Name="Length">4</Int>
+          <Real>1.400000</Real>
+          <Real>292.305603</Real>
+          <Real>6241.403809</Real>
+          <Real>-271.350677</Real>
+        </Sequence>
+        <Sequence Name="Row8">
+          <Int Name="Length">4</Int>
+          <Real>1.600000</Real>
+          <Real>295.773956</Real>
+          <Real>6419.104492</Real>
+          <Real>-282.657257</Real>
+        </Sequence>
+        <Sequence Name="Row9">
+          <Int Name="Length">4</Int>
+          <Real>1.800000</Real>
+          <Real>277.526611</Real>
+          <Real>6256.709473</Real>
+          <Real>-278.745453</Real>
+        </Sequence>
+        <Sequence Name="Row10">
+          <Int Name="Length">4</Int>
+          <Real>2.000000</Real>
+          <Real>298.229156</Real>
+          <Real>6094.508301</Real>
+          <Real>-271.631927</Real>
+        </Sequence>
+        <Sequence Name="Row11">
+          <Int Name="Length">4</Int>
+          <Real>2.200000</Real>
+          <Real>304.681488</Real>
+          <Real>6014.866699</Real>
+          <Real>-276.008667</Real>
+        </Sequence>
+        <Sequence Name="Row12">
+          <Int Name="Length">4</Int>
+          <Real>2.400000</Real>
+          <Real>305.796234</Real>
+          <Real>6177.041016</Real>
+          <Real>-272.094727</Real>
+        </Sequence>
+        <Sequence Name="Row13">
+          <Int Name="Length">4</Int>
+          <Real>2.600000</Real>
+          <Real>306.506500</Real>
+          <Real>5990.643066</Real>
+          <Real>-260.638428</Real>
+        </Sequence>
+        <Sequence Name="Row14">
+          <Int Name="Length">4</Int>
+          <Real>2.800000</Real>
+          <Real>333.718231</Real>
+          <Real>6077.416992</Real>
+          <Real>-257.015717</Real>
+        </Sequence>
+        <Sequence Name="Row15">
+          <Int Name="Length">4</Int>
+          <Real>3.000000</Real>
+          <Real>309.297546</Real>
+          <Real>6137.697754</Real>
+          <Real>-263.238159</Real>
+        </Sequence>
+        <Sequence Name="Row16">
+          <Int Name="Length">4</Int>
+          <Real>3.200000</Real>
+          <Real>293.729523</Real>
+          <Real>6238.207031</Real>
+          <Real>-266.992706</Real>
+        </Sequence>
+        <Sequence Name="Row17">
+          <Int Name="Length">4</Int>
+          <Real>3.400000</Real>
+          <Real>293.085510</Real>
+          <Real>6159.159180</Real>
+          <Real>-262.892700</Real>
+        </Sequence>
+        <Sequence Name="Row18">
+          <Int Name="Length">4</Int>
+          <Real>3.600000</Real>
+          <Real>261.200470</Real>
+          <Real>6063.009766</Real>
+          <Real>-264.705597</Real>
+        </Sequence>
+        <Sequence Name="Row19">
+          <Int Name="Length">4</Int>
+          <Real>3.800000</Real>
+          <Real>316.416992</Real>
+          <Real>6266.519043</Real>
+          <Real>-262.703918</Real>
+        </Sequence>
+        <Sequence Name="Row20">
+          <Int Name="Length">4</Int>
+          <Real>4.000000</Real>
+          <Real>306.888702</Real>
+          <Real>6216.680176</Real>
+          <Real>-266.768372</Real>
+        </Sequence>
+        <Sequence Name="Row21">
+          <Int Name="Length">4</Int>
+          <Real>4.200000</Real>
+          <Real>288.428619</Real>
+          <Real>6327.523926</Real>
+          <Real>-269.623749</Real>
+        </Sequence>
+        <Sequence Name="Row22">
+          <Int Name="Length">4</Int>
+          <Real>4.400000</Real>
+          <Real>316.909424</Real>
+          <Real>6213.844727</Real>
+          <Real>-272.557800</Real>
+        </Sequence>
+        <Sequence Name="Row23">
+          <Int Name="Length">4</Int>
+          <Real>4.600000</Real>
+          <Real>315.392242</Real>
+          <Real>6261.648438</Real>
+          <Real>-269.936920</Real>
+        </Sequence>
+        <Sequence Name="Row24">
+          <Int Name="Length">4</Int>
+          <Real>4.800000</Real>
+          <Real>306.055420</Real>
+          <Real>6168.812500</Real>
+          <Real>-262.402161</Real>
+        </Sequence>
+        <Sequence Name="Row25">
+          <Int Name="Length">4</Int>
+          <Real>5.000000</Real>
+          <Real>294.990906</Real>
+          <Real>6095.376953</Real>
+          <Real>-258.683838</Real>
+        </Sequence>
+        <Sequence Name="Row26">
+          <Int Name="Length">4</Int>
+          <Real>5.200000</Real>
+          <Real>289.555115</Real>
+          <Real>5930.162109</Real>
+          <Real>-259.584320</Real>
+        </Sequence>
+        <Sequence Name="Row27">
+          <Int Name="Length">4</Int>
+          <Real>5.400000</Real>
+          <Real>307.466949</Real>
+          <Real>6003.146973</Real>
+          <Real>-266.808014</Real>
+        </Sequence>
+        <Sequence Name="Row28">
+          <Int Name="Length">4</Int>
+          <Real>5.600000</Real>
+          <Real>299.525543</Real>
+          <Real>6124.571777</Real>
+          <Real>-271.693329</Real>
+        </Sequence>
+        <Sequence Name="Row29">
+          <Int Name="Length">4</Int>
+          <Real>5.800000</Real>
+          <Real>303.685181</Real>
+          <Real>6162.232910</Real>
+          <Real>-265.650055</Real>
+        </Sequence>
+        <Sequence Name="Row30">
+          <Int Name="Length">4</Int>
+          <Real>6.000000</Real>
+          <Real>302.508575</Real>
+          <Real>6059.147461</Real>
+          <Real>-262.166931</Real>
+        </Sequence>
+        <Sequence Name="Row31">
+          <Int Name="Length">4</Int>
+          <Real>6.200000</Real>
+          <Real>305.190033</Real>
+          <Real>6066.780273</Real>
+          <Real>-268.883850</Real>
+        </Sequence>
+        <Sequence Name="Row32">
+          <Int Name="Length">4</Int>
+          <Real>6.400000</Real>
+          <Real>316.891418</Real>
+          <Real>6135.265137</Real>
+          <Real>-264.964966</Real>
+        </Sequence>
+        <Sequence Name="Row33">
+          <Int Name="Length">4</Int>
+          <Real>6.600000</Real>
+          <Real>305.526703</Real>
+          <Real>6222.209961</Real>
+          <Real>-263.851654</Real>
+        </Sequence>
+        <Sequence Name="Row34">
+          <Int Name="Length">4</Int>
+          <Real>6.800000</Real>
+          <Real>306.182434</Real>
+          <Real>6135.084961</Real>
+          <Real>-261.104309</Real>
+        </Sequence>
+        <Sequence Name="Row35">
+          <Int Name="Length">4</Int>
+          <Real>7.000000</Real>
+          <Real>313.867401</Real>
+          <Real>6281.751953</Real>
+          <Real>-263.505280</Real>
+        </Sequence>
+        <Sequence Name="Row36">
+          <Int Name="Length">4</Int>
+          <Real>7.200000</Real>
+          <Real>327.160248</Real>
+          <Real>6196.525391</Real>
+          <Real>-260.642639</Real>
+        </Sequence>
+        <Sequence Name="Row37">
+          <Int Name="Length">4</Int>
+          <Real>7.400000</Real>
+          <Real>330.673920</Real>
+          <Real>5933.003418</Real>
+          <Real>-255.867264</Real>
+        </Sequence>
+        <Sequence Name="Row38">
+          <Int Name="Length">4</Int>
+          <Real>7.600000</Real>
+          <Real>299.878540</Real>
+          <Real>6100.635742</Real>
+          <Real>-263.021698</Real>
+        </Sequence>
+        <Sequence Name="Row39">
+          <Int Name="Length">4</Int>
+          <Real>7.800000</Real>
+          <Real>298.238159</Real>
+          <Real>6173.767090</Real>
+          <Real>-263.497375</Real>
+        </Sequence>
+        <Sequence Name="Row40">
+          <Int Name="Length">4</Int>
+          <Real>8.000000</Real>
+          <Real>346.477814</Real>
+          <Real>6069.120117</Real>
+          <Real>-252.196213</Real>
+        </Sequence>
+        <Sequence Name="Row41">
+          <Int Name="Length">4</Int>
+          <Real>8.200000</Real>
+          <Real>314.671814</Real>
+          <Real>6030.937988</Real>
+          <Real>-262.904236</Real>
+        </Sequence>
+        <Sequence Name="Row42">
+          <Int Name="Length">4</Int>
+          <Real>8.400000</Real>
+          <Real>306.445038</Real>
+          <Real>6250.905273</Real>
+          <Real>-275.029877</Real>
+        </Sequence>
+        <Sequence Name="Row43">
+          <Int Name="Length">4</Int>
+          <Real>8.600000</Real>
+          <Real>337.485474</Real>
+          <Real>6157.070312</Real>
+          <Real>-268.037445</Real>
+        </Sequence>
+        <Sequence Name="Row44">
+          <Int Name="Length">4</Int>
+          <Real>8.800000</Real>
+          <Real>313.903717</Real>
+          <Real>6056.696289</Real>
+          <Real>-263.511719</Real>
+        </Sequence>
+        <Sequence Name="Row45">
+          <Int Name="Length">4</Int>
+          <Real>9.000000</Real>
+          <Real>286.324554</Real>
+          <Real>6261.636230</Real>
+          <Real>-268.191803</Real>
+        </Sequence>
+        <Sequence Name="Row46">
+          <Int Name="Length">4</Int>
+          <Real>9.200000</Real>
+          <Real>296.164307</Real>
+          <Real>6217.412109</Real>
+          <Real>-265.517853</Real>
+        </Sequence>
+        <Sequence Name="Row47">
+          <Int Name="Length">4</Int>
+          <Real>9.400000</Real>
+          <Real>278.793793</Real>
+          <Real>6132.755371</Real>
+          <Real>-278.546753</Real>
+        </Sequence>
+        <Sequence Name="Row48">
+          <Int Name="Length">4</Int>
+          <Real>9.600000</Real>
+          <Real>322.638519</Real>
+          <Real>6159.531250</Real>
+          <Real>-273.344574</Real>
+        </Sequence>
+        <Sequence Name="Row49">
+          <Int Name="Length">4</Int>
+          <Real>9.800000</Real>
+          <Real>294.918335</Real>
+          <Real>6217.981934</Real>
+          <Real>-271.223114</Real>
+        </Sequence>
+        <Sequence Name="Row50">
+          <Int Name="Length">4</Int>
+          <Real>10.000000</Real>
+          <Real>323.157379</Real>
+          <Real>6107.636719</Real>
+          <Real>-266.596802</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/energyanalysis/tests/refdata/EnergyTest_ExtractEnergyMixed.xml b/src/gromacs/energyanalysis/tests/refdata/EnergyTest_ExtractEnergyMixed.xml
new file mode 100644 (file)
index 0000000..cd6370f
--- /dev/null
@@ -0,0 +1,430 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <OutputFiles Name="Files">
+    <File Name="-o">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "GROMACS Energies"
+xaxis  label "Time (ps)"
+yaxis  label "(kJ/mol), (bar), (nm), (nm^3)"
+TYPE xy
+s0 legend "Total Energy"
+s1 legend "Pressure"
+s2 legend "Box-Z"
+s3 legend "Volume"
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">5</Int>
+          <Real>0.000000</Real>
+          <Real>-25954.687500</Real>
+          <Real>-4113.184082</Real>
+          <Real>2.908700</Real>
+          <Real>24.609161</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">5</Int>
+          <Real>0.200000</Real>
+          <Real>-28565.414062</Real>
+          <Real>2182.145752</Real>
+          <Real>2.862453</Real>
+          <Real>23.453901</Real>
+        </Sequence>
+        <Sequence Name="Row2">
+          <Int Name="Length">5</Int>
+          <Real>0.400000</Real>
+          <Real>-27562.640625</Real>
+          <Real>-1272.206055</Real>
+          <Real>2.910590</Real>
+          <Real>24.657173</Real>
+        </Sequence>
+        <Sequence Name="Row3">
+          <Int Name="Length">5</Int>
+          <Real>0.600000</Real>
+          <Real>-27818.544922</Real>
+          <Real>52.116547</Real>
+          <Real>2.919243</Real>
+          <Real>24.877728</Real>
+        </Sequence>
+        <Sequence Name="Row4">
+          <Int Name="Length">5</Int>
+          <Real>0.800000</Real>
+          <Real>-27749.398438</Real>
+          <Real>21.307526</Real>
+          <Real>2.913108</Real>
+          <Real>24.721209</Real>
+        </Sequence>
+        <Sequence Name="Row5">
+          <Int Name="Length">5</Int>
+          <Real>1.000000</Real>
+          <Real>-28104.845703</Real>
+          <Real>-255.442398</Real>
+          <Real>2.906520</Real>
+          <Real>24.553862</Real>
+        </Sequence>
+        <Sequence Name="Row6">
+          <Int Name="Length">5</Int>
+          <Real>1.200000</Real>
+          <Real>-28174.515625</Real>
+          <Real>563.564453</Real>
+          <Real>2.897688</Real>
+          <Real>24.330708</Real>
+        </Sequence>
+        <Sequence Name="Row7">
+          <Int Name="Length">5</Int>
+          <Real>1.400000</Real>
+          <Real>-27726.591797</Real>
+          <Real>-1227.515869</Real>
+          <Real>2.919131</Real>
+          <Real>24.874872</Real>
+        </Sequence>
+        <Sequence Name="Row8">
+          <Int Name="Length">5</Int>
+          <Real>1.600000</Real>
+          <Real>-27904.679688</Real>
+          <Real>915.864136</Real>
+          <Real>2.899337</Real>
+          <Real>24.372284</Real>
+        </Sequence>
+        <Sequence Name="Row9">
+          <Int Name="Length">5</Int>
+          <Real>1.800000</Real>
+          <Real>-28048.607422</Real>
+          <Real>-279.529633</Real>
+          <Real>2.906079</Real>
+          <Real>24.542704</Real>
+        </Sequence>
+        <Sequence Name="Row10">
+          <Int Name="Length">5</Int>
+          <Real>2.000000</Real>
+          <Real>-28166.121094</Real>
+          <Real>-458.908936</Real>
+          <Real>2.918627</Real>
+          <Real>24.861990</Real>
+        </Sequence>
+        <Sequence Name="Row11">
+          <Int Name="Length">5</Int>
+          <Real>2.200000</Real>
+          <Real>-28581.250000</Real>
+          <Real>-189.055450</Real>
+          <Real>2.910862</Real>
+          <Real>24.664082</Real>
+        </Sequence>
+        <Sequence Name="Row12">
+          <Int Name="Length">5</Int>
+          <Real>2.400000</Real>
+          <Real>-28171.087891</Real>
+          <Real>371.100586</Real>
+          <Real>2.917799</Real>
+          <Real>24.840837</Real>
+        </Sequence>
+        <Sequence Name="Row13">
+          <Int Name="Length">5</Int>
+          <Real>2.600000</Real>
+          <Real>-27950.126953</Real>
+          <Real>445.505615</Real>
+          <Real>2.938793</Real>
+          <Real>25.380903</Real>
+        </Sequence>
+        <Sequence Name="Row14">
+          <Int Name="Length">5</Int>
+          <Real>2.800000</Real>
+          <Real>-28226.027344</Real>
+          <Real>-383.208984</Real>
+          <Real>2.945657</Real>
+          <Real>25.559153</Real>
+        </Sequence>
+        <Sequence Name="Row15">
+          <Int Name="Length">5</Int>
+          <Real>3.000000</Real>
+          <Real>-28098.013672</Real>
+          <Real>-739.696289</Real>
+          <Real>2.933936</Real>
+          <Real>25.255260</Real>
+        </Sequence>
+        <Sequence Name="Row16">
+          <Int Name="Length">5</Int>
+          <Real>3.200000</Real>
+          <Real>-27764.125000</Real>
+          <Real>556.054443</Real>
+          <Real>2.927019</Real>
+          <Real>25.077057</Real>
+        </Sequence>
+        <Sequence Name="Row17">
+          <Int Name="Length">5</Int>
+          <Real>3.400000</Real>
+          <Real>-27898.089844</Real>
+          <Real>-191.586060</Real>
+          <Real>2.934578</Real>
+          <Real>25.271851</Real>
+        </Sequence>
+        <Sequence Name="Row18">
+          <Int Name="Length">5</Int>
+          <Real>3.600000</Real>
+          <Real>-28537.119141</Real>
+          <Real>-64.853195</Real>
+          <Real>2.931219</Real>
+          <Real>25.185162</Real>
+        </Sequence>
+        <Sequence Name="Row19">
+          <Int Name="Length">5</Int>
+          <Real>3.800000</Real>
+          <Real>-27973.410156</Real>
+          <Real>-586.303345</Real>
+          <Real>2.934929</Real>
+          <Real>25.280926</Real>
+        </Sequence>
+        <Sequence Name="Row20">
+          <Int Name="Length">5</Int>
+          <Real>4.000000</Real>
+          <Real>-27882.089844</Real>
+          <Real>-361.731506</Real>
+          <Real>2.927429</Real>
+          <Real>25.087599</Real>
+        </Sequence>
+        <Sequence Name="Row21">
+          <Int Name="Length">5</Int>
+          <Real>4.200000</Real>
+          <Real>-27741.246094</Real>
+          <Real>259.893829</Real>
+          <Real>2.922239</Real>
+          <Real>24.954405</Real>
+        </Sequence>
+        <Sequence Name="Row22">
+          <Int Name="Length">5</Int>
+          <Real>4.400000</Real>
+          <Real>-27674.792969</Real>
+          <Real>520.501953</Real>
+          <Real>2.916972</Real>
+          <Real>24.819725</Real>
+        </Sequence>
+        <Sequence Name="Row23">
+          <Int Name="Length">5</Int>
+          <Real>4.600000</Real>
+          <Real>-27675.117188</Real>
+          <Real>268.957916</Real>
+          <Real>2.921674</Real>
+          <Real>24.939926</Real>
+        </Sequence>
+        <Sequence Name="Row24">
+          <Int Name="Length">5</Int>
+          <Real>4.800000</Real>
+          <Real>-27742.250000</Real>
+          <Real>-204.915268</Real>
+          <Real>2.935492</Real>
+          <Real>25.295462</Real>
+        </Sequence>
+        <Sequence Name="Row25">
+          <Int Name="Length">5</Int>
+          <Real>5.000000</Real>
+          <Real>-27852.041016</Real>
+          <Real>5.506622</Real>
+          <Real>2.942482</Real>
+          <Real>25.476610</Real>
+        </Sequence>
+        <Sequence Name="Row26">
+          <Int Name="Length">5</Int>
+          <Real>5.200000</Real>
+          <Real>-28227.044922</Real>
+          <Real>-274.371277</Real>
+          <Real>2.940779</Real>
+          <Real>25.432384</Real>
+        </Sequence>
+        <Sequence Name="Row27">
+          <Int Name="Length">5</Int>
+          <Real>5.400000</Real>
+          <Real>-27911.763672</Real>
+          <Real>592.697144</Real>
+          <Real>2.927356</Real>
+          <Real>25.085735</Real>
+        </Sequence>
+        <Sequence Name="Row28">
+          <Int Name="Length">5</Int>
+          <Real>5.600000</Real>
+          <Real>-27753.373047</Real>
+          <Real>683.389648</Real>
+          <Real>2.918517</Real>
+          <Real>24.859180</Real>
+        </Sequence>
+        <Sequence Name="Row29">
+          <Int Name="Length">5</Int>
+          <Real>5.800000</Real>
+          <Real>-27858.119141</Real>
+          <Real>-500.987946</Real>
+          <Real>2.929479</Real>
+          <Real>25.140350</Real>
+        </Sequence>
+        <Sequence Name="Row30">
+          <Int Name="Length">5</Int>
+          <Real>6.000000</Real>
+          <Real>-28069.652344</Real>
+          <Real>-272.158386</Real>
+          <Real>2.935930</Real>
+          <Real>25.306805</Real>
+        </Sequence>
+        <Sequence Name="Row31">
+          <Int Name="Length">5</Int>
+          <Real>6.200000</Real>
+          <Real>-28207.109375</Real>
+          <Real>682.146118</Real>
+          <Real>2.923578</Real>
+          <Real>24.988716</Real>
+        </Sequence>
+        <Sequence Name="Row32">
+          <Int Name="Length">5</Int>
+          <Real>6.400000</Real>
+          <Real>-27761.265625</Real>
+          <Real>-251.639786</Real>
+          <Real>2.930740</Real>
+          <Real>25.172831</Real>
+        </Sequence>
+        <Sequence Name="Row33">
+          <Int Name="Length">5</Int>
+          <Real>6.600000</Real>
+          <Real>-28128.996094</Real>
+          <Real>136.933014</Real>
+          <Real>2.932798</Real>
+          <Real>25.225883</Real>
+        </Sequence>
+        <Sequence Name="Row34">
+          <Int Name="Length">5</Int>
+          <Real>6.800000</Real>
+          <Real>-28159.035156</Real>
+          <Real>-172.420929</Real>
+          <Real>2.937919</Real>
+          <Real>25.358250</Real>
+        </Sequence>
+        <Sequence Name="Row35">
+          <Int Name="Length">5</Int>
+          <Real>7.000000</Real>
+          <Real>-27751.841797</Real>
+          <Real>187.738708</Real>
+          <Real>2.933440</Real>
+          <Real>25.242456</Real>
+        </Sequence>
+        <Sequence Name="Row36">
+          <Int Name="Length">5</Int>
+          <Real>7.200000</Real>
+          <Real>-27753.189453</Real>
+          <Real>181.039490</Real>
+          <Real>2.938785</Real>
+          <Real>25.380699</Real>
+        </Sequence>
+        <Sequence Name="Row37">
+          <Int Name="Length">5</Int>
+          <Real>7.400000</Real>
+          <Real>-27601.382812</Real>
+          <Real>-59.191101</Real>
+          <Real>2.947856</Real>
+          <Real>25.616447</Real>
+        </Sequence>
+        <Sequence Name="Row38">
+          <Int Name="Length">5</Int>
+          <Real>7.600000</Real>
+          <Real>-28106.945312</Real>
+          <Real>234.138947</Real>
+          <Real>2.934338</Real>
+          <Real>25.265654</Real>
+        </Sequence>
+        <Sequence Name="Row39">
+          <Int Name="Length">5</Int>
+          <Real>7.800000</Real>
+          <Real>-28048.005859</Real>
+          <Real>352.149719</Real>
+          <Real>2.933455</Real>
+          <Real>25.242838</Real>
+        </Sequence>
+        <Sequence Name="Row40">
+          <Int Name="Length">5</Int>
+          <Real>8.000000</Real>
+          <Real>-27979.414062</Real>
+          <Real>-506.414001</Real>
+          <Real>2.954965</Real>
+          <Real>25.802214</Real>
+        </Sequence>
+        <Sequence Name="Row41">
+          <Int Name="Length">5</Int>
+          <Real>8.200000</Real>
+          <Real>-28036.621094</Real>
+          <Real>-413.985809</Real>
+          <Real>2.934557</Real>
+          <Real>25.271296</Real>
+        </Sequence>
+        <Sequence Name="Row42">
+          <Int Name="Length">5</Int>
+          <Real>8.400000</Real>
+          <Real>-28163.242188</Real>
+          <Real>449.511932</Real>
+          <Real>2.912586</Real>
+          <Real>24.707930</Real>
+        </Sequence>
+        <Sequence Name="Row43">
+          <Int Name="Length">5</Int>
+          <Real>8.600000</Real>
+          <Real>-27828.839844</Real>
+          <Real>421.591461</Real>
+          <Real>2.925114</Real>
+          <Real>25.028139</Real>
+        </Sequence>
+        <Sequence Name="Row44">
+          <Int Name="Length">5</Int>
+          <Real>8.800000</Real>
+          <Real>-27906.761719</Real>
+          <Real>-277.707733</Real>
+          <Real>2.933428</Real>
+          <Real>25.242149</Real>
+        </Sequence>
+        <Sequence Name="Row45">
+          <Int Name="Length">5</Int>
+          <Real>9.000000</Real>
+          <Real>-28056.156250</Real>
+          <Real>-76.575607</Real>
+          <Real>2.924834</Real>
+          <Real>25.020935</Real>
+        </Sequence>
+        <Sequence Name="Row46">
+          <Int Name="Length">5</Int>
+          <Real>9.200000</Real>
+          <Real>-27878.431641</Real>
+          <Real>-443.641296</Real>
+          <Real>2.929722</Real>
+          <Real>25.146606</Real>
+        </Sequence>
+        <Sequence Name="Row47">
+          <Int Name="Length">5</Int>
+          <Real>9.400000</Real>
+          <Real>-28078.681641</Real>
+          <Real>727.809448</Real>
+          <Real>2.906425</Real>
+          <Real>24.551456</Real>
+        </Sequence>
+        <Sequence Name="Row48">
+          <Int Name="Length">5</Int>
+          <Real>9.600000</Real>
+          <Real>-27960.445312</Real>
+          <Real>-348.396515</Real>
+          <Real>2.915571</Real>
+          <Real>24.783981</Real>
+        </Sequence>
+        <Sequence Name="Row49">
+          <Int Name="Length">5</Int>
+          <Real>9.800000</Real>
+          <Real>-28230.580078</Real>
+          <Real>260.881683</Real>
+          <Real>2.919360</Real>
+          <Real>24.880718</Real>
+        </Sequence>
+        <Sequence Name="Row50">
+          <Int Name="Length">5</Int>
+          <Real>10.000000</Real>
+          <Real>-27836.777344</Real>
+          <Real>-291.007599</Real>
+          <Real>2.927743</Real>
+          <Real>25.095673</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/energyanalysis/tests/refdata/OriresTest_ExtractOrires.xml b/src/gromacs/energyanalysis/tests/refdata/OriresTest_ExtractOrires.xml
new file mode 100644 (file)
index 0000000..432e4e0
--- /dev/null
@@ -0,0 +1,379 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <OutputFiles Name="Files">
+    <File Name="-oten">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Order tensor"
+xaxis  label "Time (ps)"
+yaxis  label ""
+TYPE xy
+s0 legend "eig1"
+s1 legend "eig2"
+s2 legend "eig3"
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">4</Int>
+          <Real>0.000000</Real>
+          <Real>0.000874024</Real>
+          <Real>-0.000514914</Real>
+          <Real>-0.00035911</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">4</Int>
+          <Real>0.002000</Real>
+          <Real>0.000957853</Real>
+          <Real>-0.000568174</Real>
+          <Real>-0.00038968</Real>
+        </Sequence>
+        <Sequence Name="Row2">
+          <Int Name="Length">4</Int>
+          <Real>0.004000</Real>
+          <Real>0.0010501</Real>
+          <Real>-0.000591766</Real>
+          <Real>-0.000458333</Real>
+        </Sequence>
+        <Sequence Name="Row3">
+          <Int Name="Length">4</Int>
+          <Real>0.006000</Real>
+          <Real>0.00109263</Real>
+          <Real>-0.000597102</Real>
+          <Real>-0.000495525</Real>
+        </Sequence>
+        <Sequence Name="Row4">
+          <Int Name="Length">4</Int>
+          <Real>0.008000</Real>
+          <Real>0.00110458</Real>
+          <Real>-0.000597999</Real>
+          <Real>-0.000506579</Real>
+        </Sequence>
+        <Sequence Name="Row5">
+          <Int Name="Length">4</Int>
+          <Real>0.010000</Real>
+          <Real>0.00110374</Real>
+          <Real>-0.000602079</Real>
+          <Real>-0.000501658</Real>
+        </Sequence>
+        <Sequence Name="Row6">
+          <Int Name="Length">4</Int>
+          <Real>0.012000</Real>
+          <Real>0.00109991</Real>
+          <Real>-0.000609947</Real>
+          <Real>-0.00048996</Real>
+        </Sequence>
+        <Sequence Name="Row7">
+          <Int Name="Length">4</Int>
+          <Real>0.014000</Real>
+          <Real>0.00109939</Real>
+          <Real>-0.000620441</Real>
+          <Real>-0.000478945</Real>
+        </Sequence>
+        <Sequence Name="Row8">
+          <Int Name="Length">4</Int>
+          <Real>0.016000</Real>
+          <Real>0.00110964</Real>
+          <Real>-0.00063242</Real>
+          <Real>-0.000477215</Real>
+        </Sequence>
+        <Sequence Name="Row9">
+          <Int Name="Length">4</Int>
+          <Real>0.018000</Real>
+          <Real>0.00114132</Real>
+          <Real>-0.000644279</Real>
+          <Real>-0.000497043</Real>
+        </Sequence>
+        <Sequence Name="Row10">
+          <Int Name="Length">4</Int>
+          <Real>0.020000</Real>
+          <Real>0.00120594</Real>
+          <Real>-0.000654815</Real>
+          <Real>-0.000551126</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+    <File Name="-ora">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Average calculated orientations"
+xaxis  label "Restraint label"
+yaxis  label ""
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>3</Real>
+          <Real>-5.65282</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">2</Int>
+          <Real>4</Real>
+          <Real>-6.6605</Real>
+        </Sequence>
+        <Sequence Name="Row2">
+          <Int Name="Length">2</Int>
+          <Real>5</Real>
+          <Real>-5.05241</Real>
+        </Sequence>
+        <Sequence Name="Row3">
+          <Int Name="Length">2</Int>
+          <Real>6</Real>
+          <Real>-4.79816</Real>
+        </Sequence>
+        <Sequence Name="Row4">
+          <Int Name="Length">2</Int>
+          <Real>7</Real>
+          <Real>-1.77661</Real>
+        </Sequence>
+        <Sequence Name="Row5">
+          <Int Name="Length">2</Int>
+          <Real>8</Real>
+          <Real>-5.81927</Real>
+        </Sequence>
+        <Sequence Name="Row6">
+          <Int Name="Length">2</Int>
+          <Real>9</Real>
+          <Real>-3.85166</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+    <File Name="-ort">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Calculated orientations"
+xaxis  label "Time (ps)"
+yaxis  label ""
+TYPE xy
+s0 legend "3"
+s1 legend "4"
+s2 legend "5"
+s3 legend "6"
+s4 legend "7"
+s5 legend "8"
+s6 legend "9"
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">8</Int>
+          <Real>0.000000</Real>
+          <Real>-4.89452</Real>
+          <Real>-5.87842</Real>
+          <Real>-5.30698</Real>
+          <Real>-5.01504</Real>
+          <Real>-0.544227</Real>
+          <Real>-4.75521</Real>
+          <Real>-5.82053</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">8</Int>
+          <Real>0.002000</Real>
+          <Real>-5.15825</Real>
+          <Real>-6.3131</Real>
+          <Real>-4.82974</Real>
+          <Real>-5.30595</Real>
+          <Real>-0.699448</Real>
+          <Real>-5.26383</Real>
+          <Real>-4.98295</Real>
+        </Sequence>
+        <Sequence Name="Row2">
+          <Int Name="Length">8</Int>
+          <Real>0.004000</Real>
+          <Real>-5.50881</Real>
+          <Real>-6.5012</Real>
+          <Real>-4.6769</Real>
+          <Real>-5.30756</Real>
+          <Real>-1.18245</Real>
+          <Real>-5.6455</Real>
+          <Real>-4.25769</Real>
+        </Sequence>
+        <Sequence Name="Row3">
+          <Int Name="Length">8</Int>
+          <Real>0.006000</Real>
+          <Real>-5.78819</Real>
+          <Real>-6.57865</Real>
+          <Real>-4.73666</Real>
+          <Real>-5.14671</Real>
+          <Real>-1.67991</Real>
+          <Real>-5.82657</Real>
+          <Real>-3.80163</Real>
+        </Sequence>
+        <Sequence Name="Row4">
+          <Int Name="Length">8</Int>
+          <Real>0.008000</Real>
+          <Real>-5.94801</Real>
+          <Real>-6.63582</Real>
+          <Real>-4.8771</Real>
+          <Real>-4.94553</Real>
+          <Real>-2.03635</Real>
+          <Real>-5.89558</Real>
+          <Real>-3.55664</Real>
+        </Sequence>
+        <Sequence Name="Row5">
+          <Int Name="Length">8</Int>
+          <Real>0.010000</Real>
+          <Real>-5.99537</Real>
+          <Real>-6.69487</Real>
+          <Real>-5.0156</Real>
+          <Real>-4.77013</Real>
+          <Real>-2.23404</Real>
+          <Real>-5.93982</Real>
+          <Real>-3.4359</Real>
+        </Sequence>
+        <Sequence Name="Row6">
+          <Int Name="Length">8</Int>
+          <Real>0.012000</Real>
+          <Real>-5.95561</Real>
+          <Real>-6.75984</Real>
+          <Real>-5.1177</Real>
+          <Real>-4.63846</Real>
+          <Real>-2.30732</Real>
+          <Real>-6.0011</Real>
+          <Real>-3.37638</Real>
+        </Sequence>
+        <Sequence Name="Row7">
+          <Int Name="Length">8</Int>
+          <Real>0.014000</Real>
+          <Real>-5.86272</Real>
+          <Real>-6.83544</Real>
+          <Real>-5.18525</Real>
+          <Real>-4.53827</Real>
+          <Real>-2.29768</Real>
+          <Real>-6.08155</Real>
+          <Real>-3.3403</Real>
+        </Sequence>
+        <Sequence Name="Row8">
+          <Int Name="Length">8</Int>
+          <Real>0.016000</Real>
+          <Real>-5.75713</Real>
+          <Real>-6.9238</Real>
+          <Real>-5.23559</Real>
+          <Real>-4.45047</Real>
+          <Real>-2.24405</Real>
+          <Real>-6.16018</Real>
+          <Real>-3.3078</Real>
+        </Sequence>
+        <Sequence Name="Row9">
+          <Int Name="Length">8</Int>
+          <Real>0.018000</Real>
+          <Real>-5.67512</Real>
+          <Real>-7.02144</Real>
+          <Real>-5.27937</Real>
+          <Real>-4.36782</Real>
+          <Real>-2.18139</Real>
+          <Real>-6.21335</Real>
+          <Real>-3.26937</Real>
+        </Sequence>
+        <Sequence Name="Row10">
+          <Int Name="Length">8</Int>
+          <Real>0.020000</Real>
+          <Real>-5.63729</Real>
+          <Real>-7.12295</Real>
+          <Real>-5.31557</Real>
+          <Real>-4.29384</Real>
+          <Real>-2.1358</Real>
+          <Real>-6.22931</Real>
+          <Real>-3.21908</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+    <File Name="-oda">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Average restraint deviation"
+xaxis  label "Restraint label"
+yaxis  label ""
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>3</Real>
+          <Real>1.07718</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">2</Int>
+          <Real>4</Real>
+          <Real>1.2095</Real>
+        </Sequence>
+        <Sequence Name="Row2">
+          <Int Name="Length">2</Int>
+          <Real>5</Real>
+          <Real>2.07759</Real>
+        </Sequence>
+        <Sequence Name="Row3">
+          <Int Name="Length">2</Int>
+          <Real>6</Real>
+          <Real>-2.22816</Real>
+        </Sequence>
+        <Sequence Name="Row4">
+          <Int Name="Length">2</Int>
+          <Real>7</Real>
+          <Real>0.323394</Real>
+        </Sequence>
+        <Sequence Name="Row5">
+          <Int Name="Length">2</Int>
+          <Real>8</Real>
+          <Real>-1.71927</Real>
+        </Sequence>
+        <Sequence Name="Row6">
+          <Int Name="Length">2</Int>
+          <Real>9</Real>
+          <Real>-0.751661</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+    <File Name="-odr">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "RMS orientation restraint deviations"
+xaxis  label "Restraint label"
+yaxis  label ""
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>3</Real>
+          <Real>1.1271</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">2</Int>
+          <Real>4</Real>
+          <Real>1.25451</Real>
+        </Sequence>
+        <Sequence Name="Row2">
+          <Int Name="Length">2</Int>
+          <Real>5</Real>
+          <Real>2.08989</Real>
+        </Sequence>
+        <Sequence Name="Row3">
+          <Int Name="Length">2</Int>
+          <Real>6</Real>
+          <Real>2.25577</Real>
+        </Sequence>
+        <Sequence Name="Row4">
+          <Int Name="Length">2</Int>
+          <Real>7</Real>
+          <Real>0.70923</Real>
+        </Sequence>
+        <Sequence Name="Row5">
+          <Int Name="Length">2</Int>
+          <Real>8</Real>
+          <Real>1.7722</Real>
+        </Sequence>
+        <Sequence Name="Row6">
+          <Int Name="Length">2</Int>
+          <Real>9</Real>
+          <Real>1.10045</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/energyanalysis/tests/refdata/ViscosityTest_EinsteinViscosity.xml b/src/gromacs/energyanalysis/tests/refdata/ViscosityTest_EinsteinViscosity.xml
new file mode 100644 (file)
index 0000000..59131e9
--- /dev/null
@@ -0,0 +1,134 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <OutputFiles Name="Files">
+    <File Name="-evisco">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Shear viscosity using Einstein relation"
+xaxis  label "Time (ps)"
+yaxis  label "(kg m\S-1\N s\S-1\N)"
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">5</Int>
+          <Real>0.1</Real>
+          <Real>0</Real>
+          <Real>0</Real>
+          <Real>0</Real>
+          <Real>0</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">5</Int>
+          <Real>0.3</Real>
+          <Real>0.000176958</Real>
+          <Real>0.0001997</Real>
+          <Real>0.000227414</Real>
+          <Real>0.000201357</Real>
+        </Sequence>
+        <Sequence Name="Row2">
+          <Int Name="Length">5</Int>
+          <Real>0.5</Real>
+          <Real>0.00032058</Real>
+          <Real>0.000336305</Real>
+          <Real>0.000523275</Real>
+          <Real>0.000393386</Real>
+        </Sequence>
+        <Sequence Name="Row3">
+          <Int Name="Length">5</Int>
+          <Real>0.7</Real>
+          <Real>0.000438803</Real>
+          <Real>0.000332506</Real>
+          <Real>0.000720448</Real>
+          <Real>0.000497252</Real>
+        </Sequence>
+        <Sequence Name="Row4">
+          <Int Name="Length">5</Int>
+          <Real>0.9</Real>
+          <Real>0.000479678</Real>
+          <Real>0.00026701</Real>
+          <Real>0.000834344</Real>
+          <Real>0.000527011</Real>
+        </Sequence>
+        <Sequence Name="Row5">
+          <Int Name="Length">5</Int>
+          <Real>1.1</Real>
+          <Real>0.000518115</Real>
+          <Real>0.0002171</Real>
+          <Real>0.000888733</Real>
+          <Real>0.000541316</Real>
+        </Sequence>
+        <Sequence Name="Row6">
+          <Int Name="Length">5</Int>
+          <Real>1.3</Real>
+          <Real>0.000521</Real>
+          <Real>0.000157779</Real>
+          <Real>0.00086004</Real>
+          <Real>0.00051294</Real>
+        </Sequence>
+        <Sequence Name="Row7">
+          <Int Name="Length">5</Int>
+          <Real>1.5</Real>
+          <Real>0.000545937</Real>
+          <Real>0.000116376</Real>
+          <Real>0.000702937</Real>
+          <Real>0.000455084</Real>
+        </Sequence>
+        <Sequence Name="Row8">
+          <Int Name="Length">5</Int>
+          <Real>1.7</Real>
+          <Real>0.000564482</Real>
+          <Real>0.000149521</Real>
+          <Real>0.000433129</Real>
+          <Real>0.000382377</Real>
+        </Sequence>
+        <Sequence Name="Row9">
+          <Int Name="Length">5</Int>
+          <Real>1.9</Real>
+          <Real>0.000643496</Real>
+          <Real>0.000253498</Real>
+          <Real>0.000142306</Real>
+          <Real>0.000346433</Real>
+        </Sequence>
+        <Sequence Name="Row10">
+          <Int Name="Length">5</Int>
+          <Real>2.1</Real>
+          <Real>0.000680419</Real>
+          <Real>0.000327415</Real>
+          <Real>4.35872e-05</Real>
+          <Real>0.000350474</Real>
+        </Sequence>
+        <Sequence Name="Row11">
+          <Int Name="Length">5</Int>
+          <Real>2.3</Real>
+          <Real>0.000715131</Real>
+          <Real>0.000369339</Real>
+          <Real>-5.31824e-05</Real>
+          <Real>0.000343763</Real>
+        </Sequence>
+        <Sequence Name="Row12">
+          <Int Name="Length">5</Int>
+          <Real>2.5</Real>
+          <Real>0.000818337</Real>
+          <Real>0.000399551</Real>
+          <Real>-8.46781e-05</Real>
+          <Real>0.000377737</Real>
+        </Sequence>
+        <Sequence Name="Row13">
+          <Int Name="Length">5</Int>
+          <Real>2.7</Real>
+          <Real>0.000924901</Real>
+          <Real>0.000419762</Real>
+          <Real>7.73914e-06</Real>
+          <Real>0.000450801</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+    <File Name="-vis"></File>
+    <File Name="-o"></File>
+    <File Name="-eviscoi"></File>
+    <File Name="-corr"></File>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/energyanalysis/tests/refdata/ViscosityTest_EinsteinViscosityIntegral.xml b/src/gromacs/energyanalysis/tests/refdata/ViscosityTest_EinsteinViscosityIntegral.xml
new file mode 100644 (file)
index 0000000..ee97d8d
--- /dev/null
@@ -0,0 +1,134 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <OutputFiles Name="Files">
+    <File Name="-eviscoi">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Shear viscosity integral"
+xaxis  label "Time (ps)"
+yaxis  label "(kg m\S-1\N s\S-1\N ps)"
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">5</Int>
+          <Real>0</Real>
+          <Real>0</Real>
+          <Real>0</Real>
+          <Real>0</Real>
+          <Real>0</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">5</Int>
+          <Real>0.2</Real>
+          <Real>3.53916e-05</Real>
+          <Real>3.994e-05</Real>
+          <Real>4.54828e-05</Real>
+          <Real>4.02715e-05</Real>
+        </Sequence>
+        <Sequence Name="Row2">
+          <Int Name="Length">5</Int>
+          <Real>0.4</Real>
+          <Real>9.95076e-05</Real>
+          <Real>0.000107201</Real>
+          <Real>0.000150138</Real>
+          <Real>0.000118949</Real>
+        </Sequence>
+        <Sequence Name="Row3">
+          <Int Name="Length">5</Int>
+          <Real>0.6</Real>
+          <Real>0.000187268</Real>
+          <Real>0.000173702</Real>
+          <Real>0.000294227</Real>
+          <Real>0.000218399</Real>
+        </Sequence>
+        <Sequence Name="Row4">
+          <Int Name="Length">5</Int>
+          <Real>0.8</Real>
+          <Real>0.000283204</Real>
+          <Real>0.000227104</Real>
+          <Real>0.000461096</Real>
+          <Real>0.000323801</Real>
+        </Sequence>
+        <Sequence Name="Row5">
+          <Int Name="Length">5</Int>
+          <Real>1</Real>
+          <Real>0.000386827</Real>
+          <Real>0.000270524</Real>
+          <Real>0.000638843</Real>
+          <Real>0.000432065</Real>
+        </Sequence>
+        <Sequence Name="Row6">
+          <Int Name="Length">5</Int>
+          <Real>1.2</Real>
+          <Real>0.000491027</Real>
+          <Real>0.00030208</Real>
+          <Real>0.000810851</Real>
+          <Real>0.000534652</Real>
+        </Sequence>
+        <Sequence Name="Row7">
+          <Int Name="Length">5</Int>
+          <Real>1.4</Real>
+          <Real>0.000600214</Real>
+          <Real>0.000325355</Real>
+          <Real>0.000951438</Real>
+          <Real>0.000625669</Real>
+        </Sequence>
+        <Sequence Name="Row8">
+          <Int Name="Length">5</Int>
+          <Real>1.6</Real>
+          <Real>0.000713111</Real>
+          <Real>0.000355259</Real>
+          <Real>0.00103806</Real>
+          <Real>0.000702145</Real>
+        </Sequence>
+        <Sequence Name="Row9">
+          <Int Name="Length">5</Int>
+          <Real>1.8</Real>
+          <Real>0.00084181</Real>
+          <Real>0.000405959</Real>
+          <Real>0.00106653</Real>
+          <Real>0.000771431</Real>
+        </Sequence>
+        <Sequence Name="Row10">
+          <Int Name="Length">5</Int>
+          <Real>2</Real>
+          <Real>0.000977894</Real>
+          <Real>0.000471442</Real>
+          <Real>0.00107524</Real>
+          <Real>0.000841526</Real>
+        </Sequence>
+        <Sequence Name="Row11">
+          <Int Name="Length">5</Int>
+          <Real>2.2</Real>
+          <Real>0.00112092</Real>
+          <Real>0.00054531</Real>
+          <Real>0.00106461</Real>
+          <Real>0.000910279</Real>
+        </Sequence>
+        <Sequence Name="Row12">
+          <Int Name="Length">5</Int>
+          <Real>2.4</Real>
+          <Real>0.00128459</Real>
+          <Real>0.00062522</Real>
+          <Real>0.00104767</Real>
+          <Real>0.000985826</Real>
+        </Sequence>
+        <Sequence Name="Row13">
+          <Int Name="Length">5</Int>
+          <Real>2.6</Real>
+          <Real>0.00146957</Real>
+          <Real>0.000709173</Real>
+          <Real>0.00104922</Real>
+          <Real>0.00107599</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+    <File Name="-vis"></File>
+    <File Name="-o"></File>
+    <File Name="-evisco"></File>
+    <File Name="-corr"></File>
+  </OutputFiles>
+</ReferenceData>
index 41bbd3078e683f59f87c497f8db99faa5216cbf3..911c648456c4ce5544a451e3ac01003ae7ea282b 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,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.
 #include "gromacs/math/utilities.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/math/vectypes.h"
+#include "gromacs/mdlib/broadcaststructs.h"
+#include "gromacs/mdlib/constr.h"
 #include "gromacs/mdlib/groupcoord.h"
 #include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/sim_util.h"
 #include "gromacs/mdlib/update.h"
 #include "gromacs/mdtypes/commrec.h"
+#include "gromacs/mdtypes/edsamhistory.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/mdtypes/observableshistory.h"
 #include "gromacs/pbcutil/pbc.h"
-#include "gromacs/topology/mtop_util.h"
+#include "gromacs/topology/mtop_lookup.h"
 #include "gromacs/topology/topology.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
 
-/* We use the same defines as in broadcaststructs.cpp here */
-#define  block_bc(cr,   d) gmx_bcast(     sizeof(d),     &(d), (cr))
-#define nblock_bc(cr, nr, d) gmx_bcast((nr)*sizeof((d)[0]), (d), (cr))
-#define   snew_bc(cr, d, nr) { if (!MASTER(cr)) {snew((d), (nr)); }}
-
 /* enum to identify the type of ED: none, normal ED, flooding */
 enum {
     eEDnone, eEDedsam, eEDflood, eEDnr
@@ -230,8 +229,8 @@ static void fit_to_reference(rvec *xcoll, rvec transvec, matrix rotmat, t_edpar
 static void translate_and_rotate(rvec *x, int nat, rvec transvec, matrix rotmat);
 static real rmsd_from_structure(rvec *x, struct gmx_edx *s);
 static int read_edi_file(const char *fn, t_edpar *edi, int nr_mdatoms);
-static void crosscheck_edi_file_vs_checkpoint(gmx_edsam_t ed, edsamstate_t *EDstate);
-static void init_edsamstate(gmx_edsam_t ed, edsamstate_t *EDstate);
+static void crosscheck_edi_file_vs_checkpoint(gmx_edsam_t ed, edsamhistory_t *EDstate);
+static void init_edsamstate(gmx_edsam_t ed, edsamhistory_t *EDstate);
 static void write_edo_legend(gmx_edsam_t ed, int nED, const gmx_output_env_t *oenv);
 /* End function declarations */
 
@@ -577,7 +576,7 @@ static void do_edfit(int natoms, rvec *xp, rvec *x, matrix R, t_edpar *edi)
     struct t_do_edfit *loc;
     gmx_bool           bFirst;
 
-    if (edi->buf->do_edfit != NULL)
+    if (edi->buf->do_edfit != nullptr)
     {
         bFirst = FALSE;
     }
@@ -1184,12 +1183,23 @@ static void get_flood_energies(t_edpar *edi, real Vfl[], int nnames)
 #endif
 
 
-gmx_edsam_t ed_open(int natoms, edsamstate_t *EDstate, int nfile, const t_filenm fnm[], unsigned long Flags, const gmx_output_env_t *oenv, t_commrec *cr)
+/* This function opens the ED input and output files, reads in all datasets it finds
+ * in the input file, and cross-checks whether the .edi file information is consistent
+ * with the essential dynamics data found in the checkpoint file (if present).
+ * gmx make_edi can be used to create an .edi input file.
+ */
+static gmx_edsam_t ed_open(
+        int                     natoms,
+        ObservablesHistory     *oh,
+        const char             *ediFileName,
+        const char             *edoFileName,
+        gmx_bool                bAppend,
+        const gmx_output_env_t *oenv,
+        t_commrec              *cr)
 {
     gmx_edsam_t ed;
     int         nED;
 
-
     /* Allocate space for the ED data structure */
     snew(ed, 1);
 
@@ -1198,11 +1208,17 @@ gmx_edsam_t ed_open(int natoms, edsamstate_t *EDstate, int nfile, const t_filenm
 
     if (MASTER(cr))
     {
-        fprintf(stderr, "ED sampling will be performed!\n");
         snew(ed->edpar, 1);
 
+        // If we start from a checkpoint file, we already have an edsamHistory struct
+        if (oh->edsamHistory.get() == nullptr)
+        {
+            oh->edsamHistory = std::unique_ptr<edsamhistory_t>(new edsamhistory_t {});
+        }
+        edsamhistory_t *EDstate = oh->edsamHistory.get();
+
         /* Read the edi input file: */
-        nED = read_edi_file(ftp2fn(efEDI, nfile, fnm), ed->edpar, natoms);
+        nED = read_edi_file(ediFileName, ed->edpar, natoms);
 
         /* Make sure the checkpoint was produced in a run using this .edi file */
         if (EDstate->bFromCpt)
@@ -1216,14 +1232,13 @@ gmx_edsam_t ed_open(int natoms, edsamstate_t *EDstate, int nfile, const t_filenm
         init_edsamstate(ed, EDstate);
 
         /* The master opens the ED output file */
-        /* TODO This file is never closed... */
-        if (Flags & MD_APPENDFILES)
+        if (bAppend)
         {
-            ed->edo = gmx_fio_fopen(opt2fn("-eo", nfile, fnm), "a+");
+            ed->edo = gmx_fio_fopen(edoFileName, "a+");
         }
         else
         {
-            ed->edo = xvgropen(opt2fn("-eo", nfile, fnm),
+            ed->edo = xvgropen(edoFileName,
                                "Essential dynamics / flooding output",
                                "Time (ps)",
                                "RMSDs (nm), projections on EVs (nm), ...", oenv);
@@ -1361,23 +1376,19 @@ static void init_edi(const gmx_mtop_t *mtop, t_edpar *edi)
     int                   i;
     real                  totalmass = 0.0;
     rvec                  com;
-    gmx_mtop_atomlookup_t alook = NULL;
-    t_atom               *atom;
 
     /* NOTE Init_edi is executed on the master process only
      * The initialized data sets are then transmitted to the
      * other nodes in broadcast_ed_data */
 
-    alook = gmx_mtop_atomlookup_init(mtop);
-
     /* evaluate masses (reference structure) */
     snew(edi->sref.m, edi->sref.nr);
+    int molb = 0;
     for (i = 0; i < edi->sref.nr; i++)
     {
         if (edi->fitmas)
         {
-            gmx_mtop_atomnr_to_atom(alook, edi->sref.anrs[i], &atom);
-            edi->sref.m[i] = atom->m;
+            edi->sref.m[i] = mtopGetAtomMass(mtop, edi->sref.anrs[i], &molb);
         }
         else
         {
@@ -1404,11 +1415,10 @@ static void init_edi(const gmx_mtop_t *mtop, t_edpar *edi)
     snew(edi->sav.m, edi->sav.nr );
     for (i = 0; i < edi->sav.nr; i++)
     {
-        gmx_mtop_atomnr_to_atom(alook, edi->sav.anrs[i], &atom);
-        edi->sav.m[i] = atom->m;
+        edi->sav.m[i] = mtopGetAtomMass(mtop, edi->sav.anrs[i], &molb);
         if (edi->pcamas)
         {
-            edi->sav.sqrtm[i] = sqrt(atom->m);
+            edi->sav.sqrtm[i] = sqrt(edi->sav.m[i]);
         }
         else
         {
@@ -1422,12 +1432,10 @@ static void init_edi(const gmx_mtop_t *mtop, t_edpar *edi)
                       "For ED with mass-weighting, all average structure atoms need to have a mass >0.\n"
                       "Either make the covariance analysis non-mass-weighted, or exclude massless\n"
                       "atoms from the average structure by creating a proper index group.\n",
-                      i, edi->sav.anrs[i]+1, atom->m);
+                      i, edi->sav.anrs[i] + 1, edi->sav.m[i]);
         }
     }
 
-    gmx_mtop_atomlookup_destroy(alook);
-
     /* put reference structure in origin */
     get_center(edi->sref.x, edi->sref.m, edi->sref.nr, com);
     com[XX] = -com[XX];
@@ -1470,13 +1478,13 @@ static int read_edint(FILE *file, gmx_bool *bEOF)
 
 
     eof = fgets2 (line, STRLEN, file);
-    if (eof == NULL)
+    if (eof == nullptr)
     {
         *bEOF = TRUE;
         return -1;
     }
     eof = fgets2 (line, STRLEN, file);
-    if (eof == NULL)
+    if (eof == nullptr)
     {
         *bEOF = TRUE;
         return -1;
@@ -1725,7 +1733,7 @@ static int read_edi(FILE* in, t_edpar *edi, int nr_mdatoms, const char *fn)
     snew(edi->sref.anrs, edi->sref.nr);
     snew(edi->sref.x, edi->sref.nr);
     snew(edi->sref.x_old, edi->sref.nr);
-    edi->sref.sqrtm    = NULL;
+    edi->sref.sqrtm    = nullptr;
     read_edx(in, edi->sref.nr, edi->sref.anrs, edi->sref.x);
 
     /* average positions. they define which atoms will be used for ED sampling */
@@ -1748,7 +1756,7 @@ static int read_edi(FILE* in, t_edpar *edi, int nr_mdatoms, const char *fn)
     {
         snew(edi->star.anrs, edi->star.nr);
         snew(edi->star.x, edi->star.nr);
-        edi->star.sqrtm    = NULL;
+        edi->star.sqrtm    = nullptr;
         read_edx(in, edi->star.nr, edi->star.anrs, edi->star.x);
     }
 
@@ -1765,7 +1773,7 @@ static int read_edi(FILE* in, t_edpar *edi, int nr_mdatoms, const char *fn)
         }
         snew(edi->sori.anrs, edi->sori.nr);
         snew(edi->sori.x, edi->sori.nr);
-        edi->sori.sqrtm    = NULL;
+        edi->sori.sqrtm    = nullptr;
         read_edx(in, edi->sori.nr, edi->sori.anrs, edi->sori.x);
     }
 
@@ -1815,7 +1823,7 @@ static int read_edi_file(const char *fn, t_edpar *edi, int nr_mdatoms)
     }
 
     /* Terminate the edi group list with a NULL pointer: */
-    last_edi->next_edi = NULL;
+    last_edi->next_edi = nullptr;
 
     fprintf(stderr, "ED: Found %d ED group%s.\n", edi_nr, edi_nr > 1 ? "s" : "");
 
@@ -1845,7 +1853,7 @@ static void fit_to_reference(rvec      *xcoll,    /* The positions to be fitted
 
 
     /* Allocate memory the first time this routine is called for each edi group */
-    if (NULL == edi->buf->fit_to_ref)
+    if (nullptr == edi->buf->fit_to_ref)
     {
         snew(edi->buf->fit_to_ref, 1);
         snew(edi->buf->fit_to_ref->xcopy, edi->sref.nr);
@@ -2145,7 +2153,7 @@ static void do_radcon(rvec *xcoll, t_edpar *edi)
     rvec                vec_dum;
 
 
-    if (edi->buf->do_radcon != NULL)
+    if (edi->buf->do_radcon != nullptr)
     {
         bFirst = FALSE;
     }
@@ -2308,7 +2316,7 @@ static void copyEvecReference(t_eigvec* floodvecs)
     int i;
 
 
-    if (NULL == floodvecs->refproj0)
+    if (nullptr == floodvecs->refproj0)
     {
         snew(floodvecs->refproj0, floodvecs->neig);
     }
@@ -2322,13 +2330,13 @@ static void copyEvecReference(t_eigvec* floodvecs)
 
 /* Call on MASTER only. Check whether the essential dynamics / flooding
  * groups of the checkpoint file are consistent with the provided .edi file. */
-static void crosscheck_edi_file_vs_checkpoint(gmx_edsam_t ed, edsamstate_t *EDstate)
+static void crosscheck_edi_file_vs_checkpoint(gmx_edsam_t ed, edsamhistory_t *EDstate)
 {
-    t_edpar *edi = NULL;    /* points to a single edi data set */
+    t_edpar *edi = nullptr;    /* points to a single edi data set */
     int      edinum;
 
 
-    if (NULL == EDstate->nref || NULL == EDstate->nav)
+    if (nullptr == EDstate->nref || nullptr == EDstate->nav)
     {
         gmx_fatal(FARGS, "Essential dynamics and flooding can only be switched on (or off) at the\n"
                   "start of a new simulation. If a simulation runs with/without ED constraints,\n"
@@ -2339,7 +2347,7 @@ static void crosscheck_edi_file_vs_checkpoint(gmx_edsam_t ed, edsamstate_t *EDst
 
     edi    = ed->edpar;
     edinum = 0;
-    while (edi != NULL)
+    while (edi != nullptr)
     {
         /* Check number of atoms in the reference and average structures */
         if (EDstate->nref[edinum] != edi->sref.nr)
@@ -2374,7 +2382,7 @@ static void crosscheck_edi_file_vs_checkpoint(gmx_edsam_t ed, edsamstate_t *EDst
  * c) in any case, for subsequent checkpoint writing, we set the pointers in
  * edsamstate to the x_old arrays, which contain the correct PBC representation of
  * all ED structures at the last time step. */
-static void init_edsamstate(gmx_edsam_t ed, edsamstate_t *EDstate)
+static void init_edsamstate(gmx_edsam_t ed, edsamhistory_t *EDstate)
 {
     int      i, nr_edi;
     t_edpar *edi;
@@ -2475,12 +2483,12 @@ static void nice_legend_evec(const char ***setname, int *nsets, char **LegendStr
 /* Makes a legend for the xvg output file. Call on MASTER only! */
 static void write_edo_legend(gmx_edsam_t ed, int nED, const gmx_output_env_t *oenv)
 {
-    t_edpar     *edi = NULL;
+    t_edpar     *edi = nullptr;
     int          i;
     int          nr_edi, nsets, n_flood, n_edsam;
     const char **setname;
     char         buf[STRLEN];
-    char        *LegendStr = NULL;
+    char        *LegendStr = nullptr;
 
 
     edi         = ed->edpar;
@@ -2650,33 +2658,44 @@ static void write_edo_legend(gmx_edsam_t ed, int nED, const gmx_output_env_t *oe
 
 /* Init routine for ED and flooding. Calls init_edi in a loop for every .edi-cycle
  * contained in the input file, creates a NULL terminated list of t_edpar structures */
-void init_edsam(const gmx_mtop_t *mtop,
-                const t_inputrec *ir,
-                t_commrec        *cr,
-                gmx_edsam_t       ed,
-                rvec              x[],
-                matrix            box,
-                edsamstate_t     *EDstate)
-{
-    t_edpar *edi = NULL;                    /* points to a single edi data set */
-    int      i, nr_edi, avindex;
-    rvec    *x_pbc  = NULL;                 /* positions of the whole MD system with pbc removed  */
-    rvec    *xfit   = NULL, *xstart = NULL; /* dummy arrays to determine initial RMSDs  */
-    rvec     fit_transvec;                  /* translation ... */
-    matrix   fit_rotmat;                    /* ... and rotation from fit to reference structure */
-    rvec    *ref_x_old = NULL;              /* helper pointer */
+gmx_edsam_t init_edsam(
+        const char             *ediFileName,
+        const char             *edoFileName,
+        const gmx_mtop_t       *mtop,
+        const t_inputrec       *ir,
+        t_commrec              *cr,
+        gmx_constr             *constr,
+        rvec                    x[],
+        matrix                  box,
+        ObservablesHistory     *oh,
+        const gmx_output_env_t *oenv,
+        gmx_bool                bAppend)
+{
+    t_edpar *edi = nullptr;                       /* points to a single edi data set */
+    int      i, avindex;
+    int      nED    = 0;                          /* Number of ED data sets */
+    rvec    *x_pbc  = nullptr;                    /* positions of the whole MD system with pbc removed  */
+    rvec    *xfit   = nullptr, *xstart = nullptr; /* dummy arrays to determine initial RMSDs  */
+    rvec     fit_transvec;                        /* translation ... */
+    matrix   fit_rotmat;                          /* ... and rotation from fit to reference structure */
+    rvec    *ref_x_old = nullptr;                 /* helper pointer */
+
 
     if (MASTER(cr))
     {
         fprintf(stderr, "ED: Initializing essential dynamics constraints.\n");
 
-        if (NULL == ed)
+        if (oh->edsamHistory != nullptr && oh->edsamHistory->bFromCpt && !gmx_fexist(ediFileName) )
         {
-            gmx_fatal(FARGS, "The checkpoint file you provided is from an essential dynamics or\n"
-                      "flooding simulation. Please also provide the correct .edi file with -ei.\n");
+            gmx_fatal(FARGS, "The checkpoint file you provided is from an essential dynamics or flooding\n"
+                      "simulation. Please also set the .edi file on the command line with -ei.\n");
         }
     }
 
+    /* Open input and output files, allocate space for ED data structure */
+    gmx_edsam_t ed = ed_open(mtop->natoms, oh, ediFileName, edoFileName, bAppend, oenv, cr);
+    saveEdsamPointer(constr, ed);
+
     /* Needed for initializing radacc radius in do_edsam */
     ed->bFirst = TRUE;
 
@@ -2690,7 +2709,7 @@ void init_edsam(const gmx_mtop_t *mtop,
          * as well, but will be done in the order given in the edi file, so
          * expect different results for different order of edi file concatenation! */
         edi = ed->edpar;
-        while (edi != NULL)
+        while (edi != nullptr)
         {
             init_edi(mtop, edi);
             init_flood(edi, ed, ir->delta_t);
@@ -2702,20 +2721,23 @@ void init_edsam(const gmx_mtop_t *mtop,
      * not before dd_partition_system which is called after init_edsam */
     if (MASTER(cr))
     {
+        edsamhistory_t *EDstate = oh->edsamHistory.get();
+
         if (!EDstate->bFromCpt)
         {
             /* Remove PBC, make molecule(s) subject to ED whole. */
             snew(x_pbc, mtop->natoms);
             copy_rvecn(x, x_pbc, 0, mtop->natoms);
-            do_pbc_first_mtop(NULL, ir->ePBC, box, mtop, x_pbc);
+            do_pbc_first_mtop(nullptr, ir->ePBC, box, mtop, x_pbc);
         }
         /* Reset pointer to first ED data set which contains the actual ED data */
         edi = ed->edpar;
         GMX_ASSERT(NULL != edi,
                    "The pointer to the essential dynamics parameters is undefined");
 
+        nED = EDstate->nED;
         /* Loop over all ED/flooding data sets (usually only one, though) */
-        for (nr_edi = 1; nr_edi <= EDstate->nED; nr_edi++)
+        for (int nr_edi = 1; nr_edi <= EDstate->nED; nr_edi++)
         {
             /* For multiple ED groups we use the output frequency that was specified
              * in the first set */
@@ -2909,18 +2931,17 @@ void init_edsam(const gmx_mtop_t *mtop,
     if (PAR(cr))
     {
         /* First let everybody know how many ED data sets to expect */
-        gmx_bcast(sizeof(EDstate->nED), &EDstate->nED, cr);
+        gmx_bcast(sizeof(nED), &nED, cr);
         /* Broadcast the essential dynamics / flooding data to all nodes */
-        broadcast_ed_data(cr, ed, EDstate->nED);
+        broadcast_ed_data(cr, ed, nED);
     }
     else
     {
         /* In the single-CPU case, point the local atom numbers pointers to the global
          * one, so that we can use the same notation in serial and parallel case: */
-
         /* Loop over all ED data sets (usually only one, though) */
         edi = ed->edpar;
-        for (nr_edi = 1; nr_edi <= EDstate->nED; nr_edi++)
+        for (int nr_edi = 1; nr_edi <= nED; nr_edi++)
         {
             edi->sref.anrs_loc = edi->sref.anrs;
             edi->sav.anrs_loc  = edi->sav.anrs;
@@ -2959,7 +2980,7 @@ void init_edsam(const gmx_mtop_t *mtop,
     /* Allocate space for ED buffer variables */
     /* Again, loop over ED data sets */
     edi = ed->edpar;
-    for (nr_edi = 1; nr_edi <= EDstate->nED; nr_edi++)
+    for (int nr_edi = 1; nr_edi <= nED; nr_edi++)
     {
         /* Allocate space for ED buffer variables */
         snew_bc(cr, edi->buf, 1); /* MASTER has already allocated edi->buf in init_edi() */
@@ -2997,6 +3018,8 @@ void init_edsam(const gmx_mtop_t *mtop,
     {
         fflush(ed->edo);
     }
+
+    return ed;
 }
 
 
@@ -3030,7 +3053,7 @@ void do_edsam(const t_inputrec *ir,
     /* Loop over all ED groups (usually one) */
     edi   = ed->edpar;
     edinr = 0;
-    while (edi != NULL)
+    while (edi != nullptr)
     {
         edinr++;
         if (bNeedDoEdsam(edi))
@@ -3161,7 +3184,7 @@ void do_edsam(const t_inputrec *ir,
                     /* dx is the ED correction to the positions: */
                     rvec_sub(x_unsh, xs[edi->sav.anrs_loc[i]], dx);
 
-                    if (v != NULL)
+                    if (v != nullptr)
                     {
                         /* dv is the ED correction to the velocity: */
                         svmul(dt_1, dx, dv);
index 57afb0fcf4b3dad17a52b793f30d0fbd69167c2b..5e882083c546e1cdf9b3e0fb0c277674408a5f2e 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,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.
 #include "gromacs/math/vectypes.h"
 #include "gromacs/utility/basedefinitions.h"
 
-struct gmx_output_env_t;
-struct t_filenm;
 
 /*! \brief Abstract type for essential dynamics
  *
- * The main type is defined only in edsam.c
+ * The main type is defined only in edsam.cpp
  */
 typedef struct gmx_edsam *gmx_edsam_t;
 
-struct edsamstate_t;
-struct t_commrec;
-struct t_inputrec;
 struct gmx_domdec_t;
 struct gmx_mtop_t;
+struct gmx_output_env_t;
+struct ObservablesHistory;
+struct t_commrec;
+struct t_filenm;
+struct t_inputrec;
 
 /*! \brief Applies essential dynamics constrains as defined in the .edi input file.
  *
@@ -80,40 +80,34 @@ void do_edsam(const t_inputrec *ir, gmx_int64_t step,
               t_commrec *cr, rvec xs[], rvec v[], matrix box, gmx_edsam_t ed);
 
 
-/*! \brief Reads in the .edi file containing the essential dynamics and flooding data.
- *
- * This function opens the ED input and output files, reads in all datasets it finds
- * in the input file, and cross-checks whether the .edi file information is consistent
- * with the essential dynamics data found in the checkpoint file (if present).
- * gmx make_edi can be used to create an .edi input file.
- *
- * \param natoms            Number of atoms of the whole MD system.
- * \param EDstate           Essential dynamics and flooding data stored in the checkpoint file.
- * \param nfile             Number of entries (files) in the fnm structure.
- * \param fnm               The filenames struct; it contains also the names of the
- *                          essential dynamics and flooding in + output files.
- * \param Flags             Flags passed over from main, used to determine
- *                          whether we are appending.
- * \param oenv              Needed to open the output xvgr file.
- * \param cr                Data needed for MPI communication.
- * \returns                 Pointer to the initialized essential dynamics / flooding data.
- */
-gmx_edsam_t ed_open(int natoms, edsamstate_t *EDstate, int nfile, const t_filenm fnm[],
-                    unsigned long Flags, const gmx_output_env_t *oenv, t_commrec *cr);
-
 /*! \brief Initializes the essential dynamics and flooding module.
  *
+ * \param ediFileName       Essential dynamics input file.
+ * \param edoFileName       Output file for essential dynamics data.
  * \param mtop              Molecular topology.
  * \param ir                MD input parameter record.
  * \param cr                Data needed for MPI communication.
- * \param ed                The essential dynamics data.
+ * \param constr            Data structure keeping the constraint information.
  * \param x                 Positions of the whole MD system.
  * \param box               The simulation box.
- * \param EDstate           ED data stored in the checkpoint file.
+ * \param oh                The observables history container.
+ * \param oenv              The output environment information.
+ * \param bAppend           Append to existing output files?
+ *
+ * \returns                 A pointer to the ED data structure.
  */
-void init_edsam(const gmx_mtop_t *mtop, const t_inputrec *ir, t_commrec *cr,
-                gmx_edsam_t ed, rvec x[], matrix box, edsamstate_t *EDstate);
-
+gmx_edsam_t init_edsam(
+        const char             *ediFileName,
+        const char             *edoFileName,
+        const gmx_mtop_t       *mtop,
+        const t_inputrec       *ir,
+        t_commrec              *cr,
+        struct gmx_constr      *constr,
+        rvec                    x[],
+        matrix                  box,
+        ObservablesHistory     *oh,
+        const gmx_output_env_t *oenv,
+        gmx_bool                bAppend);
 
 /*! \brief Make a selection of the home atoms for the ED groups.
  *
index 866d0688509695c461e560d2039c2d5d0213ddda..8d1904c46920d594f3a63d99d94e0dc80032bdc6 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,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.
@@ -36,5 +36,5 @@ file(GLOB EWALD_SOURCES *.cpp)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${EWALD_SOURCES} PARENT_SCOPE)
 
 if (BUILD_TESTING)
-#    add_subdirectory(tests)
+    add_subdirectory(tests)
 endif()
index 89767dc67fa09262b2efc26bbab4b412805254c3..7ac0997af58122d8621115d14a0cbada6376027c 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,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.
 
 #include "gromacs/math/utilities.h"
 #include "gromacs/math/vec.h"
-#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
 
 #include "pme-internal.h"
 
-static void make_dft_mod(real *mod, real *data, int ndata)
+static void make_dft_mod(real *mod,
+                         const double *data, int splineOrder, int ndata)
 {
-    int  i, j;
-    real sc, ss, arg;
-
-    for (i = 0; i < ndata; i++)
+    for (int i = 0; i < ndata; i++)
     {
-        sc = ss = 0;
-        for (j = 0; j < ndata; j++)
+        /* We use double precision, since this is only called once per grid.
+         * But for single precision bsp_mod, single precision also seems
+         * to give full accuracy.
+         */
+        double sc = 0;
+        double ss = 0;
+        for (int j = 0; j < splineOrder; j++)
         {
-            arg = (2.0*M_PI*i*j)/ndata;
-            sc += data[j]*cos(arg);
-            ss += data[j]*sin(arg);
+            double arg  = (2.0*M_PI*i*(j + 1))/ndata;
+            sc         += data[j]*cos(arg);
+            ss         += data[j]*sin(arg);
         }
-        mod[i] = sc*sc+ss*ss;
+        mod[i] = sc*sc + ss*ss;
     }
-    for (i = 0; i < ndata; i++)
+    if (splineOrder % 2 == 0 && ndata % 2 == 0)
     {
-        if (mod[i] < 1e-7)
-        {
-            mod[i] = (mod[i-1]+mod[i+1])*0.5;
-        }
+        /* Note that pme_order = splineOrder + 1 */
+        GMX_RELEASE_ASSERT(mod[ndata/2] < GMX_DOUBLE_EPS, "With even spline order and even grid size (ndata), dft_mod[ndata/2] should first come out as zero");
+        /* This factor causes a division by zero. But since this occurs in
+         * the tail of the distribution, the term with this factor can
+         * be ignored (see Essmann et al. JCP 103, 8577).
+         * Using the average of the neighbors probably originates from
+         * Tom Darden's original PME code. It seems to give slighlty better
+         * accuracy than using a large value.
+         */
+        mod[ndata/2] = (mod[ndata/2 - 1] + mod[ndata/2 + 1])*0.5;
     }
 }
 
 void make_bspline_moduli(splinevec bsp_mod,
-                         int nx, int ny, int nz, int order)
+                         int nx, int ny, int nz, int pme_order)
 {
-    int   nmax = std::max(nx, std::max(ny, nz));
-    real *data, *ddata, *bsp_data;
-    int   i, k, l;
-    real  div;
+    /* We use double precision, since this is only called once per grid.
+     * But for single precision bsp_mod, single precision also seems
+     * to give full accuracy.
+     */
+    double *data;
 
-    snew(data, order);
-    snew(ddata, order);
-    snew(bsp_data, nmax);
+    /* In GROMACS we, confusingly, defined pme-order as the order
+     * of the cardinal B-spline + 1. This probably happened because
+     * the smooth PME paper only talks about "n" which is the number
+     * of points we spread to and that was chosen to be pme-order.
+     */
+    const int splineOrder = pme_order - 1;
 
-    data[order-1] = 0;
-    data[1]       = 0;
-    data[0]       = 1;
+    snew(data, splineOrder);
 
-    for (k = 3; k < order; k++)
+    data[0]     = 1;
+    for (int k = 1; k < splineOrder; k++)
     {
-        div       = 1.0/(k-1.0);
-        data[k-1] = 0;
-        for (l = 1; l < (k-1); l++)
-        {
-            data[k-l-1] = div*(l*data[k-l-2]+(k-l)*data[k-l-1]);
-        }
-        data[0] = div*data[0];
+        data[k] = 0;
     }
-    /* differentiate */
-    ddata[0] = -data[0];
-    for (k = 1; k < order; k++)
-    {
-        ddata[k] = data[k-1]-data[k];
-    }
-    div           = 1.0/(order-1);
-    data[order-1] = 0;
-    for (l = 1; l < (order-1); l++)
-    {
-        data[order-l-1] = div*(l*data[order-l-2]+(order-l)*data[order-l-1]);
-    }
-    data[0] = div*data[0];
 
-    for (i = 0; i < nmax; i++)
+    for (int k = 2; k <= splineOrder; k++)
     {
-        bsp_data[i] = 0;
-    }
-    for (i = 1; i <= order; i++)
-    {
-        bsp_data[i] = data[i-1];
+        double div  = 1.0/k;
+        for (int m = k - 1; m > 0; m--)
+        {
+            data[m] = div*((k - m)*data[m - 1] + (m + 1)*data[m]);
+        }
+        data[0]     = div*data[0];
     }
 
-    make_dft_mod(bsp_mod[XX], bsp_data, nx);
-    make_dft_mod(bsp_mod[YY], bsp_data, ny);
-    make_dft_mod(bsp_mod[ZZ], bsp_data, nz);
+    make_dft_mod(bsp_mod[XX], data, splineOrder, nx);
+    make_dft_mod(bsp_mod[YY], data, splineOrder, ny);
+    make_dft_mod(bsp_mod[ZZ], data, splineOrder, nz);
 
     sfree(data);
-    sfree(ddata);
-    sfree(bsp_data);
 }
 
 /* Return the P3M optimal influence function */
@@ -172,7 +165,7 @@ static void make_p3m_bspline_moduli_dim(real *bsp_mod, int n, int order)
 
     if (order > 8)
     {
-        gmx_fatal(FARGS, "The current P3M code only supports orders up to 8");
+        GMX_THROW(gmx::InconsistentInputError("The current P3M code only supports orders up to 8"));
     }
 
     zarg = M_PI/n;
index 1f508cddc9fd98c144cc2edcfe60a2721064a43a..ce3521a16fd3f710d4a2d2b364f9264a28ddf4b0 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,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.
@@ -87,9 +87,9 @@ void init_ewald_tab(struct gmx_ewald_tab_t **et, const t_inputrec *ir, FILE *fp)
     (*et)->ny       = ir->nky+1;
     (*et)->nz       = ir->nkz+1;
     (*et)->kmax     = std::max((*et)->nx, std::max((*et)->ny, (*et)->nz));
-    (*et)->eir      = NULL;
-    (*et)->tab_xy   = NULL;
-    (*et)->tab_qxyz = NULL;
+    (*et)->eir      = nullptr;
+    (*et)->tab_xy   = nullptr;
+    (*et)->tab_qxyz = nullptr;
 }
 
 //! Calculates wave vectors.
@@ -151,7 +151,7 @@ real do_ewald(t_inputrec *ir,
     real     tmp, cs, ss, ak, akv, mx, my, mz, m2, scale;
     gmx_bool bFreeEnergy;
 
-    if (cr != NULL)
+    if (cr != nullptr)
     {
         if (PAR(cr))
         {
index ae5ff5ed23c2116d688420cff6852c0a1bbaab58..a37e6113cfc43b4ae0f8358e670ce54c88542968 100644 (file)
@@ -107,8 +107,9 @@ void ewald_LRcorrection(int numAtomsLocal,
     tensor      dxdf_q = {{0}}, dxdf_lj = {{0}};
     real        vol    = box[XX][XX]*box[YY][YY]*box[ZZ][ZZ];
     real        L1_q, L1_lj, dipole_coeff, qqA, qqB, qqL, vr0_q, vr0_lj = 0;
-    gmx_bool    bMolPBC      = fr->bMolPBC;
-    gmx_bool    bDoingLBRule = (fr->ljpme_combination_rule == eljpmeLB);
+    real        chargecorr[2] = { 0, 0 };
+    gmx_bool    bMolPBC       = fr->bMolPBC;
+    gmx_bool    bDoingLBRule  = (fr->ljpme_combination_rule == eljpmeLB);
     gmx_bool    bNeedLongRangeCorrection;
 
     /* This routine can be made faster by using tables instead of analytical interactions
@@ -157,9 +158,17 @@ void ewald_LRcorrection(int numAtomsLocal,
             }
             break;
         case eewg3DC:
-            dipole_coeff = 2*M_PI*one_4pi_eps/vol;
-            dipcorrA[ZZ] = 2*dipole_coeff*mutot[0][ZZ];
-            dipcorrB[ZZ] = 2*dipole_coeff*mutot[1][ZZ];
+            dipole_coeff  = 2*M_PI*one_4pi_eps/vol;
+            dipcorrA[ZZ]  = 2*dipole_coeff*mutot[0][ZZ];
+            dipcorrB[ZZ]  = 2*dipole_coeff*mutot[1][ZZ];
+            for (int q = 0; q < (bHaveChargeOrTypePerturbed ? 2 : 1); q++)
+            {
+                /* Avoid charge corrections with near-zero net charge */
+                if (fabs(fr->qsum[q]) > 1e-4)
+                {
+                    chargecorr[q] = 2*dipole_coeff*fr->qsum[q];
+                }
+            }
             break;
         default:
             gmx_incons("Unsupported Ewald geometry");
@@ -330,6 +339,10 @@ void ewald_LRcorrection(int numAtomsLocal,
                 {
                     f[i][j] -= dipcorrA[j]*chargeA[i];
                 }
+                if (chargecorr[0] != 0)
+                {
+                    f[i][ZZ] += chargecorr[0]*chargeA[i]*x[i][ZZ];
+                }
             }
         }
     }
@@ -478,6 +491,11 @@ void ewald_LRcorrection(int numAtomsLocal,
                     f[i][j] -= L1_q*dipcorrA[j]*chargeA[i]
                         + lambda_q*dipcorrB[j]*chargeB[i];
                 }
+                if (chargecorr[0] != 0 || chargecorr[1] != 0)
+                {
+                    f[i][ZZ] += (L1_q*chargecorr[0]*chargeA[i]
+                                 + lambda_q*chargecorr[1])*x[i][ZZ];
+                }
             }
         }
     }
@@ -510,8 +528,9 @@ void ewald_LRcorrection(int numAtomsLocal,
                 }
             }
 
-            /* Apply surface dipole correction:
-             * correction = dipole_coeff * (dipole)^2
+            /* Apply surface and charged surface dipole correction:
+             * correction = dipole_coeff * ( (dipole)^2
+             *              - qsum*sum_i q_i z_i^2 - qsum^2 * box_z^2 / 12 )
              */
             if (dipole_coeff != 0)
             {
@@ -522,6 +541,23 @@ void ewald_LRcorrection(int numAtomsLocal,
                 else if (ewald_geometry == eewg3DC)
                 {
                     Vdipole[q] = dipole_coeff*mutot[q][ZZ]*mutot[q][ZZ];
+
+                    if (chargecorr[q] != 0)
+                    {
+                        /* Here we use a non thread-parallelized loop,
+                         * because this is the only loop over atoms for
+                         * energies and they need reduction (unlike forces).
+                         * We could implement a reduction over threads,
+                         * but this case is rarely used.
+                         */
+                        const real *qPtr   = (q == 0 ? chargeA : chargeB);
+                        real        sumQZ2 = 0;
+                        for (int i = 0; i < numAtomsLocal; i++)
+                        {
+                            sumQZ2 += qPtr[i]*x[i][ZZ]*x[i][ZZ];
+                        }
+                        Vdipole[q] -= dipole_coeff*fr->qsum[q]*(sumQZ2 + fr->qsum[q]*box[ZZ][ZZ]*box[ZZ][ZZ]/12);
+                    }
                 }
             }
         }
index 4068790b545ffc5e887357af04edb4e078233cf9..a1112f99bc8cf8df0f2e31545f452c43e51a1433 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,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.
 
 #include "gmxpre.h"
 
+#include "pme-gather.h"
+
 #include "gromacs/math/vec.h"
 #include "gromacs/simd/simd.h"
 #include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/typetraits.h"
 
 #include "pme-internal.h"
 #include "pme-simd.h"
 
 using namespace gmx; // TODO: Remove when this file is moved into gmx namespace
 
-#define DO_FSPLINE(order)                      \
-    for (ithx = 0; (ithx < order); ithx++)              \
-    {                                              \
-        index_x = (i0+ithx)*pny*pnz;               \
-        tx      = thx[ithx];                       \
-        dx      = dthx[ithx];                      \
-                                               \
-        for (ithy = 0; (ithy < order); ithy++)          \
-        {                                          \
-            index_xy = index_x+(j0+ithy)*pnz;      \
-            ty       = thy[ithy];                  \
-            dy       = dthy[ithy];                 \
-            fxy1     = fz1 = 0;                    \
-                                               \
-            for (ithz = 0; (ithz < order); ithz++)      \
-            {                                      \
-                gval  = grid[index_xy+(k0+ithz)];  \
-                fxy1 += thz[ithz]*gval;            \
-                fz1  += dthz[ithz]*gval;           \
-            }                                      \
-            fx += dx*ty*fxy1;                      \
-            fy += tx*dy*fxy1;                      \
-            fz += tx*ty*fz1;                       \
-        }                                          \
+/* Spline function. Goals: 1) Force compiler to instantiate function separately
+   for each compile-time value of order and once more for any possible (runtime)
+   value. 2) Allow overloading for specific compile-time values.
+   The Int template argument can be either int (runtime) or an object of type
+   integral_constant<int, N> (compile-time). Common runtime values can be
+   converted to compile-time values with a switch statement. For the compile
+   value the compiler is required to instantiate the function separately for
+   each value. The function can be overloaded for specific compile-time values
+   using integral_constant<int, N> where N is either a specific value or an
+   enable_if constrained non-type template parameter. The most specific overload
+   (specific value > int template parameter > general function) is called. Inside
+   the function the order argument can be used as regular int because
+   integral_constant has a proper conversion.
+
+   SIMD do_fspline() template funtions will be used for PME order 4 and 5
+   when the SIMD module has support for SIMD4 for the architecture used.
+   For SIMD4 without unaligned load/store support:
+     order 4 and 5 use the order 4+5 aligned SIMD template
+   For SIMD4 with unaligned load/store support:
+     order 4 uses the order 4 unaligned SIMD template
+     order 5 uses the order 4+5 aligned SIMD template
+ */
+struct do_fspline
+{
+    do_fspline (
+            const gmx_pme_t *                   pme,
+            const real * gmx_restrict           grid,
+            const pme_atomcomm_t * gmx_restrict atc,
+            const splinedata_t * gmx_restrict   spline,
+            int                                 nn)
+        : pme(pme), grid(grid), atc(atc), spline(spline), nn(nn) {}
+
+    template <typename Int>
+    RVec operator()(Int order) const
+    {
+        static_assert(isIntegralConstant<Int, int>::value || std::is_same<Int, int>::value,
+                      "'order' needs to be either of type integral_constant<int,N> or int.");
+
+        const int  norder = nn*order;
+
+        /* Pointer arithmetic alert, next six statements */
+        const real *const gmx_restrict thx  = spline->theta[XX] + norder;
+        const real *const gmx_restrict thy  = spline->theta[YY] + norder;
+        const real *const gmx_restrict thz  = spline->theta[ZZ] + norder;
+        const real *const gmx_restrict dthx = spline->dtheta[XX] + norder;
+        const real *const gmx_restrict dthy = spline->dtheta[YY] + norder;
+        const real *const gmx_restrict dthz = spline->dtheta[ZZ] + norder;
+
+        RVec                           f(0, 0, 0);
+
+        for (int ithx = 0; (ithx < order); ithx++)
+        {
+            const int  index_x = (idxX + ithx)*gridNY*gridNZ;
+            const real tx      = thx[ithx];
+            const real dx      = dthx[ithx];
+
+            for (int ithy = 0; (ithy < order); ithy++)
+            {
+                const int  index_xy = index_x + (idxY + ithy)*gridNZ;
+                const real ty       = thy[ithy];
+                const real dy       = dthy[ithy];
+                real       fxy1     = 0, fz1 = 0;
+
+                for (int ithz = 0; (ithz < order); ithz++)
+                {
+                    const real gval = grid[index_xy + (idxZ + ithz)];
+                    fxy1 += thz[ithz]*gval;
+                    fz1  += dthz[ithz]*gval;
+                }
+                f[XX] += dx*ty*fxy1;
+                f[YY] += tx*dy*fxy1;
+                f[ZZ] += tx*ty*fz1;
+            }
+        }
+
+        return f;
     }
 
+#ifdef PME_SIMD4_UNALIGNED //TODO: Consider always have at least a dummy implementation of Simd (enough for first phase of two-phase lookup) and then use enable_if instead of #ifdef
+/* Gather for one charge with pme_order=4 with unaligned SIMD4 load+store.
+ * This code does not assume any memory alignment for the grid.
+ */
+    RVec
+    operator()(std::integral_constant<int, 4>) const
+    {
+        const int                      norder = nn*4;
+        /* Pointer arithmetic alert, next six statements */
+        const real *const gmx_restrict thx  = spline->theta[XX] + norder;
+        const real *const gmx_restrict thy  = spline->theta[YY] + norder;
+        const real *const gmx_restrict thz  = spline->theta[ZZ] + norder;
+        const real *const gmx_restrict dthx = spline->dtheta[XX] + norder;
+        const real *const gmx_restrict dthy = spline->dtheta[YY] + norder;
+        const real *const gmx_restrict dthz = spline->dtheta[ZZ] + norder;
 
-void gather_f_bsplines(struct gmx_pme_t *pme, real *grid,
-                       gmx_bool bClearF, pme_atomcomm_t *atc,
-                       splinedata_t *spline,
-                       real scale)
-{
-    /* sum forces for local particles */
-    int    nn, n, ithx, ithy, ithz, i0, j0, k0;
-    int    index_x, index_xy;
-    int    nx, ny, nz, pny, pnz;
-    int   *idxptr;
-    real   tx, ty, dx, dy, coefficient;
-    real   fx, fy, fz, gval;
-    real   fxy1, fz1;
-    real  *thx, *thy, *thz, *dthx, *dthy, *dthz;
-    int    norder;
-    real   rxx, ryx, ryy, rzx, rzy, rzz;
-    int    order;
+        Simd4Real                      fx_S = setZero();
+        Simd4Real                      fy_S = setZero();
+        Simd4Real                      fz_S = setZero();
+
+        /* With order 4 the z-spline is actually aligned */
+        const Simd4Real tz_S = load4(thz);
+        const Simd4Real dz_S = load4(dthz);
+
+        for (int ithx = 0; (ithx < 4); ithx++)
+        {
+            const int       index_x = (idxX + ithx)*gridNY*gridNZ;
+            const Simd4Real tx_S    = Simd4Real(thx[ithx]);
+            const Simd4Real dx_S    = Simd4Real(dthx[ithx]);
+
+            for (int ithy = 0; (ithy < 4); ithy++)
+            {
+                const int       index_xy = index_x + (idxY + ithy)*gridNZ;
+                const Simd4Real ty_S     = Simd4Real(thy[ithy]);
+                const Simd4Real dy_S     = Simd4Real(dthy[ithy]);
+
+                const Simd4Real gval_S = load4U(grid + index_xy + idxZ);
+
+                const Simd4Real fxy1_S = tz_S * gval_S;
+                const Simd4Real fz1_S  = dz_S * gval_S;
+
+                fx_S = fma(dx_S * ty_S, fxy1_S, fx_S);
+                fy_S = fma(tx_S * dy_S, fxy1_S, fy_S);
+                fz_S = fma(tx_S * ty_S, fz1_S, fz_S);
+            }
+        }
+
+        return {
+                   reduce(fx_S), reduce(fy_S), reduce(fz_S)
+        };
+    }
+#endif
 
 #ifdef PME_SIMD4_SPREAD_GATHER
-    // cppcheck-suppress unreadVariable cppcheck seems not to analyze code from pme-simd4.h
-    struct pme_spline_work *work = pme->spline_work;
-#ifndef PME_SIMD4_UNALIGNED
-    GMX_ALIGNED(real, GMX_SIMD4_WIDTH)  thz_aligned[GMX_SIMD4_WIDTH*2];
-    GMX_ALIGNED(real, GMX_SIMD4_WIDTH)  dthz_aligned[GMX_SIMD4_WIDTH*2];
+/* Load order elements from unaligned memory into two 4-wide SIMD */
+    template<int order>
+    static inline void loadOrderU(const real* data, std::integral_constant<int, order>,
+                                  int offset, Simd4Real* S0, Simd4Real* S1)
+    {
+#ifdef PME_SIMD4_UNALIGNED //TODO: Extract into helper function
+        *S0 = load4U(data-offset);
+        *S1 = load4U(data-offset+4);
+#else
+        GMX_ALIGNED(real, GMX_SIMD4_WIDTH)  buf_aligned[GMX_SIMD4_WIDTH*2];
+        /* Copy data to an aligned buffer */
+        for (int i = 0; i < order; i++)
+        {
+            buf_aligned[offset+i]  = data[i];
+        }
+        *S0 = load4(buf_aligned);
+        *S1 = load4(buf_aligned+4);
 #endif
+    }
 #endif
 
-    order = pme->pme_order;
-    nx    = pme->nkx;
-    ny    = pme->nky;
-    nz    = pme->nkz;
-    pny   = pme->pmegrid_ny;
-    pnz   = pme->pmegrid_nz;
-
-    rxx   = pme->recipbox[XX][XX];
-    ryx   = pme->recipbox[YY][XX];
-    ryy   = pme->recipbox[YY][YY];
-    rzx   = pme->recipbox[ZZ][XX];
-    rzy   = pme->recipbox[ZZ][YY];
-    rzz   = pme->recipbox[ZZ][ZZ];
-
-    for (nn = 0; nn < spline->n; nn++)
+#ifdef PME_SIMD4_SPREAD_GATHER
+/* This code assumes that the grid is allocated 4-real aligned
+ * and that pme->pmegrid_nz is a multiple of 4.
+ * This code supports pme_order <= 5.
+ */
+    template <int Order>
+    typename std::enable_if<Order == 4 || Order == 5, RVec>::type
+    operator()(std::integral_constant<int, Order>  order) const
     {
-        n           = spline->ind[nn];
-        coefficient = scale*atc->coefficient[n];
+        const int                     norder = nn*order;
+        GMX_ASSERT(gridNZ % 4 == 0, "For aligned SIMD4 operations the grid size has to be padded up to a multiple of 4");
+        /* Pointer arithmetic alert, next six statements */
+        const real *const gmx_restrict thx  = spline->theta[XX] + norder;
+        const real *const gmx_restrict thy  = spline->theta[YY] + norder;
+        const real *const gmx_restrict thz  = spline->theta[ZZ] + norder;
+        const real *const gmx_restrict dthx = spline->dtheta[XX] + norder;
+        const real *const gmx_restrict dthy = spline->dtheta[YY] + norder;
+        const real *const gmx_restrict dthz = spline->dtheta[ZZ] + norder;
+
+        struct pme_spline_work *const  work = pme->spline_work;
+
+        const int                      offset = idxZ & 3;
+
+        Simd4Real                      fx_S = setZero();
+        Simd4Real                      fy_S = setZero();
+        Simd4Real                      fz_S = setZero();
+
+        Simd4Real                      tz_S0, tz_S1, dz_S0, dz_S1;
+        loadOrderU(thz,  order, offset, &tz_S0, &tz_S1);
+        loadOrderU(dthz, order, offset, &dz_S0, &dz_S1);
+
+        tz_S0 = selectByMask(tz_S0, work->mask_S0[offset]);
+        dz_S0 = selectByMask(dz_S0, work->mask_S0[offset]);
+        tz_S1 = selectByMask(tz_S1, work->mask_S1[offset]);
+        dz_S1 = selectByMask(dz_S1, work->mask_S1[offset]);
+
+        for (int ithx = 0; (ithx < order); ithx++)
+        {
+            const int       index_x  = (idxX + ithx)*gridNY*gridNZ;
+            const Simd4Real tx_S     = Simd4Real(thx[ithx]);
+            const Simd4Real dx_S     = Simd4Real(dthx[ithx]);
+
+            for (int ithy = 0; (ithy < order); ithy++)
+            {
+                const int       index_xy = index_x + (idxY + ithy)*gridNZ;
+                const Simd4Real ty_S     = Simd4Real(thy[ithy]);
+                const Simd4Real dy_S     = Simd4Real(dthy[ithy]);
+
+                const Simd4Real gval_S0 = load4(grid + index_xy + idxZ - offset);
+                const Simd4Real gval_S1 = load4(grid + index_xy + idxZ - offset + 4);
+
+                const Simd4Real fxy1_S0 = tz_S0 * gval_S0;
+                const Simd4Real fz1_S0  = dz_S0 * gval_S0;
+                const Simd4Real fxy1_S1 = tz_S1 * gval_S1;
+                const Simd4Real fz1_S1  = dz_S1 * gval_S1;
+
+                const Simd4Real fxy1_S = fxy1_S0 + fxy1_S1;
+                const Simd4Real fz1_S  = fz1_S0 + fz1_S1;
+
+                fx_S = fma(dx_S * ty_S, fxy1_S, fx_S);
+                fy_S = fma(tx_S * dy_S, fxy1_S, fy_S);
+                fz_S = fma(tx_S * ty_S, fz1_S, fz_S);
+            }
+        }
+
+        return {
+                   reduce(fx_S), reduce(fy_S), reduce(fz_S)
+        };
+    }
+#endif
+    private:
+        const gmx_pme_t *const                   pme;
+        const real *const gmx_restrict           grid;
+        const pme_atomcomm_t *const gmx_restrict atc;
+        const splinedata_t *const gmx_restrict   spline;
+        const int                                nn;
+
+        const int                                gridNY = pme->pmegrid_ny;
+        const int                                gridNZ = pme->pmegrid_nz;
+
+        const int *const                         idxptr = atc->idx[spline->ind[nn]];
+        const int                                idxX   = idxptr[XX];
+        const int                                idxY   = idxptr[YY];
+        const int                                idxZ   = idxptr[ZZ];
+};
+
+
+void gather_f_bsplines(const gmx_pme_t *pme, const real *grid,
+                       gmx_bool bClearF, const pme_atomcomm_t *atc,
+                       const splinedata_t *spline,
+                       real scale)
+{
+    /* sum forces for local particles */
+
+    const int  order = pme->pme_order;
+    const int  nx    = pme->nkx;
+    const int  ny    = pme->nky;
+    const int  nz    = pme->nkz;
+
+    const real rxx   = pme->recipbox[XX][XX];
+    const real ryx   = pme->recipbox[YY][XX];
+    const real ryy   = pme->recipbox[YY][YY];
+    const real rzx   = pme->recipbox[ZZ][XX];
+    const real rzy   = pme->recipbox[ZZ][YY];
+    const real rzz   = pme->recipbox[ZZ][ZZ];
+
+    /* Extract the buffer for force output */
+    rvec * gmx_restrict force = atc->f;
+
+    /* Note that unrolling this loop by templating this function on order
+     * deteriorates performance significantly with gcc5/6/7.
+     */
+    for (int nn = 0; nn < spline->n; nn++)
+    {
+        const int  n           = spline->ind[nn];
+        const real coefficient = scale*atc->coefficient[n];
 
         if (bClearF)
         {
-            atc->f[n][XX] = 0;
-            atc->f[n][YY] = 0;
-            atc->f[n][ZZ] = 0;
+            force[n][XX] = 0;
+            force[n][YY] = 0;
+            force[n][ZZ] = 0;
         }
         if (coefficient != 0)
         {
-            fx     = 0;
-            fy     = 0;
-            fz     = 0;
-            idxptr = atc->idx[n];
-            norder = nn*order;
-
-            i0   = idxptr[XX];
-            j0   = idxptr[YY];
-            k0   = idxptr[ZZ];
-
-            /* Pointer arithmetic alert, next six statements */
-            thx  = spline->theta[XX] + norder;
-            thy  = spline->theta[YY] + norder;
-            thz  = spline->theta[ZZ] + norder;
-            dthx = spline->dtheta[XX] + norder;
-            dthy = spline->dtheta[YY] + norder;
-            dthz = spline->dtheta[ZZ] + norder;
+            RVec       f;
+            const auto spline_func = do_fspline(pme, grid, atc, spline, nn);
 
             switch (order)
             {
                 case 4:
-#ifdef PME_SIMD4_SPREAD_GATHER
-#ifdef PME_SIMD4_UNALIGNED
-#define PME_GATHER_F_SIMD4_ORDER4
-#else
-#define PME_GATHER_F_SIMD4_ALIGNED
-#define PME_ORDER 4
-#endif
-#include "pme-simd4.h"
-#else
-                    DO_FSPLINE(4);
-#endif
+                    f = spline_func(std::integral_constant<int, 4>());
                     break;
                 case 5:
-#ifdef PME_SIMD4_SPREAD_GATHER
-#define PME_GATHER_F_SIMD4_ALIGNED
-#define PME_ORDER 5
-#include "pme-simd4.h"
-#else
-                    DO_FSPLINE(5);
-#endif
+                    f = spline_func(std::integral_constant<int, 5>());
                     break;
                 default:
-                    DO_FSPLINE(order);
+                    f = spline_func(order);
                     break;
             }
 
-            atc->f[n][XX] += -coefficient*( fx*nx*rxx );
-            atc->f[n][YY] += -coefficient*( fx*nx*ryx + fy*ny*ryy );
-            atc->f[n][ZZ] += -coefficient*( fx*nx*rzx + fy*ny*rzy + fz*nz*rzz );
+            force[n][XX] += -coefficient*( f[XX]*nx*rxx );
+            force[n][YY] += -coefficient*( f[XX]*nx*ryx + f[YY]*ny*ryy );
+            force[n][ZZ] += -coefficient*( f[XX]*nx*rzx + f[YY]*ny*rzy + f[ZZ]*nz*rzz );
         }
     }
     /* Since the energy and not forces are interpolated
@@ -193,17 +363,17 @@ void gather_f_bsplines(struct gmx_pme_t *pme, real *grid,
 }
 
 
-real gather_energy_bsplines(struct gmx_pme_t *pme, real *grid,
+real gather_energy_bsplines(gmx_pme_t *pme, real *grid,
                             pme_atomcomm_t *atc)
 {
     splinedata_t *spline;
-    int     n, ithx, ithy, ithz, i0, j0, k0;
-    int     index_x, index_xy;
-    int *   idxptr;
-    real    energy, pot, tx, ty, coefficient, gval;
-    real    *thx, *thy, *thz;
-    int     norder;
-    int     order;
+    int           n, ithx, ithy, ithz, i0, j0, k0;
+    int           index_x, index_xy;
+    int          *idxptr;
+    real          energy, pot, tx, ty, coefficient, gval;
+    real         *thx, *thy, *thz;
+    int           norder;
+    int           order;
 
     spline = &atc->spline[0];
 
index 5a47fee3576706f8c9ac43c33cbd4ced1c563787..fdee72a41b1ab71b6e4ddf2083b769a5adf6818f 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,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.
@@ -40,9 +40,9 @@
 #include "pme-internal.h"
 
 void
-gather_f_bsplines(struct gmx_pme_t *pme, real *grid,
-                  gmx_bool bClearF, pme_atomcomm_t *atc,
-                  splinedata_t *spline,
+gather_f_bsplines(const struct gmx_pme_t *pme, const real *grid,
+                  gmx_bool bClearF, const pme_atomcomm_t *atc,
+                  const splinedata_t *spline,
                   real scale);
 
 real
index d4ec0d361913b12cb4ec22cfc5264caa6c8cd043..5c01efa49970f17d4b35d403a88128ebbf62cf45 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,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.
@@ -44,6 +44,7 @@
 #include <cstdlib>
 
 #include "gromacs/ewald/pme.h"
+#include "gromacs/fft/parallel_3dfft.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/timing/cyclecounter.h"
 #include "gromacs/utility/fatalerror.h"
@@ -232,7 +233,7 @@ void gmx_sum_qgrid_dd(struct gmx_pme_t *pme, real *grid, int direction)
 #endif
 
 
-int copy_pmegrid_to_fftgrid(struct gmx_pme_t *pme, real *pmegrid, real *fftgrid, int grid_index)
+int copy_pmegrid_to_fftgrid(const gmx_pme_t *pme, real *pmegrid, real *fftgrid, int grid_index)
 {
     ivec    local_fft_ndata, local_fft_offset, local_fft_size;
     ivec    local_pme_size;
@@ -373,7 +374,7 @@ int copy_fftgrid_to_pmegrid(struct gmx_pme_t *pme, const real *fftgrid, real *pm
 }
 
 
-void wrap_periodic_pmegrid(struct gmx_pme_t *pme, real *pmegrid)
+void wrap_periodic_pmegrid(const gmx_pme_t *pme, real *pmegrid)
 {
     int     nx, ny, nz, pny, pnz, ny_x, overlap, ix, iy, iz;
 
@@ -567,7 +568,7 @@ void pmegrid_init(pmegrid_t *grid,
     }
 
     grid->order = pme_order;
-    if (ptr == NULL)
+    if (ptr == nullptr)
     {
         gridsize = grid->s[XX]*grid->s[YY]*grid->s[ZZ];
         set_gridsize_alignment(&gridsize, pme_order);
@@ -627,7 +628,7 @@ static void make_subgrid_division(const ivec n, int ovl, int nthread,
     }
 
     env = getenv("GMX_PME_THREAD_DIVISION");
-    if (env != NULL)
+    if (env != nullptr)
     {
         sscanf(env, "%20d %20d %20d", &nsub[XX], &nsub[YY], &nsub[ZZ]);
     }
@@ -658,7 +659,7 @@ void pmegrids_init(pmegrids_t *grids,
     n_base[ZZ] = nz_base;
 
     pmegrid_init(&grids->grid, 0, 0, 0, 0, 0, 0, n[XX], n[YY], n[ZZ], FALSE, pme_order,
-                 NULL);
+                 nullptr);
 
     grids->nthread = nthread;
 
@@ -716,10 +717,9 @@ void pmegrids_init(pmegrids_t *grids,
     }
     else
     {
-        grids->grid_th = NULL;
+        grids->grid_th = nullptr;
     }
 
-    snew(grids->g2t, DIM);
     tfac = 1;
     for (d = DIM-1; d >= 0; d--)
     {
@@ -751,7 +751,7 @@ void pmegrids_init(pmegrids_t *grids,
         {
             grids->nthread_comm[d]++;
         }
-        if (debug != NULL)
+        if (debug != nullptr)
         {
             fprintf(debug, "pmegrid thread grid communication range in %c: %d\n",
                     'x'+d, grids->nthread_comm[d]);
@@ -768,43 +768,42 @@ void pmegrids_init(pmegrids_t *grids,
 
 void pmegrids_destroy(pmegrids_t *grids)
 {
-    int t;
-
-    if (grids->grid.grid != NULL)
+    if (grids->grid.grid != nullptr)
     {
-        sfree(grids->grid.grid);
+        sfree_aligned(grids->grid.grid);
 
         if (grids->nthread > 0)
         {
-            for (t = 0; t < grids->nthread; t++)
-            {
-                sfree(grids->grid_th[t].grid);
-            }
+            sfree_aligned(grids->grid_all);
             sfree(grids->grid_th);
         }
+        for (int d = 0; d < DIM; d++)
+        {
+            sfree(grids->g2t[d]);
+        }
     }
 }
 
 void
-make_gridindex5_to_localindex(int n, int local_start, int local_range,
-                              int **global_to_local,
-                              real **fraction_shift)
+make_gridindex_to_localindex(int n, int local_start, int local_range,
+                             int **global_to_local,
+                             real **fraction_shift)
 {
     /* Here we construct array for looking up the grid line index and
      * fraction for particles. This is done because it is slighlty
      * faster than the modulo operation and to because we need to take
      * care of rounding issues, see below.
-     * We use an array size of 5 times the grid size to allow for particles
-     * to be out of the triclinic unit-cell by up to 2 box lengths, which
-     * can be needed along dimension x for a very skewed unit-cell.
+     * We use an array size of c_pmeNeighborUnitcellCount times the grid size
+     * to allow for particles to be out of the triclinic unit-cell.
      */
-    int  * gtl;
-    real * fsh;
+    const int arraySize = c_pmeNeighborUnitcellCount * n;
+    int     * gtl;
+    real    * fsh;
 
-    snew(gtl, 5*n);
-    snew(fsh, 5*n);
+    snew(gtl, arraySize);
+    snew(fsh, arraySize);
 
-    for (int i = 0; i < 5*n; i++)
+    for (int i = 0; i < arraySize; i++)
     {
         /* Transform global grid index to the local grid index.
          * Our local grid always runs from 0 to local_range-1.
@@ -861,9 +860,10 @@ void reuse_pmegrids(const pmegrids_t *oldgrid, pmegrids_t *newgrid)
     sfree_aligned(newgrid->grid.grid);
     newgrid->grid.grid = oldgrid->grid.grid;
 
-    if (newgrid->grid_th != NULL && newgrid->nthread == oldgrid->nthread)
+    if (newgrid->grid_th != nullptr && newgrid->nthread == oldgrid->nthread)
     {
         sfree_aligned(newgrid->grid_all);
+        newgrid->grid_all = oldgrid->grid_all;
         for (t = 0; t < newgrid->nthread; t++)
         {
             newgrid->grid_th[t].grid = oldgrid->grid_th[t].grid;
index ed91fd2125e0aed2af60e0a89712a9dd4bbb8022..7f398a24f95c9222e42d2d79bafe3176598eff3a 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) 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.
 
 #include "pme-internal.h"
 
+
+/*! \brief
+ * We allow coordinates to be out the unit-cell by up to 2 box lengths,
+ * which might be needed along dimension x for a very skewed unit-cell.
+ */
+constexpr int c_pmeMaxUnitcellShift = 2;
+
+/*! \brief
+ * This affects the size of the lookup table of the modulo operation result,
+ * when working with PME local grid indices of the particles.
+ */
+constexpr int c_pmeNeighborUnitcellCount = 2*c_pmeMaxUnitcellShift + 1;
+
+
 #if GMX_MPI
 void
 gmx_sum_qgrid_dd(struct gmx_pme_t *pme, real *grid, int direction);
 #endif
 
 int
-copy_pmegrid_to_fftgrid(struct gmx_pme_t *pme, real *pmegrid, real *fftgrid, int grid_index);
+copy_pmegrid_to_fftgrid(const gmx_pme_t *pme, real *pmegrid, real *fftgrid, int grid_index);
 
 int
 copy_fftgrid_to_pmegrid(struct gmx_pme_t *pme, const real *fftgrid, real *pmegrid, int grid_index,
                         int nthread, int thread);
 
 void
-wrap_periodic_pmegrid(struct gmx_pme_t *pme, real *pmegrid);
+wrap_periodic_pmegrid(const gmx_pme_t *pme, real *pmegrid);
 
 void
 unwrap_periodic_pmegrid(struct gmx_pme_t *pme, real *pmegrid);
@@ -83,9 +97,9 @@ void
 pmegrids_destroy(pmegrids_t *grids);
 
 void
-make_gridindex5_to_localindex(int n, int local_start, int local_range,
-                              int **global_to_local,
-                              real **fraction_shift);
+make_gridindex_to_localindex(int n, int local_start, int local_range,
+                             int **global_to_local,
+                             real **fraction_shift);
 
 void
 set_grid_alignment(int *pmegrid_nz, int pme_order);
index a74070a431d2d33b465cb2148796ab8858a8d339..6aeb4b72de5ba5d998b584bca85b16d8909d794f 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,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.
 
 #include <stdio.h>
 
-#include "gromacs/fft/parallel_3dfft.h"
 #include "gromacs/math/gmxcomplex.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/timing/walltime_accounting.h"
 #include "gromacs/utility/gmxmpi.h"
 
+//! A repeat of typedef from parallel_3dfft.h
+typedef struct gmx_parallel_3dfft *gmx_parallel_3dfft_t;
+
 struct t_commrec;
 struct t_inputrec;
 
@@ -94,12 +96,17 @@ static const real lb_scale_factor_symm[] = { 2.0/64, 12.0/64, 30.0/64, 20.0/64 }
  */
 #define PME_ORDER_MAX 12
 
-/*! \brief As gmx_pme_init, but takes most settings, except the grid, from pme_src */
+/*! \brief As gmx_pme_init, but takes most settings, except the grid/Ewald coefficients, from pme_src.
+ * This is only called when the PME cut-off/grid size changes.
+ */
 int gmx_pme_reinit(struct gmx_pme_t **pmedata,
                    t_commrec *        cr,
                    struct gmx_pme_t * pme_src,
                    const t_inputrec * ir,
-                   ivec               grid_size);
+                   ivec               grid_size,
+                   real               ewaldcoeff_q,
+                   real               ewaldcoeff_lj);
+
 
 /* The following three routines are for PME/PP node splitting in pme_pp.c */
 
@@ -149,7 +156,6 @@ typedef real *splinevec[DIM];
 
 /*! \brief Data structure for beta-spline interpolation */
 typedef struct {
-    int      *thread_one;
     int       n;
     int      *ind;
     splinevec theta;
@@ -214,7 +220,7 @@ typedef struct {
     ivec       nc;           /* The local spatial decomposition over the threads */
     pmegrid_t *grid_th;      /* Array of grids for each thread                   */
     real      *grid_all;     /* Allocated array for the grids in *grid_th        */
-    int      **g2t;          /* The grid to thread index                         */
+    int       *g2t[DIM];     /* The grid to thread index                         */
     ivec       nthread_comm; /* The number of threads to communicate with        */
 } pmegrids_t;
 
@@ -244,12 +250,16 @@ typedef struct gmx_pme_t {
     int        nthread;       /* The number of threads doing PME on our rank */
 
     gmx_bool   bPPnode;       /* Node also does particle-particle forces */
+    bool       doCoulomb;     /* Apply PME to electrostatics */
+    bool       doLJ;          /* Apply PME to Lennard-Jones r^-6 interactions */
     gmx_bool   bFEP;          /* Compute Free energy contribution */
     gmx_bool   bFEP_q;
     gmx_bool   bFEP_lj;
     int        nkx, nky, nkz; /* Grid dimensions */
     gmx_bool   bP3M;          /* Do P3M: optimize the influence function */
     int        pme_order;
+    real       ewaldcoeff_q;  /* Ewald splitting coefficient for Coulomb */
+    real       ewaldcoeff_lj; /* Ewald splitting coefficient for r^-6 */
     real       epsilon_r;
 
     int        ljpme_combination_rule;  /* Type of combination rule in LJ-PME */
@@ -319,23 +329,6 @@ typedef struct gmx_pme_t {
 
 //! @endcond
 
-/*! \brief Check restrictions on pme_order and the PME grid nkx,nky,nkz.
- *
- * With bFatal=TRUE, a fatal error is generated on violation,
- * bValidSettings=NULL can be passed.
- * With bFatal=FALSE, *bValidSettings reports the validity of the settings.
- * bUseThreads tells if any MPI rank doing PME uses more than 1 threads.
- * If at calling you bUseThreads is unknown, pass TRUE for conservative
- * checking.
- */
-void gmx_pme_check_restrictions(int pme_order,
-                                int nkx, int nky, int nkz,
-                                int nnodes_major,
-                                int nnodes_minor,
-                                gmx_bool bUseThreads,
-                                gmx_bool bFatal,
-                                gmx_bool *bValidSettings);
-
 /*! \brief Initialize the PME-only side of the PME <-> PP communication */
 gmx_pme_pp_t gmx_pme_pp_init(t_commrec *cr);
 
@@ -365,9 +358,8 @@ int gmx_pme_recv_coeffs_coords(struct gmx_pme_pp *pme_pp,
                                real **sigmaA, real **sigmaB,
                                matrix box, rvec **x, rvec **f,
                                int *maxshift_x, int *maxshift_y,
-                               gmx_bool *bFreeEnergy_q, gmx_bool *bFreeEnergy_lj,
                                real *lambda_q, real *lambda_lj,
-                               gmx_bool *bEnerVir, int *pme_flags,
+                               gmx_bool *bEnerVir,
                                gmx_int64_t *step,
                                ivec grid_size, real *ewaldcoeff_q, real *ewaldcoeff_lj);
 
index 292624fb4d783b2c356701c8b72837d9e267be6d..6e2bea5d8739446eb0e9efc1996d0936fa447f5f 100644 (file)
 #include "gromacs/domdec/domdec.h"
 #include "gromacs/domdec/domdec_network.h"
 #include "gromacs/domdec/domdec_struct.h"
+#include "gromacs/ewald/pme.h"
 #include "gromacs/fft/calcgrid.h"
-#include "gromacs/gmxlib/md_logging.h"
 #include "gromacs/gmxlib/network.h"
 #include "gromacs/math/functions.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/forcerec.h"
+#include "gromacs/mdlib/nb_verlet.h"
 #include "gromacs/mdlib/nbnxn_gpu_data_mgmt.h"
+#include "gromacs/mdlib/nbnxn_pairlist.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"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/logger.h"
 #include "gromacs/utility/smalloc.h"
 
 #include "pme-internal.h"
@@ -79,7 +83,8 @@
 /*! \brief Parameters and settings for one PP-PME setup */
 struct pme_setup_t {
     real              rcut_coulomb;    /**< Coulomb cut-off                              */
-    real              rlist;           /**< pair-list cut-off                            */
+    real              rlistOuter;      /**< cut-off for the outer pair-list              */
+    real              rlistInner;      /**< cut-off for the inner pair-list              */
     real              spacing;         /**< (largest) PME grid spacing                   */
     ivec              grid;            /**< the PME grid dimensions                      */
     real              grid_efficiency; /**< ineffiency factor for non-uniform grids <= 1 */
@@ -127,8 +132,10 @@ struct pme_load_balancing_t {
     real         cut_spacing;        /**< the minimum cutoff / PME grid spacing ratio */
     real         rcut_vdw;           /**< Vdw cutoff (does not change) */
     real         rcut_coulomb_start; /**< Initial electrostatics cutoff */
-    real         rbuf_coulomb;       /**< the pairlist buffer size */
-    real         rbuf_vdw;           /**< the pairlist buffer size */
+    real         rbufOuter_coulomb;  /**< the outer pairlist buffer size */
+    real         rbufOuter_vdw;      /**< the outer pairlist buffer size */
+    real         rbufInner_coulomb;  /**< the inner pairlist buffer size */
+    real         rbufInner_vdw;      /**< the inner pairlist buffer size */
     matrix       box_start;          /**< the initial simulation box */
     int          n;                  /**< the count of setup as well as the allocation size */
     pme_setup_t *setup;              /**< the PME+cutoff setups */
@@ -150,16 +157,17 @@ struct pme_load_balancing_t {
  * read bActive anywhere */
 bool pme_loadbal_is_active(const pme_load_balancing_t *pme_lb)
 {
-    return pme_lb != NULL && pme_lb->bActive;
+    return pme_lb != nullptr && pme_lb->bActive;
 }
 
 void pme_loadbal_init(pme_load_balancing_t     **pme_lb_p,
                       t_commrec                 *cr,
-                      FILE                      *fp_log,
+                      const gmx::MDLogger       &mdlog,
                       const t_inputrec          *ir,
                       matrix                     box,
                       const interaction_const_t *ic,
-                      struct gmx_pme_t          *pmedata,
+                      const NbnxnListParameters *listParams,
+                      gmx_pme_t                 *pmedata,
                       gmx_bool                   bUseGPU,
                       gmx_bool                  *bPrinting)
 {
@@ -177,18 +185,20 @@ void pme_loadbal_init(pme_load_balancing_t     **pme_lb_p,
 
     snew(pme_lb, 1);
 
-    pme_lb->bSepPMERanks  = !(cr->duty & DUTY_PME);
+    pme_lb->bSepPMERanks      = !(cr->duty & DUTY_PME);
 
     /* Initially we turn on balancing directly on based on PP/PME imbalance */
-    pme_lb->bTriggerOnDLB = FALSE;
+    pme_lb->bTriggerOnDLB     = FALSE;
 
     /* Any number of stages >= 2 is supported */
-    pme_lb->nstage        = 2;
+    pme_lb->nstage            = 2;
 
-    pme_lb->cutoff_scheme = ir->cutoff_scheme;
+    pme_lb->cutoff_scheme     = ir->cutoff_scheme;
 
-    pme_lb->rbuf_coulomb  = ic->rlist - ic->rcoulomb;
-    pme_lb->rbuf_vdw      = ic->rlist - ic->rvdw;
+    pme_lb->rbufOuter_coulomb = listParams->rlistOuter - ic->rcoulomb;
+    pme_lb->rbufOuter_vdw     = listParams->rlistOuter - ic->rvdw;
+    pme_lb->rbufInner_coulomb = listParams->rlistInner - ic->rcoulomb;
+    pme_lb->rbufInner_vdw     = listParams->rlistInner - ic->rvdw;
 
     copy_mat(box, pme_lb->box_start);
     if (ir->ePBC == epbcXY && ir->nwall == 2)
@@ -204,7 +214,8 @@ void pme_loadbal_init(pme_load_balancing_t     **pme_lb_p,
 
     pme_lb->cur                      = 0;
     pme_lb->setup[0].rcut_coulomb    = ic->rcoulomb;
-    pme_lb->setup[0].rlist           = ic->rlist;
+    pme_lb->setup[0].rlistOuter      = listParams->rlistOuter;
+    pme_lb->setup[0].rlistInner      = listParams->rlistInner;
     pme_lb->setup[0].grid[XX]        = ir->nkx;
     pme_lb->setup[0].grid[YY]        = ir->nky;
     pme_lb->setup[0].grid[ZZ]        = ir->nkz;
@@ -246,7 +257,7 @@ void pme_loadbal_init(pme_load_balancing_t     **pme_lb_p,
 
     if (!wallcycle_have_counter())
     {
-        md_print_warn(cr, fp_log, "NOTE: Cycle counters unsupported or not enabled in kernel. Cannot use PME-PP balancing.\n");
+        GMX_LOG(mdlog.warning).asParagraph().appendText("NOTE: Cycle counters unsupported or not enabled in kernel. Cannot use PME-PP balancing.");
     }
 
     /* Tune with GPUs and/or separate PME ranks.
@@ -276,7 +287,7 @@ void pme_loadbal_init(pme_load_balancing_t     **pme_lb_p,
         dd_dlb_lock(cr->dd);
         if (dd_dlb_is_locked(cr->dd))
         {
-            md_print_warn(cr, fp_log, "NOTE: DLB will not turn on during the first phase of PME tuning\n");
+            GMX_LOG(mdlog.warning).asParagraph().appendText("NOTE: DLB will not turn on during the first phase of PME tuning");
         }
     }
 
@@ -295,13 +306,13 @@ static gmx_bool pme_loadbal_increase_cutoff(pme_load_balancing_t *pme_lb,
     real         fac, sp;
     real         tmpr_coulomb, tmpr_vdw;
     int          d;
-    gmx_bool     grid_ok;
+    bool         grid_ok;
 
     /* Try to add a new setup with next larger cut-off to the list */
     pme_lb->n++;
     srenew(pme_lb->setup, pme_lb->n);
     set          = &pme_lb->setup[pme_lb->n-1];
-    set->pmedata = NULL;
+    set->pmedata = nullptr;
 
     get_pme_nnodes(dd, &npmeranks_x, &npmeranks_y);
 
@@ -322,23 +333,23 @@ static gmx_bool pme_loadbal_increase_cutoff(pme_load_balancing_t *pme_lb,
 
         fac *= 1.01;
         clear_ivec(set->grid);
-        sp = calc_grid(NULL, pme_lb->box_start,
-                       fac*pme_lb->setup[pme_lb->cur].spacing,
-                       &set->grid[XX],
-                       &set->grid[YY],
-                       &set->grid[ZZ]);
+        sp = calcFftGrid(nullptr, pme_lb->box_start,
+                         fac*pme_lb->setup[pme_lb->cur].spacing,
+                         minimalPmeGridSize(pme_order),
+                         &set->grid[XX],
+                         &set->grid[YY],
+                         &set->grid[ZZ]);
 
         /* As here we can't easily check if one of the PME ranks
          * uses threading, we do a conservative grid check.
          * This means we can't use pme_order or less grid lines
          * per PME rank along x, which is not a strong restriction.
          */
-        gmx_pme_check_restrictions(pme_order,
-                                   set->grid[XX], set->grid[YY], set->grid[ZZ],
-                                   npmeranks_x, npmeranks_y,
-                                   TRUE,
-                                   FALSE,
-                                   &grid_ok);
+        grid_ok = gmx_pme_check_restrictions(pme_order,
+                                             set->grid[XX], set->grid[YY], set->grid[ZZ],
+                                             npmeranks_x,
+                                             true,
+                                             false);
     }
     while (sp <= 1.001*pme_lb->setup[pme_lb->cur].spacing || !grid_ok);
 
@@ -356,22 +367,25 @@ static gmx_bool pme_loadbal_increase_cutoff(pme_load_balancing_t *pme_lb,
     if (pme_lb->cutoff_scheme == ecutsVERLET)
     {
         /* Never decrease the Coulomb and VdW list buffers */
-        set->rlist        = std::max(set->rcut_coulomb + pme_lb->rbuf_coulomb,
-                                     pme_lb->rcut_vdw + pme_lb->rbuf_vdw);
+        set->rlistOuter  = std::max(set->rcut_coulomb + pme_lb->rbufOuter_coulomb,
+                                    pme_lb->rcut_vdw + pme_lb->rbufOuter_vdw);
+        set->rlistInner  = std::max(set->rcut_coulomb + pme_lb->rbufInner_coulomb,
+                                    pme_lb->rcut_vdw + pme_lb->rbufInner_vdw);
     }
     else
     {
         /* TODO Remove these lines and pme_lb->cutoff_scheme */
-        tmpr_coulomb          = set->rcut_coulomb + pme_lb->rbuf_coulomb;
-        tmpr_vdw              = pme_lb->rcut_vdw + pme_lb->rbuf_vdw;
+        tmpr_coulomb     = set->rcut_coulomb + pme_lb->rbufOuter_coulomb;
+        tmpr_vdw         = pme_lb->rcut_vdw + pme_lb->rbufOuter_vdw;
         /* Two (known) bugs with cutoff-scheme=group here:
          * - This modification of rlist results in incorrect DD comunication.
          * - We should set fr->bTwinRange = (fr->rlistlong > fr->rlist).
          */
-        set->rlist            = std::min(tmpr_coulomb, tmpr_vdw);
+        set->rlistOuter  = std::min(tmpr_coulomb, tmpr_vdw);
+        set->rlistInner  = set->rlistOuter;
     }
 
-    set->spacing      = sp;
+    set->spacing         = sp;
     /* The grid efficiency is the size wrt a grid with uniform x/y/z spacing */
     set->grid_efficiency = 1;
     for (d = 0; d < DIM; d++)
@@ -417,12 +431,12 @@ static void print_grid(FILE *fp_err, FILE *fp_log,
             pre,
             desc, set->grid[XX], set->grid[YY], set->grid[ZZ], set->rcut_coulomb,
             buft);
-    if (fp_err != NULL)
+    if (fp_err != nullptr)
     {
         fprintf(fp_err, "\r%s\n", buf);
         fflush(fp_err);
     }
-    if (fp_log != NULL)
+    if (fp_log != nullptr)
     {
         fprintf(fp_log, "%s\n", buf);
     }
@@ -453,12 +467,12 @@ static void print_loadbal_limited(FILE *fp_err, FILE *fp_log,
             gmx_step_str(step, sbuf),
             pmelblim_str[pme_lb->elimited],
             pme_lb->setup[pme_loadbal_end(pme_lb)-1].rcut_coulomb);
-    if (fp_err != NULL)
+    if (fp_err != nullptr)
     {
         fprintf(fp_err, "\r%s\n", buf);
         fflush(fp_err);
     }
-    if (fp_log != NULL)
+    if (fp_log != nullptr)
     {
         fprintf(fp_log, "%s\n", buf);
     }
@@ -525,6 +539,7 @@ pme_load_balance(pme_load_balancing_t      *pme_lb,
                  t_commrec                 *cr,
                  FILE                      *fp_err,
                  FILE                      *fp_log,
+                 const gmx::MDLogger       &mdlog,
                  const t_inputrec          *ir,
                  t_state                   *state,
                  double                     cycles,
@@ -606,7 +621,7 @@ pme_load_balance(pme_load_balancing_t      *pme_lb,
              * better overal performance can be obtained with a slightly
              * shorter cut-off and better DD load balancing.
              */
-            set_dd_dlb_max_cutoff(cr, pme_lb->setup[pme_lb->fastest].rlist);
+            set_dd_dlb_max_cutoff(cr, pme_lb->setup[pme_lb->fastest].rlistOuter);
         }
     }
     cycles_fast = pme_lb->setup[pme_lb->fastest].cycles;
@@ -648,7 +663,7 @@ pme_load_balance(pme_load_balancing_t      *pme_lb,
 
             if (OK && ir->ePBC != epbcNONE)
             {
-                OK = (gmx::square(pme_lb->setup[pme_lb->cur+1].rlist)
+                OK = (gmx::square(pme_lb->setup[pme_lb->cur+1].rlistOuter)
                       <= max_cutoff2(ir->ePBC, state->box));
                 if (!OK)
                 {
@@ -663,7 +678,7 @@ pme_load_balance(pme_load_balancing_t      *pme_lb,
                 if (DOMAINDECOMP(cr))
                 {
                     OK = change_dd_cutoff(cr, state, ir,
-                                          pme_lb->setup[pme_lb->cur].rlist);
+                                          pme_lb->setup[pme_lb->cur].rlistOuter);
                     if (!OK)
                     {
                         /* Failed: do not use this setup */
@@ -735,7 +750,7 @@ pme_load_balance(pme_load_balancing_t      *pme_lb,
 
     if (DOMAINDECOMP(cr) && pme_lb->stage > 0)
     {
-        OK = change_dd_cutoff(cr, state, ir, pme_lb->setup[pme_lb->cur].rlist);
+        OK = change_dd_cutoff(cr, state, ir, pme_lb->setup[pme_lb->cur].rlistOuter);
         if (!OK)
         {
             /* For some reason the chosen cut-off is incompatible with DD.
@@ -753,7 +768,8 @@ pme_load_balance(pme_load_balancing_t      *pme_lb,
                 /* This should not happen, as we set limits on the DLB bounds.
                  * But we implement a complete failsafe solution anyhow.
                  */
-                md_print_warn(cr, fp_log, "The fastest PP/PME load balancing setting (cutoff %.3f nm) is no longer available due to DD DLB or box size limitations\n");
+                GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
+                        "The fastest PP/PME load balancing setting (cutoff %.3f nm) is no longer available due to DD DLB or box size limitations", pme_lb->fastest);
                 pme_lb->fastest = pme_lb->lower_limit;
                 pme_lb->start   = pme_lb->lower_limit;
             }
@@ -769,9 +785,12 @@ pme_load_balance(pme_load_balancing_t      *pme_lb,
 
     set = &pme_lb->setup[pme_lb->cur];
 
-    ic->rcoulomb     = set->rcut_coulomb;
-    ic->rlist        = set->rlist;
-    ic->ewaldcoeff_q = set->ewaldcoeff_q;
+    NbnxnListParameters *listParams = nbv->listParams.get();
+
+    ic->rcoulomb           = set->rcut_coulomb;
+    listParams->rlistOuter = set->rlistOuter;
+    listParams->rlistInner = set->rlistInner;
+    ic->ewaldcoeff_q       = set->ewaldcoeff_q;
     /* TODO: centralize the code that sets the potentials shifts */
     if (ic->coulomb_modifier == eintmodPOTSHIFT)
     {
@@ -796,9 +815,9 @@ pme_load_balance(pme_load_balancing_t      *pme_lb,
     }
 
     /* We always re-initialize the tables whether they are used or not */
-    init_interaction_const_tables(NULL, ic, rtab);
+    init_interaction_const_tables(nullptr, ic, rtab);
 
-    nbnxn_gpu_pme_loadbal_update_param(nbv, ic);
+    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
@@ -821,14 +840,14 @@ pme_load_balance(pme_load_balancing_t      *pme_lb,
 
     if (!pme_lb->bSepPMERanks)
     {
-        if (pme_lb->setup[pme_lb->cur].pmedata == NULL)
+        if (pme_lb->setup[pme_lb->cur].pmedata == nullptr)
         {
             /* Generate a new PME data structure,
              * copying part of the old pointers.
              */
             gmx_pme_reinit(&set->pmedata,
                            cr, pme_lb->setup[0].pmedata, ir,
-                           set->grid);
+                           set->grid, set->ewaldcoeff_q, set->ewaldcoeff_lj);
         }
         *pmedata = set->pmedata;
     }
@@ -840,7 +859,7 @@ pme_load_balance(pme_load_balancing_t      *pme_lb,
 
     if (debug)
     {
-        print_grid(NULL, debug, "", "switched to", set, -1);
+        print_grid(nullptr, debug, "", "switched to", set, -1);
     }
 
     if (pme_lb->stage == pme_lb->nstage)
@@ -878,6 +897,7 @@ void pme_loadbal_do(pme_load_balancing_t *pme_lb,
                     t_commrec            *cr,
                     FILE                 *fp_err,
                     FILE                 *fp_log,
+                    const gmx::MDLogger  &mdlog,
                     const t_inputrec     *ir,
                     t_forcerec           *fr,
                     t_state              *state,
@@ -959,7 +979,7 @@ void pme_loadbal_do(pme_load_balancing_t *pme_lb,
         {
             /* Unlock the DLB=auto, DLB is allowed to activate */
             dd_dlb_unlock(cr->dd);
-            md_print_warn(cr, fp_log, "NOTE: DLB can now turn on, when beneficial\n");
+            GMX_LOG(mdlog.warning).asParagraph().appendText("NOTE: DLB can now turn on, when beneficial");
 
             /* We don't deactivate the tuning yet, since we will balance again
              * after DLB gets turned on, if it does within PMETune_period.
@@ -981,7 +1001,7 @@ void pme_loadbal_do(pme_load_balancing_t *pme_lb,
              * This also ensures that we won't disable the currently
              * optimal setting during a second round of PME balancing.
              */
-            set_dd_dlb_max_cutoff(cr, fr->ic->rlist);
+            set_dd_dlb_max_cutoff(cr, fr->nbv->listParams->rlistOuter);
         }
     }
 
@@ -992,7 +1012,7 @@ void pme_loadbal_do(pme_load_balancing_t *pme_lb,
          * but the first data collected is skipped anyhow.
          */
         pme_load_balance(pme_lb, cr,
-                         fp_err, fp_log,
+                         fp_err, fp_log, mdlog,
                          ir, state, pme_lb->cycles_c - cycles_prev,
                          fr->ic, fr->nbv, &fr->pmedata,
                          step);
@@ -1000,13 +1020,13 @@ void pme_loadbal_do(pme_load_balancing_t *pme_lb,
         /* Update constants in forcerec/inputrec to keep them in sync with fr->ic */
         fr->ewaldcoeff_q  = fr->ic->ewaldcoeff_q;
         fr->ewaldcoeff_lj = fr->ic->ewaldcoeff_lj;
-        fr->rlist         = fr->ic->rlist;
+        fr->rlist         = fr->nbv->listParams->rlistOuter;
         fr->rcoulomb      = fr->ic->rcoulomb;
         fr->rvdw          = fr->ic->rvdw;
 
         if (ir->eDispCorr != edispcNO)
         {
-            calc_enervirdiff(NULL, ir->eDispCorr, fr);
+            calc_enervirdiff(nullptr, ir->eDispCorr, fr);
         }
     }
 
@@ -1023,7 +1043,7 @@ void pme_loadbal_do(pme_load_balancing_t *pme_lb,
     {
         /* Make sure DLB is allowed when we deactivate PME tuning */
         dd_dlb_unlock(cr->dd);
-        md_print_warn(cr, fp_log, "NOTE: DLB can now turn on, when beneficial\n");
+        GMX_LOG(mdlog.warning).asParagraph().appendText("NOTE: DLB can now turn on, when beneficial");
     }
 
     *bPrinting = pme_lb->bBalance;
@@ -1043,21 +1063,21 @@ static void print_pme_loadbal_setting(FILE              *fplog,
     fprintf(fplog,
             "   %-7s %6.3f nm %6.3f nm     %3d %3d %3d   %5.3f nm  %5.3f nm\n",
             name,
-            setup->rcut_coulomb, setup->rlist,
+            setup->rcut_coulomb, setup->rlistInner,
             setup->grid[XX], setup->grid[YY], setup->grid[ZZ],
             setup->spacing, 1/setup->ewaldcoeff_q);
 }
 
 /*! \brief Print all load-balancing settings */
 static void print_pme_loadbal_settings(pme_load_balancing_t *pme_lb,
-                                       t_commrec            *cr,
                                        FILE                 *fplog,
+                                       const gmx::MDLogger  &mdlog,
                                        gmx_bool              bNonBondedOnGPU)
 {
     double     pp_ratio, grid_ratio;
     real       pp_ratio_temporary;
 
-    pp_ratio_temporary = pme_lb->setup[pme_lb->cur].rlist / pme_lb->setup[0].rlist;
+    pp_ratio_temporary = pme_lb->setup[pme_lb->cur].rlistInner / pme_lb->setup[0].rlistInner;
     pp_ratio           = gmx::power3(pp_ratio_temporary);
     grid_ratio         = pme_grid_points(&pme_lb->setup[pme_lb->cur])/
         (double)pme_grid_points(&pme_lb->setup[0]);
@@ -1089,10 +1109,10 @@ static void print_pme_loadbal_settings(pme_load_balancing_t *pme_lb,
 
     if (pp_ratio > 1.5 && !bNonBondedOnGPU)
     {
-        md_print_warn(cr, fplog,
-                      "NOTE: PME load balancing increased the non-bonded workload by more than 50%%.\n"
-                      "      For better performance, use (more) PME ranks (mdrun -npme),\n"
-                      "      or if you are beyond the scaling limit, use fewer total ranks (or nodes).\n");
+        GMX_LOG(mdlog.warning).asParagraph().appendText(
+                "NOTE: PME load balancing increased the non-bonded workload by more than 50%.\n"
+                "      For better performance, use (more) PME ranks (mdrun -npme),\n"
+                "      or if you are beyond the scaling limit, use fewer total ranks (or nodes).");
     }
     else
     {
@@ -1101,13 +1121,13 @@ static void print_pme_loadbal_settings(pme_load_balancing_t *pme_lb,
 }
 
 void pme_loadbal_done(pme_load_balancing_t *pme_lb,
-                      t_commrec            *cr,
                       FILE                 *fplog,
+                      const gmx::MDLogger  &mdlog,
                       gmx_bool              bNonBondedOnGPU)
 {
-    if (fplog != NULL && (pme_lb->cur > 0 || pme_lb->elimited != epmelblimNO))
+    if (fplog != nullptr && (pme_lb->cur > 0 || pme_lb->elimited != epmelblimNO))
     {
-        print_pme_loadbal_settings(pme_lb, cr, fplog, bNonBondedOnGPU);
+        print_pme_loadbal_settings(pme_lb, fplog, mdlog, bNonBondedOnGPU);
     }
 
     /* TODO: Here we should free all pointers in pme_lb,
index d0e305a8eb91f248dbe2f40942a8340927b1fbb0..3edce7e7182df4ba417eae0440475eb043d9e629 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,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.
 
 #include "gromacs/mdtypes/forcerec.h"
 #include "gromacs/mdtypes/interaction_const.h"
-#include "gromacs/mdtypes/state.h"
 #include "gromacs/timing/wallcycle.h"
 
+struct NbnxnListParameters;
 struct t_commrec;
 struct t_inputrec;
+class t_state;
+
+namespace gmx
+{
+class MDLogger;
+}
 
 /*! \brief Object to manage PME load balancing */
 struct pme_load_balancing_t;
@@ -69,12 +75,13 @@ bool pme_loadbal_is_active(const pme_load_balancing_t *pme_lb);
  * usage.
  */
 void pme_loadbal_init(pme_load_balancing_t     **pme_lb_p,
-                      struct t_commrec          *cr,
-                      FILE                      *fp_log,
+                      t_commrec                 *cr,
+                      const gmx::MDLogger       &mdlog,
                       const t_inputrec          *ir,
                       matrix                     box,
                       const interaction_const_t *ic,
-                      struct gmx_pme_t          *pmedata,
+                      const NbnxnListParameters *listParams,
+                      gmx_pme_t                 *pmedata,
                       gmx_bool                   bUseGPU,
                       gmx_bool                  *bPrinting);
 
@@ -89,6 +96,7 @@ void pme_loadbal_do(pme_load_balancing_t  *pme_lb,
                     struct t_commrec      *cr,
                     FILE                  *fp_err,
                     FILE                  *fp_log,
+                    const gmx::MDLogger   &mdlog,
                     const t_inputrec      *ir,
                     t_forcerec            *fr,
                     t_state               *state,
@@ -99,8 +107,8 @@ void pme_loadbal_do(pme_load_balancing_t  *pme_lb,
 
 /*! \brief Finish the PME load balancing and print the settings when fplog!=NULL */
 void pme_loadbal_done(pme_load_balancing_t *pme_lb,
-                      struct t_commrec     *cr,
                       FILE                 *fplog,
+                      const gmx::MDLogger  &mdlog,
                       gmx_bool              bNonBondedOnGPU);
 
 #endif
index 326cf977f97c56aa20c0e62d444fed4d1af5ad9c..66a7728b24b6d5f73b342cb249b7f0d88057347e 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,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.
@@ -107,11 +107,12 @@ static void reset_pmeonly_counters(gmx_wallcycle_t wcycle,
 
 static void gmx_pmeonly_switch(int *npmedata, struct gmx_pme_t ***pmedata,
                                ivec grid_size,
+                               real ewaldcoeff_q, real ewaldcoeff_lj,
                                t_commrec *cr, t_inputrec *ir,
                                struct gmx_pme_t **pme_ret)
 {
     int               ind;
-    struct gmx_pme_t *pme = NULL;
+    struct gmx_pme_t *pme = nullptr;
 
     ind = 0;
     while (ind < *npmedata)
@@ -133,7 +134,7 @@ static void gmx_pmeonly_switch(int *npmedata, struct gmx_pme_t ***pmedata,
     srenew(*pmedata, *npmedata);
 
     /* Generate a new PME data structure, copying part of the old pointers */
-    gmx_pme_reinit(&((*pmedata)[ind]), cr, pme, ir, grid_size);
+    gmx_pme_reinit(&((*pmedata)[ind]), cr, pme, ir, grid_size, ewaldcoeff_q, ewaldcoeff_lj);
 
     *pme_ret = (*pmedata)[ind];
 }
@@ -151,10 +152,10 @@ int gmx_pmeonly(struct gmx_pme_t *pme,
     int                ret;
     int                natoms;
     matrix             box;
-    rvec              *x_pp       = NULL, *f_pp = NULL;
-    real              *chargeA    = NULL, *chargeB = NULL;
-    real              *c6A        = NULL, *c6B = NULL;
-    real              *sigmaA     = NULL, *sigmaB = NULL;
+    rvec              *x_pp       = nullptr, *f_pp = nullptr;
+    real              *chargeA    = nullptr, *chargeB = nullptr;
+    real              *c6A        = nullptr, *c6B = nullptr;
+    real              *sigmaA     = nullptr, *sigmaB = nullptr;
     real               lambda_q   = 0;
     real               lambda_lj  = 0;
     int                maxshift_x = 0, maxshift_y = 0;
@@ -163,7 +164,6 @@ int gmx_pmeonly(struct gmx_pme_t *pme,
     float              cycles;
     int                count;
     gmx_bool           bEnerVir;
-    int                pme_flags;
     gmx_int64_t        step;
     ivec               grid_switch;
 
@@ -190,17 +190,15 @@ int gmx_pmeonly(struct gmx_pme_t *pme,
                                              &sigmaA, &sigmaB,
                                              box, &x_pp, &f_pp,
                                              &maxshift_x, &maxshift_y,
-                                             &pme->bFEP_q, &pme->bFEP_lj,
                                              &lambda_q, &lambda_lj,
                                              &bEnerVir,
-                                             &pme_flags,
                                              &step,
                                              grid_switch, &ewaldcoeff_q, &ewaldcoeff_lj);
 
             if (ret == pmerecvqxSWITCHGRID)
             {
                 /* Switch the PME grid to grid_switch */
-                gmx_pmeonly_switch(&npmedata, &pmedata, grid_switch, cr, ir, &pme);
+                gmx_pmeonly_switch(&npmedata, &pmedata, grid_switch, ewaldcoeff_q, ewaldcoeff_lj, cr, ir, &pme);
             }
 
             if (ret == pmerecvqxRESETCOUNTERS)
@@ -233,9 +231,9 @@ int gmx_pmeonly(struct gmx_pme_t *pme,
         gmx_pme_do(pme, 0, natoms, x_pp, f_pp,
                    chargeA, chargeB, c6A, c6B, sigmaA, sigmaB, box,
                    cr, maxshift_x, maxshift_y, mynrnb, wcycle,
-                   vir_q, ewaldcoeff_q, vir_lj, ewaldcoeff_lj,
+                   vir_q, vir_lj,
                    &energy_q, &energy_lj, lambda_q, lambda_lj, &dvdlambda_q, &dvdlambda_lj,
-                   pme_flags | GMX_PME_DO_ALL_F | (bEnerVir ? GMX_PME_CALC_ENER_VIR : 0));
+                   GMX_PME_DO_ALL_F | (bEnerVir ? GMX_PME_CALC_ENER_VIR : 0));
 
         cycles = wallcycle_stop(wcycle, ewcPMEMESH);
 
index d7642deda6f85c3c606e5d8da53ede11bdcb02d5..24819755e2937c1abb45d3bec84a8874c7a7c3ef 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,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.
@@ -79,9 +79,6 @@ enum {
  *
  * Some parts of the code(gmx_pme_send_q, gmx_pme_recv_q_x) assume
  * that the six first flags are exactly in this order.
- * If more PP_PME_...-flags are to be introduced be aware of some of
- * the PME-specific flags in pme.h. Currently, they are also passed
- * through here.
  */
 
 #define PP_PME_CHARGE         (1<<0)
@@ -91,8 +88,6 @@ enum {
 #define PP_PME_SIGMA          (1<<4)
 #define PP_PME_SIGMAB         (1<<5)
 #define PP_PME_COORD          (1<<6)
-#define PP_PME_FEP_Q          (1<<7)
-#define PP_PME_FEP_LJ         (1<<8)
 #define PP_PME_ENER_VIR       (1<<9)
 #define PP_PME_FINISH         (1<<10)
 #define PP_PME_SWITCHGRID     (1<<11)
@@ -111,7 +106,6 @@ struct gmx_pme_pp {
     int         *node;           /**< The PP node ranks                          */
     int          node_peer;      /**< The peer PP node rank                      */
     int         *nat;            /**< The number of atom for each PP node        */
-    int          flags_charge;   /**< The flags sent along with the last charges */
     //@{
     /**< Vectors of A- and B-state parameters used to transfer vectors to PME ranks  */
     real        *chargeA;
@@ -141,7 +135,7 @@ struct gmx_pme_comm_n_box_t {
     int             maxshift_y; /**< Maximum shift in y direction */
     real            lambda_q;   /**< Free-energy lambda for electrostatics */
     real            lambda_lj;  /**< Free-energy lambda for Lennard-Jones */
-    int             flags;      /**< Control flags */
+    unsigned int    flags;      /**< Control flags */
     gmx_int64_t     step;       /**< MD integration step number */
     //@{
     /*! \brief Used in PME grid tuning */
@@ -182,7 +176,6 @@ gmx_pme_pp_t gmx_pme_pp_init(t_commrec *cr)
     snew(pme_pp->req, eCommType_NR*pme_pp->nnode);
     snew(pme_pp->stat, eCommType_NR*pme_pp->nnode);
     pme_pp->nalloc       = 0;
-    pme_pp->flags_charge = 0;
 #else
     GMX_UNUSED_VALUE(cr);
 #endif
@@ -207,7 +200,7 @@ static void gmx_pme_send_coeffs_coords_wait(gmx_domdec_t gmx_unused *dd)
 }
 
 /*! \brief Send data to PME ranks */
-static void gmx_pme_send_coeffs_coords(t_commrec *cr, int flags,
+static void gmx_pme_send_coeffs_coords(t_commrec *cr, unsigned int flags,
                                        real gmx_unused *chargeA, real gmx_unused *chargeB,
                                        real gmx_unused *c6A, real gmx_unused *c6B,
                                        real gmx_unused *sigmaA, real gmx_unused *sigmaB,
@@ -241,7 +234,7 @@ static void gmx_pme_send_coeffs_coords(t_commrec *cr, int flags,
     if (dd->pme_receive_vir_ener)
     {
         /* Peer PP node: communicate all data */
-        if (dd->cnb == NULL)
+        if (dd->cnb == nullptr)
         {
             snew(dd->cnb, 1);
         }
@@ -339,9 +332,8 @@ void gmx_pme_send_parameters(t_commrec *cr,
                              real *sigmaA, real *sigmaB,
                              int maxshift_x, int maxshift_y)
 {
-    int flags;
+    unsigned int flags = 0;
 
-    flags = 0;
     if (EEL_PME(ic->eeltype))
     {
         flags |= PP_PME_CHARGE;
@@ -360,41 +352,28 @@ void gmx_pme_send_parameters(t_commrec *cr,
     gmx_pme_send_coeffs_coords(cr, flags,
                                chargeA, chargeB,
                                sqrt_c6A, sqrt_c6B, sigmaA, sigmaB,
-                               NULL, NULL, 0, 0, maxshift_x, maxshift_y, -1);
+                               nullptr, nullptr, 0, 0, maxshift_x, maxshift_y, -1);
 }
 
 void gmx_pme_send_coordinates(t_commrec *cr, matrix box, rvec *x,
-                              gmx_bool bFreeEnergy_q, gmx_bool bFreeEnergy_lj,
                               real lambda_q, real lambda_lj,
-                              gmx_bool bEnerVir, int pme_flags,
+                              gmx_bool bEnerVir,
                               gmx_int64_t step)
 {
-    int flags;
-
-    flags = pme_flags | PP_PME_COORD;
-    if (bFreeEnergy_q)
-    {
-        flags |= PP_PME_FEP_Q;
-    }
-    if (bFreeEnergy_lj)
-    {
-        flags |= PP_PME_FEP_LJ;
-    }
+    unsigned int flags = PP_PME_COORD;
     if (bEnerVir)
     {
         flags |= PP_PME_ENER_VIR;
     }
-    gmx_pme_send_coeffs_coords(cr, flags, NULL, NULL, NULL, NULL, NULL, NULL,
+    gmx_pme_send_coeffs_coords(cr, flags, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
                                box, x, lambda_q, lambda_lj, 0, 0, step);
 }
 
 void gmx_pme_send_finish(t_commrec *cr)
 {
-    int flags;
-
-    flags = PP_PME_FINISH;
+    unsigned int flags = PP_PME_FINISH;
 
-    gmx_pme_send_coeffs_coords(cr, flags, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, -1);
+    gmx_pme_send_coeffs_coords(cr, flags, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, 0, 0, 0, 0, -1);
 }
 
 void gmx_pme_send_switchgrid(t_commrec gmx_unused *cr,
@@ -451,34 +430,36 @@ int gmx_pme_recv_coeffs_coords(struct gmx_pme_pp *pme_pp,
                                rvec             **f,
                                int               *maxshift_x,
                                int               *maxshift_y,
-                               gmx_bool          *bFreeEnergy_q,
-                               gmx_bool          *bFreeEnergy_lj,
                                real              *lambda_q,
                                real              *lambda_lj,
                                gmx_bool          *bEnerVir,
-                               int               *pme_flags,
                                gmx_int64_t       *step,
                                ivec               grid_size,
                                real              *ewaldcoeff_q,
                                real              *ewaldcoeff_lj)
 {
-    int                  nat = 0, status;
+    int status = -1;
+    int nat    = 0;
 
-    *pme_flags = 0;
 #if GMX_MPI
-    gmx_pme_comm_n_box_t cnb;
-    int                  messages;
+    unsigned int flags    = 0;
+    int          messages = 0;
 
-    cnb.flags  = 0;
-    messages   = 0;
     do
     {
+        gmx_pme_comm_n_box_t cnb;
+        cnb.flags = 0;
 
         /* Receive the send count, box and time step from the peer PP node */
         MPI_Recv(&cnb, sizeof(cnb), MPI_BYTE,
                  pme_pp->node_peer, eCommType_CNB,
                  pme_pp->mpi_comm_mysim, MPI_STATUS_IGNORE);
 
+        /* We accumulate all received flags */
+        flags |= cnb.flags;
+
+        *step  = cnb.step;
+
         if (debug)
         {
             fprintf(debug, "PME only rank receiving:%s%s%s%s%s\n",
@@ -489,21 +470,25 @@ int gmx_pme_recv_coeffs_coords(struct gmx_pme_pp *pme_pp,
                     (cnb.flags & PP_PME_RESETCOUNTERS) ? " reset counters" : "");
         }
 
+        if (cnb.flags & PP_PME_FINISH)
+        {
+            status = pmerecvqxFINISH;
+        }
+
         if (cnb.flags & PP_PME_SWITCHGRID)
         {
             /* Special case, receive the new parameters and return */
             copy_ivec(cnb.grid_size, grid_size);
             *ewaldcoeff_q  = cnb.ewaldcoeff_q;
             *ewaldcoeff_lj = cnb.ewaldcoeff_lj;
-            return pmerecvqxSWITCHGRID;
+
+            status         = pmerecvqxSWITCHGRID;
         }
 
         if (cnb.flags & PP_PME_RESETCOUNTERS)
         {
-            /* Special case, receive the step and return */
-            *step = cnb.step;
-
-            return pmerecvqxRESETCOUNTERS;
+            /* Special case, receive the step (set above) and return */
+            status = pmerecvqxRESETCOUNTERS;
         }
 
         if (cnb.flags & (PP_PME_CHARGE | PP_PME_SQRTC6 | PP_PME_SIGMA))
@@ -608,41 +593,17 @@ int gmx_pme_recv_coeffs_coords(struct gmx_pme_pp *pme_pp,
                     }
                 }
             }
-
-            pme_pp->flags_charge = cnb.flags;
         }
 
         if (cnb.flags & PP_PME_COORD)
         {
-            if (!(pme_pp->flags_charge & (PP_PME_CHARGE | PP_PME_SQRTC6)))
-            {
-                gmx_incons("PME-only rank received coordinates before charges and/or C6-values"
-                           );
-            }
-
             /* The box, FE flag and lambda are sent along with the coordinates
              *  */
             copy_mat(cnb.box, box);
-            *bFreeEnergy_q  = ((cnb.flags & GMX_PME_DO_COULOMB) &&
-                               (cnb.flags & PP_PME_FEP_Q));
-            *bFreeEnergy_lj = ((cnb.flags & GMX_PME_DO_LJ) &&
-                               (cnb.flags & PP_PME_FEP_LJ));
             *lambda_q       = cnb.lambda_q;
             *lambda_lj      = cnb.lambda_lj;
             *bEnerVir       = (cnb.flags & PP_PME_ENER_VIR);
-            *pme_flags      = cnb.flags;
-
-            if (*bFreeEnergy_q && !(pme_pp->flags_charge & PP_PME_CHARGEB))
-            {
-                gmx_incons("PME-only rank received free energy request, but "
-                           "did not receive B-state charges");
-            }
-
-            if (*bFreeEnergy_lj && !(pme_pp->flags_charge & PP_PME_SQRTC6B))
-            {
-                gmx_incons("PME-only rank received free energy request, but "
-                           "did not receive B-state C6-values");
-            }
+            *step           = cnb.step;
 
             /* Receive the coordinates in place */
             nat = 0;
@@ -663,22 +624,19 @@ int gmx_pme_recv_coeffs_coords(struct gmx_pme_pp *pme_pp,
                     }
                 }
             }
+
+            status = pmerecvqxX;
         }
 
         /* Wait for the coordinates and/or charges to arrive */
         MPI_Waitall(messages, pme_pp->req, pme_pp->stat);
         messages = 0;
     }
-    while (!(cnb.flags & (PP_PME_COORD | PP_PME_FINISH)));
-    status = ((cnb.flags & PP_PME_FINISH) ? pmerecvqxFINISH : pmerecvqxX);
-
-    *step = cnb.step;
+    while (status == -1);
 #else
     GMX_UNUSED_VALUE(box);
     GMX_UNUSED_VALUE(maxshift_x);
     GMX_UNUSED_VALUE(maxshift_y);
-    GMX_UNUSED_VALUE(bFreeEnergy_q);
-    GMX_UNUSED_VALUE(bFreeEnergy_lj);
     GMX_UNUSED_VALUE(lambda_q);
     GMX_UNUSED_VALUE(lambda_lj);
     GMX_UNUSED_VALUE(bEnerVir);
@@ -690,15 +648,18 @@ int gmx_pme_recv_coeffs_coords(struct gmx_pme_pp *pme_pp,
     status = pmerecvqxX;
 #endif
 
-    *natoms   = nat;
-    *chargeA  = pme_pp->chargeA;
-    *chargeB  = pme_pp->chargeB;
-    *sqrt_c6A = pme_pp->sqrt_c6A;
-    *sqrt_c6B = pme_pp->sqrt_c6B;
-    *sigmaA   = pme_pp->sigmaA;
-    *sigmaB   = pme_pp->sigmaB;
-    *x        = pme_pp->x;
-    *f        = pme_pp->f;
+    if (status == pmerecvqxX)
+    {
+        *natoms   = nat;
+        *chargeA  = pme_pp->chargeA;
+        *chargeB  = pme_pp->chargeB;
+        *sqrt_c6A = pme_pp->sqrt_c6A;
+        *sqrt_c6B = pme_pp->sqrt_c6B;
+        *sigmaA   = pme_pp->sigmaA;
+        *sigmaB   = pme_pp->sigmaB;
+        *x        = pme_pp->x;
+        *f        = pme_pp->f;
+    }
 
     return status;
 }
index dbe9e3680d9e3fa354cab9788114dd87ecab7db9..7500db7cde465ed15283543c7a232c25435bc741 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,2013,2014,2015, by the GROMACS development team, led by
+ * 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.
 #endif
 
 
-#ifdef PME_GATHER_F_SIMD4_ORDER4
-/* Gather for one charge with pme_order=4 with unaligned SIMD4 load+store.
- * This code does not assume any memory alignment for the grid.
- */
-{
-    Simd4Real fx_S, fy_S, fz_S;
-
-    Simd4Real tx_S, ty_S, tz_S;
-    Simd4Real dx_S, dy_S, dz_S;
-
-    Simd4Real gval_S;
-
-    Simd4Real fxy1_S;
-    Simd4Real fz1_S;
-
-    fx_S = setZero();
-    fy_S = setZero();
-    fz_S = setZero();
-
-    /* With order 4 the z-spline is actually aligned */
-    tz_S  = load4(thz);
-    dz_S  = load4(dthz);
-
-    for (ithx = 0; (ithx < 4); ithx++)
-    {
-        index_x  = (i0+ithx)*pny*pnz;
-        tx_S     = Simd4Real(thx[ithx]);
-        dx_S     = Simd4Real(dthx[ithx]);
-
-        for (ithy = 0; (ithy < 4); ithy++)
-        {
-            index_xy = index_x+(j0+ithy)*pnz;
-            ty_S     = Simd4Real(thy[ithy]);
-            dy_S     = Simd4Real(dthy[ithy]);
-
-            gval_S = load4U(grid+index_xy+k0);
-
-            fxy1_S = tz_S * gval_S;
-            fz1_S  = dz_S * gval_S;
-
-            fx_S = fma(dx_S * ty_S, fxy1_S, fx_S);
-            fy_S = fma(tx_S * dy_S, fxy1_S, fy_S);
-            fz_S = fma(tx_S * ty_S, fz1_S, fz_S);
-        }
-    }
-
-    fx += reduce(fx_S);
-    fy += reduce(fy_S);
-    fz += reduce(fz_S);
-}
-#undef PME_GATHER_F_SIMD4_ORDER4
-#endif
-
-
 #ifdef PME_SPREAD_SIMD4_ALIGNED
 /* This code assumes that the grid is allocated 4-real aligned
  * and that pnz is a multiple of 4.
 #undef PME_ORDER
 #undef PME_SPREAD_SIMD4_ALIGNED
 #endif
-
-
-#ifdef PME_GATHER_F_SIMD4_ALIGNED
-/* This code assumes that the grid is allocated 4-real aligned
- * and that pnz is a multiple of 4.
- * This code supports pme_order <= 5.
- */
-{
-    int              offset;
-
-    Simd4Real        fx_S, fy_S, fz_S;
-
-    Simd4Real        tx_S, ty_S, tz_S0, tz_S1;
-    Simd4Real        dx_S, dy_S, dz_S0, dz_S1;
-
-    Simd4Real        gval_S0;
-    Simd4Real        gval_S1;
-
-    Simd4Real        fxy1_S0;
-    Simd4Real        fz1_S0;
-    Simd4Real        fxy1_S1;
-    Simd4Real        fz1_S1;
-    Simd4Real        fxy1_S;
-    Simd4Real        fz1_S;
-
-    offset = k0 & 3;
-
-    fx_S = setZero();
-    fy_S = setZero();
-    fz_S = setZero();
-
-#ifdef PME_SIMD4_UNALIGNED
-    tz_S0 = load4U(thz-offset);
-    tz_S1 = load4U(thz-offset+4);
-    dz_S0 = load4U(dthz-offset);
-    dz_S1 = load4U(dthz-offset+4);
-#else
-    {
-        int i;
-        /* Copy (d)thz to an aligned buffer (unused buffer parts are masked) */
-        for (i = 0; i < PME_ORDER; i++)
-        {
-            thz_aligned[offset+i]  = thz[i];
-            dthz_aligned[offset+i] = dthz[i];
-        }
-        tz_S0 = load4(thz_aligned);
-        tz_S1 = load4(thz_aligned+4);
-        dz_S0 = load4(dthz_aligned);
-        dz_S1 = load4(dthz_aligned+4);
-    }
-#endif
-    tz_S0 = selectByMask(tz_S0, work->mask_S0[offset]);
-    dz_S0 = selectByMask(dz_S0, work->mask_S0[offset]);
-    tz_S1 = selectByMask(tz_S1, work->mask_S1[offset]);
-    dz_S1 = selectByMask(dz_S1, work->mask_S1[offset]);
-
-    for (ithx = 0; (ithx < PME_ORDER); ithx++)
-    {
-        index_x  = (i0+ithx)*pny*pnz;
-        tx_S     = Simd4Real(thx[ithx]);
-        dx_S     = Simd4Real(dthx[ithx]);
-
-        for (ithy = 0; (ithy < PME_ORDER); ithy++)
-        {
-            index_xy = index_x+(j0+ithy)*pnz;
-            ty_S     = Simd4Real(thy[ithy]);
-            dy_S     = Simd4Real(dthy[ithy]);
-
-            gval_S0 = load4(grid+index_xy+k0-offset);
-            gval_S1 = load4(grid+index_xy+k0-offset+4);
-
-            fxy1_S0 = tz_S0 * gval_S0;
-            fz1_S0  = dz_S0 * gval_S0;
-            fxy1_S1 = tz_S1 * gval_S1;
-            fz1_S1  = dz_S1 * gval_S1;
-
-            fxy1_S = fxy1_S0 + fxy1_S1;
-            fz1_S  = fz1_S0 + fz1_S1;
-
-            fx_S = fma(dx_S * ty_S, fxy1_S, fx_S);
-            fy_S = fma(tx_S * dy_S, fxy1_S, fy_S);
-            fz_S = fma(tx_S * ty_S, fz1_S, fz_S);
-        }
-    }
-
-    fx += reduce(fx_S);
-    fy += reduce(fy_S);
-    fz += reduce(fz_S);
-}
-#undef PME_ORDER
-#undef PME_GATHER_F_SIMD4_ALIGNED
-#endif
index a7599b029e36be538079db4bfe1c43e6b94d670f..c36fbbf776682eab68e2524b1f5b78ab3bd0c4b7 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,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.
@@ -140,27 +140,31 @@ void pme_init_all_work(struct pme_solve_work_t **work, int nthread, int nkx)
 
 static void free_work(struct pme_solve_work_t *work)
 {
-    sfree(work->mhx);
-    sfree(work->mhy);
-    sfree(work->mhz);
-    sfree(work->m2);
-    sfree_aligned(work->denom);
-    sfree_aligned(work->tmp1);
-    sfree_aligned(work->tmp2);
-    sfree_aligned(work->eterm);
-    sfree(work->m2inv);
+    if (work)
+    {
+        sfree(work->mhx);
+        sfree(work->mhy);
+        sfree(work->mhz);
+        sfree(work->m2);
+        sfree_aligned(work->denom);
+        sfree_aligned(work->tmp1);
+        sfree_aligned(work->tmp2);
+        sfree_aligned(work->eterm);
+        sfree(work->m2inv);
+    }
 }
 
 void pme_free_all_work(struct pme_solve_work_t **work, int nthread)
 {
-    int thread;
-
-    for (thread = 0; thread < nthread; thread++)
+    if (*work)
     {
-        free_work(&(*work)[thread]);
+        for (int thread = 0; thread < nthread; thread++)
+        {
+            free_work(&(*work)[thread]);
+        }
     }
-    sfree(work);
-    *work = NULL;
+    sfree(*work);
+    *work = nullptr;
 }
 
 void get_pme_ener_vir_q(struct pme_solve_work_t *work, int nthread,
@@ -287,8 +291,7 @@ gmx_inline static void calc_exponentials_lj(int start, int end, real *r, real *t
 }
 #endif
 
-int solve_pme_yzx(struct gmx_pme_t *pme, t_complex *grid,
-                  real ewaldcoeff, real vol,
+int solve_pme_yzx(const gmx_pme_t *pme, t_complex *grid, real vol,
                   gmx_bool bEnerVir,
                   int nthread, int thread)
 {
@@ -298,7 +301,8 @@ int solve_pme_yzx(struct gmx_pme_t *pme, t_complex *grid,
     int                      kx, ky, kz, maxkx, maxky;
     int                      nx, ny, nz, iyz0, iyz1, iyz, iy, iz, kxstart, kxend;
     real                     mx, my, mz;
-    real                     factor = M_PI*M_PI/(ewaldcoeff*ewaldcoeff);
+    real                     ewaldcoeff = pme->ewaldcoeff_q;
+    real                     factor     = M_PI*M_PI/(ewaldcoeff*ewaldcoeff);
     real                     ets2, struct2, vfactor, ets2vf;
     real                     d1, d2, energy = 0;
     real                     by, bz;
@@ -538,8 +542,7 @@ int solve_pme_yzx(struct gmx_pme_t *pme, t_complex *grid,
     return local_ndata[YY]*local_ndata[XX];
 }
 
-int solve_pme_lj_yzx(struct gmx_pme_t *pme, t_complex **grid, gmx_bool bLB,
-                     real ewaldcoeff, real vol,
+int solve_pme_lj_yzx(const gmx_pme_t *pme, t_complex **grid, gmx_bool bLB, real vol,
                      gmx_bool bEnerVir, int nthread, int thread)
 {
     /* do recip sum over local cells in grid */
@@ -548,7 +551,8 @@ int solve_pme_lj_yzx(struct gmx_pme_t *pme, t_complex **grid, gmx_bool bLB,
     int                      kx, ky, kz, maxkx, maxky;
     int                      nx, ny, nz, iy, iyz0, iyz1, iyz, iz, kxstart, kxend;
     real                     mx, my, mz;
-    real                     factor = M_PI*M_PI/(ewaldcoeff*ewaldcoeff);
+    real                     ewaldcoeff = pme->ewaldcoeff_lj;
+    real                     factor     = M_PI*M_PI/(ewaldcoeff*ewaldcoeff);
     real                     ets2, ets2vf;
     real                     eterm, vterm, d1, d2, energy = 0;
     real                     by, bz;
index 6b26a58f1bc37df9b0ac46c5475d0b663b22ae5a..b1af3702f5e9de02c8dfe0d6dcd3c11c46463729 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,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.
@@ -69,13 +69,13 @@ void get_pme_ener_vir_q(struct pme_solve_work_t *work, int nthread,
 void get_pme_ener_vir_lj(struct pme_solve_work_t *work, int nthread,
                          real *mesh_energy, matrix vir);
 
-int solve_pme_yzx(struct gmx_pme_t *pme, t_complex *grid,
-                  real ewaldcoeff, real vol,
+int solve_pme_yzx(const gmx_pme_t *pme, t_complex *grid,
+                  real vol,
                   gmx_bool bEnerVir,
                   int nthread, int thread);
 
-int solve_pme_lj_yzx(struct gmx_pme_t *pme, t_complex **grid, gmx_bool bLB,
-                     real ewaldcoeff, real vol,
+int solve_pme_lj_yzx(const gmx_pme_t *pme, t_complex **grid, gmx_bool bLB,
+                     real vol,
                      gmx_bool bEnerVir, int nthread, int thread);
 
 #endif
index 2a1e8efc6b7ebef3aa2dde4aab037946975893fc..b3db6c366bc141439eeed445822338021ed92c8c 100644 (file)
 #include <algorithm>
 
 #include "gromacs/ewald/pme.h"
+#include "gromacs/fft/parallel_3dfft.h"
 #include "gromacs/simd/simd.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
+#include "pme-grid.h"
 #include "pme-internal.h"
 #include "pme-simd.h"
 #include "pme-spline-work.h"
 
 /* TODO consider split of pme-spline from this file */
 
-static void calc_interpolation_idx(struct gmx_pme_t *pme, pme_atomcomm_t *atc,
+static void calc_interpolation_idx(const gmx_pme_t *pme, const pme_atomcomm_t *atc,
                                    int start, int grid_index, int end, int thread)
 {
     int             i;
@@ -67,9 +69,9 @@ static void calc_interpolation_idx(struct gmx_pme_t *pme, pme_atomcomm_t *atc,
     int             nx, ny, nz;
     int            *g2tx, *g2ty, *g2tz;
     gmx_bool        bThreads;
-    int            *thread_idx = NULL;
-    thread_plist_t *tpl        = NULL;
-    int            *tpl_n      = NULL;
+    int            *thread_idx = nullptr;
+    thread_plist_t *tpl        = nullptr;
+    int            *tpl_n      = nullptr;
     int             thread_i;
 
     nx  = pme->nkx;
@@ -100,21 +102,28 @@ static void calc_interpolation_idx(struct gmx_pme_t *pme, pme_atomcomm_t *atc,
         }
     }
 
+    const real shift = c_pmeMaxUnitcellShift;
+
     for (i = start; i < end; i++)
     {
         xptr   = atc->x[i];
         idxptr = atc->idx[i];
         fptr   = atc->fractx[i];
 
-        /* Fractional coordinates along box vectors, add 2.0 to make 100% sure we are positive for triclinic boxes */
-        tx = nx * ( xptr[XX] * rxx + xptr[YY] * ryx + xptr[ZZ] * rzx + 2.0 );
-        ty = ny * (                  xptr[YY] * ryy + xptr[ZZ] * rzy + 2.0 );
-        tz = nz * (                                   xptr[ZZ] * rzz + 2.0 );
+        /* Fractional coordinates along box vectors, add a positive shift to ensure tx/ty/tz are positive for triclinic boxes */
+        tx = nx * ( xptr[XX] * rxx + xptr[YY] * ryx + xptr[ZZ] * rzx + shift );
+        ty = ny * (                  xptr[YY] * ryy + xptr[ZZ] * rzy + shift );
+        tz = nz * (                                   xptr[ZZ] * rzz + shift );
 
-        tix = (int)(tx);
-        tiy = (int)(ty);
-        tiz = (int)(tz);
+        tix = static_cast<int>(tx);
+        tiy = static_cast<int>(ty);
+        tiz = static_cast<int>(tz);
 
+#ifdef DEBUG
+        range_check(tix, 0, c_pmeNeighborUnitcellCount * nx);
+        range_check(tiy, 0, c_pmeNeighborUnitcellCount * ny);
+        range_check(tiz, 0, c_pmeNeighborUnitcellCount * nz);
+#endif
         /* Because decomposition only occurs in x and y,
          * we never have a fraction correction in z.
          */
@@ -174,7 +183,7 @@ static void calc_interpolation_idx(struct gmx_pme_t *pme, pme_atomcomm_t *atc,
     }
 }
 
-static void make_thread_local_ind(pme_atomcomm_t *atc,
+static void make_thread_local_ind(const pme_atomcomm_t *atc,
                                   int thread, splinedata_t *spline)
 {
     int             n, t, i, start, end;
@@ -303,8 +312,8 @@ static void make_bsplines(splinevec theta, splinevec dtheta, int order,
     }
 
 
-static void spread_coefficients_bsplines_thread(pmegrid_t                         *pmegrid,
-                                                pme_atomcomm_t                    *atc,
+static void spread_coefficients_bsplines_thread(const pmegrid_t                   *pmegrid,
+                                                const pme_atomcomm_t              *atc,
                                                 splinedata_t                      *spline,
                                                 struct pme_spline_work gmx_unused *work)
 {
@@ -390,7 +399,7 @@ static void spread_coefficients_bsplines_thread(pmegrid_t
     }
 }
 
-static void copy_local_grid(struct gmx_pme_t *pme, pmegrids_t *pmegrids,
+static void copy_local_grid(const gmx_pme_t *pme, const pmegrids_t *pmegrids,
                             int grid_index, int thread, real *fftgrid)
 {
     ivec local_fft_ndata, local_fft_offset, local_fft_size;
@@ -399,7 +408,6 @@ static void copy_local_grid(struct gmx_pme_t *pme, pmegrids_t *pmegrids,
     ivec nf;
     int  offx, offy, offz, x, y, z, i0, i0t;
     int  d;
-    pmegrid_t *pmegrid;
     real *grid_th;
 
     gmx_parallel_3dfft_real_limits(pme->pfft_setup[grid_index],
@@ -409,7 +417,7 @@ static void copy_local_grid(struct gmx_pme_t *pme, pmegrids_t *pmegrids,
     fft_my = local_fft_size[YY];
     fft_mz = local_fft_size[ZZ];
 
-    pmegrid = &pmegrids->grid_th[thread];
+    const pmegrid_t *pmegrid = &pmegrids->grid_th[thread];
 
     nsy = pmegrid->s[YY];
     nsz = pmegrid->s[ZZ];
@@ -443,7 +451,7 @@ static void copy_local_grid(struct gmx_pme_t *pme, pmegrids_t *pmegrids,
 }
 
 static void
-reduce_threadgrid_overlap(struct gmx_pme_t *pme,
+reduce_threadgrid_overlap(const gmx_pme_t *pme,
                           const pmegrids_t *pmegrids, int thread,
                           real *fftgrid, real *commbuf_x, real *commbuf_y,
                           int grid_index)
@@ -462,7 +470,7 @@ reduce_threadgrid_overlap(struct gmx_pme_t *pme,
     int  thread_f;
     const pmegrid_t *pmegrid, *pmegrid_g, *pmegrid_f;
     const real *grid_th;
-    real *commbuf = NULL;
+    real *commbuf = nullptr;
 
     gmx_parallel_3dfft_real_limits(pme->pfft_setup[grid_index],
                                    local_fft_ndata,
@@ -693,10 +701,9 @@ reduce_threadgrid_overlap(struct gmx_pme_t *pme,
 }
 
 
-static void sum_fftgrid_dd(struct gmx_pme_t *pme, real *fftgrid, int grid_index)
+static void sum_fftgrid_dd(const gmx_pme_t *pme, real *fftgrid, int grid_index)
 {
     ivec local_fft_ndata, local_fft_offset, local_fft_size;
-    pme_overlap_t *overlap;
     int  send_index0, send_nindex;
     int  recv_nindex;
 #if GMX_MPI
@@ -722,7 +729,7 @@ static void sum_fftgrid_dd(struct gmx_pme_t *pme, real *fftgrid, int grid_index)
     if (pme->nnodes_minor > 1)
     {
         /* Major dimension */
-        overlap = &pme->overlap[1];
+        const pme_overlap_t *overlap = &pme->overlap[1];
 
         if (pme->nnodes_major > 1)
         {
@@ -751,7 +758,7 @@ static void sum_fftgrid_dd(struct gmx_pme_t *pme, real *fftgrid, int grid_index)
             sendptr = overlap->sendbuf + send_index0*local_fft_ndata[ZZ];
             recvptr = overlap->recvbuf;
 
-            if (debug != NULL)
+            if (debug != nullptr)
             {
                 fprintf(debug, "PME fftgrid comm y %2d x %2d x %2d\n",
                         local_fft_ndata[XX], send_nindex, local_fft_ndata[ZZ]);
@@ -807,7 +814,7 @@ static void sum_fftgrid_dd(struct gmx_pme_t *pme, real *fftgrid, int grid_index)
     if (pme->nnodes_major > 1)
     {
         /* Major dimension */
-        overlap = &pme->overlap[0];
+        const pme_overlap_t *overlap = &pme->overlap[0];
 
         ipulse = 0;
 
@@ -817,7 +824,7 @@ static void sum_fftgrid_dd(struct gmx_pme_t *pme, real *fftgrid, int grid_index)
 
         recvptr = overlap->recvbuf;
 
-        if (debug != NULL)
+        if (debug != nullptr)
         {
             fprintf(debug, "PME fftgrid comm x %2d x %2d x %2d\n",
                     send_nindex, local_fft_ndata[YY], local_fft_ndata[ZZ]);
@@ -850,8 +857,8 @@ static void sum_fftgrid_dd(struct gmx_pme_t *pme, real *fftgrid, int grid_index)
     }
 }
 
-void spread_on_grid(struct gmx_pme_t *pme,
-                    pme_atomcomm_t *atc, pmegrids_t *grids,
+void spread_on_grid(const gmx_pme_t *pme,
+                    const pme_atomcomm_t *atc, const pmegrids_t *grids,
                     gmx_bool bCalcSplines, gmx_bool bSpread,
                     real *fftgrid, gmx_bool bDoSplines, int grid_index)
 {
@@ -903,19 +910,13 @@ void spread_on_grid(struct gmx_pme_t *pme,
         try
         {
             splinedata_t *spline;
-            pmegrid_t *grid = NULL;
 
             /* make local bsplines  */
-            if (grids == NULL || !pme->bUseThreads)
+            if (grids == nullptr || !pme->bUseThreads)
             {
                 spline = &atc->spline[0];
 
                 spline->n = atc->n;
-
-                if (bSpread)
-                {
-                    grid = &grids->grid;
-                }
             }
             else
             {
@@ -931,8 +932,6 @@ void spread_on_grid(struct gmx_pme_t *pme,
                     /* Get the indices our thread should operate on */
                     make_thread_local_ind(atc, thread, spline);
                 }
-
-                grid = &grids->grid_th[thread];
             }
 
             if (bCalcSplines)
@@ -944,6 +943,8 @@ void spread_on_grid(struct gmx_pme_t *pme,
             if (bSpread)
             {
                 /* put local atoms on grid. */
+                const pmegrid_t *grid = pme->bUseThreads ? &grids->grid_th[thread] : &grids->grid;
+
 #ifdef PME_TIME_SPREAD
                 ct1a = omp_cyc_start();
 #endif
index 557d1ad9c092fa462f6c79006ea840f76a94d784..78d8fbef69531376eecd41ea2da231d09dc259d2 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,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.
@@ -42,8 +42,8 @@
 #include "pme-internal.h"
 
 void
-spread_on_grid(struct gmx_pme_t *pme,
-               pme_atomcomm_t *atc, pmegrids_t *grids,
+spread_on_grid(const gmx_pme_t *pme,
+               const pme_atomcomm_t *atc, const pmegrids_t *grids,
                gmx_bool bCalcSplines, gmx_bool bSpread,
                real *fftgrid, gmx_bool bDoSplines, int grid_index);
 
index 5824e580ada49cc7b693832127decb1e0d3b802c..0ea7ae8feccbfef9f006bf16f0aaedeacb0e43e0 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,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.
 #include "gromacs/utility/gmxomp.h"
 #include "gromacs/utility/real.h"
 #include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/unique_cptr.h"
 
 #include "calculate-spline-moduli.h"
 #include "pme-gather.h"
@@ -150,38 +152,6 @@ static void setup_coordinate_communication(pme_atomcomm_t *atc)
     }
 }
 
-int gmx_pme_destroy(FILE *log, struct gmx_pme_t **pmedata)
-{
-    int i;
-
-    if (NULL != log)
-    {
-        fprintf(log, "Destroying PME data structures.\n");
-    }
-
-    sfree((*pmedata)->nnx);
-    sfree((*pmedata)->nny);
-    sfree((*pmedata)->nnz);
-
-    for (i = 0; i < (*pmedata)->ngrids; ++i)
-    {
-        pmegrids_destroy(&(*pmedata)->pmegrid[i]);
-        sfree((*pmedata)->fftgrid[i]);
-        sfree((*pmedata)->cfftgrid[i]);
-        gmx_parallel_3dfft_destroy((*pmedata)->pfft_setup[i]);
-    }
-
-    sfree((*pmedata)->lb_buf1);
-    sfree((*pmedata)->lb_buf2);
-
-    pme_free_all_work(&(*pmedata)->solve_work, (*pmedata)->nthread);
-
-    sfree(*pmedata);
-    *pmedata = NULL;
-
-    return 0;
-}
-
 /*! \brief Round \p n up to the next multiple of \p f */
 static int mult_up(int n, int f)
 {
@@ -261,11 +231,57 @@ static void init_atomcomm(struct gmx_pme_t *pme, pme_atomcomm_t *atc,
             snew(atc->thread_plist[thread].n, atc->nthread+2*gmxCacheLineSize);
             atc->thread_plist[thread].n += gmxCacheLineSize;
         }
-        snew(atc->spline[thread].thread_one, pme->nthread);
-        atc->spline[thread].thread_one[thread] = 1;
     }
 }
 
+/*! \brief Destroy an atom communication data structure and its child structs */
+static void destroy_atomcomm(pme_atomcomm_t *atc)
+{
+    sfree(atc->pd);
+    if (atc->nslab > 1)
+    {
+        sfree(atc->node_dest);
+        sfree(atc->node_src);
+        for (int i = 0; i < atc->nthread; i++)
+        {
+            sfree(atc->count_thread[i]);
+        }
+        sfree(atc->count_thread);
+        sfree(atc->rcount);
+        sfree(atc->buf_index);
+
+        sfree(atc->x);
+        sfree(atc->coefficient);
+        sfree(atc->f);
+    }
+    sfree(atc->idx);
+    sfree(atc->fractx);
+
+    sfree(atc->thread_idx);
+    for (int i = 0; i < atc->nthread; i++)
+    {
+        if (atc->nthread > 1)
+        {
+            int *n_ptr = atc->thread_plist[i].n - gmxCacheLineSize;
+            sfree(n_ptr);
+            sfree(atc->thread_plist[i].i);
+        }
+        sfree(atc->spline[i].ind);
+        for (int d = 0; d < ZZ; d++)
+        {
+            sfree(atc->spline[i].theta[d]);
+            sfree(atc->spline[i].dtheta[d]);
+        }
+        sfree_aligned(atc->spline[i].ptr_dtheta_z);
+        sfree_aligned(atc->spline[i].ptr_theta_z);
+    }
+    if (atc->nthread > 1)
+    {
+        sfree(atc->thread_plist);
+    }
+    sfree(atc->spline);
+}
+
 /*! \brief Initialize data structure for communication */
 static void
 init_overlap_comm(pme_overlap_t *  ol,
@@ -399,59 +415,85 @@ init_overlap_comm(pme_overlap_t *  ol,
     snew(ol->recvbuf, norder*commplainsize);
 }
 
-void gmx_pme_check_restrictions(int pme_order,
+/*! \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);
+}
+
+int minimalPmeGridSize(int pmeOrder)
+{
+    /* The actual grid size limitations are:
+     *   serial:        >= pme_order
+     *   DD, no OpenMP: >= 2*(pme_order - 1)
+     *   DD, OpenMP:    >= pme_order + 1
+     * But we use the maximum for simplicity since in practice there is not
+     * much performance difference between pme_order and 2*(pme_order -1).
+     */
+    int minimalSize = 2*(pmeOrder - 1);
+
+    GMX_RELEASE_ASSERT(pmeOrder >= 3, "pmeOrder has to be >= 3");
+    GMX_RELEASE_ASSERT(minimalSize >= pmeOrder + 1, "The grid size should be >= pmeOrder + 1");
+
+    return minimalSize;
+}
+
+bool gmx_pme_check_restrictions(int pme_order,
                                 int nkx, int nky, int nkz,
                                 int nnodes_major,
-                                int nnodes_minor,
-                                gmx_bool bUseThreads,
-                                gmx_bool bFatal,
-                                gmx_bool *bValidSettings)
+                                bool useThreads,
+                                bool errorsAreFatal)
 {
     if (pme_order > PME_ORDER_MAX)
     {
-        if (!bFatal)
+        if (!errorsAreFatal)
         {
-            *bValidSettings = FALSE;
-            return;
+            return false;
         }
-        gmx_fatal(FARGS, "pme_order (%d) is larger than the maximum allowed value (%d). Modify and recompile the code if you really need such a high order.",
-                  pme_order, PME_ORDER_MAX);
+
+        std::string message = gmx::formatString(
+                    "pme_order (%d) is larger than the maximum allowed value (%d). Modify and recompile the code if you really need such a high order.",
+                    pme_order, PME_ORDER_MAX);
+        GMX_THROW(InconsistentInputError(message));
     }
 
-    if (nkx <= pme_order*(nnodes_major > 1 ? 2 : 1) ||
-        nky <= pme_order*(nnodes_minor > 1 ? 2 : 1) ||
-        nkz <= pme_order)
+    const int minGridSize = minimalPmeGridSize(pme_order);
+    if (nkx < minGridSize ||
+        nky < minGridSize ||
+        nkz < minGridSize)
     {
-        if (!bFatal)
+        if (!errorsAreFatal)
         {
-            *bValidSettings = FALSE;
-            return;
+            return false;
         }
-        gmx_fatal(FARGS, "The PME grid sizes need to be larger than pme_order (%d) and for dimensions with domain decomposition larger than 2*pme_order",
-                  pme_order);
+        std::string message = gmx::formatString(
+                    "The PME grid sizes need to be >= 2*(pme_order-1) (%d)",
+                    minGridSize);
+        GMX_THROW(InconsistentInputError(message));
     }
 
     /* Check for a limitation of the (current) sum_fftgrid_dd code.
      * We only allow multiple communication pulses in dim 1, not in dim 0.
      */
-    if (bUseThreads && (nkx < nnodes_major*pme_order &&
-                        nkx != nnodes_major*(pme_order - 1)))
+    if (useThreads && (nkx < nnodes_major*pme_order &&
+                       nkx != nnodes_major*(pme_order - 1)))
     {
-        if (!bFatal)
+        if (!errorsAreFatal)
         {
-            *bValidSettings = FALSE;
-            return;
+            return false;
         }
         gmx_fatal(FARGS, "The number of PME grid lines per rank along x is %g. But when using OpenMP threads, the number of grid lines per rank along x should be >= pme_order (%d) or = pmeorder-1. To resolve this issue, use fewer ranks along x (and possibly more along y and/or z) by specifying -dd manually.",
                   nkx/(double)nnodes_major, pme_order);
     }
 
-    if (bValidSettings != NULL)
-    {
-        *bValidSettings = TRUE;
-    }
-
-    return;
+    return true;
 }
 
 /*! \brief Round \p enumerator */
@@ -464,15 +506,15 @@ int gmx_pme_init(struct gmx_pme_t **pmedata,
                  t_commrec *        cr,
                  int                nnodes_major,
                  int                nnodes_minor,
-                 t_inputrec *       ir,
+                 const t_inputrec * ir,
                  int                homenr,
                  gmx_bool           bFreeEnergy_q,
                  gmx_bool           bFreeEnergy_lj,
                  gmx_bool           bReproducible,
+                 real               ewaldcoeff_q,
+                 real               ewaldcoeff_lj,
                  int                nthread)
 {
-    struct gmx_pme_t *pme = NULL;
-
     int               use_threads, sum_use_threads, i;
     ivec              ndata;
 
@@ -480,10 +522,14 @@ int gmx_pme_init(struct gmx_pme_t **pmedata,
     {
         fprintf(debug, "Creating PME data structures.\n");
     }
-    snew(pme, 1);
 
-    pme->sum_qgrid_tmp       = NULL;
-    pme->sum_qgrid_dd_tmp    = NULL;
+    gmx_pme_t *pmeRaw = nullptr;
+    snew(pmeRaw, 1);
+    unique_cptr<gmx_pme_t, gmx_pme_destroy> pme(pmeRaw);
+
+    pme->sum_qgrid_tmp       = nullptr;
+    pme->sum_qgrid_dd_tmp    = nullptr;
+
     pme->buf_nalloc          = 0;
 
     pme->nnodes              = 1;
@@ -591,17 +637,29 @@ int gmx_pme_init(struct gmx_pme_t **pmedata,
         gmx_fatal(FARGS, "pme does not (yet) work with pbc = screw");
     }
 
-    pme->bFEP_q      = ((ir->efep != efepNO) && bFreeEnergy_q);
-    pme->bFEP_lj     = ((ir->efep != efepNO) && bFreeEnergy_lj);
-    pme->bFEP        = (pme->bFEP_q || pme->bFEP_lj);
-    pme->nkx         = ir->nkx;
-    pme->nky         = ir->nky;
-    pme->nkz         = ir->nkz;
-    pme->bP3M        = (ir->coulombtype == eelP3M_AD || getenv("GMX_PME_P3M") != NULL);
-    pme->pme_order   = ir->pme_order;
+    /* NOTE:
+     * It is likely that the current gmx_pme_do() routine supports calculating
+     * only Coulomb or LJ while gmx_pme_init() configures for both,
+     * but that has never been tested.
+     * It is likely that the current gmx_pme_do() routine supports calculating,
+     * not calculating free-energy for Coulomb and/or LJ while gmx_pme_init()
+     * configures with free-energy, but that has never been tested.
+     */
+    pme->doCoulomb     = EEL_PME(ir->coulombtype);
+    pme->doLJ          = EVDW_PME(ir->vdwtype);
+    pme->bFEP_q        = ((ir->efep != efepNO) && bFreeEnergy_q);
+    pme->bFEP_lj       = ((ir->efep != efepNO) && bFreeEnergy_lj);
+    pme->bFEP          = (pme->bFEP_q || pme->bFEP_lj);
+    pme->nkx           = ir->nkx;
+    pme->nky           = ir->nky;
+    pme->nkz           = ir->nkz;
+    pme->bP3M          = (ir->coulombtype == eelP3M_AD || getenv("GMX_PME_P3M") != nullptr);
+    pme->pme_order     = ir->pme_order;
+    pme->ewaldcoeff_q  = ewaldcoeff_q;
+    pme->ewaldcoeff_lj = ewaldcoeff_lj;
 
     /* Always constant electrostatics coefficients */
-    pme->epsilon_r   = ir->epsilon_r;
+    pme->epsilon_r     = ir->epsilon_r;
 
     /* Always constant LJ coefficients */
     pme->ljpme_combination_rule = ir->ljpme_combination_rule;
@@ -610,10 +668,8 @@ int gmx_pme_init(struct gmx_pme_t **pmedata,
     gmx_pme_check_restrictions(pme->pme_order,
                                pme->nkx, pme->nky, pme->nkz,
                                pme->nnodes_major,
-                               pme->nnodes_minor,
                                pme->bUseThreads,
-                               TRUE,
-                               NULL);
+                               true);
 
     if (pme->nnodes > 1)
     {
@@ -630,7 +686,7 @@ int gmx_pme_init(struct gmx_pme_t **pmedata,
          * (unless the coefficient distribution is inhomogeneous).
          */
 
-        imbal = estimate_pme_load_imbalance(pme);
+        imbal = estimate_pme_load_imbalance(pme.get());
         if (imbal >= 1.2 && pme->nodeid_major == 0 && pme->nodeid_minor == 0)
         {
             fprintf(stderr,
@@ -698,18 +754,18 @@ int gmx_pme_init(struct gmx_pme_t **pmedata,
     pme->pmegrid_start_iy = pme->overlap[1].s2g0[pme->nodeid_minor];
     pme->pmegrid_start_iz = 0;
 
-    make_gridindex5_to_localindex(pme->nkx,
-                                  pme->pmegrid_start_ix,
-                                  pme->pmegrid_nx - (pme->pme_order-1),
-                                  &pme->nnx, &pme->fshx);
-    make_gridindex5_to_localindex(pme->nky,
-                                  pme->pmegrid_start_iy,
-                                  pme->pmegrid_ny - (pme->pme_order-1),
-                                  &pme->nny, &pme->fshy);
-    make_gridindex5_to_localindex(pme->nkz,
-                                  pme->pmegrid_start_iz,
-                                  pme->pmegrid_nz_base,
-                                  &pme->nnz, &pme->fshz);
+    make_gridindex_to_localindex(pme->nkx,
+                                 pme->pmegrid_start_ix,
+                                 pme->pmegrid_nx - (pme->pme_order-1),
+                                 &pme->nnx, &pme->fshx);
+    make_gridindex_to_localindex(pme->nky,
+                                 pme->pmegrid_start_iy,
+                                 pme->pmegrid_ny - (pme->pme_order-1),
+                                 &pme->nny, &pme->fshy);
+    make_gridindex_to_localindex(pme->nkz,
+                                 pme->pmegrid_start_iz,
+                                 pme->pmegrid_nz_base,
+                                 &pme->nnz, &pme->fshz);
 
     pme->spline_work = make_pme_spline_work(pme->pme_order);
 
@@ -719,7 +775,7 @@ int gmx_pme_init(struct gmx_pme_t **pmedata,
     /* It doesn't matter if we allocate too many grids here,
      * we only allocate and use the ones we need.
      */
-    if (EVDW_PME(ir->vdwtype))
+    if (pme->doLJ)
     {
         pme->ngrids = ((ir->ljpme_combination_rule == eljpmeLB) ? DO_Q_AND_LJ_LB : DO_Q_AND_LJ);
     }
@@ -733,11 +789,11 @@ int gmx_pme_init(struct gmx_pme_t **pmedata,
 
     for (i = 0; i < pme->ngrids; ++i)
     {
-        if ((i <  DO_Q && EEL_PME(ir->coulombtype) && (i == 0 ||
-                                                       bFreeEnergy_q)) ||
-            (i >= DO_Q && EVDW_PME(ir->vdwtype) && (i == 2 ||
-                                                    bFreeEnergy_lj ||
-                                                    ir->ljpme_combination_rule == eljpmeLB)))
+        if ((i <  DO_Q && pme->doCoulomb && (i == 0 ||
+                                             bFreeEnergy_q)) ||
+            (i >= DO_Q && pme->doLJ && (i == 2 ||
+                                        bFreeEnergy_lj ||
+                                        ir->ljpme_combination_rule == eljpmeLB)))
         {
             pmegrids_init(&pme->pmegrid[i],
                           pme->pmegrid_nx, pme->pmegrid_ny, pme->pmegrid_nz,
@@ -768,10 +824,10 @@ int gmx_pme_init(struct gmx_pme_t **pmedata,
     }
 
     /* Use atc[0] for spreading */
-    init_atomcomm(pme, &pme->atc[0], nnodes_major > 1 ? 0 : 1, TRUE);
+    init_atomcomm(pme.get(), &pme->atc[0], nnodes_major > 1 ? 0 : 1, TRUE);
     if (pme->ndecompdim >= 2)
     {
-        init_atomcomm(pme, &pme->atc[1], 1, FALSE);
+        init_atomcomm(pme.get(), &pme->atc[1], 1, FALSE);
     }
 
     if (pme->nnodes == 1)
@@ -780,13 +836,14 @@ int gmx_pme_init(struct gmx_pme_t **pmedata,
         pme_realloc_atomcomm_things(&pme->atc[0]);
     }
 
-    pme->lb_buf1       = NULL;
-    pme->lb_buf2       = NULL;
+    pme->lb_buf1       = nullptr;
+    pme->lb_buf2       = nullptr;
     pme->lb_buf_nalloc = 0;
 
     pme_init_all_work(&pme->solve_work, pme->nthread, pme->nkx);
 
-    *pmedata = pme;
+    // no exception was thrown during the init, so we hand over the PME structure handle
+    *pmedata = pme.release();
 
     return 0;
 }
@@ -795,16 +852,27 @@ int gmx_pme_reinit(struct gmx_pme_t **pmedata,
                    t_commrec *        cr,
                    struct gmx_pme_t * pme_src,
                    const t_inputrec * ir,
-                   ivec               grid_size)
+                   ivec               grid_size,
+                   real               ewaldcoeff_q,
+                   real               ewaldcoeff_lj)
 {
-    t_inputrec irc;
     int        homenr;
     int        ret;
 
-    irc     = *ir;
-    irc.nkx = grid_size[XX];
-    irc.nky = grid_size[YY];
-    irc.nkz = grid_size[ZZ];
+    // Create a copy of t_inputrec fields that are used in gmx_pme_init().
+    // TODO: This would be better as just copying a sub-structure that contains
+    // all the PME parameters and nothing else.
+    t_inputrec irc;
+    irc.ePBC                   = ir->ePBC;
+    irc.coulombtype            = ir->coulombtype;
+    irc.vdwtype                = ir->vdwtype;
+    irc.efep                   = ir->efep;
+    irc.pme_order              = ir->pme_order;
+    irc.epsilon_r              = ir->epsilon_r;
+    irc.ljpme_combination_rule = ir->ljpme_combination_rule;
+    irc.nkx                    = grid_size[XX];
+    irc.nky                    = grid_size[YY];
+    irc.nkz                    = grid_size[ZZ];
 
     if (pme_src->nnodes == 1)
     {
@@ -815,8 +883,12 @@ int gmx_pme_reinit(struct gmx_pme_t **pmedata,
         homenr = -1;
     }
 
-    ret = gmx_pme_init(pmedata, cr, pme_src->nnodes_major, pme_src->nnodes_minor,
-                       &irc, homenr, pme_src->bFEP_q, pme_src->bFEP_lj, FALSE, pme_src->nthread);
+    try
+    {
+        ret = gmx_pme_init(pmedata, cr, pme_src->nnodes_major, pme_src->nnodes_minor,
+                           &irc, homenr, pme_src->bFEP_q, pme_src->bFEP_lj, FALSE, ewaldcoeff_q, ewaldcoeff_lj, pme_src->nthread);
+    }
+    GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
 
     if (ret == 0)
     {
@@ -844,7 +916,7 @@ void gmx_pme_calc_energy(struct gmx_pme_t *pme, int n, rvec *x, real *q, real *V
 
     atc            = &pme->atc_energy;
     atc->nthread   = 1;
-    if (atc->spline == NULL)
+    if (atc->spline == nullptr)
     {
         snew(atc->spline, atc->nthread);
     }
@@ -860,7 +932,7 @@ void gmx_pme_calc_energy(struct gmx_pme_t *pme, int n, rvec *x, real *q, real *V
     grid = &pme->pmegrid[PME_GRID_QA];
 
     /* Only calculate the spline coefficients, don't actually spread */
-    spread_on_grid(pme, atc, NULL, TRUE, FALSE, pme->fftgrid[PME_GRID_QA], FALSE, PME_GRID_QA);
+    spread_on_grid(pme, atc, nullptr, TRUE, FALSE, pme->fftgrid[PME_GRID_QA], FALSE, PME_GRID_QA);
 
     *V = gather_energy_bsplines(pme, grid->grid.grid, atc);
 }
@@ -901,8 +973,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
                matrix box,      t_commrec *cr,
                int  maxshift_x, int maxshift_y,
                t_nrnb *nrnb,    gmx_wallcycle_t wcycle,
-               matrix vir_q,    real ewaldcoeff_q,
-               matrix vir_lj,   real ewaldcoeff_lj,
+               matrix vir_q,    matrix vir_lj,
                real *energy_q,  real *energy_lj,
                real lambda_q,   real lambda_lj,
                real *dvdlambda_q, real *dvdlambda_lj,
@@ -910,11 +981,11 @@ int gmx_pme_do(struct gmx_pme_t *pme,
 {
     int                  d, i, j, npme, grid_index, max_grid_index;
     int                  n_d;
-    pme_atomcomm_t      *atc        = NULL;
-    pmegrids_t          *pmegrid    = NULL;
-    real                *grid       = NULL;
+    pme_atomcomm_t      *atc        = nullptr;
+    pmegrids_t          *pmegrid    = nullptr;
+    real                *grid       = nullptr;
     rvec                *f_d;
-    real                *coefficient = NULL;
+    real                *coefficient = nullptr;
     real                 energy_AB[4];
     matrix               vir_AB[4];
     real                 scale, lambda;
@@ -971,7 +1042,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
      * that don't yet have them.
      */
 
-    bDoSplines = pme->bFEP || ((flags & GMX_PME_DO_COULOMB) && (flags & GMX_PME_DO_LJ));
+    bDoSplines = pme->bFEP || (pme->doCoulomb && pme->doLJ);
 
     /* We need a maximum of four separate PME calculations:
      * grid_index=0: Coulomb PME with charges from state A
@@ -992,9 +1063,9 @@ int gmx_pme_do(struct gmx_pme_t *pme,
          * If grid_index < 2 we should be doing electrostatic PME
          * If grid_index >= 2 we should be doing LJ-PME
          */
-        if ((grid_index <  DO_Q && (!(flags & GMX_PME_DO_COULOMB) ||
+        if ((grid_index <  DO_Q && (!pme->doCoulomb ||
                                     (grid_index == 1 && !pme->bFEP_q))) ||
-            (grid_index >= DO_Q && (!(flags & GMX_PME_DO_LJ) ||
+            (grid_index >= DO_Q && (!pme->doLJ ||
                                     (grid_index == 3 && !pme->bFEP_lj))))
         {
             continue;
@@ -1019,7 +1090,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
             fprintf(debug, "PME: number of ranks = %d, rank = %d\n",
                     cr->nnodes, cr->nodeid);
             fprintf(debug, "Grid = %p\n", (void*)grid);
-            if (grid == NULL)
+            if (grid == nullptr)
             {
                 gmx_fatal(FARGS, "No grid!");
             }
@@ -1047,7 +1118,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
 
         if (flags & GMX_PME_SPREAD)
         {
-            wallcycle_start(wcycle, ewcPME_SPREADGATHER);
+            wallcycle_start(wcycle, ewcPME_SPREAD);
 
             /* Spread the coefficients on a grid */
             spread_on_grid(pme, &pme->atc[0], pmegrid, bFirst, TRUE, fftgrid, bDoSplines, grid_index);
@@ -1075,7 +1146,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
                 copy_pmegrid_to_fftgrid(pme, grid, fftgrid, grid_index);
             }
 
-            wallcycle_stop(wcycle, ewcPME_SPREADGATHER);
+            wallcycle_stop(wcycle, ewcPME_SPREAD);
 
             /* TODO If the OpenMP and single-threaded implementations
                converge, then spread_on_grid() and
@@ -1119,7 +1190,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
                     if (grid_index < DO_Q)
                     {
                         loop_count =
-                            solve_pme_yzx(pme, cfftgrid, ewaldcoeff_q,
+                            solve_pme_yzx(pme, cfftgrid,
                                           box[XX][XX]*box[YY][YY]*box[ZZ][ZZ],
                                           bCalcEnerVir,
                                           pme->nthread, thread);
@@ -1127,7 +1198,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
                     else
                     {
                         loop_count =
-                            solve_pme_lj_yzx(pme, &cfftgrid, FALSE, ewaldcoeff_lj,
+                            solve_pme_lj_yzx(pme, &cfftgrid, FALSE,
                                              box[XX][XX]*box[YY][YY]*box[ZZ][ZZ],
                                              bCalcEnerVir,
                                              pme->nthread, thread);
@@ -1167,7 +1238,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
                         /* Note: this wallcycle region is closed below
                            outside an OpenMP region, so take care if
                            refactoring code here. */
-                        wallcycle_start(wcycle, ewcPME_SPREADGATHER);
+                        wallcycle_start(wcycle, ewcPME_GATHER);
                     }
 
                     copy_fftgrid_to_pmegrid(pme, fftgrid, grid, grid_index, pme->nthread, thread);
@@ -1222,7 +1293,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
                      pme->pme_order*pme->pme_order*pme->pme_order*pme->atc[0].n);
             /* Note: this wallcycle region is opened above inside an OpenMP
                region, so take care if refactoring code here. */
-            wallcycle_stop(wcycle, ewcPME_SPREADGATHER);
+            wallcycle_stop(wcycle, ewcPME_GATHER);
         }
 
         if (bCalcEnerVir)
@@ -1245,15 +1316,15 @@ int gmx_pme_do(struct gmx_pme_t *pme,
     /* For Lorentz-Berthelot combination rules in LJ-PME, we need to calculate
      * seven terms. */
 
-    if ((flags & GMX_PME_DO_LJ) && pme->ljpme_combination_rule == eljpmeLB)
+    if (pme->doLJ && pme->ljpme_combination_rule == eljpmeLB)
     {
         /* Loop over A- and B-state if we are doing FEP */
         for (fep_state = 0; fep_state < fep_states_lj; ++fep_state)
         {
-            real *local_c6 = NULL, *local_sigma = NULL, *RedistC6 = NULL, *RedistSigma = NULL;
+            real *local_c6 = nullptr, *local_sigma = nullptr, *RedistC6 = nullptr, *RedistSigma = nullptr;
             if (pme->nnodes == 1)
             {
-                if (pme->lb_buf1 == NULL)
+                if (pme->lb_buf1 == nullptr)
                 {
                     pme->lb_buf_nalloc = pme->atc[0].n;
                     snew(pme->lb_buf1, pme->lb_buf_nalloc);
@@ -1330,7 +1401,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
 
                 if (flags & GMX_PME_SPREAD)
                 {
-                    wallcycle_start(wcycle, ewcPME_SPREADGATHER);
+                    wallcycle_start(wcycle, ewcPME_SPREAD);
                     /* Spread the c6 on a grid */
                     spread_on_grid(pme, &pme->atc[0], pmegrid, bFirst, TRUE, fftgrid, bDoSplines, grid_index);
 
@@ -1354,7 +1425,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
 #endif
                         copy_pmegrid_to_fftgrid(pme, grid, fftgrid, grid_index);
                     }
-                    wallcycle_stop(wcycle, ewcPME_SPREADGATHER);
+                    wallcycle_stop(wcycle, ewcPME_SPREAD);
                 }
                 /*Here we start a large thread parallel region*/
 #pragma omp parallel num_threads(pme->nthread) private(thread)
@@ -1398,7 +1469,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
                         }
 
                         loop_count =
-                            solve_pme_lj_yzx(pme, &pme->cfftgrid[2], TRUE, ewaldcoeff_lj,
+                            solve_pme_lj_yzx(pme, &pme->cfftgrid[2], TRUE,
                                              box[XX][XX]*box[YY][YY]*box[ZZ][ZZ],
                                              bCalcEnerVir,
                                              pme->nthread, thread);
@@ -1423,7 +1494,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
 
             if (bBackFFT)
             {
-                bFirst = !(flags & GMX_PME_DO_COULOMB);
+                bFirst = !pme->doCoulomb;
                 calc_initial_lb_coeffs(pme, local_c6, local_sigma);
                 for (grid_index = 8; grid_index >= 2; --grid_index)
                 {
@@ -1460,7 +1531,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
                                     npme  = static_cast<int>(ntot*std::log(ntot)/std::log(2.0));
                                     inc_nrnb(nrnb, eNR_FFT, 2*npme);
                                 }
-                                wallcycle_start(wcycle, ewcPME_SPREADGATHER);
+                                wallcycle_start(wcycle, ewcPME_GATHER);
                             }
 
                             copy_fftgrid_to_pmegrid(pme, fftgrid, grid, grid_index, pme->nthread, thread);
@@ -1504,7 +1575,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
                         inc_nrnb(nrnb, eNR_GATHERFBSP,
                                  pme->pme_order*pme->pme_order*pme->pme_order*pme->atc[0].n);
                     }
-                    wallcycle_stop(wcycle, ewcPME_SPREADGATHER);
+                    wallcycle_stop(wcycle, ewcPME_GATHER);
 
                     bFirst = FALSE;
                 } /* for (grid_index = 8; grid_index >= 2; --grid_index) */
@@ -1541,7 +1612,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
 
     if (bCalcEnerVir)
     {
-        if (flags & GMX_PME_DO_COULOMB)
+        if (pme->doCoulomb)
         {
             if (!pme->bFEP_q)
             {
@@ -1571,7 +1642,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
             *energy_q = 0;
         }
 
-        if (flags & GMX_PME_DO_LJ)
+        if (pme->doLJ)
         {
             if (!pme->bFEP_lj)
             {
@@ -1602,3 +1673,59 @@ int gmx_pme_do(struct gmx_pme_t *pme,
     }
     return 0;
 }
+
+void gmx_pme_destroy(gmx_pme_t *pme)
+{
+    if (!pme)
+    {
+        return;
+    }
+
+    sfree(pme->nnx);
+    sfree(pme->nny);
+    sfree(pme->nnz);
+    sfree(pme->fshx);
+    sfree(pme->fshy);
+    sfree(pme->fshz);
+
+    for (int i = 0; i < pme->ngrids; ++i)
+    {
+        pmegrids_destroy(&pme->pmegrid[i]);
+    }
+    if (pme->pfft_setup)
+    {
+        for (int i = 0; i < pme->ngrids; ++i)
+        {
+            gmx_parallel_3dfft_destroy(pme->pfft_setup[i]);
+        }
+    }
+    sfree(pme->fftgrid);
+    sfree(pme->cfftgrid);
+    sfree(pme->pfft_setup);
+
+    for (int i = 0; i < std::max(1, pme->ndecompdim); i++) //pme->atc[0] is always allocated
+    {
+        destroy_atomcomm(&pme->atc[i]);
+    }
+
+    for (int i = 0; i < DIM; i++)
+    {
+        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);
+
+    sfree(pme->bufv);
+    sfree(pme->bufr);
+
+    pme_free_all_work(&pme->solve_work, pme->nthread);
+
+    sfree(pme->sum_qgrid_tmp);
+    sfree(pme->sum_qgrid_dd_tmp);
+
+    sfree(pme);
+}
index 9f4f06375bfad374afaff5fd91d9e976b0921f1c..1b6c0551db1cefb5cb756987291285e3c2493b99 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,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.
@@ -66,21 +66,39 @@ enum {
     GMX_SUM_GRID_FORWARD, GMX_SUM_GRID_BACKWARD
 };
 
+/*! \brief Return the smallest allowed PME grid size for \p pmeOrder */
+int minimalPmeGridSize(int pmeOrder);
+
+/*! \brief Check restrictions on pme_order and the PME grid nkx,nky,nkz.
+ *
+ * With errorsAreFatal=true, an exception or fatal error is generated
+ * on violation of restrictions.
+ * With errorsAreFatal=false, false is returned on violation of restrictions.
+ * When all restrictions are obeyed, true is returned.
+ * Argument useThreads tells if any MPI rank doing PME uses more than 1 threads.
+ * If at calling useThreads is unknown, pass true for conservative checking.
+ */
+bool gmx_pme_check_restrictions(int pme_order,
+                                int nkx, int nky, int nkz,
+                                int nnodes_major,
+                                bool useThreads,
+                                bool errorsAreFatal);
+
 /*! \brief Initialize \p pmedata
  *
- * Return value 0 indicates all well, non zero is an error code.
+ * \returns  0 indicates all well, non zero is an error code.
+ * \throws   gmx::InconsistentInputError if input grid sizes/PME order are inconsistent.
  */
 int gmx_pme_init(struct gmx_pme_t **pmedata, struct t_commrec *cr,
                  int nnodes_major, int nnodes_minor,
-                 t_inputrec *ir, int homenr,
+                 const t_inputrec *ir, int homenr,
                  gmx_bool bFreeEnergy_q, gmx_bool bFreeEnergy_lj,
-                 gmx_bool bReproducible, int nthread);
+                 gmx_bool bReproducible,
+                 real ewaldcoeff_q, real ewaldcoeff_lj,
+                 int nthread);
 
-/*! \brief Destroy the pme data structures resepectively.
- *
- * \return 0 indicates all well, non zero is an error code.
- */
-int gmx_pme_destroy(FILE *log, struct gmx_pme_t **pmedata);
+/*! \brief Destroys the PME data structure.*/
+void gmx_pme_destroy(gmx_pme_t *pme);
 
 //@{
 /*! \brief Flag values that control what gmx_pme_do() will calculate
@@ -94,12 +112,6 @@ int gmx_pme_destroy(FILE *log, struct gmx_pme_t **pmedata);
 /* This forces the grid to be backtransformed even without GMX_PME_CALC_F */
 #define GMX_PME_CALC_POT      (1<<4)
 
-/* These values label bits used for sending messages to PME nodes using the
- * routines in pme_pp.c and shouldn't conflict with the flags used there
- */
-#define GMX_PME_DO_COULOMB    (1<<13)
-#define GMX_PME_DO_LJ         (1<<14)
-
 #define GMX_PME_DO_ALL_F  (GMX_PME_SPREAD | GMX_PME_SOLVE | GMX_PME_CALC_F)
 //@}
 
@@ -119,8 +131,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
                matrix box,      t_commrec *cr,
                int  maxshift_x, int maxshift_y,
                t_nrnb *nrnb,    gmx_wallcycle_t wcycle,
-               matrix vir_q,    real ewaldcoeff_q,
-               matrix vir_lj,   real ewaldcoeff_lj,
+               matrix vir_q,    matrix vir_lj,
                real *energy_q,  real *energy_lj,
                real lambda_q,   real lambda_lj,
                real *dvdlambda_q, real *dvdlambda_lj,
@@ -155,9 +166,8 @@ void gmx_pme_send_parameters(struct t_commrec *cr,
 
 /*! \brief Send the coordinates to our PME-only node and request a PME calculation */
 void gmx_pme_send_coordinates(struct t_commrec *cr, matrix box, rvec *x,
-                              gmx_bool bFreeEnergy_q, gmx_bool bFreeEnergy_lj,
                               real lambda_q, real lambda_lj,
-                              gmx_bool bEnerVir, int pme_flags,
+                              gmx_bool bEnerVir,
                               gmx_int64_t step);
 
 /*! \brief Tell our PME-only node to finish */
diff --git a/src/gromacs/ewald/tests/CMakeLists.txt b/src/gromacs/ewald/tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..1ebfbb0
--- /dev/null
@@ -0,0 +1,37 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 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.
+
+file(GLOB EWALD_TEST_SOURCES *.cpp)
+gmx_add_unit_test(EwaldUnitTests ewald-test
+                  ${EWALD_TEST_SOURCES})
diff --git a/src/gromacs/ewald/tests/pmebsplinetest.cpp b/src/gromacs/ewald/tests/pmebsplinetest.cpp
new file mode 100644 (file)
index 0000000..e75d3c0
--- /dev/null
@@ -0,0 +1,198 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Implements PME B-spline moduli computation tests.
+ *
+ * \author Aleksei Iupinov <a.yupinov@gmail.com>
+ * \ingroup module_ewald
+ */
+
+#include "gmxpre.h"
+
+#include <string>
+
+#include <gmock/gmock.h>
+
+#include "gromacs/ewald/pme-internal.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/mdtypes/inputrec.h"
+#include "gromacs/utility/stringutil.h"
+
+#include "testutils/refdata.h"
+#include "testutils/testasserts.h"
+
+#include "pmetestcommon.h"
+
+namespace gmx
+{
+namespace test
+{
+namespace
+{
+/*! \brief Moduli algorithm type */
+enum class ModuliType
+{
+    PME,
+    P3M
+};
+
+/*! \brief Convenience typedef of input parameters - grid dimensions, PME interpolation order, moduli type */
+typedef std::tuple<IVec, int, ModuliType> BSplineModuliInputParameters;
+
+/*! \brief Test fixture for testing PME B-spline moduli creation */
+class PmeBSplineModuliTest : public ::testing::TestWithParam<BSplineModuliInputParameters>
+{
+    public:
+        //! Default constructor
+        PmeBSplineModuliTest() = default;
+        //! The whole logic being tested is contained here
+        void runTest()
+        {
+            /* Getting the input */
+            const BSplineModuliInputParameters parameters = GetParam();
+            int         pmeOrder;
+            IVec        gridSize;
+            ModuliType  moduliType;
+            std::tie(gridSize, pmeOrder, moduliType) = parameters;
+
+            /* Describing the test in case it fails */
+            SCOPED_TRACE(formatString("Testing B-spline moduli creation (%s) for PME order %d, grid size %d %d %d",
+                                      (moduliType == ModuliType::P3M) ? "P3M" : "plain",
+                                      pmeOrder,
+                                      gridSize[XX], gridSize[YY], gridSize[ZZ]));
+
+            /* Storing the input where it's needed */
+            t_inputrec inputRec;
+            inputRec.nkx         = gridSize[XX];
+            inputRec.nky         = gridSize[YY];
+            inputRec.nkz         = gridSize[ZZ];
+            inputRec.coulombtype = (moduliType == ModuliType::P3M) ? eelP3M_AD : eelPME;
+            inputRec.pme_order   = pmeOrder;
+
+            /* PME initialization call which checks the inputs and computes the B-spline moduli according to the grid sizes. */
+            PmeSafePointer pme = pmeInitEmpty(&inputRec);
+
+            /* Setting up the checker */
+            TestReferenceData    refData;
+            TestReferenceChecker checker(refData.rootChecker());
+            auto                 singlePrecisionUlps = 6;
+            /* P3M moduli use polynomial expansions that are strongly affected by rounding errors. */
+            auto                 doublePrecisionUlps = (moduliType == ModuliType::P3M) ? 10 : singlePrecisionUlps;
+            auto                 tolerance           = relativeToleranceAsPrecisionDependentUlp(1.0, singlePrecisionUlps, doublePrecisionUlps);
+            checker.setDefaultTolerance(tolerance);
+
+            /* Perform a correctness check */
+            const char *dimString[] = { "X", "Y", "Z" };
+            for (int i = 0; i < DIM; i++)
+            {
+                checker.checkSequenceArray(gridSize[i], pme->bsp_mod[i], dimString[i]);
+            }
+        }
+};
+
+// Different aliases are needed to reuse the test class without instantiating tests more than once
+//! Failure test alias
+using PmeBSplineModuliFailureTest = PmeBSplineModuliTest;
+TEST_P(PmeBSplineModuliFailureTest, Throws)
+{
+    EXPECT_THROW(runTest(), InconsistentInputError);
+}
+//! Correctness test alias
+using PmeBSplineModuliCorrectnessTest = PmeBSplineModuliTest;
+TEST_P(PmeBSplineModuliCorrectnessTest, ReproducesValues)
+{
+    EXPECT_NO_THROW(runTest());
+}
+
+/* Invalid input instances */
+
+//! Sane interpolation order
+const int       sanePmeOrder = 4;
+//! Sane grid size
+const IVec      saneGridSize = {32, 25, 47};
+/*! \brief Hand-picked invalid input for the exception tests */
+static std::vector<BSplineModuliInputParameters> const invalidInputs
+{
+    /* Invalid grid sizes */
+    BSplineModuliInputParameters {
+        IVec {
+            -1, 10, 10
+        }, sanePmeOrder, ModuliType::P3M
+    },
+    BSplineModuliInputParameters {
+        IVec {
+            40, 0, 20
+        }, sanePmeOrder, ModuliType::P3M
+    },
+    BSplineModuliInputParameters {
+        IVec {
+            64, 2, 64
+        }, sanePmeOrder, ModuliType::PME
+    },
+    /* Invalid interpolation orders */
+    BSplineModuliInputParameters {
+        saneGridSize, 8 + 1, ModuliType::P3M  // P3M only supports orders up to 8
+    },
+    BSplineModuliInputParameters {
+        saneGridSize, PME_ORDER_MAX + 1, ModuliType::PME
+    },
+};
+
+/*! \brief Instantiation of the PME B-spline moduli creation test with invalid input */
+INSTANTIATE_TEST_CASE_P(InsaneInput, PmeBSplineModuliFailureTest, ::testing::ValuesIn(invalidInputs));
+
+/* Valid input instances */
+
+//! A couple of valid inputs for grid sizes. It is good to test both even and odd dimensions.
+static std::vector<IVec> const sampleGridSizes
+{
+    IVec {
+        64, 32, 64
+    },
+    IVec {
+        57, 84, 29
+    }
+};
+
+/*! \brief Instantiation of the PME B-spline moduli creation test with valid input - up to order of 8 */
+INSTANTIATE_TEST_CASE_P(SaneInput1, PmeBSplineModuliCorrectnessTest, ::testing::Combine(
+                                    ::testing::ValuesIn(sampleGridSizes),
+                                    ::testing::Range(3, 8 + 1),
+                                    ::testing::Values(ModuliType::PME, ModuliType::P3M)
+                                ));
+}
+}
+}
diff --git a/src/gromacs/ewald/tests/pmegathertest.cpp b/src/gromacs/ewald/tests/pmegathertest.cpp
new file mode 100644 (file)
index 0000000..7e1e74f
--- /dev/null
@@ -0,0 +1,455 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Implements PME force gathering tests.
+ *
+ * \author Aleksei Iupinov <a.yupinov@gmail.com>
+ * \ingroup module_ewald
+ */
+
+#include "gmxpre.h"
+
+#include <string>
+
+#include <gmock/gmock.h>
+
+#include "gromacs/mdtypes/inputrec.h"
+#include "gromacs/utility/stringutil.h"
+
+#include "testutils/refdata.h"
+#include "testutils/testasserts.h"
+
+#include "pmetestcommon.h"
+
+namespace gmx
+{
+namespace test
+{
+namespace
+{
+
+/* Valid input instances */
+
+//! A couple of valid inputs for boxes.
+static std::vector<Matrix3x3> const c_sampleBoxes
+{
+    // normal box
+    Matrix3x3 {{
+                   8.0f, 0.0f, 0.0f,
+                   0.0f, 3.4f, 0.0f,
+                   0.0f, 0.0f, 2.0f
+               }},
+    // triclinic box
+    Matrix3x3 {{
+                   7.0f, 0.0f, 0.0f,
+                   0.0f, 4.1f, 0.0f,
+                   3.5f, 2.0f, 12.2f
+               }},
+};
+
+//! A couple of valid inputs for grid sizes
+static std::vector<IVec> const c_sampleGridSizes
+{
+    IVec {
+        16, 12, 14
+    },
+    IVec {
+        13, 15, 11
+    }
+};
+//! Random charges
+static std::vector<real> const c_sampleChargesFull
+{
+    4.95f, 3.11f, 3.97f, 1.08f, 2.09f, 1.1f, 4.13f, 3.31f, 2.8f, 5.83f, 5.09f, 6.1f, 2.86f, 0.24f, 5.76f, 5.19f, 0.72f
+};
+
+//! All the input atom gridline indices
+static std::vector<IVec> const c_sampleGridLineIndicesFull
+{
+    IVec {
+        4, 2, 6
+    },
+    IVec {
+        1, 4, 10
+    },
+    IVec {
+        0, 6, 6
+    },
+    IVec {
+        0, 1, 4
+    },
+    IVec {
+        6, 3, 0
+    },
+    IVec {
+        7, 2, 2
+    },
+    IVec {
+        8, 3, 1
+    },
+    IVec {
+        4, 0, 3
+    },
+    IVec {
+        0, 0, 0
+    },
+    IVec {
+        8, 5, 8
+    },
+    IVec {
+        4, 4, 2
+    },
+    IVec {
+        7, 1, 7
+    },
+    IVec {
+        8, 5, 5
+    },
+    IVec {
+        2, 6, 5
+    },
+    IVec {
+        1, 6, 2
+    },
+    IVec {
+        7, 1, 8
+    },
+    IVec {
+        3, 5, 1
+    },
+};
+
+// Spline values/derivatives below are also generated randomly, so they are bogus,
+// but that should not affect the reproducibility, which we're after
+
+//! A lot of bogus input spline values - should have at list (max PME order = 5) * (DIM = 3) * (total unique atom number in all test cases = 16) values
+static std::vector<real> const c_sampleSplineValuesFull
+{
+    0.12f, 0.81f, 0.29f, 0.22f, 0.13f, 0.19f, 0.12f, 0.8f, 0.44f, 0.38f, 0.32f, 0.36f, 0.27f, 0.11f, 0.17f, 0.94f, 0.07f, 0.9f, 0.98f, 0.96f, 0.07f, 0.94f, 0.77f, 0.24f, 0.84f, 0.16f, 0.77f, 0.57f, 0.52f, 0.27f, 0.39f, 0.45f, 0.6f, 0.59f, 0.44f, 0.91f, 0.97f, 0.43f, 0.24f, 0.52f, 0.73f, 0.55f, 0.99f, 0.39f, 0.97f, 0.35f, 0.1f, 0.68f, 0.19f, 0.1f, 0.77f, 0.2f, 0.43f, 0.69f, 0.76f, 0.32f, 0.31f, 0.94f, 0.53f, 0.6f, 0.93f, 0.57f, 0.94f, 0.88f, 0.75f, 0.77f, 0.91f, 0.72f, 0.07f, 0.78f, 0.09f, 0.02f, 0.48f, 0.97f, 0.89f, 0.39f, 0.48f, 0.19f, 0.02f, 0.92f, 0.8f, 0.41f, 0.53f, 0.32f, 0.38f, 0.58f, 0.36f, 0.46f, 0.92f, 0.91f, 0.01f, 0.86f, 0.54f, 0.86f, 0.94f, 0.37f, 0.35f, 0.81f, 0.89f, 0.48f,
+    0.34f, 0.18f, 0.11f, 0.02f, 0.87f, 0.95f, 0.66f, 0.67f, 0.38f, 0.45f, 0.04f, 0.94f, 0.54f, 0.76f, 0.58f, 0.83f, 0.31f, 0.73f, 0.71f, 0.06f, 0.35f, 0.32f, 0.35f, 0.61f, 0.27f, 0.98f, 0.83f, 0.11f, 0.3f, 0.42f, 0.95f, 0.69f, 0.58f, 0.29f, 0.1f, 0.68f, 0.94f, 0.62f, 0.51f, 0.47f, 0.04f, 0.47f, 0.34f, 0.71f, 0.52f, 0.19f, 0.69f, 0.5f, 0.59f, 0.05f, 0.74f, 0.11f, 0.4f, 0.81f, 0.24f, 0.53f, 0.71f, 0.07f, 0.17f, 0.41f, 0.23f, 0.78f, 0.27f, 0.1f, 0.71f, 0.36f, 0.67f, 0.6f, 0.94f, 0.69f, 0.19f, 0.58f, 0.68f, 0.5f, 0.62f, 0.38f, 0.29f, 0.44f, 0.04f, 0.89f, 0.0f, 0.76f, 0.22f, 0.16f, 0.08f, 0.62f, 0.51f, 0.62f, 0.83f, 0.72f, 0.96f, 0.99f, 0.4f, 0.79f, 0.83f, 0.21f, 0.43f, 0.32f, 0.44f, 0.72f,
+    0.21f, 0.4f, 0.93f, 0.07f, 0.11f, 0.41f, 0.24f, 0.04f, 0.36f, 0.15f, 0.92f, 0.08f, 0.99f, 0.35f, 0.42f, 0.7f, 0.17f, 0.39f, 0.69f, 0.0f, 0.86f, 0.89f, 0.59f, 0.81f, 0.77f, 0.15f, 0.89f, 0.17f, 0.76f, 0.67f, 0.58f, 0.78f, 0.26f, 0.19f, 0.69f, 0.18f, 0.46f, 0.6f, 0.69f, 0.23f, 0.34f, 0.3f, 0.64f, 0.34f, 0.6f, 0.99f, 0.69f, 0.57f, 0.75f, 0.07f, 0.36f, 0.75f, 0.81f, 0.8f, 0.42f, 0.09f, 0.94f, 0.66f, 0.35f, 0.67f, 0.34f, 0.66f, 0.02f, 0.47f, 0.78f, 0.21f, 0.02f, 0.18f, 0.42f, 0.2f, 0.46f, 0.34f, 0.4f, 0.46f, 0.96f, 0.86f, 0.25f, 0.25f, 0.22f, 0.37f, 0.59f, 0.19f, 0.45f, 0.61f, 0.04f, 0.71f, 0.77f, 0.51f, 0.77f, 0.15f, 0.78f, 0.36f, 0.62f, 0.24f, 0.86f, 0.2f, 0.77f, 0.08f, 0.09f, 0.3f,
+    0.0f, 0.6f, 0.99f, 0.69f,
+};
+
+//! A lot of bogus input spline derivatives - should have at list (max PME order = 5) * (DIM = 3) * (total unique atom number in all test cases = 16) values
+static std::vector<real> const c_sampleSplineDerivativesFull
+{
+    0.82f, 0.88f, 0.83f, 0.11f, 0.93f, 0.32f, 0.71f, 0.37f, 0.69f, 0.88f, 0.11f, 0.38f, 0.25f, 0.5f, 0.36f, 0.81f, 0.78f, 0.31f, 0.66f, 0.32f, 0.27f, 0.35f, 0.53f, 0.83f, 0.08f, 0.08f, 0.94f, 0.71f, 0.65f, 0.24f, 0.13f, 0.01f, 0.33f, 0.65f, 0.24f, 0.53f, 0.45f, 0.84f, 0.33f, 0.97f, 0.31f, 0.7f, 0.03f, 0.31f, 0.41f, 0.76f, 0.12f, 0.3f, 0.57f, 0.65f, 0.87f, 0.99f, 0.42f, 0.97f, 0.32f, 0.39f, 0.73f, 0.23f, 0.03f, 0.67f, 0.97f, 0.57f, 0.42f, 0.38f, 0.54f, 0.17f, 0.53f, 0.54f, 0.18f, 0.8f, 0.76f, 0.13f, 0.29f, 0.83f, 0.77f, 0.56f, 0.4f, 0.87f, 0.36f, 0.18f, 0.59f, 0.04f, 0.05f, 0.61f, 0.26f, 0.91f, 0.62f, 0.16f, 0.89f, 0.23f, 0.26f, 0.59f, 0.33f, 0.2f, 0.49f, 0.41f, 0.25f, 0.4f, 0.16f, 0.83f,
+    0.44f, 0.82f, 0.21f, 0.95f, 0.14f, 0.8f, 0.37f, 0.31f, 0.41f, 0.53f, 0.15f, 0.85f, 0.78f, 0.17f, 0.92f, 0.03f, 0.13f, 0.2f, 0.03f, 0.33f, 0.87f, 0.38f, 0, 0.08f, 0.79f, 0.36f, 0.53f, 0.05f, 0.07f, 0.94f, 0.23f, 0.85f, 0.13f, 0.27f, 0.23f, 0.22f, 0.26f, 0.38f, 0.15f, 0.48f, 0.18f, 0.33f, 0.23f, 0.62f, 0.1f, 0.36f, 0.99f, 0.07f, 0.02f, 0.04f, 0.09f, 0.29f, 0.52f, 0.29f, 0.83f, 0.97f, 0.61f, 0.81f, 0.49f, 0.56f, 0.08f, 0.09f, 0.03f, 0.65f, 0.46f, 0.1f, 0.06f, 0.06f, 0.39f, 0.29f, 0.04f, 0.03f, 0.1f, 0.83f, 0.94f, 0.59f, 0.97f, 0.82f, 0.2f, 0.66f, 0.23f, 0.11f, 0.03f, 0.16f, 0.27f, 0.53f, 0.94f, 0.46f, 0.43f, 0.29f, 0.97f, 0.64f, 0.46f, 0.37f, 0.43f, 0.48f, 0.37f, 0.93f, 0.5f, 0.2f,
+    0.92f, 0.09f, 0.74f, 0.55f, 0.44f, 0.05f, 0.13f, 0.17f, 0.79f, 0.44f, 0.11f, 0.6f, 0.64f, 0.05f, 0.96f, 0.3f, 0.45f, 0.47f, 0.42f, 0.74f, 0.91f, 0.06f, 0.89f, 0.24f, 0.26f, 0.68f, 0.4f, 0.88f, 0.5f, 0.65f, 0.48f, 0.15f, 0.0f, 0.41f, 0.67f, 0.4f, 0.31f, 0.73f, 0.77f, 0.36f, 0.26f, 0.74f, 0.46f, 0.56f, 0.78f, 0.92f, 0.32f, 0.9f, 0.06f, 0.55f, 0.6f, 0.13f, 0.38f, 0.93f, 0.5f, 0.92f, 0.96f, 0.82f, 0.0f, 0.04f, 0.9f, 0.55f, 0.97f, 1.0f, 0.23f, 0.46f, 0.52f, 0.49f, 0.0f, 0.32f, 0.16f, 0.4f, 0.62f, 0.36f, 0.03f, 0.63f, 0.16f, 0.58f, 0.97f, 0.03f, 0.44f, 0.07f, 0.22f, 0.75f, 0.32f, 0.61f, 0.94f, 0.33f, 0.7f, 0.57f, 0.5f, 0.84f, 0.7f, 0.47f, 0.18f, 0.09f, 0.25f, 0.77f, 0.94f, 0.85f,
+    0.09f, 0.83f, 0.02f, 0.91f,
+};
+
+//! 2 c_sample grids - only non-zero values have to be listed
+static std::vector<SparseRealGridValuesInput> const c_sampleGrids
+{
+    SparseRealGridValuesInput {{
+                                   IVec {
+                                       0, 0, 0
+                                   }, 3.5f
+                               }, {
+                                   IVec {
+                                       7, 0, 0
+                                   }, -2.5f
+                               },
+                               {
+                                   IVec {
+                                       3, 5, 7
+                                   }, -0.006f
+                               }, {
+                                   IVec {
+                                       1, 6, 7
+                                   }, -2.76f
+                               }, {
+                                   IVec {
+                                       3, 1, 2
+                                   }, 0.6f
+                               },  {
+                                   IVec {
+                                       6, 2, 4
+                                   }, 7.1f
+                               }, {
+                                   IVec {
+                                       4, 5, 6
+                                   }, 4.1f
+                               }, {
+                                   IVec {
+                                       4, 4, 6
+                                   }, -3.7f
+                               }, },
+    SparseRealGridValuesInput {{
+                                   IVec {
+                                       0, 4, 0
+                                   }, 6.f
+                               }, {
+                                   IVec {
+                                       4, 2, 7
+                                   }, 13.76f
+                               }, {
+                                   IVec {
+                                       0, 6, 7
+                                   }, 3.6f
+                               }, {
+                                   IVec {
+                                       3, 2, 8
+                                   }, 0.61f
+                               },
+                               {
+                                   IVec {
+                                       5, 4, 3
+                                   }, 2.1f
+                               },
+                               {
+                                   IVec {
+                                       2, 5, 10
+                                   }, 3.6f
+                               }, {
+                                   IVec {
+                                       5, 3, 6
+                                   }, 2.1f
+                               }, {
+                                   IVec {
+                                       6, 6, 6
+                                   }, 6.1f
+                               }, }
+};
+
+//! Input forces for reduction
+static std::vector<RVec> const c_sampleForcesFull {
+    RVec {
+        0.02f, 0.87f, 0.95f
+    }, RVec {
+        0.66f, 0.67f, 0.38f
+    }, RVec {
+        0.45f, 0.04f, 0.94f
+    }, RVec {
+        0.54f, 0.76f, 0.58f
+    },
+    RVec {
+        0.83f, 0.31f, 0.73f
+    }, RVec {
+        0.71f, 0.06f, 0.35f
+    }, RVec {
+        0.32f, 0.35f, 0.61f
+    }, RVec {
+        0.27f, 0.98f, 0.83f
+    },
+    RVec {
+        0.11f, 0.3f, 0.42f
+    }, RVec {
+        0.95f, 0.69f, 0.58f
+    }, RVec {
+        0.29f, 0.1f, 0.68f
+    }, RVec {
+        0.94f, 0.62f, 0.51f
+    },
+    RVec {
+        0.47f, 0.04f, 0.47f
+    }, RVec {
+        0.34f, 0.71f, 0.52f
+    }
+};
+
+//! PME orders to test
+static std::vector<int> const pmeOrders {
+    3, 4, 5
+};
+//! Atom counts to test
+static std::vector<size_t> const atomCounts {
+    1, 2, 13
+};
+
+/* Helper structures for test input */
+
+//! A structure for all the spline data which depends in size both on the PME order and atom count
+struct AtomAndPmeOrderSizedData
+{
+    //! Spline values
+    SplineParamsVector splineValues;
+    //! Spline derivatives
+    SplineParamsVector splineDerivatives;
+};
+
+//! A structure for all the input atom data which depends in size on atom count - including a range of spline data for different PME orders
+struct AtomSizedData
+{
+    //! Gridline indices
+    GridLineIndicesVector                   gridLineIndices;
+    //! Charges
+    ChargesVector                           charges;
+    //! Coordinates
+    CoordinatesVector                       coordinates;
+    //! Spline data for different orders
+    std::map<int, AtomAndPmeOrderSizedData> splineDataByPmeOrder;
+};
+
+//! A range of the test input data sets, uniquely identified by the atom count
+typedef std::map<size_t, AtomSizedData> InputDataByAtomCount;
+
+/*! \brief Convenience typedef of the test input parameters - unit cell box, PME interpolation order, grid dimensions,
+ *  grid values, overwriting/reducing the input forces, atom count.
+ *
+ * The rest of the atom-related input data - gridline indices, spline theta values, spline dtheta values, atom charges -
+ * is looked up in the inputAtomDataSets_ test fixture variable.
+ */
+typedef std::tuple<Matrix3x3, int, IVec, SparseRealGridValuesInput, PmeGatherInputHandling, size_t> GatherInputParameters;
+
+//! Test fixture
+class PmeGatherTest : public ::testing::TestWithParam<GatherInputParameters>
+{
+    private:
+        //! Storage of all the input atom datasets
+        static InputDataByAtomCount s_inputAtomDataSets_;
+
+    public:
+        //! Default constructor
+        PmeGatherTest()  = default;
+        //! Sets the input atom data references once
+        static void SetUpTestCase()
+        {
+            auto                gridLineIndicesIt = c_sampleGridLineIndicesFull.begin();
+            auto                chargesIt         = c_sampleChargesFull.begin();
+            for (auto atomCount : atomCounts)
+            {
+                AtomSizedData atomData;
+                atomData.gridLineIndices = GridLineIndicesVector::fromVector(gridLineIndicesIt, gridLineIndicesIt + atomCount);
+                gridLineIndicesIt       += atomCount;
+                atomData.charges         = ChargesVector::fromVector(chargesIt, chargesIt + atomCount);
+                chargesIt               += atomCount;
+                atomData.coordinates.resize(atomCount, RVec {1e6, 1e7, -1e8});
+                /* The coordinates are intentionally bogus in this test - only the size matters; the gridline indices are fed directly as inputs */
+                for (auto pmeOrder : pmeOrders)
+                {
+                    AtomAndPmeOrderSizedData splineData;
+                    const size_t             dimSize = atomCount * pmeOrder;
+                    for (int dimIndex = 0; dimIndex < DIM; dimIndex++)
+                    {
+                        splineData.splineValues[dimIndex] = SplineParamsDimVector::fromVector(c_sampleSplineValuesFull.begin() + dimIndex * dimSize,
+                                                                                              c_sampleSplineValuesFull.begin() + (dimIndex + 1) * dimSize);
+                        splineData.splineDerivatives[dimIndex] = SplineParamsDimVector::fromVector(c_sampleSplineDerivativesFull.begin() + dimIndex * dimSize,
+                                                                                                   c_sampleSplineDerivativesFull.begin() + (dimIndex + 1) * dimSize);
+                    }
+                    atomData.splineDataByPmeOrder[pmeOrder] = splineData;
+                }
+                s_inputAtomDataSets_[atomCount] = atomData;
+            }
+        }
+        //! The test
+        void runTest()
+        {
+            /* Getting the input */
+            Matrix3x3                 box;
+            int                       pmeOrder;
+            IVec                      gridSize;
+            size_t                    atomCount;
+            SparseRealGridValuesInput nonZeroGridValues;
+            PmeGatherInputHandling    inputForceTreatment;
+            std::tie(box, pmeOrder, gridSize, nonZeroGridValues, inputForceTreatment, atomCount) = GetParam();
+            auto inputAtomData       = s_inputAtomDataSets_[atomCount];
+            auto inputAtomSplineData = inputAtomData.splineDataByPmeOrder[pmeOrder];
+
+            /* Storing the input where it's needed, running the test */
+            t_inputrec inputRec;
+            inputRec.nkx         = gridSize[XX];
+            inputRec.nky         = gridSize[YY];
+            inputRec.nkz         = gridSize[ZZ];
+            inputRec.pme_order   = pmeOrder;
+            inputRec.coulombtype = eelPME;
+
+            TestReferenceData                     refData;
+            const std::map<CodePath, std::string> modesToTest = {{CodePath::CPU, "CPU"}};
+            for (const auto &mode : modesToTest)
+            {
+                /* Describing the test uniquely */
+                SCOPED_TRACE(formatString("Testing force gathering with %s for PME grid size %d %d %d"
+                                          ", order %d, %zu atoms, %s",
+                                          mode.second.c_str(),
+                                          gridSize[XX], gridSize[YY], gridSize[ZZ],
+                                          pmeOrder,
+                                          atomCount,
+                                          (inputForceTreatment == PmeGatherInputHandling::ReduceWith) ? "with reduction" : "without reduction"
+                                          ));
+
+                PmeSafePointer pmeSafe = pmeInitAtoms(&inputRec, inputAtomData.coordinates, inputAtomData.charges, box);
+
+                /* Setting some more inputs */
+                pmeSetRealGrid(pmeSafe.get(), mode.first, nonZeroGridValues);
+
+                pmeSetGridLineIndices(pmeSafe.get(), mode.first, inputAtomData.gridLineIndices);
+
+                for (int dimIndex = 0; dimIndex < DIM; dimIndex++)
+                {
+                    pmeSetSplineData(pmeSafe.get(), mode.first, inputAtomSplineData.splineValues[dimIndex], PmeSplineDataType::Values, dimIndex);
+                    pmeSetSplineData(pmeSafe.get(), mode.first, inputAtomSplineData.splineDerivatives[dimIndex], PmeSplineDataType::Derivatives, dimIndex);
+                }
+
+                /* Explicitly copying the c_sample forces to be able to modify them */
+                auto inputForcesFull(c_sampleForcesFull);
+                GMX_RELEASE_ASSERT(inputForcesFull.size() >= atomCount, "Bad input forces size");
+                auto forces = ForcesVector::fromVector(inputForcesFull.begin(), inputForcesFull.begin() + atomCount);
+
+                /* Running the force gathering itself */
+                pmePerformGather(pmeSafe.get(), mode.first, inputForceTreatment, forces);
+
+                /* Check the output forces correctness */
+                TestReferenceChecker forceChecker(refData.rootChecker());
+                const auto           ulpTolerance = 3 * pmeOrder;
+                forceChecker.setDefaultTolerance(relativeToleranceAsUlp(1.0, ulpTolerance));
+                forceChecker.checkSequence(forces.begin(), forces.end(), "Forces");
+            }
+        }
+};
+
+// An instance of static atom data
+InputDataByAtomCount PmeGatherTest::s_inputAtomDataSets_;
+
+//! Test for PME force gathering
+TEST_P(PmeGatherTest, ReproducesOutputs)
+{
+    EXPECT_NO_THROW(runTest());
+}
+
+//! Instantiation of the PME gathering test
+INSTANTIATE_TEST_CASE_P(SaneInput, PmeGatherTest, ::testing::Combine(::testing::ValuesIn(c_sampleBoxes),
+                                                                         ::testing::ValuesIn(pmeOrders),
+                                                                         ::testing::ValuesIn(c_sampleGridSizes),
+                                                                         ::testing::ValuesIn(c_sampleGrids),
+                                                                         ::testing::Values(PmeGatherInputHandling::Overwrite, PmeGatherInputHandling::ReduceWith),
+                                                                         ::testing::ValuesIn(atomCounts)));
+
+}
+}
+}
diff --git a/src/gromacs/ewald/tests/pmesolvetest.cpp b/src/gromacs/ewald/tests/pmesolvetest.cpp
new file mode 100644 (file)
index 0000000..c5c3b8e
--- /dev/null
@@ -0,0 +1,322 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Implements PME solving tests.
+ *
+ * \author Aleksei Iupinov <a.yupinov@gmail.com>
+ * \ingroup module_ewald
+ */
+
+#include "gmxpre.h"
+
+#include <string>
+
+#include <gmock/gmock.h>
+
+#include "gromacs/mdtypes/inputrec.h"
+#include "gromacs/utility/stringutil.h"
+
+#include "testutils/refdata.h"
+#include "testutils/testasserts.h"
+
+#include "pmetestcommon.h"
+
+namespace gmx
+{
+namespace test
+{
+namespace
+{
+/*! \brief Convenience typedef of the test input parameters - unit cell box, complex grid dimensions, complex grid values,
+ * electrostatic constant epsilon_r, Ewald splitting parameters ewaldcoeff_q and ewaldcoeff_lj, solver type
+ * Output: transformed local grid (Fourier space); optionally reciprocal energy and virial matrix.
+ * TODO:
+ * Implement and test Lorentz-Berthelot
+ */
+typedef std::tuple<Matrix3x3, IVec, SparseComplexGridValuesInput, double, double, double, PmeSolveAlgorithm> SolveInputParameters;
+
+//! Test fixture
+class PmeSolveTest : public ::testing::TestWithParam<SolveInputParameters>
+{
+    public:
+        //! Default constructor
+        PmeSolveTest() = default;
+
+        //! The test
+        void runTest()
+        {
+            /* Getting the input */
+            Matrix3x3                      box;
+            IVec                           gridSize;
+            SparseComplexGridValuesInput   nonZeroGridValues;
+            double                         epsilon_r;
+            double                         ewaldCoeff_q;
+            double                         ewaldCoeff_lj;
+            PmeSolveAlgorithm              method;
+            std::tie(box, gridSize, nonZeroGridValues, epsilon_r, ewaldCoeff_q, ewaldCoeff_lj, method) = GetParam();
+
+            /* Storing the input where it's needed, running the test */
+            t_inputrec inputRec;
+            inputRec.nkx         = gridSize[XX];
+            inputRec.nky         = gridSize[YY];
+            inputRec.nkz         = gridSize[ZZ];
+            inputRec.pme_order   = 4;
+            inputRec.coulombtype = eelPME;
+            inputRec.epsilon_r   = epsilon_r;
+            switch (method)
+            {
+                case PmeSolveAlgorithm::Coulomb:
+                    break;
+
+                case PmeSolveAlgorithm::LennardJones:
+                    inputRec.vdwtype = evdwPME;
+                    break;
+
+                default:
+                    GMX_THROW(InternalError("Unknown PME solver"));
+            }
+
+            TestReferenceData                     refData;
+            const std::map<CodePath, std::string> modesToTest = {{CodePath::CPU, "CPU"}};
+            for (const auto &mode : modesToTest)
+            {
+                std::map<GridOrdering, std::string> gridOrderingsToTest = {{GridOrdering::YZX, "YZX"}};
+                for (const auto &gridOrdering : gridOrderingsToTest)
+                {
+                    for (bool computeEnergyAndVirial : {false, true})
+                    {
+                        /* Describing the test*/
+                        SCOPED_TRACE(formatString("Testing solving (%s, %s, %s energy/virial) with %s for PME grid size %d %d %d, Ewald coefficients %g %g",
+                                                  (method == PmeSolveAlgorithm::LennardJones) ? "Lennard-Jones" : "Coulomb",
+                                                  gridOrdering.second.c_str(), computeEnergyAndVirial ? "with" : "without",
+                                                  mode.second.c_str(),
+                                                  gridSize[XX], gridSize[YY], gridSize[ZZ],
+                                                  ewaldCoeff_q, ewaldCoeff_lj
+                                                  ));
+
+                        /* Running the test */
+                        PmeSafePointer pmeSafe = pmeInitEmpty(&inputRec, box, ewaldCoeff_q, ewaldCoeff_lj);
+                        pmeSetComplexGrid(pmeSafe.get(), mode.first, gridOrdering.first, nonZeroGridValues);
+                        const real     cellVolume = box[0] * box[4] * box[8];
+                        //FIXME - this is box[XX][XX] * box[YY][YY] * box[ZZ][ZZ], should be stored in the PME structure
+                        pmePerformSolve(pmeSafe.get(), mode.first, method, cellVolume, gridOrdering.first, computeEnergyAndVirial);
+
+                        /* Check the outputs */
+                        TestReferenceChecker checker(refData.rootChecker());
+                        const auto           ulpTolerance = 200;
+                        checker.setDefaultTolerance(relativeToleranceAsUlp(10.0, ulpTolerance));
+
+                        SparseComplexGridValuesOutput nonZeroGridValuesOutput = pmeGetComplexGrid(pmeSafe.get(), mode.first, gridOrdering.first);
+                        /* Transformed grid */
+                        TestReferenceChecker          gridValuesChecker(checker.checkCompound("NonZeroGridValues", "ComplexSpaceGrid"));
+                        const auto                    ulpToleranceGrid = 50;
+                        gridValuesChecker.setDefaultTolerance(relativeToleranceAsUlp(1.0, ulpToleranceGrid));
+                        for (const auto &point : nonZeroGridValuesOutput)
+                        {
+                            // we want an additional safeguard for denormal numbers as they cause an exception in string conversion;
+                            // however, using GMX_REAL_MIN causes an "unused item warning" for single precision builds
+                            if (fabs(point.second.re) >= GMX_FLOAT_MIN)
+                            {
+                                gridValuesChecker.checkReal(point.second.re, (point.first + " re").c_str());
+                            }
+                            if (fabs(point.second.im) >= GMX_FLOAT_MIN)
+                            {
+                                gridValuesChecker.checkReal(point.second.im, (point.first + " im").c_str());
+                            }
+                        }
+
+                        if (computeEnergyAndVirial)
+                        {
+                            real       energy;
+                            Matrix3x3  virial;
+                            std::tie(energy, virial) = pmeGetReciprocalEnergyAndVirial(pmeSafe.get(), mode.first, method);
+                            /* Energy */
+                            checker.checkReal(energy, "Energy");
+                            /* Virial */
+                            TestReferenceChecker virialChecker(checker.checkCompound("Matrix", "Virial"));
+                            virialChecker.setDefaultTolerance(relativeToleranceAsUlp(1000, 30));
+                            for (int i = 0; i < DIM; i++)
+                            {
+                                for (int j = 0; j <= i; j++)
+                                {
+                                    std::string valueId = formatString("Cell %d %d", i, j);
+                                    virialChecker.checkReal(virial[i * DIM + j], valueId.c_str());
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+};
+
+/*! \brief Test for PME solving */
+TEST_P(PmeSolveTest, ReproducesOutputs)
+{
+    EXPECT_NO_THROW(runTest());
+}
+
+/* Valid input instances */
+
+//! A couple of valid inputs for boxes.
+static std::vector<Matrix3x3> const c_sampleBoxes
+{
+    // normal box
+    Matrix3x3 {{
+                   8.0f, 0.0f, 0.0f,
+                   0.0f, 3.4f, 0.0f,
+                   0.0f, 0.0f, 2.0f
+               }},
+    // triclinic box
+    Matrix3x3 {{
+                   7.0f, 0.0f, 0.0f,
+                   0.0f, 4.1f, 0.0f,
+                   3.5f, 2.0f, 12.2f
+               }},
+};
+
+//! A couple of valid inputs for grid sizes
+static std::vector<IVec> const c_sampleGridSizes
+{
+    IVec {
+        16, 12, 28
+    },
+    IVec {
+        9, 7, 23
+    }
+};
+
+//! Moved out from instantiations for readability
+const auto c_inputBoxes     = ::testing::ValuesIn(c_sampleBoxes);
+//! Moved out from instantiations for readability
+const auto c_inputGridSizes = ::testing::ValuesIn(c_sampleGridSizes);
+
+//! 2 sample complex grids - only non-zero values have to be listed
+static std::vector<SparseComplexGridValuesInput> const c_sampleGrids
+{
+    SparseComplexGridValuesInput {{
+                                      IVec {
+                                          0, 0, 0
+                                      }, t_complex {
+                                          3.5f, 6.7f
+                                      }
+                                  }, {
+                                      IVec {
+                                          7, 0, 0
+                                      }, t_complex {
+                                          -2.5f, -0.7f
+                                      }
+                                  }, {
+                                      IVec {
+                                          3, 5, 7
+                                      }, t_complex {
+                                          -0.006f, 1e-8f
+                                      }
+                                  }, {
+                                      IVec {
+                                          3, 1, 2
+                                      }, t_complex {
+                                          0.6f, 7.9f
+                                      }
+                                  },  {
+                                      IVec {
+                                          6, 2, 4
+                                      }, t_complex {
+                                          30.1f, 2.45f
+                                      }
+                                  }, },
+    SparseComplexGridValuesInput {{
+                                      IVec {
+                                          0, 4, 0
+                                      }, t_complex {
+                                          0.0f, 0.3f
+                                      }
+                                  }, {
+                                      IVec {
+                                          4, 2, 7
+                                      }, t_complex {
+                                          13.76f, -40.0f
+                                      }
+                                  }, {
+                                      IVec {
+                                          0, 6, 7
+                                      }, t_complex {
+                                          3.6f, 0.0f
+                                      }
+                                  }, {
+                                      IVec {
+                                          2, 5, 10
+                                      }, t_complex {
+                                          3.6f, 10.65f
+                                      }
+                                  }, }
+};
+
+//! Moved out from instantiations for readability
+const auto c_inputGrids = ::testing::ValuesIn(c_sampleGrids);
+//! Moved out from instantiations for readability
+const auto c_inputEpsilon_r = ::testing::Values(1.2);
+//! Moved out from instantiations for readability
+const auto c_inputEwaldCoeff_q = ::testing::Values(2.0);
+//! Moved out from instantiations for readability
+const auto c_inputEwaldCoeff_lj = ::testing::Values(0.7);
+//! Moved out from instantiations for readability
+const auto c_inputMethods = ::testing::Values(PmeSolveAlgorithm::Coulomb, PmeSolveAlgorithm::LennardJones);
+
+//! Instantiation of the PME solving test
+INSTANTIATE_TEST_CASE_P(SaneInput, PmeSolveTest, ::testing::Combine(c_inputBoxes, c_inputGridSizes, c_inputGrids,
+                                                                    c_inputEpsilon_r, c_inputEwaldCoeff_q, c_inputEwaldCoeff_lj, c_inputMethods));
+
+//! A few more instances to check that different ewaldCoeff_q actually affects results of the Coulomb solver
+INSTANTIATE_TEST_CASE_P(DifferentEwaldCoeffQ, PmeSolveTest, ::testing::Combine(c_inputBoxes, c_inputGridSizes, c_inputGrids,
+                                                                               c_inputEpsilon_r, ::testing::Values(0.4), c_inputEwaldCoeff_lj,
+                                                                                   ::testing::Values(PmeSolveAlgorithm::Coulomb)));
+
+//! A few more instances to check that different ewaldCoeff_lj actually affects results of the Lennard-Jones solver.
+//! The value has to be approximately larger than 1 / (box dimensions) to have a meaningful output grid.
+//! Previous value of 0.3 caused one of the grid cells to be less or greater than GMX_FLOAT_MIN, depending on the architecture.
+INSTANTIATE_TEST_CASE_P(DifferentEwaldCoeffLJ, PmeSolveTest, ::testing::Combine(c_inputBoxes, c_inputGridSizes, c_inputGrids,
+                                                                                c_inputEpsilon_r, c_inputEwaldCoeff_q, ::testing::Values(2.35),
+                                                                                    ::testing::Values(PmeSolveAlgorithm::LennardJones)));
+
+//! A few more instances to check that different epsilon_r actually affects results of all solvers
+INSTANTIATE_TEST_CASE_P(DifferentEpsilonR, PmeSolveTest, ::testing::Combine(c_inputBoxes, c_inputGridSizes, c_inputGrids,
+                                                                            testing::Values(1.9), c_inputEwaldCoeff_q, c_inputEwaldCoeff_lj,
+                                                                            c_inputMethods));
+
+}
+}
+}
diff --git a/src/gromacs/ewald/tests/pmesplinespreadtest.cpp b/src/gromacs/ewald/tests/pmesplinespreadtest.cpp
new file mode 100644 (file)
index 0000000..c751ef1
--- /dev/null
@@ -0,0 +1,322 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Implements PME spline computation and charge spreading tests.
+ *
+ * \author Aleksei Iupinov <a.yupinov@gmail.com>
+ * \ingroup module_ewald
+ */
+
+#include "gmxpre.h"
+
+#include <string>
+
+#include <gmock/gmock.h>
+
+#include "gromacs/mdtypes/inputrec.h"
+#include "gromacs/utility/stringutil.h"
+
+#include "testutils/refdata.h"
+#include "testutils/testasserts.h"
+
+#include "pmetestcommon.h"
+
+namespace gmx
+{
+namespace test
+{
+namespace
+{
+
+//! PME spline and spread code path being tested
+enum class PmeSplineAndSpreadOptions
+{
+    SplineOnly,
+    SpreadOnly,
+    SplineAndSpreadUnified
+};
+
+/*! \brief Convenience typedef of input parameters - unit cell box, PME interpolation order, grid dimensions,
+ * particle coordinates, particle charges
+ * TODO: consider inclusion of local grid offsets/sizes or PME nodes counts to test the PME DD
+ */
+typedef std::tuple<Matrix3x3, int, IVec, CoordinatesVector, ChargesVector> SplineAndSpreadInputParameters;
+
+/*! \brief Test fixture for testing both atom spline parameter computation and charge spreading.
+ * These 2 stages of PME are tightly coupled in the code.
+ */
+class PmeSplineAndSpreadTest : public ::testing::TestWithParam<SplineAndSpreadInputParameters>
+{
+    public:
+        //! Default constructor
+        PmeSplineAndSpreadTest() = default;
+        //! The test
+        void runTest()
+        {
+            /* Getting the input */
+            Matrix3x3               box;
+            int                     pmeOrder;
+            IVec                    gridSize;
+            CoordinatesVector       coordinates;
+            ChargesVector           charges;
+
+            std::tie(box, pmeOrder, gridSize, coordinates, charges) = GetParam();
+            const size_t atomCount = coordinates.size();
+
+            /* Storing the input where it's needed */
+            t_inputrec inputRec;
+            inputRec.nkx         = gridSize[XX];
+            inputRec.nky         = gridSize[YY];
+            inputRec.nkz         = gridSize[ZZ];
+            inputRec.pme_order   = pmeOrder;
+            inputRec.coulombtype = eelPME;
+
+            TestReferenceData                                      refData;
+
+            const std::map<CodePath, std::string>                  modesToTest   = {{CodePath::CPU, "CPU"}};
+            const std::map<PmeSplineAndSpreadOptions, std::string> optionsToTest = {{PmeSplineAndSpreadOptions::SplineAndSpreadUnified, "spline computation and charge spreading (fused)"},
+                                                                                    {PmeSplineAndSpreadOptions::SplineOnly, "spline computation"},
+                                                                                    {PmeSplineAndSpreadOptions::SpreadOnly, "charge spreading"}};
+            for (const auto &mode : modesToTest)
+            {
+                for (const auto &option : optionsToTest)
+                {
+                    /* Describing the test uniquely in case it fails */
+
+                    SCOPED_TRACE(formatString("Testing %s with %s for PME grid size %d %d %d"
+                                              ", order %d, %zu atoms",
+                                              option.second.c_str(), mode.second.c_str(),
+                                              gridSize[XX], gridSize[YY], gridSize[ZZ],
+                                              pmeOrder,
+                                              atomCount));
+
+                    /* Running the test */
+
+                    PmeSafePointer pmeSafe = pmeInitAtoms(&inputRec, coordinates, charges, box);
+
+                    const bool     computeSplines = (option.first == PmeSplineAndSpreadOptions::SplineOnly) || (option.first == PmeSplineAndSpreadOptions::SplineAndSpreadUnified);
+                    const bool     spreadCharges  = (option.first == PmeSplineAndSpreadOptions::SpreadOnly) || (option.first == PmeSplineAndSpreadOptions::SplineAndSpreadUnified);
+
+                    if (!computeSplines)
+                    {
+                        // Here we should set up the results of the spline computation so that the spread can run.
+                        // What is lazy and works is running the separate spline so that it will set it up for us:
+                        pmePerformSplineAndSpread(pmeSafe.get(), mode.first, true, false);
+                        // We know that it is tested in another iteration.
+                        // TODO: Clean alternative: read and set the reference gridline indices, spline params
+                    }
+
+                    pmePerformSplineAndSpread(pmeSafe.get(), mode.first, computeSplines, spreadCharges);
+
+                    /* Outputs correctness check */
+                    /* All tolerances were picked empirically for single precision on CPU */
+
+                    TestReferenceChecker rootChecker(refData.rootChecker());
+
+                    const auto           maxGridSize              = std::max(std::max(gridSize[XX], gridSize[YY]), gridSize[ZZ]);
+                    const auto           ulpToleranceSplineValues = 2 * (pmeOrder - 2) * maxGridSize;
+                    /* 2 is empiric, the rest follows from the amount of operations */
+
+                    if (computeSplines)
+                    {
+                        const char *dimString[] = { "X", "Y", "Z" };
+
+                        /* Spline values */
+                        SCOPED_TRACE(formatString("Testing spline values with tolerance of %ld", ulpToleranceSplineValues));
+                        TestReferenceChecker splineValuesChecker(rootChecker.checkCompound("Splines", "Values"));
+                        splineValuesChecker.setDefaultTolerance(relativeToleranceAsUlp(1.0, ulpToleranceSplineValues));
+                        for (int i = 0; i < DIM; i++)
+                        {
+                            auto splineValuesDim = pmeGetSplineData(pmeSafe.get(), mode.first, PmeSplineDataType::Values, i);
+                            splineValuesChecker.checkSequence(splineValuesDim.begin(), splineValuesDim.end(), dimString[i]);
+                        }
+
+                        /* Spline derivatives */
+                        const auto ulpToleranceSplineDerivatives = 4 * ulpToleranceSplineValues;
+                        /* 4 is just a wild guess since the derivatives are deltas of neighbor spline values which could differ greatly */
+                        SCOPED_TRACE(formatString("Testing spline derivatives with tolerance of %ld", ulpToleranceSplineDerivatives));
+                        TestReferenceChecker splineDerivativesChecker(rootChecker.checkCompound("Splines", "Derivatives"));
+                        splineDerivativesChecker.setDefaultTolerance(relativeToleranceAsUlp(1.0, ulpToleranceSplineDerivatives));
+                        for (int i = 0; i < DIM; i++)
+                        {
+                            auto splineDerivativesDim = pmeGetSplineData(pmeSafe.get(), mode.first, PmeSplineDataType::Derivatives, i);
+                            splineDerivativesChecker.checkSequence(splineDerivativesDim.begin(), splineDerivativesDim.end(), dimString[i]);
+                        }
+
+                        /* Particle gridline indices */
+                        auto gridLineIndices = pmeGetGridlineIndices(pmeSafe.get(), mode.first);
+                        rootChecker.checkSequence(gridLineIndices.begin(), gridLineIndices.end(), "Gridline indices");
+                    }
+
+                    if (spreadCharges)
+                    {
+                        /* The wrapped grid */
+                        SparseRealGridValuesOutput nonZeroGridValues = pmeGetRealGrid(pmeSafe.get(), mode.first);
+                        TestReferenceChecker       gridValuesChecker(rootChecker.checkCompound("NonZeroGridValues", "RealSpaceGrid"));
+                        const auto                 ulpToleranceGrid = 2 * ulpToleranceSplineValues * (int)(ceil(sqrt(atomCount)));
+                        /* 2 is empiric; sqrt(atomCount) assumes all the input charges may spread onto the same cell */
+                        SCOPED_TRACE(formatString("Testing grid values with tolerance of %ld", ulpToleranceGrid));
+                        gridValuesChecker.setDefaultTolerance(relativeToleranceAsUlp(1.0, ulpToleranceGrid));
+                        for (const auto &point : nonZeroGridValues)
+                        {
+                            gridValuesChecker.checkReal(point.second, point.first.c_str());
+                        }
+                    }
+                }
+            }
+        }
+};
+
+
+/*! \brief Test for PME B-spline moduli computation */
+TEST_P(PmeSplineAndSpreadTest, ReproducesOutputs)
+{
+    EXPECT_NO_THROW(runTest());
+}
+
+/* Valid input instances */
+
+//! A couple of valid inputs for boxes.
+static std::vector<Matrix3x3> const sampleBoxes
+{
+    // normal box
+    Matrix3x3 {{
+                   8.0f, 0.0f, 0.0f,
+                   0.0f, 3.4f, 0.0f,
+                   0.0f, 0.0f, 2.0f
+               }},
+    // triclinic box
+    Matrix3x3 {{
+                   7.0f, 0.0f, 0.0f,
+                   0.0f, 4.1f, 0.0f,
+                   3.5f, 2.0f, 12.2f
+               }},
+};
+
+//! A couple of valid inputs for grid sizes.
+static std::vector<IVec> const sampleGridSizes
+{
+    IVec {
+        16, 12, 14
+    },
+    IVec {
+        19, 17, 11
+    }
+};
+
+//! Random charges
+static std::vector<real> const sampleChargesFull
+{
+    4.95f, 3.11f, 3.97f, 1.08f, 2.09f, 1.1f, 4.13f, 3.31f, 2.8f, 5.83f, 5.09f, 6.1f, 2.86f, 0.24f, 5.76f, 5.19f, 0.72f
+};
+//! 1 charge
+static auto const sampleCharges1 = ChargesVector::fromVector(sampleChargesFull.begin(), sampleChargesFull.begin() + 1);
+//! 2 charges
+static auto const sampleCharges2 = ChargesVector::fromVector(sampleChargesFull.begin() + 1, sampleChargesFull.begin() + 3);
+//! 13 charges
+static auto const sampleCharges13 = ChargesVector::fromVector(sampleChargesFull.begin() + 3, sampleChargesFull.begin() + 16);
+
+//! Random coordinate vectors
+static CoordinatesVector const sampleCoordinatesFull
+{
+    {
+        5.59f, 1.37f, 0.95f
+    }, {
+        16.0f, 1.02f, 0.22f      // 2 box lengths in x
+    }, {
+        0.034f, 1.65f, 0.22f
+    }, {
+        0.33f, 0.92f, 1.56f
+    }, {
+        1.16f, 0.75f, 0.39f
+    }, {
+        0.5f, 1.63f, 1.14f
+    }, {
+        16.0001f, 1.52f, 1.19f  // > 2 box lengths in x
+    }, {
+        1.43f, 1.1f, 4.1f       // > 2 box lengths in z
+    }, {
+        -1.08f, 1.19f, 0.08f    // negative x
+    }, {
+        1.6f, 0.93f, 0.53f
+    }, {
+        1.32f, -1.48f, 0.16f    // negative y
+    }, {
+        0.87f, 0.0f, 0.33f
+    }, {
+        0.95f, 7.7f, -0.48f     // > 2 box lengths in y, negative z
+    }, {
+        1.23f, 0.91f, 0.68f
+    }, {
+        0.19f, 1.45f, 0.94f
+    }, {
+        1.28f, 0.46f, 0.38f
+    }, {
+        1.21f, 0.23f, 1.0f
+    }
+};
+//! 1 coordinate vector
+static CoordinatesVector const sampleCoordinates1(sampleCoordinatesFull.begin(), sampleCoordinatesFull.begin() + 1);
+//! 2 coordinate vectors
+static CoordinatesVector const sampleCoordinates2(sampleCoordinatesFull.begin() + 1, sampleCoordinatesFull.begin() + 3);
+//! 13 coordinate vectors
+static CoordinatesVector const sampleCoordinates13(sampleCoordinatesFull.begin() + 3, sampleCoordinatesFull.begin() + 16);
+
+//! moved out from instantiantions for readability
+auto inputBoxes     = ::testing::ValuesIn(sampleBoxes);
+//! moved out from instantiantions for readability
+auto inputPmeOrders = ::testing::Range(3, 5 + 1);
+//! moved out from instantiantions for readability
+auto inputGridSizes = ::testing::ValuesIn(sampleGridSizes);
+
+/*! \brief Instantiation of the PME spline computation test with valid input and 1 atom */
+INSTANTIATE_TEST_CASE_P(SaneInput1, PmeSplineAndSpreadTest, ::testing::Combine(inputBoxes, inputPmeOrders, inputGridSizes,
+                                                                                   ::testing::Values(sampleCoordinates1),
+                                                                                   ::testing::Values(sampleCharges1)
+                                                                               ));
+/*! \brief Instantiation of the PME spline computation test with valid input and 2 atoms */
+INSTANTIATE_TEST_CASE_P(SaneInput2, PmeSplineAndSpreadTest, ::testing::Combine(inputBoxes, inputPmeOrders, inputGridSizes,
+                                                                                   ::testing::Values(sampleCoordinates2),
+                                                                                   ::testing::Values(sampleCharges2)
+                                                                               ));
+/*! \brief Instantiation of the PME spline computation test with valid input and 13 atoms */
+INSTANTIATE_TEST_CASE_P(SaneInput13, PmeSplineAndSpreadTest, ::testing::Combine(inputBoxes, inputPmeOrders, inputGridSizes,
+                                                                                    ::testing::Values(sampleCoordinates13),
+                                                                                    ::testing::Values(sampleCharges13)
+                                                                                ));
+}
+}
+}
diff --git a/src/gromacs/ewald/tests/pmetestcommon.cpp b/src/gromacs/ewald/tests/pmetestcommon.cpp
new file mode 100644 (file)
index 0000000..475b844
--- /dev/null
@@ -0,0 +1,548 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Implements common routines for PME tests.
+ *
+ * \author Aleksei Iupinov <a.yupinov@gmail.com>
+ * \ingroup module_ewald
+ */
+#include "gmxpre.h"
+
+#include "pmetestcommon.h"
+
+#include <cstring>
+
+#include "gromacs/ewald/pme.h"
+#include "gromacs/ewald/pme-gather.h"
+#include "gromacs/ewald/pme-grid.h"
+#include "gromacs/ewald/pme-internal.h"
+#include "gromacs/ewald/pme-solve.h"
+#include "gromacs/ewald/pme-spread.h"
+#include "gromacs/fft/parallel_3dfft.h"
+#include "gromacs/math/invertmatrix.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/stringutil.h"
+
+namespace gmx
+{
+namespace test
+{
+
+//! PME initialization - internal
+static PmeSafePointer pmeInitInternal(const t_inputrec         *inputRec,
+                                      size_t                    atomCount,
+                                      const Matrix3x3          &box,
+                                      real                      ewaldCoeff_q = 1.0f,
+                                      real                      ewaldCoeff_lj = 1.0f
+                                      )
+{
+    gmx_pme_t *pmeDataRaw = nullptr;
+    gmx_pme_init(&pmeDataRaw, nullptr, 1, 1, inputRec,
+                 atomCount, false, false, true, ewaldCoeff_q, ewaldCoeff_lj, 1);
+    PmeSafePointer pme(pmeDataRaw); // taking ownership
+
+    // TODO get rid of this with proper matrix type
+    matrix boxTemp;
+    for (int i = 0; i < DIM; i++)
+    {
+        for (int j = 0; j < DIM; j++)
+        {
+            boxTemp[i][j] = box[i * DIM + j];
+        }
+    }
+    const char *boxError = check_box(-1, boxTemp);
+    GMX_RELEASE_ASSERT(boxError == nullptr, boxError);
+    invertBoxMatrix(boxTemp, pme->recipbox);
+
+    return pme;
+}
+
+//! Simple PME initialization based on input, no atom data
+PmeSafePointer pmeInitEmpty(const t_inputrec         *inputRec,
+                            const Matrix3x3          &box,
+                            real                      ewaldCoeff_q,
+                            real                      ewaldCoeff_lj
+                            )
+{
+    return pmeInitInternal(inputRec, 0, box, ewaldCoeff_q, ewaldCoeff_lj);
+    // hiding the fact that PME actually needs to know the number of atoms in advance
+}
+
+//! PME initialization with atom data
+PmeSafePointer pmeInitAtoms(const t_inputrec         *inputRec,
+                            const CoordinatesVector  &coordinates,
+                            const ChargesVector      &charges,
+                            const Matrix3x3          &box
+                            )
+{
+    const size_t    atomCount = coordinates.size();
+    GMX_RELEASE_ASSERT(atomCount == charges.size(), "Mismatch in atom data");
+    PmeSafePointer  pmeSafe = pmeInitInternal(inputRec, atomCount, box);
+    pme_atomcomm_t *atc     = &(pmeSafe->atc[0]);
+    atc->x           = const_cast<rvec *>(as_rvec_array(coordinates.data()));
+    atc->coefficient = const_cast<real *>(charges.data());
+    /* With decomposition there would be more boilerplate atc code here, e.g. do_redist_pos_coeffs */
+    return pmeSafe;
+}
+
+//! Getting local PME real grid pointer for test I/O
+static real *pmeGetRealGridInternal(const gmx_pme_t *pme)
+{
+    const size_t gridIndex = 0;
+    return pme->fftgrid[gridIndex];
+}
+
+//! Getting local PME real grid dimensions
+static void pmeGetRealGridSizesInternal(const gmx_pme_t      *pme,
+                                        IVec                 &gridSize,
+                                        IVec                 &paddedGridSize)
+{
+    const size_t gridIndex = 0;
+    IVec         gridOffsetUnused;
+    gmx_parallel_3dfft_real_limits(pme->pfft_setup[gridIndex], gridSize, gridOffsetUnused, paddedGridSize);
+}
+
+//! Getting local PME complex grid pointer for test I/O
+static t_complex *pmeGetComplexGridInternal(const gmx_pme_t *pme)
+{
+    const size_t gridIndex = 0;
+    return pme->cfftgrid[gridIndex];
+}
+
+//! Getting local PME complex grid dimensions
+static void pmeGetComplexGridSizesInternal(const gmx_pme_t      *pme,
+                                           IVec                 &gridSize,
+                                           IVec                 &paddedGridSize)
+{
+    const size_t gridIndex = 0;
+    IVec         gridOffsetUnused, complexOrderUnused;
+    gmx_parallel_3dfft_complex_limits(pme->pfft_setup[gridIndex], complexOrderUnused, gridSize, gridOffsetUnused, paddedGridSize); //TODO: what about YZX ordering?
+}
+
+//! Getting the PME grid memory buffer and its sizes - template definition
+template<typename ValueType> static void pmeGetGridAndSizesInternal(const gmx_pme_t *, ValueType * &, IVec &, IVec &)
+{
+    GMX_THROW(InternalError("Deleted function call"));
+    // explicitly deleting general template does not compile in clang/icc, see https://llvm.org/bugs/show_bug.cgi?id=17537
+}
+
+//! Getting the PME real grid memory buffer and its sizes
+template<> void pmeGetGridAndSizesInternal<real>(const gmx_pme_t *pme, real * &grid, IVec &gridSize, IVec &paddedGridSize)
+{
+    grid = pmeGetRealGridInternal(pme);
+    pmeGetRealGridSizesInternal(pme, gridSize, paddedGridSize);
+}
+
+//! Getting the PME complex grid memory buffer and its sizes
+template<> void pmeGetGridAndSizesInternal<t_complex>(const gmx_pme_t *pme, t_complex * &grid, IVec &gridSize, IVec &paddedGridSize)
+{
+    grid = pmeGetComplexGridInternal(pme);
+    pmeGetComplexGridSizesInternal(pme, gridSize, paddedGridSize);
+}
+
+//! PME spline calculation and charge spreading
+void pmePerformSplineAndSpread(gmx_pme_t *pme, CodePath mode, // TODO const qualifiers
+                               bool computeSplines, bool spreadCharges)
+{
+    GMX_RELEASE_ASSERT(pme != nullptr, "PME data is not initialized");
+    pme_atomcomm_t *atc                          = &(pme->atc[0]);
+    const size_t    gridIndex                    = 0;
+    const bool      computeSplinesForZeroCharges = true;
+    real           *fftgrid                      = spreadCharges ? pme->fftgrid[gridIndex] : nullptr;
+
+    switch (mode)
+    {
+        case CodePath::CPU:
+            spread_on_grid(pme, atc, &pme->pmegrid[gridIndex], computeSplines, spreadCharges,
+                           fftgrid, computeSplinesForZeroCharges, gridIndex);
+            if (spreadCharges && !pme->bUseThreads)
+            {
+                wrap_periodic_pmegrid(pme, pme->pmegrid[gridIndex].grid.grid);
+                copy_pmegrid_to_fftgrid(pme, pme->pmegrid[gridIndex].grid.grid, fftgrid, gridIndex);
+            }
+            break;
+
+        default:
+            GMX_THROW(InternalError("Test not implemented for this mode"));
+    }
+}
+
+//! Getting the internal spline data buffer pointer
+static real *pmeGetSplineDataInternal(const gmx_pme_t *pme, PmeSplineDataType type, int dimIndex)
+{
+    GMX_ASSERT((0 <= dimIndex) && (dimIndex < DIM), "Invalid dimension index");
+    const pme_atomcomm_t *atc          = &(pme->atc[0]);
+    const size_t          threadIndex  = 0;
+    real                 *splineBuffer = nullptr;
+    switch (type)
+    {
+        case PmeSplineDataType::Values:
+            splineBuffer = atc->spline[threadIndex].theta[dimIndex];
+            break;
+
+        case PmeSplineDataType::Derivatives:
+            splineBuffer = atc->spline[threadIndex].dtheta[dimIndex];
+            break;
+
+        default:
+            GMX_THROW(InternalError("Unknown spline data type"));
+    }
+    return splineBuffer;
+}
+
+//! PME solving
+void pmePerformSolve(const gmx_pme_t *pme, CodePath mode,
+                     PmeSolveAlgorithm method, real cellVolume,
+                     GridOrdering gridOrdering, bool computeEnergyAndVirial)
+{
+    t_complex      *h_grid                 = pmeGetComplexGridInternal(pme);
+    const bool      useLorentzBerthelot    = false;
+    const size_t    threadIndex            = 0;
+    switch (mode)
+    {
+        case CodePath::CPU:
+            if (gridOrdering != GridOrdering::YZX)
+            {
+                GMX_THROW(InternalError("Test not implemented for this mode"));
+            }
+            switch (method)
+            {
+                case PmeSolveAlgorithm::Coulomb:
+                    solve_pme_yzx(pme, h_grid, cellVolume,
+                                  computeEnergyAndVirial, pme->nthread, threadIndex);
+                    break;
+
+                case PmeSolveAlgorithm::LennardJones:
+                    solve_pme_lj_yzx(pme, &h_grid, useLorentzBerthelot,
+                                     cellVolume, computeEnergyAndVirial, pme->nthread, threadIndex);
+                    break;
+
+                default:
+                    GMX_THROW(InternalError("Test not implemented for this mode"));
+            }
+            break;
+
+        default:
+            GMX_THROW(InternalError("Test not implemented for this mode"));
+    }
+}
+
+//! PME force gathering
+void pmePerformGather(gmx_pme_t *pme, CodePath mode,
+                      PmeGatherInputHandling inputTreatment, ForcesVector &forces)
+{
+    pme_atomcomm_t *atc                     = &(pme->atc[0]);
+    const size_t    atomCount               = atc->n;
+    GMX_RELEASE_ASSERT(forces.size() == atomCount, "Invalid force buffer size");
+    const bool      forceReductionWithInput = (inputTreatment == PmeGatherInputHandling::ReduceWith);
+    const real      scale                   = 1.0;
+    const size_t    threadIndex             = 0;
+    const size_t    gridIndex               = 0;
+    real           *grid                    = pme->pmegrid[gridIndex].grid.grid;
+    switch (mode)
+    {
+        case CodePath::CPU:
+            atc->f = as_rvec_array(forces.begin());
+            if (atc->nthread == 1)
+            {
+                // something which is normally done in serial spline computation (make_thread_local_ind())
+                atc->spline[threadIndex].n = atomCount;
+            }
+            copy_fftgrid_to_pmegrid(pme, pme->fftgrid[gridIndex], grid, gridIndex, pme->nthread, threadIndex);
+            unwrap_periodic_pmegrid(pme, grid);
+            gather_f_bsplines(pme, grid, !forceReductionWithInput, atc, &atc->spline[threadIndex], scale);
+            break;
+
+        default:
+            GMX_THROW(InternalError("Test not implemented for this mode"));
+    }
+}
+
+//! Setting atom spline values/derivatives to be used in spread/gather
+void pmeSetSplineData(const gmx_pme_t *pme, CodePath mode,
+                      const SplineParamsDimVector &splineValues, PmeSplineDataType type, int dimIndex)
+{
+    const pme_atomcomm_t *atc         = &(pme->atc[0]);
+    const size_t          atomCount   = atc->n;
+    const size_t          pmeOrder    = pme->pme_order;
+    const size_t          dimSize     = pmeOrder * atomCount;
+    GMX_RELEASE_ASSERT(dimSize == splineValues.size(), "Mismatch in spline data");
+    real                 *splineBuffer = pmeGetSplineDataInternal(pme, type, dimIndex);
+
+    switch (mode)
+    {
+        case CodePath::CPU:
+            std::copy(splineValues.begin(), splineValues.end(), splineBuffer);
+            break;
+
+        default:
+            GMX_THROW(InternalError("Test not implemented for this mode"));
+    }
+}
+
+//! Setting gridline indices to be used in spread/gather
+void pmeSetGridLineIndices(const gmx_pme_t *pme, CodePath mode,
+                           const GridLineIndicesVector &gridLineIndices)
+{
+    const pme_atomcomm_t       *atc         = &(pme->atc[0]);
+    const size_t                atomCount   = atc->n;
+    GMX_RELEASE_ASSERT(atomCount == gridLineIndices.size(), "Mismatch in gridline indices size");
+
+    IVec paddedGridSizeUnused, gridSize;
+    pmeGetRealGridSizesInternal(pme, gridSize, paddedGridSizeUnused);
+
+    for (const auto &index : gridLineIndices)
+    {
+        for (int i = 0; i < DIM; i++)
+        {
+            GMX_RELEASE_ASSERT((0 <= index[i]) && (index[i] < gridSize[i]), "Invalid gridline index");
+        }
+    }
+
+    switch (mode)
+    {
+        case CodePath::CPU:
+            // incompatible IVec and ivec assignment?
+            //std::copy(gridLineIndices.begin(), gridLineIndices.end(), atc->idx);
+            memcpy(atc->idx, gridLineIndices.data(), atomCount * sizeof(gridLineIndices[0]));
+            break;
+
+        default:
+            GMX_THROW(InternalError("Test not implemented for this mode"));
+    }
+}
+
+//! Getting plain index into the complex 3d grid
+inline size_t pmeGetGridPlainIndexInternal(const IVec &index, const IVec &paddedGridSize, GridOrdering gridOrdering)
+{
+    size_t result;
+    switch (gridOrdering)
+    {
+        case GridOrdering::YZX:
+            result = (index[YY] * paddedGridSize[ZZ] + index[ZZ]) * paddedGridSize[XX] + index[XX];
+            break;
+
+        case GridOrdering::XYZ:
+            result = (index[XX] * paddedGridSize[YY] + index[YY]) * paddedGridSize[ZZ] + index[ZZ];
+            break;
+
+        default:
+            GMX_THROW(InternalError("Test not implemented for this mode"));
+    }
+    return result;
+}
+
+//! Setting real or complex grid
+template<typename ValueType>
+static void pmeSetGridInternal(const gmx_pme_t *pme, CodePath mode,
+                               GridOrdering gridOrdering,
+                               const SparseGridValuesInput<ValueType> &gridValues)
+{
+    IVec       gridSize, paddedGridSize;
+    ValueType *grid;
+    pmeGetGridAndSizesInternal<ValueType>(pme, grid, gridSize, paddedGridSize);
+
+    switch (mode)
+    {
+        case CodePath::CPU:
+            std::memset(grid, 0, paddedGridSize[XX] * paddedGridSize[YY] * paddedGridSize[ZZ] * sizeof(ValueType));
+            for (const auto &gridValue : gridValues)
+            {
+                for (int i = 0; i < DIM; i++)
+                {
+                    GMX_RELEASE_ASSERT((0 <= gridValue.first[i]) && (gridValue.first[i] < gridSize[i]), "Invalid grid value index");
+                }
+                const size_t gridValueIndex = pmeGetGridPlainIndexInternal(gridValue.first, paddedGridSize, gridOrdering);
+                grid[gridValueIndex] = gridValue.second;
+            }
+            break;
+
+        default:
+            GMX_THROW(InternalError("Test not implemented for this mode"));
+    }
+}
+
+//! Setting real grid to be used in gather
+void pmeSetRealGrid(const gmx_pme_t *pme, CodePath mode,
+                    const SparseRealGridValuesInput &gridValues)
+{
+    pmeSetGridInternal<real>(pme, mode, GridOrdering::XYZ, gridValues);
+}
+
+//! Setting complex grid to be used in solve
+void pmeSetComplexGrid(const gmx_pme_t *pme, CodePath mode,
+                       GridOrdering gridOrdering,
+                       const SparseComplexGridValuesInput &gridValues)
+{
+    pmeSetGridInternal<t_complex>(pme, mode, gridOrdering, gridValues);
+}
+
+//! Getting the single dimension's spline values or derivatives
+SplineParamsDimVector pmeGetSplineData(const gmx_pme_t *pme, CodePath mode,
+                                       PmeSplineDataType type, int dimIndex)
+{
+    GMX_RELEASE_ASSERT(pme != nullptr, "PME data is not initialized");
+    const pme_atomcomm_t    *atc         = &(pme->atc[0]);
+    const size_t             atomCount   = atc->n;
+    const size_t             pmeOrder    = pme->pme_order;
+    const size_t             dimSize     = pmeOrder * atomCount;
+
+    real                    *sourceBuffer = pmeGetSplineDataInternal(pme, type, dimIndex);
+    SplineParamsDimVector    result;
+    switch (mode)
+    {
+        case CodePath::CPU:
+            result = SplineParamsDimVector::fromArray(sourceBuffer, dimSize);
+            break;
+
+        default:
+            GMX_THROW(InternalError("Test not implemented for this mode"));
+    }
+    return result;
+}
+
+//! Getting the gridline indices
+GridLineIndicesVector pmeGetGridlineIndices(const gmx_pme_t *pme, CodePath mode)
+{
+    GMX_RELEASE_ASSERT(pme != nullptr, "PME data is not initialized");
+    const pme_atomcomm_t *atc         = &(pme->atc[0]);
+    const size_t          atomCount   = atc->n;
+
+    GridLineIndicesVector gridLineIndices;
+    switch (mode)
+    {
+        case CodePath::CPU:
+            gridLineIndices = GridLineIndicesVector::fromArray(reinterpret_cast<IVec *>(atc->idx), atomCount);
+            break;
+
+        default:
+            GMX_THROW(InternalError("Test not implemented for this mode"));
+    }
+    return gridLineIndices;
+}
+
+//! Getting real or complex grid - only non zero values
+template<typename ValueType>
+static SparseGridValuesOutput<ValueType> pmeGetGridInternal(const gmx_pme_t *pme, CodePath mode, GridOrdering gridOrdering)
+{
+    IVec       gridSize, paddedGridSize;
+    ValueType *grid;
+    pmeGetGridAndSizesInternal<ValueType>(pme, grid, gridSize, paddedGridSize);
+    SparseGridValuesOutput<ValueType> gridValues;
+    switch (mode)
+    {
+        case CodePath::CPU:
+            gridValues.clear();
+            for (int ix = 0; ix < gridSize[XX]; ix++)
+            {
+                for (int iy = 0; iy < gridSize[YY]; iy++)
+                {
+                    for (int iz = 0; iz < gridSize[ZZ]; iz++)
+                    {
+                        IVec            temp(ix, iy, iz);
+                        const size_t    gridValueIndex = pmeGetGridPlainIndexInternal(temp, paddedGridSize, gridOrdering);
+                        const ValueType value          = grid[gridValueIndex];
+                        if (value != ValueType {})
+                        {
+                            auto key = formatString("Cell %d %d %d", ix, iy, iz);
+                            gridValues[key] = value;
+                        }
+                    }
+                }
+            }
+            break;
+
+        default:
+            GMX_THROW(InternalError("Test not implemented for this mode"));
+    }
+    return gridValues;
+}
+
+//! Getting the real grid (spreading output of pmePerformSplineAndSpread())
+SparseRealGridValuesOutput pmeGetRealGrid(const gmx_pme_t *pme, CodePath mode)
+{
+    return pmeGetGridInternal<real>(pme, mode, GridOrdering::XYZ);
+}
+
+//! Getting the complex grid output of pmePerformSolve()
+SparseComplexGridValuesOutput pmeGetComplexGrid(const gmx_pme_t *pme, CodePath mode,
+                                                GridOrdering gridOrdering)
+{
+    return pmeGetGridInternal<t_complex>(pme, mode, gridOrdering);
+}
+
+//! Getting the reciprocal energy and virial
+PmeSolveOutput pmeGetReciprocalEnergyAndVirial(const gmx_pme_t *pme, CodePath mode,
+                                               PmeSolveAlgorithm method)
+{
+    real      energy = 0.0f;
+    Matrix3x3 virial;
+    matrix    virialTemp; //TODO get rid of
+    switch (mode)
+    {
+        case CodePath::CPU:
+            switch (method)
+            {
+                case PmeSolveAlgorithm::Coulomb:
+                    get_pme_ener_vir_q(pme->solve_work, pme->nthread, &energy, virialTemp);
+                    break;
+
+                case PmeSolveAlgorithm::LennardJones:
+                    get_pme_ener_vir_lj(pme->solve_work, pme->nthread, &energy, virialTemp);
+                    break;
+
+                default:
+                    GMX_THROW(InternalError("Test not implemented for this mode"));
+            }
+            break;
+
+        default:
+            GMX_THROW(InternalError("Test not implemented for this mode"));
+    }
+    for (int i = 0; i < DIM; i++)
+    {
+        for (int j = 0; j < DIM; j++)
+        {
+            virial[i * DIM + j] = virialTemp[i][j];
+        }
+    }
+    return std::make_tuple(energy, virial);
+}
+
+}
+}
diff --git a/src/gromacs/ewald/tests/pmetestcommon.h b/src/gromacs/ewald/tests/pmetestcommon.h
new file mode 100644 (file)
index 0000000..e3bd8e8
--- /dev/null
@@ -0,0 +1,181 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Describes common routines and types for PME tests.
+ *
+ * \author Aleksei Iupinov <a.yupinov@gmail.com>
+ * \ingroup module_ewald
+ */
+#ifndef GMX_EWALD_PME_TEST_COMMON_H
+#define GMX_EWALD_PME_TEST_COMMON_H
+
+#include <array>
+#include <map>
+#include <vector>
+
+#include "gromacs/ewald/pme.h"
+#include "gromacs/math/gmxcomplex.h"
+#include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/unique_cptr.h"
+
+struct t_inputrec;
+
+namespace gmx
+{
+namespace test
+{
+
+// Convenience typedefs
+//! A safe pointer type for PME.
+typedef gmx::unique_cptr<gmx_pme_t, gmx_pme_destroy> PmeSafePointer;
+//! Charges
+typedef ConstArrayRef<real> ChargesVector;
+//! Coordinates
+typedef std::vector<RVec> CoordinatesVector;
+//! Forces
+typedef ArrayRef<RVec> ForcesVector;
+//! Gridline indices
+typedef ConstArrayRef<IVec> GridLineIndicesVector;
+//! Type of spline data
+enum class PmeSplineDataType
+{
+    Values,      // theta
+    Derivatives, // dtheta
+};
+/*! \brief Spline parameters (theta or dtheta).
+ * A reference to a single dimension's spline data; this means (atomCount * pmeOrder) values or derivatives.
+ */
+typedef ConstArrayRef<real> SplineParamsDimVector;
+/*! \brief Spline parameters (theta or dtheta) in all 3 dimensions
+ */
+typedef std::array<SplineParamsDimVector, DIM> SplineParamsVector;
+
+//! Non-zero grid values for test input; keys are 3d indices (IVec)
+template<typename ValueType>using SparseGridValuesInput = std::map<IVec, ValueType>;
+//! Non-zero real grid values
+typedef SparseGridValuesInput<real> SparseRealGridValuesInput;
+//! Non-zero complex grid values
+typedef SparseGridValuesInput<t_complex> SparseComplexGridValuesInput;
+//! Non-zero grid values for test output; keys are string representations of the cells' 3d indices (IVec); this allows for better sorting.
+template<typename ValueType>using SparseGridValuesOutput = std::map<std::string, ValueType>;
+//! Non-zero real grid values
+typedef SparseGridValuesOutput<real> SparseRealGridValuesOutput;
+//! Non-zero complex grid values
+typedef SparseGridValuesOutput<t_complex> SparseComplexGridValuesOutput;
+//! TODO: make proper C++ matrix for the whole Gromacs, get rid of this
+typedef std::array<real, DIM * DIM> Matrix3x3;
+//! PME code path being tested
+enum class CodePath
+{
+    CPU,    // serial CPU code
+};
+//! PME gathering input forces treatment
+enum class PmeGatherInputHandling
+{
+    Overwrite,
+    ReduceWith,
+};
+//! PME solver type
+enum class PmeSolveAlgorithm
+{
+    Coulomb,
+    LennardJones,
+};
+//! PME grid dimension ordering (from major to minor)
+enum class GridOrdering
+{
+    YZX,
+    XYZ
+};
+//! PME solver results - reciprocal energy and virial
+typedef std::tuple<real, Matrix3x3> PmeSolveOutput;
+
+// PME stages
+
+//! Simple PME initialization (no atom data)
+PmeSafePointer pmeInitEmpty(const t_inputrec *inputRec,
+                            const Matrix3x3 &box = {{1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f}},
+                            real ewaldCoeff_q = 0.0f, real ewaldCoeff_lj = 0.0f);
+//! PME initialization with atom data and system box; lacks Ewald coefficients
+PmeSafePointer pmeInitAtoms(const t_inputrec         *inputRec,
+                            const CoordinatesVector  &coordinates,
+                            const ChargesVector      &charges,
+                            const Matrix3x3          &box
+                            );
+//! PME spline computation and charge spreading
+void pmePerformSplineAndSpread(gmx_pme_t *pme, CodePath mode,
+                               bool computeSplines, bool spreadCharges);
+//! PME solving
+void pmePerformSolve(const gmx_pme_t *pme, CodePath mode,
+                     PmeSolveAlgorithm method, real cellVolume,
+                     GridOrdering gridOrdering, bool computeEnergyAndVirial);
+//! PME force gathering
+void pmePerformGather(gmx_pme_t *pme, CodePath mode,
+                      PmeGatherInputHandling inputTreatment, ForcesVector &forces);
+
+// PME state setters
+
+//! Setting atom spline values or derivatives to be used in spread/gather
+void pmeSetSplineData(const gmx_pme_t *pme, CodePath mode,
+                      const SplineParamsDimVector &splineValues, PmeSplineDataType type, int dimIndex);
+//! Setting gridline indices be used in spread/gather
+void pmeSetGridLineIndices(const gmx_pme_t *pme, CodePath mode,
+                           const GridLineIndicesVector &gridLineIndices);
+//! Setting real grid to be used in gather
+void pmeSetRealGrid(const gmx_pme_t *pme, CodePath mode,
+                    const SparseRealGridValuesInput &gridValues);
+void pmeSetComplexGrid(const gmx_pme_t *pme, CodePath mode, GridOrdering gridOrdering,
+                       const SparseComplexGridValuesInput &gridValues);
+
+// PME state getters
+
+//! Getting the single dimension's spline values or derivatives
+SplineParamsDimVector pmeGetSplineData(const gmx_pme_t *pme, CodePath mode,
+                                       PmeSplineDataType type, int dimIndex);
+//! Getting the gridline indices
+GridLineIndicesVector pmeGetGridlineIndices(const gmx_pme_t *pme, CodePath mode);
+//! Getting the real grid (spreading output of pmePerformSplineAndSpread())
+SparseRealGridValuesOutput pmeGetRealGrid(const gmx_pme_t *pme, CodePath mode);
+//! Getting the complex grid output of pmePerformSolve()
+SparseComplexGridValuesOutput pmeGetComplexGrid(const gmx_pme_t *pme, CodePath mode,
+                                                GridOrdering gridOrdering);
+//! Getting the reciprocal energy and virial
+PmeSolveOutput pmeGetReciprocalEnergyAndVirial(const gmx_pme_t *pme, CodePath mode,
+                                               PmeSolveAlgorithm method);
+}
+}
+
+#endif
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_0.xml b/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_0.xml
new file mode 100644 (file)
index 0000000..cf7ff86
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 0 0 re">3.5</Real>
+    <Real Name="Cell 0 0 0 im">6.6999998092651367</Real>
+    <Real Name="Cell 3 1 2 re">0.018817131631578641</Real>
+    <Real Name="Cell 3 1 2 im">0.24775889296163411</Real>
+    <Real Name="Cell 3 5 7 re">-1.119109555041644e-18</Real>
+    <Real Name="Cell 3 5 7 im">1.8651825641876716e-24</Real>
+    <Real Name="Cell 6 2 4 re">0.00014622573978042473</Real>
+    <Real Name="Cell 6 2 4 im">1.1902095179213895e-05</Real>
+    <Real Name="Cell 7 0 0 re">-1.6418289569939666</Real>
+    <Real Name="Cell 7 0 0 im">-0.45971210012946007</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">4.18620154095722</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">5.2163287107129568</Real>
+    <Real Name="Cell 1 0">0.71788757122964064</Real>
+    <Real Name="Cell 1 1">-1.5300517107974831</Real>
+    <Real Name="Cell 2 0">2.4408178106438716</Real>
+    <Real Name="Cell 2 1">1.9143668566123748</Real>
+    <Real Name="Cell 2 2">4.4157467245717141</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_1.xml b/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_1.xml
new file mode 100644 (file)
index 0000000..038a0b3
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 0 0 re">-0.040960646891504318</Real>
+    <Real Name="Cell 0 0 0 im">-0.078410378960130159</Real>
+    <Real Name="Cell 3 1 2 re">-1.3292554554983258e-14</Real>
+    <Real Name="Cell 3 1 2 im">-1.7501863013212537e-13</Real>
+    <Real Name="Cell 7 0 0 re">3.8478547590276771e-09</Real>
+    <Real Name="Cell 7 0 0 im">1.0773993141797484e-09</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">-0.33435589928707093</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">0.16717786512572544</Real>
+    <Real Name="Cell 1 0">-3.2035473334097224e-12</Real>
+    <Real Name="Cell 1 1">0.16717794964102289</Real>
+    <Real Name="Cell 2 0">-1.0892061239107136e-11</Real>
+    <Real Name="Cell 2 1">-8.5427928890925915e-12</Real>
+    <Real Name="Cell 2 2">0.16717794961448998</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_10.xml b/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_10.xml
new file mode 100644 (file)
index 0000000..4611723
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 4 0 im">0.0073185487574843394</Real>
+    <Real Name="Cell 0 6 7 re">0.0017113607923287439</Real>
+    <Real Name="Cell 2 5 10 re">0.053679757843731919</Real>
+    <Real Name="Cell 2 5 10 im">0.15880261547309443</Real>
+    <Real Name="Cell 4 2 7 re">1.8806856946202906</Real>
+    <Real Name="Cell 4 2 7 im">-5.4671094864454624</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">246.45436864462314</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">192.88102601012326</Real>
+    <Real Name="Cell 1 0">271.42730351185259</Real>
+    <Real Name="Cell 1 1">115.25885143338239</Real>
+    <Real Name="Cell 2 0">183.08288439538768</Real>
+    <Real Name="Cell 2 1">159.24069411835538</Real>
+    <Real Name="Cell 2 2">-16.391759814440562</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_11.xml b/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_11.xml
new file mode 100644 (file)
index 0000000..e951fb5
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 4 0 im">-4.178818756469648e-13</Real>
+    <Real Name="Cell 0 6 7 re">-1.0069137884249014e-27</Real>
+    <Real Name="Cell 2 5 10 re">-5.6094174367698197e-19</Real>
+    <Real Name="Cell 2 5 10 im">-1.6594526428986948e-18</Real>
+    <Real Name="Cell 4 2 7 re">-2.2152312932810136e-08</Real>
+    <Real Name="Cell 4 2 7 im">6.4396257454452892e-08</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">-2.8806661919058218e-06</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">-1.8705530331608101e-05</Real>
+    <Real Name="Cell 1 0">-1.7197688691957962e-05</Real>
+    <Real Name="Cell 1 1">-1.3240622263816033e-05</Real>
+    <Real Name="Cell 2 0">-1.1629584411980756e-05</Real>
+    <Real Name="Cell 2 1">-9.9276940353995703e-06</Real>
+    <Real Name="Cell 2 2">-5.2730666430580063e-06</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_12.xml b/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_12.xml
new file mode 100644 (file)
index 0000000..82f4457
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 0 0 re">3.5</Real>
+    <Real Name="Cell 0 0 0 im">6.6999998092651367</Real>
+    <Real Name="Cell 3 1 2 re">0.52012107052982537</Real>
+    <Real Name="Cell 3 1 2 im">6.8482605725216255</Real>
+    <Real Name="Cell 3 5 7 re">-0.0036980789183935344</Real>
+    <Real Name="Cell 3 5 7 im">6.1634647729559887e-09</Real>
+    <Real Name="Cell 6 2 4 re">15.260222121080961</Real>
+    <Real Name="Cell 6 2 4 im">1.2421111113117829</Real>
+    <Real Name="Cell 7 0 0 re">-2.8812686235380811</Real>
+    <Real Name="Cell 7 0 0 im">-0.80675520085170338</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">520.6731680619182</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">171.22464074353465</Real>
+    <Real Name="Cell 1 0">-373.95782882517159</Real>
+    <Real Name="Cell 1 1">229.20286440584107</Real>
+    <Real Name="Cell 2 0">-313.85265632355726</Real>
+    <Real Name="Cell 2 1">356.06528628658498</Real>
+    <Real Name="Cell 2 2">10.654363487499289</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_13.xml b/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_13.xml
new file mode 100644 (file)
index 0000000..4a67884
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 0 0 re">-0.0063639096934527042</Real>
+    <Real Name="Cell 0 0 0 im">-0.012182341066375335</Real>
+    <Real Name="Cell 3 1 2 re">-9.9228430546493259e-06</Real>
+    <Real Name="Cell 3 1 2 im">-0.00013065076327181465</Real>
+    <Real Name="Cell 3 5 7 re">2.5759085022798612e-11</Real>
+    <Real Name="Cell 3 5 7 im">-4.2931807737236158e-17</Real>
+    <Real Name="Cell 6 2 4 re">-1.3138496192640048e-06</Real>
+    <Real Name="Cell 6 2 4 im">-1.0694124880568754e-07</Real>
+    <Real Name="Cell 7 0 0 re">0.00057663643475955946</Real>
+    <Real Name="Cell 7 0 0 im">0.00016145819898305986</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">-0.053802892914868977</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">0.020691662312509726</Real>
+    <Real Name="Cell 1 0">-0.0023237899154683532</Real>
+    <Real Name="Cell 1 1">0.02527149273778484</Real>
+    <Real Name="Cell 2 0">0.000600553079798094</Real>
+    <Real Name="Cell 2 1">-0.00016167607048479874</Real>
+    <Real Name="Cell 2 2">0.026646993387493604</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_14.xml b/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_14.xml
new file mode 100644 (file)
index 0000000..771ae35
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 4 0 im">0.069611755622628294</Real>
+    <Real Name="Cell 0 6 7 re">0.79383865861583514</Real>
+    <Real Name="Cell 2 5 10 re">0.88080833512750023</Real>
+    <Real Name="Cell 2 5 10 im">2.6057246337798414</Real>
+    <Real Name="Cell 4 2 7 re">19.096438888541929</Real>
+    <Real Name="Cell 4 2 7 im">-55.512902822367884</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">2517.0732535091583</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">1955.3066474629525</Real>
+    <Real Name="Cell 1 0">2721.0324266903935</Real>
+    <Real Name="Cell 1 1">1103.5308168016663</Real>
+    <Real Name="Cell 2 0">1875.3173351098101</Real>
+    <Real Name="Cell 2 1">1534.4704563076873</Real>
+    <Real Name="Cell 2 2">-113.42604196736495</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_15.xml b/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_15.xml
new file mode 100644 (file)
index 0000000..a295124
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 4 0 im">-7.0537221329547844e-09</Real>
+    <Real Name="Cell 0 6 7 re">-5.7463804790685012e-07</Real>
+    <Real Name="Cell 2 5 10 re">-4.1614840083045064e-11</Real>
+    <Real Name="Cell 2 5 10 im">-1.2311056743065747e-10</Real>
+    <Real Name="Cell 4 2 7 re">-2.2493407131842702e-07</Real>
+    <Real Name="Cell 4 2 7 im">6.5387810342123984e-07</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">-3.1321432926615869e-05</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">-0.00018890242348857845</Real>
+    <Real Name="Cell 1 0">-0.00017462064584253123</Real>
+    <Real Name="Cell 1 1">-0.00013613472585420061</Real>
+    <Real Name="Cell 2 0">-0.00011809371439078819</Real>
+    <Real Name="Cell 2 1">-9.3982474514113124e-05</Real>
+    <Real Name="Cell 2 2">-6.9661560924232365e-05</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_2.xml b/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_2.xml
new file mode 100644 (file)
index 0000000..b02a6c5
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 4 0 im">0.012194838340975378</Real>
+    <Real Name="Cell 0 6 7 re">6.975795431873326e-17</Real>
+    <Real Name="Cell 2 5 10 re">1.5478395335267946e-29</Real>
+    <Real Name="Cell 2 5 10 im">4.5790252439711993e-29</Real>
+    <Real Name="Cell 4 2 7 re">5.7327906140725394e-14</Real>
+    <Real Name="Cell 4 2 7 im">-1.6665088717192258e-13</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">0.0018292258312883258</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">-0.00091461291090054464</Real>
+    <Real Name="Cell 1 0">5.5807272795043997e-12</Real>
+    <Real Name="Cell 1 1">0.0071615797758995967</Real>
+    <Real Name="Cell 2 0">3.3205328244435521e-11</Real>
+    <Real Name="Cell 2 1">3.9061162844133993e-11</Real>
+    <Real Name="Cell 2 2">-0.00091461268319907444</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_3.xml b/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_3.xml
new file mode 100644 (file)
index 0000000..a16227f
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 4 0 im">-5.4292848213686879e-16</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">-8.1439275556636247e-17</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">4.0719637778318123e-17</Real>
+    <Real Name="Cell 1 0">-2.215406351573413e-112</Real>
+    <Real Name="Cell 1 1">-2.3047772408403365e-15</Real>
+    <Real Name="Cell 2 0">-1.3181668161597632e-111</Real>
+    <Real Name="Cell 2 1">-1.5507844461013891e-111</Real>
+    <Real Name="Cell 2 2">4.0719637778318123e-17</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_4.xml b/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_4.xml
new file mode 100644 (file)
index 0000000..a471dff
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 0 0 re">3.5</Real>
+    <Real Name="Cell 0 0 0 im">6.6999998092651367</Real>
+    <Real Name="Cell 3 1 2 re">0.058526893274896463</Real>
+    <Real Name="Cell 3 1 2 im">0.77060407346768123</Real>
+    <Real Name="Cell 3 5 7 re">-1.6754581199058096e-16</Real>
+    <Real Name="Cell 3 5 7 im">2.7924301585993392e-22</Real>
+    <Real Name="Cell 6 2 4 re">0.00075718908137880822</Real>
+    <Real Name="Cell 6 2 4 im">6.1631669832991787e-05</Real>
+    <Real Name="Cell 7 0 0 re">-27.942228597744055</Real>
+    <Real Name="Cell 7 0 0 im">-7.8238238741294062</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">43.811954836969655</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">24.403587715787729</Real>
+    <Real Name="Cell 1 0">2.2029901722547436</Real>
+    <Real Name="Cell 1 1">-20.146106627765938</Real>
+    <Real Name="Cell 2 0">7.4901667957596416</Real>
+    <Real Name="Cell 2 1">5.9835608562785838</Real>
+    <Real Name="Cell 2 2">-1.5618699365008126</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_5.xml b/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_5.xml
new file mode 100644 (file)
index 0000000..0c68446
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 0 0 re">-0.040960646891504318</Real>
+    <Real Name="Cell 0 0 0 im">-0.078410378960130159</Real>
+    <Real Name="Cell 3 1 2 re">-4.1343810365053865e-14</Real>
+    <Real Name="Cell 3 1 2 im">-5.4436015474703515e-13</Real>
+    <Real Name="Cell 7 0 0 re">0.0073924880067034026</Real>
+    <Real Name="Cell 7 0 0 im">0.0020698966066268229</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">-0.3443209679114585</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">0.15510734808993293</Real>
+    <Real Name="Cell 1 0">-9.9639879528132092e-12</Real>
+    <Real Name="Cell 1 1">0.17216048394791436</Real>
+    <Real Name="Cell 2 0">-3.3877559989804848e-11</Real>
+    <Real Name="Cell 2 1">-2.6570634540835225e-11</Real>
+    <Real Name="Cell 2 2">0.1721604838653891</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_6.xml b/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_6.xml
new file mode 100644 (file)
index 0000000..2dde2be
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 4 0 im">0.17992679246372756</Real>
+    <Real Name="Cell 0 6 7 re">3.1968338340529017e-14</Real>
+    <Real Name="Cell 2 5 10 re">1.4964328935770195e-27</Real>
+    <Real Name="Cell 2 5 10 im">4.4269472688716676e-27</Real>
+    <Real Name="Cell 4 2 7 re">5.8210622825280826e-13</Real>
+    <Real Name="Cell 4 2 7 im">-1.6921692400294715e-12</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">0.026989020017818024</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">-0.013494509960742423</Real>
+    <Real Name="Cell 1 0">5.6666575255782654e-11</Real>
+    <Real Name="Cell 1 1">0.06534006396863376</Real>
+    <Real Name="Cell 2 0">3.3716613222916207e-10</Real>
+    <Real Name="Cell 2 1">3.9636410829671391e-10</Real>
+    <Real Name="Cell 2 2">-0.013494507645153258</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_7.xml b/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_7.xml
new file mode 100644 (file)
index 0000000..40708a3
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 4 0 im">-3.36295522544755e-10</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">-5.0444330386190764e-11</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">2.5222165193095382e-11</Real>
+    <Real Name="Cell 1 0">-2.2495184669680253e-111</Real>
+    <Real Name="Cell 1 1">-8.0991543667196338e-10</Real>
+    <Real Name="Cell 2 0">-1.3384635253888647e-110</Real>
+    <Real Name="Cell 2 1">8.1762240348126863e-110</Real>
+    <Real Name="Cell 2 2">2.5222165193095382e-11</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_8.xml b/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_8.xml
new file mode 100644 (file)
index 0000000..e779a9f
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 0 0 re">3.5</Real>
+    <Real Name="Cell 0 0 0 im">6.6999998092651367</Real>
+    <Real Name="Cell 3 1 2 re">0.16722545997013091</Real>
+    <Real Name="Cell 3 1 2 im">2.2018018286947507</Real>
+    <Real Name="Cell 3 5 7 re">-7.965262272963144e-05</Real>
+    <Real Name="Cell 3 5 7 im">1.3275436925529491e-10</Real>
+    <Real Name="Cell 6 2 4 re">1.8922041838381742</Real>
+    <Real Name="Cell 6 2 4 im">0.1540166206604045</Real>
+    <Real Name="Cell 7 0 0 re">-0.082605078044972122</Real>
+    <Real Name="Cell 7 0 0 im">-0.023129421458700488</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">74.938609442792128</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">131.28949617469087</Real>
+    <Real Name="Cell 1 0">95.826683673140366</Real>
+    <Real Name="Cell 1 1">17.066209311548512</Real>
+    <Real Name="Cell 2 0">0.28439471667197097</Real>
+    <Real Name="Cell 2 1">0.22350643167596149</Real>
+    <Real Name="Cell 2 2">-37.437308226605346</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_9.xml b/src/gromacs/ewald/tests/refdata/DifferentEpsilonR_PmeSolveTest_ReproducesOutputs_9.xml
new file mode 100644 (file)
index 0000000..1291a6b
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 0 0 re">-0.0063639096934527042</Real>
+    <Real Name="Cell 0 0 0 im">-0.012182341066375335</Real>
+    <Real Name="Cell 3 1 2 re">-3.1903187316269281e-06</Real>
+    <Real Name="Cell 3 1 2 im">-4.2005862137679066e-05</Real>
+    <Real Name="Cell 3 5 7 re">7.4468604604379845e-21</Real>
+    <Real Name="Cell 3 5 7 im">-1.2411433917415391e-26</Real>
+    <Real Name="Cell 6 2 4 re">-1.1742988941980482e-10</Real>
+    <Real Name="Cell 6 2 4 im">-9.5582468781340022e-12</Real>
+    <Real Name="Cell 7 0 0 re">7.4608679756532561e-13</Real>
+    <Real Name="Cell 7 0 0 im">2.089042997606721e-13</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">-0.052281447439372866</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">0.02472611767566462</Real>
+    <Real Name="Cell 1 0">-0.00080506035697563581</Real>
+    <Real Name="Cell 1 1">0.025682559278230224</Real>
+    <Real Name="Cell 2 0">-3.29941854498715e-06</Real>
+    <Real Name="Cell 2 1">-1.8777213593421415e-06</Real>
+    <Real Name="Cell 2 2">0.026140716022377927</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffLJ_PmeSolveTest_ReproducesOutputs_0.xml b/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffLJ_PmeSolveTest_ReproducesOutputs_0.xml
new file mode 100644 (file)
index 0000000..97e1176
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 0 0 re">-1.5498022019739996</Real>
+    <Real Name="Cell 0 0 0 im">-2.9667641307498531</Real>
+    <Real Name="Cell 3 1 2 re">-0.01941158897436121</Real>
+    <Real Name="Cell 3 1 2 im">-0.25558591442507311</Real>
+    <Real Name="Cell 3 5 7 re">1.7720564655953271e-14</Real>
+    <Real Name="Cell 3 5 7 im">-2.9534273990373024e-20</Real>
+    <Real Name="Cell 6 2 4 re">-0.0028355851140043973</Real>
+    <Real Name="Cell 6 2 4 im">-0.00023080344107898613</Real>
+    <Real Name="Cell 7 0 0 re">0.98439186309649662</Real>
+    <Real Name="Cell 7 0 0 im">0.27562971697307287</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">-16.094465920337093</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">4.8742582912547263</Real>
+    <Real Name="Cell 1 0">-0.57680403129439006</Real>
+    <Real Name="Cell 1 1">7.5948376541956275</Real>
+    <Real Name="Cell 2 0">-1.9611337614092448</Real>
+    <Real Name="Cell 2 1">-1.5381440834517075</Real>
+    <Real Name="Cell 2 2">2.8175429297438925</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffLJ_PmeSolveTest_ReproducesOutputs_1.xml b/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffLJ_PmeSolveTest_ReproducesOutputs_1.xml
new file mode 100644 (file)
index 0000000..ac36f29
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 4 0 im">-0.014734386660503283</Real>
+    <Real Name="Cell 0 6 7 re">-1.9260433175085867e-12</Real>
+    <Real Name="Cell 2 5 10 re">-1.413009482353229e-21</Real>
+    <Real Name="Cell 2 5 10 im">-4.1801530129700011e-21</Real>
+    <Real Name="Cell 4 2 7 re">-2.8112014428689828e-10</Real>
+    <Real Name="Cell 4 2 7 im">8.1720970817089197e-10</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">-0.0022101946504346128</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">0.0011050803459824404</Real>
+    <Real Name="Cell 1 0">-1.9975569870376849e-08</Real>
+    <Real Name="Cell 1 1">-0.0056561825503867015</Real>
+    <Real Name="Cell 2 0">-1.1885464406244038e-07</Real>
+    <Real Name="Cell 2 1">-1.3974988391173238e-07</Real>
+    <Real Name="Cell 2 2">0.0011042651858169206</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffLJ_PmeSolveTest_ReproducesOutputs_2.xml b/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffLJ_PmeSolveTest_ReproducesOutputs_2.xml
new file mode 100644 (file)
index 0000000..12d0340
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 0 0 re">-1.5498022019739996</Real>
+    <Real Name="Cell 0 0 0 im">-2.9667641307498531</Real>
+    <Real Name="Cell 3 1 2 re">-0.060375832961279227</Real>
+    <Real Name="Cell 3 1 2 im">-0.79494844533157683</Real>
+    <Real Name="Cell 3 5 7 re">7.6208799660687442e-13</Real>
+    <Real Name="Cell 3 5 7 im">-1.2701466422516263e-18</Real>
+    <Real Name="Cell 6 2 4 re">-0.010822157027959465</Real>
+    <Real Name="Cell 6 2 4 im">-0.00088087325244235457</Real>
+    <Real Name="Cell 7 0 0 re">1.642150584269557</Real>
+    <Real Name="Cell 7 0 0 im">0.45980215576509176</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">-21.508655755976211</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">8.1769429198299068</Real>
+    <Real Name="Cell 1 0">-1.4219812694541607</Real>
+    <Real Name="Cell 1 1">9.3048524361756808</Real>
+    <Real Name="Cell 2 0">-4.834736451754865</Real>
+    <Real Name="Cell 2 1">-4.9282166403949645</Real>
+    <Real Name="Cell 2 2">-6.0016091693463043</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffLJ_PmeSolveTest_ReproducesOutputs_3.xml b/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffLJ_PmeSolveTest_ReproducesOutputs_3.xml
new file mode 100644 (file)
index 0000000..7d7c015
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 4 0 im">-0.10980031377406475</Real>
+    <Real Name="Cell 0 6 7 re">-1.104282829889803e-10</Real>
+    <Real Name="Cell 2 5 10 re">-3.9568265111014019e-20</Real>
+    <Real Name="Cell 2 5 10 im">-1.1705611652820699e-19</Real>
+    <Real Name="Cell 4 2 7 re">-2.8544874197050347e-09</Real>
+    <Real Name="Cell 4 2 7 im">8.2979284076276372e-09</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">-0.016470419312996247</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">0.0082350372497414174</Real>
+    <Real Name="Cell 1 0">-2.0283147278850997e-07</Real>
+    <Real Name="Cell 1 1">-0.022453844836226242</Real>
+    <Real Name="Cell 2 0">-1.206847296948174e-06</Real>
+    <Real Name="Cell 2 1">-1.419058922419327e-06</Real>
+    <Real Name="Cell 2 2">0.0082267526649127572</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffLJ_PmeSolveTest_ReproducesOutputs_4.xml b/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffLJ_PmeSolveTest_ReproducesOutputs_4.xml
new file mode 100644 (file)
index 0000000..505d406
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 0 0 re">-0.24078724347789371</Real>
+    <Real Name="Cell 0 0 0 im">-0.46093556725010454</Real>
+    <Real Name="Cell 3 1 2 re">-0.033844124579137755</Real>
+    <Real Name="Cell 3 1 2 im">-0.44561429463090468</Real>
+    <Real Name="Cell 3 5 7 re">0.00013337714155882522</Real>
+    <Real Name="Cell 3 5 7 im">-2.222952326481159e-10</Real>
+    <Real Name="Cell 6 2 4 re">-1.4748639396178393</Real>
+    <Real Name="Cell 6 2 4 im">-0.12004706566765375</Real>
+    <Real Name="Cell 7 0 0 re">0.072971802679737227</Real>
+    <Real Name="Cell 7 0 0 im">0.020432104402369752</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">-50.292058479806066</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">-53.039180547663896</Real>
+    <Real Name="Cell 1 0">-44.367827409532083</Real>
+    <Real Name="Cell 1 1">-0.10395647320044596</Real>
+    <Real Name="Cell 2 0">-0.11740041231477359</Real>
+    <Real Name="Cell 2 1">-0.10348396692396387</Real>
+    <Real Name="Cell 2 2">25.127119580840922</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffLJ_PmeSolveTest_ReproducesOutputs_5.xml b/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffLJ_PmeSolveTest_ReproducesOutputs_5.xml
new file mode 100644 (file)
index 0000000..80ff5b4
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 4 0 im">-0.0057362984570354389</Real>
+    <Real Name="Cell 0 6 7 re">-0.0069394141749721059</Real>
+    <Real Name="Cell 2 5 10 re">-0.10030703953351935</Real>
+    <Real Name="Cell 2 5 10 im">-0.2967416558520477</Real>
+    <Real Name="Cell 4 2 7 re">-0.98747845589181826</Real>
+    <Real Name="Cell 4 2 7 im">2.870576858913505</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">-131.95802432517937</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">-37.20016196088654</Real>
+    <Real Name="Cell 1 0">-90.173425803606264</Real>
+    <Real Name="Cell 1 1">-20.045771494967298</Real>
+    <Real Name="Cell 2 0">-60.362280008302307</Real>
+    <Real Name="Cell 2 1">-55.408444753903993</Real>
+    <Real Name="Cell 2 2">29.593848348790942</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffLJ_PmeSolveTest_ReproducesOutputs_6.xml b/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffLJ_PmeSolveTest_ReproducesOutputs_6.xml
new file mode 100644 (file)
index 0000000..10f8462
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 0 0 re">-0.24078724347789371</Real>
+    <Real Name="Cell 0 0 0 im">-0.46093556725010454</Real>
+    <Real Name="Cell 3 1 2 re">-0.10526532449299339</Real>
+    <Real Name="Cell 3 1 2 im">-1.3859934008147894</Real>
+    <Real Name="Cell 3 5 7 re">0.0020302261986413928</Real>
+    <Real Name="Cell 3 5 7 im">-3.3837102810922127e-09</Real>
+    <Real Name="Cell 6 2 4 re">-6.6640634797260141</Real>
+    <Real Name="Cell 6 2 4 im">-0.54242377528829877</Real>
+    <Real Name="Cell 7 0 0 re">0.23325414914067172</Real>
+    <Real Name="Cell 7 0 0 im">0.065311160647145622</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">-215.20970930906984</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">8.3297521257045215</Real>
+    <Real Name="Cell 1 0">102.94721396484063</Real>
+    <Real Name="Cell 1 1">-15.233403449790623</Real>
+    <Real Name="Cell 2 0">80.797987021631059</Real>
+    <Real Name="Cell 2 1">-91.960023311736748</Real>
+    <Real Name="Cell 2 2">37.691308119304068</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffLJ_PmeSolveTest_ReproducesOutputs_7.xml b/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffLJ_PmeSolveTest_ReproducesOutputs_7.xml
new file mode 100644 (file)
index 0000000..859b341
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 4 0 im">-0.029904417511235334</Real>
+    <Real Name="Cell 0 6 7 re">-0.27370127182526427</Real>
+    <Real Name="Cell 2 5 10 re">-0.6991498586593593</Real>
+    <Real Name="Cell 2 5 10 im">-2.06831831257441</Real>
+    <Real Name="Cell 4 2 7 re">-10.026833319693612</Real>
+    <Real Name="Cell 4 2 7 im">29.147770793339333</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">-1329.4143993872051</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">-381.37902032167398</Real>
+    <Real Name="Cell 1 0">-881.13528084607606</Real>
+    <Real Name="Cell 1 1">-107.89864126422562</Real>
+    <Real Name="Cell 2 0">-614.45788958812147</Real>
+    <Real Name="Cell 2 1">-490.1935785693114</Real>
+    <Real Name="Cell 2 2">278.73579683973628</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffQ_PmeSolveTest_ReproducesOutputs_0.xml b/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffQ_PmeSolveTest_ReproducesOutputs_0.xml
new file mode 100644 (file)
index 0000000..d430106
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 0 0 re">3.5</Real>
+    <Real Name="Cell 0 0 0 im">6.6999998092651367</Real>
+    <Real Name="Cell 3 1 2 re">8.2210755780125459e-34</Real>
+    <Real Name="Cell 3 1 2 im">1.0824415878263353e-32</Real>
+    <Real Name="Cell 7 0 0 re">-5.3044697270927454e-20</Real>
+    <Real Name="Cell 7 0 0 im">-1.4852514982922861e-20</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">7.1504251744240444e-20</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">3.41272626726192e-18</Real>
+    <Real Name="Cell 1 0">5.9287266918327695e-31</Real>
+    <Real Name="Cell 1 1">-3.5752125871655224e-20</Real>
+    <Real Name="Cell 2 0">2.0157671317638854e-30</Real>
+    <Real Name="Cell 2 1">1.5809937844887388e-30</Real>
+    <Real Name="Cell 2 2">-3.5752125866744843e-20</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffQ_PmeSolveTest_ReproducesOutputs_1.xml b/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffQ_PmeSolveTest_ReproducesOutputs_1.xml
new file mode 100644 (file)
index 0000000..bcd6795
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 4 0 im">4.898432637853757e-38</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">7.3476492487499718e-39</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">-3.6738246243749859e-39</Real>
+    <Real Name="Cell 1 0">0</Real>
+    <Real Name="Cell 1 1">6.3099551402707054e-37</Real>
+    <Real Name="Cell 2 0">0</Real>
+    <Real Name="Cell 2 1">0</Real>
+    <Real Name="Cell 2 2">-3.6738246243749859e-39</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffQ_PmeSolveTest_ReproducesOutputs_2.xml b/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffQ_PmeSolveTest_ReproducesOutputs_2.xml
new file mode 100644 (file)
index 0000000..95b20f5
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 0 0 re">3.5</Real>
+    <Real Name="Cell 0 0 0 im">6.6999998092651367</Real>
+    <Real Name="Cell 3 1 2 re">2.556999772227411e-33</Real>
+    <Real Name="Cell 3 1 2 im">3.3667162736272229e-32</Real>
+    <Real Name="Cell 7 0 0 re">-1.0926105068604317</Real>
+    <Real Name="Cell 7 0 0 im">-0.30593093671094795</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">1.4728389596008808</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">6.4146764633054083</Real>
+    <Real Name="Cell 1 0">1.84401087871763e-30</Real>
+    <Real Name="Cell 1 1">-0.73641947980044042</Real>
+    <Real Name="Cell 2 0">6.2696371634985231e-30</Real>
+    <Real Name="Cell 2 1">4.917362343247014e-30</Real>
+    <Real Name="Cell 2 2">-0.73641947980044042</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffQ_PmeSolveTest_ReproducesOutputs_3.xml b/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffQ_PmeSolveTest_ReproducesOutputs_3.xml
new file mode 100644 (file)
index 0000000..bbf414b
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 4 0 im">2.7045303395891825e-21</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">4.0567956705863441e-22</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">-2.0283978352931721e-22</Real>
+    <Real Name="Cell 1 0">0</Real>
+    <Real Name="Cell 1 1">1.9685468212785548e-20</Real>
+    <Real Name="Cell 2 0">0</Real>
+    <Real Name="Cell 2 1">0</Real>
+    <Real Name="Cell 2 2">-2.0283978352931721e-22</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffQ_PmeSolveTest_ReproducesOutputs_4.xml b/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffQ_PmeSolveTest_ReproducesOutputs_4.xml
new file mode 100644 (file)
index 0000000..64665b1
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 0 0 re">3.5</Real>
+    <Real Name="Cell 0 0 0 im">6.6999998092651367</Real>
+    <Real Name="Cell 3 1 2 re">1.4765194649429009e-07</Real>
+    <Real Name="Cell 3 1 2 im">1.9440839083925106e-06</Real>
+    <Real Name="Cell 6 2 4 re">2.8973305349725333e-25</Real>
+    <Real Name="Cell 6 2 4 im">2.3582923119190961e-26</Real>
+    <Real Name="Cell 7 0 0 re">-1.9143774765849531e-29</Real>
+    <Real Name="Cell 7 0 0 im">-5.3602568431532371e-30</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">1.5446854233119991e-05</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">0.00017895573959435024</Real>
+    <Real Name="Cell 1 0">0.00010624017864812442</Real>
+    <Real Name="Cell 1 1">5.2738464577355206e-05</Real>
+    <Real Name="Cell 2 0">4.3541015979734419e-07</Real>
+    <Real Name="Cell 2 1">2.4779440564845181e-07</Real>
+    <Real Name="Cell 2 2">-7.7224115666698012e-06</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffQ_PmeSolveTest_ReproducesOutputs_5.xml b/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffQ_PmeSolveTest_ReproducesOutputs_5.xml
new file mode 100644 (file)
index 0000000..b52d391
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 4 0 im">8.4622953690730811e-28</Real>
+    <Real Name="Cell 4 2 7 re">1.4391546043716599e-17</Real>
+    <Real Name="Cell 4 2 7 im">-4.1835888966074777e-17</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">1.8714632354986221e-15</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">3.7666982290146189e-14</Real>
+    <Real Name="Cell 1 0">3.2953537029348404e-14</Real>
+    <Real Name="Cell 1 1">2.7195337232381974e-14</Real>
+    <Real Name="Cell 2 0">2.2284153843094576e-14</Real>
+    <Real Name="Cell 2 1">1.9023058601221014e-14</Real>
+    <Real Name="Cell 2 2">1.1928221773909695e-14</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffQ_PmeSolveTest_ReproducesOutputs_6.xml b/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffQ_PmeSolveTest_ReproducesOutputs_6.xml
new file mode 100644 (file)
index 0000000..1d95a12
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 0 0 re">3.5</Real>
+    <Real Name="Cell 0 0 0 im">6.6999998092651367</Real>
+    <Real Name="Cell 3 1 2 re">4.5924160406040909e-07</Real>
+    <Real Name="Cell 3 1 2 im">6.0466809528496931e-06</Real>
+    <Real Name="Cell 3 5 7 re">-4.7703059370503073e-21</Real>
+    <Real Name="Cell 3 5 7 im">7.9505097776562864e-27</Real>
+    <Real Name="Cell 6 2 4 re">1.0063968348774453e-13</Real>
+    <Real Name="Cell 6 2 4 im">8.1916021999667744e-15</Real>
+    <Real Name="Cell 7 0 0 re">-0.024375179191018694</Real>
+    <Real Name="Cell 7 0 0 im">-0.0068250500572553229</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">0.032905785796259142</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">0.17994239387577421</Real>
+    <Real Name="Cell 1 0">0.00033043861081358196</Real>
+    <Real Name="Cell 1 1">-0.016264838330712152</Real>
+    <Real Name="Cell 2 0">-0.056174983204850239</Real>
+    <Real Name="Cell 2 1">7.7074954253368213e-07</Real>
+    <Real Name="Cell 2 2">-0.00033672708354701251</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffQ_PmeSolveTest_ReproducesOutputs_7.xml b/src/gromacs/ewald/tests/refdata/DifferentEwaldCoeffQ_PmeSolveTest_ReproducesOutputs_7.xml
new file mode 100644 (file)
index 0000000..9ae05dd
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 4 0 im">7.9977633138124044e-16</Real>
+    <Real Name="Cell 0 6 7 re">7.6137551246740057e-12</Real>
+    <Real Name="Cell 2 5 10 re">5.378627596651949e-26</Real>
+    <Real Name="Cell 2 5 10 im">1.5911773158340167e-25</Real>
+    <Real Name="Cell 4 2 7 re">1.4613142447013661e-16</Real>
+    <Real Name="Cell 4 2 7 im">-4.2480064546339484e-16</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">2.7428640483431204e-11</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">-1.3322349180734567e-11</Real>
+    <Real Name="Cell 1 0">3.3460945005926606e-13</Real>
+    <Real Name="Cell 1 1">9.089404609722578e-11</Real>
+    <Real Name="Cell 2 0">2.262727808888106e-13</Real>
+    <Real Name="Cell 2 1">-2.6231426231809359e-10</Real>
+    <Real Name="Cell 2 2">6.4698667840508995e-10</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_0.xml b/src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_0.xml
new file mode 100644 (file)
index 0000000..313574c
--- /dev/null
@@ -0,0 +1,562 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">39</Int>
+      <Real>0.057799991083145486</Real>
+      <Real>0.72439999160766533</Real>
+      <Real>0.21780001730918919</Real>
+      <Real>0.23120004539489969</Real>
+      <Real>0.71759997596740277</Real>
+      <Real>0.051199978637697541</Real>
+      <Real>0.5</Real>
+      <Real>0.5</Real>
+      <Real>0</Real>
+      <Real>0.49980165541637689</Real>
+      <Real>0.50019832490943372</Real>
+      <Real>1.9674189388751984e-08</Real>
+      <Real>0.0098000146865899751</Real>
+      <Real>0.62040007553099485</Real>
+      <Real>0.36979990978241517</Real>
+      <Real>0.01280001373291384</Real>
+      <Real>0.6344000583648608</Real>
+      <Real>0.35279992790222536</Real>
+      <Real>0.31999996185302848</Real>
+      <Real>0.66000002861022722</Real>
+      <Real>0.020000009536744301</Real>
+      <Real>0.064799962234502573</Real>
+      <Real>0.73039997062682005</Real>
+      <Real>0.20480006713867738</Real>
+      <Real>0.033799997520446823</Real>
+      <Real>0.69239999542236319</Real>
+      <Real>0.27380000705718999</Real>
+      <Real>0.0050000023841860752</Real>
+      <Real>0.59000001907348576</Real>
+      <Real>0.40499997854232817</Real>
+      <Real>0.14579997940063549</Real>
+      <Real>0.74840000305175636</Real>
+      <Real>0.10580001754760815</Real>
+      <Real>0.19220000295639039</Real>
+      <Real>0.7355999988555908</Real>
+      <Real>0.07219999818801881</Real>
+      <Real>0.09680002517700359</Real>
+      <Real>0.7464000068664518</Real>
+      <Real>0.15679996795654461</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">39</Int>
+      <Real>0.28346023183768659</Real>
+      <Real>0.68602074496934773</Real>
+      <Real>0.03051902319296566</Real>
+      <Real>0.062283763229400151</Real>
+      <Real>0.72837372425978641</Real>
+      <Real>0.20934251251081343</Real>
+      <Real>0.030519075166579968</Real>
+      <Real>0.68602085139144819</Real>
+      <Real>0.28346007344197183</Real>
+      <Real>0.20179944632183019</Real>
+      <Real>0.73169544279752741</Real>
+      <Real>0.06650511088064244</Real>
+      <Real>0.0069204181366000162</Real>
+      <Real>0.60380624729966226</Real>
+      <Real>0.38927333456373775</Real>
+      <Real>0.31999993268181826</Real>
+      <Real>0.66000005048863186</Real>
+      <Real>0.020000016829549865</Real>
+      <Real>0.25750869847450536</Real>
+      <Real>0.70262972869771734</Real>
+      <Real>0.039861572827777289</Real>
+      <Real>0.024982681258888664</Real>
+      <Real>0.67356397004906354</Real>
+      <Real>0.30145334869204782</Real>
+      <Real>0.5</Real>
+      <Real>0.5</Real>
+      <Real>0</Real>
+      <Real>0.33910152816638917</Real>
+      <Real>0.64532779089322467</Real>
+      <Real>0.015570680940386146</Real>
+      <Real>0.31065743749553704</Real>
+      <Real>0.6669204166516397</Real>
+      <Real>0.022422145852823244</Real>
+      <Real>0.38927333456373775</Real>
+      <Real>0.60380624729966226</Real>
+      <Real>0.0069204181366000162</Real>
+      <Real>0.070865057959422981</Real>
+      <Real>0.73474048840351802</Real>
+      <Real>0.19439445363705898</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">39</Int>
+      <Real>0.0032000320435372487</Real>
+      <Real>0.57360033645613839</Real>
+      <Real>0.42319963150032436</Real>
+      <Real>0.036450027036671884</Real>
+      <Real>0.69710004606245946</Real>
+      <Real>0.26644992690086866</Real>
+      <Real>0.00020000200272107804</Real>
+      <Real>0.51960009613036107</Real>
+      <Real>0.48019990186691786</Real>
+      <Real>0.22444973163612758</Real>
+      <Real>0.72110013618453195</Real>
+      <Real>0.054450132179340471</Real>
+      <Real>0.045000200271829272</Real>
+      <Real>0.71000026702836294</Real>
+      <Real>0.24499953269980779</Real>
+      <Real>0.096800005507469256</Real>
+      <Real>0.74640000150203689</Real>
+      <Real>0.15679999299049385</Real>
+      <Real>0.042050058078785923</Real>
+      <Real>0.7059000841140346</Real>
+      <Real>0.25204985780717948</Real>
+      <Real>0.38720002202987702</Real>
+      <Real>0.60559998097419676</Real>
+      <Real>0.0071999969959262167</Real>
+      <Real>0.23804993666410867</Real>
+      <Real>0.7139000348806297</Real>
+      <Real>0.048050028455261629</Real>
+      <Real>0.06479997296333595</Real>
+      <Real>0.73039997897147568</Real>
+      <Real>0.20480004806518837</Real>
+      <Real>0.028799987983704867</Real>
+      <Real>0.68239997396468866</Real>
+      <Real>0.28880003805160648</Real>
+      <Real>0.088200007009506365</Real>
+      <Real>0.74360000267028781</Real>
+      <Real>0.16819999032020583</Real>
+      <Real>0.057800011348724922</Real>
+      <Real>0.72440001068115123</Real>
+      <Real>0.21779997797012385</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">39</Int>
+      <Real>-0.3399999737739563</Real>
+      <Real>-0.3200000524520874</Real>
+      <Real>0.6600000262260437</Real>
+      <Real>-0.68000006675720215</Real>
+      <Real>0.3600001335144043</Real>
+      <Real>0.31999993324279785</Real>
+      <Real>-1</Real>
+      <Real>1</Real>
+      <Real>0</Real>
+      <Real>-0.9998016357421875</Real>
+      <Real>0.999603271484375</Real>
+      <Real>0.0001983642578125</Real>
+      <Real>-0.1400001049041748</Real>
+      <Real>-0.71999979019165039</Real>
+      <Real>0.8599998950958252</Real>
+      <Real>-0.16000008583068848</Real>
+      <Real>-0.67999982833862305</Real>
+      <Real>0.83999991416931152</Real>
+      <Real>-0.79999995231628418</Real>
+      <Real>0.59999990463256836</Real>
+      <Real>0.20000004768371582</Real>
+      <Real>-0.3599998950958252</Real>
+      <Real>-0.28000020980834961</Real>
+      <Real>0.6400001049041748</Real>
+      <Real>-0.25999999046325684</Real>
+      <Real>-0.48000001907348633</Real>
+      <Real>0.74000000953674316</Real>
+      <Real>-0.10000002384185791</Real>
+      <Real>-0.79999995231628418</Real>
+      <Real>0.89999997615814209</Real>
+      <Real>-0.53999996185302734</Real>
+      <Real>0.079999923706054688</Real>
+      <Real>0.46000003814697266</Real>
+      <Real>-0.62000000476837158</Real>
+      <Real>0.24000000953674316</Real>
+      <Real>0.37999999523162842</Real>
+      <Real>-0.44000005722045898</Real>
+      <Real>-0.11999988555908203</Real>
+      <Real>0.55999994277954102</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">39</Int>
+      <Real>-0.75294120864472092</Real>
+      <Real>0.50588241728944183</Real>
+      <Real>0.24705879135527908</Real>
+      <Real>-0.35294125071858673</Real>
+      <Real>-0.29411749856282654</Real>
+      <Real>0.64705874928141327</Real>
+      <Real>-0.24705900172460815</Real>
+      <Real>-0.5058819965507837</Real>
+      <Real>0.75294099827539185</Real>
+      <Real>-0.63529433544118774</Real>
+      <Real>0.27058867088237548</Real>
+      <Real>0.36470566455881226</Real>
+      <Real>-0.11764708357286224</Real>
+      <Real>-0.76470583285427551</Real>
+      <Real>0.88235291642713776</Real>
+      <Real>-0.79999991585226837</Real>
+      <Real>0.59999983170453675</Real>
+      <Real>0.20000008414773163</Real>
+      <Real>-0.71764712564672806</Real>
+      <Real>0.43529425129345611</Real>
+      <Real>0.28235287435327194</Real>
+      <Real>-0.22352933256684082</Real>
+      <Real>-0.55294133486631836</Real>
+      <Real>0.77647066743315918</Real>
+      <Real>-1</Real>
+      <Real>1</Real>
+      <Real>0</Real>
+      <Real>-0.823530847226003</Real>
+      <Real>0.64706169445200601</Real>
+      <Real>0.176469152773997</Real>
+      <Real>-0.78823529164271378</Real>
+      <Real>0.57647058328542755</Real>
+      <Real>0.21176470835728622</Real>
+      <Real>-0.88235291642713776</Real>
+      <Real>0.76470583285427551</Real>
+      <Real>0.11764708357286224</Real>
+      <Real>-0.37647060432236401</Real>
+      <Real>-0.24705879135527198</Real>
+      <Real>0.62352939567763599</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">39</Int>
+      <Real>-0.080000400543212891</Real>
+      <Real>-0.83999919891357422</Real>
+      <Real>0.91999959945678711</Real>
+      <Real>-0.27000010013580322</Real>
+      <Real>-0.45999979972839355</Real>
+      <Real>0.72999989986419678</Real>
+      <Real>-0.020000100135803223</Real>
+      <Real>-0.95999979972839355</Real>
+      <Real>0.97999989986419678</Real>
+      <Real>-0.66999959945678711</Real>
+      <Real>0.33999919891357422</Real>
+      <Real>0.33000040054321289</Real>
+      <Real>-0.30000066757202148</Real>
+      <Real>-0.39999866485595703</Real>
+      <Real>0.69999933242797852</Real>
+      <Real>-0.4400000125169754</Real>
+      <Real>-0.11999997496604919</Real>
+      <Real>0.5599999874830246</Real>
+      <Real>-0.29000020027160645</Real>
+      <Real>-0.41999959945678711</Real>
+      <Real>0.70999979972839355</Real>
+      <Real>-0.88000002503395081</Real>
+      <Real>0.76000005006790161</Real>
+      <Real>0.11999997496604919</Real>
+      <Real>-0.68999990820884705</Real>
+      <Real>0.37999981641769409</Real>
+      <Real>0.31000009179115295</Real>
+      <Real>-0.35999992489814758</Real>
+      <Real>-0.28000015020370483</Real>
+      <Real>0.64000007510185242</Real>
+      <Real>-0.23999994993209839</Real>
+      <Real>-0.52000010013580322</Real>
+      <Real>0.76000005006790161</Real>
+      <Real>-0.42000001668930054</Real>
+      <Real>-0.15999996662139893</Real>
+      <Real>0.57999998331069946</Real>
+      <Real>-0.34000003337860107</Real>
+      <Real>-0.31999993324279785</Real>
+      <Real>0.65999996662139893</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">10</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">2</Int>
+      <Int Name="Z">2</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">1</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">7</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">8</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">13</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">3</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">6</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">1</Int>
+      <Int Name="Y">0</Int>
+      <Int Name="Z">2</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">1</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">10</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">4</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">6</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">1</Int>
+      <Int Name="Z">2</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 3 10">5.6623669355262653e-05</Real>
+    <Real Name="Cell 0 3 11">0.010149697050426341</Real>
+    <Real Name="Cell 0 3 12">0.007488398765799556</Real>
+    <Real Name="Cell 0 4 10">0.00013703866529058128</Real>
+    <Real Name="Cell 0 4 11">0.02456394918823649</Real>
+    <Real Name="Cell 0 4 12">0.018123166225599462</Real>
+    <Real Name="Cell 0 5 10">0.022687329577496734</Real>
+    <Real Name="Cell 0 5 11">0.0010927770632069087</Real>
+    <Real Name="Cell 0 5 12">0.00080624577962836266</Real>
+    <Real Name="Cell 0 5 6">0.038010113433341118</Real>
+    <Real Name="Cell 0 5 7">0.32045712249755282</Real>
+    <Real Name="Cell 0 5 8">0.16598105861316068</Real>
+    <Real Name="Cell 0 5 9">0.30037466664767609</Real>
+    <Real Name="Cell 0 6 10">0.082238852604420473</Real>
+    <Real Name="Cell 0 6 6">0.058957914436500745</Real>
+    <Real Name="Cell 0 6 7">0.497064646805428</Real>
+    <Real Name="Cell 0 6 8">0.4514325111168781</Real>
+    <Real Name="Cell 0 6 9">1.08911485499034</Real>
+    <Real Name="Cell 0 7 10">0.0074748367848824267</Real>
+    <Real Name="Cell 0 7 6">0.00067573567214182734</Real>
+    <Real Name="Cell 0 7 7">0.0056970182276166216</Real>
+    <Real Name="Cell 0 7 8">0.032100787939127552</Real>
+    <Real Name="Cell 0 7 9">0.098991602183492719</Real>
+    <Real Name="Cell 1 0 2">0.024540565786750318</Real>
+    <Real Name="Cell 1 0 3">0.073595948046277712</Real>
+    <Real Name="Cell 1 0 4">0.0049534769926253023</Real>
+    <Real Name="Cell 1 1 2">0.024540565786750318</Real>
+    <Real Name="Cell 1 1 3">0.073595948046277712</Real>
+    <Real Name="Cell 1 1 4">0.0049534769926253023</Real>
+    <Real Name="Cell 1 3 10">0.0010238823471539209</Real>
+    <Real Name="Cell 1 3 11">0.13074669381137438</Real>
+    <Real Name="Cell 1 3 12">0.094844263370290671</Real>
+    <Real Name="Cell 1 4 10">0.0023154748502671177</Real>
+    <Real Name="Cell 1 4 11">0.31459714509427167</Real>
+    <Real Name="Cell 1 4 12">0.22902528850437476</Real>
+    <Real Name="Cell 1 5 10">0.022790068545680862</Real>
+    <Real Name="Cell 1 5 11">0.013858268451161514</Real>
+    <Real Name="Cell 1 5 12">0.01015017752588509</Real>
+    <Real Name="Cell 1 5 6">0.14547470847027352</Real>
+    <Real Name="Cell 1 5 7">1.2264771100795671</Real>
+    <Real Name="Cell 1 5 8">0.37971512665726326</Real>
+    <Real Name="Cell 1 5 9">0.30867345161902582</Real>
+    <Real Name="Cell 1 6 10">0.082304121783941267</Real>
+    <Real Name="Cell 1 6 6">0.22564745642516129</Real>
+    <Real Name="Cell 1 6 7">1.9024726950852704</Real>
+    <Real Name="Cell 1 6 8">0.96563446440803302</Real>
+    <Real Name="Cell 1 6 9">1.2711641691167428</Real>
+    <Real Name="Cell 1 7 10">0.0074807692176505243</Real>
+    <Real Name="Cell 1 7 6">0.0025862182726760627</Real>
+    <Real Name="Cell 1 7 7">0.021835169148112558</Real>
+    <Real Name="Cell 1 7 8">0.11677582478108178</Real>
+    <Real Name="Cell 1 7 9">0.17393479356687258</Real>
+    <Real Name="Cell 13 4 0">0.0011101808418038936</Real>
+    <Real Name="Cell 13 4 1">0.0085603195748374158</Real>
+    <Real Name="Cell 13 4 2">0.0017983092800505994</Real>
+    <Real Name="Cell 13 5 0">0.0022897486430743653</Real>
+    <Real Name="Cell 13 5 1">0.017655664187933528</Real>
+    <Real Name="Cell 13 5 2">0.0037090139540988942</Real>
+    <Real Name="Cell 13 6 0">6.9386375596519858e-05</Real>
+    <Real Name="Cell 13 6 1">0.00053502053618650989</Real>
+    <Real Name="Cell 13 6 2">0.00011239444822480495</Real>
+    <Real Name="Cell 14 4 0">0.055023284000462663</Real>
+    <Real Name="Cell 14 4 1">0.42427042276793414</Real>
+    <Real Name="Cell 14 4 2">0.089128616267700259</Real>
+    <Real Name="Cell 14 5 0">0.11348555580624049</Real>
+    <Real Name="Cell 14 5 1">0.87505799798432204</Real>
+    <Real Name="Cell 14 5 2">0.1838278237863091</Real>
+    <Real Name="Cell 14 6 0">0.003438958867283791</Real>
+    <Real Name="Cell 14 6 1">0.026516929314719953</Real>
+    <Real Name="Cell 14 6 2">0.0055705443760856732</Real>
+    <Real Name="Cell 15 4 0">0.030599320369454324</Real>
+    <Real Name="Cell 15 4 1">0.23594350692428107</Real>
+    <Real Name="Cell 15 4 2">0.04956583622378094</Real>
+    <Real Name="Cell 15 5 0">0.063111116366510248</Real>
+    <Real Name="Cell 15 5 1">0.48663362263056564</Real>
+    <Real Name="Cell 15 5 2">0.10222956653786006</Real>
+    <Real Name="Cell 15 6 0">0.0019124595347036657</Real>
+    <Real Name="Cell 15 6 1">0.014746484693797416</Real>
+    <Real Name="Cell 15 6 2">0.0030978680224661675</Real>
+    <Real Name="Cell 2 0 2">0.50271860606288887</Real>
+    <Real Name="Cell 2 0 3">1.5076283381240179</Real>
+    <Real Name="Cell 2 0 4">0.10147300883509652</Real>
+    <Real Name="Cell 2 1 2">0.5047764048326977</Real>
+    <Real Name="Cell 2 1 3">1.5334184619673425</Real>
+    <Real Name="Cell 2 1 4">0.10922713407267229</Real>
+    <Real Name="Cell 2 2 2">0.022432594190590932</Real>
+    <Real Name="Cell 2 2 3">0.28837614886492213</Real>
+    <Real Name="Cell 2 2 4">0.088415117807521301</Real>
+    <Real Name="Cell 2 3 0">1.0101863480419877e-05</Real>
+    <Real Name="Cell 2 3 1">0.00015938430774211805</Real>
+    <Real Name="Cell 2 3 10">0.03729190653598248</Real>
+    <Real Name="Cell 2 3 11">0.45618055990310158</Real>
+    <Real Name="Cell 2 3 12">0.14540410722102243</Real>
+    <Real Name="Cell 2 3 2">0.018528685636693628</Real>
+    <Real Name="Cell 2 3 3">0.31609512046265792</Real>
+    <Real Name="Cell 2 3 4">0.1153625735577145</Real>
+    <Real Name="Cell 2 3 5">0.0074180447991776845</Real>
+    <Real Name="Cell 2 3 6">0.0031394075351794978</Real>
+    <Real Name="Cell 2 4 0">0.00088138724545949656</Real>
+    <Real Name="Cell 2 4 1">0.013906275435475911</Real>
+    <Real Name="Cell 2 4 10">0.071078767034347068</Real>
+    <Real Name="Cell 2 4 11">0.88791266956615367</Real>
+    <Real Name="Cell 2 4 12">0.29130323596519359</Real>
+    <Real Name="Cell 2 4 2">0.0084857720442544186</Real>
+    <Real Name="Cell 2 4 3">0.070515847026058828</Real>
+    <Real Name="Cell 2 4 4">0.027625108536345405</Real>
+    <Real Name="Cell 2 4 5">0.015925083165855905</Real>
+    <Real Name="Cell 2 4 6">0.0067396905037282002</Real>
+    <Real Name="Cell 2 5 0">0.00056822954982062139</Real>
+    <Real Name="Cell 2 5 1">0.008965363035475387</Real>
+    <Real Name="Cell 2 5 10">0.0017255256521228211</Real>
+    <Real Name="Cell 2 5 11">0.02330827131049042</Real>
+    <Real Name="Cell 2 5 12">0.0084189784020007839</Real>
+    <Real Name="Cell 2 5 2">0.0030936745465869725</Real>
+    <Real Name="Cell 2 5 4">2.2596343831713116e-05</Real>
+    <Real Name="Cell 2 5 5">0.00053540801653051829</Real>
+    <Real Name="Cell 2 5 6">0.014505103615625918</Real>
+    <Real Name="Cell 2 5 7">0.12038318703711517</Real>
+    <Real Name="Cell 2 5 8">0.035951287063896872</Real>
+    <Real Name="Cell 2 5 9">0.0080604032936843015</Real>
+    <Real Name="Cell 2 6 1">0.0031905603848251464</Real>
+    <Real Name="Cell 2 6 10">3.2372497043954596e-09</Real>
+    <Real Name="Cell 2 6 2">0.0049901942107793643</Real>
+    <Real Name="Cell 2 6 3">5.932857406782298e-05</Real>
+    <Real Name="Cell 2 6 6">0.022147561134276194</Real>
+    <Real Name="Cell 2 6 7">0.18679797109805318</Real>
+    <Real Name="Cell 2 6 8">0.23828713894708675</Real>
+    <Real Name="Cell 2 6 9">0.18118497683324633</Real>
+    <Real Name="Cell 2 7 1">0.086021452109728128</Real>
+    <Real Name="Cell 2 7 10">2.9423943070631154e-10</Real>
+    <Real Name="Cell 2 7 2">0.13454180474453697</Real>
+    <Real Name="Cell 2 7 3">0.0015995716981841053</Real>
+    <Real Name="Cell 2 7 6">0.00025384034107059551</Real>
+    <Real Name="Cell 2 7 7">0.0021712678064379127</Real>
+    <Real Name="Cell 2 7 8">0.081491318690849343</Real>
+    <Real Name="Cell 2 7 9">0.074864630216865194</Real>
+    <Real Name="Cell 2 8 1">0.038498874570059433</Real>
+    <Real Name="Cell 2 8 2">0.06021414354505631</Real>
+    <Real Name="Cell 2 8 3">0.00071588782407037044</Real>
+    <Real Name="Cell 3 0 2">0.19879312362478679</Real>
+    <Real Name="Cell 3 0 3">0.5961707861742187</Real>
+    <Real Name="Cell 3 0 4">0.040126098669622232</Real>
+    <Real Name="Cell 3 1 2">0.21466027875317184</Real>
+    <Real Name="Cell 3 1 3">0.79503177385004864</Real>
+    <Real Name="Cell 3 1 4">0.09991615678155788</Real>
+    <Real Name="Cell 3 2 2">0.16791813106015502</Real>
+    <Real Name="Cell 3 2 3">2.1269408189763399</Real>
+    <Real Name="Cell 3 2 4">0.64480275193967729</Real>
+    <Real Name="Cell 3 3 0">0.00063950892592356222</Real>
+    <Real Name="Cell 3 3 1">0.010089988609606101</Real>
+    <Real Name="Cell 3 3 10">0.025452215343283555</Real>
+    <Real Name="Cell 3 3 11">0.28688742759245028</Real>
+    <Real Name="Cell 3 3 12">0.080441621921961484</Real>
+    <Real Name="Cell 3 3 2">0.086826077747086727</Real>
+    <Real Name="Cell 3 3 3">1.3272237357284817</Real>
+    <Real Name="Cell 3 3 4">0.79581183811150646</Real>
+    <Real Name="Cell 3 3 5">0.15916407654768858</Real>
+    <Real Name="Cell 3 3 6">0.016114766398237244</Real>
+    <Real Name="Cell 3 4 0">0.055797132059747637</Real>
+    <Real Name="Cell 3 4 1">0.88035116338443908</Real>
+    <Real Name="Cell 3 4 10">0.048436885524032317</Real>
+    <Real Name="Cell 3 4 11">0.54596165014164655</Real>
+    <Real Name="Cell 3 4 12">0.15308457750534166</Real>
+    <Real Name="Cell 3 4 2">0.31522661556836007</Real>
+    <Real Name="Cell 3 4 3">0.27398777795327972</Real>
+    <Real Name="Cell 3 4 4">1.0124189061732707</Real>
+    <Real Name="Cell 3 4 5">0.41213787182227002</Real>
+    <Real Name="Cell 3 4 6">0.034595233924539864</Real>
+    <Real Name="Cell 3 5 0">0.035972359930240401</Real>
+    <Real Name="Cell 3 5 1">0.56756158865585526</Real>
+    <Real Name="Cell 3 5 10">0.0011687010863065466</Real>
+    <Real Name="Cell 3 5 11">0.013173142052778681</Real>
+    <Real Name="Cell 3 5 12">0.0036936749770689519</Real>
+    <Real Name="Cell 3 5 2">0.1958482700028199</Real>
+    <Real Name="Cell 3 5 3">0.0031270837041210611</Real>
+    <Real Name="Cell 3 5 4">0.052610770806788179</Real>
+    <Real Name="Cell 3 5 5">0.021492155630256263</Real>
+    <Real Name="Cell 3 5 6">0.0011631063639692884</Real>
+    <Real Name="Cell 3 6 1">0.035962755702326245</Real>
+    <Real Name="Cell 3 6 2">0.056247528228260152</Real>
+    <Real Name="Cell 3 6 3">0.0006687286112860752</Real>
+    <Real Name="Cell 3 7 1">0.96960035048860149</Real>
+    <Real Name="Cell 3 7 2">1.5165028935952978</Real>
+    <Real Name="Cell 3 7 3">0.018029750035056202</Real>
+    <Real Name="Cell 3 8 1">0.43394434017377931</Real>
+    <Real Name="Cell 3 8 2">0.67871040599482013</Real>
+    <Real Name="Cell 3 8 3">0.0080692091112776632</Real>
+    <Real Name="Cell 4 1 2">0.0033332923269083705</Real>
+    <Real Name="Cell 4 1 3">0.04177571839298766</Real>
+    <Real Name="Cell 4 1 4">0.012560395377580517</Real>
+    <Real Name="Cell 4 2 2">0.034803053196972543</Real>
+    <Real Name="Cell 4 2 3">0.4377835401891883</Real>
+    <Real Name="Cell 4 2 4">0.13200408043466716</Real>
+    <Real Name="Cell 4 3 0">0.00038119006176646992</Real>
+    <Real Name="Cell 4 3 1">0.0060143075810304616</Real>
+    <Real Name="Cell 4 3 2">0.014060101366706755</Real>
+    <Real Name="Cell 4 3 3">0.21059581558386664</Real>
+    <Real Name="Cell 4 3 4">0.75488543362632587</Real>
+    <Real Name="Cell 4 3 5">0.25512450276702403</Real>
+    <Real Name="Cell 4 3 6">0.0022781167300332033</Real>
+    <Real Name="Cell 4 4 0">0.033258819938330797</Real>
+    <Real Name="Cell 4 4 1">0.52474813211099514</Real>
+    <Real Name="Cell 4 4 2">0.1818911746733872</Real>
+    <Real Name="Cell 4 4 3">0.12930160007977831</Real>
+    <Real Name="Cell 4 4 4">1.9149130085007566</Real>
+    <Real Name="Cell 4 4 5">0.69299270525738577</Real>
+    <Real Name="Cell 4 4 6">0.0048906685480422209</Real>
+    <Real Name="Cell 4 5 0">0.021441930750053368</Real>
+    <Real Name="Cell 4 5 1">0.33830464011672068</Real>
+    <Real Name="Cell 4 5 2">0.11673865854400045</Real>
+    <Real Name="Cell 4 5 3">0.0064496111881862817</Real>
+    <Real Name="Cell 4 5 4">0.10828690342773702</Real>
+    <Real Name="Cell 4 5 5">0.039047766821141347</Real>
+    <Real Name="Cell 4 5 6">0.00016442634048088761</Real>
+    <Real Name="Cell 4 6 1">0.010083755583954317</Real>
+    <Real Name="Cell 4 6 2">0.015771492361433749</Real>
+    <Real Name="Cell 4 6 3">0.00018750776286506287</Real>
+    <Real Name="Cell 4 7 1">0.27187051596858192</Real>
+    <Real Name="Cell 4 7 2">0.42521893060562377</Real>
+    <Real Name="Cell 4 7 3">0.0050554410818283964</Real>
+    <Real Name="Cell 4 8 1">0.12167556623225267</Real>
+    <Real Name="Cell 4 8 2">0.19030660228007695</Real>
+    <Real Name="Cell 4 8 3">0.0022625611092610995</Real>
+    <Real Name="Cell 5 3 3">0.0012625752032468175</Real>
+    <Real Name="Cell 5 3 4">0.021195022858288406</Real>
+    <Real Name="Cell 5 3 5">0.0075679301049474106</Real>
+    <Real Name="Cell 5 4 3">0.0034450209945261568</Real>
+    <Real Name="Cell 5 4 4">0.057832039262687311</Real>
+    <Real Name="Cell 5 4 5">0.020649604102476335</Real>
+    <Real Name="Cell 5 5 3">0.00019544284800053645</Real>
+    <Real Name="Cell 5 5 4">0.0032809258570957118</Real>
+    <Real Name="Cell 5 5 5">0.0011714928420709493</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_1.xml b/src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_1.xml
new file mode 100644 (file)
index 0000000..691e2bb
--- /dev/null
@@ -0,0 +1,584 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">39</Int>
+      <Real>0.023382024515234419</Real>
+      <Real>0.66948591982610428</Real>
+      <Real>0.30713205565866131</Real>
+      <Real>0.030012519422176642</Real>
+      <Real>0.68497504042982427</Real>
+      <Real>0.28501244014799909</Real>
+      <Real>0.330078125</Real>
+      <Real>0.65234375</Real>
+      <Real>0.017578125</Real>
+      <Real>0.49976447018752879</Real>
+      <Real>0.50023550206879008</Real>
+      <Real>2.7743681130232289e-08</Real>
+      <Real>0.18225710646138371</Real>
+      <Real>0.73923591165094016</Real>
+      <Real>0.078506981887676131</Real>
+      <Real>0.15961255758703274</Real>
+      <Real>0.74577498674987708</Real>
+      <Real>0.094612455663090178</Real>
+      <Real>0.019999988675119096</Real>
+      <Real>0.65999996602534927</Real>
+      <Real>0.32000004529953163</Real>
+      <Real>0.3741123922437507</Real>
+      <Real>0.61677509093879102</Real>
+      <Real>0.0091125168174582827</Real>
+      <Real>0.43594452067539102</Real>
+      <Real>0.56186094732433545</Real>
+      <Real>0.0021945320002735302</Real>
+      <Real>0.27658205230720379</Real>
+      <Real>0.6905859236977987</Real>
+      <Real>0.032832023994997545</Real>
+      <Real>0.0031007776826630362</Real>
+      <Real>0.5725483993351439</Real>
+      <Real>0.42435082298219307</Real>
+      <Real>0.15056328435726465</Real>
+      <Real>0.747623436947912</Real>
+      <Real>0.1018132786948234</Real>
+      <Real>0.46080006523132555</Real>
+      <Real>0.53839993748664394</Real>
+      <Real>0.0007999972820305068</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">39</Int>
+      <Real>0.080000018232009792</Real>
+      <Real>0.74000000911600228</Real>
+      <Real>0.17999997265198792</Real>
+      <Real>0.031250026296172552</Real>
+      <Real>0.68750005259232294</Real>
+      <Real>0.28124992111150449</Real>
+      <Real>0.3612502145767475</Real>
+      <Real>0.62749982328969989</Real>
+      <Real>0.011249962133552631</Real>
+      <Real>0.080000123416718763</Real>
+      <Real>0.7400000617082404</Real>
+      <Real>0.17999981487504085</Real>
+      <Real>0.12500001753077744</Real>
+      <Real>0.74999999999999878</Real>
+      <Real>0.12499998246922378</Real>
+      <Real>0.0012499940395428412</Real>
+      <Real>0.54749989271162902</Real>
+      <Real>0.45125011324882813</Real>
+      <Real>0.061250033133174432</Real>
+      <Real>0.72750002839985095</Real>
+      <Real>0.21124993846697457</Real>
+      <Real>0.079999955121217034</Real>
+      <Real>0.73999997756059277</Real>
+      <Real>0.18000006731819018</Real>
+      <Real>0.5</Real>
+      <Real>0.5</Real>
+      <Real>0</Real>
+      <Real>0.12500101678715228</Real>
+      <Real>0.74999999999586464</Real>
+      <Real>0.12499898321698313</Real>
+      <Real>0.10124999842222977</Real>
+      <Real>0.74749999964938441</Real>
+      <Real>0.15125000192838584</Real>
+      <Real>0.28124997370383537</Real>
+      <Real>0.68750001753077561</Real>
+      <Real>0.031250008765389033</Real>
+      <Real>0.24500001595301041</Real>
+      <Real>0.70999999088399368</Real>
+      <Real>0.04499999316299591</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">39</Int>
+      <Real>0.088200132179309776</Real>
+      <Real>0.74360005035390486</Real>
+      <Real>0.16819981746678536</Real>
+      <Real>0.36551256726980519</Real>
+      <Real>0.62397494413852073</Real>
+      <Real>0.010512488591674085</Real>
+      <Real>0.2664500574350388</Real>
+      <Real>0.6970999638080535</Real>
+      <Real>0.036449978756907697</Real>
+      <Real>0.10351235680585091</Real>
+      <Real>0.74797497167577376</Real>
+      <Real>0.14851267151837533</Real>
+      <Real>0.10125023603453087</Real>
+      <Real>0.74750005245181228</Real>
+      <Real>0.15124971151365685</Real>
+      <Real>0.15680000550746923</Real>
+      <Real>0.74639999881982799</Real>
+      <Real>0.096799995672702838</Real>
+      <Real>0.0036125133752946681</Real>
+      <Real>0.57777513060567287</Real>
+      <Real>0.41861235601903246</Real>
+      <Real>0.0072000023603441266</Real>
+      <Real>0.60560001494884452</Real>
+      <Real>0.38719998269081135</Real>
+      <Real>0.017112486657502868</Real>
+      <Real>0.65077495456337409</Real>
+      <Real>0.33211255877912305</Real>
+      <Real>0.20479996223449881</Real>
+      <Real>0.73040001652240405</Real>
+      <Real>0.064800021243097139</Real>
+      <Real>0.03379998977184373</Real>
+      <Real>0.69239998111724699</Real>
+      <Real>0.27380002911090928</Real>
+      <Real>0.34445001088380822</Real>
+      <Real>0.64109999134540541</Real>
+      <Real>0.014449997770786371</Real>
+      <Real>0.41405002386570011</Real>
+      <Real>0.58189997849464348</Real>
+      <Real>0.0040499976396564108</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">39</Int>
+      <Real>-0.2162499688565731</Real>
+      <Real>-0.56750006228685379</Real>
+      <Real>0.7837500311434269</Real>
+      <Real>-0.24500007927417755</Real>
+      <Real>-0.5099998414516449</Real>
+      <Real>0.75499992072582245</Real>
+      <Real>-0.8125</Real>
+      <Real>0.625</Real>
+      <Real>0.1875</Real>
+      <Real>-0.99976444244384766</Real>
+      <Real>0.99952888488769531</Real>
+      <Real>0.00023555755615234375</Real>
+      <Real>-0.60375012457370758</Real>
+      <Real>0.20750024914741516</Real>
+      <Real>0.39624987542629242</Real>
+      <Real>-0.56500010192394257</Real>
+      <Real>0.13000020384788513</Real>
+      <Real>0.43499989807605743</Real>
+      <Real>-0.19999994337558746</Real>
+      <Real>-0.60000011324882507</Real>
+      <Real>0.80000005662441254</Real>
+      <Real>-0.86499987542629242</Real>
+      <Real>0.72999975085258484</Real>
+      <Real>0.13500012457370758</Real>
+      <Real>-0.93374998867511749</Real>
+      <Real>0.86749997735023499</Real>
+      <Real>0.066250011324882507</Real>
+      <Real>-0.74375002831220627</Real>
+      <Real>0.48750005662441254</Real>
+      <Real>0.25624997168779373</Real>
+      <Real>-0.078749954700469971</Real>
+      <Real>-0.84250009059906006</Real>
+      <Real>0.92125004529953003</Real>
+      <Real>-0.54875000566244125</Real>
+      <Real>0.097500011324882507</Real>
+      <Real>0.45124999433755875</Real>
+      <Real>-0.96000006794929504</Real>
+      <Real>0.92000013589859009</Real>
+      <Real>0.039999932050704956</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">39</Int>
+      <Real>-0.40000004558002189</Real>
+      <Real>-0.19999990883995622</Real>
+      <Real>0.59999995441997811</Real>
+      <Real>-0.25000010518466809</Real>
+      <Real>-0.49999978963066383</Real>
+      <Real>0.74999989481533191</Real>
+      <Real>-0.85000025244319488</Real>
+      <Real>0.70000050488638976</Real>
+      <Real>0.14999974755680512</Real>
+      <Real>-0.4000003085416779</Real>
+      <Real>-0.19999938291664421</Real>
+      <Real>0.5999996914583221</Real>
+      <Real>-0.50000003506155366</Real>
+      <Real>7.0123107320796407e-08</Real>
+      <Real>0.49999996493844634</Real>
+      <Real>-0.049999880790714712</Real>
+      <Real>-0.90000023841857058</Real>
+      <Real>0.95000011920928529</Real>
+      <Real>-0.35000009466619986</Real>
+      <Real>-0.29999981066760029</Real>
+      <Real>0.64999990533380014</Real>
+      <Real>-0.39999988780302687</Real>
+      <Real>-0.20000022439394627</Real>
+      <Real>0.60000011219697313</Real>
+      <Real>-1</Real>
+      <Real>1</Real>
+      <Real>0</Real>
+      <Real>-0.50000203357016915</Real>
+      <Real>4.0671403382930293e-06</Real>
+      <Real>0.49999796642983085</Real>
+      <Real>-0.44999999649384392</Real>
+      <Real>-0.10000000701231215</Real>
+      <Real>0.55000000350615608</Real>
+      <Real>-0.74999996493844634</Real>
+      <Real>0.49999992987689268</Real>
+      <Real>0.25000003506155366</Real>
+      <Real>-0.7000000227900145</Real>
+      <Real>0.400000045580029</Real>
+      <Real>0.2999999772099855</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">39</Int>
+      <Real>-0.42000031471252441</Real>
+      <Real>-0.15999937057495117</Real>
+      <Real>0.57999968528747559</Real>
+      <Real>-0.8550000786781311</Real>
+      <Real>0.71000015735626221</Real>
+      <Real>0.1449999213218689</Real>
+      <Real>-0.7300000786781311</Real>
+      <Real>0.46000015735626221</Real>
+      <Real>0.2699999213218689</Real>
+      <Real>-0.45499968528747559</Real>
+      <Real>-0.090000629425048828</Real>
+      <Real>0.54500031471252441</Real>
+      <Real>-0.45000052452087402</Real>
+      <Real>-0.099998950958251953</Real>
+      <Real>0.54999947547912598</Real>
+      <Real>-0.56000000983476639</Real>
+      <Real>0.12000001966953278</Real>
+      <Real>0.43999999016523361</Real>
+      <Real>-0.085000157356262207</Real>
+      <Real>-0.82999968528747559</Real>
+      <Real>0.91499984264373779</Real>
+      <Real>-0.12000001966953278</Real>
+      <Real>-0.75999996066093445</Real>
+      <Real>0.87999998033046722</Real>
+      <Real>-0.18499992787837982</Real>
+      <Real>-0.63000014424324036</Real>
+      <Real>0.81500007212162018</Real>
+      <Real>-0.63999994099140167</Real>
+      <Real>0.27999988198280334</Real>
+      <Real>0.36000005900859833</Real>
+      <Real>-0.25999996066093445</Real>
+      <Real>-0.4800000786781311</Real>
+      <Real>0.74000003933906555</Real>
+      <Real>-0.83000001311302185</Real>
+      <Real>0.6600000262260437</Real>
+      <Real>0.16999998688697815</Real>
+      <Real>-0.9100000262260437</Real>
+      <Real>0.8200000524520874</Real>
+      <Real>0.089999973773956299</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">8</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">2</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">1</Int>
+      <Int Name="Y">8</Int>
+      <Int Name="Z">6</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">7</Int>
+      <Int Name="Z">6</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">16</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">2</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">9</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">0</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">8</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">3</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">7</Int>
+      <Int Name="Z">5</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">2</Int>
+      <Int Name="Z">2</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 4 10">0.00033979852581477555</Real>
+    <Real Name="Cell 0 4 8">0.00017818256489556583</Real>
+    <Real Name="Cell 0 4 9">0.0015022263680871451</Real>
+    <Real Name="Cell 0 5 10">0.0031431356861857176</Real>
+    <Real Name="Cell 0 5 8">0.0016481883699655609</Real>
+    <Real Name="Cell 0 5 9">0.01389559090917796</Real>
+    <Real Name="Cell 0 6 10">0.00076454639268285103</Real>
+    <Real Name="Cell 0 6 8">0.00040091061873570724</Real>
+    <Real Name="Cell 0 6 9">0.0033800080443555183</Real>
+    <Real Name="Cell 0 7 5">0.084015665878839491</Real>
+    <Real Name="Cell 0 7 6">0.17346451942957417</Real>
+    <Real Name="Cell 0 7 7">0.12703198776749894</Real>
+    <Real Name="Cell 0 7 8">0.024522774730782425</Real>
+    <Real Name="Cell 0 8 5">0.20537165214239544</Real>
+    <Real Name="Cell 0 8 6">0.54034620040982984</Real>
+    <Real Name="Cell 0 8 7">1.1510578006413572</Real>
+    <Real Name="Cell 0 8 8">0.22683533523454369</Real>
+    <Real Name="Cell 0 9 5">0.0093350774777616521</Real>
+    <Real Name="Cell 0 9 6">0.055832087480720508</Real>
+    <Real Name="Cell 0 9 7">0.27828266895736808</Real>
+    <Real Name="Cell 0 9 8">0.055176101276372402</Real>
+    <Real Name="Cell 1 10 6">0.0010883693853612156</Real>
+    <Real Name="Cell 1 10 7">0.0028474464087142122</Real>
+    <Real Name="Cell 1 10 8">0.00014888734255858396</Real>
+    <Real Name="Cell 1 4 10">0.0097292827856903189</Real>
+    <Real Name="Cell 1 4 8">0.0051018130734727116</Real>
+    <Real Name="Cell 1 4 9">0.043012503094870161</Real>
+    <Real Name="Cell 1 5 10">0.089995846366223098</Real>
+    <Real Name="Cell 1 5 8">0.047191760755966275</Real>
+    <Real Name="Cell 1 5 9">0.39786556785521332</Real>
+    <Real Name="Cell 1 6 10">0.021890877952912662</Real>
+    <Real Name="Cell 1 6 8">0.011479075055175422</Real>
+    <Real Name="Cell 1 6 9">0.096778095203887429</Real>
+    <Real Name="Cell 1 7 5">0.41718059718172407</Real>
+    <Real Name="Cell 1 7 6">0.79357651466241896</Real>
+    <Real Name="Cell 1 7 7">0.14112497270190399</Real>
+    <Real Name="Cell 1 7 8">0.024545887635769155</Real>
+    <Real Name="Cell 1 8 5">1.0197749144608135</Real>
+    <Real Name="Cell 1 8 6">2.0912342252936194</Real>
+    <Real Name="Cell 1 8 7">1.2777345644176898</Real>
+    <Real Name="Cell 1 8 8">0.23183008622566867</Real>
+    <Real Name="Cell 1 9 5">0.046353417022564243</Real>
+    <Real Name="Cell 1 9 6">0.18547491543672612</Real>
+    <Real Name="Cell 1 9 7">0.43892226002306806</Real>
+    <Real Name="Cell 1 9 8">0.063532735899987328</Real>
+    <Real Name="Cell 16 5 0">8.7594955501962249e-05</Real>
+    <Real Name="Cell 16 5 1">0.00041696984940586026</Real>
+    <Real Name="Cell 16 5 2">5.4076473314515499e-05</Real>
+    <Real Name="Cell 16 6 0">0.038366765938295154</Real>
+    <Real Name="Cell 16 6 1">0.18263362911489175</Real>
+    <Real Name="Cell 16 6 2">0.023685603611956891</Real>
+    <Real Name="Cell 16 7 0">0.031621937657192963</Real>
+    <Real Name="Cell 16 7 1">0.15052687117976654</Real>
+    <Real Name="Cell 16 7 2">0.019521704852446232</Real>
+    <Real Name="Cell 17 5 0">0.00040927936853095821</Real>
+    <Real Name="Cell 17 5 1">0.0019482532490978466</Real>
+    <Real Name="Cell 17 5 2">0.00025266734509671985</Real>
+    <Real Name="Cell 17 6 0">0.1792651830897814</Real>
+    <Real Name="Cell 17 6 1">0.85333882491652924</Real>
+    <Real Name="Cell 17 6 2">0.11066880317507713</Real>
+    <Real Name="Cell 17 7 0">0.14775059364886992</Real>
+    <Real Name="Cell 17 7 1">0.70332295313530524</Real>
+    <Real Name="Cell 17 7 2">0.091213369410045014</Real>
+    <Real Name="Cell 18 5 0">5.1923069018054873e-05</Real>
+    <Real Name="Cell 18 5 1">0.00024716439599839095</Real>
+    <Real Name="Cell 18 5 2">3.2054545151286616e-05</Real>
+    <Real Name="Cell 18 6 0">0.022742408217434739</Real>
+    <Real Name="Cell 18 6 1">0.10825850044912612</Real>
+    <Real Name="Cell 18 6 2">0.014039954972639695</Real>
+    <Real Name="Cell 18 7 0">0.018744321999481783</Real>
+    <Real Name="Cell 18 7 1">0.089226794814272023</Real>
+    <Real Name="Cell 18 7 2">0.011571748882056981</Real>
+    <Real Name="Cell 2 0 1">0.022753288764355752</Real>
+    <Real Name="Cell 2 0 2">0.86529040215781761</Real>
+    <Real Name="Cell 2 0 3">0.44158707635031469</Real>
+    <Real Name="Cell 2 1 1">0.022753288764355752</Real>
+    <Real Name="Cell 2 1 2">0.86529040215781761</Real>
+    <Real Name="Cell 2 1 3">0.44158707635031469</Real>
+    <Real Name="Cell 2 10 6">0.0021509785485837041</Real>
+    <Real Name="Cell 2 10 7">0.0056274976361570823</Real>
+    <Real Name="Cell 2 10 8">0.00029425072434655059</Real>
+    <Real Name="Cell 2 3 2">0.00071647563036925078</Real>
+    <Real Name="Cell 2 3 3">0.0012231120937252554</Real>
+    <Real Name="Cell 2 3 4">2.0606519624561914e-05</Real>
+    <Real Name="Cell 2 4 10">0.010870740615147208</Real>
+    <Real Name="Cell 2 4 2">0.0157624518101704</Real>
+    <Real Name="Cell 2 4 3">0.026910992269419991</Real>
+    <Real Name="Cell 2 4 4">0.00050551465829993657</Real>
+    <Real Name="Cell 2 4 5">2.0630529598032113e-05</Real>
+    <Real Name="Cell 2 4 8">0.022590889607581807</Real>
+    <Real Name="Cell 2 4 9">0.091953470864929776</Real>
+    <Real Name="Cell 2 5 10">0.079730129199632044</Real>
+    <Real Name="Cell 2 5 2">0.0064482734385521989</Real>
+    <Real Name="Cell 2 5 3">0.011026798734413678</Real>
+    <Real Name="Cell 2 5 4">0.00057062638631341807</Real>
+    <Real Name="Cell 2 5 5">0.00015230934427263969</Real>
+    <Real Name="Cell 2 5 8">0.14315096256908022</Real>
+    <Real Name="Cell 2 5 9">0.61584734032591548</Real>
+    <Real Name="Cell 2 6 10">0.016449866071848479</Real>
+    <Real Name="Cell 2 6 3">3.8044669821726105e-06</Real>
+    <Real Name="Cell 2 6 4">7.7935315495623989e-05</Real>
+    <Real Name="Cell 2 6 5">3.0818446322078073e-05</Real>
+    <Real Name="Cell 2 6 8">0.02551618044207965</Real>
+    <Real Name="Cell 2 6 9">0.11661769417980841</Real>
+    <Real Name="Cell 2 7 5">0.056812724572056175</Real>
+    <Real Name="Cell 2 7 6">0.10574143245003807</Real>
+    <Real Name="Cell 2 7 7">0.0023833534014874617</Real>
+    <Real Name="Cell 2 7 8">1.3613453599533678e-09</Real>
+    <Real Name="Cell 2 8 5">0.13887556547966037</Real>
+    <Real Name="Cell 2 8 6">0.32754967899868059</Real>
+    <Real Name="Cell 2 8 7">0.18653193978312091</Real>
+    <Real Name="Cell 2 8 8">0.0094487677124567102</Real>
+    <Real Name="Cell 2 9 5">0.0063125273132716301</Real>
+    <Real Name="Cell 2 9 6">0.13172622800644337</Real>
+    <Real Name="Cell 2 9 7">0.31415511253401474</Real>
+    <Real Name="Cell 2 9 8">0.016412705198223475</Real>
+    <Real Name="Cell 3 0 1">0.029325255333130615</Real>
+    <Real Name="Cell 3 0 2">1.1152173315857687</Real>
+    <Real Name="Cell 3 0 3">0.56913327562870597</Real>
+    <Real Name="Cell 3 1 1">0.029325255333130615</Real>
+    <Real Name="Cell 3 1 2">1.1152173315857687</Real>
+    <Real Name="Cell 3 1 3">0.56913327562870597</Real>
+    <Real Name="Cell 3 10 0">0.010145751826232199</Real>
+    <Real Name="Cell 3 10 1">0.85337020047029799</Real>
+    <Real Name="Cell 3 10 2">0.54561578384185616</Real>
+    <Real Name="Cell 3 10 6">5.7960499812135745e-05</Real>
+    <Real Name="Cell 3 10 7">0.00015163915786052019</Real>
+    <Real Name="Cell 3 10 8">7.9289117338890878e-06</Real>
+    <Real Name="Cell 3 11 0">0.0024678865771531875</Real>
+    <Real Name="Cell 3 11 1">0.2075766191755235</Real>
+    <Real Name="Cell 3 11 2">0.13271740648581237</Real>
+    <Real Name="Cell 3 2 2">0.24260448267074416</Real>
+    <Real Name="Cell 3 2 3">0.34095286828095939</Real>
+    <Real Name="Cell 3 2 4">0.0023730166056101336</Real>
+    <Real Name="Cell 3 3 2">0.71940994058169738</Real>
+    <Real Name="Cell 3 3 3">1.0159824779923214</Real>
+    <Real Name="Cell 3 3 4">0.0073472068525608069</Real>
+    <Real Name="Cell 3 4 10">0.015998248299614531</Real>
+    <Real Name="Cell 3 4 2">0.40433187211438543</Real>
+    <Real Name="Cell 3 4 3">0.68135139693612101</Real>
+    <Real Name="Cell 3 4 4">0.023405432983189891</Real>
+    <Real Name="Cell 3 4 5">0.0038093594277436656</Real>
+    <Real Name="Cell 3 4 8">0.050562339096890584</Real>
+    <Real Name="Cell 3 4 9">0.18032587950135495</Real>
+    <Real Name="Cell 3 5 0">0.0076351676149998314</Real>
+    <Real Name="Cell 3 5 1">0.056368147040608489</Real>
+    <Real Name="Cell 3 5 10">0.095988708996469344</Real>
+    <Real Name="Cell 3 5 2">0.15888080548132233</Real>
+    <Real Name="Cell 3 5 3">0.30371763843954619</Real>
+    <Real Name="Cell 3 5 4">0.11086210523037408</Real>
+    <Real Name="Cell 3 5 5">0.028123419410124081</Real>
+    <Real Name="Cell 3 5 8">0.3033715668651783</Real>
+    <Real Name="Cell 3 5 9">1.0819464761279529</Real>
+    <Real Name="Cell 3 6 0">0.045810999265179453</Real>
+    <Real Name="Cell 3 6 1">0.33820883481113989</Real>
+    <Real Name="Cell 3 6 10">0.015997988033247611</Real>
+    <Real Name="Cell 3 6 2">0.068522407341301245</Real>
+    <Real Name="Cell 3 6 3">0.014934082496857223</Real>
+    <Real Name="Cell 3 6 4">0.024701645567436741</Real>
+    <Real Name="Cell 3 6 5">0.0056905247384739233</Real>
+    <Real Name="Cell 3 6 8">0.05056151652706585</Real>
+    <Real Name="Cell 3 6 9">0.18032294588258366</Real>
+    <Real Name="Cell 3 7 0">0.0076351654733934201</Real>
+    <Real Name="Cell 3 7 1">0.05636813122977221</Real>
+    <Real Name="Cell 3 7 2">0.011405569215818359</Real>
+    <Real Name="Cell 3 8 6">0.0018611834196012062</Real>
+    <Real Name="Cell 3 8 7">0.0048693211288215509</Real>
+    <Real Name="Cell 3 8 8">0.00025460717389303762</Real>
+    <Real Name="Cell 3 9 0">0.0010968374532188702</Real>
+    <Real Name="Cell 3 9 1">0.0922561889318676</Real>
+    <Real Name="Cell 3 9 2">0.058985458843749838</Real>
+    <Real Name="Cell 3 9 6">0.0032329178496899079</Real>
+    <Real Name="Cell 3 9 7">0.008458121336913935</Real>
+    <Real Name="Cell 3 9 8">0.00044225844076897785</Real>
+    <Real Name="Cell 4 0 1">0.00011453939191042932</Real>
+    <Real Name="Cell 4 0 2">0.004355846643336595</Real>
+    <Real Name="Cell 4 0 3">0.0022229364609438027</Real>
+    <Real Name="Cell 4 1 1">0.00011453939191042932</Real>
+    <Real Name="Cell 4 1 2">0.004355846643336595</Real>
+    <Real Name="Cell 4 1 3">0.0022229364609438027</Real>
+    <Real Name="Cell 4 10 0">0.016726649891858267</Real>
+    <Real Name="Cell 4 10 1">1.4068966810823802</Real>
+    <Real Name="Cell 4 10 2">0.89952172575305001</Real>
+    <Real Name="Cell 4 11 0">0.0040686462132976968</Real>
+    <Real Name="Cell 4 11 1">0.34221824997802897</Real>
+    <Real Name="Cell 4 11 2">0.21880267040476464</Real>
+    <Real Name="Cell 4 2 2">0.28345967841462172</Real>
+    <Real Name="Cell 4 2 3">0.398370175742504</Real>
+    <Real Name="Cell 4 2 4">0.0027726384792803398</Real>
+    <Real Name="Cell 4 3 2">0.82825849042288924</Real>
+    <Real Name="Cell 4 3 3">1.166075644183495</Real>
+    <Real Name="Cell 4 3 4">0.0082306813353532505</Real>
+    <Real Name="Cell 4 4 10">0.00076059307614952955</Real>
+    <Real Name="Cell 4 4 2">0.20260276249046691</Real>
+    <Real Name="Cell 4 4 3">0.46522211219696519</Real>
+    <Real Name="Cell 4 4 4">0.11061191382510344</Real>
+    <Real Name="Cell 4 4 5">0.0028233504976611979</Real>
+    <Real Name="Cell 4 4 8">0.0024038484908342275</Real>
+    <Real Name="Cell 4 4 9">0.0085731020565926342</Real>
+    <Real Name="Cell 4 5 0">0.030968285418697873</Real>
+    <Real Name="Cell 4 5 1">0.22862954084299197</Real>
+    <Real Name="Cell 4 5 10">0.0045635213358331071</Real>
+    <Real Name="Cell 4 5 2">0.11760920316189255</Real>
+    <Real Name="Cell 4 5 3">1.7244611989533951</Real>
+    <Real Name="Cell 4 5 4">1.2262834578844777</Real>
+    <Real Name="Cell 4 5 5">0.020843995347149334</Real>
+    <Real Name="Cell 4 5 8">0.014422973624171607</Real>
+    <Real Name="Cell 4 5 9">0.051438193925714422</Real>
+    <Real Name="Cell 4 6 0">0.18580968645308085</Real>
+    <Real Name="Cell 4 6 1">1.3717770526714039</Real>
+    <Real Name="Cell 4 6 10">0.00076058070249505633</Real>
+    <Real Name="Cell 4 6 2">0.2805028021484528</Real>
+    <Real Name="Cell 4 6 3">0.47016370063536744</Real>
+    <Real Name="Cell 4 6 4">0.35093367474363762</Real>
+    <Real Name="Cell 4 6 5">0.0042175977764954617</Real>
+    <Real Name="Cell 4 6 8">0.0024038093839956771</Real>
+    <Real Name="Cell 4 6 9">0.0085729625856903382</Real>
+    <Real Name="Cell 4 7 0">0.030968276732329478</Real>
+    <Real Name="Cell 4 7 1">0.22862947671414563</Real>
+    <Real Name="Cell 4 7 2">0.046261056816129208</Real>
+    <Real Name="Cell 4 9 0">0.0018082855152078731</Real>
+    <Real Name="Cell 4 9 1">0.1520968577834364</Real>
+    <Real Name="Cell 4 9 2">0.0972455403688324</Real>
+    <Real Name="Cell 5 10 0">0.00024712716301057887</Real>
+    <Real Name="Cell 5 10 1">0.020786133965422622</Real>
+    <Real Name="Cell 5 10 2">0.013289944704344794</Real>
+    <Real Name="Cell 5 11 0">6.011203692829193e-05</Real>
+    <Real Name="Cell 5 11 1">0.0050560886844819245</Real>
+    <Real Name="Cell 5 11 2">0.0032326905594280381</Real>
+    <Real Name="Cell 5 2 2">0.00042118684737507846</Real>
+    <Real Name="Cell 5 2 3">0.00059192996812694541</Real>
+    <Real Name="Cell 5 2 4">4.1198059157139e-06</Real>
+    <Real Name="Cell 5 3 2">0.001220582197244095</Real>
+    <Real Name="Cell 5 3 3">0.001715388753503997</Real>
+    <Real Name="Cell 5 3 4">1.1939028457703049e-05</Real>
+    <Real Name="Cell 5 4 2">0.00049015578742989607</Real>
+    <Real Name="Cell 5 4 3">0.066129974627542984</Real>
+    <Real Name="Cell 5 4 4">0.047834785417711266</Real>
+    <Real Name="Cell 5 5 0">0.0032888372766258409</Real>
+    <Real Name="Cell 5 5 1">0.024280496846889963</Real>
+    <Real Name="Cell 5 5 2">0.0098159243010806398</Real>
+    <Real Name="Cell 5 5 3">0.78417040521923786</Real>
+    <Real Name="Cell 5 5 4">0.56815083145775247</Real>
+    <Real Name="Cell 5 6 0">0.019733020892273433</Real>
+    <Real Name="Cell 5 6 1">0.14568296064985509</Real>
+    <Real Name="Cell 5 6 2">0.030901317814393377</Real>
+    <Real Name="Cell 5 6 3">0.22770576410086152</Real>
+    <Real Name="Cell 5 6 4">0.16497845154645666</Real>
+    <Real Name="Cell 5 7 0">0.0032888363541320131</Real>
+    <Real Name="Cell 5 7 1">0.024280490036395375</Real>
+    <Real Name="Cell 5 7 2">0.0049129322484586218</Real>
+    <Real Name="Cell 5 9 0">2.6716435877812135e-05</Real>
+    <Real Name="Cell 5 9 1">0.0022471484254082343</Real>
+    <Real Name="Cell 5 9 2">0.0014367500164200787</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_10.xml b/src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_10.xml
new file mode 100644 (file)
index 0000000..92309fa
--- /dev/null
@@ -0,0 +1,1145 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">65</Int>
+      <Real>0.00021708683077646437</Real>
+      <Real>0.10685313751771594</Real>
+      <Real>0.56622690927004382</Real>
+      <Real>0.31478347546866026</Real>
+      <Real>0.011919390912803422</Real>
+      <Real>0.00555681060650858</Real>
+      <Real>0.24823626950660688</Real>
+      <Real>0.59218767283768492</Real>
+      <Real>0.15299780777998639</Real>
+      <Real>0.0010214392692131807</Real>
+      <Real>0.0055706031003877185</Real>
+      <Real>0.24842522267954437</Real>
+      <Real>0.59213916477497697</Real>
+      <Real>0.15284743306593457</Real>
+      <Real>0.0010175763791563232</Real>
+      <Real>7.9004320672188935e-05</Real>
+      <Real>0.088529908212318653</Real>
+      <Real>0.54771436432265241</Real>
+      <Real>0.34733817457128247</Real>
+      <Real>0.016338548573074076</Real>
+      <Real>0.0012959629629042319</Real>
+      <Real>0.16290908840719873</Real>
+      <Real>0.5949639220172942</Real>
+      <Real>0.23611429987157478</Real>
+      <Real>0.0047167267410280055</Real>
+      <Real>0.0030707289787711557</Real>
+      <Real>0.20766465349097596</Real>
+      <Real>0.59868195490802356</Real>
+      <Real>0.18838975650061909</Real>
+      <Real>0.0021929061216100672</Real>
+      <Real>0.0094664469245116546</Real>
+      <Real>0.292875904454512</Real>
+      <Real>0.57662973675080809</Real>
+      <Real>0.12064508407747568</Real>
+      <Real>0.00038282779269252336</Real>
+      <Real>2.4732795142422786e-06</Real>
+      <Real>0.058324774366595201</Real>
+      <Real>0.49997145574959673</Real>
+      <Real>0.41284792733169456</Real>
+      <Real>0.028853369272599252</Real>
+      <Real>0.0001122461656009853</Real>
+      <Real>0.094134504932700883</Real>
+      <Real>0.55402979196571256</Real>
+      <Real>0.33690993174225514</Real>
+      <Real>0.014813525193730359</Real>
+      <Real>0.0029041821408254892</Real>
+      <Real>0.20429690725194238</Real>
+      <Real>0.59883901780490834</Real>
+      <Real>0.1916318736441007</Real>
+      <Real>0.0023280191582231232</Real>
+      <Real>0.0067521400006586548</Real>
+      <Real>0.26361111244989777</Real>
+      <Real>0.58773820865348103</Real>
+      <Real>0.14115472132129334</Real>
+      <Real>0.00074381757466905163</Real>
+      <Real>4.5824991688022811e-05</Real>
+      <Real>0.08113201123186245</Real>
+      <Real>0.53835170637041108</Real>
+      <Real>0.36182499545693908</Real>
+      <Real>0.018645461949099336</Real>
+      <Real>0.00045614602247217174</Real>
+      <Real>0.12555140868204157</Real>
+      <Real>0.57972350108592152</Real>
+      <Real>0.28554029601040781</Real>
+      <Real>0.0087286481991568354</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">65</Int>
+      <Real>4.0445689790761521e-07</Real>
+      <Real>0.051775860314962917</Real>
+      <Real>0.48537868893172431</Real>
+      <Real>0.42973098647302688</Real>
+      <Real>0.033114059823387824</Real>
+      <Real>0.040349760360540596</Real>
+      <Real>0.45431917497727448</Real>
+      <Real>0.46231551720983821</Real>
+      <Real>0.043015547281948473</Real>
+      <Real>1.7039818940569402e-10</Real>
+      <Real>0.015128431656919935</Real>
+      <Real>0.33912518267111513</Real>
+      <Real>0.55271819213710216</Real>
+      <Real>0.092923758682779953</Real>
+      <Real>0.00010443485208280977</Real>
+      <Real>9.2885392266106725e-06</Real>
+      <Real>0.066031433813125914</Real>
+      <Real>0.51483976179875901</Real>
+      <Real>0.39438014636383906</Real>
+      <Real>0.024739369485049234</Real>
+      <Real>0.013022673519183717</Real>
+      <Real>0.32362472920489493</Real>
+      <Real>0.56155215775990919</Real>
+      <Real>0.1016316085083009</Real>
+      <Real>0.00016883100771119422</Real>
+      <Real>0.0039663616904885837</Real>
+      <Real>0.22407360111788807</Real>
+      <Real>0.59703848434694429</Real>
+      <Real>0.17329435021010889</Real>
+      <Real>0.001627202634570212</Real>
+      <Real>0.0033463234311831495</Real>
+      <Real>0.21299812095041259</Real>
+      <Real>0.59830465286561263</Real>
+      <Real>0.18335801078383104</Real>
+      <Real>0.0019928919689605092</Real>
+      <Real>0.0011600005621822387</Real>
+      <Real>0.15817872363342664</Real>
+      <Real>0.5937405609424351</Real>
+      <Real>0.24181947217421018</Real>
+      <Real>0.005101242687745782</Real>
+      <Real>2.6188756138822681e-05</Real>
+      <Real>0.074880580528960364</Real>
+      <Real>0.52940638875946033</Real>
+      <Real>0.37477740365364631</Real>
+      <Real>0.020909438301794151</Real>
+      <Real>0.00012302926676329543</Real>
+      <Real>0.095721497307896308</Real>
+      <Real>0.55570684053130115</Real>
+      <Real>0.33403649747337788</Real>
+      <Real>0.014412135420661361</Real>
+      <Real>0.0080438175486878816</Real>
+      <Real>0.27835174040155514</Real>
+      <Real>0.58255814246999404</Real>
+      <Real>0.13050795912816038</Real>
+      <Real>0.0005383404516025815</Real>
+      <Real>7.6674538268946279e-05</Real>
+      <Real>0.08808460996980419</Real>
+      <Real>0.54718509906177959</Real>
+      <Real>0.34818620507411202</Real>
+      <Real>0.016467411356035154</Real>
+      <Real>0.020350910822734453</Real>
+      <Real>0.37168637272872385</Real>
+      <Real>0.53159022896744179</Real>
+      <Real>0.076342335409551182</Real>
+      <Real>3.015207154867334e-05</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">65</Int>
+      <Real>8.0781071366164143e-05</Real>
+      <Real>0.088863912709195345</Real>
+      <Real>0.54810860714010579</Real>
+      <Real>0.34670402655589716</Real>
+      <Real>0.016242672523435472</Real>
+      <Real>0.0038814058076428711</Real>
+      <Real>0.22262305120967962</Real>
+      <Real>0.59724025827145955</Real>
+      <Real>0.1745837324097608</Real>
+      <Real>0.0016715523014573224</Real>
+      <Real>0.009543753462321709</Real>
+      <Real>0.29362203367646711</Real>
+      <Real>0.57630387159140495</Real>
+      <Real>0.1201544165903765</Real>
+      <Real>0.00037592467942967011</Real>
+      <Real>0.0067501440370550166</Real>
+      <Real>0.26358696701753564</Real>
+      <Real>0.5877459756955512</Real>
+      <Real>0.14117271390405697</Real>
+      <Real>0.00074419934580130292</Real>
+      <Real>0.00031590729140079595</Real>
+      <Real>0.11563401680596481</Real>
+      <Real>0.5731545365365911</Real>
+      <Real>0.30060725043776265</Real>
+      <Real>0.010288288928280482</Real>
+      <Real>0.028347089724108751</Real>
+      <Real>0.41069974749995353</Real>
+      <Real>0.50175891727755573</Real>
+      <Real>0.059191285976777946</Real>
+      <Real>2.9595216040380113e-06</Real>
+      <Real>0.00098188613037316231</Real>
+      <Real>0.15144140556262448</Real>
+      <Real>0.59167601560811955</Real>
+      <Real>0.25019950958578069</Real>
+      <Real>0.0057011831131020489</Real>
+      <Real>0.01850916350611969</Real>
+      <Real>0.36100761805514159</Real>
+      <Real>0.53889806957339226</Real>
+      <Real>0.081537796519681793</Real>
+      <Real>4.735234566460818e-05</Real>
+      <Real>0.006209064902512571</Real>
+      <Real>0.25686322541125284</Real>
+      <Real>0.58981468383641034</Real>
+      <Real>0.14625615092505842</Real>
+      <Real>0.00085687492476571407</Real>
+      <Real>0.0038355399988331635</Real>
+      <Real>0.22183168789484034</Real>
+      <Real>0.5973458516518555</Real>
+      <Real>0.17529074144732165</Real>
+      <Real>0.0016961790071493039</Real>
+      <Real>9.7026072122114408e-05</Real>
+      <Real>0.091721283461048936</Real>
+      <Real>0.55138735537598849</Real>
+      <Real>0.34134544531642963</Real>
+      <Real>0.015448889774410696</Real>
+      <Real>0.03002027414372372</Real>
+      <Real>0.41767831776931053</Real>
+      <Real>0.49589560078901784</Real>
+      <Real>0.056404209820706527</Real>
+      <Real>1.59747724137161e-06</Real>
+      <Real>0.004214083962815713</Real>
+      <Real>0.22819550614322012</Real>
+      <Real>0.59640775379533539</Real>
+      <Real>0.16967606301236299</Real>
+      <Real>0.001506593086265755</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">65</Int>
+      <Real>-0.0032320813985638091</Real>
+      <Real>-0.32416132360442773</Real>
+      <Real>-0.27678859468033556</Real>
+      <Real>0.5389894857682096</Real>
+      <Real>0.065192513915117434</Real>
+      <Real>-0.036781240901433088</Real>
+      <Real>-0.50429111252355241</Real>
+      <Real>0.12925157857804453</Real>
+      <Real>0.40149514402030057</Real>
+      <Real>0.010325630826640411</Real>
+      <Real>-0.036849690391817888</Real>
+      <Real>-0.50443110165396199</Real>
+      <Real>0.12970760425672057</Real>
+      <Real>0.40127685801571628</Real>
+      <Real>0.010296329773342997</Real>
+      <Real>-0.0015144164319307073</Real>
+      <Real>-0.28671745992113595</Real>
+      <Real>-0.33943376678124004</Real>
+      <Real>0.54507757905361098</Real>
+      <Real>0.082588064080695744</Real>
+      <Real>-0.012343878077116547</Real>
+      <Real>-0.41544815555149472</Real>
+      <Real>-0.099545525862192785</Real>
+      <Real>0.49481103068733606</Real>
+      <Real>0.032526528803468034</Real>
+      <Real>-0.023574272347497677</Real>
+      <Real>-0.46862126184458164</Real>
+      <Real>0.026278876914052063</Real>
+      <Real>0.44760312109563155</Real>
+      <Real>0.018313536182395652</Real>
+      <Real>-0.054846312535409794</Real>
+      <Real>-0.5308051855327709</Real>
+      <Real>0.2310953731700971</Real>
+      <Real>0.34961006039975789</Real>
+      <Real>0.0049460644983257609</Real>
+      <Real>-0.00011270990432847568</Real>
+      <Real>-0.21395558471812193</Real>
+      <Real>-0.44523204146839401</Real>
+      <Real>0.53278167670846766</Real>
+      <Real>0.12651865938237672</Real>
+      <Real>-0.0019707694277898893</Real>
+      <Real>-0.29864603181250143</Real>
+      <Real>-0.32005930312994324</Real>
+      <Real>0.54393977940855043</Real>
+      <Real>0.07673632496168413</Real>
+      <Real>-0.022608672803415615</Real>
+      <Real>-0.46514479473883608</Real>
+      <Real>0.01726906146395546</Real>
+      <Real>0.45133095250225974</Real>
+      <Real>0.01915345357603648</Real>
+      <Real>-0.042568491442497081</Real>
+      <Real>-0.51490723558017959</Real>
+      <Real>0.1656596194149379</Real>
+      <Real>0.38367643368065152</Real>
+      <Real>0.0081396739270872612</Real>
+      <Real>-0.0010065468105848374</Real>
+      <Real>-0.2702759651770702</Real>
+      <Real>-0.36524056546538103</Real>
+      <Real>0.54533521370431204</Real>
+      <Real>0.091187863748724007</Real>
+      <Real>-0.0056407272445787252</Real>
+      <Real>-0.35815197346276556</Real>
+      <Real>-0.21516582446249533</Real>
+      <Real>0.52735047829160231</Real>
+      <Real>0.051608046878237321</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">65</Int>
+      <Real>-2.8984203206300032e-05</Real>
+      <Real>-0.19601731158403063</Real>
+      <Real>-0.46759172313762626</Real>
+      <Real>0.52335131784016975</Real>
+      <Real>0.14028670108469343</Real>
+      <Real>-0.16270013029218783</Real>
+      <Real>-0.50390284243168182</Real>
+      <Real>0.49590616097256179</Real>
+      <Real>0.17069672651867335</Real>
+      <Real>8.5232634550106489e-08</Real>
+      <Real>-0.07795655011881443</Real>
+      <Real>-0.54424675415103807</Real>
+      <Real>0.3242301455679914</Real>
+      <Real>0.29610617179238913</Real>
+      <Real>0.0018669869094719406</Real>
+      <Real>-0.00030406591916461119</Real>
+      <Real>-0.23401130135135068</Real>
+      <Real>-0.41833282598860178</Real>
+      <Real>0.53991581970791414</Real>
+      <Real>0.11273237355120293</Real>
+      <Real>-0.069667831943294664</Real>
+      <Real>-0.54137398919008151</Real>
+      <Real>0.29442815351047347</Real>
+      <Real>0.31393698832247624</Real>
+      <Real>0.0026766793004264337</Real>
+      <Real>-0.028562841964611067</Real>
+      <Real>-0.48441063880862106</Real>
+      <Real>0.069151399193913665</Real>
+      <Real>0.42918048589648011</Real>
+      <Real>0.014641595682838331</Real>
+      <Real>-0.025143927553512784</Real>
+      <Real>-0.47396109287771809</Real>
+      <Real>0.040399870863204346</Real>
+      <Real>0.44165924712079685</Real>
+      <Real>0.017045902447229689</Real>
+      <Real>-0.011359280676947803</Real>
+      <Real>-0.40889456223730591</Real>
+      <Real>-0.11363739643448467</Real>
+      <Real>0.49939560228867841</Real>
+      <Real>0.034495637060059994</Real>
+      <Real>-0.00066159670659626552</Real>
+      <Real>-0.25572387049812095</Real>
+      <Real>-0.38719548605006293</Real>
+      <Real>0.54420897042087379</Real>
+      <Real>0.099371982833906358</Real>
+      <Real>-0.002111122856071995</Real>
+      <Real>-0.30194495620125406</Real>
+      <Real>-0.31460518178652813</Real>
+      <Real>0.54348972360110648</Real>
+      <Real>0.075171537242747735</Real>
+      <Real>-0.048540454602101754</Real>
+      <Real>-0.52362041615793031</Real>
+      <Real>0.1992492406188362</Real>
+      <Real>0.36652458564452561</Real>
+      <Real>0.006387044496670261</Real>
+      <Real>-0.0014807971091969363</Real>
+      <Real>-0.28575065546727157</Real>
+      <Real>-0.34098018220316317</Real>
+      <Real>0.54513551924492898</Real>
+      <Real>0.083076115534702732</Real>
+      <Real>-0.097374461581833008</Real>
+      <Real>-0.54459752168524922</Real>
+      <Real>0.38205377972520166</Real>
+      <Real>0.25918285193267654</Real>
+      <Real>0.00073535160920408949</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">65</Int>
+      <Real>-0.0015398888964354171</Real>
+      <Real>-0.28744075781890077</Real>
+      <Real>-0.33827449641384477</Real>
+      <Real>0.54503082187013352</Real>
+      <Real>0.082224321259047425</Real>
+      <Real>-0.028102759671169996</Real>
+      <Real>-0.48309062848886392</Real>
+      <Real>0.065429417681321655</Real>
+      <Real>0.43082408878862832</Real>
+      <Real>0.014939881690083917</Real>
+      <Real>-0.055181892379010555</Real>
+      <Real>-0.53113661988609029</Real>
+      <Real>0.23269793928045979</Real>
+      <Real>0.34874155061339374</Real>
+      <Real>0.0048790223712473569</Real>
+      <Real>-0.042559053512507009</Real>
+      <Real>-0.51489178900580035</Real>
+      <Real>0.16560354559645685</Real>
+      <Real>0.38370448987451528</Real>
+      <Real>0.0081428070473352349</Real>
+      <Real>-0.0042822983182703679</Real>
+      <Real>-0.34061516921592089</Real>
+      <Real>-0.24754270553705771</Real>
+      <Real>0.53406011199495973</Real>
+      <Real>0.058380061076289277</Real>
+      <Real>-0.12484999797808245</Real>
+      <Real>-0.53377567857897978</Real>
+      <Real>0.44223030167724925</Real>
+      <Real>0.21626642429477083</Real>
+      <Real>0.00012895058504219708</Real>
+      <Real>-0.010024276215463116</Real>
+      <Real>-0.3992261265440199</Real>
+      <Real>-0.13397926508654767</Real>
+      <Real>0.5057340146670074</Real>
+      <Real>0.037495653179023217</Real>
+      <Real>-0.090687467643976075</Real>
+      <Real>-0.54536264560477932</Real>
+      <Real>0.36381929882182451</Real>
+      <Real>0.27119920974659328</Real>
+      <Real>0.0010316046803375766</Real>
+      <Real>-0.03997392842591032</Real>
+      <Real>-0.51044064189409244</Real>
+      <Real>0.14985404179605111</Real>
+      <Real>0.39150955579381641</Real>
+      <Real>0.0090509727301352396</Real>
+      <Real>-0.027853326369114029</Real>
+      <Real>-0.48236434897080954</Real>
+      <Real>0.063393336696226488</Real>
+      <Real>0.43171967899643182</Real>
+      <Real>0.01510465964726525</Real>
+      <Real>-0.0017667435669507293</Real>
+      <Real>-0.29356366588737742</Real>
+      <Real>-0.32838065167620528</Real>
+      <Real>0.54451927528234589</Real>
+      <Real>0.079191785848187535</Real>
+      <Real>-0.13033713529174909</Real>
+      <Real>-0.53038126048484435</Real>
+      <Real>0.45185513192345894</Real>
+      <Real>0.20878205877461156</Real>
+      <Real>8.120507852295045e-05</Real>
+      <Real>-0.02989059562152363</Real>
+      <Real>-0.48808251440715034</Real>
+      <Real>0.079656692066635837</Real>
+      <Real>0.42449654157427391</Real>
+      <Real>0.013819876387764206</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Int Name="X">15</Int>
+      <Int Name="Y">1</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">2</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">1</Int>
+      <Int Name="Z">4</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">13</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">2</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">7</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">1</Int>
+      <Int Name="Y">11</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">10</Int>
+      <Int Name="Z">13</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">2</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">15</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">1</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 1 1">3.7704475772332836e-12</Real>
+    <Real Name="Cell 0 1 2">4.1477133035177474e-09</Real>
+    <Real Name="Cell 0 1 3">2.5582908655476696e-08</Real>
+    <Real Name="Cell 0 1 4">3.3829757874947194e-08</Real>
+    <Real Name="Cell 0 1 5">6.4603687662248064e-06</Real>
+    <Real Name="Cell 0 1 6">3.2017871951316145e-05</Real>
+    <Real Name="Cell 0 1 7">1.6792686507051745e-05</Real>
+    <Real Name="Cell 0 1 8">5.7473001870377429e-07</Real>
+    <Real Name="Cell 0 2 1">4.8266741918272822e-07</Real>
+    <Real Name="Cell 0 2 2">0.00053096244801467359</Real>
+    <Real Name="Cell 0 2 3">0.0032749524407888154</Real>
+    <Real Name="Cell 0 2 4">0.0020719973337249863</Real>
+    <Real Name="Cell 0 2 5">0.00025757699814518356</Real>
+    <Real Name="Cell 0 2 6">0.00079567188140728133</Real>
+    <Real Name="Cell 0 2 7">0.00041731282101649115</Real>
+    <Real Name="Cell 0 2 8">1.4282539326117711e-05</Real>
+    <Real Name="Cell 0 3 0">5.9308385507673237e-05</Real>
+    <Real Name="Cell 0 3 1">0.00086487526256287279</Real>
+    <Real Name="Cell 0 3 2">0.0060423246113045946</Real>
+    <Real Name="Cell 0 3 3">0.03084302397776225</Real>
+    <Real Name="Cell 0 3 4">0.019422851526003437</Real>
+    <Real Name="Cell 0 3 5">0.0011883525860937917</Real>
+    <Real Name="Cell 0 3 6">0.0013806462286454566</Real>
+    <Real Name="Cell 0 3 7">0.00072411930842997173</Real>
+    <Real Name="Cell 0 3 8">2.4782997259131731e-05</Real>
+    <Real Name="Cell 0 4 0">0.0033505374835231649</Real>
+    <Real Name="Cell 0 4 1">0.049784065033905686</Real>
+    <Real Name="Cell 0 4 2">0.080933655815938046</Real>
+    <Real Name="Cell 0 4 3">0.054644122832690413</Real>
+    <Real Name="Cell 0 4 4">0.019527025676968034</Real>
+    <Real Name="Cell 0 4 5">0.0008560121097811158</Real>
+    <Real Name="Cell 0 4 6">0.00024987402338172405</Real>
+    <Real Name="Cell 0 4 7">0.00013105356118873863</Real>
+    <Real Name="Cell 0 4 8">4.4853106524421048e-06</Real>
+    <Real Name="Cell 0 5 0">0.0089274230026671394</Real>
+    <Real Name="Cell 0 5 1">0.13703939232835463</Real>
+    <Real Name="Cell 0 5 2">0.26577483197529306</Real>
+    <Real Name="Cell 0 5 3">0.14873924017072424</Real>
+    <Real Name="Cell 0 5 4">0.015998679751913502</Real>
+    <Real Name="Cell 0 5 5">6.3343314471152033e-05</Real>
+    <Real Name="Cell 0 5 6">4.1509215280147159e-07</Real>
+    <Real Name="Cell 0 5 7">2.1770692331242828e-07</Real>
+    <Real Name="Cell 0 5 8">7.4510236378646352e-09</Real>
+    <Real Name="Cell 0 6 0">0.0025912432931190481</Real>
+    <Real Name="Cell 0 6 1">0.042459640802408681</Real>
+    <Real Name="Cell 0 6 2">0.11482320272947122</Real>
+    <Real Name="Cell 0 6 3">0.088052030731030725</Real>
+    <Real Name="Cell 0 6 4">0.0095850018575592954</Real>
+    <Real Name="Cell 0 6 5">1.5331411773910054e-06</Real>
+    <Real Name="Cell 0 7 0">2.4331306290502165e-05</Real>
+    <Real Name="Cell 0 7 1">0.00058897507594114025</Real>
+    <Real Name="Cell 0 7 2">0.0038121348078564952</Real>
+    <Real Name="Cell 0 7 3">0.0041951495960878982</Real>
+    <Real Name="Cell 0 7 4">0.00050248095884609619</Real>
+    <Real Name="Cell 0 7 5">2.2634706839362255e-07</Real>
+    <Real Name="Cell 0 8 1">6.1074452018871705e-09</Real>
+    <Real Name="Cell 0 8 2">1.879009645235996e-07</Real>
+    <Real Name="Cell 0 8 3">3.6880084227612454e-07</Real>
+    <Real Name="Cell 0 8 4">7.6891813895612386e-08</Real>
+    <Real Name="Cell 0 8 5">2.4056985427358033e-10</Real>
+    <Real Name="Cell 1 0 0">3.1834405547852001e-07</Real>
+    <Real Name="Cell 1 0 1">1.3169596737122512e-05</Real>
+    <Real Name="Cell 1 0 2">3.0240302103668306e-05</Real>
+    <Real Name="Cell 1 0 3">7.4986776519795489e-06</Real>
+    <Real Name="Cell 1 0 4">4.3932708527073875e-08</Real>
+    <Real Name="Cell 1 1 0">2.2506953819454378e-06</Real>
+    <Real Name="Cell 1 1 1">9.3109189283570784e-05</Real>
+    <Real Name="Cell 1 1 2">0.00021382119147760439</Real>
+    <Real Name="Cell 1 1 3">5.3151286276529188e-05</Real>
+    <Real Name="Cell 1 1 4">2.6147223784414513e-06</Real>
+    <Real Name="Cell 1 1 5">0.00081200969282870764</Real>
+    <Real Name="Cell 1 1 6">0.0040248081786522305</Real>
+    <Real Name="Cell 1 1 7">0.0021109254886737261</Real>
+    <Real Name="Cell 1 1 8">7.2246465452580259e-05</Real>
+    <Real Name="Cell 1 11 0">1.1133774308742727e-10</Real>
+    <Real Name="Cell 1 11 1">4.6059386153095683e-09</Real>
+    <Real Name="Cell 1 11 2">1.0576252103854932e-08</Real>
+    <Real Name="Cell 1 11 3">2.6225897155722595e-09</Real>
+    <Real Name="Cell 1 11 4">1.5365038331781313e-11</Real>
+    <Real Name="Cell 1 2 0">1.5933124147544389e-06</Real>
+    <Real Name="Cell 1 2 1">6.847155838658876e-05</Real>
+    <Real Name="Cell 1 2 2">0.002964983056401943</Real>
+    <Real Name="Cell 1 2 3">0.017391875758012421</Real>
+    <Real Name="Cell 1 2 4">0.011032773402513961</Real>
+    <Real Name="Cell 1 2 5">0.020693324497262969</Real>
+    <Real Name="Cell 1 2 6">0.10001997324122575</Real>
+    <Real Name="Cell 1 2 7">0.05245832882452281</Real>
+    <Real Name="Cell 1 2 8">0.0017953873130321419</Real>
+    <Real Name="Cell 1 3 0">7.7925862541051509e-07</Real>
+    <Real Name="Cell 1 3 1">4.4794798301202857e-05</Real>
+    <Real Name="Cell 1 3 2">0.026496668647201942</Real>
+    <Real Name="Cell 1 3 3">0.16281171882666379</Real>
+    <Real Name="Cell 1 3 4">0.1030182021058587</Real>
+    <Real Name="Cell 1 3 5">0.039835757980574718</Real>
+    <Real Name="Cell 1 3 6">0.17355420251935791</Real>
+    <Real Name="Cell 1 3 7">0.091025453512976043</Real>
+    <Real Name="Cell 1 3 8">0.0031153478973161095</Real>
+    <Real Name="Cell 1 4 0">3.9001134110377136e-05</Real>
+    <Real Name="Cell 1 4 1">0.0088255421886861748</Real>
+    <Real Name="Cell 1 4 2">0.13934239827875922</Real>
+    <Real Name="Cell 1 4 3">0.28195206608718143</Real>
+    <Real Name="Cell 1 4 4">0.10703120678706325</Real>
+    <Real Name="Cell 1 4 5">0.010607481556243276</Real>
+    <Real Name="Cell 1 4 6">0.031410426478957823</Real>
+    <Real Name="Cell 1 4 7">0.016474094396903022</Real>
+    <Real Name="Cell 1 4 8">0.00056382619760595549</Real>
+    <Real Name="Cell 1 5 0">0.00010391754263288176</Real>
+    <Real Name="Cell 1 5 1">0.053329144205845461</Real>
+    <Real Name="Cell 1 5 2">0.73955327542646399</Real>
+    <Real Name="Cell 1 5 3">0.90614399566507098</Real>
+    <Real Name="Cell 1 5 4">0.11386071510771985</Real>
+    <Real Name="Cell 1 5 5">0.00037699078141340778</Real>
+    <Real Name="Cell 1 5 6">5.2179179616621858e-05</Real>
+    <Real Name="Cell 1 5 7">2.7366859572347577e-05</Real>
+    <Real Name="Cell 1 5 8">9.3663129525308548e-07</Real>
+    <Real Name="Cell 1 6 0">3.0162750807754859e-05</Real>
+    <Real Name="Cell 1 6 1">0.034291164685054908</Real>
+    <Real Name="Cell 1 6 2">0.49584680636659995</Real>
+    <Real Name="Cell 1 6 3">0.62252280037563723</Real>
+    <Real Name="Cell 1 6 4">0.079047345328780008</Real>
+    <Real Name="Cell 1 6 5">5.8504469572490606e-05</Real>
+    <Real Name="Cell 1 7 0">2.8322277974299722e-07</Real>
+    <Real Name="Cell 1 7 1">0.0017794006626936547</Real>
+    <Real Name="Cell 1 7 2">0.028789258332702738</Real>
+    <Real Name="Cell 1 7 3">0.039957074289487533</Real>
+    <Real Name="Cell 1 7 4">0.005931307709881122</Real>
+    <Real Name="Cell 1 7 5">9.6274538062489295e-06</Real>
+    <Real Name="Cell 1 8 1">2.7236609877597162e-07</Real>
+    <Real Name="Cell 1 8 2">8.3795844206217942e-06</Real>
+    <Real Name="Cell 1 8 3">1.6446950126544283e-05</Real>
+    <Real Name="Cell 1 8 4">3.4290481021564943e-06</Real>
+    <Real Name="Cell 1 8 5">1.072839305563524e-08</Real>
+    <Real Name="Cell 13 3 0">9.6671911172593367e-07</Real>
+    <Real Name="Cell 13 3 1">1.4006069016374246e-05</Real>
+    <Real Name="Cell 13 3 2">1.7111454457301455e-05</Real>
+    <Real Name="Cell 13 3 3">2.0185968985987524e-06</Real>
+    <Real Name="Cell 13 3 4">1.009283889116871e-10</Real>
+    <Real Name="Cell 13 4 0">5.4613333209970765e-05</Real>
+    <Real Name="Cell 13 4 1">0.00079125167266781986</Real>
+    <Real Name="Cell 13 4 2">0.00096668572354528944</Real>
+    <Real Name="Cell 13 4 3">0.00011403757689549133</Real>
+    <Real Name="Cell 13 4 4">5.7017965892270016e-09</Real>
+    <Real Name="Cell 13 5 0">0.00014551585515716774</Real>
+    <Real Name="Cell 13 5 1">0.00210827021581199</Real>
+    <Real Name="Cell 13 5 2">0.0025757098397399493</Real>
+    <Real Name="Cell 13 5 3">0.00030385026048857015</Real>
+    <Real Name="Cell 13 5 4">1.5192293856587216e-08</Real>
+    <Real Name="Cell 13 6 0">4.2236934847362106e-05</Real>
+    <Real Name="Cell 13 6 1">0.00061193930826099977</Real>
+    <Real Name="Cell 13 6 2">0.00074761673612338999</Real>
+    <Real Name="Cell 13 6 3">8.8194538263534265e-05</Real>
+    <Real Name="Cell 13 6 4">4.4096632982680613e-09</Real>
+    <Real Name="Cell 13 7 0">3.9659718609677362e-07</Real>
+    <Real Name="Cell 13 7 1">5.7459995285021488e-06</Real>
+    <Real Name="Cell 13 7 2">7.0199860595212811e-06</Real>
+    <Real Name="Cell 13 7 3">8.2813077773815883e-07</Real>
+    <Real Name="Cell 13 7 4">4.1405941554410773e-11</Real>
+    <Real Name="Cell 14 3 0">6.5376459709579301e-05</Real>
+    <Real Name="Cell 14 3 1">0.00094719054959386271</Real>
+    <Real Name="Cell 14 3 2">0.0011571989208973236</Real>
+    <Real Name="Cell 14 3 3">0.00013651195803454481</Real>
+    <Real Name="Cell 14 3 4">6.8254994353606008e-09</Real>
+    <Real Name="Cell 14 4 0">0.0036933441522977819</Real>
+    <Real Name="Cell 14 4 1">0.053510096646325826</Real>
+    <Real Name="Cell 14 4 2">0.065374201762032624</Real>
+    <Real Name="Cell 14 4 3">0.0077120364755959752</Real>
+    <Real Name="Cell 14 4 4">3.8559626107143182e-07</Real>
+    <Real Name="Cell 14 5 0">0.0098408227647459531</Real>
+    <Real Name="Cell 14 5 1">0.14257630903237381</Real>
+    <Real Name="Cell 14 5 2">0.1741879192402527</Real>
+    <Real Name="Cell 14 5 3">0.020548527562583081</Real>
+    <Real Name="Cell 14 5 4">1.0274115564323738e-06</Real>
+    <Real Name="Cell 14 6 0">0.0028563635867038988</Real>
+    <Real Name="Cell 14 6 1">0.041383712234474755</Real>
+    <Real Name="Cell 14 6 2">0.050559190187226349</Real>
+    <Real Name="Cell 14 6 3">0.0059643453899414839</Real>
+    <Real Name="Cell 14 6 4">2.9821296740201686e-07</Real>
+    <Real Name="Cell 14 7 0">2.6820737940617965e-05</Real>
+    <Real Name="Cell 14 7 1">0.00038858557993718518</Real>
+    <Real Name="Cell 14 7 2">0.000474741659925114</Real>
+    <Real Name="Cell 14 7 3">5.6004125467636519e-05</Real>
+    <Real Name="Cell 14 7 4">2.8001658774866164e-09</Real>
+    <Real Name="Cell 15 1 1">7.6601823228135412e-15</Real>
+    <Real Name="Cell 15 1 2">8.4266494830885169e-12</Real>
+    <Real Name="Cell 15 1 3">5.1975194094234499e-11</Real>
+    <Real Name="Cell 15 1 4">3.2876712459450888e-11</Real>
+    <Real Name="Cell 15 1 5">1.5402349936074849e-12</Real>
+    <Real Name="Cell 15 2 1">9.8060518187462104e-10</Real>
+    <Real Name="Cell 15 2 2">1.0787231688139069e-06</Real>
+    <Real Name="Cell 15 2 3">6.6535158707587536e-06</Real>
+    <Real Name="Cell 15 2 4">4.2086563011333431e-06</Real>
+    <Real Name="Cell 15 2 5">1.9717055709470061e-07</Real>
+    <Real Name="Cell 15 3 0">0.00018847553517622293</Real>
+    <Real Name="Cell 15 3 1">0.0027306906377961228</Real>
+    <Real Name="Cell 15 3 2">0.0033462406249134642</Real>
+    <Real Name="Cell 15 3 3">0.00045593813310929726</Real>
+    <Real Name="Cell 15 3 4">3.9475345922646997e-05</Real>
+    <Real Name="Cell 15 3 5">1.848397836179248e-06</Real>
+    <Real Name="Cell 15 4 0">0.01064764012591983</Real>
+    <Real Name="Cell 15 4 1">0.15426638748479837</Real>
+    <Real Name="Cell 15 4 2">0.18848768996618698</Real>
+    <Real Name="Cell 15 4 3">0.02229998784533575</Real>
+    <Real Name="Cell 15 4 4">3.7354193397897755e-05</Real>
+    <Real Name="Cell 15 4 5">1.6365198090804252e-06</Real>
+    <Real Name="Cell 15 5 0">0.028370369784463605</Real>
+    <Real Name="Cell 15 5 1">0.41104137132755258</Real>
+    <Real Name="Cell 15 5 2">0.50223200245331323</Real>
+    <Real Name="Cell 15 5 3">0.059315774696959159</Real>
+    <Real Name="Cell 15 5 4">1.3800156742702871e-05</Real>
+    <Real Name="Cell 15 5 5">1.2633423271277674e-07</Real>
+    <Real Name="Cell 15 6 0">0.0082346865837247263</Real>
+    <Real Name="Cell 15 6 1">0.11930896409852028</Real>
+    <Real Name="Cell 15 6 2">0.14579682111395517</Real>
+    <Real Name="Cell 15 6 3">0.017240345022343992</Real>
+    <Real Name="Cell 15 6 4">6.0435229746471657e-06</Real>
+    <Real Name="Cell 15 6 5">1.4681523879443191e-10</Real>
+    <Real Name="Cell 15 7 0">7.7322219031669351e-05</Real>
+    <Real Name="Cell 15 7 1">0.001120394193835168</Real>
+    <Real Name="Cell 15 7 2">0.0013704608458003386</Real>
+    <Real Name="Cell 15 7 3">0.00016361124598818271</Real>
+    <Real Name="Cell 15 7 4">2.5323952396839405e-07</Real>
+    <Real Name="Cell 15 7 5">6.9436034378439443e-12</Real>
+    <Real Name="Cell 2 0 0">0.0012908810309318257</Real>
+    <Real Name="Cell 2 0 1">0.013801752046572177</Real>
+    <Real Name="Cell 2 0 13">1.7703621935103908e-05</Real>
+    <Real Name="Cell 2 0 2">0.026169915314852705</Real>
+    <Real Name="Cell 2 0 3">0.0062965454712082414</Real>
+    <Real Name="Cell 2 0 4">3.6843875649614558e-05</Real>
+    <Real Name="Cell 2 1 0">0.0025032045215755533</Real>
+    <Real Name="Cell 2 1 1">0.079753716118418819</Real>
+    <Real Name="Cell 2 1 13">1.0641682686758067e-05</Real>
+    <Real Name="Cell 2 1 2">0.17981638582869913</Real>
+    <Real Name="Cell 2 1 3">0.044474238980637716</Real>
+    <Real Name="Cell 2 1 4">0.00026870853789524239</Real>
+    <Real Name="Cell 2 1 5">0.0029655463051386222</Real>
+    <Real Name="Cell 2 1 6">0.014699091884626855</Real>
+    <Real Name="Cell 2 1 7">0.0077093581463567743</Real>
+    <Real Name="Cell 2 1 8">0.00026385293084516882</Real>
+    <Real Name="Cell 2 10 0">2.8303130614497391e-07</Real>
+    <Real Name="Cell 2 10 1">1.7094159110736354e-06</Real>
+    <Real Name="Cell 2 10 13">3.9194472100577706e-09</Real>
+    <Real Name="Cell 2 10 2">1.8196732584500806e-06</Real>
+    <Real Name="Cell 2 10 3">2.4995583653365001e-07</Real>
+    <Real Name="Cell 2 10 4">1.4415302549321039e-10</Real>
+    <Real Name="Cell 2 11 0">0.00017646383836175032</Real>
+    <Real Name="Cell 2 11 1">0.00047881111138060319</Real>
+    <Real Name="Cell 2 11 13">3.0494805458591623e-06</Real>
+    <Real Name="Cell 2 11 2">0.00014827079101254026</Real>
+    <Real Name="Cell 2 11 3">3.5532162123108468e-06</Real>
+    <Real Name="Cell 2 11 4">1.288882879193024e-08</Real>
+    <Real Name="Cell 2 2 0">0.0013683038824244772</Real>
+    <Real Name="Cell 2 2 1">0.055657457193022675</Real>
+    <Real Name="Cell 2 2 13">4.5913956452464588e-07</Real>
+    <Real Name="Cell 2 2 2">0.12932801231006824</Real>
+    <Real Name="Cell 2 2 3">0.041358631561558841</Real>
+    <Real Name="Cell 2 2 4">0.0064907477596851566</Real>
+    <Real Name="Cell 2 2 5">0.073982245856878584</Real>
+    <Real Name="Cell 2 2 6">0.36528517924623594</Real>
+    <Real Name="Cell 2 2 7">0.19158423489485196</Real>
+    <Real Name="Cell 2 2 8">0.0065569741243146802</Real>
+    <Real Name="Cell 2 3 0">0.0001003766833421703</Real>
+    <Real Name="Cell 2 3 1">0.0046053771947082156</Real>
+    <Real Name="Cell 2 3 2">0.025962601198358828</Real>
+    <Real Name="Cell 2 3 3">0.093568636080465103</Real>
+    <Real Name="Cell 2 3 4">0.057596781970915147</Real>
+    <Real Name="Cell 2 3 5">0.13055779831653314</Real>
+    <Real Name="Cell 2 3 6">0.63384118113411592</Real>
+    <Real Name="Cell 2 3 7">0.33243609276184499</Real>
+    <Real Name="Cell 2 3 8">0.011377631669035961</Real>
+    <Real Name="Cell 2 4 0">2.1693299673592877e-05</Real>
+    <Real Name="Cell 2 4 1">0.0069400541388516639</Real>
+    <Real Name="Cell 2 4 2">0.096387485876494594</Real>
+    <Real Name="Cell 2 4 3">0.17808015494994614</Real>
+    <Real Name="Cell 2 4 4">0.062277014946357616</Real>
+    <Real Name="Cell 2 4 5">0.025520667214395141</Real>
+    <Real Name="Cell 2 4 6">0.11471472041783777</Real>
+    <Real Name="Cell 2 4 7">0.060165408264794155</Real>
+    <Real Name="Cell 2 4 8">0.0020591622551177071</Real>
+    <Real Name="Cell 2 5 0">1.9598590559306782e-06</Real>
+    <Real Name="Cell 2 5 1">0.036474634233574756</Real>
+    <Real Name="Cell 2 5 2">0.54259195103350411</Real>
+    <Real Name="Cell 2 5 3">0.69914663409168787</Real>
+    <Real Name="Cell 2 5 4">0.094771303511015995</Real>
+    <Real Name="Cell 2 5 5">0.00030616079898533355</Real>
+    <Real Name="Cell 2 5 6">0.00019056474783501627</Real>
+    <Real Name="Cell 2 5 7">9.9947119363666856e-05</Real>
+    <Real Name="Cell 2 5 8">3.4206920826603155e-06</Real>
+    <Real Name="Cell 2 6 0">8.465206252254226e-11</Real>
+    <Real Name="Cell 2 6 1">0.025220455762166569</Real>
+    <Real Name="Cell 2 6 2">0.40880078972991263</Real>
+    <Real Name="Cell 2 6 3">0.56732930576004903</Real>
+    <Real Name="Cell 2 6 4">0.084187596685747504</Real>
+    <Real Name="Cell 2 6 5">0.00013649763653189972</Real>
+    <Real Name="Cell 2 7 0">2.702937398317187e-10</Real>
+    <Real Name="Cell 2 7 1">0.0016079459149824856</Real>
+    <Real Name="Cell 2 7 2">0.032106518158682609</Real>
+    <Real Name="Cell 2 7 3">0.051900574397716726</Real>
+    <Real Name="Cell 2 7 4">0.0092082761525901537</Real>
+    <Real Name="Cell 2 7 5">2.2808109313890465e-05</Real>
+    <Real Name="Cell 2 8 0">3.6857498320737797e-08</Real>
+    <Real Name="Cell 2 8 1">1.3680823343505409e-06</Real>
+    <Real Name="Cell 2 8 2">2.1046448276938429e-05</Real>
+    <Real Name="Cell 2 8 3">3.9364841011200986e-05</Real>
+    <Real Name="Cell 2 8 4">8.1734740220907526e-06</Real>
+    <Real Name="Cell 2 8 5">2.5571886923640475e-08</Real>
+    <Real Name="Cell 2 9 0">1.3834851631882297e-07</Real>
+    <Real Name="Cell 2 9 1">2.6983860357172753e-06</Real>
+    <Real Name="Cell 2 9 2">4.0280452624402109e-06</Real>
+    <Real Name="Cell 2 9 3">6.0946207367363441e-07</Real>
+    <Real Name="Cell 2 9 4">3.5393964534100044e-10</Real>
+    <Real Name="Cell 3 0 0">0.073598597350954489</Real>
+    <Real Name="Cell 3 0 1">0.25895739820523322</Real>
+    <Real Name="Cell 3 0 13">0.001245374784747947</Real>
+    <Real Name="Cell 3 0 2">0.20617723416988132</Real>
+    <Real Name="Cell 3 0 3">0.037563056636917141</Real>
+    <Real Name="Cell 3 0 4">0.00021684508540157531</Real>
+    <Real Name="Cell 3 1 0">0.054460723103019075</Real>
+    <Real Name="Cell 3 1 1">0.57918491788543014</Real>
+    <Real Name="Cell 3 1 13">0.00074859728331063097</Real>
+    <Real Name="Cell 3 1 2">1.097401072556955</Real>
+    <Real Name="Cell 3 1 3">0.26425853833690915</Real>
+    <Real Name="Cell 3 1 4">0.0015562925275854991</Real>
+    <Real Name="Cell 3 1 5">0.0011768905418317172</Real>
+    <Real Name="Cell 3 1 6">0.0058334054564500677</Real>
+    <Real Name="Cell 3 1 7">0.003059495935508741</Real>
+    <Real Name="Cell 3 1 8">0.00010471130724084337</Real>
+    <Real Name="Cell 3 10 0">0.0013447135706338926</Real>
+    <Real Name="Cell 3 10 1">0.025959568194080906</Real>
+    <Real Name="Cell 3 10 13">2.7571650272749616e-07</Real>
+    <Real Name="Cell 3 10 2">0.038699930850046207</Real>
+    <Real Name="Cell 3 10 3">0.0058536957875895404</Real>
+    <Real Name="Cell 3 10 4">3.3994106358534032e-06</Real>
+    <Real Name="Cell 3 11 0">0.012435411509110801</Real>
+    <Real Name="Cell 3 11 1">0.033978426480946601</Real>
+    <Real Name="Cell 3 11 13">0.00021451803434990806</Real>
+    <Real Name="Cell 3 11 2">0.010672162987863991</Real>
+    <Real Name="Cell 3 11 3">0.00023129296207515817</Real>
+    <Real Name="Cell 3 11 4">1.4755088738748664e-07</Real>
+    <Real Name="Cell 3 2 0">0.010834472210292486</Real>
+    <Real Name="Cell 3 2 1">0.39037372957947158</Real>
+    <Real Name="Cell 3 2 13">3.229852277885253e-05</Real>
+    <Real Name="Cell 3 2 2">0.90592883136236979</Real>
+    <Real Name="Cell 3 2 3">0.23059569527913507</Real>
+    <Real Name="Cell 3 2 4">0.0018050886134847197</Real>
+    <Real Name="Cell 3 2 5">0.029257574237216415</Real>
+    <Real Name="Cell 3 2 6">0.14496518386988957</Real>
+    <Real Name="Cell 3 2 7">0.076031126955147368</Real>
+    <Real Name="Cell 3 2 8">0.0026021667824651564</Real>
+    <Real Name="Cell 3 3 0">0.0028266087590039942</Real>
+    <Real Name="Cell 3 3 1">0.15306608054300855</Real>
+    <Real Name="Cell 3 3 2">0.40626716994816375</Real>
+    <Real Name="Cell 3 3 3">0.12264118748953037</Real>
+    <Real Name="Cell 3 3 4">0.0036208997307676846</Real>
+    <Real Name="Cell 3 3 5">0.050850313040567675</Real>
+    <Real Name="Cell 3 3 6">0.2515429275204078</Real>
+    <Real Name="Cell 3 3 7">0.1319288655829173</Real>
+    <Real Name="Cell 3 3 8">0.0045152679621689642</Real>
+    <Real Name="Cell 3 4 0">0.0011766071466203342</Real>
+    <Real Name="Cell 3 4 1">0.073439108391376462</Real>
+    <Real Name="Cell 3 4 2">0.2179748889236045</Real>
+    <Real Name="Cell 3 4 3">0.080359776056964052</Real>
+    <Real Name="Cell 3 4 4">0.0040188011837243541</Real>
+    <Real Name="Cell 3 4 5">0.0092755341314021047</Real>
+    <Real Name="Cell 3 4 6">0.045525089663560954</Real>
+    <Real Name="Cell 3 4 7">0.023876932236096826</Real>
+    <Real Name="Cell 3 4 8">0.00081718846504268844</Real>
+    <Real Name="Cell 3 5 0">9.74415967473093e-05</Real>
+    <Real Name="Cell 3 5 1">0.0095721178488858503</Real>
+    <Real Name="Cell 3 5 2">0.065249832423662155</Real>
+    <Real Name="Cell 3 5 3">0.071583868329026634</Real>
+    <Real Name="Cell 3 5 4">0.010559758829523262</Real>
+    <Real Name="Cell 3 5 5">4.3834830096599138e-05</Real>
+    <Real Name="Cell 3 5 6">7.5626538602050164e-05</Real>
+    <Real Name="Cell 3 5 7">3.9664496012998495e-05</Real>
+    <Real Name="Cell 3 5 8">1.3575181389739834e-06</Real>
+    <Real Name="Cell 3 6 0">1.1129915568376659e-07</Real>
+    <Real Name="Cell 3 6 1">0.002030139159326027</Real>
+    <Real Name="Cell 3 6 2">0.043022839749956548</Real>
+    <Real Name="Cell 3 6 3">0.072214276536706506</Real>
+    <Real Name="Cell 3 6 4">0.013294439866378269</Real>
+    <Real Name="Cell 3 6 5">3.5090074605446344e-05</Real>
+    <Real Name="Cell 3 7 0">6.3740557011882817e-06</Real>
+    <Real Name="Cell 3 7 1">0.00032657514172532197</Real>
+    <Real Name="Cell 3 7 2">0.0055137970717333796</Real>
+    <Real Name="Cell 3 7 3">0.0099137159308061544</Real>
+    <Real Name="Cell 3 7 4">0.0019781397947032518</Real>
+    <Real Name="Cell 3 7 5">5.8820820362405976e-06</Real>
+    <Real Name="Cell 3 8 0">0.00086917198840454687</Real>
+    <Real Name="Cell 3 8 1">0.016952727811193911</Real>
+    <Real Name="Cell 3 8 2">0.025311275338046373</Real>
+    <Real Name="Cell 3 8 3">0.0038390534153474407</Real>
+    <Real Name="Cell 3 8 4">4.3333937600640824e-06</Real>
+    <Real Name="Cell 3 8 5">6.6008085724512386e-09</Real>
+    <Real Name="Cell 3 9 0">0.0032625289425569242</Real>
+    <Real Name="Cell 3 9 1">0.063633226968848128</Real>
+    <Real Name="Cell 3 9 2">0.094989195405288995</Real>
+    <Real Name="Cell 3 9 3">0.014372309206184548</Real>
+    <Real Name="Cell 3 9 4">8.3465899567890004e-06</Real>
+    <Real Name="Cell 4 0 0">0.21208332364093133</Real>
+    <Real Name="Cell 4 0 1">0.60805146227571971</Real>
+    <Real Name="Cell 4 0 13">0.0036504664849270206</Real>
+    <Real Name="Cell 4 0 2">0.25759965785165739</Real>
+    <Real Name="Cell 4 0 3">0.024121820296595573</Real>
+    <Real Name="Cell 4 0 4">0.00013186522454339343</Real>
+    <Real Name="Cell 4 1 0">0.1339229042933362</Real>
+    <Real Name="Cell 4 1 1">0.63518242938678626</Real>
+    <Real Name="Cell 4 1 13">0.0021943027327198995</Real>
+    <Real Name="Cell 4 1 2">0.7785262725674873</Real>
+    <Real Name="Cell 4 1 3">0.17048796327818375</Real>
+    <Real Name="Cell 4 1 4">0.0010246029357946658</Real>
+    <Real Name="Cell 4 1 5">2.3510099532532993e-05</Real>
+    <Real Name="Cell 4 1 6">0.00011653076295108855</Real>
+    <Real Name="Cell 4 1 7">6.1117883588286066e-05</Real>
+    <Real Name="Cell 4 1 8">2.0917607413846612e-06</Real>
+    <Real Name="Cell 4 10 0">0.011437196930540057</Real>
+    <Real Name="Cell 4 10 1">0.22228830893121732</Real>
+    <Real Name="Cell 4 10 13">8.0818550758735646e-07</Real>
+    <Real Name="Cell 4 10 2">0.33167235070659445</Real>
+    <Real Name="Cell 4 10 3">0.050178345658876453</Real>
+    <Real Name="Cell 4 10 4">2.9140417648520178e-05</Real>
+    <Real Name="Cell 4 11 0">0.036607760811500203</Real>
+    <Real Name="Cell 4 11 1">0.10262942510457841</Real>
+    <Real Name="Cell 4 11 13">0.00062879938183849895</Real>
+    <Real Name="Cell 4 11 2">0.035764885315914687</Real>
+    <Real Name="Cell 4 11 3">0.0013444610869341829</Real>
+    <Real Name="Cell 4 11 4">6.6084303392542545e-07</Real>
+    <Real Name="Cell 4 2 0">0.015170162593397993</Real>
+    <Real Name="Cell 4 2 1">0.47986874050893052</Real>
+    <Real Name="Cell 4 2 13">9.4674050222332066e-05</Real>
+    <Real Name="Cell 4 2 2">1.1594214344599676</Real>
+    <Real Name="Cell 4 2 3">0.31297903039943076</Real>
+    <Real Name="Cell 4 2 4">0.0024800112415277946</Real>
+    <Real Name="Cell 4 2 5">0.0005842463595196562</Real>
+    <Real Name="Cell 4 2 6">0.0028958905057806972</Real>
+    <Real Name="Cell 4 2 7">0.0015188324038607369</Real>
+    <Real Name="Cell 4 2 8">5.1982068236206017e-05</Real>
+    <Real Name="Cell 4 3 0">0.0095503653278588528</Real>
+    <Real Name="Cell 4 3 1">0.5598798524948827</Real>
+    <Real Name="Cell 4 3 2">1.5519204324548681</Real>
+    <Real Name="Cell 4 3 3">0.48023680763631632</Real>
+    <Real Name="Cell 4 3 4">0.0060696965563888745</Real>
+    <Real Name="Cell 4 3 5">0.001013784152379558</Real>
+    <Real Name="Cell 4 3 6">0.0050249360305466692</Real>
+    <Real Name="Cell 4 3 7">0.0026354710771304257</Real>
+    <Real Name="Cell 4 3 8">9.0199048306914141e-05</Real>
+    <Real Name="Cell 4 4 0">0.0041999333775353236</Real>
+    <Real Name="Cell 4 4 1">0.34220996425764427</Real>
+    <Real Name="Cell 4 4 2">1.1348563699444243</Real>
+    <Real Name="Cell 4 4 3">0.43671940766042799</Real>
+    <Real Name="Cell 4 4 4">0.011807119078425752</Real>
+    <Real Name="Cell 4 4 5">0.00020145117966054654</Real>
+    <Real Name="Cell 4 4 6">0.00090942991559854415</Real>
+    <Real Name="Cell 4 4 7">0.00047697646789274229</Real>
+    <Real Name="Cell 4 4 8">1.6324528788061371e-05</Real>
+    <Real Name="Cell 4 5 0">0.00051621780997905271</Real>
+    <Real Name="Cell 4 5 1">0.062248659565771566</Real>
+    <Real Name="Cell 4 5 2">0.27697084243004816</Real>
+    <Real Name="Cell 4 5 3">0.20478194223402993</Real>
+    <Real Name="Cell 4 5 4">0.028778419042058846</Real>
+    <Real Name="Cell 4 5 5">0.00014053565658219612</Real>
+    <Real Name="Cell 4 5 6">1.5107501627376874e-06</Real>
+    <Real Name="Cell 4 5 7">7.9235602890492953e-07</Real>
+    <Real Name="Cell 4 5 8">2.7118400329890425e-08</Real>
+    <Real Name="Cell 4 6 0">3.3485271342159279e-06</Real>
+    <Real Name="Cell 4 6 1">0.0015015418570646112</Real>
+    <Real Name="Cell 4 6 2">0.040245233940218117</Real>
+    <Real Name="Cell 4 6 3">0.085984835311039107</Real>
+    <Real Name="Cell 4 6 4">0.020451539892035284</Real>
+    <Real Name="Cell 4 6 5">0.00010754361606928727</Real>
+    <Real Name="Cell 4 7 0">5.4639661148476695e-05</Real>
+    <Real Name="Cell 4 7 1">0.0011277569505600041</Real>
+    <Real Name="Cell 4 7 2">0.0040056399488043069</Real>
+    <Real Name="Cell 4 7 3">0.0056170540076213079</Real>
+    <Real Name="Cell 4 7 4">0.0012896037684901921</Real>
+    <Real Name="Cell 4 7 5">6.7706960941369075e-06</Real>
+    <Real Name="Cell 4 8 0">0.0074507135099742871</Real>
+    <Real Name="Cell 4 8 1">0.1453206870644014</Real>
+    <Real Name="Cell 4 8 2">0.21692907739696357</Real>
+    <Real Name="Cell 4 8 3">0.03282244542471896</Real>
+    <Real Name="Cell 4 8 4">1.9075348084881309e-05</Real>
+    <Real Name="Cell 4 8 5">4.3944649588989032e-11</Real>
+    <Real Name="Cell 4 9 0">0.027967040808127171</Real>
+    <Real Name="Cell 4 9 1">0.5454765572120418</Real>
+    <Real Name="Cell 4 9 2">0.81426609572047715</Real>
+    <Real Name="Cell 4 9 3">0.12320226583533885</Real>
+    <Real Name="Cell 4 9 4">7.1548613373304825e-05</Real>
+    <Real Name="Cell 5 0 0">0.067604105140985124</Real>
+    <Real Name="Cell 5 0 1">0.18366847344578174</Real>
+    <Real Name="Cell 5 0 13">0.0011681699277809241</Real>
+    <Real Name="Cell 5 0 2">0.057378284797746031</Real>
+    <Real Name="Cell 5 0 3">0.0015062233055636589</Real>
+    <Real Name="Cell 5 0 4">5.7979556015132922e-06</Real>
+    <Real Name="Cell 5 1 0">0.041035834540160486</Real>
+    <Real Name="Cell 5 1 1">0.12852887244782626</Real>
+    <Real Name="Cell 5 1 13">0.00070218928879226092</Real>
+    <Real Name="Cell 5 1 2">0.078294224714775762</Real>
+    <Real Name="Cell 5 1 3">0.012424480032800451</Real>
+    <Real Name="Cell 5 1 4">8.6429115961081471e-05</Real>
+    <Real Name="Cell 5 10 0">0.0094205460288156861</Real>
+    <Real Name="Cell 5 10 1">0.18348935856747964</Real>
+    <Real Name="Cell 5 10 13">2.586239347574194e-07</Real>
+    <Real Name="Cell 5 10 2">0.27385744062045808</Real>
+    <Real Name="Cell 5 10 3">0.041434236681951224</Real>
+    <Real Name="Cell 5 10 4">2.4062495747350859e-05</Real>
+    <Real Name="Cell 5 11 0">0.011836119172707184</Real>
+    <Real Name="Cell 5 11 1">0.03520835528903675</Real>
+    <Real Name="Cell 5 11 13">0.00020121935963634903</Real>
+    <Real Name="Cell 5 11 2">0.014974307221056467</Real>
+    <Real Name="Cell 5 11 3">0.00096339397717289501</Real>
+    <Real Name="Cell 5 11 4">5.0963218860785206e-07</Real>
+    <Real Name="Cell 5 2 0">0.0043448458824475508</Real>
+    <Real Name="Cell 5 2 1">0.14371337306210846</Real>
+    <Real Name="Cell 5 2 13">3.0296231691923133e-05</Real>
+    <Real Name="Cell 5 2 2">0.36438594370345451</Real>
+    <Real Name="Cell 5 2 3">0.10358801651008759</Real>
+    <Real Name="Cell 5 2 4">0.00094879611698496286</Real>
+    <Real Name="Cell 5 3 0">0.0045994193383868112</Real>
+    <Real Name="Cell 5 3 1">0.32190185793324017</Real>
+    <Real Name="Cell 5 3 2">0.98659694247371699</Real>
+    <Real Name="Cell 5 3 3">0.3416942845154689</Real>
+    <Real Name="Cell 5 3 4">0.005662296150676962</Real>
+    <Real Name="Cell 5 3 5">1.5636548562492185e-08</Real>
+    <Real Name="Cell 5 4 0">0.003027394838257735</Real>
+    <Real Name="Cell 5 4 1">0.36614831194380887</Real>
+    <Real Name="Cell 5 4 2">1.3960881027314547</Real>
+    <Real Name="Cell 5 4 3">0.64277123858546115</Real>
+    <Real Name="Cell 5 4 4">0.033276089985935321</Real>
+    <Real Name="Cell 5 4 5">0.00011115889121853726</Real>
+    <Real Name="Cell 5 5 0">0.00065924413613634679</Real>
+    <Real Name="Cell 5 5 1">0.10468817425661922</Real>
+    <Real Name="Cell 5 5 2">0.68236393796811101</Real>
+    <Real Name="Cell 5 5 3">0.84263027527448631</Real>
+    <Real Name="Cell 5 5 4">0.16801514412785501</Real>
+    <Real Name="Cell 5 5 5">0.00086669353930324223</Real>
+    <Real Name="Cell 5 6 0">6.5800211159975458e-06</Real>
+    <Real Name="Cell 5 6 1">0.0070381532222178701</Real>
+    <Real Name="Cell 5 6 2">0.2391230718154575</Real>
+    <Real Name="Cell 5 6 3">0.52601752916053368</Real>
+    <Real Name="Cell 5 6 4">0.12598030816764566</Real>
+    <Real Name="Cell 5 6 5">0.00066390894846348738</Real>
+    <Real Name="Cell 5 7 0">4.5118317447611442e-05</Real>
+    <Real Name="Cell 5 7 1">0.0012577507985554381</Real>
+    <Real Name="Cell 5 7 2">0.01606446908013251</Real>
+    <Real Name="Cell 5 7 3">0.033090167773294703</Real>
+    <Real Name="Cell 5 7 4">0.0079004154620033878</Real>
+    <Real Name="Cell 5 7 5">4.1646844882794823e-05</Real>
+    <Real Name="Cell 5 8 0">0.0061523744893062738</Real>
+    <Real Name="Cell 5 8 1">0.11999753846430328</Real>
+    <Real Name="Cell 5 8 2">0.17912763775000046</Real>
+    <Real Name="Cell 5 8 3">0.027102848762240124</Real>
+    <Real Name="Cell 5 8 4">1.573973688110895e-05</Real>
+    <Real Name="Cell 5 9 0">0.023093588040791941</Real>
+    <Real Name="Cell 5 9 1">0.45042344610530621</Real>
+    <Real Name="Cell 5 9 2">0.67237452468293513</Real>
+    <Real Name="Cell 5 9 3">0.10173340799312046</Real>
+    <Real Name="Cell 5 9 4">5.9080766301625985e-05</Real>
+    <Real Name="Cell 6 0 0">0.00082077079294070991</Real>
+    <Real Name="Cell 6 0 1">0.0022101622765118975</Real>
+    <Real Name="Cell 6 0 13">1.4191386433891566e-05</Real>
+    <Real Name="Cell 6 0 2">0.00064857064479032693</Real>
+    <Real Name="Cell 6 0 3">6.2758129908261011e-06</Real>
+    <Real Name="Cell 6 1 0">0.00049725206412809043</Real>
+    <Real Name="Cell 6 1 1">0.001538913388734903</Real>
+    <Real Name="Cell 6 1 13">8.5304708758598335e-06</Real>
+    <Real Name="Cell 6 1 2">0.00093970364184294691</Real>
+    <Real Name="Cell 6 1 3">0.00016020194894869811</Real>
+    <Real Name="Cell 6 1 4">1.3889741843526278e-06</Real>
+    <Real Name="Cell 6 10 0">0.00065752523856780272</Real>
+    <Real Name="Cell 6 10 1">0.012821491220844288</Real>
+    <Real Name="Cell 6 10 13">3.1418649906252384e-09</Real>
+    <Real Name="Cell 6 10 2">0.0191388343876954</Real>
+    <Real Name="Cell 6 10 3">0.0028957747538766441</Real>
+    <Real Name="Cell 6 10 4">1.6816944677570216e-06</Real>
+    <Real Name="Cell 6 11 0">0.00015524606453695252</Real>
+    <Real Name="Cell 6 11 1">0.00065116667085300781</Real>
+    <Real Name="Cell 6 11 13">2.4444916982276238e-06</Real>
+    <Real Name="Cell 6 11 2">0.00051545295777129837</Real>
+    <Real Name="Cell 6 11 3">6.2168088676848042e-05</Real>
+    <Real Name="Cell 6 11 4">3.5475768471150243e-08</Real>
+    <Real Name="Cell 6 2 0">9.4888854677418292e-05</Real>
+    <Real Name="Cell 6 2 1">0.0042754320625026879</Real>
+    <Real Name="Cell 6 2 13">3.680505046449241e-07</Real>
+    <Real Name="Cell 6 2 2">0.01150399473725236</Real>
+    <Real Name="Cell 6 2 3">0.0034615879184730618</Real>
+    <Real Name="Cell 6 2 4">3.8952932259370093e-05</Real>
+    <Real Name="Cell 6 3 0">0.00025235343711598303</Real>
+    <Real Name="Cell 6 3 1">0.028404078858073042</Real>
+    <Real Name="Cell 6 3 2">0.10361448352320463</Real>
+    <Real Name="Cell 6 3 3">0.041763769805479703</Real>
+    <Real Name="Cell 6 3 4">0.00089467169660995124</Real>
+    <Real Name="Cell 6 3 5">9.9160631673552472e-09</Real>
+    <Real Name="Cell 6 4 0">0.00043161630972750076</Real>
+    <Real Name="Cell 6 4 1">0.065388034760294478</Real>
+    <Real Name="Cell 6 4 2">0.27666855689441577</Real>
+    <Real Name="Cell 6 4 3">0.16175737992964104</Real>
+    <Real Name="Cell 6 4 4">0.015779899068777317</Real>
+    <Real Name="Cell 6 4 5">7.0492448031671362e-05</Real>
+    <Real Name="Cell 6 5 0">0.00012699520016769497</Real>
+    <Real Name="Cell 6 5 1">0.024539070735279885</Real>
+    <Real Name="Cell 6 5 2">0.27104489843692597</Real>
+    <Real Name="Cell 6 5 3">0.4663662096198079</Real>
+    <Real Name="Cell 6 5 4">0.10499762880490854</Real>
+    <Real Name="Cell 6 5 5">0.0005496217946129589</Real>
+    <Real Name="Cell 6 6 0">1.3763408648738738e-06</Real>
+    <Real Name="Cell 6 6 1">0.0040311205726970365</Real>
+    <Real Name="Cell 6 6 2">0.14995136281498866</Real>
+    <Real Name="Cell 6 6 3">0.33286271704947562</Real>
+    <Real Name="Cell 6 6 4">0.079875180015346631</Real>
+    <Real Name="Cell 6 6 5">0.00042102405425504402</Real>
+    <Real Name="Cell 6 7 0">3.1532566547884657e-06</Real>
+    <Real Name="Cell 6 7 1">0.00030105640434455741</Real>
+    <Real Name="Cell 6 7 2">0.009446190571854576</Real>
+    <Real Name="Cell 6 7 3">0.020872285203432872</Real>
+    <Real Name="Cell 6 7 4">0.0050100570477663066</Real>
+    <Real Name="Cell 6 7 5">2.6410735267336944e-05</Real>
+    <Real Name="Cell 6 8 0">0.00042998092346156037</Real>
+    <Real Name="Cell 6 8 1">0.0083864615997738361</Real>
+    <Real Name="Cell 6 8 2">0.012518982261419167</Real>
+    <Real Name="Cell 6 8 3">0.0018941805248498551</Real>
+    <Real Name="Cell 6 8 4">1.1000283891925967e-06</Real>
+    <Real Name="Cell 6 9 0">0.0016139788514304538</Real>
+    <Real Name="Cell 6 9 1">0.031479470185329379</Real>
+    <Real Name="Cell 6 9 2">0.046991323356162476</Real>
+    <Real Name="Cell 6 9 3">0.0071100068423672969</Real>
+    <Real Name="Cell 6 9 4">4.1290728477833956e-06</Real>
+    <Real Name="Cell 7 2 0">7.3333269531007198e-09</Real>
+    <Real Name="Cell 7 2 1">1.1310571632229732e-06</Real>
+    <Real Name="Cell 7 2 2">4.4189988416612641e-06</Real>
+    <Real Name="Cell 7 2 3">1.8686431659857344e-06</Real>
+    <Real Name="Cell 7 2 4">4.2579927034904449e-08</Real>
+    <Real Name="Cell 7 3 0">4.6677641699840157e-07</Real>
+    <Real Name="Cell 7 3 1">7.1997585733344011e-05</Real>
+    <Real Name="Cell 7 3 2">0.00028144060590160649</Real>
+    <Real Name="Cell 7 3 3">0.00011931010941132857</Real>
+    <Real Name="Cell 7 3 4">2.79875471101822e-06</Real>
+    <Real Name="Cell 7 3 5">4.6644478371396267e-10</Real>
+    <Real Name="Cell 7 4 0">1.3111594641865414e-06</Real>
+    <Real Name="Cell 7 4 1">0.00023230344530564693</Real>
+    <Real Name="Cell 7 4 2">0.001964553166613188</Real>
+    <Real Name="Cell 7 4 3">0.002952912988906251</Real>
+    <Real Name="Cell 7 4 4">0.00063663389408771494</Real>
+    <Real Name="Cell 7 4 5">3.3159162180257156e-06</Real>
+    <Real Name="Cell 7 5 0">4.0182136311688975e-07</Real>
+    <Real Name="Cell 7 5 1">0.00029647813676396455</Real>
+    <Real Name="Cell 7 5 2">0.0093992676557784309</Real>
+    <Real Name="Cell 7 5 3">0.020520958255432858</Real>
+    <Real Name="Cell 7 5 4">0.004906738741398583</Real>
+    <Real Name="Cell 7 5 5">2.5853830777996006e-05</Real>
+    <Real Name="Cell 7 6 0">4.3673388694017694e-09</Real>
+    <Real Name="Cell 7 6 1">0.0001803088715674896</Real>
+    <Real Name="Cell 7 6 2">0.0070172253096031775</Real>
+    <Real Name="Cell 7 6 3">0.015642247173435798</Real>
+    <Real Name="Cell 7 6 4">0.0037569228451156912</Real>
+    <Real Name="Cell 7 6 5">1.9804681617185402e-05</Real>
+    <Real Name="Cell 7 7 1">1.1268476522822571e-05</Real>
+    <Real Name="Cell 7 7 2">0.00044002372886475029</Real>
+    <Real Name="Cell 7 7 3">0.0009811645043648991</Real>
+    <Real Name="Cell 7 7 4">0.00023566925439787439</Real>
+    <Real Name="Cell 7 7 5">1.2423428019353165e-06</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_11.xml b/src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_11.xml
new file mode 100644 (file)
index 0000000..a4efff5
--- /dev/null
@@ -0,0 +1,1276 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">65</Int>
+      <Real>0.00043168598745147113</Real>
+      <Real>0.12397212138337553</Real>
+      <Real>0.57875978626183999</Real>
+      <Real>0.28787707086482694</Real>
+      <Real>0.0089593355025060009</Real>
+      <Real>2.412283597558329e-05</Real>
+      <Real>0.074060428119428312</Real>
+      <Real>0.5281551619863365</Real>
+      <Real>0.3765290805515803</Real>
+      <Real>0.021231206506679284</Real>
+      <Real>0.0033016690086745014</Real>
+      <Real>0.21215288599464993</Real>
+      <Real>0.59837477660759653</Real>
+      <Real>0.18414717639524303</Real>
+      <Real>0.0020234919938359637</Real>
+      <Real>0.0025586095786372461</Real>
+      <Real>0.19690898092691589</Real>
+      <Real>0.59895530494502436</Real>
+      <Real>0.19892677511393422</Real>
+      <Real>0.0026503294354883137</Real>
+      <Real>0.00039076566299572229</Real>
+      <Real>0.12120264109770255</Real>
+      <Real>0.5769963210853325</Real>
+      <Real>0.2920308692972568</Real>
+      <Real>0.009379402856712335</Real>
+      <Real>0.040630434871156813</Real>
+      <Real>0.45518549365190381</Real>
+      <Real>0.46146147760918327</Real>
+      <Real>0.042722593803103726</Real>
+      <Real>6.4652349062851777e-11</Real>
+      <Real>9.9173825171589586e-07</Real>
+      <Real>0.054580451594272536</Real>
+      <Real>0.49187307297977795</Real>
+      <Real>0.42235622694042391</Real>
+      <Real>0.031189256747273925</Real>
+      <Real>0.0035886370244400901</Real>
+      <Real>0.21746702452323663</Real>
+      <Real>0.59787057097020369</Real>
+      <Real>0.17923611426248856</Real>
+      <Real>0.0018376532196310062</Real>
+      <Real>0.026799462318528058</Real>
+      <Real>0.40392471542377728</Real>
+      <Real>0.50729578665061448</Real>
+      <Real>0.061975074125176763</Real>
+      <Real>4.9614819032708608e-06</Real>
+      <Real>2.1494937337497418e-07</Real>
+      <Real>0.05019469086708727</Real>
+      <Real>0.48154173346733414</Real>
+      <Real>0.43398971515956575</Real>
+      <Real>0.034273645556639379</Real>
+      <Real>5.537920060640921e-05</Real>
+      <Real>0.083542305116125995</Real>
+      <Real>0.54153929048313976</Real>
+      <Real>0.35700971710986118</Real>
+      <Real>0.017853308090266577</Real>
+      <Real>9.1124858730694142e-05</Real>
+      <Real>0.090721181941133183</Real>
+      <Real>0.55025864959373116</Real>
+      <Real>0.3432075990130844</Real>
+      <Real>0.015721444593320491</Real>
+      <Real>0.018987348346149579</Real>
+      <Real>0.36385552673261401</Real>
+      <Real>0.53698509539530281</Real>
+      <Real>0.080129839254891311</Real>
+      <Real>4.2190271042138495e-05</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">65</Int>
+      <Real>0.00015195084349147622</Real>
+      <Real>0.099586358951448004</Real>
+      <Real>0.55959855329798436</Real>
+      <Real>0.32717756091340827</Real>
+      <Real>0.01348557599366784</Real>
+      <Real>2.4260362260629302e-05</Real>
+      <Real>0.074116427316521308</Real>
+      <Real>0.52824119730101549</Real>
+      <Real>0.37640907510647797</Real>
+      <Real>0.021209039913724623</Real>
+      <Real>2.9799899041508872e-09</Real>
+      <Real>0.044459798525464958</Real>
+      <Real>0.46644097736487722</Real>
+      <Real>0.45009197937107209</Real>
+      <Real>0.039007241758595698</Real>
+      <Real>0.0027408920796075957</Real>
+      <Real>0.20087746981344573</Real>
+      <Real>0.59893243346414637</Real>
+      <Real>0.19497658318626196</Real>
+      <Real>0.0024726214565381982</Real>
+      <Real>0.00010852418716670213</Real>
+      <Real>0.093564473503081363</Real>
+      <Real>0.55341578786571499</Real>
+      <Real>0.33795038178000431</Real>
+      <Real>0.014960832664032583</Real>
+      <Real>8.70688143407287e-06</Real>
+      <Real>0.065574009020506169</Real>
+      <Real>0.51401843463678332</Real>
+      <Real>0.39543783225030044</Real>
+      <Real>0.024961017210975898</Real>
+      <Real>0.0026918827551873068</Real>
+      <Real>0.19982682442644864</Real>
+      <Real>0.59894752670430673</Real>
+      <Real>0.19601515417024337</Real>
+      <Real>0.0025186119438139094</Real>
+      <Real>0.00015096524582485841</Real>
+      <Real>0.099462640452621973</Real>
+      <Real>0.55947807717550002</Real>
+      <Real>0.32739415018595958</Real>
+      <Real>0.013514166940093513</Real>
+      <Real>0.00010548375296443968</Real>
+      <Real>0.093089590287530832</Real>
+      <Real>0.55289950737145288</Real>
+      <Real>0.33882057290998219</Real>
+      <Real>0.015084845678069543</Real>
+      <Real>0.012967061736831292</Real>
+      <Real>0.32319192962601168</Real>
+      <Real>0.56178721913659135</Real>
+      <Real>0.10188280823098855</Real>
+      <Real>0.00017098126957707798</Real>
+      <Real>0.0093924113694081966</Real>
+      <Real>0.29215749184002215</Real>
+      <Real>0.57694155886402931</Real>
+      <Real>0.12111896985329024</Real>
+      <Real>0.00038956807325003957</Real>
+      <Real>0.0064292944800659483</Real>
+      <Real>0.25964388571917835</Real>
+      <Real>0.58898204094315654</Real>
+      <Real>0.14413606898777964</Real>
+      <Real>0.00080870986981941974</Real>
+      <Real>0.00063228945691469213</Real>
+      <Real>0.13563675482476231</Real>
+      <Real>0.58520218545915026</Real>
+      <Real>0.27113574277694441</Real>
+      <Real>0.0073930274822284784</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">65</Int>
+      <Real>0.0051677772656301057</Real>
+      <Real>0.24277874193839083</Real>
+      <Real>0.59352018741180557</Real>
+      <Real>0.15739494285160488</Real>
+      <Real>0.0011383505325685479</Real>
+      <Real>0.0073630099847195752</Real>
+      <Real>0.27079302072734218</Real>
+      <Real>0.58532264913373744</Real>
+      <Real>0.13588426274984747</Real>
+      <Real>0.00063705740435331104</Real>
+      <Real>0.037212443309160612</Real>
+      <Real>0.44421545919804756</Real>
+      <Real>0.47206292117996462</Real>
+      <Real>0.046509151178613553</Real>
+      <Real>2.5134213594333823e-08</Real>
+      <Real>0.030775118026428579</Real>
+      <Real>0.42071682716898717</Real>
+      <Real>0.49329128362289443</Real>
+      <Real>0.055215591102667598</Real>
+      <Real>1.1800790222950388e-06</Real>
+      <Real>0.00035249786697384835</Real>
+      <Real>0.11844678361245713</Real>
+      <Real>0.57514570201795168</Real>
+      <Real>0.29623697037588936</Real>
+      <Real>0.0098180461267279116</Real>
+      <Real>0.030884113789831424</Real>
+      <Real>0.42115016817053519</Real>
+      <Real>0.49291730315772098</Real>
+      <Real>0.055047286957198585</Real>
+      <Real>1.1279247137839807e-06</Real>
+      <Real>0.0030967576983704373</Real>
+      <Real>0.20818071823371087</Real>
+      <Real>0.5986522754924074</Real>
+      <Real>0.18789742938665951</Real>
+      <Real>0.0021728191888517098</Real>
+      <Real>0.022343511730447432</Real>
+      <Real>0.38242826198506941</Real>
+      <Real>0.52386869352108667</Real>
+      <Real>0.071341485967975876</Real>
+      <Real>1.8046795420541908e-05</Real>
+      <Real>0.010145481949927834</Real>
+      <Real>0.29929464095801378</Real>
+      <Real>0.57375984196142316</Real>
+      <Real>0.11647346532187075</Real>
+      <Real>0.0003265698087644401</Real>
+      <Real>0.0014617904290638469</Real>
+      <Real>0.1682872607776017</Real>
+      <Real>0.59613993352686223</Real>
+      <Real>0.2297980712357692</Real>
+      <Real>0.0043129440307029107</Real>
+      <Real>0.00093350652545619761</Real>
+      <Real>0.14948506602626943</Real>
+      <Real>0.59100241651365182</Real>
+      <Real>0.25269117265923857</Real>
+      <Real>0.0058878382753838965</Real>
+      <Real>2.2511326449719818e-05</Real>
+      <Real>0.073388012440734784</Real>
+      <Real>0.52711510749250323</Real>
+      <Real>0.37797470767964925</Real>
+      <Real>0.021499661060662919</Real>
+      <Real>0.0077812058733808722</Real>
+      <Real>0.27548781880963463</Real>
+      <Real>0.58363198148677997</Real>
+      <Real>0.13252480522712207</Real>
+      <Real>0.00057418860308248792</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">65</Int>
+      <Real>-0.0054123159943235263</Real>
+      <Real>-0.35543045994849493</Real>
+      <Real>-0.22027447567701353</Real>
+      <Real>0.52848959517680594</Real>
+      <Real>0.052627656443025993</Real>
+      <Real>-0.00062205452524004593</Real>
+      <Real>-0.25376770847962776</Real>
+      <Real>-0.39008172763611693</Real>
+      <Real>0.54395479881207742</Real>
+      <Real>0.10051669182890735</Real>
+      <Real>-0.024891858917245911</Real>
+      <Real>-0.47312831449340104</Real>
+      <Real>0.038174033354594794</Real>
+      <Real>0.44260431243999732</Real>
+      <Real>0.01724182761605484</Real>
+      <Real>-0.020559388675760314</Real>
+      <Real>-0.45723030077824783</Real>
+      <Real>-0.0027515317099742753</Real>
+      <Real>0.45943152045773322</Real>
+      <Real>0.021109700706249193</Real>
+      <Real>-0.0050227837091489976</Real>
+      <Real>-0.35059378814664566</Real>
+      <Real>-0.22927643071818149</Real>
+      <Real>0.53042536071289603</Real>
+      <Real>0.054467641861080135</Real>
+      <Real>-0.16354820572788292</Real>
+      <Real>-0.50307919348273278</Real>
+      <Real>0.49680304535368675</Real>
+      <Real>0.1698243126523564</Real>
+      <Real>4.1204572502199554e-08</Real>
+      <Real>-5.6794329827889662e-05</Real>
+      <Real>-0.20380268688822553</Real>
+      <Real>-0.45809886799216037</Real>
+      <Real>0.52783297396830886</Real>
+      <Real>0.13412537524190493</Real>
+      <Real>-0.026497465234508667</Real>
+      <Real>-0.47828050014666967</Real>
+      <Real>0.052093413976694869</Real>
+      <Real>0.43664453342465404</Real>
+      <Real>0.016040017979829454</Real>
+      <Real>-0.11970209227194881</Real>
+      <Real>-0.53662234959272781</Real>
+      <Real>0.4325409594380264</Real>
+      <Real>0.22359349898992603</Real>
+      <Real>0.00018998343672421792</Real>
+      <Real>-1.8040946492467145e-05</Real>
+      <Real>-0.19155920806570498</Real>
+      <Real>-0.47287224461691968</Real>
+      <Real>0.52049427721692421</Real>
+      <Real>0.14395521641219289</Real>
+      <Real>-0.001160158143288331</Real>
+      <Real>-0.27572281668186399</Real>
+      <Real>-0.35680733132162235</Real>
+      <Real>0.54542374526199011</Real>
+      <Real>0.088266560884784587</Real>
+      <Real>-0.0016855235775882218</Real>
+      <Real>-0.29143371186306077</Real>
+      <Real>-0.33183866640415738</Real>
+      <Real>0.54472056270785008</Real>
+      <Real>0.080237339136956284</Real>
+      <Real>-0.092439038491503631</Real>
+      <Real>-0.54524494322339256</Real>
+      <Real>0.36875305699126182</Real>
+      <Real>0.26798486965366852</Real>
+      <Real>0.0009460550699658196</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">65</Int>
+      <Real>-0.0024733439646709445</Real>
+      <Real>-0.30983851881908325</Real>
+      <Real>-0.30138592749241133</Real>
+      <Real>0.54218078730075636</Real>
+      <Real>0.07151700297540918</Real>
+      <Real>-0.00062471242253069026</Real>
+      <Real>-0.25390162851379605</Real>
+      <Real>-0.38988463303054299</Real>
+      <Real>0.54397300129259696</Real>
+      <Real>0.10043797267427278</Real>
+      <Real>-7.289005458467352e-07</Real>
+      <Real>-0.17497413775377094</Real>
+      <Real>-0.4914265549325933</Real>
+      <Real>0.50777843872868289</Real>
+      <Real>0.15862298285822721</Real>
+      <Real>-0.021648416398585668</Real>
+      <Real>-0.46153114918445864</Real>
+      <Real>0.0080465180715674767</Real>
+      <Real>0.45509407700458371</Real>
+      <Real>0.020038970506893111</Real>
+      <Real>-0.0019215517592169318</Real>
+      <Real>-0.29745274240975228</Real>
+      <Real>-0.32202193698478676</Real>
+      <Real>0.5440883082356982</Real>
+      <Real>0.077307922918057798</Real>
+      <Real>-0.00028967042316330595</Real>
+      <Real>-0.2328515765720254</Real>
+      <Real>-0.41993880385606597</Real>
+      <Real>0.53959101912086138</Real>
+      <Real>0.11348903173039328</Real>
+      <Real>-0.021357444482793631</Real>
+      <Real>-0.46040374597745926</Real>
+      <Real>0.0051976929501876823</Real>
+      <Real>0.45624562996317708</Real>
+      <Real>0.020317867546888163</Real>
+      <Real>-0.0024613020578055349</Real>
+      <Real>-0.30958887167136379</Real>
+      <Real>-0.30180765951720046</Real>
+      <Real>0.54222714227971447</Real>
+      <Real>0.071630690966655336</Real>
+      <Real>-0.0018810327659186724</Real>
+      <Real>-0.29645523625782155</Real>
+      <Real>-0.32365838815836168</Real>
+      <Real>0.54420661615386279</Real>
+      <Real>0.077788041028239135</Real>
+      <Real>-0.069444581465373606</Real>
+      <Real>-0.5412697447426873</Real>
+      <Real>0.29357544069077202</Real>
+      <Real>0.31443667870801228</Real>
+      <Real>0.0027022068092765858</Real>
+      <Real>-0.054524288877065188</Real>
+      <Real>-0.53048257613609351</Real>
+      <Real>0.22954925309162344</Real>
+      <Real>0.3504463777332944</Real>
+      <Real>0.0050112341882408307</Real>
+      <Real>-0.04103265979952906</Real>
+      <Real>-0.51231766614035856</Real>
+      <Real>0.15639997126635846</Real>
+      <Real>0.38828369508647514</Real>
+      <Real>0.0086666595870540392</Real>
+      <Real>-0.0072059979806885803</Real>
+      <Real>-0.37492576008690903</Real>
+      <Real>-0.18296626785233178</Real>
+      <Real>0.51953380788814496</Real>
+      <Real>0.045564218031784426</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">65</Int>
+      <Real>-0.034832530108168232</Real>
+      <Real>-0.50014496344496462</Real>
+      <Real>0.11598741843099425</Real>
+      <Real>0.40779017390557831</Real>
+      <Real>0.011199901216560273</Real>
+      <Real>-0.045425396100255505</Real>
+      <Real>-0.51933118858727911</Real>
+      <Real>0.18218527922514327</Real>
+      <Real>0.37532459171257293</Real>
+      <Real>0.0072467137498184323</Real>
+      <Real>-0.15311696790993051</Real>
+      <Real>-0.51278384813801825</Real>
+      <Real>0.48492220750431003</Real>
+      <Real>0.18097500104515701</Real>
+      <Real>3.6074984818065711e-06</Real>
+      <Real>-0.13278743328419851</Real>
+      <Real>-0.52875151750440053</Real>
+      <Real>0.45593004025726047</Real>
+      <Real>0.20554420513547464</Real>
+      <Real>6.4705395863929661e-05</Real>
+      <Real>-0.0046491606241226236</Real>
+      <Real>-0.34569837253547919</Real>
+      <Real>-0.23828863536588613</Real>
+      <Real>0.53226903083470045</Real>
+      <Real>0.056367137690787474</Real>
+      <Real>-0.13313999577356062</Real>
+      <Real>-0.52851141417561998</Real>
+      <Real>0.45650536422465193</Real>
+      <Real>0.20508349717179866</Real>
+      <Real>6.2548552730021432e-05</Real>
+      <Real>-0.023723982790674208</Real>
+      <Real>-0.46914679562135475</Real>
+      <Real>0.027653117742020838</Real>
+      <Real>0.44703008254271953</Real>
+      <Real>0.018187578127288623</Real>
+      <Real>-0.1044409359397518</Real>
+      <Real>-0.54291528648973197</Real>
+      <Real>0.39965376922055962</Real>
+      <Real>0.24720206478708404</Real>
+      <Real>0.00050038842184013438</Real>
+      <Real>-0.057771240463032621</Real>
+      <Real>-0.53353552805699944</Real>
+      <Real>0.24477502703072435</Real>
+      <Real>0.3421414919616802</Real>
+      <Real>0.0043902495276275291</Real>
+      <Real>-0.013510487389683298</Real>
+      <Real>-0.42267040103937348</Real>
+      <Real>-0.083712754882333984</Real>
+      <Real>0.48947866244152172</Real>
+      <Real>0.030414980869869036</Real>
+      <Real>-0.0096515085445540213</Real>
+      <Real>-0.39634333796672683</Real>
+      <Real>-0.13994616469967064</Real>
+      <Real>0.50752837747773805</Real>
+      <Real>0.038412633733213512</Real>
+      <Real>-0.00059061979071704568</Real>
+      <Real>-0.25215556429754155</Real>
+      <Real>-0.39244859365573209</Real>
+      <Real>0.54372635936695712</Real>
+      <Real>0.10146841837703359</Real>
+      <Real>-0.047346988432876699</Real>
+      <Real>-0.52203952869624104</Real>
+      <Real>0.19282346856287375</Real>
+      <Real>0.36985960269448226</Real>
+      <Real>0.0067034458717617042</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Int Name="X">18</Int>
+      <Int Name="Y">2</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">2</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">4</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">1</Int>
+      <Int Name="Z">3</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">16</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">10</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">16</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">15</Int>
+      <Int Name="Z">10</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">18</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">1</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 1 3">4.9479740823536002e-11</Real>
+    <Real Name="Cell 0 1 4">1.6626245726929841e-08</Real>
+    <Real Name="Cell 0 1 5">8.0732574400883411e-08</Real>
+    <Real Name="Cell 0 1 6">4.1582460178790155e-08</Real>
+    <Real Name="Cell 0 1 7">1.3781484180727238e-09</Real>
+    <Real Name="Cell 0 2 1">1.0513678870843961e-07</Real>
+    <Real Name="Cell 0 2 2">4.9392564698635728e-06</Real>
+    <Real Name="Cell 0 2 3">1.2117639002150265e-05</Real>
+    <Real Name="Cell 0 2 4">1.7536520861008393e-05</Real>
+    <Real Name="Cell 0 2 5">6.9627005449864914e-05</Real>
+    <Real Name="Cell 0 2 6">3.5850450440278356e-05</Real>
+    <Real Name="Cell 0 2 7">1.1881750466189399e-06</Real>
+    <Real Name="Cell 0 3 1">6.890511259260331e-05</Real>
+    <Real Name="Cell 0 3 2">0.0032371164019809355</Real>
+    <Real Name="Cell 0 3 3">0.0079140174146799629</Real>
+    <Real Name="Cell 0 3 4">0.0021834273903276508</Real>
+    <Real Name="Cell 0 3 5">0.00042687162378168933</Real>
+    <Real Name="Cell 0 3 6">0.00021204848948456936</Real>
+    <Real Name="Cell 0 3 7">7.027825892969387e-06</Real>
+    <Real Name="Cell 0 4 0">3.2167211187803997e-08</Real>
+    <Real Name="Cell 0 4 1">0.00038763225198604065</Real>
+    <Real Name="Cell 0 4 2">0.018190611663084513</Real>
+    <Real Name="Cell 0 4 3">0.044469469501171137</Real>
+    <Real Name="Cell 0 4 4">0.011844526987928358</Real>
+    <Real Name="Cell 0 4 5">0.00033669619657422108</Real>
+    <Real Name="Cell 0 4 6">0.00012949010409253451</Real>
+    <Real Name="Cell 0 4 7">4.2916311671771559e-06</Real>
+    <Real Name="Cell 0 5 0">0.00024233607822658125</Real>
+    <Real Name="Cell 0 5 1">0.0037765131373025777</Real>
+    <Real Name="Cell 0 5 2">0.016272564369407355</Real>
+    <Real Name="Cell 0 5 3">0.027701280279014685</Real>
+    <Real Name="Cell 0 5 4">0.0069693389359114545</Real>
+    <Real Name="Cell 0 5 5">6.0995882083439624e-05</Real>
+    <Real Name="Cell 0 5 6">5.7324384981392963e-06</Real>
+    <Real Name="Cell 0 5 7">1.8998758163759294e-07</Real>
+    <Real Name="Cell 0 6 0">0.0019020740106302041</Real>
+    <Real Name="Cell 0 6 1">0.035868393150081966</Real>
+    <Real Name="Cell 0 6 2">0.10233676223180677</Real>
+    <Real Name="Cell 0 6 3">0.055815489098793872</Real>
+    <Real Name="Cell 0 6 4">0.0032087988755052166</Real>
+    <Real Name="Cell 0 6 5">2.0553897142033654e-06</Real>
+    <Real Name="Cell 0 7 0">0.0014678570402335413</Real>
+    <Real Name="Cell 0 7 1">0.042571933720211924</Real>
+    <Real Name="Cell 0 7 2">0.18630208183056671</Real>
+    <Real Name="Cell 0 7 3">0.11973476726953122</Real>
+    <Real Name="Cell 0 7 4">0.0066958984413124914</Real>
+    <Real Name="Cell 0 7 5">4.2578291011704643e-11</Real>
+    <Real Name="Cell 0 8 0">9.3912967498973072e-05</Real>
+    <Real Name="Cell 0 8 1">0.0068458528441489377</Real>
+    <Real Name="Cell 0 8 2">0.041899673524474955</Real>
+    <Real Name="Cell 0 8 3">0.029404662179499844</Real>
+    <Real Name="Cell 0 8 4">0.0016953604960386203</Real>
+    <Real Name="Cell 0 8 5">4.1085899845168109e-11</Real>
+    <Real Name="Cell 0 9 0">9.5131650091012236e-09</Real>
+    <Real Name="Cell 0 9 1">3.6285186665321725e-05</Real>
+    <Real Name="Cell 0 9 2">0.00028568707151635465</Real>
+    <Real Name="Cell 0 9 3">0.00022660623541248136</Real>
+    <Real Name="Cell 0 9 4">1.5674494662014633e-05</Real>
+    <Real Name="Cell 0 9 5">3.5607113691946983e-12</Real>
+    <Real Name="Cell 1 1 3">1.5346986279876964e-08</Real>
+    <Real Name="Cell 1 1 4">5.1569139371013472e-06</Real>
+    <Real Name="Cell 1 1 5">2.5040586127729852e-05</Real>
+    <Real Name="Cell 1 1 6">1.2897509874260841e-05</Real>
+    <Real Name="Cell 1 1 7">4.2745625809211247e-07</Real>
+    <Real Name="Cell 1 2 1">4.908276528799683e-07</Real>
+    <Real Name="Cell 1 2 2">2.305875697609859e-05</Real>
+    <Real Name="Cell 1 2 3">6.9603101001052036e-05</Real>
+    <Real Name="Cell 1 2 4">0.0044609989034486448</Real>
+    <Real Name="Cell 1 2 5">0.021588929177202544</Real>
+    <Real Name="Cell 1 2 6">0.011119629203325362</Real>
+    <Real Name="Cell 1 2 7">0.00036853277392025576</Real>
+    <Real Name="Cell 1 3 1">0.00032168126020138337</Real>
+    <Real Name="Cell 1 3 2">0.015112371846259442</Real>
+    <Real Name="Cell 1 3 3">0.0370234145072037</Real>
+    <Real Name="Cell 1 3 4">0.036094968664250326</Real>
+    <Real Name="Cell 1 3 5">0.12776456595038849</Real>
+    <Real Name="Cell 1 3 6">0.065770458871125426</Real>
+    <Real Name="Cell 1 3 7">0.002179800171981933</Real>
+    <Real Name="Cell 1 4 0">4.8678827312710805e-17</Real>
+    <Real Name="Cell 1 4 1">0.0018076006566280362</Real>
+    <Real Name="Cell 1 4 2">0.084919877693199725</Real>
+    <Real Name="Cell 1 4 3">0.20765106553513776</Real>
+    <Real Name="Cell 1 4 4">0.071112994047407924</Real>
+    <Real Name="Cell 1 4 5">0.078375959818312566</Real>
+    <Real Name="Cell 1 4 6">0.040163566296262367</Real>
+    <Real Name="Cell 1 4 7">0.0013311226684847726</Real>
+    <Real Name="Cell 1 5 0">4.5872681735427457e-07</Real>
+    <Real Name="Cell 1 5 1">0.0025523108623422409</Real>
+    <Real Name="Cell 1 5 2">0.060390993794884447</Real>
+    <Real Name="Cell 1 5 3">0.12908264854096432</Real>
+    <Real Name="Cell 1 5 4">0.033337207319746556</Real>
+    <Real Name="Cell 1 5 5">0.0036848225515440768</Real>
+    <Real Name="Cell 1 5 6">0.0017780136580532566</Real>
+    <Real Name="Cell 1 5 7">5.8927891702945559e-05</Real>
+    <Real Name="Cell 1 6 0">1.8525444276679718e-05</Real>
+    <Real Name="Cell 1 6 1">0.060823493091753299</Real>
+    <Real Name="Cell 1 6 2">0.44043882770688458</Real>
+    <Real Name="Cell 1 6 3">0.32095086007456436</Real>
+    <Real Name="Cell 1 6 4">0.019502188148647608</Real>
+    <Real Name="Cell 1 6 5">9.59576136152423e-06</Real>
+    <Real Name="Cell 1 7 0">4.2023530924477262e-05</Real>
+    <Real Name="Cell 1 7 1">0.14104940189413367</Real>
+    <Real Name="Cell 1 7 2">1.0323580255566671</Real>
+    <Real Name="Cell 1 7 3">0.75697807028691433</Real>
+    <Real Name="Cell 1 7 4">0.045197615958555579</Real>
+    <Real Name="Cell 1 7 5">2.7359215279061732e-09</Real>
+    <Real Name="Cell 1 8 0">1.0284025479409903e-05</Real>
+    <Real Name="Cell 1 8 1">0.037435108584675789</Real>
+    <Real Name="Cell 1 8 2">0.28746524151708852</Real>
+    <Real Name="Cell 1 8 3">0.22225728405777784</Real>
+    <Real Name="Cell 1 8 4">0.014707046825307692</Real>
+    <Real Name="Cell 1 8 5">2.6400260604375077e-09</Real>
+    <Real Name="Cell 1 9 0">5.7700982496756358e-08</Real>
+    <Real Name="Cell 1 9 1">0.00052685468719330345</Real>
+    <Real Name="Cell 1 9 2">0.0053948153781404285</Real>
+    <Real Name="Cell 1 9 3">0.0052660358440288603</Real>
+    <Real Name="Cell 1 9 4">0.00047848296623588478</Real>
+    <Real Name="Cell 1 9 5">2.2879797798746884e-10</Real>
+    <Real Name="Cell 16 4 0">3.0591957622616733e-08</Real>
+    <Real Name="Cell 16 4 1">4.1716619052455725e-07</Real>
+    <Real Name="Cell 16 4 2">4.8825442595734692e-07</Real>
+    <Real Name="Cell 16 4 3">5.4526553078207448e-08</Real>
+    <Real Name="Cell 16 4 4">1.117254821698738e-12</Real>
+    <Real Name="Cell 16 5 0">0.00023039676378848261</Real>
+    <Real Name="Cell 16 5 1">0.0031417976399055404</Real>
+    <Real Name="Cell 16 5 2">0.0036771834295040396</Real>
+    <Real Name="Cell 16 5 3">0.00041065503308857382</Real>
+    <Real Name="Cell 16 5 4">8.4143649262955958e-09</Real>
+    <Real Name="Cell 16 6 0">0.001806023234463245</Real>
+    <Real Name="Cell 16 6 1">0.024627774463274996</Real>
+    <Real Name="Cell 16 6 2">0.028824531221126104</Real>
+    <Real Name="Cell 16 6 3">0.003219023214180718</Real>
+    <Real Name="Cell 16 6 4">6.5958125063309245e-08</Real>
+    <Real Name="Cell 16 7 0">0.0013893857976795517</Real>
+    <Real Name="Cell 16 7 1">0.018946312215024717</Real>
+    <Real Name="Cell 16 7 2">0.022174905360675456</Real>
+    <Real Name="Cell 16 7 3">0.0024764161672109941</Real>
+    <Real Name="Cell 16 7 4">5.0742028372502962e-08</Real>
+    <Real Name="Cell 16 8 0">8.7701479171100279e-05</Real>
+    <Real Name="Cell 16 8 1">0.0011959382403866987</Real>
+    <Real Name="Cell 16 8 2">0.0013997350511703885</Real>
+    <Real Name="Cell 16 8 3">0.00015631753345280895</Real>
+    <Real Name="Cell 16 8 4">3.2029627421287572e-09</Real>
+    <Real Name="Cell 17 4 0">3.4272375809873896e-07</Real>
+    <Real Name="Cell 17 4 1">4.6735408806467023e-06</Real>
+    <Real Name="Cell 17 4 2">5.4699471618230825e-06</Real>
+    <Real Name="Cell 17 4 3">6.1086464023204118e-07</Real>
+    <Real Name="Cell 17 4 4">1.251668088620264e-11</Real>
+    <Real Name="Cell 17 5 0">0.0025811504354660533</Real>
+    <Real Name="Cell 17 5 1">0.035197770198861576</Real>
+    <Real Name="Cell 17 5 2">0.041195733196437261</Real>
+    <Real Name="Cell 17 5 3">0.0046005959461132223</Real>
+    <Real Name="Cell 17 5 4">9.4266696009746056e-08</Real>
+    <Real Name="Cell 17 6 0">0.020232999723799272</Real>
+    <Real Name="Cell 17 6 1">0.27590661316233178</Real>
+    <Real Name="Cell 17 6 2">0.32292316128979293</Real>
+    <Real Name="Cell 17 6 3">0.03606293349973367</Real>
+    <Real Name="Cell 17 6 4">7.3893330978373592e-07</Real>
+    <Real Name="Cell 17 7 0">0.015565382506862265</Real>
+    <Real Name="Cell 17 7 1">0.21225680960164375</Real>
+    <Real Name="Cell 17 7 2">0.24842695568707113</Real>
+    <Real Name="Cell 17 7 3">0.027743456823291383</Real>
+    <Real Name="Cell 17 7 4">5.6846635550123161e-07</Real>
+    <Real Name="Cell 17 8 0">0.00098252556776936206</Real>
+    <Real Name="Cell 17 8 1">0.01339817651604942</Real>
+    <Real Name="Cell 17 8 2">0.015681325889552945</Real>
+    <Real Name="Cell 17 8 3">0.001751235837292897</Real>
+    <Real Name="Cell 17 8 4">3.5883006951508512e-08</Real>
+    <Real Name="Cell 18 2 1">3.6609907086066561e-10</Real>
+    <Real Name="Cell 18 2 2">1.71990910752863e-08</Real>
+    <Real Name="Cell 18 2 3">4.2046546896215035e-08</Real>
+    <Real Name="Cell 18 2 4">1.1150275906698594e-08</Real>
+    <Real Name="Cell 18 2 5">8.0643776011556709e-11</Real>
+    <Real Name="Cell 18 3 1">2.3993597300805377e-07</Real>
+    <Real Name="Cell 18 3 2">1.1272032573864506e-05</Real>
+    <Real Name="Cell 18 3 3">2.7556691464567284e-05</Real>
+    <Real Name="Cell 18 3 4">7.307727639659058e-06</Real>
+    <Real Name="Cell 18 3 5">5.2852750537956458e-08</Real>
+    <Real Name="Cell 18 4 0">3.4744914772034036e-07</Real>
+    <Real Name="Cell 18 4 1">6.0862336662597547e-06</Real>
+    <Real Name="Cell 18 4 2">6.8885497424581494e-05</Real>
+    <Real Name="Cell 18 4 3">0.00015546664610137969</Real>
+    <Real Name="Cell 18 4 4">4.1063807551389755e-05</Real>
+    <Real Name="Cell 18 4 5">2.969917069995424e-07</Real>
+    <Real Name="Cell 18 5 0">0.0026167387692974447</Real>
+    <Real Name="Cell 18 5 1">0.035684104200557266</Real>
+    <Real Name="Cell 18 5 2">0.041802541230034788</Real>
+    <Real Name="Cell 18 5 3">0.0047558371250823756</Real>
+    <Real Name="Cell 18 5 4">2.4176673527483894e-05</Real>
+    <Real Name="Cell 18 5 5">1.7364058883811605e-07</Real>
+    <Real Name="Cell 18 6 0">0.020511970341053575</Real>
+    <Real Name="Cell 18 6 1">0.27972077860183842</Real>
+    <Real Name="Cell 18 6 2">0.32744890776861246</Real>
+    <Real Name="Cell 18 6 3">0.036615402865375603</Real>
+    <Real Name="Cell 18 6 4">4.6687138830384599e-06</Real>
+    <Real Name="Cell 18 6 5">7.1571025525842582e-09</Real>
+    <Real Name="Cell 18 7 0">0.015780001074489215</Real>
+    <Real Name="Cell 18 7 1">0.21520604100121718</Real>
+    <Real Name="Cell 18 7 2">0.25201515923428436</Real>
+    <Real Name="Cell 18 7 3">0.028242825454598955</Real>
+    <Real Name="Cell 18 7 4">7.2228046199710238e-06</Real>
+    <Real Name="Cell 18 8 0">0.00099607408809970375</Real>
+    <Real Name="Cell 18 8 1">0.01358845932780222</Real>
+    <Real Name="Cell 18 8 2">0.01593741447618845</Real>
+    <Real Name="Cell 18 8 3">0.0018039767480669806</Real>
+    <Real Name="Cell 18 8 4">1.6629136614134367e-06</Real>
+    <Real Name="Cell 18 9 0">9.5554951885286652e-12</Real>
+    <Real Name="Cell 18 9 1">3.1151376234511103e-08</Real>
+    <Real Name="Cell 18 9 2">2.2374718276577056e-07</Real>
+    <Real Name="Cell 18 9 3">1.6044081225890489e-07</Real>
+    <Real Name="Cell 18 9 4">9.1260685272821227e-09</Real>
+    <Real Name="Cell 2 0 0">0.00015445186807673834</Real>
+    <Real Name="Cell 2 0 1">0.0045548659421078665</Real>
+    <Real Name="Cell 2 0 10">5.0484629021891178e-10</Real>
+    <Real Name="Cell 2 0 2">0.0087315455428858494</Real>
+    <Real Name="Cell 2 0 3">0.0017724924323999545</Real>
+    <Real Name="Cell 2 0 4">4.969733034487073e-06</Real>
+    <Real Name="Cell 2 1 0">0.00091702206667114829</Real>
+    <Real Name="Cell 2 1 1">0.02705214160316986</Real>
+    <Real Name="Cell 2 1 10">9.1556297509847007e-11</Real>
+    <Real Name="Cell 2 1 2">0.051859984281513956</Real>
+    <Real Name="Cell 2 1 3">0.010527666868546792</Real>
+    <Real Name="Cell 2 1 4">5.4067366072504947e-05</Real>
+    <Real Name="Cell 2 1 5">0.00011920801347780539</Real>
+    <Real Name="Cell 2 1 6">6.1399782060948146e-05</Real>
+    <Real Name="Cell 2 1 7">2.0349448337947681e-06</Real>
+    <Real Name="Cell 2 15 0">1.3415134170144429e-09</Real>
+    <Real Name="Cell 2 15 1">4.7521702804424301e-09</Real>
+    <Real Name="Cell 2 15 10">1.1652762451484694e-11</Real>
+    <Real Name="Cell 2 15 2">1.8318510524348346e-09</Real>
+    <Real Name="Cell 2 15 3">3.4380928522370846e-11</Real>
+    <Real Name="Cell 2 16 0">2.0838605945675685e-07</Real>
+    <Real Name="Cell 2 16 1">5.2795214152132265e-06</Real>
+    <Real Name="Cell 2 16 10">2.9043424475043593e-10</Real>
+    <Real Name="Cell 2 16 2">9.9396508980883738e-06</Real>
+    <Real Name="Cell 2 16 3">2.0093413862421701e-06</Real>
+    <Real Name="Cell 2 16 4">5.6314147488440349e-09</Real>
+    <Real Name="Cell 2 2 0">0.00056195091754646348</Real>
+    <Real Name="Cell 2 2 1">0.016577957740282697</Real>
+    <Real Name="Cell 2 2 10">1.5365116311398331e-13</Real>
+    <Real Name="Cell 2 2 2">0.031791611977287269</Real>
+    <Real Name="Cell 2 2 3">0.006542409977773834</Real>
+    <Real Name="Cell 2 2 4">0.021191353091345382</Real>
+    <Real Name="Cell 2 2 5">0.10277562215279767</Real>
+    <Real Name="Cell 2 2 6">0.052936017598657584</Real>
+    <Real Name="Cell 2 2 7">0.0017544341676510784</Real>
+    <Real Name="Cell 2 3 0">2.5046602068380665e-05</Real>
+    <Real Name="Cell 2 3 1">0.00089910276643434582</Real>
+    <Real Name="Cell 2 3 2">0.0089341095659474616</Real>
+    <Real Name="Cell 2 3 3">0.019036980132589476</Real>
+    <Real Name="Cell 2 3 4">0.1300658791051732</Real>
+    <Real Name="Cell 2 3 5">0.60793288056058503</Real>
+    <Real Name="Cell 2 3 6">0.31310631897981711</Real>
+    <Real Name="Cell 2 3 7">0.010377139215315263</Real>
+    <Real Name="Cell 2 4 0">1.9971795888534043e-07</Real>
+    <Real Name="Cell 2 4 1">0.00090689893895242271</Real>
+    <Real Name="Cell 2 4 2">0.042257317076231343</Real>
+    <Real Name="Cell 2 4 3">0.10349468451861138</Real>
+    <Real Name="Cell 2 4 4">0.10383407971439287</Real>
+    <Real Name="Cell 2 4 5">0.37141846770980802</Real>
+    <Real Name="Cell 2 4 6">0.1912023515719371</Real>
+    <Real Name="Cell 2 4 7">0.0063369318991148881</Real>
+    <Real Name="Cell 2 5 0">4.3300548837069532e-07</Real>
+    <Real Name="Cell 2 5 1">0.0014647168090771909</Real>
+    <Real Name="Cell 2 5 2">0.031411138793115134</Real>
+    <Real Name="Cell 2 5 3">0.065192602942507033</Real>
+    <Real Name="Cell 2 5 4">0.019668212383341096</Real>
+    <Real Name="Cell 2 5 5">0.016549469416744719</Real>
+    <Real Name="Cell 2 5 6">0.0084643975596968239</Real>
+    <Real Name="Cell 2 5 7">0.00028053164860084045</Real>
+    <Real Name="Cell 2 6 0">1.1564073487337495e-05</Real>
+    <Real Name="Cell 2 6 1">0.038780054382099659</Real>
+    <Real Name="Cell 2 6 2">0.28457861246858152</Real>
+    <Real Name="Cell 2 6 3">0.21031175059436169</Real>
+    <Real Name="Cell 2 6 4">0.013056399157831716</Real>
+    <Real Name="Cell 2 6 5">4.7735698990094365e-06</Real>
+    <Real Name="Cell 2 7 0">2.6210941095015262e-05</Real>
+    <Real Name="Cell 2 7 1">0.09687377922004041</Real>
+    <Real Name="Cell 2 7 2">0.75012528681155177</Real>
+    <Real Name="Cell 2 7 3">0.58502414895287624</Real>
+    <Real Name="Cell 2 7 4">0.039312117542748368</Real>
+    <Real Name="Cell 2 7 5">7.7166352246466984e-09</Real>
+    <Real Name="Cell 2 8 0">6.414357407535341e-06</Real>
+    <Real Name="Cell 2 8 1">0.031935527165092181</Real>
+    <Real Name="Cell 2 8 2">0.28179723453710215</Real>
+    <Real Name="Cell 2 8 3">0.24755128063814402</Real>
+    <Real Name="Cell 2 8 4">0.019904712380116096</Real>
+    <Real Name="Cell 2 8 5">7.4461631608083059e-09</Real>
+    <Real Name="Cell 2 9 0">3.5989285544223758e-08</Real>
+    <Real Name="Cell 2 9 1">0.0010727579703914717</Real>
+    <Real Name="Cell 2 9 2">0.012247960886355646</Real>
+    <Real Name="Cell 2 9 3">0.012724512135907948</Real>
+    <Real Name="Cell 2 9 4">0.0012284964703332458</Real>
+    <Real Name="Cell 2 9 5">6.4532206726602809e-10</Real>
+    <Real Name="Cell 3 0 0">0.015899136314447414</Real>
+    <Real Name="Cell 3 0 1">0.11672610427978347</Real>
+    <Real Name="Cell 3 0 10">0.00011789103208376422</Real>
+    <Real Name="Cell 3 0 2">0.15013454964738263</Real>
+    <Real Name="Cell 3 0 3">0.027063028371588197</Real>
+    <Real Name="Cell 3 0 4">7.4904413298601993e-05</Real>
+    <Real Name="Cell 3 1 0">0.016283157315938795</Real>
+    <Real Name="Cell 3 1 1">0.41646885582143139</Real>
+    <Real Name="Cell 3 1 10">2.1380104432427704e-05</Real>
+    <Real Name="Cell 3 1 2">0.78503708116938986</Real>
+    <Real Name="Cell 3 1 3">0.15874452985591544</Real>
+    <Real Name="Cell 3 1 4">0.00045735091069704136</Real>
+    <Real Name="Cell 3 1 5">6.033386787915789e-05</Real>
+    <Real Name="Cell 3 1 6">3.1075816386824106e-05</Real>
+    <Real Name="Cell 3 1 7">1.0299315386746828e-06</Real>
+    <Real Name="Cell 3 10 0">6.1613480093664233e-08</Real>
+    <Real Name="Cell 3 10 1">1.0545672672824666e-06</Real>
+    <Real Name="Cell 3 10 2">1.4445971479036167e-06</Real>
+    <Real Name="Cell 3 10 3">1.9672812754632667e-07</Real>
+    <Real Name="Cell 3 10 4">4.9765045164443508e-11</Real>
+    <Real Name="Cell 3 11 0">4.0593710056290399e-05</Real>
+    <Real Name="Cell 3 11 1">0.00069479597350841766</Real>
+    <Real Name="Cell 3 11 2">0.0009517650631160118</Real>
+    <Real Name="Cell 3 11 3">0.00012961326900204912</Real>
+    <Real Name="Cell 3 11 4">3.278743241369594e-08</Real>
+    <Real Name="Cell 3 12 0">0.00022833991480983664</Real>
+    <Real Name="Cell 3 12 1">0.0039082324128820361</Real>
+    <Real Name="Cell 3 12 2">0.0053536854140586766</Real>
+    <Real Name="Cell 3 12 3">0.00072907558242674489</Real>
+    <Real Name="Cell 3 12 4">1.8442954619804386e-07</Real>
+    <Real Name="Cell 3 13 0">0.00013361944893374375</Real>
+    <Real Name="Cell 3 13 1">0.0022870108441145694</Real>
+    <Real Name="Cell 3 13 2">0.003132857850923247</Real>
+    <Real Name="Cell 3 13 3">0.00042663884514470895</Real>
+    <Real Name="Cell 3 13 4">1.0792407604516389e-07</Real>
+    <Real Name="Cell 3 14 0">5.5155400250989383e-06</Real>
+    <Real Name="Cell 3 14 1">9.4403172211883734e-05</Real>
+    <Real Name="Cell 3 14 2">0.00012931802224600355</Real>
+    <Real Name="Cell 3 14 3">1.7610786793653479e-05</Real>
+    <Real Name="Cell 3 14 4">4.4548871129837326e-09</Real>
+    <Real Name="Cell 3 15 0">0.00031326842318178026</Real>
+    <Real Name="Cell 3 15 1">0.00110972046314576</Real>
+    <Real Name="Cell 3 15 10">2.7211375395801689e-06</Real>
+    <Real Name="Cell 3 15 2">0.00042777141355565513</Real>
+    <Real Name="Cell 3 15 3">8.0285885546328847e-06</Real>
+    <Real Name="Cell 3 16 0">0.0078105603778430722</Real>
+    <Real Name="Cell 3 16 1">0.027736536769341732</Real>
+    <Real Name="Cell 3 16 10">6.7821817312454626e-05</Real>
+    <Real Name="Cell 3 16 2">0.010810927299283632</Real>
+    <Real Name="Cell 3 16 3">0.00023037720704507705</Real>
+    <Real Name="Cell 3 16 4">8.4877359583721074e-08</Real>
+    <Real Name="Cell 3 2 0">0.0085779551026819879</Real>
+    <Real Name="Cell 3 2 1">0.25355917668716771</Real>
+    <Real Name="Cell 3 2 10">3.5880414596141041e-08</Real>
+    <Real Name="Cell 3 2 2">0.48680327118079653</Real>
+    <Real Name="Cell 3 2 3">0.099040713430520774</Real>
+    <Real Name="Cell 3 2 4">0.010993044079633829</Real>
+    <Real Name="Cell 3 2 5">0.052017037966696912</Real>
+    <Real Name="Cell 3 2 6">0.026792114042239482</Real>
+    <Real Name="Cell 3 2 7">0.00088795875533525604</Real>
+    <Real Name="Cell 3 3 0">0.0009104641725514442</Real>
+    <Real Name="Cell 3 3 1">0.030150891559067361</Real>
+    <Real Name="Cell 3 3 2">0.062042893425351207</Real>
+    <Real Name="Cell 3 3 3">0.014338561585781928</Real>
+    <Real Name="Cell 3 3 4">0.063567726507331238</Real>
+    <Real Name="Cell 3 3 5">0.30767181898838308</Real>
+    <Real Name="Cell 3 3 6">0.15847017939758667</Real>
+    <Real Name="Cell 3 3 7">0.0052521045197773354</Real>
+    <Real Name="Cell 3 4 0">0.00081540986631094747</Real>
+    <Real Name="Cell 3 4 1">0.030405860406687836</Real>
+    <Real Name="Cell 3 4 2">0.068229856996604762</Real>
+    <Real Name="Cell 3 4 3">0.019460753443483872</Real>
+    <Real Name="Cell 3 4 4">0.039647222187578213</Real>
+    <Real Name="Cell 3 4 5">0.187889199111751</Real>
+    <Real Name="Cell 3 4 6">0.096771828347541097</Real>
+    <Real Name="Cell 3 4 7">0.0032072643508282497</Real>
+    <Real Name="Cell 3 5 0">0.00044548212654713673</Real>
+    <Real Name="Cell 3 5 1">0.017766924610801954</Real>
+    <Real Name="Cell 3 5 2">0.042441962324856898</Real>
+    <Real Name="Cell 3 5 3">0.013041415153522374</Real>
+    <Real Name="Cell 3 5 4">0.0023293644925800119</Real>
+    <Real Name="Cell 3 5 5">0.0083210574797234864</Real>
+    <Real Name="Cell 3 5 6">0.0042840227694801473</Real>
+    <Real Name="Cell 3 5 7">0.00014198340303486998</Real>
+    <Real Name="Cell 3 6 0">2.6971571752651984e-05</Real>
+    <Real Name="Cell 3 6 1">0.0033135486103988165</Real>
+    <Real Name="Cell 3 6 2">0.019783289891593309</Real>
+    <Real Name="Cell 3 6 3">0.014275744590630378</Real>
+    <Real Name="Cell 3 6 4">0.00096128929981621888</Real>
+    <Real Name="Cell 3 6 5">1.4876692606671744e-07</Real>
+    <Real Name="Cell 3 7 0">1.2079912201636798e-06</Real>
+    <Real Name="Cell 3 7 1">0.0074313122805206612</Real>
+    <Real Name="Cell 3 7 2">0.070089498398585748</Real>
+    <Real Name="Cell 3 7 3">0.064763477013715876</Real>
+    <Real Name="Cell 3 7 4">0.0055410748938068063</Real>
+    <Real Name="Cell 3 7 5">2.37476017279155e-09</Real>
+    <Real Name="Cell 3 8 0">2.938249761202904e-07</Real>
+    <Real Name="Cell 3 8 1">0.004350597372893018</Real>
+    <Real Name="Cell 3 8 2">0.047379857080942452</Real>
+    <Real Name="Cell 3 8 3">0.047972123742179094</Real>
+    <Real Name="Cell 3 8 4">0.0045209288150333425</Real>
+    <Real Name="Cell 3 8 5">2.2915235979947213e-09</Real>
+    <Real Name="Cell 3 9 0">1.6485752654186814e-09</Real>
+    <Real Name="Cell 3 9 1">0.00029940412546229471</Real>
+    <Real Name="Cell 3 9 2">0.0035485178617052564</Real>
+    <Real Name="Cell 3 9 3">0.0037576292463859535</Real>
+    <Real Name="Cell 3 9 4">0.00036906100862140552</Real>
+    <Real Name="Cell 3 9 5">1.9859499631032996e-10</Real>
+    <Real Name="Cell 4 0 0">0.133126185601043</Real>
+    <Real Name="Cell 4 0 1">0.5474492739278628</Real>
+    <Real Name="Cell 4 0 10">0.0011309851892542036</Real>
+    <Real Name="Cell 4 0 2">0.34307522180441824</Real>
+    <Real Name="Cell 4 0 3">0.036888979430054356</Real>
+    <Real Name="Cell 4 0 4">9.4073701897767642e-05</Real>
+    <Real Name="Cell 4 1 0">0.040980752596047623</Real>
+    <Real Name="Cell 4 1 1">0.59605381702291205</Real>
+    <Real Name="Cell 4 1 10">0.00020510959171689182</Real>
+    <Real Name="Cell 4 1 2">1.0146150749870528</Real>
+    <Real Name="Cell 4 1 3">0.20004366591318026</Real>
+    <Real Name="Cell 4 1 4">0.00055982924098096117</Real>
+    <Real Name="Cell 4 1 5">1.9377939534407772e-06</Real>
+    <Real Name="Cell 4 1 6">9.9808832434271717e-07</Real>
+    <Real Name="Cell 4 1 7">3.3079183852411305e-08</Real>
+    <Real Name="Cell 4 10 0">3.7337017077065266e-06</Real>
+    <Real Name="Cell 4 10 1">6.3905489525316407e-05</Real>
+    <Real Name="Cell 4 10 2">8.7540824343573307e-05</Real>
+    <Real Name="Cell 4 10 3">1.1921484465039313e-05</Real>
+    <Real Name="Cell 4 10 4">3.0157010094562396e-09</Real>
+    <Real Name="Cell 4 11 0">0.0024599292935394601</Real>
+    <Real Name="Cell 4 11 1">0.042103788145911869</Real>
+    <Real Name="Cell 4 11 2">0.057675801400756836</Real>
+    <Real Name="Cell 4 11 3">0.0078544059364720059</Real>
+    <Real Name="Cell 4 11 4">1.9868783942771841e-06</Real>
+    <Real Name="Cell 4 12 0">0.013837120197836682</Real>
+    <Real Name="Cell 4 12 1">0.23683411506554683</Real>
+    <Real Name="Cell 4 12 2">0.32442680307308097</Real>
+    <Real Name="Cell 4 12 3">0.044181090615489978</Real>
+    <Real Name="Cell 4 12 4">1.1176205443100524e-05</Real>
+    <Real Name="Cell 4 13 0">0.0080971755516537659</Real>
+    <Real Name="Cell 4 13 1">0.13859006634965235</Real>
+    <Real Name="Cell 4 13 2">0.18984736278833814</Real>
+    <Real Name="Cell 4 13 3">0.025853793395035699</Real>
+    <Real Name="Cell 4 13 4">6.5400673102689055e-06</Real>
+    <Real Name="Cell 4 14 0">0.00033423499499346147</Real>
+    <Real Name="Cell 4 14 1">0.0057207170373203553</Real>
+    <Real Name="Cell 4 14 2">0.0078365143433406607</Real>
+    <Real Name="Cell 4 14 3">0.0010671921895267365</Real>
+    <Real Name="Cell 4 14 4">2.6996072281749859e-07</Real>
+    <Real Name="Cell 4 15 0">0.0030053341684876602</Real>
+    <Real Name="Cell 4 15 1">0.010646080417197543</Real>
+    <Real Name="Cell 4 15 10">2.6105176965471934e-05</Real>
+    <Real Name="Cell 4 15 2">0.004103816249348192</Real>
+    <Real Name="Cell 4 15 3">7.7022099013043731e-05</Real>
+    <Real Name="Cell 4 16 0">0.074908465129061255</Real>
+    <Real Name="Cell 4 16 1">0.26544132891853162</Real>
+    <Real Name="Cell 4 16 10">0.00065064720812851602</Real>
+    <Real Name="Cell 4 16 2">0.10247108226089444</Real>
+    <Real Name="Cell 4 16 3">0.0019577232995084013</Real>
+    <Real Name="Cell 4 16 4">1.0659889146341705e-07</Real>
+    <Real Name="Cell 4 2 0">0.01267023835150325</Real>
+    <Real Name="Cell 4 2 1">0.38451543644451536</Real>
+    <Real Name="Cell 4 2 10">3.4421801875228903e-07</Real>
+    <Real Name="Cell 4 2 2">0.75113671344938193</Real>
+    <Real Name="Cell 4 2 3">0.15607059201749374</Real>
+    <Real Name="Cell 4 2 4">0.00083355352107825564</Real>
+    <Real Name="Cell 4 2 5">0.0016706752268287968</Real>
+    <Real Name="Cell 4 2 6">0.00086050502671124369</Real>
+    <Real Name="Cell 4 2 7">2.8519323681349135e-05</Real>
+    <Real Name="Cell 4 3 0">0.0096787987704337903</Real>
+    <Real Name="Cell 4 3 1">0.34092837648570989</Real>
+    <Real Name="Cell 4 3 2">0.72087715415569853</Real>
+    <Real Name="Cell 4 3 3">0.16348296129708256</Real>
+    <Real Name="Cell 4 3 4">0.0027460129719335206</Real>
+    <Real Name="Cell 4 3 5">0.0098817212592206966</Real>
+    <Real Name="Cell 4 3 6">0.0050897210179259734</Real>
+    <Real Name="Cell 4 3 7">0.0001686862907852668</Real>
+    <Real Name="Cell 4 4 0">0.0085097959371298847</Real>
+    <Real Name="Cell 4 4 1">0.31786585796828204</Real>
+    <Real Name="Cell 4 4 2">0.70063491826719182</Real>
+    <Real Name="Cell 4 4 3">0.16863468706298085</Real>
+    <Real Name="Cell 4 4 4">0.0022699270810111055</Real>
+    <Real Name="Cell 4 4 5">0.006034398630144518</Real>
+    <Real Name="Cell 4 4 6">0.0031081028024071596</Real>
+    <Real Name="Cell 4 4 7">0.00010301042655791835</Real>
+    <Real Name="Cell 4 5 0">0.0038281445627319885</Real>
+    <Real Name="Cell 4 5 1">0.1672464291750031</Real>
+    <Real Name="Cell 4 5 2">0.40977193731401379</Real>
+    <Real Name="Cell 4 5 3">0.11308303333443409</Real>
+    <Real Name="Cell 4 5 4">0.0011849364518967463</Real>
+    <Real Name="Cell 4 5 5">0.00026713874151849747</Real>
+    <Real Name="Cell 4 5 6">0.00013759358898932756</Real>
+    <Real Name="Cell 4 5 7">4.5602012528184056e-06</Real>
+    <Real Name="Cell 4 6 0">0.00038022745951561422</Real>
+    <Real Name="Cell 4 6 1">0.021746648116490682</Real>
+    <Real Name="Cell 4 6 2">0.061283321782474177</Real>
+    <Real Name="Cell 4 6 3">0.01997256380053733</Real>
+    <Real Name="Cell 4 6 4">0.00036493206183265368</Real>
+    <Real Name="Cell 4 6 5">2.5074219693784609e-09</Real>
+    <Real Name="Cell 4 7 0">2.5291074077738082e-06</Real>
+    <Real Name="Cell 4 7 1">0.00040782063721388217</Real>
+    <Real Name="Cell 4 7 2">0.0036335952348797609</Real>
+    <Real Name="Cell 4 7 3">0.0037755058749347013</Real>
+    <Real Name="Cell 4 7 4">0.00039978329539623408</Real>
+    <Real Name="Cell 4 7 5">7.494760396823547e-09</Real>
+    <Real Name="Cell 4 8 1">0.00010068752756718856</Real>
+    <Real Name="Cell 4 8 2">0.0013118448451629389</Real>
+    <Real Name="Cell 4 8 3">0.0014892706048971367</Real>
+    <Real Name="Cell 4 8 4">0.00016035669040550973</Real>
+    <Real Name="Cell 4 8 5">2.4565311284381348e-09</Real>
+    <Real Name="Cell 4 9 1">4.0350330391010803e-06</Real>
+    <Real Name="Cell 4 9 2">4.9561160559909242e-05</Real>
+    <Real Name="Cell 4 9 3">5.3875236214470152e-05</Real>
+    <Real Name="Cell 4 9 4">5.4807985715573241e-06</Real>
+    <Real Name="Cell 4 9 5">3.3015749952792959e-11</Real>
+    <Real Name="Cell 5 0 0">0.11770311353212747</Real>
+    <Real Name="Cell 5 0 1">0.42621899606965957</Real>
+    <Real Name="Cell 5 0 10">0.0010193009370130027</Real>
+    <Real Name="Cell 5 0 2">0.18042927066502606</Real>
+    <Real Name="Cell 5 0 3">0.0071063720035356888</Real>
+    <Real Name="Cell 5 0 4">1.149275196397271e-05</Real>
+    <Real Name="Cell 5 1 0">0.023415618988298772</Real>
+    <Real Name="Cell 5 1 1">0.13843144777727917</Real>
+    <Real Name="Cell 5 1 10">0.00018485511659551137</Real>
+    <Real Name="Cell 5 1 2">0.15001699133198049</Real>
+    <Real Name="Cell 5 1 3">0.025124513971455879</Real>
+    <Real Name="Cell 5 1 4">6.9272258088587743e-05</Real>
+    <Real Name="Cell 5 10 0">1.0264868325268343e-05</Real>
+    <Real Name="Cell 5 10 1">0.00017569197718318345</Real>
+    <Real Name="Cell 5 10 2">0.0002406713512002004</Real>
+    <Real Name="Cell 5 10 3">3.2775105740980442e-05</Real>
+    <Real Name="Cell 5 10 4">8.290907039133046e-09</Real>
+    <Real Name="Cell 5 11 0">0.0067629533006169336</Real>
+    <Real Name="Cell 5 11 1">0.11575371444931457</Real>
+    <Real Name="Cell 5 11 2">0.15856502561817157</Real>
+    <Real Name="Cell 5 11 3">0.021593702181585284</Real>
+    <Real Name="Cell 5 11 4">5.4624195214844321e-06</Real>
+    <Real Name="Cell 5 12 0">0.038041661587088091</Real>
+    <Real Name="Cell 5 12 1">0.65111548709460387</Real>
+    <Real Name="Cell 5 12 2">0.89192942431883637</Real>
+    <Real Name="Cell 5 12 3">0.12146473209112615</Real>
+    <Real Name="Cell 5 12 4">3.0726149604501696e-05</Real>
+    <Real Name="Cell 5 13 0">0.022261135824737127</Real>
+    <Real Name="Cell 5 13 1">0.38101832809328512</Real>
+    <Real Name="Cell 5 13 2">0.52193729801698308</Real>
+    <Real Name="Cell 5 13 3">0.071078464667106572</Real>
+    <Real Name="Cell 5 13 4">1.7980260619035756e-05</Real>
+    <Real Name="Cell 5 14 0">0.00091889456681103372</Real>
+    <Real Name="Cell 5 14 1">0.015727664315820143</Real>
+    <Real Name="Cell 5 14 2">0.021544513772333559</Real>
+    <Real Name="Cell 5 14 3">0.002933974955909309</Real>
+    <Real Name="Cell 5 14 4">7.4218871502139319e-07</Real>
+    <Real Name="Cell 5 15 0">0.0027085588415147145</Real>
+    <Real Name="Cell 5 15 1">0.0095947850138700681</Real>
+    <Real Name="Cell 5 15 10">2.3527303093458172e-05</Real>
+    <Real Name="Cell 5 15 2">0.0036985663367070055</Real>
+    <Real Name="Cell 5 15 3">6.9416203183415799e-05</Real>
+    <Real Name="Cell 5 16 0">0.067508709566095532</Real>
+    <Real Name="Cell 5 16 1">0.23915301021901</Real>
+    <Real Name="Cell 5 16 10">0.00058639610422097819</Real>
+    <Real Name="Cell 5 16 2">0.092206199549789175</Real>
+    <Real Name="Cell 5 16 3">0.0017347788936183891</Real>
+    <Real Name="Cell 5 16 4">1.3022923457980471e-08</Real>
+    <Real Name="Cell 5 2 0">0.0042767928502442046</Real>
+    <Real Name="Cell 5 2 1">0.14260649828480482</Real>
+    <Real Name="Cell 5 2 10">3.1022665228917236e-07</Real>
+    <Real Name="Cell 5 2 2">0.29417368623015311</Real>
+    <Real Name="Cell 5 2 3">0.06501877277952775</Real>
+    <Real Name="Cell 5 2 4">0.00025889350787007895</Real>
+    <Real Name="Cell 5 3 0">0.013202573969039771</Real>
+    <Real Name="Cell 5 3 1">0.46852986001851926</Real>
+    <Real Name="Cell 5 3 2">0.99437149801590496</Real>
+    <Real Name="Cell 5 3 3">0.22638233528685536</Real>
+    <Real Name="Cell 5 3 4">0.00099699195104319149</Real>
+    <Real Name="Cell 5 4 0">0.010738487310442526</Real>
+    <Real Name="Cell 5 4 1">0.44377346459425671</Real>
+    <Real Name="Cell 5 4 2">1.0421726448235411</Real>
+    <Real Name="Cell 5 4 3">0.27062400088295574</Real>
+    <Real Name="Cell 5 4 4">0.0020911778684610375</Real>
+    <Real Name="Cell 5 5 0">0.007706342132584568</Real>
+    <Real Name="Cell 5 5 1">0.45090850981172659</Real>
+    <Real Name="Cell 5 5 2">1.2437763994756306</Real>
+    <Real Name="Cell 5 5 3">0.37929625939321432</Real>
+    <Real Name="Cell 5 5 4">0.0043466021115814669</Real>
+    <Real Name="Cell 5 5 5">2.6303807303724975e-09</Real>
+    <Real Name="Cell 5 6 0">0.0018732571429053411</Real>
+    <Real Name="Cell 5 6 1">0.12811614078768885</Real>
+    <Real Name="Cell 5 6 2">0.42113163177770868</Real>
+    <Real Name="Cell 5 6 3">0.19109116801872655</Real>
+    <Real Name="Cell 5 6 4">0.010313112016963737</Real>
+    <Real Name="Cell 5 6 5">1.9277819425816929e-07</Real>
+    <Real Name="Cell 5 7 0">2.2397250310540012e-05</Real>
+    <Real Name="Cell 5 7 1">0.016498265772688772</Real>
+    <Real Name="Cell 5 7 2">0.20926295352574414</Real>
+    <Real Name="Cell 5 7 3">0.24163402265709524</Real>
+    <Real Name="Cell 5 7 4">0.026909873769326405</Real>
+    <Real Name="Cell 5 7 5">5.7478378791358553e-07</Real>
+    <Real Name="Cell 5 8 1">0.0048797522262633841</Real>
+    <Real Name="Cell 5 8 2">0.066709536978584269</Real>
+    <Real Name="Cell 5 8 3">0.078217059554019447</Real>
+    <Real Name="Cell 5 8 4">0.0087550729578455798</Real>
+    <Real Name="Cell 5 8 5">1.871152283239253e-07</Real>
+    <Real Name="Cell 5 9 1">6.1883226488395235e-05</Real>
+    <Real Name="Cell 5 9 2">0.0008459858604220222</Real>
+    <Real Name="Cell 5 9 3">0.00099192003757619224</Real>
+    <Real Name="Cell 5 9 4">0.00011102862146499881</Real>
+    <Real Name="Cell 5 9 5">2.372926639897037e-09</Real>
+    <Real Name="Cell 6 0 0">0.0092672473304723311</Real>
+    <Real Name="Cell 6 0 1">0.032828991604000851</Real>
+    <Real Name="Cell 6 0 10">8.0497665752031437e-05</Real>
+    <Real Name="Cell 6 0 2">0.012656103725794182</Real>
+    <Real Name="Cell 6 0 3">0.00023783273117372765</Real>
+    <Real Name="Cell 6 0 4">9.2006474688292464e-10</Real>
+    <Real Name="Cell 6 1 0">0.0016828704520302244</Real>
+    <Real Name="Cell 6 1 1">0.0060309907631398429</Real>
+    <Real Name="Cell 6 1 10">1.4598637995825225e-05</Real>
+    <Real Name="Cell 6 1 2">0.0024580205988672965</Real>
+    <Real Name="Cell 6 1 3">7.986935820788236e-05</Real>
+    <Real Name="Cell 6 1 4">1.5644908672818736e-07</Real>
+    <Real Name="Cell 6 10 0">3.077313387497189e-06</Real>
+    <Real Name="Cell 6 10 1">5.2670843534422768e-05</Real>
+    <Real Name="Cell 6 10 2">7.215106395590838e-05</Real>
+    <Real Name="Cell 6 10 3">9.8256761292374825e-06</Real>
+    <Real Name="Cell 6 10 4">2.4855378965956516e-09</Real>
+    <Real Name="Cell 6 11 0">0.0020274713782519696</Real>
+    <Real Name="Cell 6 11 1">0.034701902044914017</Real>
+    <Real Name="Cell 6 11 2">0.047536340522018154</Real>
+    <Real Name="Cell 6 11 3">0.0064735938838535977</Real>
+    <Real Name="Cell 6 11 4">1.6375832781226253e-06</Real>
+    <Real Name="Cell 6 12 0">0.011404541273696604</Real>
+    <Real Name="Cell 6 12 1">0.19519845182140685</Real>
+    <Real Name="Cell 6 12 2">0.26739226175970099</Real>
+    <Real Name="Cell 6 12 3">0.036414012759682479</Real>
+    <Real Name="Cell 6 12 4">9.2114178699611053e-06</Real>
+    <Real Name="Cell 6 13 0">0.0066736843692114306</Real>
+    <Real Name="Cell 6 13 1">0.11422580054309768</Real>
+    <Real Name="Cell 6 13 2">0.15647201539526656</Real>
+    <Real Name="Cell 6 13 3">0.021308671865219956</Real>
+    <Real Name="Cell 6 13 4">5.3903172413271835e-06</Real>
+    <Real Name="Cell 6 14 0">0.0002754761641886042</Real>
+    <Real Name="Cell 6 14 1">0.0047150095275937127</Real>
+    <Real Name="Cell 6 14 2">0.0064588476498539452</Real>
+    <Real Name="Cell 6 14 3">0.00087957878506592189</Real>
+    <Real Name="Cell 6 14 4">2.2250137034514399e-07</Real>
+    <Real Name="Cell 6 15 0">0.00021390411445406103</Real>
+    <Real Name="Cell 6 15 1">0.00075773284313115517</Real>
+    <Real Name="Cell 6 15 10">1.8580312365981586e-06</Real>
+    <Real Name="Cell 6 15 2">0.00029208837736029468</Real>
+    <Real Name="Cell 6 15 3">5.4820339300467294e-06</Real>
+    <Real Name="Cell 6 16 0">0.0053313607452783532</Real>
+    <Real Name="Cell 6 16 1">0.018885785929965981</Real>
+    <Real Name="Cell 6 16 10">4.6309697050020013e-05</Real>
+    <Real Name="Cell 6 16 2">0.0072800324366607532</Real>
+    <Real Name="Cell 6 16 3">0.00013663495876952339</Real>
+    <Real Name="Cell 6 16 4">1.0425642885710289e-12</Real>
+    <Real Name="Cell 6 2 0">0.000441853028377094</Real>
+    <Real Name="Cell 6 2 1">0.01555300880687302</Real>
+    <Real Name="Cell 6 2 10">2.4499655064112745e-08</Real>
+    <Real Name="Cell 6 2 2">0.032931750790930366</Real>
+    <Real Name="Cell 6 2 3">0.0074768432810286131</Real>
+    <Real Name="Cell 6 2 4">3.2392740238761398e-05</Real>
+    <Real Name="Cell 6 3 0">0.0019384982510236421</Real>
+    <Real Name="Cell 6 3 1">0.06932217380582581</Real>
+    <Real Name="Cell 6 3 2">0.14795579575142345</Real>
+    <Real Name="Cell 6 3 3">0.03395516263297587</Real>
+    <Real Name="Cell 6 3 4">0.0001564748433145119</Real>
+    <Real Name="Cell 6 4 0">0.0025748826827637818</Real>
+    <Real Name="Cell 6 4 1">0.14003142058267803</Real>
+    <Real Name="Cell 6 4 2">0.37483042120721527</Real>
+    <Real Name="Cell 6 4 3">0.11089791762978085</Real>
+    <Real Name="Cell 6 4 4">0.0011561635790623495</Real>
+    <Real Name="Cell 6 5 0">0.0047163429111931835</Real>
+    <Real Name="Cell 6 5 1">0.31297523144855305</Real>
+    <Real Name="Cell 6 5 2">0.89878293689175737</Real>
+    <Real Name="Cell 6 5 3">0.28375940459773341</Real>
+    <Real Name="Cell 6 5 4">0.0036058250999567924</Real>
+    <Real Name="Cell 6 5 5">8.0010596015756409e-09</Real>
+    <Real Name="Cell 6 6 0">0.0015020804722975806</Real>
+    <Real Name="Cell 6 6 1">0.11610434921520267</Real>
+    <Real Name="Cell 6 6 2">0.49885769654057188</Real>
+    <Real Name="Cell 6 6 3">0.33606894310218988</Real>
+    <Real Name="Cell 6 6 4">0.02848942916901959</Real>
+    <Real Name="Cell 6 6 5">5.8639032910087906e-07</Real>
+    <Real Name="Cell 6 7 0">1.9206630021634376e-05</Real>
+    <Real Name="Cell 6 7 1">0.046886823666419664</Real>
+    <Real Name="Cell 6 7 2">0.62703525524630166</Real>
+    <Real Name="Cell 6 7 3">0.73201149524177678</Real>
+    <Real Name="Cell 6 7 4">0.081819273809129872</Real>
+    <Real Name="Cell 6 7 5">1.7483702233724723e-06</Real>
+    <Real Name="Cell 6 8 1">0.014843170021902385</Real>
+    <Real Name="Cell 6 8 2">0.2029162452401258</Real>
+    <Real Name="Cell 6 8 3">0.23791968520962989</Real>
+    <Real Name="Cell 6 8 4">0.026631072735217923</Real>
+    <Real Name="Cell 6 8 5">5.6916478930034905e-07</Real>
+    <Real Name="Cell 6 9 1">0.00018823563363062559</Real>
+    <Real Name="Cell 6 9 2">0.0025733093362375341</Real>
+    <Real Name="Cell 6 9 3">0.0030172101129711214</Real>
+    <Real Name="Cell 6 9 4">0.00033772548877227903</Real>
+    <Real Name="Cell 6 9 5">7.2179389305722861e-09</Real>
+    <Real Name="Cell 7 1 0">1.0773145471598899e-09</Real>
+    <Real Name="Cell 7 1 1">3.8141521969526777e-08</Real>
+    <Real Name="Cell 7 1 2">8.080434242132067e-08</Real>
+    <Real Name="Cell 7 1 3">1.8348171588560835e-08</Real>
+    <Real Name="Cell 7 1 4">7.9496898678689158e-11</Real>
+    <Real Name="Cell 7 10 0">3.1550755703541391e-08</Real>
+    <Real Name="Cell 7 10 1">5.400180962412764e-07</Real>
+    <Real Name="Cell 7 10 2">7.3974285552856636e-07</Real>
+    <Real Name="Cell 7 10 3">1.007396609117612e-07</Real>
+    <Real Name="Cell 7 10 4">2.5483462063369444e-11</Real>
+    <Real Name="Cell 7 11 0">2.078704574290248e-05</Real>
+    <Real Name="Cell 7 11 1">0.00035578801896344253</Real>
+    <Real Name="Cell 7 11 2">0.0004873756026747601</Real>
+    <Real Name="Cell 7 11 3">6.6371783901905606e-05</Real>
+    <Real Name="Cell 7 11 4">1.6789641952675067e-08</Real>
+    <Real Name="Cell 7 12 0">0.00011692728374668503</Real>
+    <Real Name="Cell 7 12 1">0.0020013101987430676</Real>
+    <Real Name="Cell 7 12 2">0.0027414913157932067</Real>
+    <Real Name="Cell 7 12 3">0.0003733417679961367</Real>
+    <Real Name="Cell 7 12 4">9.4441858303794197e-08</Real>
+    <Real Name="Cell 7 13 0">6.8423250628621554e-05</Real>
+    <Real Name="Cell 7 13 1">0.0011711222986319954</Real>
+    <Real Name="Cell 7 13 2">0.0016042598560921941</Real>
+    <Real Name="Cell 7 13 3">0.00021847131433476552</Real>
+    <Real Name="Cell 7 13 4">5.5265278842470988e-08</Real>
+    <Real Name="Cell 7 14 0">2.8243731021273011e-06</Real>
+    <Real Name="Cell 7 14 1">4.8341554795616413e-05</Real>
+    <Real Name="Cell 7 14 2">6.6220595261723376e-05</Real>
+    <Real Name="Cell 7 14 3">9.0180530466554547e-06</Real>
+    <Real Name="Cell 7 14 4">2.2812386960602466e-09</Real>
+    <Real Name="Cell 7 2 0">2.3110214396946787e-07</Real>
+    <Real Name="Cell 7 2 1">8.1819998854132056e-06</Real>
+    <Real Name="Cell 7 2 2">1.7333894566670802e-05</Real>
+    <Real Name="Cell 7 2 3">3.9359923276026833e-06</Real>
+    <Real Name="Cell 7 2 4">1.7053425828141122e-08</Real>
+    <Real Name="Cell 7 3 0">2.5128684631689892e-06</Real>
+    <Real Name="Cell 7 3 1">0.00013720015137355153</Real>
+    <Real Name="Cell 7 3 2">0.00036781153932398478</Real>
+    <Real Name="Cell 7 3 3">0.0001089526884296779</Real>
+    <Real Name="Cell 7 3 4">1.1371153924886989e-06</Real>
+    <Real Name="Cell 7 4 0">0.00011298322969292173</Real>
+    <Real Name="Cell 7 4 1">0.0075806403487128924</Real>
+    <Real Name="Cell 7 4 2">0.021786790641868229</Real>
+    <Real Name="Cell 7 4 3">0.0068351556180775023</Real>
+    <Real Name="Cell 7 4 4">7.8983874108971293e-05</Real>
+    <Real Name="Cell 7 5 0">0.0003372762779307707</Real>
+    <Real Name="Cell 7 5 1">0.022742425957312278</Real>
+    <Real Name="Cell 7 5 2">0.066146734292249557</Real>
+    <Real Name="Cell 7 5 3">0.021574675957909142</Real>
+    <Real Name="Cell 7 5 4">0.00036097574257915857</Real>
+    <Real Name="Cell 7 5 5">2.6573351482076121e-09</Real>
+    <Real Name="Cell 7 6 0">0.00011037493197617212</Real>
+    <Real Name="Cell 7 6 1">0.01249895073187695</Real>
+    <Real Name="Cell 7 6 2">0.090769979471857484</Real>
+    <Real Name="Cell 7 6 3">0.088107099680242829</Real>
+    <Real Name="Cell 7 6 4">0.009189916967116336</Real>
+    <Real Name="Cell 7 6 5">1.9475365885062688e-07</Real>
+    <Real Name="Cell 7 7 0">1.418214949500247e-06</Real>
+    <Real Name="Cell 7 7 1">0.015238651847434075</Real>
+    <Real Name="Cell 7 7 2">0.20729355128070057</Real>
+    <Real Name="Cell 7 7 3">0.24281667874999768</Real>
+    <Real Name="Cell 7 7 4">0.02717057122721802</Real>
+    <Real Name="Cell 7 7 5">5.8067379547233111e-07</Real>
+    <Real Name="Cell 7 8 1">0.0049297567290031482</Real>
+    <Real Name="Cell 7 8 2">0.067393132593677282</Real>
+    <Real Name="Cell 7 8 3">0.079018576718705533</Real>
+    <Real Name="Cell 7 8 4">0.0088447892076484232</Real>
+    <Real Name="Cell 7 8 5">1.8903266255286361e-07</Real>
+    <Real Name="Cell 7 9 1">6.2517365236635327e-05</Real>
+    <Real Name="Cell 7 9 2">0.00085465496908036667</Real>
+    <Real Name="Cell 7 9 3">0.0010020845840401809</Real>
+    <Real Name="Cell 7 9 4">0.0001121663700122217</Real>
+    <Real Name="Cell 7 9 5">2.3972428369423224e-09</Real>
+    <Real Name="Cell 8 5 1">9.2329734511730085e-07</Real>
+    <Real Name="Cell 8 5 2">1.2622103650023891e-05</Real>
+    <Real Name="Cell 8 5 3">1.4799440643814777e-05</Real>
+    <Real Name="Cell 8 5 4">1.6565463251967153e-06</Real>
+    <Real Name="Cell 8 5 5">3.5404050355808568e-11</Real>
+    <Real Name="Cell 8 6 1">6.7667616668507533e-05</Real>
+    <Real Name="Cell 8 6 2">0.00092506241446137347</Real>
+    <Real Name="Cell 8 6 3">0.0010846374482607873</Real>
+    <Real Name="Cell 8 6 4">0.00012140676275073122</Real>
+    <Real Name="Cell 8 6 5">2.5947304199006742e-09</Real>
+    <Real Name="Cell 8 7 1">0.00020175647550532561</Real>
+    <Real Name="Cell 8 7 2">0.0027581484549467567</Real>
+    <Real Name="Cell 8 7 3">0.0032339343327874434</Real>
+    <Real Name="Cell 8 7 4">0.0003619840887125341</Real>
+    <Real Name="Cell 8 7 5">7.7363987410724327e-09</Real>
+    <Real Name="Cell 8 8 1">6.5679843053759093e-05</Real>
+    <Real Name="Cell 8 8 2">0.00089788819509334318</Real>
+    <Real Name="Cell 8 8 3">0.0010527756241362162</Real>
+    <Real Name="Cell 8 8 4">0.00011784037203787135</Real>
+    <Real Name="Cell 8 8 5">2.5185087806588107e-09</Real>
+    <Real Name="Cell 8 9 1">8.3292766004440302e-07</Real>
+    <Real Name="Cell 8 9 2">1.1386688496019285e-05</Real>
+    <Real Name="Cell 8 9 3">1.3350914015519671e-05</Real>
+    <Real Name="Cell 8 9 4">1.4944083416875408e-06</Real>
+    <Real Name="Cell 8 9 5">3.1938803869528501e-11</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_2.xml b/src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_2.xml
new file mode 100644 (file)
index 0000000..7424c25
--- /dev/null
@@ -0,0 +1,872 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">52</Int>
+      <Real>0.006550665150801457</Real>
+      <Real>0.3748146491843859</Real>
+      <Real>0.57071867995278003</Real>
+      <Real>0.047916005712032542</Real>
+      <Real>0.052405348767599988</Real>
+      <Real>0.58065069913736744</Real>
+      <Real>0.36148262217966726</Real>
+      <Real>0.0054613299153652957</Real>
+      <Real>0.16666666666666666</Real>
+      <Real>0.66666666666666663</Real>
+      <Real>0.16666666666666666</Real>
+      <Real>0</Real>
+      <Real>0.16656750421064892</Real>
+      <Real>0.66666662732219051</Real>
+      <Real>0.16676586846585964</Real>
+      <Real>1.30088532538745e-12</Real>
+      <Real>0.00045733436139501672</Real>
+      <Real>0.24509473072115898</Real>
+      <Real>0.64843864037767174</Real>
+      <Real>0.10600929453977423</Real>
+      <Real>0.00068266776530006841</Real>
+      <Real>0.25741872001902455</Real>
+      <Real>0.64311464249673911</Real>
+      <Real>0.098783969718936201</Real>
+      <Real>0.085333318074545181</Real>
+      <Real>0.63066665045420167</Real>
+      <Real>0.2826666971842452</Real>
+      <Real>0.0013333342870078769</Real>
+      <Real>0.0077759932022114535</Real>
+      <Real>0.38813859684244745</Real>
+      <Real>0.56039472180429584</Real>
+      <Real>0.043690688151045189</Real>
+      <Real>0.0029293330109914262</Real>
+      <Real>0.32167866038576759</Real>
+      <Real>0.60785467065874721</Real>
+      <Real>0.06753733594449364</Real>
+      <Real>0.00016666678587598462</Real>
+      <Real>0.22116668061415373</Real>
+      <Real>0.65716666225592246</Real>
+      <Real>0.12149999034404779</Real>
+      <Real>0.02624399443817178</Real>
+      <Real>0.50373464367930043</Real>
+      <Real>0.45379869117991101</Real>
+      <Real>0.016222670702616706</Real>
+      <Real>0.039721334249814354</Real>
+      <Real>0.54970266925779976</Real>
+      <Real>0.40143066350332895</Real>
+      <Real>0.0091453329890569101</Real>
+      <Real>0.014197338872274482</Real>
+      <Real>0.44087470383707628</Real>
+      <Real>0.51565863292948289</Real>
+      <Real>0.02926932436116628</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">52</Int>
+      <Real>0.071142963187526845</Real>
+      <Real>0.61316861326413319</Real>
+      <Real>0.31317509255387399</Real>
+      <Real>0.0025133309944659421</Real>
+      <Real>0.0073275030978816038</Real>
+      <Real>0.38343854596171534</Real>
+      <Real>0.56408164950151107</Real>
+      <Real>0.045152301438891845</Real>
+      <Real>0.0025133374147378422</Real>
+      <Real>0.31317523045133716</Real>
+      <Real>0.6131685285777202</Real>
+      <Real>0.071142903556204715</Real>
+      <Real>0.042734015047808917</Real>
+      <Real>0.55791123556566391</Real>
+      <Real>0.39126981916643305</Real>
+      <Real>0.0080849302200940651</Real>
+      <Real>0.00027138900362524455</Real>
+      <Real>0.23159645957882208</Real>
+      <Real>0.65363999740434231</Real>
+      <Real>0.11449215401321031</Real>
+      <Real>0.085333306406062043</Real>
+      <Real>0.63066663805643286</Real>
+      <Real>0.28266672052121627</Real>
+      <Real>0.0013333350162886739</Real>
+      <Real>0.061600125763086246</Real>
+      <Real>0.59819855067527716</Real>
+      <Real>0.33644964700691471</Real>
+      <Real>0.0037516765547217332</Real>
+      <Real>0.0018614540225098352</Real>
+      <Real>0.29782965214144619</Real>
+      <Real>0.62228566621641879</Real>
+      <Real>0.078023227619625074</Real>
+      <Real>0.16666666666666666</Real>
+      <Real>0.66666666666666663</Real>
+      <Real>0.16666666666666666</Real>
+      <Real>0</Real>
+      <Real>0.093086856262166257</Real>
+      <Real>0.63827304965955856</Real>
+      <Real>0.2677241791203871</Real>
+      <Real>0.00091591495788805532</Real>
+      <Real>0.081623718615090907</Real>
+      <Real>0.62657059413828775</Real>
+      <Real>0.29022294752086536</Real>
+      <Real>0.0015827397257558828</Real>
+      <Real>0.11449215401321031</Real>
+      <Real>0.65363999740434231</Real>
+      <Real>0.23159645957882208</Real>
+      <Real>0.00027138900362524455</Real>
+      <Real>0.0088928703984411054</Real>
+      <Real>0.3990884155919483</Real>
+      <Real>0.55161516194314397</Real>
+      <Real>0.040403552066466536</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">52</Int>
+      <Real>8.5334615078031984e-05</Real>
+      <Real>0.20961089513657627</Real>
+      <Real>0.66052260642482619</Real>
+      <Real>0.12978116382351942</Real>
+      <Real>0.0032805036499513811</Real>
+      <Real>0.32827523282138604</Real>
+      <Real>0.60360812354317706</Real>
+      <Real>0.064836139985485555</Real>
+      <Real>1.3333533605942498e-06</Real>
+      <Real>0.17686271867720754</Real>
+      <Real>0.66627066272130631</Real>
+      <Real>0.15686528524812551</Real>
+      <Real>0.050127076764796274</Real>
+      <Real>0.57573496773679889</Real>
+      <Real>0.36814843368880035</Real>
+      <Real>0.0059895218096044133</Real>
+      <Real>0.0045000300408078141</Real>
+      <Real>0.34816711060208322</Real>
+      <Real>0.59016635624543157</Real>
+      <Real>0.057166503111677383</Real>
+      <Real>0.014197334544976585</Real>
+      <Real>0.44087467479769382</Real>
+      <Real>0.51565865928665788</Real>
+      <Real>0.029269331370671631</Real>
+      <Real>0.0040648417547602001</Real>
+      <Real>0.34152229961697517</Real>
+      <Real>0.59476107577337534</Real>
+      <Real>0.059651782854889167</Real>
+      <Real>0.11357867635981268</Real>
+      <Real>0.65313067213408094</Real>
+      <Real>0.2330026516863507</Real>
+      <Real>0.0002879998197555918</Real>
+      <Real>0.054751478149118946</Real>
+      <Real>0.58546212298784195</Real>
+      <Real>0.3548212277858061</Real>
+      <Real>0.004965171077232872</Real>
+      <Real>0.0077759951334009786</Real>
+      <Real>0.38813861667887345</Real>
+      <Real>0.56039470614019771</Real>
+      <Real>0.043690682047527844</Real>
+      <Real>0.0023039985580447344</Real>
+      <Real>0.30855463394228649</Real>
+      <Real>0.61597868637339115</Real>
+      <Real>0.073162681126277593</Real>
+      <Real>0.012348001471996365</Real>
+      <Real>0.42782267760483422</Real>
+      <Real>0.527310657063643</Real>
+      <Real>0.032518663859526398</Real>
+      <Real>0.0065506685959499985</Real>
+      <Real>0.37481468891684211</Real>
+      <Real>0.57071864975706676</Real>
+      <Real>0.047915992730141049</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">52</Int>
+      <Real>-0.057799991083145486</Real>
+      <Real>-0.66660000052451984</Real>
+      <Real>0.50659997429847614</Real>
+      <Real>0.21780001730918919</Real>
+      <Real>-0.23120004539489969</Real>
+      <Real>-0.48639993057250308</Real>
+      <Real>0.66639999732970523</Real>
+      <Real>0.051199978637697541</Real>
+      <Real>-0.5</Real>
+      <Real>0</Real>
+      <Real>0.5</Real>
+      <Real>0</Real>
+      <Real>-0.49980165541637689</Real>
+      <Real>-0.00039666949305683374</Real>
+      <Real>0.50019830523524433</Real>
+      <Real>1.9674189388751984e-08</Real>
+      <Real>-0.0098000146865899751</Real>
+      <Real>-0.61060006084440488</Real>
+      <Real>0.25060016574857968</Real>
+      <Real>0.36979990978241517</Real>
+      <Real>-0.01280001373291384</Real>
+      <Real>-0.62160004463194696</Real>
+      <Real>0.28160013046263543</Real>
+      <Real>0.35279992790222536</Real>
+      <Real>-0.31999996185302848</Real>
+      <Real>-0.34000006675719874</Real>
+      <Real>0.64000001907348292</Real>
+      <Real>0.020000009536744301</Real>
+      <Real>-0.064799962234502573</Real>
+      <Real>-0.66560000839231748</Real>
+      <Real>0.52559990348814267</Real>
+      <Real>0.20480006713867738</Real>
+      <Real>-0.033799997520446823</Real>
+      <Real>-0.65859999790191637</Real>
+      <Real>0.4185999883651732</Real>
+      <Real>0.27380000705718999</Real>
+      <Real>-0.0050000023841860752</Real>
+      <Real>-0.58500001668929968</Real>
+      <Real>0.18500004053115759</Real>
+      <Real>0.40499997854232817</Real>
+      <Real>-0.14579997940063549</Real>
+      <Real>-0.60260002365112086</Real>
+      <Real>0.64259998550414821</Real>
+      <Real>0.10580001754760815</Real>
+      <Real>-0.19220000295639039</Real>
+      <Real>-0.54339999589920041</Real>
+      <Real>0.66340000066757199</Real>
+      <Real>0.07219999818801881</Real>
+      <Real>-0.09680002517700359</Real>
+      <Real>-0.64959998168944821</Real>
+      <Real>0.5896000389099072</Real>
+      <Real>0.15679996795654461</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">52</Int>
+      <Real>-0.28346023183768659</Real>
+      <Real>-0.40256051313166114</Real>
+      <Real>0.65550172177638211</Real>
+      <Real>0.03051902319296566</Real>
+      <Real>-0.062283763229400151</Real>
+      <Real>-0.66608996103038631</Real>
+      <Real>0.51903121174897304</Real>
+      <Real>0.20934251251081343</Real>
+      <Real>-0.030519075166579968</Real>
+      <Real>-0.65550177622486827</Real>
+      <Real>0.40256077794947637</Real>
+      <Real>0.28346007344197183</Real>
+      <Real>-0.20179944632183019</Real>
+      <Real>-0.52989599647569718</Real>
+      <Real>0.66519033191688492</Real>
+      <Real>0.06650511088064244</Real>
+      <Real>-0.0069204181366000162</Real>
+      <Real>-0.59688582916306221</Real>
+      <Real>0.21453291273592451</Real>
+      <Real>0.38927333456373775</Real>
+      <Real>-0.31999993268181826</Real>
+      <Real>-0.34000011780681361</Real>
+      <Real>0.64000003365908198</Real>
+      <Real>0.020000016829549865</Real>
+      <Real>-0.25750869847450536</Real>
+      <Real>-0.44512103022321198</Real>
+      <Real>0.66276815586994009</Real>
+      <Real>0.039861572827777289</Real>
+      <Real>-0.024982681258888664</Real>
+      <Real>-0.64858128879017485</Real>
+      <Real>0.37211062135701573</Real>
+      <Real>0.30145334869204782</Real>
+      <Real>-0.5</Real>
+      <Real>0</Real>
+      <Real>0.5</Real>
+      <Real>0</Real>
+      <Real>-0.33910152816638917</Real>
+      <Real>-0.30622626272683551</Real>
+      <Real>0.62975710995283851</Real>
+      <Real>0.015570680940386146</Real>
+      <Real>-0.31065743749553704</Real>
+      <Real>-0.35626297915610267</Real>
+      <Real>0.6444982707988165</Real>
+      <Real>0.022422145852823244</Real>
+      <Real>-0.38927333456373775</Real>
+      <Real>-0.21453291273592451</Real>
+      <Real>0.59688582916306221</Real>
+      <Real>0.0069204181366000162</Real>
+      <Real>-0.070865057959422981</Real>
+      <Real>-0.66387543044409503</Real>
+      <Real>0.54034603476645904</Real>
+      <Real>0.19439445363705898</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">52</Int>
+      <Real>-0.0032000320435372487</Real>
+      <Real>-0.57040030441260114</Real>
+      <Real>0.15040070495581404</Real>
+      <Real>0.42319963150032436</Real>
+      <Real>-0.036450027036671884</Real>
+      <Real>-0.66065001902578757</Real>
+      <Real>0.43065011916159079</Real>
+      <Real>0.26644992690086866</Real>
+      <Real>-0.00020000200272107804</Real>
+      <Real>-0.51940009412763999</Real>
+      <Real>0.039400194263443211</Real>
+      <Real>0.48019990186691786</Real>
+      <Real>-0.22444973163612758</Real>
+      <Real>-0.49665040454840437</Real>
+      <Real>0.66665000400519148</Real>
+      <Real>0.054450132179340471</Real>
+      <Real>-0.045000200271829272</Real>
+      <Real>-0.66500006675653367</Real>
+      <Real>0.46500073432855515</Real>
+      <Real>0.24499953269980779</Real>
+      <Real>-0.096800005507469256</Real>
+      <Real>-0.64959999599456764</Real>
+      <Real>0.58960000851154304</Real>
+      <Real>0.15679999299049385</Real>
+      <Real>-0.042050058078785923</Real>
+      <Real>-0.66385002603524867</Real>
+      <Real>0.45385022630685512</Real>
+      <Real>0.25204985780717948</Real>
+      <Real>-0.38720002202987702</Real>
+      <Real>-0.21839995894431974</Real>
+      <Real>0.59839998397827054</Real>
+      <Real>0.0071999969959262167</Real>
+      <Real>-0.23804993666410867</Real>
+      <Real>-0.47585009821652102</Real>
+      <Real>0.66585000642536807</Real>
+      <Real>0.048050028455261629</Real>
+      <Real>-0.06479997296333595</Real>
+      <Real>-0.66560000600813973</Real>
+      <Real>0.52559993090628732</Real>
+      <Real>0.20480004806518837</Real>
+      <Real>-0.028799987983704867</Real>
+      <Real>-0.65359998598098379</Real>
+      <Real>0.39359993591308218</Real>
+      <Real>0.28880003805160648</Real>
+      <Real>-0.088200007009506365</Real>
+      <Real>-0.65539999566078144</Real>
+      <Real>0.57540001235008198</Real>
+      <Real>0.16819999032020583</Real>
+      <Real>-0.057800011348724922</Real>
+      <Real>-0.66659999933242631</Real>
+      <Real>0.50660003271102738</Real>
+      <Real>0.21779997797012385</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">10</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">2</Int>
+      <Int Name="Z">2</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">1</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">7</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">8</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">13</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">3</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">6</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">1</Int>
+      <Int Name="Y">0</Int>
+      <Int Name="Z">2</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">1</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">10</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">4</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">6</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">1</Int>
+      <Int Name="Z">2</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 3 10">4.2950315356913931e-08</Real>
+    <Real Name="Cell 0 3 11">0.00010550061121302938</Real>
+    <Real Name="Cell 0 3 12">0.00033245189212343837</Real>
+    <Real Name="Cell 0 3 13">6.5320994399638903e-05</Real>
+    <Real Name="Cell 0 4 0">0.00033509649733611701</Real>
+    <Real Name="Cell 0 4 1">0.010405865891297168</Real>
+    <Real Name="Cell 0 4 10">3.7018116939038949e-07</Real>
+    <Real Name="Cell 0 4 11">0.0009092911031199979</Real>
+    <Real Name="Cell 0 4 12">0.0028653440415890041</Real>
+    <Real Name="Cell 0 4 13">0.00056299009429063333</Real>
+    <Real Name="Cell 0 4 2">0.012170975474346139</Real>
+    <Real Name="Cell 0 4 3">0.00069083745196048469</Real>
+    <Real Name="Cell 0 5 0">0.0024765732197673551</Real>
+    <Real Name="Cell 0 5 1">0.076905873381982126</Real>
+    <Real Name="Cell 0 5 10">0.010822923401325766</Real>
+    <Real Name="Cell 0 5 11">0.00064049772304074779</Real>
+    <Real Name="Cell 0 5 12">0.0014634708398500113</Real>
+    <Real Name="Cell 0 5 13">0.00028754647754684209</Real>
+    <Real Name="Cell 0 5 2">0.089951139918889741</Real>
+    <Real Name="Cell 0 5 3">0.0051057219229048911</Real>
+    <Real Name="Cell 0 5 6">0.00032345861862233</Real>
+    <Real Name="Cell 0 5 7">0.01120690928221869</Real>
+    <Real Name="Cell 0 5 8">0.015286641915757749</Real>
+    <Real Name="Cell 0 5 9">0.01777714420179741</Real>
+    <Real Name="Cell 0 6 0">0.0011100077091752976</Real>
+    <Real Name="Cell 0 6 1">0.034469448209118014</Real>
+    <Real Name="Cell 0 6 10">0.141295526322989</Real>
+    <Real Name="Cell 0 6 11">0.0023025081221303549</Real>
+    <Real Name="Cell 0 6 12">1.1744824887884069e-05</Real>
+    <Real Name="Cell 0 6 13">2.3076531038101656e-06</Real>
+    <Real Name="Cell 0 6 2">0.040316376661963943</Real>
+    <Real Name="Cell 0 6 3">0.0022884002177259023</Real>
+    <Real Name="Cell 0 6 6">0.0018466373740537478</Real>
+    <Real Name="Cell 0 6 7">0.063980665027010677</Real>
+    <Real Name="Cell 0 6 8">0.098097835327591698</Real>
+    <Real Name="Cell 0 6 9">0.22583047424257968</Real>
+    <Real Name="Cell 0 7 0">5.2358910319006335e-06</Real>
+    <Real Name="Cell 0 7 1">0.00016259191108390975</Real>
+    <Real Name="Cell 0 7 10">0.099092240692514502</Real>
+    <Real Name="Cell 0 7 11">0.0016121626020337491</Real>
+    <Real Name="Cell 0 7 2">0.00019017179183371629</Real>
+    <Real Name="Cell 0 7 3">1.0794352217871204e-05</Real>
+    <Real Name="Cell 0 7 6">0.00065429698252113082</Real>
+    <Real Name="Cell 0 7 7">0.022669505477933588</Real>
+    <Real Name="Cell 0 7 8">0.04143357897276008</Real>
+    <Real Name="Cell 0 7 9">0.15669012808529104</Real>
+    <Real Name="Cell 0 8 10">0.0020475738534051391</Real>
+    <Real Name="Cell 0 8 11">3.3312618306866694e-05</Real>
+    <Real Name="Cell 0 8 6">7.6671727402196969e-07</Real>
+    <Real Name="Cell 0 8 7">2.6564544706433857e-05</Real>
+    <Real Name="Cell 0 8 8">0.00031153957215634021</Real>
+    <Real Name="Cell 0 8 9">0.0032041511249004512</Real>
+    <Real Name="Cell 1 0 2">0.00016305839833258049</Real>
+    <Real Name="Cell 1 0 3">0.001743597055019892</Real>
+    <Real Name="Cell 1 0 4">0.0010567126779587096</Real>
+    <Real Name="Cell 1 0 5">1.4787049969606595e-05</Real>
+    <Real Name="Cell 1 1 2">0.00065223359333032194</Real>
+    <Real Name="Cell 1 1 3">0.0069743882200795681</Real>
+    <Real Name="Cell 1 1 4">0.0042268507118348383</Real>
+    <Real Name="Cell 1 1 5">5.9148199878426382e-05</Real>
+    <Real Name="Cell 1 2 2">0.00016305839833258049</Real>
+    <Real Name="Cell 1 2 3">0.001743597055019892</Real>
+    <Real Name="Cell 1 2 4">0.0010567126779587096</Real>
+    <Real Name="Cell 1 2 5">1.4787049969606595e-05</Real>
+    <Real Name="Cell 1 3 10">2.8025545948817311e-06</Real>
+    <Real Name="Cell 1 3 11">0.0060537351499214079</Real>
+    <Real Name="Cell 1 3 12">0.019047031424992478</Real>
+    <Real Name="Cell 1 3 13">0.0037394622186376499</Real>
+    <Real Name="Cell 1 4 10">2.3546749634256062e-05</Real>
+    <Real Name="Cell 1 4 11">0.052145725306194969</Real>
+    <Real Name="Cell 1 4 12">0.16411917917245875</Real>
+    <Real Name="Cell 1 4 13">0.032226347293359915</Real>
+    <Real Name="Cell 1 5 10">0.043400797755306655</Real>
+    <Real Name="Cell 1 5 11">0.027327314932316479</Real>
+    <Real Name="Cell 1 5 12">0.083808096907543345</Real>
+    <Real Name="Cell 1 5 13">0.016458352473098174</Real>
+    <Real Name="Cell 1 5 6">0.0044763366943537776</Real>
+    <Real Name="Cell 1 5 7">0.15509217117998589</Real>
+    <Real Name="Cell 1 5 8">0.19713755876117658</Real>
+    <Real Name="Cell 1 5 9">0.079837052192902352</Real>
+    <Real Name="Cell 1 6 10">0.57452511785829974</Real>
+    <Real Name="Cell 1 6 11">0.0094140243493374201</Real>
+    <Real Name="Cell 1 6 12">0.00067225770348083511</Real>
+    <Real Name="Cell 1 6 13">0.00013205790877515966</Real>
+    <Real Name="Cell 1 6 6">0.025555573921168157</Real>
+    <Real Name="Cell 1 6 7">0.88542708978291407</Real>
+    <Real Name="Cell 1 6 8">1.1784841813340943</Real>
+    <Real Name="Cell 1 6 9">0.98995069746548714</Real>
+    <Real Name="Cell 1 7 10">0.41423879995353341</Real>
+    <Real Name="Cell 1 7 11">0.0064524890955536948</Real>
+    <Real Name="Cell 1 7 6">0.0090548015209451459</Real>
+    <Real Name="Cell 1 7 7">0.31372293657985123</Real>
+    <Real Name="Cell 1 7 8">0.46056101525849008</Real>
+    <Real Name="Cell 1 7 9">0.71898136715916283</Real>
+    <Real Name="Cell 1 8 10">0.010241143735164637</Real>
+    <Real Name="Cell 1 8 11">0.00013332979322199908</Real>
+    <Real Name="Cell 1 8 6">1.0610583457374935e-05</Real>
+    <Real Name="Cell 1 8 7">0.0003676435394808515</Real>
+    <Real Name="Cell 1 8 8">0.0038757666132998151</Real>
+    <Real Name="Cell 1 8 9">0.021534174455808238</Real>
+    <Real Name="Cell 13 4 0">2.3157560649486199e-06</Real>
+    <Real Name="Cell 13 4 1">7.1911963390779827e-05</Real>
+    <Real Name="Cell 13 4 2">8.4110130947704685e-05</Real>
+    <Real Name="Cell 13 4 3">4.7741800704841749e-06</Real>
+    <Real Name="Cell 13 5 0">1.7114889291764152e-05</Real>
+    <Real Name="Cell 13 5 1">0.0005314744980334967</Real>
+    <Real Name="Cell 13 5 2">0.0006216266044919938</Real>
+    <Real Name="Cell 13 5 3">3.5284184116817302e-05</Real>
+    <Real Name="Cell 13 6 0">7.6709458472318317e-06</Real>
+    <Real Name="Cell 13 6 1">0.00023820849928380913</Real>
+    <Real Name="Cell 13 6 2">0.00027861494976489938</Real>
+    <Real Name="Cell 13 6 3">1.5814479486823714e-05</Real>
+    <Real Name="Cell 13 7 0">3.6183745604395287e-08</Real>
+    <Real Name="Cell 13 7 1">1.1236262008029312e-06</Real>
+    <Real Name="Cell 13 7 2">1.3142228695972977e-06</Real>
+    <Real Name="Cell 13 7 3">7.4596681297607286e-08</Real>
+    <Real Name="Cell 14 4 0">0.00087321973061572802</Real>
+    <Real Name="Cell 14 4 1">0.027116390301470762</Real>
+    <Real Name="Cell 14 4 2">0.031716046003246838</Real>
+    <Real Name="Cell 14 4 3">0.0018002363453387589</Real>
+    <Real Name="Cell 14 5 0">0.0064536413152841681</Real>
+    <Real Name="Cell 14 5 1">0.20040712621959006</Real>
+    <Real Name="Cell 14 5 2">0.23440146582542237</Real>
+    <Real Name="Cell 14 5 3">0.013304875334599011</Real>
+    <Real Name="Cell 14 6 0">0.002892541821513587</Real>
+    <Real Name="Cell 14 6 1">0.089823088331024092</Real>
+    <Real Name="Cell 14 6 2">0.1050594555539329</Real>
+    <Real Name="Cell 14 6 3">0.0059632859118166903</Real>
+    <Real Name="Cell 14 7 0">1.364407981806975e-05</Real>
+    <Real Name="Cell 14 7 1">0.00042369426695193784</Real>
+    <Real Name="Cell 14 7 2">0.00049556400068598912</Real>
+    <Real Name="Cell 14 7 3">2.812873727655301e-05</Real>
+    <Real Name="Cell 15 4 0">0.00218158335506652</Real>
+    <Real Name="Cell 15 4 1">0.067745452441234991</Real>
+    <Real Name="Cell 15 4 2">0.079236869740012594</Real>
+    <Real Name="Cell 15 4 3">0.0044975686055645364</Real>
+    <Real Name="Cell 15 5 0">0.016123268839866908</Real>
+    <Real Name="Cell 15 5 1">0.50068136972705513</Real>
+    <Real Name="Cell 15 5 2">0.58561014864764749</Real>
+    <Real Name="Cell 15 5 3">0.033239851956539723</Real>
+    <Real Name="Cell 15 6 0">0.0072264985208227907</Real>
+    <Real Name="Cell 15 6 1">0.22440692477878199</Real>
+    <Real Name="Cell 15 6 2">0.26247226384497674</Real>
+    <Real Name="Cell 15 6 3">0.014898203545571202</Real>
+    <Real Name="Cell 15 7 0">3.408729370477176e-05</Real>
+    <Real Name="Cell 15 7 1">0.0010585243645006683</Real>
+    <Real Name="Cell 15 7 2">0.0012380780430882019</Real>
+    <Real Name="Cell 15 7 3">7.0274620339026402e-05</Real>
+    <Real Name="Cell 2 0 2">0.017905921567627086</Real>
+    <Real Name="Cell 2 0 3">0.19146951295972336</Real>
+    <Real Name="Cell 2 0 4">0.11604072237023297</Real>
+    <Real Name="Cell 2 0 5">0.0016238093816689579</Real>
+    <Real Name="Cell 2 1 2">0.071627978687475655</Real>
+    <Real Name="Cell 2 1 3">0.76612365439178398</Real>
+    <Real Name="Cell 2 1 4">0.46453686083666401</Real>
+    <Real Name="Cell 2 1 5">0.0065266351492525082</Real>
+    <Real Name="Cell 2 2 2">0.018101186649385214</Real>
+    <Real Name="Cell 2 2 3">0.20275496433660919</Real>
+    <Real Name="Cell 2 2 4">0.13330799619841771</Real>
+    <Real Name="Cell 2 2 5">0.0030848862702219353</Real>
+    <Real Name="Cell 2 3 0">1.8487129301657384e-09</Real>
+    <Real Name="Cell 2 3 1">1.4303483163258406e-07</Real>
+    <Real Name="Cell 2 3 10">0.0004615992069788358</Real>
+    <Real Name="Cell 2 3 11">0.032045543747876895</Real>
+    <Real Name="Cell 2 3 12">0.061960981387845254</Real>
+    <Real Name="Cell 2 3 13">0.0082635562051842672</Real>
+    <Real Name="Cell 2 3 2">0.00040426756626450538</Real>
+    <Real Name="Cell 2 3 3">0.029021040438571837</Real>
+    <Real Name="Cell 2 3 4">0.048547918921529709</Real>
+    <Real Name="Cell 2 3 5">0.0048291117556227489</Real>
+    <Real Name="Cell 2 3 6">0.00031668189191720006</Real>
+    <Real Name="Cell 2 3 7">3.7613795394796753e-05</Real>
+    <Real Name="Cell 2 4 0">1.5776445017470423e-06</Real>
+    <Real Name="Cell 2 4 1">0.00012206228019578449</Real>
+    <Real Name="Cell 2 4 10">0.0031716627891397215</Real>
+    <Real Name="Cell 2 4 11">0.23592451154391614</Real>
+    <Real Name="Cell 2 4 12">0.47588837217928692</Real>
+    <Real Name="Cell 2 4 13">0.066689110487020989</Real>
+    <Real Name="Cell 2 4 2">0.00042908263949965344</Real>
+    <Real Name="Cell 2 4 3">0.021417492478982808</Real>
+    <Real Name="Cell 2 4 4">0.039000460498604186</Real>
+    <Real Name="Cell 2 4 5">0.005366082958354652</Real>
+    <Real Name="Cell 2 4 6">0.0024309546849622674</Real>
+    <Real Name="Cell 2 4 7">0.00028873590334019044</Real>
+    <Real Name="Cell 2 5 0">4.4526222460492609e-06</Real>
+    <Real Name="Cell 2 5 1">0.00034449917177247066</Real>
+    <Real Name="Cell 2 5 10">0.012458044870967803</Real>
+    <Real Name="Cell 2 5 11">0.10636772459500912</Real>
+    <Real Name="Cell 2 5 12">0.2224033505685204</Real>
+    <Real Name="Cell 2 5 13">0.032450949223171502</Real>
+    <Real Name="Cell 2 5 2">0.00060017237238862682</Real>
+    <Real Name="Cell 2 5 3">0.0016800179022782619</Real>
+    <Real Name="Cell 2 5 4">0.0029892977034694191</Real>
+    <Real Name="Cell 2 5 5">0.0008846745247210895</Real>
+    <Real Name="Cell 2 5 6">0.0043949292092120259</Real>
+    <Real Name="Cell 2 5 7">0.11339270338521788</Real>
+    <Real Name="Cell 2 5 8">0.14139810979965023</Real>
+    <Real Name="Cell 2 5 9">0.026782256867452288</Real>
+    <Real Name="Cell 2 6 0">7.7992520956755581e-07</Real>
+    <Real Name="Cell 2 6 1">6.8710797878527758e-05</Real>
+    <Real Name="Cell 2 6 10">0.17749440017109669</Real>
+    <Real Name="Cell 2 6 11">0.0028511069165586466</Real>
+    <Real Name="Cell 2 6 12">0.0013479180531386348</Real>
+    <Real Name="Cell 2 6 13">0.00022636363927053141</Real>
+    <Real Name="Cell 2 6 2">0.00015040505928594613</Real>
+    <Real Name="Cell 2 6 3">2.7074545361823401e-05</Real>
+    <Real Name="Cell 2 6 4">4.4187184652806337e-08</Real>
+    <Real Name="Cell 2 6 5">3.075974601799134e-06</Real>
+    <Real Name="Cell 2 6 6">0.018668576880988243</Real>
+    <Real Name="Cell 2 6 7">0.64660068531865333</Real>
+    <Real Name="Cell 2 6 8">0.85684341929464791</Real>
+    <Real Name="Cell 2 6 9">0.42339525096833763</Real>
+    <Real Name="Cell 2 7 1">0.0013388699831736112</Real>
+    <Real Name="Cell 2 7 10">0.16974581175417192</Real>
+    <Real Name="Cell 2 7 11">0.0016140825169375986</Real>
+    <Real Name="Cell 2 7 2">0.0076991305061531231</Real>
+    <Real Name="Cell 2 7 3">0.0027466445845383304</Real>
+    <Real Name="Cell 2 7 4">3.3949534031249405e-06</Real>
+    <Real Name="Cell 2 7 6">0.0066124382975103896</Real>
+    <Real Name="Cell 2 7 7">0.22910253676411832</Real>
+    <Real Name="Cell 2 7 8">0.37541443403161301</Real>
+    <Real Name="Cell 2 7 9">0.47215876123032374</Real>
+    <Real Name="Cell 2 8 1">0.0027974367006971803</Real>
+    <Real Name="Cell 2 8 10">0.010233903838170607</Real>
+    <Real Name="Cell 2 8 11">3.3352290106902824e-05</Real>
+    <Real Name="Cell 2 8 2">0.016086573388042858</Real>
+    <Real Name="Cell 2 8 3">0.0057388428011104012</Real>
+    <Real Name="Cell 2 8 4">7.0934200978550121e-06</Real>
+    <Real Name="Cell 2 8 6">7.7485771775539345e-06</Real>
+    <Real Name="Cell 2 8 7">0.00026853543929615</Real>
+    <Real Name="Cell 2 8 8">0.0098372127559782519</Real>
+    <Real Name="Cell 2 8 9">0.03798666708747394</Real>
+    <Real Name="Cell 2 9 1">0.00035074733727529048</Real>
+    <Real Name="Cell 2 9 2">0.0020169617351246572</Real>
+    <Real Name="Cell 2 9 3">0.00071954580099320561</Real>
+    <Real Name="Cell 2 9 4">8.8938498979355444e-07</Real>
+    <Real Name="Cell 3 0 2">0.033835623551399498</Real>
+    <Real Name="Cell 3 0 3">0.36180714506131645</Real>
+    <Real Name="Cell 3 0 4">0.21927439947297753</Real>
+    <Real Name="Cell 3 0 5">0.0030684040891095399</Real>
+    <Real Name="Cell 3 1 2">0.13547578806272392</Real>
+    <Real Name="Cell 3 1 3">1.4548553583155341</Real>
+    <Real Name="Cell 3 1 4">0.88871065525324011</Real>
+    <Real Name="Cell 3 1 5">0.013248617212529085</Real>
+    <Real Name="Cell 3 2 2">0.039846669436794921</Real>
+    <Real Name="Cell 3 2 3">0.70699584092402734</Real>
+    <Real Name="Cell 3 2 4">0.74580508783692068</Real>
+    <Real Name="Cell 3 2 5">0.047400400734869452</Real>
+    <Real Name="Cell 3 3 0">9.907626368103328e-07</Real>
+    <Real Name="Cell 3 3 1">7.6655258169972478e-05</Real>
+    <Real Name="Cell 3 3 10">0.0013607745040133191</Real>
+    <Real Name="Cell 3 3 11">0.068679049113872598</Real>
+    <Real Name="Cell 3 3 12">0.10047643482955704</Real>
+    <Real Name="Cell 3 3 13">0.0081217677233436109</Real>
+    <Real Name="Cell 3 3 2">0.0099245124668976836</Real>
+    <Real Name="Cell 3 3 3">0.62597286133171748</Real>
+    <Real Name="Cell 3 3 4">1.0117086746774517</Real>
+    <Real Name="Cell 3 3 5">0.11191982717448912</Real>
+    <Real Name="Cell 3 3 6">0.0079065491239385614</Real>
+    <Real Name="Cell 3 3 7">0.0007219698154281415</Real>
+    <Real Name="Cell 3 4 0">0.00084549158552165945</Real>
+    <Real Name="Cell 3 4 1">0.06541564382903689</Real>
+    <Real Name="Cell 3 4 10">0.0093310404836781744</Real>
+    <Real Name="Cell 3 4 11">0.47227468323239086</Real>
+    <Real Name="Cell 3 4 12">0.69322650053967994</Real>
+    <Real Name="Cell 3 4 13">0.056530832247206016</Real>
+    <Real Name="Cell 3 4 2">0.11373511827223479</Real>
+    <Real Name="Cell 3 4 3">0.2713214863338036</Real>
+    <Real Name="Cell 3 4 4">0.56777188224543784</Real>
+    <Real Name="Cell 3 4 5">0.24918693562109068</Real>
+    <Real Name="Cell 3 4 6">0.064412785716560533</Real>
+    <Real Name="Cell 3 4 7">0.0055420785021559355</Real>
+    <Real Name="Cell 3 5 0">0.0023862502853921287</Real>
+    <Real Name="Cell 3 5 1">0.18462407128491792</Real>
+    <Real Name="Cell 3 5 10">0.0039864403175846079</Real>
+    <Real Name="Cell 3 5 11">0.19870325951005169</Real>
+    <Real Name="Cell 3 5 12">0.29268796973393935</Real>
+    <Real Name="Cell 3 5 13">0.02408787913335474</Real>
+    <Real Name="Cell 3 5 2">0.31312980743875407</Real>
+    <Real Name="Cell 3 5 3">0.048982155403907664</Real>
+    <Real Name="Cell 3 5 4">0.09032005003050933</Real>
+    <Real Name="Cell 3 5 5">0.11393087437246284</Real>
+    <Real Name="Cell 3 5 6">0.031671845299420832</Real>
+    <Real Name="Cell 3 5 7">0.005147299718395862</Real>
+    <Real Name="Cell 3 5 8">0.0032617667856080631</Real>
+    <Real Name="Cell 3 5 9">0.00050312708544542246</Real>
+    <Real Name="Cell 3 6 0">0.00041797768844334745</Real>
+    <Real Name="Cell 3 6 1">0.032756603588485769</Real>
+    <Real Name="Cell 3 6 10">0.0090198896928035868</Real>
+    <Real Name="Cell 3 6 11">0.0006954273694937792</Real>
+    <Real Name="Cell 3 6 12">0.0010506061416214218</Real>
+    <Real Name="Cell 3 6 13">9.2091458578066684e-05</Real>
+    <Real Name="Cell 3 6 2">0.057218516634815794</Real>
+    <Real Name="Cell 3 6 3">0.0061742764829265896</Real>
+    <Real Name="Cell 3 6 4">0.00063892872883243156</Real>
+    <Real Name="Cell 3 6 5">0.0011691232506900651</Real>
+    <Real Name="Cell 3 6 6">0.00065436683019917815</Real>
+    <Real Name="Cell 3 6 7">0.014744811996528273</Real>
+    <Real Name="Cell 3 6 8">0.028310947770342914</Real>
+    <Real Name="Cell 3 6 9">0.03937391518615449</Real>
+    <Real Name="Cell 3 7 1">0.06682967732992437</Real>
+    <Real Name="Cell 3 7 10">0.017633890675406386</Real>
+    <Real Name="Cell 3 7 11">1.2590923308017436e-14</Real>
+    <Real Name="Cell 3 7 2">0.38430199639517298</Real>
+    <Real Name="Cell 3 7 3">0.13709872775665843</Real>
+    <Real Name="Cell 3 7 4">0.00016945905377844923</Real>
+    <Real Name="Cell 3 7 6">0.00015064357459036907</Real>
+    <Real Name="Cell 3 7 7">0.005219515757859906</Real>
+    <Real Name="Cell 3 7 8">0.026314989565077548</Real>
+    <Real Name="Cell 3 7 9">0.075295027623240238</Real>
+    <Real Name="Cell 3 8 1">0.13963401555641472</Real>
+    <Real Name="Cell 3 8 10">0.0020459728853106465</Real>
+    <Real Name="Cell 3 8 11">2.6017017251355131e-16</Real>
+    <Real Name="Cell 3 8 2">0.8029610958330442</Real>
+    <Real Name="Cell 3 8 3">0.28645426177698968</Real>
+    <Real Name="Cell 3 8 4">0.00035406796945404429</Real>
+    <Real Name="Cell 3 8 6">1.7652691964710824e-07</Real>
+    <Real Name="Cell 3 8 7">6.1335399578891201e-06</Real>
+    <Real Name="Cell 3 8 8">0.0023143351570314823</Real>
+    <Real Name="Cell 3 8 9">0.0086905438166314207</Real>
+    <Real Name="Cell 3 9 1">0.017507548655976035</Real>
+    <Real Name="Cell 3 9 2">0.10067661807285928</Real>
+    <Real Name="Cell 3 9 3">0.035916119047268574</Real>
+    <Real Name="Cell 3 9 4">4.4393639888089178e-05</Real>
+    <Real Name="Cell 4 0 2">0.003759398397327105</Real>
+    <Real Name="Cell 4 0 3">0.040199560655909627</Real>
+    <Real Name="Cell 4 0 4">0.024363074754668708</Real>
+    <Real Name="Cell 4 0 5">0.00034092332885271202</Real>
+    <Real Name="Cell 4 1 2">0.015193497585489754</Real>
+    <Real Name="Cell 4 1 3">0.16971872256758302</Real>
+    <Real Name="Cell 4 1 4">0.11103523591878797</Real>
+    <Real Name="Cell 4 1 5">0.0025040799245339661</Real>
+    <Real Name="Cell 4 2 2">0.010774116469313418</Real>
+    <Real Name="Cell 4 2 3">0.44234432435298821</Real>
+    <Real Name="Cell 4 2 4">0.63727074972356412</Real>
+    <Real Name="Cell 4 2 5">0.051877374562982616</Real>
+    <Real Name="Cell 4 3 0">2.6212263938109493e-06</Real>
+    <Real Name="Cell 4 3 1">0.00020280416163694063</Real>
+    <Real Name="Cell 4 3 10">0.00025152815444910053</Real>
+    <Real Name="Cell 4 3 11">0.012555021993817085</Real>
+    <Real Name="Cell 4 3 12">0.018126946298234189</Real>
+    <Real Name="Cell 4 3 13">0.0014132514788792942</Real>
+    <Real Name="Cell 4 3 2">0.010964643545717887</Real>
+    <Real Name="Cell 4 3 3">0.64937886636400888</Real>
+    <Real Name="Cell 4 3 4">1.0947645822609935</Real>
+    <Real Name="Cell 4 3 5">0.22696988079589014</Real>
+    <Real Name="Cell 4 3 6">0.018986475771994395</Real>
+    <Real Name="Cell 4 3 7">0.00065039989094193716</Real>
+    <Real Name="Cell 4 4 0">0.0022368878047817477</Real>
+    <Real Name="Cell 4 4 1">0.17306790325161722</Real>
+    <Real Name="Cell 4 4 10">0.0017246649920512828</Real>
+    <Real Name="Cell 4 4 11">0.086086613065623985</Real>
+    <Real Name="Cell 4 4 12">0.12429188995494535</Real>
+    <Real Name="Cell 4 4 13">0.009690308251679448</Real>
+    <Real Name="Cell 4 4 2">0.29546793821926287</Real>
+    <Real Name="Cell 4 4 3">0.21778462395380638</Real>
+    <Real Name="Cell 4 4 4">1.0702655289755327</Real>
+    <Real Name="Cell 4 4 5">1.3620142626691392</Real>
+    <Real Name="Cell 4 4 6">0.17323593075235827</Real>
+    <Real Name="Cell 4 4 7">0.0049926841487913168</Real>
+    <Real Name="Cell 4 5 0">0.0063132197338868438</Real>
+    <Real Name="Cell 4 5 1">0.48845351106786289</Real>
+    <Real Name="Cell 4 5 10">0.00072341221284664622</Real>
+    <Real Name="Cell 4 5 11">0.036109103820914271</Real>
+    <Real Name="Cell 4 5 12">0.052134340040297669</Real>
+    <Real Name="Cell 4 5 13">0.0040646081226336514</Real>
+    <Real Name="Cell 4 5 2">0.82807302039068265</Real>
+    <Real Name="Cell 4 5 3">0.096427224677649734</Real>
+    <Real Name="Cell 4 5 4">0.44314477578098654</Real>
+    <Real Name="Cell 4 5 5">0.74771601172012381</Real>
+    <Real Name="Cell 4 5 6">0.093262715335143395</Real>
+    <Real Name="Cell 4 5 7">0.0023125750286696629</Real>
+    <Real Name="Cell 4 6 0">0.0011058290939381999</Real>
+    <Real Name="Cell 4 6 1">0.086161005084866182</Real>
+    <Real Name="Cell 4 6 10">2.4748757046975492e-06</Real>
+    <Real Name="Cell 4 6 11">0.00012353336338230507</Real>
+    <Real Name="Cell 4 6 12">0.00017835752459645737</Real>
+    <Real Name="Cell 4 6 13">1.3905488065011144e-05</Real>
+    <Real Name="Cell 4 6 2">0.14849427470411145</Real>
+    <Real Name="Cell 4 6 3">0.015341219620302503</Real>
+    <Real Name="Cell 4 6 4">0.0047129237984894004</Real>
+    <Real Name="Cell 4 6 5">0.0082573902547324607</Real>
+    <Real Name="Cell 4 6 6">0.00092902517735477625</Real>
+    <Real Name="Cell 4 6 7">1.2611698688655134e-05</Real>
+    <Real Name="Cell 4 7 1">0.096488725265258452</Real>
+    <Real Name="Cell 4 7 2">0.55485543594657594</Real>
+    <Real Name="Cell 4 7 3">0.19794321931890207</Real>
+    <Real Name="Cell 4 7 4">0.0002446650760113426</Real>
+    <Real Name="Cell 4 8 1">0.20160366925301407</Real>
+    <Real Name="Cell 4 8 2">1.1593156763579595</Real>
+    <Real Name="Cell 4 8 3">0.4135828223322302</Real>
+    <Real Name="Cell 4 8 4">0.00051120353104834994</Real>
+    <Real Name="Cell 4 9 1">0.025277408478197247</Real>
+    <Real Name="Cell 4 9 2">0.14535695711817775</Real>
+    <Real Name="Cell 4 9 3">0.051855712638529596</Real>
+    <Real Name="Cell 4 9 4">6.4095561939345712e-05</Real>
+    <Real Name="Cell 5 1 2">8.8492741942662414e-06</Real>
+    <Real Name="Cell 5 1 3">0.00050633578934437329</Real>
+    <Real Name="Cell 5 1 4">0.00077098173194170767</Real>
+    <Real Name="Cell 5 1 5">6.4729538939222294e-05</Real>
+    <Real Name="Cell 5 2 2">0.00039740630658555734</Real>
+    <Real Name="Cell 5 2 3">0.022750462154480639</Real>
+    <Real Name="Cell 5 2 4">0.034650097639080731</Real>
+    <Real Name="Cell 5 2 5">0.0029103125984534517</Real>
+    <Real Name="Cell 5 3 0">4.2852838115120977e-07</Real>
+    <Real Name="Cell 5 3 1">3.315522050373283e-05</Real>
+    <Real Name="Cell 5 3 2">0.00061946880637814728</Real>
+    <Real Name="Cell 5 3 3">0.033262285423226325</Real>
+    <Real Name="Cell 5 3 4">0.085134873931137597</Real>
+    <Real Name="Cell 5 3 5">0.064773341660101735</Real>
+    <Real Name="Cell 5 3 6">0.0062512313254760874</Real>
+    <Real Name="Cell 5 3 7">2.3250889570295768e-05</Real>
+    <Real Name="Cell 5 4 0">0.00036569519979781667</Real>
+    <Real Name="Cell 5 4 1">0.028293820245653564</Real>
+    <Real Name="Cell 5 4 2">0.048021229942312067</Real>
+    <Real Name="Cell 5 4 3">0.013066835389676628</Real>
+    <Real Name="Cell 5 4 4">0.34406729851412915</Real>
+    <Real Name="Cell 5 4 5">0.58777937539560787</Real>
+    <Real Name="Cell 5 4 6">0.060307381408057831</Real>
+    <Real Name="Cell 5 4 7">0.00017848149948917534</Real>
+    <Real Name="Cell 5 5 0">0.0010321099462458419</Real>
+    <Real Name="Cell 5 5 1">0.079854297537884616</Real>
+    <Real Name="Cell 5 5 2">0.1353600240158695</Real>
+    <Real Name="Cell 5 5 3">0.015534435322056188</Real>
+    <Real Name="Cell 5 5 4">0.18967111273463377</Real>
+    <Real Name="Cell 5 5 5">0.33014801992429144</Real>
+    <Real Name="Cell 5 5 6">0.03377003312867459</Real>
+    <Real Name="Cell 5 5 7">8.2671333995383551e-05</Real>
+    <Real Name="Cell 5 6 0">0.00018078528149042571</Real>
+    <Real Name="Cell 5 6 1">0.01403436574102454</Real>
+    <Real Name="Cell 5 6 2">0.023979854487134824</Real>
+    <Real Name="Cell 5 6 3">0.0024182058042573097</Real>
+    <Real Name="Cell 5 6 4">0.002111616708676785</Real>
+    <Real Name="Cell 5 6 5">0.0036790495014350443</Real>
+    <Real Name="Cell 5 6 6">0.00037259678061122691</Real>
+    <Real Name="Cell 5 6 7">4.5085064986571803e-07</Real>
+    <Real Name="Cell 5 7 1">0.0075226597282771999</Real>
+    <Real Name="Cell 5 7 2">0.043258822536376432</Real>
+    <Real Name="Cell 5 7 3">0.015432471310635028</Real>
+    <Real Name="Cell 5 7 4">1.9075100320442366e-05</Real>
+    <Real Name="Cell 5 8 1">0.015717855113053587</Real>
+    <Real Name="Cell 5 8 2">0.09038504060368785</Real>
+    <Real Name="Cell 5 8 3">0.032244625818329896</Real>
+    <Real Name="Cell 5 8 4">3.9855539653970006e-05</Real>
+    <Real Name="Cell 5 9 1">0.0019707312151901065</Real>
+    <Real Name="Cell 5 9 2">0.011332629014755418</Real>
+    <Real Name="Cell 5 9 3">0.0040428856332651517</Real>
+    <Real Name="Cell 5 9 4">4.997154861740327e-06</Real>
+    <Real Name="Cell 6 3 3">1.9464033267581281e-06</Real>
+    <Real Name="Cell 6 3 4">0.00016353407592266335</Real>
+    <Real Name="Cell 6 3 5">0.00028479458890517983</Real>
+    <Real Name="Cell 6 3 6">2.8563579002759801e-05</Real>
+    <Real Name="Cell 6 4 3">1.8901514155576222e-05</Real>
+    <Real Name="Cell 6 4 4">0.0015880786928779277</Real>
+    <Real Name="Cell 6 4 5">0.0027656390017523321</Real>
+    <Real Name="Cell 6 4 6">0.00027738079021567288</Real>
+    <Real Name="Cell 6 5 3">1.0630931416268054e-05</Real>
+    <Real Name="Cell 6 5 4">0.00089319593809584867</Real>
+    <Real Name="Cell 6 5 5">0.0015555007026308136</Real>
+    <Real Name="Cell 6 5 6">0.00015600952033269309</Real>
+    <Real Name="Cell 6 6 3">1.1854319510832442e-07</Real>
+    <Real Name="Cell 6 6 4">9.959832888925606e-06</Real>
+    <Real Name="Cell 6 6 5">1.7345048713316886e-05</Real>
+    <Real Name="Cell 6 6 6">1.7396280987434627e-06</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_3.xml b/src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_3.xml
new file mode 100644 (file)
index 0000000..5208490
--- /dev/null
@@ -0,0 +1,926 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">52</Int>
+      <Real>0.0016854540244076904</Real>
+      <Real>0.29311731353696457</Real>
+      <Real>0.62495897970942083</Real>
+      <Real>0.08023825272920683</Real>
+      <Real>0.0024510232125503567</Real>
+      <Real>0.31182615608828101</Real>
+      <Real>0.61399469745996438</Real>
+      <Real>0.071728123239204175</Real>
+      <Real>0.089396158854166657</Real>
+      <Real>0.63480631510416663</Real>
+      <Real>0.27469889322916663</Real>
+      <Real>0.0010986328125</Real>
+      <Real>0.16654891563009322</Real>
+      <Real>0.66666661118583959</Real>
+      <Real>0.16678447318188874</Real>
+      <Real>2.1784112419024706e-12</Real>
+      <Real>0.036679250243501299</Real>
+      <Real>0.54076108468440021</Real>
+      <Real>0.41219020447440313</Real>
+      <Real>0.010369460597695286</Real>
+      <Real>0.030060370435004882</Real>
+      <Real>0.51859816391065605</Real>
+      <Real>0.43762266279761575</Real>
+      <Real>0.013718802856723243</Real>
+      <Real>0.0013333322008454032</Real>
+      <Real>0.28266663042704326</Real>
+      <Real>0.63066668591896469</Real>
+      <Real>0.085333351453146619</Real>
+      <Real>0.10786905756209218</Real>
+      <Real>0.64967182393728695</Real>
+      <Real>0.24204905486544184</Real>
+      <Real>0.00041006363517895783</Real>
+      <Real>0.13568773041454193</Real>
+      <Real>0.66242299043599051</Real>
+      <Real>0.2018408165595105</Real>
+      <Real>4.8462589956979473e-05</Real>
+      <Real>0.068569303078043639</Real>
+      <Real>0.6094158238958427</Real>
+      <Real>0.31921047128639002</Real>
+      <Real>0.0028044017397236948</Real>
+      <Real>8.1395367348647448e-05</Real>
+      <Real>0.20889823559751874</Real>
+      <Real>0.66070929740338646</Real>
+      <Real>0.13031107163174604</Real>
+      <Real>0.027540534381201576</Real>
+      <Real>0.50898335071154721</Real>
+      <Real>0.44816170109574205</Real>
+      <Real>0.015314413811509116</Real>
+      <Real>0.14745603131103738</Real>
+      <Real>0.66509867193952754</Real>
+      <Real>0.18743463013712769</Real>
+      <Real>1.0666612307322972e-05</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">52</Int>
+      <Real>0.010666670313068831</Real>
+      <Real>0.41466669674948081</Real>
+      <Real>0.53866664114185348</Real>
+      <Real>0.035999991795596688</Real>
+      <Real>0.0026041699536889272</Real>
+      <Real>0.31510423569410645</Real>
+      <Real>0.61197912393538834</Real>
+      <Real>0.07031247041681625</Real>
+      <Real>0.10235425786179789</Real>
+      <Real>0.64585423387961782</Real>
+      <Real>0.25122901109856532</Real>
+      <Real>0.00056249716001883718</Real>
+      <Real>0.010666691350019937</Real>
+      <Real>0.41466687030416455</Real>
+      <Real>0.53866649388328902</Real>
+      <Real>0.035999944462526537</Real>
+      <Real>0.020833337716027845</Real>
+      <Real>0.47916668858013739</Real>
+      <Real>0.47916664475319531</Real>
+      <Real>0.02083332895063943</Real>
+      <Real>2.0833184322081997e-05</Real>
+      <Real>0.19285410154860061</Real>
+      <Real>0.66422917814054716</Real>
+      <Real>0.14289588712653006</Real>
+      <Real>0.0071458391316396429</Real>
+      <Real>0.38147922973802206</Real>
+      <Real>0.56560411779523667</Real>
+      <Real>0.045770813335101523</Real>
+      <Real>0.010666657690911333</Real>
+      <Real>0.41466659261666311</Real>
+      <Real>0.53866672949696659</Real>
+      <Real>0.036000020195458941</Real>
+      <Real>0.16666666666666666</Real>
+      <Real>0.66666666666666663</Real>
+      <Real>0.16666666666666666</Real>
+      <Real>0</Real>
+      <Real>0.020833587530638329</Real>
+      <Real>0.47916793764698851</Real>
+      <Real>0.47916539568427707</Real>
+      <Real>0.020833079138096039</Real>
+      <Real>0.015187499645001698</Real>
+      <Real>0.44735416440081327</Real>
+      <Real>0.5097291687572123</Real>
+      <Real>0.027729167196972774</Real>
+      <Real>0.070312490138938491</Real>
+      <Real>0.61197915242290968</Real>
+      <Real>0.31510418967581139</Real>
+      <Real>0.0026041677623403724</Real>
+      <Real>0.057166672250220395</Real>
+      <Real>0.59016667726402305</Real>
+      <Real>0.34816665151130699</Real>
+      <Real>0.0044999989744494255</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">52</Int>
+      <Real>0.012348027757665452</Real>
+      <Real>0.42782287292924226</Real>
+      <Real>0.52731048558104343</Real>
+      <Real>0.032518613732048778</Real>
+      <Real>0.10417109125784305</Real>
+      <Real>0.64716599950200826</Real>
+      <Real>0.24815480590058539</Real>
+      <Real>0.00050810333956326215</Real>
+      <Real>0.064836187630456954</Real>
+      <Real>0.60360820054940012</Real>
+      <Real>0.32827511468795989</Real>
+      <Real>0.0032804971321829571</Real>
+      <Real>0.015699363256675682</Real>
+      <Real>0.45058077634622828</Real>
+      <Real>0.50674004282499185</Real>
+      <Real>0.026979817572104103</Real>
+      <Real>0.015187553107800395</Real>
+      <Real>0.44735450563823331</Real>
+      <Real>0.50972885392100609</Real>
+      <Real>0.027729087332960128</Real>
+      <Real>0.02926933487542473</Real>
+      <Real>0.51565867246524488</Real>
+      <Real>0.44087466027800237</Real>
+      <Real>0.014197332381327967</Real>
+      <Real>0.00010235473511721623</Real>
+      <Real>0.21247219451474078</Real>
+      <Real>0.65974870412142894</Real>
+      <Real>0.12767674662871301</Real>
+      <Real>0.00028800014162065922</Real>
+      <Real>0.23300267843691519</Real>
+      <Real>0.65313066237084039</Real>
+      <Real>0.11357865905062374</Real>
+      <Real>0.001055269599152589</Real>
+      <Real>0.27311330846590165</Real>
+      <Real>0.63560750214911865</Real>
+      <Real>0.090223919785827028</Real>
+      <Real>0.043690654581706838</Real>
+      <Real>0.56039463565174574</Real>
+      <Real>0.38813870594278954</Real>
+      <Real>0.0077760038237577982</Real>
+      <Real>0.0029293320036731184</Real>
+      <Real>0.32167864075795827</Real>
+      <Real>0.60785468313399849</Real>
+      <Real>0.067537344104370053</Real>
+      <Real>0.095297837850113781</Real>
+      <Real>0.64022317055664446</Real>
+      <Real>0.2636601584493915</Real>
+      <Real>0.00081883314385018213</Real>
+      <Real>0.12559517752556038</Real>
+      <Real>0.65893117106870747</Real>
+      <Real>0.21535215151194756</Real>
+      <Real>0.00012149989378455396</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">52</Int>
+      <Real>-0.023382024515234419</Real>
+      <Real>-0.64610389531086987</Real>
+      <Real>0.36235386416744297</Real>
+      <Real>0.30713205565866131</Real>
+      <Real>-0.030012519422176642</Real>
+      <Real>-0.65496252100764762</Real>
+      <Real>0.39996260028182518</Real>
+      <Real>0.28501244014799909</Real>
+      <Real>-0.330078125</Real>
+      <Real>-0.322265625</Real>
+      <Real>0.634765625</Real>
+      <Real>0.017578125</Real>
+      <Real>-0.49976447018752879</Real>
+      <Real>-0.0004710318812612968</Real>
+      <Real>0.50023547432510895</Real>
+      <Real>2.7743681130232289e-08</Real>
+      <Real>-0.18225710646138371</Real>
+      <Real>-0.55697880518955645</Real>
+      <Real>0.66072892976326403</Real>
+      <Real>0.078506981887676131</Real>
+      <Real>-0.15961255758703274</Real>
+      <Real>-0.58616242916284433</Real>
+      <Real>0.6511625310867869</Real>
+      <Real>0.094612455663090178</Real>
+      <Real>-0.019999988675119096</Real>
+      <Real>-0.63999997735023018</Real>
+      <Real>0.33999992072581764</Real>
+      <Real>0.32000004529953163</Real>
+      <Real>-0.3741123922437507</Real>
+      <Real>-0.24266269869504031</Real>
+      <Real>0.60766257412133273</Real>
+      <Real>0.0091125168174582827</Real>
+      <Real>-0.43594452067539102</Real>
+      <Real>-0.12591642664894442</Real>
+      <Real>0.55966641532406192</Real>
+      <Real>0.0021945320002735302</Real>
+      <Real>-0.27658205230720379</Real>
+      <Real>-0.41400387139059491</Real>
+      <Real>0.65775389970280118</Real>
+      <Real>0.032832023994997545</Real>
+      <Real>-0.0031007776826630362</Real>
+      <Real>-0.56944762165248086</Real>
+      <Real>0.14819757635295083</Real>
+      <Real>0.42435082298219307</Real>
+      <Real>-0.15056328435726465</Real>
+      <Real>-0.59706015259064737</Real>
+      <Real>0.64581015825308863</Real>
+      <Real>0.1018132786948234</Real>
+      <Real>-0.46080006523132555</Real>
+      <Real>-0.077599872255318392</Real>
+      <Real>0.53759994020461344</Real>
+      <Real>0.0007999972820305068</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">52</Int>
+      <Real>-0.080000018232009792</Real>
+      <Real>-0.65999999088399253</Real>
+      <Real>0.56000003646401431</Real>
+      <Real>0.17999997265198792</Real>
+      <Real>-0.031250026296172552</Real>
+      <Real>-0.65625002629615037</Real>
+      <Real>0.40625013148081845</Real>
+      <Real>0.28124992111150449</Real>
+      <Real>-0.3612502145767475</Real>
+      <Real>-0.26624960871295239</Real>
+      <Real>0.61624986115614722</Real>
+      <Real>0.011249962133552631</Real>
+      <Real>-0.080000123416718763</Real>
+      <Real>-0.65999993829152159</Real>
+      <Real>0.56000024683319949</Real>
+      <Real>0.17999981487504085</Real>
+      <Real>-0.12500001753077744</Real>
+      <Real>-0.62499998246922139</Real>
+      <Real>0.62500001753077505</Real>
+      <Real>0.12499998246922378</Real>
+      <Real>-0.0012499940395428412</Real>
+      <Real>-0.54624989867208618</Real>
+      <Real>0.096249779462800888</Real>
+      <Real>0.45125011324882813</Real>
+      <Real>-0.061250033133174432</Real>
+      <Real>-0.6662499952666765</Real>
+      <Real>0.51625008993287635</Real>
+      <Real>0.21124993846697457</Real>
+      <Real>-0.079999955121217034</Real>
+      <Real>-0.66000002243937572</Real>
+      <Real>0.55999991024240259</Real>
+      <Real>0.18000006731819018</Real>
+      <Real>-0.5</Real>
+      <Real>0</Real>
+      <Real>0.5</Real>
+      <Real>0</Real>
+      <Real>-0.12500101678715228</Real>
+      <Real>-0.62499898320871239</Real>
+      <Real>0.62500101677888154</Real>
+      <Real>0.12499898321698313</Real>
+      <Real>-0.10124999842222977</Real>
+      <Real>-0.64625000122715459</Real>
+      <Real>0.59624999772099851</Real>
+      <Real>0.15125000192838584</Real>
+      <Real>-0.28124997370383537</Real>
+      <Real>-0.40625004382694024</Real>
+      <Real>0.65625000876538653</Real>
+      <Real>0.031250008765389033</Real>
+      <Real>-0.24500001595301041</Real>
+      <Real>-0.46499997493098327</Real>
+      <Real>0.66499999772099772</Real>
+      <Real>0.04499999316299591</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">52</Int>
+      <Real>-0.088200132179309776</Real>
+      <Real>-0.65539991817459509</Real>
+      <Real>0.5754002328871195</Real>
+      <Real>0.16819981746678536</Real>
+      <Real>-0.36551256726980519</Real>
+      <Real>-0.25846237686871554</Real>
+      <Real>0.61346245554684664</Real>
+      <Real>0.010512488591674085</Real>
+      <Real>-0.2664500574350388</Real>
+      <Real>-0.4306499063730147</Real>
+      <Real>0.6606499850511458</Real>
+      <Real>0.036449978756907697</Real>
+      <Real>-0.10351235680585091</Real>
+      <Real>-0.64446261486992285</Real>
+      <Real>0.59946230015739843</Real>
+      <Real>0.14851267151837533</Real>
+      <Real>-0.10125023603453087</Real>
+      <Real>-0.64624981641728141</Real>
+      <Real>0.59625034093815543</Real>
+      <Real>0.15124971151365685</Real>
+      <Real>-0.15680000550746923</Real>
+      <Real>-0.58959999331235879</Real>
+      <Real>0.64960000314712518</Real>
+      <Real>0.096799995672702838</Real>
+      <Real>-0.0036125133752946681</Real>
+      <Real>-0.5741626172303782</Real>
+      <Real>0.15916277458664041</Real>
+      <Real>0.41861235601903246</Real>
+      <Real>-0.0072000023603441266</Real>
+      <Real>-0.5984000125885004</Real>
+      <Real>0.21840003225803317</Real>
+      <Real>0.38719998269081135</Real>
+      <Real>-0.017112486657502868</Real>
+      <Real>-0.63366246790587122</Real>
+      <Real>0.31866239578425104</Real>
+      <Real>0.33211255877912305</Real>
+      <Real>-0.20479996223449881</Real>
+      <Real>-0.52560005428790524</Real>
+      <Real>0.66559999527930691</Real>
+      <Real>0.064800021243097139</Real>
+      <Real>-0.03379998977184373</Real>
+      <Real>-0.65859999134540326</Real>
+      <Real>0.41859995200633771</Real>
+      <Real>0.27380002911090928</Real>
+      <Real>-0.34445001088380822</Real>
+      <Real>-0.29664998046159718</Real>
+      <Real>0.62664999357461904</Real>
+      <Real>0.014449997770786371</Real>
+      <Real>-0.41405002386570011</Real>
+      <Real>-0.16784995462894337</Real>
+      <Real>0.57784998085498707</Real>
+      <Real>0.0040499976396564108</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">8</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">2</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">1</Int>
+      <Int Name="Y">8</Int>
+      <Int Name="Z">6</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">7</Int>
+      <Int Name="Z">6</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">16</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">2</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">9</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">0</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">8</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">3</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">7</Int>
+      <Int Name="Z">5</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">2</Int>
+      <Int Name="Z">2</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 10 5">3.9368318824602623e-05</Real>
+    <Real Name="Cell 0 10 6">0.00065323622565822059</Real>
+    <Real Name="Cell 0 10 7">0.011266406490666068</Real>
+    <Real Name="Cell 0 10 8">0.012548465905978405</Real>
+    <Real Name="Cell 0 10 9">0.0006680865255725832</Real>
+    <Real Name="Cell 0 4 0">6.3139563990237878e-07</Real>
+    <Real Name="Cell 0 4 10">1.0238491228872584e-05</Real>
+    <Real Name="Cell 0 4 8">2.3975471254174857e-07</Real>
+    <Real Name="Cell 0 4 9">8.3067961889104249e-06</Real>
+    <Real Name="Cell 0 5 0">2.4568921903458716e-05</Real>
+    <Real Name="Cell 0 5 1">4.1265985540490265e-07</Real>
+    <Real Name="Cell 0 5 10">0.00039802123933402675</Real>
+    <Real Name="Cell 0 5 2">3.5281336914636707e-07</Real>
+    <Real Name="Cell 0 5 3">1.1361525443963153e-08</Real>
+    <Real Name="Cell 0 5 8">9.320461940030214e-06</Real>
+    <Real Name="Cell 0 5 9">0.00032292661487872077</Real>
+    <Real Name="Cell 0 6 0">0.00024871377117768114</Real>
+    <Real Name="Cell 0 6 1">0.0038200183144798611</Real>
+    <Real Name="Cell 0 6 10">0.00051704360580639367</Real>
+    <Real Name="Cell 0 6 2">0.0032660156157182964</Real>
+    <Real Name="Cell 0 6 3">0.0001051743577862276</Real>
+    <Real Name="Cell 0 6 8">1.2107608270648624e-05</Real>
+    <Real Name="Cell 0 6 9">0.00041949304425843595</Real>
+    <Real Name="Cell 0 7 0">0.00074893221896923598</Real>
+    <Real Name="Cell 0 7 1">0.01315692850260362</Real>
+    <Real Name="Cell 0 7 10">3.4554888209782736e-05</Real>
+    <Real Name="Cell 0 7 2">0.011248829300506514</Real>
+    <Real Name="Cell 0 7 3">0.00036224211293842058</Real>
+    <Real Name="Cell 0 7 5">0.0010629440119686352</Real>
+    <Real Name="Cell 0 7 6">0.0072561820654140803</Real>
+    <Real Name="Cell 0 7 7">0.0062467776977057988</Real>
+    <Real Name="Cell 0 7 8">0.0037279204515623492</Real>
+    <Real Name="Cell 0 7 9">0.00022598774775221378</Real>
+    <Real Name="Cell 0 8 0">0.00016065965189781533</Real>
+    <Real Name="Cell 0 8 1">0.0028304552586849185</Real>
+    <Real Name="Cell 0 8 2">0.0024199651188624291</Real>
+    <Real Name="Cell 0 8 3">7.7929289748803488e-05</Real>
+    <Real Name="Cell 0 8 5">0.0092515508159670638</Real>
+    <Real Name="Cell 0 8 6">0.066631000313149322</Real>
+    <Real Name="Cell 0 8 7">0.15411420389413394</Real>
+    <Real Name="Cell 0 8 8">0.14461562717965634</Real>
+    <Real Name="Cell 0 8 9">0.0076953826676021374</Real>
+    <Real Name="Cell 0 9 5">0.0047635649214000271</Real>
+    <Real Name="Cell 0 9 6">0.037819174251502052</Real>
+    <Real Name="Cell 0 9 7">0.18012859510030349</Real>
+    <Real Name="Cell 0 9 8">0.1877983288061168</Real>
+    <Real Name="Cell 0 9 9">0.0099965661534688662</Real>
+    <Real Name="Cell 1 10 5">0.00072757552739804489</Real>
+    <Real Name="Cell 1 10 6">0.0080458297148575109</Real>
+    <Real Name="Cell 1 10 7">0.061586495423043654</Real>
+    <Real Name="Cell 1 10 8">0.058344215405201398</Real>
+    <Real Name="Cell 1 10 9">0.0027552792692082466</Real>
+    <Real Name="Cell 1 11 6">3.5863226380796118e-06</Real>
+    <Real Name="Cell 1 11 7">3.3387739675550008e-05</Real>
+    <Real Name="Cell 1 11 8">1.8158076814044073e-05</Real>
+    <Real Name="Cell 1 11 9">1.814560904838949e-07</Real>
+    <Real Name="Cell 1 4 0">0.00010980601729090598</Real>
+    <Real Name="Cell 1 4 10">0.0017805760348364051</Real>
+    <Real Name="Cell 1 4 8">4.1695742648786474e-05</Real>
+    <Real Name="Cell 1 4 9">0.0014446349456777325</Real>
+    <Real Name="Cell 1 5 0">0.0042687077726072898</Real>
+    <Real Name="Cell 1 5 10">0.069219874713131208</Real>
+    <Real Name="Cell 1 5 8">0.0016209215589522048</Real>
+    <Real Name="Cell 1 5 9">0.056160168389108561</Real>
+    <Real Name="Cell 1 6 0">0.0055452017148019759</Real>
+    <Real Name="Cell 1 6 10">0.089919054759559719</Real>
+    <Real Name="Cell 1 6 8">0.002105634184176365</Real>
+    <Real Name="Cell 1 6 9">0.072954036360432378</Real>
+    <Real Name="Cell 1 7 0">0.00037059509721009369</Real>
+    <Real Name="Cell 1 7 10">0.0060094406936914797</Real>
+    <Real Name="Cell 1 7 5">0.019644528219461749</Real>
+    <Real Name="Cell 1 7 6">0.1324355491257436</Real>
+    <Real Name="Cell 1 7 7">0.067583526693952761</Real>
+    <Real Name="Cell 1 7 8">0.015191941497319769</Real>
+    <Real Name="Cell 1 7 9">0.0056680092178851066</Real>
+    <Real Name="Cell 1 8 5">0.17098017302101526</Real>
+    <Real Name="Cell 1 8 6">1.1672436600278535</Real>
+    <Real Name="Cell 1 8 7">0.99356085528681715</Real>
+    <Real Name="Cell 1 8 8">0.58332648146984811</Real>
+    <Real Name="Cell 1 8 9">0.030836309309274869</Real>
+    <Real Name="Cell 1 9 5">0.088036608203257066</Real>
+    <Real Name="Cell 1 9 6">0.61884324706600524</Real>
+    <Real Name="Cell 1 9 7">0.95017516286955628</Real>
+    <Real Name="Cell 1 9 8">0.77316589815987258</Real>
+    <Real Name="Cell 1 9 9">0.04022287807020241</Real>
+    <Real Name="Cell 16 5 0">5.132404320263556e-08</Real>
+    <Real Name="Cell 16 5 1">9.0421214202722412e-07</Real>
+    <Real Name="Cell 16 5 2">7.7307770085524097e-07</Real>
+    <Real Name="Cell 16 5 3">2.4895150627876361e-08</Real>
+    <Real Name="Cell 16 6 0">0.0004751099057475562</Real>
+    <Real Name="Cell 16 6 1">0.0083703488417352472</Real>
+    <Real Name="Cell 16 6 2">0.0071564290470788501</Real>
+    <Real Name="Cell 16 6 3">0.00023045597989392565</Real>
+    <Real Name="Cell 16 7 0">0.0016363762019424991</Real>
+    <Real Name="Cell 16 7 1">0.028829202424270801</Real>
+    <Real Name="Cell 16 7 2">0.02464821305946872</Real>
+    <Real Name="Cell 16 7 3">0.00079373777842075372</Real>
+    <Real Name="Cell 16 8 0">0.00035203426278849478</Real>
+    <Real Name="Cell 16 8 1">0.0062020377772305695</Real>
+    <Real Name="Cell 16 8 2">0.0053025798732244849</Real>
+    <Real Name="Cell 16 8 3">0.00017075712378488035</Real>
+    <Real Name="Cell 17 5 0">8.8543667906245702e-07</Real>
+    <Real Name="Cell 17 5 1">1.5599367201908655e-05</Real>
+    <Real Name="Cell 17 5 2">1.3337050422936156e-05</Real>
+    <Real Name="Cell 17 5 3">4.2948836687859664e-07</Real>
+    <Real Name="Cell 17 6 0">0.0081965431966044069</Real>
+    <Real Name="Cell 17 6 1">0.14440432628736768</Real>
+    <Real Name="Cell 17 6 2">0.1234619171442481</Real>
+    <Real Name="Cell 17 6 3">0.0039758009068327537</Real>
+    <Real Name="Cell 17 7 0">0.028230580046554082</Real>
+    <Real Name="Cell 17 7 1">0.49735819046413043</Real>
+    <Real Name="Cell 17 7 2">0.42522822744173738</Real>
+    <Real Name="Cell 17 7 3">0.013693475780863551</Real>
+    <Real Name="Cell 17 8 0">0.0060732559071581234</Real>
+    <Real Name="Cell 17 8 1">0.10699686521596845</Real>
+    <Real Name="Cell 17 8 2">0.091479517599077478</Real>
+    <Real Name="Cell 17 8 3">0.0029458828879361811</Real>
+    <Real Name="Cell 18 5 0">7.4718189186791356e-07</Real>
+    <Real Name="Cell 18 5 1">1.3163634366497968e-05</Real>
+    <Real Name="Cell 18 5 2">1.1254562638515077e-05</Real>
+    <Real Name="Cell 18 5 3">3.6242674161567493e-07</Real>
+    <Real Name="Cell 18 6 0">0.006916709909624107</Real>
+    <Real Name="Cell 18 6 1">0.12185659376970091</Real>
+    <Real Name="Cell 18 6 2">0.10418419634835555</Real>
+    <Real Name="Cell 18 6 3">0.0033550072111344278</Real>
+    <Real Name="Cell 18 7 0">0.023822571061826277</Real>
+    <Real Name="Cell 18 7 1">0.4196991636719602</Real>
+    <Real Name="Cell 18 7 2">0.35883179336096283</Real>
+    <Real Name="Cell 18 7 3">0.011555334652531795</Real>
+    <Real Name="Cell 18 8 0">0.0051249591820764166</Real>
+    <Real Name="Cell 18 8 1">0.090290047912465352</Real>
+    <Real Name="Cell 18 8 2">0.077195626342492399</Real>
+    <Real Name="Cell 18 8 3">0.0024859037370804538</Real>
+    <Real Name="Cell 2 0 1">0.00014557358688998794</Real>
+    <Real Name="Cell 2 0 2">0.037675759798917609</Real>
+    <Real Name="Cell 2 0 3">0.087681540353607479</Real>
+    <Real Name="Cell 2 0 4">0.012446316692004146</Real>
+    <Real Name="Cell 2 1 1">0.00058229434755995176</Real>
+    <Real Name="Cell 2 1 2">0.15070303919567044</Real>
+    <Real Name="Cell 2 1 3">0.35072616141442992</Real>
+    <Real Name="Cell 2 1 4">0.049785266768016583</Real>
+    <Real Name="Cell 2 10 5">0.00064063291182019783</Real>
+    <Real Name="Cell 2 10 6">0.016067367864742034</Real>
+    <Real Name="Cell 2 10 7">0.11883665557286413</Real>
+    <Real Name="Cell 2 10 8">0.070160664175803231</Real>
+    <Real Name="Cell 2 10 9">0.0012445288545738981</Real>
+    <Real Name="Cell 2 11 6">2.5466645187382811e-05</Real>
+    <Real Name="Cell 2 11 7">0.00023708790472383055</Real>
+    <Real Name="Cell 2 11 8">0.00012894135474551734</Real>
+    <Real Name="Cell 2 11 9">1.2885282055708898e-06</Real>
+    <Real Name="Cell 2 2 1">0.00014557358688998794</Real>
+    <Real Name="Cell 2 2 2">0.037675759798917609</Real>
+    <Real Name="Cell 2 2 3">0.087681540353607479</Real>
+    <Real Name="Cell 2 2 4">0.012446316692004146</Real>
+    <Real Name="Cell 2 3 2">1.3896653536189814e-06</Real>
+    <Real Name="Cell 2 3 3">8.6333372981770328e-06</Real>
+    <Real Name="Cell 2 3 4">3.3104398920091251e-06</Real>
+    <Real Name="Cell 2 3 5">6.7782107158832729e-09</Real>
+    <Real Name="Cell 2 4 0">0.00026588867300879549</Real>
+    <Real Name="Cell 2 4 10">0.0053821817531829273</Real>
+    <Real Name="Cell 2 4 2">0.0001681493323822428</Real>
+    <Real Name="Cell 2 4 3">0.0010446335924586734</Real>
+    <Real Name="Cell 2 4 4">0.00040065824666590978</Real>
+    <Real Name="Cell 2 4 5">1.0005046766266776e-06</Real>
+    <Real Name="Cell 2 4 6">2.0037391255016578e-08</Real>
+    <Real Name="Cell 2 4 8">0.00026740416852910425</Real>
+    <Real Name="Cell 2 4 9">0.005369692940826034</Real>
+    <Real Name="Cell 2 5 0">0.0098320650706891308</Real>
+    <Real Name="Cell 2 5 10">0.18405744802597662</Real>
+    <Real Name="Cell 2 5 2">0.00032657092309448137</Real>
+    <Real Name="Cell 2 5 3">0.002028857162055594</Real>
+    <Real Name="Cell 2 5 4">0.00078076349230173754</Real>
+    <Real Name="Cell 2 5 5">6.9049276028999028e-06</Real>
+    <Real Name="Cell 2 5 6">5.90209753493568e-07</Real>
+    <Real Name="Cell 2 5 8">0.0075615432205544814</Real>
+    <Real Name="Cell 2 5 9">0.17239936614469817</Real>
+    <Real Name="Cell 2 6 0">0.012553689412396613</Real>
+    <Real Name="Cell 2 6 10">0.22819022739728018</Real>
+    <Real Name="Cell 2 6 2">3.7520901401691251e-05</Real>
+    <Real Name="Cell 2 6 3">0.00023312888358377476</Real>
+    <Real Name="Cell 2 6 4">9.2584842394106341e-05</Real>
+    <Real Name="Cell 2 6 5">6.235725654716531e-06</Real>
+    <Real Name="Cell 2 6 6">6.7250324459062679e-07</Real>
+    <Real Name="Cell 2 6 8">0.0085949831085865291</Real>
+    <Real Name="Cell 2 6 9">0.20820549639964436</Real>
+    <Real Name="Cell 2 7 0">0.00082191945841264958</Real>
+    <Real Name="Cell 2 7 10">0.014398556691109307</Real>
+    <Real Name="Cell 2 7 3">1.5867786277437549e-09</Real>
+    <Real Name="Cell 2 7 4">1.7424887022582369e-07</Real>
+    <Real Name="Cell 2 7 5">0.017297408182217682</Real>
+    <Real Name="Cell 2 7 6">0.11631939446940248</Real>
+    <Real Name="Cell 2 7 7">0.051166371516509511</Real>
+    <Real Name="Cell 2 7 8">0.004350396420061289</Real>
+    <Real Name="Cell 2 7 9">0.012883157212519267</Real>
+    <Real Name="Cell 2 8 5">0.15054866743208792</Real>
+    <Real Name="Cell 2 8 6">1.0205236077305906</Real>
+    <Real Name="Cell 2 8 7">0.58836363111277346</Real>
+    <Real Name="Cell 2 8 8">0.16949681681354267</Real>
+    <Real Name="Cell 2 8 9">0.007940732393002168</Real>
+    <Real Name="Cell 2 9 5">0.077516555376348481</Real>
+    <Real Name="Cell 2 9 6">0.55583195367941296</Real>
+    <Real Name="Cell 2 9 7">0.65387235798750443</Real>
+    <Real Name="Cell 2 9 8">0.33673831836642315</Real>
+    <Real Name="Cell 2 9 9">0.011490181362325803</Real>
+    <Real Name="Cell 3 0 1">0.0007106854132024348</Real>
+    <Real Name="Cell 3 0 2">0.18393180722162297</Real>
+    <Real Name="Cell 3 0 3">0.42805836599685543</Real>
+    <Real Name="Cell 3 0 4">0.06076250444931288</Real>
+    <Real Name="Cell 3 1 1">0.0028427416528097392</Real>
+    <Real Name="Cell 3 1 2">0.73572722888649189</Real>
+    <Real Name="Cell 3 1 3">1.7122334639874217</Real>
+    <Real Name="Cell 3 1 4">0.24305001779725152</Real>
+    <Real Name="Cell 3 10 0">6.5570188040891774e-05</Real>
+    <Real Name="Cell 3 10 1">0.053048687244270525</Real>
+    <Real Name="Cell 3 10 2">0.14870096974930153</Real>
+    <Real Name="Cell 3 10 3">0.025858924893137996</Real>
+    <Real Name="Cell 3 10 5">2.1891467943153414e-05</Real>
+    <Real Name="Cell 3 10 6">0.005069015919674757</Real>
+    <Real Name="Cell 3 10 7">0.045882618052900351</Real>
+    <Real Name="Cell 3 10 8">0.024920722707758577</Real>
+    <Real Name="Cell 3 10 9">0.0002490342357977776</Real>
+    <Real Name="Cell 3 11 0">8.5178018613957072e-05</Real>
+    <Real Name="Cell 3 11 1">0.068912141394508755</Real>
+    <Real Name="Cell 3 11 2">0.19316787625072074</Real>
+    <Real Name="Cell 3 11 3">0.033591667977389404</Real>
+    <Real Name="Cell 3 11 6">1.1020147532851824e-05</Real>
+    <Real Name="Cell 3 11 7">0.00010259473397798729</Real>
+    <Real Name="Cell 3 11 8">5.5796621106787217e-05</Real>
+    <Real Name="Cell 3 11 9">5.5758309825069386e-07</Real>
+    <Real Name="Cell 3 12 0">5.6925928823842461e-06</Real>
+    <Real Name="Cell 3 12 1">0.0046055164465631029</Real>
+    <Real Name="Cell 3 12 2">0.012909740040254374</Real>
+    <Real Name="Cell 3 12 3">0.002244988708908149</Real>
+    <Real Name="Cell 3 2 1">0.0007106854132024348</Real>
+    <Real Name="Cell 3 2 2">0.18942652991974782</Real>
+    <Real Name="Cell 3 2 3">0.45688625679255385</Real>
+    <Real Name="Cell 3 2 4">0.070184047364540661</Real>
+    <Real Name="Cell 3 2 5">5.3155561969079468e-06</Real>
+    <Real Name="Cell 3 3 2">0.056902195211874916</Real>
+    <Real Name="Cell 3 3 3">0.29870638450310633</Real>
+    <Real Name="Cell 3 3 4">0.097685539114643061</Real>
+    <Real Name="Cell 3 3 5">5.5738095444132192e-05</Real>
+    <Real Name="Cell 3 4 0">0.00031241653195321204</Real>
+    <Real Name="Cell 3 4 10">0.014581302981169915</Real>
+    <Real Name="Cell 3 4 2">0.054857381864426749</Real>
+    <Real Name="Cell 3 4 3">0.30848794008616515</Real>
+    <Real Name="Cell 3 4 4">0.10862308496535618</Real>
+    <Real Name="Cell 3 4 5">0.00060665047137282849</Real>
+    <Real Name="Cell 3 4 6">5.1425232362682741e-05</Real>
+    <Real Name="Cell 3 4 8">0.001597885638944696</Real>
+    <Real Name="Cell 3 4 9">0.020744207761907191</Real>
+    <Real Name="Cell 3 5 0">0.0077011097984351403</Real>
+    <Real Name="Cell 3 5 1">0.0011315118479777613</Real>
+    <Real Name="Cell 3 5 10">0.3431046101807379</Real>
+    <Real Name="Cell 3 5 2">0.04326939362003096</Real>
+    <Real Name="Cell 3 5 3">0.26114887521319613</Real>
+    <Real Name="Cell 3 5 4">0.10888606815620945</Real>
+    <Real Name="Cell 3 5 5">0.014214859401284977</Real>
+    <Real Name="Cell 3 5 6">0.0015147517623348083</Real>
+    <Real Name="Cell 3 5 8">0.036932215827313292</Real>
+    <Real Name="Cell 3 5 9">0.48339016841571658</Real>
+    <Real Name="Cell 3 6 0">0.0088956228781327841</Real>
+    <Real Name="Cell 3 6 1">0.026024768218852169</Real>
+    <Real Name="Cell 3 6 10">0.34876910664290012</Real>
+    <Real Name="Cell 3 6 2">0.034427350744566008</Real>
+    <Real Name="Cell 3 6 3">0.032277765916131164</Real>
+    <Real Name="Cell 3 6 4">0.02249274539694604</Real>
+    <Real Name="Cell 3 6 5">0.016118700053854015</Real>
+    <Real Name="Cell 3 6 6">0.0017259549997094888</Real>
+    <Real Name="Cell 3 6 8">0.037064708019645544</Real>
+    <Real Name="Cell 3 6 9">0.48798485732281677</Real>
+    <Real Name="Cell 3 7 0">0.0012673314288160686</Real>
+    <Real Name="Cell 3 7 1">0.026024765838498866</Real>
+    <Real Name="Cell 3 7 10">0.015738573073123159</Real>
+    <Real Name="Cell 3 7 2">0.029653418460105309</Real>
+    <Real Name="Cell 3 7 3">0.0016928027465487241</Real>
+    <Real Name="Cell 3 7 4">0.00068193632655410771</Real>
+    <Real Name="Cell 3 7 5">0.001481545973791003</Real>
+    <Real Name="Cell 3 7 6">0.004064771454758016</Real>
+    <Real Name="Cell 3 7 7">0.0016353091483799825</Real>
+    <Real Name="Cell 3 7 8">0.0016300334474656998</Real>
+    <Real Name="Cell 3 7 9">0.021682918306723812</Real>
+    <Real Name="Cell 3 8 0">3.8414476296381054e-05</Real>
+    <Real Name="Cell 3 8 1">0.0011315113719071008</Real>
+    <Real Name="Cell 3 8 2">0.0012892772678749086</Real>
+    <Real Name="Cell 3 8 3">7.0136272809158856e-05</Real>
+    <Real Name="Cell 3 8 5">0.0051444926824162412</Real>
+    <Real Name="Cell 3 8 6">0.036566636221130641</Real>
+    <Real Name="Cell 3 8 7">0.032901800624634298</Real>
+    <Real Name="Cell 3 8 8">0.010197182131828483</Real>
+    <Real Name="Cell 3 8 9">0.00010146007541164779</Real>
+    <Real Name="Cell 3 9 0">1.6866918218498779e-06</Real>
+    <Real Name="Cell 3 9 1">0.0013645955518532642</Real>
+    <Real Name="Cell 3 9 2">0.0038251027955094122</Real>
+    <Real Name="Cell 3 9 3">0.00066518090678473662</Real>
+    <Real Name="Cell 3 9 5">0.0026488667000631413</Real>
+    <Real Name="Cell 3 9 6">0.030448663600165269</Real>
+    <Real Name="Cell 3 9 7">0.12512696986734462</Real>
+    <Real Name="Cell 3 9 8">0.064087943874734418</Real>
+    <Real Name="Cell 3 9 9">0.00064021195201485737</Real>
+    <Real Name="Cell 4 0 1">0.00021654641549095449</Real>
+    <Real Name="Cell 4 0 2">0.056044169204399329</Real>
+    <Real Name="Cell 4 0 3">0.13042972749340867</Real>
+    <Real Name="Cell 4 0 4">0.01851438384736331</Real>
+    <Real Name="Cell 4 1 1">0.00086618566196381796</Real>
+    <Real Name="Cell 4 1 2">0.22417667681759731</Real>
+    <Real Name="Cell 4 1 3">0.52171890997363468</Real>
+    <Real Name="Cell 4 1 4">0.074057535389453241</Real>
+    <Real Name="Cell 4 10 0">0.00039491495173132397</Real>
+    <Real Name="Cell 4 10 1">0.31950068145932792</Real>
+    <Real Name="Cell 4 10 2">0.89559353183986712</Real>
+    <Real Name="Cell 4 10 3">0.15574266875106305</Real>
+    <Real Name="Cell 4 10 6">1.9684868577027566e-05</Real>
+    <Real Name="Cell 4 10 7">0.00018326105426731579</Real>
+    <Real Name="Cell 4 10 8">9.9667372896329544e-05</Real>
+    <Real Name="Cell 4 10 9">9.95989389172576e-07</Real>
+    <Real Name="Cell 4 11 0">0.00051300864180110078</Real>
+    <Real Name="Cell 4 11 1">0.41504280841077901</Real>
+    <Real Name="Cell 4 11 2">1.1634080182600961</Real>
+    <Real Name="Cell 4 11 3">0.2023152950177963</Real>
+    <Real Name="Cell 4 11 6">4.4074060640941977e-08</Real>
+    <Real Name="Cell 4 11 7">4.1031814803816576e-07</Real>
+    <Real Name="Cell 4 11 8">2.2315342466053253e-07</Real>
+    <Real Name="Cell 4 11 9">2.2300020223328006e-09</Real>
+    <Real Name="Cell 4 12 0">3.4285246245913893e-05</Real>
+    <Real Name="Cell 4 12 1">0.027738021798229848</Real>
+    <Real Name="Cell 4 12 2">0.077752550620741795</Real>
+    <Real Name="Cell 4 12 3">0.013521077704747895</Real>
+    <Real Name="Cell 4 2 1">0.00021654641549095449</Real>
+    <Real Name="Cell 4 2 2">0.080828050451617339</Real>
+    <Real Name="Cell 4 2 3">0.26045758537460462</Real>
+    <Real Name="Cell 4 2 4">0.061010140886432751</Real>
+    <Real Name="Cell 4 2 5">2.3975752878673684e-05</Real>
+    <Real Name="Cell 4 3 2">0.25620735053901378</Real>
+    <Real Name="Cell 4 3 3">1.3445201560158522</Real>
+    <Real Name="Cell 4 3 4">0.43953908991547852</Real>
+    <Real Name="Cell 4 3 5">0.00024921440496203633</Real>
+    <Real Name="Cell 4 4 0">0.00014789846741481761</Real>
+    <Real Name="Cell 4 4 10">0.0073823420171066452</Real>
+    <Real Name="Cell 4 4 2">0.19306673998131624</Real>
+    <Real Name="Cell 4 4 3">1.0561141440806694</Real>
+    <Real Name="Cell 4 4 4">0.36770226921625809</Real>
+    <Real Name="Cell 4 4 5">0.0033188803820038302</Real>
+    <Real Name="Cell 4 4 6">0.0001626491915834907</Real>
+    <Real Name="Cell 4 4 8">0.0008309899274023155</Real>
+    <Real Name="Cell 4 4 9">0.010658624871962234</Real>
+    <Real Name="Cell 4 5 0">0.0039679759770219532</Real>
+    <Real Name="Cell 4 5 1">0.016681845189954903</Real>
+    <Real Name="Cell 4 5 10">0.16979224505330873</Real>
+    <Real Name="Cell 4 5 2">0.10283084654977119</Real>
+    <Real Name="Cell 4 5 3">0.65328282906837465</Real>
+    <Real Name="Cell 4 5 4">0.63580125168951207</Real>
+    <Real Name="Cell 4 5 5">0.12378525434862332</Real>
+    <Real Name="Cell 4 5 6">0.0047909000751974766</Real>
+    <Real Name="Cell 4 5 8">0.019112585824847043</Real>
+    <Real Name="Cell 4 5 9">0.24514603116434824</Real>
+    <Real Name="Cell 4 6 0">0.01642751737502629</Real>
+    <Real Name="Cell 4 6 1">0.38368237620069789</Real>
+    <Real Name="Cell 4 6 10">0.16979134431366882</Real>
+    <Real Name="Cell 4 6 2">0.44667355482426851</Real>
+    <Real Name="Cell 4 6 3">0.28045412600392</Real>
+    <Real Name="Cell 4 6 4">0.66333327151699706</Real>
+    <Real Name="Cell 4 6 5">0.16818306217873083</Real>
+    <Real Name="Cell 4 6 6">0.0054588996979611799</Real>
+    <Real Name="Cell 4 6 8">0.01911248443350453</Real>
+    <Real Name="Cell 4 6 9">0.24514473067652107</Real>
+    <Real Name="Cell 4 7 0">0.013173796818948985</Real>
+    <Real Name="Cell 4 7 1">0.3836823411072206</Real>
+    <Real Name="Cell 4 7 10">0.0073821618691786604</Real>
+    <Real Name="Cell 4 7 2">0.43718664122512013</Real>
+    <Real Name="Cell 4 7 3">0.039821594929706855</Real>
+    <Real Name="Cell 4 7 4">0.051177852907122678</Real>
+    <Real Name="Cell 4 7 5">0.012303131733254044</Real>
+    <Real Name="Cell 4 7 6">0.00029696307708921546</Real>
+    <Real Name="Cell 4 7 8">0.0008309696491338133</Real>
+    <Real Name="Cell 4 7 9">0.0106583647743968</Real>
+    <Real Name="Cell 4 8 0">0.00056634347026476351</Real>
+    <Real Name="Cell 4 8 1">0.016681838171259455</Real>
+    <Real Name="Cell 4 8 2">0.019007776037038855</Real>
+    <Real Name="Cell 4 8 3">0.0010340169634934541</Real>
+    <Real Name="Cell 4 8 6">8.0198943008146383e-06</Real>
+    <Real Name="Cell 4 8 7">7.4663149460643202e-05</Real>
+    <Real Name="Cell 4 8 8">4.0605899538555062e-05</Real>
+    <Real Name="Cell 4 8 9">4.0578018566091689e-07</Real>
+    <Real Name="Cell 4 9 0">1.0158577233239914e-05</Real>
+    <Real Name="Cell 4 9 1">0.0082186615990308808</Real>
+    <Real Name="Cell 4 9 2">0.023037760466904516</Real>
+    <Real Name="Cell 4 9 3">0.0040062396272475273</Real>
+    <Real Name="Cell 4 9 6">5.0605444244849411e-05</Real>
+    <Real Name="Cell 4 9 7">0.0004711236464539991</Real>
+    <Real Name="Cell 4 9 8">0.00025622277651484457</Real>
+    <Real Name="Cell 4 9 9">2.5604684788728845e-06</Real>
+    <Real Name="Cell 5 0 1">5.1993448696228794e-08</Real>
+    <Real Name="Cell 5 0 2">1.3456374374266296e-05</Real>
+    <Real Name="Cell 5 0 3">3.1316571689799778e-05</Real>
+    <Real Name="Cell 5 0 4">4.4453595065413668e-06</Real>
+    <Real Name="Cell 5 1 1">2.0797379478491518e-07</Real>
+    <Real Name="Cell 5 1 2">5.3825497497065185e-05</Real>
+    <Real Name="Cell 5 1 3">0.00012526628675919911</Real>
+    <Real Name="Cell 5 1 4">1.7781438026165467e-05</Real>
+    <Real Name="Cell 5 10 0">0.00014713396409819641</Real>
+    <Real Name="Cell 5 10 1">0.11903677383977188</Real>
+    <Real Name="Cell 5 10 2">0.33367241727012076</Real>
+    <Real Name="Cell 5 10 3">0.058025243491328232</Real>
+    <Real Name="Cell 5 11 0">0.00019113227988435427</Real>
+    <Real Name="Cell 5 11 1">0.15463302517214483</Real>
+    <Real Name="Cell 5 11 2">0.43345239991493939</Real>
+    <Real Name="Cell 5 11 3">0.075376865887611208</Real>
+    <Real Name="Cell 5 12 0">1.2773697648389128e-05</Real>
+    <Real Name="Cell 5 12 1">0.010334389937690541</Real>
+    <Real Name="Cell 5 12 2">0.028968366331590625</Real>
+    <Real Name="Cell 5 12 3">0.0050375650576349254</Real>
+    <Real Name="Cell 5 2 1">5.1993448696228794e-08</Real>
+    <Real Name="Cell 5 2 2">0.0069979202004532481</Real>
+    <Real Name="Cell 5 2 3">0.036675087605562665</Real>
+    <Real Name="Cell 5 2 4">0.011980377411494514</Real>
+    <Real Name="Cell 5 2 5">6.7567213147013654e-06</Real>
+    <Real Name="Cell 5 3 2">0.072145578843287039</Real>
+    <Real Name="Cell 5 3 3">0.37854881086515846</Real>
+    <Real Name="Cell 5 3 4">0.12373178241247922</Real>
+    <Real Name="Cell 5 3 5">6.9952146412871448e-05</Real>
+    <Real Name="Cell 5 4 0">1.2993518591326576e-06</Real>
+    <Real Name="Cell 5 4 10">6.48570603357018e-05</Real>
+    <Real Name="Cell 5 4 2">0.047461531839977013</Real>
+    <Real Name="Cell 5 4 3">0.2593289702602522</Real>
+    <Real Name="Cell 5 4 4">0.10214709961083704</Real>
+    <Real Name="Cell 5 4 5">0.0037084177585585878</Real>
+    <Real Name="Cell 5 4 6">3.2079146666437109e-05</Real>
+    <Real Name="Cell 5 4 8">7.3006051108176207e-06</Real>
+    <Real Name="Cell 5 4 9">9.3640619035881791e-05</Real>
+    <Real Name="Cell 5 5 0">0.00046157513356384074</Real>
+    <Real Name="Cell 5 5 1">0.012715584339562609</Real>
+    <Real Name="Cell 5 5 10">0.0014916981435483157</Real>
+    <Real Name="Cell 5 5 2">0.024738827199646898</Real>
+    <Real Name="Cell 5 5 3">0.36110379307448548</Real>
+    <Real Name="Cell 5 5 4">0.95358495979718705</Real>
+    <Real Name="Cell 5 5 5">0.18763322273448055</Real>
+    <Real Name="Cell 5 5 6">0.0009449047036770153</Real>
+    <Real Name="Cell 5 5 8">0.00016791231416005478</Real>
+    <Real Name="Cell 5 5 9">0.0021537136720895821</Real>
+    <Real Name="Cell 5 6 0">0.0099587605161680463</Real>
+    <Real Name="Cell 5 6 1">0.2924583916605063</Real>
+    <Real Name="Cell 5 6 10">0.0014916902301618813</Real>
+    <Real Name="Cell 5 6 2">0.33454656561073542</Real>
+    <Real Name="Cell 5 6 3">0.46685456419554205</Real>
+    <Real Name="Cell 5 6 4">1.3797609665697212</Real>
+    <Real Name="Cell 5 6 5">0.27521282678161574</Real>
+    <Real Name="Cell 5 6 6">0.0010766536393042895</Real>
+    <Real Name="Cell 5 6 8">0.00016791142339335724</Real>
+    <Real Name="Cell 5 6 9">0.0021537022467428188</Real>
+    <Real Name="Cell 5 7 0">0.0099301742793222406</Real>
+    <Real Name="Cell 5 7 1">0.29245836491082339</Real>
+    <Real Name="Cell 5 7 10">6.4855477658414885e-05</Real>
+    <Real Name="Cell 5 7 2">0.33325287008517934</Real>
+    <Real Name="Cell 5 7 3">0.053887296781903044</Real>
+    <Real Name="Cell 5 7 4">0.11130775837033037</Real>
+    <Real Name="Cell 5 7 5">0.022013802141037347</Real>
+    <Real Name="Cell 5 7 6">5.8569747637333812e-05</Real>
+    <Real Name="Cell 5 7 8">7.3004269574781102e-06</Real>
+    <Real Name="Cell 5 7 9">9.3638333966529074e-05</Real>
+    <Real Name="Cell 5 8 0">0.00043169014454399443</Real>
+    <Real Name="Cell 5 8 1">0.012715578989626023</Real>
+    <Real Name="Cell 5 8 2">0.014488503912746004</Real>
+    <Real Name="Cell 5 8 3">0.00078816999906920922</Real>
+    <Real Name="Cell 5 9 0">3.7847939951920602e-06</Real>
+    <Real Name="Cell 5 9 1">0.0030620371686249331</Real>
+    <Real Name="Cell 5 9 2">0.0085832076161716959</Real>
+    <Real Name="Cell 5 9 3">0.0014926097755985647</Real>
+    <Real Name="Cell 6 10 0">2.4926471293158858e-07</Real>
+    <Real Name="Cell 6 10 1">0.0002016642958091611</Real>
+    <Real Name="Cell 6 10 2">0.00056528592710597284</Real>
+    <Real Name="Cell 6 10 3">9.8302562228245956e-05</Real>
+    <Real Name="Cell 6 11 0">3.2380377412748318e-07</Real>
+    <Real Name="Cell 6 11 1">0.00026196913041473801</Real>
+    <Real Name="Cell 6 11 2">0.00073432663013277657</Real>
+    <Real Name="Cell 6 11 3">0.00012769854297284291</Real>
+    <Real Name="Cell 6 12 0">2.1640360856964461e-08</Real>
+    <Real Name="Cell 6 12 1">1.7507845703268913e-05</Real>
+    <Real Name="Cell 6 12 2">4.90763064938692e-05</Real>
+    <Real Name="Cell 6 12 3">8.5343123571898908e-06</Real>
+    <Real Name="Cell 6 2 2">3.9747493701031309e-07</Real>
+    <Real Name="Cell 6 2 3">2.0853398265340585e-06</Real>
+    <Real Name="Cell 6 2 4">6.8153160450628412e-07</Real>
+    <Real Name="Cell 6 2 5">3.8451446608248141e-10</Real>
+    <Real Name="Cell 6 3 2">4.1033779584782283e-06</Real>
+    <Real Name="Cell 6 3 3">2.1528244131565571e-05</Real>
+    <Real Name="Cell 6 3 4">7.0358694436746982e-06</Real>
+    <Real Name="Cell 6 3 5">3.9695790549881638e-09</Real>
+    <Real Name="Cell 6 4 2">2.7846445770653399e-06</Real>
+    <Real Name="Cell 6 4 3">0.00076804086733975113</Real>
+    <Real Name="Cell 6 4 4">0.002349562731018647</Real>
+    <Real Name="Cell 6 4 5">0.00045389420229477798</Real>
+    <Real Name="Cell 6 5 0">1.0860024762991741e-05</Real>
+    <Real Name="Cell 6 5 1">0.00031988569683235593</Real>
+    <Real Name="Cell 6 5 2">0.00038394367077000782</Real>
+    <Real Name="Cell 6 5 3">0.040343690042915749</Real>
+    <Real Name="Cell 6 5 4">0.12520941339310562</Real>
+    <Real Name="Cell 6 5 5">0.024230928563847662</Real>
+    <Real Name="Cell 6 6 0">0.00024978052842572604</Real>
+    <Real Name="Cell 6 6 1">0.0073573698158498589</Real>
+    <Real Name="Cell 6 6 2">0.0084120041315793974</Real>
+    <Real Name="Cell 6 6 3">0.060242390521747839</Real>
+    <Real Name="Cell 6 6 4">0.18564294970091513</Real>
+    <Real Name="Cell 6 6 5">0.035926236314377316</Real>
+    <Real Name="Cell 6 7 0">0.00024978050557957035</Real>
+    <Real Name="Cell 6 7 1">0.0073573691429086293</Real>
+    <Real Name="Cell 6 7 2">0.0083855330326609578</Real>
+    <Real Name="Cell 6 7 3">0.0052941796826830286</Real>
+    <Real Name="Cell 6 7 4">0.015022925983743229</Real>
+    <Real Name="Cell 6 7 5">0.0029072862174129633</Real>
+    <Real Name="Cell 6 8 0">1.0860020193760609e-05</Real>
+    <Real Name="Cell 6 8 1">0.00031988556224410989</Real>
+    <Real Name="Cell 6 8 2">0.00036448699850678612</Real>
+    <Real Name="Cell 6 8 3">1.9827976649894474e-05</Real>
+    <Real Name="Cell 6 9 0">6.4119497799102226e-09</Real>
+    <Real Name="Cell 6 9 1">5.18750256272409e-06</Real>
+    <Real Name="Cell 6 9 2">1.4541107456667027e-05</Real>
+    <Real Name="Cell 6 9 3">2.5286815964881614e-06</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_4.xml b/src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_4.xml
new file mode 100644 (file)
index 0000000..a74f347
--- /dev/null
@@ -0,0 +1,1251 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">65</Int>
+      <Real>0.00055680649486861621</Real>
+      <Real>0.13155676367522579</Real>
+      <Real>0.58312216819554608</Real>
+      <Real>0.27685812037771235</Real>
+      <Real>0.0079061412566471846</Real>
+      <Real>0.0089089101651006128</Real>
+      <Real>0.28736974193084774</Real>
+      <Real>0.57897075870228831</Real>
+      <Real>0.12431368289967992</Real>
+      <Real>0.00043690630208344738</Real>
+      <Real>0.041666666666666664</Real>
+      <Real>0.45833333333333331</Real>
+      <Real>0.45833333333333331</Real>
+      <Real>0.041666666666666664</Real>
+      <Real>0</Real>
+      <Real>0.041633615792825124</Real>
+      <Real>0.45823414137123475</Real>
+      <Real>0.4584325056212426</Real>
+      <Real>0.041699737214697399</Real>
+      <Real>6.4512288017413517e-17</Real>
+      <Real>1.6006714642896532e-05</Real>
+      <Real>0.070293332330147548</Real>
+      <Real>0.5221574156457981</Real>
+      <Real>0.38474124976356439</Real>
+      <Real>0.022791995545847068</Real>
+      <Real>2.7306725260463809e-05</Real>
+      <Real>0.07530679536916321</Real>
+      <Real>0.53004920643788322</Real>
+      <Real>0.3738720599463905</Real>
+      <Real>0.02074463152130257</Real>
+      <Real>0.017066662597656615</Real>
+      <Real>0.35206664066314697</Real>
+      <Real>0.5447333499272653</Real>
+      <Real>0.086066680081686067</Real>
+      <Real>6.666673024497716e-05</Real>
+      <Real>0.00069983918426549322</Real>
+      <Real>0.13904326676503828</Real>
+      <Real>0.58680435526295316</Real>
+      <Real>0.26646202753774184</Real>
+      <Real>0.006990511250001127</Real>
+      <Real>0.00019040663873036857</Real>
+      <Real>0.10406770362683616</Real>
+      <Real>0.5637877706041462</Real>
+      <Real>0.31945971181953425</Real>
+      <Real>0.012494407310752881</Real>
+      <Real>4.1666706403110725e-06</Real>
+      <Real>0.060983338602384092</Real>
+      <Real>0.50535834372838317</Real>
+      <Real>0.40631665389537802</Real>
+      <Real>0.027337497103214377</Real>
+      <Real>0.0035429389988709558</Real>
+      <Real>0.21663888845184356</Real>
+      <Real>0.5979589752382396</Real>
+      <Real>0.17999359002553345</Real>
+      <Real>0.0018656072855123651</Real>
+      <Real>0.0061568068560727456</Real>
+      <Real>0.25619410909844714</Real>
+      <Real>0.59001017262631739</Real>
+      <Real>0.14677010479610444</Real>
+      <Real>0.00086880662305831996</Real>
+      <Real>0.0015617074790447547</Real>
+      <Real>0.17135053108134043</Real>
+      <Real>0.59671157761250604</Real>
+      <Real>0.22627847883524646</Real>
+      <Real>0.0040977049918622353</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">65</Int>
+      <Real>0.013391617172245837</Real>
+      <Real>0.32646347852484026</Real>
+      <Real>0.55999463520774495</Real>
+      <Real>0.099995033965726746</Real>
+      <Real>0.00015523512944212931</Real>
+      <Real>0.00064654452700266306</Real>
+      <Real>0.13637341505766881</Real>
+      <Real>0.58555883494629768</Real>
+      <Real>0.27011715754497401</Real>
+      <Real>0.0073040479240566785</Real>
+      <Real>0.00015523565817055968</Real>
+      <Real>0.099995099319446945</Real>
+      <Real>0.5599946983171572</Real>
+      <Real>0.32646336449927055</Real>
+      <Real>0.013391602205954676</Real>
+      <Real>0.0067871694226328706</Real>
+      <Real>0.26403411642505714</Real>
+      <Real>0.58760174928538256</Real>
+      <Real>0.14083980990471962</Real>
+      <Real>0.00073715496220775755</Real>
+      <Real>7.9820311975637406e-06</Real>
+      <Real>0.064974183875945363</Real>
+      <Real>0.51293039122777406</Real>
+      <Real>0.39683182136468764</Real>
+      <Real>0.025255621500395283</Real>
+      <Real>0.017066659486061366</Real>
+      <Real>0.35206662077810369</Real>
+      <Real>0.54473336261674044</Real>
+      <Real>0.086066690340230678</Real>
+      <Real>6.6666778863712974e-05</Real>
+      <Real>0.011051788298338951</Real>
+      <Real>0.30742184274810441</Real>
+      <Real>0.56991289942021961</Real>
+      <Real>0.11134864536861958</Real>
+      <Real>0.00026482416471736544</Real>
+      <Real>0.00010402239381387114</Real>
+      <Real>0.092858260504505463</Real>
+      <Real>0.55264643128266311</Real>
+      <Real>0.33924559891274259</Real>
+      <Real>0.015145686906274896</Real>
+      <Real>0.041666666666666664</Real>
+      <Real>0.45833333333333331</Real>
+      <Real>0.45833333333333331</Real>
+      <Real>0.041666666666666664</Real>
+      <Real>0</Real>
+      <Real>0.019164974400796734</Real>
+      <Real>0.36489953061317437</Real>
+      <Real>0.53627727048142182</Real>
+      <Real>0.079617816820449078</Real>
+      <Real>4.0407684157884067e-05</Real>
+      <Real>0.016084673911882248</Real>
+      <Real>0.34565295698911602</Real>
+      <Real>0.54875914803294235</Real>
+      <Real>0.08941942896195168</Real>
+      <Real>8.3792104107546423e-05</Real>
+      <Real>0.025255621500395283</Real>
+      <Real>0.39683182136468764</Real>
+      <Real>0.51293039122777406</Real>
+      <Real>0.064974183875945363</Real>
+      <Real>7.9820311975637406e-06</Real>
+      <Real>0.00083697607326539626</Real>
+      <Real>0.14538926247215167</Real>
+      <Real>0.58947935175907284</Real>
+      <Real>0.25799620909470156</Real>
+      <Real>0.006298200600808445</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">65</Int>
+      <Real>1.7067008466108632e-06</Real>
+      <Real>0.056678590590662367</Real>
+      <Real>0.4964877539430167</Real>
+      <Real>0.41698229408180587</Real>
+      <Real>0.029849654683668386</Real>
+      <Real>0.00022143407849568522</Real>
+      <Real>0.1072864642102718</Real>
+      <Real>0.56659546340401901</Real>
+      <Real>0.3140640443829672</Real>
+      <Real>0.011832593924246375</Real>
+      <Real>6.6668001820736845e-09</Real>
+      <Real>0.045101324376820941</Real>
+      <Real>0.46822942234059373</Real>
+      <Real>0.44823725565695222</Real>
+      <Real>0.038431990958832915</Real>
+      <Real>0.0083962803385882814</Real>
+      <Real>0.28210008780463808</Real>
+      <Real>0.58110471898080385</Real>
+      <Real>0.1279047767269117</Real>
+      <Real>0.00049413614905794139</Real>
+      <Real>0.00033750300408412384</Real>
+      <Real>0.1173168960890562</Real>
+      <Real>0.57435849488551072</Real>
+      <Real>0.29798297751749492</Real>
+      <Real>0.010004128503854031</Real>
+      <Real>0.0015617068443743462</Real>
+      <Real>0.17135051200737639</Real>
+      <Real>0.59671157426940269</Real>
+      <Real>0.22627850057854337</Real>
+      <Real>0.0040977063003031534</Real>
+      <Real>0.00029470123073821155</Real>
+      <Real>0.11391109924980138</Real>
+      <Real>0.57188208654989214</Real>
+      <Real>0.30332392449946483</Real>
+      <Real>0.010588188470103232</Real>
+      <Real>0.024987309509989539</Real>
+      <Real>0.39556278684045149</Real>
+      <Real>0.5139211628158693</Real>
+      <Real>0.065520100840899334</Real>
+      <Real>8.6399927902244245e-06</Real>
+      <Real>0.0094446287242976913</Real>
+      <Real>0.29266458295212366</Real>
+      <Real>0.5767216570041318</Real>
+      <Real>0.12078433044702153</Real>
+      <Real>0.00038480087242524205</Real>
+      <Real>0.00069983941600817838</Real>
+      <Real>0.1390432781007275</Real>
+      <Real>0.58680436039658534</Real>
+      <Real>0.26646201213876175</Real>
+      <Real>0.0069905099479172436</Real>
+      <Real>0.00013823988464359079</Real>
+      <Real>0.097817691333339188</Real>
+      <Real>0.55785075794125749</Real>
+      <Real>0.33029240051099151</Real>
+      <Real>0.013900910329768222</Real>
+      <Real>0.0012965402060794952</Real>
+      <Real>0.16292851360064831</Real>
+      <Real>0.59496857499371825</Real>
+      <Real>0.23609116507560096</Real>
+      <Real>0.0047152061239528892</Real>
+      <Real>0.0005568068853187883</Real>
+      <Real>0.13155678562547082</Real>
+      <Real>0.58312217987233406</Real>
+      <Real>0.27685808921624516</Real>
+      <Real>0.0079061384006310718</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">65</Int>
+      <Real>-0.006550665150801457</Real>
+      <Real>-0.36826398403358446</Real>
+      <Real>-0.19590403076839413</Real>
+      <Real>0.52280267424074744</Real>
+      <Real>0.047916005712032542</Real>
+      <Real>-0.052405348767599988</Real>
+      <Real>-0.5282453503697675</Real>
+      <Real>0.21916807695770019</Real>
+      <Real>0.35602129226430196</Real>
+      <Real>0.0054613299153652957</Real>
+      <Real>-0.16666666666666666</Real>
+      <Real>-0.5</Real>
+      <Real>0.5</Real>
+      <Real>0.16666666666666666</Real>
+      <Real>0</Real>
+      <Real>-0.16656750421064892</Real>
+      <Real>-0.50009912311154159</Real>
+      <Real>0.4999007588563309</Real>
+      <Real>0.16676586846455876</Real>
+      <Real>1.30088532538745e-12</Real>
+      <Real>-0.00045733436139501672</Real>
+      <Real>-0.24463739635976395</Real>
+      <Real>-0.40334390965651279</Real>
+      <Real>0.54242934583789748</Real>
+      <Real>0.10600929453977423</Real>
+      <Real>-0.00068266776530006841</Real>
+      <Real>-0.25673605225372448</Real>
+      <Real>-0.38569592247771456</Real>
+      <Real>0.54433067277780289</Real>
+      <Real>0.098783969718936201</Real>
+      <Real>-0.085333318074545181</Real>
+      <Real>-0.54533333237965653</Real>
+      <Real>0.34799995326995647</Real>
+      <Real>0.28133336289723732</Real>
+      <Real>0.0013333342870078769</Real>
+      <Real>-0.0077759932022114535</Real>
+      <Real>-0.380362603640236</Real>
+      <Real>-0.17225612496184839</Real>
+      <Real>0.51670403365325068</Real>
+      <Real>0.043690688151045189</Real>
+      <Real>-0.0029293330109914262</Real>
+      <Real>-0.31874932737477618</Real>
+      <Real>-0.28617601027297962</Real>
+      <Real>0.54031733471425358</Real>
+      <Real>0.06753733594449364</Real>
+      <Real>-0.00016666678587598462</Real>
+      <Real>-0.22100001382827775</Real>
+      <Real>-0.43599998164176873</Real>
+      <Real>0.53566667191187467</Real>
+      <Real>0.12149999034404779</Real>
+      <Real>-0.02624399443817178</Real>
+      <Real>-0.47749064924112866</Real>
+      <Real>0.049935952499389424</Real>
+      <Real>0.43757602047729433</Real>
+      <Real>0.016222670702616706</Real>
+      <Real>-0.039721334249814354</Real>
+      <Real>-0.50998133500798537</Real>
+      <Real>0.1482720057544708</Real>
+      <Real>0.39228533051427206</Real>
+      <Real>0.0091453329890569101</Real>
+      <Real>-0.014197338872274482</Real>
+      <Real>-0.4266773649648018</Real>
+      <Real>-0.074783929092406609</Real>
+      <Real>0.48638930856831658</Real>
+      <Real>0.02926932436116628</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">65</Int>
+      <Real>-0.071142963187526845</Real>
+      <Real>-0.5420256500766063</Real>
+      <Real>0.2999935207102592</Real>
+      <Real>0.31066176155940806</Real>
+      <Real>0.0025133309944659421</Real>
+      <Real>-0.0073275030978816038</Real>
+      <Real>-0.37611104286383373</Real>
+      <Real>-0.18064310353979574</Real>
+      <Real>0.51892934806261926</Real>
+      <Real>0.045152301438891845</Real>
+      <Real>-0.0025133374147378422</Real>
+      <Real>-0.3106618930365993</Real>
+      <Real>-0.29999329812638303</Real>
+      <Real>0.54202562502151552</Real>
+      <Real>0.071142903556204715</Real>
+      <Real>-0.042734015047808917</Real>
+      <Real>-0.51517722051785497</Real>
+      <Real>0.16664141639923086</Real>
+      <Real>0.38318488894633901</Real>
+      <Real>0.0080849302200940651</Real>
+      <Real>-0.00027138900362524455</Real>
+      <Real>-0.23132507057519683</Real>
+      <Real>-0.42204353782552023</Real>
+      <Real>0.53914784339113198</Real>
+      <Real>0.11449215401321031</Real>
+      <Real>-0.085333306406062043</Real>
+      <Real>-0.54533333165037079</Real>
+      <Real>0.34799991753521659</Real>
+      <Real>0.28133338550492759</Real>
+      <Real>0.0013333350162886739</Real>
+      <Real>-0.061600125763086246</Real>
+      <Real>-0.5365984249121909</Real>
+      <Real>0.26174890366836245</Real>
+      <Real>0.33269797045219296</Real>
+      <Real>0.0037516765547217332</Real>
+      <Real>-0.0018614540225098352</Real>
+      <Real>-0.29596819811893638</Real>
+      <Real>-0.3244560140749726</Real>
+      <Real>0.54426243859679369</Real>
+      <Real>0.078023227619625074</Real>
+      <Real>-0.16666666666666666</Real>
+      <Real>-0.5</Real>
+      <Real>0.5</Real>
+      <Real>0.16666666666666666</Real>
+      <Real>0</Real>
+      <Real>-0.093086856262166257</Real>
+      <Real>-0.54518619339739227</Real>
+      <Real>0.37054887053917146</Real>
+      <Real>0.26680826416249903</Real>
+      <Real>0.00091591495788805532</Real>
+      <Real>-0.081623718615090907</Real>
+      <Real>-0.54494687552319687</Real>
+      <Real>0.33634764661742239</Real>
+      <Real>0.28864020779510946</Real>
+      <Real>0.0015827397257558828</Real>
+      <Real>-0.11449215401321031</Real>
+      <Real>-0.53914784339113198</Real>
+      <Real>0.42204353782552023</Real>
+      <Real>0.23132507057519683</Real>
+      <Real>0.00027138900362524455</Real>
+      <Real>-0.0088928703984411054</Real>
+      <Real>-0.39019554519350719</Real>
+      <Real>-0.15252674635119567</Real>
+      <Real>0.51121160987667746</Real>
+      <Real>0.040403552066466536</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">65</Int>
+      <Real>-8.5334615078031984e-05</Real>
+      <Real>-0.20952556052149823</Real>
+      <Real>-0.45091171128824992</Real>
+      <Real>0.53074144260130673</Real>
+      <Real>0.12978116382351942</Real>
+      <Real>-0.0032805036499513811</Real>
+      <Real>-0.32499472917143468</Real>
+      <Real>-0.27533289072179101</Real>
+      <Real>0.53877198355769151</Real>
+      <Real>0.064836139985485555</Real>
+      <Real>-1.3333533605942498e-06</Real>
+      <Real>-0.17686138532384696</Real>
+      <Real>-0.48940794404409876</Real>
+      <Real>0.50940537747318082</Real>
+      <Real>0.15686528524812551</Real>
+      <Real>-0.050127076764796274</Real>
+      <Real>-0.52560789097200256</Real>
+      <Real>0.20758653404799854</Real>
+      <Real>0.36215891187919591</Real>
+      <Real>0.0059895218096044133</Real>
+      <Real>-0.0045000300408078141</Real>
+      <Real>-0.34366708056127543</Real>
+      <Real>-0.24199924564334835</Real>
+      <Real>0.5329998531337542</Real>
+      <Real>0.057166503111677383</Real>
+      <Real>-0.014197334544976585</Real>
+      <Real>-0.42667734025271725</Real>
+      <Real>-0.074783984488964061</Real>
+      <Real>0.48638932791598627</Real>
+      <Real>0.029269331370671631</Real>
+      <Real>-0.0040648417547602001</Real>
+      <Real>-0.33745745786221498</Real>
+      <Real>-0.25323877615640017</Real>
+      <Real>0.53510929291848619</Real>
+      <Real>0.059651782854889167</Real>
+      <Real>-0.11357867635981268</Real>
+      <Real>-0.53955199577426827</Real>
+      <Real>0.42012802044773023</Real>
+      <Real>0.23271465186659512</Real>
+      <Real>0.0002879998197555918</Real>
+      <Real>-0.054751478149118946</Real>
+      <Real>-0.53071064483872299</Real>
+      <Real>0.23064089520203584</Real>
+      <Real>0.34985605670857323</Real>
+      <Real>0.004965171077232872</Real>
+      <Real>-0.0077759951334009786</Real>
+      <Real>-0.38036262154547246</Real>
+      <Real>-0.17225608946132426</Real>
+      <Real>0.51670402409266991</Real>
+      <Real>0.043690682047527844</Real>
+      <Real>-0.0023039985580447344</Real>
+      <Real>-0.30625063538424174</Real>
+      <Real>-0.30742405243110466</Real>
+      <Real>0.5428160052471136</Real>
+      <Real>0.073162681126277593</Real>
+      <Real>-0.012348001471996365</Real>
+      <Real>-0.41547467613283784</Real>
+      <Real>-0.099487979458808773</Real>
+      <Real>0.4947919932041166</Real>
+      <Real>0.032518663859526398</Real>
+      <Real>-0.0065506685959499985</Real>
+      <Real>-0.36826402032089212</Real>
+      <Real>-0.19590396084022466</Real>
+      <Real>0.52280265702692574</Real>
+      <Real>0.047915992730141049</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">10</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">2</Int>
+      <Int Name="Z">2</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">1</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">7</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">8</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">13</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">3</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">6</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">1</Int>
+      <Int Name="Y">0</Int>
+      <Int Name="Z">2</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">1</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">10</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">4</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">6</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">1</Int>
+      <Int Name="Z">2</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 3 0">2.4038114646503656e-07</Real>
+    <Real Name="Cell 0 3 10">1.3744169255185129e-11</Real>
+    <Real Name="Cell 0 3 11">4.5643625464317996e-07</Real>
+    <Real Name="Cell 0 3 12">3.9982471074940497e-06</Real>
+    <Real Name="Cell 0 3 13">3.3579846389930545e-06</Real>
+    <Real Name="Cell 0 4 0">3.3761656553106184e-05</Real>
+    <Real Name="Cell 0 4 1">0.0030613639575252432</Real>
+    <Real Name="Cell 0 4 10">3.3505806257523221e-10</Real>
+    <Real Name="Cell 0 4 11">1.1127092829720778e-05</Real>
+    <Real Name="Cell 0 4 12">9.7470054730924369e-05</Real>
+    <Real Name="Cell 0 4 13">8.1861610287863737e-05</Real>
+    <Real Name="Cell 0 4 2">0.010660903694456762</Real>
+    <Real Name="Cell 0 4 3">0.0040427124373237184</Real>
+    <Real Name="Cell 0 4 4">7.3209996452955803e-05</Real>
+    <Real Name="Cell 0 5 0">0.00058563158095855294</Real>
+    <Real Name="Cell 0 5 1">0.063152608416313441</Real>
+    <Real Name="Cell 0 5 10">0.00068239171632767097</Real>
+    <Real Name="Cell 0 5 11">0.00016835571402374467</Real>
+    <Real Name="Cell 0 5 12">0.00016777058988978752</Real>
+    <Real Name="Cell 0 5 13">0.00014042018665552742</Real>
+    <Real Name="Cell 0 5 2">0.21992284671839957</Real>
+    <Real Name="Cell 0 5 3">0.083396760083518956</Real>
+    <Real Name="Cell 0 5 4">0.0015102425919624064</Real>
+    <Real Name="Cell 0 5 6">1.1612402470787594e-06</Real>
+    <Real Name="Cell 0 5 7">0.00014592617066762326</Real>
+    <Real Name="Cell 0 5 8">0.00054267958666784138</Real>
+    <Real Name="Cell 0 5 9">0.00054067388179342612</Real>
+    <Real Name="Cell 0 6 0">0.00089235766783298377</Real>
+    <Real Name="Cell 0 6 1">0.097712565492877948</Real>
+    <Real Name="Cell 0 6 10">0.026448413158310487</Real>
+    <Real Name="Cell 0 6 11">0.0058102635075056005</Real>
+    <Real Name="Cell 0 6 12">5.2288557836028981e-05</Real>
+    <Real Name="Cell 0 6 13">2.5074028305439302e-05</Real>
+    <Real Name="Cell 0 6 2">0.34027455242530774</Real>
+    <Real Name="Cell 0 6 3">0.12903523046642151</Real>
+    <Real Name="Cell 0 6 4">0.0023367154877349532</Real>
+    <Real Name="Cell 0 6 6">1.8246119276179033e-05</Real>
+    <Real Name="Cell 0 6 7">0.0022928815309455307</Real>
+    <Real Name="Cell 0 6 8">0.0087541406888681124</Real>
+    <Real Name="Cell 0 6 9">0.016129790823298878</Real>
+    <Real Name="Cell 0 7 0">0.00014070976948887473</Real>
+    <Real Name="Cell 0 7 1">0.015438373512183686</Real>
+    <Real Name="Cell 0 7 10">0.058798419436105316</Real>
+    <Real Name="Cell 0 7 11">0.012923025924008376</Real>
+    <Real Name="Cell 0 7 12">4.9972017340616792e-05</Real>
+    <Real Name="Cell 0 7 13">3.8925633356598415e-08</Real>
+    <Real Name="Cell 0 7 2">0.053762641585906677</Real>
+    <Real Name="Cell 0 7 3">0.020387286672117096</Real>
+    <Real Name="Cell 0 7 4">0.00036919598118612611</Real>
+    <Real Name="Cell 0 7 6">2.3584270703226314e-05</Real>
+    <Real Name="Cell 0 7 7">0.002963695342430731</Real>
+    <Real Name="Cell 0 7 8">0.011670900942034709</Real>
+    <Real Name="Cell 0 7 9">0.032796874107813463</Real>
+    <Real Name="Cell 0 8 0">1.0899084515889616e-07</Real>
+    <Real Name="Cell 0 8 1">1.1958478116022732e-05</Real>
+    <Real Name="Cell 0 8 10">0.014083454466678687</Real>
+    <Real Name="Cell 0 8 11">0.0030974648587453659</Real>
+    <Real Name="Cell 0 8 12">1.1966475344471613e-05</Real>
+    <Real Name="Cell 0 8 2">4.1644242663079643e-05</Real>
+    <Real Name="Cell 0 8 3">1.5791878679524813e-05</Real>
+    <Real Name="Cell 0 8 4">2.8597715025184313e-07</Real>
+    <Real Name="Cell 0 8 6">2.987478939556591e-06</Real>
+    <Real Name="Cell 0 8 7">0.00037541874964836414</Real>
+    <Real Name="Cell 0 8 8">0.0015742548438927978</Real>
+    <Real Name="Cell 0 8 9">0.0073756061587431469</Real>
+    <Real Name="Cell 0 9 10">7.3657209093621774e-05</Real>
+    <Real Name="Cell 0 9 11">1.6212117812662444e-05</Real>
+    <Real Name="Cell 0 9 12">6.263248073312284e-08</Real>
+    <Real Name="Cell 0 9 6">3.6700961328170883e-10</Real>
+    <Real Name="Cell 0 9 7">4.6119920144976405e-08</Real>
+    <Real Name="Cell 0 9 8">1.2326576585445708e-06</Real>
+    <Real Name="Cell 0 9 9">3.5823429323979585e-05</Real>
+    <Real Name="Cell 1 0 2">4.5707299525594552e-07</Real>
+    <Real Name="Cell 1 0 3">1.4163508322049627e-05</Real>
+    <Real Name="Cell 1 0 4">2.7910456079410612e-05</Real>
+    <Real Name="Cell 1 0 5">5.8453600780912934e-06</Real>
+    <Real Name="Cell 1 0 6">1.8622445886520021e-08</Real>
+    <Real Name="Cell 1 1 2">5.0278029478154015e-06</Real>
+    <Real Name="Cell 1 1 3">0.00015579859154254589</Real>
+    <Real Name="Cell 1 1 4">0.00030701501687351674</Real>
+    <Real Name="Cell 1 1 5">6.4298960859004233e-05</Real>
+    <Real Name="Cell 1 1 6">2.0484690475172022e-07</Real>
+    <Real Name="Cell 1 2 2">5.0278029478154015e-06</Real>
+    <Real Name="Cell 1 2 3">0.00015579859154254589</Real>
+    <Real Name="Cell 1 2 4">0.00030701501687351674</Real>
+    <Real Name="Cell 1 2 5">6.4298960859004233e-05</Real>
+    <Real Name="Cell 1 2 6">2.0484690475172022e-07</Real>
+    <Real Name="Cell 1 3 0">5.6796490194329426e-05</Real>
+    <Real Name="Cell 1 3 10">3.407168468900614e-09</Real>
+    <Real Name="Cell 1 3 11">0.00010787402532512448</Real>
+    <Real Name="Cell 1 3 12">0.0009448005288780081</Real>
+    <Real Name="Cell 1 3 13">0.00079345244766444755</Real>
+    <Real Name="Cell 1 3 2">4.5707299525594552e-07</Real>
+    <Real Name="Cell 1 3 3">1.4163508322049627e-05</Real>
+    <Real Name="Cell 1 3 4">2.7910456079410612e-05</Real>
+    <Real Name="Cell 1 3 5">5.8453600780912934e-06</Real>
+    <Real Name="Cell 1 3 6">1.8622445886520021e-08</Real>
+    <Real Name="Cell 1 4 0">0.0013861356368472467</Real>
+    <Real Name="Cell 1 4 1">0.0001698625654470248</Real>
+    <Real Name="Cell 1 4 10">8.2207399247739423e-08</Real>
+    <Real Name="Cell 1 4 11">0.0026296046984274108</Real>
+    <Real Name="Cell 1 4 12">0.023031817788568786</Real>
+    <Real Name="Cell 1 4 13">0.019342615035822668</Real>
+    <Real Name="Cell 1 4 2">0.0005915299443807338</Real>
+    <Real Name="Cell 1 4 3">0.00022431357901120738</Real>
+    <Real Name="Cell 1 4 4">4.0621232843936084e-06</Real>
+    <Real Name="Cell 1 5 0">0.0024069621894676333</Real>
+    <Real Name="Cell 1 5 1">0.0035040799555692546</Real>
+    <Real Name="Cell 1 5 10">0.0076432154207601924</Real>
+    <Real Name="Cell 1 5 11">0.0061536880635841172</Real>
+    <Real Name="Cell 1 5 12">0.039513031863137441</Real>
+    <Real Name="Cell 1 5 13">0.03317880385175679</Real>
+    <Real Name="Cell 1 5 2">0.012202619310315087</Real>
+    <Real Name="Cell 1 5 3">0.0046273451357963071</Real>
+    <Real Name="Cell 1 5 4">8.3797184744239381e-05</Real>
+    <Real Name="Cell 1 5 6">4.8320975061311598e-05</Real>
+    <Real Name="Cell 1 5 7">0.0060722101833934825</Real>
+    <Real Name="Cell 1 5 8">0.022282153065727051</Real>
+    <Real Name="Cell 1 5 9">0.012425762410203248</Real>
+    <Real Name="Cell 1 6 0">0.00047350706084050632</Real>
+    <Real Name="Cell 1 6 1">0.0054216706282934077</Real>
+    <Real Name="Cell 1 6 10">0.29518569263643696</Real>
+    <Real Name="Cell 1 6 11">0.064893807832174882</Real>
+    <Real Name="Cell 1 6 12">0.0073012826320099072</Real>
+    <Real Name="Cell 1 6 13">0.0059244976754494342</Real>
+    <Real Name="Cell 1 6 2">0.018880443238126255</Real>
+    <Real Name="Cell 1 6 3">0.0071596372022988131</Real>
+    <Real Name="Cell 1 6 4">0.00012965478557058568</Real>
+    <Real Name="Cell 1 6 6">0.00075924880895913863</Real>
+    <Real Name="Cell 1 6 7">0.095410292219511583</Real>
+    <Real Name="Cell 1 6 8">0.35281345240034301</Real>
+    <Real Name="Cell 1 6 9">0.28136158282034168</Real>
+    <Real Name="Cell 1 7 0">8.4656226811274288e-06</Real>
+    <Real Name="Cell 1 7 1">0.00085661220537424179</Real>
+    <Real Name="Cell 1 7 10">0.66128563932136208</Real>
+    <Real Name="Cell 1 7 11">0.14322294829521243</Real>
+    <Real Name="Cell 1 7 12">0.00056045021066088998</Real>
+    <Real Name="Cell 1 7 13">9.1970942121584555e-06</Real>
+    <Real Name="Cell 1 7 2">0.0029830690998182978</Real>
+    <Real Name="Cell 1 7 3">0.001131207156247181</Real>
+    <Real Name="Cell 1 7 4">2.0485175035412225e-05</Real>
+    <Real Name="Cell 1 7 6">0.00098137741897652954</Real>
+    <Real Name="Cell 1 7 7">0.12332387659649466</Real>
+    <Real Name="Cell 1 7 8">0.46083830155109629</Real>
+    <Real Name="Cell 1 7 9">0.50442664771633416</Real>
+    <Real Name="Cell 1 8 0">6.0474562403535729e-09</Real>
+    <Real Name="Cell 1 8 1">6.6352704213313889e-07</Real>
+    <Real Name="Cell 1 8 10">0.16204687577379562</Real>
+    <Real Name="Cell 1 8 11">0.034666836127424466</Real>
+    <Real Name="Cell 1 8 12">0.00013170721423765898</Real>
+    <Real Name="Cell 1 8 2">2.3106687061696157e-06</Real>
+    <Real Name="Cell 1 8 3">8.762267613226581e-07</Real>
+    <Real Name="Cell 1 8 4">1.5867702460401362e-08</Real>
+    <Real Name="Cell 1 8 6">0.00012431354812034582</Real>
+    <Real Name="Cell 1 8 7">0.01562174597442814</Real>
+    <Real Name="Cell 1 8 8">0.05995896538780851</Real>
+    <Real Name="Cell 1 8 9">0.10483377652624837</Real>
+    <Real Name="Cell 1 9 10">0.0010858577236716744</Real>
+    <Real Name="Cell 1 9 11">0.00020202509648595602</Real>
+    <Real Name="Cell 1 9 12">6.8935499557641082e-07</Real>
+    <Real Name="Cell 1 9 6">1.5271828904707491e-08</Real>
+    <Real Name="Cell 1 9 7">1.9191242023435899e-06</Real>
+    <Real Name="Cell 1 9 8">4.6403858752887685e-05</Real>
+    <Real Name="Cell 1 9 9">0.00068372122755422046</Real>
+    <Real Name="Cell 13 4 0">2.0378662739711926e-09</Real>
+    <Real Name="Cell 13 4 1">2.2359473591691984e-07</Real>
+    <Real Name="Cell 13 4 2">7.7864702768786007e-07</Real>
+    <Real Name="Cell 13 4 3">2.9527009279294114e-07</Real>
+    <Real Name="Cell 13 4 4">5.3470838653924772e-09</Real>
+    <Real Name="Cell 13 5 0">4.2038964523823106e-08</Real>
+    <Real Name="Cell 13 5 1">4.6125161846894896e-06</Real>
+    <Real Name="Cell 13 5 2">1.6062641200574176e-05</Real>
+    <Real Name="Cell 13 5 3">6.0911008314983672e-06</Real>
+    <Real Name="Cell 13 5 4">1.1030452380229092e-07</Real>
+    <Real Name="Cell 13 6 0">6.5044582912678825e-08</Real>
+    <Real Name="Cell 13 6 1">7.1366931799923446e-06</Real>
+    <Real Name="Cell 13 6 2">2.4852843289593539e-05</Real>
+    <Real Name="Cell 13 6 3">9.4244260664261451e-06</Real>
+    <Real Name="Cell 13 6 4">1.7066813670055601e-07</Real>
+    <Real Name="Cell 13 7 0">1.0276903086976353e-08</Real>
+    <Real Name="Cell 13 7 1">1.1275820504641901e-06</Real>
+    <Real Name="Cell 13 7 2">3.9266953601016551e-06</Real>
+    <Real Name="Cell 13 7 3">1.4890388868364316e-06</Real>
+    <Real Name="Cell 13 7 4">2.6965195599164326e-08</Real>
+    <Real Name="Cell 13 8 0">7.9604318789868479e-12</Real>
+    <Real Name="Cell 13 8 1">8.7341877457846162e-10</Real>
+    <Real Name="Cell 13 8 2">3.0415963504837989e-09</Real>
+    <Real Name="Cell 13 8 3">1.1534012263719127e-09</Real>
+    <Real Name="Cell 13 8 4">2.0887090289167917e-11</Real>
+    <Real Name="Cell 14 4 0">5.6200506292808043e-06</Real>
+    <Real Name="Cell 14 4 1">0.0006166320883484646</Real>
+    <Real Name="Cell 14 4 2">0.0021473615682432389</Real>
+    <Real Name="Cell 14 4 3">0.00081429919715734415</Real>
+    <Real Name="Cell 14 4 4">1.4746248282501894e-05</Real>
+    <Real Name="Cell 14 5 0">0.00011593553121914285</Real>
+    <Real Name="Cell 14 5 1">0.012720449235276224</Real>
+    <Real Name="Cell 14 5 2">0.044297733340119452</Real>
+    <Real Name="Cell 14 5 3">0.016798106675747038</Real>
+    <Real Name="Cell 14 5 4">0.0003041990616977784</Real>
+    <Real Name="Cell 14 6 0">0.0001793806854742009</Real>
+    <Real Name="Cell 14 6 1">0.019681653065017058</Real>
+    <Real Name="Cell 14 6 2">0.068539451951827077</Real>
+    <Real Name="Cell 14 6 3">0.025990788660540647</Real>
+    <Real Name="Cell 14 6 4">0.0004706705151918625</Real>
+    <Real Name="Cell 14 7 0">2.8341759417053756e-05</Real>
+    <Real Name="Cell 14 7 1">0.0031096585154863762</Real>
+    <Real Name="Cell 14 7 2">0.010829084818469932</Real>
+    <Real Name="Cell 14 7 3">0.0041064882617057206</Real>
+    <Real Name="Cell 14 7 4">7.4364921011448918e-05</Real>
+    <Real Name="Cell 14 8 0">2.1953368953727255e-08</Real>
+    <Real Name="Cell 14 8 1">2.4087241623219196e-06</Real>
+    <Real Name="Cell 14 8 2">8.3881487720211001e-06</Real>
+    <Real Name="Cell 14 8 3">3.1808629304477868e-06</Real>
+    <Real Name="Cell 14 8 4">5.7602653531692198e-08</Real>
+    <Real Name="Cell 15 4 0">3.9556900032567638e-05</Real>
+    <Real Name="Cell 15 4 1">0.0043401840098360595</Real>
+    <Real Name="Cell 15 4 2">0.015114270758739695</Real>
+    <Real Name="Cell 15 4 3">0.0057314700637626104</Real>
+    <Real Name="Cell 15 4 4">0.00010379192424481706</Real>
+    <Real Name="Cell 15 5 0">0.00081601581928188659</Real>
+    <Real Name="Cell 15 5 1">0.089533275046948274</Real>
+    <Real Name="Cell 15 5 2">0.31179096506265502</Real>
+    <Real Name="Cell 15 5 3">0.11823399295496491</Real>
+    <Real Name="Cell 15 5 4">0.0021411144965289711</Real>
+    <Real Name="Cell 15 6 0">0.0012625764981737295</Real>
+    <Real Name="Cell 15 6 1">0.13852992332707656</Real>
+    <Real Name="Cell 15 6 2">0.48241705066140106</Real>
+    <Real Name="Cell 15 6 3">0.18293696918957586</Real>
+    <Real Name="Cell 15 6 4">0.003312828966472173</Real>
+    <Real Name="Cell 15 7 0">0.00019948434951215846</Real>
+    <Real Name="Cell 15 7 1">0.021887427560106986</Real>
+    <Real Name="Cell 15 7 2">0.076220848149766346</Real>
+    <Real Name="Cell 15 7 3">0.028903644534247382</Real>
+    <Real Name="Cell 15 7 4">0.00052341979466404118</Real>
+    <Real Name="Cell 15 8 0">1.5451946581338766e-07</Real>
+    <Real Name="Cell 15 8 1">1.6953879454141424e-05</Real>
+    <Real Name="Cell 15 8 2">5.904024435374262e-05</Real>
+    <Real Name="Cell 15 8 3">2.2388602035267616e-05</Real>
+    <Real Name="Cell 15 8 4">4.0543805699760518e-07</Real>
+    <Real Name="Cell 2 0 2">0.0002498155385930853</Real>
+    <Real Name="Cell 2 0 3">0.0077411365286613881</Real>
+    <Real Name="Cell 2 0 4">0.015254599790898316</Real>
+    <Real Name="Cell 2 0 5">0.0031948108755827896</Real>
+    <Real Name="Cell 2 0 6">1.0178191224044032e-05</Real>
+    <Real Name="Cell 2 1 2">0.0027479747018518933</Real>
+    <Real Name="Cell 2 1 3">0.085153394284706016</Real>
+    <Real Name="Cell 2 1 4">0.16780455354843349</Real>
+    <Real Name="Cell 2 1 5">0.035144797811848927</Real>
+    <Real Name="Cell 2 1 6">0.00011201373799807559</Real>
+    <Real Name="Cell 2 10 1">1.3481074899302508e-06</Real>
+    <Real Name="Cell 2 10 2">2.134127947885331e-05</Real>
+    <Real Name="Cell 2 10 3">2.7726913477769916e-05</Real>
+    <Real Name="Cell 2 10 4">3.5349199420325544e-06</Real>
+    <Real Name="Cell 2 10 5">4.6614218264628964e-10</Real>
+    <Real Name="Cell 2 2 2">0.0027486297415234874</Real>
+    <Real Name="Cell 2 2 3">0.085308822265046866</Real>
+    <Real Name="Cell 2 2 4">0.16849458031331255</Real>
+    <Real Name="Cell 2 2 5">0.035472955034300369</Real>
+    <Real Name="Cell 2 2 6">0.00012141928533497429</Real>
+    <Real Name="Cell 2 3 0">0.00027510852556740777</Real>
+    <Real Name="Cell 2 3 1">4.9613992191374375e-11</Real>
+    <Real Name="Cell 2 3 10">2.3536826227928812e-06</Real>
+    <Real Name="Cell 2 3 11">0.00094277543386799543</Real>
+    <Real Name="Cell 2 3 12">0.0061486684252402106</Real>
+    <Real Name="Cell 2 3 13">0.0044073670860994476</Real>
+    <Real Name="Cell 2 3 2">0.00025303841064216971</Real>
+    <Real Name="Cell 2 3 3">0.0086421238685155007</Real>
+    <Real Name="Cell 2 3 4">0.019479403438330288</Real>
+    <Real Name="Cell 2 3 5">0.0053164228319110959</Real>
+    <Real Name="Cell 2 3 6">8.5628043126115337e-05</Real>
+    <Real Name="Cell 2 3 7">4.5173708911601381e-06</Real>
+    <Real Name="Cell 2 3 8">1.9012113989656424e-07</Real>
+    <Real Name="Cell 2 4 0">0.0065819138380779707</Real>
+    <Real Name="Cell 2 4 1">4.0386069305842674e-07</Real>
+    <Real Name="Cell 2 4 10">4.4890760674972554e-05</Real>
+    <Real Name="Cell 2 4 11">0.020502107996210002</Real>
+    <Real Name="Cell 2 4 12">0.1394226434741048</Real>
+    <Real Name="Cell 2 4 13">0.1026889737422</Real>
+    <Real Name="Cell 2 4 2">5.5558396599689873e-06</Real>
+    <Real Name="Cell 2 4 3">0.0014458595847623476</Real>
+    <Real Name="Cell 2 4 4">0.0073969820473805568</Real>
+    <Real Name="Cell 2 4 5">0.0040318988355889287</Real>
+    <Real Name="Cell 2 4 6">0.00030950036166268774</Real>
+    <Real Name="Cell 2 4 7">9.7076422866899026e-05</Real>
+    <Real Name="Cell 2 4 8">4.0856242750959616e-06</Real>
+    <Real Name="Cell 2 5 0">0.011180900719946847</Real>
+    <Real Name="Cell 2 5 1">3.1882266299411025e-06</Real>
+    <Real Name="Cell 2 5 10">0.0079732336948385458</Real>
+    <Real Name="Cell 2 5 11">0.034640590509580328</Real>
+    <Real Name="Cell 2 5 12">0.22998794327069275</Real>
+    <Real Name="Cell 2 5 13">0.17197978768373776</Real>
+    <Real Name="Cell 2 5 2">1.6750999695524604e-05</Real>
+    <Real Name="Cell 2 5 3">0.00055440887141524503</Real>
+    <Real Name="Cell 2 5 4">0.0028797840437215266</Real>
+    <Real Name="Cell 2 5 5">0.0016393547862294613</Real>
+    <Real Name="Cell 2 5 6">0.00043149799449147363</Real>
+    <Real Name="Cell 2 5 7">0.014138303521287764</Real>
+    <Real Name="Cell 2 5 8">0.051184175386311287</Real>
+    <Real Name="Cell 2 5 9">0.023925472939702819</Real>
+    <Real Name="Cell 2 6 0">0.0019768338428955939</Real>
+    <Real Name="Cell 2 6 1">2.4758505367869834e-06</Real>
+    <Real Name="Cell 2 6 10">0.31946219153207484</Real>
+    <Real Name="Cell 2 6 11">0.07137754822777681</Real>
+    <Real Name="Cell 2 6 12">0.039661433119773763</Real>
+    <Real Name="Cell 2 6 13">0.029959251247611205</Real>
+    <Real Name="Cell 2 6 2">1.2252595311538765e-05</Real>
+    <Real Name="Cell 2 6 3">2.1046343352777652e-05</Real>
+    <Real Name="Cell 2 6 4">7.7301320396013998e-05</Real>
+    <Real Name="Cell 2 6 5">5.0149728482387922e-05</Real>
+    <Real Name="Cell 2 6 6">0.0017925603415350079</Real>
+    <Real Name="Cell 2 6 7">0.2197532064734799</Real>
+    <Real Name="Cell 2 6 8">0.80885660483650923</Real>
+    <Real Name="Cell 2 6 9">0.48302447295309703</Real>
+    <Real Name="Cell 2 7 0">2.9679017361548918e-06</Real>
+    <Real Name="Cell 2 7 1">8.4222334570356772e-06</Real>
+    <Real Name="Cell 2 7 10">0.78126224197119498</Real>
+    <Real Name="Cell 2 7 11">0.15315390894632977</Real>
+    <Real Name="Cell 2 7 12">0.00060241082218086761</Real>
+    <Real Name="Cell 2 7 13">4.2643245949186972e-05</Real>
+    <Real Name="Cell 2 7 2">0.00013161200922329601</Real>
+    <Real Name="Cell 2 7 3">0.0001703925362663897</Real>
+    <Real Name="Cell 2 7 4">2.16860031509523e-05</Real>
+    <Real Name="Cell 2 7 5">9.8273197151913112e-09</Real>
+    <Real Name="Cell 2 7 6">0.0022601333230167424</Real>
+    <Real Name="Cell 2 7 7">0.28401257306799099</Real>
+    <Real Name="Cell 2 7 8">1.0592075495997366</Real>
+    <Real Name="Cell 2 7 9">0.85758572457001703</Real>
+    <Real Name="Cell 2 8 1">4.9190690254313615e-05</Real>
+    <Real Name="Cell 2 8 10">0.22977231345145957</Real>
+    <Real Name="Cell 2 8 11">0.040432136181128647</Real>
+    <Real Name="Cell 2 8 12">0.00013176422876454407</Real>
+    <Real Name="Cell 2 8 2">0.00077871555222152754</Real>
+    <Real Name="Cell 2 8 3">0.001011719037822199</Real>
+    <Real Name="Cell 2 8 4">0.00012898463456450065</Real>
+    <Real Name="Cell 2 8 5">1.7008922428143823e-08</Real>
+    <Real Name="Cell 2 8 6">0.00028629174278980263</Real>
+    <Real Name="Cell 2 8 7">0.035976585464035656</Real>
+    <Real Name="Cell 2 8 8">0.141038481060279</Real>
+    <Real Name="Cell 2 8 9">0.20442217635953042</Real>
+    <Real Name="Cell 2 9 1">3.019602449530798e-05</Real>
+    <Real Name="Cell 2 9 10">0.0038374796374183165</Real>
+    <Real Name="Cell 2 9 11">0.00043799089807709237</Real>
+    <Real Name="Cell 2 9 12">6.8965340936608935e-07</Real>
+    <Real Name="Cell 2 9 2">0.00047801959615105283</Real>
+    <Real Name="Cell 2 9 3">0.00062105029814599059</Real>
+    <Real Name="Cell 2 9 4">7.9178055129780698e-05</Real>
+    <Real Name="Cell 2 9 5">1.0441037432565514e-08</Real>
+    <Real Name="Cell 2 9 6">3.5170732223681197e-08</Real>
+    <Real Name="Cell 2 9 7">4.4197422153861985e-06</Real>
+    <Real Name="Cell 2 9 8">0.0003323640374771887</Real>
+    <Real Name="Cell 2 9 9">0.0035614219337351239</Real>
+    <Real Name="Cell 3 0 2">0.0013533780477245978</Real>
+    <Real Name="Cell 3 0 3">0.041937680503510946</Real>
+    <Real Name="Cell 3 0 4">0.082641938928603803</Real>
+    <Real Name="Cell 3 0 5">0.017307918194345771</Real>
+    <Real Name="Cell 3 0 6">5.514044741068652e-05</Real>
+    <Real Name="Cell 3 1 2">0.014887572973361067</Real>
+    <Real Name="Cell 3 1 3">0.46141240727683552</Real>
+    <Real Name="Cell 3 1 4">0.90949536388352359</Real>
+    <Real Name="Cell 3 1 5">0.19059317407922791</Real>
+    <Real Name="Cell 3 1 6">0.00061242970207887545</Real>
+    <Real Name="Cell 3 10 1">0.00026784048902184389</Real>
+    <Real Name="Cell 3 10 2">0.0042400615489968478</Real>
+    <Real Name="Cell 3 10 3">0.0055087521732680817</Real>
+    <Real Name="Cell 3 10 4">0.00070231394232224994</Real>
+    <Real Name="Cell 3 10 5">9.2612607738090323e-08</Real>
+    <Real Name="Cell 3 2 2">0.014959237424696927</Real>
+    <Real Name="Cell 3 2 3">0.47836591519652877</Real>
+    <Real Name="Cell 3 2 4">0.98467672257792527</Real>
+    <Real Name="Cell 3 2 5">0.22630570493329041</Real>
+    <Real Name="Cell 3 2 6">0.0016333719273454875</Real>
+    <Real Name="Cell 3 3 0">0.00031315856721966481</Real>
+    <Real Name="Cell 3 3 1">2.1787936619969193e-07</Real>
+    <Real Name="Cell 3 3 10">1.939211492020101e-05</Real>
+    <Real Name="Cell 3 3 11">0.0040783965173197372</Real>
+    <Real Name="Cell 3 3 12">0.018242282177917079</Real>
+    <Real Name="Cell 3 3 13">0.00905056858982233</Real>
+    <Real Name="Cell 3 3 2">0.0016644761398509245</Real>
+    <Real Name="Cell 3 3 3">0.11969193086264861</Real>
+    <Real Name="Cell 3 3 4">0.43486486106665123</Real>
+    <Real Name="Cell 3 3 5">0.18887955664491532</Real>
+    <Real Name="Cell 3 3 6">0.0059690091133855856</Real>
+    <Real Name="Cell 3 3 7">0.00028786531821870198</Real>
+    <Real Name="Cell 3 3 8">1.1625272812067771e-05</Real>
+    <Real Name="Cell 3 4 0">0.0066056535086816415</Real>
+    <Real Name="Cell 3 4 1">0.0017735503221979446</Real>
+    <Real Name="Cell 3 4 10">0.0003692607488595925</Real>
+    <Real Name="Cell 3 4 11">0.078863863673193813</Real>
+    <Real Name="Cell 3 4 12">0.35794419826055957</Real>
+    <Real Name="Cell 3 4 13">0.18123526493388614</Real>
+    <Real Name="Cell 3 4 2">0.0088885526611963833</Real>
+    <Real Name="Cell 3 4 3">0.072429371397158188</Real>
+    <Real Name="Cell 3 4 4">0.336693633529348</Real>
+    <Real Name="Cell 3 4 5">0.19322521924102548</Real>
+    <Real Name="Cell 3 4 6">0.025278943128235698</Real>
+    <Real Name="Cell 3 4 7">0.0062597711796156608</Real>
+    <Real Name="Cell 3 4 8">0.0002498222808438753</Real>
+    <Real Name="Cell 3 5 0">0.010456678835921987</Real>
+    <Real Name="Cell 3 5 1">0.014001066367590452</Real>
+    <Real Name="Cell 3 5 10">0.0013577282177660427</Real>
+    <Real Name="Cell 3 5 11">0.11741462944841109</Real>
+    <Real Name="Cell 3 5 12">0.53796261051252425</Real>
+    <Real Name="Cell 3 5 13">0.27635376183063376</Real>
+    <Real Name="Cell 3 5 2">0.068585276590653846</Real>
+    <Real Name="Cell 3 5 3">0.053721460399325863</Real>
+    <Real Name="Cell 3 5 4">0.10284390550374783</Real>
+    <Real Name="Cell 3 5 5">0.087722090247097248</Real>
+    <Real Name="Cell 3 5 6">0.035108251849537024</Real>
+    <Real Name="Cell 3 5 7">0.013502937599793575</Real>
+    <Real Name="Cell 3 5 8">0.01311313478406596</Real>
+    <Real Name="Cell 3 5 9">0.0054071704127621901</Real>
+    <Real Name="Cell 3 6 0">0.00172806584954548</Real>
+    <Real Name="Cell 3 6 1">0.010833852564152676</Real>
+    <Real Name="Cell 3 6 10">0.050683918175936468</Real>
+    <Real Name="Cell 3 6 11">0.02544845109710072</Real>
+    <Real Name="Cell 3 6 12">0.082392746409420833</Real>
+    <Real Name="Cell 3 6 13">0.043130178809524591</Real>
+    <Real Name="Cell 3 6 2">0.053061317410684164</Real>
+    <Real Name="Cell 3 6 3">0.028024881422337892</Real>
+    <Real Name="Cell 3 6 4">0.004676743891157676</Real>
+    <Real Name="Cell 3 6 5">0.0081684258795971434</Real>
+    <Real Name="Cell 3 6 6">0.0064409760279563249</Real>
+    <Real Name="Cell 3 6 7">0.056312160193815408</Real>
+    <Real Name="Cell 3 6 8">0.2023202100726163</Real>
+    <Real Name="Cell 3 6 9">0.1156369039316627</Real>
+    <Real Name="Cell 3 7 0">3.7770252083125348e-06</Real>
+    <Real Name="Cell 3 7 1">0.0023315142692650974</Real>
+    <Real Name="Cell 3 7 10">0.18740171023266458</Real>
+    <Real Name="Cell 3 7 11">0.023804825511154818</Real>
+    <Real Name="Cell 3 7 12">0.00010732079533397955</Real>
+    <Real Name="Cell 3 7 13">3.4916774113249023e-05</Real>
+    <Real Name="Cell 3 7 2">0.029370905937156751</Real>
+    <Real Name="Cell 3 7 3">0.03552520913646505</Real>
+    <Real Name="Cell 3 7 4">0.0043676781559706182</Real>
+    <Real Name="Cell 3 7 5">1.6062853555129327e-05</Real>
+    <Real Name="Cell 3 7 6">0.00057264054241721544</Real>
+    <Real Name="Cell 3 7 7">0.070652283704718336</Real>
+    <Real Name="Cell 3 7 8">0.27157898124136376</Real>
+    <Real Name="Cell 3 7 9">0.26311915734455293</Real>
+    <Real Name="Cell 3 8 1">0.0097731513484277718</Real>
+    <Real Name="Cell 3 8 10">0.088130184446009577</Real>
+    <Real Name="Cell 3 8 11">0.0094279804995700926</Real>
+    <Real Name="Cell 3 8 12">1.1985480188262105e-05</Real>
+    <Real Name="Cell 3 8 2">0.15471433537300527</Real>
+    <Real Name="Cell 3 8 3">0.20100720741268732</Real>
+    <Real Name="Cell 3 8 4">0.025626523000660064</Real>
+    <Real Name="Cell 3 8 5">3.3793136933942519e-06</Real>
+    <Real Name="Cell 3 8 6">7.1217533257907862e-05</Real>
+    <Real Name="Cell 3 8 7">0.0089494858734831401</Real>
+    <Real Name="Cell 3 8 8">0.040307942312643112</Real>
+    <Real Name="Cell 3 8 9">0.096877478985862658</Real>
+    <Real Name="Cell 3 9 1">0.0059993123899618073</Real>
+    <Real Name="Cell 3 9 10">0.0031001231431427479</Real>
+    <Real Name="Cell 3 9 11">0.00027571527994622148</Real>
+    <Real Name="Cell 3 9 12">6.273195200417625e-08</Real>
+    <Real Name="Cell 3 9 2">0.094972398975208247</Real>
+    <Real Name="Cell 3 9 3">0.12338957895055563</Real>
+    <Real Name="Cell 3 9 4">0.015731007478384532</Real>
+    <Real Name="Cell 3 9 5">2.0744136448484635e-06</Real>
+    <Real Name="Cell 3 9 6">8.7490221249028777e-09</Real>
+    <Real Name="Cell 3 9 7">1.0994827024180016e-06</Real>
+    <Real Name="Cell 3 9 8">0.00030958684791900621</Real>
+    <Real Name="Cell 3 9 9">0.0031987041013290607</Real>
+    <Real Name="Cell 4 0 2">0.00076686615718124702</Real>
+    <Real Name="Cell 4 0 3">0.023763196058110423</Real>
+    <Real Name="Cell 4 0 4">0.046827496747665655</Real>
+    <Real Name="Cell 4 0 5">0.0098072055600581555</Real>
+    <Real Name="Cell 4 0 6">3.1244295030631789e-05</Real>
+    <Real Name="Cell 4 1 2">0.0084369710052495175</Real>
+    <Real Name="Cell 4 1 3">0.26173615957935237</Real>
+    <Real Name="Cell 4 1 4">0.5166139512741964</Real>
+    <Real Name="Cell 4 1 5">0.10859689364135737</Real>
+    <Real Name="Cell 4 1 6">0.00036418042192934647</Real>
+    <Real Name="Cell 4 10 1">0.0011303673247218093</Real>
+    <Real Name="Cell 4 10 2">0.017894333479224256</Real>
+    <Real Name="Cell 4 10 3">0.023248589036680915</Real>
+    <Real Name="Cell 4 10 4">0.0029639758163407626</Real>
+    <Real Name="Cell 4 10 5">3.908530260929958e-07</Real>
+    <Real Name="Cell 4 2 2">0.008686409294217148</Real>
+    <Real Name="Cell 4 2 3">0.32071395875766134</Real>
+    <Real Name="Cell 4 2 4">0.77810281278405968</Real>
+    <Real Name="Cell 4 2 5">0.23278332028139342</Real>
+    <Real Name="Cell 4 2 6">0.0039127688598208071</Real>
+    <Real Name="Cell 4 3 0">0.00015910319588090428</Real>
+    <Real Name="Cell 4 3 1">1.6184654078290555e-06</Real>
+    <Real Name="Cell 4 3 10">1.5586288861135836e-05</Real>
+    <Real Name="Cell 4 3 11">0.0031031078765990437</Real>
+    <Real Name="Cell 4 3 12">0.013125466256572916</Real>
+    <Real Name="Cell 4 3 13">0.0059820443778905554</Real>
+    <Real Name="Cell 4 3 2">0.0018278250082883571</Real>
+    <Real Name="Cell 4 3 3">0.28164543316785084</Real>
+    <Real Name="Cell 4 3 4">1.2074457782232799</Real>
+    <Real Name="Cell 4 3 5">0.58025820985662313</Real>
+    <Real Name="Cell 4 3 6">0.024585509569928304</Real>
+    <Real Name="Cell 4 3 7">0.0010026045412059243</Real>
+    <Real Name="Cell 4 3 8">3.2087665641407865e-05</Real>
+    <Real Name="Cell 4 4 0">0.0030853443950048004</Real>
+    <Real Name="Cell 4 4 1">0.013174399648705735</Real>
+    <Real Name="Cell 4 4 10">0.00029676269513131184</Real>
+    <Real Name="Cell 4 4 11">0.059117515083456057</Real>
+    <Real Name="Cell 4 4 12">0.25021085588296993</Real>
+    <Real Name="Cell 4 4 13">0.11415216192660219</Real>
+    <Real Name="Cell 4 4 2">0.065100835266032595</Real>
+    <Real Name="Cell 4 4 3">0.21478052886756377</Real>
+    <Real Name="Cell 4 4 4">0.94038480253223422</Real>
+    <Real Name="Cell 4 4 5">0.80944917342994382</Real>
+    <Real Name="Cell 4 4 6">0.23376990800002562</Real>
+    <Real Name="Cell 4 4 7">0.023065186355986048</Real>
+    <Real Name="Cell 4 4 8">0.00068955059782948279</Real>
+    <Real Name="Cell 4 5 0">0.004798342901198416</Real>
+    <Real Name="Cell 4 5 1">0.10400361440328074</Real>
+    <Real Name="Cell 4 5 10">0.00043992577564243735</Real>
+    <Real Name="Cell 4 5 11">0.086921578831488683</Real>
+    <Real Name="Cell 4 5 12">0.36806423480986006</Real>
+    <Real Name="Cell 4 5 13">0.1680501289700761</Real>
+    <Real Name="Cell 4 5 2">0.50926274540764782</Real>
+    <Real Name="Cell 4 5 3">0.30214533699332163</Real>
+    <Real Name="Cell 4 5 4">0.33869835233892948</Real>
+    <Real Name="Cell 4 5 5">0.78472963900816495</Real>
+    <Real Name="Cell 4 5 6">0.40277446022214047</Real>
+    <Real Name="Cell 4 5 7">0.038417733156320043</Real>
+    <Real Name="Cell 4 5 8">0.0011702489626882104</Real>
+    <Real Name="Cell 4 5 9">3.3170379202719005e-05</Real>
+    <Real Name="Cell 4 6 0">0.0009037361550058888</Real>
+    <Real Name="Cell 4 6 1">0.080470813530078358</Real>
+    <Real Name="Cell 4 6 10">0.0021284353207737293</Real>
+    <Real Name="Cell 4 6 11">0.013088971885849303</Real>
+    <Real Name="Cell 4 6 12">0.054715711240088886</Real>
+    <Real Name="Cell 4 6 13">0.025009393346210419</Real>
+    <Real Name="Cell 4 6 2">0.39405478450098691</Real>
+    <Real Name="Cell 4 6 3">0.20555007022122307</Real>
+    <Real Name="Cell 4 6 4">0.037925494791216811</Real>
+    <Real Name="Cell 4 6 5">0.13473382504984843</Real>
+    <Real Name="Cell 4 6 6">0.076590053558302409</Real>
+    <Real Name="Cell 4 6 7">0.0069819792230342197</Real>
+    <Real Name="Cell 4 6 8">0.0015666228178196177</Real>
+    <Real Name="Cell 4 6 9">0.0026147941586366959</Real>
+    <Real Name="Cell 4 7 0">1.5099930957770617e-05</Real>
+    <Real Name="Cell 4 7 1">0.012051206924945433</Real>
+    <Real Name="Cell 4 7 10">0.011516783749394587</Real>
+    <Real Name="Cell 4 7 11">0.0009930158800500685</Real>
+    <Real Name="Cell 4 7 12">2.8212300505386193e-05</Real>
+    <Real Name="Cell 4 7 13">1.306479956504001e-05</Real>
+    <Real Name="Cell 4 7 2">0.13478115830021317</Real>
+    <Real Name="Cell 4 7 3">0.15554439685539487</Real>
+    <Real Name="Cell 4 7 4">0.0186707494745777</Real>
+    <Real Name="Cell 4 7 5">0.00031442734625891687</Real>
+    <Real Name="Cell 4 7 6">0.00017491231550959222</Real>
+    <Real Name="Cell 4 7 7">0.00042794379399261126</Real>
+    <Real Name="Cell 4 7 8">0.0026849645069519238</Real>
+    <Real Name="Cell 4 7 9">0.012623790572206965</Real>
+    <Real Name="Cell 4 8 1">0.041245634609495797</Real>
+    <Real Name="Cell 4 8 10">0.0067084644222185014</Real>
+    <Real Name="Cell 4 8 11">0.00057505421163516694</Real>
+    <Real Name="Cell 4 8 12">1.8542341069229676e-20</Real>
+    <Real Name="Cell 4 8 2">0.65294097248095295</Real>
+    <Real Name="Cell 4 8 3">0.84831079917252827</Real>
+    <Real Name="Cell 4 8 4">0.10815162543933221</Real>
+    <Real Name="Cell 4 8 5">1.4261718954247822e-05</Real>
+    <Real Name="Cell 4 8 6">4.2157266739233652e-07</Real>
+    <Real Name="Cell 4 8 7">5.297663511458808e-05</Real>
+    <Real Name="Cell 4 8 8">0.00086830204501830706</Real>
+    <Real Name="Cell 4 8 9">0.0070828376641636102</Real>
+    <Real Name="Cell 4 9 1">0.025318900518653355</Real>
+    <Real Name="Cell 4 9 10">0.00027512004946931234</Real>
+    <Real Name="Cell 4 9 11">2.3588855861020139e-05</Real>
+    <Real Name="Cell 4 9 12">9.7050533789972903e-23</Real>
+    <Real Name="Cell 4 9 2">0.40081205401048664</Real>
+    <Real Name="Cell 4 9 3">0.52074109021476223</Real>
+    <Real Name="Cell 4 9 4">0.066389577257193896</Real>
+    <Real Name="Cell 4 9 5">8.754648748802647e-06</Real>
+    <Real Name="Cell 4 9 6">5.1789895346597485e-11</Real>
+    <Real Name="Cell 4 9 7">6.5122207703702547e-09</Real>
+    <Real Name="Cell 4 9 8">2.770613703961507e-05</Real>
+    <Real Name="Cell 4 9 9">0.00028740011938470101</Real>
+    <Real Name="Cell 5 0 2">2.9992946735227256e-05</Real>
+    <Real Name="Cell 5 0 3">0.00092940373878204225</Real>
+    <Real Name="Cell 5 0 4">0.0018314729402836519</Real>
+    <Real Name="Cell 5 0 5">0.0003835701852660163</Real>
+    <Real Name="Cell 5 0 6">1.2219974344388517e-06</Real>
+    <Real Name="Cell 5 1 2">0.00033046971762233006</Real>
+    <Real Name="Cell 5 1 3">0.010352752555218342</Real>
+    <Real Name="Cell 5 1 4">0.020719372033899675</Real>
+    <Real Name="Cell 5 1 5">0.0044914048273539823</Real>
+    <Real Name="Cell 5 1 6">2.1213171466930127e-05</Real>
+    <Real Name="Cell 5 10 1">0.00051328857140607879</Real>
+    <Real Name="Cell 5 10 2">0.0081256390439943607</Real>
+    <Real Name="Cell 5 10 3">0.010556953295497832</Real>
+    <Real Name="Cell 5 10 4">0.001345911969656533</Real>
+    <Real Name="Cell 5 10 5">1.7748247583358853e-07</Real>
+    <Real Name="Cell 5 2 2">0.00042503049761861712</Real>
+    <Real Name="Cell 5 2 3">0.032703865613726443</Real>
+    <Real Name="Cell 5 2 4">0.1198054196327147</Real>
+    <Real Name="Cell 5 2 5">0.051543614203844831</Real>
+    <Real Name="Cell 5 2 6">0.0013653475482235263</Real>
+    <Real Name="Cell 5 3 0">1.0478137381352539e-05</Real>
+    <Real Name="Cell 5 3 1">1.1925338701493142e-06</Real>
+    <Real Name="Cell 5 3 10">1.0486520487610103e-06</Real>
+    <Real Name="Cell 5 3 11">0.00020834496473269646</Real>
+    <Real Name="Cell 5 3 12">0.00087927827538165188</Real>
+    <Real Name="Cell 5 3 13">0.00039927150222563102</Real>
+    <Real Name="Cell 5 3 2">0.00042914116232236206</Real>
+    <Real Name="Cell 5 3 3">0.095817735328040526</Real>
+    <Real Name="Cell 5 3 4">0.42958675268253299</Real>
+    <Real Name="Cell 5 3 5">0.22331365927731023</Real>
+    <Real Name="Cell 5 3 6">0.016927445309520558</Real>
+    <Real Name="Cell 5 3 7">0.0006011246604854854</Real>
+    <Real Name="Cell 5 3 8">9.6588133525963907e-06</Real>
+    <Real Name="Cell 5 4 0">0.00022736396648894211</Real>
+    <Real Name="Cell 5 4 1">0.0097072929232629133</Real>
+    <Real Name="Cell 5 4 10">1.9966248447142645e-05</Real>
+    <Real Name="Cell 5 4 11">0.0039668709306190765</Real>
+    <Real Name="Cell 5 4 12">0.016741385783003594</Real>
+    <Real Name="Cell 5 4 13">0.007602096444401873</Real>
+    <Real Name="Cell 5 4 2">0.047727228811153079</Real>
+    <Real Name="Cell 5 4 3">0.081126347901379861</Real>
+    <Real Name="Cell 5 4 4">0.37492099196718037</Real>
+    <Real Name="Cell 5 4 5">0.69145938642903793</Real>
+    <Real Name="Cell 5 4 6">0.30866312059123402</Real>
+    <Real Name="Cell 5 4 7">0.015269161322852913</Real>
+    <Real Name="Cell 5 4 8">0.00020756388439212154</Real>
+    <Real Name="Cell 5 5 0">0.00051356638486853984</Real>
+    <Real Name="Cell 5 5 1">0.07663298343844574</Real>
+    <Real Name="Cell 5 5 10">2.9343543415895534e-05</Real>
+    <Real Name="Cell 5 5 11">0.0058299409468949587</Real>
+    <Real Name="Cell 5 5 12">0.024604100357978109</Real>
+    <Real Name="Cell 5 5 13">0.011172476775428245</Real>
+    <Real Name="Cell 5 5 2">0.3751983968642334</Real>
+    <Real Name="Cell 5 5 3">0.20368239449029452</Real>
+    <Real Name="Cell 5 5 4">0.2567859638381379</Real>
+    <Real Name="Cell 5 5 5">1.0614725158761387</Real>
+    <Real Name="Cell 5 5 6">0.56310714350494162</Real>
+    <Real Name="Cell 5 5 7">0.026993608795061689</Real>
+    <Real Name="Cell 5 5 8">0.0003295287312268396</Real>
+    <Real Name="Cell 5 6 0">0.0002140769377791569</Real>
+    <Real Name="Cell 5 6 1">0.059291114666230459</Real>
+    <Real Name="Cell 5 6 10">4.3564569918325488e-06</Real>
+    <Real Name="Cell 5 6 11">0.00086553578891611501</Real>
+    <Real Name="Cell 5 6 12">0.0036528207760416526</Real>
+    <Real Name="Cell 5 6 13">0.0016587095114775768</Real>
+    <Real Name="Cell 5 6 2">0.29031561707846099</Real>
+    <Real Name="Cell 5 6 3">0.15096981418490443</Real>
+    <Real Name="Cell 5 6 4">0.046422024623153361</Real>
+    <Real Name="Cell 5 6 5">0.20320308833555883</Real>
+    <Real Name="Cell 5 6 6">0.10943887270321667</Real>
+    <Real Name="Cell 5 6 7">0.0050200480887681118</Real>
+    <Real Name="Cell 5 6 8">5.3696181792110319e-05</Real>
+    <Real Name="Cell 5 7 0">1.0877150318557831e-05</Real>
+    <Real Name="Cell 5 7 1">0.0069202221642068462</Real>
+    <Real Name="Cell 5 7 10">2.210991775501217e-09</Real>
+    <Real Name="Cell 5 7 11">4.392772645944315e-07</Real>
+    <Real Name="Cell 5 7 12">1.8538818834547332e-06</Real>
+    <Real Name="Cell 5 7 13">8.4182928804259133e-07</Real>
+    <Real Name="Cell 5 7 2">0.068291339707546764</Real>
+    <Real Name="Cell 5 7 3">0.074308954028088195</Real>
+    <Real Name="Cell 5 7 4">0.0086693554299629369</Real>
+    <Real Name="Cell 5 7 5">0.0004824106975018388</Real>
+    <Real Name="Cell 5 7 6">0.00025712296653383537</Real>
+    <Real Name="Cell 5 7 7">1.0100512277499371e-05</Real>
+    <Real Name="Cell 5 7 8">5.0316984878272066e-08</Real>
+    <Real Name="Cell 5 8 1">0.018729232880697003</Real>
+    <Real Name="Cell 5 8 2">0.29649400831692124</Real>
+    <Real Name="Cell 5 8 3">0.38520950552315175</Real>
+    <Real Name="Cell 5 8 4">0.049110578572909701</Real>
+    <Real Name="Cell 5 8 5">6.4761048799977059e-06</Real>
+    <Real Name="Cell 5 9 1">0.011497061169908271</Real>
+    <Real Name="Cell 5 9 2">0.18200477146312666</Real>
+    <Real Name="Cell 5 9 3">0.23646335525008316</Real>
+    <Real Name="Cell 5 9 4">0.030146847419696182</Real>
+    <Real Name="Cell 5 9 5">3.9753990151306307e-06</Real>
+    <Real Name="Cell 6 1 2">9.9111874813813196e-09</Real>
+    <Real Name="Cell 6 1 3">2.341716672622359e-06</Real>
+    <Real Name="Cell 6 1 4">1.0379600902308469e-05</Real>
+    <Real Name="Cell 6 1 5">4.9280863802325025e-06</Real>
+    <Real Name="Cell 6 1 6">1.4072961741042381e-07</Real>
+    <Real Name="Cell 6 10 1">1.3465894431817205e-05</Real>
+    <Real Name="Cell 6 10 2">0.00021317247967891209</Real>
+    <Real Name="Cell 6 10 3">0.00027695691374809945</Real>
+    <Real Name="Cell 6 10 4">3.5309394183989422e-05</Real>
+    <Real Name="Cell 6 10 5">4.6561727967675297e-09</Real>
+    <Real Name="Cell 6 2 2">1.7217811865984706e-06</Real>
+    <Real Name="Cell 6 2 3">0.0004068377638012711</Real>
+    <Real Name="Cell 6 2 4">0.0018033520229420754</Real>
+    <Real Name="Cell 6 2 5">0.00085623240294104171</Real>
+    <Real Name="Cell 6 2 6">2.4452816325099927e-05</Real>
+    <Real Name="Cell 6 3 0">2.0323635686115184e-10</Real>
+    <Real Name="Cell 6 3 1">7.0645470620626314e-08</Real>
+    <Real Name="Cell 6 3 2">7.3538547650126887e-06</Real>
+    <Real Name="Cell 6 3 3">0.0016644367202467631</Real>
+    <Real Name="Cell 6 3 4">0.0080125679505275854</Real>
+    <Real Name="Cell 6 3 5">0.0066819870402248334</Real>
+    <Real Name="Cell 6 3 6">0.0017866716080254419</Real>
+    <Real Name="Cell 6 3 7">6.1094898083865543e-05</Real>
+    <Real Name="Cell 6 3 8">1.0011219042551309e-07</Real>
+    <Real Name="Cell 6 4 0">1.6543554007912385e-06</Real>
+    <Real Name="Cell 6 4 1">0.00057505811296606568</Real>
+    <Real Name="Cell 6 4 2">0.0028185353415214804</Real>
+    <Real Name="Cell 6 4 3">0.002285292053276467</Real>
+    <Real Name="Cell 6 4 4">0.021122824558270289</Real>
+    <Real Name="Cell 6 4 5">0.089917622258439356</Real>
+    <Real Name="Cell 6 4 6">0.046925173936249204</Real>
+    <Real Name="Cell 6 4 7">0.0016843951040598887</Real>
+    <Real Name="Cell 6 4 8">2.151369361965925e-06</Real>
+    <Real Name="Cell 6 5 0">1.3060097293069452e-05</Real>
+    <Real Name="Cell 6 5 1">0.00453972278321438</Real>
+    <Real Name="Cell 6 5 2">0.022225643441520882</Real>
+    <Real Name="Cell 6 5 3">0.011659178781222565</Real>
+    <Real Name="Cell 6 5 4">0.033179542517396708</Real>
+    <Real Name="Cell 6 5 5">0.16367654423662631</Real>
+    <Real Name="Cell 6 5 6">0.086880911286593199</Real>
+    <Real Name="Cell 6 5 7">0.003109000125058479</Real>
+    <Real Name="Cell 6 5 8">3.4155171952247187e-06</Real>
+    <Real Name="Cell 6 6 0">1.0104026364285639e-05</Real>
+    <Real Name="Cell 6 6 1">0.0035122775525201397</Real>
+    <Real Name="Cell 6 6 2">0.017196374370792692</Real>
+    <Real Name="Cell 6 6 3">0.0089399750953563402</Real>
+    <Real Name="Cell 6 6 4">0.0066678841890918366</Real>
+    <Real Name="Cell 6 6 5">0.031957789114167946</Real>
+    <Real Name="Cell 6 6 6">0.016969506353613825</Real>
+    <Real Name="Cell 6 6 7">0.00060479950181667604</Real>
+    <Real Name="Cell 6 6 8">5.5655308581459313e-07</Real>
+    <Real Name="Cell 6 7 0">6.4305192211866531e-07</Real>
+    <Real Name="Cell 6 7 1">0.00030608591805945587</Real>
+    <Real Name="Cell 6 7 2">0.0024012991500714019</Real>
+    <Real Name="Cell 6 7 3">0.0022658165305128935</Real>
+    <Real Name="Cell 6 7 4">0.00025067967617652283</Real>
+    <Real Name="Cell 6 7 5">7.6024187062631148e-05</Real>
+    <Real Name="Cell 6 7 6">4.0326760005420027e-05</Real>
+    <Real Name="Cell 6 7 7">1.419355404539194e-06</Real>
+    <Real Name="Cell 6 7 8">5.215282030910293e-10</Real>
+    <Real Name="Cell 6 8 1">0.00049135298701372696</Real>
+    <Real Name="Cell 6 8 2">0.0077783867361881235</Real>
+    <Real Name="Cell 6 8 3">0.010105797838626564</Real>
+    <Real Name="Cell 6 8 4">0.0012883939043035436</Real>
+    <Real Name="Cell 6 8 5">1.6989769400969864e-07</Real>
+    <Real Name="Cell 6 9 1">0.00030162022031004468</Real>
+    <Real Name="Cell 6 9 2">0.0047748131852920787</Real>
+    <Real Name="Cell 6 9 3">0.0062035095970835365</Real>
+    <Real Name="Cell 6 9 4">0.00079088896075296873</Real>
+    <Real Name="Cell 6 9 5">1.042928022251796e-07</Real>
+    <Real Name="Cell 7 3 3">1.2658790457362825e-09</Real>
+    <Real Name="Cell 7 3 4">4.8930122638409664e-07</Real>
+    <Real Name="Cell 7 3 5">2.4564999208928818e-06</Real>
+    <Real Name="Cell 7 3 6">1.3029175315370689e-06</Real>
+    <Real Name="Cell 7 3 7">4.5481201021914433e-08</Real>
+    <Real Name="Cell 7 4 3">3.5212298537689984e-08</Real>
+    <Real Name="Cell 7 4 4">1.3610637537864738e-05</Real>
+    <Real Name="Cell 7 4 5">6.8331179715500328e-05</Real>
+    <Real Name="Cell 7 4 6">3.6242578819043961e-05</Real>
+    <Real Name="Cell 7 4 7">1.2651268963101061e-06</Real>
+    <Real Name="Cell 7 5 3">6.527819550970732e-08</Real>
+    <Real Name="Cell 7 5 4">2.5232032417807118e-05</Real>
+    <Real Name="Cell 7 5 5">0.00012667551662675413</Real>
+    <Real Name="Cell 7 5 6">6.718817697723447e-05</Real>
+    <Real Name="Cell 7 5 7">2.3453510367556405e-06</Real>
+    <Real Name="Cell 7 6 3">1.2753946523246451e-08</Real>
+    <Real Name="Cell 7 6 4">4.9297930130693912e-06</Real>
+    <Real Name="Cell 7 6 5">2.4749654187698651e-05</Real>
+    <Real Name="Cell 7 6 6">1.3127115562418353e-05</Real>
+    <Real Name="Cell 7 6 7">4.5823082987295304e-07</Real>
+    <Real Name="Cell 7 7 3">3.0333132690454403e-11</Real>
+    <Real Name="Cell 7 7 4">1.1724689713050891e-08</Real>
+    <Real Name="Cell 7 7 5">5.8862920833952816e-08</Real>
+    <Real Name="Cell 7 7 6">3.1220652954126433e-08</Real>
+    <Real Name="Cell 7 7 7">1.089825532830857e-09</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_5.xml b/src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_5.xml
new file mode 100644 (file)
index 0000000..a50715b
--- /dev/null
@@ -0,0 +1,1338 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">65</Int>
+      <Real>9.1119845071837208e-05</Real>
+      <Real>0.090720315044499733</Real>
+      <Real>0.55025766250121055</Real>
+      <Real>0.34320921934036525</Real>
+      <Real>0.015721683268852503</Real>
+      <Real>0.00015012522034442169</Real>
+      <Real>0.099356795254623917</Real>
+      <Real>0.5593747949437492</Real>
+      <Real>0.32757960274142961</Real>
+      <Real>0.013538681839852794</Real>
+      <Real>0.018158594767252602</Real>
+      <Real>0.35888417561848956</Real>
+      <Real>0.54030736287434888</Real>
+      <Real>0.082598368326822907</Real>
+      <Real>5.14984130859375e-05</Real>
+      <Real>0.041627420943636896</Real>
+      <Real>0.4582155406899513</Real>
+      <Real>0.45845109823303443</Real>
+      <Real>0.041705940133377188</Real>
+      <Real>1.2828530710933453e-16</Real>
+      <Real>0.0055362754759460259</Real>
+      <Real>0.24795438899936029</Real>
+      <Real>0.59225974451466756</Real>
+      <Real>0.15322236664250746</Real>
+      <Real>0.0010272243675186511</Real>
+      <Real>0.0042460280899123074</Real>
+      <Real>0.22871588718952912</Real>
+      <Real>0.59632216273624739</Real>
+      <Real>0.16922400252321107</Real>
+      <Real>0.001491919461100034</Real>
+      <Real>6.6666591167482021e-05</Real>
+      <Real>0.08606665073633292</Real>
+      <Real>0.54473331362803623</Real>
+      <Real>0.3520666975458463</Real>
+      <Real>0.017066671498617049</Real>
+      <Real>0.023326680338390325</Real>
+      <Real>0.3874518449014549</Real>
+      <Real>0.52012998426866952</Real>
+      <Real>0.069077650831027043</Real>
+      <Real>1.3839660458076671e-05</Real>
+      <Real>0.03167460418448273</Real>
+      <Real>0.42425323879349275</Real>
+      <Real>0.4902205011964671</Real>
+      <Real>0.053850853163774005</Real>
+      <Real>8.0266178337075683e-07</Real>
+      <Real>0.012749605276410803</Real>
+      <Real>0.32148691284470338</Real>
+      <Real>0.56270704376016845</Real>
+      <Real>0.10287678115211603</Real>
+      <Real>0.00017965696660134908</Real>
+      <Real>1.6024703728835248e-06</Real>
+      <Real>0.056417033443933631</Real>
+      <Real>0.49592335056242809</Real>
+      <Real>0.41764574336232119</Real>
+      <Real>0.030012270160944085</Real>
+      <Real>0.0037782170994077558</Real>
+      <Real>0.22083430910594309</Real>
+      <Real>0.59747439343876341</Real>
+      <Real>0.17618542306945406</Real>
+      <Real>0.00172765728643163</Real>
+      <Real>0.035389450019532316</Real>
+      <Real>0.43796494184012003</Real>
+      <Real>0.47790194087639981</Real>
+      <Real>0.0487435605980059</Real>
+      <Real>1.0666594187603302e-07</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">65</Int>
+      <Real>0.0010666671528536498</Real>
+      <Real>0.15473335174766273</Real>
+      <Real>0.59273333898525471</Real>
+      <Real>0.24606664375510937</Real>
+      <Real>0.0053999983591193996</Real>
+      <Real>0.00016276069058524602</Real>
+      <Real>0.10091149120354556</Real>
+      <Real>0.56087242706002582</Real>
+      <Real>0.32486973469163882</Real>
+      <Real>0.013183586354204581</Real>
+      <Real>0.021750286255291018</Real>
+      <Real>0.37931159553620664</Real>
+      <Real>0.52614729621290934</Real>
+      <Real>0.072769728387591756</Real>
+      <Real>2.1093608001061349e-05</Real>
+      <Real>0.0010666699577817054</Real>
+      <Real>0.1547334579841988</Real>
+      <Real>0.59273337159244333</Real>
+      <Real>0.24606651157306803</Real>
+      <Real>0.0053999888925081634</Real>
+      <Real>0.0026041673971157779</Real>
+      <Real>0.19791668273654572</Real>
+      <Real>0.59895833333333259</Real>
+      <Real>0.1979166505967882</Real>
+      <Real>0.0026041659362177087</Real>
+      <Real>2.6041418314877162e-07</Real>
+      <Real>0.05064476867914669</Real>
+      <Real>0.48264733964105189</Real>
+      <Real>0.43276985381443817</Real>
+      <Real>0.033937777451180033</Real>
+      <Real>0.00062526109313582761</Real>
+      <Real>0.13526982710338351</Real>
+      <Real>0.58502241326374205</Real>
+      <Real>0.27164474245602177</Real>
+      <Real>0.0074377560837167568</Real>
+      <Real>0.0010666654698994566</Real>
+      <Real>0.15473328800575983</Real>
+      <Real>0.59273331942090102</Real>
+      <Real>0.24606672306434757</Real>
+      <Real>0.0054000040390921661</Real>
+      <Real>0.041666666666666664</Real>
+      <Real>0.45833333333333331</Real>
+      <Real>0.45833333333333331</Real>
+      <Real>0.041666666666666664</Real>
+      <Real>0</Real>
+      <Real>0.0026042090329703206</Real>
+      <Real>0.1979175987206947</Real>
+      <Real>0.59895833333074866</Real>
+      <Real>0.1979157346147063</Real>
+      <Real>0.0026041243008799383</Real>
+      <Real>0.0017085936967502549</Real>
+      <Real>0.17564479015142287</Real>
+      <Real>0.59739739561463689</Real>
+      <Real>0.22143646002330059</Real>
+      <Real>0.0038127605138894532</Real>
+      <Real>0.01318359128473468</Real>
+      <Real>0.32486977267499179</Real>
+      <Real>0.56087240624223145</Real>
+      <Real>0.10091146929006924</Real>
+      <Real>0.0001627605079728152</Real>
+      <Real>0.010004167969495891</Real>
+      <Real>0.29798334548041105</Real>
+      <Real>0.57435832781814944</Real>
+      <Real>0.11731665883449849</Real>
+      <Real>0.00033749989744494643</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">65</Int>
+      <Real>0.0012965438860746193</Real>
+      <Real>0.16292863742177591</Real>
+      <Real>0.59496860464339196</Real>
+      <Real>0.23609101761611412</Real>
+      <Real>0.0047151964326433184</Real>
+      <Real>0.022266572805360645</Real>
+      <Real>0.38202776345099154</Real>
+      <Real>0.52416325209613102</Real>
+      <Real>0.071523992911451742</Real>
+      <Real>1.8418736065012962e-05</Real>
+      <Real>0.011832605517855912</Real>
+      <Real>0.31406414072290789</Real>
+      <Real>0.56659541417064396</Real>
+      <Real>0.10728640609669558</Real>
+      <Real>0.00022143349189650375</Real>
+      <Real>0.0017858013352502983</Real>
+      <Real>0.17781228386651252</Real>
+      <Real>0.59769371581562036</Real>
+      <Real>0.21903219671569593</Real>
+      <Real>0.0036760022669208082</Real>
+      <Real>0.0017086017161747019</Real>
+      <Real>0.17564501834717935</Real>
+      <Real>0.59739742855015188</Real>
+      <Real>0.22143620551433324</Real>
+      <Real>0.0038127458721607366</Real>
+      <Real>0.0040977069545237296</Real>
+      <Real>0.22627851145019215</Real>
+      <Real>0.59671157259785013</Real>
+      <Real>0.17135050247039479</Real>
+      <Real>0.0015617065270392145</Real>
+      <Real>2.1750421477804795e-06</Real>
+      <Real>0.057733270813550459</Real>
+      <Real>0.49873314137135216</Real>
+      <Real>0.41432536200431536</Real>
+      <Real>0.029206050768634195</Real>
+      <Real>8.6400056648268334e-06</Real>
+      <Real>0.065520111244055546</Real>
+      <Real>0.51392118159705458</Real>
+      <Real>0.39556276272059754</Real>
+      <Real>0.024987304432627432</Real>
+      <Real>4.880619993386894e-05</Real>
+      <Real>0.08191627610789852</Real>
+      <Real>0.53940408234591719</Real>
+      <Real>0.36024771006311429</Real>
+      <Real>0.018383125283136074</Real>
+      <Real>0.0069905040885420225</Real>
+      <Real>0.26646194284335506</Real>
+      <Real>0.5868043834979163</Real>
+      <Real>0.13904332911133552</Real>
+      <Real>0.00069984045885097335</Real>
+      <Real>0.00019040655142945676</Real>
+      <Real>0.10406769412736623</Real>
+      <Real>0.56378776207543602</Real>
+      <Real>0.31945972792224575</Real>
+      <Real>0.012494409323522462</Real>
+      <Real>0.019774301666309266</Real>
+      <Real>0.36842563881228446</Real>
+      <Real>0.53386063089545432</Real>
+      <Real>0.077904628220022559</Real>
+      <Real>3.4800405929288513e-05</Real>
+      <Real>0.028572903710531138</Real>
+      <Real>0.41166191232062643</Real>
+      <Real>0.50096022420001085</Real>
+      <Real>0.058802226022017991</Real>
+      <Real>2.7337468135370829e-06</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">65</Int>
+      <Real>-0.0016854540244076904</Real>
+      <Real>-0.2914318595125569</Real>
+      <Real>-0.33184166617245625</Real>
+      <Real>0.54472072698021401</Real>
+      <Real>0.08023825272920683</Real>
+      <Real>-0.0024510232125503567</Real>
+      <Real>-0.30937513287573065</Real>
+      <Real>-0.30216854137168336</Real>
+      <Real>0.54226657422076019</Real>
+      <Real>0.071728123239204175</Real>
+      <Real>-0.089396158854166657</Real>
+      <Real>-0.54541015625</Real>
+      <Real>0.360107421875</Real>
+      <Real>0.27360026041666663</Real>
+      <Real>0.0010986328125</Real>
+      <Real>-0.16654891563009322</Real>
+      <Real>-0.50011769555574637</Real>
+      <Real>0.49988213800395087</Real>
+      <Real>0.16678447317971032</Real>
+      <Real>2.1784112419024706e-12</Real>
+      <Real>-0.036679250243501299</Real>
+      <Real>-0.50408183444089893</Real>
+      <Real>0.12857088020999707</Real>
+      <Real>0.40182074387670785</Real>
+      <Real>0.010369460597695286</Real>
+      <Real>-0.030060370435004882</Real>
+      <Real>-0.48853779347565118</Real>
+      <Real>0.080975501113040305</Real>
+      <Real>0.42390385994089252</Real>
+      <Real>0.013718802856723243</Real>
+      <Real>-0.0013333322008454032</Real>
+      <Real>-0.28133329822619785</Real>
+      <Real>-0.34800005549192142</Real>
+      <Real>0.54533333446581811</Real>
+      <Real>0.085333351453146619</Real>
+      <Real>-0.10786905756209218</Real>
+      <Real>-0.54180276637519476</Real>
+      <Real>0.40762276907184514</Real>
+      <Real>0.24163899123026289</Real>
+      <Real>0.00041006363517895783</Real>
+      <Real>-0.13568773041454193</Real>
+      <Real>-0.52673526002144855</Real>
+      <Real>0.46058217387648004</Real>
+      <Real>0.20179235396955353</Real>
+      <Real>4.8462589956979473e-05</Real>
+      <Real>-0.068569303078043639</Real>
+      <Real>-0.54084652081779905</Real>
+      <Real>0.29020535260945268</Real>
+      <Real>0.31640606954666634</Real>
+      <Real>0.0028044017397236948</Real>
+      <Real>-8.1395367348647448e-05</Real>
+      <Real>-0.20881684023017011</Real>
+      <Real>-0.45181106180586772</Real>
+      <Real>0.53039822577164042</Real>
+      <Real>0.13031107163174604</Real>
+      <Real>-0.027540534381201576</Real>
+      <Real>-0.48144281633034564</Real>
+      <Real>0.060821649615805162</Real>
+      <Real>0.43284728728423294</Real>
+      <Real>0.015314413811509116</Real>
+      <Real>-0.14745603131103738</Real>
+      <Real>-0.51764264062849019</Real>
+      <Real>0.47766404180239985</Real>
+      <Real>0.18742396352482035</Real>
+      <Real>1.0666612307322972e-05</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">65</Int>
+      <Real>-0.010666670313068831</Real>
+      <Real>-0.40400002643641197</Real>
+      <Real>-0.12399994439237266</Real>
+      <Real>0.50266664934625682</Real>
+      <Real>0.035999991795596688</Real>
+      <Real>-0.0026041699536889272</Real>
+      <Real>-0.3125000657404175</Real>
+      <Real>-0.29687488824128189</Real>
+      <Real>0.54166665351857213</Real>
+      <Real>0.07031247041681625</Real>
+      <Real>-0.10235425786179789</Real>
+      <Real>-0.54349997601781996</Real>
+      <Real>0.3946252227810525</Real>
+      <Real>0.2506665139385465</Real>
+      <Real>0.00056249716001883718</Real>
+      <Real>-0.010666691350019937</Real>
+      <Real>-0.40400017895414458</Real>
+      <Real>-0.12399962357912447</Real>
+      <Real>0.5026665494207625</Real>
+      <Real>0.035999944462526537</Real>
+      <Real>-0.020833337716027845</Real>
+      <Real>-0.45833335086410953</Real>
+      <Real>4.3826942075497755e-08</Real>
+      <Real>0.45833331580255587</Real>
+      <Real>0.02083332895063943</Real>
+      <Real>-2.0833184322081997e-05</Real>
+      <Real>-0.19283326836427853</Real>
+      <Real>-0.47137507659194655</Real>
+      <Real>0.52133329101401715</Real>
+      <Real>0.14289588712653006</Real>
+      <Real>-0.0071458391316396429</Real>
+      <Real>-0.37433339060638243</Real>
+      <Real>-0.18412488805721461</Real>
+      <Real>0.51983330446013509</Real>
+      <Real>0.045770813335101523</Real>
+      <Real>-0.010666657690911333</Real>
+      <Real>-0.40399993492575176</Real>
+      <Real>-0.12400013688030348</Real>
+      <Real>0.5026667093015077</Real>
+      <Real>0.036000020195458941</Real>
+      <Real>-0.16666666666666666</Real>
+      <Real>-0.5</Real>
+      <Real>0.5</Real>
+      <Real>0.16666666666666666</Real>
+      <Real>0</Real>
+      <Real>-0.020833587530638329</Real>
+      <Real>-0.45833435011635015</Real>
+      <Real>2.5419627114331433e-06</Real>
+      <Real>0.45833231654618101</Real>
+      <Real>0.020833079138096039</Real>
+      <Real>-0.015187499645001698</Real>
+      <Real>-0.43216666475581156</Real>
+      <Real>-0.062375004356399033</Real>
+      <Real>0.48200000156023953</Real>
+      <Real>0.027729167196972774</Real>
+      <Real>-0.070312490138938491</Real>
+      <Real>-0.5416666622839712</Real>
+      <Real>0.29687496274709829</Real>
+      <Real>0.31250002191347104</Real>
+      <Real>0.0026041677623403724</Real>
+      <Real>-0.057166672250220395</Real>
+      <Real>-0.53300000501380262</Real>
+      <Real>0.24200002575271606</Real>
+      <Real>0.34366665253685758</Real>
+      <Real>0.0044999989744494255</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">65</Int>
+      <Real>-0.012348027757665452</Real>
+      <Real>-0.41547484517157679</Real>
+      <Real>-0.099487612651801172</Real>
+      <Real>0.49479187184899465</Real>
+      <Real>0.032518613732048778</Real>
+      <Real>-0.10417109125784305</Real>
+      <Real>-0.54299490824416519</Real>
+      <Real>0.3990111936014229</Real>
+      <Real>0.24764670256102214</Real>
+      <Real>0.00050810333956326215</Real>
+      <Real>-0.064836187630456954</Real>
+      <Real>-0.53877201291894317</Real>
+      <Real>0.27533308586144023</Real>
+      <Real>0.32499461755577691</Real>
+      <Real>0.0032804971321829571</Real>
+      <Real>-0.015699363256675682</Real>
+      <Real>-0.43488141308955258</Real>
+      <Real>-0.05615926647876357</Real>
+      <Real>0.47976022525288775</Real>
+      <Real>0.026979817572104103</Real>
+      <Real>-0.015187553107800395</Real>
+      <Real>-0.43216695253043291</Real>
+      <Real>-0.062374348282772774</Real>
+      <Real>0.48199976658804594</Real>
+      <Real>0.027729087332960128</Real>
+      <Real>-0.02926933487542473</Real>
+      <Real>-0.48638933758982017</Real>
+      <Real>0.07478401218724251</Real>
+      <Real>0.4266773278966744</Real>
+      <Real>0.014197332381327967</Real>
+      <Real>-0.00010235473511721623</Real>
+      <Real>-0.21236983977962356</Real>
+      <Real>-0.44727650960668819</Real>
+      <Real>0.53207195749271596</Real>
+      <Real>0.12767674662871301</Real>
+      <Real>-0.00028800014162065922</Real>
+      <Real>-0.23271467829529452</Real>
+      <Real>-0.4201279839339252</Real>
+      <Real>0.53955200332021669</Real>
+      <Real>0.11357865905062374</Real>
+      <Real>-0.001055269599152589</Real>
+      <Real>-0.27205803886674906</Real>
+      <Real>-0.362494193683217</Real>
+      <Real>0.54538358236329165</Real>
+      <Real>0.090223919785827028</Real>
+      <Real>-0.043690654581706838</Real>
+      <Real>-0.5167039810700389</Real>
+      <Real>0.1722559297089562</Real>
+      <Real>0.38036270211903173</Real>
+      <Real>0.0077760038237577982</Real>
+      <Real>-0.0029293320036731184</Real>
+      <Real>-0.31874930875428514</Real>
+      <Real>-0.28617604237604022</Real>
+      <Real>0.54031733902962842</Real>
+      <Real>0.067537344104370053</Real>
+      <Real>-0.095297837850113781</Real>
+      <Real>-0.54492533270653065</Real>
+      <Real>0.37656301210725296</Real>
+      <Real>0.26284132530554133</Real>
+      <Real>0.00081883314385018213</Real>
+      <Real>-0.12559517752556038</Real>
+      <Real>-0.53333599354314709</Real>
+      <Real>0.44357901955675993</Real>
+      <Real>0.21523065161816302</Real>
+      <Real>0.00012149989378455396</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">8</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">2</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">1</Int>
+      <Int Name="Y">8</Int>
+      <Int Name="Z">6</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">7</Int>
+      <Int Name="Z">6</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">16</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">2</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">9</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">0</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">8</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">3</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">7</Int>
+      <Int Name="Z">5</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">2</Int>
+      <Int Name="Z">2</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 10 10">0.00015550983169098254</Real>
+    <Real Name="Cell 0 10 5">4.3426126663572067e-05</Real>
+    <Real Name="Cell 0 10 6">0.00088464215043542534</Real>
+    <Real Name="Cell 0 10 7">0.0086945875355958491</Real>
+    <Real Name="Cell 0 10 8">0.025455958139809647</Real>
+    <Real Name="Cell 0 10 9">0.0092660282857752862</Real>
+    <Real Name="Cell 0 11 10">3.4127007305411425e-06</Real>
+    <Real Name="Cell 0 11 5">7.0042171467523923e-08</Real>
+    <Real Name="Cell 0 11 6">2.9628828187509245e-06</Real>
+    <Real Name="Cell 0 11 7">0.00016696707557498287</Real>
+    <Real Name="Cell 0 11 8">0.00055515856763483772</Real>
+    <Real Name="Cell 0 11 9">0.00020334366972394322</Real>
+    <Real Name="Cell 0 4 0">2.4782500924767428e-08</Real>
+    <Real Name="Cell 0 4 1">4.9495470489457263e-10</Real>
+    <Real Name="Cell 0 4 10">6.2453921981723285e-08</Real>
+    <Real Name="Cell 0 4 8">1.3609835892991086e-10</Real>
+    <Real Name="Cell 0 4 9">1.7102637568963844e-08</Real>
+    <Real Name="Cell 0 5 0">3.5955159511056679e-06</Real>
+    <Real Name="Cell 0 5 1">9.9720147587043648e-08</Real>
+    <Real Name="Cell 0 5 10">9.0597190062202705e-06</Real>
+    <Real Name="Cell 0 5 2">7.3629030380415593e-08</Real>
+    <Real Name="Cell 0 5 3">2.1143165193135773e-08</Real>
+    <Real Name="Cell 0 5 4">1.9270103447810681e-10</Real>
+    <Real Name="Cell 0 5 8">1.9742761543038636e-08</Real>
+    <Real Name="Cell 0 5 9">2.480950526780083e-06</Real>
+    <Real Name="Cell 0 6 0">0.00011210345636214471</Real>
+    <Real Name="Cell 0 6 1">0.0054302508112420425</Real>
+    <Real Name="Cell 0 6 10">3.4704848283661825e-05</Real>
+    <Real Name="Cell 0 6 2">0.014319209371003115</Real>
+    <Real Name="Cell 0 6 3">0.0041118755415084935</Real>
+    <Real Name="Cell 0 6 4">3.7476066769376444e-05</Real>
+    <Real Name="Cell 0 6 8">7.5628123077685048e-08</Real>
+    <Real Name="Cell 0 6 9">9.5037176729276018e-06</Real>
+    <Real Name="Cell 0 7 0">0.00094282750206276238</Real>
+    <Real Name="Cell 0 7 1">0.051748072135720614</Real>
+    <Real Name="Cell 0 7 10">1.5081448409904753e-05</Real>
+    <Real Name="Cell 0 7 2">0.13646282703871002</Real>
+    <Real Name="Cell 0 7 3">0.03918639264831611</Real>
+    <Real Name="Cell 0 7 4">0.00035714890991096</Real>
+    <Real Name="Cell 0 7 5">5.6734116452706757e-06</Real>
+    <Real Name="Cell 0 7 6">0.0001060318666387177</Real>
+    <Real Name="Cell 0 7 7">0.00018577684805835015</Real>
+    <Real Name="Cell 0 7 8">0.00013198988979525449</Real>
+    <Real Name="Cell 0 7 9">4.4122180077160772e-05</Real>
+    <Real Name="Cell 0 8 0">0.00084039357703873129</Real>
+    <Real Name="Cell 0 8 1">0.046400250389460058</Real>
+    <Real Name="Cell 0 8 10">9.8105074830821197e-05</Real>
+    <Real Name="Cell 0 8 2">0.1223605578196465</Real>
+    <Real Name="Cell 0 8 3">0.035136813207215088</Real>
+    <Real Name="Cell 0 8 4">0.00032024061636204578</Real>
+    <Real Name="Cell 0 8 5">0.00013980408764832462</Real>
+    <Real Name="Cell 0 8 6">0.0026522709054171735</Real>
+    <Real Name="Cell 0 8 7">0.0085045456266330741</Real>
+    <Real Name="Cell 0 8 8">0.016450615831675057</Real>
+    <Real Name="Cell 0 8 9">0.0058270205505329981</Real>
+    <Real Name="Cell 0 9 0">6.5893758678858019e-05</Real>
+    <Real Name="Cell 0 9 1">0.0036387037416742698</Real>
+    <Real Name="Cell 0 9 10">0.0003745973650160777</Real>
+    <Real Name="Cell 0 9 2">0.0095955051940054253</Real>
+    <Real Name="Cell 0 9 3">0.0027554260918586323</Real>
+    <Real Name="Cell 0 9 4">2.511324361697313e-05</Real>
+    <Real Name="Cell 0 9 5">0.00024136519195419676</Real>
+    <Real Name="Cell 0 9 6">0.0046789839158270074</Real>
+    <Real Name="Cell 0 9 7">0.024635992322006244</Real>
+    <Real Name="Cell 0 9 8">0.061857964260082388</Real>
+    <Real Name="Cell 0 9 9">0.022320564367285724</Real>
+    <Real Name="Cell 1 10 10">0.0017141079969648463</Real>
+    <Real Name="Cell 1 10 5">0.0025382285947518376</Real>
+    <Real Name="Cell 1 10 6">0.048247038404428705</Real>
+    <Real Name="Cell 1 10 7">0.15462771578528062</Real>
+    <Real Name="Cell 1 10 8">0.29427874360022516</Real>
+    <Real Name="Cell 1 10 9">0.10312733858731694</Real>
+    <Real Name="Cell 1 11 10">3.7887304515044594e-05</Real>
+    <Real Name="Cell 1 11 5">4.0939189404270194e-06</Real>
+    <Real Name="Cell 1 11 6">0.00011172440368499215</Real>
+    <Real Name="Cell 1 11 7">0.0023841117211727608</Real>
+    <Real Name="Cell 1 11 8">0.006947588599328495</Real>
+    <Real Name="Cell 1 11 9">0.0023942642345253242</Real>
+    <Real Name="Cell 1 12 10">9.329730763337878e-11</Real>
+    <Real Name="Cell 1 12 6">4.9854709314695529e-09</Real>
+    <Real Name="Cell 1 12 7">1.3232568615832114e-07</Real>
+    <Real Name="Cell 1 12 8">2.3872552524370354e-07</Real>
+    <Real Name="Cell 1 12 9">4.5203337348631021e-08</Real>
+    <Real Name="Cell 1 4 0">2.4673837951688867e-05</Real>
+    <Real Name="Cell 1 4 1">4.9278449415045374e-07</Real>
+    <Real Name="Cell 1 4 10">6.2180082434070194e-05</Real>
+    <Real Name="Cell 1 4 8">1.3550161317138827e-07</Real>
+    <Real Name="Cell 1 4 9">1.7027648226630303e-05</Real>
+    <Real Name="Cell 1 5 0">0.0035792474168576823</Real>
+    <Real Name="Cell 1 5 1">7.1484772763707945e-05</Real>
+    <Real Name="Cell 1 5 10">0.0090199951702175703</Real>
+    <Real Name="Cell 1 5 2">6.4913122068130159e-10</Real>
+    <Real Name="Cell 1 5 3">1.8640322383679289e-10</Real>
+    <Real Name="Cell 1 5 4">1.6988986150032878e-12</Real>
+    <Real Name="Cell 1 5 8">1.9656196140597609e-05</Real>
+    <Real Name="Cell 1 5 9">0.0024700723889715089</Real>
+    <Real Name="Cell 1 6 0">0.013711804127807739</Real>
+    <Real Name="Cell 1 6 1">0.00032170603230259896</Real>
+    <Real Name="Cell 1 6 10">0.034552679137933105</Real>
+    <Real Name="Cell 1 6 2">0.00012624158990232677</Real>
+    <Real Name="Cell 1 6 3">3.6251282622607455e-05</Real>
+    <Real Name="Cell 1 6 4">3.3039800799563351e-07</Real>
+    <Real Name="Cell 1 6 8">7.5296519066979278e-05</Real>
+    <Real Name="Cell 1 6 9">0.0094620470513557698</Real>
+    <Real Name="Cell 1 7 0">0.0057002046593389059</Real>
+    <Real Name="Cell 1 7 1">0.0005699015900104392</Real>
+    <Real Name="Cell 1 7 10">0.01435158026542112</Real>
+    <Real Name="Cell 1 7 2">0.0012030890673907467</Real>
+    <Real Name="Cell 1 7 3">0.00034547665183791649</Real>
+    <Real Name="Cell 1 7 4">3.1487105922443774e-06</Real>
+    <Real Name="Cell 1 7 5">0.00033160718613902687</Real>
+    <Real Name="Cell 1 7 6">0.0061819564689130644</Real>
+    <Real Name="Cell 1 7 7">0.0093115623782872824</Real>
+    <Real Name="Cell 1 7 8">0.0025441918147471143</Real>
+    <Real Name="Cell 1 7 9">0.0043707850923373091</Real>
+    <Real Name="Cell 1 8 0">0.00013231921531607838</Real>
+    <Real Name="Cell 1 8 1">0.0004115704522771027</Real>
+    <Real Name="Cell 1 8 10">0.001391297974239166</Real>
+    <Real Name="Cell 1 8 2">0.0010787600739862384</Real>
+    <Real Name="Cell 1 8 3">0.00030977458660269358</Real>
+    <Real Name="Cell 1 8 4">2.8233182093637914e-06</Real>
+    <Real Name="Cell 1 8 5">0.0081714571433293172</Real>
+    <Real Name="Cell 1 8 6">0.15277487153700511</Real>
+    <Real Name="Cell 1 8 7">0.27281437736389635</Real>
+    <Real Name="Cell 1 8 8">0.20745788862970044</Real>
+    <Real Name="Cell 1 8 9">0.064284699775528434</Real>
+    <Real Name="Cell 1 9 0">5.8093520701670787e-07</Real>
+    <Real Name="Cell 1 9 1">3.20796863591307e-05</Real>
+    <Real Name="Cell 1 9 10">0.0041250735354785009</Real>
+    <Real Name="Cell 1 9 2">8.4596279041795978e-05</Real>
+    <Real Name="Cell 1 9 3">2.4292498397222629e-05</Real>
+    <Real Name="Cell 1 9 4">2.2140438900426894e-07</Real>
+    <Real Name="Cell 1 9 5">0.014107637016354499</Real>
+    <Real Name="Cell 1 9 6">0.26493976039377909</Real>
+    <Real Name="Cell 1 9 7">0.58270645262046239</Real>
+    <Real Name="Cell 1 9 8">0.7303095158019538</Real>
+    <Real Name="Cell 1 9 9">0.24652753833462215</Real>
+    <Real Name="Cell 16 5 0">1.2686634193219325e-11</Real>
+    <Real Name="Cell 16 5 1">7.0056564132425547e-10</Real>
+    <Real Name="Cell 16 5 2">1.847438463614937e-09</Real>
+    <Real Name="Cell 16 5 3">5.3050673652159387e-10</Real>
+    <Real Name="Cell 16 5 4">4.8350942723800296e-12</Real>
+    <Real Name="Cell 16 6 0">2.4672682811038984e-06</Real>
+    <Real Name="Cell 16 6 1">0.00013624444114534139</Real>
+    <Real Name="Cell 16 6 2">0.00035928570597587275</Real>
+    <Real Name="Cell 16 6 3">0.00010317176518191451</Real>
+    <Real Name="Cell 16 6 4">9.4031833445362313e-07</Real>
+    <Real Name="Cell 16 7 0">2.3513197969169036e-05</Real>
+    <Real Name="Cell 16 7 1">0.0012984167718542109</Real>
+    <Real Name="Cell 16 7 2">0.0034240118907229635</Real>
+    <Real Name="Cell 16 7 3">0.00098323241056930718</Real>
+    <Real Name="Cell 16 7 4">8.9612837490680154e-06</Real>
+    <Real Name="Cell 16 8 0">2.1083309514137262e-05</Real>
+    <Real Name="Cell 16 8 1">0.0011642364732880575</Real>
+    <Real Name="Cell 16 8 2">0.0030701694668183736</Real>
+    <Real Name="Cell 16 8 3">0.00088162372738686146</Real>
+    <Real Name="Cell 16 8 4">8.0352115085894583e-06</Real>
+    <Real Name="Cell 16 9 0">1.6533514520905978e-06</Real>
+    <Real Name="Cell 16 9 1">9.1299331463920487e-05</Real>
+    <Real Name="Cell 16 9 2">0.00024076244494369601</Real>
+    <Real Name="Cell 16 9 3">6.9136862450137955e-05</Real>
+    <Real Name="Cell 16 9 4">6.3012064622365306e-07</Real>
+    <Real Name="Cell 17 5 0">6.8337625976730206e-10</Real>
+    <Real Name="Cell 17 5 1">3.7736559626313675e-08</Real>
+    <Real Name="Cell 17 5 2">9.9513832288961041e-08</Real>
+    <Real Name="Cell 17 5 3">2.8576193170230312e-08</Real>
+    <Real Name="Cell 17 5 4">2.6044643434642201e-10</Real>
+    <Real Name="Cell 17 6 0">0.00013290148861424918</Real>
+    <Real Name="Cell 17 6 1">0.0073389218279622621</Real>
+    <Real Name="Cell 17 6 2">0.019353227830031898</Real>
+    <Real Name="Cell 17 6 3">0.0055574342201251655</Real>
+    <Real Name="Cell 17 6 4">5.0651040820029641e-05</Real>
+    <Real Name="Cell 17 7 0">0.0012665582563992407</Real>
+    <Real Name="Cell 17 7 1">0.069940315426065283</Real>
+    <Real Name="Cell 17 7 2">0.18443729074584936</Real>
+    <Real Name="Cell 17 7 3">0.052962643754319312</Real>
+    <Real Name="Cell 17 7 4">0.00048270711347732289</Real>
+    <Real Name="Cell 17 8 0">0.0011356702636691541</Real>
+    <Real Name="Cell 17 8 1">0.062712580380500038</Real>
+    <Real Name="Cell 17 8 2">0.16537726989933088</Real>
+    <Real Name="Cell 17 8 3">0.047489406265512978</Real>
+    <Real Name="Cell 17 8 4">0.00043282345053456971</Real>
+    <Real Name="Cell 17 9 0">8.9059171581883523e-05</Real>
+    <Real Name="Cell 17 9 1">0.0049179155562328672</Real>
+    <Real Name="Cell 17 9 2">0.012968872327539139</Real>
+    <Real Name="Cell 17 9 3">0.0037241154551830398</Real>
+    <Real Name="Cell 17 9 4">3.3941980501701931e-05</Real>
+    <Real Name="Cell 18 5 0">1.7817407185594997e-09</Real>
+    <Real Name="Cell 18 5 1">9.8389084934625136e-08</Real>
+    <Real Name="Cell 18 5 2">2.5945859914641824e-07</Real>
+    <Real Name="Cell 18 5 3">7.4505612720814332e-08</Real>
+    <Real Name="Cell 18 5 4">6.7905200165523386e-10</Real>
+    <Real Name="Cell 18 6 0">0.00034650895525959808</Real>
+    <Real Name="Cell 18 6 1">0.019134489476789897</Real>
+    <Real Name="Cell 18 6 2">0.050458928836755956</Real>
+    <Real Name="Cell 18 6 3">0.014489685146634573</Real>
+    <Real Name="Cell 18 6 4">0.0001320605165552523</Real>
+    <Real Name="Cell 18 7 0">0.0033022487767173491</Real>
+    <Real Name="Cell 18 7 1">0.18235270260331951</Real>
+    <Real Name="Cell 18 7 2">0.4808762760570231</Real>
+    <Real Name="Cell 18 7 3">0.13808747024920706</Real>
+    <Real Name="Cell 18 7 4">0.0012585437479401581</Real>
+    <Real Name="Cell 18 8 0">0.0029609895320705923</Real>
+    <Real Name="Cell 18 8 1">0.16350810616090253</Real>
+    <Real Name="Cell 18 8 2">0.43118181454558763</Real>
+    <Real Name="Cell 18 8 3">0.12381730801168178</Real>
+    <Real Name="Cell 18 8 4">0.00112848398629982</Real>
+    <Real Name="Cell 18 9 0">0.00023220056316069793</Real>
+    <Real Name="Cell 18 9 1">0.01282229265611453</Real>
+    <Real Name="Cell 18 9 2">0.033813243538258521</Real>
+    <Real Name="Cell 18 9 3">0.0097097434279847603</Real>
+    <Real Name="Cell 18 9 4">8.8495624283213583e-05</Real>
+    <Real Name="Cell 2 0 1">3.9292058112330904e-07</Real>
+    <Real Name="Cell 2 0 2">0.00065947750194411507</Real>
+    <Real Name="Cell 2 0 3">0.0043425418447414453</Real>
+    <Real Name="Cell 2 0 4">0.0029002204592476952</Real>
+    <Real Name="Cell 2 0 5">0.0001479957111780785</Real>
+    <Real Name="Cell 2 1 1">4.3221263923563998e-06</Real>
+    <Real Name="Cell 2 1 2">0.0072542525213852667</Real>
+    <Real Name="Cell 2 1 3">0.047767960292155902</Real>
+    <Real Name="Cell 2 1 4">0.03190242505172465</Real>
+    <Real Name="Cell 2 1 5">0.0016279528229588636</Real>
+    <Real Name="Cell 2 10 10">0.001758654452341847</Real>
+    <Real Name="Cell 2 10 5">0.0068672598755057579</Real>
+    <Real Name="Cell 2 10 6">0.13123735197393818</Real>
+    <Real Name="Cell 2 10 7">0.33347730662196901</Real>
+    <Real Name="Cell 2 10 8">0.42320893379436209</Real>
+    <Real Name="Cell 2 10 9">0.1243441659049266</Real>
+    <Real Name="Cell 2 11 10">4.3945984061377063e-05</Real>
+    <Real Name="Cell 2 11 5">1.1076230616618764e-05</Real>
+    <Real Name="Cell 2 11 6">0.00056454698758130945</Real>
+    <Real Name="Cell 2 11 7">0.011139324794365892</Real>
+    <Real Name="Cell 2 11 8">0.022431536967245164</Real>
+    <Real Name="Cell 2 11 9">0.0053215522648599181</Real>
+    <Real Name="Cell 2 12 10">1.8439162152466346e-09</Real>
+    <Real Name="Cell 2 12 6">9.8532218392640596e-08</Real>
+    <Real Name="Cell 2 12 7">2.6152681635763627e-06</Real>
+    <Real Name="Cell 2 12 8">4.7181411570836046e-06</Real>
+    <Real Name="Cell 2 12 9">8.933930553273993e-07</Real>
+    <Real Name="Cell 2 2 1">4.3221263923563998e-06</Real>
+    <Real Name="Cell 2 2 2">0.0072542525213852667</Real>
+    <Real Name="Cell 2 2 3">0.047767960292155902</Real>
+    <Real Name="Cell 2 2 4">0.03190242505172465</Real>
+    <Real Name="Cell 2 2 5">0.0016279528229588636</Real>
+    <Real Name="Cell 2 3 1">3.9292058112330904e-07</Real>
+    <Real Name="Cell 2 3 2">0.0006594786390550268</Real>
+    <Real Name="Cell 2 3 3">0.0043425613541622351</Real>
+    <Real Name="Cell 2 3 4">0.002900247227253652</Real>
+    <Real Name="Cell 2 3 5">0.00014799936377039711</Real>
+    <Real Name="Cell 2 3 6">9.4060931347646326e-13</Real>
+    <Real Name="Cell 2 4 0">0.00016286091159007881</Real>
+    <Real Name="Cell 2 4 1">3.0554060667551216e-06</Real>
+    <Real Name="Cell 2 4 10">0.00043287157139199658</Real>
+    <Real Name="Cell 2 4 2">7.0500780842455004e-07</Real>
+    <Real Name="Cell 2 4 3">1.2095824598073633e-05</Real>
+    <Real Name="Cell 2 4 4">1.6596209552755588e-05</Real>
+    <Real Name="Cell 2 4 5">2.2649746362181506e-06</Real>
+    <Real Name="Cell 2 4 6">7.9309811414025573e-10</Real>
+    <Real Name="Cell 2 4 7">8.2102384453819349e-12</Real>
+    <Real Name="Cell 2 4 8">1.4856905085206247e-06</Real>
+    <Real Name="Cell 2 4 9">0.00012858310075115464</Real>
+    <Real Name="Cell 2 5 0">0.022713126018715672</Real>
+    <Real Name="Cell 2 5 1">0.00043863498422933272</Real>
+    <Real Name="Cell 2 5 10">0.058945017792247499</Real>
+    <Real Name="Cell 2 5 2">3.918477825382228e-06</Real>
+    <Real Name="Cell 2 5 3">6.7229367502926626e-05</Real>
+    <Real Name="Cell 2 5 4">9.2249428376030805e-05</Real>
+    <Real Name="Cell 2 5 5">1.2624897489633455e-05</Real>
+    <Real Name="Cell 2 5 6">2.4821393577762971e-08</Real>
+    <Real Name="Cell 2 5 7">8.4401903833257802e-10</Real>
+    <Real Name="Cell 2 5 8">0.00016967262949766116</Real>
+    <Real Name="Cell 2 5 9">0.016905063209985773</Real>
+    <Real Name="Cell 2 6 0">0.086199474502687612</Real>
+    <Real Name="Cell 2 6 1">0.0016762059085993247</Real>
+    <Real Name="Cell 2 6 10">0.22239284100034434</Real>
+    <Real Name="Cell 2 6 2">2.2696691620227494e-06</Real>
+    <Real Name="Cell 2 6 3">3.8940775278365286e-05</Real>
+    <Real Name="Cell 2 6 4">5.3452750651731918e-05</Real>
+    <Real Name="Cell 2 6 5">7.4200936559415253e-06</Real>
+    <Real Name="Cell 2 6 6">7.5274853939563912e-08</Real>
+    <Real Name="Cell 2 6 7">2.8706503330635104e-09</Real>
+    <Real Name="Cell 2 6 8">0.0006093806941790469</Real>
+    <Real Name="Cell 2 6 9">0.063210997069653524</Real>
+    <Real Name="Cell 2 7 0">0.03552752161528154</Real>
+    <Real Name="Cell 2 7 1">0.00069456350851879287</Real>
+    <Real Name="Cell 2 7 10">0.091245747123739521</Real>
+    <Real Name="Cell 2 7 2">9.2105777170667837e-08</Real>
+    <Real Name="Cell 2 7 3">1.5802757535347617e-06</Real>
+    <Real Name="Cell 2 7 4">2.1770663223537598e-06</Real>
+    <Real Name="Cell 2 7 5">0.00089751788198473407</Real>
+    <Real Name="Cell 2 7 6">0.016719364950284844</Real>
+    <Real Name="Cell 2 7 7">0.024580750421086251</Real>
+    <Real Name="Cell 2 7 8">0.0049817569477990957</Real>
+    <Real Name="Cell 2 7 9">0.026192331122416344</Real>
+    <Real Name="Cell 2 8 0">0.00077084317989471794</Real>
+    <Real Name="Cell 2 8 1">1.5197999913429375e-05</Real>
+    <Real Name="Cell 2 8 10">0.0030439057283585735</Real>
+    <Real Name="Cell 2 8 3">2.7920465551620358e-13</Real>
+    <Real Name="Cell 2 8 4">1.5260076121888002e-10</Real>
+    <Real Name="Cell 2 8 5">0.022108143442723001</Real>
+    <Real Name="Cell 2 8 6">0.4125334748725602</Real>
+    <Real Name="Cell 2 8 7">0.65165981446654364</Real>
+    <Real Name="Cell 2 8 8">0.26707709406119018</Real>
+    <Real Name="Cell 2 8 9">0.065678747925043662</Real>
+    <Real Name="Cell 2 9 10">0.0041586734287708278</Real>
+    <Real Name="Cell 2 9 5">0.038168670001167894</Real>
+    <Real Name="Cell 2 9 6">0.71491700908692968</Real>
+    <Real Name="Cell 2 9 7">1.2770505140092818</Real>
+    <Real Name="Cell 2 9 8">0.90599739157466841</Real>
+    <Real Name="Cell 2 9 9">0.26194858839602447</Real>
+    <Real Name="Cell 3 0 1">5.2628228014874394e-06</Real>
+    <Real Name="Cell 3 0 2">0.0088331164134419892</Real>
+    <Real Name="Cell 3 0 3">0.058164497699718098</Real>
+    <Real Name="Cell 3 0 4">0.038845881573913013</Real>
+    <Real Name="Cell 3 0 5">0.0019822713309739027</Real>
+    <Real Name="Cell 3 1 1">5.7891050816361839e-05</Real>
+    <Real Name="Cell 3 1 2">0.0971642805478619</Real>
+    <Real Name="Cell 3 1 3">0.63980947469689908</Real>
+    <Real Name="Cell 3 1 4">0.42730469731304321</Real>
+    <Real Name="Cell 3 1 5">0.02180498464071293</Real>
+    <Real Name="Cell 3 10 0">1.5873347162863456e-07</Real>
+    <Real Name="Cell 3 10 1">0.0012037300810579638</Real>
+    <Real Name="Cell 3 10 10">0.00022504749244868863</Real>
+    <Real Name="Cell 3 10 2">0.009441717570913815</Real>
+    <Real Name="Cell 3 10 3">0.0072672464590233252</Real>
+    <Real Name="Cell 3 10 4">0.0004590646966100127</Real>
+    <Real Name="Cell 3 10 5">0.0020250425788630472</Real>
+    <Real Name="Cell 3 10 6">0.041505512327973393</Real>
+    <Real Name="Cell 3 10 7">0.16041866540205424</Real>
+    <Real Name="Cell 3 10 8">0.21049031363048248</Real>
+    <Real Name="Cell 3 10 9">0.042836460156395077</Real>
+    <Real Name="Cell 3 11 0">6.080567326801825e-07</Real>
+    <Real Name="Cell 3 11 1">0.0046111016952326252</Real>
+    <Real Name="Cell 3 11 10">1.299609722080837e-05</Real>
+    <Real Name="Cell 3 11 2">0.036168174728078359</Real>
+    <Real Name="Cell 3 11 3">0.027838477241861104</Real>
+    <Real Name="Cell 3 11 4">0.0017585287881976169</Real>
+    <Real Name="Cell 3 11 5">3.2661991854950146e-06</Real>
+    <Real Name="Cell 3 11 6">0.00057427342265683144</Real>
+    <Real Name="Cell 3 11 7">0.013836785822932495</Real>
+    <Real Name="Cell 3 11 8">0.025073948443592176</Real>
+    <Real Name="Cell 3 11 9">0.004843850920990639</Real>
+    <Real Name="Cell 3 12 0">2.5242806966547337e-07</Real>
+    <Real Name="Cell 3 12 1">0.0019142481900138316</Real>
+    <Real Name="Cell 3 12 10">2.776053042473103e-09</Real>
+    <Real Name="Cell 3 12 2">0.01501482022851703</Real>
+    <Real Name="Cell 3 12 3">0.011556837865464914</Real>
+    <Real Name="Cell 3 12 4">0.0007300338991384314</Real>
+    <Real Name="Cell 3 12 6">1.4834224157735271e-07</Real>
+    <Real Name="Cell 3 12 7">3.9373389540956572e-06</Real>
+    <Real Name="Cell 3 12 8">7.1032566478014289e-06</Real>
+    <Real Name="Cell 3 12 9">1.3450212590240926e-06</Real>
+    <Real Name="Cell 3 13 0">5.5396055947692468e-09</Real>
+    <Real Name="Cell 3 13 1">4.2008719542286094e-05</Real>
+    <Real Name="Cell 3 13 2">0.00032950448915041591</Real>
+    <Real Name="Cell 3 13 3">0.00025361808527162813</Real>
+    <Real Name="Cell 3 13 4">1.6020801004412256e-05</Real>
+    <Real Name="Cell 3 2 1">5.7891050816361839e-05</Real>
+    <Real Name="Cell 3 2 2">0.09721678263018102</Real>
+    <Real Name="Cell 3 2 3">0.64056589440933942</Real>
+    <Real Name="Cell 3 2 4">0.42822520071010828</Real>
+    <Real Name="Cell 3 2 5">0.021913032438109804</Real>
+    <Real Name="Cell 3 2 6">5.0231996614006669e-09</Real>
+    <Real Name="Cell 3 3 1">5.2628228014874394e-06</Real>
+    <Real Name="Cell 3 3 2">0.010397691800003023</Real>
+    <Real Name="Cell 3 3 3">0.080708066485339736</Real>
+    <Real Name="Cell 3 3 4">0.066281637762740306</Real>
+    <Real Name="Cell 3 3 5">0.0052029917471760924</Real>
+    <Real Name="Cell 3 3 6">1.5024314242510404e-07</Real>
+    <Real Name="Cell 3 4 0">0.00042627683636924086</Real>
+    <Real Name="Cell 3 4 1">3.5400118501063598e-06</Real>
+    <Real Name="Cell 3 4 10">0.0016403087931345433</Real>
+    <Real Name="Cell 3 4 2">0.0034808370906558397</Real>
+    <Real Name="Cell 3 4 3">0.051432846937786748</Real>
+    <Real Name="Cell 3 4 4">0.063834141187148558</Real>
+    <Real Name="Cell 3 4 5">0.007715147612600063</Real>
+    <Real Name="Cell 3 4 6">8.0719946226841859e-06</Real>
+    <Real Name="Cell 3 4 7">2.8905201917854722e-07</Real>
+    <Real Name="Cell 3 4 8">1.7251012675847173e-05</Real>
+    <Real Name="Cell 3 4 9">0.0007024471648445108</Real>
+    <Real Name="Cell 3 5 0">0.038843463774114781</Real>
+    <Real Name="Cell 3 5 1">0.00040617331381915986</Real>
+    <Real Name="Cell 3 5 10">0.14090827988121804</Real>
+    <Real Name="Cell 3 5 2">0.0032375401801130123</Real>
+    <Real Name="Cell 3 5 3">0.053378565968710129</Real>
+    <Real Name="Cell 3 5 4">0.072116871072104641</Real>
+    <Real Name="Cell 3 5 5">0.010959943190772807</Real>
+    <Real Name="Cell 3 5 6">0.00076349338601510212</Real>
+    <Real Name="Cell 3 5 7">2.9714777332976491e-05</Real>
+    <Real Name="Cell 3 5 8">0.0013464653227093061</Real>
+    <Real Name="Cell 3 5 9">0.057834307728261175</Real>
+    <Real Name="Cell 3 6 0">0.12844990304803641</Real>
+    <Real Name="Cell 3 6 1">0.0020584050051700854</Real>
+    <Real Name="Cell 3 6 10">0.45387946717560984</Real>
+    <Real Name="Cell 3 6 2">0.0036705613989806126</Real>
+    <Real Name="Cell 3 6 3">0.026615293169202178</Real>
+    <Real Name="Cell 3 6 4">0.036360670942867442</Real>
+    <Real Name="Cell 3 6 5">0.00948331127843852</Real>
+    <Real Name="Cell 3 6 6">0.0025919335890815512</Real>
+    <Real Name="Cell 3 6 7">0.00010106494234577331</Real>
+    <Real Name="Cell 3 6 8">0.0041346253583830614</Real>
+    <Real Name="Cell 3 6 9">0.1825406702977076</Real>
+    <Real Name="Cell 3 7 0">0.046854556628265369</Real>
+    <Real Name="Cell 3 7 1">0.0024852906899019353</Real>
+    <Real Name="Cell 3 7 10">0.16105010198619132</Real>
+    <Real Name="Cell 3 7 2">0.0066179651088454708</Real>
+    <Real Name="Cell 3 7 3">0.0034829970604281163</Real>
+    <Real Name="Cell 3 7 4">0.0018415011223243494</Real>
+    <Real Name="Cell 3 7 5">0.0021945009003438366</Real>
+    <Real Name="Cell 3 7 6">0.0058904838841050437</Real>
+    <Real Name="Cell 3 7 7">0.0072126942384354003</Real>
+    <Real Name="Cell 3 7 8">0.002542452620295974</Real>
+    <Real Name="Cell 3 7 9">0.063390368677478146</Real>
+    <Real Name="Cell 3 8 0">0.00081167656518140406</Real>
+    <Real Name="Cell 3 8 1">0.00064814940457490655</Real>
+    <Real Name="Cell 3 8 10">0.0026967484413552428</Real>
+    <Real Name="Cell 3 8 2">0.0021666629694003666</Real>
+    <Real Name="Cell 3 8 3">0.00080328969882139376</Real>
+    <Real Name="Cell 3 8 4">2.0642453325401946e-05</Real>
+    <Real Name="Cell 3 8 5">0.0065496328757935858</Real>
+    <Real Name="Cell 3 8 6">0.12168226372182953</Real>
+    <Real Name="Cell 3 8 7">0.18480653103918754</Real>
+    <Real Name="Cell 3 8 8">0.04895768729010485</Real>
+    <Real Name="Cell 3 8 9">0.008200171024165535</Real>
+    <Real Name="Cell 3 9 0">8.2631323967394557e-08</Real>
+    <Real Name="Cell 3 9 1">1.6680051643878867e-05</Real>
+    <Real Name="Cell 3 9 10">0.00042522376422769737</Real>
+    <Real Name="Cell 3 9 2">9.3595902306118088e-05</Real>
+    <Real Name="Cell 3 9 3">6.066457974084798e-05</Real>
+    <Real Name="Cell 3 9 4">3.3465468049840549e-06</Real>
+    <Real Name="Cell 3 9 5">0.011255316288033328</Real>
+    <Real Name="Cell 3 9 6">0.21255370244104035</Real>
+    <Real Name="Cell 3 9 7">0.39282391120328353</Real>
+    <Real Name="Cell 3 9 8">0.23309730265154127</Real>
+    <Real Name="Cell 3 9 9">0.046568625001872858</Real>
+    <Real Name="Cell 4 0 1">6.0811406856676172e-06</Real>
+    <Real Name="Cell 4 0 2">0.010206580314244826</Real>
+    <Real Name="Cell 4 0 3">0.067208512763000036</Real>
+    <Real Name="Cell 4 0 4">0.044886039264514691</Real>
+    <Real Name="Cell 4 0 5">0.0022904952903622221</Real>
+    <Real Name="Cell 4 1 1">6.6892547542343791e-05</Real>
+    <Real Name="Cell 4 1 2">0.11227238345669309</Real>
+    <Real Name="Cell 4 1 3">0.7392936403930005</Real>
+    <Real Name="Cell 4 1 4">0.49374643190966166</Real>
+    <Real Name="Cell 4 1 5">0.025195448193984445</Real>
+    <Real Name="Cell 4 10 0">2.6365335974922171e-06</Real>
+    <Real Name="Cell 4 10 1">0.019993733952006879</Real>
+    <Real Name="Cell 4 10 10">1.0585583797748487e-05</Real>
+    <Real Name="Cell 4 10 2">0.15682518210139279</Real>
+    <Real Name="Cell 4 10 3">0.12070761921781678</Real>
+    <Real Name="Cell 4 10 4">0.007624979682083209</Real>
+    <Real Name="Cell 4 10 5">1.985737245315617e-05</Real>
+    <Real Name="Cell 4 10 6">0.00093562871576644273</Real>
+    <Real Name="Cell 4 10 7">0.015549876791515571</Real>
+    <Real Name="Cell 4 10 8">0.027164212367843568</Real>
+    <Real Name="Cell 4 10 9">0.0051288401348717925</Real>
+    <Real Name="Cell 4 11 0">1.0099709837149708e-05</Real>
+    <Real Name="Cell 4 11 1">0.076589546087524898</Real>
+    <Real Name="Cell 4 11 10">1.4640578091548502e-06</Real>
+    <Real Name="Cell 4 11 2">0.60074669099182854</Real>
+    <Real Name="Cell 4 11 3">0.4623919567695568</Real>
+    <Real Name="Cell 4 11 4">0.029208837837853406</Real>
+    <Real Name="Cell 4 11 5">3.2028034575442935e-08</Real>
+    <Real Name="Cell 4 11 6">7.883068954859417e-05</Real>
+    <Real Name="Cell 4 11 7">0.002077371059295864</Real>
+    <Real Name="Cell 4 11 8">0.0037463004093973139</Real>
+    <Real Name="Cell 4 11 9">0.00070934849014010672</Real>
+    <Real Name="Cell 4 12 0">4.1927835370487033e-06</Real>
+    <Real Name="Cell 4 12 1">0.031795308293375013</Real>
+    <Real Name="Cell 4 12 10">4.2438335557221526e-10</Real>
+    <Real Name="Cell 4 12 2">0.24939338620027793</Real>
+    <Real Name="Cell 4 12 3">0.19195693888907472</Real>
+    <Real Name="Cell 4 12 4">0.012125728005809607</Real>
+    <Real Name="Cell 4 12 6">2.2677512745800168e-08</Real>
+    <Real Name="Cell 4 12 7">6.0191253257744655e-07</Real>
+    <Real Name="Cell 4 12 8">1.0858956387227687e-06</Real>
+    <Real Name="Cell 4 12 9">2.0561733745263642e-07</Real>
+    <Real Name="Cell 4 13 0">9.2011824082289251e-08</Real>
+    <Real Name="Cell 4 13 1">0.00069775705983416022</Real>
+    <Real Name="Cell 4 13 2">0.0054730086052806022</Real>
+    <Real Name="Cell 4 13 3">0.004212549476109796</Real>
+    <Real Name="Cell 4 13 4">0.00026610254077785972</Real>
+    <Real Name="Cell 4 2 1">6.6892547542343791e-05</Real>
+    <Real Name="Cell 4 2 2">0.11292212713501221</Real>
+    <Real Name="Cell 4 2 3">0.74865477245871004</Real>
+    <Real Name="Cell 4 2 4">0.50513819461116538</Real>
+    <Real Name="Cell 4 2 5">0.026532602268906705</Real>
+    <Real Name="Cell 4 2 6">6.2165005286672365e-08</Real>
+    <Real Name="Cell 4 3 1">6.0811406856676172e-06</Real>
+    <Real Name="Cell 4 3 2">0.029564030388621168</Real>
+    <Real Name="Cell 4 3 3">0.34611113551190642</Real>
+    <Real Name="Cell 4 3 4">0.38429990929763463</Real>
+    <Real Name="Cell 4 3 5">0.04213246917556733</Real>
+    <Real Name="Cell 4 3 6">1.8551466278606118e-06</Real>
+    <Real Name="Cell 4 4 0">0.000587015315588387</Real>
+    <Real Name="Cell 4 4 1">3.0184743439997748e-06</Real>
+    <Real Name="Cell 4 4 10">0.0024701099633055688</Real>
+    <Real Name="Cell 4 4 2">0.039929919870704746</Real>
+    <Real Name="Cell 4 4 3">0.58252826879948949</Real>
+    <Real Name="Cell 4 4 4">0.71603854793436361</Real>
+    <Real Name="Cell 4 4 5">0.085451240682146615</Real>
+    <Real Name="Cell 4 4 6">7.9870149908774731e-05</Real>
+    <Real Name="Cell 4 4 7">2.5408575582109795e-06</Real>
+    <Real Name="Cell 4 4 8">2.9321126629228444e-05</Real>
+    <Real Name="Cell 4 4 9">0.0011197097060561922</Real>
+    <Real Name="Cell 4 5 0">0.044911610496675393</Real>
+    <Real Name="Cell 4 5 1">0.00061070818274139803</Real>
+    <Real Name="Cell 4 5 10">0.18847039345735117</Real>
+    <Real Name="Cell 4 5 2">0.023496837590293872</Real>
+    <Real Name="Cell 4 5 3">0.36467203383387659</Real>
+    <Real Name="Cell 4 5 4">0.51332372955600192</Real>
+    <Real Name="Cell 4 5 5">0.10248792206783859</Real>
+    <Real Name="Cell 4 5 6">0.0086736152554076178</Real>
+    <Real Name="Cell 4 5 7">0.00026120217665877185</Real>
+    <Real Name="Cell 4 5 8">0.0022300016249293744</Real>
+    <Real Name="Cell 4 5 9">0.085300750479011755</Real>
+    <Real Name="Cell 4 6 0">0.13668149835813465</Real>
+    <Real Name="Cell 4 6 1">0.029253119243852786</Real>
+    <Real Name="Cell 4 6 10">0.57162559989159067</Real>
+    <Real Name="Cell 4 6 2">0.10551829686535634</Real>
+    <Real Name="Cell 4 6 3">0.19834120985432607</Real>
+    <Real Name="Cell 4 6 4">0.35388301915279685</Real>
+    <Real Name="Cell 4 6 5">0.1889207437188786</Real>
+    <Real Name="Cell 4 6 6">0.031294920070306806</Real>
+    <Real Name="Cell 4 6 7">0.00088839241932710722</Real>
+    <Real Name="Cell 4 6 8">0.0067513973570738073</Real>
+    <Real Name="Cell 4 6 9">0.25849011249778781</Real>
+    <Real Name="Cell 4 7 0">0.046113586911392966</Real>
+    <Real Name="Cell 4 7 1">0.086586623549942399</Real>
+    <Real Name="Cell 4 7 10">0.18939130215353053</Real>
+    <Real Name="Cell 4 7 2">0.29401359829336382</Real>
+    <Real Name="Cell 4 7 3">0.1226165174894152</Real>
+    <Real Name="Cell 4 7 4">0.080674623996323191</Real>
+    <Real Name="Cell 4 7 5">0.072437720000441491</Real>
+    <Real Name="Cell 4 7 6">0.012449077210919422</Real>
+    <Real Name="Cell 4 7 7">0.00039933846794491562</Real>
+    <Real Name="Cell 4 7 8">0.0022422119322471771</Real>
+    <Real Name="Cell 4 7 9">0.085552623145093917</Real>
+    <Real Name="Cell 4 8 0">0.00088190565035645976</Real>
+    <Real Name="Cell 4 8 1">0.028534428512314008</Real>
+    <Real Name="Cell 4 8 10">0.0025142438095358496</Real>
+    <Real Name="Cell 4 8 2">0.097038819412092817</Real>
+    <Real Name="Cell 4 8 3">0.036184746445648806</Real>
+    <Real Name="Cell 4 8 4">0.0025278411086193707</Real>
+    <Real Name="Cell 4 8 5">0.0018660508879273638</Real>
+    <Real Name="Cell 4 8 6">0.0014684278997884725</Real>
+    <Real Name="Cell 4 8 7">0.0023522276490109636</Real>
+    <Real Name="Cell 4 8 8">0.0014009731105222895</Real>
+    <Real Name="Cell 4 8 9">0.001343792287701223</Real>
+    <Real Name="Cell 4 9 0">3.6699944314404438e-06</Real>
+    <Real Name="Cell 4 9 1">0.00051323694881170502</Real>
+    <Real Name="Cell 4 9 10">7.6313889834793078e-06</Real>
+    <Real Name="Cell 4 9 2">0.0023579123079199684</Real>
+    <Real Name="Cell 4 9 3">0.001305385804122302</Real>
+    <Real Name="Cell 4 9 4">6.0712403742290838e-05</Real>
+    <Real Name="Cell 4 9 5">0.00011036854728014495</Real>
+    <Real Name="Cell 4 9 6">0.0024641295503743874</Real>
+    <Real Name="Cell 4 9 7">0.013803468717253149</Real>
+    <Real Name="Cell 4 9 8">0.019961719491648291</Real>
+    <Real Name="Cell 4 9 9">0.0036976669643922848</Real>
+    <Real Name="Cell 5 0 1">6.6801493069522987e-07</Real>
+    <Real Name="Cell 5 0 2">0.0011211955772253319</Real>
+    <Real Name="Cell 5 0 3">0.0073828731016401432</Real>
+    <Real Name="Cell 5 0 4">0.0049307434177830248</Real>
+    <Real Name="Cell 5 0 5">0.00025161152022929893</Real>
+    <Real Name="Cell 5 1 1">7.3481642376475287e-06</Real>
+    <Real Name="Cell 5 1 2">0.012333151349478651</Real>
+    <Real Name="Cell 5 1 3">0.081211604118041569</Real>
+    <Real Name="Cell 5 1 4">0.054238177595613266</Real>
+    <Real Name="Cell 5 1 5">0.002767726722522288</Real>
+    <Real Name="Cell 5 10 0">3.5393822397109359e-06</Real>
+    <Real Name="Cell 5 10 1">0.026840343291110891</Real>
+    <Real Name="Cell 5 10 10">6.5998975308475378e-09</Real>
+    <Real Name="Cell 5 10 2">0.21052804515636045</Real>
+    <Real Name="Cell 5 10 3">0.16204246517613069</Real>
+    <Real Name="Cell 5 10 4">0.010236060595090411</Real>
+    <Real Name="Cell 5 10 6">3.5267467117074908e-07</Real>
+    <Real Name="Cell 5 10 7">9.3607842658854868e-06</Real>
+    <Real Name="Cell 5 10 8">1.6887561330253376e-05</Real>
+    <Real Name="Cell 5 10 9">3.1977063660362546e-06</Real>
+    <Real Name="Cell 5 11 0">1.3558231785038738e-05</Real>
+    <Real Name="Cell 5 11 1">0.10281669819324503</Real>
+    <Real Name="Cell 5 11 10">9.1281045091860911e-10</Real>
+    <Real Name="Cell 5 11 2">0.80646503829271543</Real>
+    <Real Name="Cell 5 11 3">0.62073241969380488</Real>
+    <Real Name="Cell 5 11 4">0.039211046650127243</Real>
+    <Real Name="Cell 5 11 6">4.8777291482827472e-08</Real>
+    <Real Name="Cell 5 11 7">1.2946597529367214e-06</Real>
+    <Real Name="Cell 5 11 8">2.3356639100432653e-06</Real>
+    <Real Name="Cell 5 11 9">4.4226441035547786e-07</Real>
+    <Real Name="Cell 5 12 0">5.6285509124927381e-06</Real>
+    <Real Name="Cell 5 12 1">0.042683222237996747</Real>
+    <Real Name="Cell 5 12 10">2.6459444411273003e-13</Real>
+    <Real Name="Cell 5 12 2">0.33479509711472194</Real>
+    <Real Name="Cell 5 12 3">0.25769024181580685</Real>
+    <Real Name="Cell 5 12 4">0.016278035063975595</Real>
+    <Real Name="Cell 5 12 6">1.4138970815063686e-11</Real>
+    <Real Name="Cell 5 12 7">3.7528029756745265e-10</Real>
+    <Real Name="Cell 5 12 8">6.7703398146913598e-10</Real>
+    <Real Name="Cell 5 12 9">1.2819825374598627e-10</Real>
+    <Real Name="Cell 5 13 0">1.2352014641877625e-07</Real>
+    <Real Name="Cell 5 13 1">0.00093669541991005787</Real>
+    <Real Name="Cell 5 13 2">0.0073471733770965027</Real>
+    <Real Name="Cell 5 13 3">0.005655085455322225</Real>
+    <Real Name="Cell 5 13 4">0.00035722609704915478</Real>
+    <Real Name="Cell 5 2 1">7.3481642376475287e-06</Real>
+    <Real Name="Cell 5 2 2">0.013042143634651629</Real>
+    <Real Name="Cell 5 2 3">0.091426355929468628</Real>
+    <Real Name="Cell 5 2 4">0.066668728502675093</Real>
+    <Real Name="Cell 5 2 5">0.0042268127511236667</Real>
+    <Real Name="Cell 5 2 6">6.7833686770156194e-08</Real>
+    <Real Name="Cell 5 3 1">6.6801493069522987e-07</Real>
+    <Real Name="Cell 5 3 2">0.022241664194336302</Real>
+    <Real Name="Cell 5 3 3">0.31168122240742901</Real>
+    <Real Name="Cell 5 3 4">0.37524454556954639</Real>
+    <Real Name="Cell 5 3 5">0.043719801159408919</Real>
+    <Real Name="Cell 5 3 6">2.0225412078983892e-06</Real>
+    <Real Name="Cell 5 4 0">0.00010653918816651577</Real>
+    <Real Name="Cell 5 4 1">5.3623884589502417e-07</Real>
+    <Real Name="Cell 5 4 10">0.00044962719916150242</Real>
+    <Real Name="Cell 5 4 2">0.042242958063500702</Real>
+    <Real Name="Cell 5 4 3">0.61295662309693943</Real>
+    <Real Name="Cell 5 4 4">0.75088323345063446</Real>
+    <Real Name="Cell 5 4 5">0.089629650057529514</Real>
+    <Real Name="Cell 5 4 6">0.00011787241108008185</Real>
+    <Real Name="Cell 5 4 7">2.1398031419035043e-06</Real>
+    <Real Name="Cell 5 4 8">5.3563348578314463e-06</Real>
+    <Real Name="Cell 5 4 9">0.00020417116915455951</Real>
+    <Real Name="Cell 5 5 0">0.0081056073864261835</Real>
+    <Real Name="Cell 5 5 1">0.00093744906805072914</Real>
+    <Real Name="Cell 5 5 10">0.034171272140952703</Real>
+    <Real Name="Cell 5 5 2">0.01991522221554216</Real>
+    <Real Name="Cell 5 5 3">0.29241884634567228</Real>
+    <Real Name="Cell 5 5 4">0.56314919987641943</Real>
+    <Real Name="Cell 5 5 5">0.23249097234455948</Real>
+    <Real Name="Cell 5 5 6">0.018178802605955689</Real>
+    <Real Name="Cell 5 5 7">0.00021997346387257196</Real>
+    <Real Name="Cell 5 5 8">0.00040707674368090373</Real>
+    <Real Name="Cell 5 5 9">0.015516829492361151</Real>
+    <Real Name="Cell 5 6 0">0.025166538179984405</Real>
+    <Real Name="Cell 5 6 1">0.068272168746508821</Real>
+    <Real Name="Cell 5 6 10">0.10341257342264018</Real>
+    <Real Name="Cell 5 6 2">0.23676580818573023</Real>
+    <Real Name="Cell 5 6 3">0.27850507761420418</Real>
+    <Real Name="Cell 5 6 4">1.0513162219764158</Real>
+    <Real Name="Cell 5 6 5">0.81949700800476777</Real>
+    <Real Name="Cell 5 6 6">0.073395637261637017</Real>
+    <Real Name="Cell 5 6 7">0.00074816665104905969</Real>
+    <Real Name="Cell 5 6 8">0.0012319369753313802</Real>
+    <Real Name="Cell 5 6 9">0.046958604951739688</Real>
+    <Real Name="Cell 5 7 0">0.010103024267042652</Real>
+    <Real Name="Cell 5 7 1">0.20628063442319733</Real>
+    <Real Name="Cell 5 7 10">0.034170950295530973</Real>
+    <Real Name="Cell 5 7 2">0.70165841477427537</Real>
+    <Real Name="Cell 5 7 3">0.31326546464329735</Real>
+    <Real Name="Cell 5 7 4">0.44176896497145529</Real>
+    <Real Name="Cell 5 7 5">0.37059277333899682</Real>
+    <Real Name="Cell 5 7 6">0.032286502959641465</Real>
+    <Real Name="Cell 5 7 7">0.00027732188980392105</Real>
+    <Real Name="Cell 5 7 8">0.00040707290958933969</Real>
+    <Real Name="Cell 5 7 9">0.015516683345606318</Real>
+    <Real Name="Cell 5 8 0">0.00076945915687349532</Real>
+    <Real Name="Cell 5 8 1">0.068149360973100898</Real>
+    <Real Name="Cell 5 8 10">0.00044961284265584929</Real>
+    <Real Name="Cell 5 8 2">0.23178534792764141</Real>
+    <Real Name="Cell 5 8 3">0.087279207571151665</Real>
+    <Real Name="Cell 5 8 4">0.013299556590620813</Real>
+    <Real Name="Cell 5 8 5">0.010002156198763004</Real>
+    <Real Name="Cell 5 8 6">0.00081197311820122649</Real>
+    <Real Name="Cell 5 8 7">5.1619762730474361e-06</Real>
+    <Real Name="Cell 5 8 8">6.0542717291521941e-06</Real>
+    <Real Name="Cell 5 8 9">0.00020429671539371323</Real>
+    <Real Name="Cell 5 9 0">8.7470740352536622e-06</Real>
+    <Real Name="Cell 5 9 1">0.0010817207936087941</Real>
+    <Real Name="Cell 5 9 10">4.758016777469524e-09</Real>
+    <Real Name="Cell 5 9 2">0.0045010967184971225</Real>
+    <Real Name="Cell 5 9 3">0.0022475177785366597</Real>
+    <Real Name="Cell 5 9 4">9.002770289817758e-05</Real>
+    <Real Name="Cell 5 9 6">2.5425122050394683e-07</Real>
+    <Real Name="Cell 5 9 7">6.7484030440145877e-06</Real>
+    <Real Name="Cell 5 9 8">1.2174628433901255e-05</Real>
+    <Real Name="Cell 5 9 9">2.3052995092588617e-06</Real>
+    <Real Name="Cell 6 0 1">9.9569463451105728e-12</Real>
+    <Real Name="Cell 6 0 2">1.6711728573475769e-08</Real>
+    <Real Name="Cell 6 0 3">1.1004375496410728e-07</Real>
+    <Real Name="Cell 6 0 4">7.3494087327176079e-08</Real>
+    <Real Name="Cell 6 0 5">3.7503389394717347e-09</Real>
+    <Real Name="Cell 6 1 1">1.0952640979621631e-10</Real>
+    <Real Name="Cell 6 1 2">1.8382901430823346e-07</Real>
+    <Real Name="Cell 6 1 3">1.2104813046051801e-06</Real>
+    <Real Name="Cell 6 1 4">8.0843496059893693e-07</Real>
+    <Real Name="Cell 6 1 5">4.1253728334189086e-08</Real>
+    <Real Name="Cell 6 10 0">4.7005982717197042e-07</Real>
+    <Real Name="Cell 6 10 1">0.0035646240711447843</Real>
+    <Real Name="Cell 6 10 2">0.027959900858047414</Real>
+    <Real Name="Cell 6 10 3">0.021520606709444542</Real>
+    <Real Name="Cell 6 10 4">0.0013594352201538366</Real>
+    <Real Name="Cell 6 11 0">1.800647587064043e-06</Real>
+    <Real Name="Cell 6 11 1">0.013654925099883123</Real>
+    <Real Name="Cell 6 11 2">0.10710536213547556</Real>
+    <Real Name="Cell 6 11 3">0.08243850315108632</Real>
+    <Real Name="Cell 6 11 4">0.0052075578627235808</Real>
+    <Real Name="Cell 6 12 0">7.4751905557706981e-07</Real>
+    <Real Name="Cell 6 12 1">0.0056686920794330959</Real>
+    <Real Name="Cell 6 12 2">0.044463613938635266</Real>
+    <Real Name="Cell 6 12 3">0.034223438534780631</Real>
+    <Real Name="Cell 6 12 4">0.002161860412538138</Real>
+    <Real Name="Cell 6 13 0">1.6404517722451026e-08</Real>
+    <Real Name="Cell 6 13 1">0.00012440105571407794</Real>
+    <Real Name="Cell 6 13 2">0.00097576662082209684</Real>
+    <Real Name="Cell 6 13 3">0.00075104306676652944</Real>
+    <Real Name="Cell 6 13 4">4.7442640005436991e-05</Real>
+    <Real Name="Cell 6 2 1">1.0952640979621631e-10</Real>
+    <Real Name="Cell 6 2 2">7.249742613524083e-05</Real>
+    <Real Name="Cell 6 2 3">0.0010430630693079226</Real>
+    <Real Name="Cell 6 2 4">0.0012686612298118173</Real>
+    <Real Name="Cell 6 2 5">0.00014886058708866713</Real>
+    <Real Name="Cell 6 2 6">6.9186900886062962e-09</Real>
+    <Real Name="Cell 6 3 1">9.9569463451105728e-12</Real>
+    <Real Name="Cell 6 3 2">0.0021540462685153455</Real>
+    <Real Name="Cell 6 3 3">0.031034407153948909</Real>
+    <Real Name="Cell 6 3 4">0.037766649253532458</Real>
+    <Real Name="Cell 6 3 5">0.0044330538887957273</Real>
+    <Real Name="Cell 6 3 6">2.0616437515539892e-07</Real>
+    <Real Name="Cell 6 4 0">1.8605274344523832e-07</Real>
+    <Real Name="Cell 6 4 1">9.3645080404352049e-10</Real>
+    <Real Name="Cell 6 4 10">7.8519815451238663e-07</Real>
+    <Real Name="Cell 6 4 2">0.0042152434969009766</Real>
+    <Real Name="Cell 6 4 3">0.060979669263615414</Real>
+    <Real Name="Cell 6 4 4">0.074927869949635836</Real>
+    <Real Name="Cell 6 4 5">0.0092869040285360211</Real>
+    <Real Name="Cell 6 4 6">4.1863798242267894e-05</Real>
+    <Real Name="Cell 6 4 7">1.5376751949877226e-07</Real>
+    <Real Name="Cell 6 4 8">9.3539364459331444e-09</Real>
+    <Real Name="Cell 6 4 9">3.5655055015302284e-07</Real>
+    <Real Name="Cell 6 5 0">1.6396472616472288e-05</Real>
+    <Real Name="Cell 6 5 1">0.00023205348902448984</Real>
+    <Real Name="Cell 6 5 10">5.96743699501574e-05</Real>
+    <Real Name="Cell 6 5 2">0.001990997708296922</Real>
+    <Real Name="Cell 6 5 3">0.034602716321019668</Real>
+    <Real Name="Cell 6 5 4">0.16179540654780275</Real>
+    <Real Name="Cell 6 5 5">0.11863014090461818</Real>
+    <Real Name="Cell 6 5 6">0.0085135403850301623</Real>
+    <Real Name="Cell 6 5 7">1.5807423231068199e-05</Real>
+    <Real Name="Cell 6 5 8">7.1089095250295752e-07</Real>
+    <Real Name="Cell 6 5 9">2.7097528583694584e-05</Real>
+    <Real Name="Cell 6 6 0">0.00021429509529400956</Real>
+    <Real Name="Cell 6 6 1">0.017630868154979922</Real>
+    <Real Name="Cell 6 6 10">0.00018059263753674208</Real>
+    <Real Name="Cell 6 6 2">0.060174469001166922</Real>
+    <Real Name="Cell 6 6 3">0.095100125373405134</Real>
+    <Real Name="Cell 6 6 4">0.60456394409670589</Real>
+    <Real Name="Cell 6 6 5">0.50060502742307966</Real>
+    <Real Name="Cell 6 6 6">0.036445059221526251</Real>
+    <Real Name="Cell 6 6 7">5.37636980947593e-05</Real>
+    <Real Name="Cell 6 6 8">2.1513703826407522e-06</Real>
+    <Real Name="Cell 6 6 9">8.2005292418571343e-05</Real>
+    <Real Name="Cell 6 7 0">0.00053316390534166472</Real>
+    <Real Name="Cell 6 7 1">0.05335598970762679</Real>
+    <Real Name="Cell 6 7 10">5.9673807901349731e-05</Real>
+    <Real Name="Cell 6 7 2">0.18148172267598461</Real>
+    <Real Name="Cell 6 7 3">0.099598782295309621</Real>
+    <Real Name="Cell 6 7 4">0.27959541735444116</Real>
+    <Real Name="Cell 6 7 5">0.23193886550615328</Real>
+    <Real Name="Cell 6 7 6">0.016793788683833303</Real>
+    <Real Name="Cell 6 7 7">1.9928515040840058e-05</Real>
+    <Real Name="Cell 6 7 8">7.1088425690797147e-07</Real>
+    <Real Name="Cell 6 7 9">2.7097273363008653e-05</Real>
+    <Real Name="Cell 6 8 0">0.00017168967930050437</Real>
+    <Real Name="Cell 6 8 1">0.017630650848171565</Real>
+    <Real Name="Cell 6 8 10">7.8517260683931051e-07</Real>
+    <Real Name="Cell 6 8 2">0.05996475648638866</Real>
+    <Real Name="Cell 6 8 3">0.023108395611492947</Real>
+    <Real Name="Cell 6 8 4">0.0079994069118838572</Real>
+    <Real Name="Cell 6 8 5">0.006340722447411404</Real>
+    <Real Name="Cell 6 8 6">0.00045464336680280028</Real>
+    <Real Name="Cell 6 8 7">3.4313525080816315e-07</Real>
+    <Real Name="Cell 6 8 8">9.3536321007065007e-09</Real>
+    <Real Name="Cell 6 8 9">3.5653894921275306e-07</Real>
+    <Real Name="Cell 6 9 0">2.2598666876396731e-06</Real>
+    <Real Name="Cell 6 9 1">0.00025655519153948544</Real>
+    <Real Name="Cell 6 9 2">0.0009817530230581521</Real>
+    <Real Name="Cell 6 9 3">0.0004408145560120188</Real>
+    <Real Name="Cell 6 9 4">1.4407031242653609e-05</Real>
+    <Real Name="Cell 7 10 0">9.417616732444329e-11</Real>
+    <Real Name="Cell 7 10 1">7.1417001319292355e-07</Real>
+    <Real Name="Cell 7 10 2">5.6017471593440044e-06</Real>
+    <Real Name="Cell 7 10 3">4.3116389472923664e-06</Real>
+    <Real Name="Cell 7 10 4">2.7236192365171194e-07</Real>
+    <Real Name="Cell 7 11 0">3.6075852189270068e-10</Real>
+    <Real Name="Cell 7 11 1">2.7357549755871065e-06</Real>
+    <Real Name="Cell 7 11 2">2.1458486606908898e-05</Real>
+    <Real Name="Cell 7 11 3">1.6516498151825687e-05</Real>
+    <Real Name="Cell 7 11 4">1.0433306832071701e-06</Real>
+    <Real Name="Cell 7 12 0">1.4976493541210618e-10</Real>
+    <Real Name="Cell 7 12 1">1.1357186105336493e-06</Real>
+    <Real Name="Cell 7 12 2">8.9082548732725608e-06</Real>
+    <Real Name="Cell 7 12 3">6.8566426815498987e-06</Real>
+    <Real Name="Cell 7 12 4">4.3312726630603258e-07</Real>
+    <Real Name="Cell 7 13 0">3.2866339912539245e-12</Real>
+    <Real Name="Cell 7 13 1">2.492366707606405e-08</Real>
+    <Real Name="Cell 7 13 2">1.9549418018768319e-07</Real>
+    <Real Name="Cell 7 13 3">1.5047096866201918e-07</Real>
+    <Real Name="Cell 7 13 4">9.5051007237654569e-09</Real>
+    <Real Name="Cell 7 2 2">1.5824445019438774e-10</Real>
+    <Real Name="Cell 7 2 3">2.2798947436741577e-09</Real>
+    <Real Name="Cell 7 2 4">2.7744528890345081e-09</Real>
+    <Real Name="Cell 7 2 5">3.2566259353020388e-10</Real>
+    <Real Name="Cell 7 2 6">1.5140227463804852e-14</Real>
+    <Real Name="Cell 7 3 2">4.7134565129665686e-09</Real>
+    <Real Name="Cell 7 3 3">6.7908762141412058e-08</Real>
+    <Real Name="Cell 7 3 4">8.2639631428934694e-08</Real>
+    <Real Name="Cell 7 3 5">9.7001599147327556e-09</Real>
+    <Real Name="Cell 7 3 6">4.5096560201260841e-13</Real>
+    <Real Name="Cell 7 4 2">9.2204302934674245e-09</Real>
+    <Real Name="Cell 7 4 3">3.722633554063567e-06</Real>
+    <Real Name="Cell 7 4 4">3.1186802917091703e-05</Real>
+    <Real Name="Cell 7 4 5">2.5794980566283604e-05</Real>
+    <Real Name="Cell 7 4 6">1.8169870306999936e-06</Real>
+    <Real Name="Cell 7 5 0">1.5128749607123834e-08</Real>
+    <Real Name="Cell 7 5 1">1.5552422060434383e-06</Real>
+    <Real Name="Cell 7 5 2">5.3207630150312277e-06</Real>
+    <Real Name="Cell 7 5 3">0.00077902940276503442</Real>
+    <Real Name="Cell 7 5 4">0.0067126009639382738</Real>
+    <Real Name="Cell 7 5 5">0.0055764797454387303</Real>
+    <Real Name="Cell 7 5 6">0.00039308923379469585</Real>
+    <Real Name="Cell 7 6 0">1.149784740992458e-06</Real>
+    <Real Name="Cell 7 6 1">0.00011819838410268673</Real>
+    <Real Name="Cell 7 6 2">0.00040213864420885154</Real>
+    <Real Name="Cell 7 6 3">0.0035096071237953508</Real>
+    <Real Name="Cell 7 6 4">0.029033306212592931</Real>
+    <Real Name="Cell 7 6 5">0.024117450841427791</Real>
+    <Real Name="Cell 7 6 6">0.0017000540105888611</Real>
+    <Real Name="Cell 7 7 0">3.4796114336337115e-06</Real>
+    <Real Name="Cell 7 7 1">0.00035770560705626522</Real>
+    <Real Name="Cell 7 7 2">0.0012166740486485661</Real>
+    <Real Name="Cell 7 7 3">0.0020113925291494706</Real>
+    <Real Name="Cell 7 7 4">0.013487672213987152</Real>
+    <Real Name="Cell 7 7 5">0.01119850893059283</Real>
+    <Real Name="Cell 7 7 6">0.00078938981378719251</Real>
+    <Real Name="Cell 7 8 0">1.1497845542785223e-06</Real>
+    <Real Name="Cell 7 8 1">0.00011819836490841088</Real>
+    <Real Name="Cell 7 8 2">0.00040201357626689033</Real>
+    <Real Name="Cell 7 8 3">0.00019173837051812416</Real>
+    <Real Name="Cell 7 8 4">0.00037165171663785244</Real>
+    <Real Name="Cell 7 8 5">0.00030662024662803062</Real>
+    <Real Name="Cell 7 8 6">2.1613850637548296e-05</Real>
+    <Real Name="Cell 7 9 0">1.5129390330565356e-08</Real>
+    <Real Name="Cell 7 9 1">1.5601645178667451e-06</Real>
+    <Real Name="Cell 7 9 2">5.3282461478527664e-06</Real>
+    <Real Name="Cell 7 9 3">1.9904200548264883e-06</Real>
+    <Real Name="Cell 7 9 4">3.5637343175257864e-08</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_6.xml b/src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_6.xml
new file mode 100644 (file)
index 0000000..dfb0aa0
--- /dev/null
@@ -0,0 +1,561 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">39</Int>
+      <Real>0.036090455589515444</Real>
+      <Real>0.69648414270597081</Real>
+      <Real>0.26742540170451373</Real>
+      <Real>0.18259480726201247</Real>
+      <Real>0.73911958987718629</Real>
+      <Real>0.078285602860801204</Real>
+      <Real>0.18282127502653051</Real>
+      <Real>0.73904129300301158</Real>
+      <Real>0.07813743197045793</Real>
+      <Real>0.02177213641407599</Real>
+      <Real>0.66512837230808042</Real>
+      <Real>0.31309949127784359</Real>
+      <Real>0.088180370703606098</Real>
+      <Real>0.74359251957216421</Real>
+      <Real>0.16822710972422975</Real>
+      <Real>0.1357364132155662</Real>
+      <Real>0.74955771627354661</Real>
+      <Real>0.11470587051088713</Real>
+      <Real>0.2383247396874062</Real>
+      <Real>0.71374857926586222</Real>
+      <Real>0.047926681046731583</Real>
+      <Real>0.0038522301444038455</Real>
+      <Real>0.58007059475992295</Real>
+      <Real>0.41607717509567321</Real>
+      <Real>0.025951435289900862</Real>
+      <Real>0.67591914455438529</Real>
+      <Real>0.29812942015571386</Real>
+      <Real>0.13200413949930864</Real>
+      <Real>0.74980908057442919</Real>
+      <Real>0.11818677992626223</Real>
+      <Real>0.20127801669320952</Real>
+      <Real>0.73191700259416459</Real>
+      <Real>0.066804980712625833</Real>
+      <Real>0.016581614822692537</Real>
+      <Real>0.64894451221471561</Real>
+      <Real>0.33447387296259184</Real>
+      <Real>0.052315161615281575</Real>
+      <Real>0.71883578508770118</Real>
+      <Real>0.22884905329701719</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">39</Int>
+      <Real>0.0015578001757111505</Real>
+      <Real>0.5527019627575338</Real>
+      <Real>0.44574023706675503</Real>
+      <Real>0.49203512289596113</Real>
+      <Real>0.50793290228368859</Real>
+      <Real>3.1974820350303207e-05</Real>
+      <Real>0.30128157916062442</Real>
+      <Real>0.67368625927676062</Real>
+      <Real>0.025032161562614976</Real>
+      <Real>0.007465335582521662</Real>
+      <Real>0.60726045439259824</Real>
+      <Real>0.3852742100248801</Real>
+      <Real>0.27952824743682397</Real>
+      <Real>0.68864431084589117</Real>
+      <Real>0.031827441717284875</Real>
+      <Real>0.15426655549059071</Real>
+      <Real>0.74692445803843455</Real>
+      <Real>0.098808986470974761</Real>
+      <Real>0.14169664987958924</Real>
+      <Real>0.74895367333184837</Real>
+      <Real>0.10934967678856237</Real>
+      <Real>0.083426634674385811</Real>
+      <Real>0.74162349785931769</Real>
+      <Real>0.17494986746629645</Real>
+      <Real>0.012535251765837658</Real>
+      <Real>0.63326617425232812</Real>
+      <Real>0.35419857398183424</Real>
+      <Real>0.02716938719551423</Real>
+      <Real>0.6787680131356939</Real>
+      <Real>0.29406259966879189</Real>
+      <Real>0.21968820016588803</Real>
+      <Real>0.7234783351357893</Real>
+      <Real>0.056833464698322671</Real>
+      <Real>0.021448711607312865</Real>
+      <Real>0.66421950804553398</Real>
+      <Real>0.31433178034715314</Real>
+      <Real>0.34943592393514256</Real>
+      <Real>0.63711370695125913</Real>
+      <Real>0.013450369113598334</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">39</Int>
+      <Real>0.022015595113395979</Real>
+      <Real>0.66580491302236766</Real>
+      <Real>0.31217949186423638</Real>
+      <Real>0.1526054876007322</Real>
+      <Real>0.74724805061082555</Real>
+      <Real>0.1001464617884423</Real>
+      <Real>0.23929588540952862</Real>
+      <Real>0.71321150383281751</Real>
+      <Real>0.047492610757653875</Real>
+      <Real>0.20124826514116861</Real>
+      <Real>0.73192961221364883</Real>
+      <Real>0.066822122645182544</Real>
+      <Real>0.043536694275114363</Real>
+      <Real>0.70800861454421404</Real>
+      <Real>0.24845469118067159</Real>
+      <Real>0.41241064286055051</Real>
+      <Real>0.58337543620708399</Real>
+      <Real>0.0042139209323654933</Real>
+      <Real>0.076754913733512689</Real>
+      <Real>0.73829347454436067</Real>
+      <Real>0.18495161172212665</Real>
+      <Real>0.33324912758583197</Real>
+      <Real>0.64989518868470608</Real>
+      <Real>0.016855683729461973</Real>
+      <Real>0.193013961710223</Real>
+      <Real>0.73528353102124222</Real>
+      <Real>0.07170250726853479</Real>
+      <Real>0.15170115356515579</Real>
+      <Real>0.74741736130057479</Real>
+      <Real>0.10088148513426944</Real>
+      <Real>0.024127918118492662</Real>
+      <Real>0.67141627450305674</Real>
+      <Real>0.30445580737845057</Real>
+      <Real>0.42440740434438973</Real>
+      <Real>0.57249665259278926</Real>
+      <Real>0.0030959430628210299</Real>
+      <Real>0.1590110177845997</Real>
+      <Real>0.74591238931475767</Real>
+      <Real>0.095076592900642645</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">39</Int>
+      <Real>-0.26866505388500173</Real>
+      <Real>-0.46266989222999655</Real>
+      <Real>0.73133494611499827</Real>
+      <Real>-0.60430920440121128</Real>
+      <Real>0.20861840880242255</Real>
+      <Real>0.39569079559878872</Real>
+      <Real>-0.60468384305607259</Real>
+      <Real>0.20936768611214518</Real>
+      <Real>0.39531615694392741</Real>
+      <Real>-0.2086726451362324</Real>
+      <Real>-0.58265470972753519</Real>
+      <Real>0.7913273548637676</Real>
+      <Real>-0.41995326097937635</Real>
+      <Real>-0.16009347804124729</Real>
+      <Real>0.58004673902062365</Real>
+      <Real>-0.52103054270467908</Real>
+      <Real>0.042061085409358157</Real>
+      <Real>0.47896945729532092</Real>
+      <Real>-0.69039805864067461</Real>
+      <Real>0.38079611728134921</Real>
+      <Real>0.30960194135932539</Real>
+      <Real>-0.087775055048730621</Real>
+      <Real>-0.82444988990253876</Real>
+      <Real>0.91222494495126938</Real>
+      <Real>-0.22782201513418698</Real>
+      <Real>-0.54435596973162603</Real>
+      <Real>0.77217798486581302</Real>
+      <Real>-0.51381735957304642</Real>
+      <Real>0.027634719146092834</Real>
+      <Real>0.48618264042695358</Real>
+      <Real>-0.63447303598058369</Real>
+      <Real>0.26894607196116738</Real>
+      <Real>0.36552696401941631</Real>
+      <Real>-0.1821077418601007</Real>
+      <Real>-0.63578451627979859</Real>
+      <Real>0.8178922581398993</Real>
+      <Real>-0.32346610831826439</Real>
+      <Real>-0.35306778336347122</Real>
+      <Real>0.67653389168173561</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">39</Int>
+      <Real>-0.055817563108956136</Real>
+      <Real>-0.88836487378208773</Real>
+      <Real>0.94418243689104386</Real>
+      <Real>-0.99200314807561085</Real>
+      <Real>0.9840062961512217</Real>
+      <Real>0.0079968519243891478</Real>
+      <Real>-0.77624941759800947</Real>
+      <Real>0.55249883519601894</Real>
+      <Real>0.22375058240199053</Real>
+      <Real>-0.12219112555764156</Real>
+      <Real>-0.75561774888471689</Real>
+      <Real>0.87780887444235844</Real>
+      <Real>-0.74770080571953912</Real>
+      <Real>0.49540161143907824</Real>
+      <Real>0.25229919428046088</Real>
+      <Real>-0.55545756901961596</Real>
+      <Real>0.11091513803923192</Real>
+      <Real>0.44454243098038404</Real>
+      <Real>-0.53234697309102685</Real>
+      <Real>0.064693946182053708</Real>
+      <Real>0.46765302690897315</Real>
+      <Real>-0.40847676720808934</Real>
+      <Real>-0.18304646558382132</Real>
+      <Real>0.59152323279191066</Real>
+      <Real>-0.1583366777840034</Real>
+      <Real>-0.6833266444319932</Real>
+      <Real>0.8416633222159966</Real>
+      <Real>-0.23310678752672231</Real>
+      <Real>-0.53378642494655537</Real>
+      <Real>0.76689321247327769</Real>
+      <Real>-0.66285473546756535</Real>
+      <Real>0.3257094709351307</Real>
+      <Real>0.33714526453243465</Real>
+      <Real>-0.20711693126015973</Real>
+      <Real>-0.58576613747968054</Real>
+      <Real>0.79288306873984027</Real>
+      <Real>-0.83598555482154424</Real>
+      <Real>0.67197110964308848</Real>
+      <Real>0.16401444517845576</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">39</Int>
+      <Real>-0.20983610324915958</Real>
+      <Real>-0.58032779350168084</Real>
+      <Real>0.79016389675084042</Real>
+      <Real>-0.55245902581228989</Real>
+      <Real>0.10491805162457979</Real>
+      <Real>0.44754097418771011</Real>
+      <Real>-0.69180327465187474</Real>
+      <Real>0.38360654930374949</Real>
+      <Real>0.30819672534812526</Real>
+      <Real>-0.63442614249598606</Real>
+      <Real>0.26885228499197211</Real>
+      <Real>0.36557385750401394</Real>
+      <Real>-0.29508200309444277</Real>
+      <Real>-0.40983599381111446</Real>
+      <Real>0.70491799690555723</Real>
+      <Real>-0.90819672192818501</Real>
+      <Real>0.81639344385637003</Real>
+      <Real>0.091803278071814987</Real>
+      <Real>-0.39180330201138602</Real>
+      <Real>-0.21639339597722795</Real>
+      <Real>0.60819669798861398</Real>
+      <Real>-0.81639344385637003</Real>
+      <Real>0.63278688771274005</Real>
+      <Real>0.18360655614362997</Real>
+      <Real>-0.62131145444168823</Real>
+      <Real>0.24262290888337645</Real>
+      <Real>0.37868854555831177</Real>
+      <Real>-0.55081966843088637</Real>
+      <Real>0.10163933686177273</Real>
+      <Real>0.44918033156911363</Real>
+      <Real>-0.21967211074004211</Real>
+      <Real>-0.56065577851991577</Real>
+      <Real>0.78032788925995789</Real>
+      <Real>-0.92131146128156871</Real>
+      <Real>0.84262292256313742</Real>
+      <Real>0.078688538718431289</Real>
+      <Real>-0.56393442488395706</Real>
+      <Real>0.12786884976791413</Real>
+      <Real>0.43606557511604294</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Int Name="X">15</Int>
+      <Int Name="Y">1</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">2</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">1</Int>
+      <Int Name="Z">4</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">13</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">2</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">7</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">1</Int>
+      <Int Name="Y">11</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">10</Int>
+      <Int Name="Z">13</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">2</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">15</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">1</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 1 1">2.5797474023194253e-05</Real>
+    <Real Name="Cell 0 1 2">0.0007801780901102414</Real>
+    <Real Name="Cell 0 1 3">0.00036580625190737114</Real>
+    <Real Name="Cell 0 1 4">0.0035520662581957122</Real>
+    <Real Name="Cell 0 1 5">0.057764916517143869</Real>
+    <Real Name="Cell 0 1 6">0.02027088964670782</Real>
+    <Real Name="Cell 0 2 1">0.0091528520468274425</Real>
+    <Real Name="Cell 0 2 2">0.27680441203410755</Real>
+    <Real Name="Cell 0 2 3">0.12978675735858289</Real>
+    <Real Name="Cell 0 2 4">0.0087508516326493032</Real>
+    <Real Name="Cell 0 2 5">0.14230934258266517</Real>
+    <Real Name="Cell 0 2 6">0.049939256440067588</Real>
+    <Real Name="Cell 0 3 1">0.041407805893118807</Real>
+    <Real Name="Cell 0 3 2">0.26913490493268388</Real>
+    <Real Name="Cell 0 3 3">0.10491796958061207</Real>
+    <Real Name="Cell 0 3 4">0.00040444278116904555</Real>
+    <Real Name="Cell 0 3 5">0.0065771868518180567</Real>
+    <Real Name="Cell 0 3 6">0.0023080692727983467</Real>
+    <Real Name="Cell 0 4 1">1.0682172328334281</Real>
+    <Real Name="Cell 0 4 2">1.4646071359710569</Real>
+    <Real Name="Cell 0 4 3">0.010564124651040705</Real>
+    <Real Name="Cell 0 5 1">0.53107624953265142</Real>
+    <Real Name="Cell 0 5 2">0.76927967298649325</Real>
+    <Real Name="Cell 0 5 3">0.010071897180004931</Real>
+    <Real Name="Cell 0 6 1">0.001204628163136146</Real>
+    <Real Name="Cell 0 6 2">0.003590344490542938</Real>
+    <Real Name="Cell 0 6 3">0.00023908031833318956</Real>
+    <Real Name="Cell 1 0 0">0.019349343136229973</Real>
+    <Real Name="Cell 1 0 1">0.073711006282066616</Real>
+    <Real Name="Cell 1 0 2">0.0071880624830126987</Real>
+    <Real Name="Cell 1 1 0">0.010822478801160527</Real>
+    <Real Name="Cell 1 1 1">0.041237961348894979</Real>
+    <Real Name="Cell 1 1 2">0.0043199895999238456</Real>
+    <Real Name="Cell 1 1 3">0.0001404567281062272</Real>
+    <Real Name="Cell 1 1 4">0.029953263720074206</Real>
+    <Real Name="Cell 1 1 5">0.48711022048472935</Real>
+    <Real Name="Cell 1 1 6">0.17093693059002246</Real>
+    <Real Name="Cell 1 11 0">0.00038301254287360795</Real>
+    <Real Name="Cell 1 11 1">0.0014590800191560194</Real>
+    <Real Name="Cell 1 11 2">0.0001422848347134895</Real>
+    <Real Name="Cell 1 2 1">0.0035143730995152579</Real>
+    <Real Name="Cell 1 2 2">0.10628315354633035</Real>
+    <Real Name="Cell 1 2 3">0.049833547663694334</Real>
+    <Real Name="Cell 1 2 4">0.073792701958529855</Real>
+    <Real Name="Cell 1 2 5">1.2000421609179603</Real>
+    <Real Name="Cell 1 2 6">0.42111931743457376</Real>
+    <Real Name="Cell 1 3 1">0.020371801103436751</Real>
+    <Real Name="Cell 1 3 2">0.10937164714289969</Real>
+    <Real Name="Cell 1 3 3">0.040317435195201638</Real>
+    <Real Name="Cell 1 3 4">0.0034105166974532273</Real>
+    <Real Name="Cell 1 3 5">0.055462989141644582</Real>
+    <Real Name="Cell 1 3 6">0.019463096290170498</Real>
+    <Real Name="Cell 1 4 1">0.60170900531440941</Real>
+    <Real Name="Cell 1 4 2">0.90728766137964656</Real>
+    <Real Name="Cell 1 4 3">0.015593921061816004</Real>
+    <Real Name="Cell 1 5 1">0.38806872374325674</Real>
+    <Real Name="Cell 1 5 2">0.73729836237251578</Real>
+    <Real Name="Cell 1 5 3">0.027885133861340006</Real>
+    <Real Name="Cell 1 6 1">0.0048696190043679907</Real>
+    <Real Name="Cell 1 6 2">0.014513698333150976</Real>
+    <Real Name="Cell 1 6 3">0.00096646425623544768</Real>
+    <Real Name="Cell 13 3 0">0.02417998570750084</Real>
+    <Real Name="Cell 13 3 1">0.034203796516386366</Real>
+    <Real Name="Cell 13 3 2">0.00024706575759149223</Real>
+    <Real Name="Cell 13 4 0">0.11707412966158916</Real>
+    <Real Name="Cell 13 4 1">0.16560719914056177</Real>
+    <Real Name="Cell 13 4 2">0.0011962376193726339</Real>
+    <Real Name="Cell 13 5 0">0.015487477976304072</Real>
+    <Real Name="Cell 13 5 1">0.021907810519887643</Real>
+    <Real Name="Cell 13 5 2">0.00015824763197482477</Real>
+    <Real Name="Cell 14 3 0">0.1335256651997847</Real>
+    <Real Name="Cell 14 3 1">0.18887871719427107</Real>
+    <Real Name="Cell 14 3 2">0.0013643357787535453</Real>
+    <Real Name="Cell 14 4 0">0.64650166587568469</Real>
+    <Real Name="Cell 14 4 1">0.91450887087402799</Real>
+    <Real Name="Cell 14 4 2">0.0066058113431468526</Real>
+    <Real Name="Cell 14 5 0">0.085524277146760794</Real>
+    <Real Name="Cell 14 5 1">0.12097835822257741</Real>
+    <Real Name="Cell 14 5 2">0.00087386818922620174</Real>
+    <Real Name="Cell 15 1 1">1.3367750009906849e-06</Real>
+    <Real Name="Cell 15 1 2">4.0427313396743701e-05</Real>
+    <Real Name="Cell 15 1 3">1.8955369518590044e-05</Real>
+    <Real Name="Cell 15 2 1">0.00047428301673895304</Real>
+    <Real Name="Cell 15 2 2">0.014343467032409222</Real>
+    <Real Name="Cell 15 2 3">0.0067252976993254898</Real>
+    <Real Name="Cell 15 3 0">0.020433620159941126</Real>
+    <Real Name="Cell 15 3 1">0.030156300536097254</Real>
+    <Real Name="Cell 15 3 2">0.012949230487125235</Real>
+    <Real Name="Cell 15 3 3">0.0054301257607806469</Real>
+    <Real Name="Cell 15 4 0">0.09893505831637088</Real>
+    <Real Name="Cell 15 4 1">0.1668728452989488</Real>
+    <Real Name="Cell 15 4 2">0.037329898211844563</Real>
+    <Real Name="Cell 15 4 3">0.00019640562194681352</Real>
+    <Real Name="Cell 15 5 0">0.013087900300333131</Real>
+    <Real Name="Cell 15 5 1">0.031254988413792179</Real>
+    <Real Name="Cell 15 5 2">0.017321144433225886</Real>
+    <Real Name="Cell 15 5 3">9.2945973535754072e-05</Real>
+    <Real Name="Cell 2 0 0">0.58694086273196078</Real>
+    <Real Name="Cell 2 0 1">1.9310426184393541</Real>
+    <Real Name="Cell 2 0 13">0.016841557142288337</Real>
+    <Real Name="Cell 2 0 2">0.18721696855095113</Real>
+    <Real Name="Cell 2 1 0">0.29696384581386692</Real>
+    <Real Name="Cell 2 1 1">1.1445771610757201</Real>
+    <Real Name="Cell 2 1 2">0.11373484937937912</Real>
+    <Real Name="Cell 2 1 4">0.0067764949885925985</Real>
+    <Real Name="Cell 2 1 5">0.11020167948492346</Real>
+    <Real Name="Cell 2 1 6">0.038672021330763293</Real>
+    <Real Name="Cell 2 10 0">0.0076664903300319356</Real>
+    <Real Name="Cell 2 10 1">0.0010347724983472929</Real>
+    <Real Name="Cell 2 10 13">0.0015560455069416677</Real>
+    <Real Name="Cell 2 11 0">0.20150634558713815</Real>
+    <Real Name="Cell 2 11 1">0.063854065928642068</Real>
+    <Real Name="Cell 2 11 13">0.038874410729068672</Real>
+    <Real Name="Cell 2 11 2">0.003705885346543055</Real>
+    <Real Name="Cell 2 2 0">0.056417829346471646</Real>
+    <Real Name="Cell 2 2 1">0.27647027453863693</Real>
+    <Real Name="Cell 2 2 2">0.038482666424098783</Real>
+    <Real Name="Cell 2 2 4">0.016694537185994698</Real>
+    <Real Name="Cell 2 2 5">0.27149227428296563</Real>
+    <Real Name="Cell 2 2 6">0.095272187059950025</Real>
+    <Real Name="Cell 2 3 0">0.031004836149050478</Real>
+    <Real Name="Cell 2 3 1">0.17103507381595617</Real>
+    <Real Name="Cell 2 3 2">0.030399888552461542</Real>
+    <Real Name="Cell 2 3 4">0.00077158033678027241</Real>
+    <Real Name="Cell 2 3 5">0.012547703364920297</Real>
+    <Real Name="Cell 2 3 6">0.0044032455262777897</Real>
+    <Real Name="Cell 2 4 0">6.8103856373110224e-05</Real>
+    <Real Name="Cell 2 4 1">0.00804913833139362</Real>
+    <Real Name="Cell 2 4 2">0.019306059718609787</Real>
+    <Real Name="Cell 2 4 3">0.0012298452032841604</Real>
+    <Real Name="Cell 2 5 1">0.013856219323555284</Real>
+    <Real Name="Cell 2 5 2">0.041297889448778206</Real>
+    <Real Name="Cell 2 5 3">0.0027500181617418204</Real>
+    <Real Name="Cell 2 6 1">0.0005148555666351683</Real>
+    <Real Name="Cell 2 6 2">0.0015345057534447018</Real>
+    <Real Name="Cell 2 6 3">0.00010218242984315733</Real>
+    <Real Name="Cell 2 7 0">0.00054513462395007701</Real>
+    <Real Name="Cell 2 7 1">0.0010631096677045397</Real>
+    <Real Name="Cell 2 7 2">2.7572815802541165e-05</Real>
+    <Real Name="Cell 2 8 0">0.004845990110904066</Real>
+    <Real Name="Cell 2 8 1">0.0094505443429227249</Real>
+    <Real Name="Cell 2 8 2">0.0002451093488443149</Real>
+    <Real Name="Cell 2 9 0">0.0011431748455824604</Real>
+    <Real Name="Cell 2 9 1">0.0022293946794446433</Real>
+    <Real Name="Cell 2 9 2">5.7821587663876302e-05</Real>
+    <Real Name="Cell 3 0 0">0.69360889878227783</Real>
+    <Real Name="Cell 3 0 1">0.91040637793099377</Real>
+    <Real Name="Cell 3 0 13">0.095663306652342267</Real>
+    <Real Name="Cell 3 0 2">0.082576276655402028</Real>
+    <Real Name="Cell 3 1 0">0.33162478626599567</Real>
+    <Real Name="Cell 3 1 1">1.446043578060217</Real>
+    <Real Name="Cell 3 1 2">0.170134206887115</Real>
+    <Real Name="Cell 3 10 0">0.04354715001664098</Real>
+    <Real Name="Cell 3 10 1">0.0058777082183362308</Real>
+    <Real Name="Cell 3 10 13">0.0088386398738504249</Real>
+    <Real Name="Cell 3 11 0">1.0923308142069499</Real>
+    <Real Name="Cell 3 11 1">0.16360362246020402</Real>
+    <Real Name="Cell 3 11 13">0.22081418262484387</Real>
+    <Real Name="Cell 3 11 2">0.0016345645162289698</Real>
+    <Real Name="Cell 3 2 0">0.50999022695333962</Real>
+    <Real Name="Cell 3 2 1">2.5122011878832065</Real>
+    <Real Name="Cell 3 2 2">0.35027008991016406</Real>
+    <Real Name="Cell 3 3 0">0.21065780466812811</Real>
+    <Real Name="Cell 3 3 1">1.4774930885137767</Real>
+    <Real Name="Cell 3 3 2">0.31499733311583844</Real>
+    <Real Name="Cell 3 3 3">4.4856017500429612e-05</Real>
+    <Real Name="Cell 3 4 0">0.011910102317287511</Real>
+    <Real Name="Cell 3 4 1">0.12990084340822095</Real>
+    <Real Name="Cell 3 4 2">0.071111330073043141</Real>
+    <Real Name="Cell 3 4 3">0.0036487690698496721</Real>
+    <Real Name="Cell 3 5 1">0.0069719328295118951</Real>
+    <Real Name="Cell 3 5 2">0.025356561899824073</Real>
+    <Real Name="Cell 3 5 3">0.002314948406043751</Real>
+    <Real Name="Cell 3 7 0">0.082086623510362583</Real>
+    <Real Name="Cell 3 7 1">0.16008354488795243</Real>
+    <Real Name="Cell 3 7 2">0.0041519273413663212</Real>
+    <Real Name="Cell 3 8 0">0.7297114296030327</Real>
+    <Real Name="Cell 3 8 1">1.4230673330273156</Real>
+    <Real Name="Cell 3 8 2">0.036908678982195769</Real>
+    <Real Name="Cell 3 9 0">0.17213979636053725</Real>
+    <Real Name="Cell 3 9 1">0.335703280744716</Real>
+    <Real Name="Cell 3 9 2">0.008706801382277838</Real>
+    <Real Name="Cell 4 0 0">0.074291288586959311</Real>
+    <Real Name="Cell 4 0 1">0.010027350063356486</Real>
+    <Real Name="Cell 4 0 13">0.01507868931338798</Real>
+    <Real Name="Cell 4 1 0">0.065995033097346487</Real>
+    <Real Name="Cell 4 1 1">0.30957925750297188</Real>
+    <Real Name="Cell 4 1 2">0.039460051150421262</Real>
+    <Real Name="Cell 4 10 0">0.0068640105445105931</Real>
+    <Real Name="Cell 4 10 1">0.00092645904893429924</Real>
+    <Real Name="Cell 4 10 13">0.0013931684913951292</Real>
+    <Real Name="Cell 4 11 0">0.17148236601409761</Real>
+    <Real Name="Cell 4 11 1">0.023145563180039061</Real>
+    <Real Name="Cell 4 11 13">0.034805282948142918</Real>
+    <Real Name="Cell 4 2 0">0.17795321010669471</Real>
+    <Real Name="Cell 4 2 1">1.0622806245370715</Real>
+    <Real Name="Cell 4 2 2">0.19013223348046562</Real>
+    <Real Name="Cell 4 3 0">0.25471021463831761</Real>
+    <Real Name="Cell 4 3 1">2.3868328005936488</Real>
+    <Real Name="Cell 4 3 2">0.60478691865321432</Real>
+    <Real Name="Cell 4 3 3">0.0013703299180596153</Real>
+    <Real Name="Cell 4 4 0">0.03494787133213529</Real>
+    <Real Name="Cell 4 4 1">0.67226341940984968</Real>
+    <Real Name="Cell 4 4 2">1.3053903497833907</Real>
+    <Real Name="Cell 4 4 3">0.11146815297318073</Real>
+    <Real Name="Cell 4 5 1">0.21298921918091981</Real>
+    <Real Name="Cell 4 5 2">0.77463085950790644</Real>
+    <Real Name="Cell 4 5 3">0.070720568528755093</Real>
+    <Real Name="Cell 4 7 0">0.058879679011257922</Real>
+    <Real Name="Cell 4 7 1">0.11482586729611367</Real>
+    <Real Name="Cell 4 7 2">0.0029781240680079066</Real>
+    <Real Name="Cell 4 8 0">0.52341262082059925</Real>
+    <Real Name="Cell 4 8 1">1.0207478904218499</Real>
+    <Real Name="Cell 4 8 2">0.026474120609028446</Real>
+    <Real Name="Cell 4 9 0">0.12347366137543997</Real>
+    <Real Name="Cell 4 9 1">0.24079564450327059</Real>
+    <Real Name="Cell 4 9 2">0.0062452766197476578</Real>
+    <Real Name="Cell 5 2 0">0.0030388668685303035</Real>
+    <Real Name="Cell 5 2 1">0.029230383696795037</Real>
+    <Real Name="Cell 5 2 2">0.0073225712570666674</Real>
+    <Real Name="Cell 5 3 0">0.016062274626014745</Real>
+    <Real Name="Cell 5 3 1">0.15644323644182084</Real>
+    <Real Name="Cell 5 3 2">0.04576991184270697</Real>
+    <Real Name="Cell 5 3 3">0.00064506284514434086</Real>
+    <Real Name="Cell 5 4 0">0.002345144434675343</Real>
+    <Real Name="Cell 5 4 1">0.18058758771061995</Real>
+    <Real Name="Cell 5 4 2">0.58039799171281714</Real>
+    <Real Name="Cell 5 4 3">0.052472009077697473</Real>
+    <Real Name="Cell 5 5 1">0.10026157197564638</Real>
+    <Real Name="Cell 5 5 2">0.3646461918297238</Real>
+    <Real Name="Cell 5 5 3">0.03329067733555785</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_7.xml b/src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_7.xml
new file mode 100644 (file)
index 0000000..04b1be5
--- /dev/null
@@ -0,0 +1,582 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">39</Int>
+      <Real>0.05089318151490263</Real>
+      <Real>0.71725338845863429</Real>
+      <Real>0.23185343002646308</Real>
+      <Real>0.012030669800701029</Real>
+      <Real>0.6310558406250385</Real>
+      <Real>0.35691348957426045</Real>
+      <Real>0.14074805168117607</Real>
+      <Real>0.74906596026673178</Real>
+      <Real>0.11018598805209209</Real>
+      <Real>0.12390180576498261</Real>
+      <Real>0.74999515456931432</Real>
+      <Real>0.12610303966570308</Real>
+      <Real>0.048421007610068734</Real>
+      <Real>0.71435248219287506</Real>
+      <Real>0.23722651019705621</Real>
+      <Real>0.4937434649966933</Real>
+      <Real>0.50623683946842246</Real>
+      <Real>1.9695534884260206e-05</Real>
+      <Real>0.0024393502229682756</Real>
+      <Real>0.56496899418986768</Real>
+      <Real>0.43259165558716406</Real>
+      <Real>0.1467372554828546</Real>
+      <Real>0.74825836690465708</Real>
+      <Real>0.10500437761248832</Real>
+      <Real>0.40099473052793144</Real>
+      <Real>0.59354918191598727</Real>
+      <Real>0.0054560875560812957</Real>
+      <Real>0.0011356479385134484</Real>
+      <Real>0.54538681861596261</Real>
+      <Real>0.45347753344552394</Real>
+      <Real>0.018228417474878484</Real>
+      <Real>0.65447989527718753</Real>
+      <Real>0.327291687247934</Real>
+      <Real>0.023382667777312426</Real>
+      <Real>0.66948760790424433</Real>
+      <Real>0.30712972431844326</Real>
+      <Real>0.33752642870877159</Real>
+      <Real>0.64656314621039446</Real>
+      <Real>0.015910425080833981</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">39</Int>
+      <Real>0.030194454142256941</Real>
+      <Real>0.68535263945317304</Real>
+      <Real>0.28445290640456999</Real>
+      <Real>0.01206491498369449</Real>
+      <Real>0.63120796313972638</Real>
+      <Real>0.35672712187657912</Real>
+      <Real>0.00013371589069704963</Real>
+      <Real>0.51608590981578717</Real>
+      <Real>0.48378037429351578</Real>
+      <Real>0.1282394341754734</Real>
+      <Real>0.74995855952237578</Real>
+      <Real>0.12180200630215082</Real>
+      <Real>0.025517545395280731</Real>
+      <Real>0.67487438397878385</Real>
+      <Real>0.29960807062593542</Real>
+      <Real>0.0072278135424509414</Real>
+      <Real>0.60577592902622013</Real>
+      <Real>0.38699625743132893</Real>
+      <Real>0.12708775130249114</Real>
+      <Real>0.74998270927396971</Real>
+      <Real>0.12292953942353911</Real>
+      <Real>0.030096369796856738</Real>
+      <Real>0.68514934728441157</Real>
+      <Real>0.28475428291873167</Real>
+      <Real>0.025157553891160367</Real>
+      <Real>0.67399518574501771</Real>
+      <Real>0.30084726036382192</Real>
+      <Real>0.27893076277274931</Real>
+      <Real>0.68903975678403295</Real>
+      <Real>0.032029480443217746</Real>
+      <Real>0.23739096068816348</Real>
+      <Real>0.71426228720272134</Real>
+      <Real>0.048346752109115224</Real>
+      <Real>0.19640714569586232</Real>
+      <Real>0.73393469456016713</Real>
+      <Real>0.069658159743970549</Real>
+      <Real>0.061593317344401516</Real>
+      <Real>0.72779290130838736</Real>
+      <Real>0.21061378134721118</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">39</Int>
+      <Real>0.17608709093451638</Real>
+      <Real>0.74126847068387636</Real>
+      <Real>0.082644438381607302</Real>
+      <Real>0.2101857747525209</Real>
+      <Real>0.72798911363318541</Real>
+      <Real>0.061825111614293639</Real>
+      <Real>0.47251948092640972</Real>
+      <Real>0.52709218251650869</Real>
+      <Real>0.00038833655708161568</Real>
+      <Real>0.42971002799396185</Real>
+      <Real>0.56762905597320845</Real>
+      <Real>0.0026609160328297157</Real>
+      <Real>0.045988990006773256</Real>
+      <Real>0.71130073670351313</Real>
+      <Real>0.24271027328971362</Real>
+      <Real>0.43047030413140991</Real>
+      <Real>0.56692824468075209</Real>
+      <Real>0.0026014511878380275</Real>
+      <Real>0.13631047718434056</Real>
+      <Real>0.74951021149740771</Real>
+      <Real>0.11417931131825178</Real>
+      <Real>0.36614351063849898</Real>
+      <Real>0.62345068461014941</Real>
+      <Real>0.010405804751351597</Real>
+      <Real>0.24672432328322841</Real>
+      <Real>0.70901035335201301</Real>
+      <Real>0.044265323364758566</Real>
+      <Real>0.093652242762162843</Real>
+      <Real>0.74548239681422868</Real>
+      <Real>0.16086536042360849</Real>
+      <Real>0.074840090544688584</Real>
+      <Real>0.73720504877779824</Real>
+      <Real>0.18795486067751316</Real>
+      <Real>0.011621874147413528</Real>
+      <Real>0.6292152569978321</Real>
+      <Real>0.3591628688547544</Real>
+      <Real>0.21607229169952644</Real>
+      <Real>0.72523246472405656</Real>
+      <Real>0.058695243576417054</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">39</Int>
+      <Real>-0.31903975148843955</Real>
+      <Real>-0.3619204970231209</Real>
+      <Real>0.68096024851156045</Real>
+      <Real>-0.15511718022644061</Real>
+      <Real>-0.68976563954711878</Real>
+      <Real>0.84488281977355939</Real>
+      <Real>-0.53056206362908398</Real>
+      <Real>0.06112412725816796</Real>
+      <Real>0.46943793637091602</Real>
+      <Real>-0.49779876609927953</Real>
+      <Real>-0.0044024678014409346</Real>
+      <Real>0.50220123390072047</Real>
+      <Real>-0.31119449741301253</Real>
+      <Real>-0.37761100517397495</Real>
+      <Real>0.68880550258698747</Real>
+      <Real>-0.99372376946180907</Real>
+      <Real>0.98744753892361814</Real>
+      <Real>0.00627623053819093</Real>
+      <Real>-0.069847694635804203</Real>
+      <Real>-0.86030461072839159</Real>
+      <Real>0.9301523053641958</Real>
+      <Real>-0.54173287787036628</Real>
+      <Real>0.083465755740732561</Real>
+      <Real>0.45826712212963372</Real>
+      <Real>-0.89553864297185015</Real>
+      <Real>0.7910772859437003</Real>
+      <Real>0.10446135702814985</Real>
+      <Real>-0.047658114492989512</Real>
+      <Real>-0.90468377101402098</Real>
+      <Real>0.95234188550701049</Real>
+      <Real>-0.19093673022694446</Real>
+      <Real>-0.61812653954611108</Real>
+      <Real>0.80906326977305554</Real>
+      <Real>-0.21625294345886914</Real>
+      <Real>-0.56749411308226172</Real>
+      <Real>0.78374705654113086</Real>
+      <Real>-0.82161600362793763</Real>
+      <Real>0.64323200725587526</Real>
+      <Real>0.17838399637206237</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">39</Int>
+      <Real>-0.24574154773768697</Real>
+      <Real>-0.50851690452462606</Real>
+      <Real>0.75425845226231303</Real>
+      <Real>-0.15533779310711537</Real>
+      <Real>-0.68932441378576925</Real>
+      <Real>0.84466220689288463</Real>
+      <Real>-0.01635334159718127</Real>
+      <Real>-0.96729331680563746</Real>
+      <Real>0.98364665840281873</Real>
+      <Real>-0.50643742787332258</Real>
+      <Real>0.012874855746645153</Real>
+      <Real>0.49356257212667742</Real>
+      <Real>-0.22590947476934531</Real>
+      <Real>-0.54818105046130938</Real>
+      <Real>0.77409052523065469</Real>
+      <Real>-0.12023155611112202</Real>
+      <Real>-0.75953688777775596</Real>
+      <Real>0.87976844388887798</Real>
+      <Real>-0.50415821187895205</Real>
+      <Real>0.0083164237579040901</Real>
+      <Real>0.49584178812104795</Real>
+      <Real>-0.24534208687812509</Real>
+      <Real>-0.50931582624374983</Real>
+      <Real>0.75465791312187491</Real>
+      <Real>-0.22431029352733844</Real>
+      <Real>-0.55137941294532311</Real>
+      <Real>0.77568970647266156</Real>
+      <Real>-0.74690128232953157</Real>
+      <Real>0.49380256465906314</Real>
+      <Real>0.25309871767046843</Real>
+      <Real>-0.68904420857904825</Real>
+      <Real>0.37808841715809649</Real>
+      <Real>0.31095579142095175</Real>
+      <Real>-0.62674898595189177</Real>
+      <Real>0.25349797190378354</Real>
+      <Real>0.37325101404810823</Real>
+      <Real>-0.35097953599719034</Real>
+      <Real>-0.29804092800561932</Real>
+      <Real>0.64902046400280966</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">39</Int>
+      <Real>-0.59344265255290907</Real>
+      <Real>0.18688530510581813</Real>
+      <Real>0.40655734744709093</Real>
+      <Real>-0.64836066313822727</Real>
+      <Real>0.29672132627645453</Real>
+      <Real>0.35163933686177273</Real>
+      <Real>-0.97213114436932813</Real>
+      <Real>0.94426228873865625</Real>
+      <Real>0.027868855630671874</Real>
+      <Real>-0.92704911196113216</Real>
+      <Real>0.85409822392226431</Real>
+      <Real>0.072950888038867845</Real>
+      <Real>-0.30327871671705964</Real>
+      <Real>-0.39344256656588072</Real>
+      <Real>0.69672128328294036</Real>
+      <Real>-0.92786885294357191</Real>
+      <Real>0.85573770588714382</Real>
+      <Real>0.072131147056428091</Real>
+      <Real>-0.52213116586608876</Real>
+      <Real>0.044262331732177529</Real>
+      <Real>0.47786883413391124</Real>
+      <Real>-0.85573770588714737</Real>
+      <Real>0.71147541177429474</Real>
+      <Real>0.14426229411285263</Real>
+      <Real>-0.70245899991846983</Real>
+      <Real>0.40491799983693966</Real>
+      <Real>0.29754100008153017</Real>
+      <Real>-0.43278688233855434</Real>
+      <Real>-0.13442623532289133</Real>
+      <Real>0.56721311766144566</Real>
+      <Real>-0.38688522986717544</Real>
+      <Real>-0.22622954026564912</Real>
+      <Real>0.61311477013282456</Real>
+      <Real>-0.1524590052926591</Real>
+      <Real>-0.6950819894146818</Real>
+      <Real>0.8475409947073409</Real>
+      <Real>-0.65737704812310938</Real>
+      <Real>0.31475409624621875</Real>
+      <Real>0.34262295187689062</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Int Name="X">18</Int>
+      <Int Name="Y">2</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">2</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">4</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">1</Int>
+      <Int Name="Z">3</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">16</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">10</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">16</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">15</Int>
+      <Int Name="Z">10</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">18</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">1</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 1 3">0.00018808517987243056</Real>
+    <Real Name="Cell 0 1 4">0.0029090686050415276</Real>
+    <Real Name="Cell 0 1 5">0.0009926333542410739</Real>
+    <Real Name="Cell 0 2 1">0.0041186139190493107</Real>
+    <Real Name="Cell 0 2 2">0.017338003739560695</Real>
+    <Real Name="Cell 0 2 3">0.0069073999573910144</Real>
+    <Real Name="Cell 0 2 4">0.076937489573057044</Real>
+    <Real Name="Cell 0 2 5">0.026252635709394366</Real>
+    <Real Name="Cell 0 3 1">0.093484151328262238</Real>
+    <Real Name="Cell 0 3 2">0.39353738834865115</Real>
+    <Real Name="Cell 0 3 3">0.046084061115039682</Real>
+    <Real Name="Cell 0 3 4">0.034156123505365274</Real>
+    <Real Name="Cell 0 3 5">0.011654763790804143</Real>
+    <Real Name="Cell 0 4 1">0.038800227820390172</Real>
+    <Real Name="Cell 0 4 2">0.16333613887290838</Real>
+    <Real Name="Cell 0 4 3">0.018210437916127798</Real>
+    <Real Name="Cell 0 5 0">0.0088023472191847106</Real>
+    <Real Name="Cell 0 5 1">0.47657415536293973</Real>
+    <Real Name="Cell 0 5 2">0.27203900659924801</Real>
+    <Real Name="Cell 0 5 3">8.0394508390120395e-09</Real>
+    <Real Name="Cell 0 6 0">0.032892632265675077</Real>
+    <Real Name="Cell 0 6 1">1.8185820988028998</Real>
+    <Real Name="Cell 0 6 2">1.0586309034261097</Real>
+    <Real Name="Cell 0 6 3">3.1028827456798062e-05</Real>
+    <Real Name="Cell 0 7 0">0.0031218584565417917</Real>
+    <Real Name="Cell 0 7 1">0.20441112723321075</Real>
+    <Real Name="Cell 0 7 2">0.13595738222468978</Real>
+    <Real Name="Cell 0 7 3">2.9086509581896539e-05</Real>
+    <Real Name="Cell 1 1 3">0.002774810391959405</Real>
+    <Real Name="Cell 1 1 4">0.04291733033760034</Real>
+    <Real Name="Cell 1 1 5">0.014644265691862666</Real>
+    <Real Name="Cell 1 2 1">0.0013313492546036102</Real>
+    <Real Name="Cell 1 2 2">0.0056045404615897845</Real>
+    <Real Name="Cell 1 2 3">0.074011553572345776</Real>
+    <Real Name="Cell 1 2 4">1.1350545840102093</Real>
+    <Real Name="Cell 1 2 5">0.38730370161094119</Real>
+    <Real Name="Cell 1 3 1">0.030218917731638664</Real>
+    <Real Name="Cell 1 3 2">0.12721165880912841</Real>
+    <Real Name="Cell 1 3 3">0.046762662589622535</Real>
+    <Real Name="Cell 1 3 4">0.50390342565011836</Real>
+    <Real Name="Cell 1 3 5">0.17194209402617516</Real>
+    <Real Name="Cell 1 4 1">0.01254224246370985</Real>
+    <Real Name="Cell 1 4 2">0.052798696603364434</Real>
+    <Real Name="Cell 1 4 3">0.0058865563566196924</Real>
+    <Real Name="Cell 1 5 0">0.0040381068191034947</Real>
+    <Real Name="Cell 1 5 1">0.21867759350058125</Real>
+    <Real Name="Cell 1 5 2">0.12485189059509993</Real>
+    <Real Name="Cell 1 5 3">4.2786233207568734e-08</Real>
+    <Real Name="Cell 1 6 0">0.015089607276658711</Real>
+    <Real Name="Cell 1 6 1">1.0178948988864061</Real>
+    <Real Name="Cell 1 6 2">0.69047084849042828</Real>
+    <Real Name="Cell 1 6 3">0.00016513648435806865</Real>
+    <Real Name="Cell 1 7 0">0.0014321632182563401</Real>
+    <Real Name="Cell 1 7 1">0.26589472537246744</Real>
+    <Real Name="Cell 1 7 2">0.25437004369160016</Real>
+    <Real Name="Cell 1 7 3">0.00015479940198479322</Real>
+    <Real Name="Cell 16 4 0">0.0043013969422817924</Real>
+    <Real Name="Cell 16 4 1">0.0056649283231824119</Real>
+    <Real Name="Cell 16 4 2">2.5994532206908954e-05</Real>
+    <Real Name="Cell 16 5 0">0.36050774048298312</Real>
+    <Real Name="Cell 16 5 1">0.4747877345877265</Real>
+    <Real Name="Cell 16 5 2">0.0021786480523821776</Real>
+    <Real Name="Cell 16 6 0">0.23030817115201113</Real>
+    <Real Name="Cell 16 6 1">0.30331524835447249</Real>
+    <Real Name="Cell 16 6 2">0.0013918160199717393</Real>
+    <Real Name="Cell 17 4 0">0.0044102367883987166</Real>
+    <Real Name="Cell 17 4 1">0.0058082701107997868</Real>
+    <Real Name="Cell 17 4 2">2.6652281520270527e-05</Real>
+    <Real Name="Cell 17 5 0">0.36962980187946365</Real>
+    <Real Name="Cell 17 5 1">0.48680146516505807</Real>
+    <Real Name="Cell 17 5 2">0.0022337751940866178</Real>
+    <Real Name="Cell 17 6 0">0.23613574443669338</Real>
+    <Real Name="Cell 17 6 1">0.31099014685809795</Real>
+    <Real Name="Cell 17 6 2">0.0014270336582110122</Real>
+    <Real Name="Cell 18 2 1">0.00029223893416861806</Real>
+    <Real Name="Cell 18 2 2">0.0012302293521676579</Real>
+    <Real Name="Cell 18 2 3">0.00013715896184909214</Real>
+    <Real Name="Cell 18 3 1">0.0066332288684478819</Real>
+    <Real Name="Cell 18 3 2">0.027923701805256392</Real>
+    <Real Name="Cell 18 3 3">0.0031132292070939218</Real>
+    <Real Name="Cell 18 4 0">1.7158366547358471e-07</Real>
+    <Real Name="Cell 18 4 1">0.0027533214210761553</Real>
+    <Real Name="Cell 18 4 2">0.011589623194678714</Real>
+    <Real Name="Cell 18 4 3">0.001292133487613084</Real>
+    <Real Name="Cell 18 5 0">0.00032181339947092179</Real>
+    <Real Name="Cell 18 5 1">0.01666352889051886</Real>
+    <Real Name="Cell 18 5 2">0.0095009984797486229</Real>
+    <Real Name="Cell 18 6 0">0.0011580021722818275</Real>
+    <Real Name="Cell 18 6 1">0.062209641413896677</Real>
+    <Real Name="Cell 18 6 2">0.035503084743494354</Real>
+    <Real Name="Cell 18 7 0">0.00010903469799182714</Real>
+    <Real Name="Cell 18 7 1">0.0059032041345824576</Real>
+    <Real Name="Cell 18 7 2">0.0033696127181149838</Real>
+    <Real Name="Cell 2 0 0">0.406836631155853</Real>
+    <Real Name="Cell 2 0 1">1.1689180985182439</Real>
+    <Real Name="Cell 2 0 10">9.7426659105024389e-06</Real>
+    <Real Name="Cell 2 0 2">0.07297749122996576</Real>
+    <Real Name="Cell 2 1 0">0.18156265350916104</Real>
+    <Real Name="Cell 2 1 1">0.52175561536461634</Real>
+    <Real Name="Cell 2 1 2">0.032574532829179541</Real>
+    <Real Name="Cell 2 1 3">0.00092147588501739904</Real>
+    <Real Name="Cell 2 1 4">0.014252247674299079</Real>
+    <Real Name="Cell 2 1 5">0.0048631566783596302</Real>
+    <Real Name="Cell 2 15 0">0.00067537276197739496</Real>
+    <Real Name="Cell 2 15 1">0.0001457366173098991</Real>
+    <Real Name="Cell 2 15 10">8.4844624272759466e-05</Real>
+    <Real Name="Cell 2 16 0">0.016851061444656389</Real>
+    <Real Name="Cell 2 16 1">0.043990440575358343</Real>
+    <Real Name="Cell 2 16 10">0.00020959079124938432</Real>
+    <Real Name="Cell 2 16 2">0.0027239588758043564</Real>
+    <Real Name="Cell 2 2 0">6.3762254037022745e-05</Real>
+    <Real Name="Cell 2 2 1">0.00022084380759982648</Real>
+    <Real Name="Cell 2 2 2">1.8755353340441018e-05</Real>
+    <Real Name="Cell 2 2 3">0.024370701045855054</Real>
+    <Real Name="Cell 2 2 4">0.37693581888501343</Real>
+    <Real Name="Cell 2 2 5">0.12861816513539928</Real>
+    <Real Name="Cell 2 3 0">0.0034136157314101061</Real>
+    <Real Name="Cell 2 3 1">0.012319647322337986</Real>
+    <Real Name="Cell 2 3 2">0.0011764351123614851</Real>
+    <Real Name="Cell 2 3 3">0.010819285623351859</Real>
+    <Real Name="Cell 2 3 4">0.16733930954696927</Real>
+    <Real Name="Cell 2 3 5">0.057099574703781263</Real>
+    <Real Name="Cell 2 4 0">0.0021191365405715309</Real>
+    <Real Name="Cell 2 4 1">0.0088333535499049813</Real>
+    <Real Name="Cell 2 4 2">0.0011418609327748059</Real>
+    <Real Name="Cell 2 5 0">1.5829303519544015e-05</Real>
+    <Real Name="Cell 2 5 1">0.0001635831317127439</Real>
+    <Real Name="Cell 2 5 2">4.8296593356786407e-05</Real>
+    <Real Name="Cell 2 5 3">6.293762673883149e-09</Real>
+    <Real Name="Cell 2 6 1">0.029557029516431226</Real>
+    <Real Name="Cell 2 6 2">0.032970660100566145</Real>
+    <Real Name="Cell 2 6 3">2.4291220877215411e-05</Real>
+    <Real Name="Cell 2 7 1">0.027706842079001048</Real>
+    <Real Name="Cell 2 7 2">0.030906788929481923</Real>
+    <Real Name="Cell 2 7 3">2.2770658342949888e-05</Real>
+    <Real Name="Cell 3 0 0">0.63932566264442026</Real>
+    <Real Name="Cell 3 0 1">1.7382352159757049</Real>
+    <Real Name="Cell 3 0 10">0.0046788457809578392</Real>
+    <Real Name="Cell 3 0 2">0.10802069683259874</Real>
+    <Real Name="Cell 3 1 0">0.29206110095876386</Real>
+    <Real Name="Cell 3 1 1">0.85054876868078688</Real>
+    <Real Name="Cell 3 1 2">0.054549593611895285</Real>
+    <Real Name="Cell 3 10 0">0.0082304511774808527</Real>
+    <Real Name="Cell 3 10 1">0.014014396738324461</Real>
+    <Real Name="Cell 3 10 2">0.00023390956136037089</Real>
+    <Real Name="Cell 3 11 0">0.18736772209305352</Real>
+    <Real Name="Cell 3 11 1">0.31904029763917302</Real>
+    <Real Name="Cell 3 11 2">0.0053249938238856638</Real>
+    <Real Name="Cell 3 12 0">0.077871724695048175</Real>
+    <Real Name="Cell 3 12 1">0.13259604133974251</Real>
+    <Real Name="Cell 3 12 2">0.0022131157299895977</Real>
+    <Real Name="Cell 3 15 0">0.32434294955607429</Real>
+    <Real Name="Cell 3 15 1">0.069988970503076953</Real>
+    <Real Name="Cell 3 15 10">0.040746025365359297</Real>
+    <Real Name="Cell 3 16 0">0.82369431210280031</Real>
+    <Real Name="Cell 3 16 1">0.23747443528036877</Real>
+    <Real Name="Cell 3 16 10">0.10065448188135853</Real>
+    <Real Name="Cell 3 16 2">0.0040319820666417684</Real>
+    <Real Name="Cell 3 2 0">0.27881948439827597</Real>
+    <Real Name="Cell 3 2 1">0.9361975580964299</Real>
+    <Real Name="Cell 3 2 2">0.075815536664766078</Real>
+    <Real Name="Cell 3 3 0">0.25773644310361049</Real>
+    <Real Name="Cell 3 3 1">0.90246891412795205</Real>
+    <Real Name="Cell 3 3 2">0.08033987532708721</Real>
+    <Real Name="Cell 3 4 0">0.10874064438493782</Real>
+    <Real Name="Cell 3 4 1">0.43321472040346831</Real>
+    <Real Name="Cell 3 4 2">0.051393093435294919</Real>
+    <Real Name="Cell 3 5 0">0.00080664349445461094</Real>
+    <Real Name="Cell 3 5 1">0.0069087073888523436</Real>
+    <Real Name="Cell 3 5 2">0.0016269550683567472</Real>
+    <Real Name="Cell 4 0 0">0.036502228650249352</Real>
+    <Real Name="Cell 4 0 1">0.022586945687235831</Real>
+    <Real Name="Cell 4 0 10">0.0038903606975782099</Real>
+    <Real Name="Cell 4 0 2">0.00099295963627660006</Real>
+    <Real Name="Cell 4 1 0">0.047129615318141325</Real>
+    <Real Name="Cell 4 1 1">0.15699489479143533</Real>
+    <Real Name="Cell 4 1 2">0.012574730231023285</Real>
+    <Real Name="Cell 4 10 0">0.041969600267397121</Real>
+    <Real Name="Cell 4 10 1">0.071463716437015462</Real>
+    <Real Name="Cell 4 10 2">0.0011927767478746832</Real>
+    <Real Name="Cell 4 11 0">0.95544560433989678</Real>
+    <Real Name="Cell 4 11 1">1.6268845379635501</Real>
+    <Real Name="Cell 4 11 2">0.02715378019935526</Real>
+    <Real Name="Cell 4 12 0">0.39709185889178705</Real>
+    <Real Name="Cell 4 12 1">0.67614796954200196</Real>
+    <Real Name="Cell 4 12 2">0.011285357330991628</Real>
+    <Real Name="Cell 4 15 0">0.26968426029875026</Real>
+    <Real Name="Cell 4 15 1">0.058194339556408806</Real>
+    <Real Name="Cell 4 15 10">0.033879452985831809</Real>
+    <Real Name="Cell 4 16 0">0.66640479962494958</Real>
+    <Real Name="Cell 4 16 1">0.14435052290460143</Real>
+    <Real Name="Cell 4 16 10">0.083692059682756156</Real>
+    <Real Name="Cell 4 16 2">3.706322550918936e-05</Real>
+    <Real Name="Cell 4 2 0">0.52958933416905918</Real>
+    <Real Name="Cell 4 2 1">1.7777344644186996</Real>
+    <Real Name="Cell 4 2 2">0.143903554795795</Real>
+    <Real Name="Cell 4 3 0">0.31012941343083311</Real>
+    <Real Name="Cell 4 3 1">1.182820148258702</Real>
+    <Real Name="Cell 4 3 2">0.1218930946316889</Real>
+    <Real Name="Cell 4 4 0">0.39685309808198815</Real>
+    <Real Name="Cell 4 4 1">2.0865717815302651</Real>
+    <Real Name="Cell 4 4 2">0.30905066626026545</Real>
+    <Real Name="Cell 4 5 0">0.055476536285432781</Real>
+    <Real Name="Cell 4 5 1">0.33447588928119287</Real>
+    <Real Name="Cell 4 5 2">0.084194101614856576</Real>
+    <Real Name="Cell 4 5 3">0.0001746145636465291</Real>
+    <Real Name="Cell 4 6 1">0.16490751776386439</Real>
+    <Real Name="Cell 4 6 2">0.21783596503012673</Real>
+    <Real Name="Cell 4 6 3">0.0010211655054933554</Real>
+    <Real Name="Cell 4 7 1">0.026782901885590082</Real>
+    <Real Name="Cell 4 7 2">0.035379098282887149</Real>
+    <Real Name="Cell 4 7 3">0.00016584917360614468</Real>
+    <Real Name="Cell 5 1 0">0.0010989598324157807</Real>
+    <Real Name="Cell 5 1 1">0.0036885865449326352</Real>
+    <Real Name="Cell 5 1 2">0.00029852839777366085</Real>
+    <Real Name="Cell 5 10 0">0.0058896658555967693</Real>
+    <Real Name="Cell 5 10 1">0.010028625670283108</Real>
+    <Real Name="Cell 5 10 2">0.0001673844030095395</Real>
+    <Real Name="Cell 5 11 0">0.13407931733703174</Real>
+    <Real Name="Cell 5 11 1">0.22830349236577308</Real>
+    <Real Name="Cell 5 11 2">0.0038105364614291256</Real>
+    <Real Name="Cell 5 12 0">0.055724580361733632</Real>
+    <Real Name="Cell 5 12 1">0.094885002100821458</Real>
+    <Real Name="Cell 5 12 2">0.0015836935142835525</Real>
+    <Real Name="Cell 5 2 0">0.012985421135592702</Real>
+    <Real Name="Cell 5 2 1">0.043584713715823439</Real>
+    <Real Name="Cell 5 2 2">0.0035274419061370019</Real>
+    <Real Name="Cell 5 3 0">0.047447567779325767</Real>
+    <Real Name="Cell 5 3 1">0.25284323272175968</Real>
+    <Real Name="Cell 5 3 2">0.037617148170581045</Real>
+    <Real Name="Cell 5 4 0">0.2578262761675304</Real>
+    <Real Name="Cell 5 4 1">1.4176711194296565</Real>
+    <Real Name="Cell 5 4 2">0.21596598633241318</Real>
+    <Real Name="Cell 5 5 0">0.042260261454884658</Real>
+    <Real Name="Cell 5 5 1">0.40305926133387909</Real>
+    <Real Name="Cell 5 5 2">0.26087204666098224</Real>
+    <Real Name="Cell 5 5 3">0.0010569666506760804</Real>
+    <Real Name="Cell 5 6 1">0.99820852901488599</Real>
+    <Real Name="Cell 5 6 2">1.318591906347335</Real>
+    <Real Name="Cell 5 6 3">0.0061812592351240172</Real>
+    <Real Name="Cell 5 7 1">0.16212069320118783</Real>
+    <Real Name="Cell 5 7 2">0.21415468581246491</Real>
+    <Real Name="Cell 5 7 3">0.0010039085050129897</Real>
+    <Real Name="Cell 6 5 1">0.028699392301152461</Real>
+    <Real Name="Cell 6 5 2">0.037910702328633687</Real>
+    <Real Name="Cell 6 5 3">0.0001777167581196857</Real>
+    <Real Name="Cell 6 6 1">0.16783725729707202</Real>
+    <Real Name="Cell 6 6 2">0.22170602897358535</Real>
+    <Real Name="Cell 6 6 3">0.0010393074858709619</Real>
+    <Real Name="Cell 6 7 1">0.0272587257141956</Real>
+    <Real Name="Cell 6 7 2">0.036007641749516935</Real>
+    <Real Name="Cell 6 7 3">0.00016879564255463438</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_8.xml b/src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_8.xml
new file mode 100644 (file)
index 0000000..094e4e9
--- /dev/null
@@ -0,0 +1,833 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">52</Int>
+      <Real>0.0032320813985638091</Real>
+      <Real>0.32739340500299152</Real>
+      <Real>0.60418199968332709</Real>
+      <Real>0.065192513915117434</Real>
+      <Real>0.036781240901433088</Real>
+      <Real>0.5410723534249855</Real>
+      <Real>0.41182077484694096</Real>
+      <Real>0.010325630826640411</Real>
+      <Real>0.036849690391817888</Real>
+      <Real>0.54128079204577983</Real>
+      <Real>0.41157318778905927</Real>
+      <Real>0.010296329773342997</Real>
+      <Real>0.0015144164319307073</Real>
+      <Real>0.28823187635306668</Real>
+      <Real>0.62766564313430673</Real>
+      <Real>0.082588064080695744</Real>
+      <Real>0.012343878077116547</Real>
+      <Real>0.42779203362861129</Real>
+      <Real>0.52733755949080408</Real>
+      <Real>0.032526528803468034</Real>
+      <Real>0.023574272347497677</Real>
+      <Real>0.49219553419207929</Real>
+      <Real>0.46591665727802722</Real>
+      <Real>0.018313536182395652</Real>
+      <Real>0.054846312535409794</Real>
+      <Real>0.58565149806818073</Real>
+      <Real>0.35455612489808364</Real>
+      <Real>0.0049460644983257609</Real>
+      <Real>0.00011270990432847568</Real>
+      <Real>0.21406829462245039</Real>
+      <Real>0.65930033609084437</Real>
+      <Real>0.12651865938237672</Real>
+      <Real>0.0019707694277898893</Real>
+      <Real>0.30061680124029133</Real>
+      <Real>0.62067610437023457</Real>
+      <Real>0.07673632496168413</Real>
+      <Real>0.022608672803415615</Real>
+      <Real>0.48775346754225168</Real>
+      <Real>0.47048440607829622</Real>
+      <Real>0.01915345357603648</Real>
+      <Real>0.042568491442497081</Real>
+      <Real>0.55747572702267667</Real>
+      <Real>0.39181610760773877</Real>
+      <Real>0.0081396739270872612</Real>
+      <Real>0.0010065468105848374</Real>
+      <Real>0.27128251198765502</Real>
+      <Real>0.63652307745303605</Real>
+      <Real>0.091187863748724007</Real>
+      <Real>0.0056407272445787252</Real>
+      <Real>0.36379270070734426</Real>
+      <Real>0.57895852516983959</Real>
+      <Real>0.051608046878237321</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">52</Int>
+      <Real>2.8984203206300032e-05</Real>
+      <Real>0.19604629578723692</Real>
+      <Real>0.66363801892486318</Real>
+      <Real>0.14028670108469343</Real>
+      <Real>0.16270013029218783</Real>
+      <Real>0.6666029727238697</Real>
+      <Real>0.17069681175130791</Real>
+      <Real>8.5232634550106489e-08</Real>
+      <Real>0.07795655011881443</Real>
+      <Real>0.62220330426985249</Real>
+      <Real>0.29797315870186108</Real>
+      <Real>0.0018669869094719406</Real>
+      <Real>0.00030406591916461119</Real>
+      <Real>0.23431536727051527</Real>
+      <Real>0.65264819325911705</Real>
+      <Real>0.11273237355120293</Real>
+      <Real>0.069667831943294664</Real>
+      <Real>0.61104182113337613</Real>
+      <Real>0.31661366762290266</Real>
+      <Real>0.0026766793004264337</Real>
+      <Real>0.028562841964611067</Real>
+      <Real>0.51297348077323213</Real>
+      <Real>0.44382208157931846</Real>
+      <Real>0.014641595682838331</Real>
+      <Real>0.025143927553512784</Real>
+      <Real>0.49910502043123089</Real>
+      <Real>0.45870514956802655</Real>
+      <Real>0.017045902447229689</Real>
+      <Real>0.011359280676947803</Real>
+      <Real>0.42025384291425372</Real>
+      <Real>0.53389123934873839</Real>
+      <Real>0.034495637060059994</Real>
+      <Real>0.00066159670659626552</Real>
+      <Real>0.25638546720471722</Real>
+      <Real>0.64358095325478015</Real>
+      <Real>0.099371982833906358</Real>
+      <Real>0.002111122856071995</Real>
+      <Real>0.30405607905732607</Real>
+      <Real>0.6186612608438542</Real>
+      <Real>0.075171537242747735</Real>
+      <Real>0.048540454602101754</Real>
+      <Real>0.57216087076003208</Real>
+      <Real>0.37291163014119588</Real>
+      <Real>0.006387044496670261</Real>
+      <Real>0.0014807971091969363</Real>
+      <Real>0.28723145257646854</Real>
+      <Real>0.62821163477963171</Real>
+      <Real>0.083076115534702732</Real>
+      <Real>0.097374461581833008</Real>
+      <Real>0.64197198326708227</Real>
+      <Real>0.25991820354188061</Real>
+      <Real>0.00073535160920408949</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">52</Int>
+      <Real>0.0015398888964354171</Real>
+      <Real>0.28898064671533619</Real>
+      <Real>0.62725514312918096</Real>
+      <Real>0.082224321259047425</Real>
+      <Real>0.028102759671169996</Real>
+      <Real>0.5111933881600339</Real>
+      <Real>0.44576397047871225</Real>
+      <Real>0.014939881690083917</Real>
+      <Real>0.055181892379010555</Real>
+      <Real>0.5863185122651009</Real>
+      <Real>0.35362057298464111</Real>
+      <Real>0.0048790223712473569</Real>
+      <Real>0.042559053512507009</Real>
+      <Real>0.55745084251830734</Real>
+      <Real>0.3918472969218505</Real>
+      <Real>0.0081428070473352349</Real>
+      <Real>0.0042822983182703679</Real>
+      <Real>0.34489746753419126</Real>
+      <Real>0.59244017307124897</Real>
+      <Real>0.058380061076289277</Real>
+      <Real>0.12484999797808245</Real>
+      <Real>0.65862567655706228</Real>
+      <Real>0.21639537487981303</Real>
+      <Real>0.00012895058504219708</Real>
+      <Real>0.010024276215463116</Real>
+      <Real>0.40925040275948299</Real>
+      <Real>0.54322966784603066</Real>
+      <Real>0.037495653179023217</Real>
+      <Real>0.090687467643976075</Real>
+      <Real>0.63605011324875538</Real>
+      <Real>0.27223081442693087</Real>
+      <Real>0.0010316046803375766</Real>
+      <Real>0.03997392842591032</Real>
+      <Real>0.55041457032000274</Real>
+      <Real>0.40056052852395163</Real>
+      <Real>0.0090509727301352396</Real>
+      <Real>0.027853326369114029</Real>
+      <Real>0.51021767533992357</Real>
+      <Real>0.44682433864369708</Real>
+      <Real>0.01510465964726525</Real>
+      <Real>0.0017667435669507293</Real>
+      <Real>0.29533040945432815</Real>
+      <Real>0.62371106113053343</Real>
+      <Real>0.079191785848187535</Real>
+      <Real>0.13033713529174909</Real>
+      <Real>0.66071839577659341</Real>
+      <Real>0.2088632638531345</Real>
+      <Real>8.120507852295045e-05</Real>
+      <Real>0.02989059562152363</Real>
+      <Real>0.51797311002867397</Real>
+      <Real>0.43831641796203813</Real>
+      <Real>0.013819876387764206</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">52</Int>
+      <Real>-0.036090455589515444</Real>
+      <Real>-0.66039368711645541</Real>
+      <Real>0.42905874100145708</Real>
+      <Real>0.26742540170451373</Real>
+      <Real>-0.18259480726201247</Real>
+      <Real>-0.5565247826151738</Real>
+      <Real>0.66083398701638507</Real>
+      <Real>0.078285602860801204</Real>
+      <Real>-0.18282127502653051</Real>
+      <Real>-0.55622001797648113</Real>
+      <Real>0.66090386103255361</Real>
+      <Real>0.07813743197045793</Real>
+      <Real>-0.02177213641407599</Real>
+      <Real>-0.64335623589400448</Real>
+      <Real>0.35202888103023683</Real>
+      <Real>0.31309949127784359</Real>
+      <Real>-0.088180370703606098</Real>
+      <Real>-0.65541214886855814</Real>
+      <Real>0.57536540984793449</Real>
+      <Real>0.16822710972422975</Real>
+      <Real>-0.1357364132155662</Real>
+      <Real>-0.61382130305798044</Real>
+      <Real>0.63485184576265952</Real>
+      <Real>0.11470587051088713</Real>
+      <Real>-0.2383247396874062</Real>
+      <Real>-0.47542383957845602</Real>
+      <Real>0.66582189821913063</Real>
+      <Real>0.047926681046731583</Real>
+      <Real>-0.0038522301444038455</Real>
+      <Real>-0.57621836461551912</Real>
+      <Real>0.16399341966424974</Real>
+      <Real>0.41607717509567321</Real>
+      <Real>-0.025951435289900862</Real>
+      <Real>-0.64996770926448444</Real>
+      <Real>0.37778972439867142</Real>
+      <Real>0.29812942015571386</Real>
+      <Real>-0.13200413949930864</Real>
+      <Real>-0.61780494107512052</Real>
+      <Real>0.63162230064816693</Real>
+      <Real>0.11818677992626223</Real>
+      <Real>-0.20127801669320952</Real>
+      <Real>-0.53063898590095504</Real>
+      <Real>0.66511202188153873</Real>
+      <Real>0.066804980712625833</Real>
+      <Real>-0.016581614822692537</Real>
+      <Real>-0.63236289739202312</Real>
+      <Real>0.31447063925212376</Real>
+      <Real>0.33447387296259184</Real>
+      <Real>-0.052315161615281575</Real>
+      <Real>-0.66652062347241958</Real>
+      <Real>0.48998673179068397</Real>
+      <Real>0.22884905329701719</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">52</Int>
+      <Real>-0.0015578001757111505</Real>
+      <Real>-0.55114416258182264</Real>
+      <Real>0.10696172569077878</Real>
+      <Real>0.44574023706675503</Real>
+      <Real>-0.49203512289596113</Real>
+      <Real>-0.015897779387727462</Real>
+      <Real>0.50790092746333826</Real>
+      <Real>3.1974820350303207e-05</Real>
+      <Real>-0.30128157916062442</Real>
+      <Real>-0.3724046801161362</Real>
+      <Real>0.64865409771414562</Real>
+      <Real>0.025032161562614976</Real>
+      <Real>-0.007465335582521662</Real>
+      <Real>-0.59979511881007652</Real>
+      <Real>0.22198624436771813</Real>
+      <Real>0.3852742100248801</Real>
+      <Real>-0.27952824743682397</Real>
+      <Real>-0.4091160634090672</Real>
+      <Real>0.65681686912860626</Real>
+      <Real>0.031827441717284875</Real>
+      <Real>-0.15426655549059071</Real>
+      <Real>-0.59265790254784378</Real>
+      <Real>0.64811547156745974</Real>
+      <Real>0.098808986470974761</Real>
+      <Real>-0.14169664987958924</Real>
+      <Real>-0.60725702345225918</Real>
+      <Real>0.63960399654328604</Real>
+      <Real>0.10934967678856237</Real>
+      <Real>-0.083426634674385811</Real>
+      <Real>-0.65819686318493187</Real>
+      <Real>0.56667363039302121</Real>
+      <Real>0.17494986746629645</Real>
+      <Real>-0.012535251765837658</Real>
+      <Real>-0.62073092248649042</Real>
+      <Real>0.27906760027049388</Real>
+      <Real>0.35419857398183424</Real>
+      <Real>-0.02716938719551423</Real>
+      <Real>-0.6515986259401797</Real>
+      <Real>0.38470541346690201</Real>
+      <Real>0.29406259966879189</Real>
+      <Real>-0.21968820016588803</Real>
+      <Real>-0.50379013496990122</Real>
+      <Real>0.66664487043746667</Real>
+      <Real>0.056833464698322671</Real>
+      <Real>-0.021448711607312865</Real>
+      <Real>-0.6427707964382211</Real>
+      <Real>0.34988772769838083</Real>
+      <Real>0.31433178034715314</Real>
+      <Real>-0.34943592393514256</Real>
+      <Real>-0.28767778301611657</Real>
+      <Real>0.62366333783766081</Real>
+      <Real>0.013450369113598334</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">52</Int>
+      <Real>-0.022015595113395979</Real>
+      <Real>-0.64378931790897165</Real>
+      <Real>0.35362542115813128</Real>
+      <Real>0.31217949186423638</Real>
+      <Real>-0.1526054876007322</Real>
+      <Real>-0.59464256301009333</Real>
+      <Real>0.64710158882238322</Real>
+      <Real>0.1001464617884423</Real>
+      <Real>-0.23929588540952862</Real>
+      <Real>-0.47391561842328889</Real>
+      <Real>0.66571889307516363</Real>
+      <Real>0.047492610757653875</Real>
+      <Real>-0.20124826514116861</Real>
+      <Real>-0.53068134707248027</Real>
+      <Real>0.66510748956846633</Real>
+      <Real>0.066822122645182544</Real>
+      <Real>-0.043536694275114363</Real>
+      <Real>-0.66447192026909963</Real>
+      <Real>0.45955392336354245</Real>
+      <Real>0.24845469118067159</Real>
+      <Real>-0.41241064286055051</Real>
+      <Real>-0.17096479334653347</Real>
+      <Real>0.57916151527471849</Real>
+      <Real>0.0042139209323654933</Real>
+      <Real>-0.076754913733512689</Real>
+      <Real>-0.66153856081084794</Real>
+      <Real>0.55334186282223397</Real>
+      <Real>0.18495161172212665</Real>
+      <Real>-0.33324912758583197</Real>
+      <Real>-0.31664606109887411</Real>
+      <Real>0.63303950495524408</Real>
+      <Real>0.016855683729461973</Real>
+      <Real>-0.193013961710223</Real>
+      <Real>-0.54226956931101922</Real>
+      <Real>0.66358102375270744</Real>
+      <Real>0.07170250726853479</Real>
+      <Real>-0.15170115356515579</Real>
+      <Real>-0.595716207735419</Real>
+      <Real>0.64653587616630537</Real>
+      <Real>0.10088148513426944</Real>
+      <Real>-0.024127918118492662</Real>
+      <Real>-0.64728835638456406</Real>
+      <Real>0.36696046712460617</Real>
+      <Real>0.30445580737845057</Real>
+      <Real>-0.42440740434438973</Real>
+      <Real>-0.14808924824839953</Real>
+      <Real>0.56940070952996824</Real>
+      <Real>0.0030959430628210299</Real>
+      <Real>-0.1590110177845997</Real>
+      <Real>-0.58690137153015798</Real>
+      <Real>0.65083579641411504</Real>
+      <Real>0.095076592900642645</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Int Name="X">15</Int>
+      <Int Name="Y">1</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">2</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">1</Int>
+      <Int Name="Z">4</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">13</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">2</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">7</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">1</Int>
+      <Int Name="Y">11</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">10</Int>
+      <Int Name="Z">13</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">2</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">15</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">1</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 1 1">1.578136093948518e-08</Real>
+    <Real Name="Cell 0 1 2">2.9615824238341996e-06</Real>
+    <Real Name="Cell 0 1 3">6.4283467708510775e-06</Real>
+    <Real Name="Cell 0 1 4">1.3032248079823335e-05</Real>
+    <Real Name="Cell 0 1 5">0.00098175226244482891</Real>
+    <Real Name="Cell 0 1 6">0.0016863837372718463</Real>
+    <Real Name="Cell 0 1 7">0.00016617911825528967</Real>
+    <Real Name="Cell 0 2 1">0.00010674357106339121</Real>
+    <Real Name="Cell 0 2 2">0.020031851823861083</Real>
+    <Real Name="Cell 0 2 3">0.043480704419960381</Real>
+    <Real Name="Cell 0 2 4">0.0058066206494026742</Real>
+    <Real Name="Cell 0 2 5">0.008610741480147904</Real>
+    <Real Name="Cell 0 2 6">0.014790915135568187</Real>
+    <Real Name="Cell 0 2 7">0.0014575219038781074</Real>
+    <Real Name="Cell 0 3 0">0.00018286062146263715</Real>
+    <Real Name="Cell 0 3 1">0.0016275736041690731</Real>
+    <Real Name="Cell 0 3 2">0.069655757150767592</Real>
+    <Real Name="Cell 0 3 3">0.14767038255915954</Real>
+    <Real Name="Cell 0 3 4">0.019349717312040677</Real>
+    <Real Name="Cell 0 3 5">0.0044616887857618611</Real>
+    <Real Name="Cell 0 3 6">0.0076639695133881112</Real>
+    <Real Name="Cell 0 3 7">0.00075522057519993371</Real>
+    <Real Name="Cell 0 4 0">0.0032840797006217187</Real>
+    <Real Name="Cell 0 4 1">0.076073842891386814</Real>
+    <Real Name="Cell 0 4 2">0.31842564661451356</Real>
+    <Real Name="Cell 0 4 3">0.1259776045669844</Real>
+    <Real Name="Cell 0 4 4">0.0041309267860407386</Real>
+    <Real Name="Cell 0 4 5">3.7719502469544199e-05</Real>
+    <Real Name="Cell 0 4 6">6.4791860407043583e-05</Real>
+    <Real Name="Cell 0 4 7">6.3846999912254604e-06</Real>
+    <Real Name="Cell 0 5 0">0.0028413692782037741</Real>
+    <Real Name="Cell 0 5 1">0.14432447322557718</Real>
+    <Real Name="Cell 0 5 2">0.66829686527291721</Real>
+    <Real Name="Cell 0 5 3">0.21394913146163794</Real>
+    <Real Name="Cell 0 5 4">0.00020276663663295686</Real>
+    <Real Name="Cell 0 6 0">9.373616564786184e-05</Real>
+    <Real Name="Cell 0 6 1">0.018080533852036267</Real>
+    <Real Name="Cell 0 6 2">0.093014453839735778</Real>
+    <Real Name="Cell 0 6 3">0.031384521315035774</Real>
+    <Real Name="Cell 0 6 4">6.947153745591987e-05</Real>
+    <Real Name="Cell 0 7 1">4.1760376030672574e-06</Real>
+    <Real Name="Cell 0 7 2">4.4371224853550681e-05</Real>
+    <Real Name="Cell 0 7 3">2.6761184626639464e-05</Real>
+    <Real Name="Cell 0 7 4">3.692330945918291e-07</Real>
+    <Real Name="Cell 1 0 0">0.00012320714087502198</Real>
+    <Real Name="Cell 1 0 1">0.0016964808858046813</Real>
+    <Real Name="Cell 1 0 2">0.0012346026375239822</Real>
+    <Real Name="Cell 1 0 3">2.789679463915135e-05</Real>
+    <Real Name="Cell 1 1 0">0.00030927559988737032</Real>
+    <Real Name="Cell 1 1 1">0.004258549692340464</Real>
+    <Real Name="Cell 1 1 2">0.0031045753071671936</Real>
+    <Real Name="Cell 1 1 3">8.1889839824169614e-05</Real>
+    <Real Name="Cell 1 1 4">0.00042399980815044483</Real>
+    <Real Name="Cell 1 1 5">0.034023812795862418</Real>
+    <Real Name="Cell 1 1 6">0.05844366931840763</Real>
+    <Real Name="Cell 1 1 7">0.0057591384572105286</Real>
+    <Real Name="Cell 1 11 0">3.1793314777459778e-07</Real>
+    <Real Name="Cell 1 11 1">4.3777292804029945e-06</Real>
+    <Real Name="Cell 1 11 2">3.1858632544438581e-06</Real>
+    <Real Name="Cell 1 11 3">7.1987026640312263e-08</Real>
+    <Real Name="Cell 1 2 0">4.7753634484560603e-05</Real>
+    <Real Name="Cell 1 2 1">0.00085452389504690827</Real>
+    <Real Name="Cell 1 2 2">0.037445921488349618</Real>
+    <Real Name="Cell 1 2 3">0.080251460394392293</Real>
+    <Real Name="Cell 1 2 4">0.014223592994074028</Real>
+    <Real Name="Cell 1 2 5">0.29841566692654647</Real>
+    <Real Name="Cell 1 2 6">0.51259706435394181</Real>
+    <Real Name="Cell 1 2 7">0.050512185507904046</Real>
+    <Real Name="Cell 1 3 1">0.0013744459657307258</Real>
+    <Real Name="Cell 1 3 2">0.12872582299847918</Real>
+    <Real Name="Cell 1 3 3">0.27275726530417721</Real>
+    <Real Name="Cell 1 3 4">0.03752628436599631</Real>
+    <Real Name="Cell 1 3 5">0.15462522451654762</Real>
+    <Real Name="Cell 1 3 6">0.26560413861166682</Real>
+    <Real Name="Cell 1 3 7">0.026173083020147432</Real>
+    <Real Name="Cell 1 4 1">0.13996001705531683</Real>
+    <Real Name="Cell 1 4 2">0.74946868661100219</Real>
+    <Real Name="Cell 1 4 3">0.29378563449513984</Real>
+    <Real Name="Cell 1 4 4">0.0078549772341450896</Real>
+    <Real Name="Cell 1 4 5">0.0013072150071555984</Real>
+    <Real Name="Cell 1 4 6">0.0022454403351158912</Real>
+    <Real Name="Cell 1 4 7">0.00022126950511754709</Real>
+    <Real Name="Cell 1 5 1">0.32064305884265848</Real>
+    <Real Name="Cell 1 5 2">1.7390157845254106</Real>
+    <Real Name="Cell 1 5 3">0.61207020778629195</Real>
+    <Real Name="Cell 1 5 4">0.0019945451176575663</Real>
+    <Real Name="Cell 1 6 1">0.049489274873467437</Real>
+    <Real Name="Cell 1 6 2">0.30526912304037801</Real>
+    <Real Name="Cell 1 6 3">0.12635515085077775</Real>
+    <Real Name="Cell 1 6 4">0.0008903500740208148</Real>
+    <Real Name="Cell 1 7 1">6.134132790171573e-05</Real>
+    <Real Name="Cell 1 7 2">0.00065176373199879337</Real>
+    <Real Name="Cell 1 7 3">0.0003930919108619452</Real>
+    <Real Name="Cell 1 7 4">5.4236217391545922e-06</Real>
+    <Real Name="Cell 13 3 0">0.00023538906135106544</Real>
+    <Real Name="Cell 13 3 1">0.0012417563660168706</Real>
+    <Real Name="Cell 13 3 2">0.00040798642369712474</Real>
+    <Real Name="Cell 13 3 3">2.4312020556926323e-07</Real>
+    <Real Name="Cell 13 4 0">0.0042274625993731756</Real>
+    <Real Name="Cell 13 4 1">0.022301285220049618</Real>
+    <Real Name="Cell 13 4 2">0.0073272196139109414</Real>
+    <Real Name="Cell 13 4 3">4.3663098459070614e-06</Real>
+    <Real Name="Cell 13 5 0">0.003657579428520089</Real>
+    <Real Name="Cell 13 5 1">0.019294960069547899</Real>
+    <Real Name="Cell 13 5 2">0.0063394736436138566</Real>
+    <Real Name="Cell 13 5 3">3.7777093695169178e-06</Real>
+    <Real Name="Cell 13 6 0">0.00012066276418625477</Real>
+    <Real Name="Cell 13 6 1">0.00063653661180970646</Real>
+    <Real Name="Cell 13 6 2">0.00020913788156170309</Real>
+    <Real Name="Cell 13 6 3">1.2462582528321472e-07</Real>
+    <Real Name="Cell 14 3 0">0.0049145714059317565</Real>
+    <Real Name="Cell 14 3 1">0.025926014975090592</Real>
+    <Real Name="Cell 14 3 2">0.0085181460871702145</Real>
+    <Real Name="Cell 14 3 3">5.0759861296738361e-06</Real>
+    <Real Name="Cell 14 4 0">0.08826309383824435</Real>
+    <Real Name="Cell 14 4 1">0.4656174676465622</Real>
+    <Real Name="Cell 14 4 2">0.15298138236679812</Real>
+    <Real Name="Cell 14 4 3">9.1162016599103174e-05</Real>
+    <Real Name="Cell 14 5 0">0.076364785904473306</Real>
+    <Real Name="Cell 14 5 1">0.40284989664395854</Real>
+    <Real Name="Cell 14 5 2">0.13235872439754579</Real>
+    <Real Name="Cell 14 5 3">7.8872919331025219e-05</Real>
+    <Real Name="Cell 14 6 0">0.0025192579775235591</Real>
+    <Real Name="Cell 14 6 1">0.013289932052377872</Real>
+    <Real Name="Cell 14 6 2">0.0043664860496102917</Real>
+    <Real Name="Cell 14 6 3">2.6020007635956435e-06</Real>
+    <Real Name="Cell 15 1 1">1.5579618390928022e-10</Real>
+    <Real Name="Cell 15 1 2">2.9237227494856138e-08</Real>
+    <Real Name="Cell 15 1 3">6.3461693803501172e-08</Real>
+    <Real Name="Cell 15 1 4">8.3189348961108985e-09</Real>
+    <Real Name="Cell 15 2 1">1.0537900433489441e-06</Real>
+    <Real Name="Cell 15 2 2">0.00019775772715426666</Real>
+    <Real Name="Cell 15 2 3">0.00042924864644393508</Real>
+    <Real Name="Cell 15 2 4">5.626845629219268e-05</Real>
+    <Real Name="Cell 15 3 0">0.0046521768734949787</Real>
+    <Real Name="Cell 15 3 1">0.02454648184631009</Real>
+    <Real Name="Cell 15 3 2">0.0087384564427777679</Real>
+    <Real Name="Cell 15 3 3">0.001459651435021985</Real>
+    <Real Name="Cell 15 3 4">0.00019047553736359761</Real>
+    <Real Name="Cell 15 4 0">0.083550627312443893</Real>
+    <Real Name="Cell 15 4 1">0.44097542629927661</Real>
+    <Real Name="Cell 15 4 2">0.14605532868375404</Real>
+    <Real Name="Cell 15 4 3">0.00074127306681089457</Real>
+    <Real Name="Cell 15 4 4">4.0399780738420634e-05</Real>
+    <Real Name="Cell 15 5 0">0.072287583512449072</Real>
+    <Real Name="Cell 15 5 1">0.38181599694312202</Real>
+    <Real Name="Cell 15 5 2">0.12769840335756452</Real>
+    <Real Name="Cell 15 5 3">0.00083538124283651029</Real>
+    <Real Name="Cell 15 5 4">2.9576422658338407e-07</Real>
+    <Real Name="Cell 15 6 0">0.0023847519413914848</Real>
+    <Real Name="Cell 15 6 1">0.012643144570544053</Real>
+    <Real Name="Cell 15 6 2">0.0044515902324904679</Real>
+    <Real Name="Cell 15 6 3">0.00010306232161466888</Real>
+    <Real Name="Cell 15 6 4">3.9112524662635974e-08</Real>
+    <Real Name="Cell 2 0 0">0.039204049865150054</Real>
+    <Real Name="Cell 2 0 1">0.27665180841072834</Real>
+    <Real Name="Cell 2 0 13">0.0011142203247297578</Real>
+    <Real Name="Cell 2 0 2">0.18892778412908051</Real>
+    <Real Name="Cell 2 0 3">0.0042553152342553356</Real>
+    <Real Name="Cell 2 1 0">0.049741413483468042</Real>
+    <Real Name="Cell 2 1 1">0.65323372369663812</Real>
+    <Real Name="Cell 2 1 13">0.00013538532301635305</Real>
+    <Real Name="Cell 2 1 2">0.47405486342880254</Real>
+    <Real Name="Cell 2 1 3">0.010722404053741445</Real>
+    <Real Name="Cell 2 1 4">0.00052091375150695163</Real>
+    <Real Name="Cell 2 1 5">0.041941020388234954</Real>
+    <Real Name="Cell 2 1 6">0.072043281602603954</Real>
+    <Real Name="Cell 2 1 7">0.007099267354360372</Real>
+    <Real Name="Cell 2 10 0">7.1442929248053273e-05</Real>
+    <Real Name="Cell 2 10 1">7.3581984906150396e-05</Real>
+    <Real Name="Cell 2 10 13">3.8021711445589364e-06</Real>
+    <Real Name="Cell 2 10 2">7.4493163488209558e-06</Real>
+    <Real Name="Cell 2 10 3">2.0415374459620007e-08</Real>
+    <Real Name="Cell 2 11 0">0.010079636463766932</Real>
+    <Real Name="Cell 2 11 1">0.0094525634469115501</Real>
+    <Real Name="Cell 2 11 13">0.00054761059821526121</Real>
+    <Real Name="Cell 2 11 2">0.00078292983107846941</Real>
+    <Real Name="Cell 2 11 3">1.0980741518645826e-05</Real>
+    <Real Name="Cell 2 2 0">0.0081983598974018444</Real>
+    <Real Name="Cell 2 2 1">0.11659517003468504</Real>
+    <Real Name="Cell 2 2 2">0.091103123292234203</Real>
+    <Real Name="Cell 2 2 3">0.010793304055686917</Real>
+    <Real Name="Cell 2 2 4">0.0057023123423931973</Real>
+    <Real Name="Cell 2 2 5">0.36785582044635079</Real>
+    <Real Name="Cell 2 2 6">0.63187638775253607</Real>
+    <Real Name="Cell 2 2 7">0.06226617266419187</Real>
+    <Real Name="Cell 2 3 0">0.0016778584421366038</Real>
+    <Real Name="Cell 2 3 1">0.032036430604903146</Real>
+    <Real Name="Cell 2 3 2">0.043840291535881599</Real>
+    <Real Name="Cell 2 3 3">0.030804821703040206</Real>
+    <Real Name="Cell 2 3 4">0.0062086164085601156</Real>
+    <Real Name="Cell 2 3 5">0.19060590689508433</Real>
+    <Real Name="Cell 2 3 6">0.32740917837598099</Real>
+    <Real Name="Cell 2 3 7">0.032263456631305656</Real>
+    <Real Name="Cell 2 4 0">0.00037613719788839146</Real>
+    <Real Name="Cell 2 4 1">0.029470369111757898</Real>
+    <Real Name="Cell 2 4 2">0.13146240221710898</Real>
+    <Real Name="Cell 2 4 3">0.050684445721015721</Real>
+    <Real Name="Cell 2 4 4">0.0010166091404921454</Real>
+    <Real Name="Cell 2 4 5">0.0016113988045921457</Real>
+    <Real Name="Cell 2 4 6">0.0027679454810283144</Real>
+    <Real Name="Cell 2 4 7">0.00027275804981381329</Real>
+    <Real Name="Cell 2 5 0">1.1546917062218504e-07</Real>
+    <Real Name="Cell 2 5 1">0.058569944450123292</Real>
+    <Real Name="Cell 2 5 2">0.38321377342230895</Real>
+    <Real Name="Cell 2 5 3">0.16853388911122885</Real>
+    <Real Name="Cell 2 5 4">0.0014011685649805391</Real>
+    <Real Name="Cell 2 6 1">0.013131393009735775</Real>
+    <Real Name="Cell 2 6 2">0.10792576797876144</Real>
+    <Real Name="Cell 2 6 3">0.056817724704946018</Real>
+    <Real Name="Cell 2 6 4">0.00066173103103508589</Real>
+    <Real Name="Cell 2 7 0">5.9098707380832857e-07</Real>
+    <Real Name="Cell 2 7 1">5.0787026388975193e-05</Real>
+    <Real Name="Cell 2 7 2">0.00049735505993768502</Real>
+    <Real Name="Cell 2 7 3">0.00029890166452569041</Real>
+    <Real Name="Cell 2 7 4">4.1239543714625355e-06</Real>
+    <Real Name="Cell 2 8 0">2.1864464480098968e-05</Real>
+    <Real Name="Cell 2 8 1">0.00015334969064619266</Real>
+    <Real Name="Cell 2 8 2">6.5633996924396618e-05</Real>
+    <Real Name="Cell 2 8 3">2.4871665817479734e-07</Real>
+    <Real Name="Cell 2 9 0">2.7776655075961438e-05</Real>
+    <Real Name="Cell 2 9 1">0.00019481572333782598</Real>
+    <Real Name="Cell 2 9 2">8.3381547967253339e-05</Real>
+    <Real Name="Cell 2 9 3">3.1597009074040129e-07</Real>
+    <Real Name="Cell 3 0 0">0.47912946209747515</Real>
+    <Real Name="Cell 3 0 1">0.91990835507739344</Real>
+    <Real Name="Cell 3 0 13">0.024037891640896713</Real>
+    <Real Name="Cell 3 0 2">0.40186257222397703</Real>
+    <Real Name="Cell 3 0 3">0.008785844542180966</Real>
+    <Real Name="Cell 3 1 0">0.15640164199786069</Real>
+    <Real Name="Cell 3 1 1">1.4832677885127843</Real>
+    <Real Name="Cell 3 1 13">0.0029207667928909924</Real>
+    <Real Name="Cell 3 1 2">1.0582056900769019</Real>
+    <Real Name="Cell 3 1 3">0.024595101295715377</Real>
+    <Real Name="Cell 3 1 4">3.2119954280957093e-05</Real>
+    <Real Name="Cell 3 1 5">0.0025869498258800847</Real>
+    <Real Name="Cell 3 1 6">0.0044436771702856866</Real>
+    <Real Name="Cell 3 1 7">0.00043788749716233656</Real>
+    <Real Name="Cell 3 10 0">0.0049112158978242716</Real>
+    <Real Name="Cell 3 10 1">0.025222912512218112</Real>
+    <Real Name="Cell 3 10 13">8.2027024587995315e-05</Real>
+    <Real Name="Cell 3 10 2">0.010276743373912343</Real>
+    <Real Name="Cell 3 10 3">3.8774626069356451e-05</Real>
+    <Real Name="Cell 3 11 0">0.21650925726023235</Real>
+    <Real Name="Cell 3 11 1">0.19089953249076932</Real>
+    <Real Name="Cell 3 11 13">0.011814004761129914</Real>
+    <Real Name="Cell 3 11 2">0.0074100092484539696</Real>
+    <Real Name="Cell 3 11 3">2.26716665228627e-05</Real>
+    <Real Name="Cell 3 2 0">0.056532521058634988</Real>
+    <Real Name="Cell 3 2 1">0.93418053191533734</Real>
+    <Real Name="Cell 3 2 2">0.77242019261172157</Real>
+    <Real Name="Cell 3 2 3">0.02372084682759755</Real>
+    <Real Name="Cell 3 2 4">0.00028171732650632329</Real>
+    <Real Name="Cell 3 2 5">0.022689589853650934</Real>
+    <Real Name="Cell 3 2 6">0.038974552744374745</Real>
+    <Real Name="Cell 3 2 7">0.0038406186363800403</Real>
+    <Real Name="Cell 3 3 0">0.037588244043927535</Real>
+    <Real Name="Cell 3 3 1">0.72746360502384166</Real>
+    <Real Name="Cell 3 3 2">0.68557111467741128</Real>
+    <Real Name="Cell 3 3 3">0.030091062110324043</Real>
+    <Real Name="Cell 3 3 4">0.00014598840119149094</Real>
+    <Real Name="Cell 3 3 5">0.011756698170182624</Real>
+    <Real Name="Cell 3 3 6">0.020194814268965147</Real>
+    <Real Name="Cell 3 3 7">0.001990031304485349</Real>
+    <Real Name="Cell 3 4 0">0.0070246411523578632</Real>
+    <Real Name="Cell 3 4 1">0.17426735629017845</Real>
+    <Real Name="Cell 3 4 2">0.19878554833932208</Real>
+    <Real Name="Cell 3 4 3">0.013240277078022018</Real>
+    <Real Name="Cell 3 4 4">1.7475484977519544e-05</Real>
+    <Real Name="Cell 3 4 5">9.9392142069399457e-05</Real>
+    <Real Name="Cell 3 4 6">0.00017072870459299545</Real>
+    <Real Name="Cell 3 4 7">1.6823896580045288e-05</Real>
+    <Real Name="Cell 3 5 0">5.6149750152812813e-05</Real>
+    <Real Name="Cell 3 5 1">0.0030456374401335302</Real>
+    <Real Name="Cell 3 5 2">0.0099012447635933119</Real>
+    <Real Name="Cell 3 5 3">0.004363553291023399</Real>
+    <Real Name="Cell 3 5 4">6.7621776851363994e-05</Real>
+    <Real Name="Cell 3 6 1">0.00021623759631415483</Real>
+    <Real Name="Cell 3 6 2">0.0023717795830038644</Real>
+    <Real Name="Cell 3 6 3">0.0014696976434452284</Real>
+    <Real Name="Cell 3 6 4">2.220729040611576e-05</Real>
+    <Real Name="Cell 3 7 0">0.0011224532199527251</Real>
+    <Real Name="Cell 3 7 1">0.007873660323692246</Real>
+    <Real Name="Cell 3 7 2">0.003381842069657122</Real>
+    <Real Name="Cell 3 7 3">2.0245792489656967e-05</Real>
+    <Real Name="Cell 3 7 4">1.0316899992173508e-07</Real>
+    <Real Name="Cell 3 8 0">0.041526861831479897</Real>
+    <Real Name="Cell 3 8 1">0.29125485424812941</Real>
+    <Real Name="Cell 3 8 2">0.12465770310578665</Real>
+    <Real Name="Cell 3 8 3">0.00047238395930589356</Real>
+    <Real Name="Cell 3 9 0">0.052755800103406157</Real>
+    <Real Name="Cell 3 9 1">0.37001069168711215</Real>
+    <Real Name="Cell 3 9 2">0.15836537066264197</Real>
+    <Real Name="Cell 3 9 3">0.00060011743315276556</Real>
+    <Real Name="Cell 4 0 0">0.42953393306754173</Real>
+    <Real Name="Cell 4 0 1">0.43802035858157973</Real>
+    <Real Name="Cell 4 0 13">0.02318682269759989</Real>
+    <Real Name="Cell 4 0 2">0.060646069022436661</Real>
+    <Real Name="Cell 4 0 3">0.0010862242272653689</Real>
+    <Real Name="Cell 4 1 0">0.07239641094376241</Real>
+    <Real Name="Cell 4 1 1">0.36256509394910369</Real>
+    <Real Name="Cell 4 1 13">0.0028173561466838587</Real>
+    <Real Name="Cell 4 1 2">0.25044574353069737</Real>
+    <Real Name="Cell 4 1 3">0.0067702105943121</Real>
+    <Real Name="Cell 4 10 0">0.011947517585427198</Real>
+    <Real Name="Cell 4 10 1">0.074899596623516598</Real>
+    <Real Name="Cell 4 10 13">7.9122832565633588e-05</Real>
+    <Real Name="Cell 4 10 2">0.031556836204469231</Real>
+    <Real Name="Cell 4 10 3">0.00011942041227735595</Real>
+    <Real Name="Cell 4 11 0">0.20875947484206031</Real>
+    <Real Name="Cell 4 11 1">0.1829812203328243</Real>
+    <Real Name="Cell 4 11 13">0.01139572629068984</Real>
+    <Real Name="Cell 4 11 2">0.0063038695772131776</Real>
+    <Real Name="Cell 4 11 3">2.8029762342575523e-06</Real>
+    <Real Name="Cell 4 2 0">0.064322248760643158</Real>
+    <Real Name="Cell 4 2 1">1.1328378637970524</Real>
+    <Real Name="Cell 4 2 2">0.97604860162715812</Real>
+    <Real Name="Cell 4 2 3">0.032752082412234672</Real>
+    <Real Name="Cell 4 3 0">0.05664611465083845</Real>
+    <Real Name="Cell 4 3 1">1.4111503874271834</Real>
+    <Real Name="Cell 4 3 2">1.5575693598920775</Real>
+    <Real Name="Cell 4 3 3">0.087664742935699605</Real>
+    <Real Name="Cell 4 3 4">2.9473652718122413e-06</Real>
+    <Real Name="Cell 4 4 0">0.019956660100731011</Real>
+    <Real Name="Cell 4 4 1">0.73943559381681567</Real>
+    <Real Name="Cell 4 4 2">1.094615567563646</Real>
+    <Real Name="Cell 4 4 3">0.17302479750547023</Real>
+    <Real Name="Cell 4 4 4">0.0022712607122903914</Real>
+    <Real Name="Cell 4 5 0">0.00058448254061990561</Real>
+    <Real Name="Cell 4 5 1">0.057060646568843514</Real>
+    <Real Name="Cell 4 5 2">0.46508059214329511</Real>
+    <Real Name="Cell 4 5 3">0.3066602706090148</Real>
+    <Real Name="Cell 4 5 4">0.0063262355242172229</Real>
+    <Real Name="Cell 4 6 1">0.005711269904622643</Real>
+    <Real Name="Cell 4 6 2">0.074807871825573441</Real>
+    <Real Name="Cell 4 6 3">0.052584479433026465</Real>
+    <Real Name="Cell 4 6 4">0.0010927350349774119</Real>
+    <Real Name="Cell 4 7 0">0.0034569985549063702</Real>
+    <Real Name="Cell 4 7 1">0.024246176230007868</Real>
+    <Real Name="Cell 4 7 2">0.010377415496587604</Real>
+    <Real Name="Cell 4 7 3">3.9324682691131902e-05</Real>
+    <Real Name="Cell 4 8 0">0.12789691257446686</Real>
+    <Real Name="Cell 4 8 1">0.89702411855315956</Real>
+    <Real Name="Cell 4 8 2">0.38392824915483065</Real>
+    <Real Name="Cell 4 8 3">0.0014548763687008736</Real>
+    <Real Name="Cell 4 9 0">0.16248046820880935</Real>
+    <Real Name="Cell 4 9 1">1.1395810566752411</Real>
+    <Real Name="Cell 4 9 2">0.48774313957691978</Real>
+    <Real Name="Cell 4 9 3">0.0018482775605299685</Real>
+    <Real Name="Cell 5 0 0">0.01729105660838327</Real>
+    <Real Name="Cell 5 0 1">0.015142683813029854</Real>
+    <Real Name="Cell 5 0 13">0.00094393719829337266</Real>
+    <Real Name="Cell 5 0 2">0.00051189039038528463</Real>
+    <Real Name="Cell 5 1 0">0.0028805673038345345</Real>
+    <Real Name="Cell 5 1 1">0.015349370121486038</Real>
+    <Real Name="Cell 5 1 13">0.00011469476876496123</Real>
+    <Real Name="Cell 5 1 2">0.011494076482990032</Real>
+    <Real Name="Cell 5 1 3">0.00036044085717739011</Real>
+    <Real Name="Cell 5 10 0">0.002073580858346971</Real>
+    <Real Name="Cell 5 10 1">0.014181208340325416</Real>
+    <Real Name="Cell 5 10 13">3.2210961315010522e-06</Real>
+    <Real Name="Cell 5 10 2">0.0060492182591495997</Real>
+    <Real Name="Cell 5 10 3">2.2916582378535227e-05</Real>
+    <Real Name="Cell 5 11 0">0.0084981090749598875</Real>
+    <Real Name="Cell 5 11 1">0.0074422391670597443</Real>
+    <Real Name="Cell 5 11 13">0.00046392082639530244</Real>
+    <Real Name="Cell 5 11 2">0.00025158094559755685</Real>
+    <Real Name="Cell 5 2 0">0.0057595155073241148</Real>
+    <Real Name="Cell 5 2 1">0.11215849848576423</Real>
+    <Real Name="Cell 5 2 2">0.10522642388864858</Real>
+    <Real Name="Cell 5 2 3">0.0043850876005894369</Real>
+    <Real Name="Cell 5 3 0">0.012829031413087565</Real>
+    <Real Name="Cell 5 3 1">0.46599366235353873</Real>
+    <Real Name="Cell 5 3 2">0.59850364197295436</Real>
+    <Real Name="Cell 5 3 3">0.040257965301610792</Real>
+    <Real Name="Cell 5 3 4">6.4183043953738888e-06</Real>
+    <Real Name="Cell 5 4 0">0.0096154361251026225</Real>
+    <Real Name="Cell 5 4 1">0.41609069805215393</Real>
+    <Real Name="Cell 5 4 2">0.85585704834134446</Real>
+    <Real Name="Cell 5 4 3">0.27367824045973532</Real>
+    <Real Name="Cell 5 4 4">0.0049459911712164944</Real>
+    <Real Name="Cell 5 5 0">0.00035322686967433889</Real>
+    <Real Name="Cell 5 5 1">0.086426421979336018</Real>
+    <Real Name="Cell 5 5 2">0.96226232910242926</Real>
+    <Real Name="Cell 5 5 3">0.66426243850893629</Real>
+    <Real Name="Cell 5 5 4">0.013776271865444051</Real>
+    <Real Name="Cell 5 6 1">0.012437097323015922</Real>
+    <Real Name="Cell 5 6 2">0.16290471260503855</Real>
+    <Real Name="Cell 5 6 3">0.1145101351031125</Real>
+    <Real Name="Cell 5 6 4">0.0023795849618809487</Real>
+    <Real Name="Cell 5 7 0">0.00066339238539884831</Real>
+    <Real Name="Cell 5 7 1">0.0046528016805784918</Real>
+    <Real Name="Cell 5 7 2">0.0019914091114633633</Real>
+    <Real Name="Cell 5 7 3">7.5463424821215634e-06</Real>
+    <Real Name="Cell 5 8 0">0.024543208963019512</Real>
+    <Real Name="Cell 5 8 1">0.17213746558346391</Real>
+    <Real Name="Cell 5 8 2">0.073675204945442802</Real>
+    <Real Name="Cell 5 8 3">0.00027918840270357793</Real>
+    <Real Name="Cell 5 9 0">0.031179736894244411</Real>
+    <Real Name="Cell 5 9 1">0.21868374647428904</Real>
+    <Real Name="Cell 5 9 2">0.09359711312769689</Real>
+    <Real Name="Cell 5 9 3">0.00035468144990079368</Real>
+    <Real Name="Cell 6 2 0">7.2679924277060463e-06</Real>
+    <Real Name="Cell 6 2 1">0.00029672255276678392</Real>
+    <Real Name="Cell 6 2 2">0.0003938627615148788</Real>
+    <Real Name="Cell 6 2 3">2.7185815466323189e-05</Real>
+    <Real Name="Cell 6 3 0">0.00014426908848683313</Real>
+    <Real Name="Cell 6 3 1">0.0058943337071926567</Real>
+    <Real Name="Cell 6 3 2">0.00787596055564313</Real>
+    <Real Name="Cell 6 3 3">0.00058027617419253942</Real>
+    <Real Name="Cell 6 3 4">8.4451863901227645e-07</Real>
+    <Real Name="Cell 6 4 0">0.00013259128059905746</Real>
+    <Real Name="Cell 6 4 1">0.0088145809942466007</Real>
+    <Real Name="Cell 6 4 2">0.051738077221165343</Real>
+    <Real Name="Cell 6 4 3">0.031813303597487373</Real>
+    <Real Name="Cell 6 4 4">0.00065079209011855614</Real>
+    <Real Name="Cell 6 5 0">4.9272131271541582e-06</Real>
+    <Real Name="Cell 6 5 1">0.0096752686701172558</Real>
+    <Real Name="Cell 6 5 2">0.12436166478492172</Real>
+    <Real Name="Cell 6 5 3">0.087247922527886476</Real>
+    <Real Name="Cell 6 5 4">0.001812677874058696</Real>
+    <Real Name="Cell 6 6 1">0.0016364696744621716</Real>
+    <Real Name="Cell 6 6 2">0.02143495504467717</Real>
+    <Real Name="Cell 6 6 3">0.015067210511252014</Real>
+    <Real Name="Cell 6 6 4">0.00031310510216222171</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_9.xml b/src/gromacs/ewald/tests/refdata/SaneInput13_PmeSplineAndSpreadTest_ReproducesOutputs_9.xml
new file mode 100644 (file)
index 0000000..068304a
--- /dev/null
@@ -0,0 +1,891 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">52</Int>
+      <Real>0.0054123159943235263</Real>
+      <Real>0.36084277594281844</Real>
+      <Real>0.58111725161983196</Real>
+      <Real>0.052627656443025993</Real>
+      <Real>0.00062205452524004593</Real>
+      <Real>0.25438976300486782</Real>
+      <Real>0.64447149064098475</Real>
+      <Real>0.10051669182890735</Real>
+      <Real>0.024891858917245911</Real>
+      <Real>0.49802017341064697</Real>
+      <Real>0.45984614005605218</Real>
+      <Real>0.01724182761605484</Real>
+      <Real>0.020559388675760314</Real>
+      <Real>0.47778968945400813</Real>
+      <Real>0.4805412211639824</Real>
+      <Real>0.021109700706249193</Real>
+      <Real>0.0050227837091489976</Real>
+      <Real>0.35561657185579465</Real>
+      <Real>0.58489300257397614</Real>
+      <Real>0.054467641861080135</Real>
+      <Real>0.16354820572788292</Real>
+      <Real>0.66662739921061565</Real>
+      <Real>0.1698243538569289</Real>
+      <Real>4.1204572502199554e-08</Real>
+      <Real>5.6794329827889662e-05</Real>
+      <Real>0.20385948121805342</Real>
+      <Real>0.66195834921021379</Real>
+      <Real>0.13412537524190493</Real>
+      <Real>0.026497465234508667</Real>
+      <Real>0.50477796538117836</Real>
+      <Real>0.45268455140448349</Real>
+      <Real>0.016040017979829454</Real>
+      <Real>0.11970209227194881</Real>
+      <Real>0.65632444186467664</Real>
+      <Real>0.22378348242665025</Real>
+      <Real>0.00018998343672421792</Real>
+      <Real>1.8040946492467145e-05</Real>
+      <Real>0.19157724901219744</Real>
+      <Real>0.66444949362911709</Real>
+      <Real>0.14395521641219289</Real>
+      <Real>0.001160158143288331</Real>
+      <Real>0.27688297482515234</Real>
+      <Real>0.63369030614677468</Real>
+      <Real>0.088266560884784587</Real>
+      <Real>0.0016855235775882218</Real>
+      <Real>0.293119235440649</Real>
+      <Real>0.62495790184480637</Real>
+      <Real>0.080237339136956284</Real>
+      <Real>0.092439038491503631</Real>
+      <Real>0.63768398171489615</Real>
+      <Real>0.26893092472363433</Real>
+      <Real>0.0009460550699658196</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">52</Int>
+      <Real>0.0024733439646709445</Real>
+      <Real>0.31231186278375422</Real>
+      <Real>0.61369779027616556</Real>
+      <Real>0.07151700297540918</Real>
+      <Real>0.00062471242253069026</Real>
+      <Real>0.25452634093632676</Real>
+      <Real>0.64441097396686975</Real>
+      <Real>0.10043797267427278</Real>
+      <Real>7.289005458467352e-07</Real>
+      <Real>0.17497486665431677</Real>
+      <Real>0.66640142158691007</Real>
+      <Real>0.15862298285822721</Real>
+      <Real>0.021648416398585668</Real>
+      <Real>0.48317956558304431</Real>
+      <Real>0.47513304751147684</Real>
+      <Real>0.020038970506893111</Real>
+      <Real>0.0019215517592169318</Real>
+      <Real>0.29937429416896921</Real>
+      <Real>0.62139623115375597</Real>
+      <Real>0.077307922918057798</Real>
+      <Real>0.00028967042316330595</Real>
+      <Real>0.23314124699518871</Real>
+      <Real>0.65308005085125465</Real>
+      <Real>0.11348903173039328</Real>
+      <Real>0.021357444482793631</Real>
+      <Real>0.4817611904602529</Real>
+      <Real>0.47656349751006521</Real>
+      <Real>0.020317867546888163</Real>
+      <Real>0.0024613020578055349</Real>
+      <Real>0.31205017372916932</Real>
+      <Real>0.61385783324636978</Real>
+      <Real>0.071630690966655336</Real>
+      <Real>0.0018810327659186724</Real>
+      <Real>0.29833626902374022</Real>
+      <Real>0.6219946571821019</Real>
+      <Real>0.077788041028239135</Real>
+      <Real>0.069444581465373606</Real>
+      <Real>0.61071432620806088</Real>
+      <Real>0.31713888551728886</Real>
+      <Real>0.0027022068092765858</Real>
+      <Real>0.054524288877065188</Real>
+      <Real>0.58500686501315868</Real>
+      <Real>0.35545761192153524</Real>
+      <Real>0.0050112341882408307</Real>
+      <Real>0.04103265979952906</Real>
+      <Real>0.55335032593988764</Real>
+      <Real>0.39695035467352918</Real>
+      <Real>0.0086666595870540392</Real>
+      <Real>0.0072059979806885803</Real>
+      <Real>0.38213175806759764</Real>
+      <Real>0.56509802591992941</Real>
+      <Real>0.045564218031784426</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">52</Int>
+      <Real>0.034832530108168232</Real>
+      <Real>0.53497749355313284</Real>
+      <Real>0.41899007512213859</Real>
+      <Real>0.011199901216560273</Real>
+      <Real>0.045425396100255505</Real>
+      <Real>0.56475658468753465</Real>
+      <Real>0.38257130546239138</Real>
+      <Real>0.0072467137498184323</Real>
+      <Real>0.15311696790993051</Real>
+      <Real>0.66590081604794882</Real>
+      <Real>0.18097860854363881</Real>
+      <Real>3.6074984818065711e-06</Real>
+      <Real>0.13278743328419851</Real>
+      <Real>0.66153895078859903</Real>
+      <Real>0.20560891053133856</Real>
+      <Real>6.4705395863929661e-05</Real>
+      <Real>0.0046491606241226236</Real>
+      <Real>0.35034753315960182</Real>
+      <Real>0.58863616852548795</Real>
+      <Real>0.056367137690787474</Real>
+      <Real>0.13313999577356062</Real>
+      <Real>0.66165140994918059</Real>
+      <Real>0.20514604572452869</Real>
+      <Real>6.2548552730021432e-05</Real>
+      <Real>0.023723982790674208</Real>
+      <Real>0.49287077841202898</Real>
+      <Real>0.46521766067000814</Real>
+      <Real>0.018187578127288623</Real>
+      <Real>0.1044409359397518</Real>
+      <Real>0.64735622242948376</Real>
+      <Real>0.24770245320892417</Real>
+      <Real>0.00050038842184013438</Real>
+      <Real>0.057771240463032621</Real>
+      <Real>0.59130676852003206</Real>
+      <Real>0.34653174148930771</Real>
+      <Real>0.0043902495276275291</Real>
+      <Real>0.013510487389683298</Real>
+      <Real>0.43618088842905678</Real>
+      <Real>0.51989364331139076</Real>
+      <Real>0.030414980869869036</Real>
+      <Real>0.0096515085445540213</Real>
+      <Real>0.40599484651128087</Real>
+      <Real>0.54594101121095151</Real>
+      <Real>0.038412633733213512</Real>
+      <Real>0.00059061979071704568</Real>
+      <Real>0.25274618408825861</Real>
+      <Real>0.6451947777439907</Real>
+      <Real>0.10146841837703359</Real>
+      <Real>0.047346988432876699</Real>
+      <Real>0.5693865171291177</Real>
+      <Real>0.37656304856624395</Real>
+      <Real>0.0067034458717617042</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">52</Int>
+      <Real>-0.05089318151490263</Real>
+      <Real>-0.66636020694373166</Real>
+      <Real>0.48539995843217121</Real>
+      <Real>0.23185343002646308</Real>
+      <Real>-0.012030669800701029</Real>
+      <Real>-0.6190251708243375</Real>
+      <Real>0.27414235105077805</Real>
+      <Real>0.35691348957426045</Real>
+      <Real>-0.14074805168117607</Real>
+      <Real>-0.60831790858555568</Real>
+      <Real>0.63887997221463966</Real>
+      <Real>0.11018598805209209</Real>
+      <Real>-0.12390180576498261</Real>
+      <Real>-0.62609334880433165</Real>
+      <Real>0.62389211490361118</Real>
+      <Real>0.12610303966570308</Real>
+      <Real>-0.048421007610068734</Real>
+      <Real>-0.66593147458280633</Real>
+      <Real>0.47712597199581885</Real>
+      <Real>0.23722651019705621</Real>
+      <Real>-0.4937434649966933</Real>
+      <Real>-0.012493374471729157</Real>
+      <Real>0.50621714393353823</Real>
+      <Real>1.9695534884260206e-05</Real>
+      <Real>-0.0024393502229682756</Real>
+      <Real>-0.56252964396689942</Real>
+      <Real>0.13237733860270362</Real>
+      <Real>0.43259165558716406</Real>
+      <Real>-0.1467372554828546</Real>
+      <Real>-0.60152111142180242</Real>
+      <Real>0.6432539892921687</Real>
+      <Real>0.10500437761248832</Real>
+      <Real>-0.40099473052793144</Real>
+      <Real>-0.19255445138805583</Real>
+      <Real>0.58809309435990598</Real>
+      <Real>0.0054560875560812957</Real>
+      <Real>-0.0011356479385134484</Real>
+      <Real>-0.54425117067744921</Real>
+      <Real>0.09190928517043867</Real>
+      <Real>0.45347753344552394</Real>
+      <Real>-0.018228417474878484</Real>
+      <Real>-0.63625147780230906</Real>
+      <Real>0.32718820802925352</Real>
+      <Real>0.327291687247934</Real>
+      <Real>-0.023382667777312426</Real>
+      <Real>-0.64610494012693187</Real>
+      <Real>0.36235788358580107</Real>
+      <Real>0.30712972431844326</Real>
+      <Real>-0.33752642870877159</Real>
+      <Real>-0.30903671750162287</Real>
+      <Real>0.6306527211295605</Real>
+      <Real>0.015910425080833981</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">52</Int>
+      <Real>-0.030194454142256941</Real>
+      <Real>-0.65515818531091607</Real>
+      <Real>0.40089973304860305</Real>
+      <Real>0.28445290640456999</Real>
+      <Real>-0.01206491498369449</Real>
+      <Real>-0.61914304815603194</Real>
+      <Real>0.27448084126314726</Real>
+      <Real>0.35672712187657912</Real>
+      <Real>-0.00013371589069704963</Real>
+      <Real>-0.51595219392509017</Real>
+      <Real>0.032305535522271389</Real>
+      <Real>0.48378037429351578</Real>
+      <Real>-0.1282394341754734</Real>
+      <Real>-0.62171912534690232</Real>
+      <Real>0.6281565532202249</Real>
+      <Real>0.12180200630215082</Real>
+      <Real>-0.025517545395280731</Real>
+      <Real>-0.64935683858350313</Real>
+      <Real>0.37526631335284844</Real>
+      <Real>0.29960807062593542</Real>
+      <Real>-0.0072278135424509414</Real>
+      <Real>-0.59854811548376918</Real>
+      <Real>0.2187796715948912</Real>
+      <Real>0.38699625743132893</Real>
+      <Real>-0.12708775130249114</Real>
+      <Real>-0.62289495797147854</Real>
+      <Real>0.62705316985043058</Real>
+      <Real>0.12292953942353911</Real>
+      <Real>-0.030096369796856738</Real>
+      <Real>-0.65505297748755487</Real>
+      <Real>0.4003950643656799</Real>
+      <Real>0.28475428291873167</Real>
+      <Real>-0.025157553891160367</Real>
+      <Real>-0.64883763185385734</Real>
+      <Real>0.37314792538119579</Real>
+      <Real>0.30084726036382192</Real>
+      <Real>-0.27893076277274931</Real>
+      <Real>-0.41010899401128365</Real>
+      <Real>0.65701027634081521</Real>
+      <Real>0.032029480443217746</Real>
+      <Real>-0.23739096068816348</Real>
+      <Real>-0.47687132651455788</Real>
+      <Real>0.66591553509360613</Real>
+      <Real>0.048346752109115224</Real>
+      <Real>-0.19640714569586232</Real>
+      <Real>-0.53752754886430476</Real>
+      <Real>0.66427653481619653</Real>
+      <Real>0.069658159743970549</Real>
+      <Real>-0.061593317344401516</Real>
+      <Real>-0.66619958396398582</Real>
+      <Real>0.51717911996117616</Real>
+      <Real>0.21061378134721118</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">52</Int>
+      <Real>-0.17608709093451638</Real>
+      <Real>-0.56518137974936</Real>
+      <Real>0.65862403230226907</Real>
+      <Real>0.082644438381607302</Real>
+      <Real>-0.2101857747525209</Real>
+      <Real>-0.51780333888066454</Real>
+      <Real>0.66616400201889181</Real>
+      <Real>0.061825111614293639</Real>
+      <Real>-0.47251948092640972</Real>
+      <Real>-0.054572701590098971</Real>
+      <Real>0.5267038459594271</Real>
+      <Real>0.00038833655708161568</Real>
+      <Real>-0.42971002799396185</Real>
+      <Real>-0.1379190279792466</Real>
+      <Real>0.56496813994037876</Real>
+      <Real>0.0026609160328297157</Real>
+      <Real>-0.045988990006773256</Real>
+      <Real>-0.66531174669673987</Real>
+      <Real>0.46859046341379951</Real>
+      <Real>0.24271027328971362</Real>
+      <Real>-0.43047030413140991</Real>
+      <Real>-0.13645794054934218</Real>
+      <Real>0.56432679349291404</Real>
+      <Real>0.0026014511878380275</Real>
+      <Real>-0.13631047718434056</Real>
+      <Real>-0.61319973431306718</Real>
+      <Real>0.63533090017915594</Real>
+      <Real>0.11417931131825178</Real>
+      <Real>-0.36614351063849898</Real>
+      <Real>-0.25730717397165043</Real>
+      <Real>0.61304487985879785</Real>
+      <Real>0.010405804751351597</Real>
+      <Real>-0.24672432328322841</Real>
+      <Real>-0.4622860300687846</Real>
+      <Real>0.66474502998725449</Real>
+      <Real>0.044265323364758566</Real>
+      <Real>-0.093652242762162843</Real>
+      <Real>-0.65183015405206579</Real>
+      <Real>0.58461703639062024</Real>
+      <Real>0.16086536042360849</Real>
+      <Real>-0.074840090544688584</Real>
+      <Real>-0.6623649582331097</Real>
+      <Real>0.54925018810028514</Real>
+      <Real>0.18795486067751316</Real>
+      <Real>-0.011621874147413528</Real>
+      <Real>-0.61759338285041854</Real>
+      <Real>0.27005238814307769</Real>
+      <Real>0.3591628688547544</Real>
+      <Real>-0.21607229169952644</Real>
+      <Real>-0.50916017302453009</Real>
+      <Real>0.66653722114763947</Real>
+      <Real>0.058695243576417054</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Int Name="X">18</Int>
+      <Int Name="Y">2</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">2</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">4</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">1</Int>
+      <Int Name="Z">3</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">16</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">10</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">16</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">15</Int>
+      <Int Name="Z">10</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">2</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">18</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">3</Int>
+      <Int Name="Y">1</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 1 3">1.4852484278813739e-07</Real>
+    <Real Name="Cell 0 1 4">1.1192410090920781e-05</Real>
+    <Real Name="Cell 0 1 5">1.8804920169037745e-05</Real>
+    <Real Name="Cell 0 1 6">1.8007380129012918e-06</Real>
+    <Real Name="Cell 0 2 1">3.3574637039544062e-05</Real>
+    <Real Name="Cell 0 2 2">0.00051565806774855677</Real>
+    <Real Name="Cell 0 2 3">0.00042699915833960749</Real>
+    <Real Name="Cell 0 2 4">0.0017545527247491788</Real>
+    <Real Name="Cell 0 2 5">0.0029297726046181032</Real>
+    <Real Name="Cell 0 2 6">0.00028055173065712658</Real>
+    <Real Name="Cell 0 3 1">0.0042395063468268837</Real>
+    <Real Name="Cell 0 3 2">0.065112711373102039</Real>
+    <Real Name="Cell 0 3 3">0.051043782790330998</Real>
+    <Real Name="Cell 0 3 4">0.0049825822205819331</Real>
+    <Real Name="Cell 0 3 5">0.0060811822862108528</Real>
+    <Real Name="Cell 0 3 6">0.00058232717861743583</Real>
+    <Real Name="Cell 0 4 0">4.4495503882781831e-12</Real>
+    <Real Name="Cell 0 4 1">0.0083306975938243367</Real>
+    <Real Name="Cell 0 4 2">0.12794751609666455</Real>
+    <Real Name="Cell 0 4 3">0.10021344216990317</Real>
+    <Real Name="Cell 0 4 4">0.0031289098483462422</Real>
+    <Real Name="Cell 0 4 5">0.00075656006242612935</Real>
+    <Real Name="Cell 0 4 6">7.2447340972860833e-05</Real>
+    <Real Name="Cell 0 5 0">4.0920647233743564e-05</Real>
+    <Real Name="Cell 0 5 1">0.018480631465922048</Real>
+    <Real Name="Cell 0 5 2">0.059608248467664236</Real>
+    <Real Name="Cell 0 5 3">0.018707184490057021</Real>
+    <Real Name="Cell 0 5 4">0.00031215139967351969</Real>
+    <Real Name="Cell 0 6 0">0.00055180150534747305</Real>
+    <Real Name="Cell 0 6 1">0.23686386639064808</Real>
+    <Real Name="Cell 0 6 2">0.60596895389480154</Real>
+    <Real Name="Cell 0 6 3">0.095664785114731615</Real>
+    <Real Name="Cell 0 6 4">1.7283506352435327e-08</Real>
+    <Real Name="Cell 0 7 0">0.00039583384252009905</Real>
+    <Real Name="Cell 0 7 1">0.17218384128729677</Real>
+    <Real Name="Cell 0 7 2">0.44455867696811047</Real>
+    <Real Name="Cell 0 7 3">0.071306187928466533</Real>
+    <Real Name="Cell 0 7 4">6.5825186345327837e-08</Real>
+    <Real Name="Cell 0 8 0">8.6422445965792202e-06</Real>
+    <Real Name="Cell 0 8 1">0.0043633360324719225</Real>
+    <Real Name="Cell 0 8 2">0.012332995580887908</Real>
+    <Real Name="Cell 0 8 3">0.002270774430897566</Real>
+    <Real Name="Cell 0 8 4">1.5668315023143775e-08</Real>
+    <Real Name="Cell 1 1 3">1.0515661928967893e-05</Real>
+    <Real Name="Cell 1 1 4">0.00079243040071335486</Real>
+    <Real Name="Cell 1 1 5">0.0013314013964714636</Real>
+    <Real Name="Cell 1 1 6">0.00012749350082344484</Real>
+    <Real Name="Cell 1 2 1">5.4070088418910366e-05</Real>
+    <Real Name="Cell 1 2 2">0.00083043868156340811</Real>
+    <Real Name="Cell 1 2 3">0.0022887140434028584</Real>
+    <Real Name="Cell 1 2 4">0.12347661093162883</Real>
+    <Real Name="Cell 1 2 5">0.20742993334025839</Real>
+    <Real Name="Cell 1 2 6">0.019863257201931415</Real>
+    <Real Name="Cell 1 3 1">0.0068274895348972679</Real>
+    <Real Name="Cell 1 3 2">0.10486040569826598</Real>
+    <Real Name="Cell 1 3 3">0.085526408479558322</Real>
+    <Real Name="Cell 1 3 4">0.2584534135331904</Real>
+    <Real Name="Cell 1 3 5">0.43055192552157256</Real>
+    <Real Name="Cell 1 3 6">0.041229168315805434</Real>
+    <Real Name="Cell 1 4 1">0.013416125802436393</Real>
+    <Real Name="Cell 1 4 2">0.20605236922763329</Real>
+    <Real Name="Cell 1 4 3">0.16180162662213007</Real>
+    <Real Name="Cell 1 4 4">0.036194844667286404</Real>
+    <Real Name="Cell 1 4 5">0.053564977387523222</Real>
+    <Real Name="Cell 1 4 6">0.0051293220112003752</Real>
+    <Real Name="Cell 1 5 0">8.7239050302150001e-05</Real>
+    <Real Name="Cell 1 5 1">0.03889604365906639</Real>
+    <Real Name="Cell 1 5 2">0.11931268078999198</Real>
+    <Real Name="Cell 1 5 3">0.033793911774638682</Real>
+    <Real Name="Cell 1 5 4">0.00050270249548867261</Real>
+    <Real Name="Cell 1 6 0">0.0011764715510822188</Real>
+    <Real Name="Cell 1 6 1">0.51812901157850511</Real>
+    <Real Name="Cell 1 6 2">1.349010945795253</Real>
+    <Real Name="Cell 1 6 3">0.21946541530760227</Real>
+    <Real Name="Cell 1 6 4">3.4579718852657778e-07</Real>
+    <Real Name="Cell 1 7 0">0.00084395143107973095</Real>
+    <Real Name="Cell 1 7 1">0.41705369514315466</Real>
+    <Real Name="Cell 1 7 2">1.165035073098555</Real>
+    <Real Name="Cell 1 7 3">0.21106053689593204</Real>
+    <Real Name="Cell 1 7 4">1.3169876475467115e-06</Real>
+    <Real Name="Cell 1 8 0">1.8426081939618633e-05</Real>
+    <Real Name="Cell 1 8 1">0.021190578196421634</Real>
+    <Real Name="Cell 1 8 2">0.077993616489624176</Real>
+    <Real Name="Cell 1 8 3">0.018892131821834048</Real>
+    <Real Name="Cell 1 8 4">3.1348148769525742e-07</Real>
+    <Real Name="Cell 16 4 0">1.7661049201756804e-05</Real>
+    <Real Name="Cell 16 4 1">8.7768202467111508e-05</Real>
+    <Real Name="Cell 16 4 2">2.7212667283306599e-05</Real>
+    <Real Name="Cell 16 4 3">8.2970790320766862e-09</Real>
+    <Real Name="Cell 16 5 0">0.014214495871467179</Real>
+    <Real Name="Cell 16 5 1">0.070640239850005684</Real>
+    <Real Name="Cell 16 5 2">0.021902115912326089</Real>
+    <Real Name="Cell 16 5 3">6.6779042569542913e-06</Real>
+    <Real Name="Cell 16 6 0">0.039817937864741325</Real>
+    <Real Name="Cell 16 6 1">0.19787889113563242</Real>
+    <Real Name="Cell 16 6 2">0.061352657061438727</Real>
+    <Real Name="Cell 16 6 3">1.8706282598726599e-05</Real>
+    <Real Name="Cell 16 7 0">0.0069193649505605234</Real>
+    <Real Name="Cell 16 7 1">0.034386418212583932</Real>
+    <Real Name="Cell 16 7 2">0.01066156229227007</Real>
+    <Real Name="Cell 16 7 3">3.2506855731352154e-06</Real>
+    <Real Name="Cell 17 4 0">7.1986967049254814e-05</Real>
+    <Real Name="Cell 17 4 1">0.00035774582963869398</Real>
+    <Real Name="Cell 17 4 2">0.00011091964926131698</Real>
+    <Real Name="Cell 17 4 3">3.3819143362544609e-08</Real>
+    <Real Name="Cell 17 5 0">0.057938712147367184</Real>
+    <Real Name="Cell 17 5 1">0.28793173952134038</Real>
+    <Real Name="Cell 17 5 2">0.089273682354768666</Real>
+    <Real Name="Cell 17 5 3">2.7219338342346502e-05</Real>
+    <Real Name="Cell 17 6 0">0.16229911078857545</Real>
+    <Real Name="Cell 17 6 1">0.80656030415831037</Real>
+    <Real Name="Cell 17 6 2">0.25007527309457284</Real>
+    <Real Name="Cell 17 6 3">7.6247369772042118e-05</Real>
+    <Real Name="Cell 17 7 0">0.028203539382485897</Real>
+    <Real Name="Cell 17 7 1">0.14016007353430293</Real>
+    <Real Name="Cell 17 7 2">0.04345684815548094</Real>
+    <Real Name="Cell 17 7 3">1.3249892040247265e-05</Real>
+    <Real Name="Cell 18 2 1">5.0358925595209205e-07</Real>
+    <Real Name="Cell 18 2 2">7.7344056573817727e-06</Real>
+    <Real Name="Cell 18 2 3">6.0575243752560386e-06</Real>
+    <Real Name="Cell 18 2 4">1.6192191330545645e-07</Real>
+    <Real Name="Cell 18 3 1">6.3588769233399731e-05</Real>
+    <Real Name="Cell 18 3 2">0.00097663190922313726</Real>
+    <Real Name="Cell 18 3 3">0.0007648902653723304</Real>
+    <Real Name="Cell 18 3 4">2.0446058086653773e-05</Real>
+    <Real Name="Cell 18 4 0">1.8338790424360122e-05</Real>
+    <Real Name="Cell 18 4 1">0.00021608924506664109</Real>
+    <Real Name="Cell 18 4 2">0.0019473542253280766</Real>
+    <Real Name="Cell 18 4 3">0.0015030301833394641</Real>
+    <Real Name="Cell 18 4 4">4.0176830158787832e-05</Real>
+    <Real Name="Cell 18 5 0">0.014760211196061928</Real>
+    <Real Name="Cell 18 5 1">0.073466300813910868</Real>
+    <Real Name="Cell 18 5 2">0.023223275326072778</Real>
+    <Real Name="Cell 18 5 3">0.00022251013668336917</Real>
+    <Real Name="Cell 18 5 4">4.6819892910410096e-06</Real>
+    <Real Name="Cell 18 6 0">0.041349120723697577</Real>
+    <Real Name="Cell 18 6 1">0.20683029603754097</Real>
+    <Real Name="Cell 18 6 2">0.067173217850274594</Real>
+    <Real Name="Cell 18 6 3">0.00056453946205176498</Real>
+    <Real Name="Cell 18 7 0">0.0071871711303569345</Real>
+    <Real Name="Cell 18 7 1">0.036680037022704497</Real>
+    <Real Name="Cell 18 7 2">0.013557175380755782</Real>
+    <Real Name="Cell 18 7 3">0.00039441834193904121</Real>
+    <Real Name="Cell 18 8 0">4.969550022508899e-08</Real>
+    <Real Name="Cell 18 8 1">2.1266385322102851e-05</Real>
+    <Real Name="Cell 18 8 2">5.4287509031277304e-05</Real>
+    <Real Name="Cell 18 8 3">8.5376817498333205e-06</Real>
+    <Real Name="Cell 2 0 0">0.012592024317158865</Real>
+    <Real Name="Cell 2 0 1">0.12881877238921938</Real>
+    <Real Name="Cell 2 0 10">2.2107816325567422e-07</Real>
+    <Real Name="Cell 2 0 2">0.075488971487600753</Real>
+    <Real Name="Cell 2 0 3">0.00095637194731275767</Real>
+    <Real Name="Cell 2 1 0">0.02623801181817411</Real>
+    <Real Name="Cell 2 1 1">0.26855373164199592</Real>
+    <Real Name="Cell 2 1 10">1.8837138724171884e-09</Real>
+    <Real Name="Cell 2 1 2">0.15738424562743988</Real>
+    <Real Name="Cell 2 1 3">0.0020112140364247442</Real>
+    <Real Name="Cell 2 1 4">0.0013033335144799743</Real>
+    <Real Name="Cell 2 1 5">0.0021897949140827987</Real>
+    <Real Name="Cell 2 1 6">0.00020969229897286986</Real>
+    <Real Name="Cell 2 15 0">1.5628969123845743e-06</Real>
+    <Real Name="Cell 2 15 1">1.8628513799083989e-06</Real>
+    <Real Name="Cell 2 15 10">4.840995923089627e-08</Real>
+    <Real Name="Cell 2 15 2">1.0898111529589788e-07</Real>
+    <Real Name="Cell 2 16 0">9.3093200561282708e-05</Real>
+    <Real Name="Cell 2 16 1">0.00082854089110981604</Real>
+    <Real Name="Cell 2 16 10">4.2573020111292651e-07</Real>
+    <Real Name="Cell 2 16 2">0.00047691895241848105</Real>
+    <Real Name="Cell 2 16 3">6.0299975433345314e-06</Real>
+    <Real Name="Cell 2 2 0">0.0032814136477268075</Real>
+    <Real Name="Cell 2 2 1">0.033591275848255837</Real>
+    <Real Name="Cell 2 2 2">0.019758342383185207</Real>
+    <Real Name="Cell 2 2 3">0.0030028660754793249</Real>
+    <Real Name="Cell 2 2 4">0.20305858248835423</Real>
+    <Real Name="Cell 2 2 5">0.34116609330653302</Real>
+    <Real Name="Cell 2 2 6">0.032669681519926365</Real>
+    <Real Name="Cell 2 3 0">1.5178159172396139e-05</Real>
+    <Real Name="Cell 2 3 1">0.00081136338598438254</Real>
+    <Real Name="Cell 2 3 2">0.0096313453891943689</Real>
+    <Real Name="Cell 2 3 3">0.013033568770678041</Real>
+    <Real Name="Cell 2 3 4">0.42167407442096549</Real>
+    <Real Name="Cell 2 3 5">0.70814137588739057</Real>
+    <Real Name="Cell 2 3 6">0.067810821987334055</Real>
+    <Real Name="Cell 2 4 0">3.9629275690581939e-05</Real>
+    <Real Name="Cell 2 4 1">0.0017542849472656223</Real>
+    <Real Name="Cell 2 4 2">0.019070141132790173</Real>
+    <Real Name="Cell 2 4 3">0.015323066368989988</Real>
+    <Real Name="Cell 2 4 4">0.05282641643694802</Real>
+    <Real Name="Cell 2 4 5">0.088099888859229175</Real>
+    <Real Name="Cell 2 4 6">0.0084363463059205796</Real>
+    <Real Name="Cell 2 5 0">1.8087312463302894e-05</Real>
+    <Real Name="Cell 2 5 1">0.0050486387709806424</Real>
+    <Real Name="Cell 2 5 2">0.01451428910116921</Real>
+    <Real Name="Cell 2 5 3">0.0036321982620402299</Real>
+    <Real Name="Cell 2 5 4">4.5526190883183145e-05</Real>
+    <Real Name="Cell 2 6 0">0.00015105875581281753</Real>
+    <Real Name="Cell 2 6 1">0.078189980353204305</Real>
+    <Real Name="Cell 2 6 2">0.22394040492032885</Real>
+    <Real Name="Cell 2 6 3">0.04196761353982939</Real>
+    <Real Name="Cell 2 6 4">3.1929128753398059e-07</Real>
+    <Real Name="Cell 2 7 0">0.00010835356588143395</Real>
+    <Real Name="Cell 2 7 1">0.097981793961272212</Real>
+    <Real Name="Cell 2 7 2">0.34283182009632313</Real>
+    <Real Name="Cell 2 7 3">0.079620548239234562</Real>
+    <Real Name="Cell 2 7 4">1.2160384630172265e-06</Real>
+    <Real Name="Cell 2 8 0">2.365695003119852e-06</Real>
+    <Real Name="Cell 2 8 1">0.013297912855161896</Real>
+    <Real Name="Cell 2 8 2">0.056013766199145658</Real>
+    <Real Name="Cell 2 8 3">0.014927495424731353</Real>
+    <Real Name="Cell 2 8 4">2.894526362425686e-07</Real>
+    <Real Name="Cell 3 0 0">0.1447951839891552</Real>
+    <Real Name="Cell 3 0 1">0.79660311578495036</Real>
+    <Real Name="Cell 3 0 10">0.0023476343855282716</Real>
+    <Real Name="Cell 3 0 2">0.41918698287268091</Real>
+    <Real Name="Cell 3 0 3">0.0052437703687671765</Real>
+    <Real Name="Cell 3 1 0">0.1446716993295708</Real>
+    <Real Name="Cell 3 1 1">1.4752131212023569</Real>
+    <Real Name="Cell 3 1 10">2.0003203365991888e-05</Real>
+    <Real Name="Cell 3 1 2">0.86428185741592523</Real>
+    <Real Name="Cell 3 1 3">0.010957405675058065</Real>
+    <Real Name="Cell 3 1 4">0.00012137177702559288</Real>
+    <Real Name="Cell 3 1 5">0.00020392270826387809</Real>
+    <Real Name="Cell 3 1 6">1.9527409271811653e-05</Real>
+    <Real Name="Cell 3 10 0">3.4670315698056223e-05</Real>
+    <Real Name="Cell 3 10 1">0.00021489700756491175</Real>
+    <Real Name="Cell 3 10 2">8.2227549711833898e-05</Real>
+    <Real Name="Cell 3 10 3">1.6610943209908981e-07</Real>
+    <Real Name="Cell 3 11 0">0.0043955913507298505</Real>
+    <Real Name="Cell 3 11 1">0.027245192572705992</Real>
+    <Real Name="Cell 3 11 2">0.010425019185080851</Real>
+    <Real Name="Cell 3 11 3">2.1059778900436783e-05</Real>
+    <Real Name="Cell 3 12 0">0.0086469049196471748</Real>
+    <Real Name="Cell 3 12 1">0.053596108212959549</Real>
+    <Real Name="Cell 3 12 2">0.020507854913292635</Real>
+    <Real Name="Cell 3 12 3">4.1428306512303993e-05</Real>
+    <Real Name="Cell 3 13 0">0.001009001988036391</Real>
+    <Real Name="Cell 3 13 1">0.0062540967248309156</Real>
+    <Real Name="Cell 3 13 2">0.0023930489082697659</Real>
+    <Real Name="Cell 3 13 3">4.8342434686562201e-06</Real>
+    <Real Name="Cell 3 15 0">0.016596440274866547</Real>
+    <Real Name="Cell 3 15 1">0.019781664051297939</Real>
+    <Real Name="Cell 3 15 10">0.00051406653293496155</Real>
+    <Real Name="Cell 3 15 2">0.0011572731104427807</Real>
+    <Real Name="Cell 3 16 0">0.14638862663064428</Real>
+    <Real Name="Cell 3 16 1">0.17841832432159288</Real>
+    <Real Name="Cell 3 16 10">0.0045208393464654878</Real>
+    <Real Name="Cell 3 16 2">0.012787054165212907</Real>
+    <Real Name="Cell 3 16 3">3.3062369228126233e-05</Real>
+    <Real Name="Cell 3 2 0">0.026686988989901881</Real>
+    <Real Name="Cell 3 2 1">0.28872478564464071</Real>
+    <Real Name="Cell 3 2 2">0.17708332784615444</Real>
+    <Real Name="Cell 3 2 3">0.002849546069958088</Real>
+    <Real Name="Cell 3 2 4">0.018909503688767565</Real>
+    <Real Name="Cell 3 2 5">0.031770789706128871</Real>
+    <Real Name="Cell 3 2 6">0.0030423351021674036</Real>
+    <Real Name="Cell 3 3 0">0.019018610348532101</Real>
+    <Real Name="Cell 3 3 1">0.23226704011615046</Real>
+    <Real Name="Cell 3 3 2">0.15584315155684203</Real>
+    <Real Name="Cell 3 3 3">0.0034581918334634859</Real>
+    <Real Name="Cell 3 3 4">0.039249509908009184</Real>
+    <Real Name="Cell 3 3 5">0.065945037261697384</Real>
+    <Real Name="Cell 3 3 6">0.0063148226257749148</Real>
+    <Real Name="Cell 3 4 0">0.016977492023025901</Real>
+    <Real Name="Cell 3 4 1">0.22180346034633217</Real>
+    <Real Name="Cell 3 4 2">0.16060458227326968</Real>
+    <Real Name="Cell 3 4 3">0.0041903671756561792</Real>
+    <Real Name="Cell 3 4 4">0.0048830326519780972</Real>
+    <Real Name="Cell 3 4 5">0.0082042239747577451</Real>
+    <Real Name="Cell 3 4 6">0.0007856272637640436</Real>
+    <Real Name="Cell 3 5 0">0.0026574508176976214</Real>
+    <Real Name="Cell 3 5 1">0.039825894173325861</Real>
+    <Real Name="Cell 3 5 2">0.033398431724949579</Real>
+    <Real Name="Cell 3 5 3">0.0012971878338948056</Real>
+    <Real Name="Cell 3 5 4">4.9871269748312929e-14</Real>
+    <Real Name="Cell 3 6 0">3.3736135172618111e-06</Real>
+    <Real Name="Cell 3 6 1">0.00064664470491959062</Real>
+    <Real Name="Cell 3 6 2">0.002394773361223148</Real>
+    <Real Name="Cell 3 6 3">0.0006135051211589985</Real>
+    <Real Name="Cell 3 6 4">1.1971755027231609e-08</Real>
+    <Real Name="Cell 3 7 1">0.0019352417670423301</Real>
+    <Real Name="Cell 3 7 2">0.0084163047996196894</Real>
+    <Real Name="Cell 3 7 3">0.0022873843896966226</Real>
+    <Real Name="Cell 3 7 4">4.5595088720935213e-08</Real>
+    <Real Name="Cell 3 8 1">0.00046064400779500169</Real>
+    <Real Name="Cell 3 8 2">0.0020033261165328712</Real>
+    <Real Name="Cell 3 8 3">0.00054446422694148528</Real>
+    <Real Name="Cell 3 8 4">1.0852961506861105e-08</Real>
+    <Real Name="Cell 4 0 0">0.28639936380806902</Real>
+    <Real Name="Cell 4 0 1">0.55413404081027673</Real>
+    <Real Name="Cell 4 0 10">0.0081423263291104473</Real>
+    <Real Name="Cell 4 0 2">0.15945607569211365</Real>
+    <Real Name="Cell 4 0 3">0.001787940718517914</Real>
+    <Real Name="Cell 4 1 0">0.052420932224019015</Real>
+    <Real Name="Cell 4 1 1">0.51831090169375649</Real>
+    <Real Name="Cell 4 1 10">6.9377331682256987e-05</Real>
+    <Real Name="Cell 4 1 2">0.30336716249047002</Real>
+    <Real Name="Cell 4 1 3">0.0038875071843456005</Real>
+    <Real Name="Cell 4 10 0">0.000660471153082068</Real>
+    <Real Name="Cell 4 10 1">0.0040937981533361286</Real>
+    <Real Name="Cell 4 10 2">0.0015664387093058056</Real>
+    <Real Name="Cell 4 10 3">3.1643925342867354e-06</Real>
+    <Real Name="Cell 4 11 0">0.08373622303234099</Real>
+    <Real Name="Cell 4 11 1">0.51902220652253772</Real>
+    <Real Name="Cell 4 11 2">0.19859710831704536</Real>
+    <Real Name="Cell 4 11 3">0.00040118978365128382</Real>
+    <Real Name="Cell 4 12 0">0.16472394750044236</Real>
+    <Real Name="Cell 4 12 1">1.0210083952050457</Real>
+    <Real Name="Cell 4 12 2">0.39067560560406223</Real>
+    <Real Name="Cell 4 12 3">0.00078921119757651402</Real>
+    <Real Name="Cell 4 13 0">0.019221535572514457</Real>
+    <Real Name="Cell 4 13 1">0.11914083826953564</Real>
+    <Real Name="Cell 4 13 2">0.045587694833575693</Real>
+    <Real Name="Cell 4 13 3">9.2092566616052958e-05</Real>
+    <Real Name="Cell 4 15 0">0.057561617538306228</Real>
+    <Real Name="Cell 4 15 1">0.068608964424525021</Real>
+    <Real Name="Cell 4 15 10">0.0017829426472167566</Real>
+    <Real Name="Cell 4 15 2">0.0040137831406867166</Real>
+    <Real Name="Cell 4 16 0">0.50636068817263258</Real>
+    <Real Name="Cell 4 16 1">0.60488401834051164</Real>
+    <Real Name="Cell 4 16 10">0.015679677153868782</Real>
+    <Real Name="Cell 4 16 2">0.036188098336917891</Real>
+    <Real Name="Cell 4 16 3">1.1273101611338928e-05</Real>
+    <Real Name="Cell 4 2 0">0.066052296032392988</Real>
+    <Real Name="Cell 4 2 1">0.78336482781740691</Real>
+    <Real Name="Cell 4 2 2">0.51335665149739507</Real>
+    <Real Name="Cell 4 2 3">0.0089501028968885944</Real>
+    <Real Name="Cell 4 3 0">0.10480564876387043</Real>
+    <Real Name="Cell 4 3 1">1.2743823695925314</Real>
+    <Real Name="Cell 4 3 2">0.85175618754233717</Real>
+    <Real Name="Cell 4 3 3">0.015801639074619279</Real>
+    <Real Name="Cell 4 4 0">0.061010906542406498</Real>
+    <Real Name="Cell 4 4 1">0.89439020566808269</Real>
+    <Real Name="Cell 4 4 2">0.70379612100417177</Real>
+    <Real Name="Cell 4 4 3">0.02113226045271871</Real>
+    <Real Name="Cell 4 5 0">0.020104281709067348</Real>
+    <Real Name="Cell 4 5 1">0.37775503800864418</Real>
+    <Real Name="Cell 4 5 2">0.34598301092016664</Real>
+    <Real Name="Cell 4 5 3">0.013736272788794244</Real>
+    <Real Name="Cell 4 5 4">1.1893971458531676e-07</Real>
+    <Real Name="Cell 4 6 0">0.00058023778672453518</Real>
+    <Real Name="Cell 4 6 1">0.01765902735533683</Real>
+    <Real Name="Cell 4 6 2">0.038790964977005835</Real>
+    <Real Name="Cell 4 6 3">0.0089039641842783984</Real>
+    <Real Name="Cell 4 6 4">2.6546625196870846e-06</Real>
+    <Real Name="Cell 4 7 1">0.005357133577463845</Real>
+    <Real Name="Cell 4 7 2">0.026688915045784911</Real>
+    <Real Name="Cell 4 7 3">0.0082950198764348507</Real>
+    <Real Name="Cell 4 7 4">2.6104537172870925e-06</Real>
+    <Real Name="Cell 4 8 1">0.00022593974955550041</Real>
+    <Real Name="Cell 4 8 2">0.0011256181489891861</Real>
+    <Real Name="Cell 4 8 3">0.00034984655251528251</Real>
+    <Real Name="Cell 4 8 4">1.1009717241161162e-07</Real>
+    <Real Name="Cell 5 0 0">0.056972048987246365</Real>
+    <Real Name="Cell 5 0 1">0.068086876618959347</Real>
+    <Real Name="Cell 5 0 10">0.0017640623704953126</Real>
+    <Real Name="Cell 5 0 2">0.0040910900563363422</Real>
+    <Real Name="Cell 5 0 3">1.5178918420600495e-06</Real>
+    <Real Name="Cell 5 1 0">0.0010031135325047212</Real>
+    <Real Name="Cell 5 1 1">0.0067313944853817295</Real>
+    <Real Name="Cell 5 1 10">1.503083212821962e-05</Real>
+    <Real Name="Cell 5 1 2">0.0040710169888644185</Real>
+    <Real Name="Cell 5 1 3">7.0586420194077576e-05</Real>
+    <Real Name="Cell 5 10 0">0.00059231010098228457</Real>
+    <Real Name="Cell 5 10 1">0.0036713155242108129</Real>
+    <Real Name="Cell 5 10 2">0.0014047812168053822</Real>
+    <Real Name="Cell 5 10 3">2.8378251688731499e-06</Real>
+    <Real Name="Cell 5 11 0">0.075094590412789972</Real>
+    <Real Name="Cell 5 11 1">0.46545877760570908</Real>
+    <Real Name="Cell 5 11 2">0.17810175771210765</Real>
+    <Real Name="Cell 5 11 3">0.00035978673732935292</Real>
+    <Real Name="Cell 5 12 0">0.14772432909884275</Real>
+    <Real Name="Cell 5 12 1">0.91563966548061526</Real>
+    <Real Name="Cell 5 12 2">0.35035762928756425</Real>
+    <Real Name="Cell 5 12 3">0.0007077640892437432</Real>
+    <Real Name="Cell 5 13 0">0.017237860613385392</Real>
+    <Real Name="Cell 5 13 1">0.10684542635547038</Real>
+    <Real Name="Cell 5 13 2">0.040883015108866695</Real>
+    <Real Name="Cell 5 13 3">8.2588553909627329e-05</Real>
+    <Real Name="Cell 5 15 0">0.012470917939156412</Real>
+    <Real Name="Cell 5 15 1">0.01486436277888396</Real>
+    <Real Name="Cell 5 15 10">0.00038628051807031871</Real>
+    <Real Name="Cell 5 15 2">0.00086959961018750846</Real>
+    <Real Name="Cell 5 16 0">0.10967273229018376</Real>
+    <Real Name="Cell 5 16 1">0.13072249298520022</Real>
+    <Real Name="Cell 5 16 10">0.0033970547642834183</Real>
+    <Real Name="Cell 5 16 2">0.0076482482606756675</Real>
+    <Real Name="Cell 5 16 3">9.5704229974411844e-09</Real>
+    <Real Name="Cell 5 2 0">0.025264205753332727</Real>
+    <Real Name="Cell 5 2 1">0.3038159746366968</Real>
+    <Real Name="Cell 5 2 2">0.20092548444720354</Real>
+    <Real Name="Cell 5 2 3">0.0035767032899450984</Real>
+    <Real Name="Cell 5 3 0">0.041739779619336732</Real>
+    <Real Name="Cell 5 3 1">0.52038674454903411</Real>
+    <Real Name="Cell 5 3 2">0.35644063738972892</Real>
+    <Real Name="Cell 5 3 3">0.0072181831762580121</Real>
+    <Real Name="Cell 5 4 0">0.053388420535682303</Real>
+    <Real Name="Cell 5 4 1">1.0340535029022566</Real>
+    <Real Name="Cell 5 4 2">0.94744786276377313</Real>
+    <Real Name="Cell 5 4 3">0.035698125343962862</Real>
+    <Real Name="Cell 5 5 0">0.044663399523051185</Real>
+    <Real Name="Cell 5 5 1">0.92711515781101317</Real>
+    <Real Name="Cell 5 5 2">0.89605359503052484</Real>
+    <Real Name="Cell 5 5 3">0.042675298794380062</Real>
+    <Real Name="Cell 5 5 4">2.7640982030982142e-06</Real>
+    <Real Name="Cell 5 6 0">0.0018612472781498015</Real>
+    <Real Name="Cell 5 6 1">0.16529506254790416</Real>
+    <Real Name="Cell 5 6 2">0.66727680980185566</Real>
+    <Real Name="Cell 5 6 3">0.19746686029335783</Real>
+    <Real Name="Cell 5 6 4">6.1693000744808424e-05</Real>
+    <Real Name="Cell 5 7 1">0.12449704749041782</Real>
+    <Real Name="Cell 5 7 2">0.62023675084387708</Real>
+    <Real Name="Cell 5 7 3">0.19277202417255557</Real>
+    <Real Name="Cell 5 7 4">6.0665610762404447e-05</Real>
+    <Real Name="Cell 5 8 1">0.0052507243516785509</Real>
+    <Real Name="Cell 5 8 2">0.026158790727246653</Real>
+    <Real Name="Cell 5 8 3">0.008130255151015604</Real>
+    <Real Name="Cell 5 8 4">2.5586020404550271e-06</Real>
+    <Real Name="Cell 6 1 0">1.6752139333715467e-06</Real>
+    <Real Name="Cell 6 1 1">2.0145826768282194e-05</Real>
+    <Real Name="Cell 6 1 2">1.3323416897895206e-05</Real>
+    <Real Name="Cell 6 1 3">2.3717888502871541e-07</Real>
+    <Real Name="Cell 6 10 0">2.0987384349463681e-05</Real>
+    <Real Name="Cell 6 10 1">0.00013008609822284559</Real>
+    <Real Name="Cell 6 10 2">4.9775756440938395e-05</Real>
+    <Real Name="Cell 6 10 3">1.0055294926922717e-07</Real>
+    <Real Name="Cell 6 11 0">0.0026608342976847379</Real>
+    <Real Name="Cell 6 11 1">0.016492648442500101</Real>
+    <Real Name="Cell 6 11 2">0.0063106977851975837</Real>
+    <Real Name="Cell 6 11 3">1.2748360238409143e-05</Real>
+    <Real Name="Cell 6 12 0">0.0052343312521979136</Real>
+    <Real Name="Cell 6 12 1">0.032443953856580915</Real>
+    <Real Name="Cell 6 12 2">0.012414257689393934</Real>
+    <Real Name="Cell 6 12 3">2.5078277316345857e-05</Real>
+    <Real Name="Cell 6 13 0">0.000610790877034902</Real>
+    <Real Name="Cell 6 13 1">0.0037858649129666648</Real>
+    <Real Name="Cell 6 13 2">0.0014486120530981437</Real>
+    <Real Name="Cell 6 13 3">2.9263686722431767e-06</Real>
+    <Real Name="Cell 6 2 0">8.8836056742474097e-05</Real>
+    <Real Name="Cell 6 2 1">0.0010683267218947118</Real>
+    <Real Name="Cell 6 2 2">0.00070653651809290767</Real>
+    <Real Name="Cell 6 2 3">1.2577520081940823e-05</Real>
+    <Real Name="Cell 6 3 0">0.00052757287491048198</Real>
+    <Real Name="Cell 6 3 1">0.0098110213634352086</Real>
+    <Real Name="Cell 6 3 2">0.0088141843515628353</Real>
+    <Real Name="Cell 6 3 3">0.000322340855692457</Real>
+    <Real Name="Cell 6 4 0">0.0089477397317942985</Real>
+    <Real Name="Cell 6 4 1">0.18579851404036285</Real>
+    <Real Name="Cell 6 4 2">0.17533806948335917</Real>
+    <Real Name="Cell 6 4 3">0.0068530079125408176</Real>
+    <Real Name="Cell 6 5 0">0.0088407248412974947</Real>
+    <Real Name="Cell 6 5 1">0.18937304256253962</Real>
+    <Real Name="Cell 6 5 2">0.20178552039832159</Real>
+    <Real Name="Cell 6 5 3">0.015611412376668892</Real>
+    <Real Name="Cell 6 5 4">2.7800163026788034e-06</Real>
+    <Real Name="Cell 6 6 0">0.00037691656470221498</Real>
+    <Real Name="Cell 6 6 1">0.13516506836567235</Real>
+    <Real Name="Cell 6 6 2">0.6417641808357567</Real>
+    <Real Name="Cell 6 6 3">0.19745458264448704</Real>
+    <Real Name="Cell 6 6 4">6.2048283103510618e-05</Real>
+    <Real Name="Cell 6 7 1">0.12521401058428347</Real>
+    <Real Name="Cell 6 7 2">0.62380861755700889</Real>
+    <Real Name="Cell 6 7 3">0.19388217441023198</Real>
+    <Real Name="Cell 6 7 4">6.1014976509305474e-05</Real>
+    <Real Name="Cell 6 8 1">0.005280962623606284</Real>
+    <Real Name="Cell 6 8 2">0.026309435966709337</Real>
+    <Real Name="Cell 6 8 3">0.008177076284564478</Real>
+    <Real Name="Cell 6 8 4">2.5733367130587029e-06</Real>
+    <Real Name="Cell 7 5 1">0.00025061972476839135</Real>
+    <Real Name="Cell 7 5 2">0.0012485722908384461</Real>
+    <Real Name="Cell 7 5 3">0.00038806118389988348</Real>
+    <Real Name="Cell 7 5 4">1.2212336741038272e-07</Real>
+    <Real Name="Cell 7 6 1">0.0055936807344506168</Real>
+    <Real Name="Cell 7 6 2">0.027867378656194021</Real>
+    <Real Name="Cell 7 6 3">0.0086612910064238005</Real>
+    <Real Name="Cell 7 6 4">2.7257197259353487e-06</Real>
+    <Real Name="Cell 7 7 1">0.0055005276784805789</Real>
+    <Real Name="Cell 7 7 2">0.027403295772859129</Real>
+    <Real Name="Cell 7 7 3">0.0085170522190856062</Real>
+    <Real Name="Cell 7 7 4">2.6803275889431705e-06</Real>
+    <Real Name="Cell 7 8 1">0.0002319874664554018</Real>
+    <Real Name="Cell 7 8 2">0.0011557475083244519</Real>
+    <Real Name="Cell 7 8 3">0.0003592108760226837</Real>
+    <Real Name="Cell 7 8 4">1.130441373946878e-07</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_0.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_0.xml
new file mode 100644 (file)
index 0000000..7a3da03
--- /dev/null
@@ -0,0 +1,173 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="X">
+    <Int Name="Length">64</Int>
+    <Real>1</Real>
+    <Real>0.99759236333609846</Real>
+    <Real>0.99039264020161522</Real>
+    <Real>0.97847016786610419</Real>
+    <Real>0.96193976625564348</Real>
+    <Real>0.94096063217417747</Real>
+    <Real>0.91573480615127245</Real>
+    <Real>0.88650522668136855</Real>
+    <Real>0.85355339059327373</Real>
+    <Real>0.81719664208182263</Real>
+    <Real>0.77778511650980098</Real>
+    <Real>0.73569836841299885</Real>
+    <Real>0.69134171618254503</Real>
+    <Real>0.64514233862723136</Real>
+    <Real>0.59754516100806421</Real>
+    <Real>0.54900857016478033</Real>
+    <Real>0.5</Real>
+    <Real>0.45099142983521967</Real>
+    <Real>0.4024548389919359</Real>
+    <Real>0.35485766137276892</Real>
+    <Real>0.30865828381745519</Real>
+    <Real>0.26430163158700121</Real>
+    <Real>0.22221488349019899</Real>
+    <Real>0.18280335791817731</Real>
+    <Real>0.1464466094067263</Real>
+    <Real>0.11349477331863152</Real>
+    <Real>0.084265193848727327</Real>
+    <Real>0.059039367825822531</Real>
+    <Real>0.038060233744356645</Real>
+    <Real>0.021529832133895557</Real>
+    <Real>0.009607359798384809</Real>
+    <Real>0.0024076366639015686</Real>
+    <Real>0.002407636663901563</Real>
+    <Real>0.0024076366639015573</Real>
+    <Real>0.009607359798384783</Real>
+    <Real>0.021529832133895539</Real>
+    <Real>0.038060233744356603</Real>
+    <Real>0.059039367825822482</Real>
+    <Real>0.084265193848727285</Real>
+    <Real>0.11349477331863143</Real>
+    <Real>0.14644660940672619</Real>
+    <Real>0.18280335791817706</Real>
+    <Real>0.22221488349019888</Real>
+    <Real>0.2643016315870011</Real>
+    <Real>0.30865828381745486</Real>
+    <Real>0.35485766137276881</Real>
+    <Real>0.40245483899193568</Real>
+    <Real>0.45099142983521989</Real>
+    <Real>0.49999999999999994</Real>
+    <Real>0.54900857016478011</Real>
+    <Real>0.59754516100806421</Real>
+    <Real>0.64514233862723114</Real>
+    <Real>0.69134171618254492</Real>
+    <Real>0.73569836841299885</Real>
+    <Real>0.77778511650980087</Real>
+    <Real>0.81719664208182274</Real>
+    <Real>0.85355339059327373</Real>
+    <Real>0.88650522668136833</Real>
+    <Real>0.91573480615127245</Real>
+    <Real>0.94096063217417725</Real>
+    <Real>0.96193976625564326</Real>
+    <Real>0.97847016786610441</Real>
+    <Real>0.9903926402016151</Real>
+    <Real>0.99759236333609846</Real>
+  </Sequence>
+  <Sequence Name="Y">
+    <Int Name="Length">32</Int>
+    <Real>1</Real>
+    <Real>0.99039264020161522</Real>
+    <Real>0.96193976625564348</Real>
+    <Real>0.91573480615127245</Real>
+    <Real>0.85355339059327373</Real>
+    <Real>0.77778511650980098</Real>
+    <Real>0.69134171618254503</Real>
+    <Real>0.59754516100806421</Real>
+    <Real>0.5</Real>
+    <Real>0.4024548389919359</Real>
+    <Real>0.30865828381745519</Real>
+    <Real>0.22221488349019899</Real>
+    <Real>0.1464466094067263</Real>
+    <Real>0.084265193848727327</Real>
+    <Real>0.038060233744356645</Real>
+    <Real>0.009607359798384809</Real>
+    <Real>0.0096073597983847951</Real>
+    <Real>0.009607359798384783</Real>
+    <Real>0.038060233744356603</Real>
+    <Real>0.084265193848727285</Real>
+    <Real>0.14644660940672619</Real>
+    <Real>0.22221488349019888</Real>
+    <Real>0.30865828381745486</Real>
+    <Real>0.40245483899193568</Real>
+    <Real>0.49999999999999994</Real>
+    <Real>0.59754516100806421</Real>
+    <Real>0.69134171618254492</Real>
+    <Real>0.77778511650980087</Real>
+    <Real>0.85355339059327373</Real>
+    <Real>0.91573480615127245</Real>
+    <Real>0.96193976625564326</Real>
+    <Real>0.9903926402016151</Real>
+  </Sequence>
+  <Sequence Name="Z">
+    <Int Name="Length">64</Int>
+    <Real>1</Real>
+    <Real>0.99759236333609846</Real>
+    <Real>0.99039264020161522</Real>
+    <Real>0.97847016786610419</Real>
+    <Real>0.96193976625564348</Real>
+    <Real>0.94096063217417747</Real>
+    <Real>0.91573480615127245</Real>
+    <Real>0.88650522668136855</Real>
+    <Real>0.85355339059327373</Real>
+    <Real>0.81719664208182263</Real>
+    <Real>0.77778511650980098</Real>
+    <Real>0.73569836841299885</Real>
+    <Real>0.69134171618254503</Real>
+    <Real>0.64514233862723136</Real>
+    <Real>0.59754516100806421</Real>
+    <Real>0.54900857016478033</Real>
+    <Real>0.5</Real>
+    <Real>0.45099142983521967</Real>
+    <Real>0.4024548389919359</Real>
+    <Real>0.35485766137276892</Real>
+    <Real>0.30865828381745519</Real>
+    <Real>0.26430163158700121</Real>
+    <Real>0.22221488349019899</Real>
+    <Real>0.18280335791817731</Real>
+    <Real>0.1464466094067263</Real>
+    <Real>0.11349477331863152</Real>
+    <Real>0.084265193848727327</Real>
+    <Real>0.059039367825822531</Real>
+    <Real>0.038060233744356645</Real>
+    <Real>0.021529832133895557</Real>
+    <Real>0.009607359798384809</Real>
+    <Real>0.0024076366639015686</Real>
+    <Real>0.002407636663901563</Real>
+    <Real>0.0024076366639015573</Real>
+    <Real>0.009607359798384783</Real>
+    <Real>0.021529832133895539</Real>
+    <Real>0.038060233744356603</Real>
+    <Real>0.059039367825822482</Real>
+    <Real>0.084265193848727285</Real>
+    <Real>0.11349477331863143</Real>
+    <Real>0.14644660940672619</Real>
+    <Real>0.18280335791817706</Real>
+    <Real>0.22221488349019888</Real>
+    <Real>0.2643016315870011</Real>
+    <Real>0.30865828381745486</Real>
+    <Real>0.35485766137276881</Real>
+    <Real>0.40245483899193568</Real>
+    <Real>0.45099142983521989</Real>
+    <Real>0.49999999999999994</Real>
+    <Real>0.54900857016478011</Real>
+    <Real>0.59754516100806421</Real>
+    <Real>0.64514233862723114</Real>
+    <Real>0.69134171618254492</Real>
+    <Real>0.73569836841299885</Real>
+    <Real>0.77778511650980087</Real>
+    <Real>0.81719664208182274</Real>
+    <Real>0.85355339059327373</Real>
+    <Real>0.88650522668136833</Real>
+    <Real>0.91573480615127245</Real>
+    <Real>0.94096063217417725</Real>
+    <Real>0.96193976625564326</Real>
+    <Real>0.97847016786610441</Real>
+    <Real>0.9903926402016151</Real>
+    <Real>0.99759236333609846</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_1.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_1.xml
new file mode 100644 (file)
index 0000000..208d08e
--- /dev/null
@@ -0,0 +1,173 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="X">
+    <Int Name="Length">64</Int>
+    <Real>1</Real>
+    <Real>0.99759313626102608</Real>
+    <Real>0.99040494896489739</Real>
+    <Real>0.97853199445156747</Real>
+    <Real>0.96213303679655804</Real>
+    <Real>0.94142587779030484</Real>
+    <Real>0.91668306539587419</Real>
+    <Real>0.8882266204150725</Real>
+    <Real>0.85642195165849222</Real>
+    <Real>0.82167115397292223</Real>
+    <Real>0.78440590014224809</Real>
+    <Real>0.74508014638808595</Real>
+    <Real>0.704162871796433</Real>
+    <Real>0.66213106482234474</Real>
+    <Real>0.61946315604830537</Real>
+    <Real>0.57663307743738934</Real>
+    <Real>0.53410510754183604</Real>
+    <Real>0.49232964455793721</Real>
+    <Real>0.45174004290269998</Real>
+    <Real>0.41275066727856663</Real>
+    <Real>0.37575638235588521</Real>
+    <Real>0.34113384114481293</Real>
+    <Real>0.30924521810841143</Real>
+    <Real>0.28044554827137741</Real>
+    <Real>0.25509573620985398</Real>
+    <Real>0.23358484501772991</Real>
+    <Real>0.21636788858636874</Real>
+    <Real>0.20402973233710939</Real>
+    <Real>0.1973930234488693</Real>
+    <Real>0.197700265275248</Real>
+    <Real>0.20692047834147811</Real>
+    <Real>0.22826483825615454</Real>
+    <Real>0.2670525537709178</Real>
+    <Real>0.22826483825615454</Real>
+    <Real>0.20692047834147811</Real>
+    <Real>0.197700265275248</Real>
+    <Real>0.1973930234488693</Real>
+    <Real>0.20402973233710939</Real>
+    <Real>0.21636788858636874</Real>
+    <Real>0.23358484501772991</Real>
+    <Real>0.25509573620985398</Real>
+    <Real>0.28044554827137741</Real>
+    <Real>0.30924521810841143</Real>
+    <Real>0.34113384114481293</Real>
+    <Real>0.37575638235588521</Real>
+    <Real>0.41275066727856663</Real>
+    <Real>0.45174004290269998</Real>
+    <Real>0.49232964455793721</Real>
+    <Real>0.53410510754183604</Real>
+    <Real>0.57663307743738934</Real>
+    <Real>0.61946315604830537</Real>
+    <Real>0.66213106482234474</Real>
+    <Real>0.704162871796433</Real>
+    <Real>0.74508014638808595</Real>
+    <Real>0.78440590014224809</Real>
+    <Real>0.82167115397292223</Real>
+    <Real>0.85642195165849222</Real>
+    <Real>0.8882266204150725</Real>
+    <Real>0.91668306539587419</Real>
+    <Real>0.94142587779030484</Real>
+    <Real>0.96213303679655804</Real>
+    <Real>0.97853199445156747</Real>
+    <Real>0.99040494896489739</Real>
+    <Real>0.99759313626102608</Real>
+  </Sequence>
+  <Sequence Name="Y">
+    <Int Name="Length">32</Int>
+    <Real>1</Real>
+    <Real>0.99040494896489739</Real>
+    <Real>0.96213303679655804</Real>
+    <Real>0.91668306539587419</Real>
+    <Real>0.85642195165849222</Real>
+    <Real>0.78440590014224809</Real>
+    <Real>0.704162871796433</Real>
+    <Real>0.61946315604830537</Real>
+    <Real>0.53410510754183604</Real>
+    <Real>0.45174004290269998</Real>
+    <Real>0.37575638235588521</Real>
+    <Real>0.30924521810841143</Real>
+    <Real>0.25509573620985398</Real>
+    <Real>0.21636788858636874</Real>
+    <Real>0.1973930234488693</Real>
+    <Real>0.20692047834147811</Real>
+    <Real>0.2670525537709178</Real>
+    <Real>0.20692047834147811</Real>
+    <Real>0.1973930234488693</Real>
+    <Real>0.21636788858636874</Real>
+    <Real>0.25509573620985398</Real>
+    <Real>0.30924521810841143</Real>
+    <Real>0.37575638235588521</Real>
+    <Real>0.45174004290269998</Real>
+    <Real>0.53410510754183604</Real>
+    <Real>0.61946315604830537</Real>
+    <Real>0.704162871796433</Real>
+    <Real>0.78440590014224809</Real>
+    <Real>0.85642195165849222</Real>
+    <Real>0.91668306539587419</Real>
+    <Real>0.96213303679655804</Real>
+    <Real>0.99040494896489739</Real>
+  </Sequence>
+  <Sequence Name="Z">
+    <Int Name="Length">64</Int>
+    <Real>1</Real>
+    <Real>0.99759313626102608</Real>
+    <Real>0.99040494896489739</Real>
+    <Real>0.97853199445156747</Real>
+    <Real>0.96213303679655804</Real>
+    <Real>0.94142587779030484</Real>
+    <Real>0.91668306539587419</Real>
+    <Real>0.8882266204150725</Real>
+    <Real>0.85642195165849222</Real>
+    <Real>0.82167115397292223</Real>
+    <Real>0.78440590014224809</Real>
+    <Real>0.74508014638808595</Real>
+    <Real>0.704162871796433</Real>
+    <Real>0.66213106482234474</Real>
+    <Real>0.61946315604830537</Real>
+    <Real>0.57663307743738934</Real>
+    <Real>0.53410510754183604</Real>
+    <Real>0.49232964455793721</Real>
+    <Real>0.45174004290269998</Real>
+    <Real>0.41275066727856663</Real>
+    <Real>0.37575638235588521</Real>
+    <Real>0.34113384114481293</Real>
+    <Real>0.30924521810841143</Real>
+    <Real>0.28044554827137741</Real>
+    <Real>0.25509573620985398</Real>
+    <Real>0.23358484501772991</Real>
+    <Real>0.21636788858636874</Real>
+    <Real>0.20402973233710939</Real>
+    <Real>0.1973930234488693</Real>
+    <Real>0.197700265275248</Real>
+    <Real>0.20692047834147811</Real>
+    <Real>0.22826483825615454</Real>
+    <Real>0.2670525537709178</Real>
+    <Real>0.22826483825615454</Real>
+    <Real>0.20692047834147811</Real>
+    <Real>0.197700265275248</Real>
+    <Real>0.1973930234488693</Real>
+    <Real>0.20402973233710939</Real>
+    <Real>0.21636788858636874</Real>
+    <Real>0.23358484501772991</Real>
+    <Real>0.25509573620985398</Real>
+    <Real>0.28044554827137741</Real>
+    <Real>0.30924521810841143</Real>
+    <Real>0.34113384114481293</Real>
+    <Real>0.37575638235588521</Real>
+    <Real>0.41275066727856663</Real>
+    <Real>0.45174004290269998</Real>
+    <Real>0.49232964455793721</Real>
+    <Real>0.53410510754183604</Real>
+    <Real>0.57663307743738934</Real>
+    <Real>0.61946315604830537</Real>
+    <Real>0.66213106482234474</Real>
+    <Real>0.704162871796433</Real>
+    <Real>0.74508014638808595</Real>
+    <Real>0.78440590014224809</Real>
+    <Real>0.82167115397292223</Real>
+    <Real>0.85642195165849222</Real>
+    <Real>0.8882266204150725</Real>
+    <Real>0.91668306539587419</Real>
+    <Real>0.94142587779030484</Real>
+    <Real>0.96213303679655804</Real>
+    <Real>0.97853199445156747</Real>
+    <Real>0.99040494896489739</Real>
+    <Real>0.99759313626102608</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_10.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_10.xml
new file mode 100644 (file)
index 0000000..8ea4170
--- /dev/null
@@ -0,0 +1,173 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="X">
+    <Int Name="Length">64</Int>
+    <Real>0.99999999999999956</Real>
+    <Real>0.99359456296950732</Real>
+    <Real>0.9746173395105846</Real>
+    <Real>0.94377114413720775</Real>
+    <Real>0.90218036114469657</Real>
+    <Real>0.85132452097735178</Real>
+    <Real>0.79295295531904542</Real>
+    <Real>0.7289872415404699</Real>
+    <Real>0.66141885238450659</Real>
+    <Real>0.59220942658258502</Real>
+    <Real>0.52320040489228981</Real>
+    <Real>0.45603754023519838</Real>
+    <Real>0.39211415200068039</Real>
+    <Real>0.33253514767267173</Real>
+    <Real>0.27810198156777877</Real>
+    <Real>0.22931704539006106</Real>
+    <Real>0.18640463592844536</Real>
+    <Real>0.14934471796128809</Real>
+    <Real>0.11791523482559967</Real>
+    <Real>0.091738699755794559</Real>
+    <Real>0.070329166320450678</Real>
+    <Real>0.053136331569776436</Real>
+    <Real>0.039584359326425025</Real>
+    <Real>0.029103910644517863</Real>
+    <Real>0.021156733405364819</Real>
+    <Real>0.015252915086482025</Real>
+    <Real>0.010961491220026948</Real>
+    <Real>0.0079155044959704057</Real>
+    <Real>0.0058128284706795742</Real>
+    <Real>0.0044141270290442821</Real>
+    <Real>0.0035392492112647795</Real>
+    <Real>0.003063195698103806</Real>
+    <Real>0.0029125724363819575</Real>
+    <Real>0.0030631956981038082</Real>
+    <Real>0.0035392492112647786</Real>
+    <Real>0.0044141270290442812</Real>
+    <Real>0.0058128284706795725</Real>
+    <Real>0.0079155044959703658</Real>
+    <Real>0.010961491220026993</Real>
+    <Real>0.015252915086482015</Real>
+    <Real>0.021156733405364836</Real>
+    <Real>0.029103910644517856</Real>
+    <Real>0.039584359326424984</Real>
+    <Real>0.053136331569776346</Real>
+    <Real>0.070329166320450651</Real>
+    <Real>0.091738699755794365</Real>
+    <Real>0.11791523482559939</Real>
+    <Real>0.14934471796128818</Real>
+    <Real>0.186404635928445</Real>
+    <Real>0.22931704539006126</Real>
+    <Real>0.2781019815677791</Real>
+    <Real>0.33253514767267195</Real>
+    <Real>0.39211415200068039</Real>
+    <Real>0.45603754023519832</Real>
+    <Real>0.52320040489228958</Real>
+    <Real>0.59220942658258446</Real>
+    <Real>0.66141885238450582</Real>
+    <Real>0.72898724154046912</Real>
+    <Real>0.79295295531904642</Real>
+    <Real>0.85132452097735112</Real>
+    <Real>0.90218036114469724</Real>
+    <Real>0.94377114413720775</Real>
+    <Real>0.9746173395105846</Real>
+    <Real>0.99359456296950754</Real>
+  </Sequence>
+  <Sequence Name="Y">
+    <Int Name="Length">32</Int>
+    <Real>0.99999999999999956</Real>
+    <Real>0.9746173395105846</Real>
+    <Real>0.90218036114469657</Real>
+    <Real>0.79295295531904542</Real>
+    <Real>0.66141885238450659</Real>
+    <Real>0.52320040489228981</Real>
+    <Real>0.39211415200068039</Real>
+    <Real>0.27810198156777877</Real>
+    <Real>0.18640463592844536</Real>
+    <Real>0.11791523482559967</Real>
+    <Real>0.070329166320450678</Real>
+    <Real>0.039584359326425025</Real>
+    <Real>0.021156733405364819</Real>
+    <Real>0.010961491220026948</Real>
+    <Real>0.0058128284706795742</Real>
+    <Real>0.0035392492112647795</Real>
+    <Real>0.0029125724363819575</Real>
+    <Real>0.0035392492112647786</Real>
+    <Real>0.0058128284706795725</Real>
+    <Real>0.010961491220026993</Real>
+    <Real>0.021156733405364836</Real>
+    <Real>0.039584359326424984</Real>
+    <Real>0.070329166320450651</Real>
+    <Real>0.11791523482559939</Real>
+    <Real>0.186404635928445</Real>
+    <Real>0.2781019815677791</Real>
+    <Real>0.39211415200068039</Real>
+    <Real>0.52320040489228958</Real>
+    <Real>0.66141885238450582</Real>
+    <Real>0.79295295531904642</Real>
+    <Real>0.90218036114469724</Real>
+    <Real>0.9746173395105846</Real>
+  </Sequence>
+  <Sequence Name="Z">
+    <Int Name="Length">64</Int>
+    <Real>0.99999999999999956</Real>
+    <Real>0.99359456296950732</Real>
+    <Real>0.9746173395105846</Real>
+    <Real>0.94377114413720775</Real>
+    <Real>0.90218036114469657</Real>
+    <Real>0.85132452097735178</Real>
+    <Real>0.79295295531904542</Real>
+    <Real>0.7289872415404699</Real>
+    <Real>0.66141885238450659</Real>
+    <Real>0.59220942658258502</Real>
+    <Real>0.52320040489228981</Real>
+    <Real>0.45603754023519838</Real>
+    <Real>0.39211415200068039</Real>
+    <Real>0.33253514767267173</Real>
+    <Real>0.27810198156777877</Real>
+    <Real>0.22931704539006106</Real>
+    <Real>0.18640463592844536</Real>
+    <Real>0.14934471796128809</Real>
+    <Real>0.11791523482559967</Real>
+    <Real>0.091738699755794559</Real>
+    <Real>0.070329166320450678</Real>
+    <Real>0.053136331569776436</Real>
+    <Real>0.039584359326425025</Real>
+    <Real>0.029103910644517863</Real>
+    <Real>0.021156733405364819</Real>
+    <Real>0.015252915086482025</Real>
+    <Real>0.010961491220026948</Real>
+    <Real>0.0079155044959704057</Real>
+    <Real>0.0058128284706795742</Real>
+    <Real>0.0044141270290442821</Real>
+    <Real>0.0035392492112647795</Real>
+    <Real>0.003063195698103806</Real>
+    <Real>0.0029125724363819575</Real>
+    <Real>0.0030631956981038082</Real>
+    <Real>0.0035392492112647786</Real>
+    <Real>0.0044141270290442812</Real>
+    <Real>0.0058128284706795725</Real>
+    <Real>0.0079155044959703658</Real>
+    <Real>0.010961491220026993</Real>
+    <Real>0.015252915086482015</Real>
+    <Real>0.021156733405364836</Real>
+    <Real>0.029103910644517856</Real>
+    <Real>0.039584359326424984</Real>
+    <Real>0.053136331569776346</Real>
+    <Real>0.070329166320450651</Real>
+    <Real>0.091738699755794365</Real>
+    <Real>0.11791523482559939</Real>
+    <Real>0.14934471796128818</Real>
+    <Real>0.186404635928445</Real>
+    <Real>0.22931704539006126</Real>
+    <Real>0.2781019815677791</Real>
+    <Real>0.33253514767267195</Real>
+    <Real>0.39211415200068039</Real>
+    <Real>0.45603754023519832</Real>
+    <Real>0.52320040489228958</Real>
+    <Real>0.59220942658258446</Real>
+    <Real>0.66141885238450582</Real>
+    <Real>0.72898724154046912</Real>
+    <Real>0.79295295531904642</Real>
+    <Real>0.85132452097735112</Real>
+    <Real>0.90218036114469724</Real>
+    <Real>0.94377114413720775</Real>
+    <Real>0.9746173395105846</Real>
+    <Real>0.99359456296950754</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_11.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_11.xml
new file mode 100644 (file)
index 0000000..81c686a
--- /dev/null
@@ -0,0 +1,173 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="X">
+    <Int Name="Length">64</Int>
+    <Real>1</Real>
+    <Real>0.99359456296949322</Real>
+    <Real>0.97461733950689855</Real>
+    <Real>0.94377114404174522</Real>
+    <Real>0.90218036017845771</Real>
+    <Real>0.85132451513286955</Real>
+    <Real>0.79295292981514398</Real>
+    <Real>0.72898715282651005</Real>
+    <Real>0.66141859145189652</Real>
+    <Real>0.59220875271982998</Real>
+    <Real>0.52319883754353402</Real>
+    <Real>0.45603419748120122</Real>
+    <Real>0.39210752851646108</Real>
+    <Real>0.33252283355373813</Real>
+    <Real>0.27808033609763227</Real>
+    <Real>0.22928085553476424</Real>
+    <Real>0.18634680587273886</Real>
+    <Real>0.14925605025534092</Real>
+    <Real>0.11778437226576131</Real>
+    <Real>0.091552297002078148</Real>
+    <Real>0.070072349847468088</Real>
+    <Real>0.052793486472092074</Real>
+    <Real>0.039140255209952811</Real>
+    <Real>0.028545152841074214</Real>
+    <Real>0.020473509426959413</Real>
+    <Real>0.014441011915963002</Real>
+    <Real>0.010024605753721196</Real>
+    <Real>0.0068680064109441037</Real>
+    <Real>0.004683556831785461</Real>
+    <Real>0.0032533768155527912</Real>
+    <Real>0.0024376935527143208</Real>
+    <Real>0.0022199287318187566</Real>
+    <Real>0.0029116688417632187</Real>
+    <Real>0.0022199287318187566</Real>
+    <Real>0.0024376935527143208</Real>
+    <Real>0.0032533768155527912</Real>
+    <Real>0.004683556831785461</Real>
+    <Real>0.0068680064109441037</Real>
+    <Real>0.010024605753721196</Real>
+    <Real>0.014441011915963002</Real>
+    <Real>0.020473509426959413</Real>
+    <Real>0.028545152841074214</Real>
+    <Real>0.039140255209952811</Real>
+    <Real>0.052793486472092074</Real>
+    <Real>0.070072349847468088</Real>
+    <Real>0.091552297002078148</Real>
+    <Real>0.11778437226576131</Real>
+    <Real>0.14925605025534092</Real>
+    <Real>0.18634680587273886</Real>
+    <Real>0.22928085553476424</Real>
+    <Real>0.27808033609763227</Real>
+    <Real>0.33252283355373813</Real>
+    <Real>0.39210752851646108</Real>
+    <Real>0.45603419748120122</Real>
+    <Real>0.52319883754353402</Real>
+    <Real>0.59220875271982998</Real>
+    <Real>0.66141859145189652</Real>
+    <Real>0.72898715282651005</Real>
+    <Real>0.79295292981514398</Real>
+    <Real>0.85132451513286955</Real>
+    <Real>0.90218036017845771</Real>
+    <Real>0.94377114404174522</Real>
+    <Real>0.97461733950689855</Real>
+    <Real>0.99359456296949322</Real>
+  </Sequence>
+  <Sequence Name="Y">
+    <Int Name="Length">32</Int>
+    <Real>1</Real>
+    <Real>0.97461733950689855</Real>
+    <Real>0.90218036017845771</Real>
+    <Real>0.79295292981514398</Real>
+    <Real>0.66141859145189652</Real>
+    <Real>0.52319883754353402</Real>
+    <Real>0.39210752851646108</Real>
+    <Real>0.27808033609763227</Real>
+    <Real>0.18634680587273886</Real>
+    <Real>0.11778437226576131</Real>
+    <Real>0.070072349847468088</Real>
+    <Real>0.039140255209952811</Real>
+    <Real>0.020473509426959413</Real>
+    <Real>0.010024605753721196</Real>
+    <Real>0.004683556831785461</Real>
+    <Real>0.0024376935527143208</Real>
+    <Real>0.0029116688417632187</Real>
+    <Real>0.0024376935527143208</Real>
+    <Real>0.004683556831785461</Real>
+    <Real>0.010024605753721196</Real>
+    <Real>0.020473509426959413</Real>
+    <Real>0.039140255209952811</Real>
+    <Real>0.070072349847468088</Real>
+    <Real>0.11778437226576131</Real>
+    <Real>0.18634680587273886</Real>
+    <Real>0.27808033609763227</Real>
+    <Real>0.39210752851646108</Real>
+    <Real>0.52319883754353402</Real>
+    <Real>0.66141859145189652</Real>
+    <Real>0.79295292981514398</Real>
+    <Real>0.90218036017845771</Real>
+    <Real>0.97461733950689855</Real>
+  </Sequence>
+  <Sequence Name="Z">
+    <Int Name="Length">64</Int>
+    <Real>1</Real>
+    <Real>0.99359456296949322</Real>
+    <Real>0.97461733950689855</Real>
+    <Real>0.94377114404174522</Real>
+    <Real>0.90218036017845771</Real>
+    <Real>0.85132451513286955</Real>
+    <Real>0.79295292981514398</Real>
+    <Real>0.72898715282651005</Real>
+    <Real>0.66141859145189652</Real>
+    <Real>0.59220875271982998</Real>
+    <Real>0.52319883754353402</Real>
+    <Real>0.45603419748120122</Real>
+    <Real>0.39210752851646108</Real>
+    <Real>0.33252283355373813</Real>
+    <Real>0.27808033609763227</Real>
+    <Real>0.22928085553476424</Real>
+    <Real>0.18634680587273886</Real>
+    <Real>0.14925605025534092</Real>
+    <Real>0.11778437226576131</Real>
+    <Real>0.091552297002078148</Real>
+    <Real>0.070072349847468088</Real>
+    <Real>0.052793486472092074</Real>
+    <Real>0.039140255209952811</Real>
+    <Real>0.028545152841074214</Real>
+    <Real>0.020473509426959413</Real>
+    <Real>0.014441011915963002</Real>
+    <Real>0.010024605753721196</Real>
+    <Real>0.0068680064109441037</Real>
+    <Real>0.004683556831785461</Real>
+    <Real>0.0032533768155527912</Real>
+    <Real>0.0024376935527143208</Real>
+    <Real>0.0022199287318187566</Real>
+    <Real>0.0029116688417632187</Real>
+    <Real>0.0022199287318187566</Real>
+    <Real>0.0024376935527143208</Real>
+    <Real>0.0032533768155527912</Real>
+    <Real>0.004683556831785461</Real>
+    <Real>0.0068680064109441037</Real>
+    <Real>0.010024605753721196</Real>
+    <Real>0.014441011915963002</Real>
+    <Real>0.020473509426959413</Real>
+    <Real>0.028545152841074214</Real>
+    <Real>0.039140255209952811</Real>
+    <Real>0.052793486472092074</Real>
+    <Real>0.070072349847468088</Real>
+    <Real>0.091552297002078148</Real>
+    <Real>0.11778437226576131</Real>
+    <Real>0.14925605025534092</Real>
+    <Real>0.18634680587273886</Real>
+    <Real>0.22928085553476424</Real>
+    <Real>0.27808033609763227</Real>
+    <Real>0.33252283355373813</Real>
+    <Real>0.39210752851646108</Real>
+    <Real>0.45603419748120122</Real>
+    <Real>0.52319883754353402</Real>
+    <Real>0.59220875271982998</Real>
+    <Real>0.66141859145189652</Real>
+    <Real>0.72898715282651005</Real>
+    <Real>0.79295292981514398</Real>
+    <Real>0.85132451513286955</Real>
+    <Real>0.90218036017845771</Real>
+    <Real>0.94377114404174522</Real>
+    <Real>0.97461733950689855</Real>
+    <Real>0.99359456296949322</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_12.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_12.xml
new file mode 100644 (file)
index 0000000..7b4b02d
--- /dev/null
@@ -0,0 +1,183 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="X">
+    <Int Name="Length">57</Int>
+    <Real>1</Real>
+    <Real>0.99696533865897474</Real>
+    <Real>0.98789819131371792</Real>
+    <Real>0.97290862085031737</Real>
+    <Real>0.95217858034878877</Real>
+    <Real>0.92595970441916342</Real>
+    <Real>0.89457025469819695</Real>
+    <Real>0.85839125658422555</Real>
+    <Real>0.8178618741049839</Real>
+    <Real>0.77347407906121335</Real>
+    <Real>0.72576667915544457</Real>
+    <Real>0.67531877759637726</Real>
+    <Real>0.6227427435703996</Real>
+    <Real>0.56867677890920409</Real>
+    <Real>0.51377717118408106</Real>
+    <Real>0.45871032726383398</Real>
+    <Real>0.40414468403813075</Real>
+    <Real>0.35074259449915274</Real>
+    <Real>0.29915228767351526</Real>
+    <Real>0.25000000000000011</Real>
+    <Real>0.20388237366751011</Real>
+    <Real>0.16135921418712934</Real>
+    <Real>0.12294669511155193</Real>
+    <Real>0.089111092387377466</Real>
+    <Real>0.060263124396755505</Real>
+    <Real>0.036752966392599146</Real>
+    <Real>0.018865999845374768</Real>
+    <Real>0.0068193482986388214</Real>
+    <Real>0.00075924178334189039</Real>
+    <Real>0.00075924178334188411</Real>
+    <Real>0.0068193482986387685</Real>
+    <Real>0.018865999845374789</Real>
+    <Real>0.036752966392599097</Real>
+    <Real>0.060263124396755435</Real>
+    <Real>0.089111092387377411</Real>
+    <Real>0.12294669511155171</Real>
+    <Real>0.16135921418712945</Real>
+    <Real>0.2038823736675098</Real>
+    <Real>0.24999999999999983</Real>
+    <Real>0.29915228767351509</Real>
+    <Real>0.35074259449915257</Real>
+    <Real>0.40414468403813064</Real>
+    <Real>0.45871032726383404</Real>
+    <Real>0.51377717118408084</Real>
+    <Real>0.56867677890920387</Real>
+    <Real>0.62274274357039938</Real>
+    <Real>0.67531877759637693</Real>
+    <Real>0.7257666791554449</Real>
+    <Real>0.77347407906121335</Real>
+    <Real>0.81786187410498368</Real>
+    <Real>0.85839125658422555</Real>
+    <Real>0.89457025469819684</Real>
+    <Real>0.92595970441916364</Real>
+    <Real>0.95217858034878877</Real>
+    <Real>0.97290862085031726</Real>
+    <Real>0.9878981913137177</Real>
+    <Real>0.99696533865897463</Real>
+  </Sequence>
+  <Sequence Name="Y">
+    <Int Name="Length">84</Int>
+    <Real>1</Real>
+    <Real>0.99860189859059001</Real>
+    <Real>0.99441541311256421</Real>
+    <Real>0.98746395609091187</Real>
+    <Real>0.97778640289307028</Real>
+    <Real>0.96543687432210223</Real>
+    <Real>0.95048443395120974</Real>
+    <Real>0.93301270189221941</Real>
+    <Real>0.91311938715799768</Real>
+    <Real>0.89091574123401496</Real>
+    <Real>0.86652593591491323</Real>
+    <Real>0.84008636888545962</Real>
+    <Real>0.8117449009293668</Real>
+    <Real>0.78166002903181098</Real>
+    <Real>0.74999999999999989</Real>
+    <Real>0.71694186955877914</Real>
+    <Real>0.68267051218319763</Real>
+    <Real>0.64737758720545202</Real>
+    <Real>0.61126046697815717</Real>
+    <Real>0.57452113308808728</Real>
+    <Real>0.53736504679321218</Real>
+    <Real>0.5</Real>
+    <Real>0.46263495320678805</Real>
+    <Real>0.42547886691191283</Real>
+    <Real>0.38873953302184278</Real>
+    <Real>0.35262241279454792</Real>
+    <Real>0.31732948781680242</Real>
+    <Real>0.28305813044122108</Real>
+    <Real>0.25000000000000011</Real>
+    <Real>0.21833997096818897</Real>
+    <Real>0.18825509907063326</Real>
+    <Real>0.15991363111454038</Real>
+    <Real>0.1334740640850868</Real>
+    <Real>0.10908425876598513</Real>
+    <Real>0.086880612842002519</Real>
+    <Real>0.066987298107780785</Real>
+    <Real>0.049515566048790448</Real>
+    <Real>0.034563125677897849</Real>
+    <Real>0.022213597106929692</Real>
+    <Real>0.012536043909088213</Real>
+    <Real>0.0055845868874357454</Real>
+    <Real>0.0013981014094099416</Real>
+    <Real>0.0013981014094099288</Real>
+    <Real>0.001398101409409916</Real>
+    <Real>0.0055845868874356977</Real>
+    <Real>0.01253604390908818</Real>
+    <Real>0.022213597106929585</Real>
+    <Real>0.034563125677897863</Real>
+    <Real>0.049515566048790399</Real>
+    <Real>0.066987298107780605</Real>
+    <Real>0.086880612842002575</Real>
+    <Real>0.10908425876598506</Real>
+    <Real>0.13347406408508691</Real>
+    <Real>0.15991363111454029</Real>
+    <Real>0.1882550990706332</Real>
+    <Real>0.21833997096818905</Real>
+    <Real>0.24999999999999983</Real>
+    <Real>0.2830581304412208</Real>
+    <Real>0.31732948781680248</Real>
+    <Real>0.35262241279454759</Real>
+    <Real>0.38873953302184272</Real>
+    <Real>0.42547886691191283</Real>
+    <Real>0.46263495320678771</Real>
+    <Real>0.49999999999999994</Real>
+    <Real>0.53736504679321218</Real>
+    <Real>0.57452113308808683</Real>
+    <Real>0.61126046697815706</Real>
+    <Real>0.64737758720545224</Real>
+    <Real>0.68267051218319774</Real>
+    <Real>0.71694186955877914</Real>
+    <Real>0.74999999999999956</Real>
+    <Real>0.78166002903181131</Real>
+    <Real>0.81174490092936669</Real>
+    <Real>0.8400863688854594</Real>
+    <Real>0.86652593591491334</Real>
+    <Real>0.89091574123401474</Real>
+    <Real>0.91311938715799723</Real>
+    <Real>0.93301270189221919</Real>
+    <Real>0.95048443395120952</Real>
+    <Real>0.96543687432210223</Real>
+    <Real>0.97778640289307028</Real>
+    <Real>0.98746395609091187</Real>
+    <Real>0.99441541311256409</Real>
+    <Real>0.99860189859059012</Real>
+  </Sequence>
+  <Sequence Name="Z">
+    <Int Name="Length">29</Int>
+    <Real>1</Real>
+    <Real>0.98831027785504322</Real>
+    <Real>0.95378770983547845</Real>
+    <Real>0.89804653285282199</Real>
+    <Real>0.82369314239091374</Real>
+    <Real>0.73420422034989519</Real>
+    <Real>0.63376416926461054</Real>
+    <Real>0.52706945429270879</Real>
+    <Real>0.41910900172361765</Real>
+    <Real>0.31493092233004294</Real>
+    <Real>0.21940646731880881</Real>
+    <Real>0.13700225403843475</Real>
+    <Real>0.071571411916205363</Real>
+    <Real>0.026173414408598751</Real>
+    <Real>0.0029310214228202036</Real>
+    <Real>0.002931021422820168</Real>
+    <Real>0.026173414408598775</Real>
+    <Real>0.071571411916205391</Real>
+    <Real>0.1370022540384345</Real>
+    <Real>0.21940646731880872</Real>
+    <Real>0.31493092233004277</Real>
+    <Real>0.41910900172361765</Real>
+    <Real>0.52706945429270846</Real>
+    <Real>0.6337641692646101</Real>
+    <Real>0.73420422034989519</Real>
+    <Real>0.82369314239091396</Real>
+    <Real>0.89804653285282199</Real>
+    <Real>0.95378770983547856</Real>
+    <Real>0.98831027785504355</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_13.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_13.xml
new file mode 100644 (file)
index 0000000..1360ce7
--- /dev/null
@@ -0,0 +1,183 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="X">
+    <Int Name="Length">57</Int>
+    <Real>1</Real>
+    <Real>0.99696656660775951</Real>
+    <Real>0.98791772233095498</Real>
+    <Real>0.97300652443155822</Real>
+    <Real>0.95248375455969336</Real>
+    <Real>0.92669163563931867</Real>
+    <Real>0.89605540132524364</Real>
+    <Real>0.86107306257852145</Real>
+    <Real>0.82230378514128921</Real>
+    <Real>0.7803553410560129</Real>
+    <Real>0.73587112468566351</Real>
+    <Real>0.68951722811810012</Real>
+    <Real>0.64197005325186551</Real>
+    <Real>0.59390490139645091</Real>
+    <Real>0.54598593224673653</Real>
+    <Real>0.49885783396168321</Real>
+    <Real>0.45313951429664129</Real>
+    <Real>0.40942014266734855</Real>
+    <Real>0.36825800204726461</Real>
+    <Real>0.3301829471406319</Real>
+    <Real>0.29570398453575975</Real>
+    <Real>0.26532489435174572</Real>
+    <Real>0.23957343194663078</Real>
+    <Real>0.2190544144461728</Real>
+    <Real>0.20454555031604094</Real>
+    <Real>0.19717010656521591</Real>
+    <Real>0.19870756117866156</Real>
+    <Real>0.21215140990095066</Real>
+    <Real>0.24270871389263426</Real>
+    <Real>0.24270871389263426</Real>
+    <Real>0.21215140990095066</Real>
+    <Real>0.19870756117866156</Real>
+    <Real>0.19717010656521591</Real>
+    <Real>0.20454555031604094</Real>
+    <Real>0.2190544144461728</Real>
+    <Real>0.23957343194663078</Real>
+    <Real>0.26532489435174572</Real>
+    <Real>0.29570398453575975</Real>
+    <Real>0.3301829471406319</Real>
+    <Real>0.36825800204726461</Real>
+    <Real>0.40942014266734855</Real>
+    <Real>0.45313951429664129</Real>
+    <Real>0.49885783396168321</Real>
+    <Real>0.54598593224673653</Real>
+    <Real>0.59390490139645091</Real>
+    <Real>0.64197005325186551</Real>
+    <Real>0.68951722811810012</Real>
+    <Real>0.73587112468566351</Real>
+    <Real>0.7803553410560129</Real>
+    <Real>0.82230378514128921</Real>
+    <Real>0.86107306257852145</Real>
+    <Real>0.89605540132524364</Real>
+    <Real>0.92669163563931867</Real>
+    <Real>0.95248375455969336</Real>
+    <Real>0.97300652443155822</Real>
+    <Real>0.98791772233095498</Real>
+    <Real>0.99696656660775951</Real>
+  </Sequence>
+  <Sequence Name="Y">
+    <Int Name="Length">84</Int>
+    <Real>1</Real>
+    <Real>0.99860215922139717</Real>
+    <Real>0.99441957183361773</Real>
+    <Real>0.98748491402436001</Real>
+    <Real>0.97785221971601055</Real>
+    <Real>0.96559624954959267</Real>
+    <Real>0.95081162440523803</Real>
+    <Real>0.93361173994840618</Real>
+    <Real>0.91412748276565448</Real>
+    <Real>0.89250577227050065</Real>
+    <Real>0.86890795563906131</Real>
+    <Real>0.84350808550915102</Real>
+    <Real>0.81649111199327118</Real>
+    <Real>0.78805102167992025</Real>
+    <Real>0.75838895671363937</Real>
+    <Real>0.72771134675963611</Real>
+    <Real>0.69622808570858563</Real>
+    <Real>0.66415078342968292</Real>
+    <Real>0.63169112084631851</Real>
+    <Real>0.59905933425595059</Real>
+    <Real>0.56646285238799932</Real>
+    <Real>0.53410510754183604</Real>
+    <Real>0.50218454077555041</Real>
+    <Real>0.47089382125013918</Real>
+    <Real>0.4404193025196152</Real>
+    <Real>0.41094074531162983</Real>
+    <Real>0.38263134936935156</Real>
+    <Real>0.35565815943534768</Real>
+    <Real>0.33018294714063184</Real>
+    <Real>0.30636372827068858</Real>
+    <Real>0.28435716364329472</Real>
+    <Real>0.26432222633550939</Real>
+    <Real>0.24642571976242944</Real>
+    <Real>0.23085053171587089</Real>
+    <Real>0.217807955305068</Real>
+    <Real>0.20755606705812685</Real>
+    <Real>0.20042712586833097</Real>
+    <Real>0.19686839270742718</Real>
+    <Real>0.19750289044735603</Real>
+    <Real>0.20321975336085121</Real>
+    <Real>0.21530844579905295</Real>
+    <Real>0.23565799171305502</Real>
+    <Real>0.2670525537709178</Real>
+    <Real>0.23565799171305502</Real>
+    <Real>0.21530844579905295</Real>
+    <Real>0.20321975336085121</Real>
+    <Real>0.19750289044735603</Real>
+    <Real>0.19686839270742718</Real>
+    <Real>0.20042712586833097</Real>
+    <Real>0.20755606705812685</Real>
+    <Real>0.217807955305068</Real>
+    <Real>0.23085053171587089</Real>
+    <Real>0.24642571976242944</Real>
+    <Real>0.26432222633550939</Real>
+    <Real>0.28435716364329472</Real>
+    <Real>0.30636372827068858</Real>
+    <Real>0.33018294714063184</Real>
+    <Real>0.35565815943534768</Real>
+    <Real>0.38263134936935156</Real>
+    <Real>0.41094074531162983</Real>
+    <Real>0.4404193025196152</Real>
+    <Real>0.47089382125013918</Real>
+    <Real>0.50218454077555041</Real>
+    <Real>0.53410510754183604</Real>
+    <Real>0.56646285238799932</Real>
+    <Real>0.59905933425595059</Real>
+    <Real>0.63169112084631851</Real>
+    <Real>0.66415078342968292</Real>
+    <Real>0.69622808570858563</Real>
+    <Real>0.72771134675963611</Real>
+    <Real>0.75838895671363937</Real>
+    <Real>0.78805102167992025</Real>
+    <Real>0.81649111199327118</Real>
+    <Real>0.84350808550915102</Real>
+    <Real>0.86890795563906131</Real>
+    <Real>0.89250577227050065</Real>
+    <Real>0.91412748276565448</Real>
+    <Real>0.93361173994840618</Real>
+    <Real>0.95081162440523803</Real>
+    <Real>0.96559624954959267</Real>
+    <Real>0.97785221971601055</Real>
+    <Real>0.98748491402436001</Real>
+    <Real>0.99441957183361773</Real>
+    <Real>0.99860215922139717</Real>
+  </Sequence>
+  <Sequence Name="Z">
+    <Int Name="Length">29</Int>
+    <Real>1</Real>
+    <Real>0.98832850126686445</Real>
+    <Real>0.95407268332389905</Real>
+    <Real>0.89943524093127036</Real>
+    <Real>0.82785442132742759</Real>
+    <Real>0.74369297639299847</Real>
+    <Real>0.65187208271592423</Real>
+    <Real>0.55750420447989546</Real>
+    <Real>0.46557626648701822</Real>
+    <Real>0.38072635390533288</Real>
+    <Real>0.30715580638020212</Real>
+    <Real>0.24876055053672902</Real>
+    <Real>0.20975887354800338</Real>
+    <Real>0.19676185240721122</Real>
+    <Real>0.22536122439134543</Real>
+    <Real>0.22536122439134543</Real>
+    <Real>0.19676185240721122</Real>
+    <Real>0.20975887354800338</Real>
+    <Real>0.24876055053672902</Real>
+    <Real>0.30715580638020212</Real>
+    <Real>0.38072635390533288</Real>
+    <Real>0.46557626648701822</Real>
+    <Real>0.55750420447989546</Real>
+    <Real>0.65187208271592423</Real>
+    <Real>0.74369297639299847</Real>
+    <Real>0.82785442132742759</Real>
+    <Real>0.89943524093127036</Real>
+    <Real>0.95407268332389905</Real>
+    <Real>0.98832850126686445</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_14.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_14.xml
new file mode 100644 (file)
index 0000000..0da026d
--- /dev/null
@@ -0,0 +1,183 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="X">
+    <Int Name="Length">57</Int>
+    <Real>0.99999999999999978</Real>
+    <Real>0.99595787784283507</Real>
+    <Real>0.98392934565094792</Real>
+    <Real>0.96420435794452586</Real>
+    <Real>0.9372545018772549</Real>
+    <Real>0.90371603494541697</Real>
+    <Real>0.86436719790621919</Real>
+    <Real>0.82010080265087626</Real>
+    <Real>0.77189329743088908</Real>
+    <Real>0.72077165779591346</Real>
+    <Real>0.66777953410122992</Real>
+    <Real>0.61394410176472991</Real>
+    <Real>0.56024500810666122</Real>
+    <Real>0.50758669234655629</Real>
+    <Real>0.45677517902844306</Real>
+    <Real>0.40850021848992346</Real>
+    <Real>0.36332338207751624</Real>
+    <Real>0.3216724275978442</Real>
+    <Real>0.28384194617502795</Real>
+    <Real>0.24999999999999994</Real>
+    <Real>0.22020017598213704</Real>
+    <Real>0.19439822675120766</Real>
+    <Real>0.1724722599779577</Real>
+    <Real>0.15424527963282181</Real>
+    <Real>0.13950878602613967</Real>
+    <Real>0.12804610974722422</Real>
+    <Real>0.11965418924246241</Real>
+    <Real>0.11416260080438093</Real>
+    <Real>0.11144880810285662</Real>
+    <Real>0.11144880810285659</Real>
+    <Real>0.11416260080438081</Real>
+    <Real>0.11965418924246238</Real>
+    <Real>0.12804610974722422</Real>
+    <Real>0.13950878602613973</Real>
+    <Real>0.15424527963282186</Real>
+    <Real>0.17247225997795768</Real>
+    <Real>0.1943982267512076</Real>
+    <Real>0.22020017598213701</Real>
+    <Real>0.25000000000000006</Real>
+    <Real>0.28384194617502811</Real>
+    <Real>0.32167242759784387</Real>
+    <Real>0.36332338207751563</Real>
+    <Real>0.40850021848992313</Real>
+    <Real>0.45677517902844317</Real>
+    <Real>0.50758669234655607</Real>
+    <Real>0.56024500810666145</Real>
+    <Real>0.6139441017647298</Real>
+    <Real>0.66777953410122959</Real>
+    <Real>0.72077165779591368</Real>
+    <Real>0.77189329743088875</Real>
+    <Real>0.82010080265087626</Real>
+    <Real>0.86436719790621874</Real>
+    <Real>0.90371603494541697</Real>
+    <Real>0.93725450187725468</Real>
+    <Real>0.96420435794452608</Real>
+    <Real>0.98392934565094803</Real>
+    <Real>0.99595787784283507</Real>
+  </Sequence>
+  <Sequence Name="Y">
+    <Int Name="Length">84</Int>
+    <Real>0.99999999999999978</Real>
+    <Real>0.99813673353747623</Real>
+    <Real>0.99256774531039826</Real>
+    <Real>0.98335512029761163</Real>
+    <Real>0.97060117892250686</Real>
+    <Real>0.95444677005463663</Real>
+    <Real>0.93506893028211602</Real>
+    <Real>0.91267795723752809</Real>
+    <Real>0.8875139566052419</Real>
+    <Real>0.85984293298336401</Real>
+    <Real>0.82995250379027963</Real>
+    <Real>0.79814732269894051</Real>
+    <Real>0.76474430449519737</Real>
+    <Real>0.73006774667458774</Real>
+    <Real>0.6944444444444442</Real>
+    <Real>0.65819889506009632</Real>
+    <Real>0.62164868461674083</Real>
+    <Real>0.58510014560951307</Real>
+    <Real>0.54884436687489413</Real>
+    <Real>0.51315362909018081</Real>
+    <Real>0.47827832902590361</Real>
+    <Real>0.44444444444444442</Real>
+    <Real>0.41185157917130444</Real>
+    <Real>0.38067161471135902</Real>
+    <Real>0.35104798113594815</Real>
+    <Real>0.32309554613315405</Real>
+    <Real>0.29690110740216724</Real>
+    <Real>0.2725244602889334</Real>
+    <Real>0.24999999999999994</Real>
+    <Real>0.22933880617359045</Real>
+    <Real>0.21053114728743447</Real>
+    <Real>0.19354933356923457</Real>
+    <Real>0.17835083994154516</Real>
+    <Real>0.16488161523400408</Real>
+    <Real>0.15307949054657974</Real>
+    <Real>0.14287759831802727</Real>
+    <Real>0.13420771436885445</Real>
+    <Real>0.12700343792645519</Real>
+    <Real>0.12120312933482608</Real>
+    <Real>0.11675253169154608</Real>
+    <Real>0.1136070108880618</Real>
+    <Real>0.11173335826531594</Real>
+    <Real>0.11111111111111113</Real>
+    <Real>0.1117333582653159</Real>
+    <Real>0.11360701088806179</Real>
+    <Real>0.11675253169154612</Real>
+    <Real>0.12120312933482608</Real>
+    <Real>0.1270034379264551</Real>
+    <Real>0.1342077143688544</Real>
+    <Real>0.14287759831802727</Real>
+    <Real>0.15307949054657974</Real>
+    <Real>0.16488161523400399</Real>
+    <Real>0.17835083994154527</Real>
+    <Real>0.19354933356923443</Real>
+    <Real>0.2105311472874343</Real>
+    <Real>0.22933880617359059</Real>
+    <Real>0.25000000000000006</Real>
+    <Real>0.2725244602889334</Real>
+    <Real>0.29690110740216724</Real>
+    <Real>0.32309554613315422</Real>
+    <Real>0.3510479811359476</Real>
+    <Real>0.38067161471135902</Real>
+    <Real>0.41185157917130388</Real>
+    <Real>0.44444444444444425</Real>
+    <Real>0.4782783290259035</Real>
+    <Real>0.5131536290901807</Real>
+    <Real>0.54884436687489446</Real>
+    <Real>0.58510014560951307</Real>
+    <Real>0.62164868461674094</Real>
+    <Real>0.65819889506009566</Real>
+    <Real>0.6944444444444442</Real>
+    <Real>0.73006774667458785</Real>
+    <Real>0.76474430449519715</Real>
+    <Real>0.79814732269894006</Real>
+    <Real>0.82995250379027941</Real>
+    <Real>0.85984293298336367</Real>
+    <Real>0.88751395660524168</Real>
+    <Real>0.91267795723752831</Real>
+    <Real>0.9350689302821158</Real>
+    <Real>0.95444677005463674</Real>
+    <Real>0.97060117892250664</Real>
+    <Real>0.9833551202976113</Real>
+    <Real>0.99256774531039815</Real>
+    <Real>0.99813673353747601</Real>
+  </Sequence>
+  <Sequence Name="Z">
+    <Int Name="Length">29</Int>
+    <Real>0.99999999999999978</Real>
+    <Real>0.98447443696398029</Real>
+    <Real>0.93933275789719339</Real>
+    <Real>0.86868182578746489</Real>
+    <Real>0.77873934898343644</Real>
+    <Real>0.67700447001310771</Real>
+    <Real>0.57129830733700993</Real>
+    <Real>0.46883185064049882</Real>
+    <Real>0.37544949202194877</Real>
+    <Real>0.29516107029764194</Real>
+    <Real>0.23002029565339052</Real>
+    <Real>0.18034305406668735</Real>
+    <Real>0.14519727951994868</Real>
+    <Real>0.12304820534684577</Real>
+    <Real>0.11241760547084502</Real>
+    <Real>0.11241760547084489</Real>
+    <Real>0.12304820534684582</Real>
+    <Real>0.14519727951994876</Real>
+    <Real>0.1803430540666871</Real>
+    <Real>0.23002029565339013</Real>
+    <Real>0.2951610702976416</Real>
+    <Real>0.37544949202194894</Real>
+    <Real>0.46883185064049865</Real>
+    <Real>0.57129830733701015</Real>
+    <Real>0.67700447001310726</Real>
+    <Real>0.778739348983436</Real>
+    <Real>0.86868182578746533</Real>
+    <Real>0.93933275789719284</Real>
+    <Real>0.9844744369639804</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_15.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_15.xml
new file mode 100644 (file)
index 0000000..f8f9da2
--- /dev/null
@@ -0,0 +1,183 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="X">
+    <Int Name="Length">57</Int>
+    <Real>1</Real>
+    <Real>0.99595746961106935</Real>
+    <Real>0.98392290411739991</Real>
+    <Real>0.96417249585689879</Real>
+    <Real>0.93715702990301086</Real>
+    <Real>0.90348786274003334</Real>
+    <Real>0.86391786113433711</Real>
+    <Real>0.81931787951960255</Real>
+    <Real>0.77064952856941005</Real>
+    <Real>0.71893516132582791</Real>
+    <Real>0.66522616885086927</Real>
+    <Real>0.61057082453529554</Real>
+    <Real>0.55598303255336479</Real>
+    <Real>0.50241340863405681</Real>
+    <Real>0.45072413946621243</Real>
+    <Real>0.40166902542472988</Real>
+    <Real>0.35588001551284348</Real>
+    <Real>0.31386141771105369</Real>
+    <Real>0.27599286746285367</Real>
+    <Real>0.24254216886929247</Real>
+    <Real>0.21368948507772698</Real>
+    <Real>0.18956541097020155</Real>
+    <Real>0.17030789936928309</Real>
+    <Real>0.15614816416805158</Real>
+    <Real>0.1475462110421403</Real>
+    <Real>0.14541798763152783</Real>
+    <Real>0.15153961053372036</Real>
+    <Real>0.16930353151461464</Real>
+    <Real>0.20518747914506352</Real>
+    <Real>0.20518747914506352</Real>
+    <Real>0.16930353151461464</Real>
+    <Real>0.15153961053372036</Real>
+    <Real>0.14541798763152783</Real>
+    <Real>0.1475462110421403</Real>
+    <Real>0.15614816416805158</Real>
+    <Real>0.17030789936928309</Real>
+    <Real>0.18956541097020155</Real>
+    <Real>0.21368948507772698</Real>
+    <Real>0.24254216886929247</Real>
+    <Real>0.27599286746285367</Real>
+    <Real>0.31386141771105369</Real>
+    <Real>0.35588001551284348</Real>
+    <Real>0.40166902542472988</Real>
+    <Real>0.45072413946621243</Real>
+    <Real>0.50241340863405681</Real>
+    <Real>0.55598303255336479</Real>
+    <Real>0.61057082453529554</Real>
+    <Real>0.66522616885086927</Real>
+    <Real>0.71893516132582791</Real>
+    <Real>0.77064952856941005</Real>
+    <Real>0.81931787951960255</Real>
+    <Real>0.86391786113433711</Real>
+    <Real>0.90348786274003334</Real>
+    <Real>0.93715702990301086</Real>
+    <Real>0.96417249585689879</Real>
+    <Real>0.98392290411739991</Real>
+    <Real>0.99595746961106935</Real>
+  </Sequence>
+  <Sequence Name="Y">
+    <Int Name="Length">84</Int>
+    <Real>1</Real>
+    <Real>0.99813664676658265</Real>
+    <Real>0.9925663658296221</Real>
+    <Real>0.98334821080237111</Real>
+    <Real>0.97057966570670828</Real>
+    <Real>0.95439524956616717</Real>
+    <Real>0.93496458813901551</Real>
+    <Real>0.9124899783466649</Real>
+    <Real>0.88720347856845028</Real>
+    <Real>0.85936356574592299</Real>
+    <Real>0.82925140811986475</Real>
+    <Real>0.79716681031855896</Real>
+    <Real>0.76342389528860444</Real>
+    <Real>0.72834659502631327</Real>
+    <Real>0.69226402900504336</Real>
+    <Real>0.65550585534580197</Real>
+    <Real>0.61839768487013713</Real>
+    <Real>0.58125665192995213</Real>
+    <Real>0.54438723807606892</Real>
+    <Real>0.50807744500843544</Real>
+    <Real>0.47259541174334813</Real>
+    <Real>0.43818656757996727</Real>
+    <Real>0.40507140750487103</Real>
+    <Real>0.3734439706933132</Real>
+    <Real>0.34347109672106363</Real>
+    <Real>0.31529252955077341</Real>
+    <Real>0.28902193869824733</Real>
+    <Real>0.2647489338337406</Real>
+    <Real>0.24254216886929233</Real>
+    <Real>0.22245367254997173</Real>
+    <Real>0.20452461728862817</Real>
+    <Real>0.18879286598937658</Real>
+    <Real>0.1753028486476319</Real>
+    <Real>0.16411866568055694</Real>
+    <Real>0.15534187249635459</Real>
+    <Real>0.14913629897657579</Real>
+    <Real>0.14576371059594109</Real>
+    <Real>0.14563647564909091</Real>
+    <Real>0.1493972480929823</Real>
+    <Real>0.15804197939885326</Real>
+    <Real>0.17311296177291857</Real>
+    <Real>0.19700581106261494</Real>
+    <Real>0.23346292694334683</Real>
+    <Real>0.19700581106261494</Real>
+    <Real>0.17311296177291857</Real>
+    <Real>0.15804197939885326</Real>
+    <Real>0.1493972480929823</Real>
+    <Real>0.14563647564909091</Real>
+    <Real>0.14576371059594109</Real>
+    <Real>0.14913629897657579</Real>
+    <Real>0.15534187249635459</Real>
+    <Real>0.16411866568055694</Real>
+    <Real>0.1753028486476319</Real>
+    <Real>0.18879286598937658</Real>
+    <Real>0.20452461728862817</Real>
+    <Real>0.22245367254997173</Real>
+    <Real>0.24254216886929233</Real>
+    <Real>0.2647489338337406</Real>
+    <Real>0.28902193869824733</Real>
+    <Real>0.31529252955077341</Real>
+    <Real>0.34347109672106363</Real>
+    <Real>0.3734439706933132</Real>
+    <Real>0.40507140750487103</Real>
+    <Real>0.43818656757996727</Real>
+    <Real>0.47259541174334813</Real>
+    <Real>0.50807744500843544</Real>
+    <Real>0.54438723807606892</Real>
+    <Real>0.58125665192995213</Real>
+    <Real>0.61839768487013713</Real>
+    <Real>0.65550585534580197</Real>
+    <Real>0.69226402900504336</Real>
+    <Real>0.72834659502631327</Real>
+    <Real>0.76342389528860444</Real>
+    <Real>0.79716681031855896</Real>
+    <Real>0.82925140811986475</Real>
+    <Real>0.85936356574592299</Real>
+    <Real>0.88720347856845028</Real>
+    <Real>0.9124899783466649</Real>
+    <Real>0.93496458813901551</Real>
+    <Real>0.95439524956616717</Real>
+    <Real>0.97057966570670828</Real>
+    <Real>0.98334821080237111</Real>
+    <Real>0.9925663658296221</Real>
+    <Real>0.99813664676658265</Real>
+  </Sequence>
+  <Sequence Name="Z">
+    <Int Name="Length">29</Int>
+    <Real>1</Real>
+    <Real>0.98446842450555616</Real>
+    <Real>0.93924160417612246</Real>
+    <Real>0.86826025265339679</Real>
+    <Real>0.77756700407501733</Real>
+    <Real>0.67458281427952937</Real>
+    <Real>0.56722374129711373</Real>
+    <Real>0.46298628726392016</Real>
+    <Real>0.36815395301498727</Real>
+    <Real>0.28728291393347499</Real>
+    <Real>0.22311064862270136</Real>
+    <Real>0.17702819848076223</Real>
+    <Real>0.15038677384389965</Real>
+    <Real>0.14760833414605379</Real>
+    <Real>0.18500370061649021</Real>
+    <Real>0.18500370061649021</Real>
+    <Real>0.14760833414605379</Real>
+    <Real>0.15038677384389965</Real>
+    <Real>0.17702819848076223</Real>
+    <Real>0.22311064862270136</Real>
+    <Real>0.28728291393347499</Real>
+    <Real>0.36815395301498727</Real>
+    <Real>0.46298628726392016</Real>
+    <Real>0.56722374129711373</Real>
+    <Real>0.67458281427952937</Real>
+    <Real>0.77756700407501733</Real>
+    <Real>0.86826025265339679</Real>
+    <Real>0.93924160417612246</Real>
+    <Real>0.98446842450555616</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_16.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_16.xml
new file mode 100644 (file)
index 0000000..fdb11eb
--- /dev/null
@@ -0,0 +1,183 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="X">
+    <Int Name="Length">57</Int>
+    <Real>0.99999999999999978</Real>
+    <Real>0.99494939068045452</Real>
+    <Real>0.97994403041828604</Real>
+    <Real>0.95541633655567315</Real>
+    <Real>0.92206417335942237</Real>
+    <Real>0.88081815972655553</Real>
+    <Real>0.83279888241711397</Real>
+    <Real>0.77926671299848038</Real>
+    <Real>0.7215673206267248</Real>
+    <Real>0.66107613182548253</Real>
+    <Real>0.59914490755703098</Real>
+    <Real>0.53705330286897801</Real>
+    <Real>0.47596777973251997</Real>
+    <Real>0.41690960880755507</Real>
+    <Real>0.36073298004042298</Real>
+    <Real>0.30811350836714391</Real>
+    <Real>0.2595467302579938</Real>
+    <Real>0.21535559236527288</Real>
+    <Real>0.17570547548805457</Real>
+    <Real>0.14062499999999986</Real>
+    <Real>0.11003073009920575</Real>
+    <Real>0.083753924189319984</Real>
+    <Real>0.061567643166775265</Real>
+    <Real>0.043212792097817088</Real>
+    <Real>0.028421992051017742</Real>
+    <Real>0.016940514768528789</Real>
+    <Real>0.0085438242312313867</Real>
+    <Real>0.0030515249292297555</Real>
+    <Real>0.00033769704037479138</Real>
+    <Real>0.00033769704037478818</Real>
+    <Real>0.0030515249292297057</Real>
+    <Real>0.0085438242312312826</Real>
+    <Real>0.016940514768528779</Real>
+    <Real>0.028421992051017839</Real>
+    <Real>0.043212792097817386</Real>
+    <Real>0.061567643166775432</Real>
+    <Real>0.083753924189319692</Real>
+    <Real>0.11003073009920591</Real>
+    <Real>0.14062500000000014</Real>
+    <Real>0.17570547548805493</Real>
+    <Real>0.21535559236527266</Real>
+    <Real>0.25954673025799285</Real>
+    <Real>0.3081135083671433</Real>
+    <Real>0.36073298004042298</Real>
+    <Real>0.41690960880755462</Real>
+    <Real>0.47596777973252047</Real>
+    <Real>0.53705330286897823</Real>
+    <Real>0.59914490755703076</Real>
+    <Real>0.66107613182548275</Real>
+    <Real>0.72156732062672435</Real>
+    <Real>0.77926671299848038</Real>
+    <Real>0.83279888241711375</Real>
+    <Real>0.88081815972655575</Real>
+    <Real>0.92206417335942226</Real>
+    <Real>0.95541633655567315</Real>
+    <Real>0.97994403041828604</Real>
+    <Real>0.99494939068045474</Real>
+  </Sequence>
+  <Sequence Name="Y">
+    <Int Name="Length">84</Int>
+    <Real>0.99999999999999978</Real>
+    <Real>0.99767135099320636</Real>
+    <Real>0.9907165928659406</Real>
+    <Real>0.97922860423028468</Real>
+    <Real>0.96335990994523879</Real>
+    <Real>0.94331934366491299</Real>
+    <Real>0.91936751626699431</Real>
+    <Real>0.89181122479574559</Real>
+    <Real>0.86099696642115131</Real>
+    <Real>0.82730374583628341</Real>
+    <Real>0.79113538169690201</Real>
+    <Real>0.75291252763844485</Real>
+    <Real>0.71306462587103303</Real>
+    <Real>0.67202200644047028</Real>
+    <Real>0.63020833333333326</Real>
+    <Real>0.58803358034978093</Real>
+    <Real>0.54588769595915243</Real>
+    <Real>0.50413508827548392</Real>
+    <Real>0.4631100300695869</Real>
+    <Real>0.42311305068326482</Real>
+    <Real>0.38440834816649128</Real>
+    <Real>0.34722222222222221</Real>
+    <Real>0.31174249782689201</Real>
+    <Real>0.27811888176607463</Real>
+    <Real>0.24646417066754356</Real>
+    <Real>0.21685621009290576</Real>
+    <Real>0.18934049028906835</Real>
+    <Real>0.16393325547735715</Real>
+    <Real>0.14062499999999986</Real>
+    <Real>0.11938422594799727</Real>
+    <Real>0.10016134255230789</Real>
+    <Real>0.082892596952518285</Real>
+    <Real>0.067503938156579582</Real>
+    <Real>0.053914730184820014</Real>
+    <Real>0.04204124563482544</Real>
+    <Real>0.031799886315365442</Real>
+    <Real>0.023110092350312129</Real>
+    <Real>0.015896914531310535</Real>
+    <Real>0.01009323613081602</Real>
+    <Real>0.005641639477029229</Real>
+    <Real>0.0024959191291642081</Real>
+    <Real>0.00062224745785503723</Real>
+    <Real>0.00062224745785502671</Real>
+    <Real>0.00062224745785501609</Real>
+    <Real>0.0024959191291641634</Real>
+    <Real>0.0056416394770293365</Real>
+    <Real>0.010093236130816099</Real>
+    <Real>0.01589691453131041</Real>
+    <Real>0.023110092350312087</Real>
+    <Real>0.031799886315365573</Real>
+    <Real>0.042041245634825385</Real>
+    <Real>0.053914730184819785</Real>
+    <Real>0.067503938156579721</Real>
+    <Real>0.082892596952517966</Real>
+    <Real>0.10016134255230759</Real>
+    <Real>0.11938422594799739</Real>
+    <Real>0.14062500000000014</Real>
+    <Real>0.16393325547735713</Real>
+    <Real>0.18934049028906835</Real>
+    <Real>0.21685621009290634</Real>
+    <Real>0.24646417066754278</Real>
+    <Real>0.27811888176607447</Real>
+    <Real>0.31174249782689112</Real>
+    <Real>0.34722222222222199</Real>
+    <Real>0.38440834816649111</Real>
+    <Real>0.42311305068326494</Real>
+    <Real>0.46311003006958729</Real>
+    <Real>0.50413508827548359</Real>
+    <Real>0.54588769595915254</Real>
+    <Real>0.58803358034977982</Real>
+    <Real>0.63020833333333348</Real>
+    <Real>0.67202200644046983</Real>
+    <Real>0.71306462587103292</Real>
+    <Real>0.75291252763844418</Real>
+    <Real>0.79113538169690145</Real>
+    <Real>0.82730374583628263</Real>
+    <Real>0.86099696642115153</Real>
+    <Real>0.89181122479574582</Real>
+    <Real>0.91936751626699442</Real>
+    <Real>0.94331934366491299</Real>
+    <Real>0.96335990994523857</Real>
+    <Real>0.9792286042302849</Real>
+    <Real>0.99071659286594016</Real>
+    <Real>0.99767135099320625</Real>
+  </Sequence>
+  <Sequence Name="Z">
+    <Int Name="Length">29</Int>
+    <Real>0.99999999999999978</Real>
+    <Real>0.98062323529517048</Real>
+    <Real>0.92462955422457049</Real>
+    <Real>0.83804442252850697</Real>
+    <Real>0.72972283897039203</Real>
+    <Real>0.60986858897549723</Real>
+    <Real>0.48847117722940447</Real>
+    <Real>0.37398974608946534</Real>
+    <Real>0.27251810127650261</Real>
+    <Real>0.18752054994359144</Real>
+    <Real>0.12008274580351165</Real>
+    <Real>0.069517662946712813</Real>
+    <Real>0.034126904208387411</Real>
+    <Real>0.011939086461878554</Real>
+    <Real>0.0013064971575197132</Real>
+    <Real>0.0013064971575196787</Real>
+    <Real>0.011939086461878627</Real>
+    <Real>0.034126904208387515</Real>
+    <Real>0.069517662946712799</Real>
+    <Real>0.12008274580351111</Real>
+    <Real>0.18752054994359071</Real>
+    <Real>0.27251810127650294</Real>
+    <Real>0.37398974608946534</Real>
+    <Real>0.4884711772294047</Real>
+    <Real>0.60986858897549667</Real>
+    <Real>0.72972283897039136</Real>
+    <Real>0.83804442252850708</Real>
+    <Real>0.92462955422457016</Real>
+    <Real>0.98062323529517048</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_17.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_17.xml
new file mode 100644 (file)
index 0000000..36abaec
--- /dev/null
@@ -0,0 +1,183 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="X">
+    <Int Name="Length">57</Int>
+    <Real>1</Real>
+    <Real>0.99494939127197923</Real>
+    <Real>0.9799440679435939</Real>
+    <Real>0.95541675775135737</Real>
+    <Real>0.92206649160055121</Real>
+    <Real>0.88082677118404018</Real>
+    <Real>0.83282377210865988</Real>
+    <Real>0.77932709828961222</Real>
+    <Real>0.72169598676563462</Real>
+    <Real>0.66132403592671196</Real>
+    <Real>0.59958548922687738</Real>
+    <Real>0.53778586364542869</Real>
+    <Real>0.47711929657339158</Real>
+    <Real>0.41863443844503245</Real>
+    <Real>0.36321009172092422</Real>
+    <Real>0.31154114346152084</Real>
+    <Real>0.26413471053519755</Real>
+    <Real>0.22131585891635455</Real>
+    <Real>0.18324180764543538</Real>
+    <Real>0.14992321097434119</Real>
+    <Real>0.12125095507366032</Real>
+    <Real>0.097026960331861353</Real>
+    <Real>0.076997902013451275</Real>
+    <Real>0.060892024312349677</Real>
+    <Real>0.048462702886541115</Real>
+    <Real>0.039551969610798522</Real>
+    <Real>0.034213419233233101</Real>
+    <Real>0.033005268440282939</Real>
+    <Real>0.037756945100019701</Real>
+    <Real>0.037756945100019701</Real>
+    <Real>0.033005268440282939</Real>
+    <Real>0.034213419233233101</Real>
+    <Real>0.039551969610798522</Real>
+    <Real>0.048462702886541115</Real>
+    <Real>0.060892024312349677</Real>
+    <Real>0.076997902013451275</Real>
+    <Real>0.097026960331861353</Real>
+    <Real>0.12125095507366032</Real>
+    <Real>0.14992321097434119</Real>
+    <Real>0.18324180764543538</Real>
+    <Real>0.22131585891635455</Real>
+    <Real>0.26413471053519755</Real>
+    <Real>0.31154114346152084</Real>
+    <Real>0.36321009172092422</Real>
+    <Real>0.41863443844503245</Real>
+    <Real>0.47711929657339158</Real>
+    <Real>0.53778586364542869</Real>
+    <Real>0.59958548922687738</Real>
+    <Real>0.66132403592671196</Real>
+    <Real>0.72169598676563462</Real>
+    <Real>0.77932709828961222</Real>
+    <Real>0.83282377210865988</Real>
+    <Real>0.88082677118404018</Real>
+    <Real>0.92206649160055121</Real>
+    <Real>0.95541675775135737</Real>
+    <Real>0.9799440679435939</Real>
+    <Real>0.99494939127197923</Real>
+  </Sequence>
+  <Sequence Name="Y">
+    <Int Name="Length">84</Int>
+    <Real>1</Real>
+    <Real>0.99767135105104621</Real>
+    <Real>0.99071659655276323</Real>
+    <Real>0.97922864594230408</Real>
+    <Real>0.96336014209944676</Real>
+    <Real>0.94332021852360948</Real>
+    <Real>0.91937008986699287</Real>
+    <Real>0.89181760077675287</Real>
+    <Real>0.86101088605709308</Real>
+    <Real>0.82733131793012282</Real>
+    <Real>0.79118593294295625</Real>
+    <Real>0.75299954137234981</Real>
+    <Real>0.71320672561299991</Real>
+    <Real>0.67224393106003733</Real>
+    <Real>0.63054184372494826</Real>
+    <Real>0.5885182338069832</Real>
+    <Real>0.54657142443460582</Real>
+    <Real>0.50507452071616155</Real>
+    <Real>0.46437050713986255</Real>
+    <Real>0.42476829235622371</Real>
+    <Real>0.3865397505982584</Real>
+    <Real>0.34991777955278341</Real>
+    <Real>0.31509536642106994</Real>
+    <Real>0.28222562811429547</Real>
+    <Real>0.25142276879144704</Real>
+    <Real>0.22276387888579641</Real>
+    <Real>0.19629148487173642</Real>
+    <Real>0.17201674873386533</Real>
+    <Real>0.14992321097434108</Real>
+    <Real>0.12997097208672034</Real>
+    <Real>0.11210121703674311</Real>
+    <Real>0.096241010481140643</Real>
+    <Real>0.082308338034130235</Real>
+    <Real>0.070217463333273111</Real>
+    <Real>0.059884857726556467</Real>
+    <Real>0.051236330892951661</Real>
+    <Real>0.044216728742829996</Real>
+    <Real>0.038805028015203503</Real>
+    <Real>0.035040546624042074</Real>
+    <Real>0.033071671888768056</Real>
+    <Real>0.033249640426096155</Real>
+    <Real>0.036311630888043747</Real>
+    <Real>0.043739722444097656</Real>
+    <Real>0.036311630888043747</Real>
+    <Real>0.033249640426096155</Real>
+    <Real>0.033071671888768056</Real>
+    <Real>0.035040546624042074</Real>
+    <Real>0.038805028015203503</Real>
+    <Real>0.044216728742829996</Real>
+    <Real>0.051236330892951661</Real>
+    <Real>0.059884857726556467</Real>
+    <Real>0.070217463333273111</Real>
+    <Real>0.082308338034130235</Real>
+    <Real>0.096241010481140643</Real>
+    <Real>0.11210121703674311</Real>
+    <Real>0.12997097208672034</Real>
+    <Real>0.14992321097434108</Real>
+    <Real>0.17201674873386533</Real>
+    <Real>0.19629148487173642</Real>
+    <Real>0.22276387888579641</Real>
+    <Real>0.25142276879144704</Real>
+    <Real>0.28222562811429547</Real>
+    <Real>0.31509536642106994</Real>
+    <Real>0.34991777955278341</Real>
+    <Real>0.3865397505982584</Real>
+    <Real>0.42476829235622371</Real>
+    <Real>0.46437050713986255</Real>
+    <Real>0.50507452071616155</Real>
+    <Real>0.54657142443460582</Real>
+    <Real>0.5885182338069832</Real>
+    <Real>0.63054184372494826</Real>
+    <Real>0.67224393106003733</Real>
+    <Real>0.71320672561299991</Real>
+    <Real>0.75299954137234981</Real>
+    <Real>0.79118593294295625</Real>
+    <Real>0.82733131793012282</Real>
+    <Real>0.86101088605709308</Real>
+    <Real>0.89181760077675287</Real>
+    <Real>0.91937008986699287</Real>
+    <Real>0.94332021852360948</Real>
+    <Real>0.96336014209944676</Real>
+    <Real>0.97922864594230408</Real>
+    <Real>0.99071659655276323</Real>
+    <Real>0.99767135105104621</Real>
+  </Sequence>
+  <Sequence Name="Z">
+    <Int Name="Length">29</Int>
+    <Real>1</Real>
+    <Real>0.98062326911566944</Real>
+    <Real>0.92463164612174864</Real>
+    <Real>0.83806692785041004</Real>
+    <Real>0.72983951519887702</Real>
+    <Real>0.61026962025499942</Real>
+    <Real>0.48952422891097952</Real>
+    <Real>0.37626774010234398</Real>
+    <Real>0.27676472172225453</Real>
+    <Real>0.1945468549937158</Real>
+    <Real>0.13062393044503182</Real>
+    <Real>0.084118646872820113</Real>
+    <Real>0.053173105906025683</Real>
+    <Real>0.036146384873032851</Real>
+    <Real>0.034510897785185804</Real>
+    <Real>0.034510897785185804</Real>
+    <Real>0.036146384873032851</Real>
+    <Real>0.053173105906025683</Real>
+    <Real>0.084118646872820113</Real>
+    <Real>0.13062393044503182</Real>
+    <Real>0.1945468549937158</Real>
+    <Real>0.27676472172225453</Real>
+    <Real>0.37626774010234398</Real>
+    <Real>0.48952422891097952</Real>
+    <Real>0.61026962025499942</Real>
+    <Real>0.72983951519887702</Real>
+    <Real>0.83806692785041004</Real>
+    <Real>0.92463164612174864</Real>
+    <Real>0.98062326911566944</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_18.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_18.xml
new file mode 100644 (file)
index 0000000..2d3d7de
--- /dev/null
@@ -0,0 +1,183 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="X">
+    <Int Name="Length">57</Int>
+    <Real>1</Real>
+    <Real>0.99394233481497718</Real>
+    <Real>0.97598141849367381</Real>
+    <Real>0.94674160991483403</Real>
+    <Real>0.9072248154338074</Real>
+    <Real>0.8587555295403756</Real>
+    <Real>0.80290974618244992</Real>
+    <Real>0.74143292517658166</Real>
+    <Real>0.67615280819988821</Real>
+    <Real>0.60889297367088469</Real>
+    <Real>0.54139261577970732</Real>
+    <Real>0.47523719723429253</Real>
+    <Real>0.41180346564684528</Real>
+    <Real>0.35222097340504771</Real>
+    <Real>0.29735084281184915</Real>
+    <Real>0.24778120691639133</Real>
+    <Real>0.20383764427828754</Real>
+    <Real>0.16560609275165325</Real>
+    <Real>0.13296521498033564</Real>
+    <Real>0.10562500000000008</Real>
+    <Real>0.083168490441534557</Real>
+    <Real>0.06509386645826154</Real>
+    <Real>0.05085462256619782</Real>
+    <Real>0.0398961632045189</Real>
+    <Real>0.031687741829208173</Real>
+    <Real>0.025749212878354629</Real>
+    <Real>0.021672508458015584</Real>
+    <Real>0.019138063289678757</Real>
+    <Real>0.017926582309016018</Real>
+    <Real>0.017926582309016028</Real>
+    <Real>0.019138063289678757</Real>
+    <Real>0.021672508458015584</Real>
+    <Real>0.025749212878354591</Real>
+    <Real>0.03168774182920818</Real>
+    <Real>0.039896163204518879</Real>
+    <Real>0.050854622566197757</Real>
+    <Real>0.065093866458261609</Real>
+    <Real>0.083168490441534362</Real>
+    <Real>0.10562499999999994</Real>
+    <Real>0.13296521498033548</Real>
+    <Real>0.16560609275165311</Real>
+    <Real>0.20383764427828743</Real>
+    <Real>0.24778120691639138</Real>
+    <Real>0.29735084281184893</Real>
+    <Real>0.35222097340504754</Real>
+    <Real>0.41180346564684495</Real>
+    <Real>0.47523719723429225</Real>
+    <Real>0.54139261577970754</Real>
+    <Real>0.60889297367088457</Real>
+    <Real>0.67615280819988799</Real>
+    <Real>0.74143292517658144</Real>
+    <Real>0.80290974618244992</Real>
+    <Real>0.85875552954037593</Real>
+    <Real>0.90722481543380695</Real>
+    <Real>0.94674160991483414</Real>
+    <Real>0.9759814184936737</Real>
+    <Real>0.99394233481497696</Real>
+  </Sequence>
+  <Sequence Name="Y">
+    <Int Name="Length">84</Int>
+    <Real>1</Real>
+    <Real>0.99720627239005266</Real>
+    <Real>0.98887028410399891</Real>
+    <Real>0.9751264469717813</Real>
+    <Real>0.95619491607323037</Real>
+    <Real>0.93237593572814026</Real>
+    <Real>0.9040422032368971</Real>
+    <Real>0.87162951483124795</Real>
+    <Real>0.8356260134676966</Real>
+    <Real>0.79656039947962531</Real>
+    <Real>0.75498949118750946</Real>
+    <Real>0.71148553261965164</Real>
+    <Real>0.66662363958893034</Real>
+    <Real>0.62096975434726776</Real>
+    <Real>0.57506944444444452</Real>
+    <Real>0.52943783539115363</Real>
+    <Real>0.4845509118634278</Real>
+    <Real>0.44083836138004096</Real>
+    <Real>0.39867807065886807</Real>
+    <Real>0.35839232119761033</Real>
+    <Real>0.32024566982017466</Real>
+    <Real>0.28444444444444456</Real>
+    <Real>0.25113773718423743</Real>
+    <Real>0.22041973760769953</Real>
+    <Real>0.19233321949021653</Real>
+    <Real>0.16687397511358193</Real>
+    <Real>0.14399598192965166</Real>
+    <Real>0.12361708659889853</Real>
+    <Real>0.10562500000000008</Real>
+    <Real>0.089883412441655375</Real>
+    <Real>0.076238059437568603</Real>
+    <Real>0.064522593368110989</Real>
+    <Real>0.054564143476825672</Real>
+    <Real>0.046188474345041246</Real>
+    <Real>0.03922467981458605</Real>
+    <Real>0.033509374057641109</Real>
+    <Real>0.028890363143075554</Real>
+    <Real>0.025229798308550752</Real>
+    <Real>0.022406825780016942</Real>
+    <Real>0.020319757213500347</Real>
+    <Real>0.018887789743089457</Real>
+    <Real>0.018052305497639386</Real>
+    <Real>0.017777777777777778</Real>
+    <Real>0.018052305497639393</Real>
+    <Real>0.018887789743089457</Real>
+    <Real>0.020319757213500336</Real>
+    <Real>0.022406825780016917</Real>
+    <Real>0.025229798308550766</Real>
+    <Real>0.028890363143075536</Real>
+    <Real>0.033509374057641046</Real>
+    <Real>0.039224679814586064</Real>
+    <Real>0.046188474345041239</Real>
+    <Real>0.054564143476825727</Real>
+    <Real>0.06452259336811092</Real>
+    <Real>0.076238059437568562</Real>
+    <Real>0.089883412441655416</Real>
+    <Real>0.10562499999999994</Real>
+    <Real>0.12361708659889853</Real>
+    <Real>0.14399598192965177</Real>
+    <Real>0.16687397511358176</Real>
+    <Real>0.19233321949021651</Real>
+    <Real>0.22041973760769942</Real>
+    <Real>0.25113773718423715</Real>
+    <Real>0.28444444444444444</Real>
+    <Real>0.32024566982017455</Real>
+    <Real>0.35839232119760994</Real>
+    <Real>0.39867807065886796</Real>
+    <Real>0.44083836138004107</Real>
+    <Real>0.48455091186342819</Real>
+    <Real>0.52943783539115352</Real>
+    <Real>0.57506944444444408</Real>
+    <Real>0.62096975434726787</Real>
+    <Real>0.66662363958893001</Real>
+    <Real>0.71148553261965097</Real>
+    <Real>0.75498949118750946</Real>
+    <Real>0.79656039947962509</Real>
+    <Real>0.83562601346769649</Real>
+    <Real>0.87162951483124751</Real>
+    <Real>0.90404220323689677</Real>
+    <Real>0.93237593572814004</Real>
+    <Real>0.95619491607323004</Real>
+    <Real>0.97512644697178119</Real>
+    <Real>0.98887028410399869</Real>
+    <Real>0.99720627239005233</Real>
+  </Sequence>
+  <Sequence Name="Z">
+    <Int Name="Length">29</Int>
+    <Real>1</Real>
+    <Real>0.97679321956799314</Real>
+    <Real>0.91025424608948602</Real>
+    <Real>0.80897876349947651</Real>
+    <Real>0.68531524119907727</Real>
+    <Real>0.55297646481359697</Real>
+    <Real>0.42464510777126263</Real>
+    <Real>0.3101278395646998</Real>
+    <Real>0.21538904078841092</Real>
+    <Real>0.14251144028518392</Real>
+    <Real>0.090390403912195938</Real>
+    <Real>0.055839707378934816</Real>
+    <Real>0.034783007569253982</Real>
+    <Real>0.023292409670689136</Real>
+    <Real>0.018355885667517561</Real>
+    <Real>0.018355885667517561</Real>
+    <Real>0.023292409670689143</Real>
+    <Real>0.034783007569254031</Real>
+    <Real>0.055839707378934726</Real>
+    <Real>0.090390403912195827</Real>
+    <Real>0.14251144028518381</Real>
+    <Real>0.21538904078841084</Real>
+    <Real>0.31012783956469941</Real>
+    <Real>0.4246451077712623</Real>
+    <Real>0.55297646481359697</Real>
+    <Real>0.6853152411990775</Real>
+    <Real>0.80897876349947662</Real>
+    <Real>0.9102542460894858</Real>
+    <Real>0.97679321956799292</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_19.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_19.xml
new file mode 100644 (file)
index 0000000..3907a0c
--- /dev/null
@@ -0,0 +1,183 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="X">
+    <Int Name="Length">57</Int>
+    <Real>1</Real>
+    <Real>0.99394233469628879</Real>
+    <Real>0.97598141089179258</Real>
+    <Real>0.94674152324479255</Real>
+    <Real>0.90722432819348298</Real>
+    <Real>0.85875367175041695</Real>
+    <Real>0.80290421150777025</Real>
+    <Real>0.74141903744684357</Real>
+    <Real>0.67612212380676495</Real>
+    <Real>0.60883155879062278</Real>
+    <Real>0.54127911188492994</Real>
+    <Real>0.47504087184025068</Real>
+    <Real>0.41148252492562132</Real>
+    <Real>0.35172147384038532</Real>
+    <Real>0.296606565620393</Real>
+    <Real>0.24671484078000847</Real>
+    <Real>0.20236355564261158</Real>
+    <Real>0.16363485481098436</Real>
+    <Real>0.13040993308132204</Real>
+    <Real>0.1024093385705175</Real>
+    <Real>0.079236208884266926</Real>
+    <Real>0.060419654754816671</Real>
+    <Real>0.045456176328449546</Real>
+    <Real>0.0338479899109973</Real>
+    <Real>0.025138955077774604</Real>
+    <Real>0.018953401231942061</Real>
+    <Real>0.015057546528290352</Real>
+    <Real>0.013511057412693969</Real>
+    <Real>0.015136223367319493</Real>
+    <Real>0.015136223367319493</Real>
+    <Real>0.013511057412693969</Real>
+    <Real>0.015057546528290352</Real>
+    <Real>0.018953401231942061</Real>
+    <Real>0.025138955077774604</Real>
+    <Real>0.0338479899109973</Real>
+    <Real>0.045456176328449546</Real>
+    <Real>0.060419654754816671</Real>
+    <Real>0.079236208884266926</Real>
+    <Real>0.1024093385705175</Real>
+    <Real>0.13040993308132204</Real>
+    <Real>0.16363485481098436</Real>
+    <Real>0.20236355564261158</Real>
+    <Real>0.24671484078000847</Real>
+    <Real>0.296606565620393</Real>
+    <Real>0.35172147384038532</Real>
+    <Real>0.41148252492562132</Real>
+    <Real>0.47504087184025068</Real>
+    <Real>0.54127911188492994</Real>
+    <Real>0.60883155879062278</Real>
+    <Real>0.67612212380676495</Real>
+    <Real>0.74141903744684357</Real>
+    <Real>0.80290421150777025</Real>
+    <Real>0.85875367175041695</Real>
+    <Real>0.90722432819348298</Real>
+    <Real>0.94674152324479255</Real>
+    <Real>0.97598141089179258</Real>
+    <Real>0.99394233469628879</Real>
+  </Sequence>
+  <Sequence Name="Y">
+    <Int Name="Length">84</Int>
+    <Real>1</Real>
+    <Real>0.99720627237846593</Real>
+    <Real>0.98887028336224359</Real>
+    <Real>0.97512643851789638</Real>
+    <Real>0.95619486854349123</Real>
+    <Real>0.93237575431714581</Real>
+    <Real>0.90404166140062658</Real>
+    <Real>0.87162814883418571</Real>
+    <Real>0.83562297271034502</Real>
+    <Real>0.79655424707085953</Real>
+    <Real>0.75497795158484893</Real>
+    <Real>0.711465186436539</Real>
+    <Real>0.66658956985227713</Real>
+    <Real>0.62091515345733406</Real>
+    <Real>0.57498519660083891</Real>
+    <Real>0.52931209495227383</Real>
+    <Real>0.48436870356467054</Real>
+    <Real>0.44058123306096036</Real>
+    <Real>0.39832383264886684</Real>
+    <Real>0.35791490833811923</Real>
+    <Real>0.31961516191294181</Real>
+    <Real>0.28362727851290037</Real>
+    <Real>0.25009714030836877</Real>
+    <Real>0.21911640244644226</Real>
+    <Real>0.19072623636552247</Real>
+    <Real>0.16492202533715164</Real>
+    <Real>0.141658787735681</Real>
+    <Real>0.12085710459189307</Real>
+    <Real>0.10240933857051719</Real>
+    <Real>0.086185950490232893</Real>
+    <Real>0.072041745806303639</Real>
+    <Real>0.059821916711369744</Real>
+    <Real>0.049367787310129883</Real>
+    <Real>0.040522226335123285</Real>
+    <Real>0.033134782570204697</Real>
+    <Real>0.027066768383207464</Real>
+    <Real>0.02219687507318183</Real>
+    <Real>0.018428701142637595</Real>
+    <Real>0.015703384014872881</Real>
+    <Real>0.014024643029010873</Real>
+    <Real>0.013512879057637064</Real>
+    <Real>0.014526046402321378</Real>
+    <Real>0.017932325748914145</Real>
+    <Real>0.014526046402321378</Real>
+    <Real>0.013512879057637064</Real>
+    <Real>0.014024643029010873</Real>
+    <Real>0.015703384014872881</Real>
+    <Real>0.018428701142637595</Real>
+    <Real>0.02219687507318183</Real>
+    <Real>0.027066768383207464</Real>
+    <Real>0.033134782570204697</Real>
+    <Real>0.040522226335123285</Real>
+    <Real>0.049367787310129883</Real>
+    <Real>0.059821916711369744</Real>
+    <Real>0.072041745806303639</Real>
+    <Real>0.086185950490232893</Real>
+    <Real>0.10240933857051719</Real>
+    <Real>0.12085710459189307</Real>
+    <Real>0.141658787735681</Real>
+    <Real>0.16492202533715164</Real>
+    <Real>0.19072623636552247</Real>
+    <Real>0.21911640244644226</Real>
+    <Real>0.25009714030836877</Real>
+    <Real>0.28362727851290037</Real>
+    <Real>0.31961516191294181</Real>
+    <Real>0.35791490833811923</Real>
+    <Real>0.39832383264886684</Real>
+    <Real>0.44058123306096036</Real>
+    <Real>0.48436870356467054</Real>
+    <Real>0.52931209495227383</Real>
+    <Real>0.57498519660083891</Real>
+    <Real>0.62091515345733406</Real>
+    <Real>0.66658956985227713</Real>
+    <Real>0.711465186436539</Real>
+    <Real>0.75497795158484893</Real>
+    <Real>0.79655424707085953</Real>
+    <Real>0.83562297271034502</Real>
+    <Real>0.87162814883418571</Real>
+    <Real>0.90404166140062658</Real>
+    <Real>0.93237575431714581</Real>
+    <Real>0.95619486854349123</Real>
+    <Real>0.97512643851789638</Real>
+    <Real>0.98887028336224359</Real>
+    <Real>0.99720627237846593</Real>
+  </Sequence>
+  <Sequence Name="Z">
+    <Int Name="Length">29</Int>
+    <Real>1</Real>
+    <Real>0.97679321271960218</Real>
+    <Real>0.91025380713600412</Real>
+    <Real>0.80897377554073846</Real>
+    <Real>0.68528755848646272</Real>
+    <Real>0.55287384922299132</Real>
+    <Real>0.42435396506286321</Real>
+    <Real>0.30944933832540578</Real>
+    <Real>0.21403629922390921</Real>
+    <Real>0.14014625148844487</Real>
+    <Real>0.086709898455324869</Real>
+    <Real>0.05071060594404888</Real>
+    <Real>0.028417516579249732</Real>
+    <Real>0.016526844645414884</Real>
+    <Real>0.013844502036860955</Real>
+    <Real>0.013844502036860955</Real>
+    <Real>0.016526844645414884</Real>
+    <Real>0.028417516579249732</Real>
+    <Real>0.05071060594404888</Real>
+    <Real>0.086709898455324869</Real>
+    <Real>0.14014625148844487</Real>
+    <Real>0.21403629922390921</Real>
+    <Real>0.30944933832540578</Real>
+    <Real>0.42435396506286321</Real>
+    <Real>0.55287384922299132</Real>
+    <Real>0.68528755848646272</Real>
+    <Real>0.80897377554073846</Real>
+    <Real>0.91025380713600412</Real>
+    <Real>0.97679321271960218</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_2.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_2.xml
new file mode 100644 (file)
index 0000000..7ca8e47
--- /dev/null
@@ -0,0 +1,173 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="X">
+    <Int Name="Length">64</Int>
+    <Real>0.99999999999999978</Real>
+    <Real>0.99679239409893372</Real>
+    <Real>0.98723120976317369</Real>
+    <Real>0.97149957212001192</Real>
+    <Real>0.94989683562649085</Real>
+    <Real>0.92283001932258024</Real>
+    <Real>0.89080224059919155</Real>
+    <Real>0.85439855271766807</Real>
+    <Real>0.81426968052735449</Real>
+    <Real>0.77111421951627979</Real>
+    <Real>0.72565991287731824</Real>
+    <Real>0.67864464786602108</Real>
+    <Real>0.63079781542967595</Real>
+    <Real>0.58282265587406412</Real>
+    <Real>0.53538016908987429</Real>
+    <Real>0.48907510234629203</Real>
+    <Real>0.44444444444444442</Real>
+    <Real>0.4019487553866824</Real>
+    <Real>0.36196654951998258</Real>
+    <Real>0.3247918316478754</Real>
+    <Real>0.29063476443848546</Real>
+    <Real>0.25962532624291201</Real>
+    <Real>0.23181970574878294</Real>
+    <Real>0.2072090780374837</Real>
+    <Real>0.18573031947264551</Real>
+    <Real>0.16727814972856847</Real>
+    <Real>0.15171814077470705</Real>
+    <Real>0.13890000656848678</Real>
+    <Real>0.12867058450534741</Real>
+    <Real>0.12088594035804859</Real>
+    <Real>0.11542207162696907</Real>
+    <Real>0.11218374816809194</Real>
+    <Real>0.11111111111111113</Real>
+    <Real>0.112183748168092</Real>
+    <Real>0.11542207162696905</Real>
+    <Real>0.12088594035804853</Real>
+    <Real>0.12867058450534735</Real>
+    <Real>0.13890000656848675</Real>
+    <Real>0.15171814077470702</Real>
+    <Real>0.1672781497285685</Real>
+    <Real>0.18573031947264537</Real>
+    <Real>0.20720907803748359</Real>
+    <Real>0.23181970574878286</Real>
+    <Real>0.2596253262429119</Real>
+    <Real>0.29063476443848507</Real>
+    <Real>0.32479183164787534</Real>
+    <Real>0.36196654951998264</Real>
+    <Real>0.40194875538668234</Real>
+    <Real>0.44444444444444425</Real>
+    <Real>0.48907510234629159</Real>
+    <Real>0.53538016908987418</Real>
+    <Real>0.58282265587406357</Real>
+    <Real>0.63079781542967606</Real>
+    <Real>0.67864464786602086</Real>
+    <Real>0.72565991287731779</Real>
+    <Real>0.77111421951627979</Real>
+    <Real>0.81426968052735449</Real>
+    <Real>0.85439855271766763</Real>
+    <Real>0.89080224059919133</Real>
+    <Real>0.92283001932258024</Real>
+    <Real>0.94989683562649074</Real>
+    <Real>0.9714995721200117</Real>
+    <Real>0.98723120976317369</Real>
+    <Real>0.99679239409893361</Real>
+  </Sequence>
+  <Sequence Name="Y">
+    <Int Name="Length">32</Int>
+    <Real>0.99999999999999978</Real>
+    <Real>0.98723120976317369</Real>
+    <Real>0.94989683562649085</Real>
+    <Real>0.89080224059919155</Real>
+    <Real>0.81426968052735449</Real>
+    <Real>0.72565991287731824</Real>
+    <Real>0.63079781542967595</Real>
+    <Real>0.53538016908987429</Real>
+    <Real>0.44444444444444442</Real>
+    <Real>0.36196654951998258</Real>
+    <Real>0.29063476443848546</Real>
+    <Real>0.23181970574878294</Real>
+    <Real>0.18573031947264551</Real>
+    <Real>0.15171814077470705</Real>
+    <Real>0.12867058450534741</Real>
+    <Real>0.11542207162696907</Real>
+    <Real>0.11111111111111113</Real>
+    <Real>0.11542207162696905</Real>
+    <Real>0.12867058450534735</Real>
+    <Real>0.15171814077470702</Real>
+    <Real>0.18573031947264537</Real>
+    <Real>0.23181970574878286</Real>
+    <Real>0.29063476443848507</Real>
+    <Real>0.36196654951998264</Real>
+    <Real>0.44444444444444425</Real>
+    <Real>0.53538016908987418</Real>
+    <Real>0.63079781542967606</Real>
+    <Real>0.72565991287731779</Real>
+    <Real>0.81426968052735449</Real>
+    <Real>0.89080224059919133</Real>
+    <Real>0.94989683562649074</Real>
+    <Real>0.98723120976317369</Real>
+  </Sequence>
+  <Sequence Name="Z">
+    <Int Name="Length">64</Int>
+    <Real>0.99999999999999978</Real>
+    <Real>0.99679239409893372</Real>
+    <Real>0.98723120976317369</Real>
+    <Real>0.97149957212001192</Real>
+    <Real>0.94989683562649085</Real>
+    <Real>0.92283001932258024</Real>
+    <Real>0.89080224059919155</Real>
+    <Real>0.85439855271766807</Real>
+    <Real>0.81426968052735449</Real>
+    <Real>0.77111421951627979</Real>
+    <Real>0.72565991287731824</Real>
+    <Real>0.67864464786602108</Real>
+    <Real>0.63079781542967595</Real>
+    <Real>0.58282265587406412</Real>
+    <Real>0.53538016908987429</Real>
+    <Real>0.48907510234629203</Real>
+    <Real>0.44444444444444442</Real>
+    <Real>0.4019487553866824</Real>
+    <Real>0.36196654951998258</Real>
+    <Real>0.3247918316478754</Real>
+    <Real>0.29063476443848546</Real>
+    <Real>0.25962532624291201</Real>
+    <Real>0.23181970574878294</Real>
+    <Real>0.2072090780374837</Real>
+    <Real>0.18573031947264551</Real>
+    <Real>0.16727814972856847</Real>
+    <Real>0.15171814077470705</Real>
+    <Real>0.13890000656848678</Real>
+    <Real>0.12867058450534741</Real>
+    <Real>0.12088594035804859</Real>
+    <Real>0.11542207162696907</Real>
+    <Real>0.11218374816809194</Real>
+    <Real>0.11111111111111113</Real>
+    <Real>0.112183748168092</Real>
+    <Real>0.11542207162696905</Real>
+    <Real>0.12088594035804853</Real>
+    <Real>0.12867058450534735</Real>
+    <Real>0.13890000656848675</Real>
+    <Real>0.15171814077470702</Real>
+    <Real>0.1672781497285685</Real>
+    <Real>0.18573031947264537</Real>
+    <Real>0.20720907803748359</Real>
+    <Real>0.23181970574878286</Real>
+    <Real>0.2596253262429119</Real>
+    <Real>0.29063476443848507</Real>
+    <Real>0.32479183164787534</Real>
+    <Real>0.36196654951998264</Real>
+    <Real>0.40194875538668234</Real>
+    <Real>0.44444444444444425</Real>
+    <Real>0.48907510234629159</Real>
+    <Real>0.53538016908987418</Real>
+    <Real>0.58282265587406357</Real>
+    <Real>0.63079781542967606</Real>
+    <Real>0.67864464786602086</Real>
+    <Real>0.72565991287731779</Real>
+    <Real>0.77111421951627979</Real>
+    <Real>0.81426968052735449</Real>
+    <Real>0.85439855271766763</Real>
+    <Real>0.89080224059919133</Real>
+    <Real>0.92283001932258024</Real>
+    <Real>0.94989683562649074</Real>
+    <Real>0.9714995721200117</Real>
+    <Real>0.98723120976317369</Real>
+    <Real>0.99679239409893361</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_20.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_20.xml
new file mode 100644 (file)
index 0000000..b595717
--- /dev/null
@@ -0,0 +1,183 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="X">
+    <Int Name="Length">57</Int>
+    <Real>0.99999999999999956</Real>
+    <Real>0.99293629743143541</Real>
+    <Real>0.97203477780395642</Real>
+    <Real>0.93814505871719378</Real>
+    <Real>0.89262105791292667</Real>
+    <Real>0.83723362292112424</Real>
+    <Real>0.77405914830226275</Real>
+    <Real>0.70535366793118959</Real>
+    <Real>0.63342276382324902</Real>
+    <Real>0.56049743155528897</Real>
+    <Real>0.48862486224864865</Real>
+    <Real>0.41958113040177153</Real>
+    <Real>0.35481028404913162</Real>
+    <Real>0.29539162793120283</Real>
+    <Real>0.24203437918365034</Real>
+    <Real>0.19509662614010267</Real>
+    <Real>0.1546238325516216</Real>
+    <Real>0.12040111394787817</Real>
+    <Real>0.092013192235849639</Real>
+    <Real>0.068906250000000127</Real>
+    <Real>0.050446735243276537</Real>
+    <Real>0.035973348788724116</Real>
+    <Real>0.024839803791898197</Real>
+    <Real>0.016447311108468962</Real>
+    <Real>0.01026697222271509</Real>
+    <Real>0.0058532460907484716</Real>
+    <Real>0.0028503316368781138</Real>
+    <Real>0.00099364786527341895</Real>
+    <Real>0.0001086077931603231</Real>
+    <Real>0.00010860779316032216</Real>
+    <Real>0.00099364786527340876</Real>
+    <Real>0.0028503316368781902</Real>
+    <Real>0.0058532460907484637</Real>
+    <Real>0.010266972222715005</Real>
+    <Real>0.016447311108468771</Real>
+    <Real>0.024839803791897968</Real>
+    <Real>0.035973348788724345</Real>
+    <Real>0.050446735243276218</Real>
+    <Real>0.068906249999999725</Real>
+    <Real>0.092013192235849153</Real>
+    <Real>0.12040111394787807</Real>
+    <Real>0.15462383255162196</Real>
+    <Real>0.19509662614010334</Real>
+    <Real>0.24203437918365009</Real>
+    <Real>0.29539162793120266</Real>
+    <Real>0.35481028404913062</Real>
+    <Real>0.41958113040177086</Real>
+    <Real>0.48862486224864954</Real>
+    <Real>0.56049743155528831</Real>
+    <Real>0.63342276382324869</Real>
+    <Real>0.70535366793118925</Real>
+    <Real>0.77405914830226319</Real>
+    <Real>0.83723362292112458</Real>
+    <Real>0.8926210579129269</Real>
+    <Real>0.93814505871719367</Real>
+    <Real>0.97203477780395642</Real>
+    <Real>0.99293629743143519</Real>
+  </Sequence>
+  <Sequence Name="Y">
+    <Int Name="Length">84</Int>
+    <Real>0.99999999999999956</Real>
+    <Real>0.99674141050890508</Real>
+    <Real>0.98702741098370728</Real>
+    <Real>0.97104141608284489</Real>
+    <Real>0.94908288808508878</Real>
+    <Real>0.92155826424873033</Real>
+    <Real>0.88896878196077733</Real>
+    <Real>0.85189569598331061</Real>
+    <Real>0.81098347908176738</Real>
+    <Real>0.76692166484224311</Real>
+    <Real>0.72042602682911738</Real>
+    <Real>0.67221979054407921</Real>
+    <Real>0.62301554493158862</Real>
+    <Real>0.57349846118404957</Real>
+    <Real>0.5243113425925926</Real>
+    <Real>0.4760419256162659</Real>
+    <Real>0.42921273546095995</Real>
+    <Real>0.38427367591921779</Real>
+    <Real>0.34159740964749719</Real>
+    <Real>0.30147746765616906</Real>
+    <Real>0.26412892101138158</Real>
+    <Real>0.22969135802469134</Real>
+    <Real>0.19823383975668096</Real>
+    <Real>0.1697614574053431</Real>
+    <Real>0.14422308770631728</Real>
+    <Real>0.12151993623309564</Real>
+    <Real>0.10151447176686693</Real>
+    <Real>0.084039385146186182</Real>
+    <Real>0.068906250000000127</Real>
+    <Real>0.055913616910146603</Real>
+    <Real>0.04485433308308312</Real>
+    <Real>0.035521942845509483</Real>
+    <Real>0.027716086784539334</Real>
+    <Real>0.021246876110046373</Real>
+    <Real>0.015938271321125595</Real>
+    <Real>0.011630538584590228</Real>
+    <Real>0.0081818920534518398</Real>
+    <Real>0.0054694549226529986</Real>
+    <Real>0.0033896861326249278</Real>
+    <Real>0.0018584235604375595</Real>
+    <Real>0.00081068895897857336</Real>
+    <Real>0.00020038581963129673</Real>
+    <Real>0.00020038581963129518</Real>
+    <Real>0.00020038581963129364</Real>
+    <Real>0.00081068895897857271</Real>
+    <Real>0.0018584235604375034</Real>
+    <Real>0.003389686132624822</Real>
+    <Real>0.0054694549226530897</Real>
+    <Real>0.0081818920534518346</Real>
+    <Real>0.011630538584590056</Real>
+    <Real>0.015938271321125658</Real>
+    <Real>0.021246876110046411</Real>
+    <Real>0.027716086784539323</Real>
+    <Real>0.035521942845509608</Real>
+    <Real>0.044854333083083259</Real>
+    <Real>0.055913616910146548</Real>
+    <Real>0.068906249999999725</Real>
+    <Real>0.084039385146186127</Real>
+    <Real>0.10151447176686712</Real>
+    <Real>0.12151993623309497</Real>
+    <Real>0.14422308770631762</Real>
+    <Real>0.16976145740534321</Real>
+    <Real>0.19823383975668116</Real>
+    <Real>0.22969135802469126</Real>
+    <Real>0.26412892101138163</Real>
+    <Real>0.30147746765616856</Real>
+    <Real>0.3415974096474968</Real>
+    <Real>0.38427367591921813</Real>
+    <Real>0.42921273546096006</Real>
+    <Real>0.47604192561626668</Real>
+    <Real>0.52431134259259149</Real>
+    <Real>0.5734984611840499</Real>
+    <Real>0.62301554493158839</Real>
+    <Real>0.67221979054407854</Real>
+    <Real>0.72042602682911738</Real>
+    <Real>0.76692166484224344</Real>
+    <Real>0.81098347908176716</Real>
+    <Real>0.85189569598331061</Real>
+    <Real>0.88896878196077711</Real>
+    <Real>0.92155826424873044</Real>
+    <Real>0.94908288808508867</Real>
+    <Real>0.97104141608284467</Real>
+    <Real>0.98702741098370717</Real>
+    <Real>0.99674141050890508</Real>
+  </Sequence>
+  <Sequence Name="Z">
+    <Int Name="Length">29</Int>
+    <Real>0.99999999999999956</Real>
+    <Real>0.97297811546027457</Real>
+    <Real>0.89609952702199769</Real>
+    <Real>0.78089025164742498</Real>
+    <Real>0.64345222053817641</Real>
+    <Real>0.50086041897423228</Real>
+    <Real>0.36780213122533956</Real>
+    <Real>0.25433397578287836</Real>
+    <Real>0.16515116321224893</Real>
+    <Real>0.10023011466040034</Real>
+    <Real>0.056328260625575277</Real>
+    <Real>0.028709139040944638</Real>
+    <Real>0.012586618383384689</Real>
+    <Real>0.0040410309448576029</Real>
+    <Real>0.00042206334646079926</Real>
+    <Real>0.00042206334646079877</Real>
+    <Real>0.004041030944857589</Real>
+    <Real>0.012586618383384688</Real>
+    <Real>0.028709139040944513</Real>
+    <Real>0.056328260625575576</Real>
+    <Real>0.10023011466040069</Real>
+    <Real>0.16515116321224854</Real>
+    <Real>0.25433397578287764</Real>
+    <Real>0.36780213122533884</Real>
+    <Real>0.50086041897423261</Real>
+    <Real>0.6434522205381773</Real>
+    <Real>0.78089025164742532</Real>
+    <Real>0.89609952702199769</Real>
+    <Real>0.97297811546027435</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_21.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_21.xml
new file mode 100644 (file)
index 0000000..086fd19
--- /dev/null
@@ -0,0 +1,183 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="X">
+    <Int Name="Length">57</Int>
+    <Real>1</Real>
+    <Real>0.99293629743168654</Real>
+    <Real>0.97203477786767201</Real>
+    <Real>0.93814506032243061</Real>
+    <Real>0.89262107356599829</Real>
+    <Real>0.8372337133624983</Real>
+    <Real>0.7740595225726723</Real>
+    <Real>0.70535489520651073</Real>
+    <Real>0.63342615067862673</Real>
+    <Real>0.56050560842274966</Real>
+    <Real>0.48864259492939621</Real>
+    <Real>0.41961632697852747</Real>
+    <Real>0.35487510938368044</Real>
+    <Real>0.29550357667902794</Real>
+    <Real>0.24221710707749461</Real>
+    <Real>0.19538031305624226</Real>
+    <Real>0.15504486355218705</Real>
+    <Real>0.12100092637404439</Real>
+    <Real>0.092836252208210415</Real>
+    <Real>0.069997287104629088</Real>
+    <Real>0.051847569248538034</Real>
+    <Real>0.03771987195092983</Real>
+    <Real>0.026959926212416486</Real>
+    <Real>0.018960962681762932</Real>
+    <Real>0.01318979364150431</Real>
+    <Real>0.0092074161121755982</Real>
+    <Real>0.0066936075825058403</Real>
+    <Real>0.0055105467586834996</Real>
+    <Real>0.0059466765207910549</Real>
+    <Real>0.0059466765207910549</Real>
+    <Real>0.0055105467586834996</Real>
+    <Real>0.0066936075825058403</Real>
+    <Real>0.0092074161121755982</Real>
+    <Real>0.01318979364150431</Real>
+    <Real>0.018960962681762932</Real>
+    <Real>0.026959926212416486</Real>
+    <Real>0.03771987195092983</Real>
+    <Real>0.051847569248538034</Real>
+    <Real>0.069997287104629088</Real>
+    <Real>0.092836252208210415</Real>
+    <Real>0.12100092637404439</Real>
+    <Real>0.15504486355218705</Real>
+    <Real>0.19538031305624226</Real>
+    <Real>0.24221710707749461</Real>
+    <Real>0.29550357667902794</Real>
+    <Real>0.35487510938368044</Real>
+    <Real>0.41961632697852747</Real>
+    <Real>0.48864259492939621</Real>
+    <Real>0.56050560842274966</Real>
+    <Real>0.63342615067862673</Real>
+    <Real>0.70535489520651073</Real>
+    <Real>0.7740595225726723</Real>
+    <Real>0.8372337133624983</Real>
+    <Real>0.89262107356599829</Real>
+    <Real>0.93814506032243061</Real>
+    <Real>0.97203477786767201</Real>
+    <Real>0.99293629743168654</Real>
+  </Sequence>
+  <Sequence Name="Y">
+    <Int Name="Length">84</Int>
+    <Real>1</Real>
+    <Real>0.99674141050891507</Real>
+    <Real>0.9870274109865933</Real>
+    <Real>0.97104141615621542</Real>
+    <Real>0.94908288880993164</Real>
+    <Real>0.9215582685081537</Real>
+    <Real>0.88896879995906597</Real>
+    <Real>0.85189575649289284</Real>
+    <Real>0.81098365101084746</Real>
+    <Real>0.76692209409240086</Real>
+    <Real>0.72042699386112352</Real>
+    <Real>0.67222179390131365</Real>
+    <Real>0.62301941503640845</Real>
+    <Real>0.57350550693962055</Real>
+    <Real>0.52432353069059301</Real>
+    <Real>0.47606208906480318</Real>
+    <Real>0.42924480390382203</Real>
+    <Real>0.38432291611213432</Real>
+    <Real>0.34167066036902483</Real>
+    <Real>0.30158334980102902</Real>
+    <Real>0.26427800111314936</Real>
+    <Real>0.22989624244423834</Real>
+    <Real>0.19850917766423412</Real>
+    <Real>0.17012383379813972</Real>
+    <Real>0.1446907932352707</Real>
+    <Real>0.12211260860350447</Real>
+    <Real>0.10225261380805185</Real>
+    <Real>0.084943777029759818</Real>
+    <Real>0.069997287104629269</Real>
+    <Real>0.057210619972190936</Real>
+    <Real>0.046374893040217122</Real>
+    <Real>0.03728137891452072</Real>
+    <Real>0.029727113355527277</Real>
+    <Real>0.023519594837572814</Real>
+    <Real>0.018480638640988686</Real>
+    <Real>0.014449532808924836</Real>
+    <Real>0.011285793500657533</Real>
+    <Real>0.0088721624647573345</Real>
+    <Real>0.0071193751787466692</Real>
+    <Real>0.0059765660173935206</Real>
+    <Real>0.0054573457400799311</Real>
+    <Real>0.0057077485219992341</Real>
+    <Real>0.007184257576382103</Real>
+    <Real>0.0057077485219992341</Real>
+    <Real>0.0054573457400799311</Real>
+    <Real>0.0059765660173935206</Real>
+    <Real>0.0071193751787466692</Real>
+    <Real>0.0088721624647573345</Real>
+    <Real>0.011285793500657533</Real>
+    <Real>0.014449532808924836</Real>
+    <Real>0.018480638640988686</Real>
+    <Real>0.023519594837572814</Real>
+    <Real>0.029727113355527277</Real>
+    <Real>0.03728137891452072</Real>
+    <Real>0.046374893040217122</Real>
+    <Real>0.057210619972190936</Real>
+    <Real>0.069997287104629269</Real>
+    <Real>0.084943777029759818</Real>
+    <Real>0.10225261380805185</Real>
+    <Real>0.12211260860350447</Real>
+    <Real>0.1446907932352707</Real>
+    <Real>0.17012383379813972</Real>
+    <Real>0.19850917766423412</Real>
+    <Real>0.22989624244423834</Real>
+    <Real>0.26427800111314936</Real>
+    <Real>0.30158334980102902</Real>
+    <Real>0.34167066036902483</Real>
+    <Real>0.38432291611213432</Real>
+    <Real>0.42924480390382203</Real>
+    <Real>0.47606208906480318</Real>
+    <Real>0.52432353069059301</Real>
+    <Real>0.57350550693962055</Real>
+    <Real>0.62301941503640845</Real>
+    <Real>0.67222179390131365</Real>
+    <Real>0.72042699386112352</Real>
+    <Real>0.76692209409240086</Real>
+    <Real>0.81098365101084746</Real>
+    <Real>0.85189575649289284</Real>
+    <Real>0.88896879995906597</Real>
+    <Real>0.9215582685081537</Real>
+    <Real>0.94908288880993164</Real>
+    <Real>0.97104141615621542</Real>
+    <Real>0.9870274109865933</Real>
+    <Real>0.99674141050891507</Real>
+  </Sequence>
+  <Sequence Name="Z">
+    <Int Name="Length">29</Int>
+    <Real>1</Real>
+    <Real>0.97297811551573965</Real>
+    <Real>0.89609954066760555</Real>
+    <Real>0.78089057870742196</Real>
+    <Real>0.64345519050916622</Real>
+    <Real>0.5008760414411888</Real>
+    <Real>0.36785958159082133</Real>
+    <Real>0.25449710346867382</Real>
+    <Real>0.16553035204390604</Real>
+    <Real>0.10097905569026178</Real>
+    <Real>0.057617856941626314</Real>
+    <Real>0.030684806374171453</Real>
+    <Real>0.015338183773234699</Real>
+    <Real>0.0076532954239202228</Real>
+    <Real>0.0054817471316373021</Real>
+    <Real>0.0054817471316373021</Real>
+    <Real>0.0076532954239202228</Real>
+    <Real>0.015338183773234699</Real>
+    <Real>0.030684806374171453</Real>
+    <Real>0.057617856941626314</Real>
+    <Real>0.10097905569026178</Real>
+    <Real>0.16553035204390604</Real>
+    <Real>0.25449710346867382</Real>
+    <Real>0.36785958159082133</Real>
+    <Real>0.5008760414411888</Real>
+    <Real>0.64345519050916622</Real>
+    <Real>0.78089057870742196</Real>
+    <Real>0.89609954066760555</Real>
+    <Real>0.97297811551573965</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_22.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_22.xml
new file mode 100644 (file)
index 0000000..7f3a8ab
--- /dev/null
@@ -0,0 +1,183 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="X">
+    <Int Name="Length">57</Int>
+    <Real>0.99999999999999956</Real>
+    <Real>0.99193127844649409</Real>
+    <Real>0.96810410408333403</Real>
+    <Real>0.92962665398015176</Real>
+    <Real>0.87825288461282425</Real>
+    <Real>0.8162530500090498</Real>
+    <Real>0.7462511581756055</Real>
+    <Real>0.67104521835376052</Real>
+    <Real>0.59342703817645626</Real>
+    <Real>0.5160172836875867</Real>
+    <Real>0.44112876699547454</Real>
+    <Real>0.37066694386142046</Real>
+    <Real>0.3060719875940312</Real>
+    <Real>0.24830219075902438</Real>
+    <Real>0.19785440413602559</Real>
+    <Real>0.1548141842976353</Real>
+    <Real>0.11892653039631937</Real>
+    <Real>0.089677589925257761</Real>
+    <Real>0.066378365077993856</Real>
+    <Real>0.0482429846938775</Real>
+    <Real>0.034456177152976754</Real>
+    <Real>0.024226831981760157</Real>
+    <Real>0.016826660985003003</Real>
+    <Real>0.011614733348713855</Real>
+    <Real>0.0080499320349045177</Real>
+    <Real>0.0056941260851402367</Real>
+    <Real>0.0042091187954661864</Real>
+    <Real>0.0033503095195367158</Real>
+    <Real>0.0029596118817922222</Real>
+    <Real>0.0029596118817922196</Real>
+    <Real>0.0033503095195367241</Real>
+    <Real>0.0042091187954661994</Real>
+    <Real>0.0056941260851402307</Real>
+    <Real>0.0080499320349044796</Real>
+    <Real>0.011614733348713791</Real>
+    <Real>0.016826660985002902</Real>
+    <Real>0.024226831981760174</Real>
+    <Real>0.034456177152976636</Real>
+    <Real>0.048242984693877611</Real>
+    <Real>0.06637836507799369</Real>
+    <Real>0.0896775899252579</Real>
+    <Real>0.11892653039631947</Real>
+    <Real>0.15481418429763574</Real>
+    <Real>0.19785440413602556</Real>
+    <Real>0.24830219075902377</Real>
+    <Real>0.30607198759403043</Real>
+    <Real>0.37066694386141941</Real>
+    <Real>0.44112876699547565</Real>
+    <Real>0.51601728368758537</Real>
+    <Real>0.59342703817645603</Real>
+    <Real>0.67104521835376074</Real>
+    <Real>0.74625115817560594</Real>
+    <Real>0.81625305000905002</Real>
+    <Real>0.87825288461282414</Real>
+    <Real>0.92962665398015132</Real>
+    <Real>0.96810410408333403</Real>
+    <Real>0.99193127844649376</Real>
+  </Sequence>
+  <Sequence Name="Y">
+    <Int Name="Length">84</Int>
+    <Real>0.99999999999999956</Real>
+    <Real>0.99627676534133136</Real>
+    <Real>0.98518797301387973</Real>
+    <Real>0.96697350687603367</Real>
+    <Real>0.94202380662007779</Real>
+    <Real>0.91086628854960949</Real>
+    <Real>0.87414724744706795</Real>
+    <Real>0.83261008676316861</Real>
+    <Real>0.78707087800851039</Real>
+    <Real>0.73839234623961181</Real>
+    <Real>0.68745741286369988</Real>
+    <Real>0.63514339972072009</Real>
+    <Real>0.58229791360658945</Real>
+    <Real>0.52971729570097492</Real>
+    <Real>0.47812834624590589</Real>
+    <Real>0.42817383377522444</Real>
+    <Real>0.38040208372436973</Real>
+    <Real>0.33526072687671404</Real>
+    <Real>0.293094486419747</Real>
+    <Real>0.25414670424212998</Real>
+    <Real>0.21856416098060585</Real>
+    <Real>0.18640463592844536</Real>
+    <Real>0.1576465850096847</Real>
+    <Real>0.13220028750107038</Real>
+    <Real>0.10991982235054854</Real>
+    <Real>0.090615277957865767</Real>
+    <Real>0.074064668731352826</Real>
+    <Real>0.060025120244528413</Real>
+    <Real>0.048242984693877652</Real>
+    <Real>0.038462652173631234</Real>
+    <Real>0.030433924359437956</Real>
+    <Real>0.023917909986791643</Real>
+    <Real>0.018691481848758126</Real>
+    <Real>0.014550400217029913</Real>
+    <Real>0.011311256343814337</Real>
+    <Real>0.0088124220551732777</Real>
+    <Real>0.0069142084873060269</Real>
+    <Real>0.0054984406117524675</Real>
+    <Real>0.0044676466805511558</Real>
+    <Real>0.0037440456080141816</Real>
+    <Real>0.0032684930126888941</Real>
+    <Real>0.0029995202968429351</Real>
+    <Real>0.0029125724363819575</Real>
+    <Real>0.0029995202968429347</Real>
+    <Real>0.0032684930126888898</Real>
+    <Real>0.0037440456080141526</Real>
+    <Real>0.0044676466805511532</Real>
+    <Real>0.0054984406117524901</Real>
+    <Real>0.0069142084873060356</Real>
+    <Real>0.0088124220551732673</Real>
+    <Real>0.011311256343814337</Real>
+    <Real>0.014550400217030076</Real>
+    <Real>0.018691481848758091</Real>
+    <Real>0.023917909986791695</Real>
+    <Real>0.030433924359437974</Real>
+    <Real>0.038462652173631193</Real>
+    <Real>0.048242984693877278</Real>
+    <Real>0.060025120244528156</Real>
+    <Real>0.074064668731353075</Real>
+    <Real>0.090615277957865462</Real>
+    <Real>0.10991982235054876</Real>
+    <Real>0.1322002875010703</Real>
+    <Real>0.15764658500968512</Real>
+    <Real>0.18640463592844567</Real>
+    <Real>0.21856416098060552</Real>
+    <Real>0.25414670424212982</Real>
+    <Real>0.29309448641974739</Real>
+    <Real>0.33526072687671399</Real>
+    <Real>0.38040208372436929</Real>
+    <Real>0.42817383377522528</Real>
+    <Real>0.47812834624590517</Real>
+    <Real>0.52971729570097448</Real>
+    <Real>0.58229791360658956</Real>
+    <Real>0.63514339972071954</Real>
+    <Real>0.6874574128636991</Real>
+    <Real>0.73839234623961159</Real>
+    <Real>0.78707087800851072</Real>
+    <Real>0.83261008676316894</Real>
+    <Real>0.87414724744706784</Real>
+    <Real>0.91086628854960949</Real>
+    <Real>0.9420238066200779</Real>
+    <Real>0.96697350687603367</Real>
+    <Real>0.98518797301387928</Real>
+    <Real>0.99627676534133158</Real>
+  </Sequence>
+  <Sequence Name="Z">
+    <Int Name="Length">29</Int>
+    <Real>0.99999999999999956</Real>
+    <Real>0.96917791908558748</Real>
+    <Real>0.88216537239769921</Real>
+    <Real>0.75378233627323288</Real>
+    <Real>0.6041770102709294</Real>
+    <Real>0.45377217342940634</Real>
+    <Real>0.31890105676761415</Real>
+    <Real>0.20935022433017264</Real>
+    <Real>0.12813776789921963</Real>
+    <Real>0.073018671122717774</Real>
+    <Real>0.038769336070128772</Real>
+    <Real>0.019343447783351012</Real>
+    <Real>0.0093556684327434619</Real>
+    <Real>0.0047848541871871432</Real>
+    <Real>0.0030965032198494846</Real>
+    <Real>0.0030965032198494854</Real>
+    <Real>0.004784854187187138</Real>
+    <Real>0.0093556684327433959</Real>
+    <Real>0.019343447783350964</Real>
+    <Real>0.038769336070129043</Real>
+    <Real>0.073018671122718204</Real>
+    <Real>0.12813776789921927</Real>
+    <Real>0.20935022433017228</Real>
+    <Real>0.3189010567676136</Real>
+    <Real>0.45377217342940562</Real>
+    <Real>0.60417701027092974</Real>
+    <Real>0.75378233627323299</Real>
+    <Real>0.88216537239769943</Real>
+    <Real>0.96917791908558759</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_23.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_23.xml
new file mode 100644 (file)
index 0000000..414c17f
--- /dev/null
@@ -0,0 +1,183 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="X">
+    <Int Name="Length">57</Int>
+    <Real>1</Real>
+    <Real>0.9919312784464579</Real>
+    <Real>0.96810410407400227</Real>
+    <Real>0.92962665373789177</Real>
+    <Real>0.87825288215462305</Real>
+    <Real>0.81625303510994751</Real>
+    <Real>0.74625109309937454</Real>
+    <Real>0.67104499215886504</Real>
+    <Real>0.59342637479853322</Real>
+    <Real>0.51601557976094403</Real>
+    <Real>0.44112483623292992</Real>
+    <Real>0.37065865400702902</Real>
+    <Real>0.30605579558399515</Real>
+    <Real>0.24827261141223606</Real>
+    <Real>0.1978034837607025</Real>
+    <Real>0.15473108602317279</Real>
+    <Real>0.11879736361383499</Real>
+    <Real>0.089485622848125321</Real>
+    <Real>0.066104741182465745</Real>
+    <Real>0.047868021041824929</Real>
+    <Real>0.03396126438376966</Real>
+    <Real>0.023596900712822586</Real>
+    <Real>0.016053155268528081</Real>
+    <Real>0.010699078328354525</Real>
+    <Real>0.0070076840823060605</Real>
+    <Real>0.0045606884104341452</Real>
+    <Real>0.0030508666701079268</Real>
+    <Real>0.0022996596630090486</Real>
+    <Real>0.0023683132890026382</Real>
+    <Real>0.0023683132890026382</Real>
+    <Real>0.0022996596630090486</Real>
+    <Real>0.0030508666701079268</Real>
+    <Real>0.0045606884104341452</Real>
+    <Real>0.0070076840823060605</Real>
+    <Real>0.010699078328354525</Real>
+    <Real>0.016053155268528081</Real>
+    <Real>0.023596900712822586</Real>
+    <Real>0.03396126438376966</Real>
+    <Real>0.047868021041824929</Real>
+    <Real>0.066104741182465745</Real>
+    <Real>0.089485622848125321</Real>
+    <Real>0.11879736361383499</Real>
+    <Real>0.15473108602317279</Real>
+    <Real>0.1978034837607025</Real>
+    <Real>0.24827261141223606</Real>
+    <Real>0.30605579558399515</Real>
+    <Real>0.37065865400702902</Real>
+    <Real>0.44112483623292992</Real>
+    <Real>0.51601557976094403</Real>
+    <Real>0.59342637479853322</Real>
+    <Real>0.67104499215886504</Real>
+    <Real>0.74625109309937454</Real>
+    <Real>0.81625303510994751</Real>
+    <Real>0.87825288215462305</Real>
+    <Real>0.92962665373789177</Real>
+    <Real>0.96810410407400227</Real>
+    <Real>0.9919312784464579</Real>
+  </Sequence>
+  <Sequence Name="Y">
+    <Int Name="Length">84</Int>
+    <Real>1</Real>
+    <Real>0.9962767653413287</Real>
+    <Real>0.98518797301346384</Real>
+    <Real>0.96697350686527894</Real>
+    <Real>0.94202380651173623</Real>
+    <Real>0.91086628789736601</Real>
+    <Real>0.87414724461158877</Real>
+    <Real>0.83261007691987088</Real>
+    <Real>0.787070849041003</Real>
+    <Real>0.73839227114940331</Real>
+    <Real>0.68745723689264115</Real>
+    <Real>0.63514301999540812</Real>
+    <Real>0.58229714886548378</Real>
+    <Real>0.52971584366150437</Real>
+    <Real>0.47812572651811547</Real>
+    <Real>0.42816931502090799</Real>
+    <Real>0.38039459504912959</Real>
+    <Real>0.33524875522378467</Real>
+    <Real>0.29307596393494545</Real>
+    <Real>0.25411889204827737</Real>
+    <Real>0.21852353831426113</Real>
+    <Real>0.18634680587273886</Real>
+    <Real>0.1575662097981721</Real>
+    <Real>0.13209106727404829</Real>
+    <Real>0.1097745310797878</Real>
+    <Real>0.090425868886316554</Real>
+    <Real>0.073822459118630945</Real>
+    <Real>0.059721061668809007</Real>
+    <Real>0.047868021041824728</Real>
+    <Real>0.038008163362592905</Real>
+    <Real>0.029892250579570376</Real>
+    <Real>0.023282949794115493</Real>
+    <Real>0.017959358953134743</Real>
+    <Real>0.013720199916616887</Real>
+    <Real>0.01038584637701591</Real>
+    <Real>0.0077994023793495834</Real>
+    <Real>0.0058271051667861881</Real>
+    <Real>0.0043584494641990641</Real>
+    <Real>0.0033067900681457208</Real>
+    <Real>0.0026122974912873775</Real>
+    <Real>0.0022525975538414582</Real>
+    <Real>0.0022769636247049127</Real>
+    <Real>0.0029116688417632187</Real>
+    <Real>0.0022769636247049127</Real>
+    <Real>0.0022525975538414582</Real>
+    <Real>0.0026122974912873775</Real>
+    <Real>0.0033067900681457208</Real>
+    <Real>0.0043584494641990641</Real>
+    <Real>0.0058271051667861881</Real>
+    <Real>0.0077994023793495834</Real>
+    <Real>0.01038584637701591</Real>
+    <Real>0.013720199916616887</Real>
+    <Real>0.017959358953134743</Real>
+    <Real>0.023282949794115493</Real>
+    <Real>0.029892250579570376</Real>
+    <Real>0.038008163362592905</Real>
+    <Real>0.047868021041824728</Real>
+    <Real>0.059721061668809007</Real>
+    <Real>0.073822459118630945</Real>
+    <Real>0.090425868886316554</Real>
+    <Real>0.1097745310797878</Real>
+    <Real>0.13209106727404829</Real>
+    <Real>0.1575662097981721</Real>
+    <Real>0.18634680587273886</Real>
+    <Real>0.21852353831426113</Real>
+    <Real>0.25411889204827737</Real>
+    <Real>0.29307596393494545</Real>
+    <Real>0.33524875522378467</Real>
+    <Real>0.38039459504912959</Real>
+    <Real>0.42816931502090799</Real>
+    <Real>0.47812572651811547</Real>
+    <Real>0.52971584366150437</Real>
+    <Real>0.58229714886548378</Real>
+    <Real>0.63514301999540812</Real>
+    <Real>0.68745723689264115</Real>
+    <Real>0.73839227114940331</Real>
+    <Real>0.787070849041003</Real>
+    <Real>0.83261007691987088</Real>
+    <Real>0.87414724461158877</Real>
+    <Real>0.91086628789736601</Real>
+    <Real>0.94202380651173623</Real>
+    <Real>0.96697350686527894</Real>
+    <Real>0.98518797301346384</Real>
+    <Real>0.9962767653413287</Real>
+  </Sequence>
+  <Sequence Name="Z">
+    <Int Name="Length">29</Int>
+    <Real>1</Real>
+    <Real>0.96917791907747108</Real>
+    <Real>0.88216537026122621</Real>
+    <Real>0.75378227973535905</Real>
+    <Real>0.60417643346431482</Real>
+    <Real>0.45376874694186936</Real>
+    <Real>0.31888687751663913</Real>
+    <Real>0.20930533305661311</Real>
+    <Real>0.12802286870126137</Real>
+    <Real>0.072772488825568721</Real>
+    <Real>0.038317724135902481</Real>
+    <Real>0.018624855991253263</Real>
+    <Real>0.008362805329911337</Real>
+    <Real>0.0036266823497955996</Real>
+    <Real>0.0022103327659906773</Real>
+    <Real>0.0022103327659906773</Real>
+    <Real>0.0036266823497955996</Real>
+    <Real>0.008362805329911337</Real>
+    <Real>0.018624855991253263</Real>
+    <Real>0.038317724135902481</Real>
+    <Real>0.072772488825568721</Real>
+    <Real>0.12802286870126137</Real>
+    <Real>0.20930533305661311</Real>
+    <Real>0.31888687751663913</Real>
+    <Real>0.45376874694186936</Real>
+    <Real>0.60417643346431482</Real>
+    <Real>0.75378227973535905</Real>
+    <Real>0.88216537026122621</Real>
+    <Real>0.96917791907747108</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_3.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_3.xml
new file mode 100644 (file)
index 0000000..b9e478c
--- /dev/null
@@ -0,0 +1,173 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="X">
+    <Int Name="Length">64</Int>
+    <Real>1</Real>
+    <Real>0.99679213699886537</Real>
+    <Real>0.98722714126407807</Real>
+    <Real>0.9714793508556292</Real>
+    <Real>0.94983455505992243</Real>
+    <Real>0.92268294451100652</Real>
+    <Real>0.8905094656677498</Real>
+    <Real>0.85388180727504404</Real>
+    <Real>0.81343631504757941</Real>
+    <Real>0.76986220016018247</Real>
+    <Real>0.72388447541602163</Real>
+    <Real>0.67624611751597763</Real>
+    <Real>0.62769001121533641</Real>
+    <Real>0.57894127734366008</Real>
+    <Real>0.53069061757903879</Real>
+    <Real>0.48357932090399453</Real>
+    <Real>0.43818656757996727</Real>
+    <Real>0.39501963656238342</Real>
+    <Real>0.35450757605533195</Real>
+    <Real>0.31699884553256041</Real>
+    <Real>0.28276340257865784</Real>
+    <Real>0.25199972745538329</Real>
+    <Real>0.22484741790164994</Real>
+    <Real>0.20140635909365345</Real>
+    <Real>0.18176427632469225</Real>
+    <Real>0.16603606468681617</Real>
+    <Real>0.1544213105775194</Real>
+    <Real>0.147292091880976</Real>
+    <Real>0.14533378613132461</Real>
+    <Real>0.14978169836524</Real>
+    <Real>0.16283453532845385</Real>
+    <Real>0.18839912911864681</Real>
+    <Real>0.23346292694334683</Real>
+    <Real>0.18839912911864681</Real>
+    <Real>0.16283453532845385</Real>
+    <Real>0.14978169836524</Real>
+    <Real>0.14533378613132461</Real>
+    <Real>0.147292091880976</Real>
+    <Real>0.1544213105775194</Real>
+    <Real>0.16603606468681617</Real>
+    <Real>0.18176427632469225</Real>
+    <Real>0.20140635909365345</Real>
+    <Real>0.22484741790164994</Real>
+    <Real>0.25199972745538329</Real>
+    <Real>0.28276340257865784</Real>
+    <Real>0.31699884553256041</Real>
+    <Real>0.35450757605533195</Real>
+    <Real>0.39501963656238342</Real>
+    <Real>0.43818656757996727</Real>
+    <Real>0.48357932090399453</Real>
+    <Real>0.53069061757903879</Real>
+    <Real>0.57894127734366008</Real>
+    <Real>0.62769001121533641</Real>
+    <Real>0.67624611751597763</Real>
+    <Real>0.72388447541602163</Real>
+    <Real>0.76986220016018247</Real>
+    <Real>0.81343631504757941</Real>
+    <Real>0.85388180727504404</Real>
+    <Real>0.8905094656677498</Real>
+    <Real>0.92268294451100652</Real>
+    <Real>0.94983455505992243</Real>
+    <Real>0.9714793508556292</Real>
+    <Real>0.98722714126407807</Real>
+    <Real>0.99679213699886537</Real>
+  </Sequence>
+  <Sequence Name="Y">
+    <Int Name="Length">32</Int>
+    <Real>1</Real>
+    <Real>0.98722714126407807</Real>
+    <Real>0.94983455505992243</Real>
+    <Real>0.8905094656677498</Real>
+    <Real>0.81343631504757941</Real>
+    <Real>0.72388447541602163</Real>
+    <Real>0.62769001121533641</Real>
+    <Real>0.53069061757903879</Real>
+    <Real>0.43818656757996727</Real>
+    <Real>0.35450757605533195</Real>
+    <Real>0.28276340257865784</Real>
+    <Real>0.22484741790164994</Real>
+    <Real>0.18176427632469225</Real>
+    <Real>0.1544213105775194</Real>
+    <Real>0.14533378613132461</Real>
+    <Real>0.16283453532845385</Real>
+    <Real>0.23346292694334683</Real>
+    <Real>0.16283453532845385</Real>
+    <Real>0.14533378613132461</Real>
+    <Real>0.1544213105775194</Real>
+    <Real>0.18176427632469225</Real>
+    <Real>0.22484741790164994</Real>
+    <Real>0.28276340257865784</Real>
+    <Real>0.35450757605533195</Real>
+    <Real>0.43818656757996727</Real>
+    <Real>0.53069061757903879</Real>
+    <Real>0.62769001121533641</Real>
+    <Real>0.72388447541602163</Real>
+    <Real>0.81343631504757941</Real>
+    <Real>0.8905094656677498</Real>
+    <Real>0.94983455505992243</Real>
+    <Real>0.98722714126407807</Real>
+  </Sequence>
+  <Sequence Name="Z">
+    <Int Name="Length">64</Int>
+    <Real>1</Real>
+    <Real>0.99679213699886537</Real>
+    <Real>0.98722714126407807</Real>
+    <Real>0.9714793508556292</Real>
+    <Real>0.94983455505992243</Real>
+    <Real>0.92268294451100652</Real>
+    <Real>0.8905094656677498</Real>
+    <Real>0.85388180727504404</Real>
+    <Real>0.81343631504757941</Real>
+    <Real>0.76986220016018247</Real>
+    <Real>0.72388447541602163</Real>
+    <Real>0.67624611751597763</Real>
+    <Real>0.62769001121533641</Real>
+    <Real>0.57894127734366008</Real>
+    <Real>0.53069061757903879</Real>
+    <Real>0.48357932090399453</Real>
+    <Real>0.43818656757996727</Real>
+    <Real>0.39501963656238342</Real>
+    <Real>0.35450757605533195</Real>
+    <Real>0.31699884553256041</Real>
+    <Real>0.28276340257865784</Real>
+    <Real>0.25199972745538329</Real>
+    <Real>0.22484741790164994</Real>
+    <Real>0.20140635909365345</Real>
+    <Real>0.18176427632469225</Real>
+    <Real>0.16603606468681617</Real>
+    <Real>0.1544213105775194</Real>
+    <Real>0.147292091880976</Real>
+    <Real>0.14533378613132461</Real>
+    <Real>0.14978169836524</Real>
+    <Real>0.16283453532845385</Real>
+    <Real>0.18839912911864681</Real>
+    <Real>0.23346292694334683</Real>
+    <Real>0.18839912911864681</Real>
+    <Real>0.16283453532845385</Real>
+    <Real>0.14978169836524</Real>
+    <Real>0.14533378613132461</Real>
+    <Real>0.147292091880976</Real>
+    <Real>0.1544213105775194</Real>
+    <Real>0.16603606468681617</Real>
+    <Real>0.18176427632469225</Real>
+    <Real>0.20140635909365345</Real>
+    <Real>0.22484741790164994</Real>
+    <Real>0.25199972745538329</Real>
+    <Real>0.28276340257865784</Real>
+    <Real>0.31699884553256041</Real>
+    <Real>0.35450757605533195</Real>
+    <Real>0.39501963656238342</Real>
+    <Real>0.43818656757996727</Real>
+    <Real>0.48357932090399453</Real>
+    <Real>0.53069061757903879</Real>
+    <Real>0.57894127734366008</Real>
+    <Real>0.62769001121533641</Real>
+    <Real>0.67624611751597763</Real>
+    <Real>0.72388447541602163</Real>
+    <Real>0.76986220016018247</Real>
+    <Real>0.81343631504757941</Real>
+    <Real>0.85388180727504404</Real>
+    <Real>0.8905094656677498</Real>
+    <Real>0.92268294451100652</Real>
+    <Real>0.94983455505992243</Real>
+    <Real>0.9714793508556292</Real>
+    <Real>0.98722714126407807</Real>
+    <Real>0.99679213699886537</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_4.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_4.xml
new file mode 100644 (file)
index 0000000..d2af6e0
--- /dev/null
@@ -0,0 +1,173 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="X">
+    <Int Name="Length">64</Int>
+    <Real>0.99999999999999978</Real>
+    <Real>0.99599177923169246</Real>
+    <Real>0.9840594250875444</Real>
+    <Real>0.96447636376571355</Real>
+    <Real>0.93768682558188565</Real>
+    <Real>0.90428924676588729</Real>
+    <Real>0.86501423524055476</Real>
+    <Real>0.82069821242500096</Real>
+    <Real>0.77225403794614478</Real>
+    <Real>0.72064003918992392</Real>
+    <Real>0.6668288976714164</Real>
+    <Real>0.61177778997574395</Real>
+    <Real>0.55640104899164056</Real>
+    <Real>0.50154641292836599</Real>
+    <Real>0.44797568090291112</Real>
+    <Real>0.39635031326736697</Real>
+    <Real>0.34722222222222221</Real>
+    <Real>0.30102971333769502</Real>
+    <Real>0.25809827940786451</Real>
+    <Real>0.21864572963652307</Real>
+    <Real>0.18279097054930363</Real>
+    <Real>0.15056564664626138</Real>
+    <Real>0.12192780016169502</Real>
+    <Real>0.096776717168722937</Real>
+    <Real>0.074968184276077238</Real>
+    <Real>0.05632947566079672</Real>
+    <Real>0.04067351137077823</Real>
+    <Real>0.02781176105655182</Real>
+    <Real>0.017565599321614365</Real>
+    <Real>0.0097759381138420327</Real>
+    <Real>0.0043110590461244089</Real>
+    <Real>0.0010726386076899712</Real>
+    <Real>0.0010726386076899683</Real>
+    <Real>0.0010726386076899655</Real>
+    <Real>0.0043110590461243941</Real>
+    <Real>0.0097759381138420171</Real>
+    <Real>0.017565599321614323</Real>
+    <Real>0.027811761056551795</Real>
+    <Real>0.040673511370778202</Real>
+    <Real>0.056329475660796699</Real>
+    <Real>0.074968184276077002</Real>
+    <Real>0.096776717168722659</Real>
+    <Real>0.12192780016169497</Real>
+    <Real>0.15056564664626132</Real>
+    <Real>0.18279097054930318</Real>
+    <Real>0.21864572963652326</Real>
+    <Real>0.25809827940786451</Real>
+    <Real>0.30102971333769535</Real>
+    <Real>0.34722222222222199</Real>
+    <Real>0.39635031326736658</Real>
+    <Real>0.44797568090291079</Real>
+    <Real>0.50154641292836544</Real>
+    <Real>0.55640104899164067</Real>
+    <Real>0.61177778997574372</Real>
+    <Real>0.66682889767141607</Real>
+    <Real>0.72064003918992425</Real>
+    <Real>0.77225403794614522</Real>
+    <Real>0.82069821242500074</Real>
+    <Real>0.86501423524055443</Real>
+    <Real>0.90428924676588762</Real>
+    <Real>0.93768682558188543</Real>
+    <Real>0.96447636376571333</Real>
+    <Real>0.9840594250875444</Real>
+    <Real>0.99599177923169235</Real>
+  </Sequence>
+  <Sequence Name="Y">
+    <Int Name="Length">32</Int>
+    <Real>0.99999999999999978</Real>
+    <Real>0.9840594250875444</Real>
+    <Real>0.93768682558188565</Real>
+    <Real>0.86501423524055476</Real>
+    <Real>0.77225403794614478</Real>
+    <Real>0.6668288976714164</Real>
+    <Real>0.55640104899164056</Real>
+    <Real>0.44797568090291112</Real>
+    <Real>0.34722222222222221</Real>
+    <Real>0.25809827940786451</Real>
+    <Real>0.18279097054930363</Real>
+    <Real>0.12192780016169502</Real>
+    <Real>0.074968184276077238</Real>
+    <Real>0.04067351137077823</Real>
+    <Real>0.017565599321614365</Real>
+    <Real>0.0043110590461244089</Real>
+    <Real>0.0043110590461244019</Real>
+    <Real>0.0043110590461243941</Real>
+    <Real>0.017565599321614323</Real>
+    <Real>0.040673511370778202</Real>
+    <Real>0.074968184276077002</Real>
+    <Real>0.12192780016169497</Real>
+    <Real>0.18279097054930318</Real>
+    <Real>0.25809827940786451</Real>
+    <Real>0.34722222222222199</Real>
+    <Real>0.44797568090291079</Real>
+    <Real>0.55640104899164067</Real>
+    <Real>0.66682889767141607</Real>
+    <Real>0.77225403794614522</Real>
+    <Real>0.86501423524055443</Real>
+    <Real>0.93768682558188543</Real>
+    <Real>0.9840594250875444</Real>
+  </Sequence>
+  <Sequence Name="Z">
+    <Int Name="Length">64</Int>
+    <Real>0.99999999999999978</Real>
+    <Real>0.99599177923169246</Real>
+    <Real>0.9840594250875444</Real>
+    <Real>0.96447636376571355</Real>
+    <Real>0.93768682558188565</Real>
+    <Real>0.90428924676588729</Real>
+    <Real>0.86501423524055476</Real>
+    <Real>0.82069821242500096</Real>
+    <Real>0.77225403794614478</Real>
+    <Real>0.72064003918992392</Real>
+    <Real>0.6668288976714164</Real>
+    <Real>0.61177778997574395</Real>
+    <Real>0.55640104899164056</Real>
+    <Real>0.50154641292836599</Real>
+    <Real>0.44797568090291112</Real>
+    <Real>0.39635031326736697</Real>
+    <Real>0.34722222222222221</Real>
+    <Real>0.30102971333769502</Real>
+    <Real>0.25809827940786451</Real>
+    <Real>0.21864572963652307</Real>
+    <Real>0.18279097054930363</Real>
+    <Real>0.15056564664626138</Real>
+    <Real>0.12192780016169502</Real>
+    <Real>0.096776717168722937</Real>
+    <Real>0.074968184276077238</Real>
+    <Real>0.05632947566079672</Real>
+    <Real>0.04067351137077823</Real>
+    <Real>0.02781176105655182</Real>
+    <Real>0.017565599321614365</Real>
+    <Real>0.0097759381138420327</Real>
+    <Real>0.0043110590461244089</Real>
+    <Real>0.0010726386076899712</Real>
+    <Real>0.0010726386076899683</Real>
+    <Real>0.0010726386076899655</Real>
+    <Real>0.0043110590461243941</Real>
+    <Real>0.0097759381138420171</Real>
+    <Real>0.017565599321614323</Real>
+    <Real>0.027811761056551795</Real>
+    <Real>0.040673511370778202</Real>
+    <Real>0.056329475660796699</Real>
+    <Real>0.074968184276077002</Real>
+    <Real>0.096776717168722659</Real>
+    <Real>0.12192780016169497</Real>
+    <Real>0.15056564664626132</Real>
+    <Real>0.18279097054930318</Real>
+    <Real>0.21864572963652326</Real>
+    <Real>0.25809827940786451</Real>
+    <Real>0.30102971333769535</Real>
+    <Real>0.34722222222222199</Real>
+    <Real>0.39635031326736658</Real>
+    <Real>0.44797568090291079</Real>
+    <Real>0.50154641292836544</Real>
+    <Real>0.55640104899164067</Real>
+    <Real>0.61177778997574372</Real>
+    <Real>0.66682889767141607</Real>
+    <Real>0.72064003918992425</Real>
+    <Real>0.77225403794614522</Real>
+    <Real>0.82069821242500074</Real>
+    <Real>0.86501423524055443</Real>
+    <Real>0.90428924676588762</Real>
+    <Real>0.93768682558188543</Real>
+    <Real>0.96447636376571333</Real>
+    <Real>0.9840594250875444</Real>
+    <Real>0.99599177923169235</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_5.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_5.xml
new file mode 100644 (file)
index 0000000..22b73dd
--- /dev/null
@@ -0,0 +1,173 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="X">
+    <Int Name="Length">64</Int>
+    <Real>1</Real>
+    <Real>0.99599177952708939</Real>
+    <Real>0.98405944386122601</Real>
+    <Real>0.96447657513014773</Real>
+    <Real>0.93768799390763358</Real>
+    <Real>0.90429361071025816</Real>
+    <Real>0.86502693413175713</Real>
+    <Real>0.82072927057868161</Real>
+    <Real>0.77232083699097831</Real>
+    <Real>0.72077012325834022</Real>
+    <Real>0.66706288046749973</Real>
+    <Real>0.61217207500421655</Real>
+    <Real>0.55703004225461283</Real>
+    <Real>0.50250390701447112</Real>
+    <Real>0.44937512408934693</Real>
+    <Real>0.39832374774258422</Real>
+    <Real>0.34991777955278341</Real>
+    <Real>0.30460768763511636</Real>
+    <Real>0.26272595143111366</Real>
+    <Real>0.22449127839581315</Real>
+    <Real>0.19001697209284932</Real>
+    <Real>0.15932281325392275</Real>
+    <Real>0.13234975413966146</Real>
+    <Real>0.10897673699334089</Real>
+    <Real>0.08903906947532618</Real>
+    <Real>0.072348133312829188</Real>
+    <Real>0.058713055603409205</Real>
+    <Real>0.047967068542932936</Real>
+    <Real>0.040006441190879767</Real>
+    <Real>0.034862523812425897</Real>
+    <Real>0.032858315342583898</Real>
+    <Real>0.034975731876511651</Real>
+    <Real>0.043739722444097656</Real>
+    <Real>0.034975731876511651</Real>
+    <Real>0.032858315342583898</Real>
+    <Real>0.034862523812425897</Real>
+    <Real>0.040006441190879767</Real>
+    <Real>0.047967068542932936</Real>
+    <Real>0.058713055603409205</Real>
+    <Real>0.072348133312829188</Real>
+    <Real>0.08903906947532618</Real>
+    <Real>0.10897673699334089</Real>
+    <Real>0.13234975413966146</Real>
+    <Real>0.15932281325392275</Real>
+    <Real>0.19001697209284932</Real>
+    <Real>0.22449127839581315</Real>
+    <Real>0.26272595143111366</Real>
+    <Real>0.30460768763511636</Real>
+    <Real>0.34991777955278341</Real>
+    <Real>0.39832374774258422</Real>
+    <Real>0.44937512408934693</Real>
+    <Real>0.50250390701447112</Real>
+    <Real>0.55703004225461283</Real>
+    <Real>0.61217207500421655</Real>
+    <Real>0.66706288046749973</Real>
+    <Real>0.72077012325834022</Real>
+    <Real>0.77232083699097831</Real>
+    <Real>0.82072927057868161</Real>
+    <Real>0.86502693413175713</Real>
+    <Real>0.90429361071025816</Real>
+    <Real>0.93768799390763358</Real>
+    <Real>0.96447657513014773</Real>
+    <Real>0.98405944386122601</Real>
+    <Real>0.99599177952708939</Real>
+  </Sequence>
+  <Sequence Name="Y">
+    <Int Name="Length">32</Int>
+    <Real>1</Real>
+    <Real>0.98405944386122601</Real>
+    <Real>0.93768799390763358</Real>
+    <Real>0.86502693413175713</Real>
+    <Real>0.77232083699097831</Real>
+    <Real>0.66706288046749973</Real>
+    <Real>0.55703004225461283</Real>
+    <Real>0.44937512408934693</Real>
+    <Real>0.34991777955278341</Real>
+    <Real>0.26272595143111366</Real>
+    <Real>0.19001697209284932</Real>
+    <Real>0.13234975413966146</Real>
+    <Real>0.08903906947532618</Real>
+    <Real>0.058713055603409205</Real>
+    <Real>0.040006441190879767</Real>
+    <Real>0.032858315342583898</Real>
+    <Real>0.043739722444097656</Real>
+    <Real>0.032858315342583898</Real>
+    <Real>0.040006441190879767</Real>
+    <Real>0.058713055603409205</Real>
+    <Real>0.08903906947532618</Real>
+    <Real>0.13234975413966146</Real>
+    <Real>0.19001697209284932</Real>
+    <Real>0.26272595143111366</Real>
+    <Real>0.34991777955278341</Real>
+    <Real>0.44937512408934693</Real>
+    <Real>0.55703004225461283</Real>
+    <Real>0.66706288046749973</Real>
+    <Real>0.77232083699097831</Real>
+    <Real>0.86502693413175713</Real>
+    <Real>0.93768799390763358</Real>
+    <Real>0.98405944386122601</Real>
+  </Sequence>
+  <Sequence Name="Z">
+    <Int Name="Length">64</Int>
+    <Real>1</Real>
+    <Real>0.99599177952708939</Real>
+    <Real>0.98405944386122601</Real>
+    <Real>0.96447657513014773</Real>
+    <Real>0.93768799390763358</Real>
+    <Real>0.90429361071025816</Real>
+    <Real>0.86502693413175713</Real>
+    <Real>0.82072927057868161</Real>
+    <Real>0.77232083699097831</Real>
+    <Real>0.72077012325834022</Real>
+    <Real>0.66706288046749973</Real>
+    <Real>0.61217207500421655</Real>
+    <Real>0.55703004225461283</Real>
+    <Real>0.50250390701447112</Real>
+    <Real>0.44937512408934693</Real>
+    <Real>0.39832374774258422</Real>
+    <Real>0.34991777955278341</Real>
+    <Real>0.30460768763511636</Real>
+    <Real>0.26272595143111366</Real>
+    <Real>0.22449127839581315</Real>
+    <Real>0.19001697209284932</Real>
+    <Real>0.15932281325392275</Real>
+    <Real>0.13234975413966146</Real>
+    <Real>0.10897673699334089</Real>
+    <Real>0.08903906947532618</Real>
+    <Real>0.072348133312829188</Real>
+    <Real>0.058713055603409205</Real>
+    <Real>0.047967068542932936</Real>
+    <Real>0.040006441190879767</Real>
+    <Real>0.034862523812425897</Real>
+    <Real>0.032858315342583898</Real>
+    <Real>0.034975731876511651</Real>
+    <Real>0.043739722444097656</Real>
+    <Real>0.034975731876511651</Real>
+    <Real>0.032858315342583898</Real>
+    <Real>0.034862523812425897</Real>
+    <Real>0.040006441190879767</Real>
+    <Real>0.047967068542932936</Real>
+    <Real>0.058713055603409205</Real>
+    <Real>0.072348133312829188</Real>
+    <Real>0.08903906947532618</Real>
+    <Real>0.10897673699334089</Real>
+    <Real>0.13234975413966146</Real>
+    <Real>0.15932281325392275</Real>
+    <Real>0.19001697209284932</Real>
+    <Real>0.22449127839581315</Real>
+    <Real>0.26272595143111366</Real>
+    <Real>0.30460768763511636</Real>
+    <Real>0.34991777955278341</Real>
+    <Real>0.39832374774258422</Real>
+    <Real>0.44937512408934693</Real>
+    <Real>0.50250390701447112</Real>
+    <Real>0.55703004225461283</Real>
+    <Real>0.61217207500421655</Real>
+    <Real>0.66706288046749973</Real>
+    <Real>0.72077012325834022</Real>
+    <Real>0.77232083699097831</Real>
+    <Real>0.82072927057868161</Real>
+    <Real>0.86502693413175713</Real>
+    <Real>0.90429361071025816</Real>
+    <Real>0.93768799390763358</Real>
+    <Real>0.96447657513014773</Real>
+    <Real>0.98405944386122601</Real>
+    <Real>0.99599177952708939</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_6.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_6.xml
new file mode 100644 (file)
index 0000000..a7a4cfd
--- /dev/null
@@ -0,0 +1,173 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="X">
+    <Int Name="Length">64</Int>
+    <Real>1</Real>
+    <Real>0.99519206545587935</Real>
+    <Real>0.98090195914095746</Real>
+    <Real>0.95752482092227065</Real>
+    <Real>0.92569973735431099</Real>
+    <Real>0.88628175571309442</Real>
+    <Real>0.84030507487319939</Real>
+    <Real>0.78893956803574239</Real>
+    <Real>0.73344312125447653</Real>
+    <Real>0.67511242174423391</Real>
+    <Real>0.61523479682321514</Real>
+    <Real>0.55504349911147488</Real>
+    <Real>0.49567848103759116</Real>
+    <Real>0.43815423731549918</Real>
+    <Real>0.38333576031933869</Real>
+    <Real>0.33192309536911935</Real>
+    <Real>0.28444444444444456</Real>
+    <Real>0.24125728601051996</Real>
+    <Real>0.20255658537845778</Real>
+    <Real>0.16838888398780899</Real>
+    <Real>0.13867088585165055</Real>
+    <Real>0.11321110319069098</Real>
+    <Real>0.091733169806735446</Real>
+    <Real>0.073899561666448732</Real>
+    <Real>0.059334656523301256</Real>
+    <Real>0.047646293257735658</Real>
+    <Real>0.03844523250730239</Real>
+    <Real>0.031362151188981613</Real>
+    <Real>0.026062006867558715</Real>
+    <Real>0.022255770792402298</Real>
+    <Real>0.01970964337301654</Real>
+    <Real>0.018251930682543428</Real>
+    <Real>0.017777777777777778</Real>
+    <Real>0.018251930682543431</Real>
+    <Real>0.019709643373016533</Real>
+    <Real>0.022255770792402284</Real>
+    <Real>0.026062006867558708</Real>
+    <Real>0.031362151188981606</Real>
+    <Real>0.038445232507302342</Real>
+    <Real>0.047646293257735631</Real>
+    <Real>0.059334656523301228</Real>
+    <Real>0.073899561666448621</Real>
+    <Real>0.091733169806735404</Real>
+    <Real>0.11321110319069089</Real>
+    <Real>0.13867088585165038</Real>
+    <Real>0.16838888398780893</Real>
+    <Real>0.20255658537845753</Real>
+    <Real>0.24125728601052007</Real>
+    <Real>0.28444444444444444</Real>
+    <Real>0.33192309536911896</Real>
+    <Real>0.38333576031933875</Real>
+    <Real>0.43815423731549907</Real>
+    <Real>0.49567848103759121</Real>
+    <Real>0.55504349911147466</Real>
+    <Real>0.61523479682321447</Real>
+    <Real>0.67511242174423391</Real>
+    <Real>0.7334431212544763</Real>
+    <Real>0.78893956803574194</Real>
+    <Real>0.84030507487319928</Real>
+    <Real>0.88628175571309442</Real>
+    <Real>0.92569973735431066</Real>
+    <Real>0.9575248209222702</Real>
+    <Real>0.98090195914095757</Real>
+    <Real>0.99519206545587924</Real>
+  </Sequence>
+  <Sequence Name="Y">
+    <Int Name="Length">32</Int>
+    <Real>1</Real>
+    <Real>0.98090195914095746</Real>
+    <Real>0.92569973735431099</Real>
+    <Real>0.84030507487319939</Real>
+    <Real>0.73344312125447653</Real>
+    <Real>0.61523479682321514</Real>
+    <Real>0.49567848103759116</Real>
+    <Real>0.38333576031933869</Real>
+    <Real>0.28444444444444456</Real>
+    <Real>0.20255658537845778</Real>
+    <Real>0.13867088585165055</Real>
+    <Real>0.091733169806735446</Real>
+    <Real>0.059334656523301256</Real>
+    <Real>0.03844523250730239</Real>
+    <Real>0.026062006867558715</Real>
+    <Real>0.01970964337301654</Real>
+    <Real>0.017777777777777778</Real>
+    <Real>0.019709643373016533</Real>
+    <Real>0.026062006867558708</Real>
+    <Real>0.038445232507302342</Real>
+    <Real>0.059334656523301228</Real>
+    <Real>0.091733169806735404</Real>
+    <Real>0.13867088585165038</Real>
+    <Real>0.20255658537845753</Real>
+    <Real>0.28444444444444444</Real>
+    <Real>0.38333576031933875</Real>
+    <Real>0.49567848103759121</Real>
+    <Real>0.61523479682321447</Real>
+    <Real>0.7334431212544763</Real>
+    <Real>0.84030507487319928</Real>
+    <Real>0.92569973735431066</Real>
+    <Real>0.98090195914095757</Real>
+  </Sequence>
+  <Sequence Name="Z">
+    <Int Name="Length">64</Int>
+    <Real>1</Real>
+    <Real>0.99519206545587935</Real>
+    <Real>0.98090195914095746</Real>
+    <Real>0.95752482092227065</Real>
+    <Real>0.92569973735431099</Real>
+    <Real>0.88628175571309442</Real>
+    <Real>0.84030507487319939</Real>
+    <Real>0.78893956803574239</Real>
+    <Real>0.73344312125447653</Real>
+    <Real>0.67511242174423391</Real>
+    <Real>0.61523479682321514</Real>
+    <Real>0.55504349911147488</Real>
+    <Real>0.49567848103759116</Real>
+    <Real>0.43815423731549918</Real>
+    <Real>0.38333576031933869</Real>
+    <Real>0.33192309536911935</Real>
+    <Real>0.28444444444444456</Real>
+    <Real>0.24125728601051996</Real>
+    <Real>0.20255658537845778</Real>
+    <Real>0.16838888398780899</Real>
+    <Real>0.13867088585165055</Real>
+    <Real>0.11321110319069098</Real>
+    <Real>0.091733169806735446</Real>
+    <Real>0.073899561666448732</Real>
+    <Real>0.059334656523301256</Real>
+    <Real>0.047646293257735658</Real>
+    <Real>0.03844523250730239</Real>
+    <Real>0.031362151188981613</Real>
+    <Real>0.026062006867558715</Real>
+    <Real>0.022255770792402298</Real>
+    <Real>0.01970964337301654</Real>
+    <Real>0.018251930682543428</Real>
+    <Real>0.017777777777777778</Real>
+    <Real>0.018251930682543431</Real>
+    <Real>0.019709643373016533</Real>
+    <Real>0.022255770792402284</Real>
+    <Real>0.026062006867558708</Real>
+    <Real>0.031362151188981606</Real>
+    <Real>0.038445232507302342</Real>
+    <Real>0.047646293257735631</Real>
+    <Real>0.059334656523301228</Real>
+    <Real>0.073899561666448621</Real>
+    <Real>0.091733169806735404</Real>
+    <Real>0.11321110319069089</Real>
+    <Real>0.13867088585165038</Real>
+    <Real>0.16838888398780893</Real>
+    <Real>0.20255658537845753</Real>
+    <Real>0.24125728601052007</Real>
+    <Real>0.28444444444444444</Real>
+    <Real>0.33192309536911896</Real>
+    <Real>0.38333576031933875</Real>
+    <Real>0.43815423731549907</Real>
+    <Real>0.49567848103759121</Real>
+    <Real>0.55504349911147466</Real>
+    <Real>0.61523479682321447</Real>
+    <Real>0.67511242174423391</Real>
+    <Real>0.7334431212544763</Real>
+    <Real>0.78893956803574194</Real>
+    <Real>0.84030507487319928</Real>
+    <Real>0.88628175571309442</Real>
+    <Real>0.92569973735431066</Real>
+    <Real>0.9575248209222702</Real>
+    <Real>0.98090195914095757</Real>
+    <Real>0.99519206545587924</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_7.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_7.xml
new file mode 100644 (file)
index 0000000..d8ece33
--- /dev/null
@@ -0,0 +1,173 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="X">
+    <Int Name="Length">64</Int>
+    <Real>1</Real>
+    <Real>0.99519206539664795</Real>
+    <Real>0.98090195534776159</Real>
+    <Real>0.95752477767965549</Real>
+    <Real>0.92569949422153175</Real>
+    <Real>0.88628082812780185</Real>
+    <Real>0.84030230781068749</Real>
+    <Real>0.78893260887116534</Real>
+    <Real>0.7334276905744932</Real>
+    <Real>0.67508138110804994</Real>
+    <Real>0.61517704054824585</Real>
+    <Real>0.5549427315744101</Real>
+    <Real>0.4955119785320366</Real>
+    <Real>0.43789172953994737</Real>
+    <Real>0.38293859560014715</Real>
+    <Real>0.33134387031599155</Real>
+    <Real>0.28362727851290037</Real>
+    <Real>0.24013890206896338</Real>
+    <Real>0.20106831932581998</Real>
+    <Real>0.16645969346411715</Real>
+    <Real>0.13623136708511188</Real>
+    <Real>0.11019846583152162</Real>
+    <Real>0.088097074458449012</Real>
+    <Real>0.069608709285530979</Real>
+    <Real>0.05438405768510373</Real>
+    <Real>0.042065295084498688</Real>
+    <Real>0.032306804602271443</Real>
+    <Real>0.024795128706184621</Real>
+    <Real>0.019271489544086841</Real>
+    <Real>0.015567297482519917</Real>
+    <Real>0.013683799764266789</Real>
+    <Real>0.014007804808888453</Real>
+    <Real>0.017932325748914145</Real>
+    <Real>0.014007804808888453</Real>
+    <Real>0.013683799764266789</Real>
+    <Real>0.015567297482519917</Real>
+    <Real>0.019271489544086841</Real>
+    <Real>0.024795128706184621</Real>
+    <Real>0.032306804602271443</Real>
+    <Real>0.042065295084498688</Real>
+    <Real>0.05438405768510373</Real>
+    <Real>0.069608709285530979</Real>
+    <Real>0.088097074458449012</Real>
+    <Real>0.11019846583152162</Real>
+    <Real>0.13623136708511188</Real>
+    <Real>0.16645969346411715</Real>
+    <Real>0.20106831932581998</Real>
+    <Real>0.24013890206896338</Real>
+    <Real>0.28362727851290037</Real>
+    <Real>0.33134387031599155</Real>
+    <Real>0.38293859560014715</Real>
+    <Real>0.43789172953994737</Real>
+    <Real>0.4955119785320366</Real>
+    <Real>0.5549427315744101</Real>
+    <Real>0.61517704054824585</Real>
+    <Real>0.67508138110804994</Real>
+    <Real>0.7334276905744932</Real>
+    <Real>0.78893260887116534</Real>
+    <Real>0.84030230781068749</Real>
+    <Real>0.88628082812780185</Real>
+    <Real>0.92569949422153175</Real>
+    <Real>0.95752477767965549</Real>
+    <Real>0.98090195534776159</Real>
+    <Real>0.99519206539664795</Real>
+  </Sequence>
+  <Sequence Name="Y">
+    <Int Name="Length">32</Int>
+    <Real>1</Real>
+    <Real>0.98090195534776159</Real>
+    <Real>0.92569949422153175</Real>
+    <Real>0.84030230781068749</Real>
+    <Real>0.7334276905744932</Real>
+    <Real>0.61517704054824585</Real>
+    <Real>0.4955119785320366</Real>
+    <Real>0.38293859560014715</Real>
+    <Real>0.28362727851290037</Real>
+    <Real>0.20106831932581998</Real>
+    <Real>0.13623136708511188</Real>
+    <Real>0.088097074458449012</Real>
+    <Real>0.05438405768510373</Real>
+    <Real>0.032306804602271443</Real>
+    <Real>0.019271489544086841</Real>
+    <Real>0.013683799764266789</Real>
+    <Real>0.017932325748914145</Real>
+    <Real>0.013683799764266789</Real>
+    <Real>0.019271489544086841</Real>
+    <Real>0.032306804602271443</Real>
+    <Real>0.05438405768510373</Real>
+    <Real>0.088097074458449012</Real>
+    <Real>0.13623136708511188</Real>
+    <Real>0.20106831932581998</Real>
+    <Real>0.28362727851290037</Real>
+    <Real>0.38293859560014715</Real>
+    <Real>0.4955119785320366</Real>
+    <Real>0.61517704054824585</Real>
+    <Real>0.7334276905744932</Real>
+    <Real>0.84030230781068749</Real>
+    <Real>0.92569949422153175</Real>
+    <Real>0.98090195534776159</Real>
+  </Sequence>
+  <Sequence Name="Z">
+    <Int Name="Length">64</Int>
+    <Real>1</Real>
+    <Real>0.99519206539664795</Real>
+    <Real>0.98090195534776159</Real>
+    <Real>0.95752477767965549</Real>
+    <Real>0.92569949422153175</Real>
+    <Real>0.88628082812780185</Real>
+    <Real>0.84030230781068749</Real>
+    <Real>0.78893260887116534</Real>
+    <Real>0.7334276905744932</Real>
+    <Real>0.67508138110804994</Real>
+    <Real>0.61517704054824585</Real>
+    <Real>0.5549427315744101</Real>
+    <Real>0.4955119785320366</Real>
+    <Real>0.43789172953994737</Real>
+    <Real>0.38293859560014715</Real>
+    <Real>0.33134387031599155</Real>
+    <Real>0.28362727851290037</Real>
+    <Real>0.24013890206896338</Real>
+    <Real>0.20106831932581998</Real>
+    <Real>0.16645969346411715</Real>
+    <Real>0.13623136708511188</Real>
+    <Real>0.11019846583152162</Real>
+    <Real>0.088097074458449012</Real>
+    <Real>0.069608709285530979</Real>
+    <Real>0.05438405768510373</Real>
+    <Real>0.042065295084498688</Real>
+    <Real>0.032306804602271443</Real>
+    <Real>0.024795128706184621</Real>
+    <Real>0.019271489544086841</Real>
+    <Real>0.015567297482519917</Real>
+    <Real>0.013683799764266789</Real>
+    <Real>0.014007804808888453</Real>
+    <Real>0.017932325748914145</Real>
+    <Real>0.014007804808888453</Real>
+    <Real>0.013683799764266789</Real>
+    <Real>0.015567297482519917</Real>
+    <Real>0.019271489544086841</Real>
+    <Real>0.024795128706184621</Real>
+    <Real>0.032306804602271443</Real>
+    <Real>0.042065295084498688</Real>
+    <Real>0.05438405768510373</Real>
+    <Real>0.069608709285530979</Real>
+    <Real>0.088097074458449012</Real>
+    <Real>0.11019846583152162</Real>
+    <Real>0.13623136708511188</Real>
+    <Real>0.16645969346411715</Real>
+    <Real>0.20106831932581998</Real>
+    <Real>0.24013890206896338</Real>
+    <Real>0.28362727851290037</Real>
+    <Real>0.33134387031599155</Real>
+    <Real>0.38293859560014715</Real>
+    <Real>0.43789172953994737</Real>
+    <Real>0.4955119785320366</Real>
+    <Real>0.5549427315744101</Real>
+    <Real>0.61517704054824585</Real>
+    <Real>0.67508138110804994</Real>
+    <Real>0.7334276905744932</Real>
+    <Real>0.78893260887116534</Real>
+    <Real>0.84030230781068749</Real>
+    <Real>0.88628082812780185</Real>
+    <Real>0.92569949422153175</Real>
+    <Real>0.95752477767965549</Real>
+    <Real>0.98090195534776159</Real>
+    <Real>0.99519206539664795</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_8.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_8.xml
new file mode 100644 (file)
index 0000000..fc46dd1
--- /dev/null
@@ -0,0 +1,173 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="X">
+    <Int Name="Length">64</Int>
+    <Real>0.99999999999999956</Real>
+    <Real>0.99439299338254172</Real>
+    <Real>0.97775459804016207</Real>
+    <Real>0.95062308706588539</Real>
+    <Real>0.91386426325293835</Real>
+    <Real>0.86862680875708975</Real>
+    <Real>0.81628422030148851</Real>
+    <Real>0.75836730630936389</Real>
+    <Real>0.69649174294903782</Real>
+    <Real>0.6322853339762925</Real>
+    <Real>0.56731939718573354</Real>
+    <Real>0.50304814581753765</Real>
+    <Real>0.4407591133040894</Real>
+    <Real>0.38153667201800334</Real>
+    <Real>0.32623961953760694</Real>
+    <Real>0.27549274763416898</Real>
+    <Real>0.22969135802469134</Real>
+    <Real>0.18901691535672854</Real>
+    <Real>0.1534614791515895</Real>
+    <Real>0.12285825431769751</Real>
+    <Real>0.096915541336904859</Real>
+    <Real>0.075251527682212882</Real>
+    <Real>0.057427700224227017</Real>
+    <Real>0.042979122601058753</Real>
+    <Real>0.031440355816394101</Real>
+    <Real>0.022366350281397697</Real>
+    <Real>0.015348154926586595</Real>
+    <Real>0.010023735161529325</Real>
+    <Real>0.0060845388961903949</Real>
+    <Real>0.0032786827602900564</Real>
+    <Real>0.001411744212852303</Real>
+    <Real>0.00034614403869458372</Real>
+    <Real>0.0003461440386945796</Real>
+    <Real>0.00034614403869457548</Real>
+    <Real>0.0014117442128522993</Real>
+    <Real>0.0032786827602900586</Real>
+    <Real>0.0060845388961903845</Real>
+    <Real>0.010023735161529325</Real>
+    <Real>0.015348154926586557</Real>
+    <Real>0.022366350281397676</Real>
+    <Real>0.031440355816394171</Real>
+    <Real>0.042979122601058718</Real>
+    <Real>0.057427700224226982</Real>
+    <Real>0.075251527682212813</Real>
+    <Real>0.096915541336904776</Real>
+    <Real>0.12285825431769723</Real>
+    <Real>0.15346147915158917</Real>
+    <Real>0.18901691535672849</Real>
+    <Real>0.22969135802469109</Real>
+    <Real>0.27549274763416887</Real>
+    <Real>0.32623961953760716</Real>
+    <Real>0.38153667201800379</Real>
+    <Real>0.44075911330408957</Real>
+    <Real>0.50304814581753743</Real>
+    <Real>0.56731939718573332</Real>
+    <Real>0.63228533397629227</Real>
+    <Real>0.69649174294903737</Real>
+    <Real>0.75836730630936322</Real>
+    <Real>0.81628422030148906</Real>
+    <Real>0.86862680875708931</Real>
+    <Real>0.91386426325293857</Real>
+    <Real>0.95062308706588561</Real>
+    <Real>0.97775459804016185</Real>
+    <Real>0.99439299338254172</Real>
+  </Sequence>
+  <Sequence Name="Y">
+    <Int Name="Length">32</Int>
+    <Real>0.99999999999999956</Real>
+    <Real>0.97775459804016207</Real>
+    <Real>0.91386426325293835</Real>
+    <Real>0.81628422030148851</Real>
+    <Real>0.69649174294903782</Real>
+    <Real>0.56731939718573354</Real>
+    <Real>0.4407591133040894</Real>
+    <Real>0.32623961953760694</Real>
+    <Real>0.22969135802469134</Real>
+    <Real>0.1534614791515895</Real>
+    <Real>0.096915541336904859</Real>
+    <Real>0.057427700224227017</Real>
+    <Real>0.031440355816394101</Real>
+    <Real>0.015348154926586595</Real>
+    <Real>0.0060845388961903949</Real>
+    <Real>0.001411744212852303</Real>
+    <Real>0.0014117442128523013</Real>
+    <Real>0.0014117442128522993</Real>
+    <Real>0.0060845388961903845</Real>
+    <Real>0.015348154926586557</Real>
+    <Real>0.031440355816394171</Real>
+    <Real>0.057427700224226982</Real>
+    <Real>0.096915541336904776</Real>
+    <Real>0.15346147915158917</Real>
+    <Real>0.22969135802469109</Real>
+    <Real>0.32623961953760716</Real>
+    <Real>0.44075911330408957</Real>
+    <Real>0.56731939718573332</Real>
+    <Real>0.69649174294903737</Real>
+    <Real>0.81628422030148906</Real>
+    <Real>0.91386426325293857</Real>
+    <Real>0.97775459804016185</Real>
+  </Sequence>
+  <Sequence Name="Z">
+    <Int Name="Length">64</Int>
+    <Real>0.99999999999999956</Real>
+    <Real>0.99439299338254172</Real>
+    <Real>0.97775459804016207</Real>
+    <Real>0.95062308706588539</Real>
+    <Real>0.91386426325293835</Real>
+    <Real>0.86862680875708975</Real>
+    <Real>0.81628422030148851</Real>
+    <Real>0.75836730630936389</Real>
+    <Real>0.69649174294903782</Real>
+    <Real>0.6322853339762925</Real>
+    <Real>0.56731939718573354</Real>
+    <Real>0.50304814581753765</Real>
+    <Real>0.4407591133040894</Real>
+    <Real>0.38153667201800334</Real>
+    <Real>0.32623961953760694</Real>
+    <Real>0.27549274763416898</Real>
+    <Real>0.22969135802469134</Real>
+    <Real>0.18901691535672854</Real>
+    <Real>0.1534614791515895</Real>
+    <Real>0.12285825431769751</Real>
+    <Real>0.096915541336904859</Real>
+    <Real>0.075251527682212882</Real>
+    <Real>0.057427700224227017</Real>
+    <Real>0.042979122601058753</Real>
+    <Real>0.031440355816394101</Real>
+    <Real>0.022366350281397697</Real>
+    <Real>0.015348154926586595</Real>
+    <Real>0.010023735161529325</Real>
+    <Real>0.0060845388961903949</Real>
+    <Real>0.0032786827602900564</Real>
+    <Real>0.001411744212852303</Real>
+    <Real>0.00034614403869458372</Real>
+    <Real>0.0003461440386945796</Real>
+    <Real>0.00034614403869457548</Real>
+    <Real>0.0014117442128522993</Real>
+    <Real>0.0032786827602900586</Real>
+    <Real>0.0060845388961903845</Real>
+    <Real>0.010023735161529325</Real>
+    <Real>0.015348154926586557</Real>
+    <Real>0.022366350281397676</Real>
+    <Real>0.031440355816394171</Real>
+    <Real>0.042979122601058718</Real>
+    <Real>0.057427700224226982</Real>
+    <Real>0.075251527682212813</Real>
+    <Real>0.096915541336904776</Real>
+    <Real>0.12285825431769723</Real>
+    <Real>0.15346147915158917</Real>
+    <Real>0.18901691535672849</Real>
+    <Real>0.22969135802469109</Real>
+    <Real>0.27549274763416887</Real>
+    <Real>0.32623961953760716</Real>
+    <Real>0.38153667201800379</Real>
+    <Real>0.44075911330408957</Real>
+    <Real>0.50304814581753743</Real>
+    <Real>0.56731939718573332</Real>
+    <Real>0.63228533397629227</Real>
+    <Real>0.69649174294903737</Real>
+    <Real>0.75836730630936322</Real>
+    <Real>0.81628422030148906</Real>
+    <Real>0.86862680875708931</Real>
+    <Real>0.91386426325293857</Real>
+    <Real>0.95062308706588561</Real>
+    <Real>0.97775459804016185</Real>
+    <Real>0.99439299338254172</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_9.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeBSplineModuliCorrectnessTest_ReproducesValues_9.xml
new file mode 100644 (file)
index 0000000..528c997
--- /dev/null
@@ -0,0 +1,173 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="X">
+    <Int Name="Length">64</Int>
+    <Real>1</Real>
+    <Real>0.9943929933826412</Real>
+    <Real>0.97775459806545628</Real>
+    <Real>0.95062308770542614</Real>
+    <Real>0.91386426952058264</Real>
+    <Real>0.86862684520717015</Real>
+    <Real>0.81628437236115869</Real>
+    <Real>0.75836780976663731</Real>
+    <Real>0.69649314812801999</Real>
+    <Real>0.63228877105049019</Real>
+    <Real>0.56732696252619141</Real>
+    <Real>0.50306341536533861</Real>
+    <Real>0.44078776809104703</Real>
+    <Real>0.38158719500517224</Real>
+    <Real>0.32632399523249089</Real>
+    <Real>0.27562707102208034</Real>
+    <Real>0.22989624244423834</Real>
+    <Real>0.18931758530084425</Real>
+    <Real>0.15388744802462673</Real>
+    <Real>0.12344252180808435</Real>
+    <Real>0.097693301009772776</Real>
+    <Real>0.076258450968699501</Real>
+    <Real>0.058697954219134638</Real>
+    <Real>0.044543380510381522</Real>
+    <Real>0.033324165671369955</Real>
+    <Real>0.024589341948346485</Real>
+    <Real>0.017924720035043865</Real>
+    <Real>0.012966158129245784</Real>
+    <Real>0.0094106738097037273</Real>
+    <Real>0.0070303430050181626</Real>
+    <Real>0.0057049431829982985</Real>
+    <Real>0.0055285593395392749</Real>
+    <Real>0.007184257576382103</Real>
+    <Real>0.0055285593395392749</Real>
+    <Real>0.0057049431829982985</Real>
+    <Real>0.0070303430050181626</Real>
+    <Real>0.0094106738097037273</Real>
+    <Real>0.012966158129245784</Real>
+    <Real>0.017924720035043865</Real>
+    <Real>0.024589341948346485</Real>
+    <Real>0.033324165671369955</Real>
+    <Real>0.044543380510381522</Real>
+    <Real>0.058697954219134638</Real>
+    <Real>0.076258450968699501</Real>
+    <Real>0.097693301009772776</Real>
+    <Real>0.12344252180808435</Real>
+    <Real>0.15388744802462673</Real>
+    <Real>0.18931758530084425</Real>
+    <Real>0.22989624244423834</Real>
+    <Real>0.27562707102208034</Real>
+    <Real>0.32632399523249089</Real>
+    <Real>0.38158719500517224</Real>
+    <Real>0.44078776809104703</Real>
+    <Real>0.50306341536533861</Real>
+    <Real>0.56732696252619141</Real>
+    <Real>0.63228877105049019</Real>
+    <Real>0.69649314812801999</Real>
+    <Real>0.75836780976663731</Real>
+    <Real>0.81628437236115869</Real>
+    <Real>0.86862684520717015</Real>
+    <Real>0.91386426952058264</Real>
+    <Real>0.95062308770542614</Real>
+    <Real>0.97775459806545628</Real>
+    <Real>0.9943929933826412</Real>
+  </Sequence>
+  <Sequence Name="Y">
+    <Int Name="Length">32</Int>
+    <Real>1</Real>
+    <Real>0.97775459806545628</Real>
+    <Real>0.91386426952058264</Real>
+    <Real>0.81628437236115869</Real>
+    <Real>0.69649314812801999</Real>
+    <Real>0.56732696252619141</Real>
+    <Real>0.44078776809104703</Real>
+    <Real>0.32632399523249089</Real>
+    <Real>0.22989624244423834</Real>
+    <Real>0.15388744802462673</Real>
+    <Real>0.097693301009772776</Real>
+    <Real>0.058697954219134638</Real>
+    <Real>0.033324165671369955</Real>
+    <Real>0.017924720035043865</Real>
+    <Real>0.0094106738097037273</Real>
+    <Real>0.0057049431829982985</Real>
+    <Real>0.007184257576382103</Real>
+    <Real>0.0057049431829982985</Real>
+    <Real>0.0094106738097037273</Real>
+    <Real>0.017924720035043865</Real>
+    <Real>0.033324165671369955</Real>
+    <Real>0.058697954219134638</Real>
+    <Real>0.097693301009772776</Real>
+    <Real>0.15388744802462673</Real>
+    <Real>0.22989624244423834</Real>
+    <Real>0.32632399523249089</Real>
+    <Real>0.44078776809104703</Real>
+    <Real>0.56732696252619141</Real>
+    <Real>0.69649314812801999</Real>
+    <Real>0.81628437236115869</Real>
+    <Real>0.91386426952058264</Real>
+    <Real>0.97775459806545628</Real>
+  </Sequence>
+  <Sequence Name="Z">
+    <Int Name="Length">64</Int>
+    <Real>1</Real>
+    <Real>0.9943929933826412</Real>
+    <Real>0.97775459806545628</Real>
+    <Real>0.95062308770542614</Real>
+    <Real>0.91386426952058264</Real>
+    <Real>0.86862684520717015</Real>
+    <Real>0.81628437236115869</Real>
+    <Real>0.75836780976663731</Real>
+    <Real>0.69649314812801999</Real>
+    <Real>0.63228877105049019</Real>
+    <Real>0.56732696252619141</Real>
+    <Real>0.50306341536533861</Real>
+    <Real>0.44078776809104703</Real>
+    <Real>0.38158719500517224</Real>
+    <Real>0.32632399523249089</Real>
+    <Real>0.27562707102208034</Real>
+    <Real>0.22989624244423834</Real>
+    <Real>0.18931758530084425</Real>
+    <Real>0.15388744802462673</Real>
+    <Real>0.12344252180808435</Real>
+    <Real>0.097693301009772776</Real>
+    <Real>0.076258450968699501</Real>
+    <Real>0.058697954219134638</Real>
+    <Real>0.044543380510381522</Real>
+    <Real>0.033324165671369955</Real>
+    <Real>0.024589341948346485</Real>
+    <Real>0.017924720035043865</Real>
+    <Real>0.012966158129245784</Real>
+    <Real>0.0094106738097037273</Real>
+    <Real>0.0070303430050181626</Real>
+    <Real>0.0057049431829982985</Real>
+    <Real>0.0055285593395392749</Real>
+    <Real>0.007184257576382103</Real>
+    <Real>0.0055285593395392749</Real>
+    <Real>0.0057049431829982985</Real>
+    <Real>0.0070303430050181626</Real>
+    <Real>0.0094106738097037273</Real>
+    <Real>0.012966158129245784</Real>
+    <Real>0.017924720035043865</Real>
+    <Real>0.024589341948346485</Real>
+    <Real>0.033324165671369955</Real>
+    <Real>0.044543380510381522</Real>
+    <Real>0.058697954219134638</Real>
+    <Real>0.076258450968699501</Real>
+    <Real>0.097693301009772776</Real>
+    <Real>0.12344252180808435</Real>
+    <Real>0.15388744802462673</Real>
+    <Real>0.18931758530084425</Real>
+    <Real>0.22989624244423834</Real>
+    <Real>0.27562707102208034</Real>
+    <Real>0.32632399523249089</Real>
+    <Real>0.38158719500517224</Real>
+    <Real>0.44078776809104703</Real>
+    <Real>0.50306341536533861</Real>
+    <Real>0.56732696252619141</Real>
+    <Real>0.63228877105049019</Real>
+    <Real>0.69649314812801999</Real>
+    <Real>0.75836780976663731</Real>
+    <Real>0.81628437236115869</Real>
+    <Real>0.86862684520717015</Real>
+    <Real>0.91386426952058264</Real>
+    <Real>0.95062308770542614</Real>
+    <Real>0.97775459806545628</Real>
+    <Real>0.9943929933826412</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_0.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_0.xml
new file mode 100644 (file)
index 0000000..589a995
--- /dev/null
@@ -0,0 +1,81 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">3</Int>
+      <Real>0.33619974975590594</Real>
+      <Real>0.64760019531240687</Real>
+      <Real>0.016200054931687191</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">3</Int>
+      <Real>0.013564033407368874</Real>
+      <Real>0.63757793433500098</Real>
+      <Real>0.34885803225763012</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">3</Int>
+      <Real>0.061250029206279422</Real>
+      <Real>0.72750002503394384</Real>
+      <Real>0.21124994575977674</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">3</Int>
+      <Real>-0.81999969482421875</Real>
+      <Real>0.6399993896484375</Real>
+      <Real>0.18000030517578125</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">3</Int>
+      <Real>-0.16470600114973877</Real>
+      <Real>-0.67058799770052246</Real>
+      <Real>0.83529399885026123</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">3</Int>
+      <Real>-0.35000008344650269</Real>
+      <Real>-0.29999983310699463</Real>
+      <Real>0.64999991655349731</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Int Name="X">11</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">6</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 11 4 6">0.0013826037132043639</Real>
+    <Real Name="Cell 11 4 7">0.016421938879093271</Real>
+    <Real Name="Cell 11 4 8">0.0047685684922374521</Real>
+    <Real Name="Cell 11 5 6">0.064989342992169435</Real>
+    <Real Name="Cell 11 5 7">0.77191389565730451</Real>
+    <Real Name="Cell 11 5 8">0.22414675323374061</Real>
+    <Real Name="Cell 11 6 6">0.035559659600847962</Real>
+    <Real Name="Cell 11 6 7">0.42236148431359816</Real>
+    <Real Name="Cell 11 6 8">0.12264445028452525</Real>
+    <Real Name="Cell 12 4 6">0.0026632215977581233</Real>
+    <Real Name="Cell 12 4 7">0.03163253641095963</Real>
+    <Real Name="Cell 12 4 8">0.0091853902008423947</Real>
+    <Real Name="Cell 12 5 6">0.12518483801820438</Real>
+    <Real Name="Cell 12 5 7">1.4868886427041421</Real>
+    <Real Name="Cell 12 5 8">0.43175963479509505</Real>
+    <Real Name="Cell 12 6 6">0.068496310658979945</Real>
+    <Real Name="Cell 12 6 7">0.81356806461786901</Real>
+    <Real Name="Cell 12 6 8">0.23624220427262857</Real>
+    <Real Name="Cell 13 4 6">6.6621870239128315e-05</Real>
+    <Real Name="Cell 13 4 7">0.00079130431274643503</Real>
+    <Real Name="Cell 13 4 8">0.0002297773022610718</Real>
+    <Real Name="Cell 13 5 6">0.0031315636826374821</Real>
+    <Real Name="Cell 13 5 7">0.037195290958009747</Real>
+    <Real Name="Cell 13 5 8">0.010800691308611372</Real>
+    <Real Name="Cell 13 6 6">0.0017134707545263879</Real>
+    <Real Name="Cell 13 6 7">0.020351827304681189</Real>
+    <Real Name="Cell 13 6 8">0.0059097213282235219</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_1.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_1.xml
new file mode 100644 (file)
index 0000000..e740c7f
--- /dev/null
@@ -0,0 +1,81 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">3</Int>
+      <Real>0.2619067689657868</Real>
+      <Real>0.69993609967218617</Real>
+      <Real>0.03815713136202703</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">3</Int>
+      <Real>0.011250025244333649</Real>
+      <Real>0.62750011780679593</Real>
+      <Real>0.36124985694887041</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">3</Int>
+      <Real>0.30031255081296182</Real>
+      <Real>0.67437496393918561</Real>
+      <Real>0.025312485247852567</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">3</Int>
+      <Real>-0.72374963760375977</Real>
+      <Real>0.44749927520751953</Real>
+      <Real>0.27625036239624023</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">3</Int>
+      <Real>-0.15000016829546325</Real>
+      <Real>-0.69999966340907349</Real>
+      <Real>0.84999983170453675</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">3</Int>
+      <Real>-0.77500006556510925</Real>
+      <Real>0.55000013113021851</Real>
+      <Real>0.22499993443489075</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Int Name="X">13</Int>
+      <Int Name="Y">6</Int>
+      <Int Name="Z">5</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 13 6 5">0.004380048151535948</Real>
+    <Real Name="Cell 13 6 6">0.0098357354904011641</Real>
+    <Real Name="Cell 13 6 7">0.00036918172057913309</Real>
+    <Real Name="Cell 13 7 5">0.24430885010436626</Real>
+    <Real Name="Cell 13 7 6">0.54861434040353418</Real>
+    <Real Name="Cell 13 7 7">0.02059209362860796</Real>
+    <Real Name="Cell 13 8 5">0.14064784156537652</Real>
+    <Real Name="Cell 13 8 6">0.31583556140764957</Real>
+    <Real Name="Cell 13 8 7">0.011854803953842074</Real>
+    <Real Name="Cell 14 6 5">0.011705515789715702</Real>
+    <Real Name="Cell 14 6 6">0.026285637304234787</Real>
+    <Real Name="Cell 14 6 7">0.00098662441827221674</Real>
+    <Real Name="Cell 14 7 5">0.6529063159867583</Real>
+    <Real Name="Cell 14 7 6">1.4661514216016331</Real>
+    <Real Name="Cell 14 7 7">0.055031604396506215</Real>
+    <Real Name="Cell 14 8 5">0.37587612584935198</Real>
+    <Real Name="Cell 14 8 6">0.8440587918455954</Real>
+    <Real Name="Cell 14 8 7">0.031681522683037484</Real>
+    <Real Name="Cell 15 6 5">0.00063812811463453717</Real>
+    <Real Name="Cell 15 6 6">0.0014329658321981548</Real>
+    <Real Name="Cell 15 6 7">5.3785992107891378e-05</Real>
+    <Real Name="Cell 15 7 5">0.035593294984887676</Real>
+    <Real Name="Cell 15 7 6">0.079927485404564111</Real>
+    <Real Name="Cell 15 7 7">0.0030000569466327744</Real>
+    <Real Name="Cell 15 8 5">0.02049094869746073</Real>
+    <Real Name="Cell 15 8 6">0.046014003582341645</Real>
+    <Real Name="Cell 15 8 7">0.0017271234093110433</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_10.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_10.xml
new file mode 100644 (file)
index 0000000..074eab1
--- /dev/null
@@ -0,0 +1,191 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">5</Int>
+      <Real>0.021324316667810716</Real>
+      <Real>0.37703209201365662</Real>
+      <Real>0.52779403433509819</Real>
+      <Real>0.073826004296754302</Real>
+      <Real>2.3552686680204097e-05</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">5</Int>
+      <Real>0.0016495581997036655</Real>
+      <Real>0.17394692978238177</Real>
+      <Real>0.59714209698097642</Real>
+      <Real>0.22333826404637869</Real>
+      <Real>0.0039231509905593431</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">5</Int>
+      <Real>0.028552316185848529</Real>
+      <Real>0.41157446110166374</Real>
+      <Real>0.50103294517195562</Real>
+      <Real>0.058837523817601385</Real>
+      <Real>2.7537229307044074e-06</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">5</Int>
+      <Real>-0.10084712538648778</Real>
+      <Real>-0.54387723433073287</Real>
+      <Real>0.39090683963196193</Real>
+      <Real>0.25320652527422582</Real>
+      <Real>0.00061099481103286458</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">5</Int>
+      <Real>-0.014792204869455098</Real>
+      <Real>-0.4300140093047109</Real>
+      <Real>-0.067266223023428329</Real>
+      <Real>0.48374329343880984</Real>
+      <Real>0.028329143758784502</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">5</Int>
+      <Real>-0.12552730045233818</Real>
+      <Real>-0.53337632601106966</Real>
+      <Real>0.44345671853734003</Real>
+      <Real>0.21532474276788161</Real>
+      <Real>0.00012216515818619025</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Int Name="X">12</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 3 1">5.4910402122506737e-09</Real>
+    <Real Name="Cell 0 3 2">7.9151964468814374e-08</Real>
+    <Real Name="Cell 0 3 3">9.6356177610738879e-08</Real>
+    <Real Name="Cell 0 3 4">1.1315341535473563e-08</Real>
+    <Real Name="Cell 0 3 5">5.2958237249379593e-13</Real>
+    <Real Name="Cell 0 4 1">5.790335778417459e-07</Real>
+    <Real Name="Cell 0 4 2">8.3466234826196632e-06</Real>
+    <Real Name="Cell 0 4 3">1.016081837183126e-05</Real>
+    <Real Name="Cell 0 4 4">1.1932097454265494e-06</Real>
+    <Real Name="Cell 0 4 5">5.5844787882424654e-11</Real>
+    <Real Name="Cell 0 5 1">1.9877633099209692e-06</Real>
+    <Real Name="Cell 0 5 2">2.8653108481751327e-05</Real>
+    <Real Name="Cell 0 5 3">3.4881054797511526e-05</Real>
+    <Real Name="Cell 0 5 4">4.096167551870835e-06</Real>
+    <Real Name="Cell 0 5 5">1.9170947014292434e-10</Real>
+    <Real Name="Cell 0 6 1">7.4344717817972915e-07</Real>
+    <Real Name="Cell 0 6 2">1.0716604205599626e-05</Real>
+    <Real Name="Cell 0 6 3">1.3045930384022172e-05</Real>
+    <Real Name="Cell 0 6 4">1.5320155033502546e-06</Real>
+    <Real Name="Cell 0 6 5">7.1701627601605536e-11</Real>
+    <Real Name="Cell 0 7 1">1.3059363320289248e-08</Real>
+    <Real Name="Cell 0 7 2">1.8824743974861345e-07</Real>
+    <Real Name="Cell 0 7 3">2.2916428999473404e-07</Real>
+    <Real Name="Cell 0 7 4">2.6911322899298214e-08</Real>
+    <Real Name="Cell 0 7 5">1.2595079152739433e-12</Real>
+    <Real Name="Cell 12 3 1">4.9715211649349404e-06</Real>
+    <Real Name="Cell 12 3 2">7.1663227984556779e-05</Real>
+    <Real Name="Cell 12 3 3">8.7239713760477178e-05</Real>
+    <Real Name="Cell 12 3 4">1.0244772895046167e-05</Real>
+    <Real Name="Cell 12 3 5">4.7947745266105399e-10</Real>
+    <Real Name="Cell 12 4 1">0.00052424997380748155</Real>
+    <Real Name="Cell 12 4 2">0.0075569316005024223</Real>
+    <Real Name="Cell 12 4 3">0.0091994816348128436</Real>
+    <Real Name="Cell 12 4 4">0.0010803176218524323</Real>
+    <Real Name="Cell 12 4 5">5.0561193175997469e-08</Real>
+    <Real Name="Cell 12 5 1">0.0017996967758687563</Real>
+    <Real Name="Cell 12 5 2">0.025942176664522407</Real>
+    <Real Name="Cell 12 5 3">0.031580883671949243</Real>
+    <Real Name="Cell 12 5 4">0.0037086203874108401</Real>
+    <Real Name="Cell 12 5 5">1.7357142754257098e-07</Real>
+    <Real Name="Cell 12 6 1">0.00067310805211108352</Real>
+    <Real Name="Cell 12 6 2">0.0097026833832877281</Real>
+    <Real Name="Cell 12 6 3">0.011811627034843718</Real>
+    <Real Name="Cell 12 6 4">0.0013870682430847487</Real>
+    <Real Name="Cell 12 6 5">6.4917783407664483e-08</Real>
+    <Real Name="Cell 12 7 1">1.1823789052308096e-05</Real>
+    <Real Name="Cell 12 7 2">0.00017043694724126757</Real>
+    <Real Name="Cell 12 7 3">0.00020748256685760699</Real>
+    <Real Name="Cell 12 7 4">2.4365185137739379e-05</Real>
+    <Real Name="Cell 12 7 5">1.1403431801897063e-09</Real>
+    <Real Name="Cell 13 3 1">8.7900731099864658e-05</Real>
+    <Real Name="Cell 13 3 2">0.0012670669446704962</Real>
+    <Real Name="Cell 13 3 3">0.001542472488013479</Real>
+    <Real Name="Cell 13 3 4">0.0001811363157373624</Real>
+    <Real Name="Cell 13 3 5">8.4775699904636615e-09</Real>
+    <Real Name="Cell 13 4 1">0.0092691863210373308</Real>
+    <Real Name="Cell 13 4 2">0.13361299097768722</Real>
+    <Real Name="Cell 13 4 3">0.1626546754227505</Real>
+    <Real Name="Cell 13 4 4">0.019100936238725361</Real>
+    <Real Name="Cell 13 4 5">8.9396498536476137e-07</Real>
+    <Real Name="Cell 13 5 1">0.031820172761751316</Real>
+    <Real Name="Cell 13 5 2">0.45867979225694588</Real>
+    <Real Name="Cell 13 5 3">0.55837693765112328</Real>
+    <Real Name="Cell 13 5 4">0.06557156906512783</Real>
+    <Real Name="Cell 13 5 5">3.0688907625798746e-06</Real>
+    <Real Name="Cell 13 6 1">0.011901124007493654</Real>
+    <Real Name="Cell 13 6 2">0.1715517111818754</Real>
+    <Real Name="Cell 13 6 3">0.20883963225675545</Real>
+    <Real Name="Cell 13 6 4">0.024524548645696</Real>
+    <Real Name="Cell 13 6 5">1.1478017358477941e-06</Real>
+    <Real Name="Cell 13 7 1">0.00020905466709042131</Real>
+    <Real Name="Cell 13 7 2">0.0030134704795393413</Real>
+    <Real Name="Cell 13 7 3">0.0036684686059259434</Real>
+    <Real Name="Cell 13 7 4">0.00043079723809621464</Real>
+    <Real Name="Cell 13 7 5">2.0162239266003734e-08</Real>
+    <Real Name="Cell 14 3 1">0.00012304915807146138</Real>
+    <Real Name="Cell 14 3 2">0.0017737226847948657</Real>
+    <Real Name="Cell 14 3 3">0.002159253269268236</Real>
+    <Real Name="Cell 14 3 4">0.00025356639095898442</Real>
+    <Real Name="Cell 14 3 5">1.1867453623716749e-08</Real>
+    <Real Name="Cell 14 4 1">0.012975609628494957</Real>
+    <Real Name="Cell 14 4 2">0.18704015133316099</Real>
+    <Real Name="Cell 14 4 3">0.22769458930230768</Real>
+    <Real Name="Cell 14 4 4">0.026738732353449569</Real>
+    <Real Name="Cell 14 4 5">1.2514303057334815e-06</Real>
+    <Real Name="Cell 14 5 1">0.044543946552316853</Real>
+    <Real Name="Cell 14 5 2">0.64208979328610949</Real>
+    <Real Name="Cell 14 5 3">0.78165233900537368</Real>
+    <Real Name="Cell 14 5 4">0.091791345372565211</Real>
+    <Real Name="Cell 14 5 5">4.2960328068229237e-06</Real>
+    <Real Name="Cell 14 6 1">0.016659967111791241</Real>
+    <Real Name="Cell 14 6 2">0.24014923837966554</Real>
+    <Real Name="Cell 14 6 3">0.29234729449465219</Real>
+    <Real Name="Cell 14 6 4">0.034331057605277847</Real>
+    <Real Name="Cell 14 6 5">1.6067674917125967e-06</Real>
+    <Real Name="Cell 14 7 1">0.00029264831423484708</Real>
+    <Real Name="Cell 14 7 2">0.0042184518915917169</Real>
+    <Real Name="Cell 14 7 3">0.00513536085220877</Real>
+    <Real Name="Cell 14 7 4">0.00060305798124734504</Real>
+    <Real Name="Cell 14 7 5">2.8224413329378312e-08</Real>
+    <Real Name="Cell 15 3 1">1.721169070040701e-05</Real>
+    <Real Name="Cell 15 3 2">0.00024810219523204715</Real>
+    <Real Name="Cell 15 3 3">0.00030202888013995292</Real>
+    <Real Name="Cell 15 3 4">3.5467989879865154e-05</Real>
+    <Real Name="Cell 15 3 5">1.6599783726615397e-09</Real>
+    <Real Name="Cell 15 4 1">0.0018149834023665329</Real>
+    <Real Name="Cell 15 4 2">0.026162529543144672</Real>
+    <Real Name="Cell 15 4 3">0.031849131734420645</Real>
+    <Real Name="Cell 15 4 4">0.0037401214132750569</Real>
+    <Real Name="Cell 15 4 5">1.7504574344906493e-07</Real>
+    <Real Name="Cell 15 5 1">0.0062306532011270465</Real>
+    <Real Name="Cell 15 5 2">0.08981329979934205</Real>
+    <Real Name="Cell 15 5 3">0.10933482605705404</Real>
+    <Real Name="Cell 15 5 4">0.012839455956369107</Real>
+    <Real Name="Cell 15 5 5">6.0091421240684457e-07</Real>
+    <Real Name="Cell 15 6 1">0.0023303385858241682</Real>
+    <Real Name="Cell 15 6 2">0.033591244976488487</Real>
+    <Real Name="Cell 15 6 3">0.040892528553673785</Real>
+    <Real Name="Cell 15 6 4">0.0048021096135963202</Real>
+    <Real Name="Cell 15 6 5">2.2474908019090314e-07</Real>
+    <Real Name="Cell 15 7 1">4.0934634153940817e-05</Real>
+    <Real Name="Cell 15 7 2">0.00059006246227590465</Real>
+    <Real Name="Cell 15 7 3">0.00071831651681731961</Real>
+    <Real Name="Cell 15 7 4">8.4353664911816168e-05</Real>
+    <Real Name="Cell 15 7 5">3.9479333303815013e-09</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_11.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_11.xml
new file mode 100644 (file)
index 0000000..69d2a96
--- /dev/null
@@ -0,0 +1,191 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">5</Int>
+      <Real>0.0043033234951522009</Real>
+      <Real>0.22964313623763247</Real>
+      <Real>0.59616637285212148</Real>
+      <Real>0.16842109522125989</Real>
+      <Real>0.0014660721938338738</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">5</Int>
+      <Real>0.036170521700431418</Real>
+      <Real>0.44067912152529032</Real>
+      <Real>0.47538401613235459</Real>
+      <Real>0.047766279909607884</Real>
+      <Real>6.0732315723613201e-08</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">5</Int>
+      <Real>1.7640122565251958e-05</Real>
+      <Real>0.071139063318108806</Real>
+      <Real>0.5235408156117729</Real>
+      <Real>0.38287323863964373</Real>
+      <Real>0.022429242307909311</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">5</Int>
+      <Real>-0.030364083489944928</Real>
+      <Real>-0.48934445009998118</Real>
+      <Real>0.083321307620603857</Real>
+      <Real>0.42284706901851549</Real>
+      <Real>0.013540156950806738</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">5</Int>
+      <Real>-0.14989020738891354</Real>
+      <Real>-0.5155901329125363</Real>
+      <Real>0.48085787951917658</Real>
+      <Real>0.18461546925491013</Real>
+      <Real>6.9915273631839181e-06</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">5</Int>
+      <Real>-0.00049190742688337704</Real>
+      <Real>-0.24670823977340217</Real>
+      <Real>-0.40036645642627017</Real>
+      <Real>0.54282526188028035</Real>
+      <Real>0.10474134174627532</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Int Name="X">14</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 14 5 0">1.3591442370183604e-08</Real>
+    <Real Name="Cell 14 5 1">5.4811551097808827e-05</Real>
+    <Real Name="Cell 14 5 2">0.00040338012377776793</Real>
+    <Real Name="Cell 14 5 3">0.00029499792525857345</Real>
+    <Real Name="Cell 14 5 4">1.7281385268565402e-05</Real>
+    <Real Name="Cell 14 6 0">1.6558967364528452e-07</Real>
+    <Real Name="Cell 14 6 1">0.00066778982032025423</Real>
+    <Real Name="Cell 14 6 2">0.0049145323382225204</Real>
+    <Real Name="Cell 14 6 3">0.0035940710955568228</Real>
+    <Real Name="Cell 14 6 4">0.00021054564105998669</Real>
+    <Real Name="Cell 14 7 0">1.7863039168971306e-07</Real>
+    <Real Name="Cell 14 7 1">0.00072038041107406374</Real>
+    <Real Name="Cell 14 7 2">0.0053015675266623102</Real>
+    <Real Name="Cell 14 7 3">0.0038771157248323612</Real>
+    <Real Name="Cell 14 7 4">0.00022712678576607709</Real>
+    <Real Name="Cell 14 8 0">1.7948666762573985e-08</Real>
+    <Real Name="Cell 14 8 1">7.2383359955421496e-05</Real>
+    <Real Name="Cell 14 8 2">0.00053269809216247282</Real>
+    <Real Name="Cell 14 8 3">0.00038957009211416867</Real>
+    <Real Name="Cell 14 8 4">2.2821553219516418e-05</Real>
+    <Real Name="Cell 14 9 0">2.2820786938094924e-14</Real>
+    <Real Name="Cell 14 9 1">9.203163985697721e-11</Real>
+    <Real Name="Cell 14 9 2">6.7729764134448123e-10</Real>
+    <Real Name="Cell 14 9 3">4.9531790785314671e-10</Real>
+    <Real Name="Cell 14 9 4">2.9016406093456866e-11</Real>
+    <Real Name="Cell 15 5 0">7.2529556641467702e-07</Real>
+    <Real Name="Cell 15 5 1">0.0029249710160832052</Real>
+    <Real Name="Cell 15 5 2">0.021526031409120152</Real>
+    <Real Name="Cell 15 5 3">0.015742309128349063</Real>
+    <Real Name="Cell 15 5 4">0.00092220617763801591</Real>
+    <Real Name="Cell 15 6 0">8.836549710312734e-06</Real>
+    <Real Name="Cell 15 6 1">0.035636026168765732</Real>
+    <Real Name="Cell 15 6 2">0.26225976749413965</Real>
+    <Real Name="Cell 15 6 3">0.19179449538815141</Real>
+    <Real Name="Cell 15 6 4">0.011235586027554296</Real>
+    <Real Name="Cell 15 7 0">9.5324563494224515e-06</Real>
+    <Real Name="Cell 15 7 1">0.038442477557070545</Real>
+    <Real Name="Cell 15 7 2">0.28291356556620223</Real>
+    <Real Name="Cell 15 7 3">0.2068989272151511</Real>
+    <Real Name="Cell 15 7 4">0.012120424473236134</Real>
+    <Real Name="Cell 15 8 0">9.5781507741282704e-07</Real>
+    <Real Name="Cell 15 8 1">0.003862675397354143</Real>
+    <Real Name="Cell 15 8 2">0.028426972940751926</Real>
+    <Real Name="Cell 15 8 3">0.020789071014127174</Real>
+    <Real Name="Cell 15 8 4">0.0012178524484733003</Real>
+    <Real Name="Cell 15 9 0">1.2178115565280235e-12</Real>
+    <Real Name="Cell 15 9 1">4.9111888598793464e-09</Real>
+    <Real Name="Cell 15 9 2">3.6143402814107232e-08</Real>
+    <Real Name="Cell 15 9 3">2.6432211736393347e-08</Real>
+    <Real Name="Cell 15 9 4">1.5484354139661328e-09</Real>
+    <Real Name="Cell 16 5 0">1.8829076895541218e-06</Real>
+    <Real Name="Cell 16 5 1">0.0075933876793577385</Real>
+    <Real Name="Cell 16 5 2">0.055882776543325213</Real>
+    <Real Name="Cell 16 5 3">0.040867911347688447</Real>
+    <Real Name="Cell 16 5 4">0.0023940986042594353</Real>
+    <Real Name="Cell 16 6 0">2.2940175245966322e-05</Real>
+    <Real Name="Cell 16 6 1">0.092513108869547195</Real>
+    <Real Name="Cell 16 6 2">0.68084096434840546</Real>
+    <Real Name="Cell 16 6 3">0.49790919302825487</Real>
+    <Real Name="Cell 16 6 4">0.029168207152438941</Real>
+    <Real Name="Cell 16 7 0">2.4746787643266283e-05</Real>
+    <Real Name="Cell 16 7 1">0.099798812993619784</Real>
+    <Real Name="Cell 16 7 2">0.73445937456511778</Real>
+    <Real Name="Cell 16 7 3">0.53712113937171768</Real>
+    <Real Name="Cell 16 7 4">0.031465297043148266</Real>
+    <Real Name="Cell 16 8 0">2.4865412914993295e-06</Real>
+    <Real Name="Cell 16 8 1">0.010027720483501996</Real>
+    <Real Name="Cell 16 8 2">0.073798005143583645</Real>
+    <Real Name="Cell 16 8 3">0.053969586309047995</Real>
+    <Real Name="Cell 16 8 4">0.0031616127909179083</Real>
+    <Real Name="Cell 16 9 0">3.161506633150278e-12</Real>
+    <Real Name="Cell 16 9 1">1.2749719834675436e-08</Real>
+    <Real Name="Cell 16 9 2">9.3830286901857782e-08</Real>
+    <Real Name="Cell 16 9 3">6.8619493948378575e-08</Real>
+    <Real Name="Cell 16 9 4">4.01982458288987e-09</Real>
+    <Real Name="Cell 17 5 0">5.3193435543520483e-07</Real>
+    <Real Name="Cell 17 5 1">0.0021451841761532531</Real>
+    <Real Name="Cell 17 5 2">0.015787268215757554</Real>
+    <Real Name="Cell 17 5 3">0.011545465665320862</Real>
+    <Real Name="Cell 17 5 4">0.00067634930005869569</Real>
+    <Real Name="Cell 17 6 0">6.4807570762661043e-06</Real>
+    <Real Name="Cell 17 6 1">0.026135588700836845</Real>
+    <Real Name="Cell 17 6 2">0.19234224892369181</Real>
+    <Real Name="Cell 17 6 3">0.14066276702150288</Real>
+    <Real Name="Cell 17 6 4">0.0082402188683542276</Real>
+    <Real Name="Cell 17 7 0">6.991137487589706e-06</Real>
+    <Real Name="Cell 17 7 1">0.028193850159234684</Real>
+    <Real Name="Cell 17 7 2">0.20748981809891848</Real>
+    <Real Name="Cell 17 7 3">0.15174041119879605</Real>
+    <Real Name="Cell 17 7 4">0.0088891625405108487</Real>
+    <Real Name="Cell 17 8 0">7.0246499416545011e-07</Real>
+    <Real Name="Cell 17 8 1">0.0028328999140362333</Real>
+    <Real Name="Cell 17 8 2">0.020848443349738489</Real>
+    <Real Name="Cell 17 8 3">0.015246778833436227</Real>
+    <Real Name="Cell 17 8 4">0.00089317732961771733</Real>
+    <Real Name="Cell 17 9 0">8.931473393191955e-13</Real>
+    <Real Name="Cell 17 9 1">3.6018834273514096e-09</Real>
+    <Real Name="Cell 17 9 2">2.6507700542271014e-08</Real>
+    <Real Name="Cell 17 9 3">1.9385478367430883e-08</Real>
+    <Real Name="Cell 17 9 4">1.1356280556528323e-09</Real>
+    <Real Name="Cell 18 5 0">4.6303829483116718e-09</Real>
+    <Real Name="Cell 18 5 1">1.8673402326347753e-05</Real>
+    <Real Name="Cell 18 5 2">0.00013742503525055938</Real>
+    <Real Name="Cell 18 5 3">0.00010050098626038372</Real>
+    <Real Name="Cell 18 5 4">5.8874863676215402e-06</Real>
+    <Real Name="Cell 18 6 0">5.6413703592318757e-08</Real>
+    <Real Name="Cell 18 6 1">0.00022750511041053328</Real>
+    <Real Name="Cell 18 6 2">0.0016743010872601334</Real>
+    <Real Name="Cell 18 6 3">0.0012244414582807338</Real>
+    <Real Name="Cell 18 6 4">7.1729469150693423e-05</Real>
+    <Real Name="Cell 18 7 0">6.0856463736682049e-08</Real>
+    <Real Name="Cell 18 7 1">0.0002454218677373561</Real>
+    <Real Name="Cell 18 7 2">0.0018061576693753387</Real>
+    <Real Name="Cell 18 7 3">0.0013208701513739559</Real>
+    <Real Name="Cell 18 7 4">7.7378394968824387e-05</Real>
+    <Real Name="Cell 18 8 0">6.1148182995406646e-09</Real>
+    <Real Name="Cell 18 8 1">2.4659831278419495e-05</Real>
+    <Real Name="Cell 18 8 2">0.00018148155989377549</Real>
+    <Real Name="Cell 18 8 3">0.00013272018249180763</Real>
+    <Real Name="Cell 18 8 4">7.7749313136519353e-06</Real>
+    <Real Name="Cell 18 9 0">7.7746702540578876e-15</Real>
+    <Real Name="Cell 18 9 1">3.1353680079883351e-11</Real>
+    <Real Name="Cell 18 9 2">2.3074427010728188e-10</Real>
+    <Real Name="Cell 18 9 3">1.6874674019499523e-10</Real>
+    <Real Name="Cell 18 9 4">9.8854167451114012e-12</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_2.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_2.xml
new file mode 100644 (file)
index 0000000..451660b
--- /dev/null
@@ -0,0 +1,124 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">4</Int>
+      <Real>0.091894564066607176</Real>
+      <Real>0.63718257163486036</Real>
+      <Real>0.26995085935467633</Real>
+      <Real>0.00097200494385603809</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">4</Int>
+      <Real>0.00074469256732973097</Real>
+      <Real>0.26034962294691572</Real>
+      <Real>0.64177267755391809</Real>
+      <Real>0.097133006931836421</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">4</Int>
+      <Real>0.0071458384444328411</Real>
+      <Real>0.38147922226289888</Real>
+      <Real>0.5656041235874063</Real>
+      <Real>0.045770815705261904</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">4</Int>
+      <Real>-0.33619974975590594</Real>
+      <Real>-0.31140044555650093</Real>
+      <Real>0.63140014038071968</Real>
+      <Real>0.016200054931687191</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">4</Int>
+      <Real>-0.013564033407368874</Real>
+      <Real>-0.62401390092763209</Real>
+      <Real>0.28871990207737086</Real>
+      <Real>0.34885803225763012</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">4</Int>
+      <Real>-0.061250029206279422</Real>
+      <Real>-0.66624999582766442</Real>
+      <Real>0.51625007927416711</Real>
+      <Real>0.21124994575977674</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Int Name="X">11</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">6</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 11 4 6">2.4206121932465698e-06</Real>
+    <Real Name="Cell 11 4 7">0.00012922392019640487</Real>
+    <Real Name="Cell 11 4 8">0.00019159518491113612</Real>
+    <Real Name="Cell 11 4 9">1.5504603896735891e-05</Real>
+    <Real Name="Cell 11 5 6">0.00084626260481180846</Real>
+    <Real Name="Cell 11 5 7">0.045177567730389195</Real>
+    <Real Name="Cell 11 5 8">0.066982989139963478</Real>
+    <Real Name="Cell 11 5 9">0.0054205157343394797</Real>
+    <Real Name="Cell 11 6 6">0.0020860726113460328</Real>
+    <Real Name="Cell 11 6 7">0.1113645884312153</Real>
+    <Real Name="Cell 11 6 8">0.16511586152626936</Real>
+    <Real Name="Cell 11 6 9">0.013361797329199482</Real>
+    <Real Name="Cell 11 7 6">0.00031572940467096281</Real>
+    <Real Name="Cell 11 7 7">0.01685515404189445</Real>
+    <Real Name="Cell 11 7 8">0.024990468873364941</Real>
+    <Real Name="Cell 11 7 9">0.0020223228535463586</Real>
+    <Real Name="Cell 12 4 6">1.6784147331126181e-05</Real>
+    <Real Name="Cell 12 4 7">0.00089601850363860429</Real>
+    <Real Name="Cell 12 4 8">0.0013284911232186406</Real>
+    <Real Name="Cell 12 4 9">0.00010750650469315406</Real>
+    <Real Name="Cell 12 5 6">0.0058678528843290716</Real>
+    <Real Name="Cell 12 5 7">0.31325420691688016</Real>
+    <Real Name="Cell 12 5 8">0.46444959731302682</Real>
+    <Real Name="Cell 12 5 9">0.037585010498447133</Real>
+    <Real Name="Cell 12 6 6">0.014464502058588301</Real>
+    <Real Name="Cell 12 6 7">0.77218468324444689</Real>
+    <Real Name="Cell 12 6 8">1.1448876256571181</Real>
+    <Real Name="Cell 12 6 9">0.092648618232870364</Real>
+    <Real Name="Cell 12 7 6">0.0021892184380261047</Real>
+    <Real Name="Cell 12 7 7">0.11687100871311136</Real>
+    <Real Name="Cell 12 7 8">0.17328001264089909</Real>
+    <Real Name="Cell 12 7 9">0.014022471183002953</Real>
+    <Real Name="Cell 13 4 6">7.1108269392048839e-06</Real>
+    <Real Name="Cell 13 4 7">0.00037961013973486886</Real>
+    <Real Name="Cell 13 4 8">0.00056283290900091337</Real>
+    <Real Name="Cell 13 4 9">4.5546558584727484e-05</Real>
+    <Real Name="Cell 13 5 6">0.002485993809634806</Real>
+    <Real Name="Cell 13 5 7">0.13271430531552367</Real>
+    <Real Name="Cell 13 5 8">0.19677024059194384</Real>
+    <Real Name="Cell 13 5 9">0.015923388891315431</Real>
+    <Real Name="Cell 13 6 6">0.0061280784106113326</Real>
+    <Real Name="Cell 13 6 7">0.32714629699854858</Real>
+    <Real Name="Cell 13 6 8">0.48504684868842246</Real>
+    <Real Name="Cell 13 6 9">0.039251817647515765</Real>
+    <Real Name="Cell 13 7 6">0.00092749146785972201</Real>
+    <Real Name="Cell 13 7 7">0.049513955089518336</Real>
+    <Real Name="Cell 13 7 8">0.073412378812215309</Real>
+    <Real Name="Cell 13 7 9">0.0059408061592385415</Real>
+    <Real Name="Cell 14 4 6">2.5603767131301463e-08</Real>
+    <Real Name="Cell 14 4 7">1.3668522242982891e-06</Real>
+    <Real Name="Cell 14 4 8">2.0265776201696924e-06</Real>
+    <Real Name="Cell 14 4 9">1.6399829297011971e-07</Real>
+    <Real Name="Cell 14 5 6">8.9512523839968256e-06</Real>
+    <Real Name="Cell 14 5 7">0.00047786090103763202</Real>
+    <Real Name="Cell 14 5 8">0.00070850541878742976</Real>
+    <Real Name="Cell 14 5 9">5.7334926668877825e-05</Real>
+    <Real Name="Cell 14 6 6">2.2065210407890048e-05</Real>
+    <Real Name="Cell 14 6 7">0.0011779470486107807</Real>
+    <Real Name="Cell 14 6 8">0.0017464954031040799</Real>
+    <Real Name="Cell 14 6 9">0.00014133298519562604</Real>
+    <Real Name="Cell 14 7 6">3.3395940813045107e-06</Real>
+    <Real Name="Cell 14 7 7">0.00017828359299143661</Real>
+    <Real Name="Cell 14 7 8">0.00026433401737000037</Real>
+    <Real Name="Cell 14 7 9">2.1390904148534e-05</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_3.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_3.xml
new file mode 100644 (file)
index 0000000..80c0dda
--- /dev/null
@@ -0,0 +1,124 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">4</Int>
+      <Real>0.063184976374986601</Real>
+      <Real>0.60089332530937345</Real>
+      <Real>0.3324080578600529</Real>
+      <Real>0.0035136404555869702</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">4</Int>
+      <Real>0.00056250189332608582</Real>
+      <Real>0.25122927037875364</Real>
+      <Real>0.64585412185797764</Real>
+      <Real>0.1023541058699426</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">4</Int>
+      <Real>0.07758074885669021</Real>
+      <Real>0.62173700369211249</Real>
+      <Real>0.29878381161081358</Real>
+      <Real>0.0018984358403836554</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">4</Int>
+      <Real>-0.2619067689657868</Real>
+      <Real>-0.43802933070639938</Real>
+      <Real>0.66177896831015914</Real>
+      <Real>0.03815713136202703</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">4</Int>
+      <Real>-0.011250025244333649</Real>
+      <Real>-0.61625009256246233</Real>
+      <Real>0.26625026085792552</Real>
+      <Real>0.36124985694887041</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">4</Int>
+      <Real>-0.30031255081296182</Real>
+      <Real>-0.37406241312622379</Real>
+      <Real>0.64906247869133304</Real>
+      <Real>0.025312485247852567</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Int Name="X">13</Int>
+      <Int Name="Y">6</Int>
+      <Int Name="Z">5</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 13 6 5">1.3648878431251139e-05</Real>
+    <Real Name="Cell 13 6 6">0.00010938297070681329</Real>
+    <Real Name="Cell 13 6 7">5.2565410646331537e-05</Real>
+    <Real Name="Cell 13 6 8">3.339941980038275e-07</Real>
+    <Real Name="Cell 13 7 5">0.0060959755166258966</Real>
+    <Real Name="Cell 13 7 6">0.048853531425542843</Real>
+    <Real Name="Cell 13 7 7">0.023477200557939917</Real>
+    <Real Name="Cell 13 7 8">0.00014917126443625306</Real>
+    <Real Name="Cell 13 8 5">0.015671386173364891</Real>
+    <Real Name="Cell 13 8 6">0.12559147503368878</Real>
+    <Real Name="Cell 13 8 7">0.060354618421541308</Real>
+    <Real Name="Cell 13 8 8">0.00038348587269976031</Real>
+    <Real Name="Cell 13 9 5">0.0024835805257430389</Real>
+    <Real Name="Cell 13 9 6">0.019903570631368037</Real>
+    <Real Name="Cell 13 9 7">0.0095649199944517187</Real>
+    <Real Name="Cell 13 9 8">6.077433322097759e-05</Real>
+    <Real Name="Cell 14 6 5">0.00012980174113896896</Real>
+    <Real Name="Cell 14 6 6">0.0010402393222426643</Real>
+    <Real Name="Cell 14 6 7">0.00049990054933424189</Real>
+    <Real Name="Cell 14 6 8">3.1763070240223655e-06</Real>
+    <Real Name="Cell 14 7 5">0.057973132370117746</Real>
+    <Real Name="Cell 14 7 6">0.46460033121135497</Real>
+    <Real Name="Cell 14 7 7">0.22326973786446375</Real>
+    <Real Name="Cell 14 7 8">0.0014186286403865571</Real>
+    <Real Name="Cell 14 8 5">0.14903592420505299</Real>
+    <Real Name="Cell 14 8 6">1.1943832757905088</Real>
+    <Real Name="Cell 14 8 7">0.57397643303472723</Real>
+    <Real Name="Cell 14 8 8">0.0036469761401532992</Real>
+    <Real Name="Cell 14 9 5">0.023619015886474689</Real>
+    <Real Name="Cell 14 9 6">0.18928427971917966</Real>
+    <Real Name="Cell 14 9 7">0.090963024939255982</Real>
+    <Real Name="Cell 14 9 8">0.00057796794867632627</Real>
+    <Real Name="Cell 15 6 5">7.1804999093047747e-05</Real>
+    <Real Name="Cell 15 6 6">0.00057544978160360314</Real>
+    <Real Name="Cell 15 6 7">0.00027653988441594821</Real>
+    <Real Name="Cell 15 6 8">1.7571006442431672e-06</Real>
+    <Real Name="Cell 15 7 5">0.032070145444356456</Real>
+    <Real Name="Cell 15 7 6">0.25701216384720382</Real>
+    <Real Name="Cell 15 7 7">0.12351054141637972</Real>
+    <Real Name="Cell 15 7 8">0.00078477089245874976</Real>
+    <Real Name="Cell 15 8 5">0.082445152957679083</Real>
+    <Real Name="Cell 15 8 6">0.66072064428680677</Real>
+    <Real Name="Cell 15 8 7">0.31751790763241178</Real>
+    <Real Name="Cell 15 8 8">0.0020174699980003248</Real>
+    <Real Name="Cell 15 9 5">0.013065798651277376</Real>
+    <Real Name="Cell 15 9 6">0.10471013265540433</Real>
+    <Real Name="Cell 15 9 7">0.050319817484353033</Real>
+    <Real Name="Cell 15 9 8">0.00031972597336797116</Real>
+    <Real Name="Cell 16 6 5">7.5899769503463048e-07</Real>
+    <Real Name="Cell 16 6 6">6.0826552936702764e-06</Real>
+    <Real Name="Cell 16 6 7">2.9230991923676517e-06</Real>
+    <Real Name="Cell 16 6 8">1.8573015190714658e-08</Real>
+    <Real Name="Cell 16 7 5">0.0003389898583544255</Real>
+    <Real Name="Cell 16 7 6">0.0027166860583496279</Real>
+    <Real Name="Cell 16 7 7">0.0013055388542799651</Real>
+    <Real Name="Cell 16 7 8">8.295234399134357e-06</Real>
+    <Real Name="Cell 16 8 5">0.00087146691528493649</Real>
+    <Real Name="Cell 16 8 6">0.0069839907027314041</Real>
+    <Real Name="Cell 16 8 7">0.0033562476578117909</Real>
+    <Real Name="Cell 16 8 8">2.1325187627946444e-05</Real>
+    <Real Name="Cell 16 9 5">0.00013810892257313989</Real>
+    <Real Name="Cell 16 9 6">0.0011068135970482469</Real>
+    <Real Name="Cell 16 9 7">0.00053189368383245483</Real>
+    <Real Name="Cell 16 9 8">3.3795874924325363e-06</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_4.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_4.xml
new file mode 100644 (file)
index 0000000..b9ad14a
--- /dev/null
@@ -0,0 +1,191 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">5</Int>
+      <Real>0.018838378622655624</Real>
+      <Real>0.36297420692464072</Real>
+      <Real>0.53757988540360191</Real>
+      <Real>0.080563788752470042</Real>
+      <Real>4.3740296631613747e-05</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">5</Int>
+      <Real>3.0663833712703144e-05</Real>
+      <Real>0.076521720794453157</Real>
+      <Real>0.5318542225048053</Real>
+      <Real>0.37130973842191789</Real>
+      <Real>0.020283654445110946</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">5</Int>
+      <Real>0.00062526101296168034</Real>
+      <Real>0.13526982290347628</Real>
+      <Real>0.58502241119791654</Real>
+      <Real>0.27164474828839408</Real>
+      <Real>0.0074377565972514352</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">5</Int>
+      <Real>-0.091894564066607176</Real>
+      <Real>-0.54528800756825313</Real>
+      <Real>0.36723171228018403</Real>
+      <Real>0.26897885441082031</Real>
+      <Real>0.00097200494385603809</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">5</Int>
+      <Real>-0.00074469256732973097</Real>
+      <Real>-0.25960493037958599</Real>
+      <Real>-0.38142305460700238</Real>
+      <Real>0.54463967062208163</Real>
+      <Real>0.097133006931836421</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">5</Int>
+      <Real>-0.0071458384444328411</Real>
+      <Real>-0.37433338381846604</Real>
+      <Real>-0.18412490132450743</Real>
+      <Real>0.51983330788214444</Real>
+      <Real>0.045770815705261904</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Int Name="X">11</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">6</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 11 4 10">2.1267533054017136e-08</Real>
+    <Real Name="Cell 11 4 6">1.7878723357880327e-09</Real>
+    <Real Name="Cell 11 4 7">3.8679074694025961e-07</Real>
+    <Real Name="Cell 11 4 8">1.6728140138506729e-06</Real>
+    <Real Name="Cell 11 4 9">7.7674142567511696e-07</Real>
+    <Real Name="Cell 11 5 10">5.3073214575648657e-05</Real>
+    <Real Name="Cell 11 5 6">4.4616426301131996e-06</Real>
+    <Real Name="Cell 11 5 7">0.0009652378701420813</Real>
+    <Real Name="Cell 11 5 8">0.004174514123323733</Real>
+    <Real Name="Cell 11 5 9">0.0019383613628315987</Real>
+    <Real Name="Cell 11 6 10">0.00036887844367462823</Real>
+    <Real Name="Cell 11 6 6">3.1010064168671417e-05</Real>
+    <Real Name="Cell 11 6 7">0.0067087597041312654</Real>
+    <Real Name="Cell 11 6 8">0.029014414996749671</Real>
+    <Real Name="Cell 11 6 9">0.01347232739748952</Real>
+    <Real Name="Cell 11 7 10">0.0002575295121006073</Real>
+    <Real Name="Cell 11 7 6">2.1649426342219628e-05</Real>
+    <Real Name="Cell 11 7 7">0.0046836665113699962</Real>
+    <Real Name="Cell 11 7 8">0.020256179958805826</Real>
+    <Real Name="Cell 11 7 9">0.0094055967786381058</Real>
+    <Real Name="Cell 11 8 10">1.4068146057971513e-05</Real>
+    <Real Name="Cell 11 8 6">1.1826500557911143e-06</Real>
+    <Real Name="Cell 11 8 7">0.00025585613093943968</Real>
+    <Real Name="Cell 11 8 8">0.0011065407452242196</Real>
+    <Real Name="Cell 11 8 9">0.00051380250816681131</Real>
+    <Real Name="Cell 12 4 10">4.0977868096576318e-07</Real>
+    <Real Name="Cell 12 4 6">3.4448375635932738e-08</Real>
+    <Real Name="Cell 12 4 7">7.4526087105812087e-06</Real>
+    <Real Name="Cell 12 4 8">3.2231454318454416e-05</Real>
+    <Real Name="Cell 12 4 9">1.4966102370979737e-05</Real>
+    <Real Name="Cell 12 5 10">0.0010226043522859028</Real>
+    <Real Name="Cell 12 5 6">8.5966060438921849e-05</Real>
+    <Real Name="Cell 12 5 7">0.018598015117240595</Real>
+    <Real Name="Cell 12 5 8">0.080433724343286508</Real>
+    <Real Name="Cell 12 5 9">0.037347968872492233</Real>
+    <Real Name="Cell 12 6 10">0.0071074779431054419</Real>
+    <Real Name="Cell 12 6 6">0.00059749587126192933</Real>
+    <Real Name="Cell 12 6 7">0.12926307416533703</Real>
+    <Real Name="Cell 12 6 8">0.55904409205164396</Real>
+    <Real Name="Cell 12 6 9">0.25958217798276284</Real>
+    <Real Name="Cell 12 7 10">0.004962028436034817</Real>
+    <Real Name="Cell 12 7 6">0.00041713692639610173</Real>
+    <Real Name="Cell 12 7 7">0.090243973301369448</Real>
+    <Real Name="Cell 12 7 8">0.39029212668164731</Real>
+    <Real Name="Cell 12 7 9">0.18122520519220012</Real>
+    <Real Name="Cell 12 8 10">0.00027106229578330771</Real>
+    <Real Name="Cell 12 8 6">2.278707072772741e-05</Real>
+    <Real Name="Cell 12 8 7">0.0049297860540324185</Real>
+    <Real Name="Cell 12 8 8">0.021320611368567048</Real>
+    <Real Name="Cell 12 8 9">0.0098998465660655281</Real>
+    <Real Name="Cell 13 4 10">6.0689925661894107e-07</Real>
+    <Real Name="Cell 13 4 6">5.1019475966648357e-08</Real>
+    <Real Name="Cell 13 4 7">1.103762322545392e-05</Real>
+    <Real Name="Cell 13 4 8">4.7736123361799961e-05</Real>
+    <Real Name="Cell 13 4 9">2.2165419591922221e-05</Real>
+    <Real Name="Cell 13 5 10">0.0015145195444402838</Real>
+    <Real Name="Cell 13 5 6">0.00012731930819797732</Real>
+    <Real Name="Cell 13 5 7">0.027544433308828421</Real>
+    <Real Name="Cell 13 5 8">0.11912568852041348</Real>
+    <Real Name="Cell 13 5 9">0.055313894055012233</Real>
+    <Real Name="Cell 13 6 10">0.010526470215434671</Real>
+    <Real Name="Cell 13 6 6">0.0008849162168396166</Real>
+    <Real Name="Cell 13 6 7">0.191443984919695</Real>
+    <Real Name="Cell 13 6 8">0.82796753380076538</Real>
+    <Real Name="Cell 13 6 9">0.38445199364196991</Real>
+    <Real Name="Cell 13 7 10">0.007348970332117356</Real>
+    <Real Name="Cell 13 7 6">0.00061779712390468524</Real>
+    <Real Name="Cell 13 7 7">0.13365507493425849</Real>
+    <Real Name="Cell 13 7 8">0.57803885987691861</Real>
+    <Real Name="Cell 13 7 9">0.26840206047944826</Real>
+    <Real Name="Cell 13 8 10">0.00040145452521005479</Real>
+    <Real Name="Cell 13 8 6">3.3748598762111889e-05</Real>
+    <Real Name="Cell 13 8 7">0.0073012180244014895</Real>
+    <Real Name="Cell 13 8 8">0.031576711506194177</Real>
+    <Real Name="Cell 13 8 9">0.014662084194879646</Real>
+    <Real Name="Cell 14 4 10">9.095225627270441e-08</Real>
+    <Real Name="Cell 14 4 6">7.6459748507012131e-09</Real>
+    <Real Name="Cell 14 4 7">1.6541406589221847e-06</Real>
+    <Real Name="Cell 14 4 8">7.1539190040463777e-06</Real>
+    <Real Name="Cell 14 4 9">3.321795011494524e-06</Real>
+    <Real Name="Cell 14 5 10">0.00022697172262717378</Real>
+    <Real Name="Cell 14 5 6">1.9080561100368405e-05</Real>
+    <Real Name="Cell 14 5 7">0.0041279146907308821</Real>
+    <Real Name="Cell 14 5 8">0.017852633749020911</Real>
+    <Real Name="Cell 14 5 9">0.008289552858509271</Real>
+    <Real Name="Cell 14 6 10">0.0015775373033326005</Real>
+    <Real Name="Cell 14 6 6">0.00013261694697445272</Real>
+    <Real Name="Cell 14 6 7">0.028690531728920277</Real>
+    <Real Name="Cell 14 6 8">0.12408239835266263</Real>
+    <Real Name="Cell 14 6 9">0.05761545407894849</Real>
+    <Real Name="Cell 14 7 10">0.0011013449525559672</Real>
+    <Real Name="Cell 14 7 6">9.2585452569105993e-05</Real>
+    <Real Name="Cell 14 7 7">0.020030063466037206</Real>
+    <Real Name="Cell 14 7 8">0.086627126241674443</Real>
+    <Real Name="Cell 14 7 9">0.040223764854891417</Real>
+    <Real Name="Cell 14 8 10">6.0163518838626006e-05</Real>
+    <Real Name="Cell 14 8 6">5.0576947820905883e-06</Real>
+    <Real Name="Cell 14 8 7">0.0010941886081023875</Real>
+    <Real Name="Cell 14 8 8">0.0047322074064820889</Real>
+    <Real Name="Cell 14 8 9">0.0021973163167375068</Real>
+    <Real Name="Cell 15 4 10">4.9380481358762696e-11</Real>
+    <Real Name="Cell 15 4 6">4.1512100310361337e-12</Real>
+    <Real Name="Cell 15 4 7">8.9807845698482103e-10</Real>
+    <Real Name="Cell 15 4 8">3.8840593790461917e-09</Real>
+    <Real Name="Cell 15 4 9">1.8034938699147332e-09</Real>
+    <Real Name="Cell 15 5 10">1.2322919053874011e-07</Real>
+    <Real Name="Cell 15 5 6">1.0359361387434206e-08</Real>
+    <Real Name="Cell 15 5 7">2.2411584142016798e-06</Real>
+    <Real Name="Cell 15 5 8">9.6926858571282351e-06</Real>
+    <Real Name="Cell 15 5 9">4.5006262315775254e-06</Real>
+    <Real Name="Cell 15 6 10">8.5648838843975567e-07</Real>
+    <Real Name="Cell 15 6 6">7.2001387830257749e-08</Real>
+    <Real Name="Cell 15 6 7">1.5576878741359136e-05</Real>
+    <Real Name="Cell 15 6 8">6.7367746660761682e-05</Real>
+    <Real Name="Cell 15 6 9">3.1281014597281609e-05</Real>
+    <Real Name="Cell 15 7 10">5.9795046465030628e-07</Real>
+    <Real Name="Cell 15 7 6">5.0267188545309557e-08</Real>
+    <Real Name="Cell 15 7 7">1.0874872335589548e-05</Real>
+    <Real Name="Cell 15 7 8">4.7032249312367646e-05</Real>
+    <Real Name="Cell 15 7 9">2.1838588199953398e-05</Real>
+    <Real Name="Cell 15 8 10">3.2664429033850529e-08</Real>
+    <Real Name="Cell 15 8 6">2.7459615972197525e-09</Real>
+    <Real Name="Cell 15 8 7">5.9406508842800209e-07</Real>
+    <Real Name="Cell 15 8 8">2.5692455492356669e-06</Real>
+    <Real Name="Cell 15 8 9">1.192983460384201e-06</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_5.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_5.xml
new file mode 100644 (file)
index 0000000..9acdadd
--- /dev/null
@@ -0,0 +1,191 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">5</Int>
+      <Real>0.011432525938349669</Real>
+      <Real>0.31069986337177463</Real>
+      <Real>0.56829499415745799</Real>
+      <Real>0.10932995542012119</Real>
+      <Real>0.00024266111229649778</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">5</Int>
+      <Real>2.1093844666357399e-05</Real>
+      <Real>0.072769833852738011</Real>
+      <Real>0.526147462246918</Real>
+      <Real>0.3793113668647477</Real>
+      <Real>0.021750243190929889</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">5</Int>
+      <Real>0.015031271362631297</Real>
+      <Real>0.33844528307349747</Real>
+      <Real>0.55312247231512424</Real>
+      <Real>0.093294186263843212</Real>
+      <Real>0.0001067869849037923</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">5</Int>
+      <Real>-0.063184976374986601</Real>
+      <Real>-0.53770834893438679</Real>
+      <Real>0.26848526744932055</Real>
+      <Real>0.3288944174044659</Real>
+      <Real>0.0035136404555869702</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">5</Int>
+      <Real>-0.00056250189332608582</Real>
+      <Real>-0.25066676848542757</Real>
+      <Real>-0.39462485147922399</Real>
+      <Real>0.54350001598803499</Real>
+      <Real>0.1023541058699426</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">5</Int>
+      <Real>-0.07758074885669021</Real>
+      <Real>-0.54415625483542229</Real>
+      <Real>0.32295319208129891</Real>
+      <Real>0.29688537577042995</Real>
+      <Real>0.0018984358403836554</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Int Name="X">13</Int>
+      <Int Name="Y">6</Int>
+      <Int Name="Z">5</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 13 10 5">1.8501511503215527e-05</Real>
+    <Real Name="Cell 13 10 6">0.00041658148182730962</Real>
+    <Real Name="Cell 13 10 7">0.00068082077273028758</Real>
+    <Real Name="Cell 13 10 8">0.00011483283208064365</Real>
+    <Real Name="Cell 13 10 9">1.3144068668090074e-07</Real>
+    <Real Name="Cell 13 6 5">1.7943156143854031e-08</Real>
+    <Real Name="Cell 13 6 6">4.0400950883209747e-07</Real>
+    <Real Name="Cell 13 6 7">6.6027434725837286e-07</Real>
+    <Real Name="Cell 13 6 8">1.1136730294202473e-07</Real>
+    <Real Name="Cell 13 6 9">1.2747395067483544e-10</Real>
+    <Real Name="Cell 13 7 5">6.190054549251936e-05</Real>
+    <Real Name="Cell 13 7 6">0.0013937575296326917</Real>
+    <Real Name="Cell 13 7 7">0.0022778234744398559</Real>
+    <Real Name="Cell 13 7 8">0.00038419644497733732</Real>
+    <Real Name="Cell 13 7 9">4.3976137863357888e-07</Real>
+    <Real Name="Cell 13 8 5">0.00044755928656505428</Real>
+    <Real Name="Cell 13 8 6">0.010077279943881344</Real>
+    <Real Name="Cell 13 8 7">0.016469338695321131</Real>
+    <Real Name="Cell 13 8 8">0.0027778541440425168</Real>
+    <Real Name="Cell 13 8 9">3.1796050796336644e-06</Real>
+    <Real Name="Cell 13 9 5">0.00032265540921744978</Real>
+    <Real Name="Cell 13 9 6">0.0072649344605191643</Real>
+    <Real Name="Cell 13 9 7">0.011873111285575399</Real>
+    <Real Name="Cell 13 9 8">0.0020026166197361387</Real>
+    <Real Name="Cell 13 9 9">2.292247773457744e-06</Real>
+    <Real Name="Cell 14 10 5">0.00050281251293186988</Real>
+    <Real Name="Cell 14 10 6">0.011321365915539791</Real>
+    <Real Name="Cell 14 10 7">0.018502553347235329</Real>
+    <Real Name="Cell 14 10 8">0.0031207928528172888</Real>
+    <Real Name="Cell 14 10 9">3.5721417658242645e-06</Real>
+    <Real Name="Cell 14 6 5">4.8763818183461111e-07</Real>
+    <Real Name="Cell 14 6 6">1.0979699488278664e-05</Real>
+    <Real Name="Cell 14 6 7">1.7944166546162054e-05</Real>
+    <Real Name="Cell 14 6 8">3.0266107415597976e-06</Real>
+    <Real Name="Cell 14 6 9">3.4643384385663596e-09</Real>
+    <Real Name="Cell 14 7 5">0.0016822608696342367</Real>
+    <Real Name="Cell 14 7 6">0.037877917475582001</Real>
+    <Real Name="Cell 14 7 7">0.061904031192221924</Real>
+    <Real Name="Cell 14 7 8">0.010441243134376979</Real>
+    <Real Name="Cell 14 7 9">1.1951322130773126e-05</Real>
+    <Real Name="Cell 14 8 5">0.012163244582728204</Real>
+    <Real Name="Cell 14 8 6">0.27386856750705363</Real>
+    <Real Name="Cell 14 8 7">0.44758448920680238</Real>
+    <Real Name="Cell 14 8 8">0.075493281858699787</Real>
+    <Real Name="Cell 14 8 9">8.6411600476192556e-05</Real>
+    <Real Name="Cell 14 9 5">0.0087687526011856164</Real>
+    <Real Name="Cell 14 9 6">0.19743792023392859</Real>
+    <Real Name="Cell 14 9 7">0.32267357836046773</Real>
+    <Real Name="Cell 14 9 8">0.054424780096137042</Real>
+    <Real Name="Cell 14 9 9">6.2296037976921901e-05</Real>
+    <Real Name="Cell 15 10 5">0.00091968445366517068</Real>
+    <Real Name="Cell 15 10 6">0.020707687177601158</Real>
+    <Real Name="Cell 15 10 7">0.033842655520525011</Real>
+    <Real Name="Cell 15 10 8">0.005708180675754855</Real>
+    <Real Name="Cell 15 10 9">6.5337340734831138e-06</Real>
+    <Real Name="Cell 15 6 5">8.9192938384094845e-07</Real>
+    <Real Name="Cell 15 6 6">2.008275185198814e-05</Real>
+    <Real Name="Cell 15 6 7">3.2821321232154791e-05</Real>
+    <Real Name="Cell 15 6 8">5.5359140330020441e-06</Real>
+    <Real Name="Cell 15 6 9">6.3365531331076159e-09</Real>
+    <Real Name="Cell 15 7 5">0.0030769901882324352</Real>
+    <Real Name="Cell 15 7 6">0.069281752031945226</Real>
+    <Real Name="Cell 15 7 7">0.11322744291847905</Real>
+    <Real Name="Cell 15 7 8">0.019097871951579394</Real>
+    <Real Name="Cell 15 7 9">2.1859927670308133e-05</Real>
+    <Real Name="Cell 15 8 5">0.022247550848795136</Real>
+    <Real Name="Cell 15 8 6">0.5009275970781496</Real>
+    <Real Name="Cell 15 8 7">0.81866796437689004</Real>
+    <Real Name="Cell 15 8 8">0.13808327337911078</Real>
+    <Real Name="Cell 15 8 9">0.00015805375469056472</Real>
+    <Real Name="Cell 15 9 5">0.016038752493097084</Real>
+    <Real Name="Cell 15 9 6">0.36112980710114506</Real>
+    <Real Name="Cell 15 9 7">0.5901958801626771</Real>
+    <Real Name="Cell 15 9 8">0.099547292203813989</Real>
+    <Real Name="Cell 15 9 9">0.00011394445479934425</Real>
+    <Real Name="Cell 16 10 5">0.00017693110330641487</Real>
+    <Real Name="Cell 16 10 6">0.0039837945772115482</Real>
+    <Real Name="Cell 16 10 7">0.0065107313233386515</Real>
+    <Real Name="Cell 16 10 8">0.0010981535034203778</Real>
+    <Real Name="Cell 16 10 9">1.2569754481823129e-06</Real>
+    <Real Name="Cell 16 6 5">1.7159151633527958e-07</Real>
+    <Real Name="Cell 16 6 6">3.863568018835778e-06</Real>
+    <Real Name="Cell 16 6 7">6.3142445807761812e-06</Real>
+    <Real Name="Cell 16 6 8">1.0650124330851349e-06</Real>
+    <Real Name="Cell 16 6 9">1.2190413054525996e-09</Real>
+    <Real Name="Cell 16 7 5">0.00059195876009140753</Real>
+    <Real Name="Cell 16 7 6">0.013328589797470166</Real>
+    <Real Name="Cell 16 7 7">0.021782967321337571</Real>
+    <Real Name="Cell 16 7 8">0.0036740944589542567</Real>
+    <Real Name="Cell 16 7 9">4.2054653696627108e-06</Real>
+    <Real Name="Cell 16 8 5">0.0042800372474013481</Real>
+    <Real Name="Cell 16 8 6">0.096369653824697157</Real>
+    <Real Name="Cell 16 8 7">0.15749730856226324</Real>
+    <Real Name="Cell 16 8 8">0.026564791662795732</Real>
+    <Real Name="Cell 16 8 9">3.0406760805488328e-05</Real>
+    <Real Name="Cell 16 9 5">0.0030855737127587889</Real>
+    <Real Name="Cell 16 9 6">0.069475019342341349</Real>
+    <Real Name="Cell 16 9 7">0.11354330045259273</Real>
+    <Real Name="Cell 16 9 8">0.019151147081582883</Real>
+    <Real Name="Cell 16 9 9">2.1920907788483351e-05</Real>
+    <Real Name="Cell 17 10 5">3.9270388580328203e-07</Real>
+    <Real Name="Cell 17 10 6">8.8421514446990794e-06</Real>
+    <Real Name="Cell 17 10 7">1.4450763276303683e-05</Real>
+    <Real Name="Cell 17 10 8">2.4373846087130266e-06</Real>
+    <Real Name="Cell 17 10 9">2.7898946744578373e-09</Real>
+    <Real Name="Cell 17 6 5">3.8085251251184906e-10</Real>
+    <Real Name="Cell 17 6 6">8.5753049956089219e-09</Real>
+    <Real Name="Cell 17 6 7">1.4014655063156549e-08</Real>
+    <Real Name="Cell 17 6 8">2.363827009980425e-09</Real>
+    <Real Name="Cell 17 6 9">2.7056987079138661e-12</Real>
+    <Real Name="Cell 17 7 5">1.3138702069844619e-06</Real>
+    <Real Name="Cell 17 7 6">2.9583204467333142e-05</Real>
+    <Real Name="Cell 17 7 7">4.8347948730080787e-05</Real>
+    <Real Name="Cell 17 7 8">8.1547627515830453e-06</Real>
+    <Real Name="Cell 17 7 9">9.3341564112532426e-09</Real>
+    <Real Name="Cell 17 8 5">9.4996709285560274e-06</Real>
+    <Real Name="Cell 17 8 6">0.00021389533452993275</Real>
+    <Real Name="Cell 17 8 7">0.00034956999600486218</Real>
+    <Real Name="Cell 17 8 8">5.8961351150723794e-05</Real>
+    <Real Name="Cell 17 8 9">6.7488716793489128e-08</Real>
+    <Real Name="Cell 17 9 5">6.848523319466036e-06</Real>
+    <Real Name="Cell 17 9 6">0.0001542018873569441</Real>
+    <Real Name="Cell 17 9 7">0.00025201275785548152</Real>
+    <Real Name="Cell 17 9 8">4.2506544841373341e-05</Real>
+    <Real Name="Cell 17 9 9">4.8654111730510713e-08</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_6.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_6.xml
new file mode 100644 (file)
index 0000000..626298f
--- /dev/null
@@ -0,0 +1,81 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">3</Int>
+      <Real>0.35769526137043567</Real>
+      <Real>0.63041709293829207</Real>
+      <Real>0.011887645691272288</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">3</Int>
+      <Real>0.099485422038718782</Real>
+      <Real>0.74709063607685411</Real>
+      <Real>0.1534239418844271</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">3</Int>
+      <Real>0.41390083004880668</Real>
+      <Real>0.58203440211228463</Real>
+      <Real>0.0040647678389086929</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">3</Int>
+      <Real>-0.8458076156791634</Real>
+      <Real>0.69161523135832681</Real>
+      <Real>0.1541923843208366</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">3</Int>
+      <Real>-0.4460614801542917</Real>
+      <Real>-0.1078770396914166</Real>
+      <Real>0.5539385198457083</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">3</Int>
+      <Real>-0.90983606220989799</Real>
+      <Real>0.81967212441979598</Real>
+      <Real>0.090163937790102011</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Int Name="X">12</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 12 3 1">0.072907820051953801</Real>
+    <Real Name="Cell 12 3 2">0.1025242192634528</Real>
+    <Real Name="Cell 12 3 3">0.0007160008887084824</Real>
+    <Real Name="Cell 12 4 1">0.54750483579787468</Real>
+    <Real Name="Cell 12 4 2">0.76991063226334622</Real>
+    <Real Name="Cell 12 4 3">0.0053768436461839415</Real>
+    <Real Name="Cell 12 5 1">0.1124366255612588</Real>
+    <Real Name="Cell 12 5 2">0.15811029933511669</Real>
+    <Real Name="Cell 12 5 3">0.0011041987508044659</Real>
+    <Real Name="Cell 13 3 1">0.12849579218222132</Real>
+    <Real Name="Cell 13 3 2">0.18069297316437982</Real>
+    <Real Name="Cell 13 3 3">0.0012619099203927632</Real>
+    <Real Name="Cell 13 4 1">0.96494542765525437</Real>
+    <Real Name="Cell 13 4 2">1.3569227077657271</Real>
+    <Real Name="Cell 13 4 3">0.009476374184058927</Real>
+    <Real Name="Cell 13 5 1">0.1981630127124144</Real>
+    <Real Name="Cell 13 5 2">0.27866020614464265</Real>
+    <Real Name="Cell 13 5 3">0.0019460860729361054</Real>
+    <Real Name="Cell 14 3 1">0.0024230187718452647</Real>
+    <Real Name="Cell 14 3 2">0.0034072902970779312</Real>
+    <Real Name="Cell 14 3 3">2.379557628745825e-05</Real>
+    <Real Name="Cell 14 4 1">0.01819577781737226</Real>
+    <Real Name="Cell 14 4 2">0.025587212911975576</Real>
+    <Real Name="Cell 14 4 3">0.00017869404240446077</Real>
+    <Real Name="Cell 14 5 1">0.0037367192460799189</Real>
+    <Real Name="Cell 14 5 2">0.0052546382958379937</Real>
+    <Real Name="Cell 14 5 3">3.6696945528487431e-05</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_7.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_7.xml
new file mode 100644 (file)
index 0000000..ce15da6
--- /dev/null
@@ -0,0 +1,81 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">3</Int>
+      <Real>0.16068584558358961</Real>
+      <Real>0.74552485245182998</Real>
+      <Real>0.093789301964580393</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">3</Int>
+      <Real>0.46585741402556702</Real>
+      <Real>0.5335389355007798</Real>
+      <Real>0.00060365047365315571</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">3</Int>
+      <Real>0.010287892660380538</Real>
+      <Real>0.62286683498701589</Real>
+      <Real>0.36684527235260356</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">3</Int>
+      <Real>-0.56689654361900921</Real>
+      <Real>0.13379308723801842</Real>
+      <Real>0.43310345638099079</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">3</Int>
+      <Real>-0.96525376355191383</Real>
+      <Real>0.93050752710382767</Real>
+      <Real>0.034746236448086165</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">3</Int>
+      <Real>-0.14344262030777699</Real>
+      <Real>-0.71311475938444602</Real>
+      <Real>0.85655737969222301</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Int Name="X">14</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 14 5 0">0.0038120820586983882</Real>
+    <Real Name="Cell 14 5 1">0.23079745920720227</Real>
+    <Real Name="Cell 14 5 2">0.13593107230202739</Real>
+    <Real Name="Cell 14 6 0">0.0043659157124156783</Real>
+    <Real Name="Cell 14 6 1">0.26432858422842925</Real>
+    <Real Name="Cell 14 6 2">0.15567965097046402</Real>
+    <Real Name="Cell 14 7 0">4.9396340404956768e-06</Real>
+    <Real Name="Cell 14 7 1">0.0002990636005220395</Real>
+    <Real Name="Cell 14 7 2">0.00017613727657621198</Real>
+    <Real Name="Cell 15 5 0">0.017686697319378761</Real>
+    <Real Name="Cell 15 5 1">1.0708176634773812</Real>
+    <Real Name="Cell 15 5 2">0.63067155824170218</Real>
+    <Real Name="Cell 15 6 0">0.020256287387943012</Real>
+    <Real Name="Cell 15 6 1">1.226390090801043</Real>
+    <Real Name="Cell 15 6 2">0.72229789996736815</Real>
+    <Real Name="Cell 15 7 0">2.2918135233578232e-05</Real>
+    <Real Name="Cell 15 7 1">0.0013875481430436379</Real>
+    <Real Name="Cell 15 7 2">0.00081721396588374062</Real>
+    <Real Name="Cell 16 5 0">0.0022250405069501418</Real>
+    <Real Name="Cell 16 5 1">0.13471213046566496</Real>
+    <Real Name="Cell 16 5 2">0.07934040699230116</Real>
+    <Real Name="Cell 16 6 0">0.0025483027805996055</Real>
+    <Real Name="Cell 16 6 1">0.15428361666848664</Real>
+    <Real Name="Cell 16 6 2">0.090867280447634521</Real>
+    <Real Name="Cell 16 7 0">2.8831713641981376e-06</Real>
+    <Real Name="Cell 16 7 1">0.00017455779153481807</Real>
+    <Real Name="Cell 16 7 2">0.00010280801124721018</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_8.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_8.xml
new file mode 100644 (file)
index 0000000..39e5816
--- /dev/null
@@ -0,0 +1,124 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">4</Int>
+      <Real>0.10084712538648778</Real>
+      <Real>0.64472435971722064</Real>
+      <Real>0.25381752008525871</Real>
+      <Real>0.00061099481103286458</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">4</Int>
+      <Real>0.014792204869455098</Real>
+      <Real>0.44480621417416599</Real>
+      <Real>0.51207243719759432</Real>
+      <Real>0.028329143758784502</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">4</Int>
+      <Real>0.12552730045233818</Real>
+      <Real>0.65890362646340783</Real>
+      <Real>0.2154469079260678</Real>
+      <Real>0.00012216515818619025</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">4</Int>
+      <Real>-0.35769526137043567</Real>
+      <Real>-0.2727218315678564</Real>
+      <Real>0.61852944724701975</Real>
+      <Real>0.011887645691272288</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">4</Int>
+      <Real>-0.099485422038718782</Real>
+      <Real>-0.64760521403813531</Real>
+      <Real>0.59366669419242701</Real>
+      <Real>0.1534239418844271</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">4</Int>
+      <Real>-0.41390083004880668</Real>
+      <Real>-0.16813357206347795</Real>
+      <Real>0.57796963427337589</Real>
+      <Real>0.0040647678389086929</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Int Name="X">12</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 12 3 1">0.0009269147811435288</Real>
+    <Real Name="Cell 12 3 2">0.0048654556301073616</Real>
+    <Real Name="Cell 12 3 3">0.00159089634516729</Real>
+    <Real Name="Cell 12 3 4">9.0208815497081667e-07</Real>
+    <Real Name="Cell 12 4 1">0.027872616577525572</Real>
+    <Real Name="Cell 12 4 2">0.14630576835298786</Real>
+    <Real Name="Cell 12 4 3">0.047838749306305883</Real>
+    <Real Name="Cell 12 4 4">2.7126072184985119e-05</Real>
+    <Real Name="Cell 12 5 1">0.032087678290256549</Real>
+    <Real Name="Cell 12 5 2">0.16843099082074922</Real>
+    <Real Name="Cell 12 5 3">0.05507320754330311</Real>
+    <Real Name="Cell 12 5 4">3.1228237045097364e-05</Real>
+    <Real Name="Cell 12 6 1">0.0017751716068630003</Real>
+    <Real Name="Cell 12 6 2">0.0093180288681586048</Real>
+    <Real Name="Cell 12 6 3">0.0030467892829575999</Real>
+    <Real Name="Cell 12 6 4">1.7276251411332925e-06</Real>
+    <Real Name="Cell 13 3 1">0.0059258460416687364</Real>
+    <Real Name="Cell 13 3 2">0.031105276960862349</Real>
+    <Real Name="Cell 13 3 3">0.010170737376832328</Real>
+    <Real Name="Cell 13 3 4">5.7671272819440762e-06</Real>
+    <Real Name="Cell 13 4 1">0.17819203876877718</Real>
+    <Real Name="Cell 13 4 2">0.93534538007718659</Real>
+    <Real Name="Cell 13 4 3">0.30583724521624522</Real>
+    <Real Name="Cell 13 4 4">0.0001734193161588215</Real>
+    <Real Name="Cell 13 5 1">0.20513929138995271</Real>
+    <Real Name="Cell 13 5 2">1.0767938332131626</Real>
+    <Real Name="Cell 13 5 3">0.35208775991236324</Real>
+    <Real Name="Cell 13 5 4">0.00019964480947610265</Real>
+    <Real Name="Cell 13 6 1">0.011348824998598179</Real>
+    <Real Name="Cell 13 6 2">0.059570961223006459</Real>
+    <Real Name="Cell 13 6 3">0.019478386340909273</Real>
+    <Real Name="Cell 13 6 4">1.1044856347464868e-05</Real>
+    <Real Name="Cell 14 3 1">0.0023329094426695835</Real>
+    <Real Name="Cell 14 3 2">0.012245642871682449</Real>
+    <Real Name="Cell 14 3 3">0.0040040542900508591</Real>
+    <Real Name="Cell 14 3 4">2.2704244420997422e-06</Real>
+    <Real Name="Cell 14 4 1">0.070151314585142469</Real>
+    <Real Name="Cell 14 4 2">0.36823030061796208</Real>
+    <Real Name="Cell 14 4 3">0.12040316138286143</Real>
+    <Real Name="Cell 14 4 4">6.827237112867819e-05</Real>
+    <Real Name="Cell 14 5 1">0.080760010736188589</Real>
+    <Real Name="Cell 14 5 2">0.42391626168606278</Real>
+    <Real Name="Cell 14 5 3">0.13861123862688607</Real>
+    <Real Name="Cell 14 5 4">7.8596922351970562e-05</Real>
+    <Real Name="Cell 14 6 1">0.0044678482728482518</Real>
+    <Real Name="Cell 14 6 2">0.023452120923971892</Real>
+    <Real Name="Cell 14 6 3">0.0076683246751846198</Real>
+    <Real Name="Cell 14 6 4">4.3481807466388225e-06</Real>
+    <Real Name="Cell 15 3 1">5.6158281099030878e-06</Real>
+    <Real Name="Cell 15 3 2">2.9477966098818985e-05</Real>
+    <Real Name="Cell 15 3 3">9.6386427284183423e-06</Real>
+    <Real Name="Cell 15 3 4">5.4654129175131595e-09</Real>
+    <Real Name="Cell 15 4 1">0.00016886970286471379</Real>
+    <Real Name="Cell 15 4 2">0.00088641163489057938</Real>
+    <Real Name="Cell 15 4 3">0.00028983699317592336</Real>
+    <Real Name="Cell 15 4 4">1.6434667111443035e-07</Real>
+    <Real Name="Cell 15 5 1">0.00019440717678667242</Real>
+    <Real Name="Cell 15 5 2">0.001020460038044778</Real>
+    <Real Name="Cell 15 5 3">0.00033366785525056536</Real>
+    <Real Name="Cell 15 5 4">1.8920014545913153e-07</Real>
+    <Real Name="Cell 15 6 1">1.0755097245751444e-05</Real>
+    <Real Name="Cell 15 6 2">5.6454433040906165e-05</Real>
+    <Real Name="Cell 15 6 3">1.8459350577057324e-05</Real>
+    <Real Name="Cell 15 6 4">1.0467031088858332e-08</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_9.xml b/src/gromacs/ewald/tests/refdata/SaneInput1_PmeSplineAndSpreadTest_ReproducesOutputs_9.xml
new file mode 100644 (file)
index 0000000..d1b097e
--- /dev/null
@@ -0,0 +1,124 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">4</Int>
+      <Real>0.030364083489944928</Real>
+      <Real>0.51970853358992608</Real>
+      <Real>0.43638722596932222</Real>
+      <Real>0.013540156950806738</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">4</Int>
+      <Real>0.14989020738891354</Real>
+      <Real>0.66548034030144987</Real>
+      <Real>0.18462246078227332</Real>
+      <Real>6.9915273631839181e-06</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">4</Int>
+      <Real>0.00049190742688337704</Real>
+      <Real>0.24720014720028555</Real>
+      <Real>0.64756660362655571</Real>
+      <Real>0.10474134174627532</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">4</Int>
+      <Real>-0.16068584558358961</Real>
+      <Real>-0.58483900686824031</Real>
+      <Real>0.65173555048724963</Real>
+      <Real>0.093789301964580393</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">4</Int>
+      <Real>-0.46585741402556702</Real>
+      <Real>-0.06768152147521278</Real>
+      <Real>0.53293528502712662</Real>
+      <Real>0.00060365047365315571</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">4</Int>
+      <Real>-0.010287892660380538</Real>
+      <Real>-0.61257894232663535</Real>
+      <Real>0.25602156263441234</Real>
+      <Real>0.36684527235260356</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Int Name="X">14</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 14 5 0">1.1082098329049421e-05</Real>
+    <Real Name="Cell 14 5 1">0.0055691298575952257</Real>
+    <Real Name="Cell 14 5 2">0.014588917312076819</Real>
+    <Real Name="Cell 14 5 3">0.002359699782747918</Real>
+    <Real Name="Cell 14 6 0">4.9202137322650837e-05</Real>
+    <Real Name="Cell 14 6 1">0.024725740909806469</Real>
+    <Real Name="Cell 14 6 2">0.064771660714832549</Real>
+    <Real Name="Cell 14 6 3">0.010476560422375462</Real>
+    <Real Name="Cell 14 7 0">1.3650019569534291e-05</Real>
+    <Real Name="Cell 14 7 1">0.0068595972788100265</Real>
+    <Real Name="Cell 14 7 2">0.017969431500726232</Real>
+    <Real Name="Cell 14 7 3">0.0029064846075497453</Real>
+    <Real Name="Cell 14 8 0">5.1691698249511246e-10</Real>
+    <Real Name="Cell 14 8 1">2.5976829618678269e-07</Real>
+    <Real Name="Cell 14 8 2">6.8049018253714748e-07</Real>
+    <Real Name="Cell 14 8 3">1.1006660066307617e-07</Real>
+    <Real Name="Cell 15 5 0">0.00018968005649164056</Real>
+    <Real Name="Cell 15 5 1">0.095320654503573091</Real>
+    <Real Name="Cell 15 5 2">0.24970240993557094</Real>
+    <Real Name="Cell 15 5 3">0.040388379060098935</Real>
+    <Real Name="Cell 15 6 0">0.00084213872768176281</Real>
+    <Real Name="Cell 15 6 1">0.4232032412378034</Real>
+    <Real Name="Cell 15 6 2">1.108625090542817</Real>
+    <Real Name="Cell 15 6 3">0.17931573189034475</Real>
+    <Real Name="Cell 15 7 0">0.00023363233263094045</Real>
+    <Real Name="Cell 15 7 1">0.11740816231019631</Real>
+    <Real Name="Cell 15 7 2">0.30756294349472535</Real>
+    <Real Name="Cell 15 7 3">0.049747091948010899</Real>
+    <Real Name="Cell 15 8 0">8.8474979674333547e-09</Real>
+    <Real Name="Cell 15 8 1">4.4461674704949669e-06</Real>
+    <Real Name="Cell 15 8 2">1.1647200054822518e-05</Real>
+    <Real Name="Cell 15 8 3">1.8838886293662687e-06</Real>
+    <Real Name="Cell 16 5 0">0.00015926995291442304</Real>
+    <Real Name="Cell 16 5 1">0.080038547200797311</Real>
+    <Real Name="Cell 16 5 2">0.20966933376471794</Real>
+    <Real Name="Cell 16 5 3">0.033913187027521378</Real>
+    <Real Name="Cell 16 6 0">0.0007071243966610566</Real>
+    <Real Name="Cell 16 6 1">0.35535396578789352</Real>
+    <Real Name="Cell 16 6 2">0.93088682719937987</Real>
+    <Real Name="Cell 16 6 3">0.15056726944959112</Real>
+    <Real Name="Cell 16 7 0">0.00019617566182587374</Real>
+    <Real Name="Cell 16 7 1">0.098584916246785378</Real>
+    <Real Name="Cell 16 7 2">0.25825348449738106</Real>
+    <Real Name="Cell 16 7 3">0.041771481613505086</Real>
+    <Real Name="Cell 16 8 0">7.4290392503424114e-09</Real>
+    <Real Name="Cell 16 8 1">3.7333439095985362e-06</Real>
+    <Real Name="Cell 16 8 2">9.7798842884581363e-06</Real>
+    <Real Name="Cell 16 8 3">1.5818576757351712e-06</Real>
+    <Real Name="Cell 17 5 0">4.9418040485000138e-06</Real>
+    <Real Name="Cell 17 5 1">0.0024834239563408639</Real>
+    <Real Name="Cell 17 5 2">0.0065055884269741224</Real>
+    <Real Name="Cell 17 5 3">0.0010522532460356282</Real>
+    <Real Name="Cell 17 6 0">2.1940549000415319e-05</Real>
+    <Real Name="Cell 17 6 1">0.011025869190309286</Real>
+    <Real Name="Cell 17 6 2">0.02888341590595549</Real>
+    <Real Name="Cell 17 6 3">0.0046717785001002578</Real>
+    <Real Name="Cell 17 7 0">6.0869088116650081e-06</Real>
+    <Real Name="Cell 17 7 1">0.0030588778945088799</Real>
+    <Real Name="Cell 17 7 2">0.008013050119466826</Real>
+    <Real Name="Cell 17 7 3">0.0012960792238092631</Real>
+    <Real Name="Cell 17 8 0">2.3050710803897667e-10</Real>
+    <Real Name="Cell 17 8 1">1.158376310741421e-07</Real>
+    <Real Name="Cell 17 8 2">3.0344877289272717e-07</Real>
+    <Real Name="Cell 17 8 3">4.9081641094595856e-08</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_0.xml b/src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_0.xml
new file mode 100644 (file)
index 0000000..90a1962
--- /dev/null
@@ -0,0 +1,116 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">6</Int>
+      <Real>0.5</Real>
+      <Real>0.5</Real>
+      <Real>0</Real>
+      <Real>0.43431199655580521</Real>
+      <Real>0.5633760031929016</Real>
+      <Real>0.0023120002512931892</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">6</Int>
+      <Real>0.080000067318198045</Real>
+      <Real>0.74000003365906364</Real>
+      <Real>0.17999989902273833</Real>
+      <Real>0.015570977931379222</Real>
+      <Real>0.64532887986586396</Real>
+      <Real>0.3391001422027568</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">6</Int>
+      <Real>0.10580000383853916</Real>
+      <Real>0.74840000066757195</Real>
+      <Real>0.14579999549388889</Real>
+      <Real>0.10580000383853916</Real>
+      <Real>0.74840000066757195</Real>
+      <Real>0.14579999549388889</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">6</Int>
+      <Real>-1</Real>
+      <Real>1</Real>
+      <Real>0</Real>
+      <Real>-0.93199999630451202</Real>
+      <Real>0.86399999260902405</Real>
+      <Real>0.068000003695487976</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">6</Int>
+      <Real>-0.4000001682954597</Real>
+      <Real>-0.1999996634090806</Real>
+      <Real>0.5999998317045403</Real>
+      <Real>-0.17647083572862243</Real>
+      <Real>-0.64705832854275513</Real>
+      <Real>0.82352916427137757</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">6</Int>
+      <Real>-0.46000000834465027</Real>
+      <Real>-0.079999983310699463</Real>
+      <Real>0.53999999165534973</Real>
+      <Real>-0.46000000834465027</Real>
+      <Real>-0.079999983310699463</Real>
+      <Real>0.53999999165534973</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 3 1">0.01316153110868244</Real>
+    <Real Name="Cell 0 3 2">0.093101035284992792</Real>
+    <Real Name="Cell 0 3 3">0.018137534089952206</Real>
+    <Real Name="Cell 0 4 1">0.12174406584798354</Real>
+    <Real Name="Cell 0 4 2">0.86118389089050773</Real>
+    <Real Name="Cell 0 4 3">0.16777205678680626</Real>
+    <Real Name="Cell 0 5 1">0.032453897671338813</Real>
+    <Real Name="Cell 0 5 2">0.22956990697242161</Real>
+    <Real Name="Cell 0 5 3">0.044723799268112249</Real>
+    <Real Name="Cell 0 6 1">0.11772240343026551</Real>
+    <Real Name="Cell 0 6 2">0.83273576190274157</Real>
+    <Real Name="Cell 0 6 3">0.1622299174568676</Real>
+    <Real Name="Cell 0 7 1">0.061859440959702472</Real>
+    <Real Name="Cell 0 7 2">0.43757659712553931</Real>
+    <Real Name="Cell 0 7 3">0.085246747504311229</Real>
+    <Real Name="Cell 1 3 1">0.01316153110868244</Real>
+    <Real Name="Cell 1 3 2">0.093101035284992792</Real>
+    <Real Name="Cell 1 3 3">0.018137534089952206</Real>
+    <Real Name="Cell 1 4 1">0.12174406584798354</Real>
+    <Real Name="Cell 1 4 2">0.86118389089050773</Real>
+    <Real Name="Cell 1 4 3">0.16777205678680626</Real>
+    <Real Name="Cell 1 5 1">0.033298004134634109</Real>
+    <Real Name="Cell 1 5 2">0.23554088291546391</Real>
+    <Real Name="Cell 1 5 3">0.045887038531625263</Real>
+    <Real Name="Cell 1 6 1">0.15270583740894556</Real>
+    <Real Name="Cell 1 6 2">1.0801989099471756</Real>
+    <Real Name="Cell 1 6 3">0.21043959922811106</Real>
+    <Real Name="Cell 1 7 1">0.080242141326958519</Real>
+    <Real Name="Cell 1 7 2">0.5676107414354169</Real>
+    <Real Name="Cell 1 7 3">0.11057942740479287</Real>
+    <Real Name="Cell 2 5 1">1.51209807142001e-05</Real>
+    <Real Name="Cell 2 5 2">0.00010696164051063565</Real>
+    <Real Name="Cell 2 5 3">2.0837796219346491e-05</Real>
+    <Real Name="Cell 2 6 1">0.00062667904288165363</Real>
+    <Real Name="Cell 2 6 2">0.0044329544337893545</Real>
+    <Real Name="Cell 2 6 3">0.0008636086797094893</Real>
+    <Real Name="Cell 2 7 1">0.00032930023618473001</Real>
+    <Real Name="Cell 2 7 2">0.0023293789039609777</Real>
+    <Real Name="Cell 2 7 3">0.00045379934981043112</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_1.xml b/src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_1.xml
new file mode 100644 (file)
index 0000000..836e967
--- /dev/null
@@ -0,0 +1,122 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">6</Int>
+      <Real>0.5</Real>
+      <Real>0.5</Real>
+      <Real>0</Real>
+      <Real>0.42251027721597068</Real>
+      <Real>0.57422944117966668</Real>
+      <Real>0.0032602816043626613</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">6</Int>
+      <Real>0.40500021457674196</Real>
+      <Real>0.58999980926508666</Real>
+      <Real>0.0049999761581713646</Real>
+      <Real>0.28125026296171923</Real>
+      <Real>0.68749982469210524</Real>
+      <Real>0.031249912346175537</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">6</Int>
+      <Real>0.31205000517964365</Real>
+      <Real>0.66589999619722362</Real>
+      <Real>0.022049998623132727</Real>
+      <Real>0.31205000517964365</Real>
+      <Real>0.66589999619722362</Real>
+      <Real>0.022049998623132727</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">6</Int>
+      <Real>-1</Real>
+      <Real>1</Real>
+      <Real>0</Real>
+      <Real>-0.91924999561160803</Real>
+      <Real>0.83849999122321606</Real>
+      <Real>0.080750004388391972</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">6</Int>
+      <Real>-0.90000023841857058</Real>
+      <Real>0.80000047683714115</Real>
+      <Real>0.099999761581429425</Real>
+      <Real>-0.75000035061554371</Real>
+      <Real>0.50000070123108742</Real>
+      <Real>0.24999964938445629</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">6</Int>
+      <Real>-0.79000000655651093</Real>
+      <Real>0.58000001311302185</Real>
+      <Real>0.20999999344348907</Real>
+      <Real>-0.79000000655651093</Real>
+      <Real>0.58000001311302185</Real>
+      <Real>0.20999999344348907</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">8</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 10 1">0.016356891948842441</Real>
+    <Real Name="Cell 0 10 2">0.034904836102348874</Real>
+    <Real Name="Cell 0 10 3">0.0011558065661401713</Real>
+    <Real Name="Cell 0 5 1">0.19652138950383574</Real>
+    <Real Name="Cell 0 5 2">0.41936737814806518</Real>
+    <Real Name="Cell 0 5 3">0.013886544771826166</Real>
+    <Real Name="Cell 0 6 1">0.28629017504335769</Real>
+    <Real Name="Cell 0 6 2">0.61092973340258316</Real>
+    <Real Name="Cell 0 6 3">0.020229764014547336</Real>
+    <Real Name="Cell 0 7 1">0.0024261771394782738</Real>
+    <Real Name="Cell 0 7 2">0.0051773476081895782</Real>
+    <Real Name="Cell 0 7 3">0.00017143791602943349</Real>
+    <Real Name="Cell 0 8 1">0.14721257809900301</Real>
+    <Real Name="Cell 0 8 2">0.31414469978898246</Real>
+    <Real Name="Cell 0 8 3">0.010402297998752245</Real>
+    <Real Name="Cell 0 9 1">0.35985254047322562</Real>
+    <Real Name="Cell 0 9 2">0.76790835236401411</Real>
+    <Real Name="Cell 0 9 3">0.025427809294210697</Real>
+    <Real Name="Cell 1 10 1">0.022230486285707198</Real>
+    <Real Name="Cell 1 10 2">0.047438809445277126</Real>
+    <Real Name="Cell 1 10 3">0.001570845005143398</Real>
+    <Real Name="Cell 1 5 1">0.19652138950383574</Real>
+    <Real Name="Cell 1 5 2">0.41936737814806518</Real>
+    <Real Name="Cell 1 5 3">0.013886544771826166</Real>
+    <Real Name="Cell 1 6 1">0.28629017504335769</Real>
+    <Real Name="Cell 1 6 2">0.61092973340258316</Real>
+    <Real Name="Cell 1 6 3">0.020229764014547336</Real>
+    <Real Name="Cell 1 7 1">0.0024261771394782738</Real>
+    <Real Name="Cell 1 7 2">0.0051773476081895782</Real>
+    <Real Name="Cell 1 7 3">0.00017143791602943349</Real>
+    <Real Name="Cell 1 8 1">0.20007512483110124</Real>
+    <Real Name="Cell 1 8 2">0.42695088175848722</Real>
+    <Real Name="Cell 1 8 3">0.014137657919631024</Real>
+    <Real Name="Cell 1 9 1">0.48907194538465282</Real>
+    <Real Name="Cell 1 9 2">1.0436564690467567</Real>
+    <Real Name="Cell 1 9 3">0.034558678235355876</Real>
+    <Real Name="Cell 2 10 1">0.00012621722310934347</Real>
+    <Real Name="Cell 2 10 2">0.00026934160228630805</Real>
+    <Real Name="Cell 2 10 3">8.9187295291806413e-06</Real>
+    <Real Name="Cell 2 8 1">0.0011359592563511709</Real>
+    <Real Name="Cell 2 8 2">0.0024240834863917867</Real>
+    <Real Name="Cell 2 8 3">8.0268865959666954e-05</Real>
+    <Real Name="Cell 2 9 1">0.0027767859890147082</Real>
+    <Real Name="Cell 2 9 2">0.0059255303599848172</Real>
+    <Real Name="Cell 2 9 3">0.00019621254997018896</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_10.xml b/src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_10.xml
new file mode 100644 (file)
index 0000000..c144644
--- /dev/null
@@ -0,0 +1,351 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">10</Int>
+      <Real>0.0044864524938991648</Real>
+      <Real>0.23255589436182172</Real>
+      <Real>0.59564989873306362</Real>
+      <Real>0.16592043459990793</Real>
+      <Real>0.0013873198113074732</Real>
+      <Real>8.1720113811712452e-07</Real>
+      <Real>0.053911011090761712</Real>
+      <Real>0.49035772206459577</Real>
+      <Real>0.42409626041193482</Real>
+      <Real>0.031634189231569541</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">10</Int>
+      <Real>8.6954037185588164e-06</Real>
+      <Real>0.065564778558807185</Real>
+      <Real>0.51400178637626759</Real>
+      <Real>0.39545922310468573</Real>
+      <Real>0.024965516556520795</Real>
+      <Real>0.00024279846432818689</Real>
+      <Real>0.1093428100092559</Real>
+      <Real>0.56830548647196055</Real>
+      <Real>0.31067884836151949</Real>
+      <Real>0.011430056692935849</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">10</Int>
+      <Real>0.013011542449021224</Real>
+      <Real>0.32353820593028937</Real>
+      <Real>0.56159920103377459</Real>
+      <Real>0.10168179137308819</Real>
+      <Real>0.00016925921382653379</Real>
+      <Real>0.013011542449021224</Real>
+      <Real>0.32353820593028937</Real>
+      <Real>0.56159920103377459</Real>
+      <Real>0.10168179137308819</Real>
+      <Real>0.00016925921382653379</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">10</Int>
+      <Real>-0.03132813098882218</Real>
+      <Real>-0.49184024359641992</Real>
+      <Real>0.090655791595095681</Real>
+      <Real>0.41952167155435716</Real>
+      <Real>0.012990911435789263</Real>
+      <Real>-4.9119496114044609e-05</Real>
+      <Real>-0.20195851058360476</Real>
+      <Real>-0.46037775789046542</Real>
+      <Real>0.52682752551620138</Real>
+      <Real>0.13555786245398288</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">10</Int>
+      <Real>-0.00028938398568676441</Real>
+      <Real>-0.23282813529132843</Real>
+      <Real>-0.41997120336041105</Real>
+      <Real>0.53958434853755444</Real>
+      <Real>0.11350437409987174</Real>
+      <Real>-0.0035151319538936445</Real>
+      <Real>-0.32891879020819559</Real>
+      <Real>-0.26844228284257243</Real>
+      <Real>0.53770146412530617</Real>
+      <Real>0.063174740879355443</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">10</Int>
+      <Real>-0.069623165976186063</Real>
+      <Real>-0.54135325243356403</Real>
+      <Real>0.29425777213021775</Real>
+      <Real>0.31403687694500071</Real>
+      <Real>0.0026817693345315848</Real>
+      <Real>-0.069623165976186063</Real>
+      <Real>-0.54135325243356403</Real>
+      <Real>0.29425777213021775</Real>
+      <Real>0.31403687694500071</Real>
+      <Real>0.0026817693345315848</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Int Name="X">4</Int>
+      <Int Name="Y">2</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">15</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 4 0">6.7614945975548057e-07</Real>
+    <Real Name="Cell 0 4 1">1.6812778654576693e-05</Real>
+    <Real Name="Cell 0 4 2">2.9183703459128362e-05</Real>
+    <Real Name="Cell 0 4 3">5.283930677185383e-06</Real>
+    <Real Name="Cell 0 4 4">8.7956156186584266e-09</Real>
+    <Real Name="Cell 0 5 0">0.00030449979212377425</Real>
+    <Real Name="Cell 0 5 1">0.0075715324940036468</Real>
+    <Real Name="Cell 0 5 2">0.013142703153116627</Real>
+    <Real Name="Cell 0 5 3">0.0023795860065927402</Real>
+    <Real Name="Cell 0 5 4">3.961051937319697e-06</Real>
+    <Real Name="Cell 0 6 0">0.0015826271748353986</Real>
+    <Real Name="Cell 0 6 1">0.039352779181171159</Real>
+    <Real Name="Cell 0 6 2">0.068308746668905393</Real>
+    <Real Name="Cell 0 6 3">0.012367816255719805</Real>
+    <Real Name="Cell 0 6 4">2.0587430924709335e-05</Real>
+    <Real Name="Cell 0 7 0">0.00086518395434805658</Real>
+    <Real Name="Cell 0 7 1">0.021513211480203888</Real>
+    <Real Name="Cell 0 7 2">0.037342737758632179</Real>
+    <Real Name="Cell 0 7 3">0.006761185669572959</Real>
+    <Real Name="Cell 0 7 4">1.125464997728225e-05</Real>
+    <Real Name="Cell 0 8 0">3.1830624132188476e-05</Real>
+    <Real Name="Cell 0 8 1">0.00079148364352024376</Real>
+    <Real Name="Cell 0 8 2">0.001373861181414978</Real>
+    <Real Name="Cell 0 8 3">0.00024874797857096824</Real>
+    <Real Name="Cell 0 8 4">4.1406516078556029e-07</Real>
+    <Real Name="Cell 1 4 0">6.1500443444237396e-06</Real>
+    <Real Name="Cell 1 4 1">0.00015292378450767436</Real>
+    <Real Name="Cell 1 4 2">0.00026544585345532714</Real>
+    <Real Name="Cell 1 4 3">4.8060983424142505e-05</Real>
+    <Real Name="Cell 1 4 4">8.0002173056261036e-08</Real>
+    <Real Name="Cell 1 5 0">0.0027696350228635126</Real>
+    <Real Name="Cell 1 5 1">0.068868295199418381</Real>
+    <Real Name="Cell 1 5 2">0.11954192380260908</Real>
+    <Real Name="Cell 1 5 3">0.021643971241518001</Real>
+    <Real Name="Cell 1 5 4">3.6028491502295021e-05</Real>
+    <Real Name="Cell 1 6 0">0.014395082574565158</Real>
+    <Real Name="Cell 1 6 1">0.35794059072093531</Real>
+    <Real Name="Cell 1 6 2">0.62131502889568113</Real>
+    <Real Name="Cell 1 6 3">0.11249379455818613</Real>
+    <Real Name="Cell 1 6 4">0.00018725684284434833</Real>
+    <Real Name="Cell 1 7 0">0.0078694430773466328</Real>
+    <Real Name="Cell 1 7 1">0.19567745368319411</Real>
+    <Real Name="Cell 1 7 2">0.33965788161810795</Real>
+    <Real Name="Cell 1 7 3">0.061497633531783606</Real>
+    <Real Name="Cell 1 7 4">0.00010236878169847925</Real>
+    <Real Name="Cell 1 8 0">0.00028952141734230941</Real>
+    <Real Name="Cell 1 8 1">0.0071990880644878241</Real>
+    <Real Name="Cell 1 8 2">0.012496212289868676</Real>
+    <Real Name="Cell 1 8 3">0.0022625339364324188</Real>
+    <Real Name="Cell 1 8 4">3.766207402181542e-06</Real>
+    <Real Name="Cell 15 4 0">1.0249299667543124e-11</Real>
+    <Real Name="Cell 15 4 1">2.5485372233698999e-10</Real>
+    <Real Name="Cell 15 4 2">4.423763383165181e-10</Real>
+    <Real Name="Cell 15 4 3">8.009558855904725e-11</Real>
+    <Real Name="Cell 15 4 4">1.3332688348039785e-13</Real>
+    <Real Name="Cell 15 5 0">4.6157096972461982e-09</Real>
+    <Real Name="Cell 15 5 1">1.1477182204900004e-07</Real>
+    <Real Name="Cell 15 5 2">1.9922149032932706e-07</Real>
+    <Real Name="Cell 15 5 3">3.6070560605167372e-08</Real>
+    <Real Name="Cell 15 5 4">6.0042950147403033e-11</Real>
+    <Real Name="Cell 15 6 0">2.3989992068841083e-08</Real>
+    <Real Name="Cell 15 6 1">5.9652258943508866e-07</Real>
+    <Real Name="Cell 15 6 2">1.0354468297247273e-06</Real>
+    <Real Name="Cell 15 6 3">1.8747549555659604e-07</Real>
+    <Real Name="Cell 15 6 4">3.120711639827352e-10</Real>
+    <Real Name="Cell 15 7 0">1.311474776430346e-08</Real>
+    <Real Name="Cell 15 7 1">3.2610445529539798e-07</Real>
+    <Real Name="Cell 15 7 2">5.6605370923924125e-07</Real>
+    <Real Name="Cell 15 7 3">1.0248831384175304e-07</Real>
+    <Real Name="Cell 15 7 4">1.7060174877931372e-10</Real>
+    <Real Name="Cell 15 8 0">4.8249924721334526e-10</Real>
+    <Real Name="Cell 15 8 1">1.1997573801702798e-08</Real>
+    <Real Name="Cell 15 8 2">2.0825447313112048e-08</Real>
+    <Real Name="Cell 15 8 3">3.770605059702976e-09</Real>
+    <Real Name="Cell 15 8 4">6.2765382025378959e-12</Real>
+    <Real Name="Cell 2 4 0">5.3189960930075703e-06</Real>
+    <Real Name="Cell 2 4 1">0.00013225937355423531</Real>
+    <Real Name="Cell 2 4 2">0.00022957646780451645</Real>
+    <Real Name="Cell 2 4 3">4.1566559319348901e-05</Real>
+    <Real Name="Cell 2 4 4">6.9191573602912018e-08</Real>
+    <Real Name="Cell 2 5 0">0.0023953775030947878</Real>
+    <Real Name="Cell 2 5 1">0.059562203552228493</Real>
+    <Real Name="Cell 2 5 2">0.10338836438361731</Real>
+    <Real Name="Cell 2 5 3">0.01871924689050183</Real>
+    <Real Name="Cell 2 5 4">3.1160003864268063e-05</Real>
+    <Real Name="Cell 2 6 0">0.012449892014527874</Real>
+    <Real Name="Cell 2 6 1">0.30957250012347204</Real>
+    <Real Name="Cell 2 6 2">0.53735746055546063</Real>
+    <Real Name="Cell 2 6 3">0.097292640545773856</Real>
+    <Real Name="Cell 2 6 4">0.00016195304614040934</Real>
+    <Real Name="Cell 2 7 0">0.0068060544995101604</Real>
+    <Real Name="Cell 2 7 1">0.16923578975073281</Real>
+    <Real Name="Cell 2 7 2">0.29376031197629132</Real>
+    <Real Name="Cell 2 7 3">0.053187530717783496</Real>
+    <Real Name="Cell 2 7 4">8.8535808752965279e-05</Real>
+    <Real Name="Cell 2 8 0">0.00025039872908917264</Real>
+    <Real Name="Cell 2 8 1">0.0062262837702865594</Real>
+    <Real Name="Cell 2 8 2">0.010807613835739371</Real>
+    <Real Name="Cell 2 8 3">0.0019568003894301516</Real>
+    <Real Name="Cell 2 8 4">3.257284230124825e-06</Real>
+    <Real Name="Cell 3 4 0">3.9675456879705457e-07</Real>
+    <Real Name="Cell 3 4 1">9.8654914961984932e-06</Real>
+    <Real Name="Cell 3 4 2">1.7124568414230297e-05</Real>
+    <Real Name="Cell 3 4 3">3.1005328883030617e-06</Real>
+    <Real Name="Cell 3 4 4">5.1611380172476373e-09</Real>
+    <Real Name="Cell 3 5 0">0.00017867600421739681</Real>
+    <Real Name="Cell 3 5 1">0.0044428640242908284</Real>
+    <Real Name="Cell 3 5 2">0.0077119451137743975</Real>
+    <Real Name="Cell 3 5 3">0.0013963061070885595</Real>
+    <Real Name="Cell 3 5 4">2.3242870798748365e-06</Real>
+    <Real Name="Cell 3 6 0">0.00092866237376776914</Real>
+    <Real Name="Cell 3 6 1">0.023091632640862603</Real>
+    <Real Name="Cell 3 6 2">0.040082568933042947</Real>
+    <Real Name="Cell 3 6 3">0.0072572528672489841</Real>
+    <Real Name="Cell 3 6 4">1.2080401990006903e-05</Real>
+    <Real Name="Cell 3 7 0">0.00050767723287338073</Real>
+    <Real Name="Cell 3 7 1">0.012623636418129892</Real>
+    <Real Name="Cell 3 7 2">0.02191216986623867</Real>
+    <Real Name="Cell 3 7 3">0.0039673644135696587</Real>
+    <Real Name="Cell 3 7 4">6.6040632500293949e-06</Real>
+    <Real Name="Cell 3 8 0">1.8677742575842075e-05</Real>
+    <Real Name="Cell 3 8 1">0.00046443097330634318</Real>
+    <Real Name="Cell 3 8 2">0.00080616155608026908</Real>
+    <Real Name="Cell 3 8 3">0.00014596165914671283</Real>
+    <Real Name="Cell 3 8 4">2.4296735278139286e-07</Real>
+    <Real Name="Cell 4 2 0">1.5786359234655713e-09</Real>
+    <Real Name="Cell 4 2 1">3.9253534813128706e-08</Real>
+    <Real Name="Cell 4 2 2">6.8136477809221614e-08</Real>
+    <Real Name="Cell 4 2 3">1.2336625673150951e-08</Real>
+    <Real Name="Cell 4 2 4">2.053551117179089e-11</Real>
+    <Real Name="Cell 4 3 0">1.1903175297782832e-05</Real>
+    <Real Name="Cell 4 3 1">0.00029597812832775193</Real>
+    <Real Name="Cell 4 3 2">0.00051376028347067005</Real>
+    <Real Name="Cell 4 3 3">9.3020192805619046e-05</Real>
+    <Real Name="Cell 4 3 4">1.5484114207333613e-07</Real>
+    <Real Name="Cell 4 4 0">9.3316160003843764e-05</Real>
+    <Real Name="Cell 4 4 1">0.0023203508046979121</Real>
+    <Real Name="Cell 4 4 2">0.0040276762810423543</Real>
+    <Real Name="Cell 4 4 3">0.00072924131404284993</Real>
+    <Real Name="Cell 4 4 4">1.2138929678356282e-06</Real>
+    <Real Name="Cell 4 5 0">7.1794956975535651e-05</Real>
+    <Real Name="Cell 4 5 1">0.0017852158316906115</Real>
+    <Real Name="Cell 4 5 2">0.0030987863763029927</Real>
+    <Real Name="Cell 4 5 3">0.0005610587572863362</Real>
+    <Real Name="Cell 4 5 4">9.3393677359928201e-07</Real>
+    <Real Name="Cell 4 6 0">4.5324475504088847e-06</Real>
+    <Real Name="Cell 4 6 1">0.00011270146907469336</Real>
+    <Real Name="Cell 4 6 2">0.00019562776150560031</Real>
+    <Real Name="Cell 4 6 3">3.5419888766900883e-05</Real>
+    <Real Name="Cell 4 6 4">5.8959843700153721e-08</Real>
+    <Real Name="Cell 5 2 0">8.1828814537200707e-08</Real>
+    <Real Name="Cell 5 2 1">2.0347124833581762e-06</Real>
+    <Real Name="Cell 5 2 2">3.5318638851375948e-06</Real>
+    <Real Name="Cell 5 2 3">6.3947072229739122e-07</Real>
+    <Real Name="Cell 5 2 4">1.0644611022243331e-09</Real>
+    <Real Name="Cell 5 3 0">0.00061700276128760138</Real>
+    <Real Name="Cell 5 3 1">0.015342067800427581</Real>
+    <Real Name="Cell 5 3 2">0.026630836361819295</Real>
+    <Real Name="Cell 5 3 3">0.0048217147425580276</Real>
+    <Real Name="Cell 5 3 4">8.026212319831134e-06</Real>
+    <Real Name="Cell 5 4 0">0.0048370562437950312</Real>
+    <Real Name="Cell 5 4 1">0.12027570945050192</Real>
+    <Real Name="Cell 5 4 2">0.20877516501320445</Real>
+    <Real Name="Cell 5 4 3">0.037800325808294781</Real>
+    <Real Name="Cell 5 4 4">6.2922312267525238e-05</Real>
+    <Real Name="Cell 5 5 0">0.0037215016659194488</Real>
+    <Real Name="Cell 5 5 1">0.092536913058200457</Real>
+    <Real Name="Cell 5 5 2">0.16062602650029709</Real>
+    <Real Name="Cell 5 5 3">0.029082559386883981</Real>
+    <Real Name="Cell 5 5 4">4.8410743668214756e-05</Real>
+    <Real Name="Cell 5 6 0">0.00023494005456799487</Real>
+    <Real Name="Cell 5 6 1">0.0058418964587715928</Real>
+    <Real Name="Cell 5 6 2">0.010140392459476816</Real>
+    <Real Name="Cell 5 6 3">0.0018359949027843226</Real>
+    <Real Name="Cell 5 6 4">3.0561917688346847e-06</Real>
+    <Real Name="Cell 6 2 0">2.0958972132822456e-07</Real>
+    <Real Name="Cell 6 2 1">5.2115483376118884e-06</Real>
+    <Real Name="Cell 6 2 2">9.0462311062649314e-06</Real>
+    <Real Name="Cell 6 2 3">1.6378886977879666e-06</Real>
+    <Real Name="Cell 6 2 4">2.7264247568747047e-09</Real>
+    <Real Name="Cell 6 3 0">0.0015803410757982278</Real>
+    <Real Name="Cell 6 3 1">0.039295934238769981</Real>
+    <Real Name="Cell 6 3 2">0.068210074939724225</Real>
+    <Real Name="Cell 6 3 3">0.012349950991377274</Real>
+    <Real Name="Cell 6 3 4">2.0557692457707663e-05</Real>
+    <Real Name="Cell 6 4 0">0.012389245474466216</Real>
+    <Real Name="Cell 6 4 1">0.30806449499308075</Real>
+    <Real Name="Cell 6 4 2">0.53473985787095712</Real>
+    <Real Name="Cell 6 4 3">0.096818703742492476</Real>
+    <Real Name="Cell 6 4 4">0.00016116413231775123</Real>
+    <Real Name="Cell 6 5 0">0.0095319540127027664</Real>
+    <Real Name="Cell 6 5 1">0.23701658065234701</Real>
+    <Real Name="Cell 6 5 2">0.41141454049725196</Real>
+    <Real Name="Cell 6 5 3">0.074489720422840591</Real>
+    <Real Name="Cell 6 5 4">0.00012399537170492097</Real>
+    <Real Name="Cell 6 6 0">0.00060175649426472068</Real>
+    <Real Name="Cell 6 6 1">0.014962962102617864</Real>
+    <Real Name="Cell 6 6 2">0.025972782836471003</Real>
+    <Real Name="Cell 6 6 3">0.004702569164797909</Real>
+    <Real Name="Cell 6 6 4">7.827882938038561e-06</Real>
+    <Real Name="Cell 7 2 0">5.8381975258316781e-08</Real>
+    <Real Name="Cell 7 2 1">1.4516956469802116e-06</Real>
+    <Real Name="Cell 7 2 2">2.5198604076575621e-06</Real>
+    <Real Name="Cell 7 2 3">4.5623982332790372e-07</Real>
+    <Real Name="Cell 7 2 4">7.5945548136041175e-10</Real>
+    <Real Name="Cell 7 3 0">0.00044020972499155241</Real>
+    <Real Name="Cell 7 3 1">0.010946024671160078</Real>
+    <Real Name="Cell 7 3 2">0.019000163186736588</Real>
+    <Real Name="Cell 7 3 3">0.0034401235358812263</Real>
+    <Real Name="Cell 7 3 4">5.726419620332537e-06</Real>
+    <Real Name="Cell 7 4 0">0.0034510691563293511</Real>
+    <Real Name="Cell 7 4 1">0.085812479785142365</Real>
+    <Real Name="Cell 7 4 2">0.14895372232003581</Real>
+    <Real Name="Cell 7 4 3">0.026969200257604922</Real>
+    <Real Name="Cell 7 4 4">4.4892852215629916e-05</Real>
+    <Real Name="Cell 7 5 0">0.0026551602807922885</Real>
+    <Real Name="Cell 7 5 1">0.066021826164777322</Real>
+    <Real Name="Cell 7 5 2">0.11460100892356005</Real>
+    <Real Name="Cell 7 5 3">0.020749381158414522</Real>
+    <Real Name="Cell 7 5 4">3.4539359454969746e-05</Real>
+    <Real Name="Cell 7 6 0">0.00016762144888144058</Real>
+    <Real Name="Cell 7 6 1">0.0041679872358727551</Real>
+    <Real Name="Cell 7 6 2">0.0072348126393748172</Real>
+    <Real Name="Cell 7 6 3">0.0013099176566956151</Real>
+    <Real Name="Cell 7 6 4">2.1804851169102829e-06</Real>
+    <Real Name="Cell 8 2 0">4.8815247557922276e-10</Real>
+    <Real Name="Cell 8 2 1">1.2138144020059024e-08</Real>
+    <Real Name="Cell 8 2 2">2.1069449785991587e-08</Real>
+    <Real Name="Cell 8 2 3">3.8147835565672601e-09</Real>
+    <Real Name="Cell 8 2 4">6.3500775997722537e-12</Real>
+    <Real Name="Cell 8 3 0">3.6807501986336657e-06</Real>
+    <Real Name="Cell 8 3 1">9.1523608396871779e-05</Real>
+    <Real Name="Cell 8 3 2">0.00015886712731072626</Real>
+    <Real Name="Cell 8 3 3">2.8764097358962612e-05</Real>
+    <Real Name="Cell 8 3 4">4.7880632703884907e-08</Real>
+    <Real Name="Cell 8 4 0">2.8855617587506811e-05</Real>
+    <Real Name="Cell 8 4 1">0.0007175086875249551</Real>
+    <Real Name="Cell 8 4 2">0.0012454550908143085</Real>
+    <Real Name="Cell 8 4 3">0.00022549908275441971</Real>
+    <Real Name="Cell 8 4 4">3.7536511650914242e-07</Real>
+    <Real Name="Cell 8 5 0">2.2200740183824827e-05</Real>
+    <Real Name="Cell 8 5 1">0.0005520319883319816</Real>
+    <Real Name="Cell 8 5 2">0.00095821982662265526</Real>
+    <Real Name="Cell 8 5 3">0.00017349296138749657</Real>
+    <Real Name="Cell 8 5 4">2.8879587832140487e-07</Real>
+    <Real Name="Cell 8 6 0">1.4015425971733469e-06</Real>
+    <Real Name="Cell 8 6 1">3.4850024829950365e-05</Real>
+    <Real Name="Cell 8 6 2">6.0492843632582693e-05</Real>
+    <Real Name="Cell 8 6 3">1.0952687778918683e-05</Real>
+    <Real Name="Cell 8 6 4">1.8231812183020921e-08</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_11.xml b/src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_11.xml
new file mode 100644 (file)
index 0000000..686b6a8
--- /dev/null
@@ -0,0 +1,351 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">10</Int>
+      <Real>0.012680492607976912</Real>
+      <Real>0.32094073925313427</Real>
+      <Real>0.56299959840307168</Real>
+      <Real>0.10319666359097672</Real>
+      <Real>0.00018250614484040877</Real>
+      <Real>1.6250376818931188e-06</Real>
+      <Real>0.056474647330642905</Real>
+      <Real>0.49604793417672399</Real>
+      <Real>0.41749944736272515</Real>
+      <Real>0.029976346092225929</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">10</Int>
+      <Real>0.029885006865026001</Real>
+      <Real>0.41712679291586424</Real>
+      <Real>0.49636495411809156</Real>
+      <Real>0.056621562516519237</Real>
+      <Real>1.6835844989861392e-06</Real>
+      <Real>0.00037533948339706124</Real>
+      <Real>0.12011256810581823</Real>
+      <Real>0.5762759369960514</Real>
+      <Real>0.29368577777675831</Real>
+      <Real>0.0095503776379748471</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">10</Int>
+      <Real>0.017206987782729517</Real>
+      <Real>0.352960679890503</Real>
+      <Real>0.54416152671166218</Real>
+      <Real>0.085606298010210635</Real>
+      <Real>6.4507604894689253e-05</Real>
+      <Real>0.017206987782729517</Real>
+      <Real>0.352960679890503</Real>
+      <Real>0.54416152671166218</Real>
+      <Real>0.085606298010210635</Real>
+      <Real>6.4507604894689253e-05</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">10</Int>
+      <Real>-0.068290339976017453</Real>
+      <Real>-0.5407067209453843</Real>
+      <Real>0.28912215410382691</Real>
+      <Real>0.31703721453256878</Real>
+      <Real>0.0028376922850060237</Real>
+      <Real>-8.2253570274950675e-05</Real>
+      <Real>-0.20897306651756287</Real>
+      <Real>-0.45161303688449128</Real>
+      <Real>0.53047428760277104</Real>
+      <Real>0.13019406936955807</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">10</Int>
+      <Real>-0.12989642566818113</Real>
+      <Real>-0.5306670662362496</Real>
+      <Real>0.45110787575743655</Real>
+      <Real>0.20937114986660027</Real>
+      <Real>8.4466280393928373e-05</Real>
+      <Real>-0.0048733249390969704</Real>
+      <Real>-0.34866735478088184</Real>
+      <Real>-0.23283470004267681</Real>
+      <Real>0.53116476418438718</Real>
+      <Real>0.055210615578268486</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">10</Int>
+      <Real>-0.08585899856030095</Real>
+      <Real>-0.54536316105369675</Real>
+      <Real>0.3496041322869341</Real>
+      <Real>0.28031721282842603</Real>
+      <Real>0.001300814498637627</Real>
+      <Real>-0.08585899856030095</Real>
+      <Real>-0.54536316105369675</Real>
+      <Real>0.3496041322869341</Real>
+      <Real>0.28031721282842603</Real>
+      <Real>0.001300814498637627</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Int Name="X">5</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">18</Int>
+      <Int Name="Y">6</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 10 0">3.6844225564855471e-05</Real>
+    <Real Name="Cell 0 10 1">0.0007557721938097143</Real>
+    <Real Name="Cell 0 10 2">0.0011651783732887751</Real>
+    <Real Name="Cell 0 10 3">0.00018330330639428798</Real>
+    <Real Name="Cell 0 10 4">1.3812602039352923e-07</Real>
+    <Real Name="Cell 0 6 0">1.4480152632592761e-06</Real>
+    <Real Name="Cell 0 6 1">2.9702610257258285e-05</Real>
+    <Real Name="Cell 0 6 2">4.5792686454268243e-05</Real>
+    <Real Name="Cell 0 6 3">7.2040050074495806e-06</Real>
+    <Real Name="Cell 0 6 4">5.4284920558589289e-09</Real>
+    <Real Name="Cell 0 7 0">0.00046338005890657612</Real>
+    <Real Name="Cell 0 7 1">0.0095051465546761721</Real>
+    <Real Name="Cell 0 7 2">0.014654139555758068</Real>
+    <Real Name="Cell 0 7 3">0.0023053570976879489</Real>
+    <Real Name="Cell 0 7 4">1.7371743464608655e-06</Real>
+    <Real Name="Cell 0 8 0">0.0022232042977918605</Real>
+    <Real Name="Cell 0 8 1">0.045603780882072967</Real>
+    <Real Name="Cell 0 8 2">0.070307613404165609</Real>
+    <Real Name="Cell 0 8 3">0.01106063955280852</Real>
+    <Real Name="Cell 0 8 4">8.3346130219302644e-06</Real>
+    <Real Name="Cell 0 9 0">0.0011330049398854357</Real>
+    <Real Name="Cell 0 9 1">0.023240918105529414</Real>
+    <Real Name="Cell 0 9 2">0.035830658197986663</Real>
+    <Real Name="Cell 0 9 3">0.0056368005693723843</Real>
+    <Real Name="Cell 0 9 4">4.2475438425787674e-06</Real>
+    <Real Name="Cell 1 10 0">0.0003236231272199738</Real>
+    <Real Name="Cell 1 10 1">0.0066383634633890099</Real>
+    <Real Name="Cell 1 10 2">0.010234403441837537</Real>
+    <Real Name="Cell 1 10 3">0.0016100539049371438</Real>
+    <Real Name="Cell 1 10 4">1.2132369179946192e-06</Real>
+    <Real Name="Cell 1 6 0">1.2718715635190705e-05</Real>
+    <Real Name="Cell 1 6 1">0.00026089438631650885</Real>
+    <Real Name="Cell 1 6 2">0.0004022223880930187</Real>
+    <Real Name="Cell 1 6 3">6.3276744001996738e-05</Real>
+    <Real Name="Cell 1 6 4">4.7681435781936809e-08</Real>
+    <Real Name="Cell 1 7 0">0.0040701222906898158</Real>
+    <Real Name="Cell 1 7 1">0.083488937697815027</Real>
+    <Real Name="Cell 1 7 2">0.12871537933140828</Real>
+    <Real Name="Cell 1 7 3">0.020249221197478118</Real>
+    <Real Name="Cell 1 7 4">1.5258559134005365e-05</Real>
+    <Real Name="Cell 1 8 0">0.019527627905594439</Real>
+    <Real Name="Cell 1 8 1">0.40056312640178027</Real>
+    <Real Name="Cell 1 8 2">0.61755049450496635</Real>
+    <Real Name="Cell 1 8 3">0.097151689477961933</Real>
+    <Real Name="Cell 1 8 4">7.3207496940802329e-05</Real>
+    <Real Name="Cell 1 9 0">0.0099518064548805348</Real>
+    <Real Name="Cell 1 9 1">0.20413778499795809</Real>
+    <Real Name="Cell 1 9 2">0.31472040675603546</Real>
+    <Real Name="Cell 1 9 3">0.049511124194062714</Real>
+    <Real Name="Cell 1 9 4">3.7308517149305342e-05</Real>
+    <Real Name="Cell 18 10 0">1.0601793500810928e-09</Real>
+    <Real Name="Cell 18 10 1">2.17470732783385e-08</Real>
+    <Real Name="Cell 18 10 2">3.3527588966346738e-08</Real>
+    <Real Name="Cell 18 10 3">5.2744867685909788e-09</Real>
+    <Real Name="Cell 18 10 4">3.974526599082122e-12</Real>
+    <Real Name="Cell 18 6 0">4.1666118833396182e-11</Real>
+    <Real Name="Cell 18 6 1">8.5468193605593061e-10</Real>
+    <Real Name="Cell 18 6 2">1.3176680964048322e-09</Real>
+    <Real Name="Cell 18 6 3">2.0729265521770218e-10</Real>
+    <Real Name="Cell 18 6 4">1.5620290809397745e-13</Real>
+    <Real Name="Cell 18 7 0">1.3333594672178843e-08</Real>
+    <Real Name="Cell 18 7 1">2.7350717628800978e-07</Real>
+    <Real Name="Cell 18 7 2">4.2166759952312672e-07</Real>
+    <Real Name="Cell 18 7 3">6.6335822019909293e-08</Real>
+    <Real Name="Cell 18 7 4">4.9986567538691379e-11</Real>
+    <Real Name="Cell 18 8 0">6.3971904725790459e-08</Real>
+    <Real Name="Cell 18 8 1">1.3122324064510797e-06</Real>
+    <Real Name="Cell 18 8 2">2.023076309566433e-06</Real>
+    <Real Name="Cell 18 8 3">3.1826592831857682e-07</Real>
+    <Real Name="Cell 18 8 4">2.3982549453274426e-10</Real>
+    <Real Name="Cell 18 9 0">3.2601809982191194e-08</Real>
+    <Real Name="Cell 18 9 1">6.687490664998792e-07</Real>
+    <Real Name="Cell 18 9 2">1.0310143133406988e-06</Real>
+    <Real Name="Cell 18 9 3">1.6219691071141098e-07</Real>
+    <Real Name="Cell 18 9 4">1.222215476490168e-10</Real>
+    <Real Name="Cell 2 10 0">0.00027237786403118099</Real>
+    <Real Name="Cell 2 10 1">0.005587188024394488</Real>
+    <Real Name="Cell 2 10 2">0.0086138001726504074</Real>
+    <Real Name="Cell 2 10 3">0.0013551041526885497</Real>
+    <Real Name="Cell 2 10 4">1.0211225728083619e-06</Real>
+    <Real Name="Cell 2 6 0">1.0704725053776737e-05</Real>
+    <Real Name="Cell 2 6 1">0.00021958213027931757</Real>
+    <Real Name="Cell 2 6 2">0.00033853104342517891</Real>
+    <Real Name="Cell 2 6 3">5.3256961336995475e-05</Real>
+    <Real Name="Cell 2 6 4">4.0131148054187336e-08</Real>
+    <Real Name="Cell 2 7 0">0.0034256241987620432</Real>
+    <Real Name="Cell 2 7 1">0.070268582828772783</Real>
+    <Real Name="Cell 2 7 2">0.10833348157599899</Real>
+    <Real Name="Cell 2 7 3">0.017042785741066758</Real>
+    <Real Name="Cell 2 7 4">1.2842387936906806e-05</Real>
+    <Real Name="Cell 2 8 0">0.016435455723490762</Real>
+    <Real Name="Cell 2 8 1">0.33713452346935668</Real>
+    <Real Name="Cell 2 8 2">0.51976224959450512</Real>
+    <Real Name="Cell 2 8 3">0.081767857242912828</Real>
+    <Real Name="Cell 2 8 4">6.1615193633090463e-05</Real>
+    <Real Name="Cell 2 9 0">0.0083759520177604276</Real>
+    <Real Name="Cell 2 9 1">0.17181285627960069</Real>
+    <Real Name="Cell 2 9 2">0.26488487672565397</Real>
+    <Real Name="Cell 2 9 3">0.041671107901366938</Real>
+    <Real Name="Cell 2 9 4">3.1400766374744065e-05</Real>
+    <Real Name="Cell 3 10 0">1.9556656114484016e-05</Real>
+    <Real Name="Cell 3 10 1">0.00040115857148926686</Real>
+    <Real Name="Cell 3 10 2">0.00061846849564883366</Real>
+    <Real Name="Cell 3 10 3">9.7296107404695053e-05</Real>
+    <Real Name="Cell 3 10 4">7.3316321347112943e-08</Real>
+    <Real Name="Cell 3 6 0">7.6859633003380748e-07</Real>
+    <Real Name="Cell 3 6 1">1.5765936876084927e-05</Real>
+    <Real Name="Cell 3 6 2">2.4306436295373043e-05</Real>
+    <Real Name="Cell 3 6 3">3.8238352528190793e-06</Real>
+    <Real Name="Cell 3 6 4">2.8814054503538555e-09</Real>
+    <Real Name="Cell 3 7 0">0.00024595888021566571</Real>
+    <Real Name="Cell 3 7 1">0.0050452650215258672</Real>
+    <Real Name="Cell 3 7 2">0.0077783143369685405</Real>
+    <Real Name="Cell 3 7 3">0.0012236673532791899</Real>
+    <Real Name="Cell 3 7 4">9.2207994017506848e-07</Real>
+    <Real Name="Cell 3 8 0">0.0011800612241835537</Real>
+    <Real Name="Cell 3 8 1">0.024206166544634769</Real>
+    <Real Name="Cell 3 8 2">0.037318787313225688</Real>
+    <Real Name="Cell 3 8 3">0.0058709097782439724</Real>
+    <Real Name="Cell 3 8 4">4.4239540448549536e-06</Real>
+    <Real Name="Cell 3 9 0">0.00060139106320331254</Real>
+    <Real Name="Cell 3 9 1">0.012336116072643717</Real>
+    <Real Name="Cell 3 9 2">0.019018661676038717</Real>
+    <Real Name="Cell 3 9 3">0.0029919741460462381</Real>
+    <Real Name="Cell 3 9 4">2.2545664344141529e-06</Real>
+    <Real Name="Cell 5 4 0">2.0279381712035925e-05</Real>
+    <Real Name="Cell 5 4 1">0.00041598357871930786</Real>
+    <Real Name="Cell 5 4 2">0.00064132429525323492</Real>
+    <Real Name="Cell 5 4 3">0.00010089173167460559</Real>
+    <Real Name="Cell 5 4 4">7.6025761133020743e-08</Real>
+    <Real Name="Cell 5 5 0">0.00028305409110538661</Real>
+    <Real Name="Cell 5 5 1">0.0058061855859874133</Real>
+    <Real Name="Cell 5 5 2">0.0089514299831423508</Real>
+    <Real Name="Cell 5 5 3">0.0014082193340369351</Real>
+    <Real Name="Cell 5 5 4">1.0611468842430501e-06</Real>
+    <Real Name="Cell 5 6 0">0.00033682355900068551</Real>
+    <Real Name="Cell 5 6 1">0.0069091391177336153</Real>
+    <Real Name="Cell 5 6 2">0.010651859838142701</Real>
+    <Real Name="Cell 5 6 3">0.0016757272297021719</Real>
+    <Real Name="Cell 5 6 4">1.2627242686280706e-06</Real>
+    <Real Name="Cell 5 7 0">3.8422285950624296e-05</Real>
+    <Real Name="Cell 5 7 1">0.0007881423723501026</Real>
+    <Real Name="Cell 5 7 2">0.0012150836652321476</Real>
+    <Real Name="Cell 5 7 3">0.0001911542974781443</Real>
+    <Real Name="Cell 5 7 4">1.4404204109108032e-07</Real>
+    <Real Name="Cell 5 8 0">1.1424475441350034e-09</Real>
+    <Real Name="Cell 5 8 1">2.3434610810955146e-08</Real>
+    <Real Name="Cell 5 8 2">3.6129275365003898e-08</Real>
+    <Real Name="Cell 5 8 3">5.6837783672059079e-09</Real>
+    <Real Name="Cell 5 8 4">4.2829434018624326e-12</Real>
+    <Real Name="Cell 6 4 0">0.00051326710715978135</Real>
+    <Real Name="Cell 6 4 1">0.010528461424862504</Real>
+    <Real Name="Cell 6 4 2">0.016231790024473419</Real>
+    <Real Name="Cell 6 4 3">0.0025535496095638538</Real>
+    <Real Name="Cell 6 4 4">1.9241968537535151e-06</Real>
+    <Real Name="Cell 6 5 0">0.0071640426012188089</Real>
+    <Real Name="Cell 6 5 1">0.1469533993525976</Real>
+    <Real Name="Cell 6 5 2">0.22655890784204524</Real>
+    <Real Name="Cell 6 5 3">0.035641750527267313</Real>
+    <Real Name="Cell 6 5 4">2.6857416033734e-05</Real>
+    <Real Name="Cell 6 6 0">0.0085249371113192418</Real>
+    <Real Name="Cell 6 6 1">0.17486893329784842</Real>
+    <Real Name="Cell 6 6 2">0.26959644838432717</Real>
+    <Real Name="Cell 6 6 3">0.042412322022009022</Real>
+    <Real Name="Cell 6 6 4">3.1959299435372863e-05</Real>
+    <Real Name="Cell 6 7 0">0.00097246039550793507</Real>
+    <Real Name="Cell 6 7 1">0.019947726278365531</Real>
+    <Real Name="Cell 6 7 2">0.030753525263576525</Real>
+    <Real Name="Cell 6 7 3">0.0048380771505245985</Real>
+    <Real Name="Cell 6 7 4">3.6456753361632359e-06</Real>
+    <Real Name="Cell 6 8 0">2.8915119523192849e-08</Real>
+    <Real Name="Cell 6 8 1">5.9312532645980406e-07</Real>
+    <Real Name="Cell 6 8 2">9.1442475484194672e-07</Real>
+    <Real Name="Cell 6 8 3">1.4385529705482543e-07</Real>
+    <Real Name="Cell 6 8 4">1.0840044342665065e-10</Real>
+    <Real Name="Cell 7 4 0">0.00090038172117671168</Real>
+    <Real Name="Cell 7 4 1">0.018469202656521064</Real>
+    <Real Name="Cell 7 4 2">0.028474076823054098</Real>
+    <Real Name="Cell 7 4 3">0.0044794793208002819</Real>
+    <Real Name="Cell 7 4 4">3.3754582183386785e-06</Real>
+    <Real Name="Cell 7 5 0">0.012567283034290878</Real>
+    <Real Name="Cell 7 5 1">0.25778810447066258</Real>
+    <Real Name="Cell 7 5 2">0.397433415360541</Real>
+    <Real Name="Cell 7 5 3">0.062523353314167959</Real>
+    <Real Name="Cell 7 5 4">4.7113727214326512e-05</Real>
+    <Real Name="Cell 7 6 0">0.014954586884959644</Real>
+    <Real Name="Cell 7 6 1">0.30675799977581286</Real>
+    <Real Name="Cell 7 6 2">0.47293058688805373</Real>
+    <Real Name="Cell 7 6 3">0.074400402769994045</Real>
+    <Real Name="Cell 7 6 4">5.6063536181883203e-05</Real>
+    <Real Name="Cell 7 7 0">0.0017059062473899157</Real>
+    <Real Name="Cell 7 7 1">0.034992634185080376</Real>
+    <Real Name="Cell 7 7 2">0.05394834701622634</Real>
+    <Real Name="Cell 7 7 3">0.0084870356413059376</Real>
+    <Real Name="Cell 7 7 4">6.3953044881254987e-06</Real>
+    <Real Name="Cell 7 8 0">5.0723385000040655e-08</Real>
+    <Real Name="Cell 7 8 1">1.0404703415859642e-06</Real>
+    <Real Name="Cell 7 8 2">1.6040991584424275e-06</Real>
+    <Real Name="Cell 7 8 3">2.5235336174053621e-07</Real>
+    <Real Name="Cell 7 8 4">1.9015786608437929e-10</Real>
+    <Real Name="Cell 8 4 0">0.00016503810988016999</Real>
+    <Real Name="Cell 8 4 1">0.0033853667014057658</Real>
+    <Real Name="Cell 8 4 2">0.0052192394724740344</Real>
+    <Real Name="Cell 8 4 3">0.00082107930776961183</Real>
+    <Real Name="Cell 8 4 4">6.1871451988835687e-07</Real>
+    <Real Name="Cell 8 5 0">0.0023035570242339785</Real>
+    <Real Name="Cell 8 5 1">0.047252027124482197</Real>
+    <Real Name="Cell 8 5 2">0.072848724192892594</Real>
+    <Real Name="Cell 8 5 3">0.011460401529314424</Real>
+    <Real Name="Cell 8 5 4">8.6358488916239541e-06</Real>
+    <Real Name="Cell 8 6 0">0.0027411448894219905</Real>
+    <Real Name="Cell 8 6 1">0.056228107793500619</Real>
+    <Real Name="Cell 8 6 2">0.086687199805120491</Real>
+    <Real Name="Cell 8 6 3">0.013637440164195965</Real>
+    <Real Name="Cell 8 6 4">1.0276330390808299e-05</Real>
+    <Real Name="Cell 8 7 0">0.00031268909183769354</Real>
+    <Real Name="Cell 8 7 1">0.0064140775737721199</Real>
+    <Real Name="Cell 8 7 2">0.0098886205853684454</Real>
+    <Real Name="Cell 8 7 3">0.0015556561042756505</Real>
+    <Real Name="Cell 8 7 4">1.1722461040735086e-06</Real>
+    <Real Name="Cell 8 8 0">9.2974917085060422e-09</Real>
+    <Real Name="Cell 8 8 1">1.9071606466788833e-07</Real>
+    <Real Name="Cell 8 8 2">2.9402806270180973e-07</Real>
+    <Real Name="Cell 8 8 3">4.6255850006745022e-08</Real>
+    <Real Name="Cell 8 8 4">3.4855544109000254e-11</Real>
+    <Real Name="Cell 9 4 0">2.9187444766006241e-07</Real>
+    <Real Name="Cell 9 4 1">5.9871143508430354e-06</Real>
+    <Real Name="Cell 9 4 2">9.2303689089752043e-06</Real>
+    <Real Name="Cell 9 4 3">1.4521013941226495e-06</Real>
+    <Real Name="Cell 9 4 4">1.0942136872677136e-09</Real>
+    <Real Name="Cell 9 5 0">4.0739041097230541e-06</Real>
+    <Real Name="Cell 9 5 1">8.3566512775687409e-05</Real>
+    <Real Name="Cell 9 5 2">0.0001288349772787573</Real>
+    <Real Name="Cell 9 5 3">2.0268036084271086e-05</Real>
+    <Real Name="Cell 9 5 4">1.5272736867555231e-08</Real>
+    <Real Name="Cell 9 6 0">4.8477903142320106e-06</Real>
+    <Real Name="Cell 9 6 1">9.9440958922241982e-05</Real>
+    <Real Name="Cell 9 6 2">0.00015330870294556813</Real>
+    <Real Name="Cell 9 6 3">2.411818893413122e-05</Real>
+    <Real Name="Cell 9 6 4">1.8173973629286428e-08</Real>
+    <Real Name="Cell 9 7 0">5.5299928020091375e-07</Real>
+    <Real Name="Cell 9 7 1">1.1343473034518021e-05</Real>
+    <Real Name="Cell 9 7 2">1.748829814865161e-05</Real>
+    <Real Name="Cell 9 7 3">2.7512207120775846e-06</Real>
+    <Real Name="Cell 9 7 4">2.0731495555574459e-09</Real>
+    <Real Name="Cell 9 8 0">1.644287043165097e-11</Real>
+    <Real Name="Cell 9 8 1">3.3728661868012003e-10</Real>
+    <Real Name="Cell 9 8 2">5.1999673566281217e-10</Real>
+    <Real Name="Cell 9 8 3">8.1804746076939808e-11</Real>
+    <Real Name="Cell 9 8 4">6.1642990774022262e-14</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_2.xml b/src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_2.xml
new file mode 100644 (file)
index 0000000..ec81911
--- /dev/null
@@ -0,0 +1,177 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">8</Int>
+      <Real>0.16666666666666666</Real>
+      <Real>0.66666666666666663</Real>
+      <Real>0.16666666666666666</Real>
+      <Real>0</Real>
+      <Real>0.13492625972833858</Real>
+      <Real>0.66219988218971215</Real>
+      <Real>0.20282145274007193</Real>
+      <Real>5.2405341877301998e-05</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">8</Int>
+      <Real>0.010666680130309107</Real>
+      <Real>0.41466677774166727</Real>
+      <Real>0.53866657242119786</Real>
+      <Real>0.03599996970682575</Real>
+      <Real>0.00091594116288747595</Real>
+      <Real>0.26772523897369466</Real>
+      <Real>0.63827253429257058</Real>
+      <Real>0.093086285570847194</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">8</Int>
+      <Real>0.016222667549530681</Real>
+      <Real>0.45379867202893892</Real>
+      <Real>0.50373466163818037</Real>
+      <Real>0.026243998783350007</Real>
+      <Real>0.016222667549530681</Real>
+      <Real>0.45379867202893892</Real>
+      <Real>0.50373466163818037</Real>
+      <Real>0.026243998783350007</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">8</Int>
+      <Real>-0.5</Real>
+      <Real>0</Real>
+      <Real>0.5</Real>
+      <Real>0</Real>
+      <Real>-0.43431199655580521</Real>
+      <Real>-0.12906400663709638</Real>
+      <Real>0.56106400294160841</Real>
+      <Real>0.0023120002512931892</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">8</Int>
+      <Real>-0.080000067318198045</Real>
+      <Real>-0.65999996634086555</Real>
+      <Real>0.56000013463632525</Real>
+      <Real>0.17999989902273833</Real>
+      <Real>-0.015570977931379222</Real>
+      <Real>-0.62975790193448478</Real>
+      <Real>0.30622873766310715</Real>
+      <Real>0.3391001422027568</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">8</Int>
+      <Real>-0.10580000383853916</Real>
+      <Real>-0.64259999682903279</Real>
+      <Real>0.60260000517368306</Real>
+      <Real>0.14579999549388889</Real>
+      <Real>-0.10580000383853916</Real>
+      <Real>-0.64259999682903279</Real>
+      <Real>0.60260000517368306</Real>
+      <Real>0.14579999549388889</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 3 1">8.9693436549661624e-05</Real>
+    <Real Name="Cell 0 3 2">0.0025090055178456677</Real>
+    <Real Name="Cell 0 3 3">0.0027850963951250112</Real>
+    <Real Name="Cell 0 3 4">0.00014510033152666677</Real>
+    <Real Name="Cell 0 4 1">0.0034868288787382124</Real>
+    <Real Name="Cell 0 4 2">0.097537492519800234</Real>
+    <Real Name="Cell 0 4 3">0.10827051470164921</Real>
+    <Real Name="Cell 0 4 4">0.0056407697791971724</Real>
+    <Real Name="Cell 0 5 1">0.0045374713720079014</Real>
+    <Real Name="Cell 0 5 2">0.12692724403676031</Real>
+    <Real Name="Cell 0 5 3">0.14089431342242198</Real>
+    <Real Name="Cell 0 5 4">0.007340432318105777</Real>
+    <Real Name="Cell 0 6 1">0.0026291907002765156</Real>
+    <Real Name="Cell 0 6 2">0.073546674408108401</Real>
+    <Real Name="Cell 0 6 3">0.081639747824602149</Real>
+    <Real Name="Cell 0 6 4">0.0042533373336155313</Real>
+    <Real Name="Cell 0 7 1">0.0055464540100770522</Real>
+    <Real Name="Cell 0 7 2">0.15515163930702414</Real>
+    <Real Name="Cell 0 7 3">0.17222452013686987</Real>
+    <Real Name="Cell 0 7 4">0.0089727001954484336</Real>
+    <Real Name="Cell 0 8 1">0.00080890023328333068</Real>
+    <Real Name="Cell 0 8 2">0.022627465584628456</Real>
+    <Real Name="Cell 0 8 3">0.025117391086758218</Real>
+    <Real Name="Cell 0 8 4">0.0013085873006596508</Real>
+    <Real Name="Cell 1 3 1">0.00035877374619864649</Real>
+    <Real Name="Cell 1 3 2">0.010036022071382671</Real>
+    <Real Name="Cell 1 3 3">0.011140385580500045</Real>
+    <Real Name="Cell 1 3 4">0.00058040132610666709</Real>
+    <Real Name="Cell 1 4 1">0.01394731551495285</Real>
+    <Real Name="Cell 1 4 2">0.39014997007920094</Real>
+    <Real Name="Cell 1 4 3">0.43308205880659684</Real>
+    <Real Name="Cell 1 4 4">0.02256307911678869</Real>
+    <Real Name="Cell 1 5 1">0.018157111491429602</Real>
+    <Real Name="Cell 1 5 2">0.5079111100276793</Real>
+    <Real Name="Cell 1 5 3">0.56380163037530839</Real>
+    <Real Name="Cell 1 5 4">0.029373419040693738</Real>
+    <Real Name="Cell 1 6 1">0.012628889174436301</Real>
+    <Real Name="Cell 1 6 2">0.35326946811072585</Real>
+    <Real Name="Cell 1 6 3">0.39214322772303806</Real>
+    <Real Name="Cell 1 6 4">0.020430212917637993</Real>
+    <Real Name="Cell 1 7 1">0.027221248105733033</Real>
+    <Real Name="Cell 1 7 2">0.76146331690741509</Real>
+    <Real Name="Cell 1 7 3">0.84525471301463506</Real>
+    <Real Name="Cell 1 7 4">0.044036802208203656</Real>
+    <Real Name="Cell 1 8 1">0.0039699732302810493</Real>
+    <Real Name="Cell 1 8 2">0.11105254881119081</Real>
+    <Real Name="Cell 1 8 3">0.12327276730306372</Real>
+    <Real Name="Cell 1 8 4">0.0064223699528652492</Real>
+    <Real Name="Cell 2 3 1">8.9693436549661624e-05</Real>
+    <Real Name="Cell 2 3 2">0.0025090055178456677</Real>
+    <Real Name="Cell 2 3 3">0.0027850963951250112</Real>
+    <Real Name="Cell 2 3 4">0.00014510033152666677</Real>
+    <Real Name="Cell 2 4 1">0.0034868288787382124</Real>
+    <Real Name="Cell 2 4 2">0.097537492519800234</Real>
+    <Real Name="Cell 2 4 3">0.10827051470164921</Real>
+    <Real Name="Cell 2 4 4">0.0056407697791971724</Real>
+    <Real Name="Cell 2 5 1">0.0045414765275090477</Real>
+    <Real Name="Cell 2 5 2">0.12703928074355594</Real>
+    <Real Name="Cell 2 5 3">0.14101867864441883</Real>
+    <Real Name="Cell 2 5 4">0.0073469116036966519</Real>
+    <Real Name="Cell 2 6 1">0.0037998785753481233</Real>
+    <Real Name="Cell 2 6 2">0.10629447013565169</Real>
+    <Real Name="Cell 2 6 3">0.11799110982056298</Real>
+    <Real Name="Cell 2 6 4">0.0061472016487941232</Real>
+    <Real Name="Cell 2 7 1">0.0083374419638162847</Real>
+    <Real Name="Cell 2 7 2">0.23322428816015744</Real>
+    <Real Name="Cell 2 7 3">0.25888828047224965</Real>
+    <Real Name="Cell 2 7 4">0.013487782825271294</Real>
+    <Real Name="Cell 2 8 1">0.0012159406239128868</Real>
+    <Real Name="Cell 2 8 2">0.034013656429375004</Real>
+    <Real Name="Cell 2 8 3">0.037756517964062937</Real>
+    <Real Name="Cell 2 8 4">0.0019670713313433359</Real>
+    <Real Name="Cell 3 5 1">3.0914050612255641e-09</Real>
+    <Real Name="Cell 3 5 2">8.6476253501742167e-08</Real>
+    <Real Name="Cell 3 5 3">9.5992097338397879e-08</Real>
+    <Real Name="Cell 3 5 4">5.0010783009599958e-09</Real>
+    <Real Name="Cell 3 6 1">9.0360297398576509e-07</Real>
+    <Real Name="Cell 3 6 2">2.5276596982843479e-05</Real>
+    <Real Name="Cell 3 6 3">2.8058032809107341e-05</Real>
+    <Real Name="Cell 3 6 4">1.4617913655390116e-06</Real>
+    <Real Name="Cell 3 7 1">2.154242022198236e-06</Real>
+    <Real Name="Cell 3 7 2">6.0260876697234485e-05</Real>
+    <Real Name="Cell 3 7 3">6.6891981409689403e-05</Real>
+    <Real Name="Cell 3 7 4">3.4849955987199861e-06</Real>
+    <Real Name="Cell 3 8 1">3.1417674628491136e-07</Real>
+    <Real Name="Cell 3 8 2">8.7885047148482228e-06</Real>
+    <Real Name="Cell 3 8 3">9.7555914587544357e-06</Real>
+    <Real Name="Cell 3 8 4">5.0825513881017745e-07</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_3.xml b/src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_3.xml
new file mode 100644 (file)
index 0000000..f4a3cff
--- /dev/null
@@ -0,0 +1,189 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">8</Int>
+      <Real>0.16666666666666666</Real>
+      <Real>0.66666666666666663</Real>
+      <Real>0.16666666666666666</Real>
+      <Real>0</Real>
+      <Real>0.12946419015888011</Real>
+      <Real>0.66040937121180099</Real>
+      <Real>0.21003868271136564</Real>
+      <Real>8.775591795322617e-05</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">8</Int>
+      <Real>0.12150009655954666</Real>
+      <Real>0.65716671077405386</Real>
+      <Real>0.22116652719182275</Real>
+      <Real>0.00016666547457665597</Real>
+      <Real>0.070312598610667756</Real>
+      <Real>0.61197930910415455</Real>
+      <Real>0.3151039365752315</Real>
+      <Real>0.0026041557099462918</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">8</Int>
+      <Real>0.082173168712625921</Real>
+      <Real>0.62719716898668798</Real>
+      <Real>0.28908616244525709</Real>
+      <Real>0.0015434998554289384</Real>
+      <Real>0.082173168712625921</Real>
+      <Real>0.62719716898668798</Real>
+      <Real>0.28908616244525709</Real>
+      <Real>0.0015434998554289384</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">8</Int>
+      <Real>-0.5</Real>
+      <Real>0</Real>
+      <Real>0.5</Real>
+      <Real>0</Real>
+      <Real>-0.42251027721597068</Real>
+      <Real>-0.151719163963696</Real>
+      <Real>0.57096915957530403</Real>
+      <Real>0.0032602816043626613</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">8</Int>
+      <Real>-0.40500021457674196</Real>
+      <Real>-0.1849995946883447</Real>
+      <Real>0.58499983310691528</Real>
+      <Real>0.0049999761581713646</Real>
+      <Real>-0.28125026296171923</Real>
+      <Real>-0.40624956173038601</Real>
+      <Real>0.65624991234592966</Real>
+      <Real>0.031249912346175537</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">8</Int>
+      <Real>-0.31205000517964365</Real>
+      <Real>-0.35384999101757997</Real>
+      <Real>0.64384999757409089</Real>
+      <Real>0.022049998623132727</Real>
+      <Real>-0.31205000517964365</Real>
+      <Real>-0.35384999101757997</Real>
+      <Real>0.64384999757409089</Real>
+      <Real>0.022049998623132727</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">8</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 10 1">0.013308344424649362</Real>
+    <Real Name="Cell 0 10 2">0.10157763267266268</Real>
+    <Real Name="Cell 0 10 3">0.046818910338922895</Real>
+    <Real Name="Cell 0 10 4">0.00024997731032232439</Real>
+    <Real Name="Cell 0 11 1">0.00010998593511734224</Real>
+    <Real Name="Cell 0 11 2">0.00083948164850738407</Real>
+    <Real Name="Cell 0 11 3">0.00038693179786238589</Real>
+    <Real Name="Cell 0 11 4">2.0659210008868769e-06</Real>
+    <Real Name="Cell 0 5 1">0.0051750646708077115</Real>
+    <Real Name="Cell 0 5 2">0.039499339768735334</Real>
+    <Real Name="Cell 0 5 3">0.018205937650058786</Real>
+    <Real Name="Cell 0 5 4">9.7205836118618557e-05</Real>
+    <Real Name="Cell 0 6 1">0.027990761522489485</Real>
+    <Real Name="Cell 0 6 2">0.21364304991185623</Real>
+    <Real Name="Cell 0 6 3">0.098471824309892403</Real>
+    <Real Name="Cell 0 6 4">0.0005257645170578673</Real>
+    <Real Name="Cell 0 7 1">0.0094201660216351821</Real>
+    <Real Name="Cell 0 7 2">0.07190061613440453</Real>
+    <Real Name="Cell 0 7 3">0.033140253533551434</Real>
+    <Real Name="Cell 0 7 4">0.00017694370462163306</Real>
+    <Real Name="Cell 0 8 1">0.0029767357050703548</Real>
+    <Real Name="Cell 0 8 2">0.022720314140141636</Real>
+    <Real Name="Cell 0 8 3">0.010472190802353036</Real>
+    <Real Name="Cell 0 8 4">5.5913520220868544e-05</Real>
+    <Real Name="Cell 0 9 1">0.025846809515731168</Real>
+    <Real Name="Cell 0 9 2">0.19727906334362821</Real>
+    <Real Name="Cell 0 9 3">0.090929376235776224</Real>
+    <Real Name="Cell 0 9 4">0.00048549359086234878</Real>
+    <Real Name="Cell 1 10 1">0.067887153679846504</Real>
+    <Real Name="Cell 1 10 2">0.51815734096209587</Real>
+    <Real Name="Cell 1 10 3">0.2388277955456623</Real>
+    <Real Name="Cell 1 10 4">0.0012751584675622365</Real>
+    <Real Name="Cell 1 11 1">0.00056104890598586703</Real>
+    <Real Name="Cell 1 11 2">0.0042822771837852536</Real>
+    <Real Name="Cell 1 11 3">0.001973776571070009</Real>
+    <Real Name="Cell 1 11 4">1.0538463087704832e-05</Real>
+    <Real Name="Cell 1 5 1">0.020700258683230846</Real>
+    <Real Name="Cell 1 5 2">0.15799735907494133</Real>
+    <Real Name="Cell 1 5 3">0.072823750600235146</Real>
+    <Real Name="Cell 1 5 4">0.00038882334447447423</Real>
+    <Real Name="Cell 1 6 1">0.11196304608995794</Real>
+    <Real Name="Cell 1 6 2">0.85457219964742492</Real>
+    <Real Name="Cell 1 6 3">0.39388729723956961</Real>
+    <Real Name="Cell 1 6 4">0.0021030580682314692</Real>
+    <Real Name="Cell 1 7 1">0.037680664086540729</Real>
+    <Real Name="Cell 1 7 2">0.28760246453761812</Real>
+    <Real Name="Cell 1 7 3">0.13256101413420573</Real>
+    <Real Name="Cell 1 7 4">0.00070777481848653223</Real>
+    <Real Name="Cell 1 8 1">0.015176800632591584</Real>
+    <Real Name="Cell 1 8 2">0.11583886249203681</Real>
+    <Real Name="Cell 1 8 3">0.053392160991334946</Real>
+    <Real Name="Cell 1 8 4">0.00028507346070834452</Real>
+    <Real Name="Cell 1 9 1">0.13184707832464976</Real>
+    <Real Name="Cell 1 9 2">1.0063396064667087</Real>
+    <Real Name="Cell 1 9 3">0.46383955370867708</Real>
+    <Real Name="Cell 1 9 4">0.0024765498218100976</Real>
+    <Real Name="Cell 2 10 1">0.021591044817814965</Real>
+    <Real Name="Cell 2 10 2">0.16479639762410112</Real>
+    <Real Name="Cell 2 10 3">0.075957546573309276</Real>
+    <Real Name="Cell 2 10 4">0.00040555542736100698</Real>
+    <Real Name="Cell 2 11 1">0.00017843776646247957</Real>
+    <Real Name="Cell 2 11 2">0.0013619489636205195</Real>
+    <Real Name="Cell 2 11 3">0.00062774613599652198</Real>
+    <Real Name="Cell 2 11 4">3.3516860923434464e-06</Real>
+    <Real Name="Cell 2 5 1">0.0051750646708077115</Real>
+    <Real Name="Cell 2 5 2">0.039499339768735334</Real>
+    <Real Name="Cell 2 5 3">0.018205937650058786</Real>
+    <Real Name="Cell 2 5 4">9.7205836118618557e-05</Real>
+    <Real Name="Cell 2 6 1">0.027990761522489485</Real>
+    <Real Name="Cell 2 6 2">0.21364304991185623</Real>
+    <Real Name="Cell 2 6 3">0.098471824309892403</Real>
+    <Real Name="Cell 2 6 4">0.0005257645170578673</Real>
+    <Real Name="Cell 2 7 1">0.0094201660216351821</Real>
+    <Real Name="Cell 2 7 2">0.07190061613440453</Real>
+    <Real Name="Cell 2 7 3">0.033140253533551434</Real>
+    <Real Name="Cell 2 7 4">0.00017694370462163306</Real>
+    <Real Name="Cell 2 8 1">0.0048249455195422519</Real>
+    <Real Name="Cell 2 8 2">0.036827010784445141</Real>
+    <Real Name="Cell 2 8 3">0.016974214407258117</Real>
+    <Real Name="Cell 2 8 4">9.0629372440419111e-05</Real>
+    <Real Name="Cell 2 9 1">0.041933061306863598</Real>
+    <Real Name="Cell 2 9 2">0.32005942755581029</Real>
+    <Real Name="Cell 2 9 3">0.1475209969713667</Real>
+    <Real Name="Cell 2 9 4">0.00078764972896672506</Real>
+    <Real Name="Cell 3 10 1">9.0209190664195251e-06</Real>
+    <Real Name="Cell 3 10 2">6.8853312933605122e-05</Real>
+    <Real Name="Cell 3 10 3">3.1735698105551808e-05</Real>
+    <Real Name="Cell 3 10 4">1.6944444875368788e-07</Real>
+    <Real Name="Cell 3 11 1">7.4552790901649246e-08</Real>
+    <Real Name="Cell 3 11 2">5.6903366544250517e-07</Real>
+    <Real Name="Cell 3 11 3">2.6227758475169961e-07</Real>
+    <Real Name="Cell 3 11 4">1.4003624757485909e-09</Real>
+    <Real Name="Cell 3 8 1">2.0129366465881636e-06</Real>
+    <Real Name="Cell 3 8 2">1.5363995156434422e-05</Real>
+    <Real Name="Cell 3 8 3">7.0815345145402185e-06</Real>
+    <Real Name="Cell 3 8 4">3.7809998953089617e-08</Real>
+    <Real Name="Cell 3 9 1">1.7519983652866431e-05</Real>
+    <Real Name="Cell 3 9 2">0.00013372350512853588</Real>
+    <Real Name="Cell 3 9 3">6.163550608621703e-05</Real>
+    <Real Name="Cell 3 9 4">3.2908664298790362e-07</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_4.xml b/src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_4.xml
new file mode 100644 (file)
index 0000000..6cee4e6
--- /dev/null
@@ -0,0 +1,266 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">10</Int>
+      <Real>0.041666666666666664</Real>
+      <Real>0.45833333333333331</Real>
+      <Real>0.45833333333333331</Real>
+      <Real>0.041666666666666664</Real>
+      <Real>0</Real>
+      <Real>0.031437818392048296</Real>
+      <Real>0.4233309838221333</Real>
+      <Real>0.49102546437496075</Real>
+      <Real>0.054204842519997236</Real>
+      <Real>8.9089086032996169e-07</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">10</Int>
+      <Real>0.0010666684618193696</Real>
+      <Real>0.15473340132470725</Real>
+      <Real>0.59273335420195306</Real>
+      <Real>0.24606658207015428</Real>
+      <Real>0.0053999939413659995</Real>
+      <Real>4.0409225623249791e-05</Real>
+      <Real>0.079618265847521158</Real>
+      <Real>0.53627789409703197</Real>
+      <Real>0.36489861308950189</Real>
+      <Real>0.019164817740321645</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">10</Int>
+      <Real>0.0018656068020391501</Real>
+      <Real>0.17999357698475202</Real>
+      <Real>0.59795897375003171</Real>
+      <Real>0.21663890268217406</Real>
+      <Real>0.0035429397810030033</Real>
+      <Real>0.0018656068020391501</Real>
+      <Real>0.17999357698475202</Real>
+      <Real>0.59795897375003171</Real>
+      <Real>0.21663890268217406</Real>
+      <Real>0.0035429397810030033</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">10</Int>
+      <Real>-0.16666666666666666</Real>
+      <Real>-0.5</Real>
+      <Real>0.5</Real>
+      <Real>0.16666666666666666</Real>
+      <Real>0</Real>
+      <Real>-0.13492625972833858</Real>
+      <Real>-0.52727362246137355</Real>
+      <Real>0.45937842944964025</Real>
+      <Real>0.20276904739819462</Real>
+      <Real>5.2405341877301998e-05</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">10</Int>
+      <Real>-0.010666680130309107</Real>
+      <Real>-0.40400009761135819</Real>
+      <Real>-0.12399979467953059</Real>
+      <Real>0.50266660271437213</Real>
+      <Real>0.03599996970682575</Real>
+      <Real>-0.00091594116288747595</Real>
+      <Real>-0.2668092978108072</Real>
+      <Real>-0.37054729531887592</Real>
+      <Real>0.54518624872172339</Real>
+      <Real>0.093086285570847194</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">10</Int>
+      <Real>-0.016222667549530681</Real>
+      <Real>-0.43757600447940825</Real>
+      <Real>-0.049935989609241449</Real>
+      <Real>0.47749066285483038</Real>
+      <Real>0.026243998783350007</Real>
+      <Real>-0.016222667549530681</Real>
+      <Real>-0.43757600447940825</Real>
+      <Real>-0.049935989609241449</Real>
+      <Real>0.47749066285483038</Real>
+      <Real>0.026243998783350007</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">3</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 3 1">2.5786874325345551e-07</Real>
+    <Real Name="Cell 0 3 2">2.4879153227796859e-05</Real>
+    <Real Name="Cell 0 3 3">8.2651354459850881e-05</Real>
+    <Real Name="Cell 0 3 4">2.9944359933400128e-05</Real>
+    <Real Name="Cell 0 3 5">4.8971381737637177e-07</Real>
+    <Real Name="Cell 0 4 1">3.740703805086502e-05</Real>
+    <Real Name="Cell 0 4 2">0.0036090276771185504</Real>
+    <Real Name="Cell 0 4 3">0.011989597196727115</Real>
+    <Real Name="Cell 0 4 4">0.0043437983111296935</Real>
+    <Real Name="Cell 0 4 5">7.1039022292930911e-05</Real>
+    <Real Name="Cell 0 5 1">0.00014330361015577525</Real>
+    <Real Name="Cell 0 5 2">0.013825919458791263</Real>
+    <Real Name="Cell 0 5 3">0.045931264599679444</Real>
+    <Real Name="Cell 0 5 4">0.01664077168919419</Real>
+    <Real Name="Cell 0 5 5">0.00027214526695941346</Real>
+    <Real Name="Cell 0 6 1">7.8025524233388239e-05</Real>
+    <Real Name="Cell 0 6 2">0.0075278955820312684</Real>
+    <Real Name="Cell 0 6 3">0.025008518593472612</Real>
+    <Real Name="Cell 0 6 4">0.0090605179680127955</Real>
+    <Real Name="Cell 0 6 5">0.0001481768470386848</Real>
+    <Real Name="Cell 0 7 1">0.00012617396484298417</Real>
+    <Real Name="Cell 0 7 2">0.012173252814909323</Real>
+    <Real Name="Cell 0 7 3">0.040440919516919797</Real>
+    <Real Name="Cell 0 7 4">0.014651634664263882</Real>
+    <Real Name="Cell 0 7 5">0.00023961467061573354</Real>
+    <Real Name="Cell 0 8 1">8.4964056669811633e-05</Real>
+    <Real Name="Cell 0 8 2">0.0081973245693674566</Real>
+    <Real Name="Cell 0 8 3">0.027232437229746949</Real>
+    <Real Name="Cell 0 8 4">0.0098662376146223876</Real>
+    <Real Name="Cell 0 8 5">0.00016135368717665739</Real>
+    <Real Name="Cell 0 9 1">4.4623920238247299e-06</Real>
+    <Real Name="Cell 0 9 2">0.0004305311823469566</Real>
+    <Real Name="Cell 0 9 3">0.0014302731701664149</Real>
+    <Real Name="Cell 0 9 4">0.00051818406232354019</Real>
+    <Real Name="Cell 0 9 5">8.474447135569224e-06</Real>
+    <Real Name="Cell 1 3 1">2.83655617578801e-06</Real>
+    <Real Name="Cell 1 3 2">0.00027367068550576538</Real>
+    <Real Name="Cell 1 3 3">0.00090916489905835962</Real>
+    <Real Name="Cell 1 3 4">0.0003293879592674014</Real>
+    <Real Name="Cell 1 3 5">5.3868519911400891e-06</Real>
+    <Real Name="Cell 1 4 1">0.00041147741855951522</Real>
+    <Real Name="Cell 1 4 2">0.039699304448304058</Real>
+    <Real Name="Cell 1 4 3">0.13188556916399827</Real>
+    <Real Name="Cell 1 4 4">0.047781781422426631</Real>
+    <Real Name="Cell 1 4 5">0.00078142924522224002</Real>
+    <Real Name="Cell 1 5 1">0.0015763629111161547</Real>
+    <Real Name="Cell 1 5 2">0.1520873523229892</Real>
+    <Real Name="Cell 1 5 3">0.5052513464028674</Real>
+    <Real Name="Cell 1 5 4">0.18305118255347932</Real>
+    <Real Name="Cell 1 5 5">0.0029936419941150733</Real>
+    <Real Name="Cell 1 6 1">0.00090399053153762546</Real>
+    <Real Name="Cell 1 6 2">0.087216925428207095</Real>
+    <Real Name="Cell 1 6 3">0.28974446808789062</Real>
+    <Real Name="Cell 1 6 4">0.10497362926278433</Real>
+    <Real Name="Cell 1 6 5">0.0017167518966665367</Real>
+    <Real Name="Cell 1 7 1">0.0016957969392537985</Real>
+    <Real Name="Cell 1 7 2">0.16361033664889055</Real>
+    <Real Name="Cell 1 7 3">0.54353200062108642</Real>
+    <Real Name="Cell 1 7 4">0.19692015900144796</Real>
+    <Real Name="Cell 1 7 5">0.0032204569741161007</Real>
+    <Real Name="Cell 1 8 1">0.0011440971269383109</Real>
+    <Real Name="Cell 1 8 2">0.11038238822377695</Real>
+    <Real Name="Cell 1 8 3">0.36670274955399507</Real>
+    <Real Name="Cell 1 8 4">0.13285540440291682</Real>
+    <Real Name="Cell 1 8 5">0.0021727339436854827</Real>
+    <Real Name="Cell 1 9 1">6.0089055229213171e-05</Real>
+    <Real Name="Cell 1 9 2">0.0057973866607468711</Real>
+    <Real Name="Cell 1 9 3">0.019259572681229575</Real>
+    <Real Name="Cell 1 9 4">0.0069776905690077549</Real>
+    <Real Name="Cell 1 9 5">0.00011411402656860506</Real>
+    <Real Name="Cell 2 3 1">2.83655617578801e-06</Real>
+    <Real Name="Cell 2 3 2">0.00027367068550576538</Real>
+    <Real Name="Cell 2 3 3">0.00090916489905835962</Real>
+    <Real Name="Cell 2 3 4">0.0003293879592674014</Real>
+    <Real Name="Cell 2 3 5">5.3868519911400891e-06</Real>
+    <Real Name="Cell 2 4 1">0.00041147741855951522</Real>
+    <Real Name="Cell 2 4 2">0.039699304448304058</Real>
+    <Real Name="Cell 2 4 3">0.13188556916399827</Real>
+    <Real Name="Cell 2 4 4">0.047781781422426631</Real>
+    <Real Name="Cell 2 4 5">0.00078142924522224002</Real>
+    <Real Name="Cell 2 5 1">0.0015763831713481692</Real>
+    <Real Name="Cell 2 5 2">0.15208930702835738</Real>
+    <Real Name="Cell 2 5 3">0.50525784015467523</Real>
+    <Real Name="Cell 2 5 4">0.18305353522201961</Real>
+    <Real Name="Cell 2 5 5">0.0029936804699514058</Real>
+    <Real Name="Cell 2 6 1">0.00094390925093352292</Real>
+    <Real Name="Cell 2 6 2">0.091068279896289378</Real>
+    <Real Name="Cell 2 6 3">0.30253910222906988</Real>
+    <Real Name="Cell 2 6 4">0.10960909025968489</Real>
+    <Real Name="Cell 2 6 5">0.0017925608070970924</Real>
+    <Real Name="Cell 2 7 1">0.0019646740184617322</Real>
+    <Real Name="Cell 2 7 2">0.18955157314253454</Real>
+    <Real Name="Cell 2 7 3">0.6297117155386931</Real>
+    <Real Name="Cell 2 7 4">0.22814283428989943</Real>
+    <Real Name="Cell 2 7 5">0.0037310765211098474</Real>
+    <Real Name="Cell 2 8 1">0.0013270486794346719</Real>
+    <Real Name="Cell 2 8 2">0.12803353760463274</Real>
+    <Real Name="Cell 2 8 3">0.42534185960501181</Real>
+    <Real Name="Cell 2 8 4">0.15410019378377163</Real>
+    <Real Name="Cell 2 8 5">0.0025201738933185646</Real>
+    <Real Name="Cell 2 9 1">6.9697842528280385e-05</Real>
+    <Real Name="Cell 2 9 2">0.0067244415978077558</Real>
+    <Real Name="Cell 2 9 3">0.022339353793762201</Real>
+    <Real Name="Cell 2 9 4">0.0080934868527161204</Real>
+    <Real Name="Cell 2 9 5">0.00013236189891333038</Real>
+    <Real Name="Cell 3 3 1">2.5786874325345551e-07</Real>
+    <Real Name="Cell 3 3 2">2.4879153227796859e-05</Real>
+    <Real Name="Cell 3 3 3">8.2651354459850881e-05</Real>
+    <Real Name="Cell 3 3 4">2.9944359933400128e-05</Real>
+    <Real Name="Cell 3 3 5">4.8971381737637177e-07</Real>
+    <Real Name="Cell 3 4 1">3.740703805086502e-05</Real>
+    <Real Name="Cell 3 4 2">0.0036090276771185504</Real>
+    <Real Name="Cell 3 4 3">0.011989597196727115</Real>
+    <Real Name="Cell 3 4 4">0.0043437983111296935</Real>
+    <Real Name="Cell 3 4 5">7.1039022292930911e-05</Real>
+    <Real Name="Cell 3 5 1">0.00014331042408192321</Real>
+    <Real Name="Cell 3 5 2">0.013826576865775059</Real>
+    <Real Name="Cell 3 5 3">0.04593344857986336</Real>
+    <Real Name="Cell 3 5 4">0.016641562939248615</Real>
+    <Real Name="Cell 3 5 5">0.00027215820716202635</Real>
+    <Real Name="Cell 3 6 1">9.1450997628283247e-05</Real>
+    <Real Name="Cell 3 6 2">0.0088231840514019239</Real>
+    <Real Name="Cell 3 6 3">0.029311613052897353</Real>
+    <Real Name="Cell 3 6 4">0.010619517335446353</Real>
+    <Real Name="Cell 3 6 5">0.00017367291819236018</Real>
+    <Real Name="Cell 3 7 1">0.00021660276937457876</Real>
+    <Real Name="Cell 3 7 2">0.020897815767995674</Real>
+    <Real Name="Cell 3 7 3">0.069424902152516871</Real>
+    <Real Name="Cell 3 7 4">0.02515245239454484</Real>
+    <Real Name="Cell 3 7 5">0.00041134636058027727</Real>
+    <Real Name="Cell 3 8 1">0.0001464943672049502</Real>
+    <Real Name="Cell 3 8 2">0.014133763412802673</Real>
+    <Real Name="Cell 3 8 3">0.046953956952926076</Real>
+    <Real Name="Cell 3 8 4">0.017011290334979112</Real>
+    <Real Name="Cell 3 8 5">0.00027820477535565294</Real>
+    <Real Name="Cell 3 9 1">7.6940217001537177e-06</Real>
+    <Real Name="Cell 3 9 2">0.00074231852376142285</Real>
+    <Real Name="Cell 3 9 3">0.0024660659013494768</Real>
+    <Real Name="Cell 3 9 4">0.00089344893924714482</Real>
+    <Real Name="Cell 3 9 5">1.4611575991028642e-05</Real>
+    <Real Name="Cell 4 5 1">2.6663407980159471e-13</Real>
+    <Real Name="Cell 4 5 2">2.572483211203457e-11</Real>
+    <Real Name="Cell 4 5 3">8.5460795142190869e-11</Real>
+    <Real Name="Cell 4 5 4">3.0962212617767103e-11</Real>
+    <Real Name="Cell 4 5 5">5.0635990781533139e-13</Real>
+    <Real Name="Cell 4 6 1">5.2534892025840471e-10</Real>
+    <Real Name="Cell 4 6 2">5.068561672214742e-08</Real>
+    <Real Name="Cell 4 6 3">1.6838333826562169e-07</Real>
+    <Real Name="Cell 4 6 4">6.1004823463147626e-08</Real>
+    <Real Name="Cell 4 6 5">9.9768053292690404e-10</Real>
+    <Real Name="Cell 4 7 1">3.538547462988964e-09</Real>
+    <Real Name="Cell 4 7 2">3.4139874195223763e-07</Real>
+    <Real Name="Cell 4 7 3">1.1341651452074072e-06</Real>
+    <Real Name="Cell 4 7 4">4.1090493379034813e-07</Real>
+    <Real Name="Cell 4 7 5">6.7199908147246159e-09</Real>
+    <Real Name="Cell 4 8 1">2.407727552839278e-09</Real>
+    <Real Name="Cell 4 8 2">2.3229733841375152e-07</Real>
+    <Real Name="Cell 4 8 3">7.7171797132804255e-07</Real>
+    <Real Name="Cell 4 8 4">2.7959131282894596e-07</Real>
+    <Real Name="Cell 4 8 5">4.5724713907814518e-09</Real>
+    <Real Name="Cell 4 9 1">1.2645611154240632e-10</Real>
+    <Real Name="Cell 4 9 2">1.2200474303171441e-08</Real>
+    <Real Name="Cell 4 9 3">4.0531352372679661e-08</Real>
+    <Real Name="Cell 4 9 4">1.4684398240860733e-08</Real>
+    <Real Name="Cell 4 9 5">2.4015049025595398e-10</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_5.xml b/src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_5.xml
new file mode 100644 (file)
index 0000000..e47a5b3
--- /dev/null
@@ -0,0 +1,286 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">10</Int>
+      <Real>0.041666666666666664</Real>
+      <Real>0.45833333333333331</Real>
+      <Real>0.45833333333333331</Real>
+      <Real>0.041666666666666664</Real>
+      <Real>0</Real>
+      <Real>0.029752489058852732</Real>
+      <Real>0.41658437180005581</Real>
+      <Real>0.49682555640762804</Real>
+      <Real>0.056835811160773388</Real>
+      <Real>1.7715726899575947e-06</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">10</Int>
+      <Real>0.027337528967867834</Real>
+      <Real>0.40631679437954138</Real>
+      <Real>0.50535822938281461</Real>
+      <Real>0.060983280642845715</Real>
+      <Real>4.1666269303803459e-06</Real>
+      <Real>0.013183618402672702</Real>
+      <Real>0.32486998158342723</Real>
+      <Real>0.56087229174427855</Real>
+      <Real>0.10091134876601435</Real>
+      <Real>0.00016275950360727571</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">10</Int>
+      <Real>0.016229200955435938</Real>
+      <Real>0.34661470190678911</Real>
+      <Real>0.54816403361650479</Real>
+      <Real>0.088911029781390039</Real>
+      <Real>8.1033739880025853e-05</Real>
+      <Real>0.016229200955435938</Real>
+      <Real>0.34661470190678911</Real>
+      <Real>0.54816403361650479</Real>
+      <Real>0.088911029781390039</Real>
+      <Real>8.1033739880025853e-05</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">10</Int>
+      <Real>-0.16666666666666666</Real>
+      <Real>-0.5</Real>
+      <Real>0.5</Real>
+      <Real>0.16666666666666666</Real>
+      <Real>0</Real>
+      <Real>-0.12946419015888011</Real>
+      <Real>-0.53094518105292088</Real>
+      <Real>0.45037068850043538</Real>
+      <Real>0.2099509267934124</Real>
+      <Real>8.775591795322617e-05</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">10</Int>
+      <Real>-0.12150009655954666</Real>
+      <Real>-0.53566661421450723</Real>
+      <Real>0.43600018358223114</Real>
+      <Real>0.22099986171724609</Real>
+      <Real>0.00016666547457665597</Real>
+      <Real>-0.070312598610667756</Real>
+      <Real>-0.5416667104934868</Real>
+      <Real>0.29687537252892304</Real>
+      <Real>0.31249978086528524</Real>
+      <Real>0.0026041557099462918</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">10</Int>
+      <Real>-0.082173168712625921</Real>
+      <Real>-0.54502400027406206</Real>
+      <Real>0.33811100654143089</Real>
+      <Real>0.28754266258982814</Real>
+      <Real>0.0015434998554289384</Real>
+      <Real>-0.082173168712625921</Real>
+      <Real>-0.54502400027406206</Real>
+      <Real>0.33811100654143089</Real>
+      <Real>0.28754266258982814</Real>
+      <Real>0.0015434998554289384</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">5</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">0</Int>
+      <Int Name="Y">8</Int>
+      <Int Name="Z">1</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 10 1">0.0010751645522037692</Real>
+    <Real Name="Cell 0 10 2">0.022962796614951739</Real>
+    <Real Name="Cell 0 10 3">0.036315191324320512</Real>
+    <Real Name="Cell 0 10 4">0.0058902460930379454</Real>
+    <Real Name="Cell 0 10 5">5.3683853500084065e-06</Real>
+    <Real Name="Cell 0 11 1">0.00019344208424144707</Real>
+    <Real Name="Cell 0 11 2">0.0041314338610810618</Real>
+    <Real Name="Cell 0 11 3">0.0065337778156883391</Real>
+    <Real Name="Cell 0 11 4">0.0010597647388921291</Real>
+    <Real Name="Cell 0 11 5">9.6587229274655367e-07</Real>
+    <Real Name="Cell 0 12 1">3.1200195015625759e-07</Real>
+    <Real Name="Cell 0 12 2">6.6635728551703785e-06</Real>
+    <Real Name="Cell 0 12 3">1.0538303639439763e-05</Real>
+    <Real Name="Cell 0 12 4">1.7092902329799047e-06</Real>
+    <Real Name="Cell 0 12 5">1.5578514888346727e-09</Real>
+    <Real Name="Cell 0 5 1">5.7491749784508192e-05</Real>
+    <Real Name="Cell 0 5 2">0.001227878425338146</Real>
+    <Real Name="Cell 0 5 3">0.0019418645161942477</Real>
+    <Real Name="Cell 0 5 4">0.00031496625689156278</Real>
+    <Real Name="Cell 0 5 5">2.8706105187051263e-07</Real>
+    <Real Name="Cell 0 6 1">0.00085449798711393883</Real>
+    <Real Name="Cell 0 6 2">0.018249916671605682</Real>
+    <Real Name="Cell 0 6 3">0.028861868469049271</Real>
+    <Real Name="Cell 0 6 4">0.0046813331222556476</Real>
+    <Real Name="Cell 0 6 5">4.2665789773589398e-06</Real>
+    <Real Name="Cell 0 7 1">0.0010627854810640884</Real>
+    <Real Name="Cell 0 7 2">0.022698410952050312</Real>
+    <Real Name="Cell 0 7 3">0.035897070827384997</Real>
+    <Real Name="Cell 0 7 4">0.0058224278458064039</Real>
+    <Real Name="Cell 0 7 5">5.3065756260766044e-06</Real>
+    <Real Name="Cell 0 8 1">0.00015352225267788552</Real>
+    <Real Name="Cell 0 8 2">0.0032788471837968359</Real>
+    <Real Name="Cell 0 8 3">0.005185429492732623</Real>
+    <Real Name="Cell 0 8 4">0.00084106553473771526</Real>
+    <Real Name="Cell 0 8 5">7.6654927888661482e-07</Real>
+    <Real Name="Cell 0 9 1">0.00062276851270917242</Real>
+    <Real Name="Cell 0 9 2">0.013300760954427771</Real>
+    <Real Name="Cell 0 9 3">0.021034880329192499</Real>
+    <Real Name="Cell 0 9 4">0.0034118124442750713</Real>
+    <Real Name="Cell 0 9 5">3.1095345854006703e-06</Real>
+    <Real Name="Cell 1 10 1">0.015054093413008941</Real>
+    <Real Name="Cell 1 10 2">0.32151737569552391</Real>
+    <Real Name="Cell 1 10 3">0.50847312756643193</Real>
+    <Real Name="Cell 1 10 4">0.0824732500048036</Real>
+    <Real Name="Cell 1 10 5">7.5166330930838442e-05</Real>
+    <Real Name="Cell 1 11 1">0.0027085111764603431</Real>
+    <Real Name="Cell 1 11 2">0.057846951098695719</Real>
+    <Real Name="Cell 1 11 3">0.09148376532281377</Real>
+    <Real Name="Cell 1 11 4">0.014838470392643226</Real>
+    <Real Name="Cell 1 11 5">1.3523819856449285e-05</Real>
+    <Real Name="Cell 1 12 1">4.3685466499672006e-06</Real>
+    <Real Name="Cell 1 12 2">9.3301111927947657e-05</Real>
+    <Real Name="Cell 1 12 3">0.0001475537926521143</Real>
+    <Real Name="Cell 1 12 4">2.3932908487803748e-05</Real>
+    <Real Name="Cell 1 12 5">2.1812513990014341e-08</Real>
+    <Real Name="Cell 1 5 1">0.00063240924762959002</Real>
+    <Real Name="Cell 1 5 2">0.013506662678719604</Real>
+    <Real Name="Cell 1 5 3">0.021360509678136724</Real>
+    <Real Name="Cell 1 5 4">0.0034646288258071904</Real>
+    <Real Name="Cell 1 5 5">3.1576715705756388e-06</Real>
+    <Real Name="Cell 1 6 1">0.0093994778582533259</Real>
+    <Real Name="Cell 1 6 2">0.20074908338766254</Real>
+    <Real Name="Cell 1 6 3">0.31748055315954199</Real>
+    <Real Name="Cell 1 6 4">0.051494664344812119</Real>
+    <Real Name="Cell 1 6 5">4.6932368750948339e-05</Real>
+    <Real Name="Cell 1 7 1">0.011690640291704973</Real>
+    <Real Name="Cell 1 7 2">0.24968252047255343</Real>
+    <Real Name="Cell 1 7 3">0.39486777910123499</Real>
+    <Real Name="Cell 1 7 4">0.064046706303870451</Real>
+    <Real Name="Cell 1 7 5">5.837233188684265e-05</Real>
+    <Real Name="Cell 1 8 1">0.0017646038879238295</Real>
+    <Real Name="Cell 1 8 2">0.037687477792393252</Real>
+    <Real Name="Cell 1 8 3">0.059601972247173424</Real>
+    <Real Name="Cell 1 8 4">0.0096673119805692799</Real>
+    <Real Name="Cell 1 8 5">8.8108128575120559e-06</Real>
+    <Real Name="Cell 1 9 1">0.0087197695148449033</Real>
+    <Real Name="Cell 1 9 2">0.18623223160420144</Real>
+    <Real Name="Cell 1 9 3">0.2945224501556627</Real>
+    <Real Name="Cell 1 9 4">0.047770909310328825</Real>
+    <Real Name="Cell 1 9 5">4.3538528891223591e-05</Real>
+    <Real Name="Cell 2 10 1">0.017953766013383547</Real>
+    <Real Name="Cell 2 10 2">0.38344705151665431</Real>
+    <Real Name="Cell 2 10 3">0.60641363820236704</Real>
+    <Real Name="Cell 2 10 4">0.098358990629749982</Real>
+    <Real Name="Cell 2 10 5">8.9644635554781787e-05</Real>
+    <Real Name="Cell 2 11 1">0.0032302161659752619</Real>
+    <Real Name="Cell 2 11 2">0.068989250705468977</Real>
+    <Real Name="Cell 2 11 3">0.10910508335292701</Real>
+    <Real Name="Cell 2 11 4">0.017696610358204752</Real>
+    <Real Name="Cell 2 11 5">1.6128735929061189e-05</Real>
+    <Real Name="Cell 2 12 1">5.2100025036569159e-06</Real>
+    <Real Name="Cell 2 12 2">0.00011127248160260143</Real>
+    <Real Name="Cell 2 12 3">0.00017597514476521862</Real>
+    <Real Name="Cell 2 12 4">2.8542790802562579e-05</Real>
+    <Real Name="Cell 2 12 5">2.6013972518727584e-08</Real>
+    <Real Name="Cell 2 5 1">0.00063240924762959002</Real>
+    <Real Name="Cell 2 5 2">0.013506662678719604</Real>
+    <Real Name="Cell 2 5 3">0.021360509678136724</Real>
+    <Real Name="Cell 2 5 4">0.0034646288258071904</Real>
+    <Real Name="Cell 2 5 5">3.1576715705756388e-06</Real>
+    <Real Name="Cell 2 6 1">0.0093994778582533259</Real>
+    <Real Name="Cell 2 6 2">0.20074908338766254</Real>
+    <Real Name="Cell 2 6 3">0.31748055315954199</Real>
+    <Real Name="Cell 2 6 4">0.051494664344812119</Real>
+    <Real Name="Cell 2 6 5">4.6932368750948339e-05</Real>
+    <Real Name="Cell 2 7 1">0.011690640291704973</Real>
+    <Real Name="Cell 2 7 2">0.24968252047255343</Real>
+    <Real Name="Cell 2 7 3">0.39486777910123499</Real>
+    <Real Name="Cell 2 7 4">0.064046706303870451</Real>
+    <Real Name="Cell 2 7 5">5.837233188684265e-05</Real>
+    <Real Name="Cell 2 8 1">0.0018327623218823642</Real>
+    <Real Name="Cell 2 8 2">0.039143169624285816</Real>
+    <Real Name="Cell 2 8 3">0.061904118987871723</Real>
+    <Real Name="Cell 2 8 4">0.010040715241036667</Real>
+    <Real Name="Cell 2 8 5">9.1511335438595772e-06</Real>
+    <Real Name="Cell 2 9 1">0.010399325802697977</Real>
+    <Real Name="Cell 2 9 2">0.2221033076755636</Real>
+    <Real Name="Cell 2 9 3">0.35125182037934749</Real>
+    <Real Name="Cell 2 9 4">0.056972291407874874</Real>
+    <Real Name="Cell 2 9 5">5.192469206200872e-05</Real>
+    <Real Name="Cell 3 10 1">0.0020538735207980365</Real>
+    <Real Name="Cell 3 10 2">0.043865545822033121</Real>
+    <Real Name="Cell 3 10 3">0.069372459974480716</Real>
+    <Real Name="Cell 3 10 4">0.011252064120489992</Real>
+    <Real Name="Cell 3 10 5">1.0255160009900213e-05</Real>
+    <Real Name="Cell 3 11 1">0.00036953001642133035</Real>
+    <Real Name="Cell 3 11 2">0.0078922269087184273</Real>
+    <Real Name="Cell 3 11 3">0.012481394795721081</Real>
+    <Real Name="Cell 3 11 4">0.0020244554482609718</Real>
+    <Real Name="Cell 3 11 5">1.8450938718900976e-06</Real>
+    <Real Name="Cell 3 12 1">5.9601345910243233e-07</Real>
+    <Real Name="Cell 3 12 2">1.2729340651243087e-05</Real>
+    <Real Name="Cell 3 12 3">2.0131190853353941e-05</Real>
+    <Real Name="Cell 3 12 4">3.2652359507949797e-06</Real>
+    <Real Name="Cell 3 12 5">2.9759443944603989e-09</Real>
+    <Real Name="Cell 3 5 1">5.7491749784508192e-05</Real>
+    <Real Name="Cell 3 5 2">0.001227878425338146</Real>
+    <Real Name="Cell 3 5 3">0.0019418645161942477</Real>
+    <Real Name="Cell 3 5 4">0.00031496625689156278</Real>
+    <Real Name="Cell 3 5 5">2.8706105187051263e-07</Real>
+    <Real Name="Cell 3 6 1">0.00085449798711393883</Real>
+    <Real Name="Cell 3 6 2">0.018249916671605682</Real>
+    <Real Name="Cell 3 6 3">0.028861868469049271</Real>
+    <Real Name="Cell 3 6 4">0.0046813331222556476</Real>
+    <Real Name="Cell 3 6 5">4.2665789773589398e-06</Real>
+    <Real Name="Cell 3 7 1">0.0010627854810640884</Real>
+    <Real Name="Cell 3 7 2">0.022698410952050312</Real>
+    <Real Name="Cell 3 7 3">0.035897070827384997</Real>
+    <Real Name="Cell 3 7 4">0.0058224278458064039</Real>
+    <Real Name="Cell 3 7 5">5.3065756260766044e-06</Real>
+    <Real Name="Cell 3 8 1">0.00017652735697550178</Real>
+    <Real Name="Cell 3 8 2">0.0037701780503224622</Real>
+    <Real Name="Cell 3 8 3">0.0059624591690658774</Real>
+    <Real Name="Cell 3 8 4">0.00096709808057566919</Real>
+    <Real Name="Cell 3 8 5">8.8141566341687076e-07</Real>
+    <Real Name="Cell 3 9 1">0.0011896589961273134</Real>
+    <Real Name="Cell 3 9 2">0.025408108473466265</Real>
+    <Real Name="Cell 3 9 3">0.040182401816084533</Real>
+    <Real Name="Cell 3 9 4">0.0065174993349839203</Real>
+    <Real Name="Cell 3 9 5">5.9400655585464031e-06</Real>
+    <Real Name="Cell 4 10 1">6.401925412448607e-08</Real>
+    <Real Name="Cell 4 10 2">1.3672894152697775e-06</Real>
+    <Real Name="Cell 4 10 3">2.1623401340806e-06</Real>
+    <Real Name="Cell 4 10 4">3.5072692892733134e-07</Real>
+    <Real Name="Cell 4 10 5">3.196534198006378e-10</Real>
+    <Real Name="Cell 4 11 1">1.1518253577129072e-08</Real>
+    <Real Name="Cell 4 11 2">2.4600077607555631e-07</Real>
+    <Real Name="Cell 4 11 3">3.8904517593899047e-07</Real>
+    <Real Name="Cell 4 11 4">6.3102292567441842e-08</Real>
+    <Real Name="Cell 4 11 5">5.7511590792683178e-11</Real>
+    <Real Name="Cell 4 12 1">1.8577744302904731e-11</Real>
+    <Real Name="Cell 4 12 2">3.9677365024524121e-10</Real>
+    <Real Name="Cell 4 12 3">6.2748938044083474e-10</Real>
+    <Real Name="Cell 4 12 4">1.0177743078801153e-10</Real>
+    <Real Name="Cell 4 12 5">9.2760210655656188e-14</Real>
+    <Real Name="Cell 4 8 1">1.5048085441627889e-09</Real>
+    <Real Name="Cell 4 8 2">3.2138906061611698e-08</Real>
+    <Real Name="Cell 4 8 3">5.0827019990319494e-08</Real>
+    <Real Name="Cell 4 8 4">8.2440335573350497e-09</Real>
+    <Real Name="Cell 4 8 5">7.5136332633852933e-12</Real>
+    <Real Name="Cell 4 9 1">3.7081407326659395e-08</Real>
+    <Real Name="Cell 4 9 2">7.9196511165937594e-07</Real>
+    <Real Name="Cell 4 9 3">1.2524765617342267e-06</Real>
+    <Real Name="Cell 4 9 4">2.0314901024453476e-07</Real>
+    <Real Name="Cell 4 9 5">1.8515052737006967e-10</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_6.xml b/src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_6.xml
new file mode 100644 (file)
index 0000000..3bfaace
--- /dev/null
@@ -0,0 +1,131 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">6</Int>
+      <Real>0.16406923832149337</Real>
+      <Real>0.74469524848411051</Real>
+      <Real>0.091235513194396184</Real>
+      <Real>0.0022143185924122905</Real>
+      <Real>0.56211936943313945</Real>
+      <Real>0.43566631197444827</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">6</Int>
+      <Real>0.0072230479931503222</Real>
+      <Real>0.60574581716221632</Real>
+      <Real>0.38703113484463336</Real>
+      <Real>0.038167928761842988</Real>
+      <Real>0.69995358766683513</Real>
+      <Real>0.26187848357132187</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">6</Int>
+      <Real>0.2794087591578463</Real>
+      <Real>0.68872346271189799</Real>
+      <Real>0.031867778130255688</Real>
+      <Real>0.2794087591578463</Real>
+      <Real>0.68872346271189799</Real>
+      <Real>0.031867778130255688</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">6</Int>
+      <Real>-0.57283372512709718</Real>
+      <Real>0.14566745025419436</Real>
+      <Real>0.42716627487290282</Real>
+      <Real>-0.066548006617964006</Real>
+      <Real>-0.86690398676407199</Real>
+      <Real>0.93345199338203599</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">6</Int>
+      <Real>-0.12019191314851696</Real>
+      <Real>-0.75961617370296608</Real>
+      <Real>0.87980808685148304</Real>
+      <Real>-0.27628944519052112</Real>
+      <Real>-0.44742110961895776</Real>
+      <Real>0.72371055480947888</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">6</Int>
+      <Real>-0.74754098102759059</Real>
+      <Real>0.49508196205518118</Real>
+      <Real>0.25245901897240941</Real>
+      <Real>-0.74754098102759059</Real>
+      <Real>0.49508196205518118</Real>
+      <Real>0.25245901897240941</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Int Name="X">4</Int>
+      <Int Name="Y">2</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">15</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 4 0">0.023798943058854972</Real>
+    <Real Name="Cell 0 4 1">0.058662765339858897</Real>
+    <Real Name="Cell 0 4 2">0.0027143724463760469</Real>
+    <Real Name="Cell 0 5 0">0.43644379239613479</Real>
+    <Real Name="Cell 0 5 1">1.0758040688637358</Real>
+    <Real Name="Cell 0 5 2">0.049778303244065715</Real>
+    <Real Name="Cell 0 6 0">0.16328973882082448</Real>
+    <Real Name="Cell 0 6 1">0.40249802720918582</Real>
+    <Real Name="Cell 0 6 2">0.018623901352891086</Real>
+    <Real Name="Cell 1 4 0">0.018445188540286542</Real>
+    <Real Name="Cell 1 4 1">0.045466126975150789</Real>
+    <Real Name="Cell 1 4 2">0.002103753575028464</Real>
+    <Real Name="Cell 1 5 0">0.33826241854841871</Real>
+    <Real Name="Cell 1 5 1">0.83379370392735974</Real>
+    <Real Name="Cell 1 5 2">0.038580292674414464</Real>
+    <Real Name="Cell 1 6 0">0.12655646142754229</Real>
+    <Real Name="Cell 1 6 1">0.31195301323284946</Real>
+    <Real Name="Cell 1 6 2">0.014434312102022459</Real>
+    <Real Name="Cell 15 4 0">9.3749557408290193e-05</Real>
+    <Real Name="Cell 15 4 1">0.00023108624081992141</Real>
+    <Real Name="Cell 15 4 2">1.0692542725939677e-05</Real>
+    <Real Name="Cell 15 5 0">0.001719253341190267</Real>
+    <Real Name="Cell 15 5 1">0.004237841784174824</Real>
+    <Real Name="Cell 15 5 2">0.00019608828367402901</Real>
+    <Real Name="Cell 15 6 0">0.00064323615993827751</Real>
+    <Real Name="Cell 15 6 1">0.0015855330976360846</Real>
+    <Real Name="Cell 15 6 2">7.3363867661322939e-05</Real>
+    <Real Name="Cell 4 2 0">0.0010297885376019896</Real>
+    <Real Name="Cell 4 2 1">0.0025383582448021734</Real>
+    <Real Name="Cell 4 2 2">0.00011745183914882688</Real>
+    <Real Name="Cell 4 3 0">0.086361062505128913</Real>
+    <Real Name="Cell 4 3 1">0.21287410670761991</Real>
+    <Real Name="Cell 4 3 2">0.0098498529083400309</Real>
+    <Real Name="Cell 4 4 0">0.055178953086848032</Real>
+    <Real Name="Cell 4 4 1">0.1360123417509696</Real>
+    <Real Name="Cell 4 4 2">0.0062933983878367631</Real>
+    <Real Name="Cell 5 2 0">0.0046741158716962243</Real>
+    <Real Name="Cell 5 2 1">0.011521375628931728</Real>
+    <Real Name="Cell 5 2 2">0.00053310314251878404</Real>
+    <Real Name="Cell 5 3 0">0.39198495439826581</Real>
+    <Real Name="Cell 5 3 1">0.96621607689695022</Real>
+    <Real Name="Cell 5 3 2">0.044707580373689722</Real>
+    <Real Name="Cell 5 4 0">0.25045221517750116</Real>
+    <Real Name="Cell 5 4 1">0.61734756419525116</Real>
+    <Real Name="Cell 5 4 2">0.028565158979138368</Real>
+    <Real Name="Cell 6 2 0">0.00057264412677849458</Real>
+    <Real Name="Cell 6 2 1">0.0014115285687007091</Real>
+    <Real Name="Cell 6 2 2">6.5312540790683421e-05</Real>
+    <Real Name="Cell 6 3 0">0.048023602341771679</Real>
+    <Real Name="Cell 6 3 1">0.11837489202705763</Real>
+    <Real Name="Cell 6 3 2">0.0054772996704038042</Real>
+    <Real Name="Cell 6 4 0">0.030683875624164414</Real>
+    <Real Name="Cell 6 4 1">0.075633652763753279</Real>
+    <Real Name="Cell 6 4 2">0.0034996288001652408</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_7.xml b/src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_7.xml
new file mode 100644 (file)
index 0000000..540766d
--- /dev/null
@@ -0,0 +1,131 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">6</Int>
+      <Real>0.27583138988857209</Real>
+      <Real>0.69107726881128639</Real>
+      <Real>0.033091341300141533</Real>
+      <Real>0.0031225352025811837</Real>
+      <Real>0.57278068745366728</Real>
+      <Real>0.42409677734375156</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">6</Int>
+      <Real>0.42345016376210792</Real>
+      <Real>0.57337154943618318</Real>
+      <Real>0.0031782868017088757</Real>
+      <Real>0.047455630860650959</Real>
+      <Real>0.7131654522986024</Real>
+      <Real>0.23937891684074664</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">6</Int>
+      <Real>0.32131281751025292</Real>
+      <Real>0.65901370721545616</Real>
+      <Real>0.019673475274290902</Real>
+      <Real>0.32131281751025292</Real>
+      <Real>0.65901370721545616</Real>
+      <Real>0.019673475274290902</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">6</Int>
+      <Real>-0.74274004858843057</Real>
+      <Real>0.48548009717686114</Real>
+      <Real>0.25725995141156943</Real>
+      <Real>-0.079025757858829593</Real>
+      <Real>-0.84194848428234081</Real>
+      <Real>0.92097424214117041</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">6</Int>
+      <Real>-0.92027187696039903</Real>
+      <Real>0.84054375392079805</Real>
+      <Real>0.079728123039600973</Real>
+      <Real>-0.30807671401990433</Real>
+      <Real>-0.38384657196019134</Real>
+      <Real>0.69192328598009567</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">6</Int>
+      <Real>-0.801639342235962</Real>
+      <Real>0.60327868447192401</Real>
+      <Real>0.198360657764038</Real>
+      <Real>-0.801639342235962</Real>
+      <Real>0.60327868447192401</Real>
+      <Real>0.198360657764038</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Int Name="X">5</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">18</Int>
+      <Int Name="Y">6</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 6 0">0.034673260125936183</Real>
+    <Real Name="Cell 0 6 1">0.07111497721720958</Real>
+    <Real Name="Cell 0 6 2">0.0021229888401351907</Real>
+    <Real Name="Cell 0 7 0">0.52107138377300621</Real>
+    <Real Name="Cell 0 7 1">1.0687192219873987</Real>
+    <Real Name="Cell 0 7 2">0.03190437612863567</Real>
+    <Real Name="Cell 0 8 0">0.17490121407628884</Real>
+    <Real Name="Cell 0 8 1">0.35872299890813186</Real>
+    <Real Name="Cell 0 8 2">0.010708924521703933</Real>
+    <Real Name="Cell 1 6 0">0.02567268450474881</Real>
+    <Real Name="Cell 1 6 1">0.052654765286814134</Real>
+    <Real Name="Cell 1 6 2">0.0015718978400627616</Real>
+    <Real Name="Cell 1 7 0">0.38581031006227273</Real>
+    <Real Name="Cell 1 7 1">0.79129828895783105</Real>
+    <Real Name="Cell 1 7 2">0.02362255466305644</Real>
+    <Real Name="Cell 1 8 0">0.12949989912022614</Real>
+    <Real Name="Cell 1 8 1">0.26560474388957295</Real>
+    <Real Name="Cell 1 8 2">0.0079290738636146659</Real>
+    <Real Name="Cell 18 6 0">0.00018902256605893007</Real>
+    <Real Name="Cell 18 6 1">0.00038768594098148308</Real>
+    <Real Name="Cell 18 6 2">1.1573552553734388e-05</Real>
+    <Real Name="Cell 18 7 0">0.0028406400120124793</Real>
+    <Real Name="Cell 18 7 1">0.0058261625530116505</Real>
+    <Real Name="Cell 18 7 2">0.00017392789205399704</Real>
+    <Real Name="Cell 18 8 0">0.00095348046798728145</Real>
+    <Real Name="Cell 18 8 1">0.0019555917589430616</Real>
+    <Real Name="Cell 18 8 2">5.8380099981129861e-05</Real>
+    <Real Name="Cell 5 4 0">0.11671708100942477</Real>
+    <Real Name="Cell 5 4 1">0.23938713944685172</Real>
+    <Real Name="Cell 5 4 2">0.0071464021420591314</Real>
+    <Real Name="Cell 5 5 0">0.15804044799387293</Real>
+    <Real Name="Cell 5 5 1">0.32414150898013988</Real>
+    <Real Name="Cell 5 5 2">0.0096765665000155283</Real>
+    <Real Name="Cell 5 6 0">0.00087604254255205336</Real>
+    <Real Name="Cell 5 6 1">0.0017967663043110956</Real>
+    <Real Name="Cell 5 6 2">5.3638698367751239e-05</Real>
+    <Real Name="Cell 6 4 0">0.29242691196315057</Real>
+    <Real Name="Cell 6 4 1">0.59976861438543239</Real>
+    <Real Name="Cell 6 4 2">0.017904836995370432</Real>
+    <Real Name="Cell 6 5 0">0.3959598695617596</Real>
+    <Real Name="Cell 6 5 1">0.81211507082227463</Real>
+    <Real Name="Cell 6 5 2">0.024243996127500132</Real>
+    <Real Name="Cell 6 6 0">0.0021948665375392468</Real>
+    <Real Name="Cell 6 6 1">0.0045016789089054494</Real>
+    <Real Name="Cell 6 6 2">0.00013438820427781094</Real>
+    <Real Name="Cell 7 4 0">0.014002484506202902</Real>
+    <Real Name="Cell 7 4 1">0.028719144465394086</Real>
+    <Real Name="Cell 7 4 2">0.00085734996457971643</Real>
+    <Real Name="Cell 7 5 0">0.018960026289630026</Real>
+    <Real Name="Cell 7 5 1">0.038887079920591365</Real>
+    <Real Name="Cell 7 5 2">0.0011608924016765663</Real>
+    <Real Name="Cell 7 6 0">0.00010509834569859741</Real>
+    <Real Name="Cell 7 6 1">0.00021555707287909291</Real>
+    <Real Name="Cell 7 6 2">6.4350053679519218e-06</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_8.xml b/src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_8.xml
new file mode 100644 (file)
index 0000000..1276044
--- /dev/null
@@ -0,0 +1,217 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">8</Int>
+      <Real>0.03132813098882218</Real>
+      <Real>0.52316837458524212</Real>
+      <Real>0.43251258299014644</Real>
+      <Real>0.012990911435789263</Real>
+      <Real>4.9119496114044609e-05</Real>
+      <Real>0.20200763007971881</Real>
+      <Real>0.6623853879701842</Real>
+      <Real>0.13555786245398288</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">8</Int>
+      <Real>0.00028938398568676441</Real>
+      <Real>0.23311751927701518</Real>
+      <Real>0.65308872263742623</Real>
+      <Real>0.11350437409987174</Real>
+      <Real>0.0035151319538936445</Real>
+      <Real>0.33243392216208922</Real>
+      <Real>0.60087620500466166</Real>
+      <Real>0.063174740879355443</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">8</Int>
+      <Real>0.069623165976186063</Real>
+      <Real>0.61097641840975003</Real>
+      <Real>0.31671864627953228</Real>
+      <Real>0.0026817693345315848</Real>
+      <Real>0.069623165976186063</Real>
+      <Real>0.61097641840975003</Real>
+      <Real>0.31671864627953228</Real>
+      <Real>0.0026817693345315848</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">8</Int>
+      <Real>-0.16406923832149337</Real>
+      <Real>-0.58062601016261717</Real>
+      <Real>0.65345973528971435</Real>
+      <Real>0.091235513194396184</Real>
+      <Real>-0.0022143185924122905</Real>
+      <Real>-0.55990505084072717</Real>
+      <Real>0.12645305745869118</Real>
+      <Real>0.43566631197444827</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">8</Int>
+      <Real>-0.0072230479931503222</Real>
+      <Real>-0.59852276916906599</Real>
+      <Real>0.21871468231758295</Real>
+      <Real>0.38703113484463336</Real>
+      <Real>-0.038167928761842988</Real>
+      <Real>-0.66178565890499219</Real>
+      <Real>0.43807510409551326</Real>
+      <Real>0.26187848357132187</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">8</Int>
+      <Real>-0.2794087591578463</Real>
+      <Real>-0.4093147035540517</Real>
+      <Real>0.65685568458164234</Real>
+      <Real>0.031867778130255688</Real>
+      <Real>-0.2794087591578463</Real>
+      <Real>-0.4093147035540517</Real>
+      <Real>0.65685568458164234</Real>
+      <Real>0.031867778130255688</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Int Name="X">4</Int>
+      <Int Name="Y">2</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">15</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 4 0">0.00019626989228989163</Real>
+    <Real Name="Cell 0 4 1">0.0017223617189997022</Real>
+    <Real Name="Cell 0 4 2">0.00089283981444834208</Real>
+    <Real Name="Cell 0 4 3">7.5599920091953543e-06</Real>
+    <Real Name="Cell 0 5 0">0.018561684440889015</Real>
+    <Real Name="Cell 0 5 1">0.16288761535528778</Real>
+    <Real Name="Cell 0 5 2">0.084437866137788448</Real>
+    <Real Name="Cell 0 5 3">0.00071496542038686304</Real>
+    <Real Name="Cell 0 6 0">0.033550350195300817</Real>
+    <Real Name="Cell 0 6 1">0.29442029116758434</Real>
+    <Real Name="Cell 0 6 2">0.15262192327901958</Real>
+    <Real Name="Cell 0 6 3">0.0012923040636693877</Real>
+    <Real Name="Cell 0 7 0">0.0035274065811664443</Real>
+    <Real Name="Cell 0 7 1">0.030954671609923743</Real>
+    <Real Name="Cell 0 7 2">0.0160463176530449</Real>
+    <Real Name="Cell 0 7 3">0.00013586987415988328</Real>
+    <Real Name="Cell 1 4 0">0.00064357127847102305</Real>
+    <Real Name="Cell 1 4 1">0.0056476442746958991</Real>
+    <Real Name="Cell 1 4 2">0.0029276322218878808</Real>
+    <Real Name="Cell 1 4 3">2.4789302454002272e-05</Real>
+    <Real Name="Cell 1 5 0">0.060863980954117408</Real>
+    <Real Name="Cell 1 5 1">0.53411040092927065</Real>
+    <Real Name="Cell 1 5 2">0.27687275326670341</Real>
+    <Real Name="Cell 1 5 3">0.0023443799978314032</Real>
+    <Real Name="Cell 1 6 0">0.1100119917345689</Real>
+    <Real Name="Cell 1 6 1">0.96540758739842547</Real>
+    <Real Name="Cell 1 6 2">0.50044907622565482</Real>
+    <Real Name="Cell 1 6 3">0.0042374801795916619</Real>
+    <Real Name="Cell 1 7 0">0.011566407545459824</Real>
+    <Real Name="Cell 1 7 1">0.10150073121365499</Real>
+    <Real Name="Cell 1 7 2">0.05261606375912866</Real>
+    <Real Name="Cell 1 7 3">0.00044551891071311598</Real>
+    <Real Name="Cell 15 4 0">4.772432708523316e-08</Real>
+    <Real Name="Cell 15 4 1">4.1880368444498123e-07</Real>
+    <Real Name="Cell 15 4 2">2.1709992725993912e-07</Real>
+    <Real Name="Cell 15 4 3">1.8382622377745602e-09</Real>
+    <Real Name="Cell 15 5 0">4.5133967781542098e-06</Real>
+    <Real Name="Cell 15 5 1">3.9607204868017172e-05</Real>
+    <Real Name="Cell 15 5 2">2.0531627622167349e-05</Real>
+    <Real Name="Cell 15 5 3">1.7384858767220717e-07</Real>
+    <Real Name="Cell 15 6 0">8.1579903461694447e-06</Real>
+    <Real Name="Cell 15 6 1">7.1590248062387306e-05</Real>
+    <Real Name="Cell 15 6 2">3.711103369938734e-05</Real>
+    <Real Name="Cell 15 6 3">3.1423231097024563e-07</Real>
+    <Real Name="Cell 15 7 0">8.577123239745189e-07</Real>
+    <Real Name="Cell 15 7 1">7.5268338688748844e-06</Real>
+    <Real Name="Cell 15 7 2">3.9017686475130664e-06</Real>
+    <Real Name="Cell 15 7 3">3.3037661761480961e-08</Real>
+    <Real Name="Cell 2 4 0">0.00013170753526681934</Real>
+    <Real Name="Cell 2 4 1">0.0011557963078326714</Real>
+    <Real Name="Cell 2 4 2">0.00059914299629506543</Real>
+    <Real Name="Cell 2 4 3">5.0731566749794913e-06</Real>
+    <Real Name="Cell 2 5 0">0.012455877361460551</Real>
+    <Real Name="Cell 2 5 1">0.1093062521899574</Real>
+    <Real Name="Cell 2 5 2">0.056662298544352473</Real>
+    <Real Name="Cell 2 5 3">0.0004797798186034307</Real>
+    <Real Name="Cell 2 6 0">0.022514069172846346</Real>
+    <Real Name="Cell 2 6 1">0.19757167250567123</Real>
+    <Real Name="Cell 2 6 2">0.10241742688211861</Real>
+    <Real Name="Cell 2 6 3">0.00086720475084275505</Real>
+    <Real Name="Cell 2 7 0">0.0023670774017809835</Real>
+    <Real Name="Cell 2 7 1">0.020772230805095403</Real>
+    <Real Name="Cell 2 7 2">0.010767932480797734</Real>
+    <Real Name="Cell 2 7 3">9.1175911057107028e-05</Real>
+    <Real Name="Cell 4 2 0">1.963012758755738e-06</Real>
+    <Real Name="Cell 4 2 1">1.722637124901001e-05</Real>
+    <Real Name="Cell 4 2 2">8.9298257967071154e-06</Real>
+    <Real Name="Cell 4 2 3">7.561200853069517e-08</Real>
+    <Real Name="Cell 4 3 0">0.0015813337546798376</Real>
+    <Real Name="Cell 4 3 1">0.013876956329093026</Real>
+    <Real Name="Cell 4 3 2">0.0071935523051283668</Real>
+    <Real Name="Cell 4 3 3">6.0910363835086094e-05</Real>
+    <Real Name="Cell 4 4 0">0.0044301742962530189</Real>
+    <Real Name="Cell 4 4 1">0.038876887979805687</Real>
+    <Real Name="Cell 4 4 2">0.020153045128277546</Real>
+    <Real Name="Cell 4 4 3">0.00017064299515458792</Real>
+    <Real Name="Cell 4 5 0">0.00076994770116203869</Real>
+    <Real Name="Cell 4 5 1">0.0067566575323464257</Real>
+    <Real Name="Cell 4 5 2">0.0035025237677569509</Real>
+    <Real Name="Cell 4 5 3">2.965711347966705e-05</Real>
+    <Real Name="Cell 5 2 0">3.2781597940035372e-05</Real>
+    <Real Name="Cell 5 2 1">0.00028767412424194992</Real>
+    <Real Name="Cell 5 2 2">0.00014912483764382615</Real>
+    <Real Name="Cell 5 2 3">1.2626929967907567e-06</Real>
+    <Real Name="Cell 5 3 0">0.026407697618725138</Real>
+    <Real Name="Cell 5 3 1">0.23174011528081062</Real>
+    <Real Name="Cell 5 3 2">0.12012970286388032</Real>
+    <Real Name="Cell 5 3 3">0.0010171808862254686</Real>
+    <Real Name="Cell 5 4 0">0.07398229682220657</Real>
+    <Real Name="Cell 5 4 1">0.64922986630081603</Real>
+    <Real Name="Cell 5 4 2">0.33654851183001866</Real>
+    <Real Name="Cell 5 4 3">0.0028496758533484256</Real>
+    <Real Name="Cell 5 5 0">0.012857846115247354</Real>
+    <Real Name="Cell 5 5 1">0.1128337193204423</Real>
+    <Real Name="Cell 5 5 2">0.058490870942073829</Real>
+    <Real Name="Cell 5 5 3">0.00049526299093882893</Real>
+    <Real Name="Cell 6 2 0">2.710112898324477e-05</Real>
+    <Real Name="Cell 6 2 1">0.00023782530554136415</Real>
+    <Real Name="Cell 6 2 2">0.00012328415066841634</Real>
+    <Real Name="Cell 6 2 3">1.0438907168241979e-06</Real>
+    <Real Name="Cell 6 3 0">0.02183171243283278</Real>
+    <Real Name="Cell 6 3 1">0.19158366734609777</Real>
+    <Real Name="Cell 6 3 2">0.09931335800006387</Real>
+    <Real Name="Cell 6 3 3">0.00084092149648449686</Real>
+    <Real Name="Cell 6 4 0">0.061162478178242115</Real>
+    <Real Name="Cell 6 4 1">0.53672985613995938</Real>
+    <Real Name="Cell 6 4 2">0.27823062941923732</Real>
+    <Real Name="Cell 6 4 3">0.0023558776177812664</Real>
+    <Real Name="Cell 6 5 0">0.010629809646663468</Real>
+    <Real Name="Cell 6 5 1">0.093281638880329837</Real>
+    <Real Name="Cell 6 5 2">0.048355441386447436</Real>
+    <Real Name="Cell 6 5 3">0.00040944270693005474</Real>
+    <Real Name="Cell 7 2 0">8.1400722262745183e-07</Real>
+    <Real Name="Cell 7 2 1">7.1433008032225752e-06</Real>
+    <Real Name="Cell 7 2 2">3.7029523434844986e-06</Real>
+    <Real Name="Cell 7 2 3">3.1354213459298767e-08</Real>
+    <Real Name="Cell 7 3 0">0.00065573547189264395</Real>
+    <Real Name="Cell 7 3 1">0.0057543908614875348</Real>
+    <Real Name="Cell 7 3 2">0.0029829676381902064</Real>
+    <Real Name="Cell 7 3 3">2.525784708911082e-05</Real>
+    <Real Name="Cell 7 4 0">0.0018370710320468029</Real>
+    <Real Name="Cell 7 4 1">0.016121172655494686</Real>
+    <Real Name="Cell 7 4 2">0.0083569117007436522</Real>
+    <Real Name="Cell 7 4 3">7.0760941276133623e-05</Real>
+    <Real Name="Cell 7 5 0">0.00031927606532143246</Real>
+    <Real Name="Cell 7 5 1">0.002801799431826586</Real>
+    <Real Name="Cell 7 5 2">0.0014523999559664807</Real>
+    <Real Name="Cell 7 5 3">1.2297986585697413e-05</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_9.xml b/src/gromacs/ewald/tests/refdata/SaneInput2_PmeSplineAndSpreadTest_ReproducesOutputs_9.xml
new file mode 100644 (file)
index 0000000..b1165fd
--- /dev/null
@@ -0,0 +1,217 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Splines Name="Values">
+    <Sequence Name="X">
+      <Int Name="Length">8</Int>
+      <Real>0.068290339976017453</Real>
+      <Real>0.60899706092140171</Real>
+      <Real>0.3198749068175748</Real>
+      <Real>0.0028376922850060237</Real>
+      <Real>8.2253570274950675e-05</Real>
+      <Real>0.20905532008783781</Real>
+      <Real>0.66066835697232906</Real>
+      <Real>0.13019406936955807</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">8</Int>
+      <Real>0.12989642566818113</Real>
+      <Real>0.66056349190443076</Real>
+      <Real>0.20945561614699421</Real>
+      <Real>8.4466280393928373e-05</Real>
+      <Real>0.0048733249390969704</Real>
+      <Real>0.35354067971997882</Real>
+      <Real>0.58637537976265564</Real>
+      <Real>0.055210615578268486</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">8</Int>
+      <Real>0.08585899856030095</Real>
+      <Real>0.63122215961399775</Real>
+      <Real>0.28161802732706365</Real>
+      <Real>0.001300814498637627</Real>
+      <Real>0.08585899856030095</Real>
+      <Real>0.63122215961399775</Real>
+      <Real>0.28161802732706365</Real>
+      <Real>0.001300814498637627</Real>
+    </Sequence>
+  </Splines>
+  <Splines Name="Derivatives">
+    <Sequence Name="X">
+      <Int Name="Length">8</Int>
+      <Real>-0.27583138988857209</Real>
+      <Real>-0.41524587892271431</Real>
+      <Real>0.65798592751114482</Real>
+      <Real>0.033091341300141533</Real>
+      <Real>-0.0031225352025811837</Real>
+      <Real>-0.56965815225108607</Real>
+      <Real>0.14868391010991572</Real>
+      <Real>0.42409677734375156</Real>
+    </Sequence>
+    <Sequence Name="Y">
+      <Int Name="Length">8</Int>
+      <Real>-0.42345016376210792</Real>
+      <Real>-0.14992138567407526</Real>
+      <Real>0.57019326263447434</Real>
+      <Real>0.0031782868017088757</Real>
+      <Real>-0.047455630860650959</Real>
+      <Real>-0.66570982143795143</Real>
+      <Real>0.47378653545785576</Real>
+      <Real>0.23937891684074664</Real>
+    </Sequence>
+    <Sequence Name="Z">
+      <Int Name="Length">8</Int>
+      <Real>-0.32131281751025292</Real>
+      <Real>-0.33770088970520323</Real>
+      <Real>0.63934023194116529</Real>
+      <Real>0.019673475274290902</Real>
+      <Real>-0.32131281751025292</Real>
+      <Real>-0.33770088970520323</Real>
+      <Real>0.63934023194116529</Real>
+      <Real>0.019673475274290902</Real>
+    </Sequence>
+  </Splines>
+  <Sequence Name="Gridline indices">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Int Name="X">5</Int>
+      <Int Name="Y">4</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+    <Vector>
+      <Int Name="X">18</Int>
+      <Int Name="Y">6</Int>
+      <Int Name="Z">0</Int>
+    </Vector>
+  </Sequence>
+  <NonZeroGridValues Name="RealSpaceGrid">
+    <Real Name="Cell 0 6 0">0.00034726652598853863</Real>
+    <Real Name="Cell 0 6 1">0.002553050119052862</Real>
+    <Real Name="Cell 0 6 2">0.0011390362762841891</Real>
+    <Real Name="Cell 0 6 3">5.2612928111448962e-06</Real>
+    <Real Name="Cell 0 7 0">0.025192829367280716</Real>
+    <Real Name="Cell 0 7 1">0.18521380899677403</Real>
+    <Real Name="Cell 0 7 2">0.082632630570668553</Real>
+    <Real Name="Cell 0 7 3">0.000381686232685867</Real>
+    <Real Name="Cell 0 8 0">0.0417843143234196</Real>
+    <Real Name="Cell 0 8 1">0.30719185603702398</Real>
+    <Real Name="Cell 0 8 2">0.13705280017575541</Real>
+    <Real Name="Cell 0 8 3">0.00063305702138328741</Real>
+    <Real Name="Cell 0 9 0">0.0039342335898305027</Real>
+    <Real Name="Cell 0 9 1">0.02892388060238792</Real>
+    <Real Name="Cell 0 9 2">0.012904309637781252</Real>
+    <Real Name="Cell 0 9 3">5.9605960708758805e-05</Real>
+    <Real Name="Cell 1 6 0">0.0010974511677576001</Real>
+    <Real Name="Cell 1 6 1">0.0080682922908346111</Real>
+    <Real Name="Cell 1 6 2">0.0035996463752674176</Real>
+    <Real Name="Cell 1 6 3">1.6627032862062269e-05</Real>
+    <Real Name="Cell 1 7 0">0.079615793458747253</Real>
+    <Real Name="Cell 1 7 1">0.58532307538058348</Real>
+    <Real Name="Cell 1 7 2">0.26114027736049511</Real>
+    <Real Name="Cell 1 7 3">0.0012062262568662571</Real>
+    <Real Name="Cell 1 8 0">0.13204913550953917</Real>
+    <Real Name="Cell 1 8 1">0.97080494635576609</Real>
+    <Real Name="Cell 1 8 2">0.43312195199112263</Real>
+    <Real Name="Cell 1 8 3">0.0020006223329373431</Real>
+    <Real Name="Cell 1 9 0">0.012433185822042524</Real>
+    <Real Name="Cell 1 9 1">0.091406870998616385</Real>
+    <Real Name="Cell 1 9 2">0.04078092364582267</Real>
+    <Real Name="Cell 1 9 3">0.00018837010275876676</Real>
+    <Real Name="Cell 18 6 0">1.366332681107311e-07</Real>
+    <Real Name="Cell 18 6 1">1.0045067845905672e-06</Real>
+    <Real Name="Cell 18 6 2">4.481579342620626e-07</Real>
+    <Real Name="Cell 18 6 3">2.0700746472118896e-09</Real>
+    <Real Name="Cell 18 7 0">9.9122096482203785e-06</Real>
+    <Real Name="Cell 18 7 1">7.2873041680099007e-05</Real>
+    <Real Name="Cell 18 7 2">3.2512106760989057e-05</Real>
+    <Real Name="Cell 18 7 3">1.5017582594892596e-07</Real>
+    <Real Name="Cell 18 8 0">1.6440189291274443e-05</Real>
+    <Real Name="Cell 18 8 1">0.00012086574456855391</Real>
+    <Real Name="Cell 18 8 2">5.3923918922028441e-05</Real>
+    <Real Name="Cell 18 8 3">2.4907857008624638e-07</Real>
+    <Real Name="Cell 18 9 0">1.547938406557782e-06</Real>
+    <Real Name="Cell 18 9 1">1.1380205223924392e-05</Real>
+    <Real Name="Cell 18 9 2">5.0772472051655487e-06</Real>
+    <Real Name="Cell 18 9 3">2.3452180388922191e-08</Real>
+    <Real Name="Cell 2 6 0">0.00021626831670813599</Real>
+    <Real Name="Cell 2 6 1">0.0015899714207907613</Real>
+    <Real Name="Cell 2 6 2">0.00070936136859218936</Real>
+    <Real Name="Cell 2 6 3">3.2765926307924009e-06</Real>
+    <Real Name="Cell 2 7 0">0.015689421215786623</Real>
+    <Real Name="Cell 2 7 1">0.11534621308175426</Real>
+    <Real Name="Cell 2 7 2">0.051461395156968175</Real>
+    <Real Name="Cell 2 7 3">0.00023770399067017125</Real>
+    <Real Name="Cell 2 8 0">0.026022154878895126</Real>
+    <Real Name="Cell 2 8 1">0.19131088267853347</Real>
+    <Real Name="Cell 2 8 2">0.085352823194727964</Real>
+    <Real Name="Cell 2 8 3">0.00039425100362062732</Real>
+    <Real Name="Cell 2 9 0">0.0024501355942303862</Real>
+    <Real Name="Cell 2 9 1">0.018013020266606391</Real>
+    <Real Name="Cell 2 9 2">0.0080364593612908038</Real>
+    <Real Name="Cell 2 9 3">3.7121000221829661e-05</Real>
+    <Real Name="Cell 5 4 0">0.0023686596869420852</Real>
+    <Real Name="Cell 5 4 1">0.017414021920278012</Real>
+    <Real Name="Cell 5 4 2">0.0077692178994759522</Real>
+    <Real Name="Cell 5 4 3">3.5886592142682999e-05</Real>
+    <Real Name="Cell 5 5 0">0.012045366959800725</Real>
+    <Real Name="Cell 5 5 1">0.088555686336925024</Real>
+    <Real Name="Cell 5 5 2">0.039508875464780172</Real>
+    <Real Name="Cell 5 5 3">0.00018249441812106428</Real>
+    <Real Name="Cell 5 6 0">0.0038194205238437948</Real>
+    <Real Name="Cell 5 6 1">0.028079792589724518</Real>
+    <Real Name="Cell 5 6 2">0.012527722096618166</Real>
+    <Real Name="Cell 5 6 3">5.7866475001111562e-05</Real>
+    <Real Name="Cell 5 7 0">1.5402415597341067e-06</Real>
+    <Real Name="Cell 5 7 1">1.1323619189196228e-05</Real>
+    <Real Name="Cell 5 7 2">5.0520015016811351e-06</Real>
+    <Real Name="Cell 5 7 3">2.333556861718113e-08</Real>
+    <Real Name="Cell 6 4 0">0.021123145501652566</Real>
+    <Real Name="Cell 6 4 1">0.15529411878743787</Real>
+    <Real Name="Cell 6 4 2">0.069284043220467328</Real>
+    <Real Name="Cell 6 4 3">0.00032002812036159296</Real>
+    <Real Name="Cell 6 5 0">0.10741772670650858</Real>
+    <Real Name="Cell 6 5 1">0.78971861504869245</Real>
+    <Real Name="Cell 6 5 2">0.35233078421941649</Real>
+    <Real Name="Cell 6 5 3">0.0016274419531271879</Real>
+    <Real Name="Cell 6 6 0">0.034060686683659989</Real>
+    <Real Name="Cell 6 6 1">0.25040893286561805</Real>
+    <Real Name="Cell 6 6 2">0.11171925545486924</Real>
+    <Real Name="Cell 6 6 3">0.0005160395044736144</Real>
+    <Real Name="Cell 6 7 0">1.3735509053205462e-05</Real>
+    <Real Name="Cell 6 7 1">0.00010098135120773274</Real>
+    <Real Name="Cell 6 7 2">4.5052551610883681e-05</Real>
+    <Real Name="Cell 6 7 3">2.0810106828848415e-07</Real>
+    <Real Name="Cell 7 4 0">0.011094904446356973</Real>
+    <Real Name="Cell 7 4 1">0.081568032038269872</Real>
+    <Real Name="Cell 7 4 2">0.036391352752278901</Real>
+    <Real Name="Cell 7 4 3">0.00016809435011851408</Real>
+    <Real Name="Cell 7 5 0">0.056421019945176287</Real>
+    <Real Name="Cell 7 5 1">0.41479866588946834</Real>
+    <Real Name="Cell 7 5 2">0.18506128190607871</Real>
+    <Real Name="Cell 7 5 3">0.00085481174953446599</Real>
+    <Real Name="Cell 7 6 0">0.017890330969075892</Real>
+    <Real Name="Cell 7 6 1">0.13152696327546923</Real>
+    <Real Name="Cell 7 6 2">0.058680392273629235</Real>
+    <Real Name="Cell 7 6 3">0.00027104907231890378</Real>
+    <Real Name="Cell 7 7 0">7.2145580995720175e-06</Real>
+    <Real Name="Cell 7 7 1">5.3040322163484428e-05</Real>
+    <Real Name="Cell 7 7 2">2.3663793593061901e-05</Real>
+    <Real Name="Cell 7 7 3">1.0930481294392947e-07</Real>
+    <Real Name="Cell 8 4 0">9.8425741060900274e-05</Real>
+    <Real Name="Cell 8 4 1">0.0007236109187837216</Real>
+    <Real Name="Cell 8 4 2">0.00032283701767506321</Real>
+    <Real Name="Cell 8 4 3">1.491208063896187e-06</Real>
+    <Real Name="Cell 8 5 0">0.00050052532911531642</Real>
+    <Real Name="Cell 8 5 1">0.0036797852814901217</Real>
+    <Real Name="Cell 8 5 2">0.001641726064550905</Real>
+    <Real Name="Cell 8 5 3">7.5832541255567533e-06</Real>
+    <Real Name="Cell 8 6 0">0.00015870971146887634</Real>
+    <Real Name="Cell 8 6 1">0.0011668094026829217</Real>
+    <Real Name="Cell 8 6 2">0.00052056880013714123</Real>
+    <Real Name="Cell 8 6 3">2.4045457926965272e-06</Real>
+    <Real Name="Cell 8 7 0">6.4002194053186081e-08</Real>
+    <Real Name="Cell 8 7 1">4.7053429259267009e-07</Real>
+    <Real Name="Cell 8 7 2">2.0992757819325552e-07</Real>
+    <Real Name="Cell 8 7 3">9.6967101136791496e-10</Real>
+  </NonZeroGridValues>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_0.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_0.xml
new file mode 100644 (file)
index 0000000..0fb209f
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">0.68483443256321219</Real>
+      <Real Name="Y">0.29786650520930358</Real>
+      <Real Name="Z">2.0753823516238281</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_1.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_1.xml
new file mode 100644 (file)
index 0000000..99caf34
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54211842890838613</Real>
+      <Real Name="Y">0.30968912522684905</Real>
+      <Real Name="Z">2.9554195699926327</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_10.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_10.xml
new file mode 100644 (file)
index 0000000..46d659b
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">-4.2362713136143704</Real>
+      <Real Name="Y">-2.3275379753649541</Real>
+      <Real Name="Z">-11.746263473883745</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.57636324498554081</Real>
+      <Real Name="Y">-0.013594713514657464</Real>
+      <Real Name="Z">-6.1436686744664879</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_100.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_100.xml
new file mode 100644 (file)
index 0000000..265805b
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">2.6940571045158022</Real>
+      <Real Name="Y">2.1019189996213141</Real>
+      <Real Name="Z">-0.21251856629141863</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_101.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_101.xml
new file mode 100644 (file)
index 0000000..32fa955
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.6600000262260437</Real>
+      <Real Name="Y">0.67000001668930054</Real>
+      <Real Name="Z">0.37999999523162842</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44999998807907104</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.93999999761581421</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54000002145767212</Real>
+      <Real Name="Y">0.75999999046325684</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.19104463336113997</Real>
+      <Real Name="Y">-16.083563532509753</Real>
+      <Real Name="Z">2.8065205292802267</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-2.6398356036393578</Real>
+      <Real Name="Y">-0.91018032292522766</Real>
+      <Real Name="Z">0.93368498675769429</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.31999999284744263</Real>
+      <Real Name="Y">0.34999999403953552</Real>
+      <Real Name="Z">0.61000001430511475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.27000001072883606</Real>
+      <Real Name="Y">0.98000001907348633</Real>
+      <Real Name="Z">0.82999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10999999940395355</Real>
+      <Real Name="Y">0.30000001192092896</Real>
+      <Real Name="Z">0.41999998688697815</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.94999998807907104</Real>
+      <Real Name="Y">0.68999999761581421</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.28999999165534973</Real>
+      <Real Name="Y">0.10000000149011612</Real>
+      <Real Name="Z">0.68000000715255737</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.93999999761581421</Real>
+      <Real Name="Y">0.62000000476837158</Real>
+      <Real Name="Z">0.50999999046325684</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.4699999988079071</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.4699999988079071</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_102.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_102.xml
new file mode 100644 (file)
index 0000000..3a17deb
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-8.0544456082501288</Real>
+      <Real Name="Y">-11.923968234039531</Real>
+      <Real Name="Z">1.9257328983388657</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_103.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_103.xml
new file mode 100644 (file)
index 0000000..0d9ee08
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">-0.59903073971265186</Real>
+      <Real Name="Y">-1.6350310136998707</Real>
+      <Real Name="Z">-2.6446765062295143</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-7.7106240328717144</Real>
+      <Real Name="Y">-1.2779139061856373</Real>
+      <Real Name="Z">2.2200763403785335</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_104.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_104.xml
new file mode 100644 (file)
index 0000000..45fa915
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.060088412760632121</Real>
+      <Real Name="Y">-1.4519790167692483</Real>
+      <Real Name="Z">0.24378158880830342</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-1.3603736897226484</Real>
+      <Real Name="Y">-1.4452674741283262</Real>
+      <Real Name="Z">-0.088156767496452001</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_105.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_105.xml
new file mode 100644 (file)
index 0000000..862e11a
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-8.0344456086971636</Real>
+      <Real Name="Y">-11.05396822927116</Real>
+      <Real Name="Z">2.8757328864179366</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_106.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_106.xml
new file mode 100644 (file)
index 0000000..1c21fd0
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">-0.5790307401596867</Real>
+      <Real Name="Y">-0.76503100893149911</Real>
+      <Real Name="Z">-1.6946765181504433</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-7.0506240066456707</Real>
+      <Real Name="Y">-0.60791388949633673</Real>
+      <Real Name="Z">2.6000763356101619</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_107.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_107.xml
new file mode 100644 (file)
index 0000000..9a18786
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.6600000262260437</Real>
+      <Real Name="Y">0.67000001668930054</Real>
+      <Real Name="Z">0.37999999523162842</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44999998807907104</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.93999999761581421</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54000002145767212</Real>
+      <Real Name="Y">0.75999999046325684</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.76991157055006731</Real>
+      <Real Name="Y">-1.1419790143850626</Real>
+      <Real Name="Z">0.9737816078817898</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.70999997854232788</Real>
+      <Real Name="Y">0.059999998658895493</Real>
+      <Real Name="Z">0.34999999403953552</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.31999999284744263</Real>
+      <Real Name="Y">0.34999999403953552</Real>
+      <Real Name="Z">0.61000001430511475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-1.0903736789938123</Real>
+      <Real Name="Y">-0.46526745505483991</Real>
+      <Real Name="Z">0.7418432158142475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10999999940395355</Real>
+      <Real Name="Y">0.30000001192092896</Real>
+      <Real Name="Z">0.41999998688697815</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.94999998807907104</Real>
+      <Real Name="Y">0.68999999761581421</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.28999999165534973</Real>
+      <Real Name="Y">0.10000000149011612</Real>
+      <Real Name="Z">0.68000000715255737</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.93999999761581421</Real>
+      <Real Name="Y">0.62000000476837158</Real>
+      <Real Name="Z">0.50999999046325684</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.4699999988079071</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.4699999988079071</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_108.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_108.xml
new file mode 100644 (file)
index 0000000..b8d7398
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-9.4063956103865909</Real>
+      <Real Name="Y">1.0613765111849376</Real>
+      <Real Name="Z">1.4765278904032615</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_109.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_109.xml
new file mode 100644 (file)
index 0000000..935b88e
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">1.6526713761104288</Real>
+      <Real Name="Y">1.789898728665017</Real>
+      <Real Name="Z">-0.59016766968693601</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_11.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_11.xml
new file mode 100644 (file)
index 0000000..0ed4912
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.6600000262260437</Real>
+      <Real Name="Y">0.67000001668930054</Real>
+      <Real Name="Z">0.37999999523162842</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44999998807907104</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.93999999761581421</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54000002145767212</Real>
+      <Real Name="Y">0.75999999046325684</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.82999998331069946</Real>
+      <Real Name="Y">0.31000000238418579</Real>
+      <Real Name="Z">0.73000001907348633</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.70999997854232788</Real>
+      <Real Name="Y">0.059999998658895493</Real>
+      <Real Name="Z">0.34999999403953552</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.31999999284744263</Real>
+      <Real Name="Y">0.34999999403953552</Real>
+      <Real Name="Z">0.61000001430511475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-3.3126533138132714</Real>
+      <Real Name="Y">-8.6003366303629782</Real>
+      <Real Name="Z">-22.745529254386152</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10999999940395355</Real>
+      <Real Name="Y">0.30000001192092896</Real>
+      <Real Name="Z">0.41999998688697815</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.94999998807907104</Real>
+      <Real Name="Y">0.68999999761581421</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.28999999165534973</Real>
+      <Real Name="Y">0.10000000149011612</Real>
+      <Real Name="Z">0.68000000715255737</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.93999999761581421</Real>
+      <Real Name="Y">0.62000000476837158</Real>
+      <Real Name="Z">0.50999999046325684</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.4699999988079071</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.4699999988079071</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_110.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_110.xml
new file mode 100644 (file)
index 0000000..90aa5e9
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.82959875104586944</Real>
+      <Real Name="Y">-20.491954418617421</Real>
+      <Real Name="Z">2.8871516559459058</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-2.7217414105226196</Real>
+      <Real Name="Y">-1.2127254019801541</Real>
+      <Real Name="Z">0.55819396762823659</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_111.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_111.xml
new file mode 100644 (file)
index 0000000..5bf291e
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-9.3863956108336257</Real>
+      <Real Name="Y">1.9313765159533092</Real>
+      <Real Name="Z">2.4265278784823323</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_112.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_112.xml
new file mode 100644 (file)
index 0000000..9187b09
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">2.3126714023364725</Real>
+      <Real Name="Y">2.4598987453543177</Real>
+      <Real Name="Z">-0.2101676744553076</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_113.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_113.xml
new file mode 100644 (file)
index 0000000..f2088aa
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.6600000262260437</Real>
+      <Real Name="Y">0.67000001668930054</Real>
+      <Real Name="Z">0.37999999523162842</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44999998807907104</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.93999999761581421</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54000002145767212</Real>
+      <Real Name="Y">0.75999999046325684</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.00040123226483002039</Real>
+      <Real Name="Y">-20.181954416233236</Real>
+      <Real Name="Z">3.6171516750193922</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-2.0117414319802918</Real>
+      <Real Name="Y">-1.1527254033212586</Real>
+      <Real Name="Z">0.90819396166777211</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.31999999284744263</Real>
+      <Real Name="Y">0.34999999403953552</Real>
+      <Real Name="Z">0.61000001430511475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.27000001072883606</Real>
+      <Real Name="Y">0.98000001907348633</Real>
+      <Real Name="Z">0.82999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10999999940395355</Real>
+      <Real Name="Y">0.30000001192092896</Real>
+      <Real Name="Z">0.41999998688697815</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.94999998807907104</Real>
+      <Real Name="Y">0.68999999761581421</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.28999999165534973</Real>
+      <Real Name="Y">0.10000000149011612</Real>
+      <Real Name="Z">0.68000000715255737</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.93999999761581421</Real>
+      <Real Name="Y">0.62000000476837158</Real>
+      <Real Name="Z">0.50999999046325684</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.4699999988079071</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.4699999988079071</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_114.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_114.xml
new file mode 100644 (file)
index 0000000..b5d4abc
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-6.5442370567032295</Real>
+      <Real Name="Y">-14.904960292549413</Real>
+      <Real Name="Z">2.4825316419739121</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_115.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_115.xml
new file mode 100644 (file)
index 0000000..028ca5f
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">-0.48671247601652962</Real>
+      <Real Name="Y">-2.0437887671248385</Real>
+      <Real Name="Z">-1.9489107480528729</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-6.2648820267082685</Real>
+      <Real Name="Y">-1.5973923827320464</Real>
+      <Real Name="Z">1.9008625299783468</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_116.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_116.xml
new file mode 100644 (file)
index 0000000..5634d4e
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.0488218353680136</Real>
+      <Real Name="Y">-1.8149737709615605</Real>
+      <Real Name="Z">0.30251804902903451</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-1.1053036228996518</Real>
+      <Real Name="Y">-1.8065843426604078</Real>
+      <Real Name="Z">0.051190455240391619</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_117.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_117.xml
new file mode 100644 (file)
index 0000000..5520d5d
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-6.5242370571502644</Real>
+      <Real Name="Y">-14.034960287781042</Real>
+      <Real Name="Z">3.4325316300529831</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_118.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_118.xml
new file mode 100644 (file)
index 0000000..09181d2
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">-0.46671247646356445</Real>
+      <Real Name="Y">-1.1737887623564669</Real>
+      <Real Name="Z">-0.99891075997380185</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-5.6048820004822248</Real>
+      <Real Name="Y">-0.92739236604274589</Real>
+      <Real Name="Z">2.280862525209975</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_119.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_119.xml
new file mode 100644 (file)
index 0000000..650d147
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.6600000262260437</Real>
+      <Real Name="Y">0.67000001668930054</Real>
+      <Real Name="Z">0.37999999523162842</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44999998807907104</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.93999999761581421</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54000002145767212</Real>
+      <Real Name="Y">0.75999999046325684</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.78117814794268581</Real>
+      <Real Name="Y">-1.5049737685773747</Real>
+      <Real Name="Z">1.0325180681025208</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.70999997854232788</Real>
+      <Real Name="Y">0.059999998658895493</Real>
+      <Real Name="Z">0.34999999403953552</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.31999999284744263</Real>
+      <Real Name="Y">0.34999999403953552</Real>
+      <Real Name="Z">0.61000001430511475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.83530361217081572</Real>
+      <Real Name="Y">-0.82658432358692147</Real>
+      <Real Name="Z">0.88119043855109114</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10999999940395355</Real>
+      <Real Name="Y">0.30000001192092896</Real>
+      <Real Name="Z">0.41999998688697815</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.94999998807907104</Real>
+      <Real Name="Y">0.68999999761581421</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.28999999165534973</Real>
+      <Real Name="Y">0.10000000149011612</Real>
+      <Real Name="Z">0.68000000715255737</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.93999999761581421</Real>
+      <Real Name="Y">0.62000000476837158</Real>
+      <Real Name="Z">0.50999999046325684</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.4699999988079071</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.4699999988079071</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_12.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_12.xml
new file mode 100644 (file)
index 0000000..8df22aa
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">0.55642797645760989</Real>
+      <Real Name="Y">0.3723331315116295</Real>
+      <Real Name="Z">1.6306575619901507</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_120.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_120.xml
new file mode 100644 (file)
index 0000000..d1ecbf9
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">3.4320122274828666</Real>
+      <Real Name="Y">-0.81224418229071649</Real>
+      <Real Name="Z">-0.764761636476889</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_121.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_121.xml
new file mode 100644 (file)
index 0000000..b754dce
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">12.870589400646217</Real>
+      <Real Name="Y">2.4002360860135794</Real>
+      <Real Name="Z">-2.7526346195710181</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_122.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_122.xml
new file mode 100644 (file)
index 0000000..c28af07
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">-3.9130491664545959</Real>
+      <Real Name="Y">-0.62204635074971815</Real>
+      <Real Name="Z">1.1633583220151211</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">4.1305407769409488</Real>
+      <Real Name="Y">-0.46469970389626269</Real>
+      <Real Name="Z">-3.6193285397896875</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.1597567999404905</Real>
+      <Real Name="Y">-0.73800016335319685</Real>
+      <Real Name="Z">-0.54897393926970917</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">2.2124223213639174</Real>
+      <Real Name="Y">-16.220145737822616</Real>
+      <Real Name="Z">2.8258755564357965</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_123.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_123.xml
new file mode 100644 (file)
index 0000000..672c139
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">3.4520122270358318</Real>
+      <Real Name="Y">0.057755822477655094</Real>
+      <Real Name="Z">0.18523835160218205</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_124.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_124.xml
new file mode 100644 (file)
index 0000000..8d70dc0
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">13.530589426872261</Real>
+      <Real Name="Y">3.0702361027028799</Real>
+      <Real Name="Z">-2.3726346243393897</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_125.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_125.xml
new file mode 100644 (file)
index 0000000..c94d064
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">-3.8930491669016307</Real>
+      <Real Name="Y">0.24795365401865344</Real>
+      <Real Name="Z">2.1133583100941919</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.6600000262260437</Real>
+      <Real Name="Y">0.67000001668930054</Real>
+      <Real Name="Z">0.37999999523162842</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44999998807907104</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.93999999761581421</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54000002145767212</Real>
+      <Real Name="Y">0.75999999046325684</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">4.9605407602516483</Real>
+      <Real Name="Y">-0.1546997015120769</Real>
+      <Real Name="Z">-2.8893285207162012</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.55024317860183736</Real>
+      <Real Name="Y">-0.67800016469430135</Real>
+      <Real Name="Z">-0.19897394523017364</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.31999999284744263</Real>
+      <Real Name="Y">0.34999999403953552</Real>
+      <Real Name="Z">0.61000001430511475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">2.4824223320927534</Real>
+      <Real Name="Y">-15.24014571874913</Real>
+      <Real Name="Z">3.6558755397464959</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10999999940395355</Real>
+      <Real Name="Y">0.30000001192092896</Real>
+      <Real Name="Z">0.41999998688697815</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.94999998807907104</Real>
+      <Real Name="Y">0.68999999761581421</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.28999999165534973</Real>
+      <Real Name="Y">0.10000000149011612</Real>
+      <Real Name="Z">0.68000000715255737</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.93999999761581421</Real>
+      <Real Name="Y">0.62000000476837158</Real>
+      <Real Name="Z">0.50999999046325684</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.4699999988079071</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.4699999988079071</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_126.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_126.xml
new file mode 100644 (file)
index 0000000..bd4621e
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-16.500695458472016</Real>
+      <Real Name="Y">-15.572010667113076</Real>
+      <Real Name="Z">6.0618364657657224</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_127.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_127.xml
new file mode 100644 (file)
index 0000000..63f2ba6
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">-0.56750283571532234</Real>
+      <Real Name="Y">-0.70603611451836135</Real>
+      <Real Name="Z">-0.73298662849655538</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-7.5662986143550031</Real>
+      <Real Name="Y">-4.9570092424793035</Real>
+      <Real Name="Z">0.22987632186540616</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_128.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_128.xml
new file mode 100644 (file)
index 0000000..d33540d
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">-8.3516260207559565</Real>
+      <Real Name="Y">-0.89155680381272195</Real>
+      <Real Name="Z">1.9626024243687374</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-10.991689448063681</Real>
+      <Real Name="Y">-17.399473852314976</Real>
+      <Real Name="Z">1.9943402280115583</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-1.5304702532285459</Real>
+      <Real Name="Y">-2.0431421404374799</Real>
+      <Real Name="Z">-2.0385186389652117</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-7.0292328592073234</Real>
+      <Real Name="Y">-14.608255429729208</Real>
+      <Real Name="Z">3.679921612389506</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.67546778632879001</Real>
+      <Real Name="Y">-0.07424836221296291</Real>
+      <Real Name="Z">0.089381774901316297</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_129.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_129.xml
new file mode 100644 (file)
index 0000000..83d377c
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-16.480695458919051</Real>
+      <Real Name="Y">-14.702010662344705</Real>
+      <Real Name="Z">7.0118364538447935</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_13.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_13.xml
new file mode 100644 (file)
index 0000000..f0a9eef
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44047122348806367</Real>
+      <Real Name="Y">0.3871114065335613</Real>
+      <Real Name="Z">2.3221153764227829</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_130.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_130.xml
new file mode 100644 (file)
index 0000000..340efaf
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">-0.54750283616235718</Real>
+      <Real Name="Y">0.16396389025001024</Real>
+      <Real Name="Z">0.21701335958251566</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-6.9062985881289594</Real>
+      <Real Name="Y">-4.287009225790003</Real>
+      <Real Name="Z">0.6098763170970346</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_131.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_131.xml
new file mode 100644 (file)
index 0000000..1970d05
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">-8.3316260212029913</Real>
+      <Real Name="Y">-0.021556799044350372</Real>
+      <Real Name="Z">2.9126024124478085</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.6600000262260437</Real>
+      <Real Name="Y">0.67000001668930054</Real>
+      <Real Name="Z">0.37999999523162842</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44999998807907104</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.93999999761581421</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54000002145767212</Real>
+      <Real Name="Y">0.75999999046325684</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-10.161689464752982</Real>
+      <Real Name="Y">-17.089473849930791</Real>
+      <Real Name="Z">2.7243402470850446</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.82047027468621803</Real>
+      <Real Name="Y">-1.9831421417785844</Real>
+      <Real Name="Z">-1.6885186449256762</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.31999999284744263</Real>
+      <Real Name="Y">0.34999999403953552</Real>
+      <Real Name="Z">0.61000001430511475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-6.7592328484784874</Real>
+      <Real Name="Y">-13.628255410655722</Real>
+      <Real Name="Z">4.5099215957002059</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10999999940395355</Real>
+      <Real Name="Y">0.30000001192092896</Real>
+      <Real Name="Z">0.41999998688697815</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.94999998807907104</Real>
+      <Real Name="Y">0.68999999761581421</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.38546779467344028</Real>
+      <Real Name="Y">0.02575163927715321</Real>
+      <Real Name="Z">0.76938178205387364</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.93999999761581421</Real>
+      <Real Name="Y">0.62000000476837158</Real>
+      <Real Name="Z">0.50999999046325684</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.4699999988079071</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.4699999988079071</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_132.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_132.xml
new file mode 100644 (file)
index 0000000..330c2a8
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">2.788509934829829</Real>
+      <Real Name="Y">-1.0153052278633954</Real>
+      <Real Name="Z">-0.5654353231810999</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_133.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_133.xml
new file mode 100644 (file)
index 0000000..dd4f51b
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">10.457353888025052</Real>
+      <Real Name="Y">3.0002951075169739</Real>
+      <Real Name="Z">-2.4443752014337479</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_134.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_134.xml
new file mode 100644 (file)
index 0000000..775c0fd
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">-3.1793524477443595</Real>
+      <Real Name="Y">-0.77755793843714771</Real>
+      <Real Name="Z">0.99148224011632069</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">3.3560643812645212</Real>
+      <Real Name="Y">-0.58087462987032856</Real>
+      <Real Name="Z">-2.8401295588358915</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.12980239995164852</Real>
+      <Real Name="Y">-0.92250020419149636</Real>
+      <Real Name="Z">-0.37393805370732247</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">1.7975931361081829</Real>
+      <Real Name="Y">-20.275182172278267</Real>
+      <Real Name="Z">3.4378840352447644</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_135.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_135.xml
new file mode 100644 (file)
index 0000000..d4d2726
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">2.8085099343827942</Real>
+      <Real Name="Y">-0.14530522309502381</Real>
+      <Real Name="Z">0.38456466489797114</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_136.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_136.xml
new file mode 100644 (file)
index 0000000..7d8827f
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">11.117353914251096</Real>
+      <Real Name="Y">3.6702951242062745</Real>
+      <Real Name="Z">-2.0643752062021195</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_137.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_137.xml
new file mode 100644 (file)
index 0000000..dc388f2
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">-3.1593524481913944</Real>
+      <Real Name="Y">0.092442066331223871</Real>
+      <Real Name="Z">1.9414822281953916</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.6600000262260437</Real>
+      <Real Name="Y">0.67000001668930054</Real>
+      <Real Name="Z">0.37999999523162842</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44999998807907104</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.93999999761581421</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54000002145767212</Real>
+      <Real Name="Y">0.75999999046325684</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">4.1860643645752207</Real>
+      <Real Name="Y">-0.27087462748614277</Real>
+      <Real Name="Z">-2.1101295397624051</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.58019757859067933</Real>
+      <Real Name="Y">-0.86250020553260087</Real>
+      <Real Name="Z">-0.023938059667786948</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.31999999284744263</Real>
+      <Real Name="Y">0.34999999403953552</Real>
+      <Real Name="Z">0.61000001430511475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">2.067593146837019</Real>
+      <Real Name="Y">-19.295182153204781</Real>
+      <Real Name="Z">4.2678840185554634</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10999999940395355</Real>
+      <Real Name="Y">0.30000001192092896</Real>
+      <Real Name="Z">0.41999998688697815</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.94999998807907104</Real>
+      <Real Name="Y">0.68999999761581421</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.28999999165534973</Real>
+      <Real Name="Y">0.10000000149011612</Real>
+      <Real Name="Z">0.68000000715255737</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.93999999761581421</Real>
+      <Real Name="Y">0.62000000476837158</Real>
+      <Real Name="Z">0.50999999046325684</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.4699999988079071</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.4699999988079071</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_138.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_138.xml
new file mode 100644 (file)
index 0000000..9871d3a
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-13.406815060008514</Real>
+      <Real Name="Y">-19.465013333891342</Real>
+      <Real Name="Z">6.0748932006495915</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_139.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_139.xml
new file mode 100644 (file)
index 0000000..53b7b71
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">-3.4931516109310436</Real>
+      <Real Name="Y">-1.1695586621622649</Real>
+      <Real Name="Z">0.37948711624127879</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-6.1476176241634404</Real>
+      <Real Name="Y">-6.196261553099129</Real>
+      <Real Name="Z">0.61604971101077255</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_14.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_14.xml
new file mode 100644 (file)
index 0000000..e5582cc
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-8.1581138200755436</Real>
+      <Real Name="Y">-14.70340061881376</Real>
+      <Real Name="Z">-8.9453847792568535</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-8.4309497156824804</Real>
+      <Real Name="Y">-11.184451168201075</Real>
+      <Real Name="Z">-7.7012318674352152</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_140.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_140.xml
new file mode 100644 (file)
index 0000000..5f89638
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">-6.7856961418642161</Real>
+      <Real Name="Y">-1.1144460047659024</Real>
+      <Real Name="Z">1.6740807570530818</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-8.9307476765517411</Real>
+      <Real Name="Y">-21.749342315393726</Real>
+      <Real Name="Z">2.9757623819770487</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-1.2435070807481936</Real>
+      <Real Name="Y">-2.5539276755468499</Real>
+      <Real Name="Z">-1.4344239512261392</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-5.7112516981059507</Real>
+      <Real Name="Y">-18.260319287161511</Real>
+      <Real Name="Z">4.0572521792161034</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.5488175763921419</Real>
+      <Real Name="Y">-0.092810452766203616</Real>
+      <Real Name="Z">0.081070341914709868</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_141.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_141.xml
new file mode 100644 (file)
index 0000000..26365b6
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-13.386815060455548</Real>
+      <Real Name="Y">-18.59501332912297</Real>
+      <Real Name="Z">7.0248931887286625</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_142.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_142.xml
new file mode 100644 (file)
index 0000000..145c59c
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">-3.4731516113780785</Real>
+      <Real Name="Y">-0.29955865739389331</Real>
+      <Real Name="Z">1.3294871043203498</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-5.4876175979373967</Real>
+      <Real Name="Y">-5.5262615364098284</Real>
+      <Real Name="Z">0.99604970624240097</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_143.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_143.xml
new file mode 100644 (file)
index 0000000..237ccf4
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">-6.7656961423112509</Real>
+      <Real Name="Y">-0.24444599999753081</Real>
+      <Real Name="Z">2.6240807451321526</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.6600000262260437</Real>
+      <Real Name="Y">0.67000001668930054</Real>
+      <Real Name="Z">0.37999999523162842</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44999998807907104</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.93999999761581421</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54000002145767212</Real>
+      <Real Name="Y">0.75999999046325684</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-8.1007476932410416</Real>
+      <Real Name="Y">-21.43934231300954</Real>
+      <Real Name="Z">3.705762401050535</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.53350710220586572</Real>
+      <Real Name="Y">-2.4939276768879544</Real>
+      <Real Name="Z">-1.0844239571866037</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.31999999284744263</Real>
+      <Real Name="Y">0.34999999403953552</Real>
+      <Real Name="Z">0.61000001430511475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-5.4412516873771146</Real>
+      <Real Name="Y">-17.280319268088025</Real>
+      <Real Name="Z">4.8872521625268028</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10999999940395355</Real>
+      <Real Name="Y">0.30000001192092896</Real>
+      <Real Name="Z">0.41999998688697815</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.94999998807907104</Real>
+      <Real Name="Y">0.68999999761581421</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.25881758473679217</Real>
+      <Real Name="Y">0.0071895487239125033</Real>
+      <Real Name="Z">0.76107034906726723</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.93999999761581421</Real>
+      <Real Name="Y">0.62000000476837158</Real>
+      <Real Name="Z">0.50999999046325684</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.4699999988079071</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.4699999988079071</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_15.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_15.xml
new file mode 100644 (file)
index 0000000..dd50b3f
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">0.57642797601057505</Real>
+      <Real Name="Y">1.242333136280001</Real>
+      <Real Name="Z">2.5806575500692217</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_16.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_16.xml
new file mode 100644 (file)
index 0000000..ee9cd8b
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">1.1004712497141074</Real>
+      <Real Name="Y">1.0571114232228618</Real>
+      <Real Name="Z">2.7021153716544113</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_17.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_17.xml
new file mode 100644 (file)
index 0000000..f0c2f1d
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.6600000262260437</Real>
+      <Real Name="Y">0.67000001668930054</Real>
+      <Real Name="Z">0.37999999523162842</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44999998807907104</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.93999999761581421</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54000002145767212</Real>
+      <Real Name="Y">0.75999999046325684</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-7.3281138367648442</Real>
+      <Real Name="Y">-14.393400616429574</Real>
+      <Real Name="Z">-8.2153847601833672</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-7.7209497371401525</Real>
+      <Real Name="Y">-11.12445116954218</Real>
+      <Real Name="Z">-7.3512318733956796</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.31999999284744263</Real>
+      <Real Name="Y">0.34999999403953552</Real>
+      <Real Name="Z">0.61000001430511475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.27000001072883606</Real>
+      <Real Name="Y">0.98000001907348633</Real>
+      <Real Name="Z">0.82999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10999999940395355</Real>
+      <Real Name="Y">0.30000001192092896</Real>
+      <Real Name="Z">0.41999998688697815</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.94999998807907104</Real>
+      <Real Name="Y">0.68999999761581421</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.28999999165534973</Real>
+      <Real Name="Y">0.10000000149011612</Real>
+      <Real Name="Z">0.68000000715255737</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.93999999761581421</Real>
+      <Real Name="Y">0.62000000476837158</Real>
+      <Real Name="Z">0.50999999046325684</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.4699999988079071</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.4699999988079071</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_18.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_18.xml
new file mode 100644 (file)
index 0000000..c634fc3
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-16.205517527929572</Real>
+      <Real Name="Y">-7.3188043172213684</Real>
+      <Real Name="Z">-7.9336359387100472</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_19.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_19.xml
new file mode 100644 (file)
index 0000000..adf3e32
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">-3.4582204419484599</Real>
+      <Real Name="Y">-3.9969224751666577</Real>
+      <Real Name="Z">-9.9756355772564991</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.067954884757908562</Real>
+      <Real Name="Y">-0.85449341275494772</Real>
+      <Real Name="Z">-5.12573966904852</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_2.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_2.xml
new file mode 100644 (file)
index 0000000..3c00c91
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-10.040755470862207</Real>
+      <Real Name="Y">-11.762720495051008</Real>
+      <Real Name="Z">-11.385035173599631</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-10.376553496224592</Real>
+      <Real Name="Y">-8.94756093456086</Real>
+      <Real Name="Z">-9.8015678312811829</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_20.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_20.xml
new file mode 100644 (file)
index 0000000..32a755e
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-2.9109058261904628</Real>
+      <Real Name="Y">-11.975420811795583</Real>
+      <Real Name="Z">-18.523630115333241</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_21.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_21.xml
new file mode 100644 (file)
index 0000000..b98c4bb
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-16.185517528376607</Real>
+      <Real Name="Y">-6.4488043124529968</Real>
+      <Real Name="Z">-6.9836359506309762</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_22.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_22.xml
new file mode 100644 (file)
index 0000000..f2588cb
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">-3.4382204423954947</Real>
+      <Real Name="Y">-3.1269224703982861</Real>
+      <Real Name="Z">-9.025635589177428</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.59204514146813514</Real>
+      <Real Name="Y">-0.18449339606564719</Real>
+      <Real Name="Z">-4.7457396738168915</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_23.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_23.xml
new file mode 100644 (file)
index 0000000..4802142
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.6600000262260437</Real>
+      <Real Name="Y">0.67000001668930054</Real>
+      <Real Name="Z">0.37999999523162842</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44999998807907104</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.93999999761581421</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54000002145767212</Real>
+      <Real Name="Y">0.75999999046325684</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.82999998331069946</Real>
+      <Real Name="Y">0.31000000238418579</Real>
+      <Real Name="Z">0.73000001907348633</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.70999997854232788</Real>
+      <Real Name="Y">0.059999998658895493</Real>
+      <Real Name="Z">0.34999999403953552</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.31999999284744263</Real>
+      <Real Name="Y">0.34999999403953552</Real>
+      <Real Name="Z">0.61000001430511475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-2.6409058154616267</Real>
+      <Real Name="Y">-10.995420792722097</Real>
+      <Real Name="Z">-17.693630132022541</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10999999940395355</Real>
+      <Real Name="Y">0.30000001192092896</Real>
+      <Real Name="Z">0.41999998688697815</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.94999998807907104</Real>
+      <Real Name="Y">0.68999999761581421</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.28999999165534973</Real>
+      <Real Name="Y">0.10000000149011612</Real>
+      <Real Name="Z">0.68000000715255737</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.93999999761581421</Real>
+      <Real Name="Y">0.62000000476837158</Real>
+      <Real Name="Z">0.50999999046325684</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.4699999988079071</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.4699999988079071</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_24.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_24.xml
new file mode 100644 (file)
index 0000000..9f65a9d
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-10.129964503493252</Real>
+      <Real Name="Y">1.0239161111946307</Real>
+      <Real Name="Z">-8.1365401298928379</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_25.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_25.xml
new file mode 100644 (file)
index 0000000..da6834c
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">1.7797999435035388</Real>
+      <Real Name="Y">1.7267257437615944</Real>
+      <Real Name="Z">1.3771557011554771</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_26.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_26.xml
new file mode 100644 (file)
index 0000000..64e5147
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.89341403958785948</Real>
+      <Real Name="Y">-19.76870795422418</Real>
+      <Real Name="Z">-5.5136166998409726</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-2.9311061344089753</Real>
+      <Real Name="Y">-1.1699232689408006</Real>
+      <Real Name="Z">-3.2719141904858438</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_27.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_27.xml
new file mode 100644 (file)
index 0000000..79179ca
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-10.109964503940287</Real>
+      <Real Name="Y">1.8939161159630022</Real>
+      <Real Name="Z">-7.1865401418137669</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_28.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_28.xml
new file mode 100644 (file)
index 0000000..49d85f3
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">2.4397999697295827</Real>
+      <Real Name="Y">2.3967257604508951</Real>
+      <Real Name="Z">1.7571556963871056</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_29.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_29.xml
new file mode 100644 (file)
index 0000000..271e8e1
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.6600000262260437</Real>
+      <Real Name="Y">0.67000001668930054</Real>
+      <Real Name="Z">0.37999999523162842</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44999998807907104</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.93999999761581421</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54000002145767212</Real>
+      <Real Name="Y">0.75999999046325684</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.063414056277160014</Real>
+      <Real Name="Y">-19.458707951839994</Real>
+      <Real Name="Z">-4.7836166807674863</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-2.2211061558666474</Real>
+      <Real Name="Y">-1.1099232702819051</Real>
+      <Real Name="Z">-2.9219141964463082</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.31999999284744263</Real>
+      <Real Name="Y">0.34999999403953552</Real>
+      <Real Name="Z">0.61000001430511475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.27000001072883606</Real>
+      <Real Name="Y">0.98000001907348633</Real>
+      <Real Name="Z">0.82999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10999999940395355</Real>
+      <Real Name="Y">0.30000001192092896</Real>
+      <Real Name="Z">0.41999998688697815</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.94999998807907104</Real>
+      <Real Name="Y">0.68999999761581421</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.28999999165534973</Real>
+      <Real Name="Y">0.10000000149011612</Real>
+      <Real Name="Z">0.68000000715255737</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.93999999761581421</Real>
+      <Real Name="Y">0.62000000476837158</Real>
+      <Real Name="Z">0.50999999046325684</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.4699999988079071</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.4699999988079071</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_3.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_3.xml
new file mode 100644 (file)
index 0000000..8c011ce
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">0.70483443211617736</Real>
+      <Real Name="Y">1.1678665099776753</Real>
+      <Real Name="Z">3.0253823397028992</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_30.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_30.xml
new file mode 100644 (file)
index 0000000..f812d5c
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-7.0476399072188638</Real>
+      <Real Name="Y">-14.378902132683789</Real>
+      <Real Name="Z">-14.272277552262375</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_31.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_31.xml
new file mode 100644 (file)
index 0000000..1dd998a
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">-0.52415189724857048</Real>
+      <Real Name="Y">-1.9716549447673803</Real>
+      <Real Name="Z">-18.815861243981043</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-6.7467960287627502</Real>
+      <Real Name="Y">-1.5410137489785949</Real>
+      <Real Name="Z">-1.2290404991250639</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_32.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_32.xml
new file mode 100644 (file)
index 0000000..28f1061
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.052577361165553116</Real>
+      <Real Name="Y">-1.7509157833241376</Real>
+      <Real Name="Z">-0.070066070618527432</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-1.1903269785073174</Real>
+      <Real Name="Y">-1.7428224529077028</Real>
+      <Real Name="Z">-4.3636777044640338</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_33.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_33.xml
new file mode 100644 (file)
index 0000000..2201ef1
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-7.0276399076658986</Real>
+      <Real Name="Y">-13.508902127915418</Real>
+      <Real Name="Z">-13.322277564183304</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_34.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_34.xml
new file mode 100644 (file)
index 0000000..7c8a85a
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">-0.50415189769560531</Real>
+      <Real Name="Y">-1.1016549399990088</Real>
+      <Real Name="Z">-17.865861255901972</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-6.0867960025367065</Real>
+      <Real Name="Y">-0.87101373228929435</Real>
+      <Real Name="Z">-0.84904050389343544</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_35.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_35.xml
new file mode 100644 (file)
index 0000000..cf4222c
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.6600000262260437</Real>
+      <Real Name="Y">0.67000001668930054</Real>
+      <Real Name="Z">0.37999999523162842</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44999998807907104</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.93999999761581421</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54000002145767212</Real>
+      <Real Name="Y">0.75999999046325684</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.77742262214514635</Real>
+      <Real Name="Y">-1.4409157809399518</Real>
+      <Real Name="Z">0.6599339484549589</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.70999997854232788</Real>
+      <Real Name="Y">0.059999998658895493</Real>
+      <Real Name="Z">0.34999999403953552</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.31999999284744263</Real>
+      <Real Name="Y">0.34999999403953552</Real>
+      <Real Name="Z">0.61000001430511475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.92032696777848133</Real>
+      <Real Name="Y">-0.76282243383421644</Real>
+      <Real Name="Z">-3.5336777211533343</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10999999940395355</Real>
+      <Real Name="Y">0.30000001192092896</Real>
+      <Real Name="Z">0.41999998688697815</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.94999998807907104</Real>
+      <Real Name="Y">0.68999999761581421</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.28999999165534973</Real>
+      <Real Name="Y">0.10000000149011612</Real>
+      <Real Name="Z">0.68000000715255737</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.93999999761581421</Real>
+      <Real Name="Y">0.62000000476837158</Real>
+      <Real Name="Z">0.50999999046325684</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.4699999988079071</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.4699999988079071</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_36.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_36.xml
new file mode 100644 (file)
index 0000000..4c5cf09
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-8.2305961590882664</Real>
+      <Real Name="Y">1.2798951389932887</Real>
+      <Real Name="Z">-6.3929958163443734</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_37.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_37.xml
new file mode 100644 (file)
index 0000000..515e410
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">1.4460874540966253</Real>
+      <Real Name="Y">2.1584071797019928</Real>
+      <Real Name="Z">1.0820509080507321</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_38.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_38.xml
new file mode 100644 (file)
index 0000000..81e684c
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.72589890716513583</Real>
+      <Real Name="Y">-24.710884942780222</Real>
+      <Real Name="Z">-4.3321274070179072</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-2.3815237342072924</Real>
+      <Real Name="Y">-1.4624040861760008</Real>
+      <Real Name="Z">-2.5707897210960202</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_39.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_39.xml
new file mode 100644 (file)
index 0000000..4bf64f3
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-8.2105961595353012</Real>
+      <Real Name="Y">2.1498951437616602</Real>
+      <Real Name="Z">-5.4429958282653024</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_4.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_4.xml
new file mode 100644 (file)
index 0000000..f40c696
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">1.2021184551344297</Real>
+      <Real Name="Y">0.97968914191614953</Real>
+      <Real Name="Z">3.3354195652242611</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_40.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_40.xml
new file mode 100644 (file)
index 0000000..a1b6cd6
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">2.1060874803226692</Real>
+      <Real Name="Y">2.8284071963912933</Real>
+      <Real Name="Z">1.4620509032823605</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_41.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_41.xml
new file mode 100644 (file)
index 0000000..4a5309b
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.6600000262260437</Real>
+      <Real Name="Y">0.67000001668930054</Real>
+      <Real Name="Z">0.37999999523162842</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44999998807907104</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.93999999761581421</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54000002145767212</Real>
+      <Real Name="Y">0.75999999046325684</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10410107614556363</Real>
+      <Real Name="Y">-24.400884940396036</Real>
+      <Real Name="Z">-3.6021273879444209</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-1.6715237556649645</Real>
+      <Real Name="Y">-1.4024040875171053</Real>
+      <Real Name="Z">-2.2207897270564847</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.31999999284744263</Real>
+      <Real Name="Y">0.34999999403953552</Real>
+      <Real Name="Z">0.61000001430511475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.27000001072883606</Real>
+      <Real Name="Y">0.98000001907348633</Real>
+      <Real Name="Z">0.82999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10999999940395355</Real>
+      <Real Name="Y">0.30000001192092896</Real>
+      <Real Name="Z">0.41999998688697815</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.94999998807907104</Real>
+      <Real Name="Y">0.68999999761581421</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.28999999165534973</Real>
+      <Real Name="Y">0.10000000149011612</Real>
+      <Real Name="Z">0.68000000715255737</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.93999999761581421</Real>
+      <Real Name="Y">0.62000000476837158</Real>
+      <Real Name="Z">0.50999999046325684</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.4699999988079071</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.4699999988079071</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_42.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_42.xml
new file mode 100644 (file)
index 0000000..61df0e8
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-5.7262074246153265</Real>
+      <Real Name="Y">-17.973627665854735</Real>
+      <Real Name="Z">-11.213932362491866</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_43.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_43.xml
new file mode 100644 (file)
index 0000000..73af103
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">-0.42587341651446342</Real>
+      <Real Name="Y">-2.4645686809592258</Real>
+      <Real Name="Z">-14.783890977413678</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-5.4817717733697346</Real>
+      <Real Name="Y">-1.9262671862232437</Real>
+      <Real Name="Z">-0.96567467788397876</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_44.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_44.xml
new file mode 100644 (file)
index 0000000..bc15223
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.0427191059470119</Real>
+      <Real Name="Y">-2.1886447291551718</Real>
+      <Real Name="Z">-0.055051912628842979</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.96714067003719539</Real>
+      <Real Name="Y">-2.1785280661346289</Real>
+      <Real Name="Z">-3.4286039106503119</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_45.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_45.xml
new file mode 100644 (file)
index 0000000..7441c77
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-5.7062074250623613</Real>
+      <Real Name="Y">-17.103627661086364</Real>
+      <Real Name="Z">-10.263932374412795</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_46.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_46.xml
new file mode 100644 (file)
index 0000000..5ca4468
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">-0.40587341696149826</Real>
+      <Real Name="Y">-1.5945686761908542</Real>
+      <Real Name="Z">-13.833890989334607</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-4.8217717471436909</Real>
+      <Real Name="Y">-1.2562671695339431</Real>
+      <Real Name="Z">-0.58567468265235034</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_47.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_47.xml
new file mode 100644 (file)
index 0000000..0d6f646
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.6600000262260437</Real>
+      <Real Name="Y">0.67000001668930054</Real>
+      <Real Name="Z">0.37999999523162842</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44999998807907104</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.93999999761581421</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54000002145767212</Real>
+      <Real Name="Y">0.75999999046325684</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.78728087736368757</Real>
+      <Real Name="Y">-1.878644726770986</Real>
+      <Real Name="Z">0.67494810644464331</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.70999997854232788</Real>
+      <Real Name="Y">0.059999998658895493</Real>
+      <Real Name="Z">0.34999999403953552</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.31999999284744263</Real>
+      <Real Name="Y">0.34999999403953552</Real>
+      <Real Name="Z">0.61000001430511475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.69714065930835933</Real>
+      <Real Name="Y">-1.1985280470611426</Real>
+      <Real Name="Z">-2.5986039273396124</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10999999940395355</Real>
+      <Real Name="Y">0.30000001192092896</Real>
+      <Real Name="Z">0.41999998688697815</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.94999998807907104</Real>
+      <Real Name="Y">0.68999999761581421</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.28999999165534973</Real>
+      <Real Name="Y">0.10000000149011612</Real>
+      <Real Name="Z">0.68000000715255737</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.93999999761581421</Real>
+      <Real Name="Y">0.62000000476837158</Real>
+      <Real Name="Z">0.50999999046325684</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.4699999988079071</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.4699999988079071</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_48.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_48.xml
new file mode 100644 (file)
index 0000000..fb5bbfc
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">3.0030106990475081</Real>
+      <Real Name="Y">-0.97947087544725719</Real>
+      <Real Name="Z">0.52873130622863018</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_49.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_49.xml
new file mode 100644 (file)
index 0000000..bde9921
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">11.261765725565441</Real>
+      <Real Name="Y">2.8944021905057711</Real>
+      <Real Name="Z">8.1326966202729416</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_5.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_5.xml
new file mode 100644 (file)
index 0000000..41a9637
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.6600000262260437</Real>
+      <Real Name="Y">0.67000001668930054</Real>
+      <Real Name="Z">0.37999999523162842</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44999998807907104</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.93999999761581421</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54000002145767212</Real>
+      <Real Name="Y">0.75999999046325684</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-9.2107554875515074</Real>
+      <Real Name="Y">-11.452720492666822</Real>
+      <Real Name="Z">-10.655035154526145</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-9.6665535176822637</Real>
+      <Real Name="Y">-8.8875609359019645</Real>
+      <Real Name="Z">-9.4515678372416474</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.31999999284744263</Real>
+      <Real Name="Y">0.34999999403953552</Real>
+      <Real Name="Z">0.61000001430511475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.27000001072883606</Real>
+      <Real Name="Y">0.98000001907348633</Real>
+      <Real Name="Z">0.82999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10999999940395355</Real>
+      <Real Name="Y">0.30000001192092896</Real>
+      <Real Name="Z">0.41999998688697815</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.94999998807907104</Real>
+      <Real Name="Y">0.68999999761581421</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.28999999165534973</Real>
+      <Real Name="Y">0.10000000149011612</Real>
+      <Real Name="Z">0.68000000715255737</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.93999999761581421</Real>
+      <Real Name="Y">0.62000000476837158</Real>
+      <Real Name="Z">0.50999999046325684</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.4699999988079071</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.4699999988079071</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_50.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_50.xml
new file mode 100644 (file)
index 0000000..3dce491
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">-3.423918020647772</Real>
+      <Real Name="Y">-0.75011467859246217</Real>
+      <Real Name="Z">-0.37339673869951695</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">3.6142231798233309</Real>
+      <Real Name="Y">-0.5603731435929743</Real>
+      <Real Name="Z">-15.314157091800631</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.13978719994792918</Real>
+      <Real Name="Y">-0.88994132779279667</Real>
+      <Real Name="Z">-4.3663155404400467</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">1.935869531193428</Real>
+      <Real Name="Y">-19.559586503779869</Real>
+      <Real Name="Z">4.8894339493261105</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_51.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_51.xml
new file mode 100644 (file)
index 0000000..353f2d7
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">3.0230106986004732</Real>
+      <Real Name="Y">-0.10947087067888561</Real>
+      <Real Name="Z">1.4787312943077011</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_52.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_52.xml
new file mode 100644 (file)
index 0000000..748e28d
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">11.921765751791485</Real>
+      <Real Name="Y">3.5644022071950716</Real>
+      <Real Name="Z">8.51269661550457</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_53.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_53.xml
new file mode 100644 (file)
index 0000000..1ed2e94
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">-3.4039180210948068</Real>
+      <Real Name="Y">0.11988532617590941</Real>
+      <Real Name="Z">0.57660324937955409</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.6600000262260437</Real>
+      <Real Name="Y">0.67000001668930054</Real>
+      <Real Name="Z">0.37999999523162842</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44999998807907104</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.93999999761581421</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54000002145767212</Real>
+      <Real Name="Y">0.75999999046325684</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">4.4442231631340299</Real>
+      <Real Name="Y">-0.25037314120878851</Real>
+      <Real Name="Z">-14.584157072727145</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.57021277859439867</Real>
+      <Real Name="Y">-0.82994132913390117</Real>
+      <Real Name="Z">-4.0163155464005111</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.31999999284744263</Real>
+      <Real Name="Y">0.34999999403953552</Real>
+      <Real Name="Z">0.61000001430511475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">2.2058695419222643</Real>
+      <Real Name="Y">-18.579586484706383</Real>
+      <Real Name="Z">5.71943393263681</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10999999940395355</Real>
+      <Real Name="Y">0.30000001192092896</Real>
+      <Real Name="Z">0.41999998688697815</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.94999998807907104</Real>
+      <Real Name="Y">0.68999999761581421</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.28999999165534973</Real>
+      <Real Name="Y">0.10000000149011612</Real>
+      <Real Name="Z">0.68000000715255737</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.93999999761581421</Real>
+      <Real Name="Y">0.62000000476837158</Real>
+      <Real Name="Z">0.50999999046325684</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.4699999988079071</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.4699999988079071</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_54.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_54.xml
new file mode 100644 (file)
index 0000000..5e7af78
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-14.438108526163015</Real>
+      <Real Name="Y">-18.778011899791231</Real>
+      <Real Name="Z">-7.4710258563699679</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_55.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_55.xml
new file mode 100644 (file)
index 0000000..75f89f2
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">-0.49656498125090714</Real>
+      <Real Name="Y">-0.85139644735204068</Real>
+      <Real Name="Z">-6.170384440946111</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-6.6205112875606282</Real>
+      <Real Name="Y">-5.9775696621654237</Real>
+      <Real Name="Z">-16.795786276144295</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_56.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_56.xml
new file mode 100644 (file)
index 0000000..043cabb
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">-7.3076727681614635</Real>
+      <Real Name="Y">-1.0751125611988102</Real>
+      <Real Name="Z">-3.5350277386547013</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-9.6177282670557229</Real>
+      <Real Name="Y">-20.98171739240464</Real>
+      <Real Name="Z">-24.469455185751023</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-1.3391614715749778</Real>
+      <Real Name="Y">-2.4637889252880081</Real>
+      <Real Name="Z">-17.156428586866937</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-6.1505787518064086</Real>
+      <Real Name="Y">-17.61583652610614</Real>
+      <Real Name="Z">-4.4618914487107055</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.59103431303769127</Real>
+      <Real Name="Y">-0.089534785133402892</Real>
+      <Real Name="Z">-0.71108816991442636</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_57.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_57.xml
new file mode 100644 (file)
index 0000000..b86c84a
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-14.41810852661005</Real>
+      <Real Name="Y">-17.90801189502286</Real>
+      <Real Name="Z">-6.5210258682908968</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_58.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_58.xml
new file mode 100644 (file)
index 0000000..37334d2
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">-0.47656498169794198</Real>
+      <Real Name="Y">0.018603557416330907</Real>
+      <Real Name="Z">-5.22038445286704</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-5.9605112613345845</Real>
+      <Real Name="Y">-5.3075696454761232</Real>
+      <Real Name="Z">-16.415786280912666</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_59.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_59.xml
new file mode 100644 (file)
index 0000000..0ef2b80
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">-7.2876727686084983</Real>
+      <Real Name="Y">-0.20511255643043858</Real>
+      <Real Name="Z">-2.5850277505756303</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.6600000262260437</Real>
+      <Real Name="Y">0.67000001668930054</Real>
+      <Real Name="Z">0.37999999523162842</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44999998807907104</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.93999999761581421</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54000002145767212</Real>
+      <Real Name="Y">0.75999999046325684</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-8.7877282837450235</Real>
+      <Real Name="Y">-20.671717390020454</Real>
+      <Real Name="Z">-23.739455166677537</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.6291614930326499</Real>
+      <Real Name="Y">-2.4037889266291126</Real>
+      <Real Name="Z">-16.806428592827402</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.31999999284744263</Real>
+      <Real Name="Y">0.34999999403953552</Real>
+      <Real Name="Z">0.61000001430511475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-5.8805787410775725</Real>
+      <Real Name="Y">-16.635836507032653</Real>
+      <Real Name="Z">-3.6318914654000061</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10999999940395355</Real>
+      <Real Name="Y">0.30000001192092896</Real>
+      <Real Name="Z">0.41999998688697815</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.94999998807907104</Real>
+      <Real Name="Y">0.68999999761581421</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.30103432138234154</Real>
+      <Real Name="Y">0.010465216356713228</Real>
+      <Real Name="Z">-0.031088162761868987</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.93999999761581421</Real>
+      <Real Name="Y">0.62000000476837158</Real>
+      <Real Name="Z">0.50999999046325684</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.4699999988079071</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.4699999988079071</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_6.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_6.xml
new file mode 100644 (file)
index 0000000..f9540fb
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-19.945252342067167</Real>
+      <Real Name="Y">-5.8550434537770943</Real>
+      <Real Name="Z">-10.097354831085514</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_60.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_60.xml
new file mode 100644 (file)
index 0000000..ab73bb4
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">2.4399461929761004</Real>
+      <Real Name="Y">-1.2243385943090714</Real>
+      <Real Name="Z">0.41543174060820942</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_61.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_61.xml
new file mode 100644 (file)
index 0000000..2de56c4
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">9.1501846520219203</Real>
+      <Real Name="Y">3.6180027381322137</Real>
+      <Real Name="Z">6.3899759159287406</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_62.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_62.xml
new file mode 100644 (file)
index 0000000..fe0b3dc
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">-2.7819333917763145</Real>
+      <Real Name="Y">-0.93764334824057782</Real>
+      <Real Name="Z">-0.29338315183533475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">2.9365563336064566</Real>
+      <Real Name="Y">-0.70046642949121796</Real>
+      <Real Name="Z">-12.032552000700495</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.11357709995769247</Real>
+      <Real Name="Y">-1.112426659740996</Real>
+      <Real Name="Z">-3.4306764960600371</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">1.5728939940946602</Real>
+      <Real Name="Y">-24.449483129724836</Real>
+      <Real Name="Z">3.8416981030419435</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_63.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_63.xml
new file mode 100644 (file)
index 0000000..e5b27b0
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">2.4599461925290655</Real>
+      <Real Name="Y">-0.35433858954069986</Real>
+      <Real Name="Z">1.3654317286872804</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_64.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_64.xml
new file mode 100644 (file)
index 0000000..d360799
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">9.810184678247964</Real>
+      <Real Name="Y">4.2880027548215143</Real>
+      <Real Name="Z">6.769975911160369</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_65.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_65.xml
new file mode 100644 (file)
index 0000000..205fd7d
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">-2.7619333922233493</Real>
+      <Real Name="Y">-0.067643343472206241</Real>
+      <Real Name="Z">0.65661683624373635</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.6600000262260437</Real>
+      <Real Name="Y">0.67000001668930054</Real>
+      <Real Name="Z">0.37999999523162842</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44999998807907104</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.93999999761581421</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54000002145767212</Real>
+      <Real Name="Y">0.75999999046325684</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">3.7665563169171561</Real>
+      <Real Name="Y">-0.39046642710703217</Real>
+      <Real Name="Z">-11.302551981627008</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.59642287858463539</Real>
+      <Real Name="Y">-1.0524266610821005</Real>
+      <Real Name="Z">-3.0806765020205016</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.31999999284744263</Real>
+      <Real Name="Y">0.34999999403953552</Real>
+      <Real Name="Z">0.61000001430511475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">1.8428940048234963</Real>
+      <Real Name="Y">-23.46948311065135</Real>
+      <Real Name="Z">4.6716980863526434</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10999999940395355</Real>
+      <Real Name="Y">0.30000001192092896</Real>
+      <Real Name="Z">0.41999998688697815</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.94999998807907104</Real>
+      <Real Name="Y">0.68999999761581421</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.28999999165534973</Real>
+      <Real Name="Y">0.10000000149011612</Real>
+      <Real Name="Z">0.68000000715255737</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.93999999761581421</Real>
+      <Real Name="Y">0.62000000476837158</Real>
+      <Real Name="Z">0.50999999046325684</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.4699999988079071</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.4699999988079071</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_66.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_66.xml
new file mode 100644 (file)
index 0000000..86c8e77
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-11.73096317750745</Real>
+      <Real Name="Y">-23.472514874739037</Real>
+      <Real Name="Z">-5.870091744290689</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_67.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_67.xml
new file mode 100644 (file)
index 0000000..ce158bb
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">-3.0565076595646632</Real>
+      <Real Name="Y">-1.4103500790664754</Real>
+      <Real Name="Z">-4.9677026084105016</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-5.3791654211430107</Real>
+      <Real Name="Y">-7.4719620777067792</Real>
+      <Real Name="Z">-13.196689216970519</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_68.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_68.xml
new file mode 100644 (file)
index 0000000..7968b98
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">-5.9374841241311893</Real>
+      <Real Name="Y">-1.3438907014985126</Real>
+      <Real Name="Z">-2.7775217946572655</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-7.8144042169827745</Real>
+      <Real Name="Y">-26.227146740505805</Real>
+      <Real Name="Z">-19.226000503090088</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-1.0880686956546695</Real>
+      <Real Name="Y">-3.0797361566100099</Real>
+      <Real Name="Z">-13.480051032538309</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-4.9973452358427064</Real>
+      <Real Name="Y">-22.019795657632674</Real>
+      <Real Name="Z">-3.5057718525584116</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.48021537934312419</Real>
+      <Real Name="Y">-0.1119184814167536</Real>
+      <Real Name="Z">-0.55871213350419213</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_69.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_69.xml
new file mode 100644 (file)
index 0000000..454e02b
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-11.710963177954484</Real>
+      <Real Name="Y">-22.602514869970666</Real>
+      <Real Name="Z">-4.920091756211618</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_7.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_7.xml
new file mode 100644 (file)
index 0000000..a985a7b
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">-4.2562713131673355</Real>
+      <Real Name="Y">-3.1975379801333257</Real>
+      <Real Name="Z">-12.696263461962817</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.083636781240502847</Real>
+      <Real Name="Y">-0.683594730203958</Real>
+      <Real Name="Z">-6.5236686696981163</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_70.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_70.xml
new file mode 100644 (file)
index 0000000..049d038
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">-3.036507660011698</Real>
+      <Real Name="Y">-0.54035007429810378</Real>
+      <Real Name="Z">-4.0177026203314306</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-4.719165394916967</Real>
+      <Real Name="Y">-6.8019620610174787</Real>
+      <Real Name="Z">-12.816689221738891</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_71.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_71.xml
new file mode 100644 (file)
index 0000000..5b6e408
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">-5.9174841245782241</Real>
+      <Real Name="Y">-0.47389069673014106</Real>
+      <Real Name="Z">-1.8275218065781944</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.6600000262260437</Real>
+      <Real Name="Y">0.67000001668930054</Real>
+      <Real Name="Z">0.37999999523162842</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44999998807907104</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.93999999761581421</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54000002145767212</Real>
+      <Real Name="Y">0.75999999046325684</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-6.9844042336720751</Real>
+      <Real Name="Y">-25.91714673812162</Real>
+      <Real Name="Z">-18.496000484016601</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.37806871711234158</Real>
+      <Real Name="Y">-3.0197361579511144</Real>
+      <Real Name="Z">-13.130051038498774</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.31999999284744263</Real>
+      <Real Name="Y">0.34999999403953552</Real>
+      <Real Name="Z">0.61000001430511475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-4.7273452251138703</Real>
+      <Real Name="Y">-21.039795638559188</Real>
+      <Real Name="Z">-2.6757718692477122</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10999999940395355</Real>
+      <Real Name="Y">0.30000001192092896</Real>
+      <Real Name="Z">0.41999998688697815</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.94999998807907104</Real>
+      <Real Name="Y">0.68999999761581421</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.19021538768777446</Real>
+      <Real Name="Y">-0.011918479926637485</Real>
+      <Real Name="Z">0.12128787364836524</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.93999999761581421</Real>
+      <Real Name="Y">0.62000000476837158</Real>
+      <Real Name="Z">0.50999999046325684</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.4699999988079071</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.4699999988079071</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_72.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_72.xml
new file mode 100644 (file)
index 0000000..571aef3
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">0.78266792292938536</Real>
+      <Real Name="Y">0.24701126089639641</Real>
+      <Real Name="Z">0.075197087339731225</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_73.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_73.xml
new file mode 100644 (file)
index 0000000..f59a297
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.61956391875244121</Real>
+      <Real Name="Y">0.25681538531643089</Real>
+      <Real Name="Z">0.264650385589911</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_74.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_74.xml
new file mode 100644 (file)
index 0000000..831e529
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-11.475149109556806</Real>
+      <Real Name="Y">-9.7544516427343577</Real>
+      <Real Name="Z">3.0247422457903341</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-11.858918281399532</Real>
+      <Real Name="Y">-7.4199289605932677</Real>
+      <Real Name="Z">3.011716132619819</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_75.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_75.xml
new file mode 100644 (file)
index 0000000..fffc562
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">0.80266792248235053</Real>
+      <Real Name="Y">1.1170112656647679</Real>
+      <Real Name="Z">1.0251970754188022</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_76.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_76.xml
new file mode 100644 (file)
index 0000000..a88b4e1
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">1.2795639449784848</Real>
+      <Real Name="Y">0.92681540200573143</Real>
+      <Real Name="Z">0.64465038082153936</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_77.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_77.xml
new file mode 100644 (file)
index 0000000..f57b0cd
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.6600000262260437</Real>
+      <Real Name="Y">0.67000001668930054</Real>
+      <Real Name="Z">0.37999999523162842</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44999998807907104</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.93999999761581421</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54000002145767212</Real>
+      <Real Name="Y">0.75999999046325684</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-10.645149126246107</Real>
+      <Real Name="Y">-9.4444516403501719</Real>
+      <Real Name="Z">3.7547422648638205</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-11.148918302857204</Real>
+      <Real Name="Y">-7.3599289619343722</Real>
+      <Real Name="Z">3.3617161266593545</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.31999999284744263</Real>
+      <Real Name="Y">0.34999999403953552</Real>
+      <Real Name="Z">0.61000001430511475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.27000001072883606</Real>
+      <Real Name="Y">0.98000001907348633</Real>
+      <Real Name="Z">0.82999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10999999940395355</Real>
+      <Real Name="Y">0.30000001192092896</Real>
+      <Real Name="Z">0.41999998688697815</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.94999998807907104</Real>
+      <Real Name="Y">0.68999999761581421</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.28999999165534973</Real>
+      <Real Name="Y">0.10000000149011612</Real>
+      <Real Name="Z">0.68000000715255737</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.93999999761581421</Real>
+      <Real Name="Y">0.62000000476837158</Real>
+      <Real Name="Z">0.50999999046325684</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.4699999988079071</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.4699999988079071</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_78.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_78.xml
new file mode 100644 (file)
index 0000000..2b89260
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-22.79457410521962</Real>
+      <Real Name="Y">-4.8554021376267826</Real>
+      <Real Name="Z">5.6800905790772545</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_79.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_79.xml
new file mode 100644 (file)
index 0000000..7b95007
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">-4.8643100721912402</Real>
+      <Real Name="Y">-2.6516169976273649</Real>
+      <Real Name="Z">-0.25116456753339361</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.09558489284628896</Real>
+      <Real Name="Y">-0.56688346388984168</Real>
+      <Real Name="Z">-0.94910028423615156</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_8.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_8.xml
new file mode 100644 (file)
index 0000000..e537a38
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-3.5826533245421075</Real>
+      <Real Name="Y">-9.5803366494364646</Real>
+      <Real Name="Z">-23.575529237696852</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_80.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_80.xml
new file mode 100644 (file)
index 0000000..b008c56
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-4.0944609423338374</Real>
+      <Real Name="Y">-7.9446698242436193</Real>
+      <Real Name="Z">-1.3877955568392644</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_81.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_81.xml
new file mode 100644 (file)
index 0000000..90ff66e
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-22.774574105666655</Real>
+      <Real Name="Y">-3.9854021328584111</Real>
+      <Real Name="Z">6.6300905671563255</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_82.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_82.xml
new file mode 100644 (file)
index 0000000..161ac2b
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">-4.8443100726382751</Real>
+      <Real Name="Y">-1.7816169928589933</Real>
+      <Real Name="Z">0.69883542054567749</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.56441513337975469</Real>
+      <Real Name="Y">0.10311655279945886</Real>
+      <Real Name="Z">-0.56910028900452314</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_83.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_83.xml
new file mode 100644 (file)
index 0000000..5b85cce
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.6600000262260437</Real>
+      <Real Name="Y">0.67000001668930054</Real>
+      <Real Name="Z">0.37999999523162842</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44999998807907104</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.93999999761581421</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54000002145767212</Real>
+      <Real Name="Y">0.75999999046325684</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.82999998331069946</Real>
+      <Real Name="Y">0.31000000238418579</Real>
+      <Real Name="Z">0.73000001907348633</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.70999997854232788</Real>
+      <Real Name="Y">0.059999998658895493</Real>
+      <Real Name="Z">0.34999999403953552</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.31999999284744263</Real>
+      <Real Name="Y">0.34999999403953552</Real>
+      <Real Name="Z">0.61000001430511475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-3.8244609316050013</Real>
+      <Real Name="Y">-6.964669805170133</Real>
+      <Real Name="Z">-0.5577955735285649</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10999999940395355</Real>
+      <Real Name="Y">0.30000001192092896</Real>
+      <Real Name="Z">0.41999998688697815</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.94999998807907104</Real>
+      <Real Name="Y">0.68999999761581421</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.28999999165534973</Real>
+      <Real Name="Y">0.10000000149011612</Real>
+      <Real Name="Z">0.68000000715255737</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.93999999761581421</Real>
+      <Real Name="Y">0.62000000476837158</Real>
+      <Real Name="Z">0.50999999046325684</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.4699999988079071</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.4699999988079071</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_84.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_84.xml
new file mode 100644 (file)
index 0000000..5f59624
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">0.63591768738012566</Real>
+      <Real Name="Y">0.3087640761204955</Real>
+      <Real Name="Z">0.03426844856107035</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_85.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_85.xml
new file mode 100644 (file)
index 0000000..ef5c4c2
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.50339568398635848</Real>
+      <Real Name="Y">0.32101923164553864</Real>
+      <Real Name="Z">0.18363175660878781</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_86.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_86.xml
new file mode 100644 (file)
index 0000000..ef02889
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-9.3235586515149063</Real>
+      <Real Name="Y">-12.193064553417946</Real>
+      <Real Name="Z">3.2071979869138385</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-9.6353711036371195</Real>
+      <Real Name="Y">-9.2749112007415846</Real>
+      <Real Name="Z">3.0222260742447977</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_87.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_87.xml
new file mode 100644 (file)
index 0000000..5a48768
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">0.65591768693309083</Real>
+      <Real Name="Y">1.1787640808888671</Real>
+      <Real Name="Z">0.98426843664014141</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_88.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_88.xml
new file mode 100644 (file)
index 0000000..1cc01a9
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">1.1633957102124022</Real>
+      <Real Name="Y">0.99101924833483923</Real>
+      <Real Name="Z">0.56363175184041625</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_89.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_89.xml
new file mode 100644 (file)
index 0000000..061bf0f
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.6600000262260437</Real>
+      <Real Name="Y">0.67000001668930054</Real>
+      <Real Name="Z">0.37999999523162842</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44999998807907104</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.93999999761581421</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54000002145767212</Real>
+      <Real Name="Y">0.75999999046325684</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-8.4935586682042068</Real>
+      <Real Name="Y">-11.88306455103376</Real>
+      <Real Name="Z">3.9371980059873248</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-8.9253711250947916</Real>
+      <Real Name="Y">-9.2149112020826891</Real>
+      <Real Name="Z">3.3722260682843332</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.31999999284744263</Real>
+      <Real Name="Y">0.34999999403953552</Real>
+      <Real Name="Z">0.61000001430511475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.27000001072883606</Real>
+      <Real Name="Y">0.98000001907348633</Real>
+      <Real Name="Z">0.82999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10999999940395355</Real>
+      <Real Name="Y">0.30000001192092896</Real>
+      <Real Name="Z">0.41999998688697815</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.94999998807907104</Real>
+      <Real Name="Y">0.68999999761581421</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.28999999165534973</Real>
+      <Real Name="Y">0.10000000149011612</Real>
+      <Real Name="Z">0.68000000715255737</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.93999999761581421</Real>
+      <Real Name="Y">0.62000000476837158</Real>
+      <Real Name="Z">0.50999999046325684</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.4699999988079071</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.4699999988079071</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_9.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_9.xml
new file mode 100644 (file)
index 0000000..7759abf
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-19.925252342514202</Real>
+      <Real Name="Y">-4.9850434490087228</Real>
+      <Real Name="Z">-9.1473548430064433</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_90.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_90.xml
new file mode 100644 (file)
index 0000000..759360d
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-18.520591460490941</Real>
+      <Real Name="Y">-6.0692526720334774</Real>
+      <Real Name="Z">5.0076479125818185</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_91.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_91.xml
new file mode 100644 (file)
index 0000000..e86b6ed
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">-3.9522519336553823</Real>
+      <Real Name="Y">-3.3145212470342056</Real>
+      <Real Name="Z">0.041856812732197594</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-0.077662725437609784</Real>
+      <Real Name="Y">-0.70860432986230215</Real>
+      <Real Name="Z">-0.70184026829559087</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_92.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_92.xml
new file mode 100644 (file)
index 0000000..993c18d
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-3.326749515646243</Real>
+      <Real Name="Y">-9.9308372803045231</Real>
+      <Real Name="Z">-0.45425921737202102</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_93.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_93.xml
new file mode 100644 (file)
index 0000000..cd4597a
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-18.500591460937976</Real>
+      <Real Name="Y">-5.1992526672651058</Real>
+      <Real Name="Z">5.9576479006608896</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_94.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_94.xml
new file mode 100644 (file)
index 0000000..36ced80
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">-3.9322519341024171</Real>
+      <Real Name="Y">-2.444521242265834</Real>
+      <Real Name="Z">0.99185680081126859</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.58233730078843393</Real>
+      <Real Name="Y">-0.038604313173001614</Real>
+      <Real Name="Z">-0.32184027306396246</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_95.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_95.xml
new file mode 100644 (file)
index 0000000..59d83c3
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0.019999999552965164</Real>
+      <Real Name="Y">0.87000000476837158</Real>
+      <Real Name="Z">0.94999998807907104</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.6600000262260437</Real>
+      <Real Name="Y">0.67000001668930054</Real>
+      <Real Name="Z">0.37999999523162842</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.44999998807907104</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.93999999761581421</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.54000002145767212</Real>
+      <Real Name="Y">0.75999999046325684</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.82999998331069946</Real>
+      <Real Name="Y">0.31000000238418579</Real>
+      <Real Name="Z">0.73000001907348633</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.70999997854232788</Real>
+      <Real Name="Y">0.059999998658895493</Real>
+      <Real Name="Z">0.34999999403953552</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.31999999284744263</Real>
+      <Real Name="Y">0.34999999403953552</Real>
+      <Real Name="Z">0.61000001430511475</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-3.0567495049174069</Real>
+      <Real Name="Y">-8.9508372612310367</Real>
+      <Real Name="Z">0.37574076593867844</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.10999999940395355</Real>
+      <Real Name="Y">0.30000001192092896</Real>
+      <Real Name="Z">0.41999998688697815</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.94999998807907104</Real>
+      <Real Name="Y">0.68999999761581421</Real>
+      <Real Name="Z">0.57999998331069946</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.28999999165534973</Real>
+      <Real Name="Y">0.10000000149011612</Real>
+      <Real Name="Z">0.68000000715255737</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.93999999761581421</Real>
+      <Real Name="Y">0.62000000476837158</Real>
+      <Real Name="Z">0.50999999046325684</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0.4699999988079071</Real>
+      <Real Name="Y">0.039999999105930328</Real>
+      <Real Name="Z">0.4699999988079071</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_96.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_96.xml
new file mode 100644 (file)
index 0000000..50244a9
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-11.577102289706572</Real>
+      <Real Name="Y">0.84910120894795005</Real>
+      <Real Name="Z">1.8482439089193421</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_97.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_97.xml
new file mode 100644 (file)
index 0000000..7bc4c48
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">2</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">2.0340570782897585</Real>
+      <Real Name="Y">1.4319189829320136</Real>
+      <Real Name="Z">-0.59251856152304705</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_98.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_98.xml
new file mode 100644 (file)
index 0000000..f60869d
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">13</Int>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-1.0210446166718394</Real>
+      <Real Name="Y">-16.393563534893939</Real>
+      <Real Name="Z">2.0765205102067403</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">-3.3498355821816856</Real>
+      <Real Name="Y">-0.97018032158412315</Real>
+      <Real Name="Z">0.58368499271815877</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+    <Vector>
+      <Real Name="X">0</Real>
+      <Real Name="Y">0</Real>
+      <Real Name="Z">0</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_99.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeGatherTest_ReproducesOutputs_99.xml
new file mode 100644 (file)
index 0000000..ef42b55
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Forces">
+    <Int Name="Length">1</Int>
+    <Vector>
+      <Real Name="X">-11.557102290153606</Real>
+      <Real Name="Y">1.7191012137163217</Real>
+      <Real Name="Z">2.7982438969984131</Real>
+    </Vector>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_0.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_0.xml
new file mode 100644 (file)
index 0000000..8c74152
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 0 0 re">3.5</Real>
+    <Real Name="Cell 0 0 0 im">6.6999998092651367</Real>
+    <Real Name="Cell 3 1 2 re">0.029793791749999521</Real>
+    <Real Name="Cell 3 1 2 im">0.39228491385592074</Real>
+    <Real Name="Cell 3 5 7 re">-1.7719234621492696e-18</Real>
+    <Real Name="Cell 3 5 7 im">2.9532057266304802e-24</Real>
+    <Real Name="Cell 6 2 4 re">0.00023152408798567255</Real>
+    <Real Name="Cell 6 2 4 im">1.8844984033755337e-05</Real>
+    <Real Name="Cell 7 0 0 re">-2.5995625152404473</Real>
+    <Real Name="Cell 7 0 0 im">-0.72787749187164519</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">6.6281524398489351</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">8.2591871252955169</Real>
+    <Real Name="Cell 1 0">1.1366553211135979</Real>
+    <Real Name="Cell 1 1">-2.4225818754293491</Real>
+    <Real Name="Cell 2 0">3.8646282001861314</Real>
+    <Real Name="Cell 2 1">3.0310808563029275</Real>
+    <Real Name="Cell 2 2">6.9915989805718821</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_1.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_1.xml
new file mode 100644 (file)
index 0000000..038a0b3
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 0 0 re">-0.040960646891504318</Real>
+    <Real Name="Cell 0 0 0 im">-0.078410378960130159</Real>
+    <Real Name="Cell 3 1 2 re">-1.3292554554983258e-14</Real>
+    <Real Name="Cell 3 1 2 im">-1.7501863013212537e-13</Real>
+    <Real Name="Cell 7 0 0 re">3.8478547590276771e-09</Real>
+    <Real Name="Cell 7 0 0 im">1.0773993141797484e-09</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">-0.33435589928707093</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">0.16717786512572544</Real>
+    <Real Name="Cell 1 0">-3.2035473334097224e-12</Real>
+    <Real Name="Cell 1 1">0.16717794964102289</Real>
+    <Real Name="Cell 2 0">-1.0892061239107136e-11</Real>
+    <Real Name="Cell 2 1">-8.5427928890925915e-12</Real>
+    <Real Name="Cell 2 2">0.16717794961448998</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_10.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_10.xml
new file mode 100644 (file)
index 0000000..2c822fb
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 4 0 im">0.011587702199350205</Real>
+    <Real Name="Cell 0 6 7 re">0.0027096545878538447</Real>
+    <Real Name="Cell 2 5 10 re">0.084992949919242208</Real>
+    <Real Name="Cell 2 5 10 im">0.25143747449906617</Real>
+    <Real Name="Cell 4 2 7 re">2.9777523498154599</Real>
+    <Real Name="Cell 4 2 7 im">-8.6562566868719806</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">390.21941702065322</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">305.39495784936184</Real>
+    <Real Name="Cell 1 0">429.75989722709977</Real>
+    <Real Name="Cell 1 1">182.49318143618873</Real>
+    <Real Name="Cell 2 0">289.88123362603045</Real>
+    <Real Name="Cell 2 1">252.13109902072929</Real>
+    <Real Name="Cell 2 2">-25.953619706197543</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_11.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_11.xml
new file mode 100644 (file)
index 0000000..e951fb5
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 4 0 im">-4.178818756469648e-13</Real>
+    <Real Name="Cell 0 6 7 re">-1.0069137884249014e-27</Real>
+    <Real Name="Cell 2 5 10 re">-5.6094174367698197e-19</Real>
+    <Real Name="Cell 2 5 10 im">-1.6594526428986948e-18</Real>
+    <Real Name="Cell 4 2 7 re">-2.2152312932810136e-08</Real>
+    <Real Name="Cell 4 2 7 im">6.4396257454452892e-08</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">-2.8806661919058218e-06</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">-1.8705530331608101e-05</Real>
+    <Real Name="Cell 1 0">-1.7197688691957962e-05</Real>
+    <Real Name="Cell 1 1">-1.3240622263816033e-05</Real>
+    <Real Name="Cell 2 0">-1.1629584411980756e-05</Real>
+    <Real Name="Cell 2 1">-9.9276940353995703e-06</Real>
+    <Real Name="Cell 2 2">-5.2730666430580063e-06</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_12.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_12.xml
new file mode 100644 (file)
index 0000000..5bc243a
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 0 0 re">3.5</Real>
+    <Real Name="Cell 0 0 0 im">6.6999998092651367</Real>
+    <Real Name="Cell 3 1 2 re">0.8235250283388903</Real>
+    <Real Name="Cell 3 1 2 im">10.84307923982591</Real>
+    <Real Name="Cell 3 5 7 re">-0.0058552916207897637</Real>
+    <Real Name="Cell 3 5 7 im">9.7588192238469836e-09</Real>
+    <Real Name="Cell 6 2 4 re">24.162018358378187</Real>
+    <Real Name="Cell 6 2 4 im">1.9666759262436562</Real>
+    <Real Name="Cell 7 0 0 re">-4.5620086539352958</Real>
+    <Real Name="Cell 7 0 0 im">-1.2773624013485305</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">824.39918276470382</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">271.10568117726308</Real>
+    <Real Name="Cell 1 0">-592.09989563985494</Real>
+    <Real Name="Cell 1 1">362.90453530924833</Real>
+    <Real Name="Cell 2 0">-496.93337251229889</Real>
+    <Real Name="Cell 2 1">563.77003662042625</Real>
+    <Real Name="Cell 2 2">16.869408855207137</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_13.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_13.xml
new file mode 100644 (file)
index 0000000..4a67884
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 0 0 re">-0.0063639096934527042</Real>
+    <Real Name="Cell 0 0 0 im">-0.012182341066375335</Real>
+    <Real Name="Cell 3 1 2 re">-9.9228430546493259e-06</Real>
+    <Real Name="Cell 3 1 2 im">-0.00013065076327181465</Real>
+    <Real Name="Cell 3 5 7 re">2.5759085022798612e-11</Real>
+    <Real Name="Cell 3 5 7 im">-4.2931807737236158e-17</Real>
+    <Real Name="Cell 6 2 4 re">-1.3138496192640048e-06</Real>
+    <Real Name="Cell 6 2 4 im">-1.0694124880568754e-07</Real>
+    <Real Name="Cell 7 0 0 re">0.00057663643475955946</Real>
+    <Real Name="Cell 7 0 0 im">0.00016145819898305986</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">-0.053802892914868977</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">0.020691662312509726</Real>
+    <Real Name="Cell 1 0">-0.0023237899154683532</Real>
+    <Real Name="Cell 1 1">0.02527149273778484</Real>
+    <Real Name="Cell 2 0">0.000600553079798094</Real>
+    <Real Name="Cell 2 1">-0.00016167607048479874</Real>
+    <Real Name="Cell 2 2">0.026646993387493604</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_14.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_14.xml
new file mode 100644 (file)
index 0000000..3ad5450
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 4 0 im">0.11021861306916146</Real>
+    <Real Name="Cell 0 6 7 re">1.2569112094750723</Real>
+    <Real Name="Cell 2 5 10 re">1.3946131972852089</Real>
+    <Real Name="Cell 2 5 10 im">4.125730670151416</Real>
+    <Real Name="Cell 4 2 7 re">30.236028240191384</Real>
+    <Real Name="Cell 4 2 7 im">-87.895429468749143</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">3985.3659847228328</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">3095.9021918163417</Real>
+    <Real Name="Cell 1 0">4308.3013422597896</Real>
+    <Real Name="Cell 1 1">1747.2571266026378</Real>
+    <Real Name="Cell 2 0">2969.2524472571986</Real>
+    <Real Name="Cell 2 1">2429.5782224871705</Real>
+    <Real Name="Cell 2 2">-179.5912331149944</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_15.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_15.xml
new file mode 100644 (file)
index 0000000..a295124
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 4 0 im">-7.0537221329547844e-09</Real>
+    <Real Name="Cell 0 6 7 re">-5.7463804790685012e-07</Real>
+    <Real Name="Cell 2 5 10 re">-4.1614840083045064e-11</Real>
+    <Real Name="Cell 2 5 10 im">-1.2311056743065747e-10</Real>
+    <Real Name="Cell 4 2 7 re">-2.2493407131842702e-07</Real>
+    <Real Name="Cell 4 2 7 im">6.5387810342123984e-07</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">-3.1321432926615869e-05</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">-0.00018890242348857845</Real>
+    <Real Name="Cell 1 0">-0.00017462064584253123</Real>
+    <Real Name="Cell 1 1">-0.00013613472585420061</Real>
+    <Real Name="Cell 2 0">-0.00011809371439078819</Real>
+    <Real Name="Cell 2 1">-9.3982474514113124e-05</Real>
+    <Real Name="Cell 2 2">-6.9661560924232365e-05</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_2.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_2.xml
new file mode 100644 (file)
index 0000000..0ddc9d4
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 4 0 im">0.01930849403987768</Real>
+    <Real Name="Cell 0 6 7 re">1.1045009433799435e-16</Real>
+    <Real Name="Cell 2 5 10 re">2.4507459280840924e-29</Real>
+    <Real Name="Cell 2 5 10 im">7.2501233029544003e-29</Real>
+    <Real Name="Cell 4 2 7 re">9.076918472281522e-14</Real>
+    <Real Name="Cell 4 2 7 im">-2.6386390468887747e-13</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">0.0028962742328731829</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">-0.0014481371089258624</Real>
+    <Real Name="Cell 1 0">8.8361515258819677e-12</Real>
+    <Real Name="Cell 1 1">0.011339167978507696</Real>
+    <Real Name="Cell 2 0">5.257510305368959e-11</Real>
+    <Real Name="Cell 2 1">6.1846841169878849e-11</Real>
+    <Real Name="Cell 2 2">-0.0014481367483985346</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_3.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_3.xml
new file mode 100644 (file)
index 0000000..a16227f
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 4 0 im">-5.4292848213686879e-16</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">-8.1439275556636247e-17</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">4.0719637778318123e-17</Real>
+    <Real Name="Cell 1 0">-2.215406351573413e-112</Real>
+    <Real Name="Cell 1 1">-2.3047772408403365e-15</Real>
+    <Real Name="Cell 2 0">-1.3181668161597632e-111</Real>
+    <Real Name="Cell 2 1">-1.5507844461013891e-111</Real>
+    <Real Name="Cell 2 2">4.0719637778318123e-17</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_4.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_4.xml
new file mode 100644 (file)
index 0000000..0001f72
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 0 0 re">3.5</Real>
+    <Real Name="Cell 0 0 0 im">6.6999998092651367</Real>
+    <Real Name="Cell 3 1 2 re">0.092667581018586076</Real>
+    <Real Name="Cell 3 1 2 im">1.2201231163238289</Real>
+    <Real Name="Cell 3 5 7 re">-2.6528086898508655e-16</Real>
+    <Real Name="Cell 3 5 7 im">4.4213477511156205e-22</Real>
+    <Real Name="Cell 6 2 4 re">0.0011988827121831131</Real>
+    <Real Name="Cell 6 2 4 im">9.7583477235570334e-05</Real>
+    <Real Name="Cell 7 0 0 re">-44.241861946428088</Real>
+    <Real Name="Cell 7 0 0 im">-12.387721134038228</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">69.36892849186863</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">38.63901388333057</Real>
+    <Real Name="Cell 1 0">3.4880677727366778</Real>
+    <Real Name="Cell 1 1">-31.8980021606294</Real>
+    <Real Name="Cell 2 0">11.859430759952769</Real>
+    <Real Name="Cell 2 1">9.4739713557744256</Real>
+    <Real Name="Cell 2 2">-2.4729607327929468</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_5.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_5.xml
new file mode 100644 (file)
index 0000000..0c68446
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 0 0 re">-0.040960646891504318</Real>
+    <Real Name="Cell 0 0 0 im">-0.078410378960130159</Real>
+    <Real Name="Cell 3 1 2 re">-4.1343810365053865e-14</Real>
+    <Real Name="Cell 3 1 2 im">-5.4436015474703515e-13</Real>
+    <Real Name="Cell 7 0 0 re">0.0073924880067034026</Real>
+    <Real Name="Cell 7 0 0 im">0.0020698966066268229</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">-0.3443209679114585</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">0.15510734808993293</Real>
+    <Real Name="Cell 1 0">-9.9639879528132092e-12</Real>
+    <Real Name="Cell 1 1">0.17216048394791436</Real>
+    <Real Name="Cell 2 0">-3.3877559989804848e-11</Real>
+    <Real Name="Cell 2 1">-2.6570634540835225e-11</Real>
+    <Real Name="Cell 2 2">0.1721604838653891</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_6.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_6.xml
new file mode 100644 (file)
index 0000000..a482ad5
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 4 0 im">0.28488408806756871</Real>
+    <Real Name="Cell 0 6 7 re">5.061653570583762e-14</Real>
+    <Real Name="Cell 2 5 10 re">2.3693520814969476e-27</Real>
+    <Real Name="Cell 2 5 10 im">7.0093331757134742e-27</Real>
+    <Real Name="Cell 4 2 7 re">9.2166819473361329e-13</Real>
+    <Real Name="Cell 4 2 7 im">-2.6792679633799972e-12</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">0.042732615028211886</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">-0.021366307437842177</Real>
+    <Real Name="Cell 1 0">8.9722077488322564e-11</Real>
+    <Real Name="Cell 1 1">0.10345510128367014</Real>
+    <Real Name="Cell 2 0">5.3384637602950688e-10</Real>
+    <Real Name="Cell 2 1">6.2757650480313056e-10</Real>
+    <Real Name="Cell 2 2">-0.021366303771492665</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_7.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_7.xml
new file mode 100644 (file)
index 0000000..40708a3
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 4 0 im">-3.36295522544755e-10</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">-5.0444330386190764e-11</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">2.5222165193095382e-11</Real>
+    <Real Name="Cell 1 0">-2.2495184669680253e-111</Real>
+    <Real Name="Cell 1 1">-8.0991543667196338e-10</Real>
+    <Real Name="Cell 2 0">-1.3384635253888647e-110</Real>
+    <Real Name="Cell 2 1">8.1762240348126863e-110</Real>
+    <Real Name="Cell 2 2">2.5222165193095382e-11</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_8.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_8.xml
new file mode 100644 (file)
index 0000000..c24261d
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 0 0 re">3.5</Real>
+    <Real Name="Cell 0 0 0 im">6.6999998092651367</Real>
+    <Real Name="Cell 3 1 2 re">0.26477364495270733</Real>
+    <Real Name="Cell 3 1 2 im">3.4861862287666896</Real>
+    <Real Name="Cell 3 5 7 re">-0.00012611665265524979</Real>
+    <Real Name="Cell 3 5 7 im">2.1019441798755029e-10</Real>
+    <Real Name="Cell 6 2 4 re">2.9959899577437761</Real>
+    <Real Name="Cell 6 2 4 im">0.24385964937897381</Real>
+    <Real Name="Cell 7 0 0 re">-0.13079137357120588</Real>
+    <Real Name="Cell 7 0 0 im">-0.036621583976275775</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">118.65279828442088</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">207.87503560992724</Real>
+    <Real Name="Cell 1 0">151.72558248247225</Real>
+    <Real Name="Cell 1 1">27.021498076618471</Real>
+    <Real Name="Cell 2 0">0.45029163473062073</Real>
+    <Real Name="Cell 2 1">0.35388518348693898</Real>
+    <Real Name="Cell 2 2">-59.275738025458466</Real>
+  </Matrix>
+</ReferenceData>
diff --git a/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_9.xml b/src/gromacs/ewald/tests/refdata/SaneInput_PmeSolveTest_ReproducesOutputs_9.xml
new file mode 100644 (file)
index 0000000..1291a6b
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <NonZeroGridValues Name="ComplexSpaceGrid">
+    <Real Name="Cell 0 0 0 re">-0.0063639096934527042</Real>
+    <Real Name="Cell 0 0 0 im">-0.012182341066375335</Real>
+    <Real Name="Cell 3 1 2 re">-3.1903187316269281e-06</Real>
+    <Real Name="Cell 3 1 2 im">-4.2005862137679066e-05</Real>
+    <Real Name="Cell 3 5 7 re">7.4468604604379845e-21</Real>
+    <Real Name="Cell 3 5 7 im">-1.2411433917415391e-26</Real>
+    <Real Name="Cell 6 2 4 re">-1.1742988941980482e-10</Real>
+    <Real Name="Cell 6 2 4 im">-9.5582468781340022e-12</Real>
+    <Real Name="Cell 7 0 0 re">7.4608679756532561e-13</Real>
+    <Real Name="Cell 7 0 0 im">2.089042997606721e-13</Real>
+  </NonZeroGridValues>
+  <Real Name="Energy">-0.052281447439372866</Real>
+  <Matrix Name="Virial">
+    <Real Name="Cell 0 0">0.02472611767566462</Real>
+    <Real Name="Cell 1 0">-0.00080506035697563581</Real>
+    <Real Name="Cell 1 1">0.025682559278230224</Real>
+    <Real Name="Cell 2 0">-3.29941854498715e-06</Real>
+    <Real Name="Cell 2 1">-1.8777213593421415e-06</Real>
+    <Real Name="Cell 2 2">0.026140716022377927</Real>
+  </Matrix>
+</ReferenceData>
index 8a32f6ef52c625f1fa2da96222fadbdd6ecfd9d2..4850ee2590beff7b0ab16a9b9837db3a13935fc7 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,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.
@@ -59,8 +59,9 @@ const int grid_init[g_initNR] = { 6, 8, 10, 12, 14, 16, 20, 24, 25, 28, 32, 36,
 #define g_baseNR 14
 const int grid_base[g_baseNR] = { 45, 48, 50, 52, 54, 56, 60, 64, 70, 72, 75, 80, 81, 84 };
 
-real calc_grid(FILE *fp, const matrix box, real gr_sp,
-               int *nx, int *ny, int *nz)
+real calcFftGrid(FILE *fp,
+                 const matrix box, real gridSpacing, int minGridPointsPerDim,
+                 int *nx, int *ny, int *nz)
 {
     int  d, n[DIM];
     int  i;
@@ -69,9 +70,9 @@ real calc_grid(FILE *fp, const matrix box, real gr_sp,
     rvec spacing;
     real max_spacing;
 
-    if ((*nx <= 0 || *ny <= 0 || *nz <= 0) && gr_sp <= 0)
+    if ((*nx <= 0 || *ny <= 0 || *nz <= 0) && gridSpacing <= 0)
     {
-        gmx_fatal(FARGS, "invalid fourier grid spacing: %g", gr_sp);
+        gmx_fatal(FARGS, "invalid fourier grid spacing: %g", gridSpacing);
     }
 
     if (grid_base[g_baseNR-1] % 4 != 0)
@@ -107,7 +108,7 @@ real calc_grid(FILE *fp, const matrix box, real gr_sp,
 
     if ((*nx <= 0) || (*ny <= 0) || (*nz <= 0))
     {
-        if (NULL != fp)
+        if (nullptr != fp)
         {
             fprintf(fp, "Calculating fourier grid dimensions for%s%s%s\n",
                     *nx > 0 ? "" : " X", *ny > 0 ? "" : " Y", *nz > 0 ? "" : " Z");
@@ -119,7 +120,8 @@ real calc_grid(FILE *fp, const matrix box, real gr_sp,
     {
         if (n[d] <= 0)
         {
-            nmin = static_cast<int>(box_size[d]/gr_sp + 0.999);
+            nmin = static_cast<int>(box_size[d]/gridSpacing + 0.999);
+            nmin = std::max(nmin, minGridPointsPerDim);
 
             i = g_initNR - 1;
             if (grid_init[i] >= nmin)
@@ -162,7 +164,7 @@ real calc_grid(FILE *fp, const matrix box, real gr_sp,
     *nx = n[XX];
     *ny = n[YY];
     *nz = n[ZZ];
-    if (NULL != fp)
+    if (nullptr != fp)
     {
         fprintf(fp, "Using a fourier grid of %dx%dx%d, spacing %.3f %.3f %.3f\n",
                 *nx, *ny, *nz, spacing[XX], spacing[YY], spacing[ZZ]);
index 86eb76987240a3bdcd21edbe6f69e0fb780e9450..4da63261320d3196b30d4f7e62cf88270e057049 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,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,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.
 #include "gromacs/math/vectypes.h"
 #include "gromacs/utility/real.h"
 
-real calc_grid(FILE *fp,
-               const matrix box, real gr_sp,
-               int *nx, int *ny, int *nz);
+real calcFftGrid(FILE *fp,
+                 const matrix box, real gridSpacing, int minGridPointsPerDim,
+                 int *nx, int *ny, int *nz);
 /* Sets the number of grid points for each zero n* to the first reasonable
- * number which gives a spacing equal to or smaller than gr_sp.
+ * number which gives a spacing equal to or smaller than gridSpacing
+ * and is >= minGridPointsPerDim.
  * Returns the maximum grid spacing.
  */
 
index 9ead1601ff498473d61d36b4d0f1c8f097db2b95..53434e64534de854c7305b6fd2f2364af3cea7b2 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 1991-2003 Erik Lindahl, David van der Spoel, University of Groningen.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * 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.
@@ -70,14 +70,14 @@ gmx_fft_init_many_1d(gmx_fft_t *        pfft,
                      gmx_fft_flag       flags)
 {
     gmx_many_fft_t fft;
-    if (pfft == NULL)
+    if (pfft == nullptr)
     {
         gmx_fatal(FARGS, "Invalid opaque FFT datatype pointer.");
         return EINVAL;
     }
-    *pfft = NULL;
+    *pfft = nullptr;
 
-    if ( (fft = (gmx_many_fft_t)malloc(sizeof(struct gmx_many_fft))) == NULL)
+    if ( (fft = (gmx_many_fft_t)malloc(sizeof(struct gmx_many_fft))) == nullptr)
     {
         return ENOMEM;
     }
@@ -97,14 +97,14 @@ gmx_fft_init_many_1d_real(gmx_fft_t *        pfft,
                           gmx_fft_flag       flags)
 {
     gmx_many_fft_t fft;
-    if (pfft == NULL)
+    if (pfft == nullptr)
     {
         gmx_fatal(FARGS, "Invalid opaque FFT datatype pointer.");
         return EINVAL;
     }
-    *pfft = NULL;
+    *pfft = nullptr;
 
-    if ( (fft = (gmx_many_fft_t)malloc(sizeof(struct gmx_many_fft))) == NULL)
+    if ( (fft = (gmx_many_fft_t)malloc(sizeof(struct gmx_many_fft))) == nullptr)
     {
         return ENOMEM;
     }
@@ -164,9 +164,9 @@ void
 gmx_many_fft_destroy(gmx_fft_t    fft)
 {
     gmx_many_fft_t mfft = (gmx_many_fft_t)fft;
-    if (mfft != NULL)
+    if (mfft != nullptr)
     {
-        if (mfft->fft != NULL)
+        if (mfft->fft != nullptr)
         {
             gmx_fft_destroy(mfft->fft);
         }
index 471f57c25b43e66eff7b77cd6f0c7e94a8d4bfc0..e46667b9d074f1b260ed4688b31435dda34a8913 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2012,2013,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.
@@ -102,36 +102,6 @@ static int lfactor(int z)
 }
 #endif
 
-/* largest factor */
-static int l2factor(int z)
-{
-    int i;
-    if (z == 1)
-    {
-        i = 1;
-    }
-    else
-    {
-        i = z/2;
-        while (z%i != 0)
-        {
-            i--;
-        }
-    }
-    return i;
-}
-
-/* largest prime factor: WARNING: slow recursion, only use for small numbers */
-static int lpfactor(int z)
-{
-    int f = l2factor(z);
-    if (f == 1)
-    {
-        return z;
-    }
-    return std::max(lpfactor(f), lpfactor(z/f));
-}
-
 #if !GMX_MPI
 #if HAVE_GETTIMEOFDAY
 #include <sys/time.h>
@@ -174,11 +144,11 @@ fft5d_plan fft5d_plan_3d(int NG, int MG, int KG, MPI_Comm comm[2], int flags, t_
 
     int        P[2], bMaster, prank[2], i, t;
     int        rNG, rMG, rKG;
-    int       *N0 = 0, *N1 = 0, *M0 = 0, *M1 = 0, *K0 = 0, *K1 = 0, *oN0 = 0, *oN1 = 0, *oM0 = 0, *oM1 = 0, *oK0 = 0, *oK1 = 0;
-    int        N[3], M[3], K[3], pN[3], pM[3], pK[3], oM[3], oK[3], *iNin[3] = {0}, *oNin[3] = {0}, *iNout[3] = {0}, *oNout[3] = {0};
+    int       *N0 = nullptr, *N1 = nullptr, *M0 = nullptr, *M1 = nullptr, *K0 = nullptr, *K1 = nullptr, *oN0 = nullptr, *oN1 = nullptr, *oM0 = nullptr, *oM1 = nullptr, *oK0 = nullptr, *oK1 = nullptr;
+    int        N[3], M[3], K[3], pN[3], pM[3], pK[3], oM[3], oK[3], *iNin[3] = {nullptr}, *oNin[3] = {nullptr}, *iNout[3] = {nullptr}, *oNout[3] = {nullptr};
     int        C[3], rC[3], nP[2];
     int        lsize;
-    t_complex *lin = 0, *lout = 0, *lout2 = 0, *lout3 = 0;
+    t_complex *lin = nullptr, *lout = nullptr, *lout2 = nullptr, *lout3 = nullptr;
     fft5d_plan plan;
     int        s;
 
@@ -239,7 +209,7 @@ fft5d_plan fft5d_plan_3d(int NG, int MG, int KG, MPI_Comm comm[2], int flags, t_
         {
             printf("FFT5D: FATAL: Datasize cannot be zero in any dimension\n");
         }
-        return 0;
+        return nullptr;
     }
 
     rNG = NG; rMG = MG; rKG = KG;
@@ -556,21 +526,21 @@ fft5d_plan fft5d_plan_3d(int NG, int MG, int KG, MPI_Comm comm[2], int flags, t_
         if ((flags&FFT5D_REALCOMPLEX) && !(flags&FFT5D_BACKWARD))
         {
             plan->p3d = FFTW(plan_guru_dft_r2c)(/*rank*/ 3, dims,
-                                                         /*howmany*/ 0, /*howmany_dims*/ 0,
+                                                         /*howmany*/ 0, /*howmany_dims*/ nullptr,
                                                          (real*)lin, (FFTW(complex) *) lout,
                                                          /*flags*/ fftwflags);
         }
         else if ((flags&FFT5D_REALCOMPLEX) && (flags&FFT5D_BACKWARD))
         {
             plan->p3d = FFTW(plan_guru_dft_c2r)(/*rank*/ 3, dims,
-                                                         /*howmany*/ 0, /*howmany_dims*/ 0,
+                                                         /*howmany*/ 0, /*howmany_dims*/ nullptr,
                                                          (FFTW(complex) *) lin, (real*)lout,
                                                          /*flags*/ fftwflags);
         }
         else
         {
             plan->p3d = FFTW(plan_guru_dft)(/*rank*/ 3, dims,
-                                                     /*howmany*/ 0, /*howmany_dims*/ 0,
+                                                     /*howmany*/ 0, /*howmany_dims*/ nullptr,
                                                      (FFTW(complex) *) lin, (FFTW(complex) *) lout,
                                                      /*sign*/ (flags&FFT5D_BACKWARD) ? 1 : -1, /*flags*/ fftwflags);
         }
@@ -1264,22 +1234,22 @@ void fft5d_destroy(fft5d_plan plan)
         if (plan->iNin[s])
         {
             free(plan->iNin[s]);
-            plan->iNin[s] = 0;
+            plan->iNin[s] = nullptr;
         }
         if (plan->oNin[s])
         {
             free(plan->oNin[s]);
-            plan->oNin[s] = 0;
+            plan->oNin[s] = nullptr;
         }
         if (plan->iNout[s])
         {
             free(plan->iNout[s]);
-            plan->iNout[s] = 0;
+            plan->iNout[s] = nullptr;
         }
         if (plan->oNout[s])
         {
             free(plan->oNout[s]);
-            plan->oNout[s] = 0;
+            plan->oNout[s] = nullptr;
         }
     }
 #if GMX_FFT_FFTW3
@@ -1334,7 +1304,7 @@ void fft5d_local_size(fft5d_plan plan, int* N1, int* M0, int* K0, int* K1, int**
    of processor dimensions*/
 fft5d_plan fft5d_plan_3d_cart(int NG, int MG, int KG, MPI_Comm comm, int P0, int flags, t_complex** rlin, t_complex** rlout, t_complex** rlout2, t_complex** rlout3, int nthreads)
 {
-    MPI_Comm cart[2] = {0};
+    MPI_Comm cart[2] = {MPI_COMM_NULL, MPI_COMM_NULL};
 #if GMX_MPI
     int      size = 1, prank = 0;
     int      P[2];
index ac194ab3e9e1241bd7eb94171927998b974bb225..9f4ab9ec53440fcc7bbf091f591b1eca4ce72b5a 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 1991-2003 David van der Spoel, Erik Lindahl, University of Groningen.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
@@ -81,23 +81,23 @@ gmx_fft_init_1d(gmx_fft_t *        pfft,
 {
     gmx_fft_t    fft;
 
-    if (pfft == NULL)
+    if (pfft == nullptr)
     {
         gmx_fatal(FARGS, "Invalid FFT opaque type pointer.");
         return EINVAL;
     }
-    *pfft = NULL;
+    *pfft = nullptr;
 
-    if ( (fft = (struct gmx_fft *)malloc(sizeof(struct gmx_fft))) == NULL)
+    if ( (fft = (struct gmx_fft *)malloc(sizeof(struct gmx_fft))) == nullptr)
     {
         return ENOMEM;
     }
 
-    fft->next = NULL;
+    fft->next = nullptr;
     fft->n    = nx;
 
     /* Need 4*n storage for 1D complex FFT */
-    if ( (fft->work = (real *)malloc(sizeof(real)*(4*nx))) == NULL)
+    if ( (fft->work = (real *)malloc(sizeof(real)*(4*nx))) == nullptr)
     {
         free(fft);
         return ENOMEM;
@@ -121,23 +121,23 @@ gmx_fft_init_1d_real(gmx_fft_t *        pfft,
 {
     gmx_fft_t    fft;
 
-    if (pfft == NULL)
+    if (pfft == nullptr)
     {
         gmx_fatal(FARGS, "Invalid FFT opaque type pointer.");
         return EINVAL;
     }
-    *pfft = NULL;
+    *pfft = nullptr;
 
-    if ( (fft = (struct gmx_fft *)malloc(sizeof(struct gmx_fft))) == NULL)
+    if ( (fft = (struct gmx_fft *)malloc(sizeof(struct gmx_fft))) == nullptr)
     {
         return ENOMEM;
     }
 
-    fft->next = NULL;
+    fft->next = nullptr;
     fft->n    = nx;
 
     /* Need 2*n storage for 1D real FFT */
-    if ((fft->work = (real *)malloc(sizeof(real)*(2*nx))) == NULL)
+    if ((fft->work = (real *)malloc(sizeof(real)*(2*nx))) == nullptr)
     {
         free(fft);
         return ENOMEM;
@@ -162,15 +162,15 @@ gmx_fft_init_2d_real(gmx_fft_t *        pfft,
     int           nyc = (ny/2 + 1);
     int           rc;
 
-    if (pfft == NULL)
+    if (pfft == nullptr)
     {
         gmx_fatal(FARGS, "Invalid FFT opaque type pointer.");
         return EINVAL;
     }
-    *pfft = NULL;
+    *pfft = nullptr;
 
     /* Create the X transform */
-    if ( (fft = (struct gmx_fft *)malloc(sizeof(struct gmx_fft))) == NULL)
+    if ( (fft = (struct gmx_fft *)malloc(sizeof(struct gmx_fft))) == nullptr)
     {
         return ENOMEM;
     }
@@ -180,7 +180,7 @@ gmx_fft_init_2d_real(gmx_fft_t *        pfft,
     /* Need 4*nx storage for 1D complex FFT, and another
      * 2*nx*nyc elements for complex-to-real storage in our high-level routine.
      */
-    if ( (fft->work = (real *)malloc(sizeof(real)*(4*nx+2*nx*nyc))) == NULL)
+    if ( (fft->work = (real *)malloc(sizeof(real)*(4*nx+2*nx*nyc))) == nullptr)
     {
         free(fft);
         return ENOMEM;
@@ -391,7 +391,7 @@ gmx_fft_2d_real          (gmx_fft_t                  fft,
                 }
             }
         }
-        data = (t_complex *)out_data;
+        data = static_cast<t_complex *>(out_data);
 
         /* y real-to-complex FFTs */
         for (i = 0; i < nx; i++)
@@ -425,12 +425,12 @@ gmx_fft_2d_real          (gmx_fft_t                  fft,
         if (in_data != out_data)
         {
             memcpy(work, in_data, sizeof(t_complex)*nx*nyc);
-            data = (t_complex *)work;
+            data = reinterpret_cast<t_complex *>(work);
         }
         else
         {
             /* in-place */
-            data = (t_complex *)out_data;
+            data = reinterpret_cast<t_complex *>(out_data);
         }
 
         /* Transpose to get X arrays */
@@ -480,10 +480,10 @@ gmx_fft_2d_real          (gmx_fft_t                  fft,
 void
 gmx_fft_destroy(gmx_fft_t      fft)
 {
-    if (fft != NULL)
+    if (fft != nullptr)
     {
         free(fft->work);
-        if (fft->next != NULL)
+        if (fft->next != nullptr)
         {
             gmx_fft_destroy(fft->next);
         }
index e1087d03605891b388024ac525951cff1ef4e3f6..b8eceda133a12dc447ac5dc5c9dc98c910bfce30 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 1991-2003 David van der Spoel, Erik Lindahl, University of Groningen.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * 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.
@@ -120,15 +120,15 @@ gmx_fft_init_many_1d(gmx_fft_t *        pfft,
 
     fftw_flags = (flags & GMX_FFT_FLAG_CONSERVATIVE) ? FFTW_ESTIMATE : FFTW_MEASURE;
 
-    if (pfft == NULL)
+    if (pfft == nullptr)
     {
         gmx_fatal(FARGS, "Invalid opaque FFT datatype pointer.");
         return EINVAL;
     }
-    *pfft = NULL;
+    *pfft = nullptr;
 
     FFTW_LOCK;
-    if ( (fft = (gmx_fft_t)FFTWPREFIX(malloc)(sizeof(struct gmx_fft))) == NULL)
+    if ( (fft = (gmx_fft_t)FFTWPREFIX(malloc)(sizeof(struct gmx_fft))) == nullptr)
     {
         FFTW_UNLOCK;
         return ENOMEM;
@@ -136,7 +136,7 @@ gmx_fft_init_many_1d(gmx_fft_t *        pfft,
 
     /* allocate aligned, and extra memory to make it unaligned */
     p1  = (FFTWPREFIX(complex) *) FFTWPREFIX(malloc)(sizeof(FFTWPREFIX(complex))*(nx+2)*howmany);
-    if (p1 == NULL)
+    if (p1 == nullptr)
     {
         FFTWPREFIX(free)(fft);
         FFTW_UNLOCK;
@@ -144,7 +144,7 @@ gmx_fft_init_many_1d(gmx_fft_t *        pfft,
     }
 
     p2  = (FFTWPREFIX(complex) *) FFTWPREFIX(malloc)(sizeof(FFTWPREFIX(complex))*(nx+2)*howmany);
-    if (p2 == NULL)
+    if (p2 == nullptr)
     {
         FFTWPREFIX(free)(p1);
         FFTWPREFIX(free)(fft);
@@ -185,7 +185,7 @@ gmx_fft_init_many_1d(gmx_fft_t *        pfft,
         {
             for (k = 0; k < 2; k++)
             {
-                if (fft->plan[i][j][k] == NULL)
+                if (fft->plan[i][j][k] == nullptr)
                 {
                     gmx_fatal(FARGS, "Error initializing FFTW3 plan.");
                     FFTW_UNLOCK;
@@ -237,15 +237,15 @@ gmx_fft_init_many_1d_real(gmx_fft_t *        pfft,
 
     fftw_flags = (flags & GMX_FFT_FLAG_CONSERVATIVE) ? FFTW_ESTIMATE : FFTW_MEASURE;
 
-    if (pfft == NULL)
+    if (pfft == nullptr)
     {
         gmx_fatal(FARGS, "Invalid opaque FFT datatype pointer.");
         return EINVAL;
     }
-    *pfft = NULL;
+    *pfft = nullptr;
 
     FFTW_LOCK;
-    if ( (fft = (gmx_fft_t) FFTWPREFIX(malloc)(sizeof(struct gmx_fft))) == NULL)
+    if ( (fft = (gmx_fft_t) FFTWPREFIX(malloc)(sizeof(struct gmx_fft))) == nullptr)
     {
         FFTW_UNLOCK;
         return ENOMEM;
@@ -253,7 +253,7 @@ gmx_fft_init_many_1d_real(gmx_fft_t *        pfft,
 
     /* allocate aligned, and extra memory to make it unaligned */
     p1  = (real *) FFTWPREFIX(malloc)(sizeof(real)*(nx/2+1)*2*howmany + 8);
-    if (p1 == NULL)
+    if (p1 == nullptr)
     {
         FFTWPREFIX(free)(fft);
         FFTW_UNLOCK;
@@ -261,7 +261,7 @@ gmx_fft_init_many_1d_real(gmx_fft_t *        pfft,
     }
 
     p2  = (real *) FFTWPREFIX(malloc)(sizeof(real)*(nx/2+1)*2*howmany + 8);
-    if (p2 == NULL)
+    if (p2 == nullptr)
     {
         FFTWPREFIX(free)(p1);
         FFTWPREFIX(free)(fft);
@@ -287,15 +287,15 @@ gmx_fft_init_many_1d_real(gmx_fft_t *        pfft,
                                       fftw_complex *out, const int *onembed,
                                       int ostride, int odist,
                                       unsigned flag    */
-    fft->plan[0][0][1] = FFTWPREFIX(plan_many_dft_r2c)(1, &nx, howmany, up1, 0, 1, (nx/2+1) *2, (FFTWPREFIX(complex) *) up2, 0, 1, (nx/2+1), fftw_flags);
-    fft->plan[0][1][1] = FFTWPREFIX(plan_many_dft_r2c)(1, &nx, howmany, up1, 0, 1, (nx/2+1) *2, (FFTWPREFIX(complex) *) up1, 0, 1, (nx/2+1), fftw_flags);
-    fft->plan[1][0][1] = FFTWPREFIX(plan_many_dft_r2c)(1, &nx, howmany, p1, 0, 1, (nx/2+1) *2, (FFTWPREFIX(complex) *) p2, 0, 1, (nx/2+1), fftw_flags);
-    fft->plan[1][1][1] = FFTWPREFIX(plan_many_dft_r2c)(1, &nx, howmany, p1, 0, 1, (nx/2+1) *2, (FFTWPREFIX(complex) *) p1, 0, 1, (nx/2+1), fftw_flags);
+    fft->plan[0][0][1] = FFTWPREFIX(plan_many_dft_r2c)(1, &nx, howmany, up1, nullptr, 1, (nx/2+1) *2, (FFTWPREFIX(complex) *) up2, nullptr, 1, (nx/2+1), fftw_flags);
+    fft->plan[0][1][1] = FFTWPREFIX(plan_many_dft_r2c)(1, &nx, howmany, up1, nullptr, 1, (nx/2+1) *2, (FFTWPREFIX(complex) *) up1, nullptr, 1, (nx/2+1), fftw_flags);
+    fft->plan[1][0][1] = FFTWPREFIX(plan_many_dft_r2c)(1, &nx, howmany, p1, nullptr, 1, (nx/2+1) *2, (FFTWPREFIX(complex) *) p2, nullptr, 1, (nx/2+1), fftw_flags);
+    fft->plan[1][1][1] = FFTWPREFIX(plan_many_dft_r2c)(1, &nx, howmany, p1, nullptr, 1, (nx/2+1) *2, (FFTWPREFIX(complex) *) p1, nullptr, 1, (nx/2+1), fftw_flags);
 
-    fft->plan[0][0][0] = FFTWPREFIX(plan_many_dft_c2r)(1, &nx, howmany, (FFTWPREFIX(complex) *) up1, 0, 1, (nx/2+1), up2, 0, 1, (nx/2+1) *2, fftw_flags);
-    fft->plan[0][1][0] = FFTWPREFIX(plan_many_dft_c2r)(1, &nx, howmany, (FFTWPREFIX(complex) *) up1, 0, 1, (nx/2+1), up1, 0, 1, (nx/2+1) *2, fftw_flags);
-    fft->plan[1][0][0] = FFTWPREFIX(plan_many_dft_c2r)(1, &nx, howmany, (FFTWPREFIX(complex) *) p1, 0, 1, (nx/2+1), p2, 0, 1, (nx/2+1) *2, fftw_flags);
-    fft->plan[1][1][0] = FFTWPREFIX(plan_many_dft_c2r)(1, &nx, howmany, (FFTWPREFIX(complex) *) p1, 0, 1, (nx/2+1), p1, 0, 1, (nx/2+1) *2, fftw_flags);
+    fft->plan[0][0][0] = FFTWPREFIX(plan_many_dft_c2r)(1, &nx, howmany, (FFTWPREFIX(complex) *) up1, nullptr, 1, (nx/2+1), up2, nullptr, 1, (nx/2+1) *2, fftw_flags);
+    fft->plan[0][1][0] = FFTWPREFIX(plan_many_dft_c2r)(1, &nx, howmany, (FFTWPREFIX(complex) *) up1, nullptr, 1, (nx/2+1), up1, nullptr, 1, (nx/2+1) *2, fftw_flags);
+    fft->plan[1][0][0] = FFTWPREFIX(plan_many_dft_c2r)(1, &nx, howmany, (FFTWPREFIX(complex) *) p1, nullptr, 1, (nx/2+1), p2, nullptr, 1, (nx/2+1) *2, fftw_flags);
+    fft->plan[1][1][0] = FFTWPREFIX(plan_many_dft_c2r)(1, &nx, howmany, (FFTWPREFIX(complex) *) p1, nullptr, 1, (nx/2+1), p1, nullptr, 1, (nx/2+1) *2, fftw_flags);
 
     for (i = 0; i < 2; i++)
     {
@@ -303,7 +303,7 @@ gmx_fft_init_many_1d_real(gmx_fft_t *        pfft,
         {
             for (k = 0; k < 2; k++)
             {
-                if (fft->plan[i][j][k] == NULL)
+                if (fft->plan[i][j][k] == nullptr)
                 {
                     gmx_fatal(FARGS, "Error initializing FFTW3 plan.");
                     FFTW_UNLOCK;
@@ -348,15 +348,15 @@ gmx_fft_init_2d_real(gmx_fft_t *        pfft,
 
     fftw_flags = (flags & GMX_FFT_FLAG_CONSERVATIVE) ? FFTW_ESTIMATE : FFTW_MEASURE;
 
-    if (pfft == NULL)
+    if (pfft == nullptr)
     {
         gmx_fatal(FARGS, "Invalid opaque FFT datatype pointer.");
         return EINVAL;
     }
-    *pfft = NULL;
+    *pfft = nullptr;
 
     FFTW_LOCK;
-    if ( (fft = (gmx_fft_t) FFTWPREFIX(malloc)(sizeof(struct gmx_fft))) == NULL)
+    if ( (fft = (gmx_fft_t) FFTWPREFIX(malloc)(sizeof(struct gmx_fft))) == nullptr)
     {
         FFTW_UNLOCK;
         return ENOMEM;
@@ -364,7 +364,7 @@ gmx_fft_init_2d_real(gmx_fft_t *        pfft,
 
     /* allocate aligned, and extra memory to make it unaligned */
     p1  = (real *) FFTWPREFIX(malloc)(sizeof(real) *( nx*(ny/2+1)*2 + 2) );
-    if (p1 == NULL)
+    if (p1 == nullptr)
     {
         FFTWPREFIX(free)(fft);
         FFTW_UNLOCK;
@@ -372,7 +372,7 @@ gmx_fft_init_2d_real(gmx_fft_t *        pfft,
     }
 
     p2  = (real *) FFTWPREFIX(malloc)(sizeof(real) *( nx*(ny/2+1)*2 + 2) );
-    if (p2 == NULL)
+    if (p2 == nullptr)
     {
         FFTWPREFIX(free)(p1);
         FFTWPREFIX(free)(fft);
@@ -410,7 +410,7 @@ gmx_fft_init_2d_real(gmx_fft_t *        pfft,
         {
             for (k = 0; k < 2; k++)
             {
-                if (fft->plan[i][j][k] == NULL)
+                if (fft->plan[i][j][k] == nullptr)
                 {
                     gmx_fatal(FARGS, "Error initializing FFTW3 plan.");
                     FFTW_UNLOCK;
@@ -551,7 +551,7 @@ gmx_fft_destroy(gmx_fft_t      fft)
 {
     int                   i, j, k;
 
-    if (fft != NULL)
+    if (fft != nullptr)
     {
         for (i = 0; i < 2; i++)
         {
@@ -559,12 +559,12 @@ gmx_fft_destroy(gmx_fft_t      fft)
             {
                 for (k = 0; k < 2; k++)
                 {
-                    if (fft->plan[i][j][k] != NULL)
+                    if (fft->plan[i][j][k] != nullptr)
                     {
                         FFTW_LOCK;
                         FFTWPREFIX(destroy_plan)(fft->plan[i][j][k]);
                         FFTW_UNLOCK;
-                        fft->plan[i][j][k] = NULL;
+                        fft->plan[i][j][k] = nullptr;
                     }
                 }
             }
index ee86ced85eae5838fce51a24f9c59888a411441c..a120ee5d00e4b9f20034dab0ce085d2b50cbc237 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 1991-2003 David van der Spoel, Erik Lindahl, University of Groningen.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,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.
@@ -111,9 +111,9 @@ struct gmx_fft
 
 
 int
-gmx_fft_init_1d(gmx_fft_t *        pfft,
-                int                nx,
-                gmx_fft_flag       flags)
+gmx_fft_init_1d(gmx_fft_t *             pfft,
+                int                     nx,
+                gmx_fft_flag gmx_unused flags)
 {
     gmx_fft_t      fft;
     int            d;
@@ -187,9 +187,9 @@ gmx_fft_init_1d(gmx_fft_t *        pfft,
 
 
 int
-gmx_fft_init_1d_real(gmx_fft_t *        pfft,
-                     int                nx,
-                     gmx_fft_flag       flags)
+gmx_fft_init_1d_real(gmx_fft_t *             pfft,
+                     int                     nx,
+                     gmx_fft_flag gmx_unused flags)
 {
     gmx_fft_t      fft;
     int            d;
@@ -271,10 +271,10 @@ gmx_fft_init_1d_real(gmx_fft_t *        pfft,
 
 
 int
-gmx_fft_init_2d_real(gmx_fft_t *        pfft,
-                     int                nx,
-                     int                ny,
-                     gmx_fft_flag       flags)
+gmx_fft_init_2d_real(gmx_fft_t *             pfft,
+                     int                     nx,
+                     int                     ny,
+                     gmx_fft_flag gmx_unused flags)
 {
     gmx_fft_t      fft;
     int            d;
@@ -424,10 +424,12 @@ gmx_fft_init_2d_real(gmx_fft_t *        pfft,
 
     if (status == 0)
     {
-        if ((fft->work = (t_complex *)malloc(sizeof(t_complex)*(nx*(ny/2+1)))) == NULL)
+        void *memory = malloc(sizeof(t_complex)*(nx*(ny/2+1)));
+        if (nullptr == memory)
         {
             status = ENOMEM;
         }
+        fft->work = static_cast<t_complex *>(memory);
     }
 
     if (status != 0)
index 3c04fb24fc57d7ad177f927519555b9c124ed735..618be1c3aa86b0a67879ab707ab4a4525b50fcc3 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 1991-2005 David van der Spoel, Erik Lindahl, University of Groningen.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,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.
@@ -87,7 +87,7 @@ gmx_parallel_3dfft_init   (gmx_parallel_3dfft_t     *    pfft_setup,
     (*pfft_setup)->p2 = fft5d_plan_3d(Nb, Mb, Kb, rcomm,
                                       (flags|FFT5D_BACKWARD|FFT5D_NOMALLOC)^FFT5D_ORDER_YZ, complex_data, (t_complex**)real_data, &buf1, &buf2, nthreads);
 
-    return (*pfft_setup)->p1 != 0 && (*pfft_setup)->p2 != 0;
+    return (*pfft_setup)->p1 != nullptr && (*pfft_setup)->p2 != nullptr;
 }
 
 
index ca0b6d273bf43348d6115deb0d134a2174a2a7ea..3b9dd87ee25bf6ccd956650129c6796d456c74a5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,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.
@@ -118,7 +118,7 @@ class BaseFFTTest : public ::testing::Test
 class FFTTest : public BaseFFTTest
 {
     public:
-        FFTTest() : fft_(NULL)
+        FFTTest() : fft_(nullptr)
         {
         }
         ~FFTTest()
@@ -134,7 +134,7 @@ class FFTTest : public BaseFFTTest
 class ManyFFTTest : public BaseFFTTest
 {
     public:
-        ManyFFTTest() : fft_(NULL)
+        ManyFFTTest() : fft_(nullptr)
         {
         }
         ~ManyFFTTest()
@@ -158,7 +158,7 @@ class FFTTest1D : public FFTTest, public ::testing::WithParamInterface<int>
 class FFFTest3D : public BaseFFTTest
 {
     public:
-        FFFTest3D() : fft_(NULL)
+        FFFTest3D() : fft_(nullptr)
         {
         }
         ~FFFTest3D()
@@ -301,7 +301,7 @@ TEST_F(FFFTest3D, Real5_6_9)
     std::copy(inputdata, inputdata+sizeInReals, in_.begin());
     // Use memcpy to convert to t_complex easily
     memcpy(rdata, in_.data(), sizeInBytes);
-    gmx_parallel_3dfft_execute(fft_, GMX_FFT_REAL_TO_COMPLEX, 0, NULL);
+    gmx_parallel_3dfft_execute(fft_, GMX_FFT_REAL_TO_COMPLEX, 0, nullptr);
     //TODO use std::complex and add checkComplex for it
     checker_.checkSequenceArray(size*2,
                                 reinterpret_cast<real*>(cdata), "forward");
@@ -310,7 +310,7 @@ TEST_F(FFFTest3D, Real5_6_9)
     std::copy(inputdata, inputdata+sizeInReals, in_.begin());
     // Use memcpy to convert to t_complex easily
     memcpy(cdata, in_.data(), sizeInBytes);
-    gmx_parallel_3dfft_execute(fft_, GMX_FFT_COMPLEX_TO_REAL, 0, NULL);
+    gmx_parallel_3dfft_execute(fft_, GMX_FFT_COMPLEX_TO_REAL, 0, nullptr);
     for (int i = 0; i < ndata[0]*ndata[1]; i++) //check sequence but skip unused data
     {
         checker_.checkSequenceArray(ndata[2], rdata+i*rsize[2],
index 117e19c56d4f6e908703c70a3a04575a15bd9575..b7ca96feceb31d24f09c6edfbe34fc39ef3bc939 100644 (file)
@@ -60,13 +60,6 @@ gmx_install_headers(
     xvgr.h
     )
 
-if (GMX_USE_TNG AND TNG_IO_DEFINITIONS)
-    set_property(SOURCE tngio.cpp
-                 APPEND PROPERTY COMPILE_DEFINITIONS ${TNG_IO_DEFINITIONS})
-    set_property(SOURCE tngio_for_tools.cpp
-                 APPEND PROPERTY COMPILE_DEFINITIONS ${TNG_IO_DEFINITIONS})
-endif()
-
 if (BUILD_TESTING)
      add_subdirectory(tests)
 endif()
index eb07c8ed68a61bd8a974f4a48eb156c2d431cad2..4b1dfa16bfd94fda7ed3a313ebca3dc40738b7ad 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,2016, by the GROMACS development team, led by
+ * Copyright (c) 2008,2009,2010,2011,2012,2013,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.
 #include "gromacs/gmxlib/network.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/math/vecdump.h"
+#include "gromacs/math/vectypes.h"
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/df_history.h"
+#include "gromacs/mdtypes/edsamhistory.h"
 #include "gromacs/mdtypes/energyhistory.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/mdtypes/observableshistory.h"
 #include "gromacs/mdtypes/state.h"
+#include "gromacs/mdtypes/swaphistory.h"
 #include "gromacs/trajectory/trajectoryframe.h"
+#include "gromacs/utility/arrayref.h"
 #include "gromacs/utility/baseversion.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
+#include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/int64_to_int.h"
 #include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/smalloc.h"
@@ -86,7 +92,7 @@
 #define CPTSTRLEN 1024
 
 /* cpt_version should normally only be changed
- * when the header of footer format changes.
+ * when the header or footer format changes.
  * The state data format itself is backward and forward compatible.
  * But old code can not read a new entry that is present in the file
  * (but can read a new format when new entries are not present).
@@ -99,10 +105,11 @@ const char *est_names[estNR] =
     "FE-lambda",
     "box", "box-rel", "box-v", "pres_prev",
     "nosehoover-xi", "thermostat-integral",
-    "x", "v", "sdx-unsupported", "CGp", "LD-rng", "LD-rng-i",
+    "x", "v", "sdx-unsupported", "CGp", "LD-rng-unsupported", "LD-rng-i-unsupported",
     "disre_initf", "disre_rm3tav",
     "orire_initf", "orire_Dtav",
-    "svir_prev", "nosehoover-vxi", "v_eta", "vol0", "nhpres_xi", "nhpres_vxi", "fvir_prev", "fep_state", "MC-rng", "MC-rng-i"
+    "svir_prev", "nosehoover-vxi", "v_eta", "vol0", "nhpres_xi", "nhpres_vxi", "fvir_prev", "fep_state", "MC-rng-unsupported", "MC-rng-i-unsupported"
+    "barostat-integral"
 };
 
 enum {
@@ -149,32 +156,36 @@ const char *edfh_names[edfhNR] =
     "accumulated_plus", "accumulated_minus", "accumulated_plus_2",  "accumulated_minus_2", "Tij", "Tij_empirical"
 };
 
-enum {
-    ecprREAL, ecprRVEC, ecprMATRIX
+//! Higher level vector element type, only used for formatting checkpoint dumps
+enum class CptElementType
+{
+    integer,   //!< integer
+    real,      //!< float or double, not linked to precision of type real
+    real3,     //!< float[3] or double[3], not linked to precision of type real
+    matrix3x3  //!< float[3][3] or double[3][3], not linked to precision of type real
 };
 
-enum {
-    cptpEST, cptpEEKS, cptpEENH, cptpEDFH
+//! \brief Parts of the checkpoint state, only used for reporting
+enum class StatePart
+{
+    microState,       //!< The microstate of the simulated system
+    kineticEnergy,    //!< Kinetic energy, needed for T/P-coupling state
+    energyHistory,    //!< Energy observable statistics
+    freeEnergyHistory //!< Free-energy state and observable statistics
 };
-/* enums for the different components of checkpoint variables, replacing the hard coded ones.
-   cptpEST - state variables.
-   cptpEEKS - Kinetic energy state variables.
-   cptpEENH - Energy history state variables.
-   cptpEDFH - free energy history variables.
- */
 
-
-static const char *st_names(int cptp, int ecpt)
+//! \brief Return the name of a checkpoint entry based on part and part entry
+static const char *entryName(StatePart part, int ecpt)
 {
-    switch (cptp)
+    switch (part)
     {
-        case cptpEST: return est_names [ecpt];
-        case cptpEEKS: return eeks_names[ecpt];
-        case cptpEENH: return eenh_names[ecpt];
-        case cptpEDFH: return edfh_names[ecpt];
+        case StatePart::microState:        return est_names [ecpt];
+        case StatePart::kineticEnergy:     return eeks_names[ecpt];
+        case StatePart::energyHistory:     return eenh_names[ecpt];
+        case StatePart::freeEnergyHistory: return edfh_names[ecpt];
     }
 
-    return NULL;
+    return nullptr;
 }
 
 static void cp_warning(FILE *fp)
@@ -307,345 +318,423 @@ static void do_cpt_n_rvecs_err(XDR *xd, const char *desc, int n, rvec f[], FILE
     }
 }
 
-/* If nval >= 0, nval is used; on read this should match the passed value.
- * If nval n<0, *nptr is used; on read the value is stored in nptr
+template <typename T>
+struct xdr_type
+{
+};
+
+template <>
+struct xdr_type<int>
+{
+    // cppcheck-suppress unusedStructMember
+    static const int value = xdr_datatype_int;
+};
+
+template <>
+struct xdr_type<float>
+{
+    // cppcheck-suppress unusedStructMember
+    static const int value = xdr_datatype_float;
+};
+
+template <>
+struct xdr_type<double>
+{
+    // cppcheck-suppress unusedStructMember
+    static const int value = xdr_datatype_double;
+};
+
+//! \brief Returns size in byte of an xdr_datatype
+static inline unsigned int sizeOfXdrType(int xdrType)
+{
+    switch (xdrType)
+    {
+        case xdr_datatype_int:
+            return sizeof(int);
+            break;
+        case xdr_datatype_float:
+            return sizeof(float);
+            break;
+        case xdr_datatype_double:
+            return sizeof(double);
+            break;
+        default: GMX_RELEASE_ASSERT(false, "XDR data type not implemented");
+    }
+
+    return 0;
+}
+
+//! \brief Returns the XDR process function for i/o of an XDR type
+static inline xdrproc_t xdrProc(int xdrType)
+{
+    switch (xdrType)
+    {
+        case xdr_datatype_int:
+            return reinterpret_cast<xdrproc_t>(xdr_int);
+            break;
+        case xdr_datatype_float:
+            return reinterpret_cast<xdrproc_t>(xdr_float);
+            break;
+        case xdr_datatype_double:
+            return reinterpret_cast<xdrproc_t>(xdr_double);
+            break;
+        default: GMX_RELEASE_ASSERT(false, "XDR data type not implemented");
+    }
+
+    return nullptr;
+}
+
+/*! \brief Lists or only reads an xdr vector from checkpoint file
+ *
+ * When list!=NULL reads and lists the \p nf vector elements of type \p xdrType.
+ * The header for the print is set by \p part and \p ecpt.
+ * The formatting of the printing is set by \p cptElementType.
+ * When list==NULL only reads the elements.
  */
-static int do_cpte_reals_low(XDR *xd, int cptp, int ecpt, int sflags,
-                             int nval, int *nptr, real **v,
-                             FILE *list, int erealtype)
+static bool_t listXdrVector(XDR *xd, StatePart part, int ecpt, int nf, int xdrType,
+                            FILE *list, CptElementType cptElementType)
 {
-    bool_t     res       = 0;
-    const bool useDouble = GMX_DOUBLE;
-    int        dtc       = useDouble ? xdr_datatype_double : xdr_datatype_float;
-    real      *vp, *va = NULL;
-    float     *vf;
-    double    *vd;
-    int        nf, dt, i;
+    bool_t             res = 0;
+
+    const unsigned int elemSize = sizeOfXdrType(xdrType);
+    std::vector<char>  data(nf*elemSize);
+    res = xdr_vector(xd, data.data(), nf, elemSize, xdrProc(xdrType));
 
-    if (list == NULL)
+    if (list != nullptr)
     {
-        if (nval >= 0)
+        switch (xdrType)
         {
-            nf = nval;
-        }
-        else
-        {
-            if (nptr == NULL)
-            {
-                gmx_incons("*ntpr=NULL in do_cpte_reals_low");
-            }
-            nf = *nptr;
+            case xdr_datatype_int:
+                pr_ivec(list, 0, entryName(part, ecpt), reinterpret_cast<const int *>(data.data()), nf, TRUE);
+                break;
+            case xdr_datatype_float:
+#if !GMX_DOUBLE
+                if (cptElementType == CptElementType::real3)
+                {
+                    // cppcheck-suppress invalidPointerCast
+                    pr_rvecs(list, 0, entryName(part, ecpt), reinterpret_cast<const rvec *>(data.data()), nf/3);
+                }
+                else
+#endif
+                {
+                    /* Note: With double precision code dumping a single precision rvec will produce float iso rvec print, but that's a minor annoyance */
+                    // cppcheck-suppress invalidPointerCast
+                    pr_fvec(list, 0, entryName(part, ecpt), reinterpret_cast<const float *>(data.data()), nf, TRUE);
+                }
+                break;
+            case xdr_datatype_double:
+#if GMX_DOUBLE
+                if (cptElementType == CptElementType::real3)
+                {
+                    // cppcheck-suppress invalidPointerCast
+                    pr_rvecs(list, 0, entryName(part, ecpt), reinterpret_cast<const rvec *>(data.data()), nf/3);
+                }
+                else
+#endif
+                {
+                    /* Note: With single precision code dumping a double precision rvec will produce float iso rvec print, but that's a minor annoyance */
+                    // cppcheck-suppress invalidPointerCast
+                    pr_dvec(list, 0, entryName(part, ecpt), reinterpret_cast<const double *>(data.data()), nf, TRUE);
+                }
+                break;
+            default: GMX_RELEASE_ASSERT(false, "Data type not implemented for listing");
         }
     }
-    res = xdr_int(xd, &nf);
-    if (res == 0)
+
+    return res;
+}
+
+//! \brief Convert a double array, typed char*, to float
+gmx_unused static void convertArrayRealPrecision(const char *c, float *v, int n)
+{
+    // cppcheck-suppress invalidPointerCast
+    const double *d = reinterpret_cast<const double *>(c);
+    for (int i = 0; i < n; i++)
     {
-        return -1;
+        v[i] = static_cast<float>(d[i]);
     }
-    if (list == NULL)
+}
+
+//! \brief Convert a float array, typed char*, to double
+static void convertArrayRealPrecision(const char *c, double *v, int n)
+{
+    // cppcheck-suppress invalidPointerCast
+    const float *f = reinterpret_cast<const float *>(c);
+    for (int i = 0; i < n; i++)
+    {
+        v[i] = static_cast<double>(f[i]);
+    }
+}
+
+//! \brief Generate an error for trying to convert to integer
+static void convertArrayRealPrecision(const char gmx_unused *c, int gmx_unused *v, int gmx_unused n)
+{
+    GMX_RELEASE_ASSERT(false, "We only expect type mismatches between float and double, not integer");
+}
+
+/*! \brief Low-level routine for reading/writing a vector of reals from/to file.
+ *
+ * This is the only routine that does the actually i/o of real vector,
+ * all other routines are intermediate level routines for specific real
+ * data types, calling this routine.
+ * Currently this routine is (too) complex, since it handles both real *
+ * and std::vector<real>. Using real * is deprecated and this routine
+ * will simplify a lot when only std::vector needs to be supported.
+ *
+ * When not listing, we use either v or vector, depending on which is !=NULL.
+ * If nval >= 0, nval is used; on read this should match the passed value.
+ * If nval n<0, *nptr (with v) or vector->size() is used. On read using v,
+ * the value is stored in nptr
+ */
+template<typename T>
+static int doVectorLow(XDR *xd, StatePart part, int ecpt, int sflags,
+                       int nval, int *nptr,
+                       T **v, std::vector<T> *vector,
+                       FILE *list, CptElementType cptElementType)
+{
+    GMX_RELEASE_ASSERT(list != nullptr || (v != nullptr && vector == nullptr) || (v == nullptr && vector != nullptr), "Without list, we should have exactly one of v and vector != NULL");
+
+    bool_t res = 0;
+
+    int    numElemInTheFile;
+    if (list == nullptr)
     {
         if (nval >= 0)
         {
-            if (nf != nval)
-            {
-                gmx_fatal(FARGS, "Count mismatch for state entry %s, code count is %d, file count is %d\n", st_names(cptp, ecpt), nval, nf);
-            }
+            GMX_RELEASE_ASSERT(nptr == nullptr, "With nval>=0 we should have nptr==NULL");
+            numElemInTheFile = nval;
         }
         else
         {
-            *nptr = nf;
+            if (v != nullptr)
+            {
+                GMX_RELEASE_ASSERT(nptr != nullptr, "With nval<0 we should have nptr!=NULL");
+                // cppcheck-suppress nullPointer
+                numElemInTheFile = *nptr;
+            }
+            else
+            {
+                numElemInTheFile = vector->size();
+            }
         }
     }
-    dt  = dtc;
-    res = xdr_int(xd, &dt);
+    /* Read/write the vector element count */
+    res = xdr_int(xd, &numElemInTheFile);
     if (res == 0)
     {
         return -1;
     }
-    if (dt != dtc)
-    {
-        fprintf(stderr, "Precision mismatch for state entry %s, code precision is %s, file precision is %s\n",
-                st_names(cptp, ecpt), xdr_datatype_names[dtc],
-                xdr_datatype_names[dt]);
-    }
-    if (list || !(sflags & (1<<ecpt)))
+    /* Read/write the element data type */
+    constexpr int xdrTypeInTheCode = xdr_type<T>::value;
+    int           xdrTypeInTheFile = xdrTypeInTheCode;
+    res = xdr_int(xd, &xdrTypeInTheFile);
+    if (res == 0)
     {
-        snew(va, nf);
-        vp = va;
+        return -1;
     }
-    else
+
+    if (list == nullptr && (sflags & (1 << ecpt)))
     {
-        if (*v == NULL)
+        if (nval >= 0)
         {
-            snew(*v, nf);
+            if (numElemInTheFile != nval)
+            {
+                gmx_fatal(FARGS, "Count mismatch for state entry %s, code count is %d, file count is %d\n", entryName(part, ecpt), nval, numElemInTheFile);
+            }
         }
-        vp = *v;
-    }
-    if (dt == xdr_datatype_float)
-    {
-        if (!useDouble)
+        else if (nptr != nullptr)
         {
-            // This branch is not reached unless vp is already float *.
-            vf = reinterpret_cast<float *>(vp);
+            *nptr = numElemInTheFile;
         }
-        else
+
+        bool typesMatch = (xdrTypeInTheFile == xdrTypeInTheCode);
+        if (!typesMatch)
         {
-            snew(vf, nf);
+            char buf[STRLEN];
+            sprintf(buf, "mismatch for state entry %s, code precision is %s, file precision is %s",
+                    entryName(part, ecpt),
+                    xdr_datatype_names[xdrTypeInTheCode],
+                    xdr_datatype_names[xdrTypeInTheFile]);
+
+            /* Matching int and real should never occur, but check anyhow */
+            if (xdrTypeInTheFile == xdr_datatype_int ||
+                xdrTypeInTheCode == xdr_datatype_int)
+            {
+                gmx_fatal(FARGS, "Type %s: incompatible checkpoint formats or corrupted checkpoint file.", buf);
+            }
+            fprintf(stderr, "Precision %s\n", buf);
         }
-        res = xdr_vector(xd, reinterpret_cast<char *>(vf), nf,
-                         static_cast<unsigned int>(sizeof(float)), (xdrproc_t)xdr_float);
-        if (res == 0)
+
+        T *vp;
+        if (v != nullptr)
         {
-            return -1;
+            if (*v == nullptr)
+            {
+                snew(*v, numElemInTheFile);
+            }
+            vp = *v;
         }
-        if (useDouble)
+        else
         {
-            for (i = 0; i < nf; i++)
+            /* This conditional ensures that we don't resize on write.
+             * In particular in the state where this code was written
+             * PaddedRVecVector has a size of numElemInThefile and we
+             * don't want to lose that padding here.
+             */
+            if (vector->size() < static_cast<unsigned int>(numElemInTheFile))
             {
-                vp[i] = vf[i];
+                vector->resize(numElemInTheFile);
             }
-            sfree(vf);
+            vp = vector->data();
         }
-    }
-    else
-    {
-        if (useDouble)
+
+        char *vChar;
+        if (typesMatch)
         {
-            // This branch is not reached unless vp is already double *.
-            // cppcheck-suppress invalidPointerCast
-            vd = reinterpret_cast<double *>(vp);
+            vChar = reinterpret_cast<char *>(vp);
         }
         else
         {
-            snew(vd, nf);
+            snew(vChar, numElemInTheFile*sizeOfXdrType(xdrTypeInTheFile));
         }
-        res = xdr_vector(xd, reinterpret_cast<char *>(vd), nf,
-                         static_cast<unsigned int>(sizeof(double)), (xdrproc_t)xdr_double);
+        res = xdr_vector(xd, vChar,
+                         numElemInTheFile, sizeOfXdrType(xdrTypeInTheFile),
+                         xdrProc(xdrTypeInTheFile));
         if (res == 0)
         {
             return -1;
         }
-        if (!useDouble)
-        {
-            for (i = 0; i < nf; i++)
-            {
-                vp[i] = vd[i];
-            }
-            sfree(vd);
-        }
-    }
 
-    if (list)
-    {
-        switch (erealtype)
+        if (!typesMatch)
         {
-            case ecprREAL:
-                pr_reals(list, 0, st_names(cptp, ecpt), vp, nf);
-                break;
-            case ecprRVEC:
-                pr_rvecs(list, 0, st_names(cptp, ecpt), (rvec *)vp, nf/3);
-                break;
-            default:
-                gmx_incons("Unknown checkpoint real type");
+            /* In the old code float-double conversion came for free.
+             * In the new code we still support it, mainly because
+             * the tip4p_continue regression test makes use of this.
+             * It's an open question if we do or don't want to allow this.
+             */
+            convertArrayRealPrecision(vChar, vp, numElemInTheFile);
+            sfree(vChar);
         }
     }
-    if (va)
+    else
     {
-        sfree(va);
+        res = listXdrVector(xd, part, ecpt, numElemInTheFile, xdrTypeInTheFile,
+                            list, cptElementType);
     }
 
     return 0;
 }
 
+//! \brief Read/Write a std::vector.
+template <typename T>
+static int doVector(XDR *xd, StatePart part, int ecpt, int sflags,
+                    std::vector<T> *vector, FILE *list)
+{
+    return doVectorLow<T>(xd, part, ecpt, sflags, -1, nullptr, nullptr, vector, list, CptElementType::real);
+}
+
+//! \brief Read/Write an ArrayRef<real>.
+static int doRealArrayRef(XDR *xd, StatePart part, int ecpt, int sflags,
+                          gmx::ArrayRef<real> vector, FILE *list)
+{
+    real *v_real = vector.data();
+    return doVectorLow<real>(xd, part, ecpt, sflags, vector.size(), nullptr, &v_real, nullptr, list, CptElementType::real);
+}
+
+//! \brief Read/Write a PaddedRVecVector.
+static int doPaddedRvecVector(XDR *xd, StatePart part, int ecpt, int sflags,
+                              gmx::PaddedRVecVector *vector, FILE *list)
+{
+    real *v_real;
+
+    if (list == nullptr && (sflags & (1 << ecpt)))
+    {
+        v_real = vector->data()->as_vec();
+    }
+    else
+    {
+        v_real = nullptr;
+    }
+    // The current invariant of a PaddedRVecVector is that its size is
+    // one larger than necessary to store the data. Make sure that we
+    // read/write only the valid data, and don't leak to the outside
+    // world that currently we find it convenient internally to
+    // allocate one extra element.
+    gmx::ArrayRef<real> ref(v_real, v_real + (vector->size()-1) * DIM);
+
+    return doRealArrayRef(xd, part, ecpt, sflags, ref, list);
+}
 
 /* This function stores n along with the reals for reading,
  * but on reading it assumes that n matches the value in the checkpoint file,
  * a fatal error is generated when this is not the case.
  */
-static int do_cpte_reals(XDR *xd, int cptp, int ecpt, int sflags,
+static int do_cpte_reals(XDR *xd, StatePart part, int ecpt, int sflags,
                          int n, real **v, FILE *list)
 {
-    return do_cpte_reals_low(xd, cptp, ecpt, sflags, n, NULL, v, list, ecprREAL);
+    return doVectorLow<real>(xd, part, ecpt, sflags, n, nullptr, v, nullptr, list, CptElementType::real);
 }
 
 /* This function does the same as do_cpte_reals,
  * except that on reading it ignores the passed value of *n
- * and stored the value read from the checkpoint file in *n.
+ * and stores the value read from the checkpoint file in *n.
  */
-static int do_cpte_n_reals(XDR *xd, int cptp, int ecpt, int sflags,
+static int do_cpte_n_reals(XDR *xd, StatePart part, int ecpt, int sflags,
                            int *n, real **v, FILE *list)
 {
-    return do_cpte_reals_low(xd, cptp, ecpt, sflags, -1, n, v, list, ecprREAL);
+    return doVectorLow<real>(xd, part, ecpt, sflags, -1, n, v, nullptr, list, CptElementType::real);
 }
 
-static int do_cpte_real(XDR *xd, int cptp, int ecpt, int sflags,
+static int do_cpte_real(XDR *xd, StatePart part, int ecpt, int sflags,
                         real *r, FILE *list)
 {
-    return do_cpte_reals_low(xd, cptp, ecpt, sflags, 1, NULL, &r, list, ecprREAL);
+    return doVectorLow<real>(xd, part, ecpt, sflags, 1, nullptr, &r, nullptr, list, CptElementType::real);
 }
 
-static int do_cpte_ints(XDR *xd, int cptp, int ecpt, int sflags,
+static int do_cpte_ints(XDR *xd, StatePart part, int ecpt, int sflags,
                         int n, int **v, FILE *list)
 {
-    bool_t res = 0;
-    int    dtc = xdr_datatype_int;
-    int   *vp, *va = NULL;
-    int    nf, dt;
-
-    nf  = n;
-    res = xdr_int(xd, &nf);
-    if (res == 0)
-    {
-        return -1;
-    }
-    if (list == NULL && v != NULL && nf != n)
-    {
-        gmx_fatal(FARGS, "Count mismatch for state entry %s, code count is %d, file count is %d\n", st_names(cptp, ecpt), n, nf);
-    }
-    dt  = dtc;
-    res = xdr_int(xd, &dt);
-    if (res == 0)
-    {
-        return -1;
-    }
-    if (dt != dtc)
-    {
-        gmx_fatal(FARGS, "Type mismatch for state entry %s, code type is %s, file type is %s\n",
-                  st_names(cptp, ecpt), xdr_datatype_names[dtc],
-                  xdr_datatype_names[dt]);
-    }
-    if (list || !(sflags & (1<<ecpt)) || v == NULL)
-    {
-        snew(va, nf);
-        vp = va;
-    }
-    else
-    {
-        if (*v == NULL)
-        {
-            snew(*v, nf);
-        }
-        vp = *v;
-    }
-    res = xdr_vector(xd, reinterpret_cast<char *>(vp), nf,
-                     static_cast<unsigned int>(sizeof(int)), (xdrproc_t)xdr_int);
-    if (res == 0)
-    {
-        return -1;
-    }
-    if (list)
-    {
-        pr_ivec(list, 0, st_names(cptp, ecpt), vp, nf, TRUE);
-    }
-    if (va)
-    {
-        sfree(va);
-    }
-
-    return 0;
+    return doVectorLow<int>(xd, part, ecpt, sflags, n, nullptr, v, nullptr, list, CptElementType::integer);
 }
 
-static int do_cpte_int(XDR *xd, int cptp, int ecpt, int sflags,
+static int do_cpte_int(XDR *xd, StatePart part, int ecpt, int sflags,
                        int *i, FILE *list)
 {
-    return do_cpte_ints(xd, cptp, ecpt, sflags, 1, &i, list);
+    return do_cpte_ints(xd, part, ecpt, sflags, 1, &i, list);
 }
 
-static int do_cpte_doubles(XDR *xd, int cptp, int ecpt, int sflags,
+static int do_cpte_doubles(XDR *xd, StatePart part, int ecpt, int sflags,
                            int n, double **v, FILE *list)
 {
-    bool_t  res = 0;
-    int     dtc = xdr_datatype_double;
-    double *vp, *va = NULL;
-    int     nf, dt;
-
-    nf  = n;
-    res = xdr_int(xd, &nf);
-    if (res == 0)
-    {
-        return -1;
-    }
-    if (list == NULL && nf != n)
-    {
-        gmx_fatal(FARGS, "Count mismatch for state entry %s, code count is %d, file count is %d\n", st_names(cptp, ecpt), n, nf);
-    }
-    dt  = dtc;
-    res = xdr_int(xd, &dt);
-    if (res == 0)
-    {
-        return -1;
-    }
-    if (dt != dtc)
-    {
-        gmx_fatal(FARGS, "Precision mismatch for state entry %s, code precision is %s, file precision is %s\n",
-                  st_names(cptp, ecpt), xdr_datatype_names[dtc],
-                  xdr_datatype_names[dt]);
-    }
-    if (list || !(sflags & (1<<ecpt)))
-    {
-        snew(va, nf);
-        vp = va;
-    }
-    else
-    {
-        if (*v == NULL)
-        {
-            snew(*v, nf);
-        }
-        vp = *v;
-    }
-    res = xdr_vector(xd, reinterpret_cast<char *>(vp), nf,
-                     static_cast<unsigned int>(sizeof(double)), (xdrproc_t)xdr_double);
-    if (res == 0)
-    {
-        return -1;
-    }
-    if (list)
-    {
-        pr_doubles(list, 0, st_names(cptp, ecpt), vp, nf);
-    }
-    if (va)
-    {
-        sfree(va);
-    }
-
-    return 0;
+    return doVectorLow<double>(xd, part, ecpt, sflags, n, nullptr, v, nullptr, list, CptElementType::real);
 }
 
-static int do_cpte_double(XDR *xd, int cptp, int ecpt, int sflags,
+static int do_cpte_double(XDR *xd, StatePart part, int ecpt, int sflags,
                           double *r, FILE *list)
 {
-    return do_cpte_doubles(xd, cptp, ecpt, sflags, 1, &r, list);
-}
-
-
-static int do_cpte_rvecs(XDR *xd, int cptp, int ecpt, int sflags,
-                         int n, rvec **v, FILE *list)
-{
-    return do_cpte_reals_low(xd, cptp, ecpt, sflags,
-                             n*DIM, NULL, (real **)v, list, ecprRVEC);
+    return do_cpte_doubles(xd, part, ecpt, sflags, 1, &r, list);
 }
 
-static int do_cpte_matrix(XDR *xd, int cptp, int ecpt, int sflags,
+static int do_cpte_matrix(XDR *xd, StatePart part, int ecpt, int sflags,
                           matrix v, FILE *list)
 {
     real *vr;
     int   ret;
 
     vr  = &(v[0][0]);
-    ret = do_cpte_reals_low(xd, cptp, ecpt, sflags,
-                            DIM*DIM, NULL, &vr, NULL, ecprMATRIX);
+    ret = doVectorLow<real>(xd, part, ecpt, sflags,
+                            DIM*DIM, nullptr, &vr, nullptr, nullptr, CptElementType::matrix3x3);
 
     if (list && ret == 0)
     {
-        pr_rvecs(list, 0, st_names(cptp, ecpt), v, DIM);
+        pr_rvecs(list, 0, entryName(part, ecpt), v, DIM);
     }
 
     return ret;
 }
 
 
-static int do_cpte_nmatrix(XDR *xd, int cptp, int ecpt, int sflags,
+static int do_cpte_nmatrix(XDR *xd, StatePart part, int ecpt, int sflags,
                            int n, real **v, FILE *list)
 {
     int   i;
@@ -653,16 +742,16 @@ static int do_cpte_nmatrix(XDR *xd, int cptp, int ecpt, int sflags,
     char  name[CPTSTRLEN];
 
     ret = 0;
-    if (v == NULL)
+    if (v == nullptr)
     {
         snew(v, n);
     }
     for (i = 0; i < n; i++)
     {
-        reti = do_cpte_reals_low(xd, cptp, ecpt, sflags, n, NULL, &(v[i]), NULL, ecprREAL);
+        reti = doVectorLow<real>(xd, part, ecpt, sflags, n, nullptr, &(v[i]), nullptr, nullptr, CptElementType::matrix3x3);
         if (list && reti == 0)
         {
-            sprintf(name, "%s[%d]", st_names(cptp, ecpt), i);
+            sprintf(name, "%s[%d]", entryName(part, ecpt), i);
             pr_reals(list, 0, name, v[i], n);
         }
         if (reti != 0)
@@ -673,11 +762,11 @@ static int do_cpte_nmatrix(XDR *xd, int cptp, int ecpt, int sflags,
     return ret;
 }
 
-static int do_cpte_matrices(XDR *xd, int cptp, int ecpt, int sflags,
+static int do_cpte_matrices(XDR *xd, StatePart part, int ecpt, int sflags,
                             int n, matrix **v, FILE *list)
 {
     bool_t  res = 0;
-    matrix *vp, *va = NULL;
+    matrix *vp, *va = nullptr;
     real   *vr;
     int     nf, i, j, k;
     int     ret;
@@ -688,9 +777,9 @@ static int do_cpte_matrices(XDR *xd, int cptp, int ecpt, int sflags,
     {
         return -1;
     }
-    if (list == NULL && nf != n)
+    if (list == nullptr && nf != n)
     {
-        gmx_fatal(FARGS, "Count mismatch for state entry %s, code count is %d, file count is %d\n", st_names(cptp, ecpt), n, nf);
+        gmx_fatal(FARGS, "Count mismatch for state entry %s, code count is %d, file count is %d\n", entryName(part, ecpt), n, nf);
     }
     if (list || !(sflags & (1<<ecpt)))
     {
@@ -699,7 +788,7 @@ static int do_cpte_matrices(XDR *xd, int cptp, int ecpt, int sflags,
     }
     else
     {
-        if (*v == NULL)
+        if (*v == nullptr)
         {
             snew(*v, nf);
         }
@@ -716,8 +805,9 @@ static int do_cpte_matrices(XDR *xd, int cptp, int ecpt, int sflags,
             }
         }
     }
-    ret = do_cpte_reals_low(xd, cptp, ecpt, sflags,
-                            nf*DIM*DIM, NULL, &vr, NULL, ecprMATRIX);
+    ret = doVectorLow<real>(xd, part, ecpt, sflags,
+                            nf*DIM*DIM, nullptr, &vr, nullptr, nullptr,
+                            CptElementType::matrix3x3);
     for (i = 0; i < nf; i++)
     {
         for (j = 0; j < DIM; j++)
@@ -734,7 +824,7 @@ static int do_cpte_matrices(XDR *xd, int cptp, int ecpt, int sflags,
     {
         for (i = 0; i < nf; i++)
         {
-            pr_rvecs(list, 0, st_names(cptp, ecpt), vp[i], DIM);
+            pr_rvecs(list, 0, entryName(part, ecpt), vp[i], DIM);
         }
     }
     if (va)
@@ -810,7 +900,7 @@ static void do_cpt_header(XDR *xd, gmx_bool bRead, int *file_version,
     if (*file_version >= 12)
     {
         do_cpt_string_err(xd, bRead, "generating host", &fhost, list);
-        if (list == NULL)
+        if (list == nullptr)
         {
             sfree(fhost);
         }
@@ -901,6 +991,10 @@ static void do_cpt_header(XDR *xd, gmx_bool bRead, int *file_version,
     {
         do_cpt_int_err(xd, "swap", eSwapCoords, list);
     }
+    else
+    {
+        *eSwapCoords = eswapNO;
+    }
 }
 
 static int do_cpt_footer(XDR *xd, int file_version)
@@ -925,60 +1019,52 @@ static int do_cpt_footer(XDR *xd, int file_version)
     return 0;
 }
 
-static int do_cpt_state(XDR *xd, gmx_bool bRead,
+static int do_cpt_state(XDR *xd,
                         int fflags, t_state *state,
                         FILE *list)
 {
-    int    sflags;
-    int    i;
-    int    ret;
-    int    nnht, nnhtp;
-
-    ret = 0;
-
-    nnht  = state->nhchainlength*state->ngtc;
-    nnhtp = state->nhchainlength*state->nnhpres;
-
-    if (bRead) /* we need to allocate space for dfhist if we are reading */
-    {
-        init_df_history(&state->dfhist, state->dfhist.nlambda);
-    }
-
-    sflags = state->flags;
-    for (i = 0; (i < estNR && ret == 0); i++)
+    int             ret    = 0;
+    const StatePart part   = StatePart::microState;
+    const int       sflags = state->flags;
+    // If reading, state->natoms was probably just read, so
+    // allocations need to be managed. If writing, this won't change
+    // anything that matters.
+    state_change_natoms(state, state->natoms);
+    for (int i = 0; (i < estNR && ret == 0); i++)
     {
         if (fflags & (1<<i))
         {
             switch (i)
             {
-                case estLAMBDA:  ret      = do_cpte_reals(xd, cptpEST, i, sflags, efptNR, &(state->lambda), list); break;
-                case estFEPSTATE: ret     = do_cpte_int (xd, cptpEST, i, sflags, &state->fep_state, list); break;
-                case estBOX:     ret      = do_cpte_matrix(xd, cptpEST, i, sflags, state->box, list); break;
-                case estBOX_REL: ret      = do_cpte_matrix(xd, cptpEST, i, sflags, state->box_rel, list); break;
-                case estBOXV:    ret      = do_cpte_matrix(xd, cptpEST, i, sflags, state->boxv, list); break;
-                case estPRES_PREV: ret    = do_cpte_matrix(xd, cptpEST, i, sflags, state->pres_prev, list); break;
-                case estSVIR_PREV:  ret   = do_cpte_matrix(xd, cptpEST, i, sflags, state->svir_prev, list); break;
-                case estFVIR_PREV:  ret   = do_cpte_matrix(xd, cptpEST, i, sflags, state->fvir_prev, list); break;
-                case estNH_XI:   ret      = do_cpte_doubles(xd, cptpEST, i, sflags, nnht, &state->nosehoover_xi, list); break;
-                case estNH_VXI:  ret      = do_cpte_doubles(xd, cptpEST, i, sflags, nnht, &state->nosehoover_vxi, list); break;
-                case estNHPRES_XI:   ret  = do_cpte_doubles(xd, cptpEST, i, sflags, nnhtp, &state->nhpres_xi, list); break;
-                case estNHPRES_VXI:  ret  = do_cpte_doubles(xd, cptpEST, i, sflags, nnhtp, &state->nhpres_vxi, list); break;
-                case estTC_INT:  ret      = do_cpte_doubles(xd, cptpEST, i, sflags, state->ngtc, &state->therm_integral, list); break;
-                case estVETA:    ret      = do_cpte_real(xd, cptpEST, i, sflags, &state->veta, list); break;
-                case estVOL0:    ret      = do_cpte_real(xd, cptpEST, i, sflags, &state->vol0, list); break;
-                case estX:       ret      = do_cpte_rvecs(xd, cptpEST, i, sflags, state->natoms, &state->x, list); break;
-                case estV:       ret      = do_cpte_rvecs(xd, cptpEST, i, sflags, state->natoms, &state->v, list); break;
+                case estLAMBDA:  ret      = doRealArrayRef(xd, part, i, sflags, gmx::arrayRefFromArray<real>(state->lambda.data(), state->lambda.size()), list); break;
+                case estFEPSTATE: ret     = do_cpte_int (xd, part, i, sflags, &state->fep_state, list); break;
+                case estBOX:     ret      = do_cpte_matrix(xd, part, i, sflags, state->box, list); break;
+                case estBOX_REL: ret      = do_cpte_matrix(xd, part, i, sflags, state->box_rel, list); break;
+                case estBOXV:    ret      = do_cpte_matrix(xd, part, i, sflags, state->boxv, list); break;
+                case estPRES_PREV: ret    = do_cpte_matrix(xd, part, i, sflags, state->pres_prev, list); break;
+                case estSVIR_PREV:  ret   = do_cpte_matrix(xd, part, i, sflags, state->svir_prev, list); break;
+                case estFVIR_PREV:  ret   = do_cpte_matrix(xd, part, i, sflags, state->fvir_prev, list); break;
+                case estNH_XI:   ret      = doVector<double>(xd, part, i, sflags, &state->nosehoover_xi, list); break;
+                case estNH_VXI:  ret      = doVector<double>(xd, part, i, sflags, &state->nosehoover_vxi, list); break;
+                case estNHPRES_XI:   ret  = doVector<double>(xd, part, i, sflags, &state->nhpres_xi, list); break;
+                case estNHPRES_VXI:  ret  = doVector<double>(xd, part, i, sflags, &state->nhpres_vxi, list); break;
+                case estTHERM_INT:   ret  = doVector<double>(xd, part, i, sflags, &state->therm_integral, list); break;
+                case estBAROS_INT:   ret  = do_cpte_double(xd, part, i, sflags, &state->baros_integral, list); break;
+                case estVETA:    ret      = do_cpte_real(xd, part, i, sflags, &state->veta, list); break;
+                case estVOL0:    ret      = do_cpte_real(xd, part, i, sflags, &state->vol0, list); break;
+                case estX:       ret      = doPaddedRvecVector(xd, part, i, sflags, &state->x, list); break;
+                case estV:       ret      = doPaddedRvecVector(xd, part, i, sflags, &state->v, list); break;
                 /* The RNG entries are no longer written,
                  * the next 4 lines are only for reading old files.
                  */
-                case estLD_RNG:  ret      = do_cpte_ints(xd, cptpEST, i, sflags, 0, NULL, list); break;
-                case estLD_RNGI: ret      = do_cpte_ints(xd, cptpEST, i, sflags, 0, NULL, list); break;
-                case estMC_RNG:  ret      = do_cpte_ints(xd, cptpEST, i, sflags, 0, NULL, list); break;
-                case estMC_RNGI: ret      = do_cpte_ints(xd, cptpEST, i, sflags, 0, NULL, list); break;
-                case estDISRE_INITF:  ret = do_cpte_real (xd, cptpEST, i, sflags, &state->hist.disre_initf, list); break;
-                case estDISRE_RM3TAV: ret = do_cpte_n_reals(xd, cptpEST, i, sflags, &state->hist.ndisrepairs, &state->hist.disre_rm3tav, list); break;
-                case estORIRE_INITF:  ret = do_cpte_real (xd, cptpEST, i, sflags, &state->hist.orire_initf, list); break;
-                case estORIRE_DTAV:   ret = do_cpte_n_reals(xd, cptpEST, i, sflags, &state->hist.norire_Dtav, &state->hist.orire_Dtav, list); break;
+                case estLD_RNG_NOTSUPPORTED:  ret = do_cpte_ints(xd, part, i, sflags, 0, nullptr, list); break;
+                case estLD_RNGI_NOTSUPPORTED: ret = do_cpte_ints(xd, part, i, sflags, 0, nullptr, list); break;
+                case estMC_RNG_NOTSUPPORTED:  ret = do_cpte_ints(xd, part, i, sflags, 0, nullptr, list); break;
+                case estMC_RNGI_NOTSUPPORTED: ret = do_cpte_ints(xd, part, i, sflags, 0, nullptr, list); break;
+                case estDISRE_INITF:  ret         = do_cpte_real (xd, part, i, sflags, &state->hist.disre_initf, list); break;
+                case estDISRE_RM3TAV: ret         = do_cpte_n_reals(xd, part, i, sflags, &state->hist.ndisrepairs, &state->hist.disre_rm3tav, list); break;
+                case estORIRE_INITF:  ret         = do_cpte_real (xd, part, i, sflags, &state->hist.orire_initf, list); break;
+                case estORIRE_DTAV:   ret         = do_cpte_n_reals(xd, part, i, sflags, &state->hist.norire_Dtav, &state->hist.orire_Dtav, list); break;
                 default:
                     gmx_fatal(FARGS, "Unknown state entry %d\n"
                               "You are reading a checkpoint file written by different code, which is not supported", i);
@@ -992,28 +1078,26 @@ static int do_cpt_state(XDR *xd, gmx_bool bRead,
 static int do_cpt_ekinstate(XDR *xd, int fflags, ekinstate_t *ekins,
                             FILE *list)
 {
-    int  i;
-    int  ret;
-
-    ret = 0;
+    int             ret  = 0;
 
-    for (i = 0; (i < eeksNR && ret == 0); i++)
+    const StatePart part = StatePart::kineticEnergy;
+    for (int i = 0; (i < eeksNR && ret == 0); i++)
     {
         if (fflags & (1<<i))
         {
             switch (i)
             {
 
-                case eeksEKIN_N:     ret = do_cpte_int(xd, cptpEEKS, i, fflags, &ekins->ekin_n, list); break;
-                case eeksEKINH:     ret  = do_cpte_matrices(xd, cptpEEKS, i, fflags, ekins->ekin_n, &ekins->ekinh, list); break;
-                case eeksEKINF:      ret = do_cpte_matrices(xd, cptpEEKS, i, fflags, ekins->ekin_n, &ekins->ekinf, list); break;
-                case eeksEKINO:      ret = do_cpte_matrices(xd, cptpEEKS, i, fflags, ekins->ekin_n, &ekins->ekinh_old, list); break;
-                case eeksEKINTOTAL:  ret = do_cpte_matrix(xd, cptpEEKS, i, fflags, ekins->ekin_total, list); break;
-                case eeksEKINSCALEF: ret = do_cpte_doubles(xd, cptpEEKS, i, fflags, ekins->ekin_n, &ekins->ekinscalef_nhc, list); break;
-                case eeksVSCALE:     ret = do_cpte_doubles(xd, 1, cptpEEKS, fflags, ekins->ekin_n, &ekins->vscale_nhc, list); break;
-                case eeksEKINSCALEH: ret = do_cpte_doubles(xd, 1, cptpEEKS, fflags, ekins->ekin_n, &ekins->ekinscaleh_nhc, list); break;
-                case eeksDEKINDL:   ret  = do_cpte_real(xd, 1, cptpEEKS, fflags, &ekins->dekindl, list); break;
-                case eeksMVCOS:      ret = do_cpte_real(xd, 1, cptpEEKS, fflags, &ekins->mvcos, list); break;
+                case eeksEKIN_N:     ret = do_cpte_int(xd, part, i, fflags, &ekins->ekin_n, list); break;
+                case eeksEKINH:     ret  = do_cpte_matrices(xd, part, i, fflags, ekins->ekin_n, &ekins->ekinh, list); break;
+                case eeksEKINF:      ret = do_cpte_matrices(xd, part, i, fflags, ekins->ekin_n, &ekins->ekinf, list); break;
+                case eeksEKINO:      ret = do_cpte_matrices(xd, part, i, fflags, ekins->ekin_n, &ekins->ekinh_old, list); break;
+                case eeksEKINTOTAL:  ret = do_cpte_matrix(xd, part, i, fflags, ekins->ekin_total, list); break;
+                case eeksEKINSCALEF: ret = doVector<double>(xd, part, i, fflags, &ekins->ekinscalef_nhc, list); break;
+                case eeksVSCALE:     ret = doVector<double>(xd, part, i, fflags, &ekins->vscale_nhc, list); break;
+                case eeksEKINSCALEH: ret = doVector<double>(xd, part, i, fflags, &ekins->ekinscaleh_nhc, list); break;
+                case eeksDEKINDL:   ret  = do_cpte_real(xd, part, i, fflags, &ekins->dekindl, list); break;
+                case eeksMVCOS:      ret = do_cpte_real(xd, part, i, fflags, &ekins->mvcos, list); break;
                 default:
                     gmx_fatal(FARGS, "Unknown ekin data state entry %d\n"
                               "You are probably reading a new checkpoint file with old code", i);
@@ -1025,18 +1109,18 @@ static int do_cpt_ekinstate(XDR *xd, int fflags, ekinstate_t *ekins,
 }
 
 
-static int do_cpt_swapstate(XDR *xd, gmx_bool bRead, swapstate_t *swapstate, FILE *list)
+static int do_cpt_swapstate(XDR *xd, gmx_bool bRead,
+                            int eSwapCoords, swaphistory_t *swapstate, FILE *list)
 {
-    int ret              = 0;
     int swap_cpt_version = 2;
 
-
-    if (eswapNO == swapstate->eSwapCoords)
+    if (eSwapCoords == eswapNO)
     {
-        return ret;
+        return 0;
     }
 
-    swapstate->bFromCpt = bRead;
+    swapstate->bFromCpt    = bRead;
+    swapstate->eSwapCoords = eSwapCoords;
 
     do_cpt_int_err(xd, "swap checkpoint version", &swap_cpt_version, list);
     if (bRead && swap_cpt_version < 2)
@@ -1079,7 +1163,7 @@ static int do_cpt_swapstate(XDR *xd, gmx_bool bRead, swapstate_t *swapstate, FIL
                 do_cpt_int_err(xd, "swap influx net p", gs->inflow_net_p[ic], list);
             }
 
-            if (bRead && (NULL == gs->nMolPast[ic]) )
+            if (bRead && (nullptr == gs->nMolPast[ic]) )
             {
                 snew(gs->nMolPast[ic], swapstate->nAverage);
             }
@@ -1160,7 +1244,7 @@ static int do_cpt_swapstate(XDR *xd, gmx_bool bRead, swapstate_t *swapstate, FIL
         do_cpt_n_rvecs_err(xd, "Ch1 whole x", swapstate->nat[eChan1], *swapstate->xc_old_whole_p[eChan1], list);
     }
 
-    return ret;
+    return 0;
 }
 
 
@@ -1168,65 +1252,75 @@ static int do_cpt_enerhist(XDR *xd, gmx_bool bRead,
                            int fflags, energyhistory_t *enerhist,
                            FILE *list)
 {
-    int  i;
-    int  j;
-    int  ret;
+    int ret = 0;
 
-    ret = 0;
+    if (fflags == 0)
+    {
+        return ret;
+    }
+
+    GMX_RELEASE_ASSERT(enerhist != nullptr, "With energy history, we need a valid enerhist pointer");
 
+    /* This is stored/read for backward compatibility */
+    int  energyHistoryNumEnergies = 0;
     if (bRead)
     {
         enerhist->nsteps     = 0;
         enerhist->nsum       = 0;
         enerhist->nsteps_sim = 0;
         enerhist->nsum_sim   = 0;
-        enerhist->dht        = NULL;
-
-        if (fflags & (1<< eenhENERGY_DELTA_H_NN) )
-        {
-            snew(enerhist->dht, 1);
-            enerhist->dht->ndh              = NULL;
-            enerhist->dht->dh               = NULL;
-            enerhist->dht->start_lambda_set = FALSE;
-        }
+    }
+    else if (enerhist != nullptr)
+    {
+        energyHistoryNumEnergies = enerhist->ener_sum_sim.size();
     }
 
-    for (i = 0; (i < eenhNR && ret == 0); i++)
+    delta_h_history_t *deltaH = enerhist->deltaHForeignLambdas.get();
+    const StatePart    part   = StatePart::energyHistory;
+    for (int i = 0; (i < eenhNR && ret == 0); i++)
     {
         if (fflags & (1<<i))
         {
             switch (i)
             {
-                case eenhENERGY_N:     ret = do_cpte_int(xd, cptpEENH, i, fflags, &enerhist->nener, list); break;
-                case eenhENERGY_AVER:  ret = do_cpte_doubles(xd, cptpEENH, i, fflags, enerhist->nener, &enerhist->ener_ave, list); break;
-                case eenhENERGY_SUM:   ret = do_cpte_doubles(xd, cptpEENH, i, fflags, enerhist->nener, &enerhist->ener_sum, list); break;
+                case eenhENERGY_N:     ret = do_cpte_int(xd, part, i, fflags, &energyHistoryNumEnergies, list); break;
+                case eenhENERGY_AVER:  ret = doVector<double>(xd, part, i, fflags, &enerhist->ener_ave, list); break;
+                case eenhENERGY_SUM:   ret = doVector<double>(xd, part, i, fflags, &enerhist->ener_sum, list); break;
                 case eenhENERGY_NSUM:  do_cpt_step_err(xd, eenh_names[i], &enerhist->nsum, list); break;
-                case eenhENERGY_SUM_SIM: ret = do_cpte_doubles(xd, cptpEENH, i, fflags, enerhist->nener, &enerhist->ener_sum_sim, list); break;
+                case eenhENERGY_SUM_SIM: ret = doVector<double>(xd, part, i, fflags, &enerhist->ener_sum_sim, list); break;
                 case eenhENERGY_NSUM_SIM:   do_cpt_step_err(xd, eenh_names[i], &enerhist->nsum_sim, list); break;
                 case eenhENERGY_NSTEPS:     do_cpt_step_err(xd, eenh_names[i], &enerhist->nsteps, list); break;
                 case eenhENERGY_NSTEPS_SIM: do_cpt_step_err(xd, eenh_names[i], &enerhist->nsteps_sim, list); break;
-                case eenhENERGY_DELTA_H_NN: do_cpt_int_err(xd, eenh_names[i], &(enerhist->dht->nndh), list);
-                    if (bRead) /* now allocate memory for it */
+                case eenhENERGY_DELTA_H_NN:
+                {
+                    int numDeltaH = 0;
+                    if (!bRead && deltaH != nullptr)
+                    {
+                        numDeltaH = deltaH->dh.size();
+                    }
+                    do_cpt_int_err(xd, eenh_names[i], &numDeltaH, list);
+                    if (bRead)
                     {
-                        snew(enerhist->dht->dh, enerhist->dht->nndh);
-                        snew(enerhist->dht->ndh, enerhist->dht->nndh);
-                        for (j = 0; j < enerhist->dht->nndh; j++)
+                        if (deltaH == nullptr)
                         {
-                            enerhist->dht->ndh[j] = 0;
-                            enerhist->dht->dh[j]  = NULL;
+                            enerhist->deltaHForeignLambdas.reset(new delta_h_history_t);
+                            deltaH = enerhist->deltaHForeignLambdas.get();
                         }
+                        deltaH->dh.resize(numDeltaH);
+                        deltaH->start_lambda_set = FALSE;
                     }
                     break;
+                }
                 case eenhENERGY_DELTA_H_LIST:
-                    for (j = 0; j < enerhist->dht->nndh; j++)
+                    for (auto dh : deltaH->dh)
                     {
-                        ret = do_cpte_n_reals(xd, cptpEENH, i, fflags, &enerhist->dht->ndh[j], &(enerhist->dht->dh[j]), list);
+                        ret = doVector<real>(xd, part, i, fflags, &dh, list);
                     }
                     break;
                 case eenhENERGY_DELTA_H_STARTTIME:
-                    ret = do_cpte_double(xd, cptpEENH, i, fflags, &(enerhist->dht->start_time), list); break;
+                    ret = do_cpte_double(xd, part, i, fflags, &(deltaH->start_time), list); break;
                 case eenhENERGY_DELTA_H_STARTLAMBDA:
-                    ret = do_cpte_double(xd, cptpEENH, i, fflags, &(enerhist->dht->start_lambda), list); break;
+                    ret = do_cpte_double(xd, part, i, fflags, &(deltaH->start_lambda), list); break;
                 default:
                     gmx_fatal(FARGS, "Unknown energy history entry %d\n"
                               "You are probably reading a new checkpoint file with old code", i);
@@ -1237,11 +1331,7 @@ static int do_cpt_enerhist(XDR *xd, gmx_bool bRead,
     if ((fflags & (1<<eenhENERGY_SUM)) && !(fflags & (1<<eenhENERGY_SUM_SIM)))
     {
         /* Assume we have an old file format and copy sum to sum_sim */
-        srenew(enerhist->ener_sum_sim, enerhist->nener);
-        for (i = 0; i < enerhist->nener; i++)
-        {
-            enerhist->ener_sum_sim[i] = enerhist->ener_sum[i];
-        }
+        enerhist->ener_sum_sim = enerhist->ener_sum;
     }
 
     if ( (fflags & (1<<eenhENERGY_NSUM)) &&
@@ -1260,34 +1350,44 @@ static int do_cpt_enerhist(XDR *xd, gmx_bool bRead,
     return ret;
 }
 
-static int do_cpt_df_hist(XDR *xd, int fflags, df_history_t *dfhist, FILE *list)
+static int do_cpt_df_hist(XDR *xd, int fflags, int nlambda, df_history_t **dfhistPtr, FILE *list)
 {
-    int  i, nlambda;
-    int  ret;
+    int ret = 0;
 
-    nlambda = dfhist->nlambda;
-    ret     = 0;
+    if (fflags == 0)
+    {
+        return 0;
+    }
 
-    for (i = 0; (i < edfhNR && ret == 0); i++)
+    if (*dfhistPtr == nullptr)
+    {
+        snew(*dfhistPtr, 1);
+        (*dfhistPtr)->nlambda = nlambda;
+        init_df_history(*dfhistPtr, nlambda);
+    }
+    df_history_t    *dfhist = *dfhistPtr;
+
+    const StatePart  part   = StatePart::freeEnergyHistory;
+    for (int i = 0; (i < edfhNR && ret == 0); i++)
     {
         if (fflags & (1<<i))
         {
             switch (i)
             {
-                case edfhBEQUIL:       ret = do_cpte_int(xd, cptpEDFH, i, fflags, &dfhist->bEquil, list); break;
-                case edfhNATLAMBDA:    ret = do_cpte_ints(xd, cptpEDFH, i, fflags, nlambda, &dfhist->n_at_lam, list); break;
-                case edfhWLHISTO:      ret = do_cpte_reals(xd, cptpEDFH, i, fflags, nlambda, &dfhist->wl_histo, list); break;
-                case edfhWLDELTA:      ret = do_cpte_real(xd, cptpEDFH, i, fflags, &dfhist->wl_delta, list); break;
-                case edfhSUMWEIGHTS:   ret = do_cpte_reals(xd, cptpEDFH, i, fflags, nlambda, &dfhist->sum_weights, list); break;
-                case edfhSUMDG:        ret = do_cpte_reals(xd, cptpEDFH, i, fflags, nlambda, &dfhist->sum_dg, list); break;
-                case edfhSUMMINVAR:    ret = do_cpte_reals(xd, cptpEDFH, i, fflags, nlambda, &dfhist->sum_minvar, list); break;
-                case edfhSUMVAR:       ret = do_cpte_reals(xd, cptpEDFH, i, fflags, nlambda, &dfhist->sum_variance, list); break;
-                case edfhACCUMP:       ret = do_cpte_nmatrix(xd, cptpEDFH, i, fflags, nlambda, dfhist->accum_p, list); break;
-                case edfhACCUMM:       ret = do_cpte_nmatrix(xd, cptpEDFH, i, fflags, nlambda, dfhist->accum_m, list); break;
-                case edfhACCUMP2:      ret = do_cpte_nmatrix(xd, cptpEDFH, i, fflags, nlambda, dfhist->accum_p2, list); break;
-                case edfhACCUMM2:      ret = do_cpte_nmatrix(xd, cptpEDFH, i, fflags, nlambda, dfhist->accum_m2, list); break;
-                case edfhTIJ:          ret = do_cpte_nmatrix(xd, cptpEDFH, i, fflags, nlambda, dfhist->Tij, list); break;
-                case edfhTIJEMP:       ret = do_cpte_nmatrix(xd, cptpEDFH, i, fflags, nlambda, dfhist->Tij_empirical, list); break;
+                case edfhBEQUIL:       ret = do_cpte_int(xd, part, i, fflags, &dfhist->bEquil, list); break;
+                case edfhNATLAMBDA:    ret = do_cpte_ints(xd, part, i, fflags, nlambda, &dfhist->n_at_lam, list); break;
+                case edfhWLHISTO:      ret = do_cpte_reals(xd, part, i, fflags, nlambda, &dfhist->wl_histo, list); break;
+                case edfhWLDELTA:      ret = do_cpte_real(xd, part, i, fflags, &dfhist->wl_delta, list); break;
+                case edfhSUMWEIGHTS:   ret = do_cpte_reals(xd, part, i, fflags, nlambda, &dfhist->sum_weights, list); break;
+                case edfhSUMDG:        ret = do_cpte_reals(xd, part, i, fflags, nlambda, &dfhist->sum_dg, list); break;
+                case edfhSUMMINVAR:    ret = do_cpte_reals(xd, part, i, fflags, nlambda, &dfhist->sum_minvar, list); break;
+                case edfhSUMVAR:       ret = do_cpte_reals(xd, part, i, fflags, nlambda, &dfhist->sum_variance, list); break;
+                case edfhACCUMP:       ret = do_cpte_nmatrix(xd, part, i, fflags, nlambda, dfhist->accum_p, list); break;
+                case edfhACCUMM:       ret = do_cpte_nmatrix(xd, part, i, fflags, nlambda, dfhist->accum_m, list); break;
+                case edfhACCUMP2:      ret = do_cpte_nmatrix(xd, part, i, fflags, nlambda, dfhist->accum_p2, list); break;
+                case edfhACCUMM2:      ret = do_cpte_nmatrix(xd, part, i, fflags, nlambda, dfhist->accum_m2, list); break;
+                case edfhTIJ:          ret = do_cpte_nmatrix(xd, part, i, fflags, nlambda, dfhist->Tij, list); break;
+                case edfhTIJEMP:       ret = do_cpte_nmatrix(xd, part, i, fflags, nlambda, dfhist->Tij_empirical, list); break;
 
                 default:
                     gmx_fatal(FARGS, "Unknown df history entry %d\n"
@@ -1304,20 +1404,16 @@ static int do_cpt_df_hist(XDR *xd, int fflags, df_history_t *dfhist, FILE *list)
  * average structure in the .cpt file
  */
 static int do_cpt_EDstate(XDR *xd, gmx_bool bRead,
-                          edsamstate_t *EDstate, FILE *list)
+                          int nED, edsamhistory_t *EDstate, FILE *list)
 {
-    int  i;
-    int  ret = 0;
-    char buf[STRLEN];
-
-
-    EDstate->bFromCpt = bRead;
-
-    if (EDstate->nED <= 0)
+    if (nED == 0)
     {
-        return ret;
+        return 0;
     }
 
+    EDstate->bFromCpt     = bRead;
+    EDstate->nED          = nED;
+
     /* When reading, init_edsam has not been called yet,
      * so we have to allocate memory first. */
     if (bRead)
@@ -1329,8 +1425,10 @@ static int do_cpt_EDstate(XDR *xd, gmx_bool bRead,
     }
 
     /* Read/write the last whole conformation of SREF and SAV for each ED dataset (usually only one) */
-    for (i = 0; i < EDstate->nED; i++)
+    for (int i = 0; i < EDstate->nED; i++)
     {
+        char buf[STRLEN];
+
         /* Reference structure SREF */
         sprintf(buf, "ED%d # of atoms in reference structure", i+1);
         do_cpt_int_err(xd, buf, &EDstate->nref[i], list);
@@ -1360,7 +1458,7 @@ static int do_cpt_EDstate(XDR *xd, gmx_bool bRead,
         }
     }
 
-    return ret;
+    return 0;
 }
 
 
@@ -1394,7 +1492,7 @@ static int do_cpt_files(XDR *xd, gmx_bool bRead,
         {
             do_cpt_string_err(xd, bRead, "output filename", &buf, list);
             std::strncpy(outputfiles[i].filename, buf, CPTSTRLEN-1);
-            if (list == NULL)
+            if (list == nullptr)
             {
                 sfree(buf);
             }
@@ -1460,7 +1558,8 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep,
                       ivec domdecCells, int nppnodes,
                       int eIntegrator, int simulation_part,
                       gmx_bool bExpanded, int elamstats,
-                      gmx_int64_t step, double t, t_state *state)
+                      gmx_int64_t step, double t,
+                      t_state *state, ObservablesHistory *observablesHistory)
 {
     t_fileio            *fp;
     int                  file_version;
@@ -1477,7 +1576,6 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep,
     gmx_file_position_t *outputfiles;
     int                  noutputfiles;
     char                *ftime;
-    int                  flags_eks, flags_enh, flags_dfh;
     t_fileio            *ret;
 
     if (DOMAINDECOMP(cr))
@@ -1517,6 +1615,7 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep,
 
     fp = gmx_fio_open(fntemp, "w");
 
+    int flags_eks;
     if (state->ekinstate.bUpToDate)
     {
         flags_eks =
@@ -1529,20 +1628,21 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep,
         flags_eks = 0;
     }
 
-    flags_enh = 0;
-    if (state->enerhist->nsum > 0 || state->enerhist->nsum_sim > 0)
+    energyhistory_t *enerhist  = observablesHistory->energyHistory.get();
+    int              flags_enh = 0;
+    if (enerhist != nullptr && (enerhist->nsum > 0 || enerhist->nsum_sim > 0))
     {
         flags_enh |= (1<<eenhENERGY_N) | (1<<eenhENERGY_NSTEPS) | (1<<eenhENERGY_NSTEPS_SIM);
-        if (state->enerhist->nsum > 0)
+        if (enerhist->nsum > 0)
         {
             flags_enh |= ((1<<eenhENERGY_AVER) | (1<<eenhENERGY_SUM) |
                           (1<<eenhENERGY_NSUM));
         }
-        if (state->enerhist->nsum_sim > 0)
+        if (enerhist->nsum_sim > 0)
         {
             flags_enh |= ((1<<eenhENERGY_SUM_SIM) | (1<<eenhENERGY_NSUM_SIM));
         }
-        if (state->enerhist->dht)
+        if (enerhist->deltaHForeignLambdas != nullptr)
         {
             flags_enh |= ( (1<< eenhENERGY_DELTA_H_NN) |
                            (1<< eenhENERGY_DELTA_H_LIST) |
@@ -1551,6 +1651,7 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep,
         }
     }
 
+    int flags_dfh;
     if (bExpanded)
     {
         flags_dfh = ((1<<edfhBEQUIL) | (1<<edfhNATLAMBDA) | (1<<edfhSUMWEIGHTS) |  (1<<edfhSUMDG)  |
@@ -1585,14 +1686,22 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep,
 
     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 : NULL, &npmenodes,
+                  DOMAINDECOMP(cr) ? domdecCells : nullptr, &npmenodes,
                   &state->natoms, &state->ngtc, &state->nnhpres,
-                  &state->nhchainlength, &(state->dfhist.nlambda), &state->flags, &flags_eks, &flags_enh, &flags_dfh,
-                  &state->edsamstate.nED, &state->swapstate.eSwapCoords,
-                  NULL);
+                  &state->nhchainlength, &nlambda, &state->flags, &flags_eks, &flags_enh, &flags_dfh,
+                  &nED, &eSwapCoords,
+                  nullptr);
 
     sfree(version);
     sfree(btime);
@@ -1600,13 +1709,13 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep,
     sfree(bhost);
     sfree(fprog);
 
-    if ((do_cpt_state(gmx_fio_getxdr(fp), FALSE, state->flags, state, NULL) < 0)        ||
-        (do_cpt_ekinstate(gmx_fio_getxdr(fp), flags_eks, &state->ekinstate, NULL) < 0) ||
-        (do_cpt_enerhist(gmx_fio_getxdr(fp), FALSE, flags_enh, state->enerhist, NULL) < 0)  ||
-        (do_cpt_df_hist(gmx_fio_getxdr(fp), flags_dfh, &state->dfhist, NULL) < 0)  ||
-        (do_cpt_EDstate(gmx_fio_getxdr(fp), FALSE, &state->edsamstate, NULL) < 0)      ||
-        (do_cpt_swapstate(gmx_fio_getxdr(fp), FALSE, &state->swapstate, NULL) < 0) ||
-        (do_cpt_files(gmx_fio_getxdr(fp), FALSE, &outputfiles, &noutputfiles, NULL,
+    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) ||
+        (do_cpt_enerhist(gmx_fio_getxdr(fp), FALSE, flags_enh, enerhist, nullptr) < 0)  ||
+        (do_cpt_df_hist(gmx_fio_getxdr(fp), flags_dfh, nlambda, &state->dfhist, nullptr) < 0)  ||
+        (do_cpt_EDstate(gmx_fio_getxdr(fp), FALSE, nED, edsamhist, nullptr) < 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))
     {
         gmx_file("Cannot read/write checkpoint; corrupt file, or maybe you are out of disk space?");
@@ -1627,7 +1736,7 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep,
                 "Cannot fsync '%s'; maybe you are out of disk space?",
                 gmx_fio_getname(ret));
 
-        if (getenv(GMX_IGNORE_FSYNC_FAILURE_ENV) == NULL)
+        if (getenv(GMX_IGNORE_FSYNC_FAILURE_ENV) == nullptr)
         {
             gmx_file(buf);
         }
@@ -1742,7 +1851,7 @@ static void check_match(FILE *fplog,
                         char *btime, char *buser, char *bhost, int double_prec,
                         char *fprog,
                         const t_commrec *cr, int npp_f, int npme_f,
-                        ivec dd_nc, ivec dd_nc_f,
+                        const ivec dd_nc, const ivec dd_nc_f,
                         gmx_bool reproducibilityRequested)
 {
     /* Note that this check_string on the version will also print a message
@@ -1846,9 +1955,10 @@ static void check_match(FILE *fplog,
 
 static void read_checkpoint(const char *fn, FILE **pfplog,
                             const t_commrec *cr,
-                            ivec dd_nc, int *npme,
+                            const ivec dd_nc,
                             int eIntegrator, int *init_fep_state, gmx_int64_t *step, double *t,
                             t_state *state, gmx_bool *bReadEkin,
+                            ObservablesHistory *observablesHistory,
                             int *simulation_part,
                             gmx_bool bAppendOutputFiles, gmx_bool bForceAppend,
                             gmx_bool reproducibilityRequested)
@@ -1862,7 +1972,7 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
     int                  eIntegrator_f, nppnodes_f, npmenodes_f;
     ivec                 dd_nc_f;
     int                  natoms, ngtc, nnhpres, nhchainlength, nlambda, fflags, flags_eks, flags_enh, flags_dfh;
-    int                  d;
+    int                  nED, eSwapCoords;
     int                  ret;
     gmx_file_position_t *outputfiles;
     int                  nfiles;
@@ -1893,7 +2003,7 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
                   &nppnodes_f, dd_nc_f, &npmenodes_f,
                   &natoms, &ngtc, &nnhpres, &nhchainlength, &nlambda,
                   &fflags, &flags_eks, &flags_enh, &flags_dfh,
-                  &state->edsamstate.nED, &state->swapstate.eSwapCoords, NULL);
+                  &nED, &eSwapCoords, nullptr);
 
     if (bAppendOutputFiles &&
         file_version >= 13 && double_prec != GMX_DOUBLE)
@@ -1901,7 +2011,7 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
         gmx_fatal(FARGS, "Output file appending requested, but the code and checkpoint file precision (single/double) don't match");
     }
 
-    if (cr == NULL || MASTER(cr))
+    if (cr == nullptr || MASTER(cr))
     {
         fprintf(stderr, "\nReading checkpoint file %s generated: %s\n\n",
                 fn, ftime);
@@ -1937,9 +2047,10 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
         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);
     }
 
-    if (nlambda != state->dfhist.nlambda)
+    int nlambdaHistory = (state->dfhist ? state->dfhist->nlambda : 0);
+    if (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, state->dfhist.nlambda);
+        gmx_fatal(FARGS, "Checkpoint file is for a system with %d lambda states, while the current system consists of %d lambda states", nlambda, nlambdaHistory);
     }
 
     init_gtc_state(state, state->ngtc, state->nnhpres, nhchainlength); /* need to keep this here to keep the tpr format working */
@@ -1964,29 +2075,6 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
         }
     }
 
-    if (!PAR(cr))
-    {
-        *npme = 0;
-    }
-    else if (cr->nnodes == nppnodes_f + npmenodes_f)
-    {
-        if (*npme < 0)
-        {
-            *npme = npmenodes_f;
-        }
-        int nppnodes = cr->nnodes - *npme;
-        if (nppnodes == nppnodes_f)
-        {
-            for (d = 0; d < DIM; d++)
-            {
-                if (dd_nc[d] == 0)
-                {
-                    dd_nc[d] = dd_nc_f[d];
-                }
-            }
-        }
-    }
-
     if (fflags != state->flags)
     {
 
@@ -2000,9 +2088,9 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
                           "You can try with the -noappend option, and get more info in the log file.\n");
             }
 
-            if (getenv("GMX_ALLOW_CPT_MISMATCH") == NULL)
+            if (getenv("GMX_ALLOW_CPT_MISMATCH") == nullptr)
             {
-                gmx_fatal(FARGS, "You seem to have switched ensemble, integrator, T and/or P-coupling algorithm between the cpt and tpr file. The recommended way of doing this is passing the cpt file to grompp (with option -t) instead of to mdrun. If you know what you are doing, you can override this error by setting the env.var. GMX_ALLOW_CPT_MISMATCH");
+                gmx_fatal(FARGS, "You seem to have switched ensemble, integrator, T and/or P-coupling algorithm between the cpt and tpr file, or switched GROMACS version. The recommended way of doing this is passing the cpt file to grompp (with option -t) instead of to mdrun. If you know what you are doing, you can override this error by setting the env.var. GMX_ALLOW_CPT_MISMATCH");
             }
             else
             {
@@ -2026,14 +2114,14 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
                         reproducibilityRequested);
         }
     }
-    ret             = do_cpt_state(gmx_fio_getxdr(fp), TRUE, fflags, state, NULL);
+    ret             = do_cpt_state(gmx_fio_getxdr(fp), fflags, 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, NULL);
+    ret = do_cpt_ekinstate(gmx_fio_getxdr(fp), flags_eks, &state->ekinstate, nullptr);
     if (ret)
     {
         cp_error();
@@ -2041,8 +2129,12 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
     *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))));
 
+    if (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, state->enerhist, NULL);
+                          flags_enh, observablesHistory->energyHistory.get(), nullptr);
     if (ret)
     {
         cp_error();
@@ -2057,29 +2149,37 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
         {
             fprintf(fplog, "\nWARNING: %s\n\n", warn);
         }
-        state->enerhist->nsum     = *step;
-        state->enerhist->nsum_sim = *step;
+        observablesHistory->energyHistory->nsum     = *step;
+        observablesHistory->energyHistory->nsum_sim = *step;
     }
 
-    ret = do_cpt_df_hist(gmx_fio_getxdr(fp), flags_dfh, &state->dfhist, NULL);
+    ret = do_cpt_df_hist(gmx_fio_getxdr(fp), flags_dfh, nlambda, &state->dfhist, nullptr);
     if (ret)
     {
         cp_error();
     }
 
-    ret = do_cpt_EDstate(gmx_fio_getxdr(fp), TRUE, &state->edsamstate, NULL);
+    if (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);
     if (ret)
     {
         cp_error();
     }
 
-    ret = do_cpt_swapstate(gmx_fio_getxdr(fp), TRUE, &state->swapstate, NULL);
+    if (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);
     if (ret)
     {
         cp_error();
     }
 
-    ret = do_cpt_files(gmx_fio_getxdr(fp), TRUE, &outputfiles, &nfiles, NULL, file_version);
+    ret = do_cpt_files(gmx_fio_getxdr(fp), TRUE, &outputfiles, &nfiles, nullptr, file_version);
     if (ret)
     {
         cp_error();
@@ -2246,9 +2346,10 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
 
 
 void load_checkpoint(const char *fn, FILE **fplog,
-                     const t_commrec *cr, ivec dd_nc, int *npme,
+                     const t_commrec *cr, const ivec dd_nc,
                      t_inputrec *ir, t_state *state,
                      gmx_bool *bReadEkin,
+                     ObservablesHistory *observablesHistory,
                      gmx_bool bAppend, gmx_bool bForceAppend,
                      gmx_bool reproducibilityRequested)
 {
@@ -2259,15 +2360,14 @@ void load_checkpoint(const char *fn, FILE **fplog,
     {
         /* Read the state from the checkpoint file */
         read_checkpoint(fn, fplog,
-                        cr, dd_nc, npme,
-                        ir->eI, &(ir->fepvals->init_fep_state), &step, &t, state, bReadEkin,
+                        cr, dd_nc,
+                        ir->eI, &(ir->fepvals->init_fep_state), &step, &t,
+                        state, bReadEkin, observablesHistory,
                         &ir->simulation_part, bAppend, bForceAppend,
                         reproducibilityRequested);
     }
     if (PAR(cr))
     {
-        gmx_bcast(sizeof(*npme), npme, cr);
-        gmx_bcast(DIM*sizeof(dd_nc[0]), dd_nc, cr);
         gmx_bcast(sizeof(step), &step, cr);
         gmx_bcast(sizeof(*bReadEkin), bReadEkin, cr);
     }
@@ -2290,12 +2390,14 @@ void read_checkpoint_part_and_step(const char  *filename,
     int       eIntegrator;
     int       nppnodes, npme;
     ivec      dd_nc;
+    int       nlambda;
     int       flags_eks, flags_enh, flags_dfh;
     double    t;
     t_state   state;
+    int       nED, eSwapCoords;
     t_fileio *fp;
 
-    if (filename == NULL ||
+    if (filename == nullptr ||
         !gmx_fexist(filename) ||
         (!(fp = gmx_fio_open(filename, "r"))))
     {
@@ -2312,8 +2414,8 @@ void read_checkpoint_part_and_step(const char  *filename,
                   &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,
-                  &(state.dfhist.nlambda), &state.flags, &flags_eks, &flags_enh, &flags_dfh,
-                  &state.edsamstate.nED, &state.swapstate.eSwapCoords, NULL);
+                  &nlambda, &state.flags, &flags_eks, &flags_enh, &flags_dfh,
+                  &nED, &eSwapCoords, nullptr);
 
     gmx_fio_close(fp);
 }
@@ -2328,47 +2430,53 @@ static void read_checkpoint_data(t_fileio *fp, int *simulation_part,
     int                  eIntegrator;
     int                  nppnodes, npme;
     ivec                 dd_nc;
+    int                  nlambda;
     int                  flags_eks, flags_enh, flags_dfh;
+    int                  nED, eSwapCoords;
     int                  nfiles_loc;
-    gmx_file_position_t *files_loc = NULL;
+    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,
-                  &(state->dfhist.nlambda), &state->flags, &flags_eks, &flags_enh, &flags_dfh,
-                  &state->edsamstate.nED, &state->swapstate.eSwapCoords, NULL);
+                  &nlambda, &state->flags, &flags_eks, &flags_enh, &flags_dfh,
+                  &nED, &eSwapCoords, nullptr);
     ret =
-        do_cpt_state(gmx_fio_getxdr(fp), TRUE, state->flags, state, NULL);
+        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, NULL);
+    ret = do_cpt_ekinstate(gmx_fio_getxdr(fp), flags_eks, &state->ekinstate, nullptr);
     if (ret)
     {
         cp_error();
     }
+
+    energyhistory_t enerhist;
     ret = do_cpt_enerhist(gmx_fio_getxdr(fp), TRUE,
-                          flags_enh, state->enerhist, NULL);
+                          flags_enh, &enerhist, nullptr);
     if (ret)
     {
         cp_error();
     }
-    ret = do_cpt_df_hist(gmx_fio_getxdr(fp), flags_dfh, &state->dfhist, NULL);
+    ret = do_cpt_df_hist(gmx_fio_getxdr(fp), flags_dfh, nlambda, &state->dfhist, nullptr);
     if (ret)
     {
         cp_error();
     }
 
-    ret = do_cpt_EDstate(gmx_fio_getxdr(fp), TRUE, &state->edsamstate, NULL);
+    edsamhistory_t edsamhist = {};
+    ret = do_cpt_EDstate(gmx_fio_getxdr(fp), TRUE, nED, &edsamhist, nullptr);
     if (ret)
     {
         cp_error();
     }
 
-    ret = do_cpt_swapstate(gmx_fio_getxdr(fp), TRUE, &state->swapstate, NULL);
+    swaphistory_t swaphist = {};
+    ret = do_cpt_swapstate(gmx_fio_getxdr(fp), TRUE, eSwapCoords, &swaphist, nullptr);
     if (ret)
     {
         cp_error();
@@ -2377,7 +2485,7 @@ static void read_checkpoint_data(t_fileio *fp, int *simulation_part,
     ret = do_cpt_files(gmx_fio_getxdr(fp), TRUE,
                        &files_loc,
                        &nfiles_loc,
-                       NULL, file_version);
+                       nullptr, file_version);
     if (outputfiles != nullptr)
     {
         *outputfiles = files_loc;
@@ -2416,7 +2524,7 @@ read_checkpoint_state(const char *fn, int *simulation_part,
     t_fileio *fp;
 
     fp = gmx_fio_open(fn, "r");
-    read_checkpoint_data(fp, simulation_part, step, t, state, NULL, NULL);
+    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?");
@@ -2425,21 +2533,14 @@ read_checkpoint_state(const char *fn, int *simulation_part,
 
 void read_checkpoint_trxframe(t_fileio *fp, t_trxframe *fr)
 {
-    /* This next line is nasty because the sub-structures of t_state
-     * cannot be assumed to be zeroed (or even initialized in ways the
-     * rest of the code might assume). Using snew would be better, but
-     * this will all go away for 5.0. */
     t_state         state;
     int             simulation_part;
     gmx_int64_t     step;
     double          t;
 
-    init_state(&state, 0, 0, 0, 0, 0);
-
-    read_checkpoint_data(fp, &simulation_part, &step, &t, &state, NULL, NULL);
+    read_checkpoint_data(fp, &simulation_part, &step, &t, &state, nullptr, nullptr);
 
     fr->natoms  = state.natoms;
-    fr->bTitle  = FALSE;
     fr->bStep   = TRUE;
     fr->step    = gmx_int64_to_int(step,
                                    "conversion of checkpoint to trajectory");
@@ -2452,14 +2553,12 @@ void read_checkpoint_trxframe(t_fileio *fp, t_trxframe *fr)
     fr->bX         = (state.flags & (1<<estX));
     if (fr->bX)
     {
-        fr->x     = state.x;
-        state.x   = NULL;
+        fr->x   = getRvecArrayFromPaddedRVecVector(&state.x, state.natoms);
     }
     fr->bV      = (state.flags & (1<<estV));
     if (fr->bV)
     {
-        fr->v     = state.v;
-        state.v   = NULL;
+        fr->v   = getRvecArrayFromPaddedRVecVector(&state.v, state.natoms);
     }
     fr->bF      = FALSE;
     fr->bBox    = (state.flags & (1<<estBOX));
@@ -2467,7 +2566,6 @@ void read_checkpoint_trxframe(t_fileio *fp, t_trxframe *fr)
     {
         copy_mat(state.box, fr->box);
     }
-    done_state(&state);
 }
 
 void list_checkpoint(const char *fn, FILE *out)
@@ -2480,23 +2578,24 @@ void list_checkpoint(const char *fn, FILE *out)
     gmx_int64_t          step;
     double               t;
     ivec                 dd_nc;
-    t_state              state;
+    int                  nlambda;
     int                  flags_eks, flags_enh, flags_dfh;
+    int                  nED, eSwapCoords;
     int                  ret;
     gmx_file_position_t *outputfiles;
     int                  nfiles;
 
-    init_state(&state, -1, -1, -1, -1, 0);
+    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,
-                  &(state.dfhist.nlambda), &state.flags,
-                  &flags_eks, &flags_enh, &flags_dfh, &state.edsamstate.nED,
-                  &state.swapstate.eSwapCoords, out);
-    ret = do_cpt_state(gmx_fio_getxdr(fp), TRUE, state.flags, &state, out);
+                  &nlambda, &state.flags,
+                  &flags_eks, &flags_enh, &flags_dfh, &nED, &eSwapCoords,
+                  out);
+    ret = do_cpt_state(gmx_fio_getxdr(fp), state.flags, &state, out);
     if (ret)
     {
         cp_error();
@@ -2506,23 +2605,27 @@ void list_checkpoint(const char *fn, FILE *out)
     {
         cp_error();
     }
+
+    energyhistory_t enerhist;
     ret = do_cpt_enerhist(gmx_fio_getxdr(fp), TRUE,
-                          flags_enh, state.enerhist, out);
+                          flags_enh, &enerhist, out);
 
     if (ret == 0)
     {
         ret = do_cpt_df_hist(gmx_fio_getxdr(fp),
-                             flags_dfh, &state.dfhist, out);
+                             flags_dfh, nlambda, &state.dfhist, out);
     }
 
     if (ret == 0)
     {
-        ret = do_cpt_EDstate(gmx_fio_getxdr(fp), TRUE, &state.edsamstate, out);
+        edsamhistory_t edsamhist = {};
+        ret = do_cpt_EDstate(gmx_fio_getxdr(fp), TRUE, nED, &edsamhist, out);
     }
 
     if (ret == 0)
     {
-        ret = do_cpt_swapstate(gmx_fio_getxdr(fp), TRUE, &state.swapstate, out);
+        swaphistory_t swaphist = {};
+        ret = do_cpt_swapstate(gmx_fio_getxdr(fp), TRUE, eSwapCoords, &swaphist, out);
     }
 
     if (ret == 0)
@@ -2543,8 +2646,6 @@ void list_checkpoint(const char *fn, FILE *out)
     {
         gmx_file("Cannot read/write checkpoint; corrupt file, or maybe you are out of disk space?");
     }
-
-    done_state(&state);
 }
 
 /* This routine cannot print tons of data, since it is called before the log file is opened. */
@@ -2558,13 +2659,10 @@ read_checkpoint_simulation_part_and_filenames(t_fileio             *fp,
     double      t;
     t_state     state;
 
-    init_state(&state, 0, 0, 0, 0, 0);
-
     read_checkpoint_data(fp, simulation_part, &step, &t, &state,
                          nfiles, outputfiles);
     if (gmx_fio_close(fp) != 0)
     {
         gmx_file("Cannot read/write checkpoint; corrupt file, or maybe you are out of disk space?");
     }
-    done_state(&state);
 }
index 22f4d5cf5bac9b812e5bb6bebbb5fe1507d99eee..697e31c14ba8c390f9a19b2235efb86c19f50a61 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,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.
 extern "C" {
 #endif
 
+class energyhistory_t;
 struct gmx_file_position_t;
+struct ObservablesHistory;
 struct t_commrec;
 struct t_fileio;
 struct t_inputrec;
-struct t_state;
+class t_state;
 struct t_trxframe;
 
 /* the name of the environment variable to disable fsync failure checks with */
@@ -67,12 +69,12 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep,
                       int eIntegrator, int simulation_part,
                       gmx_bool bExpanded, int elamstats,
                       gmx_int64_t step, double t,
-                      t_state *state);
+                      t_state *state, ObservablesHistory *observablesHistory);
 
 /* Loads a checkpoint from fn for run continuation.
  * Generates a fatal error on system size mismatch.
  * The master node reads the file
- * and communicates all the modified number of steps and the parallel setup,
+ * and communicates all the modified number of steps,
  * but not the state itself.
  * When bAppend is set, lock the log file and truncate the existing output
  * files so they can be appended.
@@ -81,9 +83,10 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep,
  * With reproducibilityRequested warns about version, build, #ranks differences.
  */
 void load_checkpoint(const char *fn, FILE **fplog,
-                     const t_commrec *cr, ivec dd_nc, int *npme,
+                     const t_commrec *cr, const ivec dd_nc,
                      t_inputrec *ir, t_state *state,
                      gmx_bool *bReadEkin,
+                     ObservablesHistory *observablesHistory,
                      gmx_bool bAppend, gmx_bool bForceAppend,
                      gmx_bool reproducibilityRequested);
 
index a370d48890df143cacf5fde6a60ff4445b478b55..b9015383b4d3410a56b6184d0cdbf57e8b56d8e6 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,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.
@@ -50,7 +50,6 @@
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
 #include "gromacs/math/vec.h"
-#include "gromacs/topology/atomprop.h"
 #include "gromacs/topology/atoms.h"
 #include "gromacs/topology/block.h"
 #include "gromacs/topology/mtop_util.h"
@@ -59,6 +58,7 @@
 #include "gromacs/trajectory/trajectoryframe.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
 
 void write_sto_conf_indexed(const char *outfile, const char *title,
@@ -80,8 +80,6 @@ void write_sto_conf_indexed(const char *outfile, const char *title,
             break;
         case efG96:
             clear_trxframe(&fr, TRUE);
-            fr.bTitle = TRUE;
-            fr.title  = title;
             fr.natoms = atoms->nr;
             fr.bAtoms = TRUE;
             fr.atoms  = const_cast<t_atoms *>(atoms);
@@ -95,7 +93,7 @@ void write_sto_conf_indexed(const char *outfile, const char *title,
             fr.bBox = TRUE;
             copy_mat(box, fr.box);
             out = gmx_fio_fopen(outfile, "w");
-            write_g96_conf(out, &fr, nindex, index);
+            write_g96_conf(out, title, &fr, nindex, index);
             gmx_fio_fclose(out);
             break;
         case efPDB:
@@ -103,7 +101,7 @@ void write_sto_conf_indexed(const char *outfile, const char *title,
         case efENT:
         case efPQR:
             out = gmx_fio_fopen(outfile, "w");
-            write_pdbfile_indexed(out, title, atoms, x, ePBC, box, ' ', -1, nindex, index, NULL, TRUE);
+            write_pdbfile_indexed(out, title, atoms, x, ePBC, box, ' ', -1, nindex, index, nullptr, TRUE);
             gmx_fio_fclose(out);
             break;
         case efESP:
@@ -134,8 +132,6 @@ void write_sto_conf(const char *outfile, const char *title, const t_atoms *atoms
             break;
         case efG96:
             clear_trxframe(&fr, TRUE);
-            fr.bTitle = TRUE;
-            fr.title  = title;
             fr.natoms = atoms->nr;
             fr.bAtoms = TRUE;
             fr.atoms  = const_cast<t_atoms *>(atoms); // TODO check
@@ -149,19 +145,19 @@ void write_sto_conf(const char *outfile, const char *title, const t_atoms *atoms
             fr.bBox = TRUE;
             copy_mat(box, fr.box);
             out = gmx_fio_fopen(outfile, "w");
-            write_g96_conf(out, &fr, -1, NULL);
+            write_g96_conf(out, title, &fr, -1, nullptr);
             gmx_fio_fclose(out);
             break;
         case efPDB:
         case efBRK:
         case efENT:
             out = gmx_fio_fopen(outfile, "w");
-            write_pdbfile(out, title, atoms, x, ePBC, box, ' ', -1, NULL, TRUE);
+            write_pdbfile(out, title, atoms, x, ePBC, box, ' ', -1, nullptr, TRUE);
             gmx_fio_fclose(out);
             break;
         case efESP:
             out = gmx_fio_fopen(outfile, "w");
-            write_espresso_conf_indexed(out, title, atoms, atoms->nr, NULL, x, v, box);
+            write_espresso_conf_indexed(out, title, atoms, atoms->nr, nullptr, x, v, box);
             gmx_fio_fclose(out);
             break;
         case efTPR:
@@ -218,14 +214,12 @@ static void get_stx_coordnum(const char *infile, int *natoms)
         case efG96:
         {
             in        = gmx_fio_fopen(infile, "r");
-            fr.title  = NULL;
             fr.natoms = -1;
-            fr.atoms  = NULL;
-            fr.x      = NULL;
-            fr.v      = NULL;
-            fr.f      = NULL;
-            *natoms   = read_g96_conf(in, infile, &fr, NULL, g96_line);
-            sfree(const_cast<char *>(fr.title));
+            fr.atoms  = nullptr;
+            fr.x      = nullptr;
+            fr.v      = nullptr;
+            fr.f      = nullptr;
+            *natoms   = read_g96_conf(in, infile, nullptr, &fr, nullptr, g96_line);
             gmx_fio_fclose(in);
             break;
         }
@@ -304,7 +298,8 @@ static void tpx_make_chain_identifiers(t_atoms *atoms, t_block *mols)
     }
 }
 
-static void read_stx_conf(const char *infile, t_topology *top,
+static void read_stx_conf(const char *infile,
+                          t_symtab *symtab, char **name, t_atoms *atoms,
                           rvec x[], rvec *v, int *ePBC, matrix box)
 {
     FILE       *in;
@@ -312,11 +307,11 @@ static void read_stx_conf(const char *infile, t_topology *top,
     int         ftp;
     char        g96_line[STRLEN+1];
 
-    if (top->atoms.nr == 0)
+    if (atoms->nr == 0)
     {
         fprintf(stderr, "Warning: Number of atoms in %s is 0\n", infile);
     }
-    else if (top->atoms.atom == NULL)
+    else if (atoms->atom == nullptr)
     {
         gmx_mem("Uninitialized array atom");
     }
@@ -330,72 +325,79 @@ static void read_stx_conf(const char *infile, t_topology *top,
     switch (ftp)
     {
         case efGRO:
-            gmx_gro_read_conf(infile, top, x, v, box);
+            gmx_gro_read_conf(infile, symtab, name, atoms, x, v, box);
             break;
         case efG96:
-            fr.title  = NULL;
-            fr.natoms = top->atoms.nr;
-            fr.atoms  = &top->atoms;
+            fr.natoms = atoms->nr;
+            fr.atoms  = atoms;
             fr.x      = x;
             fr.v      = v;
-            fr.f      = NULL;
+            fr.f      = nullptr;
             in        = gmx_fio_fopen(infile, "r");
-            read_g96_conf(in, infile, &fr, &top->symtab, g96_line);
+            read_g96_conf(in, infile, name, &fr, symtab, g96_line);
             gmx_fio_fclose(in);
             copy_mat(fr.box, box);
-            top->name = put_symtab(&top->symtab, fr.title);
-            sfree(const_cast<char *>(fr.title));
             break;
         case efPDB:
         case efBRK:
         case efENT:
-            gmx_pdb_read_conf(infile, top, x, ePBC, box);
+            gmx_pdb_read_conf(infile, symtab, name, atoms, x, ePBC, box);
             break;
         case efESP:
-            gmx_espresso_read_conf(infile, top, x, v, box);
+            gmx_espresso_read_conf(infile, symtab, name, atoms, x, v, box);
             break;
         default:
             gmx_incons("Not supported in read_stx_conf");
     }
 }
 
-static void done_gmx_groups_t(gmx_groups_t *g)
+static void readConfAndAtoms(const char *infile,
+                             t_symtab *symtab, char **name, t_atoms *atoms,
+                             int *ePBC,
+                             rvec **x, rvec **v, matrix box)
 {
-    int i;
+    int natoms;
+    get_stx_coordnum(infile, &natoms);
+
+    init_t_atoms(atoms, natoms, (fn2ftp(infile) == efPDB));
 
-    for (i = 0; (i < egcNR); i++)
+    bool xIsNull = false;
+    if (x == nullptr)
     {
-        if (NULL != g->grps[i].nm_ind)
-        {
-            sfree(g->grps[i].nm_ind);
-            g->grps[i].nm_ind = NULL;
-        }
-        if (NULL != g->grpnr[i])
-        {
-            sfree(g->grpnr[i]);
-            g->grpnr[i] = NULL;
-        }
+        snew(x, 1);
+        xIsNull = true;
+    }
+    snew(*x, natoms);
+    if (v)
+    {
+        snew(*v, natoms);
+    }
+    read_stx_conf(infile,
+                  symtab, name, atoms,
+                  *x, (v == nullptr) ? nullptr : *v, ePBC, box);
+    if (xIsNull)
+    {
+        sfree(*x);
+        sfree(x);
     }
-    /* The contents of this array is in symtab, don't free it here */
-    sfree(g->grpname);
 }
 
-gmx_bool read_tps_conf(const char *infile, t_topology *top, int *ePBC,
-                       rvec **x, rvec **v, matrix box, gmx_bool bMass)
+void readConfAndTopology(const char *infile,
+                         bool *haveTopology, gmx_mtop_t *mtop,
+                         int *ePBC,
+                         rvec **x, rvec **v, matrix box)
 {
-    t_tpxheader      header;
-    int              natoms, i;
-    gmx_bool         bTop, bXNULL = FALSE;
-    gmx_mtop_t      *mtop;
-    gmx_atomprop_t   aps;
-
-    bTop  = fn2bTPX(infile);
-    if (ePBC != NULL)
+    GMX_RELEASE_ASSERT(mtop != nullptr, "readConfAndTopology requires mtop!=NULL");
+
+    if (ePBC != nullptr)
     {
         *ePBC = -1;
     }
-    if (bTop)
+
+    *haveTopology = fn2bTPX(infile);
+    if (*haveTopology)
     {
+        t_tpxheader header;
         read_tpxheader(infile, &header, TRUE);
         if (x)
         {
@@ -405,64 +407,55 @@ gmx_bool read_tps_conf(const char *infile, t_topology *top, int *ePBC,
         {
             snew(*v, header.natoms);
         }
-        snew(mtop, 1);
+        int natoms;
         int ePBC_tmp
-            = read_tpx(infile, NULL, box, &natoms,
-                       (x == NULL) ? NULL : *x, (v == NULL) ? NULL : *v, mtop);
-        if (ePBC != NULL)
+            = read_tpx(infile, nullptr, box, &natoms,
+                       (x == nullptr) ? nullptr : *x, (v == nullptr) ? nullptr : *v, mtop);
+        if (ePBC != nullptr)
         {
             *ePBC = ePBC_tmp;
         }
-        *top = gmx_mtop_t_to_t_topology(mtop);
-        /* In this case we need to throw away the group data too */
-        done_gmx_groups_t(&mtop->groups);
-        sfree(mtop);
-        tpx_make_chain_identifiers(&top->atoms, &top->mols);
     }
     else
     {
-        open_symtab(&top->symtab);
-        get_stx_coordnum(infile, &natoms);
-        init_t_atoms(&top->atoms, natoms, (fn2ftp(infile) == efPDB));
-        if (x == NULL)
-        {
-            snew(x, 1);
-            bXNULL = TRUE;
-        }
-        snew(*x, natoms);
-        if (v)
-        {
-            snew(*v, natoms);
-        }
-        read_stx_conf(infile, top, *x, (v == NULL) ? NULL : *v, ePBC, box);
-        if (bXNULL)
-        {
-            sfree(*x);
-            sfree(x);
-        }
-        if (bMass)
+        t_symtab   symtab;
+        char      *name;
+        t_atoms    atoms;
+
+        open_symtab(&symtab);
+
+        readConfAndAtoms(infile, &symtab, &name, &atoms, ePBC, x, v, box);
+
+        init_mtop(mtop);
+        convertAtomsToMtop(&symtab, put_symtab(&symtab, name), &atoms, mtop);
+        sfree(name);
+    }
+}
+
+gmx_bool read_tps_conf(const char *infile, t_topology *top, int *ePBC,
+                       rvec **x, rvec **v, matrix box, gmx_bool requireMasses)
+{
+    bool        haveTopology;
+    gmx_mtop_t *mtop;
+
+    // Note: We should have an initializer instead of relying on snew
+    snew(mtop, 1);
+    readConfAndTopology(infile, &haveTopology, mtop, ePBC, x, v, box);
+
+    *top = gmx_mtop_t_to_t_topology(mtop, true);
+    sfree(mtop);
+
+    tpx_make_chain_identifiers(&top->atoms, &top->mols);
+
+    if (requireMasses && !top->atoms.haveMass)
+    {
+        atomsSetMassesBasedOnNames(&top->atoms, TRUE);
+
+        if (!top->atoms.haveMass)
         {
-            aps = gmx_atomprop_init();
-            for (i = 0; (i < natoms); i++)
-            {
-                if (!gmx_atomprop_query(aps, epropMass,
-                                        *top->atoms.resinfo[top->atoms.atom[i].resind].name,
-                                        *top->atoms.atomname[i],
-                                        &(top->atoms.atom[i].m)))
-                {
-                    if (debug)
-                    {
-                        fprintf(debug, "Can not find mass for atom %s %d %s, setting to 1\n",
-                                *top->atoms.resinfo[top->atoms.atom[i].resind].name,
-                                top->atoms.resinfo[top->atoms.atom[i].resind].nr,
-                                *top->atoms.atomname[i]);
-                    }
-                }
-            }
-            gmx_atomprop_destroy(aps);
+            gmx_fatal(FARGS, "Masses were requested, but for some atom(s) masses could not be found in the database. Use a tpr file as input, if possible, or add these atoms to the mass database.");
         }
-        top->idef.ntypes = -1;
     }
 
-    return bTop;
+    return haveTopology;
 }
index 459c7167cea0952a77218907606b96e589ca7261..be8b299669a883d24c248c01f9bf0791eab27b63 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,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.
@@ -68,14 +68,46 @@ void write_sto_conf_mtop(const char *outfile, const char *title,
                          const rvec x[], const rvec *v, int ePBC, const matrix box);
 /* As write_sto_conf, but uses a gmx_mtop_t struct */
 
-gmx_bool read_tps_conf(const char *infile, struct t_topology *top,
-                       int *ePBC, rvec **x, rvec **v, matrix box, gmx_bool bMass);
-/* Read title, top.atoms, x, v (if not NULL) and box from an STX file,
- * memory for atoms, x and v will be allocated.
- * Return TRUE if a complete topology was read.
- * If infile is a TPX file read the whole top,
- * else if bMass=TRUE, read the masses into top.atoms from the mass database.
+/*! \brief Read a configuration and, when available, a topology from a tpr or structure file.
+ *
+ * When reading from a tpr file, the complete topology is returned in \p mtop.
+ * When reading from a structure file, only the atoms struct in \p mtop contains data.
+ *
+ * \param[in]     infile        Input file name
+ * \param[out]    haveTopology  true when a topology was read and stored in mtop
+ * \param[out]    mtop          The topology, either complete or only atom data
+ * \param[out]    ePBC          Enum reporting the type of PBC
+ * \param[in,out] x             Coordinates will be stored when *x!=NULL
+ * \param[in,out] v             Velocities will be stored when *v!=NULL
+ * \param[out]    box           Box dimensions
+ */
+void readConfAndTopology(const char *infile,
+                         bool *haveTopology, gmx_mtop_t *mtop,
+                         int *ePBC,
+                         rvec **x, rvec **v, matrix box);
+
+/*! \brief Read a configuration and, when available, a topology from a tpr or structure file.
+ *
+ * Deprecated, superseded by readConfAndTopology().
+ * When \p requireMasses = TRUE, this routine must return a topology with
+ * mass data. Masses are either read from a tpr input file, or otherwise
+ * looked up from the mass database, and when such lookup fails a fatal error
+ * results.
+ * When \p requireMasses = FALSE, masses will still be read from tpr input and
+ * their presence is signaled with the \p haveMass flag in t_atoms of \p top.
+ *
+ * \param[in]     infile        Input file name
+ * \param[out]    top           The topology, either complete or only atom data. Caller is responsible for calling done_top().
+ * \param[out]    ePBC          Enum reporting the type of PBC
+ * \param[in,out] x             Coordinates will be stored when *x!=NULL
+ * \param[in,out] v             Velocities will be stored when *v!=NULL
+ * \param[out]    box           Box dimensions
+ * \param[in]     requireMasses Require masses to be present, either from tpr or from the mass database
+ * \returns if a topology is available
  */
+gmx_bool read_tps_conf(const char *infile, struct t_topology *top,
+                       int *ePBC, rvec **x, rvec **v, matrix box,
+                       gmx_bool requireMasses);
 
 #ifdef __cplusplus
 }
index 48d4b7bc98f197a227ba369b5104ab4706e765f7..feedd8a99fbd00672abfc22996b351a8bd1d926c 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,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.
 #include "gromacs/math/vec.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/mdtypes/state.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/topology/topology.h"
+#include "gromacs/utility/compare.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxassert.h"
@@ -100,12 +102,12 @@ static void enxsubblock_init(t_enxsubblock *sb)
 #else
     sb->type = xdr_datatype_float;
 #endif
-    sb->fval       = NULL;
-    sb->dval       = NULL;
-    sb->ival       = NULL;
-    sb->lval       = NULL;
-    sb->cval       = NULL;
-    sb->sval       = NULL;
+    sb->fval       = nullptr;
+    sb->dval       = nullptr;
+    sb->ival       = nullptr;
+    sb->lval       = nullptr;
+    sb->cval       = nullptr;
+    sb->sval       = nullptr;
     sb->fval_alloc = 0;
     sb->dval_alloc = 0;
     sb->ival_alloc = 0;
@@ -120,31 +122,31 @@ static void enxsubblock_free(t_enxsubblock *sb)
     {
         sfree(sb->fval);
         sb->fval_alloc = 0;
-        sb->fval       = NULL;
+        sb->fval       = nullptr;
     }
     if (sb->dval_alloc)
     {
         sfree(sb->dval);
         sb->dval_alloc = 0;
-        sb->dval       = NULL;
+        sb->dval       = nullptr;
     }
     if (sb->ival_alloc)
     {
         sfree(sb->ival);
         sb->ival_alloc = 0;
-        sb->ival       = NULL;
+        sb->ival       = nullptr;
     }
     if (sb->lval_alloc)
     {
         sfree(sb->lval);
         sb->lval_alloc = 0;
-        sb->lval       = NULL;
+        sb->lval       = nullptr;
     }
     if (sb->cval_alloc)
     {
         sfree(sb->cval);
         sb->cval_alloc = 0;
-        sb->cval       = NULL;
+        sb->cval       = nullptr;
     }
     if (sb->sval_alloc)
     {
@@ -159,7 +161,7 @@ static void enxsubblock_free(t_enxsubblock *sb)
         }
         sfree(sb->sval);
         sb->sval_alloc = 0;
-        sb->sval       = NULL;
+        sb->sval       = nullptr;
     }
 }
 
@@ -212,7 +214,7 @@ static void enxsubblock_alloc(t_enxsubblock *sb)
                 srenew(sb->sval, sb->nr);
                 for (i = sb->sval_alloc; i < sb->nr; i++)
                 {
-                    sb->sval[i] = NULL;
+                    sb->sval[i] = nullptr;
                 }
                 sb->sval_alloc = sb->nr;
             }
@@ -226,7 +228,7 @@ static void enxblock_init(t_enxblock *eb)
 {
     eb->id         = enxOR;
     eb->nsub       = 0;
-    eb->sub        = NULL;
+    eb->sub        = nullptr;
     eb->nsub_alloc = 0;
 }
 
@@ -241,23 +243,21 @@ static void enxblock_free(t_enxblock *eb)
         }
         sfree(eb->sub);
         eb->nsub_alloc = 0;
-        eb->sub        = NULL;
+        eb->sub        = nullptr;
     }
 }
 
 void init_enxframe(t_enxframe *fr)
 {
     fr->e_alloc = 0;
-    fr->ener    = NULL;
+    fr->ener    = nullptr;
 
     /*fr->d_alloc=0;*/
-    fr->ener = NULL;
-
     /*fr->ndisre=0;*/
 
     fr->nblock       = 0;
     fr->nblock_alloc = 0;
-    fr->block        = NULL;
+    fr->block        = nullptr;
 }
 
 
@@ -308,7 +308,7 @@ t_enxblock *find_block_id_enxframe(t_enxframe *ef, int id, t_enxblock *prev)
             return &(ef->block[i]);
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 void add_subblocks_enxblock(t_enxblock *eb, int n)
@@ -329,7 +329,7 @@ void add_subblocks_enxblock(t_enxblock *eb, int n)
 
 static void enx_warning(const char *msg)
 {
-    if (getenv("GMX_ENX_NO_FATAL") != NULL)
+    if (getenv("GMX_ENX_NO_FATAL") != nullptr)
     {
         gmx_warning(msg);
     }
@@ -347,7 +347,7 @@ static void edr_strings(XDR *xdr, gmx_bool bRead, int file_version,
     int          i;
     gmx_enxnm_t *nm;
 
-    if (*nms == NULL)
+    if (*nms == nullptr)
     {
         snew(*nms, n);
     }
@@ -359,12 +359,12 @@ static void edr_strings(XDR *xdr, gmx_bool bRead, int file_version,
             if (nm->name)
             {
                 sfree(nm->name);
-                nm->name = NULL;
+                nm->name = nullptr;
             }
             if (nm->unit)
             {
                 sfree(nm->unit);
-                nm->unit = NULL;
+                nm->unit = nullptr;
             }
         }
         if (!xdr_string(xdr, &(nm->name), STRLEN))
@@ -497,6 +497,7 @@ static gmx_bool do_eheader(ener_file_t ef, int *file_version, t_enxframe *fr,
             return FALSE;
         }
         *file_version = enx_version;
+        // cppcheck-suppress redundantPointerOp
         if (!gmx_fio_do_int(ef->fio, *file_version))
         {
             *bOK = FALSE;
@@ -746,7 +747,7 @@ void free_enxnms(int n, gmx_enxnm_t *nms)
 
 void close_enx(ener_file_t ef)
 {
-    if (ef == NULL)
+    if (ef == nullptr)
     {
         // Nothing to do
         return;
@@ -795,7 +796,7 @@ empty_file(const char *fn)
 ener_file_t open_enx(const char *fn, const char *mode)
 {
     int               nre;
-    gmx_enxnm_t      *nms          = NULL;
+    gmx_enxnm_t      *nms          = nullptr;
     int               file_version = -1;
     t_enxframe       *fr;
     gmx_bool          bWrongPrecision, bOK = TRUE;
@@ -959,7 +960,7 @@ gmx_bool do_enx(ener_file_t ef, t_enxframe *fr)
         /*d_size = fr->ndisre*(sizeof(real)*2);*/
     }
 
-    if (!do_eheader(ef, &file_version, fr, -1, NULL, &bOK))
+    if (!do_eheader(ef, &file_version, fr, -1, nullptr, &bOK))
     {
         if (bRead)
         {
@@ -1168,7 +1169,7 @@ void get_enx_state(const char *fn, real t, const gmx_groups_t *groups, t_inputre
     int          nre, nfr, i, j, ni, npcoupl;
     char         buf[STRLEN];
     const char  *bufi;
-    gmx_enxnm_t *enm = NULL;
+    gmx_enxnm_t *enm = nullptr;
     t_enxframe  *fr;
     ener_file_t  in;
 
@@ -1246,3 +1247,364 @@ void get_enx_state(const char *fn, real t, const gmx_groups_t *groups, t_inputre
     free_enxframe(fr);
     sfree(fr);
 }
+
+static real ener_tensor_diag(int n, int *ind1, int *ind2,
+                             gmx_enxnm_t *enm1,
+                             int *tensi, int i,
+                             t_energy e1[], t_energy e2[])
+{
+    int    d1, d2;
+    int    j;
+    real   prod1, prod2;
+    int    nfound;
+    size_t len;
+
+    d1 = tensi[i]/DIM;
+    d2 = tensi[i] - d1*DIM;
+
+    /* Find the diagonal elements d1 and d2 */
+    len    = std::strlen(enm1[ind1[i]].name);
+    prod1  = 1;
+    prod2  = 1;
+    nfound = 0;
+    for (j = 0; j < n; j++)
+    {
+        if (tensi[j] >= 0 &&
+            std::strlen(enm1[ind1[j]].name) == len &&
+            std::strncmp(enm1[ind1[i]].name, enm1[ind1[j]].name, len-2) == 0 &&
+            (tensi[j] == d1*DIM+d1 || tensi[j] == d2*DIM+d2))
+        {
+            prod1 *= fabs(e1[ind1[j]].e);
+            prod2 *= fabs(e2[ind2[j]].e);
+            nfound++;
+        }
+    }
+
+    if (nfound == 2)
+    {
+        return 0.5*(std::sqrt(prod1) + std::sqrt(prod2));
+    }
+    else
+    {
+        return 0;
+    }
+}
+
+static gmx_bool enernm_equal(const char *nm1, const char *nm2)
+{
+    int len1, len2;
+
+    len1 = std::strlen(nm1);
+    len2 = std::strlen(nm2);
+
+    /* Remove " (bar)" at the end of a name */
+    if (len1 > 6 && std::strcmp(nm1+len1-6, " (bar)") == 0)
+    {
+        len1 -= 6;
+    }
+    if (len2 > 6 && std::strcmp(nm2+len2-6, " (bar)") == 0)
+    {
+        len2 -= 6;
+    }
+
+    return (len1 == len2 && gmx_strncasecmp(nm1, nm2, len1) == 0);
+}
+
+static void cmp_energies(FILE *fp, int step1, int step2,
+                         t_energy e1[], t_energy e2[],
+                         gmx_enxnm_t *enm1,
+                         real ftol, real abstol,
+                         int nre, int *ind1, int *ind2, int maxener)
+{
+    int   i, ii;
+    int  *tensi, len, d1, d2;
+    real  ftol_i, abstol_i;
+
+    snew(tensi, maxener);
+    /* Check for tensor elements ending on "-XX", "-XY", ... , "-ZZ" */
+    for (i = 0; (i < maxener); i++)
+    {
+        ii       = ind1[i];
+        tensi[i] = -1;
+        len      = std::strlen(enm1[ii].name);
+        if (len > 3 && enm1[ii].name[len-3] == '-')
+        {
+            d1 = enm1[ii].name[len-2] - 'X';
+            d2 = enm1[ii].name[len-1] - 'X';
+            if (d1 >= 0 && d1 < DIM &&
+                d2 >= 0 && d2 < DIM)
+            {
+                tensi[i] = d1*DIM + d2;
+            }
+        }
+    }
+
+    for (i = 0; (i < maxener); i++)
+    {
+        /* Check if this is an off-diagonal tensor element */
+        if (tensi[i] >= 0 && tensi[i] != 0 && tensi[i] != 4 && tensi[i] != 8)
+        {
+            /* Turn on the relative tolerance check (4 is maximum relative diff.) */
+            ftol_i = 5;
+            /* Do the relative tolerance through an absolute tolerance times
+             * the size of diagonal components of the tensor.
+             */
+            abstol_i = ftol*ener_tensor_diag(nre, ind1, ind2, enm1, tensi, i, e1, e2);
+            if (debug)
+            {
+                fprintf(debug, "tensor '%s' val %f diag %f\n",
+                        enm1[i].name, e1[i].e, abstol_i/ftol);
+            }
+            if (abstol_i > 0)
+            {
+                /* We found a diagonal, we need to check with the minimum tolerance */
+                abstol_i = std::min(abstol_i, abstol);
+            }
+            else
+            {
+                /* We did not find a diagonal, ignore the relative tolerance check */
+                abstol_i = abstol;
+            }
+        }
+        else
+        {
+            ftol_i   = ftol;
+            abstol_i = abstol;
+        }
+        if (!equal_real(e1[ind1[i]].e, e2[ind2[i]].e, ftol_i, abstol_i))
+        {
+            fprintf(fp, "%-15s  step %3d:  %12g,  step %3d: %12g\n",
+                    enm1[ind1[i]].name,
+                    step1, e1[ind1[i]].e,
+                    step2, e2[ind2[i]].e);
+        }
+    }
+
+    sfree(tensi);
+}
+
+#if 0
+static void cmp_disres(t_enxframe *fr1, t_enxframe *fr2, real ftol, real abstol)
+{
+    int  i;
+    char bav[64], bt[64], bs[22];
+
+    cmp_int(stdout, "ndisre", -1, fr1->ndisre, fr2->ndisre);
+    if ((fr1->ndisre == fr2->ndisre) && (fr1->ndisre > 0))
+    {
+        sprintf(bav, "step %s: disre rav", gmx_step_str(fr1->step, bs));
+        sprintf(bt, "step %s: disre  rt", gmx_step_str(fr1->step, bs));
+        for (i = 0; (i < fr1->ndisre); i++)
+        {
+            cmp_real(stdout, bav, i, fr1->disre_rm3tav[i], fr2->disre_rm3tav[i], ftol, abstol);
+            cmp_real(stdout, bt, i, fr1->disre_rt[i], fr2->disre_rt[i], ftol, abstol);
+        }
+    }
+}
+#endif
+
+static void cmp_eblocks(t_enxframe *fr1, t_enxframe *fr2, real ftol, real abstol)
+{
+    int  i, j, k;
+    char buf[64], bs[22];
+
+    cmp_int(stdout, "nblock", -1, fr1->nblock, fr2->nblock);
+    if ((fr1->nblock == fr2->nblock) && (fr1->nblock > 0))
+    {
+        for (j = 0; (j < fr1->nblock); j++)
+        {
+            t_enxblock *b1, *b2; /* convenience vars */
+
+            b1 = &(fr1->block[j]);
+            b2 = &(fr2->block[j]);
+
+            sprintf(buf, "step %s: block[%d]", gmx_step_str(fr1->step, bs), j);
+            cmp_int(stdout, buf, -1, b1->nsub, b2->nsub);
+            cmp_int(stdout, buf, -1, b1->id, b2->id);
+
+            if ( (b1->nsub == b2->nsub) && (b1->id == b2->id) )
+            {
+                for (i = 0; i < b1->nsub; i++)
+                {
+                    t_enxsubblock *s1, *s2;
+
+                    s1 = &(b1->sub[i]);
+                    s2 = &(b2->sub[i]);
+
+                    cmp_int(stdout, buf, -1, (int)s1->type, (int)s2->type);
+                    cmp_int64(stdout, buf, s1->nr, s2->nr);
+
+                    if ((s1->type == s2->type) && (s1->nr == s2->nr))
+                    {
+                        switch (s1->type)
+                        {
+                            case xdr_datatype_float:
+                                for (k = 0; k < s1->nr; k++)
+                                {
+                                    cmp_float(stdout, buf, i,
+                                              s1->fval[k], s2->fval[k],
+                                              ftol, abstol);
+                                }
+                                break;
+                            case xdr_datatype_double:
+                                for (k = 0; k < s1->nr; k++)
+                                {
+                                    cmp_double(stdout, buf, i,
+                                               s1->dval[k], s2->dval[k],
+                                               ftol, abstol);
+                                }
+                                break;
+                            case xdr_datatype_int:
+                                for (k = 0; k < s1->nr; k++)
+                                {
+                                    cmp_int(stdout, buf, i,
+                                            s1->ival[k], s2->ival[k]);
+                                }
+                                break;
+                            case xdr_datatype_int64:
+                                for (k = 0; k < s1->nr; k++)
+                                {
+                                    cmp_int64(stdout, buf,
+                                              s1->lval[k], s2->lval[k]);
+                                }
+                                break;
+                            case xdr_datatype_char:
+                                for (k = 0; k < s1->nr; k++)
+                                {
+                                    cmp_uc(stdout, buf, i,
+                                           s1->cval[k], s2->cval[k]);
+                                }
+                                break;
+                            case xdr_datatype_string:
+                                for (k = 0; k < s1->nr; k++)
+                                {
+                                    cmp_str(stdout, buf, i,
+                                            s1->sval[k], s2->sval[k]);
+                                }
+                                break;
+                            default:
+                                gmx_incons("Unknown data type!!");
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+void comp_enx(const char *fn1, const char *fn2, real ftol, real abstol, const char *lastener)
+{
+    int            nre, nre1, nre2;
+    ener_file_t    in1, in2;
+    int            i, j, maxener, *ind1, *ind2, *have;
+    gmx_enxnm_t   *enm1 = nullptr, *enm2 = nullptr;
+    t_enxframe    *fr1, *fr2;
+    gmx_bool       b1, b2;
+
+    fprintf(stdout, "comparing energy file %s and %s\n\n", fn1, fn2);
+
+    in1 = open_enx(fn1, "r");
+    in2 = open_enx(fn2, "r");
+    do_enxnms(in1, &nre1, &enm1);
+    do_enxnms(in2, &nre2, &enm2);
+    if (nre1 != nre2)
+    {
+        fprintf(stdout, "There are %d and %d terms in the energy files\n\n",
+                nre1, nre2);
+    }
+    else
+    {
+        fprintf(stdout, "There are %d terms in the energy files\n\n", nre1);
+    }
+
+    snew(ind1, nre1);
+    snew(ind2, nre2);
+    snew(have, nre2);
+    nre = 0;
+    for (i = 0; i < nre1; i++)
+    {
+        for (j = 0; j < nre2; j++)
+        {
+            if (enernm_equal(enm1[i].name, enm2[j].name))
+            {
+                ind1[nre] = i;
+                ind2[nre] = j;
+                have[j]   = 1;
+                nre++;
+                break;
+            }
+        }
+        if (nre == 0 || ind1[nre-1] != i)
+        {
+            cmp_str(stdout, "enm", i, enm1[i].name, "-");
+        }
+    }
+    for (i = 0; i < nre2; i++)
+    {
+        if (have[i] == 0)
+        {
+            cmp_str(stdout, "enm", i, "-", enm2[i].name);
+        }
+    }
+
+    maxener = nre;
+    for (i = 0; i < nre; i++)
+    {
+        if ((lastener != nullptr) && (std::strstr(enm1[i].name, lastener) != nullptr))
+        {
+            maxener = i+1;
+            break;
+        }
+    }
+
+    fprintf(stdout, "There are %d terms to compare in the energy files\n\n",
+            maxener);
+
+    for (i = 0; i < maxener; i++)
+    {
+        cmp_str(stdout, "unit", i, enm1[ind1[i]].unit, enm2[ind2[i]].unit);
+    }
+
+    snew(fr1, 1);
+    snew(fr2, 1);
+    do
+    {
+        b1 = do_enx(in1, fr1);
+        b2 = do_enx(in2, fr2);
+        if (b1 && !b2)
+        {
+            fprintf(stdout, "\nEnd of file on %s but not on %s\n", fn2, fn1);
+        }
+        else if (!b1 && b2)
+        {
+            fprintf(stdout, "\nEnd of file on %s but not on %s\n", fn1, fn2);
+        }
+        else if (!b1 && !b2)
+        {
+            fprintf(stdout, "\nFiles read successfully\n");
+        }
+        else
+        {
+            cmp_real(stdout, "t", -1, fr1->t, fr2->t, ftol, abstol);
+            cmp_int(stdout, "step", -1, fr1->step, fr2->step);
+            /* We don't want to print the nre mismatch for every frame */
+            /* cmp_int(stdout,"nre",-1,fr1->nre,fr2->nre); */
+            if ((fr1->nre >= nre) && (fr2->nre >= nre))
+            {
+                cmp_energies(stdout, fr1->step, fr1->step, fr1->ener, fr2->ener,
+                             enm1, ftol, abstol, nre, ind1, ind2, maxener);
+            }
+            /*cmp_disres(fr1,fr2,ftol,abstol);*/
+            cmp_eblocks(fr1, fr2, ftol, abstol);
+        }
+    }
+    while (b1 && b2);
+
+    close_enx(in1);
+    close_enx(in2);
+
+    free_enxframe(fr2);
+    sfree(fr2);
+    free_enxframe(fr1);
+    sfree(fr1);
+}
index c9c9807885635aca5d040014a502d9f69f4f68d6..00e9083ec96b2f1aa89e8272519032048785aa7b 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,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.
 #define GMX_FILEIO_ENXIO_H
 
 #include "gromacs/fileio/xdr_datatype.h"
-#include "gromacs/mdtypes/state.h"
 #include "gromacs/trajectory/energy.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include "gromacs/utility/basedefinitions.h"
 
 struct gmx_groups_t;
 struct t_fileio;
 struct t_inputrec;
+class t_state;
 
 /**************************************************************
  * These are the base datatypes + functions for reading and
@@ -216,10 +213,8 @@ t_enxblock *find_block_id_enxframe(t_enxframe *ef, int id, t_enxblock *prev);
    subbblocks. */
 void add_subblocks_enxblock(t_enxblock *eb, int n);
 
-
-
-#ifdef __cplusplus
-}
-#endif
+void comp_enx(const char *fn1, const char *fn2, real ftol, real abstol,
+              const char *lastener);
+/* Compare two binary energy files */
 
 #endif
index f101cda68c645d2ad61c99f4f2c0641fe01cbec4..34eaa711b3aedd51f4864ec1aa067ce2224b748e 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 2005, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
@@ -164,9 +164,9 @@ static const char *const esp_prop[espNR] = {
 };
 
 void gmx_espresso_read_conf(const char *infile,
-                            t_topology *top, rvec x[], rvec *v, matrix box)
+                            t_symtab *symtab, char **name, t_atoms *atoms,
+                            rvec x[], rvec *v, matrix box)
 {
-    t_atoms  *atoms = &top->atoms;
     FILE     *fp;
     char      word[STRLEN], buf[STRLEN];
     int       level, r, nprop, p, i, m, molnr;
@@ -174,11 +174,20 @@ void gmx_espresso_read_conf(const char *infile,
     double    d;
     gmx_bool  bFoundParticles, bFoundProp, bFoundVariable, bMol;
 
-    // TODO: The code does not understand titles it writes...
-    top->name = put_symtab(&top->symtab, "");
+    if (name != nullptr)
+    {
+        // No title reading implemented for espresso files
+        *name = gmx_strdup("");
+    }
 
     clear_mat(box);
 
+    atoms->haveMass    = FALSE;
+    atoms->haveCharge  = FALSE;
+    atoms->haveType    = FALSE;
+    atoms->haveBState  = FALSE;
+    atoms->havePdbInfo = FALSE;
+
     fp = gmx_fio_fopen(infile, "r");
 
     bFoundParticles = FALSE;
@@ -201,7 +210,15 @@ void gmx_espresso_read_conf(const char *infile,
                     {
                         bFoundProp    = TRUE;
                         prop[nprop++] = p;
-                        /* printf("  prop[%d] = %s\n",nprop-1,esp_prop[prop[nprop-1]]); */
+                        if (p == espQ)
+                        {
+                            atoms->haveCharge = TRUE;
+                        }
+
+                        if (debug)
+                        {
+                            fprintf(debug, "  prop[%d] = %s\n", nprop-1, esp_prop[prop[nprop-1]]);
+                        }
                     }
                 }
                 if (!bFoundProp && word[0] != '}')
@@ -249,7 +266,7 @@ void gmx_espresso_read_conf(const char *infile,
                                 break;
                             case espTYPE:
                                 r                   = get_espresso_word(fp, word);
-                                atoms->atom[i].type = std::strtol(word, NULL, 10);
+                                atoms->atom[i].type = std::strtol(word, nullptr, 10);
                                 break;
                             case espQ:
                                 r = get_espresso_word(fp, word);
@@ -273,7 +290,7 @@ void gmx_espresso_read_conf(const char *infile,
                                 break;
                             case espMOLECULE:
                                 r     = get_espresso_word(fp, word);
-                                molnr = std::strtol(word, NULL, 10);
+                                molnr = std::strtol(word, nullptr, 10);
                                 if (i == 0 ||
                                     atoms->resinfo[atoms->atom[i-1].resind].nr != molnr)
                                 {
@@ -293,13 +310,13 @@ void gmx_espresso_read_conf(const char *infile,
                     }
                     /* Generate an atom name from the particle type */
                     sprintf(buf, "T%hu", atoms->atom[i].type);
-                    atoms->atomname[i] = put_symtab(&top->symtab, buf);
+                    atoms->atomname[i] = put_symtab(symtab, buf);
                     if (bMol)
                     {
                         if (i == 0 || atoms->atom[i].resind != atoms->atom[i-1].resind)
                         {
                             atoms->resinfo[atoms->atom[i].resind].name =
-                                put_symtab(&top->symtab, "MOL");
+                                put_symtab(symtab, "MOL");
                         }
                     }
                     else
@@ -316,7 +333,7 @@ void gmx_espresso_read_conf(const char *infile,
                             sprintf(buf, "T%c%c",
                                     'A'+atoms->atom[i].type/26, 'A'+atoms->atom[i].type%26);
                         }
-                        t_atoms_set_resinfo(atoms, i, &top->symtab, buf, i, ' ', 0, ' ');
+                        t_atoms_set_resinfo(atoms, i, symtab, buf, i, ' ', 0, ' ');
                     }
 
                     if (r == 3)
index b0d1fcba37c8d5dcb7f81a3ece7f11ea1302feb7..3de1138bcdaaad4bbb01505c05e94d0e66631e87 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 2005, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
 #include "gromacs/math/vectypes.h"
 
 struct t_atoms;
-struct t_topology;
+struct t_symtab;
 
 void gmx_espresso_read_conf(const char *infile,
-                            t_topology *top, rvec x[], rvec *v, matrix box);
+                            t_symtab *symtab, char **name, t_atoms *atoms,
+                            rvec x[], rvec *v, matrix box);
+/* If name is not nullptr, gmx_strdup the title string into
+ * it. Reading a title from espresso format is not , so this will
+ * always be an empty string. */
 
 int get_espresso_coordnum(const char *infile);
 
index 2002498f344eb3a0493f2ec24207499497c09ed6..f558370d0d82693705ac0f98757cab34798d3b5e 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,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.
@@ -114,16 +114,16 @@ static const t_deffile deffile[efNR] =
     { eftASC, ".mdp", "grompp", "-f", "grompp input file with MD parameters" },
     { eftGEN, ".???", "traj", "-f", "Trajectory", NTRXS, trxs },
     { eftGEN, ".???", "trajout", "-f", "Trajectory", NTROS, tros },
-    { eftGEN, ".???", "traj", NULL,
+    { eftGEN, ".???", "traj", nullptr,
       "Full precision trajectory", NTRNS, trns },
-    { eftXDR, ".trr", "traj", NULL, "Trajectory in portable xdr format" },
-    { eftGEN, ".???", "traj_comp", NULL,
+    { eftXDR, ".trr", "traj", nullptr, "Trajectory in portable xdr format" },
+    { eftGEN, ".???", "traj_comp", nullptr,
       "Compressed trajectory (tng format or portable xdr format)", NTRCOMPRESSED, trcompressed},
-    { eftXDR, ".xtc", "traj", NULL,
+    { eftXDR, ".xtc", "traj", nullptr,
       "Compressed trajectory (portable xdr format): xtc" },
-    { eftTNG, ".tng", "traj", NULL,
+    { eftTNG, ".tng", "traj", nullptr,
       "Trajectory file (tng format)" },
-    { eftXDR, ".edr", "ener",   NULL, "Energy file"},
+    { eftXDR, ".edr", "ener",   nullptr, "Energy file"},
     { eftGEN, ".???", "conf", "-c", "Structure file", NSTXS, stxs },
     { eftGEN, ".???", "out", "-o", "Structure file", NSTOS, stos },
     { eftASC, ".gro", "conf", "-c", "Coordinate file in Gromos-87 format" },
@@ -139,24 +139,24 @@ static const t_deffile deffile[efNR] =
     { eftASC, ".out", "hello",  "-o", "Generic output file"},
     { eftASC, ".ndx", "index",  "-n", "Index file", },
     { eftASC, ".top", "topol",  "-p", "Topology file"},
-    { eftASC, ".itp", "topinc", NULL, "Include file for topology"},
+    { eftASC, ".itp", "topinc", nullptr, "Include file for topology"},
     { eftGEN, ".???", "topol", "-s", "Structure+mass(db)", NTPSS, tpss },
     { eftXDR, ".tpr", "topol",  "-s", "Portable xdr run input file"},
     { eftASC, ".tex", "doc",    "-o", "LaTeX file"},
-    { eftASC, ".rtp", "residue", NULL, "Residue Type file used by pdb2gmx" },
-    { eftASC, ".atp", "atomtp", NULL, "Atomtype file used by pdb2gmx" },
-    { eftASC, ".hdb", "polar",  NULL, "Hydrogen data base"},
-    { eftASC, ".dat", "nnnice", NULL, "Generic data file"},
-    { eftASC, ".dlg", "user",   NULL, "Dialog Box data for ngmx"},
-    { eftASC, ".map", "ss", NULL, "File that maps matrix data to colors" },
-    { eftASC, ".eps", "plot", NULL, "Encapsulated PostScript (tm) file" },
-    { eftASC, ".mat", "ss",     NULL, "Matrix Data file"},
-    { eftASC, ".m2p", "ps",     NULL, "Input file for mat2ps"},
+    { eftASC, ".rtp", "residue", nullptr, "Residue Type file used by pdb2gmx" },
+    { eftASC, ".atp", "atomtp", nullptr, "Atomtype file used by pdb2gmx" },
+    { eftASC, ".hdb", "polar",  nullptr, "Hydrogen data base"},
+    { eftASC, ".dat", "nnnice", nullptr, "Generic data file"},
+    { eftASC, ".dlg", "user",   nullptr, "Dialog Box data for ngmx"},
+    { eftASC, ".map", "ss", nullptr, "File that maps matrix data to colors" },
+    { eftASC, ".eps", "plot", nullptr, "Encapsulated PostScript (tm) file" },
+    { eftASC, ".mat", "ss",     nullptr, "Matrix Data file"},
+    { eftASC, ".m2p", "ps",     nullptr, "Input file for mat2ps"},
     { eftXDR, ".mtx", "hessian", "-m", "Hessian matrix"},
-    { eftASC, ".edi", "sam",    NULL, "ED sampling input"},
-    { eftASC, ".cub", "pot",  NULL, "Gaussian cube file" },
-    { eftASC, ".xpm", "root", NULL, "X PixMap compatible matrix file" },
-    { eftASC, "", "rundir", NULL, "Run directory" }
+    { eftASC, ".edi", "sam",    nullptr, "ED sampling input"},
+    { eftASC, ".cub", "pot",  nullptr, "Gaussian cube file" },
+    { eftASC, ".xpm", "root", nullptr, "X PixMap compatible matrix file" },
+    { eftASC, "", "rundir", nullptr, "Run directory" }
 };
 
 const char *ftp2ext(int ftp)
@@ -229,7 +229,7 @@ const int *ftp2generic_list(int ftp)
     }
     else
     {
-        return 0;
+        return nullptr;
     }
 }
 
@@ -271,7 +271,7 @@ const char *ftp2defnm(int ftp)
     }
     else
     {
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -283,7 +283,7 @@ const char *ftp2defopt(int ftp)
     }
     else
     {
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -310,7 +310,7 @@ int fn2ftp(const char *fn)
 
     for (i = 0; (i < efNR); i++)
     {
-        if ((eptr = deffile[i].ext) != NULL)
+        if ((eptr = deffile[i].ext) != nullptr)
         {
             if (gmx_strcasecmp(feptr, eptr) == 0)
             {
index eafc2ede65fec231f02dc5dc97610caac2d8c3fa..208c42d9cc388d0344286c1c75005561262f5d0d 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,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.
@@ -48,6 +48,7 @@
 #include "gromacs/trajectory/trajectoryframe.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
 
 #define CHAR_SHIFT 24
@@ -65,7 +66,19 @@ static int read_g96_pos(char line[], t_symtab *symtab,
 
     nwanted = fr->natoms;
 
+    if (fr->atoms != nullptr)
+    {
+        GMX_RELEASE_ASSERT(symtab != nullptr, "Reading a conformation from a g96 format with atom data requires a valid symbol table");
+    }
     atoms = fr->atoms;
+    if (atoms != nullptr)
+    {
+        atoms->haveMass    = FALSE;
+        atoms->haveCharge  = FALSE;
+        atoms->haveType    = FALSE;
+        atoms->haveBState  = FALSE;
+        atoms->havePdbInfo = FALSE;
+    }
 
     natoms = 0;
 
@@ -215,7 +228,7 @@ static int read_g96_vel(char line[], FILE *fp, const char *infile,
     return natoms;
 }
 
-int read_g96_conf(FILE *fp, const char *infile, t_trxframe *fr,
+int read_g96_conf(FILE *fp, const char *infile, char **name, t_trxframe *fr,
                   t_symtab *symtab, char *line)
 {
     gmx_bool   bAtStart, bTime, bAtoms, bPos, bVel, bBox, bEnd, bFinished;
@@ -230,14 +243,15 @@ int read_g96_conf(FILE *fp, const char *infile, t_trxframe *fr,
 
     if (bAtStart)
     {
-        while (!fr->bTitle && fgets2(line, STRLEN, fp))
+        bool foundTitle = false;
+        while (!foundTitle && fgets2(line, STRLEN, fp))
         {
-            fr->bTitle = (std::strcmp(line, "TITLE") == 0);
+            foundTitle = (std::strcmp(line, "TITLE") == 0);
         }
-        if (fr->title == NULL)
+        fgets2(line, STRLEN, fp);
+        if (name != nullptr)
         {
-            fgets2(line, STRLEN, fp);
-            fr->title = gmx_strdup(line);
+            *name = gmx_strdup(line);
         }
         bEnd = FALSE;
         while (!bEnd && fgets2(line, STRLEN, fp))
@@ -267,7 +281,7 @@ int read_g96_conf(FILE *fp, const char *infile, t_trxframe *fr,
                 fr->bTime = bTime;
                 do
                 {
-                    bFinished = (fgets2(line, STRLEN, fp) == NULL);
+                    bFinished = (fgets2(line, STRLEN, fp) == nullptr);
                 }
                 while (!bFinished && (line[0] == '#'));
                 sscanf(line, "%15" GMX_SCNd64 "%15lf", &(fr->step), &db1);
@@ -336,7 +350,7 @@ int read_g96_conf(FILE *fp, const char *infile, t_trxframe *fr,
     return natoms;
 }
 
-void write_g96_conf(FILE *out, const t_trxframe *fr,
+void write_g96_conf(FILE *out, const char *title, const t_trxframe *fr,
                     int nindex, const int *index)
 {
     t_atoms *atoms;
@@ -353,10 +367,7 @@ void write_g96_conf(FILE *out, const t_trxframe *fr,
         nout = fr->natoms;
     }
 
-    if (fr->bTitle)
-    {
-        fprintf(out, "TITLE\n%s\nEND\n", fr->title);
-    }
+    fprintf(out, "TITLE\n%s\nEND\n", title);
     if (fr->bStep || fr->bTime)
     {
         /* Officially the time format is %15.9, which is not enough for 10 ns */
index 1f4a8f6572410b62cbcb11ed853884bc9a9ce9c0..b33d55cdbc0cb8bd37c7b549303b69e5cc0f9535 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,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.
@@ -47,7 +47,7 @@ extern "C" {
 struct t_symtab;
 struct t_trxframe;
 
-int read_g96_conf(FILE *fp, const char *infile, struct t_trxframe *fr,
+int read_g96_conf(FILE *fp, const char *infile, char **name, struct t_trxframe *fr,
                   struct t_symtab *symtab, char *line);
 /* read a Gromos96 coordinate or trajectory file,                       *
  * returns the number of atoms                                          *
@@ -56,9 +56,13 @@ int read_g96_conf(FILE *fp, const char *infile, struct t_trxframe *fr,
  * nwanted is the number of wanted coordinates,                         *
  * set this to -1 if you want to know the number of atoms in the file   *
  * title, atoms, x, v can all be NULL, in which case they won't be read *
- * line holds the previous line for trajectory reading                  */
+ * line holds the previous line for trajectory reading                  *
+ *
+ * symtab only needs to be valid if fr->atoms is valid
+ *
+ * If name is not nullptr, gmx_strdup the first g96 title string into it. */
 
-void write_g96_conf(FILE *out, const t_trxframe *fr, int nindex, const int *index);
+void write_g96_conf(FILE *out, const char *title, const t_trxframe *fr, int nindex, const int *index);
 /* write a Gromos96 coordinate file or trajectory frame *
  * index can be NULL                                    */
 
index 0d3b70bb2587cbcb57698eff9488e32b3eb74f96..a9f4253050f98403c668c79885ec991426c00a3b 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,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.
@@ -71,9 +71,9 @@ void gmx_fio_setprecision(t_fileio *fio, gmx_bool bDouble)
 
 XDR *gmx_fio_getxdr(t_fileio *fio)
 {
-    XDR *ret = NULL;
+    XDR *ret = nullptr;
     gmx_fio_lock(fio);
-    GMX_RELEASE_ASSERT( fio->xdr != NULL, "Implementation error: NULL XDR pointers");
+    GMX_RELEASE_ASSERT( fio->xdr != nullptr, "Implementation error: NULL XDR pointers");
     ret = fio->xdr;
     gmx_fio_unlock(fio);
     return ret;
@@ -117,7 +117,7 @@ static gmx_bool do_xdr(t_fileio *fio, void *item, int nitem, int eio,
     double          d = 0;
     float           f = 0;
 
-    GMX_RELEASE_ASSERT( fio->xdr != NULL, "Implementation error: NULL XDR pointers");
+    GMX_RELEASE_ASSERT( fio->xdr != nullptr, "Implementation error: NULL XDR pointers");
     gmx_fio_check_nitem(eio, nitem, srcfile, line);
     switch (eio)
     {
@@ -264,7 +264,7 @@ static gmx_bool do_xdr(t_fileio *fio, void *item, int nitem, int eio,
             }
             break;
         case eioNRVEC:
-            ptr = NULL;
+            ptr = nullptr;
             res = 1;
             for (j = 0; (j < nitem) && res; j++)
             {
@@ -672,3 +672,62 @@ gmx_bool gmx_fio_ndoe_string(t_fileio *fio, char *item[], int n,
     gmx_fio_unlock(fio);
     return ret;
 }
+
+namespace gmx
+{
+
+bool FileIOXdrSerializer::reading() const
+{
+    return fio_->bRead;
+}
+
+void FileIOXdrSerializer::doBool(bool *value)
+{
+    gmx_bool v = *value;
+    gmx_fio_do_gmx_bool(fio_, v);
+    *value = v;
+}
+
+void FileIOXdrSerializer::doUChar(unsigned char *value)
+{
+    gmx_fio_do_uchar(fio_, *value);
+}
+
+void FileIOXdrSerializer::doInt(int *value)
+{
+    gmx_fio_do_int(fio_, *value);
+}
+
+void FileIOXdrSerializer::doInt64(gmx_int64_t *value)
+{
+    gmx_fio_do_int64(fio_, *value);
+}
+
+void FileIOXdrSerializer::doFloat(float *value)
+{
+    gmx_fio_do_float(fio_, *value);
+}
+
+void FileIOXdrSerializer::doDouble(double *value)
+{
+    gmx_fio_do_double(fio_, *value);
+}
+
+void FileIOXdrSerializer::doString(std::string *value)
+{
+    // TODO: Use an arbitrary length buffer (but that is not supported in
+    // gmx_fio, either).
+    char buf[STRLEN];
+    if (!fio_->bRead)
+    {
+        std::strncpy(buf, value->c_str(), STRLEN);
+        buf[STRLEN-1] = 0;
+    }
+    gmx_fio_do_string(fio_, buf);
+    if (fio_->bRead)
+    {
+        *value = buf;
+    }
+}
+
+} // namespace gmx
index 982724d64fe4deeffafd0cc561531b5d832d81c2..6980cc04a365678fdae1a5fce7279a3a30bd0244 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,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.
 #ifndef GMX_FILEIO_GMXFIO_XDR_H
 #define GMX_FILEIO_GMXFIO_XDR_H
 
+#include <string>
+
 #include "gromacs/fileio/xdrf.h"
 #include "gromacs/math/vectypes.h"
 #include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/iserializer.h"
 #include "gromacs/utility/real.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct t_fileio;
 
 void gmx_fio_setprecision(struct t_fileio *fio, gmx_bool bDouble);
@@ -136,8 +135,28 @@ gmx_bool gmx_fio_ndoe_string(struct t_fileio *fio, char *item[], int n,
 #define gmx_fio_ndo_ivec(fio, item, n)              gmx_fio_ndoe_ivec(fio, item, n, (#item), __FILE__, __LINE__)
 #define gmx_fio_ndo_string(fio, item, n)            gmx_fio_ndoe_string(fio, item, n, (#item), __FILE__, __LINE__)
 
-#ifdef __cplusplus
-}
-#endif
+namespace gmx
+{
+
+class FileIOXdrSerializer : public ISerializer
+{
+    public:
+        explicit FileIOXdrSerializer(t_fileio *fio) : fio_(fio) {}
+
+        virtual bool reading() const;
+
+        virtual void doBool(bool *value);
+        virtual void doUChar(unsigned char *value);
+        virtual void doInt(int *value);
+        virtual void doInt64(gmx_int64_t *value);
+        virtual void doFloat(float *value);
+        virtual void doDouble(double *value);
+        virtual void doString(std::string *value);
+
+    private:
+        t_fileio *fio_;
+};
+
+} // namespace gmx
 
 #endif
index e632956a8dcdb9adc0cdd7305a7c86368715683a..485abae3a9a74447acce2f0cff6477b173726acf 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,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.
@@ -57,6 +57,7 @@
 #include "gromacs/fileio/md5.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
+#include "gromacs/utility/mutex.h"
 #include "gromacs/utility/smalloc.h"
 
 #include "gmxfio-impl.h"
@@ -67,7 +68,7 @@
 
 /* the list of open files is a linked list, with a dummy element at its head;
        it is initialized when the first file is opened. */
-static t_fileio *open_files = NULL;
+static t_fileio *open_files = nullptr;
 
 
 /* this mutex locks the open_files structure so that no two threads can
@@ -79,7 +80,9 @@ static t_fileio *open_files = NULL;
    opening and closing of files, or during global operations like
    iterating along all open files. All these cases should be rare
    during the simulation. */
-static tMPI_Thread_mutex_t open_file_mutex = TMPI_THREAD_MUTEX_INITIALIZER;
+static gmx::Mutex open_file_mutex;
+
+using Lock = gmx::lock_guard<gmx::Mutex>;
 
 /******************************************************************
  *
@@ -117,8 +120,8 @@ static void gmx_fio_make_dummy(void)
     if (!open_files)
     {
         snew(open_files, 1);
-        open_files->fp   = NULL;
-        open_files->fn   = NULL;
+        open_files->fp   = nullptr;
+        open_files->fn   = nullptr;
         open_files->next = open_files;
         open_files->prev = open_files;
         tMPI_Lock_init(&(open_files->mtx));
@@ -142,10 +145,7 @@ static void gmx_fio_make_dummy(void)
 static void gmx_fio_insert(t_fileio *fio)
 {
     t_fileio *prev;
-    /* first lock the big open_files mutex. */
-    tMPI_Thread_mutex_lock(&open_file_mutex);
-    /* now check whether the dummy element has been allocated,
-       and allocate it if it hasn't */
+    Lock      openFilesLock(open_file_mutex);
     gmx_fio_make_dummy();
 
     /* and lock the fio we got and the list's head **/
@@ -171,9 +171,6 @@ static void gmx_fio_insert(t_fileio *fio)
     }
     gmx_fio_unlock(open_files);
     gmx_fio_unlock(fio);
-
-    /* now unlock the big open_files mutex.  */
-    tMPI_Thread_mutex_unlock(&open_file_mutex);
 }
 
 /* remove a t_fileio into the list. We assume the fio is locked, and we leave
@@ -199,14 +196,11 @@ static void gmx_fio_remove(t_fileio *fio)
 
 
 /* get the first open file, or NULL if there is none.
-   Returns a locked fio. */
+   Returns a locked fio. Assumes open_files_mutex is locked. */
 static t_fileio *gmx_fio_get_first(void)
 {
     t_fileio *ret;
-    /* first lock the big open_files mutex and the dummy's mutex */
 
-    /* first lock the big open_files mutex. */
-    tMPI_Thread_mutex_lock(&open_file_mutex);
     gmx_fio_make_dummy();
 
     gmx_fio_lock(open_files);
@@ -217,7 +211,7 @@ static t_fileio *gmx_fio_get_first(void)
     if (ret == open_files)
     {
         /* after this, the open_file pointer should never change */
-        ret = NULL;
+        ret = nullptr;
     }
     else
     {
@@ -230,7 +224,8 @@ static t_fileio *gmx_fio_get_first(void)
 }
 
 /* get the next open file, or NULL if there is none.
-   Unlocks the previous fio and locks the next one. */
+   Unlocks the previous fio and locks the next one.
+   Assumes open_file_mutex is locked. */
 static t_fileio *gmx_fio_get_next(t_fileio *fio)
 {
     t_fileio *ret;
@@ -239,8 +234,7 @@ static t_fileio *gmx_fio_get_next(t_fileio *fio)
     /* check if that was the last one */
     if (fio->next == open_files)
     {
-        ret = NULL;
-        tMPI_Thread_mutex_unlock(&open_file_mutex);
+        ret = nullptr;
     }
     else
     {
@@ -251,11 +245,10 @@ static t_fileio *gmx_fio_get_next(t_fileio *fio)
     return ret;
 }
 
-/* Stop looping through the open_files.  Unlocks the global lock. */
+/* Stop looping through the open_files. Assumes open_file_mutex is locked. */
 static void gmx_fio_stop_getting_next(t_fileio *fio)
 {
     gmx_fio_unlock(fio);
-    tMPI_Thread_mutex_unlock(&open_file_mutex);
 }
 
 
@@ -268,7 +261,7 @@ static void gmx_fio_stop_getting_next(t_fileio *fio)
  *****************************************************************/
 t_fileio *gmx_fio_open(const char *fn, const char *mode)
 {
-    t_fileio *fio = NULL;
+    t_fileio *fio = nullptr;
     char      newmode[5];
     gmx_bool  bRead, bReadWrite;
 
@@ -312,8 +305,8 @@ t_fileio *gmx_fio_open(const char *fn, const char *mode)
     tMPI_Lock_init(&(fio->mtx));
     bRead      = (newmode[0] == 'r' && newmode[1] != '+');
     bReadWrite = (newmode[1] == '+');
-    fio->fp    = NULL;
-    fio->xdr   = NULL;
+    fio->fp    = nullptr;
+    fio->xdr   = nullptr;
     if (fn)
     {
         if (fn2ftp(fn) == efTNG)
@@ -365,13 +358,13 @@ static int gmx_fio_close_locked(t_fileio *fio)
 {
     int rc = 0;
 
-    if (fio->xdr != NULL)
+    if (fio->xdr != nullptr)
     {
         xdr_destroy(fio->xdr);
         sfree(fio->xdr);
     }
 
-    if (fio->fp != NULL)
+    if (fio->fp != nullptr)
     {
         rc = gmx_ffclose(fio->fp); /* fclose returns 0 if happy */
 
@@ -382,11 +375,9 @@ static int gmx_fio_close_locked(t_fileio *fio)
 
 int gmx_fio_close(t_fileio *fio)
 {
-    int rc = 0;
+    int  rc = 0;
 
-    /* first lock the big open_files mutex. */
-    /* We don't want two processes operating on the list at the same time */
-    tMPI_Thread_mutex_lock(&open_file_mutex);
+    Lock openFilesLock(open_file_mutex);
 
     gmx_fio_lock(fio);
     /* first remove it from the list */
@@ -397,8 +388,6 @@ int gmx_fio_close(t_fileio *fio)
     sfree(fio->fn);
     sfree(fio);
 
-    tMPI_Thread_mutex_unlock(&open_file_mutex);
-
     return rc;
 }
 
@@ -407,10 +396,10 @@ int gmx_fio_fp_close(t_fileio *fio)
 {
     int rc = 0;
     gmx_fio_lock(fio);
-    if (fio->xdr == NULL)
+    if (fio->xdr == nullptr)
     {
         rc      = gmx_ffclose(fio->fp); /* fclose returns 0 if happy */
-        fio->fp = NULL;
+        fio->fp = nullptr;
     }
     gmx_fio_unlock(fio);
 
@@ -435,6 +424,7 @@ int gmx_fio_fclose(FILE *fp)
     t_fileio *cur;
     int       rc    = -1;
 
+    Lock      openFilesLock(open_file_mutex);
     cur = gmx_fio_get_first();
     while (cur)
     {
@@ -597,6 +587,7 @@ int gmx_fio_get_output_file_positions(gmx_file_position_t **p_outputfiles,
     nalloc = 100;
     snew(outputfiles, nalloc);
 
+    Lock openFilesLock(open_file_mutex);
     cur = gmx_fio_get_first();
     while (cur)
     {
@@ -712,9 +703,10 @@ int gmx_fio_fsync(t_fileio *fio)
 
 t_fileio *gmx_fio_all_output_fsync(void)
 {
-    t_fileio *ret = NULL;
+    t_fileio *ret = nullptr;
     t_fileio *cur;
 
+    Lock      openFilesLock(open_file_mutex);
     cur = gmx_fio_get_first();
     while (cur)
     {
@@ -778,7 +770,7 @@ int gmx_fio_seek(t_fileio* fio, gmx_off_t fpos)
 
 FILE *gmx_fio_getfp(t_fileio *fio)
 {
-    FILE *ret = NULL;
+    FILE *ret = nullptr;
 
     gmx_fio_lock(fio);
     if (fio->fp)
index 9b4e9f30585a15032d06cd8f02e6aaf2f6f59d9d..08fa47ddc896032a884c7dac141862d93bb3e9fa 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,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.
@@ -116,6 +116,12 @@ static gmx_bool get_w_conf(FILE *in, const char *infile, char *title,
                 " (%d)\n", natoms, atoms->nr);
     }
 
+    atoms->haveMass    = FALSE;
+    atoms->haveCharge  = FALSE;
+    atoms->haveType    = FALSE;
+    atoms->haveBState  = FALSE;
+    atoms->havePdbInfo = FALSE;
+
     bFirst = TRUE;
 
     bVel = FALSE;
@@ -126,7 +132,7 @@ static gmx_bool get_w_conf(FILE *in, const char *infile, char *title,
     /* just pray the arrays are big enough */
     for (i = 0; (i < natoms); i++)
     {
-        if ((fgets2(line, STRLEN, in)) == NULL)
+        if ((fgets2(line, STRLEN, in)) == nullptr)
         {
             gmx_fatal(FARGS, "Unexpected end of file in file %s at line %d",
                       infile, i+2);
@@ -142,12 +148,12 @@ static gmx_bool get_w_conf(FILE *in, const char *infile, char *title,
         {
             bFirst = FALSE;
             p1     = strchr(line, '.');
-            if (p1 == NULL)
+            if (p1 == nullptr)
             {
                 gmx_fatal(FARGS, "A coordinate in file %s does not contain a '.'", infile);
             }
             p2 = strchr(&p1[1], '.');
-            if (p2 == NULL)
+            if (p2 == nullptr)
             {
                 gmx_fatal(FARGS, "A coordinate in file %s does not contain a '.'", infile);
             }
@@ -155,7 +161,7 @@ static gmx_bool get_w_conf(FILE *in, const char *infile, char *title,
             *ndec = ddist - 5;
 
             p3 = strchr(&p2[1], '.');
-            if (p3 == NULL)
+            if (p3 == nullptr)
             {
                 gmx_fatal(FARGS, "A coordinate in file %s does not contain a '.'", infile);
             }
@@ -302,13 +308,17 @@ static gmx_bool get_w_conf(FILE *in, const char *infile, char *title,
 }
 
 void gmx_gro_read_conf(const char *infile,
-                       t_topology *top, rvec x[], rvec *v, matrix box)
+                       t_symtab *symtab, char **name, t_atoms *atoms,
+                       rvec x[], rvec *v, matrix box)
 {
     FILE *in = gmx_fio_fopen(infile, "r");
     int   ndec;
     char  title[STRLEN];
-    get_w_conf(in, infile, title, &top->symtab, &top->atoms, &ndec, x, v, box);
-    top->name = put_symtab(&top->symtab, title);
+    get_w_conf(in, infile, title, symtab, atoms, &ndec, x, v, box);
+    if (name != nullptr)
+    {
+        *name = gmx_strdup(title);
+    }
     gmx_fio_fclose(in);
 }
 
@@ -352,8 +362,6 @@ gmx_bool gro_next_x_or_v(FILE *status, t_trxframe *fr)
     {
         fr->prec *= 10;
     }
-    fr->title  = title;
-    fr->bTitle = TRUE;
     fr->bX     = TRUE;
     fr->bBox   = TRUE;
 
@@ -362,7 +370,7 @@ gmx_bool gro_next_x_or_v(FILE *status, t_trxframe *fr)
     sfree(atoms.atomname);
     done_symtab(&symtab);
 
-    if ((p = strstr(title, "t=")) != NULL)
+    if ((p = strstr(title, "t=")) != nullptr)
     {
         p += 2;
         if (sscanf(p, "%lf", &tt) == 1)
@@ -394,8 +402,6 @@ int gro_first_x_or_v(FILE *status, t_trxframe *fr)
     get_coordnum_fp(status, title, &fr->natoms);
     frewind(status);
     fprintf(stderr, " '%s', %d atoms.\n", title, fr->natoms);
-    fr->bTitle = TRUE;
-    fr->title  = title;
     if (fr->natoms == 0)
     {
         gmx_file("No coordinates in gro file");
@@ -448,7 +454,7 @@ void write_hconf_indexed_p(FILE *out, const char *title, const t_atoms *atoms,
     fprintf(out, "%s\n", (title && title[0]) ? title : gmx::bromacs().c_str());
     fprintf(out, "%5d\n", nx);
 
-    const char *format = get_hconf_format(v != NULL);
+    const char *format = get_hconf_format(v != nullptr);
 
     for (i = 0; (i < nx); i++)
     {
@@ -500,13 +506,13 @@ void write_hconf_mtop(FILE *out, const char *title, gmx_mtop_t *mtop,
 {
     int                     i, resnr;
     gmx_mtop_atomloop_all_t aloop;
-    t_atom                 *atom;
+    const t_atom           *atom;
     char                   *atomname, *resname;
 
     fprintf(out, "%s\n", (title && title[0]) ? title : gmx::bromacs().c_str());
     fprintf(out, "%5d\n", mtop->natoms);
 
-    const char *format = get_hconf_format(v != NULL);
+    const char *format = get_hconf_format(v != nullptr);
 
     aloop = gmx_mtop_atomloop_all_init(mtop);
     while (gmx_mtop_atomloop_all_next(aloop, &i, &atom))
index 3391e7df3dd44e11a1982d22a255c630e938c63f..82fa543c575eeecee3d33dbfa884f0dc7267c97d 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,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.
@@ -48,12 +48,14 @@ extern "C" {
 
 struct gmx_mtop_t;
 struct t_atoms;
-struct t_topology;
+struct t_symtab;
 struct t_trxframe;
 
 void get_coordnum(const char *infile, int *natoms);
 void gmx_gro_read_conf(const char *infile,
-                       struct t_topology *top, rvec x[], rvec *v, matrix box);
+                       t_symtab *symtab, char **name, t_atoms *atoms,
+                       rvec x[], rvec *v, matrix box);
+/* If name is not nullptr, gmx_strdup the title string into it. */
 
 gmx_bool gro_next_x_or_v(FILE *status, struct t_trxframe *fr);
 int gro_first_x_or_v(FILE *status, struct t_trxframe *fr);
index ceabe761ecb64e41b7aee6cb144a68d091dc71d9..b6d17c649ad7c5f604d31367597f70668414c89a 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,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.
@@ -396,8 +396,8 @@ static void receiveints(int buf[], const int num_of_ints, int num_of_bits,
 
 int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
 {
-    int     *ip  = NULL;
-    int     *buf = NULL;
+    int     *ip  = nullptr;
+    int     *buf = nullptr;
     gmx_bool bRead;
 
     /* preallocate a small buffer and ip on the stack - if we need more
@@ -468,7 +468,7 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
             bufsize        = static_cast<int>(size3 * 1.2);
             ip             = reinterpret_cast<int *>(malloc(size3 * sizeof(*ip)));
             buf            = reinterpret_cast<int *>(malloc(bufsize * sizeof(*buf)));
-            if (ip == NULL || buf == NULL)
+            if (ip == nullptr || buf == nullptr)
             {
                 fprintf(stderr, "malloc failed\n");
                 exit(1);
@@ -814,7 +814,7 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
             bufsize        = static_cast<int>(size3 * 1.2);
             ip             = reinterpret_cast<int *>(malloc(size3 * sizeof(*ip)));
             buf            = reinterpret_cast<int *>(malloc(bufsize * sizeof(*buf)));
-            if (ip == NULL || buf == NULL)
+            if (ip == nullptr || buf == nullptr)
             {
                 fprintf(stderr, "malloc failed\n");
                 exit(1);
index 4fb86f27f1f8d26d84e664e6bd19bb3c529b2b5d..8bf6934e41624fb113aeb7540d747d107246e7d0 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,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.
@@ -44,6 +44,7 @@
 #include <cstring>
 
 #include <algorithm>
+#include <string>
 
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/math/utilities.h"
@@ -95,7 +96,7 @@ void done_matrix(int nx, real ***m)
         sfree((*m)[i]);
     }
     sfree(*m);
-    *m = NULL;
+    *m = nullptr;
 }
 
 gmx_bool matelmt_cmp(t_xpmelmt e1, t_xpmelmt e2)
@@ -126,7 +127,7 @@ int getcmap(FILE *in, const char *fn, t_mapping **map)
     double     r, g, b;
     t_mapping *m;
 
-    if (fgets2(line, STRLEN-1, in) == NULL)
+    if (fgets2(line, STRLEN-1, in) == nullptr)
     {
         gmx_fatal(FARGS, "Not enough lines in colormap file %s"
                   "(just wanted to read number of entries)", fn);
@@ -135,7 +136,7 @@ int getcmap(FILE *in, const char *fn, t_mapping **map)
     snew(m, n);
     for (i = 0; (i < n); i++)
     {
-        if (fgets2(line, STRLEN-1, in) == NULL)
+        if (fgets2(line, STRLEN-1, in) == nullptr)
         {
             gmx_fatal(FARGS, "Not enough lines in colormap file %s"
                       "(should be %d, found only %d)", fn, n+1, i);
@@ -226,7 +227,7 @@ static char *line2string(char **line)
 {
     int i;
 
-    if (*line != NULL)
+    if (*line != nullptr)
     {
         while (((*line)[0] != '\"' ) && ( (*line)[0] != '\0' ))
         {
@@ -235,7 +236,7 @@ static char *line2string(char **line)
 
         if ((*line)[0] != '\"')
         {
-            return NULL;
+            return nullptr;
         }
         (*line)++;
 
@@ -247,7 +248,7 @@ static char *line2string(char **line)
 
         if ((*line)[i] != '\"')
         {
-            *line = NULL;
+            *line = nullptr;
         }
         else
         {
@@ -273,7 +274,7 @@ static void parsestring(char *line, const char *label, char *string)
 static void read_xpm_entry(FILE *in, t_matrix *mm)
 {
     t_mapping   *map;
-    char        *line_buf = NULL, *line = NULL, *str, buf[256] = {0};
+    char        *line_buf = nullptr, *line = nullptr, *str, buf[256] = {0};
     int          i, m, col_len, nch = 0, n_axis_x, n_axis_y, llmax;
     int          llalloc = 0;
     unsigned int r, g, b;
@@ -286,14 +287,14 @@ static void read_xpm_entry(FILE *in, t_matrix *mm)
     mm->legend[0]  = 0;
     mm->label_x[0] = 0;
     mm->label_y[0] = 0;
-    mm->matrix     = NULL;
-    mm->axis_x     = NULL;
-    mm->axis_y     = NULL;
+    mm->matrix     = nullptr;
+    mm->axis_x     = nullptr;
+    mm->axis_y     = nullptr;
     mm->bDiscrete  = FALSE;
 
     llmax = STRLEN;
 
-    while ((NULL != fgetline(&line_buf, llmax, &llalloc, in)) &&
+    while ((nullptr != fgetline(&line_buf, llmax, &llalloc, in)) &&
            (std::strncmp(line_buf, "static", 6) != 0))
     {
         line = line_buf;
@@ -322,7 +323,7 @@ static void read_xpm_entry(FILE *in, t_matrix *mm)
 
     /* Read sizes */
     bGetOnWithIt = FALSE;
-    while (!bGetOnWithIt && (NULL != fgetline(&line_buf, llmax, &llalloc, in)))
+    while (!bGetOnWithIt && (nullptr != fgetline(&line_buf, llmax, &llalloc, in)))
     {
         line = line_buf;
         while (( line[0] != '\"' ) && ( line[0] != '\0' ))
@@ -359,7 +360,7 @@ static void read_xpm_entry(FILE *in, t_matrix *mm)
     /* Read color map */
     snew(map, mm->nmap);
     m = 0;
-    while ((m < mm->nmap) && (NULL != fgetline(&line_buf, llmax, &llalloc, in)))
+    while ((m < mm->nmap) && (nullptr != fgetline(&line_buf, llmax, &llalloc, in)))
     {
         line = std::strchr(line_buf, '\"');
         if  (line)
@@ -448,7 +449,7 @@ static void read_xpm_entry(FILE *in, t_matrix *mm)
         {
             line = std::strstr(line, "x-axis");
             skipstr(line);
-            if (mm->axis_x == NULL)
+            if (mm->axis_x == nullptr)
             {
                 snew(mm->axis_x, mm->nx + 1);
             }
@@ -471,7 +472,7 @@ static void read_xpm_entry(FILE *in, t_matrix *mm)
         {
             line = std::strstr(line, "y-axis");
             skipstr(line);
-            if (mm->axis_y == NULL)
+            if (mm->axis_y == nullptr)
             {
                 snew(mm->axis_y, mm->ny + 1);
             }
@@ -491,7 +492,7 @@ static void read_xpm_entry(FILE *in, t_matrix *mm)
             }
         }
     }
-    while ((line[0] != '\"') && (NULL != fgetline(&line_buf, llmax, &llalloc, in)));
+    while ((line[0] != '\"') && (nullptr != fgetline(&line_buf, llmax, &llalloc, in)));
 
     /* Read matrix */
     snew(mm->matrix, mm->nx);
@@ -539,7 +540,7 @@ static void read_xpm_entry(FILE *in, t_matrix *mm)
             m--;
         }
     }
-    while ((m >= 0) && (NULL != fgetline(&line_buf, llmax, &llalloc, in)));
+    while ((m >= 0) && (nullptr != fgetline(&line_buf, llmax, &llalloc, in)));
     if (m >= 0)
     {
         gmx_incons("Not enough rows in the matrix");
@@ -551,14 +552,14 @@ static void read_xpm_entry(FILE *in, t_matrix *mm)
 int read_xpm_matrix(const char *fnm, t_matrix **mat)
 {
     FILE *in;
-    char *line = NULL;
+    char *line = nullptr;
     int   nmat;
     int   llalloc = 0;
 
     in = gmx_fio_fopen(fnm, "r");
 
     nmat = 0;
-    while (NULL != fgetline(&line, STRLEN, &llalloc, in))
+    while (nullptr != fgetline(&line, STRLEN, &llalloc, in))
     {
         if (std::strstr(line, "/* XPM */"))
         {
@@ -592,18 +593,18 @@ real **matrix2real(t_matrix *in, real **out)
 
     for (i = 0; i < nmap; i++)
     {
-        if ((map[i].desc == NULL) || (sscanf(map[i].desc, "%lf", &tmp) != 1))
+        if ((map[i].desc == nullptr) || (sscanf(map[i].desc, "%lf", &tmp) != 1))
         {
             fprintf(stderr, "Could not convert matrix to reals,\n"
                     "color map entry %d has a non-real description: \"%s\"\n",
                     i, map[i].desc);
             sfree(rmap);
-            return NULL;
+            return nullptr;
         }
         rmap[i] = tmp;
     }
 
-    if (out == NULL)
+    if (out == nullptr)
     {
         snew(out, in->nx);
         for (i = 0; i < in->nx; i++)
@@ -633,16 +634,6 @@ static void write_xpm_header(FILE *out,
                              gmx_bool bDiscrete)
 {
     fprintf(out,  "/* XPM */\n");
-    try
-    {
-        gmx::BinaryInformationSettings settings;
-        settings.generatedByHeader(true);
-        settings.linePrefix("/* ");
-        settings.lineSuffix(" */");
-        gmx::printBinaryInformation(out, gmx::getProgramContext(),
-                                    settings);
-    }
-    GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
     fprintf(out,  "/* This file can be converted to EPS by the GROMACS program xpm2ps */\n");
     fprintf(out,  "/* title:   \"%s\" */\n", title);
     fprintf(out,  "/* legend:  \"%s\" */\n", legend);
@@ -671,7 +662,7 @@ static void write_xpm_map3(FILE *out, int n_x, int n_y, int *nlevels,
                            t_rgb rlo, t_rgb rmid, t_rgb rhi)
 {
     int    i, nmid;
-    real   r, g, b, clev_lo, clev_hi;
+    double r, g, b, clev_lo, clev_hi;
 
     if (*nlevels > NMAP*NMAP)
     {
@@ -705,9 +696,9 @@ static void write_xpm_map3(FILE *out, int n_x, int n_y, int *nlevels,
         fprintf(out, "\"%c%c c #%02X%02X%02X \" /* \"%.3g\" */,\n",
                 mapper[i % NMAP],
                 (*nlevels <= NMAP) ? ' ' : mapper[i/NMAP],
-                static_cast<unsigned int>(round(255*r)),
-                static_cast<unsigned int>(round(255*g)),
-                static_cast<unsigned int>(round(255*b)),
+                static_cast<unsigned int>(std::round(255*r)),
+                static_cast<unsigned int>(std::round(255*g)),
+                static_cast<unsigned int>(std::round(255*b)),
                 ((nmid - i)*lo + i*mid)/clev_lo);
     }
     for (i = 0; (i < (*nlevels-nmid)); i++)
@@ -718,9 +709,9 @@ static void write_xpm_map3(FILE *out, int n_x, int n_y, int *nlevels,
         fprintf(out, "\"%c%c c #%02X%02X%02X \" /* \"%.3g\" */,\n",
                 mapper[(i+nmid) % NMAP],
                 (*nlevels <= NMAP) ? ' ' : mapper[(i+nmid)/NMAP],
-                static_cast<unsigned int>(round(255*r)),
-                static_cast<unsigned int>(round(255*g)),
-                static_cast<unsigned int>(round(255*b)),
+                static_cast<unsigned int>(std::round(255*r)),
+                static_cast<unsigned int>(std::round(255*g)),
+                static_cast<unsigned int>(std::round(255*b)),
                 ((*nlevels - 1 - nmid - i)*mid + i*hi)/clev_hi);
     }
 }
@@ -1094,8 +1085,8 @@ void write_xpm_m(FILE *out, t_matrix m)
 }
 
 void write_xpm3(FILE *out, unsigned int flags,
-                const char *title, const char *legend,
-                const char *label_x, const char *label_y,
+                const std::string &title, const std::string &legend,
+                const std::string &label_x, const std::string &label_y,
                 int n_x, int n_y, real axis_x[], real axis_y[],
                 real *mat[], real lo, real mid, real hi,
                 t_rgb rlo, t_rgb rmid, t_rgb rhi, int *nlevels)
@@ -1109,7 +1100,7 @@ void write_xpm3(FILE *out, unsigned int flags,
         gmx_fatal(FARGS, "hi (%g) <= lo (%g)", hi, lo);
     }
 
-    write_xpm_header(out, title, legend, label_x, label_y, FALSE);
+    write_xpm_header(out, title.c_str(), legend.c_str(), label_x.c_str(), label_y.c_str(), FALSE);
     write_xpm_map3(out, n_x, n_y, nlevels, lo, mid, hi, rlo, rmid, rhi);
     write_xpm_axis(out, "x", flags & MAT_SPATIAL_X, n_x, axis_x);
     write_xpm_axis(out, "y", flags & MAT_SPATIAL_Y, n_y, axis_y);
@@ -1117,8 +1108,8 @@ void write_xpm3(FILE *out, unsigned int flags,
 }
 
 void write_xpm_split(FILE *out, unsigned int flags,
-                     const char *title, const char *legend,
-                     const char *label_x, const char *label_y,
+                     const std::string &title, const std::string &legend,
+                     const std::string &label_x, const std::string &label_y,
                      int n_x, int n_y, real axis_x[], real axis_y[],
                      real *mat[],
                      real lo_top, real hi_top, int *nlevel_top,
@@ -1144,7 +1135,7 @@ void write_xpm_split(FILE *out, unsigned int flags,
         gmx_impl("Can not plot more than 16 discrete colors");
     }
 
-    write_xpm_header(out, title, legend, label_x, label_y, FALSE);
+    write_xpm_header(out, title.c_str(), legend.c_str(), label_x.c_str(), label_y.c_str(), FALSE);
     write_xpm_map_split(out, n_x, n_y, nlevel_top, lo_top, hi_top, rlo_top, rhi_top,
                         bDiscreteColor, nlevel_bot, lo_bot, hi_bot, rlo_bot, rhi_bot);
     write_xpm_axis(out, "x", flags & MAT_SPATIAL_X, n_x, axis_x);
@@ -1154,8 +1145,8 @@ void write_xpm_split(FILE *out, unsigned int flags,
 }
 
 void write_xpm(FILE *out, unsigned int flags,
-               const char *title, const char *legend,
-               const char *label_x, const char *label_y,
+               const std::string &title, const std::string &legend,
+               const std::string &label_x, const std::string &label_y,
                int n_x, int n_y, real axis_x[], real axis_y[],
                real *mat[], real lo, real hi,
                t_rgb rlo, t_rgb rhi, int *nlevels)
@@ -1181,7 +1172,7 @@ void write_xpm(FILE *out, unsigned int flags,
         gmx_fatal(FARGS, "hi (%f) <= lo (%f)", hi, lo);
     }
 
-    write_xpm_header(out, title, legend, label_x, label_y, FALSE);
+    write_xpm_header(out, title.c_str(), legend.c_str(), label_x.c_str(), label_y.c_str(), FALSE);
     write_xpm_map(out, n_x, n_y, nlevels, lo, hi, rlo, rhi);
     write_xpm_axis(out, "x", flags & MAT_SPATIAL_X, n_x, axis_x);
     write_xpm_axis(out, "y", flags & MAT_SPATIAL_Y, n_y, axis_y);
index 4bb767ae2c79343ec219eb7871aa19c759228b2f..a06058370328145a034abae8abc789f2532a8f64 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,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.
@@ -40,6 +40,8 @@
 
 #include <stdio.h>
 
+#include <string>
+
 #include "gromacs/fileio/rgb.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/real.h"
@@ -125,8 +127,8 @@ void write_xpm_m(FILE *out, t_matrix m);
 /* Writes a t_matrix struct to .xpm file */
 
 void write_xpm3(FILE *out, unsigned int flags,
-                const char *title, const char *legend,
-                const char *label_x, const char *label_y,
+                const std::string &title, const std::string &legend,
+                const std::string &label_x, const std::string &label_y,
                 int n_x, int n_y, real axis_x[], real axis_y[],
                 real *mat[], real lo, real mid, real hi,
                 t_rgb rlo, t_rgb rmid, t_rgb rhi, int *nlevels);
@@ -134,8 +136,8 @@ void write_xpm3(FILE *out, unsigned int flags,
  * Writes a colormap varying as rlo -> rmid -> rhi.
  */
 void write_xpm_split(FILE *out, unsigned int flags,
-                     const char *title, const char *legend,
-                     const char *label_x, const char *label_y,
+                     const std::string &title, const std::string &legend,
+                     const std::string &label_x, const std::string &label_y,
                      int n_x, int n_y, real axis_x[], real axis_y[],
                      real *mat[],
                      real lo_top, real hi_top, int *nlevel_top,
@@ -150,8 +152,8 @@ void write_xpm_split(FILE *out, unsigned int flags,
  */
 
 void write_xpm(FILE *out, unsigned int flags,
-               const char *title, const char *legend,
-               const char *label_x, const char *label_y,
+               const std::string &title, const std::string &legend,
+               const std::string &label_x, const std::string &label_y,
                int n_x, int n_y, real t_x[], real t_y[],
                real *mat[], real lo, real hi,
                t_rgb rlo, t_rgb rhi, int *nlevels);
index 827452131cd9e14b19ed43d2f40b6e8fb3e89879..7a48bc64ffca1617a322e1c5bd5c03b885ebfa9b 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,2013,2014,2015, by the GROMACS development team, led by
+ * 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.
@@ -89,7 +89,7 @@ void gmx_mtxio_write(const char *             filename,
     int         i, j, prec;
     size_t      sz;
 
-    if (full_matrix != NULL && sparse_matrix != NULL)
+    if (full_matrix != nullptr && sparse_matrix != nullptr)
     {
         gmx_fatal(FARGS, "Both full AND sparse matrix specified to gmx_mtxio_write().\n");
     }
@@ -117,7 +117,7 @@ void gmx_mtxio_write(const char *             filename,
     gmx_fio_do_int(fio, nrow);
     gmx_fio_do_int(fio, ncol);
 
-    if (full_matrix != NULL)
+    if (full_matrix != nullptr)
     {
         /* Full matrix storage format */
         i = GMX_MTXIO_FULL_MATRIX;
@@ -200,7 +200,7 @@ gmx_mtxio_read (const char *            filename,
 
     gmx_fio_do_int(fio, i);
 
-    if (i == GMX_MTXIO_FULL_MATRIX && NULL != full_matrix)
+    if (i == GMX_MTXIO_FULL_MATRIX && nullptr != full_matrix)
     {
         printf("Full matrix storage format, nrow=%d, ncols=%d\n", *nrow, *ncol);
 
@@ -208,7 +208,7 @@ gmx_mtxio_read (const char *            filename,
         snew((*full_matrix), sz);
         gmx_fio_ndo_real(fio, (*full_matrix), sz);
     }
-    else if (NULL != sparse_matrix)
+    else if (nullptr != sparse_matrix)
     {
         /* Sparse storage */
         printf("Sparse matrix storage format, nrow=%d, ncols=%d\n", *nrow, *ncol);
index 9a9c6c2d44cd15674f806c8800e5960ae17aa522..745ea6c9fd27d213287bbad7ca1eb7566d7ddf05 100644 (file)
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/stringutil.h"
 
 struct gmx_output_env_t
 {
     explicit gmx_output_env_t(const gmx::IProgramContext &context)
-        : programContext(context)
-    {
-        time_unit               = time_ps;
-        view                    = FALSE;
-        xvg_format              = exvgNONE;
-        verbosity               = 0;
-        trajectory_io_verbosity = 1;
-    }
+        : programContext(context),
+          time_unit(time_ps),
+          view(FALSE),
+          xvg_format(exvgNONE),
+          verbosity(0),
+          trajectory_io_verbosity(0) {}
+
 
     const gmx::IProgramContext  &programContext;
 
@@ -82,12 +82,12 @@ struct gmx_output_env_t
 static const real  timefactors[] =   { real(0),  real(1e3),  real(1), real(1e-3), real(1e-6), real(1e-9), real(1e-12), real(0) };
 static const real  timeinvfactors[] = { real(0), real(1e-3),  real(1),  real(1e3),  real(1e6),  real(1e9),  real(1e12), real(0) };
 static const char *time_units_str[] = {
-    NULL, "fs", "ps", "ns", "us",
+    nullptr, "fs", "ps", "ns", "us",
     "\\mus", "ms", "s"
 };
 static const char *time_units_xvgr[] = {
-    NULL, "fs", "ps", "ns",
-    "ms", "s", NULL
+    nullptr, "fs", "ps", "ns",
+    "ms", "s", nullptr
 };
 
 
@@ -139,31 +139,21 @@ int output_env_get_trajectory_io_verbosity(const gmx_output_env_t *oenv)
     return oenv->trajectory_io_verbosity;
 }
 
-const char *output_env_get_time_unit(const gmx_output_env_t *oenv)
+std::string output_env_get_time_unit(const gmx_output_env_t *oenv)
 {
     return time_units_str[oenv->time_unit];
 }
 
-const char *output_env_get_time_label(const gmx_output_env_t *oenv)
+std::string output_env_get_time_label(const gmx_output_env_t *oenv)
 {
-    char *label;
-    snew(label, 20);
-
-    sprintf(label, "Time (%s)", time_units_str[oenv->time_unit] ?
-            time_units_str[oenv->time_unit] : "ps");
-
-    return label;
+    return gmx::formatString("Time (%s)", time_units_str[oenv->time_unit] ?
+                             time_units_str[oenv->time_unit] : "ps");
 }
 
-const char *output_env_get_xvgr_tlabel(const gmx_output_env_t *oenv)
+std::string output_env_get_xvgr_tlabel(const gmx_output_env_t *oenv)
 {
-    char *label;
-    snew(label, 20);
-
-    sprintf(label, "Time (%s)", time_units_xvgr[oenv->time_unit] ?
-            time_units_xvgr[oenv->time_unit] : "ps");
-
-    return label;
+    return gmx::formatString("Time (%s)", time_units_xvgr[oenv->time_unit] ?
+                             time_units_xvgr[oenv->time_unit] : "ps");
 }
 
 real output_env_get_time_factor(const gmx_output_env_t *oenv)
@@ -207,7 +197,7 @@ xvg_format_t output_env_get_xvg_format(const gmx_output_env_t *oenv)
 
 const char *output_env_get_program_display_name(const gmx_output_env_t *oenv)
 {
-    const char *displayName = NULL;
+    const char *displayName = nullptr;
 
     try
     {
index 58ec84ec972181688640e6d84f6443ba90995658..57188976064d3594526d5f3d21d97385918459d4 100644 (file)
 #ifndef GMX_FILEIO_OENV_H
 #define GMX_FILEIO_OENV_H
 
+#include <string>
+
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/real.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct gmx_output_env_t;
 
 /* output_env member functions */
@@ -81,14 +79,14 @@ int output_env_get_verbosity(const gmx_output_env_t *oenv);
 int output_env_get_trajectory_io_verbosity(const gmx_output_env_t *oenv);
 /* return the verbosity for trajectory IO handling */
 
-const char *output_env_get_time_unit(const gmx_output_env_t *oenv);
+std::string output_env_get_time_unit(const gmx_output_env_t *oenv);
 /* return time unit (e.g. ps or ns) */
 
-const char *output_env_get_time_label(const gmx_output_env_t *oenv);
+std::string output_env_get_time_label(const gmx_output_env_t *oenv);
 /* return time unit label (e.g. "Time (ps)") */
 
-const char *output_env_get_xvgr_tlabel(const gmx_output_env_t *oenv);
-/* retrun x-axis time label for xmgr */
+std::string output_env_get_xvgr_tlabel(const gmx_output_env_t *oenv);
+/* return x-axis time label for xmgr */
 
 real output_env_get_time_factor(const gmx_output_env_t *oenv);
 /* return time conversion factor from ps (i.e. 1e-3 for ps->ns) */
@@ -113,9 +111,6 @@ xvg_format_t output_env_get_xvg_format(const gmx_output_env_t *oenv);
  */
 const char *output_env_get_program_display_name(const gmx_output_env_t *oenv);
 
-#ifdef __cplusplus
-}
-
 namespace gmx
 {
 class IProgramContext;
@@ -137,5 +132,3 @@ const gmx::IProgramContext &
 output_env_get_program_context(const gmx_output_env_t *oenv);
 
 #endif
-
-#endif
index ddedd79e71c36e4097c92ab74d3c6e7095f1eba9..d6c7579199759b7517429e5fca7df086e2a1d568 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,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.
@@ -192,7 +192,7 @@ static void read_cryst1(char *line, int *ePBC, matrix box)
         sscanf(sg, "%c %d %d %d", &ident, &syma, &symb, &symc);
         if (ident == 'P' && syma ==  1 && symb <= 1 && symc <= 1)
         {
-            fc        = strtod(sc, NULL)*0.1;
+            fc        = strtod(sc, nullptr)*0.1;
             ePBC_file = (fc > 0 ? epbcXYZ : epbcXY);
         }
         if (ident == 'P' && syma == 21 && symb == 1 && symc == 1)
@@ -207,9 +207,9 @@ static void read_cryst1(char *line, int *ePBC, matrix box)
 
     if (box)
     {
-        fa = strtod(sa, NULL)*0.1;
-        fb = strtod(sb, NULL)*0.1;
-        fc = strtod(sc, NULL)*0.1;
+        fa = strtod(sa, nullptr)*0.1;
+        fb = strtod(sb, nullptr)*0.1;
+        fc = strtod(sc, nullptr)*0.1;
         if (ePBC_file == epbcSCREW)
         {
             fa *= 0.5;
@@ -286,7 +286,7 @@ void write_pdbfile_indexed(FILE *out, const char *title,
     {
         gmx_write_pdb_box(out, ePBC, box);
     }
-    if (atoms->pdbinfo)
+    if (atoms->havePdbInfo)
     {
         /* Check whether any occupancies are set, in that case leave it as is,
          * otherwise set them all to one
@@ -306,7 +306,7 @@ void write_pdbfile_indexed(FILE *out, const char *title,
     fprintf(out, "MODEL %8d\n", model_nr > 0 ? model_nr : 1);
 
     lastchainnum      = -1;
-    p_restype         = NULL;
+    p_restype         = nullptr;
 
     for (ii = 0; ii < nindex; ii++)
     {
@@ -399,7 +399,7 @@ void write_pdbfile_indexed(FILE *out, const char *title,
     fprintf(out, "TER\n");
     fprintf(out, "ENDMDL\n");
 
-    if (NULL != gc)
+    if (nullptr != gc)
     {
         /* Write conect records */
         for (i = 0; (i < gc->nconect); i++)
@@ -426,7 +426,7 @@ void write_pdbfile(FILE *out, const char *title, const t_atoms *atoms, const rve
     sfree(index);
 }
 
-int line2type(char *line)
+static int line2type(char *line)
 {
     int  k;
     char type[8];
@@ -473,7 +473,7 @@ static void read_anisou(char line[], int natom, t_atoms *atoms)
     trim(anm);
 
     /* Search backwards for number and name only */
-    atomnr = std::strtol(anr, NULL, 10);
+    atomnr = std::strtol(anr, nullptr, 10);
     for (i = natom-1; (i >= 0); i--)
     {
         if ((std::strcmp(anm, *(atoms->atomname[i])) == 0) &&
@@ -568,9 +568,9 @@ void get_pdb_atomnumber(const t_atoms *atoms, gmx_atomprop_t aps)
         }
         else
         {
-            ptr = NULL;
+            ptr = nullptr;
         }
-        std::strncpy(atoms->atom[i].elem, ptr == NULL ? "" : ptr, 4);
+        std::strncpy(atoms->atom[i].elem, ptr == nullptr ? "" : ptr, 4);
     }
 }
 
@@ -629,7 +629,7 @@ static int read_atom(t_symtab *symtab,
     }
     rnr[k] = nc;
     trim(rnr);
-    resnr = std::strtol(rnr, NULL, 10);
+    resnr = std::strtol(rnr, nullptr, 10);
     resic = line[j];
     j    += 4;
 
@@ -708,17 +708,17 @@ static int read_atom(t_symtab *symtab,
         atomn->atomnumber      = atomnumber;
         strncpy(atomn->elem, elem, 4);
     }
-    x[natom][XX] = strtod(xc, NULL)*0.1;
-    x[natom][YY] = strtod(yc, NULL)*0.1;
-    x[natom][ZZ] = strtod(zc, NULL)*0.1;
+    x[natom][XX] = strtod(xc, nullptr)*0.1;
+    x[natom][YY] = strtod(yc, nullptr)*0.1;
+    x[natom][ZZ] = strtod(zc, nullptr)*0.1;
     if (atoms->pdbinfo)
     {
         atoms->pdbinfo[natom].type   = type;
-        atoms->pdbinfo[natom].atomnr = strtol(anr, NULL, 10);
+        atoms->pdbinfo[natom].atomnr = strtol(anr, nullptr, 10);
         atoms->pdbinfo[natom].altloc = altloc;
         strcpy(atoms->pdbinfo[natom].atomnm, anm_copy);
-        atoms->pdbinfo[natom].bfac  = strtod(bfac, NULL);
-        atoms->pdbinfo[natom].occup = strtod(occup, NULL);
+        atoms->pdbinfo[natom].bfac  = strtod(bfac, nullptr);
+        atoms->pdbinfo[natom].occup = strtod(occup, nullptr);
     }
     natom++;
 
@@ -865,16 +865,22 @@ int read_pdbfile(FILE *in, char *title, int *model_nr,
         /* Only assume pbc when there is a CRYST1 entry */
         *ePBC = epbcNONE;
     }
-    if (box != NULL)
+    if (box != nullptr)
     {
         clear_mat(box);
     }
 
+    atoms->haveMass    = FALSE;
+    atoms->haveCharge  = FALSE;
+    atoms->haveType    = FALSE;
+    atoms->haveBState  = FALSE;
+    atoms->havePdbInfo = (atoms->pdbinfo != nullptr);
+
     bCOMPND  = FALSE;
     title[0] = '\0';
     natom    = 0;
     chainnum = 0;
-    while (!bStop && (fgets2(line, STRLEN, in) != NULL))
+    while (!bStop && (fgets2(line, STRLEN, in) != nullptr))
     {
         line_type = line2type(line);
 
@@ -886,7 +892,7 @@ int read_pdbfile(FILE *in, char *title, int *model_nr,
                 break;
 
             case epdbANISOU:
-                if (atoms->pdbinfo)
+                if (atoms->havePdbInfo)
                 {
                     read_anisou(line, natom, atoms);
                 }
@@ -1018,12 +1024,16 @@ void get_pdb_coordnum(FILE *in, int *natoms)
 }
 
 void gmx_pdb_read_conf(const char *infile,
-                       t_topology *top, rvec x[], int *ePBC, matrix box)
+                       t_symtab *symtab, char **name, t_atoms *atoms,
+                       rvec x[], int *ePBC, matrix box)
 {
     FILE *in = gmx_fio_fopen(infile, "r");
     char  title[STRLEN];
-    read_pdbfile(in, title, NULL, &top->atoms, &top->symtab, x, ePBC, box, TRUE, NULL);
-    top->name = put_symtab(&top->symtab, title);
+    read_pdbfile(in, title, nullptr, atoms, symtab, x, ePBC, box, TRUE, nullptr);
+    if (name != nullptr)
+    {
+        *name = gmx_strdup(title);
+    }
     gmx_fio_fclose(in);
 }
 
@@ -1076,12 +1086,12 @@ gmx_fprintf_pdb_atomline(FILE *            fp,
     }
 
     /* Format atom name */
-    if (atom_name != NULL)
+    if (atom_name != nullptr)
     {
         /* If the atom name is an element name with two chars, it should start already in column 13.
          * Otherwise it should start in column 14, unless the name length is 4 chars.
          */
-        if ( (element != NULL) && (std::strlen(element) >= 2) && (gmx_strncasecmp(atom_name, element, 2) == 0) )
+        if ( (element != nullptr) && (std::strlen(element) >= 2) && (gmx_strncasecmp(atom_name, element, 2) == 0) )
         {
             start_name_in_col13 = TRUE;
         }
@@ -1099,7 +1109,7 @@ gmx_fprintf_pdb_atomline(FILE *            fp,
     }
 
     /* Format residue name */
-    std::strncpy(tmp_resname, (res_name != NULL) ? res_name : "", 4);
+    std::strncpy(tmp_resname, (res_name != nullptr) ? res_name : "", 4);
     /* Make sure the string is terminated if strlen was > 4 */
     tmp_resname[4] = '\0';
     /* String is properly terminated, so now we can use strcat. By adding a
@@ -1125,7 +1135,7 @@ gmx_fprintf_pdb_atomline(FILE *            fp,
                 x, y, z,
                 occupancy,
                 b_factor,
-                (element != NULL) ? element : "");
+                (element != nullptr) ? element : "");
 
     return n;
 }
index 3c268708882f2c3311357c36f6a5356ab32ba3be..27d5106d53b1faec01042e8392240b4e4a1cd886 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,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.
@@ -126,11 +126,13 @@ int read_pdbfile(FILE *in, char *title, int *model_nr,
  */
 
 void gmx_pdb_read_conf(const char *infile,
-                       struct t_topology *top, rvec x[], int *ePBC, matrix box);
+                       t_symtab *symtab, char **name, t_atoms *atoms,
+                       rvec x[], int *ePBC, matrix box);
 /* Read a pdb file and extract ATOM and HETATM fields.
  * Read a box from the CRYST1 line, return 0 box when no CRYST1 is found.
  * ePBC may be NULL.
- */
+ *
+ * If name is not nullptr, gmx_strdup the title string into it. */
 
 void get_pdb_coordnum(FILE *in, int *natoms);
 /* Read a pdb file and count the ATOM and HETATM fields. */
index 0f182a718c5389f1d44efd70aa0d843b3e8780e3..76cea0683d952b92b2d8c55f2968c2fefb894cf9 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,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.
 
 #include "readinp.h"
 
-#include <cstdio>
 #include <cstdlib>
 #include <cstring>
 
 #include <algorithm>
 
-#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/warninp.h"
-#include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/utility/binaryinformation.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
-#include "gromacs/utility/futil.h"
+#include "gromacs/utility/keyvaluetreebuilder.h"
+#include "gromacs/utility/niceheader.h"
 #include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/qsort_threadsafe.h"
 #include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/textreader.h"
+#include "gromacs/utility/textwriter.h"
 
-t_inpfile *read_inpfile(const char *fn, int *ninp,
+t_inpfile *read_inpfile(gmx::TextInputStream *stream, const char *fn, int *ninp,
                         warninp_t wi)
 {
-    FILE      *in;
-    char       buf[STRLEN], lbuf[STRLEN], rbuf[STRLEN], warn_buf[STRLEN];
-    char      *ptr, *cptr;
-    t_inpfile *inp = NULL;
-    int        nin, lc, i, j, k;
-    /* setting cppopts from command-line options would be cooler */
-    gmx_bool   allow_override = FALSE;
-
+    t_inpfile *inp = nullptr;
 
     if (debug)
     {
         fprintf(debug, "Reading MDP file %s\n", fn);
     }
 
-    in = gmx_ffopen(fn, "r");
-
-    nin = lc  = 0;
-    do
+    int             indexOfLineReadFromFile = 0;
+    int             countOfUniqueKeysFound  = 0;
+    std::string     line;
+    gmx::TextReader reader(stream);
+    reader.setTrimTrailingWhiteSpace(true);
+    reader.setTrimTrailingComment(true, ';');
+    while (reader.readLine(&line))
     {
-        ptr = fgets2(buf, STRLEN-1, in);
-        lc++;
-        set_warning_line(wi, fn, lc);
-        if (ptr)
+        indexOfLineReadFromFile++;
+        set_warning_line(wi, fn, indexOfLineReadFromFile);
+
+        if (line.empty())
         {
-            // TODO This parsing should be using strip_comment, trim,
-            // strchr, etc. rather than re-inventing wheels.
+            continue;
+        }
 
-            /* Strip comment */
-            if ((cptr = std::strchr(buf, COMMENTSIGN)) != NULL)
+        auto tokens = gmx::splitAndTrimDelimitedString(line, '=');
+        if (tokens.size() < 2)
+        {
+            // TODO this seems like it silently ignores the user accidentally deleting an equals sign...
+            if (debug)
             {
-                *cptr = '\0';
+                fprintf(debug, "No = on line %d in file %s, ignored\n", indexOfLineReadFromFile, fn);
             }
-            /* Strip spaces */
-            trim(buf);
-
-            for (j = 0; (buf[j] != '=') && (buf[j] != '\0'); j++)
+            continue;
+        }
+        if (tokens.size() > 2)
+        {
+            // TODO ignoring such lines does not seem like good behaviour
+            if (debug)
             {
-                ;
+                fprintf(debug, "Multiple equals signs on line %d in file %s, ignored\n", indexOfLineReadFromFile, fn);
             }
-            if (buf[j] == '\0')
+            continue;
+        }
+        if (tokens[0].empty())
+        {
+            // TODO ignoring such lines does not seem like good behaviour
+            if (debug)
             {
-                if (j > 0)
-                {
-                    if (debug)
-                    {
-                        fprintf(debug, "No = on line %d in file %s, ignored\n", lc, fn);
-                    }
-                }
+                fprintf(debug, "Empty left hand side on line %d in file %s, ignored\n", indexOfLineReadFromFile, fn);
             }
-            else
+            continue;
+        }
+        if (tokens[1].empty())
+        {
+            // TODO ignoring such lines does not seem like good behaviour
+            if (debug)
             {
-                for (i = 0; (i < j); i++)
-                {
-                    lbuf[i] = buf[i];
-                }
-                lbuf[i] = '\0';
-                trim(lbuf);
-                if (lbuf[0] == '\0')
-                {
-                    if (debug)
-                    {
-                        fprintf(debug, "Empty left hand side on line %d in file %s, ignored\n", lc, fn);
-                    }
-                }
-                else
-                {
-                    for (i = j+1, k = 0; (buf[i] != '\0'); i++, k++)
-                    {
-                        rbuf[k] = buf[i];
-                    }
-                    rbuf[k] = '\0';
-                    trim(rbuf);
-                    if (rbuf[0] == '\0')
-                    {
-                        if (debug)
-                        {
-                            fprintf(debug, "Empty right hand side on line %d in file %s, ignored\n", lc, fn);
-                        }
-                    }
-                    else
-                    {
-                        /* Now finally something sensible */
-                        int found_index;
-
-                        /* first check whether we hit the 'multiple_entries' option */
-                        if (gmx_strcasecmp_min(eMultentOpt_names[eMultentOptName], lbuf) == 0)
-                        {
-                            /* we now check whether to allow overrides from here or not */
-                            if (gmx_strcasecmp_min(eMultentOpt_names[eMultentOptNo], rbuf) == 0)
-                            {
-                                allow_override = FALSE;
-                            }
-                            else if (gmx_strcasecmp_min(eMultentOpt_names[eMultentOptLast], rbuf) == 0)
-                            {
-                                allow_override = TRUE;
-                            }
-                            else
-                            {
-                                sprintf(warn_buf,
-                                        "Parameter \"%s\" should either be %s or %s\n",
-                                        lbuf,
-                                        eMultentOpt_names[eMultentOptNo],
-                                        eMultentOpt_names[eMultentOptLast]);
-                                warning_error(wi, warn_buf);
-                            }
-                        }
-                        else
-                        {
-                            /* it is a regular option; check for duplicates */
-                            found_index = search_einp(nin, inp, lbuf);
-
-                            if (found_index == -1)
-                            {
-                                /* add a new item */
-                                srenew(inp, ++nin);
-                                inp[nin-1].inp_count  = 1;
-                                inp[nin-1].count      = 0;
-                                inp[nin-1].bObsolete  = FALSE;
-                                inp[nin-1].bSet       = FALSE;
-                                inp[nin-1].name       = gmx_strdup(lbuf);
-                                inp[nin-1].value      = gmx_strdup(rbuf);
-                            }
-                            else
-                            {
-                                if (!allow_override)
-                                {
-                                    sprintf(warn_buf,
-                                            "Parameter \"%s\" doubly defined (and multiple assignments not allowed)\n",
-                                            lbuf);
-                                    warning_error(wi, warn_buf);
-                                }
-                                else
-                                {
-                                    /* override */
-                                    if (!inp)
-                                    {
-                                        gmx_fatal(FARGS, "Internal inconsistency; inp[] base pointer is NULL");
-                                    }
-                                    sfree(inp[found_index].value);
-                                    inp[found_index].value = gmx_strdup(rbuf);
-                                    sprintf(warn_buf,
-                                            "Overriding existing parameter \"%s\" with value \"%s\"\n",
-                                            lbuf, rbuf);
-                                    warning_note(wi, warn_buf);
-                                }
-                            }
-                        }
-                    }
-                }
+                fprintf(debug, "Empty right hand side on line %d in file %s, ignored\n", indexOfLineReadFromFile, fn);
             }
+            continue;
         }
-    }
-    while (ptr);
 
-    gmx_ffclose(in);
+        /* Now finally something sensible; check for duplicates */
+        int found_index = search_einp(countOfUniqueKeysFound, inp, tokens[0].c_str());
+
+        if (found_index == -1)
+        {
+            /* add a new item */
+            srenew(inp, ++countOfUniqueKeysFound);
+            inp[countOfUniqueKeysFound-1].inp_count              = 1;
+            inp[countOfUniqueKeysFound-1].count                  = 0;
+            inp[countOfUniqueKeysFound-1].bObsolete              = FALSE;
+            inp[countOfUniqueKeysFound-1].bHandledAsKeyValueTree = FALSE;
+            inp[countOfUniqueKeysFound-1].bSet                   = FALSE;
+            inp[countOfUniqueKeysFound-1].name                   = gmx_strdup(tokens[0].c_str());
+            inp[countOfUniqueKeysFound-1].value                  = gmx_strdup(tokens[1].c_str());
+        }
+        else
+        {
+            auto message = gmx::formatString("Parameter \"%s\" doubly defined\n",
+                                             tokens[0].c_str());
+            warning_error(wi, message.c_str());
+        }
+    }
+    /* This preserves the behaviour of the old code, which issues some
+       warnings after completing parsing. Regenerating regressiontest
+       warning files is not worth the effort. */
+    indexOfLineReadFromFile++;
+    set_warning_line(wi, fn, indexOfLineReadFromFile);
 
     if (debug)
     {
         fprintf(debug, "Done reading MDP file, there were %d entries in there\n",
-                nin);
+                countOfUniqueKeysFound);
     }
 
-    *ninp = nin;
+    *ninp = countOfUniqueKeysFound;
 
     return inp;
 }
 
-
+gmx::KeyValueTreeObject flatKeyValueTreeFromInpFile(int ninp, t_inpfile inp[])
+{
+    gmx::KeyValueTreeBuilder  builder;
+    auto                      root = builder.rootObject();
+    for (int i = 0; i < ninp; ++i)
+    {
+        const char *value = inp[i].value;
+        root.addValue<std::string>(inp[i].name, value != nullptr ? value : "");
+    }
+    return builder.build();
+}
 
 
 static int inp_comp(const void *a, const void *b)
@@ -253,53 +197,56 @@ static void sort_inp(int ninp, t_inpfile inp[])
     gmx_qsort(inp, ninp, static_cast<size_t>(sizeof(inp[0])), inp_comp);
 }
 
-void write_inpfile(const char *fn, int ninp, t_inpfile inp[], gmx_bool bHaltOnUnknown,
+void write_inpfile(gmx::TextOutputStream *stream, const char *fn, int ninp, t_inpfile inp[],
+                   gmx_bool bHaltOnUnknown,
+                   WriteMdpHeader writeHeader,
                    warninp_t wi)
 {
-    FILE *out;
-    int   i;
-    char  warn_buf[STRLEN];
+    using gmx::formatString;
 
     sort_inp(ninp, inp);
-    out = gmx_fio_fopen(fn, "w");
-    nice_header(out, fn);
-    try
+
+    gmx::TextWriter writer(stream);
+    if (writeHeader == WriteMdpHeader::yes)
     {
+        gmx::niceHeader(&writer, fn, ';');
+
         gmx::BinaryInformationSettings settings;
         settings.generatedByHeader(true);
         settings.linePrefix(";\t");
-        gmx::printBinaryInformation(out, gmx::getProgramContext(), settings);
+        gmx::printBinaryInformation(&writer, gmx::getProgramContext(), settings);
     }
-    GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
 
-    for (i = 0; (i < ninp); i++)
+    for (int i = 0; (i < ninp); i++)
     {
-        if (inp[i].bSet)
+        if (inp[i].bHandledAsKeyValueTree)
+        {
+        }
+        else if (inp[i].bSet)
         {
             if (inp[i].name[0] == ';' || (strlen(inp[i].name) > 2 && inp[i].name[1] == ';'))
             {
-                fprintf(out, "%-24s\n", inp[i].name);
+                writer.writeLine(formatString("%-24s", inp[i].name));
             }
             else
             {
-                fprintf(out, "%-24s = %s\n", inp[i].name, inp[i].value ? inp[i].value : "");
+                writer.writeLine(formatString("%-24s = %s", inp[i].name, inp[i].value ? inp[i].value : ""));
             }
         }
         else if (!inp[i].bObsolete)
         {
-            sprintf(warn_buf, "Unknown left-hand '%s' in parameter file\n",
-                    inp[i].name);
+            auto message = formatString("Unknown left-hand '%s' in parameter file\n",
+                                        inp[i].name);
             if (bHaltOnUnknown)
             {
-                warning_error(wi, warn_buf);
+                warning_error(wi, message.c_str());
             }
             else
             {
-                warning(wi, warn_buf);
+                warning(wi, message.c_str());
             }
         }
     }
-    gmx_fio_fclose(out);
 
     check_warning_error(wi, FARGS);
 }
@@ -333,7 +280,7 @@ int search_einp(int ninp, const t_inpfile *inp, const char *name)
 {
     int i;
 
-    if (inp == NULL)
+    if (inp == nullptr)
     {
         return -1;
     }
@@ -347,6 +294,20 @@ int search_einp(int ninp, const t_inpfile *inp, const char *name)
     return -1;
 }
 
+void mark_einp_set(int ninp, t_inpfile *inp, const char *name)
+{
+    int i = search_einp(ninp, inp, name);
+    if (i != -1)
+    {
+        inp[i].count = inp[0].inp_count++;
+        inp[i].bSet  = TRUE;
+        /* Prevent mdp lines being written twice for
+           options that are handled via key-value trees. */
+        inp[i].bHandledAsKeyValueTree = TRUE;
+
+    }
+}
+
 static int get_einp(int *ninp, t_inpfile **inp, const char *name)
 {
     int    i;
@@ -358,8 +319,13 @@ static int get_einp(int *ninp, t_inpfile **inp, const char *name)
         notfound = TRUE;
         i        = (*ninp)++;
         srenew(*inp, (*ninp));
-        (*inp)[i].name = gmx_strdup(name);
-        (*inp)[i].bSet = TRUE;
+        (*inp)[i].name                   = gmx_strdup(name);
+        (*inp)[i].bSet                   = TRUE;
+        (*inp)[i].bHandledAsKeyValueTree = FALSE;
+        if (i == 0)
+        {
+            (*inp)[i].inp_count = 1;
+        }
     }
     (*inp)[i].count = (*inp)[0].inp_count++;
     (*inp)[i].bSet  = TRUE;
@@ -487,7 +453,7 @@ const char *get_estr(int *ninp, t_inpfile **inp, const char *name, const char *d
         }
         else
         {
-            (*inp)[(*ninp)-1].value = NULL;
+            (*inp)[(*ninp)-1].value = nullptr;
         }
 
         return def;
@@ -515,7 +481,7 @@ int get_eeenum(int *ninp, t_inpfile **inp, const char *name, const char **defs,
         return 0;
     }
 
-    for (i = 0; (defs[i] != NULL); i++)
+    for (i = 0; (defs[i] != nullptr); i++)
     {
         if (gmx_strcasecmp_min(defs[i], (*inp)[ii].value) == 0)
         {
@@ -523,7 +489,7 @@ int get_eeenum(int *ninp, t_inpfile **inp, const char *name, const char **defs,
         }
     }
 
-    if (defs[i] == NULL)
+    if (defs[i] == nullptr)
     {
         n += sprintf(buf, "Invalid enum '%s' for variable %s, using '%s'\n",
                      (*inp)[ii].value, name, defs[0]);
@@ -534,7 +500,7 @@ int get_eeenum(int *ninp, t_inpfile **inp, const char *name, const char **defs,
             n += sprintf(buf+n, " '%s'", defs[j]);
             j++;
         }
-        if (wi != NULL)
+        if (wi != nullptr)
         {
             warning_error(wi, buf);
         }
@@ -553,5 +519,5 @@ int get_eeenum(int *ninp, t_inpfile **inp, const char *name, const char **defs,
 
 int get_eenum(int *ninp, t_inpfile **inp, const char *name, const char **defs)
 {
-    return get_eeenum(ninp, inp, name, defs, NULL);
+    return get_eeenum(ninp, inp, name, defs, nullptr);
 }
index ead2d0d3d69cecba83fbcaa3479ba1f2285b2b77..346cc9cd715258ad27a21509ddb709202547e36a 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,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.
 
 #include <cstring>
 
-#include "gromacs/fileio/warninp.h"
 #include "gromacs/utility/basedefinitions.h"
 
-typedef struct {
-    int      count;     /* sort order for output  */
-    gmx_bool bObsolete; /* whether it is an obsolete param value */
-    gmx_bool bSet;      /* whether it it has been read out */
-    char    *name;      /* name of the parameter */
-    char    *value;     /* parameter value string */
-    int      inp_count; /* number of einps read. Only valid for the first item
-                                                 in the inpfile list. */
+struct warninp;
+typedef warninp *warninp_t;
+
+namespace gmx
+{
+class KeyValueTreeObject;
+class TextInputStream;
+class TextOutputStream;
+}
+
+typedef struct t_inpfile {
+    int      count;                  /* sort order for output  */
+    gmx_bool bObsolete;              /* whether it is an obsolete param value */
+    gmx_bool bSet;                   /* whether it it has been read out */
+    gmx_bool bHandledAsKeyValueTree; /* whether it it has been handled with key-value machinery */
+    char    *name;                   /* name of the parameter */
+    char    *value;                  /* parameter value string */
+    int      inp_count;              /* number of einps read. Only valid for the first item
+                                                              in the inpfile list. */
 } t_inpfile;
 /* entry in input files (like .mdp files).
    Initally read in with read_inpfile, then filled in with missing values
    through get_eint, get_ereal, etc. */
 
-t_inpfile *read_inpfile(const char *fn, int *ninp,
+/*! \brief Create and return an array of \c ninp t_inpfile structs
+ * from "key = value" lines in \c stream corresponding to file \c fn.
+ *
+ * \param[in]  stream          Text stream to read.
+ * \param[in]  fn              Filename corresponding to \c reader.
+ * \param[out] ninp            Length of returned array.
+ * \param[out] wi              Handler for context-sensitive warnings.
+ * \throws     std::bad_alloc  If out of memory.
+ * \throws     Anything the stream underlying \c reader can throw. */
+t_inpfile *read_inpfile(gmx::TextInputStream *stream, const char *fn, int *ninp,
                         warninp_t wi);
-/* Create & populate a t_inpfile struct from values in file fn.
-   fn = the file name
-   ninp = the number of read parameters
-   cppopts = the cpp-style options for #include paths and #defines */
 
-void write_inpfile(const char *fn, int ninp, t_inpfile inp[],
+gmx::KeyValueTreeObject flatKeyValueTreeFromInpFile(int ninp, t_inpfile inp[]);
+
+enum class WriteMdpHeader
+{
+    no, yes
+};
+
+/*! \brief Write "key = value" lines from \c inp to \c stream.
+ *
+ * \param[in]  stream          Text stream to write.
+ * \param[in]  fn              Filename corresponding to \c stream.
+ * \param[in]  ninp            Length of \c inp.
+ * \param[in]  inp             Array of key-value pairs.
+ * \param[in]  bHaltOnUnknown  Whether to issue a fatal error if an unknown key is found.
+ * \param[in]  writeHeader     Whether to write a header recording some context a user might like.
+ * \param[out] wi              Handler for context-sensitive warnings.
+ * \throws     std::bad_alloc  If out of memory.
+ * \throws     Anything the stream underlying \c writer can throw. */
+void write_inpfile(gmx::TextOutputStream *stream, const char *fn, int ninp, t_inpfile inp[],
                    gmx_bool bHaltOnUnknown,
+                   WriteMdpHeader writeHeader,
                    warninp_t wi);
+/* Write inp to fn, warning (and perhaps halting) if any fields are
+ * unknown. The helpful header contains irreproducible content, so
+ * its writing can be suppressed to make testing more useful. */
 
 void replace_inp_entry(int ninp, t_inpfile *inp,
                        const char *old_entry, const char *new_entry);
@@ -73,6 +110,8 @@ int search_einp(int ninp, const t_inpfile *inp, const char *name);
 /* Return the index of an .mdp field with the given name within the
  * inp array, if it exists. Return -1 if it does not exist. */
 
+void mark_einp_set(int ninp, t_inpfile *inp, const char *name);
+
 int get_eint(int *ninp, t_inpfile **inp, const char *name, int def,
              warninp_t wi);
 
index 2863a9795d7cd1b5e4d893a94dbbb0aa4dbeda27..23e8f91a397395570c2f72139830a8643625e33a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 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.
@@ -65,7 +65,7 @@
 /*! \brief
  * Google Test formatter for GromacsFileType values.
  */
-void PrintTo(const GromacsFileType &ftp, std::ostream *os)
+static void PrintTo(const GromacsFileType &ftp, std::ostream *os)
 {
     *os << "'" << ftp2ext(ftp) << "'";
 }
@@ -81,8 +81,8 @@ class StructureIORoundtripTest : public gmx::test::StringTestBase,
         {
             generateReferenceTopology();
             generateReferenceCoordinates();
-            testTop_ = NULL;
-            testX_   = NULL;
+            testTop_ = nullptr;
+            testX_   = nullptr;
             clear_mat(testBox_);
             referenceFilename_ =
                 fileManager_.getTemporaryFilePath(getFileSuffix("ref"));
@@ -91,7 +91,7 @@ class StructureIORoundtripTest : public gmx::test::StringTestBase,
         }
         ~StructureIORoundtripTest()
         {
-            if (testTop_ != NULL)
+            if (testTop_ != nullptr)
             {
                 done_top(testTop_);
                 sfree(testTop_);
@@ -104,7 +104,7 @@ class StructureIORoundtripTest : public gmx::test::StringTestBase,
         void writeReferenceFile()
         {
             write_sto_conf(referenceFilename_.c_str(), *refTop_->name,
-                           &refTop_->atoms, as_rvec_array(refX_.data()), NULL, -1,
+                           &refTop_->atoms, as_rvec_array(refX_.data()), nullptr, -1,
                            refBox_);
         }
 
@@ -113,7 +113,7 @@ class StructureIORoundtripTest : public gmx::test::StringTestBase,
             snew(testTop_, 1);
             int  ePBC = -2;
             read_tps_conf(referenceFilename_.c_str(), testTop_,
-                          &ePBC, &testX_, NULL, testBox_, FALSE);
+                          &ePBC, &testX_, nullptr, testBox_, FALSE);
         }
 
         void testTopologies()
@@ -124,7 +124,7 @@ class StructureIORoundtripTest : public gmx::test::StringTestBase,
         void writeTestFileAndTest()
         {
             write_sto_conf(testFilename_.c_str(), *testTop_->name,
-                           &testTop_->atoms, testX_, NULL, -1, testBox_);
+                           &testTop_->atoms, testX_, nullptr, -1, testBox_);
             testFilesEqual(referenceFilename_, testFilename_);
         }
 
@@ -181,7 +181,7 @@ class StructureIORoundtripTest : public gmx::test::StringTestBase,
             refX_.reserve(atomCount);
             for (int i = 0; i < atomCount; ++i)
             {
-                refX_.push_back(gmx::RVec(i%4, i/4, (i/2)%3));
+                refX_.emplace_back(i%4, i/4, (i/2)%3);
             }
         }
 
index 506a3dbd1d818ba75681bb271166e6a9f9dffb03..61f8d27998d780bafb82788de492498f6dd9f97f 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,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.
@@ -45,8 +45,8 @@
 #include <gtest/gtest.h>
 
 #include "gromacs/fileio/warninp.h"
-#include "gromacs/utility/scoped_cptr.h"
 #include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/unique_cptr.h"
 
 namespace gmx
 {
@@ -57,7 +57,7 @@ class ReadTest : public ::testing::Test
 {
     public:
         ReadTest() : numInputs_(1),
-                     inputField_(0),
+                     inputField_(nullptr),
                      inpGuard_(),
                      wi_(),
                      wiGuard_()
@@ -77,9 +77,9 @@ class ReadTest : public ::testing::Test
 
         int                                            numInputs_;
         t_inpfile                                     *inputField_;
-        gmx::scoped_cptr<t_inpfile>                    inpGuard_;
+        gmx::unique_cptr<t_inpfile>                    inpGuard_;
         warninp_t                                      wi_;
-        gmx::scoped_cptr<struct warninp, free_warning> wiGuard_;
+        gmx::unique_cptr<struct warninp, free_warning> wiGuard_;
 };
 
 TEST_F(ReadTest, get_eint_ReadsInteger)
index 6c5cbef3498731ad88b6e7074bce1c9f10b96629..4d2e7b68eed196b92b448e98401b2695fea033f9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,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.
@@ -47,7 +47,6 @@
 
 #include <gtest/gtest.h>
 
-#include "gromacs/fileio/tngio_for_tools.h"
 #include "gromacs/utility/path.h"
 
 #include "testutils/testfilemanager.h"
@@ -75,7 +74,7 @@ TEST_F(TngTest, CanOpenTngFile)
 
 TEST_F(TngTest, CloseBeforeOpenIsNotFatal)
 {
-    tng_trajectory_t tng = NULL;
+    tng_trajectory_t tng = nullptr;
     gmx_tng_close(&tng);
 }
 
index 13d9cbd70ed14ce4a7b9be4a3ed84de68641c3bc..fc05623f53011982e2005f8c23523649157485b3 100644 (file)
 
 #include "config.h"
 
+#include <cmath>
+
+#include <memory>
+
 #if GMX_USE_TNG
 #include "tng/tng_io.h"
 #endif
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/topology/ifunc.h"
 #include "gromacs/topology/topology.h"
+#include "gromacs/trajectory/trajectoryframe.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/baseversion.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/programcontext.h"
+#include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/sysinfo.h"
+#include "gromacs/utility/unique_cptr.h"
 
 static const char *modeToVerb(char mode)
 {
@@ -178,8 +185,8 @@ static void addTngMoleculeFromTopology(tng_trajectory_t     tng,
                                        gmx_int64_t          numMolecules,
                                        tng_molecule_t      *tngMol)
 {
-    tng_chain_t      tngChain = NULL;
-    tng_residue_t    tngRes   = NULL;
+    tng_chain_t      tngChain = nullptr;
+    tng_residue_t    tngRes   = nullptr;
 
     if (tng_molecule_add(tng, moleculeName, tngMol) != TNG_SUCCESS)
     {
@@ -197,7 +204,7 @@ static void addTngMoleculeFromTopology(tng_trajectory_t     tng,
         {
             const t_resinfo *resInfo        = &atoms->resinfo[at->resind];
             char             chainName[2]   = {resInfo->chainid, 0};
-            tng_atom_t       tngAtom        = NULL;
+            tng_atom_t       tngAtom        = nullptr;
             t_atom          *prevAtom;
 
             if (atomIndex > 0)
@@ -206,7 +213,7 @@ static void addTngMoleculeFromTopology(tng_trajectory_t     tng,
             }
             else
             {
-                prevAtom = 0;
+                prevAtom = nullptr;
             }
 
             /* If this is the first atom or if the residue changed add the
@@ -246,7 +253,7 @@ void gmx_tng_add_mtop(tng_trajectory_t  tng,
 
     for (int molIndex = 0; molIndex < mtop->nmolblock; molIndex++)
     {
-        tng_molecule_t       tngMol  = NULL;
+        tng_molecule_t       tngMol  = nullptr;
         const gmx_moltype_t *molType =
             &mtop->moltype[mtop->molblock[molIndex].type];
 
@@ -868,3 +875,839 @@ float gmx_tng_get_time_of_final_frame(tng_trajectory_t tng)
     return -1.0;
 #endif
 }
+
+void gmx_prepare_tng_writing(const char              *filename,
+                             char                     mode,
+                             tng_trajectory_t        *input,
+                             tng_trajectory_t        *output,
+                             int                      nAtoms,
+                             const gmx_mtop_t        *mtop,
+                             const int               *index,
+                             const char              *indexGroupName)
+{
+#if GMX_USE_TNG
+    /* FIXME after 5.0: Currently only standard block types are read */
+    const int           defaultNumIds              = 5;
+    static gmx_int64_t  fallbackIds[defaultNumIds] =
+    {
+        TNG_TRAJ_BOX_SHAPE, TNG_TRAJ_POSITIONS,
+        TNG_TRAJ_VELOCITIES, TNG_TRAJ_FORCES,
+        TNG_GMX_LAMBDA
+    };
+    static char         fallbackNames[defaultNumIds][32] =
+    {
+        "BOX SHAPE", "POSITIONS", "VELOCITIES",
+        "FORCES", "LAMBDAS"
+    };
+
+    typedef tng_function_status (*set_writing_interval_func_pointer)(tng_trajectory_t,
+                                                                     const gmx_int64_t,
+                                                                     const gmx_int64_t,
+                                                                     const gmx_int64_t,
+                                                                     const char*,
+                                                                     const char,
+                                                                     const char);
+#if GMX_DOUBLE
+    set_writing_interval_func_pointer set_writing_interval = tng_util_generic_write_interval_double_set;
+#else
+    set_writing_interval_func_pointer set_writing_interval = tng_util_generic_write_interval_set;
+#endif
+
+    gmx_tng_open(filename, mode, output);
+
+    /* Do we have an input file in TNG format? If so, then there's
+       more data we can copy over, rather than having to improvise. */
+    if (*input)
+    {
+        /* Set parameters (compression, time per frame, molecule
+         * information, number of frames per frame set and writing
+         * intervals of positions, box shape and lambdas) of the
+         * output tng container based on their respective values int
+         * the input tng container */
+        double      time, compression_precision;
+        gmx_int64_t n_frames_per_frame_set, interval = -1;
+
+        tng_compression_precision_get(*input, &compression_precision);
+        tng_compression_precision_set(*output, compression_precision);
+        // TODO make this configurable in a future version
+        char compression_type = TNG_TNG_COMPRESSION;
+
+        tng_molecule_system_copy(*input, *output);
+
+        tng_time_per_frame_get(*input, &time);
+        tng_time_per_frame_set(*output, time);
+
+        tng_num_frames_per_frame_set_get(*input, &n_frames_per_frame_set);
+        tng_num_frames_per_frame_set_set(*output, n_frames_per_frame_set);
+
+        for (int i = 0; i < defaultNumIds; i++)
+        {
+            if (tng_data_get_stride_length(*input, fallbackIds[i], -1, &interval)
+                == TNG_SUCCESS)
+            {
+                switch (fallbackIds[i])
+                {
+                    case TNG_TRAJ_POSITIONS:
+                    case TNG_TRAJ_VELOCITIES:
+                        set_writing_interval(*output, interval, 3, fallbackIds[i],
+                                             fallbackNames[i], TNG_PARTICLE_BLOCK_DATA,
+                                             compression_type);
+                        break;
+                    case TNG_TRAJ_FORCES:
+                        set_writing_interval(*output, interval, 3, fallbackIds[i],
+                                             fallbackNames[i], TNG_PARTICLE_BLOCK_DATA,
+                                             TNG_GZIP_COMPRESSION);
+                        break;
+                    case TNG_TRAJ_BOX_SHAPE:
+                        set_writing_interval(*output, interval, 9, fallbackIds[i],
+                                             fallbackNames[i], TNG_NON_PARTICLE_BLOCK_DATA,
+                                             TNG_GZIP_COMPRESSION);
+                        break;
+                    case TNG_GMX_LAMBDA:
+                        set_writing_interval(*output, interval, 1, fallbackIds[i],
+                                             fallbackNames[i], TNG_NON_PARTICLE_BLOCK_DATA,
+                                             TNG_GZIP_COMPRESSION);
+                        break;
+                    default:
+                        continue;
+                }
+            }
+        }
+
+    }
+    else
+    {
+        /* TODO after trjconv is modularized: fix this so the user can
+           change precision when they are doing an operation where
+           this makes sense, and not otherwise.
+
+           char compression = bUseLossyCompression ? TNG_TNG_COMPRESSION : TNG_GZIP_COMPRESSION;
+           gmx_tng_set_compression_precision(*output, ndec2prec(nDecimalsOfPrecision));
+         */
+        gmx_tng_add_mtop(*output, mtop);
+        tng_num_frames_per_frame_set_set(*output, 1);
+    }
+
+    if (index && nAtoms > 0)
+    {
+        gmx_tng_setup_atom_subgroup(*output, nAtoms, index, indexGroupName);
+    }
+
+    /* If for some reason there are more requested atoms than there are atoms in the
+     * molecular system create a number of implicit atoms (without atom data) to
+     * compensate for that. */
+    if (nAtoms >= 0)
+    {
+        tng_implicit_num_particles_set(*output, nAtoms);
+    }
+#else
+    GMX_UNUSED_VALUE(filename);
+    GMX_UNUSED_VALUE(mode);
+    GMX_UNUSED_VALUE(input);
+    GMX_UNUSED_VALUE(output);
+    GMX_UNUSED_VALUE(nAtoms);
+    GMX_UNUSED_VALUE(mtop);
+    GMX_UNUSED_VALUE(index);
+    GMX_UNUSED_VALUE(indexGroupName);
+#endif
+}
+
+void gmx_write_tng_from_trxframe(tng_trajectory_t        output,
+                                 const t_trxframe       *frame,
+                                 int                     natoms)
+{
+#if GMX_USE_TNG
+    if (frame->step > 0)
+    {
+        double timePerFrame = frame->time * PICO / frame->step;
+        tng_time_per_frame_set(output, timePerFrame);
+    }
+    if (natoms < 0)
+    {
+        natoms = frame->natoms;
+    }
+    gmx_fwrite_tng(output,
+                   TRUE,
+                   frame->step,
+                   frame->time,
+                   0,
+                   frame->box,
+                   natoms,
+                   frame->x,
+                   frame->v,
+                   frame->f);
+#else
+    GMX_UNUSED_VALUE(output);
+    GMX_UNUSED_VALUE(frame);
+    GMX_UNUSED_VALUE(natoms);
+#endif
+}
+
+namespace
+{
+
+#if GMX_USE_TNG
+void
+convert_array_to_real_array(void       *from,
+                            real       *to,
+                            const float fact,
+                            const int   nAtoms,
+                            const int   nValues,
+                            const char  datatype)
+{
+    int        i, j;
+
+    const bool useDouble = GMX_DOUBLE;
+    switch (datatype)
+    {
+        case TNG_FLOAT_DATA:
+            if (!useDouble)
+            {
+                if (fact == 1)
+                {
+                    memcpy(to, from, nValues * sizeof(real) * nAtoms);
+                }
+                else
+                {
+                    for (i = 0; i < nAtoms; i++)
+                    {
+                        for (j = 0; j < nValues; j++)
+                        {
+                            to[i*nValues+j] = reinterpret_cast<float *>(from)[i*nValues+j] * fact;
+                        }
+                    }
+                }
+            }
+            else
+            {
+                for (i = 0; i < nAtoms; i++)
+                {
+                    for (j = 0; j < nValues; j++)
+                    {
+                        to[i*nValues+j] = reinterpret_cast<float *>(from)[i*nValues+j] * fact;
+                    }
+                }
+            }
+            break;
+        case TNG_INT_DATA:
+            for (i = 0; i < nAtoms; i++)
+            {
+                for (j = 0; j < nValues; j++)
+                {
+                    to[i*nValues+j] = reinterpret_cast<gmx_int64_t *>(from)[i*nValues+j] * fact;
+                }
+            }
+            break;
+        case TNG_DOUBLE_DATA:
+            if (sizeof(real) == sizeof(double))
+            {
+                if (fact == 1)
+                {
+                    memcpy(to, from, nValues * sizeof(real) * nAtoms);
+                }
+                else
+                {
+                    for (i = 0; i < nAtoms; i++)
+                    {
+                        for (j = 0; j < nValues; j++)
+                        {
+                            to[i*nValues+j] = reinterpret_cast<double *>(from)[i*nValues+j] * fact;
+                        }
+                    }
+                }
+            }
+            else
+            {
+                for (i = 0; i < nAtoms; i++)
+                {
+                    for (j = 0; j < nValues; j++)
+                    {
+                        to[i*nValues+j] = reinterpret_cast<double *>(from)[i*nValues+j] * fact;
+                    }
+                }
+            }
+            break;
+        default:
+            gmx_incons("Illegal datatype when converting values to a real array!");
+            return;
+    }
+    return;
+}
+
+real getDistanceScaleFactor(tng_trajectory_t in)
+{
+    gmx_int64_t exp = -1;
+    real        distanceScaleFactor;
+
+    // TODO Hopefully, TNG 2.0 will do this kind of thing for us
+    tng_distance_unit_exponential_get(in, &exp);
+
+    // GROMACS expects distances in nm
+    switch (exp)
+    {
+        case 9:
+            distanceScaleFactor = NANO/NANO;
+            break;
+        case 10:
+            distanceScaleFactor = NANO/ANGSTROM;
+            break;
+        default:
+            distanceScaleFactor = pow(10.0, exp + 9.0);
+    }
+
+    return distanceScaleFactor;
+}
+#endif
+
+} // namespace
+
+void gmx_tng_setup_atom_subgroup(tng_trajectory_t tng,
+                                 const int        nind,
+                                 const int       *ind,
+                                 const char      *name)
+{
+#if GMX_USE_TNG
+    gmx_int64_t              nAtoms, cnt, nMols;
+    tng_molecule_t           mol, iterMol;
+    tng_chain_t              chain;
+    tng_residue_t            res;
+    tng_atom_t               atom;
+    tng_function_status      stat;
+
+    tng_num_particles_get(tng, &nAtoms);
+
+    if (nAtoms == nind)
+    {
+        return;
+    }
+
+    stat = tng_molecule_find(tng, name, -1, &mol);
+    if (stat == TNG_SUCCESS)
+    {
+        tng_molecule_num_atoms_get(tng, mol, &nAtoms);
+        tng_molecule_cnt_get(tng, mol, &cnt);
+        if (nAtoms == nind)
+        {
+            stat = TNG_SUCCESS;
+        }
+        else
+        {
+            stat = TNG_FAILURE;
+        }
+    }
+    if (stat == TNG_FAILURE)
+    {
+        /* The indexed atoms are added to one separate molecule. */
+        tng_molecule_alloc(tng, &mol);
+        tng_molecule_name_set(tng, mol, name);
+        tng_molecule_chain_add(tng, mol, "", &chain);
+
+        for (int i = 0; i < nind; i++)
+        {
+            char        temp_name[256], temp_type[256];
+
+            /* Try to retrieve the residue name of the atom */
+            stat = tng_residue_name_of_particle_nr_get(tng, ind[i], temp_name, 256);
+            if (stat != TNG_SUCCESS)
+            {
+                temp_name[0] = '\0';
+            }
+            /* Check if the molecule of the selection already contains this residue */
+            if (tng_chain_residue_find(tng, chain, temp_name, -1, &res)
+                != TNG_SUCCESS)
+            {
+                tng_chain_residue_add(tng, chain, temp_name, &res);
+            }
+            /* Try to find the original name and type of the atom */
+            stat = tng_atom_name_of_particle_nr_get(tng, ind[i], temp_name, 256);
+            if (stat != TNG_SUCCESS)
+            {
+                temp_name[0] = '\0';
+            }
+            stat = tng_atom_type_of_particle_nr_get(tng, ind[i], temp_type, 256);
+            if (stat != TNG_SUCCESS)
+            {
+                temp_type[0] = '\0';
+            }
+            tng_residue_atom_w_id_add(tng, res, temp_name, temp_type, ind[i], &atom);
+        }
+        tng_molecule_existing_add(tng, &mol);
+    }
+    /* Set the count of the molecule containing the selected atoms to 1 and all
+     * other molecules to 0 */
+    tng_molecule_cnt_set(tng, mol, 1);
+    tng_num_molecule_types_get(tng, &nMols);
+    for (gmx_int64_t k = 0; k < nMols; k++)
+    {
+        tng_molecule_of_index_get(tng, k, &iterMol);
+        if (iterMol == mol)
+        {
+            continue;
+        }
+        tng_molecule_cnt_set(tng, iterMol, 0);
+    }
+#else
+    GMX_UNUSED_VALUE(tng);
+    GMX_UNUSED_VALUE(nind);
+    GMX_UNUSED_VALUE(ind);
+    GMX_UNUSED_VALUE(name);
+#endif
+}
+
+/* TODO: If/when TNG acquires the ability to copy data blocks without
+ * uncompressing them, then this implemenation should be reconsidered.
+ * Ideally, gmx trjconv -f a.tng -o b.tng -b 10 -e 20 would be fast
+ * and lose no information. */
+gmx_bool gmx_read_next_tng_frame(tng_trajectory_t            input,
+                                 t_trxframe                 *fr,
+                                 gmx_int64_t                *requestedIds,
+                                 int                         numRequestedIds)
+{
+#if GMX_USE_TNG
+    gmx_bool                bOK = TRUE;
+    tng_function_status     stat;
+    gmx_int64_t             numberOfAtoms = -1, frameNumber = -1;
+    gmx_int64_t             nBlocks, blockId, *blockIds = nullptr, codecId;
+    char                    datatype      = -1;
+    void                   *values        = nullptr;
+    double                  frameTime     = -1.0;
+    int                     size, blockDependency;
+    double                  prec;
+    const int               defaultNumIds = 5;
+    static gmx_int64_t      fallbackRequestedIds[defaultNumIds] =
+    {
+        TNG_TRAJ_BOX_SHAPE, TNG_TRAJ_POSITIONS,
+        TNG_TRAJ_VELOCITIES, TNG_TRAJ_FORCES,
+        TNG_GMX_LAMBDA
+    };
+
+
+    fr->bStep     = FALSE;
+    fr->bTime     = FALSE;
+    fr->bLambda   = FALSE;
+    fr->bAtoms    = FALSE;
+    fr->bPrec     = FALSE;
+    fr->bX        = FALSE;
+    fr->bV        = FALSE;
+    fr->bF        = FALSE;
+    fr->bBox      = FALSE;
+
+    /* If no specific IDs were requested read all block types that can
+     * currently be interpreted */
+    if (!requestedIds || numRequestedIds == 0)
+    {
+        numRequestedIds = defaultNumIds;
+        requestedIds    = fallbackRequestedIds;
+    }
+
+    stat = tng_num_particles_get(input, &numberOfAtoms);
+    if (stat != TNG_SUCCESS)
+    {
+        gmx_file("Cannot determine number of atoms from TNG file.");
+    }
+    fr->natoms = numberOfAtoms;
+
+    bool nextFrameExists = gmx_get_tng_data_block_types_of_next_frame(input,
+                                                                      fr->step,
+                                                                      numRequestedIds,
+                                                                      requestedIds,
+                                                                      &frameNumber,
+                                                                      &nBlocks,
+                                                                      &blockIds);
+    gmx::unique_cptr<gmx_int64_t, gmx::free_wrapper> blockIdsGuard(blockIds);
+    if (!nextFrameExists)
+    {
+        return FALSE;
+    }
+
+    if (nBlocks == 0)
+    {
+        return FALSE;
+    }
+
+    for (gmx_int64_t i = 0; i < nBlocks; i++)
+    {
+        blockId = blockIds[i];
+        tng_data_block_dependency_get(input, blockId, &blockDependency);
+        if (blockDependency & TNG_PARTICLE_DEPENDENT)
+        {
+            stat = tng_util_particle_data_next_frame_read(input,
+                                                          blockId,
+                                                          &values,
+                                                          &datatype,
+                                                          &frameNumber,
+                                                          &frameTime);
+        }
+        else
+        {
+            stat = tng_util_non_particle_data_next_frame_read(input,
+                                                              blockId,
+                                                              &values,
+                                                              &datatype,
+                                                              &frameNumber,
+                                                              &frameTime);
+        }
+        if (stat == TNG_CRITICAL)
+        {
+            gmx_file("Cannot read positions from TNG file.");
+            return FALSE;
+        }
+        else if (stat == TNG_FAILURE)
+        {
+            continue;
+        }
+        switch (blockId)
+        {
+            case TNG_TRAJ_BOX_SHAPE:
+                switch (datatype)
+                {
+                    case TNG_INT_DATA:
+                        size = sizeof(gmx_int64_t);
+                        break;
+                    case TNG_FLOAT_DATA:
+                        size = sizeof(float);
+                        break;
+                    case TNG_DOUBLE_DATA:
+                        size = sizeof(double);
+                        break;
+                    default:
+                        gmx_incons("Illegal datatype of box shape values!");
+                }
+                for (int i = 0; i < DIM; i++)
+                {
+                    convert_array_to_real_array(reinterpret_cast<char *>(values) + size * i * DIM,
+                                                reinterpret_cast<real *>(fr->box[i]),
+                                                getDistanceScaleFactor(input),
+                                                1,
+                                                DIM,
+                                                datatype);
+                }
+                fr->bBox = TRUE;
+                break;
+            case TNG_TRAJ_POSITIONS:
+                srenew(fr->x, fr->natoms);
+                convert_array_to_real_array(values,
+                                            reinterpret_cast<real *>(fr->x),
+                                            getDistanceScaleFactor(input),
+                                            fr->natoms,
+                                            DIM,
+                                            datatype);
+                fr->bX = TRUE;
+                tng_util_frame_current_compression_get(input, blockId, &codecId, &prec);
+                /* This must be updated if/when more lossy compression methods are added */
+                if (codecId == TNG_TNG_COMPRESSION)
+                {
+                    fr->prec  = prec;
+                    fr->bPrec = TRUE;
+                }
+                break;
+            case TNG_TRAJ_VELOCITIES:
+                srenew(fr->v, fr->natoms);
+                convert_array_to_real_array(values,
+                                            (real *) fr->v,
+                                            getDistanceScaleFactor(input),
+                                            fr->natoms,
+                                            DIM,
+                                            datatype);
+                fr->bV = TRUE;
+                tng_util_frame_current_compression_get(input, blockId, &codecId, &prec);
+                /* This must be updated if/when more lossy compression methods are added */
+                if (codecId == TNG_TNG_COMPRESSION)
+                {
+                    fr->prec  = prec;
+                    fr->bPrec = TRUE;
+                }
+                break;
+            case TNG_TRAJ_FORCES:
+                srenew(fr->f, fr->natoms);
+                convert_array_to_real_array(values,
+                                            reinterpret_cast<real *>(fr->f),
+                                            getDistanceScaleFactor(input),
+                                            fr->natoms,
+                                            DIM,
+                                            datatype);
+                fr->bF = TRUE;
+                break;
+            case TNG_GMX_LAMBDA:
+                switch (datatype)
+                {
+                    case TNG_FLOAT_DATA:
+                        fr->lambda = *(reinterpret_cast<float *>(values));
+                        break;
+                    case TNG_DOUBLE_DATA:
+                        fr->lambda = *(reinterpret_cast<double *>(values));
+                        break;
+                    default:
+                        gmx_incons("Illegal datatype lambda value!");
+                }
+                fr->bLambda = TRUE;
+                break;
+            default:
+                gmx_warning("Illegal block type! Currently GROMACS tools can only handle certain data types. Skipping block.");
+        }
+        /* values does not have to be freed before reading next frame. It will
+         * be reallocated if it is not NULL. */
+    }
+
+    fr->step  = frameNumber;
+    fr->bStep = TRUE;
+    // Convert the time to ps
+    fr->time  = frameTime / PICO;
+    fr->bTime = TRUE;
+
+    // TODO This does not leak, but is not exception safe.
+    /* values must be freed before leaving this function */
+    sfree(values);
+
+    return bOK;
+#else
+    GMX_UNUSED_VALUE(input);
+    GMX_UNUSED_VALUE(fr);
+    GMX_UNUSED_VALUE(requestedIds);
+    GMX_UNUSED_VALUE(numRequestedIds);
+    return FALSE;
+#endif
+}
+
+void gmx_print_tng_molecule_system(tng_trajectory_t input,
+                                   FILE            *stream)
+{
+#if GMX_USE_TNG
+    gmx_int64_t        nMolecules, nChains, nResidues, nAtoms, *molCntList;
+    tng_molecule_t     molecule;
+    tng_chain_t        chain;
+    tng_residue_t      residue;
+    tng_atom_t         atom;
+    char               str[256], varNAtoms;
+
+    tng_num_molecule_types_get(input, &nMolecules);
+    tng_molecule_cnt_list_get(input, &molCntList);
+    /* Can the number of particles change in the trajectory or is it constant? */
+    tng_num_particles_variable_get(input, &varNAtoms);
+
+    for (gmx_int64_t i = 0; i < nMolecules; i++)
+    {
+        tng_molecule_of_index_get(input, i, &molecule);
+        tng_molecule_name_get(input, molecule, str, 256);
+        if (varNAtoms == TNG_CONSTANT_N_ATOMS)
+        {
+            if ((int)molCntList[i] == 0)
+            {
+                continue;
+            }
+            fprintf(stream, "Molecule: %s, count: %d\n", str, (int)molCntList[i]);
+        }
+        else
+        {
+            fprintf(stream, "Molecule: %s\n", str);
+        }
+        tng_molecule_num_chains_get(input, molecule, &nChains);
+        if (nChains > 0)
+        {
+            for (gmx_int64_t j = 0; j < nChains; j++)
+            {
+                tng_molecule_chain_of_index_get(input, molecule, j, &chain);
+                tng_chain_name_get(input, chain, str, 256);
+                fprintf(stream, "\tChain: %s\n", str);
+                tng_chain_num_residues_get(input, chain, &nResidues);
+                for (gmx_int64_t k = 0; k < nResidues; k++)
+                {
+                    tng_chain_residue_of_index_get(input, chain, k, &residue);
+                    tng_residue_name_get(input, residue, str, 256);
+                    fprintf(stream, "\t\tResidue: %s\n", str);
+                    tng_residue_num_atoms_get(input, residue, &nAtoms);
+                    for (gmx_int64_t l = 0; l < nAtoms; l++)
+                    {
+                        tng_residue_atom_of_index_get(input, residue, l, &atom);
+                        tng_atom_name_get(input, atom, str, 256);
+                        fprintf(stream, "\t\t\tAtom: %s", str);
+                        tng_atom_type_get(input, atom, str, 256);
+                        fprintf(stream, " (%s)\n", str);
+                    }
+                }
+            }
+        }
+        /* It is possible to have a molecule without chains, in which case
+         * residues in the molecule can be iterated through without going
+         * through chains. */
+        else
+        {
+            tng_molecule_num_residues_get(input, molecule, &nResidues);
+            if (nResidues > 0)
+            {
+                for (gmx_int64_t k = 0; k < nResidues; k++)
+                {
+                    tng_molecule_residue_of_index_get(input, molecule, k, &residue);
+                    tng_residue_name_get(input, residue, str, 256);
+                    fprintf(stream, "\t\tResidue: %s\n", str);
+                    tng_residue_num_atoms_get(input, residue, &nAtoms);
+                    for (gmx_int64_t l = 0; l < nAtoms; l++)
+                    {
+                        tng_residue_atom_of_index_get(input, residue, l, &atom);
+                        tng_atom_name_get(input, atom, str, 256);
+                        fprintf(stream, "\t\t\tAtom: %s", str);
+                        tng_atom_type_get(input, atom, str, 256);
+                        fprintf(stream, " (%s)\n", str);
+                    }
+                }
+            }
+            else
+            {
+                tng_molecule_num_atoms_get(input, molecule, &nAtoms);
+                for (gmx_int64_t l = 0; l < nAtoms; l++)
+                {
+                    tng_molecule_atom_of_index_get(input, molecule, l, &atom);
+                    tng_atom_name_get(input, atom, str, 256);
+                    fprintf(stream, "\t\t\tAtom: %s", str);
+                    tng_atom_type_get(input, atom, str, 256);
+                    fprintf(stream, " (%s)\n", str);
+                }
+            }
+        }
+    }
+#else
+    GMX_UNUSED_VALUE(input);
+    GMX_UNUSED_VALUE(stream);
+#endif
+}
+
+gmx_bool gmx_get_tng_data_block_types_of_next_frame(tng_trajectory_t     input,
+                                                    int                  frame,
+                                                    int                  nRequestedIds,
+                                                    gmx_int64_t         *requestedIds,
+                                                    gmx_int64_t         *nextFrame,
+                                                    gmx_int64_t         *nBlocks,
+                                                    gmx_int64_t        **blockIds)
+{
+#if GMX_USE_TNG
+    tng_function_status stat;
+
+    stat = tng_util_trajectory_next_frame_present_data_blocks_find(input, frame,
+                                                                   nRequestedIds, requestedIds,
+                                                                   nextFrame,
+                                                                   nBlocks, blockIds);
+
+    if (stat == TNG_CRITICAL)
+    {
+        gmx_file("Cannot read TNG file. Cannot find data blocks of next frame.");
+    }
+    else if (stat == TNG_FAILURE)
+    {
+        return FALSE;
+    }
+    return TRUE;
+#else
+    GMX_UNUSED_VALUE(input);
+    GMX_UNUSED_VALUE(frame);
+    GMX_UNUSED_VALUE(nRequestedIds);
+    GMX_UNUSED_VALUE(requestedIds);
+    GMX_UNUSED_VALUE(nextFrame);
+    GMX_UNUSED_VALUE(nBlocks);
+    GMX_UNUSED_VALUE(blockIds);
+    return FALSE;
+#endif
+}
+
+gmx_bool gmx_get_tng_data_next_frame_of_block_type(tng_trajectory_t     input,
+                                                   gmx_int64_t          blockId,
+                                                   real               **values,
+                                                   gmx_int64_t         *frameNumber,
+                                                   double              *frameTime,
+                                                   gmx_int64_t         *nValuesPerFrame,
+                                                   gmx_int64_t         *nAtoms,
+                                                   real                *prec,
+                                                   char                *name,
+                                                   int                  maxLen,
+                                                   gmx_bool            *bOK)
+{
+#if GMX_USE_TNG
+    tng_function_status stat;
+    char                datatype = -1;
+    gmx_int64_t         codecId;
+    int                 blockDependency;
+    void               *data = nullptr;
+    double              localPrec;
+
+    stat = tng_data_block_name_get(input, blockId, name, maxLen);
+    if (stat != TNG_SUCCESS)
+    {
+        gmx_file("Cannot read next frame of TNG file");
+    }
+    stat = tng_data_block_dependency_get(input, blockId, &blockDependency);
+    if (stat != TNG_SUCCESS)
+    {
+        gmx_file("Cannot read next frame of TNG file");
+    }
+    if (blockDependency & TNG_PARTICLE_DEPENDENT)
+    {
+        tng_num_particles_get(input, nAtoms);
+        stat = tng_util_particle_data_next_frame_read(input,
+                                                      blockId,
+                                                      &data,
+                                                      &datatype,
+                                                      frameNumber,
+                                                      frameTime);
+    }
+    else
+    {
+        *nAtoms = 1; /* There are not actually any atoms, but it is used for
+                        allocating memory */
+        stat    = tng_util_non_particle_data_next_frame_read(input,
+                                                             blockId,
+                                                             &data,
+                                                             &datatype,
+                                                             frameNumber,
+                                                             frameTime);
+    }
+    if (stat == TNG_CRITICAL)
+    {
+        gmx_file("Cannot read next frame of TNG file");
+    }
+    if (stat == TNG_FAILURE)
+    {
+        *bOK = TRUE;
+        return FALSE;
+    }
+
+    stat = tng_data_block_num_values_per_frame_get(input, blockId, nValuesPerFrame);
+    if (stat != TNG_SUCCESS)
+    {
+        gmx_file("Cannot read next frame of TNG file");
+    }
+    srenew(*values, sizeof(real) * *nValuesPerFrame * *nAtoms);
+    convert_array_to_real_array(data,
+                                *values,
+                                getDistanceScaleFactor(input),
+                                *nAtoms,
+                                *nValuesPerFrame,
+                                datatype);
+
+    tng_util_frame_current_compression_get(input, blockId, &codecId, &localPrec);
+
+    /* This must be updated if/when more lossy compression methods are added */
+    if (codecId != TNG_TNG_COMPRESSION)
+    {
+        *prec = -1.0;
+    }
+    else
+    {
+        *prec = localPrec;
+    }
+
+    *bOK = TRUE;
+    return TRUE;
+#else
+    GMX_UNUSED_VALUE(input);
+    GMX_UNUSED_VALUE(blockId);
+    GMX_UNUSED_VALUE(values);
+    GMX_UNUSED_VALUE(frameNumber);
+    GMX_UNUSED_VALUE(frameTime);
+    GMX_UNUSED_VALUE(nValuesPerFrame);
+    GMX_UNUSED_VALUE(nAtoms);
+    GMX_UNUSED_VALUE(prec);
+    GMX_UNUSED_VALUE(name);
+    GMX_UNUSED_VALUE(maxLen);
+    GMX_UNUSED_VALUE(bOK);
+    return FALSE;
+#endif
+}
index 544ad46b0eba333c9897345faa012e6a288b8e08..4881f2d8d9c4a0d463546e8fe3a0d7426da80869 100644 (file)
@@ -36,7 +36,7 @@
 #ifndef GMX_FILEIO_TNGIO_H
 #define GMX_FILEIO_TNGIO_H
 
-#include "tng/tng_io_fwd.h"
+#include <cstdio>
 
 #include "gromacs/math/vectypes.h"
 #include "gromacs/utility/basedefinitions.h"
@@ -44,6 +44,9 @@
 
 struct gmx_mtop_t;
 struct t_inputrec;
+struct tng_trajectory;
+typedef struct tng_trajectory *tng_trajectory_t;
+struct t_trxframe;
 
 /*! \brief Open a TNG trajectory file
  *
@@ -138,4 +141,69 @@ void fflush_tng(tng_trajectory_t tng);
  */
 float gmx_tng_get_time_of_final_frame(tng_trajectory_t tng);
 
+/*! \brief Prepare to write TNG output from trajectory conversion tools */
+void gmx_prepare_tng_writing(const char              *filename,
+                             char                     mode,
+                             tng_trajectory_t        *in,
+                             tng_trajectory_t        *out,
+                             int                      nAtoms,
+                             const struct gmx_mtop_t *mtop,
+                             const int               *index,
+                             const char              *indexGroupName);
+
+/*! \brief Write a trxframe to a TNG file
+ *
+ * \param output Trajectory to write to
+ * \param frame  Frame data to write
+ * \param natoms Number of atoms to actually write
+ *
+ * The natoms field in frame is the number of atoms in the system. The
+ * parameter natoms supports writing an index-group subset of the
+ * atoms.
+ */
+void gmx_write_tng_from_trxframe(tng_trajectory_t        output,
+                                 const t_trxframe       *frame,
+                                 int                     natoms);
+
+/*! \brief Creates a molecule containing only the indexed atoms and sets
+ * the number of all other molecules to 0. Works similar to a
+ * selection group. */
+void gmx_tng_setup_atom_subgroup(tng_trajectory_t tng,
+                                 const int        nind,
+                                 const int       *ind,
+                                 const char      *name);
+
+/*! \brief Read the first/next TNG frame. */
+gmx_bool gmx_read_next_tng_frame(tng_trajectory_t            input,
+                                 struct t_trxframe          *fr,
+                                 gmx_int64_t                *requestedIds,
+                                 int                         numRequestedIds);
+
+/*! \brief Print the molecule system to stream */
+void gmx_print_tng_molecule_system(tng_trajectory_t input,
+                                   FILE            *stream);
+
+/*! \brief Get a list of block IDs present in the next frame with data. */
+gmx_bool gmx_get_tng_data_block_types_of_next_frame(tng_trajectory_t     input,
+                                                    int                  frame,
+                                                    int                  nRequestedIds,
+                                                    gmx_int64_t         *requestedIds,
+                                                    gmx_int64_t         *nextFrame,
+                                                    gmx_int64_t         *nBlocks,
+                                                    gmx_int64_t        **blockIds);
+
+/*! \brief Get data of the next frame with data from the data block
+ * with the specified block ID. */
+gmx_bool gmx_get_tng_data_next_frame_of_block_type(tng_trajectory_t     input,
+                                                   gmx_int64_t          blockId,
+                                                   real               **values,
+                                                   gmx_int64_t         *frameNumber,
+                                                   double              *frameTime,
+                                                   gmx_int64_t         *nValuesPerFrame,
+                                                   gmx_int64_t         *nAtoms,
+                                                   real                *prec,
+                                                   char                *name,
+                                                   int                  maxLen,
+                                                   gmx_bool            *bOK);
+
 #endif /* GMX_FILEIO_TNGIO_H */
diff --git a/src/gromacs/fileio/tngio_for_tools.cpp b/src/gromacs/fileio/tngio_for_tools.cpp
deleted file mode 100644 (file)
index 51839aa..0000000
+++ /dev/null
@@ -1,879 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2013,2014,2015,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.
- */
-#include "gmxpre.h"
-
-#include "tngio_for_tools.h"
-
-#include "config.h"
-
-#include <cmath>
-
-#if GMX_USE_TNG
-#include "tng/tng_io.h"
-#endif
-
-#include "gromacs/fileio/tngio.h"
-#include "gromacs/math/units.h"
-#include "gromacs/trajectory/trajectoryframe.h"
-#include "gromacs/utility/basedefinitions.h"
-#include "gromacs/utility/fatalerror.h"
-#include "gromacs/utility/smalloc.h"
-
-void gmx_prepare_tng_writing(const char              *filename,
-                             char                     mode,
-                             tng_trajectory_t        *input,
-                             tng_trajectory_t        *output,
-                             int                      nAtoms,
-                             const gmx_mtop_t        *mtop,
-                             const int               *index,
-                             const char              *indexGroupName)
-{
-#if GMX_USE_TNG
-    /* FIXME after 5.0: Currently only standard block types are read */
-    const int           defaultNumIds              = 5;
-    static gmx_int64_t  fallbackIds[defaultNumIds] =
-    {
-        TNG_TRAJ_BOX_SHAPE, TNG_TRAJ_POSITIONS,
-        TNG_TRAJ_VELOCITIES, TNG_TRAJ_FORCES,
-        TNG_GMX_LAMBDA
-    };
-    static char         fallbackNames[defaultNumIds][32] =
-    {
-        "BOX SHAPE", "POSITIONS", "VELOCITIES",
-        "FORCES", "LAMBDAS"
-    };
-
-    typedef tng_function_status (*set_writing_interval_func_pointer)(tng_trajectory_t,
-                                                                     const gmx_int64_t,
-                                                                     const gmx_int64_t,
-                                                                     const gmx_int64_t,
-                                                                     const char*,
-                                                                     const char,
-                                                                     const char);
-#if GMX_DOUBLE
-    set_writing_interval_func_pointer set_writing_interval = tng_util_generic_write_interval_double_set;
-#else
-    set_writing_interval_func_pointer set_writing_interval = tng_util_generic_write_interval_set;
-#endif
-
-    gmx_tng_open(filename, mode, output);
-
-    /* Do we have an input file in TNG format? If so, then there's
-       more data we can copy over, rather than having to improvise. */
-    if (*input)
-    {
-        /* Set parameters (compression, time per frame, molecule
-         * information, number of frames per frame set and writing
-         * intervals of positions, box shape and lambdas) of the
-         * output tng container based on their respective values int
-         * the input tng container */
-        double      time, compression_precision;
-        gmx_int64_t n_frames_per_frame_set, interval = -1;
-
-        tng_compression_precision_get(*input, &compression_precision);
-        tng_compression_precision_set(*output, compression_precision);
-        // TODO make this configurable in a future version
-        char compression_type = TNG_TNG_COMPRESSION;
-
-        tng_molecule_system_copy(*input, *output);
-
-        tng_time_per_frame_get(*input, &time);
-        tng_time_per_frame_set(*output, time);
-
-        tng_num_frames_per_frame_set_get(*input, &n_frames_per_frame_set);
-        tng_num_frames_per_frame_set_set(*output, n_frames_per_frame_set);
-
-        for (int i = 0; i < defaultNumIds; i++)
-        {
-            if (tng_data_get_stride_length(*input, fallbackIds[i], -1, &interval)
-                == TNG_SUCCESS)
-            {
-                switch (fallbackIds[i])
-                {
-                    case TNG_TRAJ_POSITIONS:
-                    case TNG_TRAJ_VELOCITIES:
-                        set_writing_interval(*output, interval, 3, fallbackIds[i],
-                                             fallbackNames[i], TNG_PARTICLE_BLOCK_DATA,
-                                             compression_type);
-                        break;
-                    case TNG_TRAJ_FORCES:
-                        set_writing_interval(*output, interval, 3, fallbackIds[i],
-                                             fallbackNames[i], TNG_PARTICLE_BLOCK_DATA,
-                                             TNG_GZIP_COMPRESSION);
-                        break;
-                    case TNG_TRAJ_BOX_SHAPE:
-                        set_writing_interval(*output, interval, 9, fallbackIds[i],
-                                             fallbackNames[i], TNG_NON_PARTICLE_BLOCK_DATA,
-                                             TNG_GZIP_COMPRESSION);
-                        break;
-                    case TNG_GMX_LAMBDA:
-                        set_writing_interval(*output, interval, 1, fallbackIds[i],
-                                             fallbackNames[i], TNG_NON_PARTICLE_BLOCK_DATA,
-                                             TNG_GZIP_COMPRESSION);
-                    default:
-                        continue;
-                }
-            }
-        }
-
-    }
-    else
-    {
-        /* TODO after trjconv is modularized: fix this so the user can
-           change precision when they are doing an operation where
-           this makes sense, and not otherwise.
-
-           char compression = bUseLossyCompression ? TNG_TNG_COMPRESSION : TNG_GZIP_COMPRESSION;
-           gmx_tng_set_compression_precision(*output, ndec2prec(nDecimalsOfPrecision));
-         */
-        gmx_tng_add_mtop(*output, mtop);
-        tng_num_frames_per_frame_set_set(*output, 1);
-    }
-
-    if (index && nAtoms > 0)
-    {
-        gmx_tng_setup_atom_subgroup(*output, nAtoms, index, indexGroupName);
-    }
-
-    /* If for some reason there are more requested atoms than there are atoms in the
-     * molecular system create a number of implicit atoms (without atom data) to
-     * compensate for that. */
-    if (nAtoms >= 0)
-    {
-        tng_implicit_num_particles_set(*output, nAtoms);
-    }
-#else
-    GMX_UNUSED_VALUE(filename);
-    GMX_UNUSED_VALUE(mode);
-    GMX_UNUSED_VALUE(input);
-    GMX_UNUSED_VALUE(output);
-    GMX_UNUSED_VALUE(nAtoms);
-    GMX_UNUSED_VALUE(mtop);
-    GMX_UNUSED_VALUE(index);
-    GMX_UNUSED_VALUE(indexGroupName);
-#endif
-}
-
-void gmx_write_tng_from_trxframe(tng_trajectory_t        output,
-                                 const t_trxframe       *frame,
-                                 int                     natoms)
-{
-#if GMX_USE_TNG
-    if (frame->step > 0)
-    {
-        double timePerFrame = frame->time * PICO / frame->step;
-        tng_time_per_frame_set(output, timePerFrame);
-    }
-    if (natoms < 0)
-    {
-        natoms = frame->natoms;
-    }
-    gmx_fwrite_tng(output,
-                   TRUE,
-                   frame->step,
-                   frame->time,
-                   0,
-                   frame->box,
-                   natoms,
-                   frame->x,
-                   frame->v,
-                   frame->f);
-#else
-    GMX_UNUSED_VALUE(output);
-    GMX_UNUSED_VALUE(frame);
-    GMX_UNUSED_VALUE(natoms);
-#endif
-}
-
-#if GMX_USE_TNG
-static void
-convert_array_to_real_array(void       *from,
-                            real       *to,
-                            const float fact,
-                            const int   nAtoms,
-                            const int   nValues,
-                            const char  datatype)
-{
-    int        i, j;
-
-    const bool useDouble = GMX_DOUBLE;
-    switch (datatype)
-    {
-        case TNG_FLOAT_DATA:
-            if (!useDouble)
-            {
-                if (fact == 1)
-                {
-                    memcpy(to, from, nValues * sizeof(real) * nAtoms);
-                }
-                else
-                {
-                    for (i = 0; i < nAtoms; i++)
-                    {
-                        for (j = 0; j < nValues; j++)
-                        {
-                            to[i*nValues+j] = reinterpret_cast<float *>(from)[i*nValues+j] * fact;
-                        }
-                    }
-                }
-            }
-            else
-            {
-                for (i = 0; i < nAtoms; i++)
-                {
-                    for (j = 0; j < nValues; j++)
-                    {
-                        to[i*nValues+j] = reinterpret_cast<float *>(from)[i*nValues+j] * fact;
-                    }
-                }
-            }
-            break;
-        case TNG_INT_DATA:
-            for (i = 0; i < nAtoms; i++)
-            {
-                for (j = 0; j < nValues; j++)
-                {
-                    to[i*nValues+j] = reinterpret_cast<gmx_int64_t *>(from)[i*nValues+j] * fact;
-                }
-            }
-            break;
-        case TNG_DOUBLE_DATA:
-            if (sizeof(real) == sizeof(double))
-            {
-                if (fact == 1)
-                {
-                    memcpy(to, from, nValues * sizeof(real) * nAtoms);
-                }
-                else
-                {
-                    for (i = 0; i < nAtoms; i++)
-                    {
-                        for (j = 0; j < nValues; j++)
-                        {
-                            to[i*nValues+j] = reinterpret_cast<double *>(from)[i*nValues+j] * fact;
-                        }
-                    }
-                }
-            }
-            else
-            {
-                for (i = 0; i < nAtoms; i++)
-                {
-                    for (j = 0; j < nValues; j++)
-                    {
-                        to[i*nValues+j] = reinterpret_cast<double *>(from)[i*nValues+j] * fact;
-                    }
-                }
-            }
-            break;
-        default:
-            gmx_incons("Illegal datatype when converting values to a real array!");
-            return;
-    }
-    return;
-}
-
-static real getDistanceScaleFactor(tng_trajectory_t in)
-{
-    gmx_int64_t exp = -1;
-    real        distanceScaleFactor;
-
-    // TODO Hopefully, TNG 2.0 will do this kind of thing for us
-    tng_distance_unit_exponential_get(in, &exp);
-
-    // GROMACS expects distances in nm
-    switch (exp)
-    {
-        case 9:
-            distanceScaleFactor = NANO/NANO;
-            break;
-        case 10:
-            distanceScaleFactor = NANO/ANGSTROM;
-            break;
-        default:
-            distanceScaleFactor = pow(10.0, exp + 9.0);
-    }
-
-    return distanceScaleFactor;
-}
-#endif
-
-void gmx_tng_setup_atom_subgroup(tng_trajectory_t tng,
-                                 const int        nind,
-                                 const int       *ind,
-                                 const char      *name)
-{
-#if GMX_USE_TNG
-    gmx_int64_t              nAtoms, cnt, nMols;
-    tng_molecule_t           mol, iterMol;
-    tng_chain_t              chain;
-    tng_residue_t            res;
-    tng_atom_t               atom;
-    tng_function_status      stat;
-
-    tng_num_particles_get(tng, &nAtoms);
-
-    if (nAtoms == nind)
-    {
-        return;
-    }
-
-    stat = tng_molecule_find(tng, name, -1, &mol);
-    if (stat == TNG_SUCCESS)
-    {
-        tng_molecule_num_atoms_get(tng, mol, &nAtoms);
-        tng_molecule_cnt_get(tng, mol, &cnt);
-        if (nAtoms == nind)
-        {
-            stat = TNG_SUCCESS;
-        }
-        else
-        {
-            stat = TNG_FAILURE;
-        }
-    }
-    if (stat == TNG_FAILURE)
-    {
-        /* The indexed atoms are added to one separate molecule. */
-        tng_molecule_alloc(tng, &mol);
-        tng_molecule_name_set(tng, mol, name);
-        tng_molecule_chain_add(tng, mol, "", &chain);
-
-        for (int i = 0; i < nind; i++)
-        {
-            char        temp_name[256], temp_type[256];
-
-            /* Try to retrieve the residue name of the atom */
-            stat = tng_residue_name_of_particle_nr_get(tng, ind[i], temp_name, 256);
-            if (stat != TNG_SUCCESS)
-            {
-                temp_name[0] = '\0';
-            }
-            /* Check if the molecule of the selection already contains this residue */
-            if (tng_chain_residue_find(tng, chain, temp_name, -1, &res)
-                != TNG_SUCCESS)
-            {
-                tng_chain_residue_add(tng, chain, temp_name, &res);
-            }
-            /* Try to find the original name and type of the atom */
-            stat = tng_atom_name_of_particle_nr_get(tng, ind[i], temp_name, 256);
-            if (stat != TNG_SUCCESS)
-            {
-                temp_name[0] = '\0';
-            }
-            stat = tng_atom_type_of_particle_nr_get(tng, ind[i], temp_type, 256);
-            if (stat != TNG_SUCCESS)
-            {
-                temp_type[0] = '\0';
-            }
-            tng_residue_atom_w_id_add(tng, res, temp_name, temp_type, ind[i], &atom);
-        }
-        tng_molecule_existing_add(tng, &mol);
-    }
-    /* Set the count of the molecule containing the selected atoms to 1 and all
-     * other molecules to 0 */
-    tng_molecule_cnt_set(tng, mol, 1);
-    tng_num_molecule_types_get(tng, &nMols);
-    for (gmx_int64_t k = 0; k < nMols; k++)
-    {
-        tng_molecule_of_index_get(tng, k, &iterMol);
-        if (iterMol == mol)
-        {
-            continue;
-        }
-        tng_molecule_cnt_set(tng, iterMol, 0);
-    }
-#else
-    GMX_UNUSED_VALUE(tng);
-    GMX_UNUSED_VALUE(nind);
-    GMX_UNUSED_VALUE(ind);
-    GMX_UNUSED_VALUE(name);
-#endif
-}
-
-/* TODO: If/when TNG acquires the ability to copy data blocks without
- * uncompressing them, then this implemenation should be reconsidered.
- * Ideally, gmx trjconv -f a.tng -o b.tng -b 10 -e 20 would be fast
- * and lose no information. */
-gmx_bool gmx_read_next_tng_frame(tng_trajectory_t            input,
-                                 t_trxframe                 *fr,
-                                 gmx_int64_t                *requestedIds,
-                                 int                         numRequestedIds)
-{
-#if GMX_USE_TNG
-    gmx_bool                bOK = TRUE;
-    tng_function_status     stat;
-    gmx_int64_t             numberOfAtoms = -1, frameNumber = -1;
-    gmx_int64_t             nBlocks, blockId, *blockIds = NULL, codecId;
-    char                    datatype      = -1;
-    void                   *values        = NULL;
-    double                  frameTime     = -1.0;
-    int                     size, blockDependency;
-    double                  prec;
-    const int               defaultNumIds = 5;
-    static gmx_int64_t      fallbackRequestedIds[defaultNumIds] =
-    {
-        TNG_TRAJ_BOX_SHAPE, TNG_TRAJ_POSITIONS,
-        TNG_TRAJ_VELOCITIES, TNG_TRAJ_FORCES,
-        TNG_GMX_LAMBDA
-    };
-
-
-    fr->bStep     = FALSE;
-    fr->bTime     = FALSE;
-    fr->bLambda   = FALSE;
-    fr->bAtoms    = FALSE;
-    fr->bPrec     = FALSE;
-    fr->bX        = FALSE;
-    fr->bV        = FALSE;
-    fr->bF        = FALSE;
-    fr->bBox      = FALSE;
-
-    /* If no specific IDs were requested read all block types that can
-     * currently be interpreted */
-    if (!requestedIds || numRequestedIds == 0)
-    {
-        numRequestedIds = defaultNumIds;
-        requestedIds    = fallbackRequestedIds;
-    }
-
-    stat = tng_num_particles_get(input, &numberOfAtoms);
-    if (stat != TNG_SUCCESS)
-    {
-        gmx_file("Cannot determine number of atoms from TNG file.");
-    }
-    fr->natoms = numberOfAtoms;
-
-    if (!gmx_get_tng_data_block_types_of_next_frame(input,
-                                                    fr->step,
-                                                    numRequestedIds,
-                                                    requestedIds,
-                                                    &frameNumber,
-                                                    &nBlocks,
-                                                    &blockIds))
-    {
-        return FALSE;
-    }
-
-    if (nBlocks == 0)
-    {
-        return FALSE;
-    }
-
-    for (gmx_int64_t i = 0; i < nBlocks; i++)
-    {
-        blockId = blockIds[i];
-        tng_data_block_dependency_get(input, blockId, &blockDependency);
-        if (blockDependency & TNG_PARTICLE_DEPENDENT)
-        {
-            stat = tng_util_particle_data_next_frame_read(input,
-                                                          blockId,
-                                                          &values,
-                                                          &datatype,
-                                                          &frameNumber,
-                                                          &frameTime);
-        }
-        else
-        {
-            stat = tng_util_non_particle_data_next_frame_read(input,
-                                                              blockId,
-                                                              &values,
-                                                              &datatype,
-                                                              &frameNumber,
-                                                              &frameTime);
-        }
-        if (stat == TNG_CRITICAL)
-        {
-            gmx_file("Cannot read positions from TNG file.");
-            return FALSE;
-        }
-        else if (stat == TNG_FAILURE)
-        {
-            continue;
-        }
-        switch (blockId)
-        {
-            case TNG_TRAJ_BOX_SHAPE:
-                switch (datatype)
-                {
-                    case TNG_INT_DATA:
-                        size = sizeof(gmx_int64_t);
-                        break;
-                    case TNG_FLOAT_DATA:
-                        size = sizeof(float);
-                        break;
-                    case TNG_DOUBLE_DATA:
-                        size = sizeof(double);
-                        break;
-                    default:
-                        gmx_incons("Illegal datatype of box shape values!");
-                }
-                for (int i = 0; i < DIM; i++)
-                {
-                    convert_array_to_real_array(reinterpret_cast<char *>(values) + size * i * DIM,
-                                                reinterpret_cast<real *>(fr->box[i]),
-                                                getDistanceScaleFactor(input),
-                                                1,
-                                                DIM,
-                                                datatype);
-                }
-                fr->bBox = TRUE;
-                break;
-            case TNG_TRAJ_POSITIONS:
-                srenew(fr->x, fr->natoms);
-                convert_array_to_real_array(values,
-                                            reinterpret_cast<real *>(fr->x),
-                                            getDistanceScaleFactor(input),
-                                            fr->natoms,
-                                            DIM,
-                                            datatype);
-                fr->bX = TRUE;
-                tng_util_frame_current_compression_get(input, blockId, &codecId, &prec);
-                /* This must be updated if/when more lossy compression methods are added */
-                if (codecId == TNG_TNG_COMPRESSION)
-                {
-                    fr->prec  = prec;
-                    fr->bPrec = TRUE;
-                }
-                break;
-            case TNG_TRAJ_VELOCITIES:
-                srenew(fr->v, fr->natoms);
-                convert_array_to_real_array(values,
-                                            (real *) fr->v,
-                                            getDistanceScaleFactor(input),
-                                            fr->natoms,
-                                            DIM,
-                                            datatype);
-                fr->bV = TRUE;
-                tng_util_frame_current_compression_get(input, blockId, &codecId, &prec);
-                /* This must be updated if/when more lossy compression methods are added */
-                if (codecId == TNG_TNG_COMPRESSION)
-                {
-                    fr->prec  = prec;
-                    fr->bPrec = TRUE;
-                }
-                break;
-            case TNG_TRAJ_FORCES:
-                srenew(fr->f, fr->natoms);
-                convert_array_to_real_array(values,
-                                            reinterpret_cast<real *>(fr->f),
-                                            getDistanceScaleFactor(input),
-                                            fr->natoms,
-                                            DIM,
-                                            datatype);
-                fr->bF = TRUE;
-                break;
-            case TNG_GMX_LAMBDA:
-                switch (datatype)
-                {
-                    case TNG_FLOAT_DATA:
-                        fr->lambda = *(reinterpret_cast<float *>(values));
-                        break;
-                    case TNG_DOUBLE_DATA:
-                        fr->lambda = *(reinterpret_cast<double *>(values));
-                        break;
-                    default:
-                        gmx_incons("Illegal datatype lambda value!");
-                }
-                fr->bLambda = TRUE;
-                break;
-            default:
-                gmx_warning("Illegal block type! Currently GROMACS tools can only handle certain data types. Skipping block.");
-        }
-        /* values does not have to be freed before reading next frame. It will
-         * be reallocated if it is not NULL. */
-    }
-
-    fr->step  = frameNumber;
-    fr->bStep = TRUE;
-    // Convert the time to ps
-    fr->time  = frameTime / PICO;
-    fr->bTime = TRUE;
-
-    /* values must be freed before leaving this function */
-    sfree(values);
-
-    return bOK;
-#else
-    GMX_UNUSED_VALUE(input);
-    GMX_UNUSED_VALUE(fr);
-    GMX_UNUSED_VALUE(requestedIds);
-    GMX_UNUSED_VALUE(numRequestedIds);
-    return FALSE;
-#endif
-}
-
-void gmx_print_tng_molecule_system(tng_trajectory_t input,
-                                   FILE            *stream)
-{
-#if GMX_USE_TNG
-    gmx_int64_t        nMolecules, nChains, nResidues, nAtoms, *molCntList;
-    tng_molecule_t     molecule;
-    tng_chain_t        chain;
-    tng_residue_t      residue;
-    tng_atom_t         atom;
-    char               str[256], varNAtoms;
-
-    tng_num_molecule_types_get(input, &nMolecules);
-    tng_molecule_cnt_list_get(input, &molCntList);
-    /* Can the number of particles change in the trajectory or is it constant? */
-    tng_num_particles_variable_get(input, &varNAtoms);
-
-    for (gmx_int64_t i = 0; i < nMolecules; i++)
-    {
-        tng_molecule_of_index_get(input, i, &molecule);
-        tng_molecule_name_get(input, molecule, str, 256);
-        if (varNAtoms == TNG_CONSTANT_N_ATOMS)
-        {
-            if ((int)molCntList[i] == 0)
-            {
-                continue;
-            }
-            fprintf(stream, "Molecule: %s, count: %d\n", str, (int)molCntList[i]);
-        }
-        else
-        {
-            fprintf(stream, "Molecule: %s\n", str);
-        }
-        tng_molecule_num_chains_get(input, molecule, &nChains);
-        if (nChains > 0)
-        {
-            for (gmx_int64_t j = 0; j < nChains; j++)
-            {
-                tng_molecule_chain_of_index_get(input, molecule, j, &chain);
-                tng_chain_name_get(input, chain, str, 256);
-                fprintf(stream, "\tChain: %s\n", str);
-                tng_chain_num_residues_get(input, chain, &nResidues);
-                for (gmx_int64_t k = 0; k < nResidues; k++)
-                {
-                    tng_chain_residue_of_index_get(input, chain, k, &residue);
-                    tng_residue_name_get(input, residue, str, 256);
-                    fprintf(stream, "\t\tResidue: %s\n", str);
-                    tng_residue_num_atoms_get(input, residue, &nAtoms);
-                    for (gmx_int64_t l = 0; l < nAtoms; l++)
-                    {
-                        tng_residue_atom_of_index_get(input, residue, l, &atom);
-                        tng_atom_name_get(input, atom, str, 256);
-                        fprintf(stream, "\t\t\tAtom: %s", str);
-                        tng_atom_type_get(input, atom, str, 256);
-                        fprintf(stream, " (%s)\n", str);
-                    }
-                }
-            }
-        }
-        /* It is possible to have a molecule without chains, in which case
-         * residues in the molecule can be iterated through without going
-         * through chains. */
-        else
-        {
-            tng_molecule_num_residues_get(input, molecule, &nResidues);
-            if (nResidues > 0)
-            {
-                for (gmx_int64_t k = 0; k < nResidues; k++)
-                {
-                    tng_molecule_residue_of_index_get(input, molecule, k, &residue);
-                    tng_residue_name_get(input, residue, str, 256);
-                    fprintf(stream, "\t\tResidue: %s\n", str);
-                    tng_residue_num_atoms_get(input, residue, &nAtoms);
-                    for (gmx_int64_t l = 0; l < nAtoms; l++)
-                    {
-                        tng_residue_atom_of_index_get(input, residue, l, &atom);
-                        tng_atom_name_get(input, atom, str, 256);
-                        fprintf(stream, "\t\t\tAtom: %s", str);
-                        tng_atom_type_get(input, atom, str, 256);
-                        fprintf(stream, " (%s)\n", str);
-                    }
-                }
-            }
-            else
-            {
-                tng_molecule_num_atoms_get(input, molecule, &nAtoms);
-                for (gmx_int64_t l = 0; l < nAtoms; l++)
-                {
-                    tng_molecule_atom_of_index_get(input, molecule, l, &atom);
-                    tng_atom_name_get(input, atom, str, 256);
-                    fprintf(stream, "\t\t\tAtom: %s", str);
-                    tng_atom_type_get(input, atom, str, 256);
-                    fprintf(stream, " (%s)\n", str);
-                }
-            }
-        }
-    }
-#else
-    GMX_UNUSED_VALUE(input);
-    GMX_UNUSED_VALUE(stream);
-#endif
-}
-
-gmx_bool gmx_get_tng_data_block_types_of_next_frame(tng_trajectory_t     input,
-                                                    int                  frame,
-                                                    int                  nRequestedIds,
-                                                    gmx_int64_t         *requestedIds,
-                                                    gmx_int64_t         *nextFrame,
-                                                    gmx_int64_t         *nBlocks,
-                                                    gmx_int64_t        **blockIds)
-{
-#if GMX_USE_TNG
-    tng_function_status stat;
-
-    stat = tng_util_trajectory_next_frame_present_data_blocks_find(input, frame,
-                                                                   nRequestedIds, requestedIds,
-                                                                   nextFrame,
-                                                                   nBlocks, blockIds);
-
-    if (stat == TNG_CRITICAL)
-    {
-        gmx_file("Cannot read TNG file. Cannot find data blocks of next frame.");
-    }
-    else if (stat == TNG_FAILURE)
-    {
-        return FALSE;
-    }
-    return TRUE;
-#else
-    GMX_UNUSED_VALUE(input);
-    GMX_UNUSED_VALUE(frame);
-    GMX_UNUSED_VALUE(nRequestedIds);
-    GMX_UNUSED_VALUE(requestedIds);
-    GMX_UNUSED_VALUE(nextFrame);
-    GMX_UNUSED_VALUE(nBlocks);
-    GMX_UNUSED_VALUE(blockIds);
-    return FALSE;
-#endif
-}
-
-gmx_bool gmx_get_tng_data_next_frame_of_block_type(tng_trajectory_t     input,
-                                                   gmx_int64_t          blockId,
-                                                   real               **values,
-                                                   gmx_int64_t         *frameNumber,
-                                                   double              *frameTime,
-                                                   gmx_int64_t         *nValuesPerFrame,
-                                                   gmx_int64_t         *nAtoms,
-                                                   real                *prec,
-                                                   char                *name,
-                                                   int                  maxLen,
-                                                   gmx_bool            *bOK)
-{
-#if GMX_USE_TNG
-    tng_function_status stat;
-    char                datatype = -1;
-    gmx_int64_t         codecId;
-    int                 blockDependency;
-    void               *data = 0;
-    double              localPrec;
-
-    stat = tng_data_block_name_get(input, blockId, name, maxLen);
-    if (stat != TNG_SUCCESS)
-    {
-        gmx_file("Cannot read next frame of TNG file");
-    }
-    stat = tng_data_block_dependency_get(input, blockId, &blockDependency);
-    if (stat != TNG_SUCCESS)
-    {
-        gmx_file("Cannot read next frame of TNG file");
-    }
-    if (blockDependency & TNG_PARTICLE_DEPENDENT)
-    {
-        tng_num_particles_get(input, nAtoms);
-        stat = tng_util_particle_data_next_frame_read(input,
-                                                      blockId,
-                                                      &data,
-                                                      &datatype,
-                                                      frameNumber,
-                                                      frameTime);
-    }
-    else
-    {
-        *nAtoms = 1; /* There are not actually any atoms, but it is used for
-                        allocating memory */
-        stat    = tng_util_non_particle_data_next_frame_read(input,
-                                                             blockId,
-                                                             &data,
-                                                             &datatype,
-                                                             frameNumber,
-                                                             frameTime);
-    }
-    if (stat == TNG_CRITICAL)
-    {
-        gmx_file("Cannot read next frame of TNG file");
-    }
-    if (stat == TNG_FAILURE)
-    {
-        *bOK = TRUE;
-        return FALSE;
-    }
-
-    stat = tng_data_block_num_values_per_frame_get(input, blockId, nValuesPerFrame);
-    if (stat != TNG_SUCCESS)
-    {
-        gmx_file("Cannot read next frame of TNG file");
-    }
-    srenew(*values, sizeof(real) * *nValuesPerFrame * *nAtoms);
-    convert_array_to_real_array(data,
-                                *values,
-                                getDistanceScaleFactor(input),
-                                *nAtoms,
-                                *nValuesPerFrame,
-                                datatype);
-
-    tng_util_frame_current_compression_get(input, blockId, &codecId, &localPrec);
-
-    /* This must be updated if/when more lossy compression methods are added */
-    if (codecId != TNG_TNG_COMPRESSION)
-    {
-        *prec = -1.0;
-    }
-    else
-    {
-        *prec = localPrec;
-    }
-
-    *bOK = TRUE;
-    return TRUE;
-#else
-    GMX_UNUSED_VALUE(input);
-    GMX_UNUSED_VALUE(blockId);
-    GMX_UNUSED_VALUE(values);
-    GMX_UNUSED_VALUE(frameNumber);
-    GMX_UNUSED_VALUE(frameTime);
-    GMX_UNUSED_VALUE(nValuesPerFrame);
-    GMX_UNUSED_VALUE(nAtoms);
-    GMX_UNUSED_VALUE(prec);
-    GMX_UNUSED_VALUE(name);
-    GMX_UNUSED_VALUE(maxLen);
-    GMX_UNUSED_VALUE(bOK);
-    return FALSE;
-#endif
-}
diff --git a/src/gromacs/fileio/tngio_for_tools.h b/src/gromacs/fileio/tngio_for_tools.h
deleted file mode 100644 (file)
index da0d7a7..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2013,2014,2015,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.
- */
-#ifndef GMX_FILEIO_TNGIO_FOR_TOOLS_H
-#define GMX_FILEIO_TNGIO_FOR_TOOLS_H
-
-#include <stdio.h>
-
-#include "tng/tng_io_fwd.h"
-
-#include "gromacs/utility/basedefinitions.h"
-#include "gromacs/utility/real.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-}
-#endif
-
-struct gmx_mtop_t;
-struct t_trxframe;
-
-/*! \brief Prepare to write TNG output from trajectory conversion tools */
-void gmx_prepare_tng_writing(const char              *filename,
-                             char                     mode,
-                             tng_trajectory_t        *in,
-                             tng_trajectory_t        *out,
-                             int                      nAtoms,
-                             const struct gmx_mtop_t *mtop,
-                             const int               *index,
-                             const char              *indexGroupName);
-
-/*! \brief Write a trxframe to a TNG file
- *
- * \param output Trajectory to write to
- * \param frame  Frame data to write
- * \param natoms Number of atoms to actually write
- *
- * The natoms field in frame is the number of atoms in the system. The
- * parameter natoms supports writing an index-group subset of the
- * atoms.
- */
-void gmx_write_tng_from_trxframe(tng_trajectory_t        output,
-                                 const t_trxframe       *frame,
-                                 int                     natoms);
-
-/*! \brief Creates a molecule containing only the indexed atoms and sets
- * the number of all other molecules to 0. Works similar to a
- * selection group. */
-void gmx_tng_setup_atom_subgroup(tng_trajectory_t tng,
-                                 const int        nind,
-                                 const int       *ind,
-                                 const char      *name);
-
-/*! \brief Read the first/next TNG frame. */
-gmx_bool gmx_read_next_tng_frame(tng_trajectory_t            input,
-                                 struct t_trxframe          *fr,
-                                 gmx_int64_t                *requestedIds,
-                                 int                         numRequestedIds);
-
-/*! \brief Print the molecule system to stream */
-void gmx_print_tng_molecule_system(tng_trajectory_t input,
-                                   FILE            *stream);
-
-/*! \brief Get a list of block IDs present in the next frame with data. */
-gmx_bool gmx_get_tng_data_block_types_of_next_frame(tng_trajectory_t     input,
-                                                    int                  frame,
-                                                    int                  nRequestedIds,
-                                                    gmx_int64_t         *requestedIds,
-                                                    gmx_int64_t         *nextFrame,
-                                                    gmx_int64_t         *nBlocks,
-                                                    gmx_int64_t        **blockIds);
-
-/*! \brief Get data of the next frame with data from the data block
- * with the specified block ID. */
-gmx_bool gmx_get_tng_data_next_frame_of_block_type(tng_trajectory_t     input,
-                                                   gmx_int64_t          blockId,
-                                                   real               **values,
-                                                   gmx_int64_t         *frameNumber,
-                                                   double              *frameTime,
-                                                   gmx_int64_t         *nValuesPerFrame,
-                                                   gmx_int64_t         *nAtoms,
-                                                   real                *prec,
-                                                   char                *name,
-                                                   int                  maxLen,
-                                                   gmx_bool            *bOK);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
index 4b67fc762aa96042d9c256065612b6fd6215433c..d6f69751407c3eddd2f82b0362049bd9a2f0cadb 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,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.
@@ -68,6 +68,9 @@
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/keyvaluetreebuilder.h"
+#include "gromacs/utility/keyvaluetreeserializer.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/snprintf.h"
 #include "gromacs/utility/txtdump.h"
@@ -111,6 +114,7 @@ enum tpxv {
     tpxv_RemoveTwinRange,                                    /**< removed support for twin-range interactions */
     tpxv_ReplacePullPrintCOM12,                              /**< Replaced print-com-1, 2 with pull-print-com */
     tpxv_PullExternalPotential,                              /**< Added pull type external potential */
+    tpxv_GenericParamsForElectricField,                      /**< Introduced KeyValueTree and moved electric field parameters */
     tpxv_Count                                               /**< the total number of tpxv versions */
 };
 
@@ -146,7 +150,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 = 9;
+static const int tpx_incompatible_version = 30; // GMX3.2 has version 31
 
 
 
@@ -162,24 +166,16 @@ typedef struct {
  * 2. ascending file version number
  */
 static const t_ftupd ftupd[] = {
-    { 20, F_CUBICBONDS        },
-    { 20, F_CONNBONDS         },
-    { 20, F_HARMONIC          },
     { 34, F_FENEBONDS         },
     { 43, F_TABBONDS          },
     { 43, F_TABBONDSNC        },
     { 70, F_RESTRBONDS        },
     { tpxv_RestrictedBendingAndCombinedAngleTorsionPotentials, F_RESTRANGLES },
     { 76, F_LINEAR_ANGLES     },
-    { 30, F_CROSS_BOND_BONDS  },
-    { 30, F_CROSS_BOND_ANGLES },
-    { 30, F_UREY_BRADLEY      },
     { 34, F_QUARTIC_ANGLES    },
     { 43, F_TABANGLES         },
     { tpxv_RestrictedBendingAndCombinedAngleTorsionPotentials, F_RESTRDIHS },
     { tpxv_RestrictedBendingAndCombinedAngleTorsionPotentials, F_CBTDIHS },
-    { 26, F_FOURDIHS          },
-    { 26, F_PIDIHS            },
     { 43, F_TABDIHS           },
     { 65, F_CMAP              },
     { 60, F_GB12              },
@@ -194,18 +190,11 @@ static const t_ftupd ftupd[] = {
     { 32, F_COUL_RECIP        },
     { 93, F_LJ_RECIP          },
     { 46, F_DPD               },
-    { 30, F_POLARIZATION      },
     { 36, F_THOLE_POL         },
     { 90, F_FBPOSRES          },
-    { 22, F_DISRESVIOL        },
-    { 22, F_ORIRES            },
-    { 22, F_ORIRESDEV         },
-    { 26, F_DIHRES            },
-    { 26, F_DIHRESVIOL        },
     { 49, F_VSITE4FDN         },
     { 50, F_VSITEN            },
     { 46, F_COM_PULL          },
-    { 20, F_EQM               },
     { 46, F_ECONSERVED        },
     { 69, F_VTEMP_NOLONGERUSED},
     { 66, F_PDISPCORR         },
@@ -306,14 +295,14 @@ static void do_pull_coord(t_fileio *fio, t_pull_coord *pcrd,
             }
             else
             {
-                pcrd->externalPotentialProvider = NULL;
+                pcrd->externalPotentialProvider = nullptr;
             }
         }
         else
         {
             if (bRead)
             {
-                pcrd->externalPotentialProvider = NULL;
+                pcrd->externalPotentialProvider = nullptr;
             }
         }
         /* Note that we try to support adding new geometries without
@@ -552,20 +541,13 @@ static void do_fepvals(t_fileio *fio, t_lambda *fepvals, gmx_bool bRead, int fil
     else
     {
         fepvals->n_lambda     = 0;
-        fepvals->all_lambda   = NULL;
+        fepvals->all_lambda   = nullptr;
         if (fepvals->init_lambda >= 0)
         {
             fepvals->separate_dvdl[efptFEP] = TRUE;
         }
     }
-    if (file_version >= 13)
-    {
-        gmx_fio_do_real(fio, fepvals->sc_alpha);
-    }
-    else
-    {
-        fepvals->sc_alpha = 0;
-    }
+    gmx_fio_do_real(fio, fepvals->sc_alpha);
     if (file_version >= 38)
     {
         gmx_fio_do_int(fio, fepvals->sc_power);
@@ -582,14 +564,7 @@ static void do_fepvals(t_fileio *fio, t_lambda *fepvals, gmx_bool bRead, int fil
     {
         fepvals->sc_r_power = 6.0;
     }
-    if (file_version >= 15)
-    {
-        gmx_fio_do_real(fio, fepvals->sc_sigma);
-    }
-    else
-    {
-        fepvals->sc_sigma = 0.3;
-    }
+    gmx_fio_do_real(fio, fepvals->sc_sigma);
     if (bRead)
     {
         if (file_version >= 71)
@@ -947,15 +922,47 @@ static void do_swapcoords_tpx(t_fileio *fio, t_swapcoords *swap, gmx_bool bRead,
 
 }
 
+static void do_legacy_efield(t_fileio *fio, gmx::KeyValueTreeObjectBuilder *root)
+{
+    const char *const dimName[] = { "x", "y", "z" };
+
+    auto              appliedForcesObj = root->addObject("applied-forces");
+    auto              efieldObj        = appliedForcesObj.addObject("electric-field");
+    // The content of the tpr file for this feature has
+    // been the same since gromacs 4.0 that was used for
+    // developing.
+    for (int j = 0; j < DIM; ++j)
+    {
+        int n, nt;
+        gmx_fio_do_int(fio, n);
+        gmx_fio_do_int(fio, nt);
+        std::vector<real> aa(n+1), phi(nt+1), at(nt+1), phit(nt+1);
+        gmx_fio_ndo_real(fio, aa.data(),  n);
+        gmx_fio_ndo_real(fio, phi.data(), n);
+        gmx_fio_ndo_real(fio, at.data(),  nt);
+        gmx_fio_ndo_real(fio, phit.data(), nt);
+        if (n > 0)
+        {
+            if (n > 1 || nt > 1)
+            {
+                gmx_fatal(FARGS, "Can not handle tpr files with more than one electric field term per direction.");
+            }
+            auto dimObj = efieldObj.addObject(dimName[j]);
+            dimObj.addValue<real>("E0", aa[0]);
+            dimObj.addValue<real>("omega", at[0]);
+            dimObj.addValue<real>("t0", phi[0]);
+            dimObj.addValue<real>("sigma", phit[0]);
+        }
+    }
+}
+
 
 static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
                         int file_version, real *fudgeQQ)
 {
-    int      i, j, k, *tmp, idum = 0;
+    int      i, j, k, idum = 0;
     real     rdum, bd_temp;
-    rvec     vdum;
-    gmx_bool bSimAnn, bdum = 0;
-    real     zerotemptime, finish_t, init_temp, finish_temp;
+    gmx_bool bdum = 0;
 
     if (file_version != tpx_version)
     {
@@ -964,16 +971,14 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
                 file_version, tpx_version);
     }
 
-    if (bRead)
-    {
-        init_inputrec(ir);
-    }
-
     if (file_version == 0)
     {
         return;
     }
 
+    gmx::KeyValueTreeBuilder       paramsBuilder;
+    gmx::KeyValueTreeObjectBuilder paramsObj = paramsBuilder.rootObject();
+
     /* Basic inputrec stuff */
     gmx_fio_do_int(fio, ir->eI);
     if (file_version >= 62)
@@ -986,21 +991,14 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
         ir->nsteps = idum;
     }
 
-    if (file_version > 25)
+    if (file_version >= 62)
     {
-        if (file_version >= 62)
-        {
-            gmx_fio_do_int64(fio, ir->init_step);
-        }
-        else
-        {
-            gmx_fio_do_int(fio, idum);
-            ir->init_step = idum;
-        }
+        gmx_fio_do_int64(fio, ir->init_step);
     }
     else
     {
-        ir->init_step = 0;
+        gmx_fio_do_int(fio, idum);
+        ir->init_step = idum;
     }
 
     if (file_version >= 58)
@@ -1026,10 +1024,6 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
          * since we always want it, also without reading the inputrec.
          */
         gmx_fio_do_int(fio, ir->ePBC);
-        if ((file_version <= 15) && (ir->ePBC == 2))
-        {
-            ir->ePBC = epbcNONE;
-        }
         if (file_version >= 45)
         {
             gmx_fio_do_int(fio, ir->bPeriodicMols);
@@ -1091,21 +1085,14 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
     ir->nstcomm = abs(ir->nstcomm);
 
     /* ignore nstcheckpoint */
-    if (file_version > 25 && file_version < tpxv_RemoveObsoleteParameters1)
+    if (file_version < tpxv_RemoveObsoleteParameters1)
     {
         gmx_fio_do_int(fio, idum);
     }
 
     gmx_fio_do_int(fio, ir->nstcgsteep);
 
-    if (file_version >= 30)
-    {
-        gmx_fio_do_int(fio, ir->nbfgscorr);
-    }
-    else if (bRead)
-    {
-        ir->nbfgscorr = 10;
-    }
+    gmx_fio_do_int(fio, ir->nbfgscorr);
 
     gmx_fio_do_int(fio, ir->nstlog);
     gmx_fio_do_int(fio, ir->nstxout);
@@ -1126,15 +1113,6 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
         ir->delta_t = rdum;
     }
     gmx_fio_do_real(fio, ir->x_compression_precision);
-    if (file_version < 19)
-    {
-        gmx_fio_do_int(fio, idum);
-        gmx_fio_do_int(fio, idum);
-    }
-    if (file_version < 18)
-    {
-        gmx_fio_do_int(fio, idum);
-    }
     if (file_version >= 81)
     {
         gmx_fio_do_real(fio, ir->verletbuf_tol);
@@ -1226,31 +1204,13 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
             ir->epsilon_rf = 1.0;
         }
     }
-    if (file_version >= 29)
-    {
-        gmx_fio_do_real(fio, ir->tabext);
-    }
-    else
-    {
-        ir->tabext = 1.0;
-    }
+    gmx_fio_do_real(fio, ir->tabext);
 
-    if (file_version > 25)
-    {
-        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);
-    }
-    else
-    {
-        ir->gb_algorithm     = egbSTILL;
-        ir->nstgbradii       = 1;
-        ir->rgbradii         = 1.0;
-        ir->gb_saltconc      = 0;
-        ir->implicit_solvent = eisNO;
-    }
+    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)
     {
         gmx_fio_do_real(fio, ir->gb_epsilon_solvent);
@@ -1316,28 +1276,8 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
     {
         ir->ewald_rtol_lj = ir->ewald_rtol;
     }
-
-    if (file_version >= 24)
-    {
-        gmx_fio_do_int(fio, ir->ewald_geometry);
-    }
-    else
-    {
-        ir->ewald_geometry = eewg3D;
-    }
-
-    if (file_version <= 17)
-    {
-        ir->epsilon_surface = 0;
-        if (file_version == 17)
-        {
-            gmx_fio_do_int(fio, idum);
-        }
-    }
-    else
-    {
-        gmx_fio_do_real(fio, ir->epsilon_surface);
-    }
+    gmx_fio_do_int(fio, ir->ewald_geometry);
+    gmx_fio_do_real(fio, ir->epsilon_surface);
 
     /* ignore bOptFFT */
     if (file_version < tpxv_RemoveObsoleteParameters1)
@@ -1367,38 +1307,8 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
     {
         ir->nsttcouple = ir->nstcalcenergy;
     }
-    if (file_version <= 15)
-    {
-        gmx_fio_do_int(fio, idum);
-    }
-    if (file_version <= 17)
-    {
-        gmx_fio_do_int(fio, ir->epct);
-        if (file_version <= 15)
-        {
-            if (ir->epct == 5)
-            {
-                ir->epct = epctSURFACETENSION;
-            }
-            gmx_fio_do_int(fio, idum);
-        }
-        ir->epct -= 1;
-        /* we have removed the NO alternative at the beginning */
-        if (ir->epct == -1)
-        {
-            ir->epc  = epcNO;
-            ir->epct = epctISOTROPIC;
-        }
-        else
-        {
-            ir->epc = epcBERENDSEN;
-        }
-    }
-    else
-    {
-        gmx_fio_do_int(fio, ir->epc);
-        gmx_fio_do_int(fio, ir->epct);
-    }
+    gmx_fio_do_int(fio, ir->epc);
+    gmx_fio_do_int(fio, ir->epct);
     if (file_version >= 71)
     {
         gmx_fio_do_int(fio, ir->nstpcouple);
@@ -1408,36 +1318,12 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
         ir->nstpcouple = ir->nstcalcenergy;
     }
     gmx_fio_do_real(fio, ir->tau_p);
-    if (file_version <= 15)
-    {
-        gmx_fio_do_rvec(fio, vdum);
-        clear_mat(ir->ref_p);
-        for (i = 0; i < DIM; i++)
-        {
-            ir->ref_p[i][i] = vdum[i];
-        }
-    }
-    else
-    {
-        gmx_fio_do_rvec(fio, ir->ref_p[XX]);
-        gmx_fio_do_rvec(fio, ir->ref_p[YY]);
-        gmx_fio_do_rvec(fio, ir->ref_p[ZZ]);
-    }
-    if (file_version <= 15)
-    {
-        gmx_fio_do_rvec(fio, vdum);
-        clear_mat(ir->compress);
-        for (i = 0; i < DIM; i++)
-        {
-            ir->compress[i][i] = vdum[i];
-        }
-    }
-    else
-    {
-        gmx_fio_do_rvec(fio, ir->compress[XX]);
-        gmx_fio_do_rvec(fio, ir->compress[YY]);
-        gmx_fio_do_rvec(fio, ir->compress[ZZ]);
-    }
+    gmx_fio_do_rvec(fio, ir->ref_p[XX]);
+    gmx_fio_do_rvec(fio, ir->ref_p[YY]);
+    gmx_fio_do_rvec(fio, ir->ref_p[ZZ]);
+    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);
@@ -1450,7 +1336,7 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
         clear_rvec(ir->posres_com);
         clear_rvec(ir->posres_comB);
     }
-    if ((file_version > 25) && (file_version < 79))
+    if (file_version < 79)
     {
         gmx_fio_do_int(fio, ir->andersen_seed);
     }
@@ -1458,11 +1344,6 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
     {
         ir->andersen_seed = 0;
     }
-    if (file_version < 26)
-    {
-        gmx_fio_do_gmx_bool(fio, bSimAnn);
-        gmx_fio_do_real(fio, zerotemptime);
-    }
 
     if (file_version < 37)
     {
@@ -1472,14 +1353,11 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
     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);
-    if (file_version <= 14 && ir->efep != efepNO)
-    {
-        ir->efep = efepYES;
-    }
     do_fepvals(fio, ir->fepvals, bRead, file_version);
 
     if (file_version >= 79)
@@ -1520,36 +1398,16 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
         gmx_fio_do_int(fio, ir->eDisre);
     }
     gmx_fio_do_int(fio, ir->eDisreWeighting);
-    if (file_version < 22)
-    {
-        if (ir->eDisreWeighting == 0)
-        {
-            ir->eDisreWeighting = edrwEqual;
-        }
-        else
-        {
-            ir->eDisreWeighting = edrwConservative;
-        }
-    }
     gmx_fio_do_gmx_bool(fio, ir->bDisreMixed);
     gmx_fio_do_real(fio, ir->dr_fc);
     gmx_fio_do_real(fio, ir->dr_tau);
     gmx_fio_do_int(fio, ir->nstdisreout);
-    if (file_version >= 22)
-    {
-        gmx_fio_do_real(fio, ir->orires_fc);
-        gmx_fio_do_real(fio, ir->orires_tau);
-        gmx_fio_do_int(fio, ir->nstorireout);
-    }
-    else
-    {
-        ir->orires_fc   = 0;
-        ir->orires_tau  = 0;
-        ir->nstorireout = 0;
-    }
+    gmx_fio_do_real(fio, ir->orires_fc);
+    gmx_fio_do_real(fio, ir->orires_tau);
+    gmx_fio_do_int(fio, ir->nstorireout);
 
     /* ignore dihre_fc */
-    if (file_version >= 26 && file_version < 79)
+    if (file_version < 79)
     {
         gmx_fio_do_real(fio, rdum);
         if (file_version < 56)
@@ -1561,49 +1419,13 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
 
     gmx_fio_do_real(fio, ir->em_stepsize);
     gmx_fio_do_real(fio, ir->em_tol);
-    if (file_version >= 22)
-    {
-        gmx_fio_do_gmx_bool(fio, ir->bShakeSOR);
-    }
-    else if (bRead)
-    {
-        ir->bShakeSOR = TRUE;
-    }
-    if (file_version >= 11)
-    {
-        gmx_fio_do_int(fio, ir->niter);
-    }
-    else if (bRead)
-    {
-        ir->niter = 25;
-        fprintf(stderr, "Note: niter not in run input file, setting it to %d\n",
-                ir->niter);
-    }
-    if (file_version >= 21)
-    {
-        gmx_fio_do_real(fio, ir->fc_stepsize);
-    }
-    else
-    {
-        ir->fc_stepsize = 0;
-    }
+    gmx_fio_do_gmx_bool(fio, ir->bShakeSOR);
+    gmx_fio_do_int(fio, ir->niter);
+    gmx_fio_do_real(fio, ir->fc_stepsize);
     gmx_fio_do_int(fio, ir->eConstrAlg);
     gmx_fio_do_int(fio, ir->nProjOrder);
     gmx_fio_do_real(fio, ir->LincsWarnAngle);
-    if (file_version <= 14)
-    {
-        gmx_fio_do_int(fio, idum);
-    }
-    if (file_version >= 26)
-    {
-        gmx_fio_do_int(fio, ir->nLincsIter);
-    }
-    else if (bRead)
-    {
-        ir->nLincsIter = 1;
-        fprintf(stderr, "Note: nLincsIter not in run input file, setting it to %d\n",
-                ir->nLincsIter);
-    }
+    gmx_fio_do_int(fio, ir->nLincsIter);
     if (file_version < 33)
     {
         gmx_fio_do_real(fio, bd_temp);
@@ -1632,14 +1454,8 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
             clear_rvec(ir->deform[i]);
         }
     }
-    if (file_version >= 14)
-    {
-        gmx_fio_do_real(fio, ir->cos_accel);
-    }
-    else if (bRead)
-    {
-        ir->cos_accel = 0;
-    }
+    gmx_fio_do_real(fio, ir->cos_accel);
+
     gmx_fio_do_int(fio, ir->userint1);
     gmx_fio_do_int(fio, ir->userint2);
     gmx_fio_do_int(fio, ir->userint3);
@@ -1784,20 +1600,7 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
     }
     if (ir->opts.ngtc > 0)
     {
-        if (bRead && file_version < 13)
-        {
-            snew(tmp, ir->opts.ngtc);
-            gmx_fio_ndo_int(fio, tmp, ir->opts.ngtc);
-            for (i = 0; i < ir->opts.ngtc; i++)
-            {
-                ir->opts.nrdf[i] = tmp[i];
-            }
-            sfree(tmp);
-        }
-        else
-        {
-            gmx_fio_ndo_real(fio, ir->opts.nrdf, ir->opts.ngtc);
-        }
+        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)
@@ -1816,55 +1619,22 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
     {
         gmx_fio_ndo_rvec(fio, ir->opts.acc, ir->opts.ngacc);
     }
-    if (file_version >= 12)
-    {
-        gmx_fio_ndo_int(fio, ir->opts.egp_flags,
-                        ir->opts.ngener*ir->opts.ngener);
-    }
+    gmx_fio_ndo_int(fio, ir->opts.egp_flags,
+                    ir->opts.ngener*ir->opts.ngener);
 
-    if (bRead && file_version < 26)
+    /* First read the lists with annealing and npoints for each group */
+    gmx_fio_ndo_int(fio, ir->opts.annealing, ir->opts.ngtc);
+    gmx_fio_ndo_int(fio, ir->opts.anneal_npoints, ir->opts.ngtc);
+    for (j = 0; j < (ir->opts.ngtc); j++)
     {
-        for (i = 0; i < ir->opts.ngtc; i++)
-        {
-            if (bSimAnn)
-            {
-                ir->opts.annealing[i]      = eannSINGLE;
-                ir->opts.anneal_npoints[i] = 2;
-                snew(ir->opts.anneal_time[i], 2);
-                snew(ir->opts.anneal_temp[i], 2);
-                /* calculate the starting/ending temperatures from reft, zerotemptime, and nsteps */
-                finish_t                   = ir->init_t + ir->nsteps * ir->delta_t;
-                init_temp                  = ir->opts.ref_t[i]*(1-ir->init_t/zerotemptime);
-                finish_temp                = ir->opts.ref_t[i]*(1-finish_t/zerotemptime);
-                ir->opts.anneal_time[i][0] = ir->init_t;
-                ir->opts.anneal_time[i][1] = finish_t;
-                ir->opts.anneal_temp[i][0] = init_temp;
-                ir->opts.anneal_temp[i][1] = finish_temp;
-            }
-            else
-            {
-                ir->opts.annealing[i]      = eannNO;
-                ir->opts.anneal_npoints[i] = 0;
-            }
-        }
-    }
-    else
-    {
-        /* file version 26 or later */
-        /* First read the lists with annealing and npoints for each group */
-        gmx_fio_ndo_int(fio, ir->opts.annealing, ir->opts.ngtc);
-        gmx_fio_ndo_int(fio, ir->opts.anneal_npoints, ir->opts.ngtc);
-        for (j = 0; j < (ir->opts.ngtc); j++)
+        k = ir->opts.anneal_npoints[j];
+        if (bRead)
         {
-            k = ir->opts.anneal_npoints[j];
-            if (bRead)
-            {
-                snew(ir->opts.anneal_time[j], k);
-                snew(ir->opts.anneal_temp[j], k);
-            }
-            gmx_fio_ndo_real(fio, ir->opts.anneal_time[j], k);
-            gmx_fio_ndo_real(fio, ir->opts.anneal_temp[j], k);
+            snew(ir->opts.anneal_time[j], k);
+            snew(ir->opts.anneal_temp[j], k);
         }
+        gmx_fio_ndo_real(fio, ir->opts.anneal_time[j], k);
+        gmx_fio_ndo_real(fio, ir->opts.anneal_temp[j], k);
     }
     /* Walls */
     if (file_version >= 45)
@@ -1896,21 +1666,9 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
         ir->wall_ewald_zfac  = 3;
     }
     /* Cosine stuff for electric fields */
-    for (j = 0; (j < DIM); j++)
+    if (file_version < tpxv_GenericParamsForElectricField)
     {
-        gmx_fio_do_int(fio, ir->ex[j].n);
-        gmx_fio_do_int(fio, ir->et[j].n);
-        if (bRead)
-        {
-            snew(ir->ex[j].a,  ir->ex[j].n);
-            snew(ir->ex[j].phi, ir->ex[j].n);
-            snew(ir->et[j].a,  ir->et[j].n);
-            snew(ir->et[j].phi, ir->et[j].n);
-        }
-        gmx_fio_ndo_real(fio, ir->ex[j].a,  ir->ex[j].n);
-        gmx_fio_ndo_real(fio, ir->ex[j].phi, ir->ex[j].n);
-        gmx_fio_ndo_real(fio, ir->et[j].a,  ir->et[j].n);
-        gmx_fio_ndo_real(fio, ir->et[j].phi, ir->et[j].n);
+        do_legacy_efield(fio, &paramsObj);
     }
 
     /* Swap ions */
@@ -1966,6 +1724,26 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
         }
         /* end of QMMM stuff */
     }
+
+    if (file_version >= tpxv_GenericParamsForElectricField)
+    {
+        gmx::FileIOXdrSerializer serializer(fio);
+        if (bRead)
+        {
+            paramsObj.mergeObject(
+                    gmx::deserializeKeyValueTree(&serializer));
+        }
+        else
+        {
+            GMX_RELEASE_ASSERT(ir->params != nullptr,
+                               "Parameters should be present when writing inputrec");
+            gmx::serializeKeyValueTree(*ir->params, &serializer);
+        }
+    }
+    if (bRead)
+    {
+        ir->params = new gmx::KeyValueTreeObject(paramsBuilder.build());
+    }
 }
 
 
@@ -1977,8 +1755,8 @@ static void do_harm(t_fileio *fio, t_iparams *iparams)
     gmx_fio_do_real(fio, iparams->harmonic.krB);
 }
 
-void do_iparams(t_fileio *fio, t_functype ftype, t_iparams *iparams,
-                gmx_bool bRead, int file_version)
+static void do_iparams(t_fileio *fio, t_functype ftype, t_iparams *iparams,
+                       gmx_bool bRead, int file_version)
 {
     int      idum;
     real     rdum;
@@ -2105,10 +1883,6 @@ void do_iparams(t_fileio *fio, t_functype ftype, t_iparams *iparams,
             gmx_fio_do_real(fio, iparams->anharm_polarize.khyp);
             break;
         case F_WATER_POL:
-            if (file_version < 31)
-            {
-                gmx_fatal(FARGS, "Old tpr files with water_polarization not supported. Make a new.");
-            }
             gmx_fio_do_real(fio, iparams->wpol.al_x);
             gmx_fio_do_real(fio, iparams->wpol.al_y);
             gmx_fio_do_real(fio, iparams->wpol.al_z);
@@ -2211,16 +1985,8 @@ void do_iparams(t_fileio *fio, t_functype ftype, t_iparams *iparams,
         case F_POSRES:
             gmx_fio_do_rvec(fio, iparams->posres.pos0A);
             gmx_fio_do_rvec(fio, iparams->posres.fcA);
-            if (bRead && file_version < 27)
-            {
-                copy_rvec(iparams->posres.pos0A, iparams->posres.pos0B);
-                copy_rvec(iparams->posres.fcA, iparams->posres.fcB);
-            }
-            else
-            {
-                gmx_fio_do_rvec(fio, iparams->posres.pos0B);
-                gmx_fio_do_rvec(fio, iparams->posres.fcB);
-            }
+            gmx_fio_do_rvec(fio, iparams->posres.pos0B);
+            gmx_fio_do_rvec(fio, iparams->posres.fcB);
             break;
         case F_FBPOSRES:
             gmx_fio_do_int(fio, iparams->fbposres.geom);
@@ -2233,10 +1999,7 @@ void do_iparams(t_fileio *fio, t_functype ftype, t_iparams *iparams,
             break;
         case F_RBDIHS:
             gmx_fio_ndo_real(fio, iparams->rbdihs.rbcA, NR_RBDIHS);
-            if (file_version >= 25)
-            {
-                gmx_fio_ndo_real(fio, iparams->rbdihs.rbcB, NR_RBDIHS);
-            }
+            gmx_fio_ndo_real(fio, iparams->rbdihs.rbcB, NR_RBDIHS);
             break;
         case F_FOURDIHS:
             /* Fourier dihedrals are internally represented
@@ -2418,7 +2181,7 @@ static void do_ilists(t_fileio *fio, t_ilist *ilist, gmx_bool bRead,
         if (bClear)
         {
             ilist[j].nr     = 0;
-            ilist[j].iatoms = NULL;
+            ilist[j].iatoms = nullptr;
         }
         else
         {
@@ -2462,7 +2225,7 @@ static void do_block(t_fileio *fio, t_block *block, gmx_bool bRead, int file_ver
     }
     if (bRead)
     {
-        if ((block->nalloc_index > 0) && (NULL != block->index))
+        if ((block->nalloc_index > 0) && (nullptr != block->index))
         {
             sfree(block->index);
         }
@@ -2575,11 +2338,7 @@ static void do_atom(t_fileio *fio, t_atom *atom, int ngrp, gmx_bool bRead,
     {
         atom->atomnumber = 0;
     }
-    if (file_version < 23)
-    {
-        myngrp = 8;
-    }
-    else if (file_version < 39)
+    if (file_version < 39)
     {
         myngrp = 9;
     }
@@ -2609,11 +2368,7 @@ static void do_grps(t_fileio *fio, int ngrp, t_grps grps[], gmx_bool bRead,
 {
     int      j, myngrp;
 
-    if (file_version < 23)
-    {
-        myngrp = 8;
-    }
-    else if (file_version < 39)
+    if (file_version < 39)
     {
         myngrp = 9;
     }
@@ -2708,6 +2463,16 @@ static void do_atoms(t_fileio *fio, t_atoms *atoms, gmx_bool bRead, t_symtab *sy
     }
     if (bRead)
     {
+        /* Since we have always written all t_atom properties in the tpr file
+         * (at least for all backward compatible versions), we don't store
+         * but simple set the booleans here.
+         */
+        atoms->haveMass    = TRUE;
+        atoms->haveCharge  = TRUE;
+        atoms->haveType    = TRUE;
+        atoms->haveBState  = TRUE;
+        atoms->havePdbInfo = FALSE;
+
         snew(atoms->atom, atoms->nr);
         snew(atoms->atomname, atoms->nr);
         snew(atoms->atomtype, atoms->nr);
@@ -2717,26 +2482,20 @@ static void do_atoms(t_fileio *fio, t_atoms *atoms, gmx_bool bRead, t_symtab *sy
         {
             snew(groups->grpname, groups->ngrpname);
         }
-        atoms->pdbinfo = NULL;
+        atoms->pdbinfo = nullptr;
+    }
+    else
+    {
+        GMX_RELEASE_ASSERT(atoms->haveMass && atoms->haveCharge && atoms->haveType && atoms->haveBState, "Mass, charge, atomtype and B-state parameters should be present in t_atoms when writing a tpr file");
     }
     for (i = 0; (i < atoms->nr); i++)
     {
         do_atom(fio, &atoms->atom[i], egcNR, bRead, file_version, groups, i);
     }
     do_strstr(fio, atoms->nr, atoms->atomname, bRead, symtab);
-    if (bRead && (file_version <= 20))
-    {
-        for (i = 0; i < atoms->nr; i++)
-        {
-            atoms->atomtype[i]  = put_symtab(symtab, "?");
-            atoms->atomtypeB[i] = put_symtab(symtab, "?");
-        }
-    }
-    else
-    {
-        do_strstr(fio, atoms->nr, atoms->atomtype, bRead, symtab);
-        do_strstr(fio, atoms->nr, atoms->atomtypeB, 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)
@@ -2767,7 +2526,7 @@ static void do_groups(t_fileio *fio, gmx_groups_t *groups,
         {
             if (bRead)
             {
-                groups->grpnr[g] = NULL;
+                groups->grpnr[g] = nullptr;
             }
         }
         else
@@ -2786,44 +2545,28 @@ static void do_atomtypes(t_fileio *fio, t_atomtypes *atomtypes, gmx_bool bRead,
 {
     int      j;
 
-    if (file_version > 25)
+    gmx_fio_do_int(fio, atomtypes->nr);
+    j = atomtypes->nr;
+    if (bRead)
     {
-        gmx_fio_do_int(fio, atomtypes->nr);
-        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)
-        {
-            gmx_fio_ndo_int(fio, atomtypes->atomnumber, j);
-        }
-        if (file_version >= 60)
-        {
-            gmx_fio_ndo_real(fio, atomtypes->gb_radius, j);
-            gmx_fio_ndo_real(fio, atomtypes->S_hct, j);
-        }
+        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);
     }
-    else
+    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)
     {
-        /* File versions prior to 26 cannot do GBSA,
-         * so they dont use this structure
-         */
-        atomtypes->nr         = 0;
-        atomtypes->radius     = NULL;
-        atomtypes->vol        = NULL;
-        atomtypes->surftens   = NULL;
-        atomtypes->atomnumber = NULL;
-        atomtypes->gb_radius  = NULL;
-        atomtypes->S_hct      = NULL;
+        gmx_fio_ndo_int(fio, atomtypes->atomnumber, j);
+    }
+    if (file_version >= 60)
+    {
+        gmx_fio_ndo_real(fio, atomtypes->gb_radius, j);
+        gmx_fio_ndo_real(fio, atomtypes->S_hct, j);
     }
 }
 
@@ -2850,7 +2593,7 @@ static void do_symtab(t_fileio *fio, t_symtab *symtab, gmx_bool bRead)
     else
     {
         symbuf = symtab->symbuf;
-        while (symbuf != NULL)
+        while (symbuf != nullptr)
         {
             for (i = 0; (i < symbuf->bufsize) && (i < nr); i++)
             {
@@ -3197,7 +2940,7 @@ static void do_mtop(t_fileio *fio, gmx_mtop_t *mtop, gmx_bool bRead,
     {
         mtop->ffparams.cmap_grid.ngrid        = 0;
         mtop->ffparams.cmap_grid.grid_spacing = 0;
-        mtop->ffparams.cmap_grid.cmapdata     = NULL;
+        mtop->ffparams.cmap_grid.cmapdata     = nullptr;
     }
 
     if (file_version >= 57)
@@ -3312,14 +3055,7 @@ static void do_tpxheader(t_fileio *fio, gmx_bool bRead, t_tpxheader *tpx,
         gmx_fio_do_string(fio, file_tag);
     }
 
-    if (fileVersion >= 26)
-    {
-        gmx_fio_do_int(fio, fileGeneration);
-    }
-    else
-    {
-        fileGeneration = 0;
-    }
+    gmx_fio_do_int(fio, fileGeneration);
 
     if (fileVersion >= 81)
     {
@@ -3369,14 +3105,8 @@ static void do_tpxheader(t_fileio *fio, gmx_bool bRead, t_tpxheader *tpx,
     }
 
     gmx_fio_do_int(fio, tpx->natoms);
-    if (fileVersion >= 28)
-    {
-        gmx_fio_do_int(fio, tpx->ngtc);
-    }
-    else
-    {
-        tpx->ngtc = 0;
-    }
+    gmx_fio_do_int(fio, tpx->ngtc);
+
     if (fileVersion < 62)
     {
         gmx_fio_do_int(fio, idum);
@@ -3402,32 +3132,37 @@ static void do_tpxheader(t_fileio *fio, gmx_bool bRead, t_tpxheader *tpx,
 }
 
 static int do_tpx(t_fileio *fio, gmx_bool bRead,
-                  t_inputrec *ir, t_state *state, gmx_mtop_t *mtop,
-                  gmx_bool bXVallocated)
+                  t_inputrec *ir, t_state *state, rvec *x, rvec *v,
+                  gmx_mtop_t *mtop)
 {
     t_tpxheader     tpx;
-    t_inputrec      dum_ir;
     gmx_mtop_t      dum_top;
     gmx_bool        TopOnlyOK;
-    rvec           *xptr, *vptr;
     int             ePBC;
     gmx_bool        bPeriodicMols;
 
     if (!bRead)
     {
+        GMX_RELEASE_ASSERT(state != nullptr, "Cannot write a null state");
+        GMX_RELEASE_ASSERT(x == nullptr && v == nullptr, "Passing separate x and v pointers to do_tpx() is not supported when writing");
+
         tpx.natoms    = state->natoms;
         tpx.ngtc      = state->ngtc;
         tpx.fep_state = state->fep_state;
         tpx.lambda    = state->lambda[efptFEP];
-        tpx.bIr       = (ir       != NULL);
-        tpx.bTop      = (mtop     != NULL);
-        tpx.bX        = (state->x != NULL);
-        tpx.bV        = (state->v != NULL);
+        tpx.bIr       = (ir       != nullptr);
+        tpx.bTop      = (mtop     != nullptr);
+        tpx.bX        = (state->flags & (1 << estX));
+        tpx.bV        = (state->flags & (1 << estV));
         tpx.bF        = FALSE;
         tpx.bBox      = TRUE;
     }
+    else
+    {
+        GMX_RELEASE_ASSERT(!(x == nullptr && v != nullptr), "Passing x==NULL and v!=NULL is not supported");
+    }
 
-    TopOnlyOK = (ir == NULL);
+    TopOnlyOK = (ir == nullptr);
 
     int fileVersion;    /* Version number of the code that wrote the file */
     int fileGeneration; /* Generation version number of the code that wrote the file */
@@ -3435,23 +3170,31 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead,
 
     if (bRead)
     {
-        state->flags  = 0;
-        if (bXVallocated)
+        state->flags = 0;
+        init_gtc_state(state, tpx.ngtc, 0, 0);
+        if (x == nullptr)
         {
-            xptr = state->x;
-            vptr = state->v;
-            init_state(state, 0, tpx.ngtc, 0, 0, 0);
-            state->natoms = tpx.natoms;
-            state->nalloc = tpx.natoms;
-            state->x      = xptr;
-            state->v      = vptr;
-        }
-        else
-        {
-            init_state(state, tpx.natoms, tpx.ngtc, 0, 0, 0);
+            // v is also nullptr by the above assertion, so we may
+            // need to make memory in state for storing the contents
+            // of the tpx file.
+            if (tpx.bX)
+            {
+                state->flags |= (1 << estX);
+            }
+            if (tpx.bV)
+            {
+                state->flags |= (1 << estV);
+            }
+            state_change_natoms(state, tpx.natoms);
         }
     }
 
+    if (x == nullptr)
+    {
+        x = as_rvec_array(state->x.data());
+        v = as_rvec_array(state->v.data());
+    }
+
 #define do_test(fio, b, p) if (bRead && (p != NULL) && !b) gmx_fatal(FARGS, "No %s in %s",#p, gmx_fio_getname(fio))
 
     do_test(fio, tpx.bBox, state->box);
@@ -3467,18 +3210,15 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead,
             /* We initialize box_rel after reading the inputrec */
             clear_mat(state->box_rel);
         }
-        if (fileVersion >= 28)
+        gmx_fio_ndo_rvec(fio, state->boxv, DIM);
+        if (fileVersion < 56)
         {
-            gmx_fio_ndo_rvec(fio, state->boxv, DIM);
-            if (fileVersion < 56)
-            {
-                matrix mdum;
-                gmx_fio_ndo_rvec(fio, mdum, DIM);
-            }
+            matrix mdum;
+            gmx_fio_ndo_rvec(fio, mdum, DIM);
         }
     }
 
-    if (state->ngtc > 0 && fileVersion >= 28)
+    if (state->ngtc > 0)
     {
         real *dumv;
         snew(dumv, state->ngtc);
@@ -3491,30 +3231,6 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead,
         sfree(dumv);
     }
 
-    /* Prior to tpx version 26, the inputrec was here.
-     * I moved it to enable partial forward-compatibility
-     * for analysis/viewer programs.
-     */
-    if (fileVersion < 26)
-    {
-        do_test(fio, tpx.bIr, ir);
-        if (tpx.bIr)
-        {
-            if (ir)
-            {
-                do_inputrec(fio, ir, bRead, fileVersion,
-                            mtop ? &mtop->ffparams.fudgeQQ : NULL);
-            }
-            else
-            {
-                do_inputrec(fio, &dum_ir, bRead, fileVersion,
-                            mtop ? &mtop->ffparams.fudgeQQ : NULL);
-                done_inputrec(&dum_ir);
-            }
-
-        }
-    }
-
     do_test(fio, tpx.bTop, mtop);
     if (tpx.bTop)
     {
@@ -3525,27 +3241,27 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead,
         else
         {
             do_mtop(fio, &dum_top, bRead, fileVersion);
-            done_mtop(&dum_top, TRUE);
+            done_mtop(&dum_top);
         }
     }
-    do_test(fio, tpx.bX, state->x);
+    do_test(fio, tpx.bX, x);
     if (tpx.bX)
     {
         if (bRead)
         {
             state->flags |= (1<<estX);
         }
-        gmx_fio_ndo_rvec(fio, state->x, state->natoms);
+        gmx_fio_ndo_rvec(fio, x, tpx.natoms);
     }
 
-    do_test(fio, tpx.bV, state->v);
+    do_test(fio, tpx.bV, v);
     if (tpx.bV)
     {
         if (bRead)
         {
             state->flags |= (1<<estV);
         }
-        gmx_fio_ndo_rvec(fio, state->v, state->natoms);
+        gmx_fio_ndo_rvec(fio, v, tpx.natoms);
     }
 
     // No need to run do_test when the last argument is NULL
@@ -3553,7 +3269,7 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead,
     {
         rvec *dummyForces;
         snew(dummyForces, state->natoms);
-        gmx_fio_ndo_rvec(fio, dummyForces, state->natoms);
+        gmx_fio_ndo_rvec(fio, dummyForces, tpx.natoms);
         sfree(dummyForces);
     }
 
@@ -3566,42 +3282,40 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead,
      */
     ePBC          = -1;
     bPeriodicMols = FALSE;
-    if (fileVersion >= 26)
+
+    do_test(fio, tpx.bIr, ir);
+    if (tpx.bIr)
     {
-        do_test(fio, tpx.bIr, ir);
-        if (tpx.bIr)
+        if (fileVersion >= 53)
         {
-            if (fileVersion >= 53)
+            /* Removed the pbc info from do_inputrec, since we always want it */
+            if (!bRead)
             {
-                /* Removed the pbc info from do_inputrec, since we always want it */
-                if (!bRead)
-                {
-                    ePBC          = ir->ePBC;
-                    bPeriodicMols = ir->bPeriodicMols;
-                }
-                gmx_fio_do_int(fio, ePBC);
-                gmx_fio_do_gmx_bool(fio, bPeriodicMols);
+                ePBC          = ir->ePBC;
+                bPeriodicMols = ir->bPeriodicMols;
             }
-            if (fileGeneration <= tpx_generation && ir)
+            gmx_fio_do_int(fio, ePBC);
+            gmx_fio_do_gmx_bool(fio, bPeriodicMols);
+        }
+        if (fileGeneration <= tpx_generation && ir)
+        {
+            do_inputrec(fio, ir, bRead, fileVersion, mtop ? &mtop->ffparams.fudgeQQ : nullptr);
+            if (fileVersion < 51)
             {
-                do_inputrec(fio, ir, bRead, fileVersion, mtop ? &mtop->ffparams.fudgeQQ : NULL);
-                if (fileVersion < 51)
-                {
-                    set_box_rel(ir, state);
-                }
-                if (fileVersion < 53)
-                {
-                    ePBC          = ir->ePBC;
-                    bPeriodicMols = ir->bPeriodicMols;
-                }
+                set_box_rel(ir, state);
             }
-            if (bRead && ir && fileVersion >= 53)
+            if (fileVersion < 53)
             {
-                /* We need to do this after do_inputrec, since that initializes ir */
-                ir->ePBC          = ePBC;
-                ir->bPeriodicMols = bPeriodicMols;
+                ePBC          = ir->ePBC;
+                bPeriodicMols = ir->bPeriodicMols;
             }
         }
+        if (bRead && ir && fileVersion >= 53)
+        {
+            /* We need to do this after do_inputrec, since that initializes ir */
+            ir->ePBC          = ePBC;
+            ir->bPeriodicMols = bPeriodicMols;
+        }
     }
 
     if (bRead)
@@ -3660,7 +3374,7 @@ void read_tpxheader(const char *fn, t_tpxheader *tpx, gmx_bool TopOnlyOK)
     t_fileio *fio;
 
     fio = open_tpx(fn, "r");
-    do_tpxheader(fio, TRUE, tpx, TopOnlyOK, NULL, NULL);
+    do_tpxheader(fio, TRUE, tpx, TopOnlyOK, nullptr, nullptr);
     close_tpx(fio);
 }
 
@@ -3672,8 +3386,8 @@ void write_tpx_state(const char *fn,
     fio = open_tpx(fn, "w");
     do_tpx(fio, FALSE,
            const_cast<t_inputrec *>(ir),
-           const_cast<t_state *>(state),
-           const_cast<gmx_mtop_t *>(mtop), FALSE);
+           const_cast<t_state *>(state), nullptr, nullptr,
+           const_cast<gmx_mtop_t *>(mtop));
     close_tpx(fio);
 }
 
@@ -3683,7 +3397,7 @@ void read_tpx_state(const char *fn,
     t_fileio *fio;
 
     fio = open_tpx(fn, "r");
-    do_tpx(fio, TRUE, ir, state, mtop, FALSE);
+    do_tpx(fio, TRUE, ir, state, nullptr, nullptr, mtop);
     close_tpx(fio);
 }
 
@@ -3695,19 +3409,14 @@ int read_tpx(const char *fn,
     t_state   state;
     int       ePBC;
 
-    state.x = x;
-    state.v = v;
     fio     = open_tpx(fn, "r");
-    ePBC    = do_tpx(fio, TRUE, ir, &state, mtop, TRUE);
+    ePBC    = do_tpx(fio, TRUE, ir, &state, x, v, mtop);
     close_tpx(fio);
-    *natoms = state.natoms;
+    *natoms = mtop->natoms;
     if (box)
     {
         copy_mat(state.box, box);
     }
-    state.x = NULL;
-    state.v = NULL;
-    done_state(&state);
 
     return ePBC;
 }
@@ -3721,7 +3430,7 @@ int read_tpx_top(const char *fn,
 
     ePBC = read_tpx(fn, ir, box, natoms, x, v, &mtop);
 
-    *top = gmx_mtop_t_to_t_topology(&mtop);
+    *top = gmx_mtop_t_to_t_topology(&mtop, true);
 
     return ePBC;
 }
index 7201e38633fa828defe819fc61c3770a203633d1..1e06ad67bac6c9c535dd1cdf0bac928e3c30411d 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,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.
 
 #include <cstdio>
 
-#include "gromacs/mdtypes/state.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 struct gmx_mtop_t;
 struct t_atoms;
 struct t_block;
 struct t_inputrec;
+class t_state;
 struct t_topology;
 
 struct t_tpxheader
index f25eaa1e01aa3833ef80a661983446d755682915..1786c17ead287f3a217e43757de086487a5b6483 100644 (file)
@@ -55,7 +55,6 @@
 #include "gromacs/fileio/pdbio.h"
 #include "gromacs/fileio/timecontrol.h"
 #include "gromacs/fileio/tngio.h"
-#include "gromacs/fileio/tngio_for_tools.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trrio.h"
 #include "gromacs/fileio/xdrf.h"
@@ -88,7 +87,6 @@ struct t_trxstatus
                                                * for skipping frames with -dt     */
     real                    tf;               /* internal frame time              */
     t_trxframe             *xframe;
-    int                     nxframe;
     t_fileio               *fio;
     tng_trajectory_t        tng;
     int                     natoms;
@@ -170,14 +168,13 @@ static void initcount(t_trxstatus *status)
 static void status_init(t_trxstatus *status)
 {
     status->flags           = 0;
-    status->nxframe         = 0;
-    status->xframe          = NULL;
-    status->fio             = NULL;
+    status->xframe          = nullptr;
+    status->fio             = nullptr;
     status->__frame         = -1;
     status->t0              = 0;
     status->tf              = 0;
-    status->persistent_line = NULL;
-    status->tng             = NULL;
+    status->persistent_line = nullptr;
+    status->tng             = nullptr;
 }
 
 
@@ -286,7 +283,6 @@ float trx_get_time_of_final_frame(t_trxstatus *status)
 void clear_trxframe(t_trxframe *fr, gmx_bool bFirst)
 {
     fr->not_ok    = 0;
-    fr->bTitle    = FALSE;
     fr->bStep     = FALSE;
     fr->bTime     = FALSE;
     fr->bLambda   = FALSE;
@@ -301,16 +297,15 @@ void clear_trxframe(t_trxframe *fr, gmx_bool bFirst)
     {
         fr->bDouble   = FALSE;
         fr->natoms    = -1;
-        fr->title     = NULL;
         fr->step      = 0;
         fr->time      = 0;
         fr->lambda    = 0;
         fr->fep_state = 0;
-        fr->atoms     = NULL;
+        fr->atoms     = nullptr;
         fr->prec      = 0;
-        fr->x         = NULL;
-        fr->v         = NULL;
-        fr->f         = NULL;
+        fr->x         = nullptr;
+        fr->v         = nullptr;
+        fr->f         = nullptr;
         clear_mat(fr->box);
         fr->bPBC   = FALSE;
         fr->ePBC   = -1;
@@ -327,7 +322,7 @@ int write_trxframe_indexed(t_trxstatus *status, const t_trxframe *fr, int nind,
                            const int *ind, gmx_conect gc)
 {
     char  title[STRLEN];
-    rvec *xout = NULL, *vout = NULL, *fout = NULL;
+    rvec *xout = nullptr, *vout = nullptr, *fout = nullptr;
     int   i, ftp = -1;
     real  prec;
 
@@ -387,7 +382,7 @@ int write_trxframe_indexed(t_trxstatus *status, const t_trxframe *fr, int nind,
                     copy_rvec(fr->f[ind[i]], fout[i]);
                 }
             }
-        /* no break */
+        // fallthrough
         case efXTC:
             if (fr->bX)
             {
@@ -427,7 +422,7 @@ int write_trxframe_indexed(t_trxstatus *status, const t_trxframe *fr, int nind,
             if (ftp == efGRO)
             {
                 write_hconf_indexed_p(gmx_fio_getfp(status->fio), title, fr->atoms, nind, ind,
-                                      fr->x, fr->bV ? fr->v : NULL, fr->box);
+                                      fr->x, fr->bV ? fr->v : nullptr, fr->box);
             }
             else
             {
@@ -436,7 +431,8 @@ int write_trxframe_indexed(t_trxstatus *status, const t_trxframe *fr, int nind,
             }
             break;
         case efG96:
-            write_g96_conf(gmx_fio_getfp(status->fio), fr, nind, ind);
+            sprintf(title, "frame t= %.3f", fr->time);
+            write_g96_conf(gmx_fio_getfp(status->fio), title, fr, nind, ind);
             break;
         default:
             gmx_fatal(FARGS, "Sorry, write_trxframe_indexed can not write %s",
@@ -456,7 +452,7 @@ int write_trxframe_indexed(t_trxstatus *status, const t_trxframe *fr, int nind,
             {
                 sfree(fout);
             }
-        /* no break */
+        // fallthrough
         case efXTC:
             sfree(xout);
             break;
@@ -482,13 +478,13 @@ void trjtools_gmx_prepare_tng_writing(const char       *filename,
         gmx_incons("Sorry, can only prepare for TNG output.");
     }
 
-    if (*out == NULL)
+    if (*out == nullptr)
     {
         snew((*out), 1);
     }
     status_init(*out);
 
-    if (in != NULL)
+    if (in != nullptr)
     {
         gmx_prepare_tng_writing(filename,
                                 filemode,
@@ -563,7 +559,7 @@ int write_trxframe(t_trxstatus *status, t_trxframe *fr, gmx_conect gc)
             break;
         case efTRR:
             gmx_trr_write_frame(status->fio, fr->step, fr->time, fr->lambda, fr->box, fr->natoms,
-                                fr->bX ? fr->x : NULL, fr->bV ? fr->v : NULL, fr->bF ? fr->f : NULL);
+                                fr->bX ? fr->x : nullptr, fr->bV ? fr->v : nullptr, fr->bF ? fr->f : nullptr);
             break;
         case efGRO:
         case efPDB:
@@ -578,7 +574,7 @@ int write_trxframe(t_trxstatus *status, t_trxframe *fr, gmx_conect gc)
             if (gmx_fio_getftp(status->fio) == efGRO)
             {
                 write_hconf_p(gmx_fio_getfp(status->fio), title, fr->atoms,
-                              fr->x, fr->bV ? fr->v : NULL, fr->box);
+                              fr->x, fr->bV ? fr->v : nullptr, fr->box);
             }
             else
             {
@@ -588,7 +584,7 @@ int write_trxframe(t_trxstatus *status, t_trxframe *fr, gmx_conect gc)
             }
             break;
         case efG96:
-            write_g96_conf(gmx_fio_getfp(status->fio), fr, -1, NULL);
+            write_g96_conf(gmx_fio_getfp(status->fio), title, fr, -1, nullptr);
             break;
         default:
             gmx_fatal(FARGS, "Sorry, write_trxframe can not write %s",
@@ -610,11 +606,11 @@ int write_trx(t_trxstatus *status, int nind, const int *ind, const t_atoms *atom
     fr.step   = step;
     fr.bTime  = TRUE;
     fr.time   = time;
-    fr.bAtoms = atoms != NULL;
+    fr.bAtoms = atoms != nullptr;
     fr.atoms  = const_cast<t_atoms *>(atoms);
     fr.bX     = TRUE;
     fr.x      = x;
-    fr.bV     = v != NULL;
+    fr.bV     = v != nullptr;
     fr.v      = v;
     fr.bBox   = TRUE;
     copy_mat(box, fr.box);
@@ -633,6 +629,14 @@ void close_trx(t_trxstatus *status)
     {
         gmx_fio_close(status->fio);
     }
+    sfree(status->persistent_line);
+#if GMX_USE_PLUGINS
+    sfree(status->vmdplugin);
+#endif
+    /* The memory in status->xframe is lost here,
+     * but the read_first_x/read_next_x functions are deprecated anyhow.
+     * read_first_frame/read_next_frame and close_trx should be used.
+     */
     sfree(status);
 }
 
@@ -672,7 +676,7 @@ static gmx_bool gmx_next_frame(t_trxstatus *status, t_trxframe *fr)
         fr->bBox      = sh.box_size > 0;
         if (status->flags & (TRX_READ_X | TRX_NEED_X))
         {
-            if (fr->x == NULL)
+            if (fr->x == nullptr)
             {
                 snew(fr->x, sh.natoms);
             }
@@ -680,7 +684,7 @@ static gmx_bool gmx_next_frame(t_trxstatus *status, t_trxframe *fr)
         }
         if (status->flags & (TRX_READ_V | TRX_NEED_V))
         {
-            if (fr->v == NULL)
+            if (fr->v == nullptr)
             {
                 snew(fr->v, sh.natoms);
             }
@@ -688,7 +692,7 @@ static gmx_bool gmx_next_frame(t_trxstatus *status, t_trxframe *fr)
         }
         if (status->flags & (TRX_READ_F | TRX_NEED_F))
         {
-            if (fr->f == NULL)
+            if (fr->f == nullptr)
             {
                 snew(fr->f, sh.natoms);
             }
@@ -725,12 +729,12 @@ static gmx_bool pdb_next_x(t_trxstatus *status, FILE *fp, t_trxframe *fr)
     double    dbl;
 
     atoms.nr      = fr->natoms;
-    atoms.atom    = NULL;
-    atoms.pdbinfo = NULL;
+    atoms.atom    = nullptr;
+    atoms.pdbinfo = nullptr;
     /* the other pointers in atoms should not be accessed if these are NULL */
     snew(symtab, 1);
     open_symtab(symtab);
-    na       = read_pdbfile(fp, title, &model_nr, &atoms, symtab, fr->x, &ePBC, boxpdb, TRUE, NULL);
+    na       = read_pdbfile(fp, title, &model_nr, &atoms, symtab, fr->x, &ePBC, boxpdb, TRUE, nullptr);
     free_symtab(symtab);
     sfree(symtab);
     set_trxframe_ePBC(fr, ePBC);
@@ -839,12 +843,9 @@ gmx_bool read_next_frame(const gmx_output_env_t *oenv, t_trxstatus *status, t_tr
                 break;
             case efG96:
             {
-                t_symtab *symtab;
-                snew(symtab, 1);
-                open_symtab(symtab);
-                read_g96_conf(gmx_fio_getfp(status->fio), NULL, fr,
+                t_symtab *symtab = nullptr;
+                read_g96_conf(gmx_fio_getfp(status->fio), nullptr, nullptr, fr,
                               symtab, status->persistent_line);
-                free_symtab(symtab);
                 bRet = (fr->natoms > 0);
                 break;
             }
@@ -873,7 +874,7 @@ gmx_bool read_next_frame(const gmx_output_env_t *oenv, t_trxstatus *status, t_tr
                 }
                 break;
             case efTNG:
-                bRet = gmx_read_next_tng_frame(status->tng, fr, NULL, 0);
+                bRet = gmx_read_next_tng_frame(status->tng, fr, nullptr, 0);
                 break;
             case efPDB:
                 bRet = pdb_next_x(status, gmx_fio_getfp(status->fio), fr);
@@ -935,7 +936,7 @@ gmx_bool read_next_frame(const gmx_output_env_t *oenv, t_trxstatus *status, t_tr
 int read_first_frame(const gmx_output_env_t *oenv, t_trxstatus **status,
                      const char *fn, t_trxframe *fr, int flags)
 {
-    t_fileio      *fio;
+    t_fileio      *fio = nullptr;
     gmx_bool       bFirst, bOK;
     int            ftp   = fn2ftp(fn);
 
@@ -946,7 +947,6 @@ int read_first_frame(const gmx_output_env_t *oenv, t_trxstatus **status,
     snew((*status), 1);
 
     status_init( *status );
-    (*status)->nxframe = 1;
     initcount(*status);
     (*status)->flags = flags;
 
@@ -975,11 +975,8 @@ int read_first_frame(const gmx_output_env_t *oenv, t_trxstatus **status,
                 /* allocate the persistent line */
                 snew((*status)->persistent_line, STRLEN+1);
             }
-            t_symtab *symtab;
-            snew(symtab, 1);
-            open_symtab(symtab);
-            read_g96_conf(gmx_fio_getfp(fio), fn, fr, symtab, (*status)->persistent_line);
-            free_symtab(symtab);
+            t_symtab *symtab = nullptr;
+            read_g96_conf(gmx_fio_getfp(fio), fn, nullptr, fr, symtab, (*status)->persistent_line);
             gmx_fio_close(fio);
             clear_trxframe(fr, FALSE);
             if (flags & (TRX_READ_X | TRX_NEED_X))
@@ -1018,7 +1015,7 @@ int read_first_frame(const gmx_output_env_t *oenv, t_trxstatus **status,
             break;
         case efTNG:
             fr->step = -1;
-            if (!gmx_read_next_tng_frame((*status)->tng, fr, NULL, 0))
+            if (!gmx_read_next_tng_frame((*status)->tng, fr, nullptr, 0))
             {
                 fr->not_ok = DATA_NOT_OK;
                 fr->natoms = 0;
@@ -1101,7 +1098,6 @@ int read_first_x(const gmx_output_env_t *oenv, t_trxstatus **status, const char
     read_first_frame(oenv, status, fn, &fr, TRX_NEED_X);
 
     snew((*status)->xframe, 1);
-    (*status)->nxframe   = 1;
     (*(*status)->xframe) = fr;
     *t                   = (*status)->xframe->time;
     *x                   = (*status)->xframe->x;
@@ -1124,25 +1120,6 @@ gmx_bool read_next_x(const gmx_output_env_t *oenv, t_trxstatus *status, real *t,
     return bRet;
 }
 
-void close_trj(t_trxstatus *status)
-{
-    if (status == nullptr)
-    {
-        return;
-    }
-    gmx_tng_close(&status->tng);
-    if (status->fio)
-    {
-        gmx_fio_close(status->fio);
-    }
-
-    /* The memory in status->xframe is lost here,
-     * but the read_first_x/read_next_x functions are deprecated anyhow.
-     * read_first_frame/read_next_frame and close_trx should be used.
-     */
-    sfree(status);
-}
-
 void rewind_trj(t_trxstatus *status)
 {
     initcount(status);
@@ -1158,7 +1135,7 @@ t_topology *read_top(const char *fn, int *ePBC)
     t_topology *top;
 
     snew(top, 1);
-    epbc = read_tpx_top(fn, NULL, NULL, &natoms, NULL, NULL, top);
+    epbc = read_tpx_top(fn, nullptr, nullptr, &natoms, nullptr, nullptr, top);
     if (ePBC)
     {
         *ePBC = epbc;
index 3f9042ff0f626d63ce5e4cf6b17be6b379256fd6..0f6495967d518fce1020c2a763285710df8d0ea6 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,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.
@@ -132,8 +132,9 @@ void write_tng_frame(t_trxstatus        *status,
                      struct t_trxframe  *fr);
 
 void close_trx(t_trxstatus *status);
-/* Close trajectory file as opened with read_first_x, read_frist_frame
- * or open_trx. Identical to close_trj.
+/* Close trajectory file as opened with read_first_x, read_first_frame
+ * or open_trx.
+ * Also frees memory in the structure.
  */
 
 t_trxstatus *open_trx(const char *outfile, const char *filemode);
@@ -226,11 +227,6 @@ gmx_bool read_next_x(const gmx_output_env_t *oenv, t_trxstatus *status, real *t,
  * status is the integer set in read_first_x.
  */
 
-void close_trj(t_trxstatus *status);
-/* Close trajectory file as opened with read_first_x, read_first_frame
- * or open_trx. Identical to close_trx.
- */
-
 void rewind_trj(t_trxstatus *status);
 /* Rewind trajectory file as opened with read_first_x */
 
index 27760147cd5c92302430c743101f357f1f2aec89..cc42a28af7b762057a8f340060c2a2347c62a963 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2012,2013,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.
@@ -170,7 +170,7 @@ static int load_sharedlibrary_plugins(const char *fullpath, gmx_vmdplugin_t *vmd
     }
 
     /* in case this library does not support the filetype, close it */
-    if (vmdplugin->api == NULL)
+    if (vmdplugin->api == nullptr)
     {
         vmddlclose(handle);
     }
@@ -283,7 +283,7 @@ static int load_vmd_library(const char *fn, gmx_vmdplugin_t *vmdplugin)
     sprintf(defpathenv, "%s\\University of Illinois\\VMD\\plugins\\WIN32\\molfile", progfolder);
 #endif
 
-    vmdplugin->api      = NULL;
+    vmdplugin->api      = nullptr;
     vmdplugin->filetype = strrchr(fn, '.');
     if (!vmdplugin->filetype)
     {
@@ -296,10 +296,10 @@ static int load_vmd_library(const char *fn, gmx_vmdplugin_t *vmdplugin)
      * given at configure time. This last might be hard-coded to the
      * default for VMD installs. */
     pathenv = getenv("VMD_PLUGIN_PATH");
-    if (pathenv == NULL)
+    if (pathenv == nullptr)
     {
         pathenv = getenv("VMDDIR");
-        if (NULL == pathenv)
+        if (nullptr == pathenv)
         {
             printf("\nNeither VMD_PLUGIN_PATH or VMDDIR set. ");
             printf("Using default location:\n%s\n", defpathenv);
@@ -320,7 +320,7 @@ static int load_vmd_library(const char *fn, gmx_vmdplugin_t *vmdplugin)
     strncpy(pathname, pathenv, sizeof(pathname));
 #if !GMX_NATIVE_WINDOWS
     strcat(pathname, "/*.so");
-    glob(pathname, 0, NULL, &globbuf);
+    glob(pathname, 0, nullptr, &globbuf);
     if (globbuf.gl_pathc == 0)
     {
         printf("\nNo VMD Plugins found\n"
@@ -329,7 +329,7 @@ static int load_vmd_library(const char *fn, gmx_vmdplugin_t *vmdplugin)
                "The architecture (e.g. 32bit versus 64bit) of GROMACS and VMD has to match.\n");
         return 0;
     }
-    for (size_t i = 0; i < globbuf.gl_pathc && vmdplugin->api == NULL; i++)
+    for (size_t i = 0; i < globbuf.gl_pathc && vmdplugin->api == nullptr; i++)
     {
         /* FIXME: Undefined which plugin is chosen if more than one plugin
            can read a certain file ending. Requires some additional command
@@ -372,7 +372,7 @@ static int load_vmd_library(const char *fn, gmx_vmdplugin_t *vmdplugin)
         return 0;
     }
 
-    if (vmdplugin->api == NULL)
+    if (vmdplugin->api == nullptr)
     {
         printf("\nNo plugin for %s found\n", vmdplugin->filetype);
         return 0;
@@ -392,7 +392,7 @@ static int load_vmd_library(const char *fn, gmx_vmdplugin_t *vmdplugin)
 
 int read_first_vmd_frame(const char *fn, gmx_vmdplugin_t **vmdpluginp, t_trxframe *fr)
 {
-    molfile_timestep_metadata_t *metadata = NULL;
+    molfile_timestep_metadata_t *metadata = nullptr;
     gmx_vmdplugin_t             *vmdplugin;
 
     snew(vmdplugin, 1);
index a91f300a2e009ab9839c31fa9dd54acc3bd98829..169a45603c8eb58aaa3dfb5756b0ce830fcb4d88 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,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.
@@ -40,6 +40,8 @@
 
 #include <cstring>
 
+#include <string>
+
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
@@ -62,18 +64,23 @@ warninp_t init_warning(gmx_bool bAllowWarnings, int maxwarning)
 
     wi->bAllowWarnings = bAllowWarnings;
     wi->maxwarn        = maxwarning;
-    wi->nwarn_note     = 0;
-    wi->nwarn_warn     = 0;
-    wi->nwarn_error    = 0;
+    warning_reset(wi);
     strcpy(wi->filenm, "unknown");
     wi->lineno         = 0;
 
     return wi;
 }
 
+void warning_reset(warninp_t wi)
+{
+    wi->nwarn_note     = 0;
+    wi->nwarn_warn     = 0;
+    wi->nwarn_error    = 0;
+}
+
 void set_warning_line(warninp_t wi, const char *s, int line)
 {
-    if (s != NULL)
+    if (s != nullptr)
     {
         std::strcpy(wi->filenm, s);
     }
@@ -96,7 +103,7 @@ static void low_warning(warninp_t wi, const char *wtype, int n, const char *s)
     char *temp, *temp2;
     int   i;
 
-    if (s == NULL)
+    if (s == nullptr)
     {
         s = "Empty error message.";
     }
@@ -142,18 +149,33 @@ void warning(warninp_t wi, const char *s)
     }
 }
 
+void warning(warninp_t wi, const std::string &s)
+{
+    warning(wi, s.c_str());
+}
+
 void warning_note(warninp_t wi, const char *s)
 {
     wi->nwarn_note++;
     low_warning(wi, "NOTE", wi->nwarn_note, s);
 }
 
+void warning_note(warninp_t wi, const std::string &s)
+{
+    warning_note(wi, s.c_str());
+}
+
 void warning_error(warninp_t wi, const char *s)
 {
     wi->nwarn_error++;
     low_warning(wi, "ERROR", wi->nwarn_error, s);
 }
 
+void warning_error(warninp_t wi, const std::string &s)
+{
+    warning_error(wi, s.c_str());
+}
+
 static void print_warn_count(const char *type, int n)
 {
     if (n > 0)
index 70a1537b61463f14168a67401b319679cd6ae321..aeb3cb22ca4cc662bb5af430fc08415b5e99ad27 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,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,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.
@@ -37,6 +37,8 @@
 #ifndef GMX_FILEIO_WARNINP_H
 #define GMX_FILEIO_WARNINP_H
 
+#include <string>
+
 #include "gromacs/utility/basedefinitions.h"
 
 /* Abstract type for warning bookkeeping */
@@ -78,6 +80,9 @@ warning(warninp_t wi, const char *s);
  * So warning should only be called for issues that should be resolved,
  * otherwise warning_note should be called.
  */
+//! Convenience wrapper.
+void
+warning(warninp_t wi, const std::string &s);
 
 void
 warning_note(warninp_t wi, const char *s);
@@ -88,6 +93,10 @@ warning_note(warninp_t wi, const char *s);
  * but 100% ok for other systems.
  */
 
+//! Convenience wrapper.
+void
+warning_note(warninp_t wi, const std::string &s);
+
 void
 warning_error(warninp_t wi, const char *s);
 /* Issue an error, with the string s. If s == NULL, then warn_buf
@@ -95,6 +104,10 @@ warning_error(warninp_t wi, const char *s);
  * are printed, nwarn_error (local) is incremented.
  */
 
+//! Convenience wrapper.
+void
+warning_error(warninp_t wi, const std::string &s);
+
 /*! \brief Issue an error with warning_error() and prevent further
  * processing by calling check_warning_error().
  *
@@ -105,6 +118,9 @@ gmx_noreturn void warning_error_and_exit(warninp_t wi, const char *s, int f_errn
 gmx_bool warning_errors_exist(warninp_t wi);
 /* Return whether any error-level warnings were issued to wi. */
 
+//! Resets the count for all kinds of warnings to zero.
+void warning_reset(warninp_t wi);
+
 void
 check_warning_error(warninp_t wi, int f_errno, const char *file, int line);
 /* When warning_error has been called at least once gmx_fatal is called,
index 7f9f6229f51ceab82deb58cc3600f265553ba3cf..761036da75633d652e4344ba75fd22420b7c6166 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,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.
@@ -86,7 +86,7 @@ t_psdata ps_open(const char *fn, real x1, real y1, real x2, real y2)
 
     ps->nrgb     = 0;
     ps->maxrgb   = 0;
-    ps->rgb      = NULL;
+    ps->rgb      = nullptr;
     ps->gen_ybox = 0;
     ps->ostack   = 0;
 
index 6034a4f811eaa2e3f3cc8155647d2f9e9d8a494d..2dd05b986e733d0d591ceef8bfdb2b4785fabb91 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,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.
@@ -38,6 +38,7 @@
 
 #include "xvgr.h"
 
+#include <cassert>
 #include <cctype>
 #include <cstring>
 
@@ -64,11 +65,11 @@ gmx_bool output_env_get_print_xvgr_codes(const gmx_output_env_t *oenv)
     return (xvg_format == exvgXMGRACE || xvg_format == exvgXMGR);
 }
 
-static char *xvgrstr(const char *gmx, const gmx_output_env_t *oenv,
+static char *xvgrstr(const std::string &gmx, const gmx_output_env_t *oenv,
                      char *buf, int buflen)
 {
     /* Supported greek letter names and corresponding xmgrace/xmgr symbols */
-    const char *sym[]  = { "beta", "chi", "delta", "eta", "lambda", "mu", "omega", "phi", "psi", "rho", "theta", NULL };
+    const char *sym[]  = { "beta", "chi", "delta", "eta", "lambda", "mu", "omega", "phi", "psi", "rho", "theta", nullptr };
     const char  symc[] = { 'b',    'c',   'd',     'h',   'l',      'm',  'w',     'f',   'y',   'r',   'q',     '\0' };
     int         xvgf;
     gmx_bool    bXVGR;
@@ -85,7 +86,7 @@ static char *xvgrstr(const char *gmx, const gmx_output_env_t *oenv,
         /* Check with the largest string we have ("lambda"), add one for \0 */
         if (b + 6 + 1 >= buflen)
         {
-            gmx_fatal(FARGS, "Output buffer length in xvgstr (%d) too small to process xvg input string '%s'", buflen, gmx);
+            gmx_fatal(FARGS, "Output buffer length in xvgstr (%d) too small to process xvg input string '%s'", buflen, gmx.c_str());
         }
         if (gmx[g] == '\\')
         {
@@ -175,12 +176,12 @@ static char *xvgrstr(const char *gmx, const gmx_output_env_t *oenv,
             {
                 /* Check for special symbol */
                 i = 0;
-                while (sym[i] != NULL &&
-                       gmx_strncasecmp(sym[i], gmx+g, std::strlen(sym[i])) != 0)
+                while (sym[i] != nullptr &&
+                       gmx_strncasecmp(sym[i], &gmx[g], std::strlen(sym[i])) != 0)
                 {
                     i++;
                 }
-                if (sym[i] != NULL)
+                if (sym[i] != nullptr)
                 {
                     c = symc[i];
                     if (std::isupper(gmx[g]))
@@ -196,7 +197,7 @@ static char *xvgrstr(const char *gmx, const gmx_output_env_t *oenv,
                             sprintf(buf+b, "%s%c%s", "\\8", c, "\\4");
                             break;
                         default:
-                            std::strncat(buf+b, gmx+g, std::strlen(sym[i]));
+                            std::strncat(buf+b, &gmx[g], std::strlen(sym[i]));
                             b += std::strlen(sym[i]);
                             if (gmx[g+std::strlen(sym[i])] != ' ')
                             {
@@ -230,8 +231,8 @@ static char *xvgrstr(const char *gmx, const gmx_output_env_t *oenv,
     return buf;
 }
 
-void xvgr_header(FILE *fp, const char *title, const char *xaxis,
-                 const char *yaxis, int exvg_graph_type,
+void xvgr_header(FILE *fp, const char *title, const std::string &xaxis,
+                 const std::string &yaxis, int exvg_graph_type,
                  const gmx_output_env_t *oenv)
 {
     char buf[STRLEN];
@@ -279,8 +280,8 @@ void xvgr_header(FILE *fp, const char *title, const char *xaxis,
     }
 }
 
-FILE *xvgropen_type(const char *fn, const char *title, const char *xaxis,
-                    const char *yaxis, int exvg_graph_type,
+FILE *xvgropen_type(const char *fn, const char *title, const std::string &xaxis,
+                    const std::string &yaxis, int exvg_graph_type,
                     const gmx_output_env_t *oenv)
 {
     FILE  *fp;
@@ -292,8 +293,8 @@ FILE *xvgropen_type(const char *fn, const char *title, const char *xaxis,
     return fp;
 }
 
-FILE *xvgropen(const char *fn, const char *title, const char *xaxis,
-               const char *yaxis, const gmx_output_env_t *oenv)
+FILE *xvgropen(const char *fn, const char *title, const std::string &xaxis,
+               const std::string &yaxis, const gmx_output_env_t *oenv)
 {
     return xvgropen_type(fn, title, xaxis, yaxis, exvggtXNY, oenv);
 }
@@ -461,25 +462,25 @@ static char *fgets3(FILE *fp, char **ptr, int *len, int maxlen)
                 curp          = 0;
             }
         }
-        if (fgets(*ptr + curp, len_remaining, fp) == NULL)
+        if (fgets(*ptr + curp, len_remaining, fp) == nullptr)
         {
             /* if last line, skip */
-            return NULL;
+            return nullptr;
         }
         curp         += len_remaining-1; /* overwrite the nul char in next iteration */
         len_remaining = 1;
     }
-    while ((std::strchr(*ptr, '\n') == NULL) && (!feof(fp)));
+    while ((std::strchr(*ptr, '\n') == nullptr) && (!feof(fp)));
 
     if (*len + STRLEN >= maxlen)
     {
-        return NULL; /* this line was too long */
+        return nullptr; /* this line was too long */
     }
 
     if (feof(fp))
     {
         /* We reached EOF before '\n', skip this last line. */
-        return NULL;
+        return nullptr;
     }
     {
         /* now remove newline */
@@ -499,7 +500,7 @@ static int wordcount(char *ptr)
     int cur = 0;
 #define prev (1-cur)
 
-    if (NULL != ptr)
+    if (nullptr != ptr)
     {
         for (i = 0; (ptr[i] != '\0'); i++)
         {
@@ -524,11 +525,11 @@ static char *read_xvgr_string(const char *line)
     char       *str;
 
     ptr0 = std::strchr(line, '"');
-    if (ptr0 != NULL)
+    if (ptr0 != nullptr)
     {
         ptr0++;
         ptr1 = std::strchr(ptr0, '"');
-        if (ptr1 != NULL)
+        if (ptr1 != nullptr)
         {
             str            = gmx_strdup(ptr0);
             str[ptr1-ptr0] = '\0';
@@ -551,11 +552,11 @@ int read_xvg_legend(const char *fn, double ***y, int *ny,
 {
     FILE    *fp;
     char    *ptr;
-    char    *base = NULL;
-    char    *fmt  = NULL;
+    char    *base = nullptr;
+    char    *fmt  = nullptr;
     int      k, line = 0, nny, nx, maxx, rval, legend_nalloc, set, nchar;
     double   lf;
-    double **yy = NULL;
+    double **yy = nullptr;
     char    *tmpbuf;
     int      len = STRLEN;
     *ny  = 0;
@@ -565,23 +566,23 @@ int read_xvg_legend(const char *fn, double ***y, int *ny,
     fp   = gmx_fio_fopen(fn, "r");
 
     snew(tmpbuf, len);
-    if (subtitle != NULL)
+    if (subtitle != nullptr)
     {
-        *subtitle = NULL;
+        *subtitle = nullptr;
     }
     legend_nalloc = 0;
-    if (legend != NULL)
+    if (legend != nullptr)
     {
-        *legend = NULL;
+        *legend = nullptr;
     }
 
-    while ((ptr = fgets3(fp, &tmpbuf, &len, 10*STRLEN)) != NULL && ptr[0] != '&')
+    while ((ptr = fgets3(fp, &tmpbuf, &len, 10*STRLEN)) != nullptr && ptr[0] != '&')
     {
         line++;
         trim(ptr);
         if (ptr[0] == '@')
         {
-            if (legend != NULL)
+            if (legend != nullptr)
             {
                 ptr++;
                 trim(ptr);
@@ -589,7 +590,7 @@ int read_xvg_legend(const char *fn, double ***y, int *ny,
                 if (std::strncmp(ptr, "subtitle", 8) == 0)
                 {
                     ptr += 8;
-                    if (subtitle != NULL)
+                    if (subtitle != nullptr)
                     {
                         *subtitle = read_xvgr_string(ptr);
                     }
@@ -692,10 +693,11 @@ int read_xvg_legend(const char *fn, double ***y, int *ny,
     {
         if (*ny - 1 > legend_nalloc)
         {
+            assert(legend);
             srenew(*legend, *ny-1);
             for (set = legend_nalloc; set < *ny-1; set++)
             {
-                (*legend)[set] = NULL;
+                (*legend)[set] = nullptr;
             }
         }
     }
@@ -705,7 +707,7 @@ int read_xvg_legend(const char *fn, double ***y, int *ny,
 
 int read_xvg(const char *fn, double ***y, int *ny)
 {
-    return read_xvg_legend(fn, y, ny, NULL, NULL);
+    return read_xvg_legend(fn, y, ny, nullptr, nullptr);
 }
 
 void write_xvg(const char *fn, const char *title, int nx, int ny, real **y,
@@ -744,9 +746,9 @@ real **read_xvg_time(const char *fn,
     real     **val;
 
     t_nalloc   = 0;
-    *t         = NULL;
-    val        = NULL;
-    val_nalloc = NULL;
+    *t         = nullptr;
+    val        = nullptr;
+    val_nalloc = nullptr;
     *nset      = 0;
     *dt        = 0;
     fp         = gmx_fio_fopen(fn, "r");
@@ -840,7 +842,7 @@ real **read_xvg_time(const char *fn,
                                 srenew(val, *nset);
                                 srenew(val_nalloc, *nset);
                                 val_nalloc[set] = 0;
-                                val[set]        = NULL;
+                                val[set]        = nullptr;
                             }
                         }
                         if (set == -1)
index 35f81b42c1f6952ca9c0fd32ec11acd00694ad1d..166300ff1fb6e3c6b67479f35f082e58efcfbbc3 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, by the GROMACS development team, led by
+ * 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.
 
 #include <stdio.h>
 
+#include <string>
+
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/real.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct gmx_output_env_t;
 
 /***************************************************
@@ -99,23 +97,23 @@ enum {
     exvggtNONE, exvggtXNY, exvggtXYDY, exvggtXYDYDY, exvggtNR
 };
 
-void xvgr_header(FILE *fp, const char *title, const char *xaxis,
-                 const char *yaxis, int exvg_graph_type,
+void xvgr_header(FILE *fp, const char *title, const std::string &xaxis,
+                 const std::string &yaxis, int exvg_graph_type,
                  const struct gmx_output_env_t *oenv);
 /* In most cases you want to use xvgropen_type, which does the same thing
  * but takes a filename and opens it.
  */
 
-FILE *xvgropen_type(const char *fn, const char *title, const char *xaxis,
-                    const char *yaxis, int exvg_graph_type,
+FILE *xvgropen_type(const char *fn, const char *title, const std::string &xaxis,
+                    const std::string &yaxis, int exvg_graph_type,
                     const struct gmx_output_env_t *oenv);
 /* Open a file, and write a title, and axis-labels in Xvgr format
  * or write nothing when oenv specifies so.
  * The xvgr graph type enum is defined above.
  */
 
-FILE *xvgropen(const char *fn, const char *title, const char *xaxis,
-               const char *yaxis, const struct gmx_output_env_t *oenv);
+FILE *xvgropen(const char *fn, const char *title, const std::string &xaxis,
+               const std::string &yaxis, const struct gmx_output_env_t *oenv);
 /* Calls xvgropen_type with graph type xvggtXNY. */
 
 /* Close xvgr file, and clean up internal file buffers correctly */
@@ -189,8 +187,4 @@ real **read_xvg_time(const char *fn,
                      gmx_bool bTE, real te,
                      int nsets_in, int *nset, int *nval,
                      real *dt, real **t);
-#ifdef __cplusplus
-}
-#endif
-
 #endif
index c53ff6f4e61ea99bb793f5a58c4e9e542d55c244..9d4dc6ba62382af4c49b84a34fd13d1714a0ed17 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,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.
@@ -41,5 +41,5 @@ gmx_install_headers(
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${GMXANA_SOURCES} PARENT_SCOPE)
 
 if(BUILD_TESTING)
-    add_subdirectory(legacytests)
+    add_subdirectory(tests)
 endif()
index 21ce527ed1791384723b4bc42e27b863922cd692..2393f556f012acf64784ff3e536f7cbd27c3ee85 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,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.
@@ -377,16 +377,16 @@ void mk_multiplicity_lookup (int *multiplicity, int maxchi,
                 /* dihedrals to aromatic rings, COO, CONH2 or guanidinium are 2fold*/
                 if (Dih > edOmega && (dlist[i].atm.Cn[Dih-NONCHI+3] != -1))
                 {
-                    if ( ((std::strstr(name, "PHE") != NULL) && (Dih == edChi2))  ||
-                         ((std::strstr(name, "TYR") != NULL) && (Dih == edChi2))  ||
-                         ((std::strstr(name, "PTR") != NULL) && (Dih == edChi2))  ||
-                         ((std::strstr(name, "TRP") != NULL) && (Dih == edChi2))  ||
-                         ((std::strstr(name, "HIS") != NULL) && (Dih == edChi2))  ||
-                         ((std::strstr(name, "GLU") != NULL) && (Dih == edChi3))  ||
-                         ((std::strstr(name, "ASP") != NULL) && (Dih == edChi2))  ||
-                         ((std::strstr(name, "GLN") != NULL) && (Dih == edChi3))  ||
-                         ((std::strstr(name, "ASN") != NULL) && (Dih == edChi2))  ||
-                         ((std::strstr(name, "ARG") != NULL) && (Dih == edChi4))  )
+                    if ( ((std::strstr(name, "PHE") != nullptr) && (Dih == edChi2))  ||
+                         ((std::strstr(name, "TYR") != nullptr) && (Dih == edChi2))  ||
+                         ((std::strstr(name, "PTR") != nullptr) && (Dih == edChi2))  ||
+                         ((std::strstr(name, "TRP") != nullptr) && (Dih == edChi2))  ||
+                         ((std::strstr(name, "HIS") != nullptr) && (Dih == edChi2))  ||
+                         ((std::strstr(name, "GLU") != nullptr) && (Dih == edChi3))  ||
+                         ((std::strstr(name, "ASP") != nullptr) && (Dih == edChi2))  ||
+                         ((std::strstr(name, "GLN") != nullptr) && (Dih == edChi3))  ||
+                         ((std::strstr(name, "ASN") != nullptr) && (Dih == edChi2))  ||
+                         ((std::strstr(name, "ARG") != nullptr) && (Dih == edChi4))  )
                     {
                         multiplicity[j] = 2;
                     }
@@ -564,7 +564,7 @@ void get_chi_product_traj (real **dih, int nframes, int nlist,
 
             /* make a histogram pf culm. rotamer occupancy too */
             snew(chi_prhist, nbin);
-            make_histo(NULL, nframes, chi_prtrj, nbin, chi_prhist, 0, nbin);
+            make_histo(nullptr, nframes, chi_prtrj, nbin, chi_prhist, 0, nbin);
             if (bAll)
             {
                 sprintf(hisfile, "histo-chiprod%s.xvg", dlist[i].name);
@@ -848,9 +848,9 @@ void read_ang_dih(const char *trj_fn,
     total       = 0;
     teller      = 0;
     n_alloc     = 0;
-    *time       = NULL;
-    *trans_frac = NULL;
-    *aver_angle = NULL;
+    *time       = nullptr;
+    *trans_frac = nullptr;
+    *aver_angle = nullptr;
 
     do
     {
@@ -1001,7 +1001,7 @@ void read_ang_dih(const char *trj_fn,
         teller++;
     }
     while (read_next_x(oenv, status, &t, x, box));
-    close_trj(status);
+    close_trx(status);
 
     sfree(x);
     sfree(angles[cur]);
index 1c9f474d14e6cdd946f38f2d8db0da4f636e1c49..d30d16bc72087abfa2bee548e8453b12a88d6d40 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2013,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.
@@ -51,7 +51,7 @@ void rangeArray(int *ar, int size)
     }
 }
 
-void pswap(int *v1, int *v2)
+static void pswap(int *v1, int *v2)
 {
     int temp;
     temp = *v1;
@@ -60,7 +60,7 @@ void pswap(int *v1, int *v2)
 }
 
 
-void Swap (real *v1, real *v2)
+static void Swap (real *v1, real *v2)
 {
     real temp;
     temp = *v1;
@@ -133,8 +133,7 @@ int BinarySearch (real *array, int low, int high, real key, int direction)
         }
         return iMin;
     }
-
-    else if (direction < 0)
+    else
     {
         while (iMax-iMin > 1)
         {
@@ -149,9 +148,7 @@ int BinarySearch (real *array, int low, int high, real key, int direction)
             }
         }
         return iMin-1;
-
-    } /*end -ifelse direction*/
-    return -1;
+    }
 }
 
 
@@ -181,7 +178,7 @@ int LinearSearch (double *array, int startindx, int stopindx,
             }
         }
     }
-    else if (direction < 0)
+    else
     {
         for (i = stopindx; i >= startindx; i--)
         {
@@ -194,10 +191,5 @@ int LinearSearch (double *array, int startindx, int stopindx,
         }
     }
 
-    else
-    {
-        gmx_fatal(FARGS, "Startindex=stopindex=%d\n", startindx);
-    }
-
     return -1;
 }
index 6fddb2674e30f5a8cfe756c1478b2000e5608abe..d19601cff21322e98c5ca760475383d989e0414c 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,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.
@@ -144,7 +144,7 @@ void done_mat(t_mat **m)
     sfree((*m)->m_ind);
     sfree((*m)->erow);
     sfree(*m);
-    *m = NULL;
+    *m = nullptr;
 }
 
 real mat_energy(t_mat *m)
diff --git a/src/gromacs/gmxana/edittop.cpp b/src/gromacs/gmxana/edittop.cpp
deleted file mode 100644 (file)
index 3e69165..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * 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
- * Mark Abraham, David van der Spoel, Berk Hess, and 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 "gromacs/topology/ifunc.h"
-#include "gromacs/topology/symtab.h"
-#include "gromacs/topology/topology.h"
-#include "gromacs/utility/fatalerror.h"
-#include "gromacs/utility/smalloc.h"
-
-void replace_atom(t_topology *top, int inr, char *anm, char *resnm,
-                  real q, real m, int type)
-{
-    t_atoms *atoms;
-
-    atoms = &(top->atoms);
-
-    /* Replace important properties of an atom by other properties */
-    if ((inr < 0) || (inr > atoms->nr))
-    {
-        gmx_fatal(FARGS, "Replace_atom: inr (%d) not in %d .. %d", inr, 0, atoms->nr);
-    }
-    if (debug)
-    {
-        fprintf(debug, "Replacing atom %d ... ", inr);
-    }
-    /* Charge, mass and type */
-    atoms->atom[inr].q    = atoms->atom[inr].qB    = q;
-    atoms->atom[inr].m    = atoms->atom[inr].mB    = m;
-    atoms->atom[inr].type = atoms->atom[inr].typeB = type;
-
-    /* Residue name */
-    atoms->resinfo[atoms->atom[inr].resind].name = put_symtab(&top->symtab, resnm);
-    /* Atom name */
-    atoms->atomname[inr] = put_symtab(&top->symtab, anm);
-    if (debug)
-    {
-        fprintf(debug, " done\n");
-    }
-}
-
-static void delete_from_interactions(t_idef *idef, int inr)
-{
-    int      i, j, k, nra, nnr;
-    t_iatom *niatoms;
-    gmx_bool bDel;
-
-    /* Delete interactions including atom inr from lists */
-    for (i = 0; (i < F_NRE); i++)
-    {
-        nra = interaction_function[i].nratoms;
-        nnr = 0;
-        snew(niatoms, idef->il[i].nr);
-        for (j = 0; (j < idef->il[i].nr); j += nra+1)
-        {
-            bDel = FALSE;
-            for (k = 0; (k < nra); k++)
-            {
-                if (idef->il[i].iatoms[j+k+1] == inr)
-                {
-                    bDel = TRUE;
-                }
-            }
-            if (!bDel)
-            {
-                /* If this does not need to be deleted, then copy it to temp array */
-                for (k = 0; (k < nra+1); k++)
-                {
-                    niatoms[nnr+k] = idef->il[i].iatoms[j+k];
-                }
-                nnr += nra+1;
-            }
-        }
-        /* Copy temp array back */
-        for (j = 0; (j < nnr); j++)
-        {
-            idef->il[i].iatoms[j] = niatoms[j];
-        }
-        idef->il[i].nr = nnr;
-        sfree(niatoms);
-    }
-}
-
-static void delete_from_block(t_block *block, int inr)
-{
-    /* Update block data structure */
-    int i, i1, j;
-
-    for (i = 0; (i < block->nr); i++)
-    {
-        for (j = block->index[i]; (j < block->index[i+1]); j++)
-        {
-            if (j == inr)
-            {
-                /* This atom has to go */
-                /* Change indices too */
-                for (i1 = i+1; (i1 <= block->nr); i1++)
-                {
-                    block->index[i1]--;
-                }
-            }
-        }
-    }
-}
-
-static void delete_from_blocka(t_blocka *block, int inr)
-{
-    /* Update block data structure */
-    int i, i1, j1, j, k;
-
-    for (i = 0; (i < block->nr); i++)
-    {
-        for (j = block->index[i]; (j < block->index[i+1]); j++)
-        {
-            k = block->a[j];
-            if (k == inr)
-            {
-                /* This atom has to go */
-                for (j1 = j; (j1 < block->nra-1); j1++)
-                {
-                    block->a[j1] = block->a[j1+1];
-                }
-                block->nra--;
-                /* Change indices too */
-                for (i1 = i+1; (i1 <= block->nr); i1++)
-                {
-                    block->index[i1]--;
-                }
-            }
-        }
-    }
-}
-
-static void delete_from_atoms(t_atoms *atoms, int inr)
-{
-    int i;
-
-    /* Shift the atomnames down */
-    for (i = inr; (i < atoms->nr-1); i++)
-    {
-        atoms->atomname[i] = atoms->atomname[i+1];
-    }
-
-    /* Shift the atom struct down */
-    for (i = inr; (i < atoms->nr-1); i++)
-    {
-        atoms->atom[i] = atoms->atom[i+1];
-    }
-
-    if (atoms->pdbinfo)
-    {
-        /* Shift the pdbatom struct down */
-        for (i = inr; (i < atoms->nr-1); i++)
-        {
-            atoms->pdbinfo[i] = atoms->pdbinfo[i+1];
-        }
-    }
-    atoms->nr--;
-}
-
-void delete_atom(t_topology *top, int inr)
-{
-    if ((inr < 0) || (inr >= top->atoms.nr))
-    {
-        gmx_fatal(FARGS, "Delete_atom: inr (%d) not in %d .. %d", inr, 0,
-                  top->atoms.nr);
-    }
-    if (debug)
-    {
-        fprintf(debug, "Deleting atom %d ...", inr);
-    }
-
-    /* First remove bonds etc. */
-    delete_from_interactions(&top->idef, inr);
-    /* Now charge groups etc. */
-    delete_from_block(&(top->cgs), inr);
-    delete_from_block(&(top->mols), inr);
-    delete_from_blocka(&(top->excls), inr);
-    /* Now from the atoms struct */
-    delete_from_atoms(&top->atoms, inr);
-    if (debug)
-    {
-        fprintf(debug, " done\n");
-    }
-}
index 8b34c82ba529b6ea83a0cd2436e85c7aed937b8b..416b9b4ca23c86ed4b9f11b3b367ae62321500d3 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,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.
@@ -64,7 +64,7 @@ void read_eigenvectors(const char *file, int *natoms, gmx_bool *bFit,
     gmx_trr_read_frame_header(status, &head, &bOK);
     *natoms = head.natoms;
     snew(*xav, *natoms);
-    gmx_trr_read_frame_data(status, &head, box, *xav, NULL, NULL);
+    gmx_trr_read_frame_data(status, &head, box, *xav, nullptr, nullptr);
 
     if ((head.t >= -1.1) && (head.t <= -0.9))
     {
@@ -83,15 +83,15 @@ void read_eigenvectors(const char *file, int *natoms, gmx_bool *bFit,
         {
             fprintf(stderr, "Eigenvectors in %s were determined without fitting\n", file);
             sfree(*xref);
-            *xref = NULL;
+            *xref = nullptr;
         }
         gmx_trr_read_frame_header(status, &head, &bOK);
-        gmx_trr_read_frame_data(status, &head, box, *xav, NULL, NULL);
+        gmx_trr_read_frame_data(status, &head, box, *xav, nullptr, nullptr);
     }
     else
     {
         *bFit = TRUE;
-        *xref = NULL;
+        *xref = nullptr;
     }
     *bDMA = (head.lambda > 0.5);
     if ((head.t <= -0.01) || (head.t >= 0.01))
@@ -117,7 +117,7 @@ void read_eigenvectors(const char *file, int *natoms, gmx_bool *bFit,
     *nvec = 0;
     while (gmx_trr_read_frame_header(status, &head, &bOK))
     {
-        gmx_trr_read_frame_data(status, &head, box, x, NULL, NULL);
+        gmx_trr_read_frame_data(status, &head, box, x, nullptr, nullptr);
         if (*nvec >= snew_size)
         {
             snew_size += 10;
@@ -164,16 +164,16 @@ void write_eigenvectors(const char *trrname, int natoms, const real mat[],
     if (WriteXref == eWXR_YES)
     {
         /* misuse lambda: 0/1 mass weighted fit no/yes */
-        gmx_trr_write_frame(trrout, -1, -1, bDMR ? 1.0 : 0.0, zerobox, natoms, xref, NULL, NULL);
+        gmx_trr_write_frame(trrout, -1, -1, bDMR ? 1.0 : 0.0, zerobox, natoms, xref, nullptr, nullptr);
     }
     else if (WriteXref == eWXR_NOFIT)
     {
         /* misuse lambda: -1 no fit */
-        gmx_trr_write_frame(trrout, -1, -1, -1.0, zerobox, natoms, x, NULL, NULL);
+        gmx_trr_write_frame(trrout, -1, -1, -1.0, zerobox, natoms, x, nullptr, nullptr);
     }
 
     /* misuse lambda: 0/1 mass weighted analysis no/yes */
-    gmx_trr_write_frame(trrout, 0, 0, bDMA ? 1.0 : 0.0, zerobox, natoms, xav, NULL, NULL);
+    gmx_trr_write_frame(trrout, 0, 0, bDMA ? 1.0 : 0.0, zerobox, natoms, xav, nullptr, nullptr);
 
     for (i = 0; i <= (end-begin); i++)
     {
@@ -196,7 +196,7 @@ void write_eigenvectors(const char *trrname, int natoms, const real mat[],
         }
 
         /* Store the eigenvalue in the time field */
-        gmx_trr_write_frame(trrout, begin+i, eigval[vec], 0, zerobox, natoms, x, NULL, NULL);
+        gmx_trr_write_frame(trrout, begin+i, eigval[vec], 0, zerobox, natoms, x, nullptr, nullptr);
     }
     gmx_trr_close(trrout);
 
index 780d82ee1ecec01f7a362af753dfc668dc904ab8..dc6f581d074bbb1ac991b8698e73d3e4374d4de8 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,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.
@@ -76,8 +76,8 @@ real fit_ahx(int nres, t_bb bb[], int natoms, int nall, int allindex[],
              rvec x[], int nca,
              int caindex[], gmx_bool bFit)
 {
-    static rvec *xref = NULL;
-    static real *mass = NULL;
+    static rvec *xref = nullptr;
+    static real *mass = nullptr;
     const  real  d    = 0.15;  /* Rise per residue (nm)    */
     const  real  tw   = 1.745; /* Twist per residue (rad)  */
     const  real  rad  = 0.23;  /* Radius of the helix (nm) */
@@ -90,7 +90,7 @@ real fit_ahx(int nres, t_bb bb[], int natoms, int nall, int allindex[],
         gmx_fatal(FARGS, "Need at least 3 Calphas to fit to, (now %d)...\n", nca);
     }
 
-    if (xref == NULL)
+    if (xref == nullptr)
     {
         snew(xref, natoms);
         snew(mass, natoms);
index f1f3e6a6cc950abeba3bc0439332fcd66a03dee8..d9f1fcede9e01d0aa26183898aaef3ba7a110035 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,2013,2014,2015, by the GROMACS development team, led by
+ * 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.
@@ -73,19 +73,19 @@ static t_pdbfile *read_pdbf(const char *fn)
 
     snew(pdbf, 1);
     t_topology top;
-    read_tps_conf(fn, &top, &pdbf->ePBC, &pdbf->x, NULL, pdbf->box, FALSE);
+    read_tps_conf(fn, &top, &pdbf->ePBC, &pdbf->x, nullptr, pdbf->box, FALSE);
     pdbf->atoms = top.atoms;
     fp          = gmx_ffopen(fn, "r");
     char       buf[256], *ptr;
-    while ((ptr = fgets2(buf, 255, fp)) != NULL)
+    while ((ptr = fgets2(buf, 255, fp)) != nullptr)
     {
-        if (std::strstr(buf, "Intermolecular") != NULL)
+        if (std::strstr(buf, "Intermolecular") != nullptr)
         {
             ptr = std::strchr(buf, '=');
             sscanf(ptr+1, "%lf", &e);
             pdbf->edocked = e;
         }
-        else if (std::strstr(buf, "Estimated Free") != NULL)
+        else if (std::strstr(buf, "Estimated Free") != nullptr)
         {
             ptr = std::strchr(buf, '=');
             sscanf(ptr+1, "%lf", &e);
@@ -99,7 +99,7 @@ static t_pdbfile *read_pdbf(const char *fn)
 
 static t_pdbfile **read_em_all(const char *fn, int *npdbf)
 {
-    t_pdbfile **pdbf = 0;
+    t_pdbfile **pdbf = nullptr;
     int         i, maxpdbf;
     char        buf[256], name[256];
     gmx_bool    bExist;
@@ -208,9 +208,9 @@ static void clust_stat(FILE *fp, int start, int end, t_pdbfile *pdbf[])
         gmx_stats_add_point(ed, i-start, pdbf[i]->edocked, 0, 0);
         gmx_stats_add_point(ef, i-start, pdbf[i]->efree, 0, 0);
     }
-    gmx_stats_get_ase(ed, &aver, &sigma, NULL);
+    gmx_stats_get_ase(ed, &aver, &sigma, nullptr);
     fprintf(fp, "  <%12s> = %8.3f (+/- %6.3f)\n", etitles[FALSE], aver, sigma);
-    gmx_stats_get_ase(ef, &aver, &sigma, NULL);
+    gmx_stats_get_ase(ef, &aver, &sigma, nullptr);
     fprintf(fp, "  <%12s> = %8.3f (+/- %6.3f)\n", etitles[TRUE], aver, sigma);
     gmx_stats_free(ed);
     gmx_stats_free(ef);
@@ -344,7 +344,7 @@ int gmx_anadock(int argc, char *argv[])
         "energy or average energy."
     };
     t_filenm          fnm[] = {
-        { efPDB, "-f", NULL,       ffREAD  },
+        { efPDB, "-f", nullptr,       ffREAD  },
         { efXVG, "-od", "edocked", ffWRITE },
         { efXVG, "-of", "efree",   ffWRITE },
         { efLOG, "-g",  "anadock", ffWRITE }
@@ -364,11 +364,11 @@ int gmx_anadock(int argc, char *argv[])
 #define NPA asize(pa)
 
     FILE       *fp;
-    t_pdbfile **pdbf = NULL;
+    t_pdbfile **pdbf = nullptr;
     int         npdbf;
 
     if (!parse_common_args(&argc, argv, 0, NFILE, fnm, NPA, pa, asize(desc), desc, 0,
-                           NULL, &oenv))
+                           nullptr, &oenv))
     {
         return 0;
     }
index 702d6f208e5e43b3bf7b2b2cce1bdaea97b9306d..bd390ebab75912d0b634e6190b41261d613f33fc 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,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.
  */
 #include "gmxpre.h"
 
+#include <cassert>
 #include <cmath>
 #include <cstdlib>
 #include <cstring>
 
 #include <algorithm>
+#include <string>
 
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/commandline/viewit.h"
@@ -146,7 +148,7 @@ static real tick_spacing(real range, int minticks)
 
 static void write_xvgr_graphs(const char *file, int ngraphs, int nsetspergraph,
                               const char *title, const char *subtitle,
-                              const char *xlabel, const char **ylabel,
+                              const std::string &xlabel, const char **ylabel,
                               int n, real *x, real **y, real ***sy,
                               real scale_x, gmx_bool bZero, gmx_bool bSplit,
                               const gmx_output_env_t *oenv)
@@ -180,6 +182,7 @@ static void write_xvgr_graphs(const char *file, int ngraphs, int nsetspergraph,
         }
         else
         {
+            assert(sy);
             ymin = sy[g][0][0];
             ymax = sy[g][0][0];
             for (s = 0; s < nsetspergraph; s++)
@@ -221,7 +224,7 @@ static void write_xvgr_graphs(const char *file, int ngraphs, int nsetspergraph,
             }
             if (g == ngraphs-1)
             {
-                fprintf(out, "@ xaxis  label \"%s\"\n", xlabel);
+                fprintf(out, "@ xaxis  label \"%s\"\n", xlabel.c_str());
             }
             else
             {
@@ -316,7 +319,7 @@ compare(int natoms, int n1, rvec **eigvec1, int n2, rvec **eigvec2,
     // better to be safe than sorry, so we check it with an assert.
     // If we are in this comparison routine in the first place, neig2 should not be 0,
     // so eigval2 should always be a valid pointer.
-    GMX_RELEASE_ASSERT(eigval2 != NULL, "NULL pointer provided for eigval2");
+    GMX_RELEASE_ASSERT(eigval2 != nullptr, "NULL pointer provided for eigval2");
 
     for (i = n; i < neig2; i++)
     {
@@ -509,19 +512,19 @@ static void project(const char *trajfile, const t_topology *top, int ePBC, matri
                     int noutvec, int *outvec, gmx_bool bSplit,
                     const gmx_output_env_t *oenv)
 {
-    FILE        *xvgrout = NULL;
+    FILE        *xvgrout = nullptr;
     int          nat, i, j, d, v, vec, nfr, nframes = 0, snew_size, frame;
-    t_trxstatus *out = NULL;
+    t_trxstatus *out = nullptr;
     t_trxstatus *status;
     int          noutvec_extr, imin, imax;
     real        *pmin, *pmax;
     int         *all_at;
     matrix       box;
     rvec        *xread, *x;
-    real         t, inp, **inprod = NULL;
+    real         t, inp, **inprod = nullptr;
     char         str[STRLEN], str2[STRLEN], **ylabel, *c;
     real         fact;
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
 
     snew(x, natoms);
 
@@ -589,7 +592,7 @@ static void project(const char *trajfile, const t_topology *top, int ePBC, matri
                 /* calculate x: a fitted struture of the selected atoms */
                 if (bFit)
                 {
-                    reset_x(nfit, ifit, nat, NULL, xread, w_rls);
+                    reset_x(nfit, ifit, nat, nullptr, xread, w_rls);
                     do_fit(nat, w_rls, xref, xread);
                 }
                 for (i = 0; i < natoms; i++)
@@ -625,7 +628,7 @@ static void project(const char *trajfile, const t_topology *top, int ePBC, matri
                             }
                         }
                     }
-                    write_trx(out, natoms, index, atoms, 0, t, box, xread, NULL, NULL);
+                    write_trx(out, natoms, index, atoms, 0, t, box, xread, nullptr, nullptr);
                 }
                 nframes++;
             }
@@ -652,7 +655,7 @@ static void project(const char *trajfile, const t_topology *top, int ePBC, matri
 
     if (projfile)
     {
-        GMX_RELEASE_ASSERT(inprod != NULL, "inprod must be non-NULL if projfile is non-NULL");
+        GMX_RELEASE_ASSERT(inprod != nullptr, "inprod must be non-NULL if projfile is non-NULL");
         snew(ylabel, noutvec);
         for (v = 0; v < noutvec; v++)
         {
@@ -660,9 +663,9 @@ static void project(const char *trajfile, const t_topology *top, int ePBC, matri
             ylabel[v] = gmx_strdup(str);
         }
         sprintf(str, "projection on eigenvectors (%s)", proj_unit);
-        write_xvgr_graphs(projfile, noutvec, 1, str, NULL, output_env_get_xvgr_tlabel(oenv),
+        write_xvgr_graphs(projfile, noutvec, 1, str, nullptr, output_env_get_xvgr_tlabel(oenv),
                           (const char **)ylabel,
-                          nframes, inprod[noutvec], inprod, NULL,
+                          nframes, inprod[noutvec], inprod, nullptr,
                           output_env_get_time_factor(oenv), FALSE, bSplit, oenv);
     }
 
@@ -689,7 +692,7 @@ static void project(const char *trajfile, const t_topology *top, int ePBC, matri
     {
         t_atoms     atoms;
         rvec       *x;
-        real       *b = NULL;
+        real       *b = nullptr;
         matrix      box;
         char       *resnm, *atnm;
         gmx_bool    bPDB, b4D;
@@ -752,7 +755,7 @@ static void project(const char *trajfile, const t_topology *top, int ePBC, matri
         }
         if ( ( b4D || bSplit ) && bPDB)
         {
-            GMX_RELEASE_ASSERT(inprod != NULL, "inprod must be non-NULL with 4D or split PDB output options");
+            GMX_RELEASE_ASSERT(inprod != nullptr, "inprod must be non-NULL with 4D or split PDB output options");
 
             out = gmx_ffopen(threedplotfile, "w");
             fprintf(out, "HEADER    %s\n", str);
@@ -781,7 +784,7 @@ static void project(const char *trajfile, const t_topology *top, int ePBC, matri
         }
         else
         {
-            write_sto_conf(threedplotfile, str, &atoms, x, NULL, ePBC, box);
+            write_sto_conf(threedplotfile, str, &atoms, x, nullptr, ePBC, box);
         }
         done_atom(&atoms);
     }
@@ -792,7 +795,7 @@ static void project(const char *trajfile, const t_topology *top, int ePBC, matri
         snew(pmax, noutvec_extr);
         if (extreme == 0)
         {
-            GMX_RELEASE_ASSERT(inprod != NULL, "inprod must be non-NULL");
+            GMX_RELEASE_ASSERT(inprod != nullptr, "inprod must be non-NULL");
             fprintf(stderr, "%11s %17s %17s\n", "eigenvector", "Minimum", "Maximum");
             fprintf(stderr,
                     "%11s %10s %10s %10s %10s\n", "", "value", "frame", "value", "frame");
@@ -860,7 +863,7 @@ static void project(const char *trajfile, const t_topology *top, int ePBC, matri
                              *eigvec[outvec[v]][i][d]/sqrtm[i]);
                     }
                 }
-                write_trx(out, natoms, index, atoms, 0, frame, topbox, xread, NULL, NULL);
+                write_trx(out, natoms, index, atoms, 0, frame, topbox, xread, nullptr, nullptr);
             }
             close_trx(out);
         }
@@ -910,7 +913,7 @@ static void components(const char *outfile, int natoms,
     write_xvgr_graphs(outfile, noutvec, 4, "Eigenvector components",
                       "black: total, red: x, green: y, blue: z",
                       "Atom number", (const char **)ylabel,
-                      natoms, x, NULL, y, 1, FALSE, FALSE, oenv);
+                      natoms, x, nullptr, y, 1, FALSE, FALSE, oenv);
     fprintf(stderr, "\n");
 }
 
@@ -956,9 +959,9 @@ static void rmsf(const char *outfile, int natoms, real *sqrtm,
             y[g][i] = std::sqrt(eigval[eignr[v]]*norm2(eigvec[v][i]))/sqrtm[i];
         }
     }
-    write_xvgr_graphs(outfile, noutvec, 1, "RMS fluctuation (nm) ", NULL,
+    write_xvgr_graphs(outfile, noutvec, 1, "RMS fluctuation (nm) ", nullptr,
                       "Atom number", (const char **)ylabel,
-                      natoms, x, y, NULL, 1, TRUE, FALSE, oenv);
+                      natoms, x, y, nullptr, 1, TRUE, FALSE, oenv);
     fprintf(stderr, "\n");
 }
 
@@ -1071,11 +1074,11 @@ int gmx_anaeig(int argc, char *argv[])
 
     t_topology        top;
     int               ePBC  = -1;
-    const t_atoms    *atoms = NULL;
-    rvec             *xtop, *xref1, *xref2, *xrefp = NULL;
+    const t_atoms    *atoms = nullptr;
+    rvec             *xtop, *xref1, *xref2, *xrefp = nullptr;
     gmx_bool          bDMR1, bDMA1, bDMR2, bDMA2;
-    int               nvec1, nvec2, *eignr1 = NULL, *eignr2 = NULL;
-    rvec             *xav1, *xav2, **eigvec1 = NULL, **eigvec2 = NULL;
+    int               nvec1, nvec2, *eignr1 = nullptr, *eignr2 = nullptr;
+    rvec             *xav1, *xav2, **eigvec1 = nullptr, **eigvec2 = nullptr;
     matrix            topbox;
     real              totmass, *sqrtm, *w_rls, t;
     int               natoms;
@@ -1083,7 +1086,7 @@ int gmx_anaeig(int argc, char *argv[])
     const char       *indexfile;
     int               i, j, d;
     int               nout, *iout, noutvec, *outvec, nfit;
-    int              *index = NULL, *ifit = NULL;
+    int              *index = nullptr, *ifit = nullptr;
     const char       *VecFile, *Vec2File, *topfile;
     const char       *EigFile, *Eig2File;
     const char       *CompFile, *RmsfFile, *ProjOnVecFile;
@@ -1092,7 +1095,7 @@ int gmx_anaeig(int argc, char *argv[])
     const char       *OverlapFile, *InpMatFile;
     gmx_bool          bFit1, bFit2, bM, bIndex, bTPS, bTop, bVec2, bProj;
     gmx_bool          bFirstToLast, bFirstLastSet, bTraj, bCompare, bPDB3D;
-    real             *eigval1 = NULL, *eigval2 = NULL;
+    real             *eigval1 = nullptr, *eigval2 = nullptr;
     int               neig1, neig2;
     double          **xvgdata;
     gmx_output_env_t *oenv;
@@ -1101,9 +1104,9 @@ int gmx_anaeig(int argc, char *argv[])
     t_filenm          fnm[] = {
         { efTRN, "-v",    "eigenvec",    ffREAD  },
         { efTRN, "-v2",   "eigenvec2",   ffOPTRD },
-        { efTRX, "-f",    NULL,          ffOPTRD },
-        { efTPS, NULL,    NULL,          ffOPTRD },
-        { efNDX, NULL,    NULL,          ffOPTRD },
+        { efTRX, "-f",    nullptr,          ffOPTRD },
+        { efTPS, nullptr,    nullptr,          ffOPTRD },
+        { efNDX, nullptr,    nullptr,          ffOPTRD },
         { efXVG, "-eig", "eigenval",     ffOPTRD },
         { efXVG, "-eig2", "eigenval2",   ffOPTRD },
         { efXVG, "-comp", "eigcomp",     ffOPTWR },
@@ -1120,7 +1123,7 @@ int gmx_anaeig(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv,
                            PCA_CAN_TIME | PCA_TIME_UNIT | PCA_CAN_VIEW,
-                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -1164,7 +1167,7 @@ int gmx_anaeig(int argc, char *argv[])
     neig1 = DIM*natoms;
 
     /* Overwrite eigenvalues from separate files if the user provides them */
-    if (EigFile != NULL)
+    if (EigFile != nullptr)
     {
         int neig_tmp = read_xvg(EigFile, &xvgdata, &i);
         if (neig_tmp != neig1)
@@ -1222,7 +1225,7 @@ int gmx_anaeig(int argc, char *argv[])
         neig2 = 0;
     }
 
-    if (Eig2File != NULL)
+    if (Eig2File != nullptr)
     {
         neig2 = read_xvg(Eig2File, &xvgdata, &i);
         srenew(eigval2, neig2);
@@ -1243,15 +1246,15 @@ int gmx_anaeig(int argc, char *argv[])
     {
         bM = FALSE;
     }
-    if ((xref1 == NULL) && (bM || bTraj))
+    if ((xref1 == nullptr) && (bM || bTraj))
     {
         bTPS = TRUE;
     }
 
-    xtop  = NULL;
+    xtop  = nullptr;
     nfit  = 0;
-    ifit  = NULL;
-    w_rls = NULL;
+    ifit  = nullptr;
+    w_rls = nullptr;
 
     if (!bTPS)
     {
@@ -1260,14 +1263,14 @@ int gmx_anaeig(int argc, char *argv[])
     else
     {
         bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm),
-                             &top, &ePBC, &xtop, NULL, topbox, bM);
+                             &top, &ePBC, &xtop, nullptr, topbox, bM);
         atoms = &top.atoms;
         gpbc  = gmx_rmpbc_init(&top.idef, ePBC, atoms->nr);
         gmx_rmpbc(gpbc, atoms->nr, topbox, xtop);
         /* Fitting is only required for the projection */
         if (bProj && bFit1)
         {
-            if (xref1 == NULL)
+            if (xref1 == nullptr)
             {
                 printf("\nNote: the structure in %s should be the same\n"
                        "      as the one used for the fit in g_covar\n", topfile);
@@ -1289,7 +1292,7 @@ int gmx_anaeig(int argc, char *argv[])
             }
 
             snew(xrefp, atoms->nr);
-            if (xref1 != NULL)
+            if (xref1 != nullptr)
             {
                 /* Safety check between selected fit-group and reference structure read from the eigenvector file */
                 if (natoms != nfit)
@@ -1308,7 +1311,7 @@ int gmx_anaeig(int argc, char *argv[])
                 {
                     copy_rvec(xtop[ifit[i]], xrefp[ifit[i]]);
                 }
-                reset_x(nfit, ifit, atoms->nr, NULL, xrefp, w_rls);
+                reset_x(nfit, ifit, atoms->nr, nullptr, xrefp, w_rls);
             }
         }
         gmx_rmpbc_done(gpbc);
@@ -1402,7 +1405,7 @@ int gmx_anaeig(int argc, char *argv[])
     {
         printf("Select eigenvectors for output, end your selection with 0\n");
         nout = -1;
-        iout = NULL;
+        iout = nullptr;
 
         do
         {
@@ -1458,8 +1461,8 @@ int gmx_anaeig(int argc, char *argv[])
 
     if (bProj)
     {
-        project(bTraj ? opt2fn("-f", NFILE, fnm) : NULL,
-                bTop ? &top : NULL, ePBC, topbox,
+        project(bTraj ? opt2fn("-f", NFILE, fnm) : nullptr,
+                bTop ? &top : nullptr, ePBC, topbox,
                 ProjOnVecFile, TwoDPlotFile, ThreeDPlotFile, FilterFile, skip,
                 ExtremeFile, bFirstLastSet, max, nextr, atoms, natoms, index,
                 bFit1, xrefp, nfit, ifit, w_rls,
index 8ed9dc6acf25e7a2f1f28b0a6ad4451819ddfb43..f2642dd88f3a2ee4d489ccb49f70f71dd05f44cd 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,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.
@@ -45,7 +45,6 @@
 #include "gromacs/correlationfunctions/autocorr.h"
 #include "gromacs/correlationfunctions/expfit.h"
 #include "gromacs/correlationfunctions/integrate.h"
-#include "gromacs/fileio/readinp.h"
 #include "gromacs/fileio/xvgr.h"
 #include "gromacs/gmxana/gmx_ana.h"
 #include "gromacs/gmxana/gstat.h"
@@ -222,7 +221,7 @@ static void regression_analysis(int n, gmx_bool bXYdy,
             }
         }
         snew(a, nset-1);
-        chi2 = multi_regression(NULL, n, y, nset-1, xx, a);
+        chi2 = multi_regression(nullptr, n, y, nset-1, xx, a);
         printf("Fitting %d data points in %d sets\n", n, nset-1);
         printf("chi2 = %g\n", chi2);
         printf("A =");
@@ -238,8 +237,8 @@ static void regression_analysis(int n, gmx_bool bXYdy,
     }
 }
 
-void histogram(const char *distfile, real binwidth, int n, int nset, real **val,
-               const gmx_output_env_t *oenv)
+static void histogram(const char *distfile, real binwidth, int n, int nset, real **val,
+                      const gmx_output_env_t *oenv)
 {
     FILE          *fp;
     int            i, s;
@@ -322,7 +321,7 @@ static void average(const char *avfile, int avbar_opt,
     FILE   *fp;
     int     i, s, edge = 0;
     double  av, var, err;
-    real   *tmp = NULL;
+    real   *tmp = nullptr;
 
     fp = gmx_ffopen(avfile, "w");
     if ((avbar_opt == avbarERROR) && (nset == 1))
@@ -564,7 +563,7 @@ static void estimate_error(const char *eefile, int nb_min, int resol, int n,
                 fitparm[2] = std::sqrt(tau1_est*(n-1)*dt);
                 do_lmfit(nbs, ybs, fitsig, 0, tbs, 0, dt*n, oenv,
                          bDebugMode(), effnERREST, fitparm, 0,
-                         NULL);
+                         nullptr);
             }
             if (bSingleExpFit || fitparm[0] < 0 || fitparm[2] < 0 || fitparm[1] < 0
                 || (fitparm[1] > 1 && !bAllowNegLTCorr) || fitparm[2] > (n-1)*dt)
@@ -593,7 +592,7 @@ static void estimate_error(const char *eefile, int nb_min, int resol, int n,
                     fitparm[2] = (n-1)*dt;
                     fprintf(stdout, "Will fix tau2 at the total time: %g\n", fitparm[2]);
                     do_lmfit(nbs, ybs, fitsig, 0, tbs, 0, dt*n, oenv, bDebugMode(),
-                             effnERREST, fitparm, 4, NULL);
+                             effnERREST, fitparm, 4, nullptr);
                 }
                 if (bSingleExpFit || fitparm[0] < 0 || fitparm[1] < 0
                     || (fitparm[1] > 1 && !bAllowNegLTCorr))
@@ -611,7 +610,7 @@ static void estimate_error(const char *eefile, int nb_min, int resol, int n,
                     fitparm[1] = 1.0;
                     fitparm[2] = 0.0;
                     do_lmfit(nbs, ybs, fitsig, 0, tbs, 0, dt*n, oenv, bDebugMode(),
-                             effnERREST, fitparm, 6, NULL);
+                             effnERREST, fitparm, 6, nullptr);
                 }
             }
             ee   = optimal_error_estimate(sig[s], fitparm, n*dt);
@@ -658,7 +657,7 @@ static void estimate_error(const char *eefile, int nb_min, int resol, int n,
                     fitsig[i] = 1;
                 }
             }
-            low_do_autocorr(NULL, oenv, NULL, n, 1, -1, &ac,
+            low_do_autocorr(nullptr, oenv, nullptr, n, 1, -1, &ac,
                             dt, eacNormal, 1, FALSE, TRUE,
                             FALSE, 0, 0, effnNONE);
 
@@ -681,8 +680,8 @@ static void estimate_error(const char *eefile, int nb_min, int resol, int n,
             ac_fit[0] = 0.5*acint;
             ac_fit[1] = 0.95;
             ac_fit[2] = 10*acint;
-            do_lmfit(n/nb_min, ac, fitsig, dt, 0, 0, fitlen*dt, oenv,
-                     bDebugMode(), effnEXPEXP, ac_fit, 0, NULL);
+            do_lmfit(n/nb_min, ac, fitsig, dt, nullptr, 0, fitlen*dt, oenv,
+                     bDebugMode(), effnEXPEXP, ac_fit, 0, nullptr);
             ac_fit[3] = 1 - ac_fit[1];
 
             fprintf(stdout, "Set %3d:  ac erest %g  a %g  tau1 %g  tau2 %g\n",
@@ -736,7 +735,7 @@ static void luzar_correl(int nn, real *time, int nset, real **val, real temp,
             }
             fprintf(debug, "RMS difference in derivatives is %g\n", std::sqrt(d2/nn));
         }
-        analyse_corr(nn, time, val[0], val[2], kt, NULL, NULL, NULL, fit_start,
+        analyse_corr(nn, time, val[0], val[2], kt, nullptr, nullptr, nullptr, fit_start,
                      temp);
         sfree(kt);
     }
@@ -800,7 +799,7 @@ static void do_fit(FILE *out, int n, gmx_bool bYdy,
                    int npargs, t_pargs *ppa, const gmx_output_env_t *oenv,
                    const char *fn_fitted)
 {
-    real   *c1 = NULL, *sig = NULL;
+    real   *c1 = nullptr, *sig = nullptr;
     double *fitparm;
     real    tendfit, tbeginfit;
     int     i, efitfn, nparm;
@@ -919,9 +918,9 @@ static void print_fitted_function(const char       *fitfile,
     }
     else
     {
-        char *buf2 = NULL;
+        char *buf2 = nullptr;
         int   s, buflen = 0;
-        if (NULL != fn_fitted)
+        if (nullptr != fn_fitted)
         {
             buflen = std::strlen(fn_fitted)+32;
             snew(buf2, buflen);
@@ -930,8 +929,8 @@ static void print_fitted_function(const char       *fitfile,
         }
         for (s = 0; s < nset; s++)
         {
-            char *buf = NULL;
-            if (NULL != fn_fitted)
+            char *buf = nullptr;
+            if (nullptr != fn_fitted)
             {
                 snew(buf, buflen);
                 snprintf(buf, n, "%s_%d.xvg", buf2, s);
@@ -1042,7 +1041,7 @@ int gmx_analyze(int argc, char *argv[])
 
     /* must correspond to enum avbar* declared at beginning of file */
     static const char *avbar_opt[avbarNR+1] = {
-        NULL, "none", "stddev", "error", "90", NULL
+        nullptr, "none", "stddev", "error", "90", nullptr
     };
 
     t_pargs            pa[] = {
@@ -1130,8 +1129,9 @@ int gmx_analyze(int argc, char *argv[])
     ppa    = add_acf_pargs(&npargs, pa);
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW,
-                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, nullptr, &oenv))
     {
+        sfree(ppa);
         return 0;
     }
 
@@ -1141,7 +1141,7 @@ int gmx_analyze(int argc, char *argv[])
     distfile = opt2fn_null("-dist", NFILE, fnm);
     avfile   = opt2fn_null("-av", NFILE, fnm);
     eefile   = opt2fn_null("-ee", NFILE, fnm);
-    if (opt2parg_bSet("-fitfn", npargs, ppa) && acfile == NULL)
+    if (opt2parg_bSet("-fitfn", npargs, ppa) && acfile == nullptr)
     {
         fitfile  = opt2fn("-g", NFILE, fnm);
     }
@@ -1185,13 +1185,13 @@ int gmx_analyze(int argc, char *argv[])
         {
             for (s = 0; s < nset; s++)
             {
-                sum = evaluate_integral(n, t, val[s], NULL, aver_start, &stddev);
+                sum = evaluate_integral(n, t, val[s], nullptr, aver_start, &stddev);
                 printf("Integral %d  %10.5f  +/- %10.5f\n", s+1, sum, stddev);
             }
         }
     }
 
-    if (fitfile != NULL)
+    if (fitfile != nullptr)
     {
         print_fitted_function(fitfile,
                               opt2fn_null("-fitted", NFILE, fnm),
@@ -1304,7 +1304,7 @@ int gmx_analyze(int argc, char *argv[])
         power_fit(n, nset, val, t);
     }
 
-    if (acfile != NULL)
+    if (acfile != nullptr)
     {
         if (bSubAv)
         {
index 3bf3634461a902a5c100009302f6129c37381c66..295b9be41b9229d40bfcaccea537fea4f270d53e 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,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.
@@ -101,7 +101,7 @@ static void dump_dih_trr(int nframes, int nangles, real **dih, const char *fn,
                 }
             }
         }
-        gmx_trr_write_frame(fio, i, time[i], 0, box, na, x, NULL, NULL);
+        gmx_trr_write_frame(fio, i, time[i], 0, box, na, x, nullptr, nullptr);
     }
     gmx_trr_close(fio);
     sfree(x);
@@ -130,7 +130,7 @@ int gmx_g_angle(int argc, char *argv[])
         "records a histogram of the times between such transitions,",
         "assuming the input trajectory frames are equally spaced in time."
     };
-    static const char *opt[]    = { NULL, "angle", "dihedral", "improper", "ryckaert-bellemans", NULL };
+    static const char *opt[]    = { nullptr, "angle", "dihedral", "improper", "ryckaert-bellemans", nullptr };
     static gmx_bool    bALL     = FALSE, bChandler = FALSE, bAverCorr = FALSE, bPBC = TRUE;
     static real        binwidth = 1;
     t_pargs            pa[]     = {
@@ -167,18 +167,18 @@ int gmx_g_angle(int argc, char *argv[])
     real              aver, aver2, aversig; /* fraction trans dihedrals */
     double            tfrac = 0;
     char              title[256];
-    real            **dih = NULL; /* mega array with all dih. angles at all times*/
+    real            **dih = nullptr; /* mega array with all dih. angles at all times*/
     real             *time, *trans_frac, *aver_angle;
     t_filenm          fnm[] = {
-        { efTRX, "-f", NULL,  ffREAD  },
-        { efNDX, NULL, "angle",  ffREAD  },
+        { efTRX, "-f", nullptr,  ffREAD  },
+        { efNDX, nullptr, "angle",  ffREAD  },
         { efXVG, "-od", "angdist",  ffWRITE },
         { efXVG, "-ov", "angaver",  ffOPTWR },
         { efXVG, "-of", "dihfrac",  ffOPTWR },
         { efXVG, "-ot", "dihtrans", ffOPTWR },
         { efXVG, "-oh", "trhisto",  ffOPTWR },
         { efXVG, "-oc", "dihcorr",  ffOPTWR },
-        { efTRR, "-or", NULL,       ffOPTWR }
+        { efTRR, "-or", nullptr,       ffOPTWR }
     };
 #define NFILE asize(fnm)
     int               npargs;
@@ -191,6 +191,7 @@ int gmx_g_angle(int argc, char *argv[])
                            NFILE, fnm, npargs, ppa, asize(desc), desc, asize(bugs), bugs,
                            &oenv))
     {
+        sfree(ppa);
         return 0;
     }
 
@@ -198,7 +199,7 @@ int gmx_g_angle(int argc, char *argv[])
     maxang = 360.0;
     bRb    = FALSE;
 
-    GMX_RELEASE_ASSERT(opt[0] != NULL, "Internal option inconsistency; opt[0]==NULL after processing");
+    GMX_RELEASE_ASSERT(opt[0] != nullptr, "Internal option inconsistency; opt[0]==NULL after processing");
 
     switch (opt[0][0])
     {
@@ -433,7 +434,7 @@ int gmx_g_angle(int argc, char *argv[])
     {
         sprintf(title, "Dihedral Distribution: %s", grpname);
 
-        calc_distribution_props(maxangstat, angstat, -180.0, 0, NULL, &S2);
+        calc_distribution_props(maxangstat, angstat, -180.0, 0, nullptr, &S2);
         fprintf(stderr, "Order parameter S^2 = %g\n", S2);
     }
 
index 14a7895856d706471aec70e708369c289412e712..865cf3c6a3153a74666d85c66463ce42f7cf041e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,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.
@@ -255,11 +255,11 @@ static gmx_bool lambda_components_check(const lambda_components_t *lc,
     {
         return FALSE;
     }
-    if (name == NULL && lc->names[index] == NULL)
+    if (name == nullptr && lc->names[index] == nullptr)
     {
         return TRUE;
     }
-    if ((name == NULL) != (lc->names[index] == NULL))
+    if ((name == nullptr) != (lc->names[index] == nullptr))
     {
         return FALSE;
     }
@@ -566,11 +566,11 @@ static void hist_init(hist_t *h, int nhist, int *nbin)
 
 static void xvg_init(xvg_t *ba)
 {
-    ba->filename = NULL;
+    ba->filename = nullptr;
     ba->nset     = 0;
     ba->np_alloc = 0;
-    ba->np       = NULL;
-    ba->y        = NULL;
+    ba->np       = nullptr;
+    ba->y        = nullptr;
 }
 
 static void samples_init(samples_t *s, lambda_vec_t *native_lambda,
@@ -583,13 +583,13 @@ static void samples_init(samples_t *s, lambda_vec_t *native_lambda,
     s->derivative     = derivative;
 
     s->ndu        = 0;
-    s->du         = NULL;
-    s->t          = NULL;
+    s->du         = nullptr;
+    s->t          = nullptr;
     s->start_time = s->delta_time = 0;
-    s->hist       = NULL;
-    s->du_alloc   = NULL;
-    s->t_alloc    = NULL;
-    s->hist_alloc = NULL;
+    s->hist       = nullptr;
+    s->du_alloc   = nullptr;
+    s->t_alloc    = nullptr;
+    s->hist_alloc = nullptr;
     s->ndu_alloc  = 0;
     s->nt_alloc   = 0;
 
@@ -602,7 +602,7 @@ static void sample_range_init(sample_range_t *r, samples_t *s)
     r->start = 0;
     r->end   = s->ndu;
     r->use   = TRUE;
-    r->s     = NULL;
+    r->s     = nullptr;
 }
 
 static void sample_coll_init(sample_coll_t *sc, lambda_vec_t *native_lambda,
@@ -613,12 +613,12 @@ static void sample_coll_init(sample_coll_t *sc, lambda_vec_t *native_lambda,
     sc->temp           = temp;
 
     sc->nsamples       = 0;
-    sc->s              = NULL;
-    sc->r              = NULL;
+    sc->s              = nullptr;
+    sc->r              = nullptr;
     sc->nsamples_alloc = 0;
 
     sc->ntot = 0;
-    sc->next = sc->prev = NULL;
+    sc->next = sc->prev = nullptr;
 }
 
 static void sample_coll_destroy(sample_coll_t *sc)
@@ -635,12 +635,12 @@ static void lambda_data_init(lambda_data_t *l, lambda_vec_t *native_lambda,
     l->lambda = native_lambda;
     l->temp   = temp;
 
-    l->next = NULL;
-    l->prev = NULL;
+    l->next = nullptr;
+    l->prev = nullptr;
 
     l->sc = &(l->sc_head);
 
-    sample_coll_init(l->sc, native_lambda, NULL, 0.);
+    sample_coll_init(l->sc, native_lambda, nullptr, 0.);
     l->sc->next = l->sc;
     l->sc->prev = l->sc;
 }
@@ -656,8 +656,8 @@ static void barres_init(barres_t *br)
     br->dg_stddev     = 0;
     br->dg_stddev_err = 0;
 
-    br->a = NULL;
-    br->b = NULL;
+    br->a = nullptr;
+    br->b = nullptr;
 }
 
 
@@ -700,7 +700,7 @@ static sample_coll_t *lambda_data_find_sample_coll(lambda_data_t *l,
         sc = sc->next;
     }
 
-    return NULL;
+    return nullptr;
 }
 
 /* insert li into an ordered list of lambda_colls */
@@ -985,8 +985,8 @@ static void sample_coll_make_hist(sample_coll_t *sc, int **bin,
 }
 
 /* write a collection of histograms to a file */
-void sim_data_histogram(sim_data_t *sd, const char *filename,
-                        int nbin_default, const gmx_output_env_t *oenv)
+static void sim_data_histogram(sim_data_t *sd, const char *filename,
+                               int nbin_default, const gmx_output_env_t *oenv)
 {
     char           label_x[STRLEN];
     const char    *dhdl    = "dH/d\\lambda", *deltag = "\\DeltaH", *lambda = "\\lambda";
@@ -995,10 +995,10 @@ void sim_data_histogram(sim_data_t *sd, const char *filename,
     FILE          *fp;
     lambda_data_t *bl;
     int            nsets     = 0;
-    char         **setnames  = NULL;
+    char         **setnames  = nullptr;
     gmx_bool       first_set = FALSE;
     /* histogram data: */
-    int           *hist       = NULL;
+    int           *hist       = nullptr;
     int            nbin       = 0;
     int            nbin_alloc = 0;
     double         dx         = 0;
@@ -1059,7 +1059,7 @@ void sim_data_histogram(sim_data_t *sd, const char *filename,
         {
             if (!first_set)
             {
-                xvgr_new_dataset(fp, 0, 0, NULL, oenv);
+                xvgr_new_dataset(fp, 0, 0, nullptr, oenv);
             }
 
             sample_coll_make_hist(sc, &hist, &nbin_alloc, &nbin, &dx, &minval,
@@ -2213,9 +2213,9 @@ static const char *find_value(const char *str)
     gmx_bool name_end_found = FALSE;
 
     /* if the string is a NULL pointer, return a NULL pointer. */
-    if (str == NULL)
+    if (str == nullptr)
     {
-        return NULL;
+        return nullptr;
     }
     while (*str != '\0')
     {
@@ -2236,7 +2236,7 @@ static const char *find_value(const char *str)
         }
         str++;
     }
-    return NULL;
+    return nullptr;
 }
 
 
@@ -2248,14 +2248,14 @@ static gmx_bool read_lambda_compvec(const char                *str,
                                     const char               **end,
                                     const char                *fn)
 {
-    gmx_bool    initialize_lc = FALSE; /* whether to initialize the lambda
-                                          components, or to check them */
-    gmx_bool    start_reached = FALSE; /* whether the start of component names
-                                          has been reached */
-    gmx_bool    vector        = FALSE; /* whether there are multiple components */
-    int         n             = 0;     /* current component number */
-    const char *val_start     = NULL;  /* start of the component name, or NULL
-                                          if not in a value */
+    gmx_bool    initialize_lc = FALSE;   /* whether to initialize the lambda
+                                            components, or to check them */
+    gmx_bool    start_reached = FALSE;   /* whether the start of component names
+                                            has been reached */
+    gmx_bool    vector        = FALSE;   /* whether there are multiple components */
+    int         n             = 0;       /* current component number */
+    const char *val_start     = nullptr; /* start of the component name, or NULL
+                                            if not in a value */
     char       *strtod_end;
     gmx_bool    OK = TRUE;
 
@@ -2270,7 +2270,7 @@ static gmx_bool read_lambda_compvec(const char                *str,
         initialize_lc = TRUE;
     }
 
-    if (lc_in == NULL)
+    if (lc_in == nullptr)
     {
         lc_in = lc_out;
     }
@@ -2302,7 +2302,7 @@ static gmx_bool read_lambda_compvec(const char                *str,
                 if (std::isspace(*str) || *str == ')' || *str == ',' || *str == '\0')
                 {
                     /* end of value */
-                    if (lv == NULL)
+                    if (lv == nullptr)
                     {
                         if (initialize_lc)
                         {
@@ -2329,7 +2329,7 @@ static gmx_bool read_lambda_compvec(const char                *str,
                         }
                     }
                     /* reset for the next identifier */
-                    val_start = NULL;
+                    val_start = nullptr;
                     n++;
                     if (!vector)
                     {
@@ -2354,12 +2354,12 @@ static gmx_bool read_lambda_compvec(const char                *str,
                 }
                 else
                 {
-                    GMX_RELEASE_ASSERT(lc_in != NULL, "Internal inconsistency? lc_in==NULL");
+                    GMX_RELEASE_ASSERT(lc_in != nullptr, "Internal inconsistency? lc_in==NULL");
                     if (n == lc_in->N)
                     {
                         return OK;
                     }
-                    else if (lv == NULL)
+                    else if (lv == nullptr)
                     {
                         return FALSE;
                     }
@@ -2397,7 +2397,7 @@ static gmx_bool read_lambda_components(const char          *str,
                                        const char         **end,
                                        const char          *fn)
 {
-    return read_lambda_compvec(str, NULL, NULL, lc, end, fn);
+    return read_lambda_compvec(str, nullptr, nullptr, lc, end, fn);
 }
 
 /* read an initialized lambda vector from a string */
@@ -2406,7 +2406,7 @@ static gmx_bool read_lambda_vector(const char   *str,
                                    const char  **end,
                                    const char   *fn)
 {
-    return read_lambda_compvec(str, lv, lv->lc, NULL, end, fn);
+    return read_lambda_compvec(str, lv, lv->lc, nullptr, end, fn);
 }
 
 
@@ -2422,12 +2422,12 @@ static gmx_bool legend2lambda(const char   *fn,
                               const char   *legend,
                               lambda_vec_t *lam)
 {
-    const char   *ptr    = NULL, *ptr2 = NULL;
+    const char   *ptr    = nullptr, *ptr2 = nullptr;
     gmx_bool      ok     = FALSE;
     gmx_bool      bdhdl  = FALSE;
     const char   *tostr  = " to ";
 
-    if (legend == NULL)
+    if (legend == nullptr)
     {
         gmx_fatal(FARGS, "There is no legend in file '%s', can not deduce lambda", fn);
     }
@@ -2437,13 +2437,13 @@ static gmx_bool legend2lambda(const char   *fn,
     do
     {
         ptr2 = std::strstr(ptr2, tostr);
-        if (ptr2 != NULL)
+        if (ptr2 != nullptr)
         {
             ptr = ptr2;
             ptr2++;
         }
     }
-    while (ptr2 != NULL && *ptr2 != '\0');
+    while (ptr2 != nullptr && *ptr2 != '\0');
 
     if (ptr)
     {
@@ -2465,7 +2465,7 @@ static gmx_bool legend2lambda(const char   *fn,
         ok    = TRUE;
         bdhdl = TRUE;
     }
-    else if (std::strchr(legend, 'D') != NULL && std::strchr(legend, 'H') != NULL)
+    else if (std::strchr(legend, 'D') != nullptr && std::strchr(legend, 'H') != nullptr)
     {
         ok    = TRUE;
         bdhdl = FALSE;
@@ -2486,7 +2486,7 @@ static gmx_bool legend2lambda(const char   *fn,
     if (!bdhdl)
     {
         ptr = find_value(ptr);
-        if (!ptr || !read_lambda_vector(ptr, lam, NULL, fn))
+        if (!ptr || !read_lambda_vector(ptr, lam, nullptr, fn))
         {
             gmx_fatal(FARGS, "lambda vector '%s' %s faulty", legend, fn);
         }
@@ -2610,7 +2610,7 @@ static gmx_bool subtitle2lambda(const char *subtitle, xvg_t *ba, const char *fn,
             return FALSE;
         }
         lambda_vec_init(&(ba->native_lambda), lc);
-        if (!read_lambda_vector(ptr, &(ba->native_lambda), NULL, fn))
+        if (!read_lambda_vector(ptr, &(ba->native_lambda), nullptr, fn))
         {
             gmx_fatal(FARGS, "lambda vector in %s faulty", fn);
         }
@@ -2622,21 +2622,21 @@ static gmx_bool subtitle2lambda(const char *subtitle, xvg_t *ba, const char *fn,
         /* compatibility mode: check for lambda in other ways. */
         /* plain text lambda string */
         ptr = std::strstr(subtitle, "lambda");
-        if (ptr == NULL)
+        if (ptr == nullptr)
         {
             /* xmgrace formatted lambda string */
             ptr = std::strstr(subtitle, "\\xl\\f{}");
         }
-        if (ptr == NULL)
+        if (ptr == nullptr)
         {
             /* xmgr formatted lambda string */
             ptr = std::strstr(subtitle, "\\8l\\4");
         }
-        if (ptr != NULL)
+        if (ptr != nullptr)
         {
             ptr = std::strstr(ptr, "=");
         }
-        if (ptr != NULL)
+        if (ptr != nullptr)
         {
             bFound = (sscanf(ptr+1, "%lf", &(native_lambda)) == 1);
             /* add the lambda component name as an empty string */
@@ -2677,7 +2677,7 @@ static double filename2lambda(const char *fn)
     }
     /* searching backward to find the second directory separator */
     dirsep   = 0;
-    digitptr = NULL;
+    digitptr = nullptr;
     while (ptr >= fn)
     {
         if (ptr[0] != DIR_SEPARATOR && ptr[1] == DIR_SEPARATOR)
@@ -2746,11 +2746,11 @@ static void read_bar_xvg_lowlevel(const char *fn, real *temp, xvg_t *ba,
     }
 
     ba->temp = -1;
-    if (subtitle != NULL)
+    if (subtitle != nullptr)
     {
         /* try to extract temperature */
         ptr = std::strstr(subtitle, "T =");
-        if (ptr != NULL)
+        if (ptr != nullptr)
         {
             ptr += 3;
             if (sscanf(ptr, "%lf", &ba->temp) == 1)
@@ -2781,7 +2781,7 @@ static void read_bar_xvg_lowlevel(const char *fn, real *temp, xvg_t *ba,
         }
     }
     snew(ba->lambda, ba->nset);
-    if (legend == NULL)
+    if (legend == nullptr)
     {
         /* Check if we have a single set, no legend, nset=1 means t and dH/dl */
         if (ba->nset == 1)
@@ -2835,7 +2835,7 @@ static void read_bar_xvg_lowlevel(const char *fn, real *temp, xvg_t *ba,
         gmx_fatal(FARGS, "File %s contains multiple sets but no indication of the native lambda", fn);
     }
 
-    if (legend != NULL)
+    if (legend != nullptr)
     {
         for (i = 0; i < ba->nset-1; i++)
         {
@@ -3027,7 +3027,7 @@ static samples_t *read_edr_hist_block(int *nsamples, t_enxblock *blk,
     nhist = blk->nsub-2;
     if (nhist == 0)
     {
-        return NULL;
+        return nullptr;
     }
     if (nhist > 2)
     {
@@ -3151,13 +3151,13 @@ static void read_barsim_edr(char *fn, real *temp, sim_data_t *sd)
     ener_file_t    fp;
     t_enxframe    *fr;
     int            nre;
-    gmx_enxnm_t   *enm           = NULL;
+    gmx_enxnm_t   *enm           = nullptr;
     double         first_t       = -1;
     double         last_t        = -1;
-    samples_t    **samples_rawdh = NULL; /* contains samples for raw delta_h  */
-    int           *nhists        = NULL; /* array to keep count & print at end */
-    int           *npts          = NULL; /* array to keep count & print at end */
-    lambda_vec_t **lambdas       = NULL; /* array to keep count & print at end */
+    samples_t    **samples_rawdh = nullptr; /* contains samples for raw delta_h  */
+    int           *nhists        = nullptr; /* array to keep count & print at end */
+    int           *npts          = nullptr; /* array to keep count & print at end */
+    lambda_vec_t **lambdas       = nullptr; /* array to keep count & print at end */
     lambda_vec_t  *native_lambda;
     int            nsamples = 0;
     lambda_vec_t   start_lambda;
@@ -3167,7 +3167,7 @@ static void read_barsim_edr(char *fn, real *temp, sim_data_t *sd)
     snew(fr, 1);
 
     snew(native_lambda, 1);
-    start_lambda.lc = NULL;
+    start_lambda.lc = nullptr;
 
     while (do_enx(fp, fr))
     {
@@ -3306,9 +3306,9 @@ static void read_barsim_edr(char *fn, real *temp, sim_data_t *sd)
             {
                 nhists[i]        = 0;
                 npts[i]          = 0;
-                lambdas[i]       = NULL;
-                samples_rawdh[i] = NULL; /* init to NULL so we know which
-                                            ones contain values */
+                lambdas[i]       = nullptr;
+                samples_rawdh[i] = nullptr; /* init to NULL so we know which
+                                               ones contain values */
             }
         }
         else
@@ -3338,7 +3338,7 @@ static void read_barsim_edr(char *fn, real *temp, sim_data_t *sd)
                     // nsamples is always >0 here, so samples_rawdh must be a valid pointer. Unfortunately
                     // cppcheck does not understand the logic unless the assert is inside the loop, but
                     // this is not performance-sensitive code.
-                    GMX_RELEASE_ASSERT(samples_rawdh != NULL, "samples_rawdh==NULL with nsamples>0");
+                    GMX_RELEASE_ASSERT(samples_rawdh != nullptr, "samples_rawdh==NULL with nsamples>0");
                     if (samples_rawdh[i])
                     {
                         /* insert it into the existing list */
@@ -3346,7 +3346,7 @@ static void read_barsim_edr(char *fn, real *temp, sim_data_t *sd)
                                                        samples_rawdh[i]);
                         /* and make sure we'll allocate a new one this time
                            around */
-                        samples_rawdh[i] = NULL;
+                        samples_rawdh[i] = nullptr;
                     }
                 }
             }
@@ -3603,7 +3603,7 @@ int gmx_bar(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv,
                            PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -3696,7 +3696,7 @@ int gmx_bar(int argc, char *argv[])
 
 
 
-    fpb = NULL;
+    fpb = nullptr;
     if (opt2bSet("-o", NFILE, fnm))
     {
         sprintf(buf, "%s (%s)", "\\DeltaG", "kT");
@@ -3704,7 +3704,7 @@ int gmx_bar(int argc, char *argv[])
                             "\\lambda", buf, exvggtXYDY, oenv);
     }
 
-    fpi = NULL;
+    fpi = nullptr;
     if (opt2bSet("-oi", NFILE, fnm))
     {
         sprintf(buf, "%s (%s)", "\\DeltaG", "kT");
@@ -3846,14 +3846,14 @@ int gmx_bar(int argc, char *argv[])
     for (f = 0; f < nresults; f++)
     {
 
-        if (fpi != NULL)
+        if (fpi != nullptr)
         {
             lambda_vec_print_short(results[f].a->native_lambda, buf);
             fprintf(fpi, xvg2format, buf, dg_tot);
         }
 
 
-        if (fpb != NULL)
+        if (fpb != nullptr)
         {
             lambda_vec_print_intermediate(results[f].a->native_lambda,
                                           results[f].b->native_lambda,
@@ -3922,13 +3922,13 @@ int gmx_bar(int argc, char *argv[])
     printf("\n");
 
 
-    if (fpi != NULL)
+    if (fpi != nullptr)
     {
         lambda_vec_print_short(results[nresults-1].b->native_lambda, buf);
         fprintf(fpi, xvg2format, buf, dg_tot);
         xvgrclose(fpi);
     }
-    if (fpb != NULL)
+    if (fpb != nullptr)
     {
         xvgrclose(fpb);
     }
index 17c8167279ecf26f49f53b2a779b1a5db06ee6d5..286e67a57d007ea3e2ed53d57a08b29a4af43ca3 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,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.
@@ -157,10 +157,10 @@ static void dump_axes(t_trxstatus *status, t_trxframe *fr, t_atoms *outat,
                       t_bundle *bun)
 {
     t_trxframe   frout;
-    static rvec *xout = NULL;
+    static rvec *xout = nullptr;
     int          i;
 
-    if (xout == NULL)
+    if (xout == nullptr)
     {
         snew(xout, outat->nr);
     }
@@ -186,7 +186,7 @@ static void dump_axes(t_trxstatus *status, t_trxframe *fr, t_atoms *outat,
     frout.natoms = outat->nr;
     frout.atoms  = outat;
     frout.x      = xout;
-    write_trxframe(status, &frout, NULL);
+    write_trxframe(status, &frout, nullptr);
 }
 
 int gmx_bundle(int argc, char *argv[])
@@ -223,7 +223,7 @@ int gmx_bundle(int argc, char *argv[])
           "Use the [IT]z[it]-axis as reference instead of the average axis" }
     };
     FILE             *flen, *fdist, *fz, *ftilt, *ftiltr, *ftiltl;
-    FILE             *fkink = NULL, *fkinkr = NULL, *fkinkl = NULL;
+    FILE             *fkink = nullptr, *fkinkr = nullptr, *fkinkl = nullptr;
     t_trxstatus      *status;
     t_trxstatus      *fpdb;
     t_topology        top;
@@ -242,13 +242,13 @@ int gmx_bundle(int argc, char *argv[])
     gmx_bool          bKink;
     rvec              va, vb, vc, vr, vl;
     gmx_output_env_t *oenv;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
 
 #define NLEG asize(leg)
     t_filenm fnm[] = {
-        { efTRX, "-f", NULL, ffREAD },
-        { efTPS, NULL, NULL, ffREAD },
-        { efNDX, NULL, NULL, ffOPTRD },
+        { efTRX, "-f", nullptr, ffREAD },
+        { efTPS, nullptr, nullptr, ffREAD },
+        { efNDX, nullptr, nullptr, ffOPTRD },
         { efXVG, "-ol", "bun_len", ffWRITE },
         { efXVG, "-od", "bun_dist", ffWRITE },
         { efXVG, "-oz", "bun_z", ffWRITE },
@@ -263,12 +263,12 @@ int gmx_bundle(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_TIME_UNIT,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, NULL, box, TRUE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, nullptr, box, TRUE);
 
     bKink = opt2bSet("-ok", NFILE, fnm) || opt2bSet("-okr", NFILE, fnm)
         || opt2bSet("-okl", NFILE, fnm);
@@ -349,7 +349,7 @@ int gmx_bundle(int argc, char *argv[])
     }
     else
     {
-        fpdb = NULL;
+        fpdb = nullptr;
     }
 
     read_first_frame(oenv, &status, ftp2fn(efTRX, NFILE, fnm), &fr, TRX_NEED_X);
index 131e4142891eccd0d22c924e3306ea0a799cc698..35dc63c92dbd4618befe9446ad38814a719ec10a 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,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.
@@ -138,7 +138,7 @@ static gmx_bool bAllowed(real phi, real psi)
     return (map[x][y] == '1') ? TRUE : FALSE;
 }
 
-int *make_chi_ind(int nl, t_dlist dl[], int *ndih)
+static int *make_chi_ind(int nl, t_dlist dl[], int *ndih)
 {
     int     *id;
     int      i, Xi, n;
@@ -211,14 +211,6 @@ int *make_chi_ind(int nl, t_dlist dl[], int *ndih)
     return id;
 }
 
-int bin(real chi, int mult)
-{
-    mult = 3;
-
-    return static_cast<int>(chi*mult/360.0);
-}
-
-
 static void do_dihcorr(const char *fn, int nf, int ndih, real **dih, real dt,
                        int nlist, t_dlist dlist[], real time[], int maxchi,
                        gmx_bool bPhi, gmx_bool bPsi, gmx_bool bChi, gmx_bool bOmega,
@@ -479,16 +471,16 @@ static void histogramming(FILE *log, int nbin, gmx_residuetype_t *rt,
 #define NKKKCHI asize(kkkchi1)
 #define NJC (NKKKPHI+NKKKPSI+NKKKCHI)
 
-    FILE       *fp, *ssfp[3] = {NULL, NULL, NULL};
+    FILE       *fp, *ssfp[3] = {nullptr, nullptr, nullptr};
     const char *sss[3] = { "sheet", "helix", "coil" };
     real        S2;
     real       *normhisto;
     real      **Jc, **Jcsig;
-    int     ****his_aa_ss = NULL;
+    int     ****his_aa_ss = nullptr;
     int      ***his_aa, *histmp;
     int         i, j, k, m, n, nn, Dih, nres, hindex, angle;
     gmx_bool    bBfac, bOccup;
-    char        hisfile[256], hhisfile[256], sshisfile[256], title[256], *ss_str = NULL;
+    char        hisfile[256], hhisfile[256], sshisfile[256], title[256], *ss_str = nullptr;
     char      **leg;
     const char *residue_name;
     int         rt_size;
@@ -630,7 +622,7 @@ static void histogramming(FILE *log, int nbin, gmx_residuetype_t *rt,
                         }
                         break;
                     default: /* covers edOmega and higher Chis than Chi1 */
-                        calc_distribution_props(nbin, histmp, -M_PI, 0, NULL, &S2);
+                        calc_distribution_props(nbin, histmp, -M_PI, 0, nullptr, &S2);
                         break;
                 }
                 dlist[i].S2[Dih]        = S2;
@@ -892,12 +884,12 @@ static FILE *rama_file(const char *fn, const char *title, const char *xaxis,
 static void do_rama(int nf, int nlist, t_dlist dlist[], real **dih,
                     gmx_bool bViol, gmx_bool bRamOmega, const gmx_output_env_t *oenv)
 {
-    FILE    *fp, *gp = NULL;
+    FILE    *fp, *gp = nullptr;
     gmx_bool bOm;
     char     fn[256];
     int      i, j, k, Xi1, Xi2, Phi, Psi, Om = 0, nlevels;
 #define NMAT 120
-    real   **mat  = NULL, phi, psi, omega, axis[NMAT], lo, hi;
+    real   **mat  = nullptr, phi, psi, omega, axis[NMAT], lo, hi;
     t_rgb    rlo  = { 1.0, 0.0, 0.0 };
     t_rgb    rmid = { 1.0, 1.0, 1.0 };
     t_rgb    rhi  = { 0.0, 0.0, 1.0 };
@@ -1140,11 +1132,13 @@ static void order_params(FILE *log,
     }
     xvgrclose(fp);
 
-    if (NULL != pdbfn)
+    if (nullptr != pdbfn)
     {
         real x0, y0, z0;
 
-        if (NULL == atoms->pdbinfo)
+        atoms->havePdbInfo = TRUE;
+
+        if (nullptr == atoms->pdbinfo)
         {
             snew(atoms->pdbinfo, atoms->nr);
         }
@@ -1172,7 +1166,7 @@ static void order_params(FILE *log,
         fprintf(fp, "REMARK generated by g_chi\n");
         fprintf(fp, "REMARK "
                 "B-factor field contains negative of dihedral order parameters\n");
-        write_pdbfile(fp, NULL, atoms, x, ePBC, box, ' ', 0, NULL, TRUE);
+        write_pdbfile(fp, nullptr, atoms, x, ePBC, box, ' ', 0, nullptr, TRUE);
         x0 = y0 = z0 = 1000.0;
         for (i = 0; (i < atoms->nr); i++)
         {
@@ -1310,7 +1304,7 @@ int gmx_chi(int argc, char *argv[])
     static gmx_bool    bAll        = FALSE;
     static gmx_bool    bPhi        = FALSE, bPsi = FALSE, bOmega = FALSE;
     static real        bfac_init   = -1.0, bfac_max = 0;
-    static const char *maxchistr[] = { NULL, "0", "1", "2", "3",  "4", "5", "6", NULL };
+    static const char *maxchistr[] = { nullptr, "0", "1", "2", "3",  "4", "5", "6", nullptr };
     static gmx_bool    bRama       = FALSE, bShift = FALSE, bViol = FALSE, bRamOmega = FALSE;
     static gmx_bool    bNormHisto  = TRUE, bChiProduct = FALSE, bHChi = FALSE, bRAD = FALSE, bPBC = TRUE;
     static real        core_frac   = 0.5;
@@ -1374,8 +1368,8 @@ int gmx_chi(int argc, char *argv[])
     int                i, **chi_lookup, *multiplicity;
 
     t_filenm           fnm[] = {
-        { efSTX, "-s",  NULL,     ffREAD  },
-        { efTRX, "-f",  NULL,     ffREAD  },
+        { efSTX, "-s",  nullptr,     ffREAD  },
+        { efTRX, "-f",  nullptr,     ffREAD  },
         { efXVG, "-o",  "order",  ffWRITE },
         { efPDB, "-p",  "order",  ffOPTWR },
         { efDAT, "-ss", "ssdump", ffOPTRD },
@@ -1398,6 +1392,7 @@ int gmx_chi(int argc, char *argv[])
                            NFILE, fnm, npargs, ppa, asize(desc), desc, asize(bugs), bugs,
                            &oenv))
     {
+        sfree(ppa);
         return 0;
     }
 
@@ -1449,9 +1444,9 @@ int gmx_chi(int argc, char *argv[])
     /* Find the chi angles using atoms struct and a list of amino acids */
     t_topology *top;
     snew(top, 1);
-    read_tps_conf(ftp2fn(efSTX, NFILE, fnm), top, &ePBC, &x, NULL, box, FALSE);
+    read_tps_conf(ftp2fn(efSTX, NFILE, fnm), top, &ePBC, &x, nullptr, box, FALSE);
     t_atoms    &atoms = top->atoms;
-    if (atoms.pdbinfo == NULL)
+    if (atoms.pdbinfo == nullptr)
     {
         snew(atoms.pdbinfo, atoms.nr);
     }
index 4df864b0a880eb88eb93188469fe7f966370209b..96cdf384ca7217507cfbb7dea6c4d8b1a756e145 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,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.
@@ -65,6 +65,7 @@
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/stringutil.h"
 
 /* print to two file pointers at once (i.e. stderr and log) */
 static gmx_inline
@@ -139,22 +140,12 @@ typedef struct {
     int *nb;
 } t_nnb;
 
-void cp_index(int nn, int from[], int to[])
+static void mc_optimize(FILE *log, t_mat *m, real *time,
+                        int maxiter, int nrandom,
+                        int seed, real kT,
+                        const char *conv, gmx_output_env_t *oenv)
 {
-    int i;
-
-    for (i = 0; (i < nn); i++)
-    {
-        to[i] = from[i];
-    }
-}
-
-void mc_optimize(FILE *log, t_mat *m, real *time,
-                 int maxiter, int nrandom,
-                 int seed, real kT,
-                 const char *conv, gmx_output_env_t *oenv)
-{
-    FILE      *fp = NULL;
+    FILE      *fp = nullptr;
     real       ecur, enext, emin, prob, enorm;
     int        i, j, iswap, jswap, nn, nuphill = 0;
     t_mat     *minimum;
@@ -207,7 +198,7 @@ void mc_optimize(FILE *log, t_mat *m, real *time,
     minimum->nn = nn;
     copy_t_mat(minimum, m);
 
-    if (NULL != conv)
+    if (nullptr != conv)
     {
         fp = xvgropen(conv, "Convergence of the MC optimization",
                       "Energy", "Step", oenv);
@@ -257,7 +248,7 @@ void mc_optimize(FILE *log, t_mat *m, real *time,
 
             fprintf(log, "Iter: %d Swapped %4d and %4d (energy: %g prob: %g)\n",
                     i, iswap, jswap, enext, prob);
-            if (NULL != fp)
+            if (nullptr != fp)
             {
                 fprintf(fp, "%6d  %10g\n", i, enext);
             }
@@ -285,7 +276,7 @@ void mc_optimize(FILE *log, t_mat *m, real *time,
                 (i < m->nn-1) ? m->mat[m->m_ind[i]][m->m_ind[i+1]] : 0);
     }
 
-    if (NULL != fp)
+    if (nullptr != fp)
     {
         xvgrclose(fp);
     }
@@ -330,46 +321,23 @@ static real rms_dist(int isize, real **d, real **d_r)
     return std::sqrt(r2);
 }
 
-static int rms_dist_comp(const void *a, const void *b)
+static bool rms_dist_comp(const t_dist &a, const t_dist &b)
 {
-    t_dist *da, *db;
-
-    da = (t_dist *)a;
-    db = (t_dist *)b;
-
-    if (da->dist - db->dist < 0)
-    {
-        return -1;
-    }
-    else if (da->dist - db->dist > 0)
-    {
-        return 1;
-    }
-    return 0;
+    return a.dist < b.dist;
 }
 
-static int clust_id_comp(const void *a, const void *b)
+static bool clust_id_comp(const t_clustid &a, const t_clustid &b)
 {
-    t_clustid *da, *db;
-
-    da = (t_clustid *)a;
-    db = (t_clustid *)b;
-
-    return da->clust - db->clust;
+    return a.clust < b.clust;
 }
 
-static int nrnb_comp(const void *a, const void *b)
+static bool nrnb_comp(const t_nnb &a, const t_nnb &b)
 {
-    t_nnb *da, *db;
-
-    da = (t_nnb *)a;
-    db = (t_nnb *)b;
-
-    /* return the b-a, we want highest first */
-    return db->nr - da->nr;
+    /* return b<a, we want highest first */
+    return b.nr < a.nr;
 }
 
-void gather(t_mat *m, real cutoff, t_clusters *clust)
+static void gather(t_mat *m, real cutoff, t_clusters *clust)
 {
     t_clustid *c;
     t_dist    *d;
@@ -393,7 +361,7 @@ void gather(t_mat *m, real cutoff, t_clusters *clust)
     {
         gmx_incons("gather algortihm");
     }
-    qsort(d, nn, sizeof(d[0]), rms_dist_comp);
+    std::sort(d, d+nn, rms_dist_comp);
 
     /* Now we make a cluster index for all of the conformations */
     c = new_clustid(n1);
@@ -424,7 +392,7 @@ void gather(t_mat *m, real cutoff, t_clusters *clust)
     while (bChange);
     fprintf(stderr, "\nSorting and renumbering clusters\n");
     /* Sort on cluster number */
-    qsort(c, n1, sizeof(c[0]), clust_id_comp);
+    std::sort(c, c+n1, clust_id_comp);
 
     /* Renumber clusters */
     cid = 1;
@@ -459,7 +427,7 @@ void gather(t_mat *m, real cutoff, t_clusters *clust)
     sfree(d);
 }
 
-gmx_bool jp_same(int **nnb, int i, int j, int P)
+static gmx_bool jp_same(int **nnb, int i, int j, int P)
 {
     gmx_bool bIn;
     int      k, ii, jj, pp;
@@ -507,7 +475,7 @@ static void jarvis_patrick(int n1, real **mat, int M, int P,
     int       **nnb;
     int         i, j, k, cid, diff, maxval;
     gmx_bool    bChange;
-    real      **mcpy = NULL;
+    real      **mcpy = nullptr;
 
     if (rmsdcut < 0)
     {
@@ -526,7 +494,7 @@ static void jarvis_patrick(int n1, real **mat, int M, int P,
             row[j].j    = j;
             row[j].dist = mat[i][j];
         }
-        qsort(row, n1, sizeof(row[0]), rms_dist_comp);
+        std::sort(row, row+n1, rms_dist_comp);
         if (M > 0)
         {
             /* Put the M nearest neighbors in the list */
@@ -623,7 +591,7 @@ static void jarvis_patrick(int n1, real **mat, int M, int P,
 
     fprintf(stderr, "\nSorting and renumbering clusters\n");
     /* Sort on cluster number */
-    qsort(c, n1, sizeof(c[0]), clust_id_comp);
+    std::sort(c, c+n1, clust_id_comp);
 
     /* Renumber clusters */
     cid = 1;
@@ -720,7 +688,7 @@ static void gromos(int n1, real **mat, real rmsdcut, t_clusters *clust)
     sfree(row);
 
     /* sort neighbor list on number of neighbors, largest first */
-    qsort(nnb, n1, sizeof(nnb[0]), nrnb_comp);
+    std::sort(nnb, nnb+n1, nrnb_comp);
 
     if (debug)
     {
@@ -763,7 +731,7 @@ static void gromos(int n1, real **mat, real rmsdcut, t_clusters *clust)
         }
         /* sort again on nnb[].nr, because we have new # neighbors: */
         /* but we only need to sort upto i, i.e. when nnb[].nr>0 */
-        qsort(nnb, i, sizeof(nnb[0]), nrnb_comp);
+        std::sort(nnb, nnb+i, nrnb_comp);
 
         fprintf(stderr, "\b\b\b\b%4d", k);
         /* new cluster id */
@@ -784,8 +752,8 @@ static void gromos(int n1, real **mat, real rmsdcut, t_clusters *clust)
     clust->ncl = k-1;
 }
 
-rvec **read_whole_trj(const char *fn, int isize, int index[], int skip,
-                      int *nframe, real **time, const gmx_output_env_t *oenv, gmx_bool bPBC, gmx_rmpbc_t gpbc)
+static rvec **read_whole_trj(const char *fn, int isize, int index[], int skip,
+                             int *nframe, real **time, const gmx_output_env_t *oenv, gmx_bool bPBC, gmx_rmpbc_t gpbc)
 {
     rvec       **xx, *x;
     matrix       box;
@@ -796,8 +764,8 @@ rvec **read_whole_trj(const char *fn, int isize, int index[], int skip,
 
 
     max_nf = 0;
-    xx     = NULL;
-    *time  = NULL;
+    xx     = nullptr;
+    *time  = nullptr;
     natom  = read_first_x(oenv, &status, fn, &t, &x, box);
     i      = 0;
     i0     = 0;
@@ -1016,20 +984,20 @@ static void analyze_clusters(int nf, t_clusters *clust, real **rmsd,
                              gmx_bool bFit, FILE *log, t_rgb rlo, t_rgb rhi,
                              const gmx_output_env_t *oenv)
 {
-    FILE        *size_fp = NULL;
+    FILE        *size_fp = nullptr;
     char         buf[STRLEN], buf1[40], buf2[40], buf3[40], *trxsfn;
-    t_trxstatus *trxout  = NULL;
-    t_trxstatus *trxsout = NULL;
+    t_trxstatus *trxout  = nullptr;
+    t_trxstatus *trxsout = nullptr;
     int          i, i1, cl, nstr, *structure, first = 0, midstr;
-    gmx_bool    *bWrite = NULL;
+    gmx_bool    *bWrite = nullptr;
     real         r, clrmsd, midrmsd;
-    rvec        *xav = NULL;
+    rvec        *xav = nullptr;
     matrix       zerobox;
 
     clear_mat(zerobox);
 
     ffprintf_d(stderr, log, buf, "\nFound %d clusters\n\n", clust->ncl);
-    trxsfn = NULL;
+    trxsfn = nullptr;
     if (trxfn)
     {
         /* do we write all structures? */
@@ -1076,7 +1044,7 @@ static void analyze_clusters(int nf, t_clusters *clust, real **rmsd,
         /* Prepare a reference structure for the orientation of the clusters  */
         if (bFit)
         {
-            reset_x(ifsize, fitidx, natom, NULL, xtps, mass);
+            reset_x(ifsize, fitidx, natom, nullptr, xtps, mass);
         }
         trxout = open_trx(trxfn, "w");
         /* Calculate the average structure in each cluster,               *
@@ -1136,7 +1104,7 @@ static void analyze_clusters(int nf, t_clusters *clust, real **rmsd,
                 {
                     if (bFit)
                     {
-                        reset_x(ifsize, fitidx, natom, NULL, xx[i1], mass);
+                        reset_x(ifsize, fitidx, natom, nullptr, xx[i1], mass);
                     }
                     if (nstr == 1)
                     {
@@ -1257,7 +1225,7 @@ static void analyze_clusters(int nf, t_clusters *clust, real **rmsd,
                     if (bWrite[i])
                     {
                         write_trx(trxsout, iosize, outidx, atoms, i, time[structure[i]], zerobox,
-                                  xx[structure[i]], NULL, NULL);
+                                  xx[structure[i]], nullptr, nullptr);
                     }
                 }
                 close_trx(trxsout);
@@ -1278,14 +1246,14 @@ static void analyze_clusters(int nf, t_clusters *clust, real **rmsd,
                 }
                 if (bFit)
                 {
-                    reset_x(ifsize, fitidx, natom, NULL, xav, mass);
+                    reset_x(ifsize, fitidx, natom, nullptr, xav, mass);
                 }
             }
             if (bFit)
             {
                 do_fit(natom, mass, xtps, xav);
             }
-            write_trx(trxout, iosize, outidx, atoms, cl, time[midstr], zerobox, xav, NULL, NULL);
+            write_trx(trxout, iosize, outidx, atoms, cl, time[midstr], zerobox, xav, nullptr, nullptr);
         }
     }
     /* clean up */
@@ -1416,32 +1384,32 @@ int gmx_cluster(int argc, char *argv[])
     };
 
     FILE              *fp, *log;
-    int                nf, i, i1, i2, j;
+    int                nf   = 0, i, i1, i2, j;
     gmx_int64_t        nrms = 0;
 
     matrix             box;
-    rvec              *xtps, *usextps, *x1, **xx = NULL;
+    rvec              *xtps, *usextps, *x1, **xx = nullptr;
     const char        *fn, *trx_out_fn;
     t_clusters         clust;
-    t_mat             *rms, *orig = NULL;
+    t_mat             *rms, *orig = nullptr;
     real              *eigenvalues;
     t_topology         top;
     int                ePBC;
     t_atoms            useatoms;
-    t_matrix          *readmat = NULL;
+    t_matrix          *readmat = nullptr;
     real              *eigenvectors;
 
     int                isize = 0, ifsize = 0, iosize = 0;
-    int               *index = NULL, *fitidx = NULL, *outidx = NULL;
+    int               *index = nullptr, *fitidx = nullptr, *outidx = nullptr;
     char              *grpname;
-    real               rmsd, **d1, **d2, *time = NULL, time_invfac, *mass = NULL;
-    char               buf[STRLEN], buf1[80], title[STRLEN];
+    real               rmsd, **d1, **d2, *time = nullptr, time_invfac, *mass = nullptr;
+    char               buf[STRLEN], buf1[80];
     gmx_bool           bAnalyze, bUseRmsdCut, bJP_RMSD = FALSE, bReadMat, bReadTraj, bPBC = TRUE;
 
     int                method, ncluster = 0;
     static const char *methodname[] = {
-        NULL, "linkage", "jarvis-patrick", "monte-carlo",
-        "diagonalization", "gromos", NULL
+        nullptr, "linkage", "jarvis-patrick", "monte-carlo",
+        "diagonalization", "gromos", nullptr
     };
     enum {
         m_null, m_linkage, m_jarvis_patrick,
@@ -1459,7 +1427,7 @@ int gmx_cluster(int argc, char *argv[])
     static real       kT       = 1e-3;
     static int        M        = 10, P = 3;
     gmx_output_env_t *oenv;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
 
     t_pargs           pa[] = {
         { "-dista", FALSE, etBOOL, {&bRMSdist},
@@ -1475,7 +1443,7 @@ int gmx_cluster(int argc, char *argv[])
         { "-skip",  FALSE, etINT,  {&skip},
           "Only analyze every nr-th frame" },
         { "-av",    FALSE, etBOOL, {&bAverage},
-          "Write average iso middle structure for each cluster" },
+          "Write average instead of middle structure for each cluster" },
         { "-wcl",   FALSE, etINT,  {&write_ncl},
           "Write the structures for this number of clusters to numbered files" },
         { "-nst",   FALSE, etINT,  {&write_nst},
@@ -1507,9 +1475,9 @@ int gmx_cluster(int argc, char *argv[])
           { &bPBC }, "PBC check" }
     };
     t_filenm          fnm[] = {
-        { efTRX, "-f",     NULL,        ffOPTRD },
-        { efTPS, "-s",     NULL,        ffOPTRD },
-        { efNDX, NULL,     NULL,        ffOPTRD },
+        { efTRX, "-f",     nullptr,        ffOPTRD },
+        { efTPS, "-s",     nullptr,        ffOPTRD },
+        { efNDX, nullptr,     nullptr,        ffOPTRD },
         { efXPM, "-dm",   "rmsd",       ffOPTRD },
         { efXPM, "-om",   "rmsd-raw",   ffWRITE },
         { efXPM, "-o",    "rmsd-clust", ffWRITE },
@@ -1527,7 +1495,7 @@ int gmx_cluster(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv,
                            PCA_CAN_VIEW | PCA_CAN_TIME | PCA_TIME_UNIT,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL,
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr,
                            &oenv))
     {
         return 0;
@@ -1546,13 +1514,13 @@ int gmx_cluster(int argc, char *argv[])
     }
     else
     {
-        trx_out_fn = NULL;
+        trx_out_fn = nullptr;
     }
     if (bReadMat && output_env_get_time_factor(oenv) != 1)
     {
         fprintf(stderr,
                 "\nWarning: assuming the time unit in %s is %s\n",
-                opt2fn("-dm", NFILE, fnm), output_env_get_time_unit(oenv));
+                opt2fn("-dm", NFILE, fnm), output_env_get_time_unit(oenv).c_str());
     }
     if (trx_out_fn && !bReadTraj)
     {
@@ -1634,7 +1602,7 @@ int gmx_cluster(int argc, char *argv[])
     if (bReadTraj)
     {
         /* don't read mass-database as masses (and top) are not used */
-        read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtps, NULL, box,
+        read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtps, nullptr, box,
                       TRUE);
         if (bPBC)
         {
@@ -1709,7 +1677,7 @@ int gmx_cluster(int argc, char *argv[])
             {
                 for (i = 0; i < nf; i++)
                 {
-                    reset_x(ifsize, fitidx, isize, NULL, xx[i], mass);
+                    reset_x(ifsize, fitidx, isize, nullptr, xx[i], mass);
                 }
             }
         }
@@ -1925,7 +1893,7 @@ int gmx_cluster(int argc, char *argv[])
         useatoms.nr = isize;
         analyze_clusters(nf, &clust, rms->mat, isize, &useatoms, usextps, mass, xx, time,
                          ifsize, fitidx, iosize, outidx,
-                         bReadTraj ? trx_out_fn : NULL,
+                         bReadTraj ? trx_out_fn : nullptr,
                          opt2fn_null("-sz", NFILE, fnm),
                          opt2fn_null("-tr", NFILE, fnm),
                          opt2fn_null("-ntr", NFILE, fnm),
@@ -1960,31 +1928,31 @@ int gmx_cluster(int argc, char *argv[])
     }
     else
     {
-        sprintf(buf, "Time (%s)", output_env_get_time_unit(oenv));
-        sprintf(title, "RMS%sDeviation / Cluster Index",
-                bRMSdist ? " Distance " : " ");
+        auto timeLabel = output_env_get_time_label(oenv);
+        auto title     = gmx::formatString("RMS%sDeviation / Cluster Index",
+                                           bRMSdist ? " Distance " : " ");
         if (minstruct > 1)
         {
-            write_xpm_split(fp, 0, title, "RMSD (nm)", buf, buf,
+            write_xpm_split(fp, 0, title, "RMSD (nm)", timeLabel, timeLabel,
                             nf, nf, time, time, rms->mat, 0.0, rms->maxrms, &nlevels,
                             rlo_top, rhi_top, 0.0, ncluster,
                             &ncluster, TRUE, rlo_bot, rhi_bot);
         }
         else
         {
-            write_xpm(fp, 0, title, "RMSD (nm)", buf, buf,
+            write_xpm(fp, 0, title, "RMSD (nm)", timeLabel, timeLabel,
                       nf, nf, time, time, rms->mat, 0.0, rms->maxrms,
                       rlo_top, rhi_top, &nlevels);
         }
     }
     fprintf(stderr, "\n");
     gmx_ffclose(fp);
-    if (NULL != orig)
+    if (nullptr != orig)
     {
         fp = opt2FILE("-om", NFILE, fnm, "w");
-        sprintf(buf, "Time (%s)", output_env_get_time_unit(oenv));
-        sprintf(title, "RMS%sDeviation", bRMSdist ? " Distance " : " ");
-        write_xpm(fp, 0, title, "RMSD (nm)", buf, buf,
+        auto timeLabel = output_env_get_time_label(oenv);
+        auto title     = gmx::formatString("RMS%sDeviation", bRMSdist ? " Distance " : " ");
+        write_xpm(fp, 0, title, "RMSD (nm)", timeLabel, timeLabel,
                   nf, nf, time, time, orig->mat, 0.0, orig->maxrms,
                   rlo_top, rhi_top, &nlevels);
         gmx_ffclose(fp);
@@ -2005,7 +1973,7 @@ int gmx_cluster(int argc, char *argv[])
         do_view(oenv, opt2fn_null("-ntr", NFILE, fnm), "-nxy");
         do_view(oenv, opt2fn_null("-clid", NFILE, fnm), "-nxy");
     }
-    do_view(oenv, opt2fn_null("-conv", NFILE, fnm), NULL);
+    do_view(oenv, opt2fn_null("-conv", NFILE, fnm), nullptr);
 
     return 0;
 }
index 0bf6fb501eecf4d0387853e1c7f19528c708dbbe..a0d6d507934af14c8ca2949619b3745c9a460b65 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2007, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
@@ -40,6 +40,7 @@
 
 #include <algorithm>
 
+#include "gromacs/commandline/filenm.h"
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/matio.h"
 #include "gromacs/fileio/tpxio.h"
@@ -52,7 +53,7 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/topology/index.h"
-#include "gromacs/topology/mtop_util.h"
+#include "gromacs/topology/mtop_lookup.h"
 #include "gromacs/topology/topology.h"
 #include "gromacs/trajectory/trajectoryframe.h"
 #include "gromacs/utility/arraysize.h"
@@ -71,38 +72,34 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
                        const gmx_output_env_t *oenv)
 {
     FILE                 *fp, *gp, *hp, *tp;
-    int                  *index = NULL;
+    int                  *index = nullptr;
     int                   nindex, natoms;
     t_trxstatus          *status;
-    rvec                 *x = NULL, *v = NULL, dx;
+    rvec                 *x = nullptr, *v = nullptr, dx;
     t_pbc                 pbc;
-    char                 *gname;
-    char                  timebuf[32];
     gmx_bool              bSame, bTPRwarn = TRUE;
     /* Topology stuff */
     t_trxframe            fr;
     t_tpxheader           tpxh;
-    gmx_mtop_t           *mtop = NULL;
+    gmx_mtop_t           *mtop = nullptr;
     int                   ePBC = -1;
-    t_block              *mols = NULL;
-    gmx_mtop_atomlookup_t alook;
-    t_atom               *atom;
+    t_block              *mols = nullptr;
     int                   ii, jj;
     real                  temp, tfac;
     /* Cluster size distribution (matrix) */
-    real                **cs_dist = NULL;
-    real                  tf, dx2, cut2, *t_x = NULL, *t_y, cmid, cmax, cav, ekin;
+    real                **cs_dist = nullptr;
+    real                  tf, dx2, cut2, *t_x = nullptr, *t_y, cmid, cmax, cav, ekin;
     int                   i, j, k, ai, aj, ci, cj, nframe, nclust, n_x, max_size = 0;
     int                  *clust_index, *clust_size, max_clust_size, max_clust_ind, nav, nhisto;
     t_rgb                 rlo = { 1.0, 1.0, 1.0 };
 
     clear_trxframe(&fr, TRUE);
-    sprintf(timebuf, "Time (%s)", output_env_get_time_unit(oenv));
+    auto timeLabel = output_env_get_time_label(oenv);
     tf     = output_env_get_time_factor(oenv);
-    fp     = xvgropen(ncl, "Number of clusters", timebuf, "N", oenv);
-    gp     = xvgropen(acl, "Average cluster size", timebuf, "#molecules", oenv);
-    hp     = xvgropen(mcl, "Max cluster size", timebuf, "#molecules", oenv);
-    tp     = xvgropen(tempf, "Temperature of largest cluster", timebuf, "T (K)",
+    fp     = xvgropen(ncl, "Number of clusters", timeLabel, "N", oenv);
+    gp     = xvgropen(acl, "Average cluster size", timeLabel, "#molecules", oenv);
+    hp     = xvgropen(mcl, "Max cluster size", timeLabel, "#molecules", oenv);
+    tp     = xvgropen(tempf, "Temperature of largest cluster", timeLabel, "T (K)",
                       oenv);
 
     if (!read_first_frame(oenv, &status, trx, &fr, TRX_NEED_X | TRX_READ_V))
@@ -122,7 +119,7 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
             gmx_fatal(FARGS, "tpr (%d atoms) and trajectory (%d atoms) do not match!",
                       tpxh.natoms, natoms);
         }
-        ePBC = read_tpx(tpr, NULL, NULL, &natoms, NULL, NULL, mtop);
+        ePBC = read_tpx(tpr, nullptr, nullptr, &natoms, nullptr, nullptr, mtop);
     }
     if (ndf <= -1)
     {
@@ -140,7 +137,7 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
             printf("Using molecules rather than atoms. Not reading index file %s\n",
                    ndx);
         }
-        GMX_RELEASE_ASSERT(mtop != NULL, "Trying to access mtop->mols from NULL mtop pointer");
+        GMX_RELEASE_ASSERT(mtop != nullptr, "Trying to access mtop->mols from NULL mtop pointer");
         mols = &(mtop->mols);
 
         /* Make dummy index */
@@ -150,15 +147,14 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
         {
             index[i] = i;
         }
-        gname = gmx_strdup("mols");
     }
     else
     {
+        char *gname;
         rd_index(ndx, 1, &nindex, &index, &gname);
+        sfree(gname);
     }
 
-    alook = gmx_mtop_atomlookup_init(mtop);
-
     snew(clust_index, nindex);
     snew(clust_size, nindex);
     cut2   = cut*cut;
@@ -171,6 +167,7 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
     }
     max_clust_size = 1;
     max_clust_ind  = -1;
+    int molb       = 0;
     do
     {
         if ((nskip == 0) || ((nskip > 0) && ((nframe % nskip) == 0)))
@@ -210,7 +207,7 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
                         /* Compute distance */
                         if (bMol)
                         {
-                            GMX_RELEASE_ASSERT(mols != NULL, "Cannot access index[] from NULL mols pointer");
+                            GMX_RELEASE_ASSERT(mols != nullptr, "Cannot access index[] from NULL mols pointer");
                             bSame = FALSE;
                             for (ii = mols->index[ai]; !bSame && (ii < mols->index[ai+1]); ii++)
                             {
@@ -323,9 +320,9 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
                     {
                         if (clust_index[i] == max_clust_ind)
                         {
-                            ai    = index[i];
-                            gmx_mtop_atomnr_to_atom(alook, ai, &atom);
-                            ekin += 0.5*atom->m*iprod(v[ai], v[ai]);
+                            ai      = index[i];
+                            real            m  = mtopGetAtomMass(mtop, ai, &molb);
+                            ekin   += 0.5*m*iprod(v[ai], v[ai]);
                         }
                     }
                     temp = (ekin*2.0)/(3.0*tfac*max_clust_size*BOLTZ);
@@ -337,13 +334,12 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
     }
     while (read_next_frame(oenv, status, &fr));
     close_trx(status);
+    done_frame(&fr);
     xvgrclose(fp);
     xvgrclose(gp);
     xvgrclose(hp);
     xvgrclose(tp);
 
-    gmx_mtop_atomlookup_destroy(alook);
-
     if (max_clust_ind >= 0)
     {
         fp = gmx_ffopen(mcn, "w");
@@ -354,7 +350,7 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
             {
                 if (bMol)
                 {
-                    GMX_RELEASE_ASSERT(mols != NULL, "Cannot access index[] from NULL mols pointer");
+                    GMX_RELEASE_ASSERT(mols != nullptr, "Cannot access index[] from NULL mols pointer");
                     for (j = mols->index[i]; (j < mols->index[i+1]); j++)
                     {
                         fprintf(fp, "%d\n", j+1);
@@ -407,7 +403,7 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
     fprintf(stderr, "cmid: %g, cmax: %g, max_size: %d\n", cmid, cmax, max_size);
     cmid = 1;
     fp   = gmx_ffopen(xpm, "w");
-    write_xpm3(fp, 0, "Cluster size distribution", "# clusters", timebuf, "Size",
+    write_xpm3(fp, 0, "Cluster size distribution", "# clusters", timeLabel, "Size",
                n_x, max_size, t_x, t_y, cs_dist, 0, cmid, cmax,
                rlo, rmid, rhi, &nlevels);
     gmx_ffclose(fp);
@@ -427,11 +423,22 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
     }
     fprintf(stderr, "cmid: %g, cmax: %g, max_size: %d\n", cmid, cmax, max_size);
     fp = gmx_ffopen(xpmw, "w");
-    write_xpm3(fp, 0, "Weighted cluster size distribution", "Fraction", timebuf,
+    write_xpm3(fp, 0, "Weighted cluster size distribution", "Fraction", timeLabel,
                "Size", n_x, max_size, t_x, t_y, cs_dist, 0, cmid, cmax,
                rlo, rmid, rhi, &nlevels);
     gmx_ffclose(fp);
-
+    if (mtop)
+    {
+        done_mtop(mtop);
+        sfree(mtop);
+    }
+    sfree(t_x);
+    sfree(t_y);
+    for (i = 0; (i < n_x); i++)
+    {
+        sfree(cs_dist[i]);
+    }
+    sfree(cs_dist);
     sfree(clust_index);
     sfree(clust_size);
     sfree(index);
@@ -458,14 +465,14 @@ int gmx_clustsize(int argc, char *argv[])
         "atom numbers of the largest cluster."
     };
 
-    static real       cutoff   = 0.35;
-    static int        nskip    = 0;
-    static int        nlevels  = 20;
-    static int        ndf      = -1;
-    static gmx_bool   bMol     = FALSE;
-    static gmx_bool   bPBC     = TRUE;
-    static rvec       rlo      = { 1.0, 1.0, 0.0 };
-    static rvec       rhi      = { 0.0, 0.0, 1.0 };
+    real              cutoff   = 0.35;
+    int               nskip    = 0;
+    int               nlevels  = 20;
+    int               ndf      = -1;
+    gmx_bool          bMol     = FALSE;
+    gmx_bool          bPBC     = TRUE;
+    rvec              rlo      = { 1.0, 1.0, 0.0 };
+    rvec              rhi      = { 0.0, 0.0, 1.0 };
 
     gmx_output_env_t *oenv;
 
@@ -492,9 +499,9 @@ int gmx_clustsize(int argc, char *argv[])
     t_rgb             rgblo, rgbhi;
 
     t_filenm          fnm[] = {
-        { efTRX, "-f",  NULL,         ffREAD  },
-        { efTPR, NULL,  NULL,         ffOPTRD },
-        { efNDX, NULL,  NULL,         ffOPTRD },
+        { efTRX, "-f",  nullptr,         ffREAD  },
+        { efTPR, nullptr,  nullptr,         ffOPTRD },
+        { efNDX, nullptr,  nullptr,         ffOPTRD },
         { efXPM, "-o", "csize",       ffWRITE },
         { efXPM, "-ow", "csizew",      ffWRITE },
         { efXVG, "-nc", "nclust",      ffWRITE },
@@ -508,7 +515,7 @@ int gmx_clustsize(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv,
                            PCA_CAN_VIEW | PCA_CAN_TIME | PCA_TIME_UNIT,
-                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -531,5 +538,8 @@ int gmx_clustsize(int argc, char *argv[])
                bMol, bPBC, fnTPR,
                cutoff, nskip, nlevels, rgblo, rgbhi, ndf, oenv);
 
+    done_filenms(NFILE, fnm);
+    output_env_done(oenv);
+
     return 0;
 }
index 7285a059bdcd212450c9b640b180997a46dd2acc..8d80f8c15f611b7f21a62b289264763c1b97ddff 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,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.
@@ -63,7 +63,7 @@
 
 static const int NOTSET = -9368163;
 
-void calc_rm_cm(int isize, int index[], const t_atoms *atoms, rvec x[], rvec xcm)
+static void calc_rm_cm(int isize, int index[], const t_atoms *atoms, rvec x[], rvec xcm)
 {
     int  i, d;
     real tm, m;
@@ -87,7 +87,7 @@ void calc_rm_cm(int isize, int index[], const t_atoms *atoms, rvec x[], rvec xcm
     }
 }
 
-int build_res_index(int isize, int index[], t_atom atom[], int rindex[])
+static int build_res_index(int isize, int index[], t_atom atom[], int rindex[])
 {
     int i, r;
 
@@ -106,7 +106,7 @@ int build_res_index(int isize, int index[], t_atom atom[], int rindex[])
     return r;
 }
 
-int find_res_end(int i, int isize, int index[], const t_atoms *atoms)
+static int find_res_end(int i, int isize, int index[], const t_atoms *atoms)
 {
     int rnr;
 
@@ -118,7 +118,7 @@ int find_res_end(int i, int isize, int index[], const t_atoms *atoms)
     return i;
 }
 
-int debug_strcmp(char s1[], char s2[])
+static int debug_strcmp(char s1[], char s2[])
 {
     if (debug)
     {
@@ -127,10 +127,10 @@ int debug_strcmp(char s1[], char s2[])
     return std::strcmp(s1, s2);
 }
 
-int find_next_match_atoms_in_res(int *i1, int index1[],
-                                 int m1, char **atnms1[],
-                                 int *i2, int index2[],
-                                 int m2, char **atnms2[])
+static int find_next_match_atoms_in_res(int *i1, int index1[],
+                                        int m1, char **atnms1[],
+                                        int *i2, int index2[],
+                                        int m2, char **atnms2[])
 {
     int      dx, dy, dmax, cmp;
     gmx_bool bFW = FALSE;
@@ -309,7 +309,7 @@ static int find_next_match_res(int *rnr1, int isize1,
     return cmp;
 }
 
-int find_first_atom_in_res(int rnr, int isize, int index[], t_atom atom[])
+static int find_first_atom_in_res(int rnr, int isize, int index[], t_atom atom[])
 {
     int i;
 
@@ -329,8 +329,8 @@ int find_first_atom_in_res(int rnr, int isize, int index[], t_atom atom[])
     }
 }
 
-void find_matching_names(int *isize1, int index1[], const t_atoms *atoms1,
-                         int *isize2, int index2[], const t_atoms *atoms2)
+static void find_matching_names(int *isize1, int index1[], const t_atoms *atoms1,
+                                int *isize2, int index2[], const t_atoms *atoms2)
 {
     int        i1, i2, ii1, ii2, m1, m2;
     int        atcmp, rescmp;
@@ -554,7 +554,7 @@ int gmx_confrms(int argc, char *argv[])
 
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -673,13 +673,13 @@ int gmx_confrms(int argc, char *argv[])
 
         sfree(fit_x);
         sfree(w_rls);
-        w_rls = NULL;
+        w_rls = nullptr;
     }
     else
     {
         clear_rvec(xcm1);
         clear_rvec(xcm2);
-        w_rls = NULL;
+        w_rls = nullptr;
     }
 
     /* calculate the rms deviation */
@@ -739,6 +739,8 @@ int gmx_confrms(int argc, char *argv[])
                 srenew(atoms1->pdbinfo, atoms1->nr);
                 srenew(atoms1->atom, atoms1->nr); /* Why renew atom? */
 
+                atoms1->havePdbInfo = TRUE;
+
                 /* Avoid segfaults when writing the pdb-file */
                 for (i = 0; i < atoms1->nr; i++)
                 {
@@ -799,9 +801,9 @@ int gmx_confrms(int argc, char *argv[])
             fp = gmx_ffopen(outfile, "w");
             if (!bOne)
             {
-                write_pdbfile(fp, *top1->name, atoms1, x1, ePBC1, box1, ' ', 1, NULL, TRUE);
+                write_pdbfile(fp, *top1->name, atoms1, x1, ePBC1, box1, ' ', 1, nullptr, TRUE);
             }
-            write_pdbfile(fp, *top2->name, atoms2, x2, ePBC2, box2, ' ', bOne ? -1 : 2, NULL, TRUE);
+            write_pdbfile(fp, *top2->name, atoms2, x2, ePBC2, box2, ' ', bOne ? -1 : 2, nullptr, TRUE);
             gmx_ffclose(fp);
             break;
         case efGRO:
index 34a5e03c3119ed662aa41752d7416979b1f0cd00..3bdb367078d869d6c36534ca299b210b9d29041b 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,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.
@@ -110,7 +110,7 @@ int gmx_covar(int argc, char *argv[])
         { "-pbc",  FALSE,  etBOOL, {&bPBC},
           "Apply corrections for periodic boundary conditions" }
     };
-    FILE             *out = NULL; /* initialization makes all compilers happy */
+    FILE             *out = nullptr; /* initialization makes all compilers happy */
     t_trxstatus      *status;
     t_topology        top;
     int               ePBC;
@@ -119,7 +119,7 @@ int gmx_covar(int argc, char *argv[])
     matrix            box, zerobox;
     real             *sqrtm, *mat, *eigenvalues, sum, trace, inv_nframes;
     real              t, tstart, tend, **mat2;
-    real              xj, *w_rls = NULL;
+    real              xj, *w_rls = nullptr;
     real              min, max, *axis;
     int               natoms, nat, nframes0, nframes, nlevels;
     gmx_int64_t       ndim, i, j, k, l;
@@ -135,16 +135,16 @@ int gmx_covar(int argc, char *argv[])
     t_rgb             rlo, rmi, rhi;
     real             *eigenvectors;
     gmx_output_env_t *oenv;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
 
     t_filenm          fnm[] = {
-        { efTRX, "-f",  NULL, ffREAD },
-        { efTPS, NULL,  NULL, ffREAD },
-        { efNDX, NULL,  NULL, ffOPTRD },
-        { efXVG, NULL,  "eigenval", ffWRITE },
+        { efTRX, "-f",  nullptr, ffREAD },
+        { efTPS, nullptr,  nullptr, ffREAD },
+        { efNDX, nullptr,  nullptr, ffOPTRD },
+        { efXVG, nullptr,  "eigenval", ffWRITE },
         { efTRN, "-v",  "eigenvec", ffWRITE },
         { efSTO, "-av", "average.pdb", ffWRITE },
-        { efLOG, NULL,  "covar", ffWRITE },
+        { efLOG, nullptr,  "covar", ffWRITE },
         { efDAT, "-ascii", "covar", ffOPTWR },
         { efXPM, "-xpm", "covar", ffOPTWR },
         { efXPM, "-xpma", "covara", ffOPTWR }
@@ -152,7 +152,7 @@ int gmx_covar(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_TIME_UNIT,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -170,7 +170,7 @@ int gmx_covar(int argc, char *argv[])
     xpmfile    = opt2fn_null("-xpm", NFILE, fnm);
     xpmafile   = opt2fn_null("-xpma", NFILE, fnm);
 
-    read_tps_conf(fitfile, &top, &ePBC, &xref, NULL, box, TRUE);
+    read_tps_conf(fitfile, &top, &ePBC, &xref, nullptr, box, TRUE);
     atoms = &top.atoms;
 
     if (bFit)
@@ -248,7 +248,7 @@ int gmx_covar(int argc, char *argv[])
     }
     if (bFit)
     {
-        reset_x(nfit, ifit, atoms->nr, NULL, xref, w_rls);
+        reset_x(nfit, ifit, atoms->nr, nullptr, xref, w_rls);
     }
 
     snew(x, natoms);
@@ -277,7 +277,7 @@ int gmx_covar(int argc, char *argv[])
         }
         if (bFit)
         {
-            reset_x(nfit, ifit, nat, NULL, xread, w_rls);
+            reset_x(nfit, ifit, nat, nullptr, xread, w_rls);
             do_fit(nat, w_rls, xref, xread);
         }
         for (i = 0; i < natoms; i++)
@@ -286,7 +286,7 @@ int gmx_covar(int argc, char *argv[])
         }
     }
     while (read_next_x(oenv, status, &t, xread, box));
-    close_trj(status);
+    close_trx(status);
 
     inv_nframes = 1.0/nframes0;
     for (i = 0; i < natoms; i++)
@@ -298,7 +298,7 @@ int gmx_covar(int argc, char *argv[])
         }
     }
     write_sto_conf_indexed(opt2fn("-av", NFILE, fnm), "Average structure",
-                           atoms, xread, NULL, epbcNONE, zerobox, natoms, index);
+                           atoms, xread, nullptr, epbcNONE, zerobox, natoms, index);
     sfree(xread);
 
     fprintf(stderr, "Constructing covariance matrix (%dx%d) ...\n", static_cast<int>(ndim), static_cast<int>(ndim));
@@ -316,7 +316,7 @@ int gmx_covar(int argc, char *argv[])
         }
         if (bFit)
         {
-            reset_x(nfit, ifit, nat, NULL, xread, w_rls);
+            reset_x(nfit, ifit, nat, nullptr, xread, w_rls);
             do_fit(nat, w_rls, xref, xread);
         }
         if (bRef)
@@ -353,7 +353,7 @@ int gmx_covar(int argc, char *argv[])
     }
     while (read_next_x(oenv, status, &t, xread, box) &&
            (bRef || nframes < nframes0));
-    close_trj(status);
+    close_trx(status);
     gmx_rmpbc_done(gpbc);
 
     fprintf(stderr, "Read %d frames\n", nframes);
@@ -599,7 +599,7 @@ int gmx_covar(int argc, char *argv[])
     fprintf(out, "Working directory: %s\n\n", str);
 
     fprintf(out, "Read %d frames from %s (time %g to %g %s)\n", nframes, trxfile,
-            output_env_conv_time(oenv, tstart), output_env_conv_time(oenv, tend), output_env_get_time_unit(oenv));
+            output_env_conv_time(oenv, tstart), output_env_conv_time(oenv, tend), output_env_get_time_unit(oenv).c_str());
     if (bFit)
     {
         fprintf(out, "Read reference structure for fit from %s\n", fitfile);
index e767a03239a131010b67867f84d62acaba4ba1c3..44be7f8111472468c8bbdd9d4f9e325273bfa10e 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, by the GROMACS development team, led by
+ * Copyright (c) 2008,2009,2010,2011,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.
@@ -356,12 +356,12 @@ static void dielectric(FILE *fmj, FILE *fmd, FILE *outf, FILE *fcur, FILE *mcor,
     int       i, j;
     int       valloc, nalloc, nfr, nvfr;
     int       vshfr;
-    real     *xshfr       = NULL;
-    int      *vfr         = NULL;
+    real     *xshfr       = nullptr;
+    int      *vfr         = nullptr;
     real      refr        = 0.0;
-    real     *cacf        = NULL;
-    real     *time        = NULL;
-    real     *djc         = NULL;
+    real     *cacf        = nullptr;
+    real     *time        = nullptr;
+    real     *djc         = nullptr;
     real      corint      = 0.0;
     real      prefactorav = 0.0;
     real      prefactor   = 0.0;
@@ -378,16 +378,16 @@ static void dielectric(FILE *fmj, FILE *fmd, FILE *outf, FILE *fcur, FILE *mcor,
     rvec      mja_tmp;
     rvec      mjd_tmp;
     rvec      mdvec;
-    rvec     *mu    = NULL;
-    rvec     *xp    = NULL;
-    rvec     *v0    = NULL;
-    rvec     *mjdsp = NULL;
-    real     *dsp2  = NULL;
+    rvec     *mu    = nullptr;
+    rvec     *xp    = nullptr;
+    rvec     *v0    = nullptr;
+    rvec     *mjdsp = nullptr;
+    real     *dsp2  = nullptr;
     real      t0;
     real      rtmp;
 
     rvec      tmp;
-    rvec     *mtrans = NULL;
+    rvec     *mtrans = nullptr;
 
     /*
      * Variables for the least-squares fit for Einstein-Helfand and Green-Kubo
@@ -400,7 +400,7 @@ static void dielectric(FILE *fmj, FILE *fmd, FILE *outf, FILE *fcur, FILE *mcor,
     real         err   = 0.0;
     real        *xfit;
     real        *yfit;
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
 
     /*
      * indices for EH
@@ -460,7 +460,7 @@ static void dielectric(FILE *fmj, FILE *fmd, FILE *outf, FILE *fcur, FILE *mcor,
                 xshfr[i] = 0.0;
             }
         }
-        GMX_RELEASE_ASSERT(time != NULL, "Memory not allocated correctly - time array is NULL");
+        GMX_RELEASE_ASSERT(time != nullptr, "Memory not allocated correctly - time array is NULL");
 
         if (nfr == 0)
         {
@@ -639,7 +639,7 @@ static void dielectric(FILE *fmj, FILE *fmd, FILE *outf, FILE *fcur, FILE *mcor,
     printf("\n\nAverage translational dipole moment M_J [enm] after %d frames (|M|^2): %f %f %f (%f)\n", nfr, mja_tmp[XX], mja_tmp[YY], mja_tmp[ZZ], mj2);
     printf("\n\nAverage molecular dipole moment M_D [enm] after %d frames (|M|^2): %f %f %f (%f)\n", nfr, mdvec[XX], mdvec[YY], mdvec[ZZ], md2);
 
-    if (v0 != NULL)
+    if (v0 != nullptr)
     {
         if (bINT)
         {
@@ -751,7 +751,7 @@ static void dielectric(FILE *fmj, FILE *fmd, FILE *outf, FILE *fcur, FILE *mcor,
     }
 
 
-    if (v0 != NULL)
+    if (v0 != nullptr)
     {
         sfree(v0);
     }
@@ -805,13 +805,13 @@ int gmx_current(int argc, char *argv[])
 
     gmx_output_env_t      *oenv;
     t_topology             top;
-    char                 **grpname = NULL;
+    char                 **grpname = nullptr;
     const char            *indexfn;
     t_trxframe             fr;
-    real                  *mass2 = NULL;
+    real                  *mass2 = nullptr;
     matrix                 box;
     int                   *index0;
-    int                   *indexm = NULL;
+    int                   *indexm = nullptr;
     int                    isize;
     t_trxstatus           *status;
     int                    flags = 0;
@@ -821,16 +821,16 @@ int gmx_current(int argc, char *argv[])
     int                    nmols;
     int                    i;
     real                  *qmol;
-    FILE                  *outf   = NULL;
-    FILE                  *mcor   = NULL;
-    FILE                  *fmj    = NULL;
-    FILE                  *fmd    = NULL;
-    FILE                  *fmjdsp = NULL;
-    FILE                  *fcur   = NULL;
+    FILE                  *outf   = nullptr;
+    FILE                  *mcor   = nullptr;
+    FILE                  *fmj    = nullptr;
+    FILE                  *fmd    = nullptr;
+    FILE                  *fmjdsp = nullptr;
+    FILE                  *fcur   = nullptr;
     t_filenm               fnm[]  = {
-        { efTPS,  NULL,  NULL, ffREAD }, /* this is for the topology */
-        { efNDX, NULL, NULL, ffOPTRD },
-        { efTRX, "-f", NULL, ffREAD },   /* and this for the trajectory */
+        { efTPS,  nullptr,  nullptr, ffREAD }, /* this is for the topology */
+        { efNDX, nullptr, nullptr, ffOPTRD },
+        { efTRX, "-f", nullptr, ffREAD },      /* and this for the trajectory */
         { efXVG, "-o",   "current", ffWRITE },
         { efXVG, "-caf", "caf",     ffOPTWR },
         { efXVG, "-dsp", "dsp",     ffWRITE },
@@ -880,7 +880,7 @@ int gmx_current(int argc, char *argv[])
 
     /* At first the arguments will be parsed and the system information processed */
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -888,7 +888,7 @@ int gmx_current(int argc, char *argv[])
     bACF = opt2bSet("-caf", NFILE, fnm);
     bINT = opt2bSet("-mc", NFILE, fnm);
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, NULL, NULL, box, TRUE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, nullptr, nullptr, box, TRUE);
 
     indexfn = ftp2fn_null(efNDX, NFILE, fnm);
     snew(grpname, 1);
index ad9b231fea9398db62a7bb9703ac831abdad52d7..e436d98a16c7781c73f739168db0a5f8762b0ef0 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,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.
@@ -71,7 +71,7 @@ typedef struct {
 /****************************************************************************/
 
 /* used for sorting the list */
-int compare(void *a, void *b)
+static int compare(void *a, void *b)
 {
     t_electron *tmp1, *tmp2;
     tmp1 = (t_electron *)a; tmp2 = (t_electron *)b;
@@ -79,7 +79,7 @@ int compare(void *a, void *b)
     return std::strcmp(tmp1->atomname, tmp2->atomname);
 }
 
-int get_electrons(t_electron **eltab, const char *fn)
+static int get_electrons(t_electron **eltab, const char *fn)
 {
     char  buffer[256];  /* to read in a line   */
     char  tempname[80]; /* buffer to hold name */
@@ -94,7 +94,7 @@ int get_electrons(t_electron **eltab, const char *fn)
         gmx_fatal(FARGS, "Couldn't open %s. Exiting.\n", fn);
     }
 
-    if (NULL == fgets(buffer, 255, in))
+    if (nullptr == fgets(buffer, 255, in))
     {
         gmx_fatal(FARGS, "Error reading from file %s", fn);
     }
@@ -108,7 +108,7 @@ int get_electrons(t_electron **eltab, const char *fn)
 
     for (i = 0; i < nr; i++)
     {
-        if (fgets(buffer, 255, in) == NULL)
+        if (fgets(buffer, 255, in) == nullptr)
         {
             gmx_fatal(FARGS, "reading datafile. Check your datafile.\n");
         }
@@ -129,8 +129,8 @@ int get_electrons(t_electron **eltab, const char *fn)
     return nr;
 }
 
-void center_coords(t_atoms *atoms, int *index_center, int ncenter,
-                   matrix box, rvec x0[])
+static void center_coords(t_atoms *atoms, int *index_center, int ncenter,
+                          matrix box, rvec x0[])
 {
     int  i, k, m;
     real tmass, mm;
@@ -167,13 +167,13 @@ void center_coords(t_atoms *atoms, int *index_center, int ncenter,
     }
 }
 
-void calc_electron_density(const char *fn, int **index, int gnx[],
-                           double ***slDensity, int *nslices, t_topology *top,
-                           int ePBC,
-                           int axis, int nr_grps, real *slWidth,
-                           t_electron eltab[], int nr, gmx_bool bCenter,
-                           int *index_center, int ncenter,
-                           gmx_bool bRelative, const gmx_output_env_t *oenv)
+static void calc_electron_density(const char *fn, int **index, int gnx[],
+                                  double ***slDensity, int *nslices, t_topology *top,
+                                  int ePBC,
+                                  int axis, int nr_grps, real *slWidth,
+                                  t_electron eltab[], int nr, gmx_bool bCenter,
+                                  int *index_center, int ncenter,
+                                  gmx_bool bRelative, const gmx_output_env_t *oenv)
 {
     rvec        *x0;            /* coordinates without pbc */
     matrix       box;           /* box (3x3) */
@@ -186,7 +186,7 @@ void calc_electron_density(const char *fn, int **index, int gnx[],
     t_electron  *found;         /* found by bsearch */
     t_electron   sought;        /* thingie thought by bsearch */
     real         boxSz, aveBox;
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
 
     real         t,
                  z;
@@ -281,7 +281,7 @@ void calc_electron_density(const char *fn, int **index, int gnx[],
                             (const void *)eltab, nr, sizeof(t_electron),
                             (int(*)(const void*, const void*))compare);
 
-                if (found == NULL)
+                if (found == nullptr)
                 {
                     fprintf(stderr, "Couldn't find %s. Add it to the .dat file\n",
                             *(top->atoms.atomname[index[n][i]]));
@@ -300,7 +300,7 @@ void calc_electron_density(const char *fn, int **index, int gnx[],
     gmx_rmpbc_done(gpbc);
 
     /*********** done with status file **********/
-    close_trj(status);
+    close_trx(status);
 
 /* slDensity now contains the total number of electrons per slice, summed
    over all frames. Now divide by nr_frames and volume of slice
@@ -326,11 +326,11 @@ void calc_electron_density(const char *fn, int **index, int gnx[],
     sfree(x0); /* free memory used by coordinate array */
 }
 
-void calc_density(const char *fn, int **index, int gnx[],
-                  double ***slDensity, int *nslices, t_topology *top, int ePBC,
-                  int axis, int nr_grps, real *slWidth, gmx_bool bCenter,
-                  int *index_center, int ncenter,
-                  gmx_bool bRelative, const gmx_output_env_t *oenv)
+static void calc_density(const char *fn, int **index, int gnx[],
+                         double ***slDensity, int *nslices, t_topology *top, int ePBC,
+                         int axis, int nr_grps, real *slWidth, gmx_bool bCenter,
+                         int *index_center, int ncenter,
+                         gmx_bool bRelative, const gmx_output_env_t *oenv)
 {
     rvec        *x0;            /* coordinates without pbc */
     matrix       box;           /* box (3x3) */
@@ -343,7 +343,7 @@ void calc_density(const char *fn, int **index, int gnx[],
     real         t,
                  z;
     real         boxSz, aveBox;
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
 
     if (axis < 0 || axis >= DIM)
     {
@@ -449,7 +449,7 @@ void calc_density(const char *fn, int **index, int gnx[],
     gmx_rmpbc_done(gpbc);
 
     /*********** done with status file **********/
-    close_trj(status);
+    close_trx(status);
 
     /* slDensity now contains the total mass per slice, summed over all
        frames. Now divide by nr_frames and volume of slice
@@ -475,16 +475,16 @@ void calc_density(const char *fn, int **index, int gnx[],
     sfree(x0); /* free memory used by coordinate array */
 }
 
-void plot_density(double *slDensity[], const char *afile, int nslices,
-                  int nr_grps, char *grpname[], real slWidth,
-                  const char **dens_opt,
-                  gmx_bool bCenter, gmx_bool bRelative, gmx_bool bSymmetrize,
-                  const gmx_output_env_t *oenv)
+static void plot_density(double *slDensity[], const char *afile, int nslices,
+                         int nr_grps, char *grpname[], real slWidth,
+                         const char **dens_opt,
+                         gmx_bool bCenter, gmx_bool bRelative, gmx_bool bSymmetrize,
+                         const gmx_output_env_t *oenv)
 {
     FILE       *den;
-    const char *title  = NULL;
-    const char *xlabel = NULL;
-    const char *ylabel = NULL;
+    const char *title  = nullptr;
+    const char *xlabel = nullptr;
+    const char *ylabel = nullptr;
     int         slice, n;
     real        ddd;
     real        axispos;
@@ -621,7 +621,7 @@ int gmx_density(int argc, char *argv[])
 
     gmx_output_env_t  *oenv;
     static const char *dens_opt[] =
-    { NULL, "mass", "number", "charge", "electron", NULL };
+    { nullptr, "mass", "number", "charge", "electron", nullptr };
     static int         axis        = 2;  /* normal to memb. default z  */
     static const char *axtitle     = "Z";
     static int         nslices     = 50; /* nr of slices defined       */
@@ -666,9 +666,9 @@ int gmx_density(int argc, char *argv[])
     int                i;
 
     t_filenm           fnm[] = { /* files for g_density       */
-        { efTRX, "-f", NULL,  ffREAD },
-        { efNDX, NULL, NULL,  ffOPTRD },
-        { efTPR, NULL, NULL,  ffREAD },
+        { efTRX, "-f", nullptr,  ffREAD },
+        { efNDX, nullptr, nullptr,  ffOPTRD },
+        { efTPR, nullptr, nullptr,  ffREAD },
         { efDAT, "-ei", "electrons", ffOPTRD }, /* file with nr. of electrons */
         { efXVG, "-o", "density", ffWRITE },
     };
@@ -682,7 +682,7 @@ int gmx_density(int argc, char *argv[])
         return 0;
     }
 
-    GMX_RELEASE_ASSERT(dens_opt[0] != NULL, "Option setting inconsistency; dens_opt[0] is NULL");
+    GMX_RELEASE_ASSERT(dens_opt[0] != nullptr, "Option setting inconsistency; dens_opt[0] is NULL");
 
     if (bSymmetrize && !bCenter)
     {
@@ -725,7 +725,7 @@ int gmx_density(int argc, char *argv[])
     else
     {
         ncenter      = 0;
-        index_center = NULL;
+        index_center = nullptr;
     }
 
     fprintf(stderr, "\nSelect %d group%s to calculate density for:\n", ngrps, (ngrps > 1) ? "s" : "");
index 45d09ee9c298ad7f8b9cea56490c75f93cafb624..de5e182276f201911bfd38ad8e00a6a7dc5a5142 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,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.
@@ -97,8 +97,8 @@ int gmx_densmap(int argc, char *argv[])
     static int         n1      = 0, n2 = 0;
     static real        xmin    = -1, xmax = -1, bin = 0.02, dmin = 0, dmax = 0, amax = 0, rmax = 0;
     static gmx_bool    bMirror = FALSE, bSums = FALSE;
-    static const char *eaver[] = { NULL, "z", "y", "x", NULL };
-    static const char *eunit[] = { NULL, "nm-3", "nm-2", "count", NULL };
+    static const char *eaver[] = { nullptr, "z", "y", "x", nullptr };
+    static const char *eunit[] = { nullptr, "nm-3", "nm-2", "count", nullptr };
 
     t_pargs            pa[] = {
         { "-bin", FALSE, etREAL, {&bin},
@@ -140,8 +140,8 @@ int gmx_densmap(int argc, char *argv[])
     int                cav = 0, c1 = 0, c2 = 0;
     char             **grpname, buf[STRLEN];
     const char        *unit;
-    int                i, j, k, l, ngrps, anagrp, *gnx = NULL, nindex, nradial = 0, nfr, nmpower;
-    int              **ind = NULL, *index;
+    int                i, j, k, l, ngrps, anagrp, *gnx = nullptr, nindex, nradial = 0, nfr, nmpower;
+    int              **ind = nullptr, *index;
     real             **grid, maxgrid, m1, m2, box1, box2, *tickx, *tickz, invcellvol;
     real               invspa = 0, invspz = 0, axial, r, vol_old, vol, rowsum;
     int                nlev   = 51;
@@ -149,9 +149,9 @@ int gmx_densmap(int argc, char *argv[])
     gmx_output_env_t  *oenv;
     const char        *label[] = { "x (nm)", "y (nm)", "z (nm)" };
     t_filenm           fnm[]   = {
-        { efTRX, "-f",   NULL,       ffREAD },
-        { efTPS, NULL,   NULL,       ffOPTRD },
-        { efNDX, NULL,   NULL,       ffOPTRD },
+        { efTRX, "-f",   nullptr,       ffREAD },
+        { efTPS, nullptr,   nullptr,       ffOPTRD },
+        { efNDX, nullptr,   nullptr,       ffOPTRD },
         { efDAT, "-od",  "densmap",   ffOPTWR },
         { efXPM, "-o",   "densmap",   ffWRITE }
     };
@@ -161,7 +161,7 @@ int gmx_densmap(int argc, char *argv[])
     npargs = asize(pa);
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, npargs, pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, npargs, pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -177,7 +177,7 @@ int gmx_densmap(int argc, char *argv[])
         }
     }
 
-    GMX_RELEASE_ASSERT(eunit[0] != NULL, "Option setting inconsistency; eunit[0] is NULL");
+    GMX_RELEASE_ASSERT(eunit[0] != nullptr, "Option setting inconsistency; eunit[0] is NULL");
 
     if (std::strcmp(eunit[0], "nm-3") == 0)
     {
@@ -197,7 +197,7 @@ int gmx_densmap(int argc, char *argv[])
 
     if (ftp2bSet(efTPS, NFILE, fnm) || !ftp2bSet(efNDX, NFILE, fnm))
     {
-        read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, NULL, box,
+        read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, nullptr, box,
                       bRadial);
     }
     if (!bRadial)
@@ -226,7 +226,7 @@ int gmx_densmap(int argc, char *argv[])
         }
     }
 
-    GMX_RELEASE_ASSERT(eaver[0] != NULL, "Option setting inconsistency; eaver[0] is NULL");
+    GMX_RELEASE_ASSERT(eaver[0] != nullptr, "Option setting inconsistency; eaver[0] is NULL");
 
     switch (eaver[0][0])
     {
@@ -369,7 +369,7 @@ int gmx_densmap(int argc, char *argv[])
         nfr++;
     }
     while (read_next_x(oenv, status, &t, x, box));
-    close_trj(status);
+    close_trx(status);
 
     /* normalize gridpoints */
     maxgrid = 0;
@@ -527,7 +527,7 @@ int gmx_densmap(int argc, char *argv[])
         gmx_ffclose(fp);
     }
 
-    do_view(oenv, opt2fn("-o", NFILE, fnm), NULL);
+    do_view(oenv, opt2fn("-o", NFILE, fnm), nullptr);
 
     return 0;
 }
index 57bc3e95274e956ce79047b3172712db36d7dd9f..e329e11f0762c75d3454a0421efc1c21b2e4f76c 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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -115,14 +115,14 @@ static void density_in_time (const char *fn, int **index, int gnx[], real bw, re
  * grpn         - group number in index
  */
     t_trxstatus *status;
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
     matrix       box;                    /* Box - 3x3 -each step*/
     rvec        *x0;                     /* List of Coord without PBC*/
     int          i, j,                   /* loop indices, checks etc*/
                  ax1     = 0, ax2 = 0,   /* tangent directions */
                  framenr = 0,            /* frame number in trajectory*/
                  slicex, slicey, slicez; /*slice # of x y z position */
-    real ***Densslice = NULL;            /* Density-slice in one frame*/
+    real ***Densslice = nullptr;         /* Density-slice in one frame*/
     real    dscale;                      /*physical scaling factor*/
     real    t, x, y, z;                  /* time and coordinates*/
     rvec    bbww;
@@ -173,7 +173,7 @@ static void density_in_time (const char *fn, int **index, int gnx[], real bw, re
     /*Initialize Densdevel and PBC-remove*/
     gpbc = gmx_rmpbc_init(&top->idef, ePBC, top->atoms.nr);
 
-    *Densdevel = NULL;
+    *Densdevel = nullptr;
 
     do
     {
@@ -184,7 +184,7 @@ static void density_in_time (const char *fn, int **index, int gnx[], real bw, re
         /*Reset Densslice every nsttblock steps*/
         /* The first conditional is for clang to understand that this branch is
          * always taken the first time. */
-        if (Densslice == NULL || framenr % nsttblock == 0)
+        if (Densslice == nullptr || framenr % nsttblock == 0)
         {
             snew(Densslice, *xslices);
             for (i = 0; i < *xslices; i++)
@@ -264,7 +264,7 @@ static void density_in_time (const char *fn, int **index, int gnx[], real bw, re
 
     /*Free memory we no longer need and exit.*/
     gmx_rmpbc_done(gpbc);
-    close_trj(status);
+    close_trx(status);
 
     if (0)
     {
@@ -360,11 +360,11 @@ static void interfaces_txy (real ****Densmap, int xslices, int yslices, int zsli
     real         *sigma1, *sigma2;
     double        beginfit1[4];
     double        beginfit2[4];
-    double       *fit1 = NULL, *fit2 = NULL;
+    double       *fit1 = nullptr, *fit2 = nullptr;
     const double *avgfit1;
     const double *avgfit2;
     const real    onehalf = 1.00/2.00;
-    t_interf   ***int1    = NULL, ***int2 = NULL; /*Interface matrices [t][x,y] - last index in row-major order*/
+    t_interf   ***int1    = nullptr, ***int2 = nullptr; /*Interface matrices [t][x,y] - last index in row-major order*/
     /*Create int1(t,xy) and int2(t,xy) arrays with correct number of interf_t elements*/
     xysize = xslices*yslices;
     snew(int1, tblocks);
@@ -487,9 +487,9 @@ static void interfaces_txy (real ****Densmap, int xslices, int yslices, int zsli
         /*Fit average density in z over whole trajectory to obtain tentative fit-parameters in fit1 and fit2*/
 
         /*Fit 1st half of box*/
-        do_lmfit(zslices, zDensavg, sigma1, binwidth, NULL, startpoint, splitpoint, oenv, FALSE, effnERF, beginfit1, 8, NULL);
+        do_lmfit(zslices, zDensavg, sigma1, binwidth, nullptr, startpoint, splitpoint, oenv, FALSE, effnERF, beginfit1, 8, nullptr);
         /*Fit 2nd half of box*/
-        do_lmfit(zslices, zDensavg, sigma2, binwidth, NULL, splitpoint, endpoint, oenv, FALSE, effnERF, beginfit2, 8, NULL);
+        do_lmfit(zslices, zDensavg, sigma2, binwidth, nullptr, splitpoint, endpoint, oenv, FALSE, effnERF, beginfit2, 8, nullptr);
 
         /*Initialise the const arrays for storing the average fit parameters*/
         avgfit1 = beginfit1;
@@ -513,10 +513,10 @@ static void interfaces_txy (real ****Densmap, int xslices, int yslices, int zsli
                         fit2[k] = avgfit2[k];
                     }
                     /*Now fit and store in structures in row-major order int[n][i][j]*/
-                    do_lmfit(zslices, Densmap[n][i][j], sigma1, binwidth, NULL, startpoint, splitpoint, oenv, FALSE, effnERF, fit1, 0, NULL);
+                    do_lmfit(zslices, Densmap[n][i][j], sigma1, binwidth, nullptr, startpoint, splitpoint, oenv, FALSE, effnERF, fit1, 0, nullptr);
                     int1[n][j+(yslices*i)]->Z = fit1[2];
                     int1[n][j+(yslices*i)]->t = fit1[3];
-                    do_lmfit(zslices, Densmap[n][i][j], sigma2, binwidth, NULL, splitpoint, endpoint, oenv, FALSE, effnERF, fit2, 0, NULL);
+                    do_lmfit(zslices, Densmap[n][i][j], sigma2, binwidth, nullptr, splitpoint, endpoint, oenv, FALSE, effnERF, fit2, 0, nullptr);
                     int2[n][j+(yslices*i)]->Z = fit2[2];
                     int2[n][j+(yslices*i)]->t = fit2[3];
                 }
@@ -532,7 +532,7 @@ static void interfaces_txy (real ****Densmap, int xslices, int yslices, int zsli
 
 static void writesurftoxpms(t_interf ***surf1, t_interf ***surf2, int tblocks, int xbins, int ybins, int zbins, real bw, real bwz, char **outfiles, int maplevels )
 {
-    char   numbuf[13];
+    char   numbuf[STRLEN];
     int    n, i, j;
     real **profile1, **profile2;
     real   max1, max2, min1, min2, *xticks, *yticks;
@@ -687,11 +687,11 @@ int gmx_densorder(int argc, char *argv[])
     static gmx_bool    b1d      = FALSE;
     static int         nlevels  = 100;
     /*Densitymap - Densmap[t][x][y][z]*/
-    real           ****Densmap = NULL;
+    real           ****Densmap = nullptr;
     /* Surfaces surf[t][surf_x,surf_y]*/
     t_interf        ***surf1, ***surf2;
 
-    static const char *meth[] = {NULL, "bisect", "functional", NULL};
+    static const char *meth[] = {nullptr, "bisect", "functional", nullptr};
     int                eMeth;
 
     char             **graphfiles, **rawfiles, **spectra; /* Filenames for xpm-surface maps, rawdata and powerspectra */
@@ -722,11 +722,11 @@ int gmx_densorder(int argc, char *argv[])
 
 
     t_filenm fnm[] = {
-        { efTPR, "-s",  NULL, ffREAD },               /* this is for the topology */
-        { efTRX, "-f", NULL, ffREAD },                /* and this for the trajectory */
-        { efNDX, "-n", NULL, ffREAD},                 /* this is to select groups */
+        { efTPR, "-s",  nullptr, ffREAD },            /* this is for the topology */
+        { efTRX, "-f", nullptr, ffREAD },             /* and this for the trajectory */
+        { efNDX, "-n", nullptr, ffREAD},              /* this is to select groups */
         { efDAT, "-o", "Density4D", ffOPTWR},         /* This is for outputting the entire 4D densityfield in binary format */
-        { efOUT, "-or", NULL, ffOPTWRMULT},           /* This is for writing out the entire information in the t_interf arrays */
+        { efOUT, "-or", nullptr, ffOPTWRMULT},        /* This is for writing out the entire information in the t_interf arrays */
         { efXPM, "-og", "interface", ffOPTWRMULT},    /* This is for writing out the interface meshes - one xpm-file per tblock*/
         { efOUT, "-Spect", "intfspect", ffOPTWRMULT}, /* This is for the trajectory averaged Fourier-spectra*/
     };
@@ -736,7 +736,7 @@ int gmx_densorder(int argc, char *argv[])
     /* This is the routine responsible for adding default options,
      * calling the X/motif interface, etc. */
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
index c9d4bb53de7afff883d10b10935feced9c8ffaf1..e6ba83d90e47a3524fc2f0f4f38cf5bfcf071379 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,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.
@@ -59,7 +59,7 @@
 #include "gromacs/utility/smalloc.h"
 
 /* Determines at which point in the array the fit should start */
-int calc_nbegin(int nx, real x[], real tbegin)
+static int calc_nbegin(int nx, real x[], real tbegin)
 {
     int  nbegin;
 
@@ -86,8 +86,8 @@ int calc_nbegin(int nx, real x[], real tbegin)
     return nbegin;
 }
 
-real numerical_deriv(int nx, real x[], real y[], real fity[], real combined[], real dy[],
-                     real tendInt, int nsmooth)
+static real numerical_deriv(int nx, real x[], real y[], real fity[], real combined[], real dy[],
+                            real tendInt, int nsmooth)
 {
     FILE *tmpfp;
     int   i, nbegin, i0, i1;
@@ -133,7 +133,7 @@ real numerical_deriv(int nx, real x[], real y[], real fity[], real combined[], r
     }
 
     tmpfp        = gmx_ffopen("integral_smth.xvg", "w");
-    integralSmth = print_and_integrate(tmpfp, nx, x[1]-x[0], combined, NULL, 1);
+    integralSmth = print_and_integrate(tmpfp, nx, x[1]-x[0], combined, nullptr, 1);
     printf("SMOOTH integral = %10.5e\n", integralSmth);
 
     dy[0] = (combined[1]-combined[0])/(x[1]-x[0]);
@@ -151,8 +151,8 @@ real numerical_deriv(int nx, real x[], real y[], real fity[], real combined[], r
     return integralSmth;
 }
 
-void do_four(const char *fn, const char *cn, int nx, real x[], real dy[],
-             real eps0, real epsRF, const gmx_output_env_t *oenv)
+static void do_four(const char *fn, const char *cn, int nx, real x[], real dy[],
+                    real eps0, real epsRF, const gmx_output_env_t *oenv)
 {
     FILE      *fp, *cp;
     t_complex *tmp, gw, hw, kw;
@@ -314,7 +314,7 @@ int gmx_dielectric(int argc, char *argv[])
     };
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -389,10 +389,10 @@ int gmx_dielectric(int argc, char *argv[])
     snew(y[4], nx);
     snew(y[5], nx);
 
-    integral = print_and_integrate(NULL, calc_nbegin(nx, y[0], tbegin),
-                                   dt, y[1], NULL, 1);
+    integral = print_and_integrate(nullptr, calc_nbegin(nx, y[0], tbegin),
+                                   dt, y[1], nullptr, 1);
     integral += do_lmfit(nx, y[1], y[2], dt, y[0], tbegin, tend,
-                         oenv, TRUE, eFitFn, fitparms, fix, NULL);
+                         oenv, TRUE, eFitFn, fitparms, fix, nullptr);
     for (i = 0; i < nx; i++)
     {
         y[3][i] = fit_function(eFitFn, fitparms, y[0][i]);
@@ -429,7 +429,7 @@ int gmx_dielectric(int argc, char *argv[])
             nx-1, y[0], y[5], eps0, epsRF, oenv);
 
     do_view(oenv, opt2fn("-o", NFILE, fnm), "-nxy");
-    do_view(oenv, opt2fn("-c", NFILE, fnm), NULL);
+    do_view(oenv, opt2fn("-c", NFILE, fnm), nullptr);
     do_view(oenv, opt2fn("-d", NFILE, fnm), "-nxy");
 
     return 0;
index 99be1dab8cfb002ab720ea077d3a6bbbd7586eaa..32dd9125ccf5aad2f612cf74ee615fe4a8b04a66 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,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.
@@ -93,9 +93,9 @@ static t_gkrbin *mk_gkrbin(real radius, real rcmax, gmx_bool bPhi, int ndegrees)
 
     snew(gb, 1);
 
-    if ((ptr = getenv("GMX_DIPOLE_SPACING")) != NULL)
+    if ((ptr = getenv("GMX_DIPOLE_SPACING")) != nullptr)
     {
-        double bw = strtod(ptr, NULL);
+        double bw = strtod(ptr, nullptr);
         gb->spacing = bw;
     }
     else
@@ -131,7 +131,7 @@ static void done_gkrbin(t_gkrbin **gb)
     sfree((*gb)->elem);
     sfree((*gb)->count);
     sfree((*gb));
-    *gb = NULL;
+    *gb = nullptr;
 }
 
 static void add2gkr(t_gkrbin *gb, real r, real cosa, real phi)
@@ -178,7 +178,7 @@ static void do_gkr(t_gkrbin *gb, int ncos, int *ngrp, int *molindex[],
                    int mindex[], rvec x[], rvec mu[],
                    int ePBC, const matrix box, const t_atom *atom, const int *nAtom)
 {
-    static rvec *xcm[2] = { NULL, NULL};
+    static rvec *xcm[2] = { nullptr, nullptr};
     int          gi, gj, j0, j1, i, j, k, n, grp0, grp1;
     real         qtot, q, cosa, rr, phi;
     rvec         dx;
@@ -410,8 +410,8 @@ static void print_gkrbin(const char *fn, t_gkrbin *gb,
     xvgrclose(fp);
 }
 
-gmx_bool read_mu_from_enx(ener_file_t fmu, int Vol, ivec iMu, rvec mu, real *vol,
-                          real *t, int nre, t_enxframe *fr)
+static gmx_bool read_mu_from_enx(ener_file_t fmu, int Vol, ivec iMu, rvec mu, real *vol,
+                                 real *t, int nre, t_enxframe *fr)
 {
     int          i;
     gmx_bool     bCont;
@@ -621,7 +621,7 @@ static void mol_quad(int k0, int k1, rvec x[], const t_atom atom[], rvec quad)
 /*
  * Calculates epsilon according to M. Neumann, Mol. Phys. 50, 841 (1983)
  */
-real calc_eps(double M_diff, double volume, double epsRF, double temp)
+static real calc_eps(double M_diff, double volume, double epsRF, double temp)
 {
     double eps, A, teller, noemer;
     double eps_0 = 8.854187817e-12;   /* epsilon_0 in C^2 J^-1 m^-1 */
@@ -779,14 +779,14 @@ static void do_dip(const t_topology *top, int ePBC, real volume,
     };
 #define NLEGADIP asize(leg_adip)
 
-    FILE          *outdd, *outmtot, *outaver, *outeps, *caver = NULL;
-    FILE          *dip3d = NULL, *adip = NULL;
-    rvec          *x, *dipole = NULL, mu_t, quad, *dipsp = NULL;
-    t_gkrbin      *gkrbin = NULL;
-    gmx_enxnm_t   *enm    = NULL;
+    FILE          *outdd, *outmtot, *outaver, *outeps, *caver = nullptr;
+    FILE          *dip3d = nullptr, *adip = nullptr;
+    rvec          *x, *dipole = nullptr, mu_t, quad, *dipsp = nullptr;
+    t_gkrbin      *gkrbin = nullptr;
+    gmx_enxnm_t   *enm    = nullptr;
     t_enxframe    *fr;
     int            nframes = 1000, nre, timecheck = 0, ncolour = 0;
-    ener_file_t    fmu     = NULL;
+    ener_file_t    fmu     = nullptr;
     int            i, n, m, natom = 0, gnx_tot, teller, tel3;
     t_trxstatus   *status;
     int           *dipole_bin, ndipbin, ibin, iVol, idim = -1;
@@ -798,13 +798,13 @@ static void do_dip(const t_topology *top, int ePBC, real volume,
     double         M_diff = 0, epsilon, invtel, vol_aver;
     double         mu_ave, mu_mol, M2_ave = 0, M_ave2 = 0, M_av[DIM], M_av2[DIM];
     double         M[3], M2[3], M4[3], Gk = 0, g_k = 0;
-    gmx_stats_t   *Qlsq, mulsq, muframelsq = NULL;
+    gmx_stats_t   *Qlsq, mulsq, muframelsq = nullptr;
     ivec           iMu;
-    real         **muall        = NULL;
-    rvec          *slab_dipoles = NULL;
-    const t_atom  *atom         = NULL;
-    const t_block *mols         = NULL;
-    gmx_rmpbc_t    gpbc         = NULL;
+    real         **muall        = nullptr;
+    rvec          *slab_dipoles = nullptr;
+    const t_atom  *atom         = nullptr;
+    const t_block *mols         = nullptr;
+    gmx_rmpbc_t    gpbc         = nullptr;
 
     gnx_tot = gnx[0];
     if (ncos > 1)
@@ -1337,7 +1337,7 @@ static void do_dip(const t_topology *top, int ePBC, real volume,
 
     if (!bMU)
     {
-        close_trj(status);
+        close_trx(status);
     }
 
     xvgrclose(outmtot);
@@ -1469,7 +1469,7 @@ static void do_dip(const t_topology *top, int ePBC, real volume,
     }
 }
 
-void dipole_atom2molindex(int *n, int *index, const t_block *mols)
+static void dipole_atom2molindex(int *n, int *index, const t_block *mols)
 {
     int nmol, i, j, m;
 
@@ -1543,7 +1543,7 @@ int gmx_dipoles(int argc, char *argv[])
     real              mu_max     = 5, mu_aver = -1, rcmax = 0;
     real              epsilonRF  = 0.0, temp = 300;
     gmx_bool          bPairs     = TRUE, bPhi = FALSE, bQuad = FALSE;
-    const char       *corrtype[] = {NULL, "none", "mol", "molsep", "total", NULL};
+    const char       *corrtype[] = {nullptr, "none", "mol", "molsep", "total", nullptr};
     const char       *axtitle    = "Z";
     int               nslices    = 10; /* nr of slices defined       */
     int               skip       = 0, nFA = 0, nFB = 0, ncos = 1;
@@ -1588,13 +1588,13 @@ int gmx_dipoles(int argc, char *argv[])
     int              *gnx;
     int               nFF[2];
     int             **grpindex;
-    char            **grpname = NULL;
+    char            **grpname = nullptr;
     gmx_bool          bGkr, bMU, bSlab;
     t_filenm          fnm[] = {
-        { efEDR, "-en", NULL,         ffOPTRD },
-        { efTRX, "-f", NULL,           ffREAD },
-        { efTPR, NULL, NULL,           ffREAD },
-        { efNDX, NULL, NULL,           ffOPTRD },
+        { efEDR, "-en", nullptr,         ffOPTRD },
+        { efTRX, "-f", nullptr,           ffREAD },
+        { efTPR, nullptr, nullptr,           ffREAD },
+        { efNDX, nullptr, nullptr,           ffOPTRD },
         { efXVG, "-o",   "Mtot",       ffWRITE },
         { efXVG, "-eps", "epsilon",    ffWRITE },
         { efXVG, "-a",   "aver",       ffWRITE },
@@ -1618,8 +1618,9 @@ int gmx_dipoles(int argc, char *argv[])
     npargs = asize(pa);
     ppa    = add_acf_pargs(&npargs, pa);
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, nullptr, &oenv))
     {
+        sfree(ppa);
         return 0;
     }
 
@@ -1667,8 +1668,8 @@ int gmx_dipoles(int argc, char *argv[])
     }
 
     snew(top, 1);
-    ePBC = read_tpx_top(ftp2fn(efTPR, NFILE, fnm), NULL, box,
-                        &natoms, NULL, NULL, top);
+    ePBC = read_tpx_top(ftp2fn(efTPR, NFILE, fnm), nullptr, box,
+                        &natoms, nullptr, nullptr, top);
 
     snew(gnx, ncos);
     snew(grpname, ncos);
index 94dc678cda99126a2d2c54e5054c361899d2be17..a1f309b5834bd2323eec4d26f213cb6a7d9acc53 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,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.
@@ -80,7 +80,7 @@ typedef struct {
     real v;
 } t_toppop;
 
-t_toppop *top  = NULL;
+t_toppop *top  = nullptr;
 int       ntop = 0;
 
 typedef struct {
@@ -106,7 +106,7 @@ static void reset5(void)
     }
 }
 
-int tpcomp(const void *a, const void *b)
+static int tpcomp(const void *a, const void *b)
 {
     t_toppop *tpa;
     t_toppop *tpb;
@@ -204,25 +204,25 @@ static void check_viol(FILE *log,
         while (((i+n) < disres->nr) &&
                (forceparams[forceatoms[i+n]].disres.label == label));
 
-        calc_disres_R_6(NULL, n, &forceatoms[i],
-                        (const rvec*)x, pbc, fcd, NULL);
+        calc_disres_R_6(nullptr, n, &forceatoms[i],
+                        (const rvec*)x, pbc, fcd, nullptr);
 
-        if (fcd->disres.Rt_6[0] <= 0)
+        if (fcd->disres.Rt_6[label] <= 0)
         {
-            gmx_fatal(FARGS, "ndr = %d, rt_6 = %f", ndr, fcd->disres.Rt_6[0]);
+            gmx_fatal(FARGS, "ndr = %d, rt_6 = %f", ndr, fcd->disres.Rt_6[label]);
         }
 
-        rt = gmx::invsixthroot(fcd->disres.Rt_6[0]);
+        rt = gmx::invsixthroot(fcd->disres.Rt_6[label]);
         dr[clust_id].aver1[ndr]  += rt;
         dr[clust_id].aver2[ndr]  += gmx::square(rt);
         drt = 1.0/gmx::power3(rt);
         dr[clust_id].aver_3[ndr] += drt;
-        dr[clust_id].aver_6[ndr] += fcd->disres.Rt_6[0];
+        dr[clust_id].aver_6[ndr] += fcd->disres.Rt_6[label];
 
         snew(fshift, SHIFTS);
         interaction_function[F_DISRES].ifunc(n, &forceatoms[i], forceparams,
                                              (const rvec*)x, f, fshift,
-                                             pbc, g, lam, &dvdl, NULL, fcd, NULL);
+                                             pbc, g, lam, &dvdl, nullptr, fcd, nullptr);
         sfree(fshift);
         viol = fcd->disres.sumviol;
 
@@ -242,7 +242,7 @@ static void check_viol(FILE *log,
             {
                 if (index[j] == forceparams[type].disres.label)
                 {
-                    vvindex[j] = gmx::invsixthroot(fcd->disres.Rt_6[0]);
+                    vvindex[j] = gmx::invsixthroot(fcd->disres.Rt_6[label]);
                 }
             }
         }
@@ -539,7 +539,7 @@ static void dump_disre_matrix(const char *fn, t_dr_result *dr, int ndr,
     real     **matrix, *t_res, hi, *w_dr, rav, rviol;
     t_rgb      rlo = { 1, 1, 1 };
     t_rgb      rhi = { 0, 0, 0 };
-    if (fn == NULL)
+    if (fn == nullptr)
     {
         return;
     }
@@ -688,47 +688,46 @@ int gmx_disre(int argc, char *argv[])
           "Use inverse third power averaging or linear for matrix output" }
     };
 
-    FILE             *out = NULL, *aver = NULL, *numv = NULL, *maxxv = NULL, *xvg = NULL;
+    FILE             *out = nullptr, *aver = nullptr, *numv = nullptr, *maxxv = nullptr, *xvg = nullptr;
     t_tpxheader       header;
-    t_inputrec        ir;
     gmx_mtop_t        mtop;
     rvec             *xtop;
     gmx_localtop_t   *top;
-    t_atoms          *atoms = NULL;
+    t_atoms          *atoms = nullptr;
     t_fcdata          fcd;
     t_nrnb            nrnb;
     t_graph          *g;
     int               ntopatoms, natoms, i, j, kkk;
     t_trxstatus      *status;
     real              t;
-    rvec             *x, *xav = NULL;
+    rvec             *x, *xav = nullptr;
     rvec4            *f;
     matrix            box;
     gmx_bool          bPDB;
     int               isize;
-    int              *index = NULL, *ind_fit = NULL;
+    int              *index = nullptr, *ind_fit = nullptr;
     char             *grpname;
-    t_cluster_ndx    *clust = NULL;
-    t_dr_result       dr, *dr_clust = NULL;
+    t_cluster_ndx    *clust = nullptr;
+    t_dr_result       dr, *dr_clust = nullptr;
     char            **leg;
-    real             *vvindex = NULL, *w_rls = NULL;
+    real             *vvindex = nullptr, *w_rls = nullptr;
     t_mdatoms        *mdatoms;
     t_pbc             pbc, *pbc_null;
     int               my_clust;
     FILE             *fplog;
     gmx_output_env_t *oenv;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
 
     t_filenm          fnm[] = {
-        { efTPR, NULL, NULL, ffREAD },
-        { efTRX, "-f", NULL, ffREAD },
+        { efTPR, nullptr, nullptr, ffREAD },
+        { efTRX, "-f", nullptr, ffREAD },
         { efXVG, "-ds", "drsum",  ffWRITE },
         { efXVG, "-da", "draver", ffWRITE },
         { efXVG, "-dn", "drnum",  ffWRITE },
         { efXVG, "-dm", "drmax",  ffWRITE },
         { efXVG, "-dr", "restr",  ffWRITE },
         { efLOG, "-l",  "disres", ffWRITE },
-        { efNDX, NULL,  "viol",   ffOPTRD },
+        { efNDX, nullptr,  "viol",   ffOPTRD },
         { efPDB, "-q",  "viol",   ffOPTWR },
         { efNDX, "-c",  "clust",  ffOPTRD },
         { efXPM, "-x",  "matrix", ffOPTWR }
@@ -736,7 +735,7 @@ int gmx_disre(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -748,9 +747,12 @@ int gmx_disre(int argc, char *argv[])
         init5(ntop);
     }
 
+    t_inputrec      irInstance;
+    t_inputrec     *ir = &irInstance;
+
     read_tpxheader(ftp2fn(efTPR, NFILE, fnm), &header, FALSE);
     snew(xtop, header.natoms);
-    read_tpx(ftp2fn(efTPR, NFILE, fnm), &ir, box, &ntopatoms, xtop, NULL, &mtop);
+    read_tpx(ftp2fn(efTPR, NFILE, fnm), ir, box, &ntopatoms, xtop, nullptr, &mtop);
     bPDB = opt2bSet("-q", NFILE, fnm);
     if (bPDB)
     {
@@ -766,19 +768,20 @@ int gmx_disre(int argc, char *argv[])
         snew(atoms, 1);
         *atoms = gmx_mtop_global_atoms(&mtop);
 
-        if (atoms->pdbinfo == NULL)
+        if (atoms->pdbinfo == nullptr)
         {
             snew(atoms->pdbinfo, atoms->nr);
         }
+        atoms->havePdbInfo = TRUE;
     }
 
-    top = gmx_mtop_generate_local_top(&mtop, ir.efep != efepNO);
+    top = gmx_mtop_generate_local_top(&mtop, ir->efep != efepNO);
 
-    g        = NULL;
-    pbc_null = NULL;
-    if (ir.ePBC != epbcNONE)
+    g        = nullptr;
+    pbc_null = nullptr;
+    if (ir->ePBC != epbcNONE)
     {
-        if (ir.bPeriodicMols)
+        if (ir->bPeriodicMols)
         {
             pbc_null = &pbc;
         }
@@ -810,8 +813,8 @@ int gmx_disre(int argc, char *argv[])
         isize = 0;
     }
 
-    ir.dr_tau = 0.0;
-    init_disres(fplog, &mtop, &ir, NULL, &fcd, NULL, FALSE);
+    ir->dr_tau = 0.0;
+    init_disres(fplog, &mtop, ir, nullptr, &fcd, nullptr, FALSE);
 
     natoms = read_first_x(oenv, &status, ftp2fn(efTRX, NFILE, fnm), &t, &x, box);
     snew(f, 5*natoms);
@@ -838,23 +841,23 @@ int gmx_disre(int argc, char *argv[])
                          "Largest Violation", "Time (ps)", "nm", oenv);
     }
 
-    mdatoms = init_mdatoms(fplog, &mtop, ir.efep != efepNO);
-    atoms2md(&mtop, &ir, 0, NULL, mtop.natoms, mdatoms);
-    update_mdatoms(mdatoms, ir.fepvals->init_lambda);
+    mdatoms = init_mdatoms(fplog, &mtop, ir->efep != efepNO);
+    atoms2md(&mtop, ir, -1, nullptr, mtop.natoms, mdatoms);
+    update_mdatoms(mdatoms, ir->fepvals->init_lambda);
     init_nrnb(&nrnb);
-    if (ir.ePBC != epbcNONE)
+    if (ir->ePBC != epbcNONE)
     {
-        gpbc = gmx_rmpbc_init(&top->idef, ir.ePBC, natoms);
+        gpbc = gmx_rmpbc_init(&top->idef, ir->ePBC, natoms);
     }
 
     j = 0;
     do
     {
-        if (ir.ePBC != epbcNONE)
+        if (ir->ePBC != epbcNONE)
         {
-            if (ir.bPeriodicMols)
+            if (ir->bPeriodicMols)
             {
-                set_pbc(&pbc, ir.ePBC, box);
+                set_pbc(&pbc, ir->ePBC, box);
             }
             else
             {
@@ -882,7 +885,7 @@ int gmx_disre(int argc, char *argv[])
         }
         if (bPDB)
         {
-            reset_x(atoms->nr, ind_fit, atoms->nr, NULL, x, w_rls);
+            reset_x(atoms->nr, ind_fit, atoms->nr, nullptr, x, w_rls);
             do_fit(atoms->nr, w_rls, x, x);
             if (j == 0)
             {
@@ -914,8 +917,8 @@ int gmx_disre(int argc, char *argv[])
         j++;
     }
     while (read_next_x(oenv, status, &t, x, box));
-    close_trj(status);
-    if (ir.ePBC != epbcNONE)
+    close_trx(status);
+    if (ir->ePBC != epbcNONE)
     {
         gmx_rmpbc_done(gpbc);
     }
@@ -930,12 +933,12 @@ int gmx_disre(int argc, char *argv[])
     {
         dump_stats(fplog, j, fcd.disres.nres, &(top->idef.il[F_DISRES]),
                    top->idef.iparams, &dr, isize, index,
-                   bPDB ? atoms : NULL);
+                   bPDB ? atoms : nullptr);
         if (bPDB)
         {
             write_sto_conf(opt2fn("-q", NFILE, fnm),
                            "Coloured by average violation in Angstrom",
-                           atoms, xav, NULL, ir.ePBC, box);
+                           atoms, xav, nullptr, ir->ePBC, box);
         }
         dump_disre_matrix(opt2fn_null("-x", NFILE, fnm), &dr, fcd.disres.nres,
                           j, &top->idef, &mtop, max_dr, nlevels, bThird);
index 60619c54995e36c54d7fdafa2763d6b4bbcdc11c..a8aab1bc21c1734db7b7b0a47c0d119ffbc53d00 100644 (file)
@@ -85,7 +85,7 @@ static int strip_dssp(char *dsspfile, int nres,
     {
         fgets2(buf, STRLEN, tapeout);
     }
-    while (std::strstr(buf, "KAPPA") == NULL);
+    while (std::strstr(buf, "KAPPA") == nullptr);
     if (bFirst)
     {
         /* Since we also have empty lines in the dssp output (temp) file,
@@ -101,7 +101,7 @@ static int strip_dssp(char *dsspfile, int nres,
     nresidues = 0;
     naccf     = 0;
     naccb     = 0;
-    for (nr = 0; (fgets2(buf, STRLEN, tapeout) != NULL); nr++)
+    for (nr = 0; (fgets2(buf, STRLEN, tapeout) != nullptr); nr++)
     {
         if (buf[13] == '!') /* Chain separator line has '!' at pos. 13 */
         {
@@ -116,7 +116,7 @@ static int strip_dssp(char *dsspfile, int nres,
         buf[39] = '\0';
 
         /* Only calculate solvent accessible area if needed */
-        if ((NULL != acc) && (buf[13] != '!'))
+        if ((nullptr != acc) && (buf[13] != '!'))
         {
             sscanf(&(buf[34]), "%d", &iacc);
             acc[nr] = iacc;
@@ -140,14 +140,14 @@ static int strip_dssp(char *dsspfile, int nres,
 
     if (bFirst)
     {
-        if (0 != acc)
+        if (nullptr != acc)
         {
             fprintf(stderr, "%d residues were classified as hydrophobic and %d as hydrophilic.\n", naccb, naccf);
         }
 
         sprintf(mat->title, "Secondary structure");
         mat->legend[0] = 0;
-        sprintf(mat->label_x, "%s", output_env_get_time_label(oenv));
+        sprintf(mat->label_x, "%s", output_env_get_time_label(oenv).c_str());
         sprintf(mat->label_y, "Residue");
         mat->bDiscrete = TRUE;
         mat->ny        = nr;
@@ -156,8 +156,8 @@ static int strip_dssp(char *dsspfile, int nres,
         {
             mat->axis_y[i] = i+1;
         }
-        mat->axis_x = NULL;
-        mat->matrix = NULL;
+        mat->axis_x = nullptr;
+        mat->matrix = nullptr;
         xsize       = 0;
         frame       = 0;
         bFirst      = FALSE;
@@ -269,7 +269,7 @@ static void norm_acc(t_atoms *atoms, int nres,
     }
 }
 
-void prune_ss_legend(t_matrix *mat)
+static void prune_ss_legend(t_matrix *mat)
 {
     gmx_bool  *present;
     int       *newnum;
@@ -288,7 +288,7 @@ void prune_ss_legend(t_matrix *mat)
     }
 
     newnmap = 0;
-    newmap  = NULL;
+    newmap  = nullptr;
     for (i = 0; i < mat->nmap; i++)
     {
         newnum[i] = -1;
@@ -314,7 +314,7 @@ void prune_ss_legend(t_matrix *mat)
     }
 }
 
-void write_sas_mat(const char *fn, real **accr, int nframe, int nres, t_matrix *mat)
+static void write_sas_mat(const char *fn, real **accr, int nframe, int nres, t_matrix *mat)
 {
     real  lo, hi;
     int   i, j, nlev;
@@ -341,8 +341,8 @@ void write_sas_mat(const char *fn, real **accr, int nframe, int nres, t_matrix *
     }
 }
 
-void analyse_ss(const char *outfile, t_matrix *mat, const char *ss_string,
-                const gmx_output_env_t *oenv)
+static void analyse_ss(const char *outfile, t_matrix *mat, const char *ss_string,
+                       const gmx_output_env_t *oenv)
 {
     FILE        *fp;
     t_mapping   *map;
@@ -505,17 +505,17 @@ int gmx_do_dssp(int argc, char *argv[])
     int               *index;
     rvec              *xp, *x;
     int               *average_area;
-    real             **accr, *accr_ptr = NULL, *av_area, *norm_av_area;
+    real             **accr, *accr_ptr = nullptr, *av_area, *norm_av_area;
     char               pdbfile[32], tmpfile[32];
     char               dssp[256];
     const char        *dptr;
     gmx_output_env_t  *oenv;
-    gmx_rmpbc_t        gpbc = NULL;
+    gmx_rmpbc_t        gpbc = nullptr;
 
     t_filenm           fnm[] = {
-        { efTRX, "-f",   NULL,      ffREAD },
-        { efTPS, NULL,   NULL,      ffREAD },
-        { efNDX, NULL,   NULL,      ffOPTRD },
+        { efTRX, "-f",   nullptr,      ffREAD },
+        { efTPS, nullptr,   nullptr,      ffREAD },
+        { efNDX, nullptr,   nullptr,      ffOPTRD },
         { efDAT, "-ssdump", "ssdump", ffOPTWR },
         { efMAP, "-map", "ss",      ffLIBRD },
         { efXPM, "-o",   "ss",      ffWRITE },
@@ -528,7 +528,7 @@ int gmx_do_dssp(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv,
                            PCA_CAN_TIME | PCA_CAN_VIEW | PCA_TIME_UNIT,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -538,7 +538,7 @@ int gmx_do_dssp(int argc, char *argv[])
     fnAArea    = opt2fn_null("-aa", NFILE, fnm);
     bDoAccSurf = (fnArea || fnTArea || fnAArea);
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xp, NULL, box, FALSE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xp, nullptr, box, FALSE);
     atoms = &(top.atoms);
     check_oo(atoms);
     bPhbres = bPhobics(atoms);
@@ -558,11 +558,11 @@ int gmx_do_dssp(int argc, char *argv[])
 
     std::strcpy(pdbfile, "ddXXXXXX");
     gmx_tmpnam(pdbfile);
-    if ((tmpf = fopen(pdbfile, "w")) == NULL)
+    if ((tmpf = fopen(pdbfile, "w")) == nullptr)
     {
         sprintf(pdbfile, "%ctmp%cfilterXXXXXX", DIR_SEPARATOR, DIR_SEPARATOR);
         gmx_tmpnam(pdbfile);
-        if ((tmpf = fopen(pdbfile, "w")) == NULL)
+        if ((tmpf = fopen(pdbfile, "w")) == nullptr)
         {
             gmx_fatal(FARGS, "Can not open tmp file %s", pdbfile);
         }
@@ -574,11 +574,11 @@ int gmx_do_dssp(int argc, char *argv[])
 
     std::strcpy(tmpfile, "ddXXXXXX");
     gmx_tmpnam(tmpfile);
-    if ((tmpf = fopen(tmpfile, "w")) == NULL)
+    if ((tmpf = fopen(tmpfile, "w")) == nullptr)
     {
         sprintf(tmpfile, "%ctmp%cfilterXXXXXX", DIR_SEPARATOR, DIR_SEPARATOR);
         gmx_tmpnam(tmpfile);
-        if ((tmpf = fopen(tmpfile, "w")) == NULL)
+        if ((tmpf = fopen(tmpfile, "w")) == nullptr)
         {
             gmx_fatal(FARGS, "Can not open tmp file %s", tmpfile);
         }
@@ -588,7 +588,7 @@ int gmx_do_dssp(int argc, char *argv[])
         fclose(tmpf);
     }
 
-    if ((dptr = getenv("DSSP")) == NULL)
+    if ((dptr = getenv("DSSP")) == nullptr)
     {
         dptr = "/usr/local/bin/dssp";
     }
@@ -623,10 +623,10 @@ int gmx_do_dssp(int argc, char *argv[])
     }
     else
     {
-        fTArea = NULL;
+        fTArea = nullptr;
     }
 
-    mat.map  = NULL;
+    mat.map  = nullptr;
     mat.nmap = readcmap(opt2fn("-map", NFILE, fnm), &(mat.map));
 
     natoms = read_first_x(oenv, &status, ftp2fn(efTRX, NFILE, fnm), &t, &x, box);
@@ -642,7 +642,7 @@ int gmx_do_dssp(int argc, char *argv[])
     snew(average_area, atoms->nres);
     snew(av_area, atoms->nres);
     snew(norm_av_area, atoms->nres);
-    accr  = NULL;
+    accr  = nullptr;
     naccr = 0;
 
     gpbc = gmx_rmpbc_init(&top.idef, ePBC, natoms);
@@ -660,7 +660,7 @@ int gmx_do_dssp(int argc, char *argv[])
         }
         gmx_rmpbc(gpbc, natoms, box, x);
         tapein = gmx_ffopen(pdbfile, "w");
-        write_pdbfile_indexed(tapein, NULL, atoms, x, ePBC, box, ' ', -1, gnx, index, NULL, TRUE);
+        write_pdbfile_indexed(tapein, nullptr, atoms, x, ePBC, box, ' ', -1, gnx, index, nullptr, TRUE);
         gmx_ffclose(tapein);
 
         if (0 != system(dssp))
@@ -685,7 +685,7 @@ int gmx_do_dssp(int argc, char *argv[])
     }
     while (read_next_x(oenv, status, &t, x, box));
     fprintf(stderr, "\n");
-    close_trj(status);
+    close_trx(status);
     if (fTArea)
     {
         xvgrclose(fTArea);
index 88a3667a365e329fa6ad3854fef321f92686f3f9..26b3d3a83c85469581fdbb9cb6eb6ed0f14f0b0c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,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.
@@ -307,9 +307,9 @@ int gmx_dos(int argc, char *argv[])
     };
 
     t_filenm            fnm[] = {
-        { efTRN, "-f",    NULL,    ffREAD  },
-        { efTPR, "-s",    NULL,    ffREAD  },
-        { efNDX, NULL,    NULL,    ffOPTRD },
+        { efTRN, "-f",    nullptr,    ffREAD  },
+        { efTPR, "-s",    nullptr,    ffREAD  },
+        { efNDX, nullptr,    nullptr,    ffOPTRD },
         { efXVG, "-vacf", "vacf",  ffWRITE },
         { efXVG, "-mvacf", "mvacf", ffWRITE },
         { efXVG, "-dos",  "dos",   ffWRITE },
@@ -328,6 +328,7 @@ int gmx_dos(int argc, char *argv[])
                            NFILE, fnm, npargs, ppa, asize(desc), desc,
                            asize(bugs), bugs, &oenv))
     {
+        sfree(ppa);
         return 0;
     }
 
@@ -338,7 +339,7 @@ int gmx_dos(int argc, char *argv[])
     please_cite(fplog, "Pascal2011a");
     please_cite(fplog, "Caleman2011b");
 
-    read_tps_conf(ftp2fn(efTPR, NFILE, fnm), &top, &ePBC, NULL, NULL, box, TRUE);
+    read_tps_conf(ftp2fn(efTPR, NFILE, fnm), &top, &ePBC, nullptr, nullptr, box, TRUE);
 
     /* Handle index groups */
     get_index(&top.atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &grpNatoms, &index, &grpname);
@@ -358,7 +359,7 @@ int gmx_dos(int argc, char *argv[])
     snew(c1, gnx);
     for (i = 0; (i < gnx); i++)
     {
-        c1[i] = NULL;
+        c1[i] = nullptr;
     }
 
     read_first_frame(oenv, &status, ftp2fn(efTRN, NFILE, fnm), &fr, TRX_NEED_V);
@@ -397,7 +398,7 @@ int gmx_dos(int argc, char *argv[])
     }
     while (read_next_frame(oenv, status, &fr));
 
-    close_trj(status);
+    close_trx(status);
 
     if (nframes < min_frames)
     {
@@ -428,7 +429,7 @@ int gmx_dos(int argc, char *argv[])
     normalizeAutocorrelation = opt2parg_bool("-normalize", npargs, ppa);
 
     /* Note that we always disable normalization here, regardless of user settings */
-    low_do_autocorr(NULL, oenv, NULL, nframes, gnx, nframes, c1, dt, eacNormal, 0, FALSE,
+    low_do_autocorr(nullptr, oenv, nullptr, nframes, gnx, nframes, c1, dt, eacNormal, 0, FALSE,
                     FALSE, FALSE, -1, -1, 0);
     snew(dos, DOS_NR);
     for (j = 0; (j < DOS_NR); j++)
@@ -505,7 +506,7 @@ int gmx_dos(int argc, char *argv[])
         }
     }
     /* Normalize it */
-    dostot = evaluate_integral(nframes/4, nu, dos[DOS], NULL, nframes/4, &stddev);
+    dostot = evaluate_integral(nframes/4, nu, dos[DOS], nullptr, nframes/4, &stddev);
     if (bNormalizeDos)
     {
         for (j = 0; (j < nframes/4); j++)
@@ -584,14 +585,14 @@ int gmx_dos(int argc, char *argv[])
         dos[DOS_E][j]  = (dos[DOS_DIFF][j]*wEdiff +
                           dos[DOS_SOLID][j]*wEsolid(nu[j], beta));
     }
-    DiffCoeff = evaluate_integral(nframes/2, tt, dos[VACF], NULL, nframes/2, &stddev);
+    DiffCoeff = evaluate_integral(nframes/2, tt, dos[VACF], nullptr, nframes/2, &stddev);
     DiffCoeff = 1000*DiffCoeff/3.0;
     fprintf(fplog, "Diffusion coefficient from VACF %g 10^-5 cm^2/s\n",
             DiffCoeff);
     fprintf(fplog, "Diffusion coefficient from DoS %g 10^-5 cm^2/s\n",
             1000*DoS0/(12*tmass*beta));
 
-    cP = BOLTZ * evaluate_integral(nframes/4, nu, dos[DOS_CP], NULL,
+    cP = BOLTZ * evaluate_integral(nframes/4, nu, dos[DOS_CP], nullptr,
                                    nframes/4, &stddev);
     fprintf(fplog, "Heat capacity %g J/mol K\n", 1000*cP/Nmol);
     fprintf(fplog, "\nArrivederci!\n");
index b7af6b5352810d4863954a78e24202f316b749dc..e9c28c71946f384d9c8b8de612bdfac2471d8567 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,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.
@@ -87,8 +87,8 @@ int gmx_dyecoupl(int argc, char *argv[])
 
     t_filenm fnm[] =
     {
-        { efTRX, "-f", NULL, ffREAD },
-        { efNDX, NULL, NULL, ffREAD },
+        { efTRX, "-f", nullptr, ffREAD },
+        { efNDX, nullptr, nullptr, ffREAD },
         { efXVG, "-ot", "rkappa", ffOPTWR },
         { efXVG, "-oe", "insteff", ffOPTWR },
         { efDAT, "-o", "rkappa", ffOPTWR },
@@ -98,7 +98,7 @@ int gmx_dyecoupl(int argc, char *argv[])
 #define NFILE asize(fnm)
 
 
-    const char  *in_trajfile, *out_xvgrkfile = NULL, *out_xvginstefffile = NULL, *out_xvgrhistfile = NULL, *out_xvgkhistfile = NULL, *out_datfile = NULL;
+    const char  *in_trajfile, *out_xvgrkfile = nullptr, *out_xvginstefffile = nullptr, *out_xvgrhistfile = nullptr, *out_xvgkhistfile = nullptr, *out_datfile = nullptr;
     gmx_bool     bHaveFirstFrame, bHaveNextFrame, indexOK = TRUE;
     int          ndon, nacc;
     int         *donindex, *accindex;
@@ -115,10 +115,10 @@ int gmx_dyecoupl(int argc, char *argv[])
     /*we rely on PBC autodetection (...currently)*/
     int         ePBC = -1;
 
-    real       *rvalues = NULL, *kappa2values = NULL, *rhist = NULL, *khist = NULL;
-    t_pbc      *pbc     = NULL;
+    real       *rvalues = nullptr, *kappa2values = nullptr, *rhist = nullptr, *khist = nullptr;
+    t_pbc      *pbc     = nullptr;
     int         i, bin;
-    FILE       *rkfp = NULL, *rhfp = NULL, *khfp = NULL, *datfp = NULL, *iefp = NULL;
+    FILE       *rkfp = nullptr, *rhfp = nullptr, *khfp = nullptr, *datfp = nullptr, *iefp = nullptr;
     gmx_bool    bRKout, bRhistout, bKhistout, bDatout, bInstEffout, grident;
 
     const char *rkleg[2] = { "R", "\\f{Symbol}k\\f{}\\S2\\N" };
@@ -131,7 +131,7 @@ int gmx_dyecoupl(int argc, char *argv[])
     int         rkcount = 0, rblocksallocated = 0, kblocksallocated = 0;
 
     if (!parse_common_args(&argc, argv, PCA_CAN_BEGIN | PCA_CAN_END | PCA_CAN_VIEW | PCA_TIME_UNIT,
-                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -166,10 +166,10 @@ int gmx_dyecoupl(int argc, char *argv[])
     }
 
     printf("Select group with donor atom pairs defining the transition moment\n");
-    get_index(NULL, ftp2fn_null(efNDX, NFILE, fnm), 1, &ndon, &donindex, &grpnm);
+    get_index(nullptr, ftp2fn_null(efNDX, NFILE, fnm), 1, &ndon, &donindex, &grpnm);
 
     printf("Select group with acceptor atom pairs defining the transition moment\n");
-    get_index(NULL, ftp2fn_null(efNDX, NFILE, fnm), 1, &nacc, &accindex, &grpnm);
+    get_index(nullptr, ftp2fn_null(efNDX, NFILE, fnm), 1, &nacc, &accindex, &grpnm);
 
     /*check if groups are identical*/
     grident = TRUE;
index 0ac5265afd8089503101562b3b710b97bcbdfe96..720496b637bc30dd7a9a600502427736907e900c 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,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.
@@ -190,7 +190,7 @@ int gmx_dyndom(int argc, char *argv[])
     };
     int               i, j, natoms, isize;
     t_trxstatus      *status;
-    int              *index = NULL, *index_all;
+    int              *index = nullptr, *index_all;
     char             *grpname;
     real              angle, trans;
     rvec             *x, *v, *xout, *vout;
@@ -205,7 +205,7 @@ int gmx_dyndom(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, 0, NFILE, fnm, asize(pa), pa,
-                           asize(desc), desc, 0, NULL, &oenv))
+                           asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -217,13 +217,14 @@ int gmx_dyndom(int argc, char *argv[])
 
     t_topology *top;
     snew(top, 1);
-    read_tps_conf(opt2fn("-f", NFILE, fnm), top, NULL, &x, &v, box, FALSE);
+    read_tps_conf(opt2fn("-f", NFILE, fnm), top, nullptr, &x, &v, box, FALSE);
     t_atoms  &atoms = top->atoms;
-    if (atoms.pdbinfo == NULL)
+    if (atoms.pdbinfo == nullptr)
     {
         snew(atoms.pdbinfo, atoms.nr);
     }
-    natoms = atoms.nr;
+    atoms.havePdbInfo = TRUE;
+    natoms            = atoms.nr;
     snew(xout, natoms);
     snew(vout, natoms);
 
@@ -257,7 +258,7 @@ int gmx_dyndom(int argc, char *argv[])
             atoms.resinfo[atoms.atom[j].resind].chainid = label;
         }
 
-        write_trx(status, atoms.nr, index_all, &atoms, i, angle, box, xout, vout, NULL);
+        write_trx(status, atoms.nr, index_all, &atoms, i, angle, box, xout, vout, nullptr);
     }
     close_trx(status);
 
index 6af4584974fabbe74cc526841a1d16a59e891321..7abb509a260f6f31239802534e3306fa322b7119 100644 (file)
@@ -67,7 +67,7 @@
 #include "gromacs/utility/strdb.h"
 
 
-real calc_mass(t_atoms *atoms, gmx_bool bGetMass, gmx_atomprop_t aps)
+static real calc_mass(t_atoms *atoms, gmx_bool bGetMass, gmx_atomprop_t aps)
 {
     real tmass;
     int  i;
@@ -87,8 +87,8 @@ real calc_mass(t_atoms *atoms, gmx_bool bGetMass, gmx_atomprop_t aps)
     return tmass;
 }
 
-real calc_geom(int isize, int *index, rvec *x, rvec geom_center, rvec minval,
-               rvec maxval, gmx_bool bDiam)
+static real calc_geom(int isize, int *index, rvec *x, rvec geom_center, rvec minval,
+                      rvec maxval, gmx_bool bDiam)
 {
     real  diam2, d;
     int   ii, i, j;
@@ -162,7 +162,7 @@ real calc_geom(int isize, int *index, rvec *x, rvec geom_center, rvec minval,
     return std::sqrt(diam2);
 }
 
-void center_conf(int natom, rvec *x, rvec center, rvec geom_cent)
+static void center_conf(int natom, rvec *x, rvec center, rvec geom_cent)
 {
     int  i;
     rvec shift;
@@ -178,7 +178,7 @@ void center_conf(int natom, rvec *x, rvec center, rvec geom_cent)
     }
 }
 
-void scale_conf(int natom, rvec x[], matrix box, rvec scale)
+static void scale_conf(int natom, rvec x[], matrix box, rvec scale)
 {
     int i, j;
 
@@ -198,7 +198,7 @@ void scale_conf(int natom, rvec x[], matrix box, rvec scale)
     }
 }
 
-void read_bfac(const char *fn, int *n_bfac, double **bfac_val, int **bfac_nr)
+static void read_bfac(const char *fn, int *n_bfac, double **bfac_val, int **bfac_nr)
 {
     int    i;
     char **bfac_lines;
@@ -216,8 +216,8 @@ void read_bfac(const char *fn, int *n_bfac, double **bfac_val, int **bfac_nr)
 
 }
 
-void set_pdb_conf_bfac(int natoms, int nres, t_atoms *atoms, int n_bfac,
-                       double *bfac, int *bfac_nr, gmx_bool peratom)
+static void set_pdb_conf_bfac(int natoms, int nres, t_atoms *atoms, int n_bfac,
+                              double *bfac, int *bfac_nr, gmx_bool peratom)
 {
     real     bfac_min, bfac_max;
     int      i, n;
@@ -306,7 +306,7 @@ void set_pdb_conf_bfac(int natoms, int nres, t_atoms *atoms, int n_bfac,
     }
 }
 
-void pdb_legend(FILE *out, int natoms, int nres, t_atoms *atoms, rvec x[])
+static void pdb_legend(FILE *out, int natoms, int nres, t_atoms *atoms, rvec x[])
 {
     real bfac_min, bfac_max, xmin, ymin, zmin;
     int  i;
@@ -336,7 +336,7 @@ void pdb_legend(FILE *out, int natoms, int nres, t_atoms *atoms, rvec x[])
     }
 }
 
-void visualize_images(const char *fn, int ePBC, matrix box)
+static void visualize_images(const char *fn, int ePBC, matrix box)
 {
     t_atoms atoms;
     rvec   *img;
@@ -360,13 +360,13 @@ void visualize_images(const char *fn, int ePBC, matrix box)
     }
     calc_triclinic_images(box, img + 1);
 
-    write_sto_conf(fn, "Images", &atoms, img, NULL, ePBC, box);
+    write_sto_conf(fn, "Images", &atoms, img, nullptr, ePBC, box);
 
     done_atom(&atoms);
     sfree(img);
 }
 
-void visualize_box(FILE *out, int a0, int r0, matrix box, rvec gridsize)
+static void visualize_box(FILE *out, int a0, int r0, matrix box, rvec gridsize)
 {
     int  *edge;
     rvec *vert, shift;
@@ -451,7 +451,7 @@ void visualize_box(FILE *out, int a0, int r0, matrix box, rvec gridsize)
     }
 }
 
-void calc_rotmatrix(rvec principal_axis, rvec targetvec, matrix rotmatrix)
+static void calc_rotmatrix(rvec principal_axis, rvec targetvec, matrix rotmatrix)
 {
     rvec rotvec;
     real ux, uy, uz, costheta, sintheta;
@@ -493,7 +493,7 @@ static void renum_resnr(t_atoms *atoms, int isize, const int *index,
     resind_prev = -1;
     for (i = 0; i < isize; i++)
     {
-        resind = atoms->atom[index == NULL ? i : index[i]].resind;
+        resind = atoms->atom[index == nullptr ? i : index[i]].resind;
         if (resind != resind_prev)
         {
             atoms->resinfo[resind].nr = resnr_start;
@@ -620,7 +620,7 @@ int gmx_editconf(int argc, char *argv[])
     { 0, 0, 0 }, targetvec   =
     { 0, 0, 0 };
     static const char *btype[] =
-    { NULL, "triclinic", "cubic", "dodecahedron", "octahedron", NULL },
+    { nullptr, "triclinic", "cubic", "dodecahedron", "octahedron", nullptr },
     *label             = "A";
     static rvec visbox =
     { 0, 0, 0 };
@@ -703,9 +703,9 @@ int gmx_editconf(int argc, char *argv[])
     FILE             *out;
     const char       *infile, *outfile;
     int               outftp, inftp, natom, i, j, n_bfac, itype, ntype;
-    double           *bfac    = NULL, c6, c12;
-    int              *bfac_nr = NULL;
-    t_topology       *top     = NULL;
+    double           *bfac    = nullptr, c6, c12;
+    int              *bfac_nr = nullptr;
+    t_topology       *top     = nullptr;
     char             *grpname, *sgrpname, *agrpname;
     int               isize, ssize, asize;
     int              *index, *sindex, *aindex;
@@ -721,9 +721,9 @@ int gmx_editconf(int argc, char *argv[])
     gmx_output_env_t *oenv;
     t_filenm          fnm[] =
     {
-        { efSTX, "-f", NULL, ffREAD },
-        { efNDX, "-n", NULL, ffOPTRD },
-        { efSTO, NULL, NULL, ffOPTWR },
+        { efSTX, "-f", nullptr, ffREAD },
+        { efNDX, "-n", nullptr, ffOPTRD },
+        { efSTO, nullptr, nullptr, ffOPTWR },
         { efPQR, "-mead", "mead", ffOPTWR },
         { efDAT, "-bf", "bfact", ffOPTRD }
     };
@@ -758,7 +758,7 @@ int gmx_editconf(int argc, char *argv[])
     bScale    = bScale || bRho;
     bCalcGeom = bCenter || bRotate || bOrient || bScale;
 
-    GMX_RELEASE_ASSERT(btype[0] != NULL, "Option setting inconsistency; btype[0] is NULL");
+    GMX_RELEASE_ASSERT(btype[0] != nullptr, "Option setting inconsistency; btype[0] is NULL");
 
     bCalcDiam = (btype[0][0] == 'c' || btype[0][0] == 'd' || btype[0][0] == 'o');
 
@@ -797,10 +797,12 @@ int gmx_editconf(int argc, char *argv[])
     read_tps_conf(infile, top_tmp, &ePBC, &x, &v, box, FALSE);
     t_atoms  &atoms = top_tmp->atoms;
     natom = atoms.nr;
-    if (atoms.pdbinfo == NULL)
+    if (atoms.pdbinfo == nullptr)
     {
         snew(atoms.pdbinfo, atoms.nr);
     }
+    atoms.havePdbInfo = TRUE;
+
     if (fn2ftp(infile) == efPDB)
     {
         get_pdb_atomnumber(&atoms, aps);
@@ -822,7 +824,7 @@ int gmx_editconf(int argc, char *argv[])
 
     if (bMead || bGrasp || bCONECT)
     {
-        top = read_top(infile, NULL);
+        top = read_top(infile, nullptr);
     }
 
     if (bMead || bGrasp)
@@ -926,7 +928,7 @@ int gmx_editconf(int argc, char *argv[])
         else
         {
             ssize  = atoms.nr;
-            sindex = NULL;
+            sindex = nullptr;
         }
         diam = calc_geom(ssize, sindex, x, gc, rmin, rmax, bCalcDiam);
         rvec_sub(rmax, rmin, size);
@@ -964,7 +966,7 @@ int gmx_editconf(int argc, char *argv[])
         get_index(&atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &isize, &index, &grpnames);
 
         /* Orient the principal axes along the coordinate axes */
-        orient_princ(&atoms, isize, index, natom, x, bHaveV ? v : NULL, NULL);
+        orient_princ(&atoms, isize, index, natom, x, bHaveV ? v : nullptr, nullptr);
         sfree(index);
         sfree(grpnames);
     }
@@ -1057,7 +1059,7 @@ int gmx_editconf(int argc, char *argv[])
         else
         {
             ssize  = atoms.nr;
-            sindex = NULL;
+            sindex = nullptr;
         }
         printf("Translating %d atoms (out of %d) by %g %g %g nm\n", ssize, natom,
                translation[XX], translation[YY], translation[ZZ]);
@@ -1099,7 +1101,7 @@ int gmx_editconf(int argc, char *argv[])
         }
     }
 
-    if ((btype[0] != NULL) && (bSetSize || bDist || (btype[0][0] == 't' && bSetAng)))
+    if ((btype[0] != nullptr) && (bSetSize || bDist || (btype[0][0] == 't' && bSetAng)))
     {
         ePBC = epbcXYZ;
         if (!(bSetSize || bDist))
@@ -1233,7 +1235,7 @@ int gmx_editconf(int argc, char *argv[])
     }
     else
     {
-        conect = NULL;
+        conect = nullptr;
     }
 
     if (bIndex)
@@ -1268,14 +1270,14 @@ int gmx_editconf(int argc, char *argv[])
         }
         else
         {
-            write_sto_conf_indexed(outfile, *top_tmp->name, &atoms, x, bHaveV ? v : NULL, ePBC, box, isize, index);
+            write_sto_conf_indexed(outfile, *top_tmp->name, &atoms, x, bHaveV ? v : nullptr, ePBC, box, isize, index);
         }
     }
     else
     {
         if (resnr_start >= 0)
         {
-            renum_resnr(&atoms, atoms.nr, NULL, resnr_start);
+            renum_resnr(&atoms, atoms.nr, nullptr, resnr_start);
         }
 
         if ((outftp == efPDB) || (outftp == efPQR))
@@ -1323,12 +1325,12 @@ int gmx_editconf(int argc, char *argv[])
         }
         else
         {
-            write_sto_conf(outfile, *top_tmp->name, &atoms, x, bHaveV ? v : NULL, ePBC, box);
+            write_sto_conf(outfile, *top_tmp->name, &atoms, x, bHaveV ? v : nullptr, ePBC, box);
         }
     }
     gmx_atomprop_destroy(aps);
 
-    do_view(oenv, outfile, NULL);
+    do_view(oenv, outfile, nullptr);
 
     return 0;
 }
index 5c27bcb1c7b38cd47880e7d83ea925240157594f..6d47833172f5b9218bb56cec16555011baf77894 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,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.
@@ -70,7 +70,7 @@ static int *select_it(int nre, gmx_enxnm_t *nm, int *nset)
     int      *set;
     gmx_bool  bVerbose = TRUE;
 
-    if ((getenv("GMX_ENER_VERBOSE")) != NULL)
+    if ((getenv("GMX_ENER_VERBOSE")) != nullptr)
     {
         bVerbose = FALSE;
     }
@@ -163,7 +163,7 @@ static int scan_ene_files(char **fnms, int nfiles,
     for (f = 0; f < nfiles; f++)
     {
         in  = open_enx(fnms[f], "r");
-        enm = NULL;
+        enm = nullptr;
         do_enxnms(in, &nre, &enm);
 
         if (f == 0)
@@ -191,7 +191,7 @@ static int scan_ene_files(char **fnms, int nfiles,
                 fprintf(stderr,
                         "\nContinue conversion using only the first %d terms (n/y)?\n"
                         "(you should be sure that the energy terms match)\n", nremin);
-                if (NULL == fgets(inputstring, STRLEN-1, stdin))
+                if (nullptr == fgets(inputstring, STRLEN-1, stdin))
                 {
                     gmx_fatal(FARGS, "Error reading user input");
                 }
@@ -252,7 +252,7 @@ static void edit_files(char **fnms, int nfiles, real *readtime,
             ok = FALSE;
             do
             {
-                if (NULL == fgets(inputstring, STRLEN-1, stdin))
+                if (nullptr == fgets(inputstring, STRLEN-1, stdin))
                 {
                     gmx_fatal(FARGS, "Error reading user input");
                 }
@@ -444,8 +444,8 @@ int gmx_eneconv(int argc, char *argv[])
     const char       *bugs[] = {
         "When combining trajectories the sigma and E^2 (necessary for statistics) are not updated correctly. Only the actual energy is correct. One thus has to compute statistics in another way."
     };
-    ener_file_t       in  = NULL, out = NULL;
-    gmx_enxnm_t      *enm = NULL;
+    ener_file_t       in  = nullptr, out = nullptr;
+    gmx_enxnm_t      *enm = nullptr;
 #if 0
     ener_file_t       in, out = NULL;
     gmx_enxnm_t      *enm = NULL;
@@ -455,7 +455,7 @@ int gmx_eneconv(int argc, char *argv[])
     t_energy         *ee_sum;
     gmx_int64_t       lastfilestep, laststep, startstep_file = 0;
     int               noutfr;
-    int               nre, nremax, this_nre, nfile, f, i, kkk, nset, *set = NULL;
+    int               nre, nremax, this_nre, nfile, f, i, kkk, nset, *set = nullptr;
     double            last_t;
     char            **fnms;
     real             *readtime, *settime, timestep, tadjust;
@@ -464,12 +464,12 @@ int gmx_eneconv(int argc, char *argv[])
     gmx_bool          bNewFile, bFirst, bNewOutput;
     gmx_output_env_t *oenv;
     gmx_bool          warned_about_dh = FALSE;
-    t_enxblock       *blocks          = NULL;
+    t_enxblock       *blocks          = nullptr;
     int               nblocks         = 0;
     int               nblocks_alloc   = 0;
 
     t_filenm          fnm[] = {
-        { efEDR, "-f", NULL,    ffRDMULT },
+        { efEDR, "-f", nullptr,    ffRDMULT },
         { efEDR, "-o", "fixed", ffWRITE  },
     };
 
@@ -549,7 +549,7 @@ int gmx_eneconv(int argc, char *argv[])
         bNewFile   = TRUE;
         bNewOutput = TRUE;
         in         = open_enx(fnms[f], "r");
-        enm        = NULL;
+        enm        = nullptr;
         do_enxnms(in, &this_nre, &enm);
         if (f == 0)
         {
index 6c10e09aa2c024a86186c3c5c7bbf7aa3ff9ce9f..23fd17953a70fe842a0f3edec324ce68de2624a4 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,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.
@@ -150,29 +150,29 @@ int gmx_enemat(int argc, char *argv[])
     ener_file_t       in;
     FILE             *out;
     int               timecheck = 0;
-    gmx_enxnm_t      *enm       = NULL;
+    gmx_enxnm_t      *enm       = nullptr;
     t_enxframe       *fr;
     int               teller = 0;
     real              sum;
     gmx_bool          bCont, bRef;
     gmx_bool          bCutmax, bCutmin;
-    real            **eneset, *time = NULL;
+    real            **eneset, *time = nullptr;
     int              *set, i, j, k, prevk, m = 0, n, nre, nset, nenergy;
-    char            **groups = NULL;
+    char            **groups = nullptr;
     char              groupname[255], fn[255];
     int               ngroups;
     t_rgb             rlo, rhi, rmid;
     real              emax, emid, emin;
     real           ***emat, **etot, *groupnr;
-    double            beta, expE, **e, *eaver, *efree = NULL, edum;
+    double            beta, expE, **e, *eaver, *efree = nullptr, edum;
     char              label[234];
-    char            **ereflines, **erefres = NULL;
-    real             *eref  = NULL, *edif = NULL;
+    char            **ereflines, **erefres = nullptr;
+    real             *eref  = nullptr, *edif = nullptr;
     int               neref = 0;
     gmx_output_env_t *oenv;
 
     t_filenm          fnm[] = {
-        { efEDR, "-f", NULL, ffOPTRD },
+        { efEDR, "-f", nullptr, ffOPTRD },
         { efDAT, "-groups", "groups", ffREAD },
         { efDAT, "-eref",   "eref",   ffOPTRD },
         { efXPM, "-emat",   "emat",   ffWRITE },
@@ -181,7 +181,7 @@ int gmx_enemat(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -511,7 +511,7 @@ int gmx_enemat(int argc, char *argv[])
 
         out = xvgropen(ftp2fn(efXVG, NFILE, fnm), "Mean Energy", "Residue", "kJ/mol",
                        oenv);
-        xvgr_legend(out, 0, NULL, oenv);
+        xvgr_legend(out, 0, nullptr, oenv);
         j = 0;
         if (output_env_get_print_xvgr_codes(oenv))
         {
index 97d2be8a7176f0ca13c5bce484f28970689b4f3e..7c9f28e0e1577a100f5ea5e479e93950f60aecb0 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,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.
@@ -59,6 +59,7 @@
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/topology/ifunc.h"
+#include "gromacs/topology/mtop_lookup.h"
 #include "gromacs/topology/mtop_util.h"
 #include "gromacs/topology/topology.h"
 #include "gromacs/utility/arraysize.h"
@@ -67,6 +68,7 @@
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/pleasecite.h"
 #include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/strconvert.h"
 
 static real       minthird = -1.0/3.0, minsixth = -1.0/6.0;
 static const int  NOTSET   = -23451;
@@ -97,6 +99,19 @@ typedef struct {
     gmx_bool         bHaveSums;
 } enerdata_t;
 
+static void done_enerdata_t(int nset, enerdata_t *edat)
+{
+    sfree(edat->step);
+    sfree(edat->steps);
+    sfree(edat->points);
+    for (int i = 0; i < nset; i++)
+    {
+        sfree(edat->s[i].ener);
+        sfree(edat->s[i].es);
+    }
+    sfree(edat->s);
+}
+
 static double mypow(double x, double y)
 {
     if (x > 0)
@@ -109,6 +124,24 @@ static double mypow(double x, double y)
     }
 }
 
+static real blk_value(t_enxblock *blk, int sub, int index)
+{
+    range_check(index, 0, blk->sub[sub].nr);
+    if (blk->sub[sub].type == xdr_datatype_float)
+    {
+        return blk->sub[sub].fval[index];
+    }
+    else if (blk->sub[sub].type == xdr_datatype_double)
+    {
+        return blk->sub[sub].dval[index];
+    }
+    else
+    {
+        gmx_incons("Unknown datatype in t_enxblock");
+    }
+    return 0.0;
+}
+
 static int *select_it(int nre, char *nm[], int *nset)
 {
     gmx_bool *bE;
@@ -116,7 +149,7 @@ static int *select_it(int nre, char *nm[], int *nset)
     int      *set;
     gmx_bool  bVerbose = TRUE;
 
-    if ((getenv("GMX_ENER_VERBOSE")) != NULL)
+    if ((getenv("GMX_ENER_VERBOSE")) != nullptr)
     {
         bVerbose = FALSE;
     }
@@ -184,9 +217,9 @@ static int *select_by_name(int nre, gmx_enxnm_t *nm, int *nset)
     char       *ptr, buf[STRLEN];
     const char *fm4   = "%3d  %-14s";
     const char *fm2   = "%3d  %-34s";
-    char      **newnm = NULL;
+    char      **newnm = nullptr;
 
-    if ((getenv("GMX_ENER_VERBOSE")) != NULL)
+    if ((getenv("GMX_ENER_VERBOSE")) != nullptr)
     {
         bVerbose = FALSE;
     }
@@ -203,7 +236,7 @@ static int *select_by_name(int nre, gmx_enxnm_t *nm, int *nset)
     {
         newnm[k] = gmx_strdup(nm[k].name);
         /* Insert dashes in all the names */
-        while ((ptr = std::strchr(newnm[k], ' ')) != NULL)
+        while ((ptr = std::strchr(newnm[k], ' ')) != nullptr)
         {
             *ptr = '-';
         }
@@ -323,7 +356,7 @@ static int *select_by_name(int nre, gmx_enxnm_t *nm, int *nset)
                     }
                 }
                 /* Look for the first space, and remove spaces from there */
-                if ((ptr = std::strchr(ptr, ' ')) != NULL)
+                if ((ptr = std::strchr(ptr, ' ')) != nullptr)
                 {
                     trim(ptr);
                 }
@@ -364,29 +397,29 @@ static void get_dhdl_parms(const char *topnm, t_inputrec *ir)
     matrix      box;
 
     /* all we need is the ir to be able to write the label */
-    read_tpx(topnm, ir, box, &natoms, NULL, NULL, &mtop);
+    read_tpx(topnm, ir, box, &natoms, nullptr, nullptr, &mtop);
+    done_mtop(&mtop);
 }
 
-static void get_orires_parms(const char *topnm,
+static void get_orires_parms(const char *topnm, t_inputrec *ir,
                              int *nor, int *nex, int **label, real **obs)
 {
     gmx_mtop_t      mtop;
-    gmx_localtop_t *top;
-    t_inputrec      ir;
+    t_topology      top;
     t_iparams      *ip;
     int             natoms, i;
     t_iatom        *iatom;
     int             nb;
     matrix          box;
 
-    read_tpx(topnm, &ir, box, &natoms, NULL, NULL, &mtop);
-    top = gmx_mtop_generate_local_top(&mtop, ir.efep != efepNO);
+    read_tpx(topnm, ir, box, &natoms, nullptr, nullptr, &mtop);
+    top = gmx_mtop_t_to_t_topology(&mtop, FALSE);
 
-    ip       = top->idef.iparams;
-    iatom    = top->idef.il[F_ORIRES].iatoms;
+    ip       = top.idef.iparams;
+    iatom    = top.idef.il[F_ORIRES].iatoms;
 
     /* Count how many distance restraint there are... */
-    nb = top->idef.il[F_ORIRES].nr;
+    nb = top.idef.il[F_ORIRES].nr;
     if (nb == 0)
     {
         gmx_fatal(FARGS, "No orientation restraints in topology!\n");
@@ -407,6 +440,7 @@ static void get_orires_parms(const char *topnm,
     }
     fprintf(stderr, "Found %d orientation restraints with %d experiments",
             *nor, *nex);
+    done_top_mtop(&top, &mtop);
 }
 
 static int get_bounds(const char *topnm,
@@ -424,7 +458,7 @@ static int get_bounds(const char *topnm,
     int             nb, label1;
     matrix          box;
 
-    read_tpx(topnm, ir, box, &natoms, NULL, NULL, mtop);
+    read_tpx(topnm, ir, box, &natoms, nullptr, nullptr, mtop);
     snew(*ltop, 1);
     top   = gmx_mtop_generate_local_top(mtop, ir->efep != efepNO);
     *ltop = top;
@@ -534,7 +568,7 @@ static void analyse_disre(const char *voutfn,    int nframes,
 
     /* Subtract bounds from distances, to calculate violations */
     calc_violations(violaver, violaver,
-                    nbounds, pair, bounds, NULL, &sumt, &sumaver);
+                    nbounds, pair, bounds, nullptr, &sumt, &sumaver);
 
 #ifdef DEBUG
     fprintf(stdout, "\nSum of violations averaged over simulation: %g nm\n",
@@ -920,24 +954,17 @@ static enerdata_t *calc_sum(int nset, enerdata_t *edat, int nbmin, int nbmax)
     return esum;
 }
 
-static char *ee_pr(double ee, char *buf)
+static void ee_pr(double ee, int buflen, char *buf)
 {
-    char   tmp[100];
-    double rnd;
-
-    if (ee < 0)
-    {
-        sprintf(buf, "%s", "--");
-    }
-    else
+    snprintf(buf, buflen, "%s", "--");
+    if (ee >= 0)
     {
         /* Round to two decimals by printing. */
-        sprintf(tmp, "%.1e", ee);
-        sscanf(tmp, "%lf", &rnd);
-        sprintf(buf, "%g", rnd);
+        char   tmp[100];
+        snprintf(tmp, sizeof(tmp), "%.1e", ee);
+        double rnd = gmx::doubleFromString(tmp);
+        snprintf(buf, buflen, "%g", rnd);
     }
-
-    return buf;
 }
 
 static void remove_drift(int nset, int nbmin, int nbmax, real dt, enerdata_t *edat)
@@ -956,7 +983,7 @@ static void remove_drift(int nset, int nbmin, int nbmax, real dt, enerdata_t *ed
         {
             delta = edat->s[i].slope*dt;
 
-            if (NULL != debug)
+            if (nullptr != debug)
             {
                 fprintf(debug, "slope for set %d is %g\n", i, edat->s[i].slope);
             }
@@ -1076,7 +1103,7 @@ static void calc_fluctuation_props(FILE *fp,
         fprintf(fp, "WARNING: Please verify that your simulations are converged and perform\n"
                 "a block-averaging error analysis (not implemented in g_energy yet)\n");
 
-        if (debug != NULL)
+        if (debug != nullptr)
         {
             if (varv != NOTSET)
             {
@@ -1129,6 +1156,7 @@ static void calc_fluctuation_props(FILE *fp,
 }
 
 static void analyse_ener(gmx_bool bCorr, const char *corrfn,
+                         const char *eviscofn, const char *eviscoifn,
                          gmx_bool bFee, gmx_bool bSum, gmx_bool bFluct,
                          gmx_bool bVisco, const char *visfn, int nmol,
                          gmx_int64_t start_step, double start_t,
@@ -1144,10 +1172,10 @@ static void analyse_ener(gmx_bool bCorr, const char *corrfn,
     FILE           *fp;
     /* Check out the printed manual for equations! */
     double          Dt, aver, stddev, errest, delta_t, totaldrift;
-    enerdata_t     *esum = NULL;
+    enerdata_t     *esum = nullptr;
     real            integral, intBulk, Temp = 0, Pres = 0;
     real            pr_aver, pr_stddev, pr_errest;
-    double          beta = 0, expE, expEtot, *fee = NULL;
+    double          beta = 0, expE, expEtot, *fee = nullptr;
     gmx_int64_t     nsteps;
     int             nexact, nnotexact;
     int             i, j, nout;
@@ -1262,15 +1290,15 @@ static void analyse_ener(gmx_bool bCorr, const char *corrfn,
 
                 fee[i] = std::log(expE/edat->nframes)/beta + aver/nmol;
             }
-            if (std::strstr(leg[i], "empera") != NULL)
+            if (std::strstr(leg[i], "empera") != nullptr)
             {
                 Temp = aver;
             }
-            else if (std::strstr(leg[i], "olum") != NULL)
+            else if (std::strstr(leg[i], "olum") != nullptr)
             {
                 Vaver = aver;
             }
-            else if (std::strstr(leg[i], "essure") != NULL)
+            else if (std::strstr(leg[i], "essure") != nullptr)
             {
                 Pres = aver;
             }
@@ -1294,8 +1322,9 @@ static void analyse_ener(gmx_bool bCorr, const char *corrfn,
                 totaldrift /= nmol;
             }
 
+            ee_pr(pr_errest, sizeof(eebuf), eebuf);
             fprintf(stdout, "%-24s %10g %10s %10g %10g",
-                    leg[i], pr_aver, ee_pr(pr_errest, eebuf), pr_stddev, totaldrift);
+                    leg[i], pr_aver, eebuf, pr_stddev, totaldrift);
             if (bFee)
             {
                 fprintf(stdout, "  %10g", fee[i]);
@@ -1314,8 +1343,9 @@ static void analyse_ener(gmx_bool bCorr, const char *corrfn,
         if (bSum)
         {
             totaldrift = (edat->nsteps - 1)*esum->s[0].slope;
+            ee_pr(esum->s[0].ee/nmol, sizeof(eebuf), eebuf);
             fprintf(stdout, "%-24s %10g %10s %10s %10g  (%s)",
-                    "Total", esum->s[0].av/nmol, ee_pr(esum->s[0].ee/nmol, eebuf),
+                    "Total", esum->s[0].av/nmol, eebuf,
                     "--", totaldrift/nmol, enm[set[0]].unit);
             /* pr_aver,pr_stddev,a,totaldrift */
             if (bFee)
@@ -1383,7 +1413,7 @@ static void analyse_ener(gmx_bool bCorr, const char *corrfn,
                 eneint[2][i+1] = eneint[2][i] + 0.5*(edat->s[5].es[i].sum + edat->s[7].es[i].sum)*Dt/edat->points[i];
             }
 
-            einstein_visco("evisco.xvg", "eviscoi.xvg",
+            einstein_visco(eviscofn, eviscoifn,
                            3, edat->nframes+1, eneint, Vaver, Temp, Dt, oenv);
 
             for (i = 0; i < 3; i++)
@@ -1485,13 +1515,13 @@ static void fec(const char *ene2fn, const char *runavgfn,
     real         aver, beta;
     real       **eneset2;
     double       dE, sum;
-    gmx_enxnm_t *enm = NULL;
+    gmx_enxnm_t *enm = nullptr;
     t_enxframe  *fr;
     char         buf[22];
 
     /* read second energy file */
     snew(fr, 1);
-    enm = NULL;
+    enm = nullptr;
     enx = open_enx(ene2fn, "r");
     do_enxnms(enx, &(fr->nre), &enm);
 
@@ -1529,7 +1559,7 @@ static void fec(const char *ene2fn, const char *runavgfn,
                         srenew(eneset2[i], maxenergy);
                     }
                 }
-                GMX_RELEASE_ASSERT(time != NULL, "trying to dereference NULL time pointer");
+                GMX_RELEASE_ASSERT(time != nullptr, "trying to dereference NULL time pointer");
 
                 if (fr->t != time[nenergy2])
                 {
@@ -1555,7 +1585,7 @@ static void fec(const char *ene2fn, const char *runavgfn,
     nenergy = std::min(edat->nframes, nenergy2);
 
     /* calculate fe difference dF = -kT ln < exp(-(E_B-E_A)/kT) >_A */
-    fp = NULL;
+    fp = nullptr;
     if (runavgfn)
     {
         fp = xvgropen(runavgfn, "Running average free energy difference",
@@ -1607,8 +1637,8 @@ static void do_dhdl(t_enxframe *fr, const t_inputrec *ir, FILE **fp_dhdl,
     /* coll data */
     double       temp              = 0, start_time = 0, delta_time = 0, start_lambda = 0;
     static int   setnr             = 0;
-    double      *native_lambda_vec = NULL;
-    const char **lambda_components = NULL;
+    double      *native_lambda_vec = nullptr;
+    const char **lambda_components = nullptr;
     int          n_lambda_vec      = 0;
     bool         firstPass         = true;
 
@@ -1664,7 +1694,9 @@ static void do_dhdl(t_enxframe *fr, const t_inputrec *ir, FILE **fp_dhdl,
             }
         }
     }
-
+    // Clean up!
+    sfree(native_lambda_vec);
+    sfree(lambda_components);
     if (nblock_hist == 0 && nblock_dh == 0)
     {
         /* don't do anything */
@@ -1986,48 +2018,46 @@ int gmx_energy(int argc, char *argv[])
         "Volume",  "Pressure"
     };
 
-    FILE              *out     = NULL, *fp_pairs = NULL, *fort = NULL, *fodt = NULL, *foten = NULL;
-    FILE              *fp_dhdl = NULL;
+    FILE              *out     = nullptr, *fp_pairs = nullptr, *fort = nullptr, *fodt = nullptr, *foten = nullptr;
+    FILE              *fp_dhdl = nullptr;
     ener_file_t        fp;
     int                timecheck = 0;
     gmx_mtop_t         mtop;
-    gmx_localtop_t    *top = NULL;
-    t_inputrec         ir;
+    gmx_localtop_t    *top = nullptr;
     enerdata_t         edat;
-    gmx_enxnm_t       *enm = NULL;
-    t_enxframe        *frame, *fr = NULL;
+    gmx_enxnm_t       *enm = nullptr;
+    t_enxframe        *frame, *fr = nullptr;
     int                cur = 0;
 #define NEXT (1-cur)
     int                nre, teller, teller_disre, nfr;
     gmx_int64_t        start_step;
     int                nor = 0, nex = 0, norfr = 0, enx_i = 0;
     real               start_t;
-    real              *bounds  = NULL, *violaver = NULL, *oobs = NULL, *orient = NULL, *odrms = NULL;
-    int               *index   = NULL, *pair = NULL, norsel = 0, *orsel = NULL, *or_label = NULL;
+    real              *bounds  = nullptr, *violaver = nullptr, *oobs = nullptr, *orient = nullptr, *odrms = nullptr;
+    int               *index   = nullptr, *pair = nullptr, norsel = 0, *orsel = nullptr, *or_label = nullptr;
     int                nbounds = 0, npairs;
     gmx_bool           bDisRe, bDRAll, bORA, bORT, bODA, bODR, bODT, bORIRE, bOTEN, bDHDL;
     gmx_bool           bFoundStart, bCont, bVisco;
     double             sum, sumaver, sumt, dbl;
-    double            *time = NULL;
+    double            *time = nullptr;
     real               Vaver;
-    int               *set     = NULL, i, j, k, nset, sss;
-    gmx_bool          *bIsEner = NULL;
+    int               *set     = nullptr, i, j, k, nset, sss;
+    gmx_bool          *bIsEner = nullptr;
     char             **pairleg, **odtleg, **otenleg;
-    char             **leg = NULL;
-    char              *anm_j, *anm_k, *resnm_j, *resnm_k;
+    char             **leg = nullptr;
+    const char        *anm_j, *anm_k, *resnm_j, *resnm_k;
     int                resnr_j, resnr_k;
     const char        *orinst_sub = "@ subtitle \"instantaneous\"\n";
     char               buf[256];
     gmx_output_env_t  *oenv;
-    t_enxblock        *blk       = NULL;
-    t_enxblock        *blk_disre = NULL;
+    t_enxblock        *blk_disre = nullptr;
     int                ndisre    = 0;
     int                dh_blocks = 0, dh_hists = 0, dh_samples = 0, dh_lambdas = 0;
 
     t_filenm           fnm[] = {
-        { efEDR, "-f",    NULL,      ffREAD  },
-        { efEDR, "-f2",   NULL,      ffOPTRD },
-        { efTPR, "-s",    NULL,      ffOPTRD },
+        { efEDR, "-f",    nullptr,      ffREAD  },
+        { efEDR, "-f2",   nullptr,      ffOPTRD },
+        { efTPR, "-s",    nullptr,      ffOPTRD },
         { efXVG, "-o",    "energy",  ffWRITE },
         { efXVG, "-viol", "violaver", ffOPTWR },
         { efXVG, "-pairs", "pairs",   ffOPTWR },
@@ -2039,6 +2069,8 @@ int gmx_energy(int argc, char *argv[])
         { efXVG, "-oten", "oriten",  ffOPTWR },
         { efXVG, "-corr", "enecorr", ffOPTWR },
         { efXVG, "-vis",  "visco",   ffOPTWR },
+        { efXVG, "-evisco",  "evisco",  ffOPTWR },
+        { efXVG, "-eviscoi", "eviscoi", ffOPTWR },
         { efXVG, "-ravg", "runavgdf", ffOPTWR },
         { efXVG, "-odh",  "dhdl", ffOPTWR }
     };
@@ -2050,8 +2082,9 @@ int gmx_energy(int argc, char *argv[])
     ppa    = add_acf_pargs(&npargs, pa);
     if (!parse_common_args(&argc, argv,
                            PCA_CAN_VIEW | PCA_CAN_BEGIN | PCA_CAN_END,
-                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, nullptr, &oenv))
     {
+        sfree(ppa);
         return 0;
     }
 
@@ -2076,6 +2109,9 @@ int gmx_energy(int argc, char *argv[])
 
     bVisco = opt2bSet("-vis", NFILE, fnm);
 
+    t_inputrec  irInstance;
+    t_inputrec *ir = &irInstance;
+
     if ((!bDisRe) && (!bDHDL))
     {
         if (bVisco)
@@ -2162,17 +2198,17 @@ int gmx_energy(int argc, char *argv[])
                     (gmx_strcasecmp(interaction_function[j].longname, leg[i]) == 0);
             }
         }
-
         if (bPrAll && nset > 1)
         {
             gmx_fatal(FARGS, "Printing averages can only be done when a single set is selected");
         }
 
-        time = NULL;
+        time = nullptr;
 
         if (bORIRE || bOTEN)
         {
-            get_orires_parms(ftp2fn(efTPR, NFILE, fnm), &nor, &nex, &or_label, &oobs);
+            get_orires_parms(ftp2fn(efTPR, NFILE, fnm), ir,
+                             &nor, &nex, &or_label, &oobs);
         }
 
         if (bORIRE)
@@ -2199,7 +2235,7 @@ int gmx_energy(int argc, char *argv[])
                 fprintf(stderr, "Select the orientation restraint labels you want (-1 is all)\n");
                 fprintf(stderr, "End your selection with 0\n");
                 j     = -1;
-                orsel = NULL;
+                orsel = nullptr;
                 do
                 {
                     j++;
@@ -2269,6 +2305,11 @@ int gmx_energy(int argc, char *argv[])
                     }
                     xvgr_legend(fodt, norsel, (const char**)odtleg, oenv);
                 }
+                for (i = 0; i < norsel; i++)
+                {
+                    sfree(odtleg[i]);
+                }
+                sfree(odtleg);
             }
         }
         if (bOTEN)
@@ -2293,12 +2334,17 @@ int gmx_energy(int argc, char *argv[])
                 }
             }
             xvgr_legend(foten, bOvec ? nex*12 : nex*3, (const char**)otenleg, oenv);
+            for (j = 0; j < 3; j++)
+            {
+                sfree(otenleg[j]);
+            }
+            sfree(otenleg);
         }
     }
     else if (bDisRe)
     {
         nbounds = get_bounds(ftp2fn(efTPR, NFILE, fnm), &bounds, &index, &pair, &npairs,
-                             &mtop, &top, &ir);
+                             &mtop, &top, ir);
         snew(violaver, npairs);
         out = xvgropen(opt2fn("-o", NFILE, fnm), "Sum of Violations",
                        "Time (ps)", "nm", oenv);
@@ -2310,22 +2356,22 @@ int gmx_energy(int argc, char *argv[])
             if (output_env_get_print_xvgr_codes(oenv))
             {
                 fprintf(fp_pairs, "@ subtitle \"averaged (tau=%g) and instantaneous\"\n",
-                        ir.dr_tau);
+                        ir->dr_tau);
             }
         }
     }
     else if (bDHDL)
     {
-        get_dhdl_parms(ftp2fn(efTPR, NFILE, fnm), &ir);
+        get_dhdl_parms(ftp2fn(efTPR, NFILE, fnm), ir);
     }
 
     /* Initiate energies and set them to zero */
     edat.nsteps    = 0;
     edat.npoints   = 0;
     edat.nframes   = 0;
-    edat.step      = NULL;
-    edat.steps     = NULL;
-    edat.points    = NULL;
+    edat.step      = nullptr;
+    edat.steps     = nullptr;
+    edat.points    = nullptr;
     edat.bHaveSums = TRUE;
     snew(edat.s, nset);
 
@@ -2451,7 +2497,7 @@ int gmx_energy(int argc, char *argv[])
              * Define distance restraint legends. Can only be done after
              * the first frame has been read... (Then we know how many there are)
              */
-            blk_disre = find_block_id_enxframe(fr, enxDISRE, NULL);
+            blk_disre = find_block_id_enxframe(fr, enxDISRE, nullptr);
             if (bDisRe && bDRAll && !leg && blk_disre)
             {
                 t_iatom   *fa;
@@ -2472,13 +2518,14 @@ int gmx_energy(int argc, char *argv[])
                               ndisre, top->idef.il[F_DISRES].nr/3);
                 }
                 snew(pairleg, ndisre);
+                int molb = 0;
                 for (i = 0; i < ndisre; i++)
                 {
                     snew(pairleg[i], 30);
                     j = fa[3*i+1];
                     k = fa[3*i+2];
-                    gmx_mtop_atominfo_global(&mtop, j, &anm_j, &resnr_j, &resnm_j);
-                    gmx_mtop_atominfo_global(&mtop, k, &anm_k, &resnr_k, &resnm_k);
+                    mtopGetAtomAndResidueName(&mtop, j, &molb, &anm_j, &resnr_j, &resnm_j, nullptr);
+                    mtopGetAtomAndResidueName(&mtop, k, &molb, &anm_k, &resnr_k, &resnm_k, nullptr);
                     sprintf(pairleg[i], "%d %s %d %s (%d)",
                             resnr_j, anm_j, resnr_k, anm_k,
                             ip[fa[3*i]].disres.label);
@@ -2519,7 +2566,7 @@ int gmx_energy(int argc, char *argv[])
                      *******************************************/
                     if (ndisre > 0)
                     {
-                        GMX_RELEASE_ASSERT(blk_disre != NULL, "Trying to dereference NULL blk_disre pointer");
+                        GMX_RELEASE_ASSERT(blk_disre != nullptr, "Trying to dereference NULL blk_disre pointer");
  #if !GMX_DOUBLE
                         float  *disre_rt     =     blk_disre->sub[0].fval;
                         float  *disre_rm3tav = blk_disre->sub[1].fval;
@@ -2529,7 +2576,7 @@ int gmx_energy(int argc, char *argv[])
  #endif
 
                         print_time(out, fr->t);
-                        if (violaver == NULL)
+                        if (violaver == nullptr)
                         {
                             snew(violaver, ndisre);
                         }
@@ -2555,7 +2602,7 @@ int gmx_energy(int argc, char *argv[])
                 }
                 else 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);
                 }
 
                 /*******************************************
@@ -2608,25 +2655,13 @@ int gmx_energy(int argc, char *argv[])
                             fprintf(out, "\n");
                         }
                     }
-                    blk = find_block_id_enxframe(fr, enx_i, NULL);
+                    t_enxblock *blk = find_block_id_enxframe(fr, enx_i, nullptr);
                     if (bORIRE && blk)
                     {
-#if !GMX_DOUBLE
-                        xdr_datatype dt = xdr_datatype_float;
-#else
-                        xdr_datatype dt = xdr_datatype_double;
-#endif
-                        real        *vals;
-
-                        if ( (blk->nsub != 1) || (blk->sub[0].type != dt) )
+                        if (blk->nsub != 1)
                         {
-                            gmx_fatal(FARGS, "Orientational restraints read in incorrectly");
+                            gmx_fatal(FARGS, "Orientational restraints read in incorrectly.");
                         }
-#if !GMX_DOUBLE
-                        vals = blk->sub[0].fval;
-#else
-                        vals = blk->sub[0].dval;
-#endif
 
                         if (blk->sub[0].nr != nor)
                         {
@@ -2636,14 +2671,15 @@ int gmx_energy(int argc, char *argv[])
                         {
                             for (i = 0; i < nor; i++)
                             {
-                                orient[i] += vals[i];
+                                orient[i] += blk_value(blk, 0, i);
                             }
                         }
                         if (bODR)
                         {
                             for (i = 0; i < nor; i++)
                             {
-                                odrms[i] += gmx::square(vals[i]-oobs[i]);
+                                real v = blk_value(blk, 0, i);
+                                odrms[i] += gmx::square(v - oobs[i]);
                             }
                         }
                         if (bORT)
@@ -2651,7 +2687,7 @@ int gmx_energy(int argc, char *argv[])
                             fprintf(fort, "  %10f", fr->t);
                             for (i = 0; i < norsel; i++)
                             {
-                                fprintf(fort, " %g", vals[orsel[i]]);
+                                fprintf(fort, " %g", blk_value(blk, 0, orsel[i]));
                             }
                             fprintf(fort, "\n");
                         }
@@ -2660,31 +2696,19 @@ int gmx_energy(int argc, char *argv[])
                             fprintf(fodt, "  %10f", fr->t);
                             for (i = 0; i < norsel; i++)
                             {
-                                fprintf(fodt, " %g", vals[orsel[i]]-oobs[orsel[i]]);
+                                fprintf(fodt, " %g", blk_value(blk, 0, orsel[i])-oobs[orsel[i]]);
                             }
                             fprintf(fodt, "\n");
                         }
                         norfr++;
                     }
-                    blk = find_block_id_enxframe(fr, enxORT, NULL);
+                    blk = find_block_id_enxframe(fr, enxORT, nullptr);
                     if (bOTEN && blk)
                     {
-#if !GMX_DOUBLE
-                        xdr_datatype dt = xdr_datatype_float;
-#else
-                        xdr_datatype dt = xdr_datatype_double;
-#endif
-                        real        *vals;
-
-                        if ( (blk->nsub != 1) || (blk->sub[0].type != dt) )
+                        if (blk->nsub != 1)
                         {
                             gmx_fatal(FARGS, "Orientational restraints read in incorrectly");
                         }
-#if !GMX_DOUBLE
-                        vals = blk->sub[0].fval;
-#else
-                        vals = blk->sub[0].dval;
-#endif
 
                         if (blk->sub[0].nr != nex*12)
                         {
@@ -2696,7 +2720,7 @@ int gmx_energy(int argc, char *argv[])
                         {
                             for (j = 0; j < (bOvec ? 12 : 3); j++)
                             {
-                                fprintf(foten, " %g", vals[i*12+j]);
+                                fprintf(foten, " %g", blk_value(blk, 0, i*12+j));
                             }
                         }
                         fprintf(foten, "\n");
@@ -2709,7 +2733,7 @@ int gmx_energy(int argc, char *argv[])
     while (bCont && (timecheck == 0));
 
     fprintf(stderr, "\n");
-    close_enx(fp);
+    done_ener_file(fp);
     if (out)
     {
         xvgrclose(out);
@@ -2773,6 +2797,12 @@ int gmx_energy(int argc, char *argv[])
         }
         xvgrclose(out);
     }
+    // Clean up orires variables.
+    sfree(or_label);
+    sfree(oobs);
+    sfree(orient);
+    sfree(odrms);
+    sfree(orsel);
     if (bOTEN)
     {
         xvgrclose(foten);
@@ -2811,6 +2841,7 @@ int gmx_energy(int argc, char *argv[])
     {
         double dt = (frame[cur].t-start_t)/(edat.nframes-1);
         analyse_ener(opt2bSet("-corr", NFILE, fnm), opt2fn("-corr", NFILE, fnm),
+                     opt2fn("-evisco", NFILE, fnm), opt2fn("-eviscoi", NFILE, fnm),
                      bFee, bSum, bFluct,
                      bVisco, opt2fn("-vis", NFILE, fnm),
                      nmol,
@@ -2829,7 +2860,17 @@ int gmx_energy(int argc, char *argv[])
         fec(opt2fn("-f2", NFILE, fnm), opt2fn("-ravg", NFILE, fnm),
             reftemp, nset, set, leg, &edat, time, oenv);
     }
-
+    // Clean up!
+    done_enerdata_t(nset, &edat);
+    sfree(time);
+    free_enxframe(&frame[0]);
+    free_enxframe(&frame[1]);
+    sfree(frame);
+    free_enxnms(nre, enm);
+    sfree(ppa);
+    sfree(set);
+    sfree(leg);
+    sfree(bIsEner);
     {
         const char *nxy = "-nxy";
 
@@ -2843,6 +2884,8 @@ int gmx_energy(int argc, char *argv[])
         do_view(oenv, opt2fn_null("-oten", NFILE, fnm), nxy);
         do_view(oenv, opt2fn_null("-odh", NFILE, fnm), nxy);
     }
+    output_env_done(oenv);
+    done_filenms(NFILE, fnm);
 
     return 0;
 }
index ed353329e0cba7ee39cc2e033f95387cbeb1d856..ca7d7c41fdb38e272c327bf2a2068e6aefa96234 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,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.
@@ -100,7 +100,7 @@ int gmx_filter(int argc, char *argv[])
     char             *grpname;
     int               isize;
     int              *index;
-    real             *w_rls = NULL;
+    real             *w_rls = nullptr;
     t_trxstatus      *in;
     t_trxstatus      *outl, *outh;
     int               nffr, i, fr, nat, j, d, m;
@@ -108,20 +108,20 @@ int gmx_filter(int argc, char *argv[])
     real              flen, *filt, sum, *t;
     rvec              xcmtop, xcm, **x, *ptr, *xf, *xn, *xp, hbox;
     gmx_output_env_t *oenv;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
 
 #define NLEG asize(leg)
     t_filenm fnm[] = {
-        { efTRX, "-f", NULL, ffREAD  },
-        { efTPS, NULL, NULL, ffOPTRD },
-        { efNDX, NULL, NULL, ffOPTRD },
+        { efTRX, "-f", nullptr, ffREAD  },
+        { efTPS, nullptr, nullptr, ffOPTRD },
+        { efNDX, nullptr, nullptr, ffOPTRD },
         { efTRO, "-ol", "lowpass",  ffOPTWR },
         { efTRO, "-oh", "highpass", ffOPTWR }
     };
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -140,7 +140,7 @@ int gmx_filter(int argc, char *argv[])
     if (topfile)
     {
         bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC,
-                             &xtop, NULL, topbox, TRUE);
+                             &xtop, nullptr, topbox, TRUE);
         if (bTop)
         {
             gpbc = gmx_rmpbc_init(&top.idef, ePBC, top.atoms.nr);
@@ -208,7 +208,7 @@ int gmx_filter(int argc, char *argv[])
     }
     else
     {
-        outl = 0;
+        outl = nullptr;
     }
     if (highfile)
     {
@@ -216,7 +216,7 @@ int gmx_filter(int argc, char *argv[])
     }
     else
     {
-        outh = 0;
+        outh = nullptr;
     }
 
     fr = 0;
@@ -301,8 +301,8 @@ int gmx_filter(int argc, char *argv[])
             }
             if (outl && (bLowAll || fr % nf == nf - 1))
             {
-                write_trx(outl, nat, ind, topfile ? &(top.atoms) : NULL,
-                          0, t[nf - 1], bFit ? topbox : boxf, xf, NULL, NULL);
+                write_trx(outl, nat, ind, topfile ? &(top.atoms) : nullptr,
+                          0, t[nf - 1], bFit ? topbox : boxf, xf, nullptr, nullptr);
             }
             if (outh)
             {
@@ -328,8 +328,8 @@ int gmx_filter(int argc, char *argv[])
                         boxf[j][d] = topbox[j][d] + box[nf - 1][j][d] - boxf[j][d];
                     }
                 }
-                write_trx(outh, nat, ind, topfile ? &(top.atoms) : NULL,
-                          0, t[nf - 1], bFit ? topbox : boxf, xf, NULL, NULL);
+                write_trx(outh, nat, ind, topfile ? &(top.atoms) : nullptr,
+                          0, t[nf - 1], bFit ? topbox : boxf, xf, nullptr, nullptr);
             }
         }
         /* Cycle all the pointer and the box by one */
index fb15635a25671dd9ac8844cdbffb37fc575d1264..deb93af4379bd418c254335a4470c3861a3ff4f4 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,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.
@@ -137,13 +137,13 @@ static char *aname(const char *mname)
     return str;
 }
 
-void sort_ions(int nsa, int nw, int repl[], int index[],
-               t_atoms *atoms, rvec x[],
-               const char *p_name, const char *n_name)
+static void sort_ions(int nsa, int nw, int repl[], int index[],
+                      t_atoms *atoms, rvec x[],
+                      const char *p_name, const char *n_name)
 {
     int    i, j, k, r, np, nn, starta, startr, npi, nni;
     rvec  *xt;
-    char **pptr = NULL, **nptr = NULL, **paptr = NULL, **naptr = NULL;
+    char **pptr = nullptr, **nptr = nullptr, **paptr = nullptr, **naptr = nullptr;
 
     snew(xt, atoms->nr);
 
@@ -239,7 +239,7 @@ static void update_topol(const char *topinout, int p_num, int n_num,
                          const char *p_name, const char *n_name, char *grpname)
 {
     FILE    *fpin, *fpout;
-    char     buf[STRLEN], buf2[STRLEN], *temp, **mol_line = NULL;
+    char     buf[STRLEN], buf2[STRLEN], *temp, **mol_line = nullptr;
     int      line, i, nmol_line, sol_line, nsol_last;
     gmx_bool bMolecules;
     char     temporary_filename[STRLEN];
@@ -258,7 +258,7 @@ static void update_topol(const char *topinout, int p_num, int n_num,
     {
         line++;
         std::strcpy(buf2, buf);
-        if ((temp = std::strchr(buf2, '\n')) != NULL)
+        if ((temp = std::strchr(buf2, '\n')) != nullptr)
         {
             temp[0] = '\0';
         }
@@ -266,7 +266,7 @@ static void update_topol(const char *topinout, int p_num, int n_num,
         if (buf2[0] == '[')
         {
             buf2[0] = ' ';
-            if ((temp = std::strchr(buf2, '\n')) != NULL)
+            if ((temp = std::strchr(buf2, '\n')) != nullptr)
             {
                 temp[0] = '\0';
             }
@@ -396,9 +396,9 @@ int gmx_genion(int argc, char *argv[])
     int                i, nw, nwa, nsa, nsalt, iqtot;
     gmx_output_env_t  *oenv;
     t_filenm           fnm[] = {
-        { efTPR, NULL,  NULL,      ffREAD  },
-        { efNDX, NULL,  NULL,      ffOPTRD },
-        { efSTO, "-o",  NULL,      ffWRITE },
+        { efTPR, nullptr,  nullptr,      ffREAD  },
+        { efNDX, nullptr,  nullptr,      ffOPTRD },
+        { efSTO, "-o",  nullptr,      ffWRITE },
         { efTOP, "-p",  "topol",   ffOPTRW }
     };
 #define NFILE asize(fnm)
@@ -549,9 +549,9 @@ int gmx_genion(int argc, char *argv[])
         }
 
         sfree(atoms.pdbinfo);
-        atoms.pdbinfo = NULL;
+        atoms.pdbinfo = nullptr;
     }
-    write_sto_conf(ftp2fn(efSTO, NFILE, fnm), *top.name, &atoms, x, NULL, ePBC, box);
+    write_sto_conf(ftp2fn(efSTO, NFILE, fnm), *top.name, &atoms, x, nullptr, ePBC, box);
 
     return 0;
 }
index 17641a07dda4981241c462ee720115c18c1ae218..ff988d408c6aac3407bac842b5fc2baba81719d3 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,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.
@@ -110,7 +110,7 @@ int gmx_genpr(int argc, char *argv[])
 #define npargs asize(pa)
 
     gmx_output_env_t *oenv;
-    t_atoms          *atoms = NULL;
+    t_atoms          *atoms = nullptr;
     int               i, j, k;
     FILE             *out;
     int               igrp;
@@ -120,18 +120,18 @@ int gmx_genpr(int argc, char *argv[])
     char             *gn_grp;
     matrix            box;
     gmx_bool          bFreeze;
-    rvec              dx, *x = NULL, *v = NULL;
+    rvec              dx, *x = nullptr, *v = nullptr;
 
     t_filenm          fnm[] = {
-        { efSTX, "-f",  NULL,    ffREAD },
-        { efNDX, "-n",  NULL,    ffOPTRD },
+        { efSTX, "-f",  nullptr,    ffREAD },
+        { efNDX, "-n",  nullptr,    ffOPTRD },
         { efITP, "-o",  "posre", ffWRITE },
         { efNDX, "-of", "freeze",    ffOPTWR }
     };
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, 0, NFILE, fnm, npargs, pa,
-                           asize(desc), desc, 0, NULL, &oenv))
+                           asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -141,7 +141,7 @@ int gmx_genpr(int argc, char *argv[])
     xfn     = opt2fn_null("-f", NFILE, fnm);
     nfn     = opt2fn_null("-n", NFILE, fnm);
 
-    if (( nfn == NULL ) && ( xfn == NULL))
+    if (( nfn == nullptr ) && ( xfn == nullptr))
     {
         gmx_fatal(FARGS, "no index file and no structure file supplied");
     }
@@ -156,15 +156,15 @@ int gmx_genpr(int argc, char *argv[])
     }
 
     const char *title = "";
-    if (xfn != NULL)
+    if (xfn != nullptr)
     {
         fprintf(stderr, "\nReading structure file\n");
-        t_topology *top = NULL;
+        t_topology *top = nullptr;
         snew(top, 1);
-        read_tps_conf(xfn, top, NULL, &x, &v, box, FALSE);
+        read_tps_conf(xfn, top, nullptr, &x, &v, box, FALSE);
         title = *top->name;
         atoms = &top->atoms;
-        if (atoms->pdbinfo == NULL)
+        if (atoms->pdbinfo == nullptr)
         {
             snew(atoms->pdbinfo, atoms->nr);
         }
index 23fccd29519f034cfe9cb93ebe7a2d4babb60b0b..50ec5bee3b111b20d7fb3107e45280fdb319e318 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,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.
@@ -59,8 +59,8 @@
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 
-real calc_gyro(rvec x[], int gnx, int index[], t_atom atom[], real tm,
-               rvec gvec, rvec d, gmx_bool bQ, gmx_bool bRot, gmx_bool bMOI, matrix trans)
+static real calc_gyro(rvec x[], int gnx, int index[], t_atom atom[], real tm,
+                      rvec gvec, rvec d, gmx_bool bQ, gmx_bool bRot, gmx_bool bMOI, matrix trans)
 {
     int    i, ii, m;
     real   gyro, dx2, m0, Itot;
@@ -108,16 +108,16 @@ real calc_gyro(rvec x[], int gnx, int index[], t_atom atom[], real tm,
     return std::sqrt(gyro/tm);
 }
 
-void calc_gyro_z(rvec x[], matrix box,
-                 int gnx, int index[], t_atom atom[],
-                 int nz, real time, FILE *out)
+static void calc_gyro_z(rvec x[], matrix box,
+                        int gnx, int index[], t_atom atom[],
+                        int nz, real time, FILE *out)
 {
-    static dvec   *inertia = NULL;
-    static double *tm      = NULL;
+    static dvec   *inertia = nullptr;
+    static double *tm      = nullptr;
     int            i, ii, j, zi;
     real           zf, w, sdet, e1, e2;
 
-    if (inertia == NULL)
+    if (inertia == nullptr)
     {
         snew(inertia, nz);
         snew(tm, nz);
@@ -208,7 +208,7 @@ int gmx_gyrate(int argc, char *argv[])
     rvec              xcm, gvec, gvec1;
     matrix            box, trans;
     gmx_bool          bACF;
-    real            **moi_trans = NULL;
+    real            **moi_trans = nullptr;
     int               max_moi   = 0, delta_moi = 100;
     rvec              d, d1; /* eigenvalues of inertia tensor */
     real              t, t0, tm, gyro;
@@ -217,15 +217,15 @@ int gmx_gyrate(int argc, char *argv[])
     int               j, m, gnx, nam, mol;
     int              *index;
     gmx_output_env_t *oenv;
-    gmx_rmpbc_t       gpbc   = NULL;
+    gmx_rmpbc_t       gpbc   = nullptr;
     const char       *leg[]  = { "Rg", "Rg\\sX\\N", "Rg\\sY\\N", "Rg\\sZ\\N" };
     const char       *legI[] = { "Itot", "I1", "I2", "I3" };
 #define NLEG asize(leg)
     t_filenm          fnm[] = {
-        { efTRX, "-f",   NULL,       ffREAD },
-        { efTPS, NULL,   NULL,       ffREAD },
-        { efNDX, NULL,   NULL,       ffOPTRD },
-        { efXVG, NULL,   "gyrate",   ffWRITE },
+        { efTRX, "-f",   nullptr,       ffREAD },
+        { efTPS, nullptr,   nullptr,       ffREAD },
+        { efNDX, nullptr,   nullptr,       ffOPTRD },
+        { efXVG, nullptr,   "gyrate",   ffWRITE },
         { efXVG, "-acf", "moi-acf",  ffOPTWR },
     };
 #define NFILE asize(fnm)
@@ -236,8 +236,9 @@ int gmx_gyrate(int argc, char *argv[])
     ppa    = add_acf_pargs(&npargs, pa);
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, nullptr, &oenv))
     {
+        sfree(ppa);
         return 0;
     }
     bACF = opt2bSet("-acf", NFILE, fnm);
@@ -265,7 +266,7 @@ int gmx_gyrate(int argc, char *argv[])
         printf("Will print radius normalised by charge\n");
     }
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, NULL, box, TRUE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, nullptr, box, TRUE);
     get_index(&top.atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &gnx, &index, &grpname);
 
     if (nmol > gnx || gnx % nmol != 0)
@@ -374,7 +375,7 @@ int gmx_gyrate(int argc, char *argv[])
         j++;
     }
     while (read_next_x(oenv, status, &t, x, box));
-    close_trj(status);
+    close_trx(status);
     if (nz == 0)
     {
         gmx_rmpbc_done(gpbc);
index 615245e667d1defb68071d6ebcf1ab1b8fd8ec3a..85492b7ac710d00d8c9117e538f1ba782b597805 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,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.
 /* directions.                                                              */
 /****************************************************************************/
 
-void calc_h2order(const char *fn, int index[], int ngx, rvec **slDipole,
-                  real **slOrder, real *slWidth, int *nslices,
-                  const t_topology *top, int ePBC,
-                  int axis, gmx_bool bMicel, int micel[], int nmic,
-                  const gmx_output_env_t *oenv)
+static void calc_h2order(const char *fn, int index[], int ngx, rvec **slDipole,
+                         real **slOrder, real *slWidth, int *nslices,
+                         const t_topology *top, int ePBC,
+                         int axis, gmx_bool bMicel, int micel[], int nmic,
+                         const gmx_output_env_t *oenv)
 {
     rvec *x0,            /* coordinates with pbc */
           dipole,        /* dipole moment due to one molecules */
@@ -83,7 +83,7 @@ void calc_h2order(const char *fn, int index[], int ngx, rvec **slDipole,
         i, j, teller = 0,
         slice = 0,       /* current slice number */
     *count;              /* nr. of atoms in one slice */
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
 
     if ((natoms = read_first_x(oenv, &status, fn, &t, &x0, box)) == 0)
     {
@@ -232,8 +232,8 @@ void calc_h2order(const char *fn, int index[], int ngx, rvec **slDipole,
     sfree(x0);       /* free memory used by coordinate arrays */
 }
 
-void h2order_plot(rvec dipole[], real order[], const char *afile,
-                  int nslices, real slWidth, const gmx_output_env_t *oenv)
+static void h2order_plot(rvec dipole[], real order[], const char *afile,
+                         int nslices, real slWidth, const gmx_output_env_t *oenv)
 {
     FILE       *ord;              /* xvgr files with order parameters  */
     int         slice;            /* loop index     */
@@ -287,24 +287,24 @@ int gmx_h2order(int argc, char *argv[])
     };
 
     gmx_output_env_t  *oenv;
-    real              *slOrder,             /* av. cosine, per slice      */
-                       slWidth = 0.0;       /* width of a slice           */
+    real              *slOrder,               /* av. cosine, per slice      */
+                       slWidth = 0.0;         /* width of a slice           */
     rvec              *slDipole;
-    char              *grpname,             /* groupnames                 */
+    char              *grpname,               /* groupnames                 */
     *micname;
-    int                ngx,                 /* nr. of atomsin sol group   */
-                       nmic = 0;            /* nr. of atoms in micelle    */
-    t_topology        *top;                 /* topology           */
+    int                ngx,                   /* nr. of atomsin sol group   */
+                       nmic = 0;              /* nr. of atoms in micelle    */
+    t_topology        *top;                   /* topology           */
     int                ePBC;
-    int               *index,               /* indices for solvent group  */
-    *micelle                  = NULL;
-    gmx_bool           bMicel =  FALSE;     /* think we're a micel        */
-    t_filenm           fnm[]  = {           /* files for g_order      */
-        { efTRX, "-f", NULL,  ffREAD },     /* trajectory file            */
-        { efNDX, NULL, NULL,  ffREAD },     /* index file         */
-        { efNDX, "-nm", NULL, ffOPTRD },    /* index with micelle atoms   */
-        { efTPR, NULL, NULL,  ffREAD },     /* topology file              */
-        { efXVG, "-o",  "order", ffWRITE }, /* xvgr output file       */
+    int               *index,                 /* indices for solvent group  */
+    *micelle                  = nullptr;
+    gmx_bool           bMicel =  FALSE;       /* think we're a micel        */
+    t_filenm           fnm[]  = {             /* files for g_order      */
+        { efTRX, "-f", nullptr,  ffREAD },    /* trajectory file            */
+        { efNDX, nullptr, nullptr,  ffREAD }, /* index file         */
+        { efNDX, "-nm", nullptr, ffOPTRD },   /* index with micelle atoms   */
+        { efTPR, nullptr, nullptr,  ffREAD }, /* topology file              */
+        { efXVG, "-o",  "order", ffWRITE },   /* xvgr output file       */
     };
 
 #define NFILE asize(fnm)
index 2081edd40f3469a74488cc3129e96a0173623725..b04b78898e4e9806ac19cad67be21694575433bf 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
@@ -216,13 +216,13 @@ static void mk_hbmap(t_hbdata *hb)
     for (i = 0; (i < hb->d.nrd); i++)
     {
         snew(hb->hbmap[i], hb->a.nra);
-        if (hb->hbmap[i] == NULL)
+        if (hb->hbmap[i] == nullptr)
         {
             gmx_fatal(FARGS, "Could not allocate enough memory for hbmap");
         }
         for (j = 0; (j > hb->a.nra); j++)
         {
-            hb->hbmap[i][j] = NULL;
+            hb->hbmap[i][j] = nullptr;
         }
     }
 }
@@ -267,7 +267,7 @@ static gmx_bool is_hb(unsigned int hbexist[], int frame)
 
 static void set_hb(t_hbdata *hb, int id, int ih, int ia, int frame, int ihb)
 {
-    unsigned int *ghptr = NULL;
+    unsigned int *ghptr = nullptr;
 
     if (ihb == hbHB)
     {
@@ -423,7 +423,7 @@ static void add_hbond(t_hbdata *hb, int d, int a, int h, int grpd, int grpa,
     }
     else if (grpd != hb->d.grp[id])
     {
-        gmx_fatal(FARGS, "Inconsistent donor groups, %d iso %d, atom %d",
+        gmx_fatal(FARGS, "Inconsistent donor groups, %d instead of %d, atom %d",
                   grpd, hb->d.grp[id], d+1);
     }
     if ((ia = hb->a.aptr[a]) == NOTSET)
@@ -432,7 +432,7 @@ static void add_hbond(t_hbdata *hb, int d, int a, int h, int grpd, int grpa,
     }
     else if (grpa != hb->a.grp[ia])
     {
-        gmx_fatal(FARGS, "Inconsistent acceptor groups, %d iso %d, atom %d",
+        gmx_fatal(FARGS, "Inconsistent acceptor groups, %d instead of %d, atom %d",
                   grpa, hb->a.grp[ia], a+1);
     }
 
@@ -457,7 +457,7 @@ static void add_hbond(t_hbdata *hb, int d, int a, int h, int grpd, int grpa,
             }
             else if (grpd != hb->d.grp[id])
             {
-                gmx_fatal(FARGS, "Inconsistent donor groups, %d iso %d, atom %d",
+                gmx_fatal(FARGS, "Inconsistent donor groups, %d instead of %d, atom %d",
                           grpd, hb->d.grp[id], d+1);
             }
             if ((ia = hb->a.aptr[a]) == NOTSET)
@@ -466,7 +466,7 @@ static void add_hbond(t_hbdata *hb, int d, int a, int h, int grpd, int grpa,
             }
             else if (grpa != hb->a.grp[ia])
             {
-                gmx_fatal(FARGS, "Inconsistent acceptor groups, %d iso %d, atom %d",
+                gmx_fatal(FARGS, "Inconsistent acceptor groups, %d instead of %d, atom %d",
                           grpa, hb->a.grp[ia], a+1);
             }
         }
@@ -502,7 +502,7 @@ static void add_hbond(t_hbdata *hb, int d, int a, int h, int grpd, int grpa,
             {
                 try
                 {
-                    if (hb->hbmap[id][ia] == NULL)
+                    if (hb->hbmap[id][ia] == nullptr)
                     {
                         snew(hb->hbmap[id][ia], 1);
                         snew(hb->hbmap[id][ia]->h, hb->maxhydro);
@@ -912,8 +912,8 @@ static void reset_nhbonds(t_donors *ddd)
     }
 }
 
-void pbc_correct_gem(rvec dx, matrix box, rvec hbox);
-void pbc_in_gridbox(rvec dx, matrix box);
+static void pbc_correct_gem(rvec dx, matrix box, rvec hbox);
+static void pbc_in_gridbox(rvec dx, matrix box);
 
 static void build_grid(t_hbdata *hb, rvec x[], rvec xshell,
                        gmx_bool bBox, matrix box, rvec hbox,
@@ -1183,10 +1183,10 @@ static void free_grid(ivec ngrid, t_gridcell ****grid)
         sfree(g[z]);
     }
     sfree(g);
-    g = NULL;
+    g = nullptr;
 }
 
-void pbc_correct_gem(rvec dx, matrix box, rvec hbox)
+static void pbc_correct_gem(rvec dx, matrix box, rvec hbox)
 {
     int      m;
     gmx_bool bDone = FALSE;
@@ -1209,7 +1209,7 @@ void pbc_correct_gem(rvec dx, matrix box, rvec hbox)
     }
 }
 
-void pbc_in_gridbox(rvec dx, matrix box)
+static void pbc_in_gridbox(rvec dx, matrix box)
 {
     int      m;
     gmx_bool bDone = FALSE;
@@ -1469,8 +1469,8 @@ static void merge_hb(t_hbdata *hb, gmx_bool bTwo, gmx_bool bContact)
                     }
                     sfree(hb1->h[0]);
                     sfree(hb1->g[0]);
-                    hb1->h[0]       = NULL;
-                    hb1->g[0]       = NULL;
+                    hb1->h[0]       = nullptr;
+                    hb1->g[0]       = nullptr;
                     hb1->history[0] = hbNo;
                 }
             }
@@ -1767,7 +1767,7 @@ void analyse_corr(int n, real t[], real ct[], real nt[], real kt[],
     real       k = 1, kp = 1, kow = 1;
     real       Q = 0, chi2, tau_hb, dtau, tau_rlx, e_1, sigma_k, sigma_kp, ddg;
     double     tmp, sn2 = 0, sc2 = 0, sk2 = 0, scn = 0, sck = 0, snk = 0;
-    gmx_bool   bError = (sigma_ct != NULL) && (sigma_nt != NULL) && (sigma_kt != NULL);
+    gmx_bool   bError = (sigma_ct != nullptr) && (sigma_nt != nullptr) && (sigma_kt != nullptr);
 
     for (i0 = 0; (i0 < n-2) && ((t[i0]-t[0]) < fit_start); i0++)
     {
@@ -1843,7 +1843,7 @@ void analyse_corr(int n, real t[], real ct[], real nt[], real kt[],
                    sc2, sn2, sk2, sck, snk, scn);
         }
         /* Determine integral of the correlation function */
-        tau_hb = evaluate_integral(n, t, ct, NULL, (t[n-1]-t[0])/2, &dtau);
+        tau_hb = evaluate_integral(n, t, ct, nullptr, (t[n-1]-t[0])/2, &dtau);
         printf("Integral   %10.3f   %s%8.3f  %10.3f\n", 1/tau_hb,
                bError ? "       " : "", tau_hb, calc_dg(tau_hb, temp));
         e_1 = std::exp(-1.0);
@@ -1900,7 +1900,7 @@ static void normalizeACF(real *ct, real *gt, int nhb, int len)
     for (i = 0; i < len; i++)
     {
         ct[i] *= ct_fac;
-        if (gt != NULL)
+        if (gt != nullptr)
         {
             gt[i] *= gt_fac;
         }
@@ -1923,15 +1923,15 @@ static void do_hbac(const char *fn, t_hbdata *hb,
     };
     gmx_bool       bNorm = FALSE;
     double         nhb   = 0;
-    real          *rhbex = NULL, *ht, *gt, *ght, *dght, *kt;
+    real          *rhbex = nullptr, *ht, *gt, *ght, *dght, *kt;
     real          *ct, tail, tail2, dtail, *cct;
     const real     tol     = 1e-3;
     int            nframes = hb->nframes;
-    unsigned int **h       = NULL, **g = NULL;
+    unsigned int **h       = nullptr, **g = nullptr;
     int            nh, nhbonds, nhydro;
     t_hbond       *hbh;
     int            acType;
-    int           *dondata      = NULL;
+    int           *dondata      = nullptr;
 
     enum {
         AC_NONE, AC_NN, AC_GEM, AC_LUZAR
@@ -2072,7 +2072,7 @@ static void do_hbac(const char *fn, t_hbdata *hb,
                     }
 
                     /* The autocorrelation function is normalized after summation only */
-                    low_do_autocorr(NULL, oenv, NULL, nframes, 1, -1, &rhbex, hb->time[1]-hb->time[0],
+                    low_do_autocorr(nullptr, oenv, nullptr, nframes, 1, -1, &rhbex, hb->time[1]-hb->time[0],
                                     eacNormal, 1, FALSE, bNorm, FALSE, 0, -1, 0);
 
                     /* Cross correlation analysis for thermodynamics */
@@ -2149,10 +2149,10 @@ static void do_hbac(const char *fn, t_hbdata *hb,
     }
     xvgrclose(fp);
 
-    analyse_corr(nn, hb->time, ct, ght, kt, NULL, NULL, NULL,
+    analyse_corr(nn, hb->time, ct, ght, kt, nullptr, nullptr, nullptr,
                  fit_start, temp);
 
-    do_view(oenv, fn, NULL);
+    do_view(oenv, fn, nullptr);
     sfree(rhbex);
     sfree(ct);
     sfree(gt);
@@ -2180,12 +2180,12 @@ static FILE *open_donor_properties_file(const char             *fn,
                                         t_hbdata               *hb,
                                         const gmx_output_env_t *oenv)
 {
-    FILE       *fp    = NULL;
+    FILE       *fp    = nullptr;
     const char *leg[] = { "Nbound", "Nfree" };
 
     if (!fn || !hb)
     {
-        return NULL;
+        return nullptr;
     }
 
     fp = xvgropen(fn, "Donor properties", output_env_get_xvgr_tlabel(oenv), "Number", oenv);
@@ -2242,7 +2242,7 @@ static void dump_hbmap(t_hbdata *hb,
     }
     else
     {
-        fplog = NULL;
+        fplog = nullptr;
     }
     for (grp = gr0; grp <= (bTwo ? gr1 : gr0); grp++)
     {
@@ -2482,9 +2482,9 @@ int gmx_hbond(int argc, char *argv[])
         "The option [TT]-sel[tt] that used to work on selected hbonds is out of order, and therefore not available for the time being."
     };
     t_filenm    fnm[] = {
-        { efTRX, "-f",   NULL,     ffREAD  },
-        { efTPR, NULL,   NULL,     ffREAD  },
-        { efNDX, NULL,   NULL,     ffOPTRD },
+        { efTRX, "-f",   nullptr,     ffREAD  },
+        { efTPR, nullptr,   nullptr,     ffREAD  },
+        { efNDX, nullptr,   nullptr,     ffOPTRD },
         /*    { efNDX, "-sel", "select", ffOPTRD },*/
         { efXVG, "-num", "hbnum",  ffWRITE },
         { efLOG, "-g",   "hbond",  ffOPTWR },
@@ -2509,7 +2509,6 @@ int gmx_hbond(int argc, char *argv[])
     t_trxstatus          *status;
     int                   trrStatus = 1;
     t_topology            top;
-    t_inputrec            ir;
     t_pargs              *ppa;
     int                   npargs, natoms, nframes = 0, shatom;
     int                  *isize;
@@ -2527,7 +2526,7 @@ int gmx_hbond(int argc, char *argv[])
     int                   grp, nabin, nrbin, resdist, ihb;
     char                **leg;
     t_hbdata             *hb;
-    FILE                 *fp, *fpnhb = NULL, *donor_properties = NULL;
+    FILE                 *fp, *fpnhb = nullptr, *donor_properties = nullptr;
     t_gridcell         ***grid;
     t_ncell              *icell, *jcell;
     ivec                  ngrid;
@@ -2538,8 +2537,8 @@ int gmx_hbond(int argc, char *argv[])
     gmx_bool              bParallel;
     gmx_bool              bEdge_yjj, bEdge_xjj;
 
-    t_hbdata            **p_hb    = NULL;                   /* one per thread, then merge after the frame loop */
-    int                 **p_adist = NULL, **p_rdist = NULL; /* a histogram for each thread. */
+    t_hbdata            **p_hb    = nullptr;                      /* one per thread, then merge after the frame loop */
+    int                 **p_adist = nullptr, **p_rdist = nullptr; /* a histogram for each thread. */
 
     const bool            bOMP = GMX_OPENMP;
 
@@ -2549,6 +2548,7 @@ int gmx_hbond(int argc, char *argv[])
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_TIME_UNIT, NFILE, fnm, npargs,
                            ppa, asize(desc), desc, asize(bugs), bugs, &oenv))
     {
+        sfree(ppa);
         return 0;
     }
 
@@ -2585,7 +2585,9 @@ int gmx_hbond(int argc, char *argv[])
     hb = mk_hbdata(bHBmap, opt2bSet("-dan", NFILE, fnm), bMerge || bContact);
 
     /* get topology */
-    read_tpx_top(ftp2fn(efTPR, NFILE, fnm), &ir, box, &natoms, NULL, NULL, &top);
+    t_inputrec      irInstance;
+    t_inputrec     *ir = &irInstance;
+    read_tpx_top(ftp2fn(efTPR, NFILE, fnm), ir, box, &natoms, nullptr, nullptr, &top);
 
     snew(grpnames, grNR);
     snew(index, grNR);
@@ -2763,7 +2765,7 @@ int gmx_hbond(int argc, char *argv[])
                   top.atoms.nr, natoms);
     }
 
-    bBox  = ir.ePBC != epbcNONE;
+    bBox  = (ir->ePBC != epbcNONE);
     grid  = init_grid(bBox, box, (rcut > r2cut) ? rcut : r2cut, ngrid);
     nabin = static_cast<int>(acut/abin);
     nrbin = static_cast<int>(rcut/rbin);
@@ -2810,11 +2812,11 @@ int gmx_hbond(int argc, char *argv[])
             snew(p_rdist[i], nrbin+1);
 
             p_hb[i]->max_frames = 0;
-            p_hb[i]->nhb        = NULL;
-            p_hb[i]->ndist      = NULL;
-            p_hb[i]->n_bound    = NULL;
-            p_hb[i]->time       = NULL;
-            p_hb[i]->nhx        = NULL;
+            p_hb[i]->nhb        = nullptr;
+            p_hb[i]->ndist      = nullptr;
+            p_hb[i]->n_bound    = nullptr;
+            p_hb[i]->time       = nullptr;
+            p_hb[i]->nhx        = nullptr;
 
             p_hb[i]->bHBmap     = hb->bHBmap;
             p_hb[i]->bDAnr      = hb->bDAnr;
@@ -3154,7 +3156,7 @@ int gmx_hbond(int argc, char *argv[])
 
     free_grid(ngrid, &grid);
 
-    close_trj(status);
+    close_trx(status);
 
     if (donor_properties)
     {
@@ -3362,7 +3364,7 @@ int gmx_hbond(int argc, char *argv[])
                 sprintf(mat.title, bContact ? "Contact Existence Map" :
                         "Hydrogen Bond Existence Map");
                 sprintf(mat.legend, bContact ? "Contacts" : "Hydrogen Bonds");
-                sprintf(mat.label_x, "%s", output_env_get_xvgr_tlabel(oenv));
+                sprintf(mat.label_x, "%s", output_env_get_xvgr_tlabel(oenv).c_str());
                 sprintf(mat.label_y, bContact ? "Contact Index" : "Hydrogen Bond Index");
                 mat.bDiscrete = TRUE;
                 mat.nmap      = 2;
index e3a10d90187abbbd61bd3f99c244c2ba2924a2ca..5589c4e94e659f04f1b09b1a561ecebb20348ff6 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,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.
@@ -120,23 +120,23 @@ int gmx_helix(int argc, char *argv[])
     } t_xvgrfile;
 
     t_xvgrfile        xf[efhNR] = {
-        { NULL, NULL, TRUE,  "radius",  "Helix radius",               NULL, "r (nm)", 0.0 },
-        { NULL, NULL, TRUE,  "twist",   "Twist per residue",          NULL, "Angle (deg)", 0.0 },
-        { NULL, NULL, TRUE,  "rise",    "Rise per residue",           NULL, "Rise (nm)", 0.0 },
-        { NULL, NULL, FALSE, "len-ahx", "Length of the Helix",        NULL, "Length (nm)", 0.0 },
-        { NULL, NULL, FALSE, "dip-ahx", "Helix Backbone Dipole",      NULL, "rq (nm e)", 0.0 },
-        { NULL, NULL, TRUE,  "rms-ahx", "RMS Deviation from Ideal Helix", NULL, "RMS (nm)", 0.0 },
-        { NULL, NULL, FALSE, "rmsa-ahx", "Average RMSD per Residue",   "Residue", "RMS (nm)", 0.0 },
-        { NULL, NULL, FALSE,  "cd222",   "Ellipticity at 222 nm", NULL, "nm", 0.0 },
-        { NULL, NULL, TRUE,  "pprms",   "RMS Distance from \\8a\\4-helix", NULL, "deg", 0.0 },
-        { NULL, NULL, TRUE,  "caphi",   "Average Ca-Ca Dihedral",     NULL, "\\8F\\4(deg)", 0.0 },
-        { NULL, NULL, TRUE,  "phi",     "Average \\8F\\4 angles", NULL, "deg", 0.0 },
-        { NULL, NULL, TRUE,  "psi",     "Average \\8Y\\4 angles", NULL, "deg", 0.0 },
-        { NULL, NULL, TRUE,  "hb3",     "Average n-n+3 hbond length", NULL, "nm", 0.0 },
-        { NULL, NULL, TRUE,  "hb4",     "Average n-n+4 hbond length", NULL, "nm", 0.0 },
-        { NULL, NULL, TRUE,  "hb5",     "Average n-n+5 hbond length", NULL, "nm", 0.0 },
-        { NULL, NULL, FALSE,  "JCaHa",   "J-Coupling Values",        "Residue", "Hz", 0.0 },
-        { NULL, NULL, FALSE,  "helicity", "Helicity per Residue",     "Residue", "% of time", 0.0 }
+        { nullptr, nullptr, TRUE,  "radius",  "Helix radius",               nullptr, "r (nm)", 0.0 },
+        { nullptr, nullptr, TRUE,  "twist",   "Twist per residue",          nullptr, "Angle (deg)", 0.0 },
+        { nullptr, nullptr, TRUE,  "rise",    "Rise per residue",           nullptr, "Rise (nm)", 0.0 },
+        { nullptr, nullptr, FALSE, "len-ahx", "Length of the Helix",        nullptr, "Length (nm)", 0.0 },
+        { nullptr, nullptr, FALSE, "dip-ahx", "Helix Backbone Dipole",      nullptr, "rq (nm e)", 0.0 },
+        { nullptr, nullptr, TRUE,  "rms-ahx", "RMS Deviation from Ideal Helix", nullptr, "RMS (nm)", 0.0 },
+        { nullptr, nullptr, FALSE, "rmsa-ahx", "Average RMSD per Residue",   "Residue", "RMS (nm)", 0.0 },
+        { nullptr, nullptr, FALSE,  "cd222",   "Ellipticity at 222 nm", nullptr, "nm", 0.0 },
+        { nullptr, nullptr, TRUE,  "pprms",   "RMS Distance from \\8a\\4-helix", nullptr, "deg", 0.0 },
+        { nullptr, nullptr, TRUE,  "caphi",   "Average Ca-Ca Dihedral",     nullptr, "\\8F\\4(deg)", 0.0 },
+        { nullptr, nullptr, TRUE,  "phi",     "Average \\8F\\4 angles", nullptr, "deg", 0.0 },
+        { nullptr, nullptr, TRUE,  "psi",     "Average \\8Y\\4 angles", nullptr, "deg", 0.0 },
+        { nullptr, nullptr, TRUE,  "hb3",     "Average n-n+3 hbond length", nullptr, "nm", 0.0 },
+        { nullptr, nullptr, TRUE,  "hb4",     "Average n-n+4 hbond length", nullptr, "nm", 0.0 },
+        { nullptr, nullptr, TRUE,  "hb5",     "Average n-n+5 hbond length", nullptr, "nm", 0.0 },
+        { nullptr, nullptr, FALSE,  "JCaHa",   "J-Coupling Values",        "Residue", "Hz", 0.0 },
+        { nullptr, nullptr, FALSE,  "helicity", "Helicity per Residue",     "Residue", "% of time", 0.0 }
     };
 
     gmx_output_env_t *oenv;
@@ -152,18 +152,18 @@ int gmx_helix(int argc, char *argv[])
     real              t;
     real              rms;
     matrix            box;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
     gmx_bool          bRange;
     t_filenm          fnm[] = {
-        { efTPR, NULL,  NULL,   ffREAD  },
-        { efNDX, NULL,  NULL,   ffREAD  },
-        { efTRX, "-f",  NULL,   ffREAD  },
+        { efTPR, nullptr,  nullptr,   ffREAD  },
+        { efNDX, nullptr,  nullptr,   ffREAD  },
+        { efTRX, "-f",  nullptr,   ffREAD  },
         { efSTO, "-cz", "zconf", ffWRITE },
     };
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -207,7 +207,7 @@ int gmx_helix(int argc, char *argv[])
     /* Read reference frame from tpx file to compute helix length */
     snew(xref, top->atoms.nr);
     read_tpx(ftp2fn(efTPR, NFILE, fnm),
-             NULL, NULL, &natoms, xref, NULL, NULL);
+             nullptr, nullptr, &natoms, xref, nullptr, nullptr);
     calc_hxprops(nres, bb, xref);
     do_start_end(nres, bb, &nbb, bbindex, &nca, caindex, bRange, rStart, rEnd);
     sfree(xref);
@@ -243,7 +243,7 @@ int gmx_helix(int argc, char *argv[])
             if (teller == 1)
             {
                 write_sto_conf(opt2fn("-cz", NFILE, fnm), "Helix fitted to Z-Axis",
-                               &(top->atoms), x, NULL, ePBC, box);
+                               &(top->atoms), x, nullptr, ePBC, box);
             }
 
             xf[efhRAD].val   = radius(xf[efhRAD].fp2, nca, caindex, x);
@@ -274,7 +274,7 @@ int gmx_helix(int argc, char *argv[])
 
     gmx_rmpbc_done(gpbc);
 
-    close_trj(status);
+    close_trx(status);
 
     for (i = 0; (i < nres); i++)
     {
index 7f40ea3697004000585111b8b456a05fb48bd1aa..8b5a3c9bcfd1135bb7b260326abd3f86f15022cc 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,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.
@@ -76,9 +76,9 @@ int gmx_helixorient(int argc, char *argv[])
         "purposes, we also write out the actual Euler rotation angles as [TT]theta[1-3].xvg[tt]"
     };
 
-    t_topology       *top = NULL;
+    t_topology       *top = nullptr;
     real              t;
-    rvec             *x = NULL;
+    rvec             *x = nullptr;
     matrix            box;
     t_trxstatus      *status;
     int               natoms;
@@ -132,7 +132,7 @@ int gmx_helixorient(int argc, char *argv[])
     int               ePBC;
 
     gmx_output_env_t *oenv;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
 
     static  gmx_bool  bSC          = FALSE;
     static gmx_bool   bIncremental = FALSE;
@@ -146,9 +146,9 @@ int gmx_helixorient(int argc, char *argv[])
 #define NPA asize(pa)
 
     t_filenm fnm[] = {
-        { efTPR, NULL, NULL, ffREAD },
-        { efTRX, "-f", NULL, ffREAD },
-        { efNDX, NULL, NULL, ffOPTRD },
+        { efTPR, nullptr, nullptr, ffREAD },
+        { efTRX, "-f", nullptr, ffREAD },
+        { efNDX, nullptr, nullptr, ffOPTRD },
         { efDAT, "-oaxis",    "helixaxis", ffWRITE },
         { efDAT, "-ocenter",  "center", ffWRITE },
         { efXVG, "-orise",    "rise", ffWRITE },
@@ -161,7 +161,7 @@ int gmx_helixorient(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME,
-                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -480,7 +480,7 @@ int gmx_helixorient(int argc, char *argv[])
     gmx_ffclose(fptheta2);
     gmx_ffclose(fptheta3);
 
-    close_trj(status);
+    close_trx(status);
 
     return 0;
 }
index 2b3bafbfd26395539db000e527f40b98e994f7ce..e3b7d45061f1b5f9030284d6228bfbf15791f9f4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,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.
@@ -251,7 +251,7 @@ static void calc_tetra_order_interface(const char *fnNDX, const char *fnTPS, con
                                        real sgang1, real sgang2, real ****intfpos,
                                        gmx_output_env_t *oenv)
 {
-    FILE         *fpsg   = NULL, *fpsk = NULL;
+    FILE         *fpsg   = nullptr, *fpsk = nullptr;
     t_topology    top;
     int           ePBC;
     t_trxstatus  *status;
@@ -260,10 +260,10 @@ static void calc_tetra_order_interface(const char *fnNDX, const char *fnTPS, con
     rvec         *xtop, *x;
     matrix        box;
     real          sg, sk, sgintf;
-    int         **index   = NULL;
-    char        **grpname = NULL;
+    int         **index   = nullptr;
+    char        **grpname = nullptr;
     int           i, j, k, n, *isize, ng, nslicez, framenr;
-    real       ***sg_grid = NULL, ***sk_grid = NULL, ***sg_fravg = NULL, ***sk_fravg = NULL, ****sk_4d = NULL, ****sg_4d = NULL;
+    real       ***sg_grid = nullptr, ***sk_grid = nullptr, ***sg_fravg = nullptr, ***sk_fravg = nullptr, ****sk_4d = nullptr, ****sg_4d = nullptr;
     int          *perm;
     int           ndx1, ndx2;
     int           bins;
@@ -272,7 +272,7 @@ static void calc_tetra_order_interface(const char *fnNDX, const char *fnTPS, con
      * i.e 1D Row-major order in (t,x,y) */
 
 
-    read_tps_conf(fnTPS, &top, &ePBC, &xtop, NULL, box, FALSE);
+    read_tps_conf(fnTPS, &top, &ePBC, &xtop, nullptr, box, FALSE);
 
     *nslicex = static_cast<int>(box[XX][XX]/binw + onehalf); /*Calculate slicenr from binwidth*/
     *nslicey = static_cast<int>(box[YY][YY]/binw + onehalf);
@@ -295,7 +295,7 @@ static void calc_tetra_order_interface(const char *fnNDX, const char *fnTPS, con
         gmx_fatal(FARGS, "Topology (%d atoms) does not match trajectory (%d atoms)",
                   top.atoms.nr, natoms);
     }
-    check_index(NULL, ng, index[0], NULL, natoms);
+    check_index(nullptr, ng, index[0], nullptr, natoms);
 
 
     /*Prepare structures for temporary storage of frame info*/
@@ -312,8 +312,8 @@ static void calc_tetra_order_interface(const char *fnNDX, const char *fnTPS, con
         }
     }
 
-    sg_4d    = NULL;
-    sk_4d    = NULL;
+    sg_4d    = nullptr;
+    sk_4d    = nullptr;
     *nframes = 0;
     framenr  = 0;
 
@@ -341,7 +341,7 @@ static void calc_tetra_order_interface(const char *fnNDX, const char *fnTPS, con
 
         find_tetra_order_grid(top, ePBC, natoms, box, x, isize[0], index[0],
                               &sg, &sk, *nslicex, *nslicey, nslicez, sg_grid, sk_grid);
-        GMX_RELEASE_ASSERT(sk_fravg != NULL, "Trying to dereference NULL sk_fravg pointer");
+        GMX_RELEASE_ASSERT(sk_fravg != nullptr, "Trying to dereference NULL sk_fravg pointer");
         for (i = 0; i < *nslicex; i++)
         {
             for (j = 0; j < *nslicey; j++)
@@ -358,7 +358,7 @@ static void calc_tetra_order_interface(const char *fnNDX, const char *fnTPS, con
 
         if (framenr%tblock == 0)
         {
-            GMX_RELEASE_ASSERT(sk_4d != NULL, "Trying to dereference NULL sk_4d pointer");
+            GMX_RELEASE_ASSERT(sk_4d != nullptr, "Trying to dereference NULL sk_4d pointer");
             sk_4d[*nframes] = sk_fravg;
             sg_4d[*nframes] = sg_fravg;
             (*nframes)++;
@@ -366,7 +366,7 @@ static void calc_tetra_order_interface(const char *fnNDX, const char *fnTPS, con
 
     }
     while (read_next_x(oenv, status, &t, x, box));
-    close_trj(status);
+    close_trx(status);
 
     sfree(grpname);
     sfree(index);
@@ -449,7 +449,7 @@ static void calc_tetra_order_interface(const char *fnNDX, const char *fnTPS, con
 static void writesurftoxpms(real ***surf, int tblocks, int xbins, int ybins, real bw, char **outfiles, int maplevels )
 {
 
-    char   numbuf[8];
+    char   numbuf[STRLEN];
     int    n, i, j;
     real **profile1, **profile2;
     real   max1, max2, min1, min2, *xticks, *yticks;
@@ -579,7 +579,7 @@ int gmx_hydorder(int argc, char *argv[])
     static gmx_bool    bRawOut   = FALSE;
     int                frames, xslices, yslices; /* Dimensions of interface arrays*/
     real            ***intfpos;                  /* Interface arrays (intfnr,t,xy) -potentially large */
-    static const char *normal_axis[] = { NULL, "z", "x", "y", NULL };
+    static const char *normal_axis[] = { nullptr, "z", "x", "y", nullptr };
 
     t_pargs            pa[] = {
         { "-d",   FALSE, etENUM, {normal_axis},
@@ -597,9 +597,9 @@ int gmx_hydorder(int argc, char *argv[])
     };
 
     t_filenm           fnm[] = {                      /* files for g_order    */
-        { efTRX, "-f", NULL,  ffREAD },               /* trajectory file              */
-        { efNDX, "-n", NULL,  ffREAD },               /* index file           */
-        { efTPR, "-s", NULL,  ffREAD },               /* topology file                */
+        { efTRX, "-f", nullptr,  ffREAD },            /* trajectory file              */
+        { efNDX, "-n", nullptr,  ffREAD },            /* index file           */
+        { efTPR, "-s", nullptr,  ffREAD },            /* topology file                */
         { efXPM, "-o", "intf",  ffWRMULT},            /* XPM- surface maps     */
         { efOUT, "-or", "raw", ffOPTWRMULT },         /* xvgr output file           */
         { efOUT, "-Spect", "intfspect", ffOPTWRMULT}, /* Fourier spectrum interfaces */
@@ -613,7 +613,7 @@ int gmx_hydorder(int argc, char *argv[])
     gmx_output_env_t *oenv;
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -630,7 +630,7 @@ int gmx_hydorder(int argc, char *argv[])
     trxfnm = ftp2fn(efTRX, NFILE, fnm);
 
     /* Calculate axis */
-    GMX_RELEASE_ASSERT(normal_axis[0] != NULL, "Option setting inconsistency; normal_axis[0] is NULL");
+    GMX_RELEASE_ASSERT(normal_axis[0] != nullptr, "Option setting inconsistency; normal_axis[0] is NULL");
     if (std::strcmp(normal_axis[0], "x") == 0)
     {
         axis = XX;
index efb299333efda11966af49e552884e22d3613575..9ba2b1b966882dbfa380a693a81a4e780c3e56fa 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,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.
@@ -81,16 +81,16 @@ static t_liedata *analyze_names(int nre, gmx_enxnm_t *names, const char *ligand)
     snew(ld, 1);
     for (; (i < nre); i++)
     {
-        if ((std::strstr(names[i].name, ligand) != NULL) &&
-            (std::strstr(names[i].name, self) == NULL))
+        if ((std::strstr(names[i].name, ligand) != nullptr) &&
+            (std::strstr(names[i].name, self) == nullptr))
         {
-            if (std::strstr(names[i].name, "LJ") != NULL)
+            if (std::strstr(names[i].name, "LJ") != nullptr)
             {
                 ld->nlj++;
                 srenew(ld->lj, ld->nlj);
                 ld->lj[ld->nlj-1] = i;
             }
-            else if (std::strstr(names[i].name, "Coul") != NULL)
+            else if (std::strstr(names[i].name, "Coul") != nullptr)
             {
                 ld->nqq++;
                 srenew(ld->qq, ld->nqq);
@@ -114,8 +114,8 @@ static t_liedata *analyze_names(int nre, gmx_enxnm_t *names, const char *ligand)
     return ld;
 }
 
-real calc_lie(t_liedata *ld, t_energy ee[], real lie_lj, real lie_qq,
-              real fac_lj, real fac_qq)
+static real calc_lie(t_liedata *ld, t_energy ee[], real lie_lj, real lie_qq,
+                     real fac_lj, real fac_qq)
 {
     int  i;
     real lj_tot, qq_tot;
@@ -167,7 +167,7 @@ int gmx_lie(int argc, char *argv[])
     int               nre, nframes = 0, ct = 0;
     ener_file_t       fp;
     t_liedata        *ld;
-    gmx_enxnm_t      *enm = NULL;
+    gmx_enxnm_t      *enm = nullptr;
     t_enxframe       *fr;
     real              lie;
     double            lieaver = 0, lieav2 = 0;
@@ -180,7 +180,7 @@ int gmx_lie(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
-                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
index 7b35279293f59c4e40c2332049776062bbba11e5..bb9c7ac0a767c68b62047051a3e9dffe54423ffc 100644 (file)
@@ -46,7 +46,6 @@
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/pdbio.h"
-#include "gromacs/fileio/readinp.h"
 #include "gromacs/fileio/xvgr.h"
 #include "gromacs/gmxana/eigio.h"
 #include "gromacs/gmxana/gmx_ana.h"
@@ -106,14 +105,14 @@ typedef struct edipar
 
 
 
-void make_t_edx(struct edix *edx, int natoms, rvec *pos, int index[])
+static void make_t_edx(struct edix *edx, int natoms, rvec *pos, int index[])
 {
     edx->nr   = natoms;
     edx->anrs = index;
     edx->x    = pos;
 }
 
-void write_t_edx(FILE *fp, struct edix edx, const char *comment)
+static void write_t_edx(FILE *fp, struct edix edx, const char *comment)
 {
     /*here we copy only the pointers into the t_edx struct
        no data is copied and edx.box is ignored  */
@@ -125,7 +124,7 @@ void write_t_edx(FILE *fp, struct edix edx, const char *comment)
     }
 }
 
-int sscan_list(int *list[], const char *str, const char *listname)
+static int sscan_list(int *list[], const char *str, const char *listname)
 {
     /*this routine scans a string of the form 1,3-6,9 and returns the
        selected numbers (in this case 1 3 4 5 6 9) in NULL-terminated array of integers.
@@ -149,12 +148,12 @@ int sscan_list(int *list[], const char *str, const char *listname)
     int   number     = 0;
     int   end_number = 0;
 
-    char *start = NULL; /*holds the string of the number behind a ','*/
-    char *end   = NULL; /*holds the string of the number behind a '-' */
+    char *start = nullptr; /*holds the string of the number behind a ','*/
+    char *end   = nullptr; /*holds the string of the number behind a '-' */
 
-    int   nvecs = 0;    /* counts the number of vectors in the list*/
+    int   nvecs = 0;       /* counts the number of vectors in the list*/
 
-    step = NULL;
+    step = nullptr;
     snew(pos, n+4);
     startpos = pos;
     std::strcpy(pos, str);
@@ -162,7 +161,7 @@ int sscan_list(int *list[], const char *str, const char *listname)
     pos[n+1] = '1';
     pos[n+2] = '\0';
 
-    *list = NULL;
+    *list = nullptr;
 
     while ((c = *pos) != 0)
     {
@@ -185,7 +184,7 @@ int sscan_list(int *list[], const char *str, const char *listname)
                 {
                     /*store number*/
                     srenew(*list, nvecs+1);
-                    (*list)[nvecs++] = number = std::strtol(start, NULL, 10);
+                    (*list)[nvecs++] = number = std::strtol(start, nullptr, 10);
                     status           = sBefore;
                     if (number == 0)
                     {
@@ -242,8 +241,8 @@ int sscan_list(int *list[], const char *str, const char *listname)
                 if (c == ',')
                 {
                     /*store numbers*/
-                    end_number = std::strtol(end, NULL, 10);
-                    number     = std::strtol(start, NULL, 10);
+                    end_number = std::strtol(end, nullptr, 10);
+                    number     = std::strtol(start, nullptr, 10);
                     status     = sBefore;
                     if (number == 0)
                     {
@@ -256,8 +255,8 @@ int sscan_list(int *list[], const char *str, const char *listname)
                     srenew(*list, nvecs+end_number-number+1);
                     if (step)
                     {
-                        istep = strtol(step, NULL, 10);
-                        step  = NULL;
+                        istep = strtol(step, nullptr, 10);
+                        step  = nullptr;
                     }
                     else
                     {
@@ -305,7 +304,7 @@ int sscan_list(int *list[], const char *str, const char *listname)
     return nvecs;
 } /*sscan_list*/
 
-void write_eigvec(FILE* fp, int natoms, int eig_list[], rvec** eigvecs, int nvec, const char *grouptitle, real steps[])
+static void write_eigvec(FILE* fp, int natoms, int eig_list[], rvec** eigvecs, int nvec, const char *grouptitle, real steps[])
 {
 /* eig_list is a zero-terminated list of indices into the eigvecs array.
    eigvecs are coordinates of eigenvectors
@@ -360,8 +359,8 @@ enum {
 #define MAGIC 670
 
 
-void write_the_whole_thing(FILE* fp, t_edipar *edpars, rvec** eigvecs,
-                           int nvec, int *eig_listen[], real* evStepList[])
+static void write_the_whole_thing(FILE* fp, t_edipar *edpars, rvec** eigvecs,
+                                  int nvec, int *eig_listen[], real* evStepList[])
 {
 /* write edi-file */
 
@@ -380,12 +379,12 @@ void write_the_whole_thing(FILE* fp, t_edipar *edpars, rvec** eigvecs,
 
     /*Eigenvectors */
 
-    write_eigvec(fp, edpars->ned, eig_listen[evMON], eigvecs, nvec, "COMPONENTS GROUP 1", NULL);
+    write_eigvec(fp, edpars->ned, eig_listen[evMON], eigvecs, nvec, "COMPONENTS GROUP 1", nullptr);
     write_eigvec(fp, edpars->ned, eig_listen[evLINFIX], eigvecs, nvec, "COMPONENTS GROUP 2", evStepList[evLINFIX]);
     write_eigvec(fp, edpars->ned, eig_listen[evLINACC], eigvecs, nvec, "COMPONENTS GROUP 3", evStepList[evLINACC]);
     write_eigvec(fp, edpars->ned, eig_listen[evRADFIX], eigvecs, nvec, "COMPONENTS GROUP 4", evStepList[evRADFIX]);
-    write_eigvec(fp, edpars->ned, eig_listen[evRADACC], eigvecs, nvec, "COMPONENTS GROUP 5", NULL);
-    write_eigvec(fp, edpars->ned, eig_listen[evRADCON], eigvecs, nvec, "COMPONENTS GROUP 6", NULL);
+    write_eigvec(fp, edpars->ned, eig_listen[evRADACC], eigvecs, nvec, "COMPONENTS GROUP 5", nullptr);
+    write_eigvec(fp, edpars->ned, eig_listen[evRADCON], eigvecs, nvec, "COMPONENTS GROUP 6", nullptr);
     write_eigvec(fp, edpars->ned, eig_listen[evFLOOD], eigvecs, nvec, "COMPONENTS GROUP 7", evStepList[evFLOOD]);
 
 
@@ -394,19 +393,19 @@ void write_the_whole_thing(FILE* fp, t_edipar *edpars, rvec** eigvecs,
     write_t_edx(fp, edpars->sori, "NORIGIN, XORIGIN");
 }
 
-int read_conffile(const char *confin, rvec **x)
+static int read_conffile(const char *confin, rvec **x)
 {
     t_topology  top;
     matrix      box;
     printf("read coordnumber from file %s\n", confin);
-    read_tps_conf(confin, &top, NULL, x, NULL, box, FALSE);
+    read_tps_conf(confin, &top, nullptr, x, nullptr, box, FALSE);
     printf("number of coordinates in file %d\n", top.atoms.nr);
     return top.atoms.nr;
 }
 
 
-void read_eigenvalues(int vecs[], const char *eigfile, real values[],
-                      gmx_bool bHesse, real kT, int natoms_average_struct)
+static void read_eigenvalues(int vecs[], const char *eigfile, real values[],
+                             gmx_bool bHesse, real kT, int natoms_average_struct)
 {
     int      neig, nrow, i;
     double **eigval;
@@ -498,15 +497,15 @@ static real *scan_vecparams(const char *str, const char * par, int nvecs)
 }
 
 
-void init_edx(struct edix *edx)
+static void init_edx(struct edix *edx)
 {
     edx->nr = 0;
     snew(edx->x, 1);
     snew(edx->anrs, 1);
 }
 
-void filter2edx(struct edix *edx, int nindex, int index[], int ngro,
-                int igro[], const rvec *x, const char* structure)
+static void filter2edx(struct edix *edx, int nindex, int index[], int ngro,
+                       int igro[], const rvec *x, const char* structure)
 {
 /* filter2edx copies coordinates from x to edx which are given in index
  */
@@ -531,9 +530,9 @@ void filter2edx(struct edix *edx, int nindex, int index[], int ngro,
     }
 }
 
-void get_structure(const t_atoms *atoms, const char *IndexFile,
-                   const char *StructureFile, struct edix *edx, int nfit,
-                   int ifit[], int nav, int index[])
+static void get_structure(const t_atoms *atoms, const char *IndexFile,
+                          const char *StructureFile, struct edix *edx, int nfit,
+                          int ifit[], int nav, int index[])
 {
     int     *igro; /*index corresponding to target or origin structure*/
     int      ngro;
@@ -663,9 +662,9 @@ int gmx_make_edi(int argc, char *argv[])
     enum  {
         evStepNr = evRADFIX + 1
     };
-    static const char* evSelections[evNr]      = {NULL, NULL, NULL, NULL, NULL, NULL};
+    static const char* evSelections[evNr]      = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr};
     static const char* evOptions[evNr]         = {"-linfix", "-linacc", "-flood", "-radfix", "-radacc", "-radcon", "-mon"};
-    static const char* evParams[evStepNr]      = {NULL, NULL};
+    static const char* evParams[evStepNr]      = {nullptr, nullptr};
     static const char* evStepOptions[evStepNr] = {"-linstep", "-accdir", "-not_used", "-radstep"};
     static const char* ConstForceStr;
     static real      * evStepList[evStepNr];
@@ -737,18 +736,18 @@ int gmx_make_edi(int argc, char *argv[])
 #define NPA asize(pa)
 
     rvec             *xref1;
-    int               nvec1, *eignr1 = NULL;
-    rvec             *xav1, **eigvec1 = NULL;
-    t_atoms          *atoms = NULL;
+    int               nvec1, *eignr1 = nullptr;
+    rvec             *xav1, **eigvec1 = nullptr;
+    t_atoms          *atoms = nullptr;
     int               nav; /* Number of atoms in the average structure */
     char             *grpname;
     const char       *indexfile;
     int               i;
     int              *index, *ifit;
-    int               nfit;           /* Number of atoms in the reference/fit structure */
-    int               ev_class;       /* parameter _class i.e. evMON, evRADFIX etc. */
+    int               nfit;              /* Number of atoms in the reference/fit structure */
+    int               ev_class;          /* parameter _class i.e. evMON, evRADFIX etc. */
     int               nvecs;
-    real             *eigval1 = NULL; /* in V3.3 this is parameter of read_eigenvectors */
+    real             *eigval1 = nullptr; /* in V3.3 this is parameter of read_eigenvectors */
 
     const char       *EdiFile;
     const char       *TargetFile;
@@ -767,8 +766,8 @@ int gmx_make_edi(int argc, char *argv[])
     t_filenm    fnm[] = {
         { efTRN, "-f",    "eigenvec",    ffREAD  },
         { efXVG, "-eig",  "eigenval",    ffOPTRD },
-        { efTPS, NULL,    NULL,          ffREAD },
-        { efNDX, NULL,    NULL,  ffOPTRD },
+        { efTPS, nullptr,    nullptr,          ffREAD },
+        { efNDX, nullptr,    nullptr,  ffOPTRD },
         { efSTX, "-tar", "target", ffOPTRD},
         { efSTX, "-ori", "origin", ffOPTRD},
         { efEDI, "-o", "sam", ffWRITE }
@@ -776,7 +775,7 @@ int gmx_make_edi(int argc, char *argv[])
 #define NFILE asize(fnm)
     edi_params.outfrq = 100; edi_params.slope = 0.0; edi_params.maxedsteps = 0;
     if (!parse_common_args(&argc, argv, 0,
-                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -835,7 +834,7 @@ int gmx_make_edi(int argc, char *argv[])
         }
         else     /* if there are no eigenvectors for this option set list to zero */
         {
-            listen[ev_class] = NULL;
+            listen[ev_class] = nullptr;
             snew(listen[ev_class], 1);
             listen[ev_class][0] = 0;
         }
@@ -860,7 +859,7 @@ int gmx_make_edi(int argc, char *argv[])
                       &xref1, &edi_params.fitmas, &xav1, &edi_params.pcamas, &nvec1, &eignr1, &eigvec1, &eigval1);
 
     read_tps_conf(ftp2fn(efTPS, NFILE, fnm),
-                  &top, &ePBC, &xtop, NULL, topbox, 0);
+                  &top, &ePBC, &xtop, nullptr, topbox, 0);
     atoms = &top.atoms;
 
 
@@ -874,7 +873,7 @@ int gmx_make_edi(int argc, char *argv[])
     printf("\n");
 
 
-    if (xref1 == NULL)
+    if (xref1 == nullptr)
     {
         if (bFit1)
         {
@@ -958,7 +957,7 @@ int gmx_make_edi(int argc, char *argv[])
     }
     else
     {
-        make_t_edx(&edi_params.star, 0, NULL, index);
+        make_t_edx(&edi_params.star, 0, nullptr, index);
     }
 
     /* Store origin positions */
@@ -968,7 +967,7 @@ int gmx_make_edi(int argc, char *argv[])
     }
     else
     {
-        make_t_edx(&edi_params.sori, 0, NULL, index);
+        make_t_edx(&edi_params.sori, 0, nullptr, index);
     }
 
     /* Write edi-file */
index 56cfa2eb44616fade78a263a7aab5f013dfd5eef..85468fbebedf1d368506117eacaacf88128675f5 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,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,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.
@@ -153,7 +153,7 @@ static gmx_bool is_name_char(char c)
      */
     const char *spec = " !&|";
 
-    return (c != '\0' && std::strchr(spec, c) == NULL);
+    return (c != '\0' && std::strchr(spec, c) == nullptr);
 }
 
 static int parse_names(char **string, int *n_names, char **names)
@@ -283,7 +283,7 @@ static gmx_bool parse_string(char **string, int *nr, int ngrps, char **grpname)
         (*string)++;
         s  = gmx_strdup((*string));
         sp = std::strchr(s, c);
-        if (sp != NULL)
+        if (sp != nullptr)
         {
             (*string) += sp-s + 1;
             sp[0]      = '\0';
@@ -816,7 +816,7 @@ static int split_chain(const t_atoms *atoms, const rvec *x,
 {
     char    buf[STRLEN];
     int     j, nchain;
-    int     i, a, natoms, *start = NULL, *end = NULL, ca_start, ca_end;
+    int     i, a, natoms, *start = nullptr, *end = nullptr, ca_start, ca_end;
     rvec    vec;
 
     natoms   = atoms->nr;
@@ -919,7 +919,7 @@ static int split_chain(const t_atoms *atoms, const rvec *x,
 
 static gmx_bool check_have_atoms(const t_atoms *atoms, char *string)
 {
-    if (atoms == NULL)
+    if (atoms == nullptr)
     {
         printf("Can not process '%s' without atom info, use option -f\n", string);
         return FALSE;
@@ -1012,7 +1012,7 @@ static gmx_bool parse_entry(char **string, int natoms, const t_atoms *atoms,
         if (check_have_atoms(atoms, ostring) &&
             parse_names(string, &n_names, names))
         {
-            if (atoms->atomtype == NULL)
+            if (!(atoms->haveType))
             {
                 printf("Need a run input file to select atom types\n");
             }
@@ -1180,7 +1180,7 @@ static void edit_index(int natoms, const t_atoms *atoms, const rvec *x, t_blocka
         }
     }
 
-    string = NULL;
+    string = nullptr;
 
     snew(index, natoms);
     snew(index1, natoms);
@@ -1225,7 +1225,7 @@ static void edit_index(int natoms, const t_atoms *atoms, const rvec *x, t_blocka
         }
         printf("\n");
         printf("> ");
-        if (NULL == fgets(inp_string, STRLEN, stdin))
+        if (nullptr == fgets(inp_string, STRLEN, stdin))
         {
             gmx_fatal(FARGS, "Error reading user input");
         }
@@ -1483,7 +1483,7 @@ static int block2natoms(t_blocka *block)
     return natoms;
 }
 
-void merge_blocks(t_blocka *dest, t_blocka *source)
+static void merge_blocks(t_blocka *dest, t_blocka *source)
 {
     int     i, nra0, i0;
 
@@ -1566,14 +1566,14 @@ int gmx_make_ndx(int argc, char *argv[])
     t_blocka         *block, *block2;
     char            **gnames, **gnames2;
     t_filenm          fnm[] = {
-        { efSTX, "-f", NULL,     ffOPTRD  },
-        { efNDX, "-n", NULL,     ffOPTRDMULT },
-        { efNDX, "-o", NULL,     ffWRITE }
+        { efSTX, "-f", nullptr,     ffOPTRD  },
+        { efNDX, "-n", nullptr,     ffOPTRDMULT },
+        { efNDX, "-o", nullptr,     ffWRITE }
     };
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, 0, NFILE, fnm, NPA, pa, asize(desc), desc,
-                           0, NULL, &oenv))
+                           0, nullptr, &oenv))
     {
         return 0;
     }
@@ -1602,7 +1602,7 @@ int gmx_make_ndx(int argc, char *argv[])
         fprintf(stderr, "\nReading structure file\n");
         read_tps_conf(stxfile, top, &ePBC, &x, &v, box, FALSE);
         atoms = &top->atoms;
-        if (atoms->pdbinfo == NULL)
+        if (atoms->pdbinfo == nullptr)
         {
             snew(atoms->pdbinfo, atoms->nr);
         }
@@ -1611,13 +1611,13 @@ int gmx_make_ndx(int argc, char *argv[])
     }
     else
     {
-        atoms = NULL;
-        x     = NULL;
+        atoms = nullptr;
+        x     = nullptr;
     }
 
     /* read input file(s) */
     block  = new_blocka();
-    gnames = NULL;
+    gnames = nullptr;
     printf("Going to read %d old index file(s)\n", nndxin);
     if (nndxin)
     {
index f727fe9c267c94b5f8e8b3f3d193174d673624e2..f59673d35b353fa483189ccb659fbef984341eb8 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,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.
 
 #define FARAWAY 10000
 
-int *res_ndx(t_atoms *atoms)
+static int *res_ndx(t_atoms *atoms)
 {
     int *rndx;
     int  i, r0;
 
     if (atoms->nr <= 0)
     {
-        return NULL;
+        return nullptr;
     }
     snew(rndx, atoms->nr);
     r0 = atoms->atom[0].resind;
@@ -82,14 +82,14 @@ int *res_ndx(t_atoms *atoms)
     return rndx;
 }
 
-int *res_natm(t_atoms *atoms)
+static int *res_natm(t_atoms *atoms)
 {
     int *natm;
     int  i, j, r0;
 
     if (atoms->nr <= 0)
     {
-        return NULL;
+        return nullptr;
     }
     snew(natm, atoms->nres);
     r0 = atoms->atom[0].resind;
@@ -194,16 +194,16 @@ int gmx_mdmat(int argc, char *argv[])
           "Discretize distance in this number of levels" }
     };
     t_filenm        fnm[] = {
-        { efTRX, "-f",  NULL, ffREAD },
-        { efTPS, NULL,  NULL, ffREAD },
-        { efNDX, NULL,  NULL, ffOPTRD },
+        { efTRX, "-f",  nullptr, ffREAD },
+        { efTPS, nullptr,  nullptr, ffREAD },
+        { efNDX, nullptr,  nullptr, ffOPTRD },
         { efXPM, "-mean", "dm", ffWRITE },
         { efXPM, "-frames", "dmf", ffOPTWR },
         { efXVG, "-no", "num", ffOPTWR },
     };
 #define NFILE asize(fnm)
 
-    FILE             *out = NULL, *fp;
+    FILE             *out = nullptr, *fp;
     t_topology        top;
     int               ePBC;
     t_atoms           useatoms;
@@ -225,10 +225,10 @@ int gmx_mdmat(int argc, char *argv[])
     int              *tot_n;
     matrix            box = {{0}};
     gmx_output_env_t *oenv;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME, NFILE, fnm,
-                           asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -241,7 +241,7 @@ int gmx_mdmat(int argc, char *argv[])
         fprintf(stderr, "Will calculate number of different contacts\n");
     }
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, NULL, box, FALSE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, nullptr, box, FALSE);
 
     fprintf(stderr, "Select group for analysis\n");
     get_index(&top.atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &isize, &index, &grpname);
@@ -345,7 +345,7 @@ int gmx_mdmat(int argc, char *argv[])
     }
     while (read_next_x(oenv, status, &t, x, box));
     fprintf(stderr, "\n");
-    close_trj(status);
+    close_trx(status);
     gmx_rmpbc_done(gpbc);
     if (bFrames)
     {
index 399256ba2bf528b0f9fb914bc14685a49f48ef9f..7035b3be468aac40eefe4655ee5d64be850839f7 100644 (file)
@@ -154,11 +154,11 @@ static void periodic_mindist_plot(const char *trxfn, const char *outfn,
     int          natoms, ind_min[2] = {0, 0}, ind_mini = 0, ind_minj = 0;
     real         rmin, rmax, rmint, tmint;
     gmx_bool     bFirst;
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
 
     natoms = read_first_x(oenv, &status, trxfn, &t, &x, box);
 
-    check_index(NULL, n, index, NULL, natoms);
+    check_index(nullptr, n, index, nullptr, natoms);
 
     out = xvgropen(outfn, "Minimum distance to periodic image",
                    output_env_get_time_label(oenv), "Distance (nm)", oenv);
@@ -171,7 +171,7 @@ static void periodic_mindist_plot(const char *trxfn, const char *outfn,
     rmint = box[XX][XX];
     tmint = 0;
 
-    if (NULL != top)
+    if (nullptr != top)
     {
         gpbc = gmx_rmpbc_init(&top->idef, ePBC, natoms);
     }
@@ -179,7 +179,7 @@ static void periodic_mindist_plot(const char *trxfn, const char *outfn,
     bFirst = TRUE;
     do
     {
-        if (NULL != top)
+        if (nullptr != top)
         {
             gmx_rmpbc(gpbc, natoms, box, x);
         }
@@ -202,7 +202,7 @@ static void periodic_mindist_plot(const char *trxfn, const char *outfn,
     }
     while (read_next_x(oenv, status, &t, x, box));
 
-    if (NULL != top)
+    if (nullptr != top)
     {
         gmx_rmpbc_done(gpbc);
     }
@@ -212,7 +212,7 @@ static void periodic_mindist_plot(const char *trxfn, const char *outfn,
     fprintf(stdout,
             "\nThe shortest periodic distance is %g (nm) at time %g (%s),\n"
             "between atoms %d and %d\n",
-            rmint, output_env_conv_time(oenv, tmint), output_env_get_time_unit(oenv),
+            rmint, output_env_conv_time(oenv, tmint), output_env_get_time_unit(oenv).c_str(),
             index[ind_mini]+1, index[ind_minj]+1);
 }
 
@@ -262,7 +262,7 @@ static void calc_dist(real rcut, gmx_bool bPBC, int ePBC, matrix box, rvec x[],
     for (j = 0; (j < j1); j++)
     {
         jx = index3[j];
-        if (index2 == NULL)
+        if (index2 == nullptr)
         {
             i0 = j + 1;
         }
@@ -298,7 +298,7 @@ static void calc_dist(real rcut, gmx_bool bPBC, int ePBC, matrix box, rvec x[],
                 {
                     nmin_j++;
                 }
-                else if (r2 > rcut2)
+                else
                 {
                     nmax_j++;
                 }
@@ -325,19 +325,19 @@ static void calc_dist(real rcut, gmx_bool bPBC, int ePBC, matrix box, rvec x[],
     *rmax = std::sqrt(rmax2);
 }
 
-void dist_plot(const char *fn, const char *afile, const char *dfile,
-               const char *nfile, const char *rfile, const char *xfile,
-               real rcut, gmx_bool bMat, const t_atoms *atoms,
-               int ng, int *index[], int gnx[], char *grpn[], gmx_bool bSplit,
-               gmx_bool bMin, int nres, int *residue, gmx_bool bPBC, int ePBC,
-               gmx_bool bGroup, gmx_bool bEachResEachTime, gmx_bool bPrintResName,
-               const gmx_output_env_t *oenv)
+static void dist_plot(const char *fn, const char *afile, const char *dfile,
+                      const char *nfile, const char *rfile, const char *xfile,
+                      real rcut, gmx_bool bMat, const t_atoms *atoms,
+                      int ng, int *index[], int gnx[], char *grpn[], gmx_bool bSplit,
+                      gmx_bool bMin, int nres, int *residue, gmx_bool bPBC, int ePBC,
+                      gmx_bool bGroup, gmx_bool bEachResEachTime, gmx_bool bPrintResName,
+                      const gmx_output_env_t *oenv)
 {
     FILE            *atm, *dist, *num;
     t_trxstatus     *trxout;
     char             buf[256];
     char           **leg;
-    real             t, dmin, dmax, **mindres = NULL, **maxdres = NULL;
+    real             t, dmin, dmax, **mindres = nullptr, **maxdres = nullptr;
     int              nmin, nmax;
     t_trxstatus     *status;
     int              i = -1, j, k;
@@ -348,7 +348,7 @@ void dist_plot(const char *fn, const char *afile, const char *dfile,
     rvec            *x0;
     matrix           box;
     gmx_bool         bFirst;
-    FILE            *respertime = NULL;
+    FILE            *respertime = nullptr;
 
     if (read_first_x(oenv, &status, fn, &t, &x0, box) == 0)
     {
@@ -358,9 +358,9 @@ void dist_plot(const char *fn, const char *afile, const char *dfile,
     sprintf(buf, "%simum Distance", bMin ? "Min" : "Max");
     dist = xvgropen(dfile, buf, output_env_get_time_label(oenv), "Distance (nm)", oenv);
     sprintf(buf, "Number of Contacts %s %g nm", bMin ? "<" : ">", rcut);
-    num    = nfile ? xvgropen(nfile, buf, output_env_get_time_label(oenv), "Number", oenv) : NULL;
-    atm    = afile ? gmx_ffopen(afile, "w") : NULL;
-    trxout = xfile ? open_trx(xfile, "w") : NULL;
+    num    = nfile ? xvgropen(nfile, buf, output_env_get_time_label(oenv), "Number", oenv) : nullptr;
+    atm    = afile ? gmx_ffopen(afile, "w") : nullptr;
+    trxout = xfile ? open_trx(xfile, "w") : nullptr;
 
     if (bMat)
     {
@@ -534,7 +534,7 @@ void dist_plot(const char *fn, const char *afile, const char *dfile,
         {
             oindex[0] = bMin ? min1 : max1;
             oindex[1] = bMin ? min2 : max2;
-            write_trx(trxout, 2, oindex, atoms, i, t, box, x0, NULL, NULL);
+            write_trx(trxout, 2, oindex, atoms, i, t, box, x0, nullptr, nullptr);
         }
         bFirst = FALSE;
         /*dmin should be minimum distance for residue and group*/
@@ -556,7 +556,7 @@ void dist_plot(const char *fn, const char *afile, const char *dfile,
     }
     while (read_next_x(oenv, status, &t, x0, box));
 
-    close_trj(status);
+    close_trx(status);
     xvgrclose(dist);
     if (num)
     {
@@ -597,7 +597,7 @@ void dist_plot(const char *fn, const char *afile, const char *dfile,
     sfree(x0);
 }
 
-int find_residues(const t_atoms *atoms, int n, int index[], int **resindex)
+static int find_residues(const t_atoms *atoms, int n, int index[], int **resindex)
 {
     int  i;
     int  nres      = 0, resnr, presnr = 0;
@@ -629,7 +629,7 @@ int find_residues(const t_atoms *atoms, int n, int index[], int **resindex)
     return nres;
 }
 
-void dump_res(FILE *out, int nres, int *resindex, int index[])
+static void dump_res(FILE *out, int nres, int *resindex, int index[])
 {
     int i, j;
 
@@ -694,7 +694,7 @@ int gmx_mindist(int argc, char *argv[])
           "Write residue names" }
     };
     gmx_output_env_t *oenv;
-    t_topology       *top  = NULL;
+    t_topology       *top  = nullptr;
     int               ePBC = -1;
     rvec             *x;
     matrix            box;
@@ -704,11 +704,11 @@ int gmx_mindist(int argc, char *argv[])
     const char       *trxfnm, *tpsfnm, *ndxfnm, *distfnm, *numfnm, *atmfnm, *oxfnm, *resfnm;
     char            **grpname;
     int              *gnx;
-    int             **index, *residues = NULL;
+    int             **index, *residues = nullptr;
     t_filenm          fnm[] = {
-        { efTRX, "-f",  NULL,      ffREAD },
-        { efTPS,  NULL, NULL,      ffOPTRD },
-        { efNDX,  NULL, NULL,      ffOPTRD },
+        { efTRX, "-f",  nullptr,      ffREAD },
+        { efTPS,  nullptr, nullptr,      ffOPTRD },
+        { efNDX,  nullptr, nullptr,      ffOPTRD },
         { efXVG, "-od", "mindist",  ffWRITE },
         { efXVG, "-on", "numcont",  ffOPTWR },
         { efOUT, "-o", "atm-pair", ffOPTWR },
@@ -719,7 +719,7 @@ int gmx_mindist(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv,
                            PCA_CAN_VIEW | PCA_CAN_TIME | PCA_TIME_UNIT,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -731,7 +731,7 @@ int gmx_mindist(int argc, char *argv[])
     atmfnm  = ftp2fn_null(efOUT, NFILE, fnm);
     oxfnm   = opt2fn_null("-ox", NFILE, fnm);
     resfnm  = opt2fn_null("-or", NFILE, fnm);
-    if (bPI || resfnm != NULL)
+    if (bPI || resfnm != nullptr)
     {
         /* We need a tps file */
         tpsfnm = ftp2fn(efTPS, NFILE, fnm);
@@ -763,13 +763,13 @@ int gmx_mindist(int argc, char *argv[])
     if (tpsfnm || resfnm || !ndxfnm)
     {
         snew(top, 1);
-        bTop = read_tps_conf(tpsfnm, top, &ePBC, &x, NULL, box, FALSE);
+        bTop = read_tps_conf(tpsfnm, top, &ePBC, &x, nullptr, box, FALSE);
         if (bPI && !bTop)
         {
             printf("\nWARNING: Without a run input file a trajectory with broken molecules will not give the correct periodic image distance\n\n");
         }
     }
-    get_index(top ? &(top->atoms) : NULL, ndxfnm, ng, gnx, index, grpname);
+    get_index(top ? &(top->atoms) : nullptr, ndxfnm, ng, gnx, index, grpname);
 
     if (bMat && (ng == 1))
     {
@@ -791,7 +791,7 @@ int gmx_mindist(int argc, char *argv[])
 
     if (resfnm)
     {
-        GMX_RELEASE_ASSERT(top != NULL, "top pointer cannot be NULL when finding residues");
+        GMX_RELEASE_ASSERT(top != nullptr, "top pointer cannot be NULL when finding residues");
         nres = find_residues(&(top->atoms), gnx[0], index[0], &residues);
 
         if (debug)
@@ -807,7 +807,7 @@ int gmx_mindist(int argc, char *argv[])
     else
     {
         dist_plot(trxfnm, atmfnm, distfnm, numfnm, resfnm, oxfnm,
-                  rcutoff, bMat, top ? &(top->atoms) : NULL,
+                  rcutoff, bMat, top ? &(top->atoms) : nullptr,
                   ng, index, gnx, grpname, bSplit, !bMax, nres, residues, bPBC, ePBC,
                   bGroup, bEachResEachTime, bPrintResName, oenv);
     }
index 133c39d11c1a91324fbb9d81dc5a6e860a09db52..0609897bd22badcf2555a879f6cd0821e297e5ae 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,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,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.
@@ -208,7 +208,7 @@ static void fill_ang(int nft, int *ft, int fac,
 
 static int *select_ftype(const char *opt, int *nft, int *mult)
 {
-    int *ft = NULL, ftype;
+    int *ft = nullptr, ftype;
 
     if (opt[0] == 'a')
     {
@@ -255,7 +255,7 @@ int gmx_mk_angndx(int argc, char *argv[])
         "angle distributions etc. It uses a run input file ([REF].tpx[ref]) for the",
         "definitions of the angles, dihedrals etc."
     };
-    static const char *opt[] = { NULL, "angle", "dihedral", "improper", "ryckaert-bellemans", NULL };
+    static const char *opt[] = { nullptr, "angle", "dihedral", "improper", "ryckaert-bellemans", nullptr };
     static gmx_bool    bH    = TRUE;
     static real        hq    = -1;
     t_pargs            pa[]  = {
@@ -277,22 +277,22 @@ int gmx_mk_angndx(int argc, char *argv[])
     int               *nr;
     char             **grpnames;
     t_filenm           fnm[] = {
-        { efTPR, NULL, NULL, ffREAD  },
-        { efNDX, NULL, "angle", ffWRITE }
+        { efTPR, nullptr, nullptr, ffREAD  },
+        { efNDX, nullptr, "angle", ffWRITE }
     };
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, 0, NFILE, fnm, asize(pa), pa,
-                           asize(desc), desc, 0, NULL, &oenv))
+                           asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
 
-    GMX_RELEASE_ASSERT(opt[0] != 0, "Options inconsistency; opt[0] is NULL");
+    GMX_RELEASE_ASSERT(opt[0] != nullptr, "Options inconsistency; opt[0] is NULL");
 
     ft = select_ftype(opt[0], &nft, &mult);
 
-    top = read_top(ftp2fn(efTPR, NFILE, fnm), NULL);
+    top = read_top(ftp2fn(efTPR, NFILE, fnm), nullptr);
 
     ntype = calc_ntype(nft, ft, &(top->idef));
     snew(grpnames, ntype);
index 9378205c5cf10406bc7dbbc1cddbf5af9b21a17a..20618e09ad9aa0d473e0583ff8b766fcee7b1ca3 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,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.
@@ -112,7 +112,7 @@ int gmx_morph(int argc, char *argv[])
           "Do a least squares fit of the second to the first structure before interpolating" }
     };
     const char       *leg[] = { "Ref = 1\\Sst\\N conf", "Ref = 2\\Snd\\N conf" };
-    FILE             *fp    = NULL;
+    FILE             *fp    = nullptr;
     int               i, isize, is_lsq, nat1, nat2;
     t_trxstatus      *status;
     int              *index, *index_lsq, *index_all, *dummy;
@@ -125,16 +125,16 @@ int gmx_morph(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc,
-                           0, NULL, &oenv))
+                           0, nullptr, &oenv))
     {
         return 0;
     }
 
     t_topology *top;
     snew(top, 1);
-    read_tps_conf(opt2fn("-f1", NFILE, fnm), top, NULL, &x1, NULL, box, FALSE);
+    read_tps_conf(opt2fn("-f1", NFILE, fnm), top, nullptr, &x1, nullptr, box, FALSE);
     nat1 = top->atoms.nr;
-    read_tps_conf(opt2fn("-f2", NFILE, fnm), top, NULL, &x2, NULL, box, FALSE);
+    read_tps_conf(opt2fn("-f2", NFILE, fnm), top, nullptr, &x2, nullptr, box, FALSE);
     nat2 = top->atoms.nr;
     if (nat1 != nat2)
     {
@@ -183,7 +183,7 @@ int gmx_morph(int argc, char *argv[])
     for (i = 0; (i < ninterm); i++)
     {
         fac = dointerp(nat1, x1, x2, xx, i, ninterm, first, last);
-        write_trx(status, nat1, dummy, &atoms, i, fac, box, xx, NULL, NULL);
+        write_trx(status, nat1, dummy, &atoms, i, fac, box, xx, nullptr, nullptr);
         if (bRMS)
         {
             rms1 = rmsdev_ind(isize, index, mass, x1, xx);
index 5b14f33049a648254f06891ce75a81bc2d91a1c1..eabc5a6ea47e675752ab1ea2ec331d21e7818b48 100644 (file)
@@ -109,9 +109,9 @@ static gmx_bool in_data(t_corr *curr, int nx00)
     return curr->nframes-curr->n_offs[nx00];
 }
 
-t_corr *init_corr(int nrgrp, int type, int axis, real dim_factor,
-                  int nmol, gmx_bool bTen, gmx_bool bMass, real dt, const t_topology *top,
-                  real beginfit, real endfit)
+static t_corr *init_corr(int nrgrp, int type, int axis, real dim_factor,
+                         int nmol, gmx_bool bTen, gmx_bool bMass, real dt, const t_topology *top,
+                         real beginfit, real endfit)
 {
     t_corr  *curr;
     int      i;
@@ -124,8 +124,8 @@ t_corr *init_corr(int nrgrp, int type, int axis, real dim_factor,
     curr->delta_t    = dt;
     curr->beginfit   = (1 - 2*GMX_REAL_EPS)*beginfit;
     curr->endfit     = (1 + 2*GMX_REAL_EPS)*endfit;
-    curr->x0         = NULL;
-    curr->n_offs     = NULL;
+    curr->x0         = nullptr;
+    curr->n_offs     = nullptr;
     curr->nframes    = 0;
     curr->nlast      = 0;
     curr->dim_factor = dim_factor;
@@ -138,15 +138,15 @@ t_corr *init_corr(int nrgrp, int type, int axis, real dim_factor,
     }
     for (i = 0; (i < nrgrp); i++)
     {
-        curr->ndata[i] = NULL;
-        curr->data[i]  = NULL;
+        curr->ndata[i] = nullptr;
+        curr->data[i]  = nullptr;
         if (bTen)
         {
-            curr->datam[i] = NULL;
+            curr->datam[i] = nullptr;
         }
     }
-    curr->time = NULL;
-    curr->lsq  = NULL;
+    curr->time = nullptr;
+    curr->lsq  = nullptr;
     curr->nmol = nmol;
     if (curr->nmol > 0)
     {
@@ -185,9 +185,9 @@ static void corr_print(t_corr *curr, gmx_bool bTen, const char *fn, const char *
     if (DD)
     {
         fprintf(out, "# MSD gathered over %g %s with %d restarts\n",
-                msdtime, output_env_get_time_unit(oenv), curr->nrestart);
+                msdtime, output_env_get_time_unit(oenv).c_str(), curr->nrestart);
         fprintf(out, "# Diffusion constants fitted from time %g to %g %s\n",
-                beginfit, endfit, output_env_get_time_unit(oenv));
+                beginfit, endfit, output_env_get_time_unit(oenv).c_str());
         for (i = 0; i < curr->ngrp; i++)
         {
             fprintf(out, "# D[%10s] = %.4f (+/- %.4f) (1e-5 cm^2/s)\n",
@@ -553,8 +553,8 @@ static void printmol(t_corr *curr, const char *fn,
     gmx_stats_t lsq1;
     int         i, j;
     real        a, b, D, Dav, D2av, VarD, sqrtD, sqrtD_max, scale;
-    t_pdbinfo  *pdbinfo = NULL;
-    const int  *mol2a   = NULL;
+    t_pdbinfo  *pdbinfo = nullptr;
+    const int  *mol2a   = nullptr;
 
     out = xvgropen(fn, "Diffusion Coefficients / Molecule", "Molecule", "D", oenv);
 
@@ -578,7 +578,7 @@ static void printmol(t_corr *curr, const char *fn,
                 gmx_stats_add_point(lsq1, xx, yy, dx, dy);
             }
         }
-        gmx_stats_get_ab(lsq1, elsqWEIGHT_NONE, &a, &b, NULL, NULL, NULL, NULL);
+        gmx_stats_get_ab(lsq1, elsqWEIGHT_NONE, &a, &b, nullptr, nullptr, nullptr, nullptr);
         gmx_stats_free(lsq1);
         D     = a*FACTOR/curr->dim_factor;
         if (D < 0)
@@ -622,12 +622,12 @@ static void printmol(t_corr *curr, const char *fn,
         {
             scale *= 10;
         }
-        GMX_RELEASE_ASSERT(pdbinfo != NULL, "Internal error - pdbinfo not set for PDB input");
+        GMX_RELEASE_ASSERT(pdbinfo != nullptr, "Internal error - pdbinfo not set for PDB input");
         for (i = 0; i < top->atoms.nr; i++)
         {
             pdbinfo[i].bfac *= scale;
         }
-        write_sto_conf(fn_pdb, "molecular MSD", &top->atoms, x, NULL, ePBC, box);
+        write_sto_conf(fn_pdb, "molecular MSD", &top->atoms, x, nullptr, ePBC, box);
     }
 }
 
@@ -635,11 +635,11 @@ static void printmol(t_corr *curr, const char *fn,
  * fx and nx are file pointers to things like read_first_x and
  * read_next_x
  */
-int corr_loop(t_corr *curr, const char *fn, const t_topology *top, int ePBC,
-              gmx_bool bMol, int gnx[], int *index[],
-              t_calc_func *calc1, gmx_bool bTen, int *gnx_com, int *index_com[],
-              real dt, real t_pdb, rvec **x_pdb, matrix box_pdb,
-              const gmx_output_env_t *oenv)
+static int corr_loop(t_corr *curr, const char *fn, const t_topology *top, int ePBC,
+                     gmx_bool bMol, int gnx[], int *index[],
+                     t_calc_func *calc1, gmx_bool bTen, int *gnx_com, int *index_com[],
+                     real dt, real t_pdb, rvec **x_pdb, matrix box_pdb,
+                     const gmx_output_env_t *oenv)
 {
     rvec            *x[2];  /* the coordinates to read */
     rvec            *xa[2]; /* the coordinates to calculate displacements for */
@@ -650,13 +650,13 @@ int corr_loop(t_corr *curr, const char *fn, const t_topology *top, int ePBC,
 #define        prev (1-cur)
     matrix           box;
     gmx_bool         bFirst;
-    gmx_rmpbc_t      gpbc = NULL;
+    gmx_rmpbc_t      gpbc = nullptr;
 
     natoms = read_first_x(oenv, &status, fn, &curr->t0, &(x[cur]), box);
 #ifdef DEBUG
     fprintf(stderr, "Read %d atoms for first frame\n", natoms);
 #endif
-    if ((gnx_com != NULL) && natoms < top->atoms.nr)
+    if ((gnx_com != nullptr) && natoms < top->atoms.nr)
     {
         fprintf(stderr, "WARNING: The trajectory only contains part of the system (%d of %d atoms) and therefore the COM motion of only this part of the system will be removed\n", natoms, top->atoms.nr);
     }
@@ -680,7 +680,7 @@ int corr_loop(t_corr *curr, const char *fn, const t_topology *top, int ePBC,
     t      = curr->t0;
     if (x_pdb)
     {
-        *x_pdb = NULL;
+        *x_pdb = nullptr;
     }
 
     if (bMol)
@@ -696,7 +696,7 @@ int corr_loop(t_corr *curr, const char *fn, const t_topology *top, int ePBC,
                        t_pdb > t - 0.5*(t - t_prev) &&
                        t_pdb < t + 0.5*(t - t_prev))))
         {
-            if (*x_pdb == NULL)
+            if (*x_pdb == nullptr)
             {
                 snew(*x_pdb, natoms);
             }
@@ -737,14 +737,14 @@ int corr_loop(t_corr *curr, const char *fn, const t_topology *top, int ePBC,
             {
                 for (i = 0; (i < curr->ngrp); i++)
                 {
-                    curr->ndata[i] = NULL;
-                    curr->data[i]  = NULL;
+                    curr->ndata[i] = nullptr;
+                    curr->data[i]  = nullptr;
                     if (bTen)
                     {
-                        curr->datam[i] = NULL;
+                        curr->datam[i] = nullptr;
                     }
                 }
-                curr->time = NULL;
+                curr->time = nullptr;
             }
             maxframes += 10;
             for (i = 0; (i < curr->ngrp); i++)
@@ -808,7 +808,7 @@ int corr_loop(t_corr *curr, const char *fn, const t_topology *top, int ePBC,
         for (i = 0; (i < curr->ngrp); i++)
         {
             /* calculate something useful, like mean square displacements */
-            calc_corr(curr, i, gnx[i], index[i], xa[cur], (gnx_com != NULL), com,
+            calc_corr(curr, i, gnx[i], index[i], xa[cur], (gnx_com != nullptr), com,
                       calc1, bTen);
         }
         cur    = prev;
@@ -819,16 +819,16 @@ int corr_loop(t_corr *curr, const char *fn, const t_topology *top, int ePBC,
     while (read_next_x(oenv, status, &t, x[cur], box));
     fprintf(stderr, "\nUsed %d restart points spaced %g %s over %g %s\n\n",
             curr->nrestart,
-            output_env_conv_time(oenv, dt), output_env_get_time_unit(oenv),
+            output_env_conv_time(oenv, dt), output_env_get_time_unit(oenv).c_str(),
             output_env_conv_time(oenv, curr->time[curr->nframes-1]),
-            output_env_get_time_unit(oenv) );
+            output_env_get_time_unit(oenv).c_str() );
 
     if (bMol)
     {
         gmx_rmpbc_done(gpbc);
     }
 
-    close_trj(status);
+    close_trx(status);
 
     return natoms;
 }
@@ -867,12 +867,12 @@ static void index_atom2mol(int *n, int *index, const t_block *mols)
     *n = nmol;
 }
 
-void do_corr(const char *trx_file, const char *ndx_file, const char *msd_file,
-             const char *mol_file, const char *pdb_file, real t_pdb,
-             int nrgrp, t_topology *top, int ePBC,
-             gmx_bool bTen, gmx_bool bMW, gmx_bool bRmCOMM,
-             int type, real dim_factor, int axis,
-             real dt, real beginfit, real endfit, const gmx_output_env_t *oenv)
+static void do_corr(const char *trx_file, const char *ndx_file, const char *msd_file,
+                    const char *mol_file, const char *pdb_file, real t_pdb,
+                    int nrgrp, t_topology *top, int ePBC,
+                    gmx_bool bTen, gmx_bool bMW, gmx_bool bRmCOMM,
+                    int type, real dim_factor, int axis,
+                    real dt, real beginfit, real endfit, const gmx_output_env_t *oenv)
 {
     t_corr        *msd;
     int           *gnx;   /* the selected groups' sizes */
@@ -882,9 +882,9 @@ void do_corr(const char *trx_file, const char *ndx_file, const char *msd_file,
     real          *DD, *SigmaD, a, a2, b, r, chi2;
     rvec          *x;
     matrix         box;
-    int           *gnx_com     = NULL; /* the COM removal group size  */
-    int          **index_com   = NULL; /* the COM removal group atom indices */
-    char         **grpname_com = NULL; /* the COM removal group name */
+    int           *gnx_com     = nullptr; /* the COM removal group size  */
+    int          **index_com   = nullptr; /* the COM removal group atom indices */
+    char         **grpname_com = nullptr; /* the COM removal group name */
 
     snew(gnx, nrgrp);
     snew(index, nrgrp);
@@ -909,14 +909,14 @@ void do_corr(const char *trx_file, const char *ndx_file, const char *msd_file,
     }
 
     msd = init_corr(nrgrp, type, axis, dim_factor,
-                    mol_file == NULL ? 0 : gnx[0], bTen, bMW, dt, top,
+                    mol_file == nullptr ? 0 : gnx[0], bTen, bMW, dt, top,
                     beginfit, endfit);
 
     nat_trx =
         corr_loop(msd, trx_file, top, ePBC, mol_file ? gnx[0] : 0, gnx, index,
-                  (mol_file != NULL) ? calc1_mol : (bMW ? calc1_mw : calc1_norm),
+                  (mol_file != nullptr) ? calc1_mol : (bMW ? calc1_mw : calc1_norm),
                   bTen, gnx_com, index_com, dt, t_pdb,
-                  pdb_file ? &x : NULL, box, oenv);
+                  pdb_file ? &x : nullptr, box, oenv);
 
     /* Correct for the number of points */
     for (j = 0; (j < msd->ngrp); j++)
@@ -933,14 +933,14 @@ void do_corr(const char *trx_file, const char *ndx_file, const char *msd_file,
 
     if (mol_file)
     {
-        if (pdb_file && x == NULL)
+        if (pdb_file && x == nullptr)
         {
             fprintf(stderr, "\nNo frame found need time tpdb = %g ps\n"
                     "Can not write %s\n\n", t_pdb, pdb_file);
         }
         i             = top->atoms.nr;
         top->atoms.nr = nat_trx;
-        if (pdb_file && top->atoms.pdbinfo == NULL)
+        if (pdb_file && top->atoms.pdbinfo == nullptr)
         {
             snew(top->atoms.pdbinfo, top->atoms.nr);
         }
@@ -948,8 +948,8 @@ void do_corr(const char *trx_file, const char *ndx_file, const char *msd_file,
         top->atoms.nr = i;
     }
 
-    DD     = NULL;
-    SigmaD = NULL;
+    DD     = nullptr;
+    SigmaD = nullptr;
 
     if (beginfit == -1)
     {
@@ -977,7 +977,7 @@ void do_corr(const char *trx_file, const char *ndx_file, const char *msd_file,
         }
     }
     fprintf(stdout, "Fitting from %g to %g %s\n\n", beginfit, endfit,
-            output_env_get_time_unit(oenv));
+            output_env_get_time_unit(oenv).c_str());
 
     N = i1-i0;
     if (N <= 2)
@@ -1069,8 +1069,8 @@ int gmx_msd(int argc, char *argv[])
         "the diffusion coefficient of the molecule.",
         "This option implies option [TT]-mol[tt]."
     };
-    static const char *normtype[] = { NULL, "no", "x", "y", "z", NULL };
-    static const char *axtitle[]  = { NULL, "no", "x", "y", "z", NULL };
+    static const char *normtype[] = { nullptr, "no", "x", "y", "z", nullptr };
+    static const char *axtitle[]  = { nullptr, "no", "x", "y", "z", nullptr };
     static int         ngroup     = 1;
     static real        dt         = 10;
     static real        t_pdb      = 0;
@@ -1103,10 +1103,10 @@ int gmx_msd(int argc, char *argv[])
     };
 
     t_filenm           fnm[] = {
-        { efTRX, NULL, NULL,  ffREAD },
-        { efTPS, NULL, NULL,  ffREAD },
-        { efNDX, NULL, NULL,  ffOPTRD },
-        { efXVG, NULL, "msd", ffWRITE },
+        { efTRX, nullptr, nullptr,  ffREAD },
+        { efTPS, nullptr, nullptr,  ffREAD },
+        { efNDX, nullptr, nullptr,  ffOPTRD },
+        { efXVG, nullptr, "msd", ffWRITE },
         { efXVG, "-mol", "diff_mol", ffOPTWR },
         { efPDB, "-pdb", "diff_mol", ffOPTWR }
     };
@@ -1124,7 +1124,7 @@ int gmx_msd(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv,
                            PCA_CAN_VIEW | PCA_CAN_BEGIN | PCA_CAN_END | PCA_TIME_UNIT,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -1159,8 +1159,8 @@ int gmx_msd(int argc, char *argv[])
         fprintf(stderr, "Calculating diffusion coefficients for molecules.\n");
     }
 
-    GMX_RELEASE_ASSERT(normtype[0] != 0, "Options inconsistency; normtype[0] is NULL");
-    GMX_RELEASE_ASSERT(axtitle[0] != 0, "Options inconsistency; axtitle[0] is NULL");
+    GMX_RELEASE_ASSERT(normtype[0] != nullptr, "Options inconsistency; normtype[0] is NULL");
+    GMX_RELEASE_ASSERT(axtitle[0] != nullptr, "Options inconsistency; axtitle[0] is NULL");
 
     if (normtype[0][0] != 'n')
     {
@@ -1188,7 +1188,7 @@ int gmx_msd(int argc, char *argv[])
         gmx_fatal(FARGS, "Can only calculate the full tensor for 3D msd");
     }
 
-    bTop = read_tps_conf(tps_file, &top, &ePBC, &xdum, NULL, box, bMW || bRmCOMM);
+    bTop = read_tps_conf(tps_file, &top, &ePBC, &xdum, nullptr, box, bMW || bRmCOMM);
     if (mol_file && !bTop)
     {
         gmx_fatal(FARGS,
index 531c004308585b3300d9337fc5608c0b9a972aa0..71b7b558f01f2144bb0e17e2a865b2fa99fc1781 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,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.
@@ -108,22 +108,6 @@ static size_t get_nharm_mt(const gmx_moltype_t *mt)
     return nh;
 }
 
-static size_t get_nvsite_mt(gmx_moltype_t *mt)
-{
-    static int   vs_func[] = {
-        F_VSITE2, F_VSITE3, F_VSITE3FD, F_VSITE3FAD,
-        F_VSITE3OUT, F_VSITE4FD, F_VSITE4FDN, F_VSITEN
-    };
-    int          i, ft;
-    size_t       nh = 0;
-    for (i = 0; (i < asize(vs_func)); i++)
-    {
-        ft  = vs_func[i];
-        nh += mt->ilist[ft].nr/(interaction_function[ft].nratoms+1);
-    }
-    return nh;
-}
-
 static int get_nharm(const gmx_mtop_t *mtop)
 {
     int nh = 0;
@@ -179,7 +163,7 @@ nma_full_hessian(real                      *hess,
     eigensolver(hess, ndim, begin-1, end-1, eigenvalues, eigenvectors);
 
     /* And scale the output eigenvectors */
-    if (bM && eigenvectors != NULL)
+    if (bM && eigenvectors != nullptr)
     {
         for (int i = 0; i < (end-begin+1); i++)
         {
@@ -218,7 +202,7 @@ nma_sparse_hessian(gmx_sparsematrix_t        *sparse_hessian,
     /* Cannot check symmetry since we only store half matrix */
     /* divide elements hess[i][j] by sqrt(mas[i])*sqrt(mas[j]) when required */
 
-    GMX_RELEASE_ASSERT(sparse_hessian != NULL, "NULL matrix pointer provided to nma_sparse_hessian");
+    GMX_RELEASE_ASSERT(sparse_hessian != nullptr, "NULL matrix pointer provided to nma_sparse_hessian");
 
     if (bM)
     {
@@ -245,7 +229,7 @@ nma_sparse_hessian(gmx_sparsematrix_t        *sparse_hessian,
     sparse_eigensolver(sparse_hessian, neig, eigenvalues, eigenvectors, 10000000);
 
     /* Scale output eigenvectors */
-    if (bM && eigenvectors != NULL)
+    if (bM && eigenvectors != nullptr)
     {
         for (i = 0; i < neig; i++)
         {
@@ -362,19 +346,19 @@ int gmx_nmeig(int argc, char *argv[])
     real                   value, omega, nu;
     real                   factor_gmx_to_omega2;
     real                   factor_omega_to_wavenumber;
-    real                  *spectrum = NULL;
+    real                  *spectrum = nullptr;
     real                   wfac;
     gmx_output_env_t      *oenv;
     const char            *qcleg[] = {
         "Heat Capacity cV (J/mol K)",
         "Enthalpy H (kJ/mol)"
     };
-    real *                 full_hessian   = NULL;
-    gmx_sparsematrix_t *   sparse_hessian = NULL;
+    real *                 full_hessian   = nullptr;
+    gmx_sparsematrix_t *   sparse_hessian = nullptr;
 
     t_filenm               fnm[] = {
         { efMTX, "-f", "hessian",    ffREAD  },
-        { efTPR, NULL, NULL,         ffREAD  },
+        { efTPR, nullptr, nullptr,         ffREAD  },
         { efXVG, "-of", "eigenfreq", ffWRITE },
         { efXVG, "-ol", "eigenval",  ffWRITE },
         { efXVG, "-os", "spectrum",  ffOPTWR },
@@ -384,7 +368,7 @@ int gmx_nmeig(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, 0,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -394,8 +378,8 @@ int gmx_nmeig(int argc, char *argv[])
     snew(top_x, tpx.natoms);
 
     int natoms_tpx;
-    read_tpx(ftp2fn(efTPR, NFILE, fnm), NULL, box, &natoms_tpx,
-             top_x, NULL, &mtop);
+    read_tpx(ftp2fn(efTPR, NFILE, fnm), nullptr, box, &natoms_tpx,
+             top_x, nullptr, &mtop);
     int nharm = 0;
     if (bCons)
     {
@@ -403,7 +387,7 @@ int gmx_nmeig(int argc, char *argv[])
     }
     std::vector<size_t> atom_index = get_atom_index(&mtop);
 
-    top = gmx_mtop_t_to_t_topology(&mtop);
+    top = gmx_mtop_t_to_t_topology(&mtop, true);
 
     bM       = TRUE;
     int ndim = DIM*atom_index.size();
@@ -431,7 +415,7 @@ int gmx_nmeig(int argc, char *argv[])
      * If this is not valid we convert to full matrix storage,
      * but warn the user that we might run out of memory...
      */
-    if ((sparse_hessian != NULL) && (end == ndim))
+    if ((sparse_hessian != nullptr) && (end == ndim))
     {
         fprintf(stderr, "Cannot use sparse Hessian to calculate all eigenvectors.\n");
 
@@ -464,13 +448,13 @@ int gmx_nmeig(int argc, char *argv[])
             }
         }
         gmx_sparsematrix_destroy(sparse_hessian);
-        sparse_hessian = NULL;
+        sparse_hessian = nullptr;
         fprintf(stderr, "Converted sparse to full matrix storage.\n");
     }
 
     snew(eigenvalues, nrow);
 
-    if (full_hessian != NULL)
+    if (full_hessian != nullptr)
     {
         /* Using full matrix storage */
         eigenvectors = allocateEigenvectors(nrow, begin, end, false);
@@ -535,7 +519,7 @@ int gmx_nmeig(int argc, char *argv[])
     }
     else
     {
-        qc = NULL;
+        qc = nullptr;
     }
     printf("Writing eigenfrequencies - negative eigenvalues will be set to zero.\n");
 
@@ -554,7 +538,7 @@ int gmx_nmeig(int argc, char *argv[])
         }
     }
     /* Spectrum ? */
-    spec = NULL;
+    spec = nullptr;
     if (opt2bSet("-os", NFILE, fnm) && (maxspec > 0))
     {
         snew(spectrum, maxspec);
@@ -591,7 +575,7 @@ int gmx_nmeig(int argc, char *argv[])
         nu    = 1e-12*omega/(2*M_PI);
         value = omega*factor_omega_to_wavenumber;
         fprintf (out, "%6d %15g\n", i, value);
-        if (NULL != spec)
+        if (nullptr != spec)
         {
             wfac = eigenvalues[i-begin]/(width*std::sqrt(2*M_PI));
             for (j = 0; (j < maxspec); j++)
@@ -599,7 +583,7 @@ int gmx_nmeig(int argc, char *argv[])
                 spectrum[j] += wfac*std::exp(-gmx::square(j-value)/(2*gmx::square(width)));
             }
         }
-        if (NULL != qc)
+        if (nullptr != qc)
         {
             qcv = cv_corr(nu, T);
             qu  = u_corr(nu, T);
@@ -614,7 +598,7 @@ int gmx_nmeig(int argc, char *argv[])
         }
     }
     xvgrclose(out);
-    if (NULL != spec)
+    if (nullptr != spec)
     {
         for (j = 0; (j < maxspec); j++)
         {
@@ -622,7 +606,7 @@ int gmx_nmeig(int argc, char *argv[])
         }
         xvgrclose(spec);
     }
-    if (NULL != qc)
+    if (nullptr != qc)
     {
         printf("Quantum corrections for harmonic degrees of freedom\n");
         printf("Use appropriate -first and -last options to get reliable results.\n");
@@ -638,7 +622,7 @@ int gmx_nmeig(int argc, char *argv[])
      * will not be strictly orthogonal in plain cartesian scalar products.
      */
     const real *eigenvectorPtr;
-    if (full_hessian != NULL)
+    if (full_hessian != nullptr)
     {
         eigenvectorPtr = eigenvectors;
     }
@@ -648,7 +632,7 @@ int gmx_nmeig(int argc, char *argv[])
         eigenvectorPtr = eigenvectors + (begin - 1)*atom_index.size();
     }
     write_eigenvectors(opt2fn("-v", NFILE, fnm), atom_index.size(), eigenvectorPtr, FALSE, begin, end,
-                       eWXR_NO, NULL, FALSE, top_x, bM, eigenvalues);
+                       eWXR_NO, nullptr, FALSE, top_x, bM, eigenvalues);
 
     return 0;
 }
index 235f1b20ba9255c09241a2a32983ef14fc162ab9..0157f7d132cecd6e048a1208ae7386063d5feee0 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,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.
@@ -92,8 +92,8 @@ int gmx_nmens(int argc, char *argv[])
     t_atoms            *atoms;
     rvec               *xtop, *xref, *xav, *xout1, *xout2;
     gmx_bool            bDMR, bDMA, bFit;
-    int                 nvec, *eignr = NULL;
-    rvec              **eigvec = NULL;
+    int                 nvec, *eignr = nullptr;
+    rvec              **eigvec = nullptr;
     matrix              box;
     real               *eigval, *invsqrtm, t, disp;
     int                 natoms;
@@ -113,14 +113,14 @@ int gmx_nmens(int argc, char *argv[])
     t_filenm fnm[] = {
         { efTRN, "-v",    "eigenvec",    ffREAD  },
         { efXVG, "-e",    "eigenval",    ffREAD  },
-        { efTPS, NULL,    NULL,          ffREAD },
-        { efNDX, NULL,    NULL,          ffOPTRD },
+        { efTPS, nullptr,    nullptr,          ffREAD },
+        { efNDX, nullptr,    nullptr,          ffOPTRD },
         { efTRO, "-o",    "ensemble",    ffWRITE }
     };
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, 0,
-                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -130,7 +130,7 @@ int gmx_nmens(int argc, char *argv[])
     read_eigenvectors(opt2fn("-v", NFILE, fnm), &natoms, &bFit,
                       &xref, &bDMR, &xav, &bDMA, &nvec, &eignr, &eigvec, &eigval);
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, NULL, box, bDMA);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, nullptr, box, bDMA);
     atoms = &top.atoms;
 
     printf("\nSelect an index group of %d elements that corresponds to the eigenvectors\n", natoms);
@@ -176,7 +176,7 @@ int gmx_nmens(int argc, char *argv[])
     {
         printf("Select eigenvectors for output, end your selection with 0\n");
         nout = -1;
-        iout = NULL;
+        iout = nullptr;
         do
         {
             nout++;
@@ -268,7 +268,7 @@ int gmx_nmens(int argc, char *argv[])
             copy_rvec(xout1[i], xout2[index[i]]);
         }
         t = s+1;
-        write_trx(out, natoms, index, atoms, 0, t, box, xout2, NULL, NULL);
+        write_trx(out, natoms, index, atoms, 0, t, box, xout2, nullptr, nullptr);
         fprintf(stderr, "\rGenerated %d structures", s+1);
         fflush(stderr);
     }
index 3870a107450c5258e42dea0d7af9f4db4e488e68..63354ff9e0ee663e856b9a8210e65888d31990f7 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,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.
@@ -100,8 +100,8 @@ int gmx_nmtraj(int argc, char *argv[])
     int               ePBC;
     t_atoms          *atoms;
     rvec             *xtop, *xref, *xav, *xout;
-    int               nvec, *eignr = NULL;
-    rvec            **eigvec = NULL;
+    int               nvec, *eignr = nullptr;
+    rvec            **eigvec = nullptr;
     matrix            box;
     int               natoms;
     int               i, j, k, kmode, d;
@@ -124,7 +124,7 @@ int gmx_nmtraj(int argc, char *argv[])
 
     t_filenm          fnm[] =
     {
-        { efTPS, NULL,    NULL,          ffREAD },
+        { efTPS, nullptr,    nullptr,          ffREAD },
         { efTRN, "-v",    "eigenvec",    ffREAD  },
         { efTRO, "-o",    "nmtraj",      ffWRITE }
     };
@@ -132,7 +132,7 @@ int gmx_nmtraj(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, 0,
-                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -140,7 +140,7 @@ int gmx_nmtraj(int argc, char *argv[])
     read_eigenvectors(opt2fn("-v", NFILE, fnm), &natoms, &bFit,
                       &xref, &bDMR, &xav, &bDMA, &nvec, &eignr, &eigvec, &eigval);
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, NULL, box, bDMA);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, nullptr, box, bDMA);
 
     /* Find vectors and phases */
 
@@ -322,7 +322,7 @@ int gmx_nmtraj(int argc, char *argv[])
                 }
             }
         }
-        write_trx(out, natoms, dummy, atoms, i, static_cast<real>(i)/nframes, box, xout, NULL, NULL);
+        write_trx(out, natoms, dummy, atoms, i, static_cast<real>(i)/nframes, box, xout, nullptr, nullptr);
     }
 
     fprintf(stderr, "\n");
index 1f1bad24f57028e9b7fcabefccfd91f75b857dba..674046c64ea69a5a14a21aa7c925593e07e961f3 100644 (file)
@@ -258,7 +258,7 @@ static void calc_tetra_order_parm(const char *fnNDX, const char *fnTPS,
                                   const char *sgslfn, const char *skslfn,
                                   const gmx_output_env_t *oenv)
 {
-    FILE        *fpsg = NULL, *fpsk = NULL;
+    FILE        *fpsg = nullptr, *fpsk = nullptr;
     t_topology   top;
     int          ePBC;
     t_trxstatus *status;
@@ -271,10 +271,10 @@ static void calc_tetra_order_parm(const char *fnNDX, const char *fnTPS,
     char       **grpname;
     int          i, *isize, ng, nframes;
     real        *sg_slice, *sg_slice_tot, *sk_slice, *sk_slice_tot;
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
 
 
-    read_tps_conf(fnTPS, &top, &ePBC, &xtop, NULL, box, FALSE);
+    read_tps_conf(fnTPS, &top, &ePBC, &xtop, nullptr, box, FALSE);
 
     snew(sg_slice, nslice);
     snew(sk_slice, nslice);
@@ -295,7 +295,7 @@ static void calc_tetra_order_parm(const char *fnNDX, const char *fnTPS,
         gmx_fatal(FARGS, "Topology (%d atoms) does not match trajectory (%d atoms)",
                   top.atoms.nr, natoms);
     }
-    check_index(NULL, ng, index[0], NULL, natoms);
+    check_index(nullptr, ng, index[0], nullptr, natoms);
 
     fpsg = xvgropen(sgfn, "S\\sg\\N Angle Order Parameter", "Time (ps)", "S\\sg\\N",
                     oenv);
@@ -319,7 +319,7 @@ static void calc_tetra_order_parm(const char *fnNDX, const char *fnTPS,
         nframes++;
     }
     while (read_next_x(oenv, status, &t, x, box));
-    close_trj(status);
+    close_trx(status);
     gmx_rmpbc_done(gpbc);
 
     sfree(grpname);
@@ -372,12 +372,12 @@ static void check_length(real length, int a, int b)
     }
 }
 
-void calc_order(const char *fn, int *index, int *a, rvec **order,
-                real ***slOrder, real *slWidth, int nslices, gmx_bool bSliced,
-                gmx_bool bUnsat, const t_topology *top, int ePBC, int ngrps, int axis,
-                gmx_bool permolecule, gmx_bool radial, gmx_bool distcalc, const char *radfn,
-                real ***distvals,
-                const gmx_output_env_t *oenv)
+static void calc_order(const char *fn, int *index, int *a, rvec **order,
+                       real ***slOrder, real *slWidth, int nslices, gmx_bool bSliced,
+                       gmx_bool bUnsat, const t_topology *top, int ePBC, int ngrps, int axis,
+                       gmx_bool permolecule, gmx_bool radial, gmx_bool distcalc, const char *radfn,
+                       real ***distvals,
+                       const gmx_output_env_t *oenv)
 {
     /* if permolecule = TRUE, order parameters will be calculed per molecule
      * and stored in slOrder with #slices = # molecules */
@@ -405,11 +405,11 @@ void calc_order(const char *fn, int *index, int *a, rvec **order,
     gmx_bool     use_unitvector         = FALSE; /* use a specified unit vector instead of axis to specify unit normal*/
     rvec         direction, com, dref, dvec;
     int          comsize, distsize;
-    int         *comidx  = NULL, *distidx = NULL;
-    char        *grpname = NULL;
+    int         *comidx  = nullptr, *distidx = nullptr;
+    char        *grpname = nullptr;
     t_pbc        pbc;
     real         arcdist, tmpdist;
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
 
     /* PBC added for center-of-mass vector*/
     /* Initiate the pbc structure */
@@ -440,7 +440,7 @@ void calc_order(const char *fn, int *index, int *a, rvec **order,
     }
     if (distcalc)
     {
-        if (grpname != NULL)
+        if (grpname != nullptr)
         {
             sfree(grpname);
         }
@@ -736,24 +736,24 @@ void calc_order(const char *fn, int *index, int *a, rvec **order,
 
     sfree(x0); /* free memory used by coordinate arrays */
     sfree(x1);
-    if (comidx != NULL)
+    if (comidx != nullptr)
     {
         sfree(comidx);
     }
-    if (distidx != NULL)
+    if (distidx != nullptr)
     {
         sfree(distidx);
     }
-    if (grpname != NULL)
+    if (grpname != nullptr)
     {
         sfree(grpname);
     }
 }
 
 
-void order_plot(rvec order[], real *slOrder[], const char *afile, const char *bfile,
-                const char *cfile, int ngrps, int nslices, real slWidth, gmx_bool bSzonly,
-                gmx_bool permolecule, real **distvals, const gmx_output_env_t *oenv)
+static void order_plot(rvec order[], real *slOrder[], const char *afile, const char *bfile,
+                       const char *cfile, int ngrps, int nslices, real slWidth, gmx_bool bSzonly,
+                       gmx_bool permolecule, real **distvals, const gmx_output_env_t *oenv)
 {
     FILE       *ord, *slOrd;      /* xvgr files with order parameters  */
     int         atom, slice;      /* atom corresponding to order para.*/
@@ -832,7 +832,7 @@ void order_plot(rvec order[], real *slOrder[], const char *afile, const char *bf
     xvgrclose(slOrd);
 }
 
-void write_bfactors(t_filenm  *fnm, int nfile, int *index, int *a, int nslices, int ngrps, real **order, const t_topology *top, real **distvals, gmx_output_env_t *oenv)
+static void write_bfactors(t_filenm  *fnm, int nfile, int *index, int *a, int nslices, int ngrps, real **order, const t_topology *top, real **distvals, gmx_output_env_t *oenv)
 {
     /*function to write order parameters as B factors in PDB file using
           first frame of trajectory*/
@@ -846,12 +846,12 @@ void write_bfactors(t_filenm  *fnm, int nfile, int *index, int *a, int nslices,
     nout   = nslices*ngrps;
     read_first_frame(oenv, &status, ftp2fn(efTRX, nfile, fnm), &fr, TRX_NEED_X);
 
-    close_trj(status);
+    close_trx(status);
     frout        = fr;
     frout.natoms = nout;
     frout.bF     = FALSE;
     frout.bV     = FALSE;
-    frout.x      = 0;
+    frout.x      = nullptr;
     snew(frout.x, nout);
 
     init_t_atoms(&useatoms, nout, TRUE);
@@ -884,7 +884,7 @@ void write_bfactors(t_filenm  *fnm, int nfile, int *index, int *a, int nslices,
         }
     }
 
-    write_sto_conf(opt2fn("-ob", nfile, fnm), "Order parameters", &useatoms, frout.x, NULL, frout.ePBC, frout.box);
+    write_sto_conf(opt2fn("-ob", nfile, fnm), "Order parameters", &useatoms, frout.x, nullptr, frout.ePBC, frout.box);
 
     sfree(frout.x);
     done_atom(&useatoms);
@@ -916,7 +916,7 @@ int gmx_order(int argc, char *argv[])
     static int         nslices       = 1;     /* nr of slices defined       */
     static gmx_bool    bSzonly       = FALSE; /* True if only Sz is wanted  */
     static gmx_bool    bUnsat        = FALSE; /* True if carbons are unsat. */
-    static const char *normal_axis[] = { NULL, "z", "x", "y", NULL };
+    static const char *normal_axis[] = { nullptr, "z", "x", "y", nullptr };
     static gmx_bool    permolecule   = FALSE; /*compute on a per-molecule basis */
     static gmx_bool    radial        = FALSE; /*compute a radial membrane normal */
     static gmx_bool    distcalc      = FALSE; /*calculate distance from a reference group */
@@ -952,13 +952,13 @@ int gmx_order(int argc, char *argv[])
     *a;                                               /* atom numbers in each group */
     t_blocka         *block;                          /* data from index file       */
     t_filenm          fnm[] = {                       /* files for g_order    */
-        { efTRX, "-f", NULL,  ffREAD },               /* trajectory file              */
-        { efNDX, "-n", NULL,  ffREAD },               /* index file           */
-        { efNDX, "-nr", NULL,  ffOPTRD },             /* index for radial axis calculation */
-        { efTPR, NULL, NULL,  ffREAD },               /* topology file                */
+        { efTRX, "-f", nullptr,  ffREAD },            /* trajectory file              */
+        { efNDX, "-n", nullptr,  ffREAD },            /* index file           */
+        { efNDX, "-nr", nullptr,  ffOPTRD },          /* index for radial axis calculation */
+        { efTPR, nullptr, nullptr,  ffREAD },         /* topology file                */
         { efXVG, "-o", "order", ffWRITE },            /* xvgr output file     */
         { efXVG, "-od", "deuter", ffWRITE },          /* xvgr output file           */
-        { efPDB, "-ob", NULL, ffOPTWR },              /* write Scd as B factors to PDB if permolecule           */
+        { efPDB, "-ob", nullptr, ffOPTWR },           /* write Scd as B factors to PDB if permolecule           */
         { efXVG, "-os", "sliced", ffWRITE },          /* xvgr output file           */
         { efXVG, "-Sg", "sg-ang", ffOPTWR },          /* xvgr output file           */
         { efXVG, "-Sk", "sk-dist", ffOPTWR },         /* xvgr output file           */
@@ -967,12 +967,12 @@ int gmx_order(int argc, char *argv[])
     };
     gmx_bool          bSliced = FALSE;                /* True if box is sliced      */
 #define NFILE asize(fnm)
-    real            **distvals = NULL;
+    real            **distvals = nullptr;
     const char       *sgfnm, *skfnm, *ndxfnm, *tpsfnm, *trxfnm;
     gmx_output_env_t *oenv;
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -987,7 +987,7 @@ int gmx_order(int argc, char *argv[])
     trxfnm = ftp2fn(efTRX, NFILE, fnm);
 
     /* Calculate axis */
-    GMX_RELEASE_ASSERT(normal_axis[0] != NULL, "Options inconsistency; normal_axis[0] is NULL");
+    GMX_RELEASE_ASSERT(normal_axis[0] != nullptr, "Options inconsistency; normal_axis[0] is NULL");
     if (std::strcmp(normal_axis[0], "x") == 0)
     {
         axis = XX;
@@ -1028,12 +1028,12 @@ int gmx_order(int argc, char *argv[])
                               opt2fn("-Sgsl", NFILE, fnm), opt2fn("-Sksl", NFILE, fnm),
                               oenv);
         /* view xvgr files */
-        do_view(oenv, opt2fn("-Sg", NFILE, fnm), NULL);
-        do_view(oenv, opt2fn("-Sk", NFILE, fnm), NULL);
+        do_view(oenv, opt2fn("-Sg", NFILE, fnm), nullptr);
+        do_view(oenv, opt2fn("-Sk", NFILE, fnm), nullptr);
         if (nslices > 1)
         {
-            do_view(oenv, opt2fn("-Sgsl", NFILE, fnm), NULL);
-            do_view(oenv, opt2fn("-Sksl", NFILE, fnm), NULL);
+            do_view(oenv, opt2fn("-Sgsl", NFILE, fnm), nullptr);
+            do_view(oenv, opt2fn("-Sksl", NFILE, fnm), nullptr);
         }
     }
     else
@@ -1107,12 +1107,12 @@ int gmx_order(int argc, char *argv[])
         }
 
 
-        do_view(oenv, opt2fn("-o", NFILE, fnm), NULL);  /* view xvgr file */
-        do_view(oenv, opt2fn("-os", NFILE, fnm), NULL); /* view xvgr file */
-        do_view(oenv, opt2fn("-od", NFILE, fnm), NULL); /* view xvgr file */
+        do_view(oenv, opt2fn("-o", NFILE, fnm), nullptr);  /* view xvgr file */
+        do_view(oenv, opt2fn("-os", NFILE, fnm), nullptr); /* view xvgr file */
+        do_view(oenv, opt2fn("-od", NFILE, fnm), nullptr); /* view xvgr file */
     }
 
-    if (distvals != NULL)
+    if (distvals != nullptr)
     {
         for (i = 0; i < nslices; ++i)
         {
index 3f8b6ad6a7960ef1e86c350e085838ddf0f79bbf..b6d461196b664664a304b546adcf213aa2eae677 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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -41,9 +41,9 @@
 #include <algorithm>
 
 #include "gromacs/commandline/pargs.h"
+#include "gromacs/ewald/pme.h"
 #include "gromacs/fft/calcgrid.h"
 #include "gromacs/fileio/checkpoint.h"
-#include "gromacs/fileio/readinp.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/gmxana/gmx_ana.h"
 #include "gromacs/gmxlib/network.h"
 #include "gromacs/math/functions.h"
 #include "gromacs/math/units.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/mdlib/broadcaststructs.h"
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/mdtypes/state.h"
 #include "gromacs/random/threefry.h"
 #include "gromacs/random/uniformintdistribution.h"
 #include "gromacs/topology/mtop_util.h"
 #include "gromacs/utility/pleasecite.h"
 #include "gromacs/utility/smalloc.h"
 
-/* We use the same defines as in broadcaststructs.cpp here */
-#define  block_bc(cr,   d) gmx_bcast(     sizeof(d),     &(d), (cr))
-#define nblock_bc(cr, nr, d) gmx_bcast((nr)*sizeof((d)[0]), (d), (cr))
-#define   snew_bc(cr, d, nr) { if (!MASTER(cr)) {snew((d), (nr)); }}
 /* #define TAKETIME */
 /* #define DEBUG  */
 
@@ -457,7 +455,7 @@ static real estimate_reciprocal(
     real      tmp2   = 0;
     gmx_bool  bFraction;
 
-    int      *numbers = NULL;
+    int      *numbers = nullptr;
 
     /* Index variables for parallel work distribution */
     int startglobal, stopglobal;
@@ -817,7 +815,6 @@ static int prepare_x_q(real *q[], rvec *x[], const gmx_mtop_t *mtop, const rvec
     int                     i;
     int                     nq; /* number of charged particles */
     gmx_mtop_atomloop_all_t aloop;
-    t_atom                 *atom;
 
 
     if (MASTER(cr))
@@ -827,7 +824,7 @@ static int prepare_x_q(real *q[], rvec *x[], const gmx_mtop_t *mtop, const rvec
         nq = 0;
 
         aloop = gmx_mtop_atomloop_all_init(mtop);
-
+        const t_atom *atom;
         while (gmx_mtop_atomloop_all_next(aloop, &i, &atom))
         {
             if (is_charge(atom->q))
@@ -926,17 +923,17 @@ static void estimate_PME_error(t_inputinfo *info, const t_state *state,
                                const gmx_mtop_t *mtop, FILE *fp_out, gmx_bool bVerbose, unsigned int seed,
                                t_commrec *cr)
 {
-    rvec *x     = NULL; /* The coordinates */
-    real *q     = NULL; /* The charges     */
-    real  edir  = 0.0;  /* real space error */
-    real  erec  = 0.0;  /* reciprocal space error */
-    real  derr  = 0.0;  /* difference of real and reciprocal space error */
-    real  derr0 = 0.0;  /* difference of real and reciprocal space error */
-    real  beta  = 0.0;  /* splitting parameter beta */
-    real  beta0 = 0.0;  /* splitting parameter beta */
-    int   ncharges;     /* The number of atoms with charges */
-    int   nsamples;     /* The number of samples used for the calculation of the
-                         * self-energy error term */
+    rvec *x     = nullptr; /* The coordinates */
+    real *q     = nullptr; /* The charges     */
+    real  edir  = 0.0;     /* real space error */
+    real  erec  = 0.0;     /* reciprocal space error */
+    real  derr  = 0.0;     /* difference of real and reciprocal space error */
+    real  derr0 = 0.0;     /* difference of real and reciprocal space error */
+    real  beta  = 0.0;     /* splitting parameter beta */
+    real  beta0 = 0.0;     /* splitting parameter beta */
+    int   ncharges;        /* The number of atoms with charges */
+    int   nsamples;        /* The number of samples used for the calculation of the
+                            * self-energy error term */
     int   i = 0;
 
     if (MASTER(cr))
@@ -945,7 +942,7 @@ static void estimate_PME_error(t_inputinfo *info, const t_state *state,
     }
 
     /* Prepare an x and q array with only the charged atoms */
-    ncharges = prepare_x_q(&q, &x, mtop, state->x, cr);
+    ncharges = prepare_x_q(&q, &x, mtop, as_rvec_array(state->x.data()), cr);
     if (MASTER(cr))
     {
         calc_q2all(mtop, &(info->q2all), &(info->q2allnr));
@@ -1094,10 +1091,10 @@ int gmx_pme_error(int argc, char *argv[])
     real            user_beta = -1.0;
     real            fracself  = 1.0;
     t_inputinfo     info;
-    t_state         state;     /* The state from the tpr input file */
-    gmx_mtop_t      mtop;      /* The topology from the tpr input file */
-    t_inputrec     *ir = NULL; /* The inputrec from the tpr file */
-    FILE           *fp = NULL;
+    t_state         state;        /* The state from the tpr input file */
+    gmx_mtop_t      mtop;         /* The topology from the tpr input file */
+    t_inputrec     *ir = nullptr; /* The inputrec from the tpr file */
+    FILE           *fp = nullptr;
     t_commrec      *cr;
     unsigned long   PCA_Flags;
     gmx_bool        bTUNE    = FALSE;
@@ -1106,12 +1103,12 @@ int gmx_pme_error(int argc, char *argv[])
 
 
     static t_filenm   fnm[] = {
-        { efTPR, "-s",     NULL,    ffREAD },
+        { efTPR, "-s",     nullptr,    ffREAD },
         { efOUT, "-o",    "error",  ffWRITE },
         { efTPR, "-so",   "tuned",  ffOPTWR }
     };
 
-    gmx_output_env_t *oenv = NULL;
+    gmx_output_env_t *oenv = nullptr;
 
     t_pargs           pa[] = {
         { "-beta",     FALSE, etREAL, {&user_beta},
@@ -1134,8 +1131,9 @@ int gmx_pme_error(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv, PCA_Flags,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc,
-                           0, NULL, &oenv))
+                           0, nullptr, &oenv))
     {
+        sfree(cr);
         return 0;
     }
 
@@ -1152,8 +1150,7 @@ int gmx_pme_error(int argc, char *argv[])
 
     if (MASTER(cr))
     {
-        /* Read in the tpr file */
-        snew(ir, 1);
+        ir = new t_inputrec();
         read_tpr_file(opt2fn("-s", NFILE, fnm), &info, &state, &mtop, ir, user_beta, fracself);
         /* Open logfile for reading */
         fp = fopen(opt2fn("-o", NFILE, fnm), "w");
@@ -1172,7 +1169,8 @@ int gmx_pme_error(int argc, char *argv[])
         info.nkx[0] = 0;
         info.nky[0] = 0;
         info.nkz[0] = 0;
-        calc_grid(stdout, state.box, info.fourier_sp[0], &(info.nkx[0]), &(info.nky[0]), &(info.nkz[0]));
+        calcFftGrid(stdout, state.box, info.fourier_sp[0], minimalPmeGridSize(info.pme_order[0]),
+                    &(info.nkx[0]), &(info.nky[0]), &(info.nkz[0]));
         if ( (ir->nkx != info.nkx[0]) || (ir->nky != info.nky[0]) || (ir->nkz != info.nkz[0]) )
         {
             gmx_fatal(FARGS, "Wrong fourierspacing %f nm, input file grid = %d x %d x %d, computed grid = %d x %d x %d",
index affd359d0495468615c8e1a6c0aba1f2e70d56bb..f371846364c5fca98ab72bd16d6b741da7de786c 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,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.
@@ -141,9 +141,9 @@ int gmx_polystat(int argc, char *argv[])
     };
 
     t_filenm        fnm[] = {
-        { efTPR, NULL, NULL,  ffREAD  },
-        { efTRX, "-f", NULL,  ffREAD  },
-        { efNDX, NULL, NULL,  ffOPTRD },
+        { efTPR, nullptr, nullptr,  ffREAD  },
+        { efTRX, "-f", nullptr,  ffREAD  },
+        { efNDX, nullptr, nullptr,  ffOPTRD },
         { efXVG, "-o", "polystat",  ffWRITE },
         { efXVG, "-v", "polyvec", ffOPTWR },
         { efXVG, "-p", "persist",  ffOPTWR },
@@ -158,14 +158,14 @@ int gmx_polystat(int argc, char *argv[])
     char             *grpname;
     t_trxstatus      *status;
     real              t;
-    rvec             *x, *bond = NULL;
+    rvec             *x, *bond = nullptr;
     matrix            box;
     int               natoms, i, j, frame, ind0, ind1, a, d, d2, ord[DIM] = {0};
     dvec              cm, sum_eig = {0, 0, 0};
     double          **gyr, **gyr_all, eig[DIM], **eigv;
     double            sum_eed2, sum_eed2_tot, sum_gyro, sum_gyro_tot, sum_pers_tot;
-    int              *ninp    = NULL;
-    double           *sum_inp = NULL, pers;
+    int              *ninp    = nullptr;
+    double           *sum_inp = nullptr, pers;
     double           *intd, ymax, ymin;
     double            mmol, m;
     char              title[STRLEN];
@@ -176,18 +176,18 @@ int gmx_polystat(int argc, char *argv[])
         "<R\\sg\\N eig1>", "<R\\sg\\N eig2>", "<R\\sg\\N eig3>"
     };
     char            **legp, buf[STRLEN];
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
 
     if (!parse_common_args(&argc, argv,
                            PCA_CAN_VIEW | PCA_CAN_TIME | PCA_TIME_UNIT,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
 
     snew(top, 1);
     ePBC = read_tpx_top(ftp2fn(efTPR, NFILE, fnm),
-                        NULL, box, &natoms, NULL, NULL, top);
+                        nullptr, box, &natoms, nullptr, nullptr, top);
 
     fprintf(stderr, "Select a group of polymer mainchain atoms:\n");
     get_index(&top->atoms, ftp2fn_null(efNDX, NFILE, fnm),
@@ -242,7 +242,7 @@ int gmx_polystat(int argc, char *argv[])
     }
     else
     {
-        outv = NULL;
+        outv = nullptr;
     }
 
     if (opt2bSet("-p", NFILE, fnm))
@@ -255,7 +255,7 @@ int gmx_polystat(int argc, char *argv[])
     }
     else
     {
-        outp = NULL;
+        outp = nullptr;
     }
 
     if (opt2bSet("-i", NFILE, fnm))
@@ -267,8 +267,8 @@ int gmx_polystat(int argc, char *argv[])
     }
     else
     {
-        intd = NULL;
-        outi = NULL;
+        intd = nullptr;
+        outi = nullptr;
     }
 
     natoms = read_first_x(oenv, &status, ftp2fn(efTRX, NFILE, fnm), &t, &x, box);
index a8258f03608bc924d0cc86599afab1fc7a7a91f4..646dc07f3c120b497ad74cf19029c35a9d5d9b7a 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,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.
@@ -75,7 +75,7 @@ static int ce = 0, cb = 0;
 
 /* this routine integrates the array data and returns the resulting array */
 /* routine uses simple trapezoid rule                                     */
-void p_integrate(double *result, double data[], int ndata, double slWidth)
+static void p_integrate(double *result, double data[], int ndata, double slWidth)
 {
     int    i, slice;
     double sum;
@@ -100,13 +100,13 @@ void p_integrate(double *result, double data[], int ndata, double slWidth)
     return;
 }
 
-void calc_potential(const char *fn, int **index, int gnx[],
-                    double ***slPotential, double ***slCharge,
-                    double ***slField, int *nslices,
-                    const t_topology *top, int ePBC,
-                    int axis, int nr_grps, double *slWidth,
-                    double fudge_z, gmx_bool bSpherical, gmx_bool bCorrect,
-                    const gmx_output_env_t *oenv)
+static void calc_potential(const char *fn, int **index, int gnx[],
+                           double ***slPotential, double ***slCharge,
+                           double ***slField, int *nslices,
+                           const t_topology *top, int ePBC,
+                           int axis, int nr_grps, double *slWidth,
+                           double fudge_z, gmx_bool bSpherical, gmx_bool bCorrect,
+                           const gmx_output_env_t *oenv)
 {
     rvec        *x0;     /* coordinates without pbc */
     matrix       box;    /* box (3x3) */
@@ -122,7 +122,7 @@ void calc_potential(const char *fn, int **index, int gnx[],
     real         t;
     double       z;
     rvec         xcm;
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
 
     switch (axis)
     {
@@ -228,7 +228,7 @@ void calc_potential(const char *fn, int **index, int gnx[],
     gmx_rmpbc_done(gpbc);
 
     /*********** done with status file **********/
-    close_trj(status);
+    close_trx(status);
 
     /* slCharge now contains the total charge per slice, summed over all
        frames. Now divide by nr_frames and integrate twice
@@ -360,10 +360,10 @@ void calc_potential(const char *fn, int **index, int gnx[],
     sfree(x0); /* free memory used by coordinate array */
 }
 
-void plot_potential(double *potential[], double *charge[], double *field[],
-                    const char *afile, const char *bfile, const char *cfile,
-                    int nslices, int nr_grps, const char *grpname[], double slWidth,
-                    const gmx_output_env_t *oenv)
+static void plot_potential(double *potential[], double *charge[], double *field[],
+                           const char *afile, const char *bfile, const char *cfile,
+                           int nslices, int nr_grps, const char *grpname[], double slWidth,
+                           const gmx_output_env_t *oenv)
 {
     FILE       *pot,     /* xvgr file with potential */
     *cha,                /* xvgr file with charges   */
@@ -457,9 +457,9 @@ int gmx_potential(int argc, char *argv[])
     int         ePBC;
     int       **index;                         /* indices for all groups     */
     t_filenm    fnm[] = {                      /* files for g_order       */
-        { efTRX, "-f", NULL,  ffREAD },        /* trajectory file             */
-        { efNDX, NULL, NULL,  ffREAD },        /* index file          */
-        { efTPR, NULL, NULL,  ffREAD },        /* topology file               */
+        { efTRX, "-f", nullptr,  ffREAD },     /* trajectory file             */
+        { efNDX, nullptr, nullptr,  ffREAD },  /* index file          */
+        { efTPR, nullptr, nullptr,  ffREAD },  /* topology file               */
         { efXVG, "-o", "potential", ffWRITE }, /* xvgr output file    */
         { efXVG, "-oc", "charge", ffWRITE },   /* xvgr output file    */
         { efXVG, "-of", "field", ffWRITE },    /* xvgr output file    */
@@ -495,9 +495,9 @@ int gmx_potential(int argc, char *argv[])
                    opt2fn("-oc", NFILE, fnm), opt2fn("-of", NFILE, fnm),
                    nslices, ngrps, (const char**)grpname, slWidth, oenv);
 
-    do_view(oenv, opt2fn("-o", NFILE, fnm), NULL);  /* view xvgr file */
-    do_view(oenv, opt2fn("-oc", NFILE, fnm), NULL); /* view xvgr file */
-    do_view(oenv, opt2fn("-of", NFILE, fnm), NULL); /* view xvgr file */
+    do_view(oenv, opt2fn("-o", NFILE, fnm), nullptr);  /* view xvgr file */
+    do_view(oenv, opt2fn("-oc", NFILE, fnm), nullptr); /* view xvgr file */
+    do_view(oenv, opt2fn("-of", NFILE, fnm), nullptr); /* view xvgr file */
 
     return 0;
 }
index a6a8a8fb7125c60093fa16a7a6e0d8c7e1bce2b6..6a5c037b372ff355f83d89b8ad2291ee94577a5b 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,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.
@@ -56,7 +56,7 @@
 #include "gromacs/utility/smalloc.h"
 
 
-void
+static void
 calc_principal_axes(const t_topology *top,
                     rvec             *x,
                     int              *index,
@@ -102,13 +102,13 @@ int gmx_principal(int argc, char *argv[])
     FILE        *     fmoi;
     matrix            axes, box;
     gmx_output_env_t *oenv;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
     char   **         legend;
 
     t_filenm          fnm[] = {
-        { efTRX, "-f",   NULL,       ffREAD },
-        { efTPS, NULL,   NULL,       ffREAD },
-        { efNDX, NULL,   NULL,       ffOPTRD },
+        { efTRX, "-f",   nullptr,       ffREAD },
+        { efTPS, nullptr,   nullptr,       ffREAD },
+        { efNDX, nullptr,   nullptr,       ffOPTRD },
         { efXVG, "-a1",  "paxis1",   ffWRITE },
         { efXVG, "-a2",  "paxis2",   ffWRITE },
         { efXVG, "-a3",  "paxis3",   ffWRITE },
@@ -118,7 +118,7 @@ int gmx_principal(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv,
                            PCA_CAN_TIME | PCA_TIME_UNIT | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -156,7 +156,7 @@ int gmx_principal(int argc, char *argv[])
     }
     sfree(legend);
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, NULL, NULL, box, TRUE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, nullptr, nullptr, box, TRUE);
 
     get_index(&top.atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &gnx, &index, &grpname);
 
@@ -179,7 +179,7 @@ int gmx_principal(int argc, char *argv[])
 
     gmx_rmpbc_done(gpbc);
 
-    close_trj(status);
+    close_trx(status);
 
     xvgrclose(axis1);
     xvgrclose(axis2);
index d17df2149f7637dfd860e56062a81c05196afc59..7aa63cbddd0db19914d2f37441d14292a5671e42 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,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.
@@ -78,14 +78,14 @@ int gmx_rama(int argc, char *argv[])
     int               j;
     gmx_output_env_t *oenv;
     t_filenm          fnm[] = {
-        { efTRX, "-f", NULL,  ffREAD },
-        { efTPR, NULL, NULL,  ffREAD },
-        { efXVG, NULL, "rama", ffWRITE }
+        { efTRX, "-f", nullptr,  ffREAD },
+        { efTPR, nullptr, nullptr,  ffREAD },
+        { efXVG, nullptr, "rama", ffWRITE }
     };
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
-                           NFILE, fnm, 0, NULL, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, 0, nullptr, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -114,7 +114,7 @@ int gmx_rama(int argc, char *argv[])
     fprintf(stderr, "\n");
     xvgrclose(out);
 
-    do_view(oenv, ftp2fn(efXVG, NFILE, fnm), NULL);
+    do_view(oenv, ftp2fn(efXVG, NFILE, fnm), nullptr);
 
     return 0;
 }
index 7d090a335c89ac969e27367ee42997236fe26d21..a285a3abe42d1b073d8406f596bd4f126dca824b 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,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.
@@ -72,7 +72,7 @@ static void norm_princ(const t_atoms *atoms, int isize, int *index, int natoms,
 
     /* equalize principal components: */
     /* orient principal axes, get principal components */
-    orient_princ(atoms, isize, index, natoms, x, NULL, princ);
+    orient_princ(atoms, isize, index, natoms, x, nullptr, princ);
 
     /* calc our own principal components */
     clear_rvec(vec);
@@ -159,15 +159,15 @@ int gmx_rms(int argc, char *argv[])
     };
     int         ewhat;
     const char *what[ewNR + 1] =
-    { NULL, "rmsd", "rho", "rhosc", NULL };
+    { nullptr, "rmsd", "rho", "rhosc", nullptr };
     const char *whatname[ewNR] =
-    { NULL, "RMSD", "Rho", "Rho sc" };
+    { nullptr, "RMSD", "Rho", "Rho sc" };
     const char *whatlabel[ewNR] =
-    { NULL, "RMSD (nm)", "Rho", "Rho sc" };
+    { nullptr, "RMSD (nm)", "Rho", "Rho sc" };
     const char *whatxvgname[ewNR] =
-    { NULL, "RMSD", "\\8r\\4", "\\8r\\4\\ssc\\N" };
+    { nullptr, "RMSD", "\\8r\\4", "\\8r\\4\\ssc\\N" };
     const char *whatxvglabel[ewNR] =
-    { NULL, "RMSD (nm)", "\\8r\\4", "\\8r\\4\\ssc\\N" };
+    { nullptr, "RMSD (nm)", "\\8r\\4", "\\8r\\4\\ssc\\N" };
     /* strings and things for fitting methods */
     enum
     {
@@ -175,9 +175,9 @@ int gmx_rms(int argc, char *argv[])
     };
     int             efit;
     const char     *fit[efNR + 1] =
-    { NULL, "rot+trans", "translation", "none", NULL };
+    { nullptr, "rot+trans", "translation", "none", nullptr };
     const char     *fitgraphlabel[efNR + 1] =
-    { NULL, "lsq fit", "translational fit", "no fit" };
+    { nullptr, "lsq fit", "translational fit", "no fit" };
     static int      nrms          = 1;
     static gmx_bool bMassWeighted = TRUE;
     t_pargs         pa[]          =
@@ -225,44 +225,44 @@ int gmx_rms(int argc, char *argv[])
     int             i, j, k, m, teller, teller2, tel_mat, tel_mat2;
 #define NFRAME 5000
     int             maxframe = NFRAME, maxframe2 = NFRAME;
-    real            t, *w_rls, *w_rms, *w_rls_m = NULL, *w_rms_m = NULL;
+    real            t, *w_rls, *w_rms, *w_rls_m = nullptr, *w_rms_m = nullptr;
     gmx_bool        bNorm, bAv, bFreq2, bFile2, bMat, bBond, bDelta, bMirror, bMass;
     gmx_bool        bFit, bReset;
     t_topology      top;
     int             ePBC;
-    t_iatom        *iatom = NULL;
+    t_iatom        *iatom = nullptr;
 
     matrix          box = {{0}};
-    rvec           *x, *xp, *xm = NULL, **mat_x = NULL, **mat_x2, *mat_x2_j = NULL, vec1,
+    rvec           *x, *xp, *xm = nullptr, **mat_x = nullptr, **mat_x2, *mat_x2_j = nullptr, vec1,
                     vec2;
     t_trxstatus    *status;
     char            buf[256], buf2[256];
     int             ncons = 0;
     FILE           *fp;
-    real            rlstot = 0, **rls, **rlsm = NULL, *time, *time2, *rlsnorm = NULL,
-    **rmsd_mat             = NULL, **bond_mat = NULL, *axis, *axis2, *del_xaxis,
+    real            rlstot = 0, **rls, **rlsm = nullptr, *time, *time2, *rlsnorm = nullptr,
+    **rmsd_mat             = nullptr, **bond_mat = nullptr, *axis, *axis2, *del_xaxis,
     *del_yaxis, rmsd_max, rmsd_min, rmsd_avg, bond_max, bond_min, ang;
-    real            **rmsdav_mat = NULL, av_tot, weight, weight_tot;
-    real            **delta      = NULL, delta_max, delta_scalex = 0, delta_scaley = 0,
+    real            **rmsdav_mat = nullptr, av_tot, weight, weight_tot;
+    real            **delta      = nullptr, delta_max, delta_scalex = 0, delta_scaley = 0,
     *delta_tot;
     int               delta_xsize = 0, del_lev = 100, mx, my, abs_my;
-    gmx_bool          bA1, bA2, bPrev, bTop, *bInMat = NULL;
-    int               ifit, *irms, ibond = 0, *ind_bond1 = NULL, *ind_bond2 = NULL, n_ind_m =
+    gmx_bool          bA1, bA2, bPrev, bTop, *bInMat = nullptr;
+    int               ifit, *irms, ibond = 0, *ind_bond1 = nullptr, *ind_bond2 = nullptr, n_ind_m =
         0;
-    int              *ind_fit, **ind_rms, *ind_m = NULL, *rev_ind_m = NULL, *ind_rms_m =
-        NULL;
+    int              *ind_fit, **ind_rms, *ind_m = nullptr, *rev_ind_m = nullptr, *ind_rms_m =
+        nullptr;
     char             *gn_fit, **gn_rms;
     t_rgb             rlo, rhi;
     gmx_output_env_t *oenv;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
 
     t_filenm          fnm[] =
     {
-        { efTPS, NULL, NULL, ffREAD },
-        { efTRX, "-f", NULL, ffREAD },
-        { efTRX, "-f2", NULL, ffOPTRD },
-        { efNDX, NULL, NULL, ffOPTRD },
-        { efXVG, NULL, "rmsd", ffWRITE },
+        { efTPS, nullptr, nullptr, ffREAD },
+        { efTRX, "-f", nullptr, ffREAD },
+        { efTRX, "-f2", nullptr, ffOPTRD },
+        { efNDX, nullptr, nullptr, ffOPTRD },
+        { efXVG, nullptr, "rmsd", ffWRITE },
         { efXVG, "-mir", "rmsdmir", ffOPTWR },
         { efXVG, "-a", "avgrp", ffOPTWR },
         { efXVG, "-dist", "rmsd-dist", ffOPTWR },
@@ -273,7 +273,7 @@ int gmx_rms(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_TIME_UNIT | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL,
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr,
                            &oenv))
     {
         return 0;
@@ -359,7 +359,7 @@ int gmx_rms(int argc, char *argv[])
     }
 
     bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xp,
-                         NULL, box, TRUE);
+                         nullptr, box, TRUE);
     snew(w_rls, top.atoms.nr);
     snew(w_rms, top.atoms.nr);
 
@@ -477,7 +477,7 @@ int gmx_rms(int argc, char *argv[])
     }
     if (bReset)
     {
-        reset_x(ifit, ind_fit, top.atoms.nr, NULL, xp, w_rls);
+        reset_x(ifit, ind_fit, top.atoms.nr, nullptr, xp, w_rls);
     }
     if (bMirror)
     {
@@ -621,7 +621,7 @@ int gmx_rms(int argc, char *argv[])
 
         if (bReset)
         {
-            reset_x(ifit, ind_fit, natoms, NULL, x, w_rls);
+            reset_x(ifit, ind_fit, natoms, nullptr, x, w_rls);
         }
         if (ewhat == ewRhoSc)
         {
@@ -666,7 +666,7 @@ int gmx_rms(int argc, char *argv[])
             }
             if (bReset)
             {
-                reset_x(ifit, ind_fit, natoms, NULL, xp, w_rls);
+                reset_x(ifit, ind_fit, natoms, nullptr, xp, w_rls);
             }
             if (bFit)
             {
@@ -722,7 +722,7 @@ int gmx_rms(int argc, char *argv[])
         }
     }
     while (read_next_x(oenv, status, &t, x, box));
-    close_trj(status);
+    close_trx(status);
 
     if (bFile2)
     {
@@ -749,7 +749,7 @@ int gmx_rms(int argc, char *argv[])
 
             if (bReset)
             {
-                reset_x(ifit, ind_fit, natoms, NULL, x, w_rls);
+                reset_x(ifit, ind_fit, natoms, nullptr, x, w_rls);
             }
             if (ewhat == ewRhoSc)
             {
@@ -790,7 +790,7 @@ int gmx_rms(int argc, char *argv[])
             }
         }
         while (read_next_x(oenv, status, &t, x, box));
-        close_trj(status);
+        close_trx(status);
     }
     else
     {
@@ -1124,7 +1124,7 @@ int gmx_rms(int argc, char *argv[])
     else
     {
         sprintf(buf, "%s with frame %g %s ago", whatxvgname[ewhat],
-                time[prev*freq]-time[0], output_env_get_time_label(oenv));
+                time[prev*freq]-time[0], output_env_get_time_label(oenv).c_str());
     }
     fp = xvgropen(opt2fn("-o", NFILE, fnm), buf, output_env_get_xvgr_tlabel(oenv),
                   whatxvglabel[ewhat], oenv);
@@ -1219,11 +1219,11 @@ int gmx_rms(int argc, char *argv[])
         xvgrclose(fp);
     }
     do_view(oenv, opt2fn_null("-a", NFILE, fnm), "-graphtype bar");
-    do_view(oenv, opt2fn("-o", NFILE, fnm), NULL);
-    do_view(oenv, opt2fn_null("-mir", NFILE, fnm), NULL);
-    do_view(oenv, opt2fn_null("-m", NFILE, fnm), NULL);
-    do_view(oenv, opt2fn_null("-bm", NFILE, fnm), NULL);
-    do_view(oenv, opt2fn_null("-dist", NFILE, fnm), NULL);
+    do_view(oenv, opt2fn("-o", NFILE, fnm), nullptr);
+    do_view(oenv, opt2fn_null("-mir", NFILE, fnm), nullptr);
+    do_view(oenv, opt2fn_null("-m", NFILE, fnm), nullptr);
+    do_view(oenv, opt2fn_null("-bm", NFILE, fnm), nullptr);
+    do_view(oenv, opt2fn_null("-dist", NFILE, fnm), nullptr);
 
     return 0;
 }
index ddf5a24f449c681a155cb3716f0f9eb9bd1197bb..ae49501f952192fc31861b31c317dbafa7a287c5 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,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.
@@ -179,13 +179,13 @@ static int read_equiv(const char *eq_fn, t_equiv ***equivptr)
 
     fp    = gmx_ffopen(eq_fn, "r");
     neq   = 0;
-    equiv = NULL;
+    equiv = nullptr;
     while (get_a_line(fp, line, STRLEN))
     {
         lp = line;
         /* this is not efficient, but I'm lazy */
         srenew(equiv, neq+1);
-        equiv[neq] = NULL;
+        equiv[neq] = nullptr;
         na         = 0;
         if (sscanf(lp, "%s %n", atomname, &n) == 1)
         {
@@ -202,7 +202,7 @@ static int read_equiv(const char *eq_fn, t_equiv ***equivptr)
                 equiv[neq][na].aname = gmx_strdup(atomname);
                 if (na > 0)
                 {
-                    equiv[neq][na].nname = NULL;
+                    equiv[neq][na].nname = nullptr;
                 }
                 na++;
                 lp += n;
@@ -212,8 +212,8 @@ static int read_equiv(const char *eq_fn, t_equiv ***equivptr)
         srenew(equiv[neq], na+1);
         equiv[neq][na].set   = false;
         equiv[neq][na].rnr   = 0;
-        equiv[neq][na].rname = NULL;
-        equiv[neq][na].aname = NULL;
+        equiv[neq][na].rname = nullptr;
+        equiv[neq][na].aname = nullptr;
 
         /* next */
         neq++;
@@ -304,7 +304,7 @@ static int analyze_noe_equivalent(const char *eq_fn,
         else
         {
             neq   = 0;
-            equiv = NULL;
+            equiv = nullptr;
         }
 
         groupnr = 0;
@@ -611,7 +611,7 @@ static void calc_rms(int nind, int nframes,
     }
 }
 
-real rms_diff(int natom, real **d, real **d_r)
+static real rms_diff(int natom, real **d, real **d_r)
 {
     int  i, j;
     real r, r2;
@@ -671,11 +671,11 @@ int gmx_rmsdist(int argc, char *argv[])
     int              *index, *noe_index;
     char             *grpname;
     real            **d_r, **d, **dtot, **dtot2, **mean, **rms, **rmsc, *resnr;
-    real            **dtot1_3 = NULL, **dtot1_6 = NULL;
+    real            **dtot1_3 = nullptr, **dtot1_6 = nullptr;
     real              rmsnow, meanmax, rmsmax, rmscmax;
     real              max1_3, max1_6;
-    t_noe_gr         *noe_gr = NULL;
-    t_noe           **noe    = NULL;
+    t_noe_gr         *noe_gr = nullptr;
+    t_noe           **noe    = nullptr;
     t_rgb             rlo, rhi;
     gmx_bool          bRMS, bScale, bMean, bNOE, bNMR3, bNMR6, bNMR;
 
@@ -696,11 +696,11 @@ int gmx_rmsdist(int argc, char *argv[])
           "Use periodic boundary conditions when computing distances" }
     };
     t_filenm          fnm[] = {
-        { efTRX, "-f",   NULL,       ffREAD },
-        { efTPS, NULL,   NULL,       ffREAD },
-        { efNDX, NULL,   NULL,       ffOPTRD },
+        { efTRX, "-f",   nullptr,       ffREAD },
+        { efTPS, nullptr,   nullptr,       ffREAD },
+        { efNDX, nullptr,   nullptr,       ffOPTRD },
         { efDAT, "-equiv", "equiv",   ffOPTRD },
-        { efXVG, NULL,   "distrmsd", ffWRITE },
+        { efXVG, nullptr,   "distrmsd", ffWRITE },
         { efXPM, "-rms", "rmsdist",  ffOPTWR },
         { efXPM, "-scl", "rmsscale", ffOPTWR },
         { efXPM, "-mean", "rmsmean",  ffOPTWR },
@@ -711,7 +711,7 @@ int gmx_rmsdist(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -736,7 +736,7 @@ int gmx_rmsdist(int argc, char *argv[])
     }
 
     /* get topology and index */
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, NULL, box, FALSE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, nullptr, box, FALSE);
 
     if (!bPBC)
     {
@@ -806,7 +806,7 @@ int gmx_rmsdist(int argc, char *argv[])
 
     xvgrclose(fp);
 
-    close_trj(status);
+    close_trx(status);
 
     calc_rms(isize, teller, dtot, dtot2, rms, &rmsmax, rmsc, &rmscmax, mean, &meanmax);
     fprintf(stderr, "rmsmax = %g, rmscmax = %g\n", rmsmax, rmscmax);
@@ -885,7 +885,7 @@ int gmx_rmsdist(int argc, char *argv[])
         write_noe(opt2FILE("-noe", NFILE, fnm, "w"), gnr, noe, noe_gr, scalemax);
     }
 
-    do_view(oenv, ftp2fn(efXVG, NFILE, fnm), NULL);
+    do_view(oenv, ftp2fn(efXVG, NFILE, fnm), nullptr);
 
     return 0;
 }
index 8b5118003ef44f5e39f94c28a23a6537b2a144bc..e2e3ea795c0f9c7c8b92712f19d639c0661eef9a 100644 (file)
@@ -36,6 +36,7 @@
  */
 #include "gmxpre.h"
 
+#include <cassert>
 #include <cmath>
 #include <cstring>
 
@@ -72,7 +73,7 @@ static real find_pdb_bfac(const t_atoms *atoms, t_resinfo *ri, char *atomnm)
         if ((ri->nr == atoms->resinfo[atoms->atom[i].resind].nr) &&
             (ri->ic == atoms->resinfo[atoms->atom[i].resind].ic) &&
             (std::strcmp(*atoms->resinfo[atoms->atom[i].resind].name, rresnm) == 0) &&
-            (std::strstr(*atoms->atomname[i], atomnm) != NULL))
+            (std::strstr(*atoms->atomname[i], atomnm) != nullptr))
         {
             break;
         }
@@ -88,8 +89,8 @@ static real find_pdb_bfac(const t_atoms *atoms, t_resinfo *ri, char *atomnm)
     return atoms->pdbinfo[i].bfac;
 }
 
-void correlate_aniso(const char *fn, t_atoms *ref, t_atoms *calc,
-                     const gmx_output_env_t *oenv)
+static void correlate_aniso(const char *fn, t_atoms *ref, t_atoms *calc,
+                            const gmx_output_env_t *oenv)
 {
     FILE *fp;
     int   i, j;
@@ -119,15 +120,19 @@ static void average_residues(double f[], double **U, int uind,
     start = 0;
     av    = 0;
     m     = 0;
+    if (!f)
+    {
+        assert(U);
+    }
     for (i = 0; i < isize; i++)
     {
-        av += w_rls[index[i]]*(f != NULL ? f[i] : U[i][uind]);
+        av += w_rls[index[i]]*(f != nullptr ? f[i] : U[i][uind]);
         m  += w_rls[index[i]];
         if (i+1 == isize ||
             atoms->atom[index[i]].resind != atoms->atom[index[i+1]].resind)
         {
             av /= m;
-            if (f != NULL)
+            if (f != nullptr)
             {
                 for (j = start; j <= i; j++)
                 {
@@ -148,7 +153,7 @@ static void average_residues(double f[], double **U, int uind,
     }
 }
 
-void print_dir(FILE *fp, real *Uaver)
+static void print_dir(FILE *fp, real *Uaver)
 {
     real eigvec[DIM*DIM];
     real tmp[DIM*DIM];
@@ -249,22 +254,22 @@ int gmx_rmsf(int argc, char *argv[])
     real              bfac, pdb_bfac, *Uaver;
     double          **U, *xav;
     int               aid;
-    rvec             *rmsd_x = NULL;
+    rvec             *rmsd_x = nullptr;
     double           *rmsf, invcount, totmass;
     int               d;
     real              count = 0;
     rvec              xcm;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
 
     gmx_output_env_t *oenv;
 
     const char       *leg[2] = { "MD", "X-Ray" };
 
     t_filenm          fnm[] = {
-        { efTRX, "-f",  NULL,     ffREAD  },
-        { efTPS, NULL,  NULL,     ffREAD  },
-        { efNDX, NULL,  NULL,     ffOPTRD },
-        { efPDB, "-q",  NULL,     ffOPTRD },
+        { efTRX, "-f",  nullptr,     ffREAD  },
+        { efTPS, nullptr,  nullptr,     ffREAD  },
+        { efNDX, nullptr,  nullptr,     ffOPTRD },
+        { efPDB, "-q",  nullptr,     ffOPTRD },
         { efPDB, "-oq", "bfac",   ffOPTWR },
         { efPDB, "-ox", "xaver",  ffOPTWR },
         { efXVG, "-o",  "rmsf",   ffWRITE },
@@ -275,7 +280,7 @@ int gmx_rmsf(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pargs), pargs, asize(desc), desc, 0, NULL,
+                           NFILE, fnm, asize(pargs), pargs, asize(desc), desc, 0, nullptr,
                            &oenv))
     {
         return 0;
@@ -285,7 +290,7 @@ int gmx_rmsf(int argc, char *argv[])
     devfn    = opt2fn_null("-od", NFILE, fnm);
     dirfn    = opt2fn_null("-dir", NFILE, fnm);
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xref, NULL, box, TRUE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xref, nullptr, box, TRUE);
     const char *title = *top.name;
     snew(w_rls, top.atoms.nr);
 
@@ -316,10 +321,10 @@ int gmx_rmsf(int argc, char *argv[])
         t_topology *top_pdb;
         snew(top_pdb, 1);
         /* Read coordinates twice */
-        read_tps_conf(opt2fn("-q", NFILE, fnm), top_pdb, NULL, NULL, NULL, pdbbox, FALSE);
+        read_tps_conf(opt2fn("-q", NFILE, fnm), top_pdb, nullptr, nullptr, nullptr, pdbbox, FALSE);
         snew(pdbatoms, 1);
         *pdbatoms = top_pdb->atoms;
-        read_tps_conf(opt2fn("-q", NFILE, fnm), top_pdb, NULL, &pdbx, NULL, pdbbox, FALSE);
+        read_tps_conf(opt2fn("-q", NFILE, fnm), top_pdb, nullptr, &pdbx, nullptr, pdbbox, FALSE);
         /* TODO Should this assert that top_pdb->atoms.nr == top.atoms.nr?
          * See discussion at https://gerrit.gromacs.org/#/c/6430/1 */
         title = *top_pdb->name;
@@ -333,6 +338,7 @@ int gmx_rmsf(int argc, char *argv[])
         refatoms  = &top.atoms;
         pdbx      = xref;
         snew(pdbatoms->pdbinfo, pdbatoms->nr);
+        pdbatoms->havePdbInfo = TRUE;
         copy_mat(box, pdbbox);
     }
 
@@ -394,7 +400,7 @@ int gmx_rmsf(int argc, char *argv[])
         teller++;
     }
     while (read_next_x(oenv, status, &t, x, box));
-    close_trj(status);
+    close_trx(status);
 
     if (bFit)
     {
@@ -431,7 +437,7 @@ int gmx_rmsf(int argc, char *argv[])
     {
         for (d = 0; d < DIM*DIM; d++)
         {
-            average_residues(NULL, U, d, isize, index, w_rls, &top.atoms);
+            average_residues(nullptr, U, d, isize, index, w_rls, &top.atoms);
         }
     }
 
@@ -529,7 +535,7 @@ int gmx_rmsf(int argc, char *argv[])
         }
         if (bRes)
         {
-            average_residues(rmsf, NULL, 0, isize, index, w_rls, &top.atoms);
+            average_residues(rmsf, nullptr, 0, isize, index, w_rls, &top.atoms);
         }
         /* Write RMSD output */
         fp = xvgropen(devfn, "RMS Deviation", label, "(nm)", oenv);
@@ -553,7 +559,7 @@ int gmx_rmsf(int argc, char *argv[])
             rvec_inc(pdbx[index[i]], xcm);
         }
         write_sto_conf_indexed(opt2fn("-oq", NFILE, fnm), title, pdbatoms, pdbx,
-                               NULL, ePBC, pdbbox, isize, index);
+                               nullptr, ePBC, pdbbox, isize, index);
     }
     if (opt2bSet("-ox", NFILE, fnm))
     {
@@ -567,7 +573,7 @@ int gmx_rmsf(int argc, char *argv[])
             }
         }
         /* Write a .pdb file with B-factors and optionally anisou records */
-        write_sto_conf_indexed(opt2fn("-ox", NFILE, fnm), title, pdbatoms, bFactorX, NULL,
+        write_sto_conf_indexed(opt2fn("-ox", NFILE, fnm), title, pdbatoms, bFactorX, nullptr,
                                ePBC, pdbbox, isize, index);
         sfree(bFactorX);
     }
index f30805be6b568e87421c7318aafdd5643bc5fdbf..771efcaf656333dc1ce68581ce12d9bc8d1473ff 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,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.
@@ -94,13 +94,13 @@ int gmx_rotacf(int argc, char *argv[])
     int               i, m, teller, n_alloc, natoms, nvec, ai, aj, ak;
     unsigned long     mode;
     real              t, t0, t1, dt;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
     t_topology       *top;
     int               ePBC;
     t_filenm          fnm[] = {
-        { efTRX, "-f", NULL,  ffREAD  },
-        { efTPR, NULL, NULL,  ffREAD },
-        { efNDX, NULL, NULL,  ffREAD  },
+        { efTRX, "-f", nullptr,  ffREAD  },
+        { efTPR, nullptr, nullptr,  ffREAD },
+        { efNDX, nullptr, nullptr,  ffREAD  },
         { efXVG, "-o", "rotacf",  ffWRITE }
     };
 #define NFILE asize(fnm)
@@ -113,8 +113,9 @@ int gmx_rotacf(int argc, char *argv[])
     ppa    = add_acf_pargs(&npargs, pa);
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
-                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, nullptr, &oenv))
     {
+        sfree(ppa);
         return 0;
     }
 
@@ -145,7 +146,7 @@ int gmx_rotacf(int argc, char *argv[])
     snew(c1, nvec);
     for (i = 0; (i < nvec); i++)
     {
-        c1[i] = NULL;
+        c1[i] = nullptr;
     }
     n_alloc = 0;
 
@@ -208,7 +209,7 @@ int gmx_rotacf(int argc, char *argv[])
         teller++;
     }
     while (read_next_x(oenv, status, &t, x, box));
-    close_trj(status);
+    close_trx(status);
     fprintf(stderr, "\nDone with trajectory\n");
 
     gmx_rmpbc_done(gpbc);
@@ -229,7 +230,7 @@ int gmx_rotacf(int argc, char *argv[])
                     teller, nvec, c1, dt, mode, bAver);
     }
 
-    do_view(oenv, ftp2fn(efXVG, NFILE, fnm), NULL);
+    do_view(oenv, ftp2fn(efXVG, NFILE, fnm), nullptr);
 
     return 0;
 }
index a1d48990c2f043371a0612cac105791a1a15e1fd..ea5c2f4222625b627893aa0a8d99d8d4c05b7dc6 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
@@ -67,7 +67,7 @@ static void get_refx(gmx_output_env_t *oenv, const char *trxfn, int nfitdim, int
     real         xf;
     matrix       box, R;
     real        *w_rls;
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
 
 
     nfr_all = 0;
@@ -99,7 +99,7 @@ static void get_refx(gmx_output_env_t *oenv, const char *trxfn, int nfitdim, int
             {
                 copy_rvec(x[index[i]], xi[nfr][i]);
             }
-            reset_x(gnx, NULL, gnx, NULL, xi[nfr], w_rls);
+            reset_x(gnx, nullptr, gnx, nullptr, xi[nfr], w_rls);
             nfr++;
             if (nfr % 100 == 0)
             {
@@ -110,7 +110,7 @@ static void get_refx(gmx_output_env_t *oenv, const char *trxfn, int nfitdim, int
         nfr_all++;
     }
     while (read_next_x(oenv, status, &ti[nfr], x, box));
-    close_trj(status);
+    close_trx(status);
     sfree(x);
 
     gmx_rmpbc_done(gpbc);
@@ -204,7 +204,7 @@ int gmx_rotmat(int argc, char *argv[])
         "the rotation matrix."
     };
     const char       *reffit[] =
-    { NULL, "none", "xyz", "xy", NULL };
+    { nullptr, "none", "xyz", "xy", nullptr };
     static int        skip   = 1;
     static gmx_bool   bFitXY = FALSE, bMW = TRUE;
     t_pargs           pa[]   = {
@@ -227,27 +227,27 @@ int gmx_rotmat(int argc, char *argv[])
     int               natoms, i;
     char             *grpname;
     int               gnx;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
     int              *index;
     gmx_output_env_t *oenv;
     real             *w_rls;
     const char       *leg[]  = { "xx", "xy", "xz", "yx", "yy", "yz", "zx", "zy", "zz" };
 #define NLEG asize(leg)
     t_filenm          fnm[] = {
-        { efTRX, "-f",   NULL,       ffREAD },
-        { efTPS, NULL,   NULL,       ffREAD },
-        { efNDX, NULL,   NULL,       ffOPTRD },
-        { efXVG, NULL,   "rotmat",   ffWRITE }
+        { efTRX, "-f",   nullptr,       ffREAD },
+        { efTPS, nullptr,   nullptr,       ffREAD },
+        { efNDX, nullptr,   nullptr,       ffOPTRD },
+        { efXVG, nullptr,   "rotmat",   ffWRITE }
     };
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x_ref, NULL, box, bMW);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x_ref, nullptr, box, bMW);
 
     gpbc = gmx_rmpbc_init(&top.idef, ePBC, top.atoms.nr);
 
@@ -255,7 +255,7 @@ int gmx_rotmat(int argc, char *argv[])
 
     get_index(&top.atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &gnx, &index, &grpname);
 
-    GMX_RELEASE_ASSERT(reffit[0] != NULL, "Options inconsistency; reffit[0] is NULL");
+    GMX_RELEASE_ASSERT(reffit[0] != nullptr, "Options inconsistency; reffit[0] is NULL");
     if (reffit[0][0] != 'n')
     {
         get_refx(oenv, ftp2fn(efTRX, NFILE, fnm), reffit[0][2] == 'z' ? 3 : 2, skip,
@@ -276,7 +276,7 @@ int gmx_rotmat(int argc, char *argv[])
 
     if (reffit[0][0] == 'n')
     {
-        reset_x(gnx, index, natoms, NULL, x_ref, w_rls);
+        reset_x(gnx, index, natoms, nullptr, x_ref, w_rls);
     }
 
     out = xvgropen(ftp2fn(efXVG, NFILE, fnm),
@@ -287,7 +287,7 @@ int gmx_rotmat(int argc, char *argv[])
     {
         gmx_rmpbc(gpbc, natoms, box, x);
 
-        reset_x(gnx, index, natoms, NULL, x, w_rls);
+        reset_x(gnx, index, natoms, nullptr, x, w_rls);
 
         if (bFitXY)
         {
@@ -307,7 +307,7 @@ int gmx_rotmat(int argc, char *argv[])
 
     gmx_rmpbc_done(gpbc);
 
-    close_trj(status);
+    close_trx(status);
 
     xvgrclose(out);
 
index d3099a577c15ce2eab0811a4029ed857e9aa6a79..6fdd9c575cc8c095baf132566e3158f3daded948 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,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.
@@ -61,7 +61,7 @@ typedef struct {
 
 static t_charge *mk_charge(const t_atoms *atoms, const t_block *cgs, int *nncg)
 {
-    t_charge *cg = NULL;
+    t_charge *cg = nullptr;
     char      buf[32];
     int       i, j, ncg, resnr, anr;
     real      qq;
@@ -148,8 +148,8 @@ int gmx_saltbr(int argc, char *argv[])
           "Use separate files for each interaction (may be MANY)" }
     };
     t_filenm        fnm[] = {
-        { efTRX, "-f",  NULL, ffREAD },
-        { efTPR, NULL,  NULL, ffREAD },
+        { efTRX, "-f",  nullptr, ffREAD },
+        { efTPR, nullptr,  nullptr, ffREAD },
     };
 #define NFILE asize(fnm)
 
@@ -182,7 +182,7 @@ int gmx_saltbr(int argc, char *argv[])
     gmx_output_env_t  *oenv;
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -200,7 +200,7 @@ int gmx_saltbr(int argc, char *argv[])
     read_first_x(oenv, &status, ftp2fn(efTRX, NFILE, fnm), &t, &x, box);
 
     teller = 0;
-    time   = NULL;
+    time   = nullptr;
     do
     {
         srenew(time, teller+1);
@@ -226,7 +226,7 @@ int gmx_saltbr(int argc, char *argv[])
     }
     while (read_next_x(oenv, status, &t, x, box));
     fprintf(stderr, "\n");
-    close_trj(status);
+    close_trx(status);
 
     if (bSep)
     {
index b8c523d562ee4a4c7fd7f5e015e82706399ce017..b9b608dbb92d3112991a68d978bd4eff71b4746c 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,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.
@@ -84,8 +84,8 @@ int gmx_sans(int argc, char *argv[])
     static unsigned int  seed     = 0;
     static int           nthreads = -1;
 
-    static const char   *emode[]   = { NULL, "direct", "mc", NULL };
-    static const char   *emethod[] = { NULL, "debye", "fft", NULL };
+    static const char   *emode[]   = { nullptr, "direct", "mc", nullptr };
+    static const char   *emethod[] = { nullptr, "debye", "fft", nullptr };
 
     gmx_neutron_atomic_structurefactors_t    *gnsf;
     gmx_sans_t                               *gsans;
@@ -119,10 +119,10 @@ int gmx_sans(int argc, char *argv[])
 #endif
     };
     FILE                                 *fp;
-    const char                           *fnTPX, *fnTRX, *fnDAT = NULL;
+    const char                           *fnTPX, *fnTRX, *fnDAT = nullptr;
     t_trxstatus                          *status;
-    t_topology                           *top  = NULL;
-    gmx_rmpbc_t                           gpbc = NULL;
+    t_topology                           *top  = nullptr;
+    gmx_rmpbc_t                           gpbc = nullptr;
     gmx_bool                              bFFT = FALSE, bDEBYE = FALSE;
     gmx_bool                              bMC  = FALSE;
     int                                   ePBC = -1;
@@ -130,23 +130,23 @@ int gmx_sans(int argc, char *argv[])
     rvec                                 *x;
     int                                   natoms;
     real                                  t;
-    char                                **grpname = NULL;
-    int                                  *index   = NULL;
+    char                                **grpname = nullptr;
+    int                                  *index   = nullptr;
     int                                   isize;
     int                                   i;
-    char                                 *hdr            = NULL;
-    char                                 *suffix         = NULL;
-    t_filenm                             *fnmdup         = NULL;
-    gmx_radial_distribution_histogram_t  *prframecurrent = NULL, *pr = NULL;
-    gmx_static_structurefactor_t         *sqframecurrent = NULL, *sq = NULL;
+    char                                 *hdr            = nullptr;
+    char                                 *suffix         = nullptr;
+    t_filenm                             *fnmdup         = nullptr;
+    gmx_radial_distribution_histogram_t  *prframecurrent = nullptr, *pr = nullptr;
+    gmx_static_structurefactor_t         *sqframecurrent = nullptr, *sq = nullptr;
     gmx_output_env_t                     *oenv;
 
 #define NFILE asize(fnm)
 
     t_filenm   fnm[] = {
-        { efTPR,  "-s",       NULL,       ffREAD },
-        { efTRX,  "-f",       NULL,       ffREAD },
-        { efNDX,  NULL,       NULL,       ffOPTRD },
+        { efTPR,  "-s",       nullptr,       ffREAD },
+        { efTRX,  "-f",       nullptr,       ffREAD },
+        { efNDX,  nullptr,       nullptr,       ffOPTRD },
         { efDAT,  "-d",       "nsfactor", ffOPTRD },
         { efXVG,  "-pr",      "pr",       ffWRITE },
         { efXVG,  "-sq",       "sq",      ffWRITE },
@@ -157,7 +157,7 @@ int gmx_sans(int argc, char *argv[])
     nthreads = gmx_omp_get_max_threads();
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_TIME_UNIT,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -170,7 +170,7 @@ int gmx_sans(int argc, char *argv[])
     gmx_omp_set_num_threads(nthreads);
 
     /* Now try to parse opts for modes */
-    GMX_RELEASE_ASSERT(emethod[0] != NULL, "Options inconsistency; emethod[0] is NULL");
+    GMX_RELEASE_ASSERT(emethod[0] != nullptr, "Options inconsistency; emethod[0] is NULL");
     switch (emethod[0][0])
     {
         case 'd':
@@ -226,7 +226,7 @@ int gmx_sans(int argc, char *argv[])
     snew(grpname, 1);
     snew(index, 1);
 
-    read_tps_conf(fnTPX, top, &ePBC, &x, NULL, box, TRUE);
+    read_tps_conf(fnTPX, top, &ePBC, &x, nullptr, box, TRUE);
 
     printf("\nPlease select group for SANS spectra calculation:\n");
     get_index(&(top->atoms), ftp2fn_null(efNDX, NFILE, fnm), 1, &isize, &index, grpname);
@@ -253,7 +253,7 @@ int gmx_sans(int argc, char *argv[])
             gmx_rmpbc(gpbc, top->atoms.nr, box, x);
         }
         /* allocate memory for pr */
-        if (pr == NULL)
+        if (pr == nullptr)
         {
             /* in case its first frame to read */
             snew(pr, 1);
@@ -262,7 +262,7 @@ int gmx_sans(int argc, char *argv[])
         prframecurrent = calc_radial_distribution_histogram(gsans, x, box, index, isize, binwidth, bMC, bNORM, mcover, seed);
         /* copy prframecurrent -> pr and summ up pr->gr[i] */
         /* allocate and/or resize memory for pr->gr[i] and pr->r[i] */
-        if (pr->gr == NULL)
+        if (pr->gr == nullptr)
         {
             /* check if we use pr->gr first time */
             snew(pr->gr, prframecurrent->grn);
@@ -342,7 +342,7 @@ int gmx_sans(int argc, char *argv[])
         sfree(sqframecurrent);
     }
     while (read_next_x(oenv, status, &t, x, box));
-    close_trj(status);
+    close_trx(status);
 
     /* normalize histo */
     normalize_probability(pr->grn, pr->gr);
index 61581d7882cfab91c1654129c0e8536d4f59592b..6a7000bf4583eb1b847ddf39f781a46d330b7d28 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,2013,2014,2015, by the GROMACS development team, led by
+ * 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.
@@ -68,19 +68,19 @@ int gmx_saxs(int argc, char *argv[])
          "Energy of the incoming X-ray (keV) "}
     };
 #define NPA asize(pa)
-    const char       *fnTPS, *fnTRX, *fnNDX, *fnDAT = NULL;
+    const char       *fnTPS, *fnTRX, *fnNDX, *fnDAT = nullptr;
     gmx_output_env_t *oenv;
 
     t_filenm          fnm[] = {
-        { efTRX, "-f",  NULL,      ffREAD },
-        { efTPS, NULL,  NULL,      ffREAD },
-        { efNDX, NULL,  NULL,      ffOPTRD },
+        { efTRX, "-f",  nullptr,      ffREAD },
+        { efTPS, nullptr,  nullptr,      ffREAD },
+        { efNDX, nullptr,  nullptr,      ffOPTRD },
         { efDAT, "-d",  "sfactor", ffOPTRD },
         { efXVG, "-sq", "sq",      ffWRITE },
     };
 #define NFILE asize(fnm)
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME,
-                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
index dbd3838482d102b95669d498610979781405eb51..14f8d1fb6943e5e05ff82d794c38b4cdcc5347bd 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,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.
@@ -46,7 +46,6 @@
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/matio.h"
 #include "gromacs/fileio/pdbio.h"
-#include "gromacs/fileio/readinp.h"
 #include "gromacs/fileio/xvgr.h"
 #include "gromacs/gmxana/gmx_ana.h"
 #include "gromacs/gmxana/gstat.h"
@@ -426,7 +425,7 @@ static void do_sham(const char *fn, const char *ndx,
 {
     FILE        *fp;
     real        *min_eig, *max_eig;
-    real        *axis_x, *axis_y, *axis_z, *axis = NULL;
+    real        *axis_x, *axis_y, *axis_z, *axis = nullptr;
     double      *P;
     real       **PP, *W, *E, **WW, **EE, *S, **SS, *M, *bE;
     rvec         xxx;
@@ -990,7 +989,7 @@ int gmx_sham(int argc, char *argv[])
 
     npargs = asize(pa);
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW,
-                           NFILE, fnm, npargs, pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, npargs, pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -1038,7 +1037,7 @@ int gmx_sham(int argc, char *argv[])
     }
     else
     {
-        et_val = NULL;
+        et_val = nullptr;
     }
 
     if (fn_ene && et_val)
@@ -1084,10 +1083,10 @@ int gmx_sham(int argc, char *argv[])
             opt2fn("-ls", NFILE, fnm), opt2fn("-lsh", NFILE, fnm),
             opt2fn("-lss", NFILE, fnm),
             opt2fn("-ls3", NFILE, fnm), opt2fn("-g", NFILE, fnm),
-            n, nset, val, fn_ge != NULL, e_nset, et_val, Tref,
+            n, nset, val, fn_ge != nullptr, e_nset, et_val, Tref,
             pmax, gmax,
-            opt2parg_bSet("-emin", NPA, pa) ? &emin : NULL,
-            opt2parg_bSet("-emax", NPA, pa) ? &emax : NULL,
+            opt2parg_bSet("-emin", NPA, pa) ? &emin : nullptr,
+            opt2parg_bSet("-emax", NPA, pa) ? &emax : nullptr,
             nlevels, pmin,
             idim, ibox,
             opt2parg_bSet("-xmin", NPA, pa), rmin,
index 8b466aa1e75789d08013173c43220ce72bc8c902..02da8ac8ae01e695f084f581e06a46913e74ce80 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,2013,2014,2015, by the GROMACS development team, led by
+ * 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.
 #include "gromacs/utility/arraysize.h"
 #include "gromacs/utility/smalloc.h"
 
-real pot(real x, real qq, real c6, real cn, int npow)
+static real pot(real x, real qq, real c6, real cn, int npow)
 {
     return cn*pow(x, -npow)-c6/gmx::power6(x)+qq*ONE_4PI_EPS0/x;
 }
 
-real bhpot(real x, real A, real B, real C)
+static real bhpot(real x, real A, real B, real C)
 {
     return A*std::exp(-B*x) - C/gmx::power6(x);
 }
 
-real dpot(real x, real qq, real c6, real cn, int npow)
+static real dpot(real x, real qq, real c6, real cn, int npow)
 {
     return -(npow*cn*std::pow(x, -npow-1)-6*c6/(x*gmx::power6(x))+qq*ONE_4PI_EPS0/gmx::square(x));
 }
@@ -104,7 +104,7 @@ int gmx_sigeps(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW,
                            NFILE, fnm, asize(pa), pa, asize(desc),
-                           desc, 0, NULL, &oenv))
+                           desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -184,7 +184,7 @@ int gmx_sigeps(int argc, char *argv[])
     }
     xvgrclose(fp);
 
-    do_view(oenv, ftp2fn(efXVG, NFILE, fnm), NULL);
+    do_view(oenv, ftp2fn(efXVG, NFILE, fnm), nullptr);
 
     return 0;
 }
index 968b57d2cde4de6b40218c59fb4acf97e646653a..90f440c5d4a6d0bba432c1a530b467c24988b178 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,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.
@@ -135,7 +135,7 @@ int gmx_sorient(int argc, char *argv[])
     char              str[STRLEN];
     gmx_bool          bTPS;
     rvec              xref, dx, dxh1, dxh2, outer;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
     t_pbc             pbc;
     const char       *legr[] = {
         "<cos(\\8q\\4\\s1\\N)>",
@@ -187,10 +187,10 @@ int gmx_sorient(int argc, char *argv[])
     };
 
     t_filenm          fnm[] = {
-        { efTRX, NULL,  NULL,  ffREAD },
-        { efTPS, NULL,  NULL,  ffREAD },
-        { efNDX, NULL,  NULL,  ffOPTRD },
-        { efXVG, NULL,  "sori",   ffWRITE },
+        { efTRX, nullptr,  nullptr,  ffREAD },
+        { efTPS, nullptr,  nullptr,  ffREAD },
+        { efNDX, nullptr,  nullptr,  ffOPTRD },
+        { efXVG, nullptr,  "sori",   ffWRITE },
         { efXVG, "-no", "snor",   ffWRITE },
         { efXVG, "-ro", "sord",   ffWRITE },
         { efXVG, "-co", "scum",   ffWRITE },
@@ -199,7 +199,7 @@ int gmx_sorient(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -207,7 +207,7 @@ int gmx_sorient(int argc, char *argv[])
     bTPS = (opt2bSet("-s", NFILE, fnm) || !opt2bSet("-n", NFILE, fnm) || bCom);
     if (bTPS)
     {
-        read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, NULL, box,
+        read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, nullptr, box,
                       bCom);
     }
 
@@ -222,7 +222,7 @@ int gmx_sorient(int argc, char *argv[])
     }
     else
     {
-        get_index(NULL, ftp2fn(efNDX, NFILE, fnm), 2, isize, index, grpname);
+        get_index(nullptr, ftp2fn(efNDX, NFILE, fnm), 2, isize, index, grpname);
     }
 
     if (bCom)
@@ -368,7 +368,7 @@ int gmx_sorient(int argc, char *argv[])
 
     /* clean up */
     sfree(x);
-    close_trj(status);
+    close_trx(status);
     gmx_rmpbc_done(gpbc);
 
     /* Add the bin for the exact maximum to the previous bin */
@@ -462,8 +462,8 @@ int gmx_sorient(int argc, char *argv[])
     }
     xvgrclose(fp);
 
-    do_view(oenv, opt2fn("-o", NFILE, fnm), NULL);
-    do_view(oenv, opt2fn("-no", NFILE, fnm), NULL);
+    do_view(oenv, opt2fn("-o", NFILE, fnm), nullptr);
+    do_view(oenv, opt2fn("-no", NFILE, fnm), nullptr);
     do_view(oenv, opt2fn("-ro", NFILE, fnm), "-nxy");
     do_view(oenv, opt2fn("-co", NFILE, fnm), "-nxy");
 
index 40f6299fa0fbf6563f24cbbcd110b4c0fbd6ea4b..1badcc8d64d78a41716f85f9115f5111631b9c07 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2007,2008,2009,2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2007,2008,2009,2010,2011,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.
@@ -145,7 +145,7 @@ int gmx_spatial(int argc, char *argv[])
     int               i, nidx, nidxp;
     int               v;
     int               j, k;
-    int            ***bin = NULL;
+    int            ***bin = nullptr;
     int               nbin[3];
     FILE             *flp;
     int               x, y, z, minx, miny, minz, maxx, maxy, maxz;
@@ -153,12 +153,12 @@ int gmx_spatial(int argc, char *argv[])
     int               tot, maxval, minval;
     double            norm;
     gmx_output_env_t *oenv;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
 
     t_filenm          fnm[] = {
-        { efTPS,  NULL,  NULL, ffREAD }, /* this is for the topology */
-        { efTRX, "-f", NULL, ffREAD },   /* and this for the trajectory */
-        { efNDX, NULL, NULL, ffOPTRD }
+        { efTPS,  nullptr,  nullptr, ffREAD }, /* this is for the topology */
+        { efTRX, "-f", nullptr, ffREAD },      /* and this for the trajectory */
+        { efNDX, nullptr, nullptr, ffOPTRD }
     };
 
 #define NFILE asize(fnm)
@@ -171,7 +171,7 @@ int gmx_spatial(int argc, char *argv[])
         return 0;
     }
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, NULL, box, TRUE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, nullptr, box, TRUE);
     sfree(xtop);
 
     atoms = &(top.atoms);
index a1d73058512e55c3c056ce2d97eb8903284c935b..ed62da7c5d94cf82fb396e64404c68631e033d4a 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,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.
@@ -115,7 +115,7 @@ static void calc_com_pbc(int nrefat, const t_topology *top, rvec x[], t_pbc *pbc
     }
 }
 
-void spol_atom2molindex(int *n, int *index, const t_block *mols)
+static void spol_atom2molindex(int *n, int *index, const t_block *mols)
 {
     int nmol, i, j, m;
 
@@ -151,7 +151,6 @@ void spol_atom2molindex(int *n, int *index, const t_block *mols)
 int gmx_spol(int argc, char *argv[])
 {
     t_topology  *top;
-    t_inputrec  *ir;
     t_atom      *atom;
     t_trxstatus *status;
     int          nrefat, natoms, nf, ntot;
@@ -168,7 +167,7 @@ int gmx_spol(int argc, char *argv[])
     double       sdip, sdip2, sinp, sdinp, nmol;
     int         *hist;
     t_pbc        pbc;
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
 
 
     const char       *desc[] = {
@@ -208,23 +207,25 @@ int gmx_spol(int argc, char *argv[])
     };
 
     t_filenm          fnm[] = {
-        { efTRX, NULL,  NULL,  ffREAD },
-        { efTPR, NULL,  NULL,  ffREAD },
-        { efNDX, NULL,  NULL,  ffOPTRD },
-        { efXVG, NULL,  "scdist",  ffWRITE }
+        { efTRX, nullptr,  nullptr,  ffREAD },
+        { efTPR, nullptr,  nullptr,  ffREAD },
+        { efNDX, nullptr,  nullptr,  ffOPTRD },
+        { efXVG, nullptr,  "scdist",  ffWRITE }
     };
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
 
     snew(top, 1);
-    snew(ir, 1);
+    // TODO: Only ePBC is used, not the full inputrec.
+    t_inputrec  irInstance;
+    t_inputrec *ir = &irInstance;
     read_tpx_top(ftp2fn(efTPR, NFILE, fnm),
-                 ir, box, &natoms, NULL, NULL, top);
+                 ir, box, &natoms, nullptr, nullptr, top);
 
     /* get index groups */
     printf("Select a group of reference particles and a solvent group:\n");
@@ -359,7 +360,7 @@ int gmx_spol(int argc, char *argv[])
 
     /* clean up */
     sfree(x);
-    close_trj(status);
+    close_trx(status);
 
     fprintf(stderr, "Average number of molecules within %g nm is %.1f\n",
             rmax, static_cast<real>(ntot)/nf);
@@ -387,7 +388,7 @@ int gmx_spol(int argc, char *argv[])
     }
     xvgrclose(fp);
 
-    do_view(oenv, opt2fn("-o", NFILE, fnm), NULL);
+    do_view(oenv, opt2fn("-o", NFILE, fnm), nullptr);
 
     return 0;
 }
index 0c37c599a8e7deb2a0d1f54dfc6fd87dbfbd344a..940a51c9ffb73f47794f8a0f9640f2a34dba5914 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,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.
@@ -79,9 +79,9 @@ static void process_tcaf(int nframes, real dt, int nkc, real **tc, rvec *kfac,
                          const char *fn_tcf, const char *fn_cub,
                          const char *fn_vk, const gmx_output_env_t *oenv)
 {
-    FILE  *fp, *fp_vk, *fp_cub = NULL;
+    FILE  *fp, *fp_vk, *fp_cub = nullptr;
     int    nk, ntc;
-    real **tcaf, **tcafc = NULL, eta, *sig;
+    real **tcaf, **tcafc = nullptr, eta, *sig;
     int    i, j, k, kc;
     int    ncorr;
     double fitparms[3];
@@ -208,8 +208,8 @@ static void process_tcaf(int nframes, real dt, int nkc, real **tc, rvec *kfac,
         tcaf[k][0]   = 1.0;
         fitparms[0]  = 1;
         fitparms[1]  = 1;
-        do_lmfit(ncorr, tcaf[k], sig, dt, 0, 0, ncorr*dt,
-                 oenv, bDebugMode(), effnVAC, fitparms, 0, NULL);
+        do_lmfit(ncorr, tcaf[k], sig, dt, nullptr, 0, ncorr*dt,
+                 oenv, bDebugMode(), effnVAC, fitparms, 0, nullptr);
         eta = 1000*fitparms[1]*rho/
             (4*fitparms[0]*PICO*norm2(kfac[k])/(NANO*NANO));
         fprintf(stdout, "k %6.3f  tau %6.3f  eta %8.5f 10^-3 kg/(m s)\n",
@@ -233,8 +233,8 @@ static void process_tcaf(int nframes, real dt, int nkc, real **tc, rvec *kfac,
             tcafc[k][0]  = 1.0;
             fitparms[0]  = 1;
             fitparms[1]  = 1;
-            do_lmfit(ncorr, tcafc[k], sig, dt, 0, 0, ncorr*dt,
-                     oenv, bDebugMode(), effnVAC, fitparms, 0, NULL);
+            do_lmfit(ncorr, tcafc[k], sig, dt, nullptr, 0, ncorr*dt,
+                     oenv, bDebugMode(), effnVAC, fitparms, 0, nullptr);
             eta = 1000*fitparms[1]*rho/
                 (4*fitparms[0]*PICO*norm2(kfac[kset_c[k]])/(NANO*NANO));
             fprintf(stdout,
@@ -309,7 +309,7 @@ int gmx_tcaf(int argc, char *argv[])
     matrix            box;
     gmx_bool          bTop;
     int               gnx;
-    int              *index, *atndx = NULL, at;
+    int              *index, *atndx = nullptr, at;
     char             *grpname;
     char              title[256];
     real              t0, t1, dt, m, mtot, sysmass, rho, sx, cx;
@@ -323,9 +323,9 @@ int gmx_tcaf(int argc, char *argv[])
 #define NHISTO 360
 
     t_filenm  fnm[] = {
-        { efTRN, "-f",    NULL,      ffREAD  },
-        { efTPS, NULL,    NULL,      ffOPTRD },
-        { efNDX, NULL,    NULL,      ffOPTRD },
+        { efTRN, "-f",    nullptr,      ffREAD  },
+        { efTPS, nullptr,    nullptr,      ffOPTRD },
+        { efNDX, nullptr,    nullptr,      ffOPTRD },
         { efXVG, "-ot",  "transcur", ffOPTWR },
         { efXVG, "-oa",  "tcaf_all", ffWRITE },
         { efXVG, "-o",   "tcaf",     ffWRITE },
@@ -341,12 +341,13 @@ int gmx_tcaf(int argc, char *argv[])
     ppa    = add_acf_pargs(&npargs, pa);
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
-                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, nullptr, &oenv))
     {
+        sfree(ppa);
         return 0;
     }
 
-    bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, NULL, NULL, box,
+    bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, nullptr, nullptr, box,
                          TRUE);
     get_index(&top.atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &gnx, &index, &grpname);
 
@@ -479,7 +480,7 @@ int gmx_tcaf(int argc, char *argv[])
         nframes++;
     }
     while (read_next_frame(oenv, status, &fr));
-    close_trj(status);
+    close_trx(status);
 
     dt = (t1-t0)/(nframes-1);
 
index e7025cdd2393e7aefb1063f1ef913228c6710313..9c806d4a4ee7a03cf4b0f9fdcc74d85e92975ab1 100644 (file)
@@ -41,6 +41,7 @@
 #include <cstring>
 
 #include <algorithm>
+#include <string>
 
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/commandline/viewit.h"
@@ -72,7 +73,7 @@ static void low_print_data(FILE *fp, real time, rvec x[], int n, int *index,
     fprintf(fp, " %g", time);
     for (i = 0; i < n; i++)
     {
-        if (index != NULL)
+        if (index != nullptr)
         {
             ii = index[i];
         }
@@ -111,7 +112,7 @@ static void average_data(rvec x[], rvec xav[], real *mass,
         for (i = 0; i < isize[g]; i++)
         {
             ind = index[g][i];
-            if (mass != NULL)
+            if (mass != nullptr)
             {
                 m = mass[ind];
                 svmul(m, x[ind], tmp);
@@ -129,7 +130,7 @@ static void average_data(rvec x[], rvec xav[], real *mass,
                 }
             }
         }
-        if (mass != NULL)
+        if (mass != nullptr)
         {
             for (d = 0; d < DIM; d++)
             {
@@ -151,16 +152,16 @@ static void print_data(FILE *fp, real time, rvec x[], real *mass, gmx_bool bCom,
                        int ngrps, int isize[], int **index, gmx_bool bDim[],
                        const char *sffmt)
 {
-    static rvec *xav = NULL;
+    static rvec *xav = nullptr;
 
     if (bCom)
     {
-        if (xav == NULL)
+        if (xav == nullptr)
         {
             snew(xav, ngrps);
         }
         average_data(x, xav, mass, ngrps, isize, index);
-        low_print_data(fp, time, xav, ngrps, NULL, bDim, sffmt);
+        low_print_data(fp, time, xav, ngrps, nullptr, bDim, sffmt);
     }
     else
     {
@@ -171,14 +172,14 @@ static void print_data(FILE *fp, real time, rvec x[], real *mass, gmx_bool bCom,
 static void write_trx_x(t_trxstatus *status, const t_trxframe *fr, real *mass, gmx_bool bCom,
                         int ngrps, int isize[], int **index)
 {
-    static rvec    *xav   = NULL;
-    static t_atoms *atoms = NULL;
+    static rvec    *xav   = nullptr;
+    static t_atoms *atoms = nullptr;
     t_trxframe      fr_av;
     int             i;
 
     if (bCom)
     {
-        if (xav == NULL)
+        if (xav == nullptr)
         {
             snew(xav, ngrps);
             snew(atoms, 1);
@@ -199,11 +200,11 @@ static void write_trx_x(t_trxstatus *status, const t_trxframe *fr, real *mass, g
         fr_av.natoms = ngrps;
         fr_av.atoms  = atoms;
         fr_av.x      = xav;
-        write_trxframe(status, &fr_av, NULL);
+        write_trxframe(status, &fr_av, nullptr);
     }
     else
     {
-        write_trxframe_indexed(status, fr, isize[0], index[0], NULL);
+        write_trxframe_indexed(status, fr, isize[0], index[0], nullptr);
     }
 }
 
@@ -260,27 +261,13 @@ static void make_legend(FILE *fp, int ngrps, int isize, int index[],
 
 static real ekrot(rvec x[], rvec v[], real mass[], int isize, int index[])
 {
-    static real **TCM = NULL, **L;
+    real          TCM[5][5], L[5][5];
     double        tm, m0, lxx, lxy, lxz, lyy, lyz, lzz, ekrot;
     rvec          a0, ocm;
     dvec          dx, b0;
     dvec          xcm, vcm, acm;
     int           i, j, m, n;
 
-    if (TCM == NULL)
-    {
-        snew(TCM, DIM);
-        for (i = 0; i < DIM; i++)
-        {
-            snew(TCM[i], DIM);
-        }
-        snew(L, DIM);
-        for (i = 0; i < DIM; i++)
-        {
-            snew(L[i], DIM);
-        }
-    }
-
     clear_dvec(xcm);
     clear_dvec(vcm);
     clear_dvec(acm);
@@ -333,7 +320,7 @@ static real ekrot(rvec x[], rvec v[], real mass[], int isize, int index[])
     L[YY][ZZ] = -lyz;
     L[ZZ][ZZ] =  lxx + lyy;
 
-    m_inv_gen(L, DIM, TCM);
+    m_inv_gen(&L[0][0], DIM, &TCM[0][0]);
 
     /* Compute omega (hoeksnelheid) */
     clear_rvec(ocm);
@@ -507,10 +494,12 @@ static void write_pdb_bfac(const char *fname, const char *xname,
                *(atoms->resinfo[atoms->atom[maxi].resind].name),
                atoms->resinfo[atoms->atom[maxi].resind].nr);
 
-        if (atoms->pdbinfo == NULL)
+        if (atoms->pdbinfo == nullptr)
         {
             snew(atoms->pdbinfo, atoms->nr);
         }
+        atoms->havePdbInfo = TRUE;
+
         if (onedim == -1)
         {
             for (i = 0; i < isize; i++)
@@ -533,7 +522,7 @@ static void write_pdb_bfac(const char *fname, const char *xname,
                 atoms->pdbinfo[index[i]].bfac = sum[index[i]][onedim]*scale;
             }
         }
-        write_sto_conf_indexed(fname, title, atoms, x, NULL, ePBC, box, isize, index);
+        write_sto_conf_indexed(fname, title, atoms, x, nullptr, ePBC, box, isize, index);
     }
 }
 
@@ -543,7 +532,7 @@ static void update_histo(int gnx, int index[], rvec v[],
     int  i, m, in, nnn;
     real vn, vnmax;
 
-    if (*histo == NULL)
+    if (*histo == nullptr)
     {
         vnmax = 0;
         for (i = 0; (i < gnx); i++)
@@ -621,7 +610,9 @@ int gmx_traj(int argc, char *argv[])
         "(specified with [TT]-av[tt] or [TT]-af[tt]).[PAR]",
         "Option [TT]-vd[tt] computes a velocity distribution, i.e. the",
         "norm of the vector is plotted. In addition in the same graph",
-        "the kinetic energy distribution is given."
+        "the kinetic energy distribution is given.",
+        "",
+        "See [gmx-trajectory] for plotting similar data for selections."
     };
     static gmx_bool   bMol    = FALSE, bCom = FALSE, bPBC = TRUE, bNoJump = FALSE;
     static gmx_bool   bX      = TRUE, bY = TRUE, bZ = TRUE, bNorm = FALSE, bFP = FALSE;
@@ -633,7 +624,7 @@ int gmx_traj(int argc, char *argv[])
         { "-pbc", FALSE, etBOOL, {&bPBC},
           "Make molecules whole for COM" },
         { "-mol", FALSE, etBOOL, {&bMol},
-          "Index contains molecule numbers iso atom numbers" },
+          "Index contains molecule numbers instead of atom numbers" },
         { "-nojump", FALSE, etBOOL, {&bNoJump},
           "Remove jumps of atoms across the box" },
         { "-x", FALSE, etBOOL, {&bX},
@@ -655,20 +646,20 @@ int gmx_traj(int argc, char *argv[])
         { "-scale", FALSE, etREAL, {&scale},
           "Scale factor for [REF].pdb[ref] output, 0 is autoscale" }
     };
-    FILE             *outx   = NULL, *outv = NULL, *outf = NULL, *outb = NULL, *outt = NULL;
-    FILE             *outekt = NULL, *outekr = NULL;
+    FILE             *outx   = nullptr, *outv = nullptr, *outf = nullptr, *outb = nullptr, *outt = nullptr;
+    FILE             *outekt = nullptr, *outekr = nullptr;
     t_topology        top;
     int               ePBC;
     real             *mass, time;
     const char       *indexfn;
     t_trxframe        fr;
-    int               flags, nvhisto = 0, *vhisto = NULL;
-    rvec             *xtop, *xp = NULL;
-    rvec             *sumx = NULL, *sumv = NULL, *sumf = NULL;
+    int               flags, nvhisto = 0, *vhisto = nullptr;
+    rvec             *xtop, *xp = nullptr;
+    rvec             *sumx = nullptr, *sumv = nullptr, *sumf = nullptr;
     matrix            topbox;
     t_trxstatus      *status;
-    t_trxstatus      *status_out = NULL;
-    gmx_rmpbc_t       gpbc       = NULL;
+    t_trxstatus      *status_out = nullptr;
+    gmx_rmpbc_t       gpbc       = nullptr;
     int               i, j;
     int               nr_xfr, nr_vfr, nr_ffr;
     char            **grpname;
@@ -683,9 +674,9 @@ int gmx_traj(int argc, char *argv[])
     gmx_output_env_t *oenv;
 
     t_filenm          fnm[] = {
-        { efTRX, "-f", NULL, ffREAD },
-        { efTPS, NULL, NULL, ffREAD },
-        { efNDX, NULL, NULL, ffOPTRD },
+        { efTRX, "-f", nullptr, ffREAD },
+        { efTPS, nullptr, nullptr, ffREAD },
+        { efNDX, nullptr, nullptr, ffOPTRD },
         { efXVG, "-ox",  "coord",     ffOPTWR },
         { efTRX, "-oxt", "coord",     ffOPTWR },
         { efXVG, "-ov",  "veloc",     ffOPTWR },
@@ -704,7 +695,7 @@ int gmx_traj(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv,
                            PCA_CAN_TIME | PCA_TIME_UNIT | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -747,7 +738,7 @@ int gmx_traj(int argc, char *argv[])
     sprintf(sffmt6, "%s%s%s%s%s%s", sffmt, sffmt, sffmt, sffmt, sffmt, sffmt);
 
     bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC,
-                         &xtop, NULL, topbox,
+                         &xtop, nullptr, topbox,
                          bCom && (bOX || bOXT || bOV || bOT || bEKT || bEKR));
     sfree(xtop);
     if ((bMol || bCV || bCF) && !bTop)
@@ -810,16 +801,17 @@ int gmx_traj(int argc, char *argv[])
     }
     else
     {
-        mass = NULL;
+        mass = nullptr;
     }
 
     flags = 0;
+    std::string label(output_env_get_xvgr_tlabel(oenv));
     if (bOX)
     {
         flags = flags | TRX_READ_X;
         outx  = xvgropen(opt2fn("-ox", NFILE, fnm),
                          bCom ? "Center of mass" : "Coordinate",
-                         output_env_get_xvgr_tlabel(oenv), "Coordinate (nm)", oenv);
+                         label, "Coordinate (nm)", oenv);
         make_legend(outx, ngroups, isize0[0], index0[0], grpname, bCom, bMol, bDim, oenv);
     }
     if (bOXT)
@@ -832,21 +824,21 @@ int gmx_traj(int argc, char *argv[])
         flags = flags | TRX_READ_V;
         outv  = xvgropen(opt2fn("-ov", NFILE, fnm),
                          bCom ? "Center of mass velocity" : "Velocity",
-                         output_env_get_xvgr_tlabel(oenv), "Velocity (nm/ps)", oenv);
+                         label, "Velocity (nm/ps)", oenv);
         make_legend(outv, ngroups, isize0[0], index0[0], grpname, bCom, bMol, bDim, oenv);
     }
     if (bOF)
     {
         flags = flags | TRX_READ_F;
         outf  = xvgropen(opt2fn("-of", NFILE, fnm), "Force",
-                         output_env_get_xvgr_tlabel(oenv), "Force (kJ mol\\S-1\\N nm\\S-1\\N)",
+                         label, "Force (kJ mol\\S-1\\N nm\\S-1\\N)",
                          oenv);
         make_legend(outf, ngroups, isize0[0], index0[0], grpname, bCom, bMol, bDim, oenv);
     }
     if (bOB)
     {
         outb = xvgropen(opt2fn("-ob", NFILE, fnm), "Box vector elements",
-                        output_env_get_xvgr_tlabel(oenv), "(nm)", oenv);
+                        label, "(nm)", oenv);
 
         xvgr_legend(outb, 6, box_leg, oenv);
     }
@@ -858,7 +850,7 @@ int gmx_traj(int argc, char *argv[])
         bDum[DIM] = TRUE;
         flags     = flags | TRX_READ_V;
         outt      = xvgropen(opt2fn("-ot", NFILE, fnm), "Temperature",
-                             output_env_get_xvgr_tlabel(oenv), "(K)", oenv);
+                             label, "(K)", oenv);
         make_legend(outt, ngroups, isize[0], index[0], grpname, bCom, bMol, bDum, oenv);
     }
     if (bEKT)
@@ -869,7 +861,7 @@ int gmx_traj(int argc, char *argv[])
         bDum[DIM] = TRUE;
         flags     = flags | TRX_READ_V;
         outekt    = xvgropen(opt2fn("-ekt", NFILE, fnm), "Center of mass translation",
-                             output_env_get_xvgr_tlabel(oenv), "Energy (kJ mol\\S-1\\N)", oenv);
+                             label, "Energy (kJ mol\\S-1\\N)", oenv);
         make_legend(outekt, ngroups, isize[0], index[0], grpname, bCom, bMol, bDum, oenv);
     }
     if (bEKR)
@@ -880,7 +872,7 @@ int gmx_traj(int argc, char *argv[])
         bDum[DIM] = TRUE;
         flags     = flags | TRX_READ_X | TRX_READ_V;
         outekr    = xvgropen(opt2fn("-ekr", NFILE, fnm), "Center of mass rotation",
-                             output_env_get_xvgr_tlabel(oenv), "Energy (kJ mol\\S-1\\N)", oenv);
+                             label, "Energy (kJ mol\\S-1\\N)", oenv);
         make_legend(outekr, ngroups, isize[0], index[0], grpname, bCom, bMol, bDum, oenv);
     }
     if (bVD)
@@ -982,7 +974,7 @@ int gmx_traj(int argc, char *argv[])
         }
         if (bOF && fr.bF)
         {
-            print_data(outf, time, fr.f, NULL, bCom, ngroups, isize, index, bDim, sffmt);
+            print_data(outf, time, fr.f, nullptr, bCom, ngroups, isize, index, bDim, sffmt);
         }
         if (bOB && fr.bBox)
         {
@@ -1049,13 +1041,13 @@ int gmx_traj(int argc, char *argv[])
     }
     while (read_next_frame(oenv, status, &fr));
 
-    if (gpbc != NULL)
+    if (gpbc != nullptr)
     {
         gmx_rmpbc_done(gpbc);
     }
 
     /* clean up a bit */
-    close_trj(status);
+    close_trx(status);
 
     if (bOX)
     {
@@ -1132,5 +1124,28 @@ int gmx_traj(int argc, char *argv[])
     /* view it */
     view_all(oenv, NFILE, fnm);
 
+    done_top(&top);
+    // Free index and isize only if they are distinct from index0 and isize0
+    if (bMol)
+    {
+        for (int i = 0; i < ngroups; i++)
+        {
+            sfree(index[i]);
+        }
+        sfree(index);
+        sfree(isize);
+    }
+    for (int i = 0; i < ngroups; i++)
+    {
+        sfree(index0[i]);
+        sfree(grpname[i]);
+    }
+    sfree(index0);
+    sfree(isize0);
+    sfree(grpname);
+    done_filenms(NFILE, fnm);
+    done_frame(&fr);
+    output_env_done(oenv);
+
     return 0;
 }
index 1658d13d007bfc0da1b627577aa32dd73e13e6b8..950c87fee7e88a9d2fd23eb36660fef4aa3ac27e 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,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.
 #include <cstring>
 
 #include <algorithm>
+#include <string>
 
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/pdbio.h"
 #include "gromacs/fileio/tngio.h"
-#include "gromacs/fileio/tngio_for_tools.h"
 #include "gromacs/fileio/trxio.h"
 #include "gromacs/fileio/xtcio.h"
 #include "gromacs/fileio/xvgr.h"
@@ -130,7 +130,7 @@ static void scan_trj_files(char **fnms, int nfiles, real *readtime,
             timestep[i] = 0;
         }
 
-        close_trj(status);
+        close_trx(status);
         if (fr.bX)
         {
             sfree(fr.x);
@@ -184,6 +184,7 @@ static void edit_files(char **fnms, int nfiles, real *readtime, real *timestep,
     gmx_bool ok;
     char     inputstring[STRLEN], *chptr;
 
+    auto     timeUnit = output_env_get_time_unit(oenv);
     if (bSetTime)
     {
         fprintf(stderr, "\n\nEnter the new start time (%s) for each file.\n"
@@ -195,22 +196,22 @@ static void edit_files(char **fnms, int nfiles, real *readtime, real *timestep,
                 "same amount as in the previous. Use it when the time in the\n"
                 "new run continues from the end of the previous one,\n"
                 "since this takes possible overlap into account.\n\n",
-                output_env_get_time_unit(oenv));
+                timeUnit.c_str());
 
         fprintf(
                 stderr,
                 "          File             Current start (%s)  New start (%s)\n"
                 "---------------------------------------------------------\n",
-                output_env_get_time_unit(oenv), output_env_get_time_unit(oenv));
+                timeUnit.c_str(), timeUnit.c_str());
 
         for (i = 0; i < nfiles; i++)
         {
             fprintf(stderr, "%25s   %10.3f %s          ", fnms[i],
-                    output_env_conv_time(oenv, readtime[i]), output_env_get_time_unit(oenv));
+                    output_env_conv_time(oenv, readtime[i]), timeUnit.c_str());
             ok = FALSE;
             do
             {
-                if (NULL == fgets(inputstring, STRLEN - 1, stdin))
+                if (nullptr == fgets(inputstring, STRLEN - 1, stdin))
                 {
                     gmx_fatal(FARGS, "Error reading user input" );
                 }
@@ -282,8 +283,8 @@ static void edit_files(char **fnms, int nfiles, real *readtime, real *timestep,
             case TIME_EXPLICIT:
                 fprintf(stderr, "%25s   %10.3f %s   %10.3f %s",
                         fnms[i],
-                        output_env_conv_time(oenv, settime[i]), output_env_get_time_unit(oenv),
-                        output_env_conv_time(oenv, timestep[i]), output_env_get_time_unit(oenv));
+                        output_env_conv_time(oenv, settime[i]), timeUnit.c_str(),
+                        output_env_conv_time(oenv, timestep[i]), timeUnit.c_str());
                 if (i > 0 &&
                     cont_type[i-1] == TIME_EXPLICIT && settime[i] == settime[i-1])
                 {
@@ -384,11 +385,11 @@ static void do_demux(int nset, char *fnms[], char *fnms_out[], int nval,
             {
                 if (index)
                 {
-                    write_trxframe_indexed(fp_out[j], &trx[i], isize, index, NULL);
+                    write_trxframe_indexed(fp_out[j], &trx[i], isize, index, nullptr);
                 }
                 else
                 {
-                    write_trxframe(fp_out[j], &trx[i], NULL);
+                    write_trxframe(fp_out[j], &trx[i], nullptr);
                 }
             }
         }
@@ -438,7 +439,6 @@ int gmx_trjcat(int argc, char *argv[])
         "the trajectory does not match that in the [REF].xvg[ref] file then the program",
         "tries to be smart. Beware."
     };
-    static gmx_bool bVels           = TRUE;
     static gmx_bool bCat            = FALSE;
     static gmx_bool bSort           = TRUE;
     static gmx_bool bKeepLast       = FALSE;
@@ -459,8 +459,6 @@ int gmx_trjcat(int argc, char *argv[])
           { &end }, "Last time to use (%t)" },
         { "-dt", FALSE, etTIME,
           { &dt }, "Only write frame when t MOD dt = first time (%t)" },
-        { "-vel", FALSE, etBOOL,
-          { &bVels }, "Read and write velocities if possible" },
         { "-settime", FALSE, etBOOL,
           { &bSetTime }, "Change starting time interactively" },
         { "-sort", FALSE, etBOOL,
@@ -474,7 +472,7 @@ int gmx_trjcat(int argc, char *argv[])
     };
 #define npargs asize(pa)
     int               ftpin, i, frame, frame_out;
-    t_trxstatus      *status, *trxout = NULL;
+    t_trxstatus      *status, *trxout = nullptr;
     real              t_corr;
     t_trxframe        fr, frout;
     char            **fnms, **fnms_out, *out_file;
@@ -486,16 +484,16 @@ int gmx_trjcat(int argc, char *argv[])
     gmx_bool          lastTimeSet = FALSE;
     real              last_frame_time, searchtime;
     int               isize = 0, j;
-    int              *index = NULL, imax;
+    int              *index = nullptr, imax;
     char             *grpname;
-    real            **val = NULL, *t = NULL, dt_remd;
+    real            **val = nullptr, *t = nullptr, dt_remd;
     int               n, nset, ftpout = -1, prevEndStep = 0, filetype;
     gmx_off_t         fpos;
     gmx_output_env_t *oenv;
     t_filenm          fnm[] =
     {
-        { efTRX, "-f", NULL, ffRDMULT },
-        { efTRO, "-o", NULL, ffWRMULT },
+        { efTRX, "-f", nullptr, ffRDMULT },
+        { efTRO, "-o", nullptr, ffWRMULT },
         { efNDX, "-n", "index", ffOPTRD },
         { efXVG, "-demux", "remd", ffOPTRD }
     };
@@ -503,10 +501,11 @@ int gmx_trjcat(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_TIME_UNIT, NFILE, fnm,
-                           asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
+    auto timeUnit = output_env_get_time_unit(oenv);
 
     bIndex = ftp2bSet(efNDX, NFILE, fnm);
     bDeMux = ftp2bSet(efXVG, NFILE, fnm);
@@ -652,13 +651,13 @@ int gmx_trjcat(int argc, char *argv[])
                 }
                 if (bIndex)
                 {
-                    trjtools_gmx_prepare_tng_writing(out_file, 'w', NULL, &trxout,
-                                                     fnms[0], isize, NULL, index, grpname);
+                    trjtools_gmx_prepare_tng_writing(out_file, 'w', nullptr, &trxout,
+                                                     fnms[0], isize, nullptr, index, grpname);
                 }
                 else
                 {
-                    trjtools_gmx_prepare_tng_writing(out_file, 'w', NULL, &trxout,
-                                                     fnms[0], -1, NULL, NULL, NULL);
+                    trjtools_gmx_prepare_tng_writing(out_file, 'w', nullptr, &trxout,
+                                                     fnms[0], -1, nullptr, nullptr, nullptr);
                 }
             }
             else
@@ -703,7 +702,7 @@ int gmx_trjcat(int argc, char *argv[])
                 }
                 lastTimeSet     = TRUE;
                 bKeepLastAppend = TRUE;
-                close_trj(status);
+                close_trx(status);
                 trxout = open_trx(out_file, "a");
             }
             else if (bOverwrite)
@@ -739,7 +738,7 @@ int gmx_trjcat(int argc, char *argv[])
                 lasttime    = fr.time;
                 lastTimeSet = TRUE;
                 fpos        = gmx_fio_ftell(stfio);
-                close_trj(status);
+                close_trx(status);
                 trxout = open_trx(out_file, "r+");
                 if (gmx_fio_seek(trx_get_fileio(trxout), fpos))
                 {
@@ -800,7 +799,7 @@ int gmx_trjcat(int argc, char *argv[])
                                 "spacing than the rest,\n"
                                 "might be a gap or overlap that couldn't be corrected "
                                 "automatically.\n", output_env_conv_time(oenv, frout.time),
-                                output_env_get_time_unit(oenv));
+                                timeUnit.c_str());
                     }
                 }
             }
@@ -890,7 +889,7 @@ int gmx_trjcat(int argc, char *argv[])
                         {
                             fprintf(stderr, "\nContinue writing frames from %s t=%g %s, "
                                     "frame=%d      \n",
-                                    fnms[i], output_env_conv_time(oenv, frout.time), output_env_get_time_unit(oenv),
+                                    fnms[i], output_env_conv_time(oenv, frout.time), timeUnit.c_str(),
                                     frame);
                             bNewFile = FALSE;
                         }
@@ -898,16 +897,16 @@ int gmx_trjcat(int argc, char *argv[])
                         if (bIndex)
                         {
                             write_trxframe_indexed(trxout, &frout, isize, index,
-                                                   NULL);
+                                                   nullptr);
                         }
                         else
                         {
-                            write_trxframe(trxout, &frout, NULL);
+                            write_trxframe(trxout, &frout, nullptr);
                         }
                         if ( ((frame % 10) == 0) || (frame < 10) )
                         {
                             fprintf(stderr, " ->  frame %6d time %8.3f %s     \r",
-                                    frame_out, output_env_conv_time(oenv, frout.time), output_env_get_time_unit(oenv));
+                                    frame_out, output_env_conv_time(oenv, frout.time), timeUnit.c_str());
                             fflush(stderr);
                         }
                     }
@@ -915,14 +914,14 @@ int gmx_trjcat(int argc, char *argv[])
             }
             while (read_next_frame(oenv, status, &fr));
 
-            close_trj(status);
+            close_trx(status);
         }
         if (trxout)
         {
             close_trx(trxout);
         }
         fprintf(stderr, "\nLast frame written was %d, time %f %s\n",
-                frame, output_env_conv_time(oenv, last_ok_t), output_env_get_time_unit(oenv));
+                frame, output_env_conv_time(oenv, last_ok_t), timeUnit.c_str());
     }
 
     return 0;
index 0b9173470599d79cc61f89270d3cc031d777d69f..51d48f2b5f0a68c9ede9e19434e305435f9de322 100644 (file)
@@ -49,7 +49,7 @@
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/groio.h"
 #include "gromacs/fileio/pdbio.h"
-#include "gromacs/fileio/tngio_for_tools.h"
+#include "gromacs/fileio/tngio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trrio.h"
 #include "gromacs/fileio/trxio.h"
@@ -463,7 +463,7 @@ static void mk_filenm(char *base, const char *ext, int ndigit, int file_nr,
     std::strcat(out_file, ext);
 }
 
-void check_trr(const char *fn)
+static void check_trr(const char *fn)
 {
     if (fn2ftp(fn) != efTRR)
     {
@@ -471,7 +471,7 @@ void check_trr(const char *fn)
     }
 }
 
-void do_trunc(const char *fn, real t0)
+static void do_trunc(const char *fn, real t0)
 {
     t_fileio        *in;
     FILE            *fp;
@@ -492,7 +492,7 @@ void do_trunc(const char *fn, real t0)
 
     in   = gmx_trr_open(fn, "r");
     fp   = gmx_fio_getfp(in);
-    if (fp == NULL)
+    if (fp == nullptr)
     {
         fprintf(stderr, "Sorry, can not trunc %s, truncation of this filetype is not supported\n", fn);
         gmx_trr_close(in);
@@ -504,7 +504,7 @@ void do_trunc(const char *fn, real t0)
         bStop = FALSE;
         while (!bStop && gmx_trr_read_frame_header(in, &sh, &bOK))
         {
-            gmx_trr_read_frame_data(in, &sh, NULL, NULL, NULL, NULL);
+            gmx_trr_read_frame_data(in, &sh, nullptr, nullptr, nullptr, nullptr);
             fpos = gmx_ftell(fp);
             t    = sh.t;
             if (t >= t0)
@@ -568,7 +568,7 @@ static gmx_mtop_t *read_mtop_for_tng(const char *tps_file,
                                      const char *input_file,
                                      const char *output_file)
 {
-    gmx_mtop_t *mtop = NULL;
+    gmx_mtop_t *mtop = nullptr;
 
     if (fn2bTPX(tps_file) &&
         efTNG != fn2ftp(input_file) &&
@@ -576,8 +576,8 @@ static gmx_mtop_t *read_mtop_for_tng(const char *tps_file,
     {
         int temp_natoms = -1;
         snew(mtop, 1);
-        read_tpx(tps_file, NULL, NULL, &temp_natoms,
-                 NULL, NULL, mtop);
+        read_tpx(tps_file, nullptr, nullptr, &temp_natoms,
+                 nullptr, nullptr, mtop);
     }
 
     return mtop;
@@ -738,20 +738,20 @@ int gmx_trjconv(int argc, char *argv[])
     };
     const char *pbc_opt[epNR + 1] =
     {
-        NULL, "none", "mol", "res", "atom", "nojump", "cluster", "whole",
-        NULL
+        nullptr, "none", "mol", "res", "atom", "nojump", "cluster", "whole",
+        nullptr
     };
 
     int         unitcell_enum;
     const char *unitcell_opt[euNR+1] =
-    { NULL, "rect", "tric", "compact", NULL };
+    { nullptr, "rect", "tric", "compact", nullptr };
 
     enum
     {
         ecSel, ecTric, ecRect, ecZero, ecNR
     };
     const char *center_opt[ecNR+1] =
-    { NULL, "tric", "rect", "zero", NULL };
+    { nullptr, "tric", "rect", "zero", nullptr };
     int         ecenter;
 
     int         fit_enum;
@@ -761,8 +761,8 @@ int gmx_trjconv(int argc, char *argv[])
     };
     const char *fit[efNR + 1] =
     {
-        NULL, "none", "rot+trans", "rotxy+transxy", "translation", "transxy",
-        "progressive", NULL
+        nullptr, "none", "rot+trans", "rotxy+transxy", "translation", "transxy",
+        "progressive", nullptr
     };
 
     static gmx_bool  bSeparate     = FALSE, bVels = TRUE, bForce = FALSE, bCONECT = FALSE;
@@ -770,7 +770,7 @@ int gmx_trjconv(int argc, char *argv[])
     static int       skip_nr       = 1, ndec = 3, nzero = 0;
     static real      tzero         = 0, delta_t = 0, timestep = 0, ttrunc = -1, tdump = -1, split_t = 0;
     static rvec      newbox        = {0, 0, 0}, shift = {0, 0, 0}, trans = {0, 0, 0};
-    static char     *exec_command  = NULL;
+    static char     *exec_command  = nullptr;
     static real      dropunder     = 0, dropover = 0;
     static gmx_bool  bRound        = FALSE;
 
@@ -854,59 +854,59 @@ int gmx_trjconv(int argc, char *argv[])
     };
 #define NPA asize(pa)
 
-    FILE             *out    = NULL;
-    t_trxstatus      *trxout = NULL;
+    FILE             *out    = nullptr;
+    t_trxstatus      *trxout = nullptr;
     t_trxstatus      *trxin;
     int               file_nr;
     t_trxframe        fr, frout;
     int               flags;
-    rvec             *xmem  = NULL, *vmem = NULL, *fmem = NULL;
-    rvec             *xp    = NULL, x_shift, hbox;
-    real             *w_rls = NULL;
+    rvec             *xmem  = nullptr, *vmem = nullptr, *fmem = nullptr;
+    rvec             *xp    = nullptr, x_shift, hbox;
+    real             *w_rls = nullptr;
     int               m, i, d, frame, outframe, natoms, nout, ncent, newstep = 0, model_nr;
 #define SKIP 10
     t_topology        top;
-    gmx_mtop_t       *mtop  = NULL;
-    gmx_conect        gc    = NULL;
+    gmx_mtop_t       *mtop  = nullptr;
+    gmx_conect        gc    = nullptr;
     int               ePBC  = -1;
-    t_atoms          *atoms = NULL, useatoms;
+    t_atoms          *atoms = nullptr, useatoms;
     matrix            top_box;
-    int              *index, *cindex;
-    char             *grpnm;
+    int              *index = nullptr, *cindex = nullptr;
+    char             *grpnm = nullptr;
     int              *frindex, nrfri;
     char             *frname;
     int               ifit, my_clust = -1;
     int              *ind_fit;
     char             *gn_fit;
-    t_cluster_ndx    *clust           = NULL;
-    t_trxstatus     **clust_status    = NULL;
-    int              *clust_status_id = NULL;
+    t_cluster_ndx    *clust           = nullptr;
+    t_trxstatus     **clust_status    = nullptr;
+    int              *clust_status_id = nullptr;
     int               ntrxopen        = 0;
-    int              *nfwritten       = NULL;
+    int              *nfwritten       = nullptr;
     int               ndrop           = 0, ncol, drop0 = 0, drop1 = 0, dropuse = 0;
     double          **dropval;
     real              tshift = 0, t0 = -1, dt = 0.001, prec;
     gmx_bool          bFit, bPFit, bReset;
     int               nfitdim;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
     gmx_bool          bRmPBC, bPBCWhole, bPBCcomRes, bPBCcomMol, bPBCcomAtom, bPBC, bNoJump, bCluster;
     gmx_bool          bCopy, bDoIt, bIndex, bTDump, bSetTime, bTPS = FALSE, bDTset = FALSE;
     gmx_bool          bExec, bTimeStep = FALSE, bDumpFrame = FALSE, bSetPrec, bNeedPrec;
     gmx_bool          bHaveFirstFrame, bHaveNextFrame, bSetBox, bSetUR, bSplit = FALSE;
     gmx_bool          bSubTraj = FALSE, bDropUnder = FALSE, bDropOver = FALSE, bTrans = FALSE;
     gmx_bool          bWriteFrame, bSplitHere;
-    const char       *top_file, *in_file, *out_file = NULL;
+    const char       *top_file, *in_file, *out_file = nullptr;
     char              out_file2[256], *charpt;
-    char             *outf_base = NULL;
-    const char       *outf_ext  = NULL;
+    char             *outf_base = nullptr;
+    const char       *outf_ext  = nullptr;
     char              top_title[256], title[256], filemode[5];
     gmx_output_env_t *oenv;
 
     t_filenm          fnm[] = {
-        { efTRX, "-f",   NULL,      ffREAD  },
-        { efTRO, "-o",   NULL,      ffWRITE },
-        { efTPS, NULL,   NULL,      ffOPTRD },
-        { efNDX, NULL,   NULL,      ffOPTRD },
+        { efTRX, "-f",   nullptr,      ffREAD  },
+        { efTRO, "-o",   nullptr,      ffWRITE },
+        { efTPS, nullptr,   nullptr,      ffOPTRD },
+        { efNDX, nullptr,   nullptr,      ffOPTRD },
         { efNDX, "-fr",  "frames",  ffOPTRD },
         { efNDX, "-sub", "cluster", ffOPTRD },
         { efXVG, "-drop", "drop",    ffOPTRD }
@@ -917,13 +917,12 @@ int gmx_trjconv(int argc, char *argv[])
                            PCA_CAN_BEGIN | PCA_CAN_END | PCA_CAN_VIEW |
                            PCA_TIME_UNIT,
                            NFILE, fnm, NPA, pa, asize(desc), desc,
-                           0, NULL, &oenv))
+                           0, nullptr, &oenv))
     {
         return 0;
     }
 
     top_file = ftp2fn(efTPS, NFILE, fnm);
-    init_top(&top);
 
     /* Check command line */
     in_file = opt2fn("-f", NFILE, fnm);
@@ -1026,7 +1025,7 @@ int gmx_trjconv(int argc, char *argv[])
         if (bSeparate || bSplit)
         {
             outf_ext = std::strrchr(out_file, '.');
-            if (outf_ext == NULL)
+            if (outf_ext == nullptr)
             {
                 gmx_fatal(FARGS, "Output file name '%s' does not contain a '.'", out_file);
             }
@@ -1044,7 +1043,7 @@ int gmx_trjconv(int argc, char *argv[])
                 gmx_fatal(FARGS, "Can only use the sub option with output file types "
                           "xtc and trr");
             }
-            clust = cluster_index(NULL, opt2fn("-sub", NFILE, fnm));
+            clust = cluster_index(nullptr, opt2fn("-sub", NFILE, fnm));
 
             /* Check for number of files disabled, as FOPEN_MAX is not the correct
              * number to check for. In my linux box it is only 16.
@@ -1067,7 +1066,7 @@ int gmx_trjconv(int argc, char *argv[])
             snew(nfwritten, clust->clust->nr);
             for (i = 0; (i < clust->clust->nr); i++)
             {
-                clust_status[i]    = NULL;
+                clust_status[i]    = nullptr;
                 clust_status_id[i] = -1;
             }
             bSeparate = bSplit = FALSE;
@@ -1089,7 +1088,7 @@ int gmx_trjconv(int argc, char *argv[])
 
         if (bTPS)
         {
-            read_tps_conf(top_file, &top, &ePBC, &xp, NULL, top_box,
+            read_tps_conf(top_file, &top, &ePBC, &xp, nullptr, top_box,
                           bReset || bPBCcomRes);
             std::strncpy(top_title, *top.name, 255);
             top_title[255] = '\0';
@@ -1120,7 +1119,7 @@ int gmx_trjconv(int argc, char *argv[])
         }
 
         /* get frame number index */
-        frindex = NULL;
+        frindex = nullptr;
         if (opt2bSet("-fr", NFILE, fnm))
         {
             printf("Select groups of frame number indices:\n");
@@ -1181,7 +1180,7 @@ int gmx_trjconv(int argc, char *argv[])
                 gmx_fatal(FARGS, "Could not read a frame from %s", in_file);
             }
             natoms = fr.natoms;
-            close_trj(trxin);
+            close_trx(trxin);
             sfree(fr.x);
             snew(index, natoms);
             for (i = 0; i < natoms; i++)
@@ -1211,7 +1210,7 @@ int gmx_trjconv(int argc, char *argv[])
                 gmx_rmpbc(gpbc, top.atoms.nr, top_box, xp);
             }
             copy_rvec(xp[index[0]], x_shift);
-            reset_x_ndim(nfitdim, ifit, ind_fit, atoms->nr, NULL, xp, w_rls);
+            reset_x_ndim(nfitdim, ifit, ind_fit, atoms->nr, nullptr, xp, w_rls);
             rvec_dec(x_shift, xp[index[0]]);
         }
         else
@@ -1240,14 +1239,14 @@ int gmx_trjconv(int argc, char *argv[])
             /* get memory for stuff to go in .pdb file, and initialize
              * the pdbinfo structure part if the input has it.
              */
-            init_t_atoms(&useatoms, atoms->nr, (atoms->pdbinfo != NULL));
+            init_t_atoms(&useatoms, atoms->nr, atoms->havePdbInfo);
             sfree(useatoms.resinfo);
             useatoms.resinfo = atoms->resinfo;
             for (i = 0; (i < nout); i++)
             {
                 useatoms.atomname[i] = atoms->atomname[index[i]];
                 useatoms.atom[i]     = atoms->atom[index[i]];
-                if (atoms->pdbinfo != NULL)
+                if (atoms->havePdbInfo)
                 {
                     useatoms.pdbinfo[i]  = atoms->pdbinfo[index[i]];
                 }
@@ -1332,7 +1331,7 @@ int gmx_trjconv(int argc, char *argv[])
                                                      filemode[0],
                                                      trxin,
                                                      &trxout,
-                                                     NULL,
+                                                     nullptr,
                                                      nout,
                                                      mtop,
                                                      index,
@@ -1340,7 +1339,7 @@ int gmx_trjconv(int argc, char *argv[])
                     break;
                 case efXTC:
                 case efTRR:
-                    out = NULL;
+                    out = nullptr;
                     if (!bSplit && !bSubTraj)
                     {
                         trxout = open_trx(out_file, filemode);
@@ -1510,14 +1509,14 @@ int gmx_trjconv(int argc, char *argv[])
                         gmx_rmpbc_trxfr(gpbc, &fr);
                     }
 
-                    reset_x_ndim(nfitdim, ifit, ind_fit, natoms, NULL, fr.x, w_rls);
+                    reset_x_ndim(nfitdim, ifit, ind_fit, natoms, nullptr, fr.x, w_rls);
                     do_fit(natoms, w_rls, xp, fr.x);
                 }
 
                 /* store this set of coordinates for future use */
                 if (bPFit || bNoJump)
                 {
-                    if (xp == NULL)
+                    if (xp == nullptr)
                     {
                         snew(xp, natoms);
                     }
@@ -1591,7 +1590,7 @@ int gmx_trjconv(int argc, char *argv[])
                     if (bTDump)
                     {
                         fprintf(stderr, "\nDumping frame at t= %g %s\n",
-                                output_env_conv_time(oenv, frout_time), output_env_get_time_unit(oenv));
+                                output_env_conv_time(oenv, frout_time), output_env_get_time_unit(oenv).c_str());
                     }
 
                     /* check for writing at each delta_t */
@@ -1632,7 +1631,7 @@ int gmx_trjconv(int argc, char *argv[])
 
                             if (bReset)
                             {
-                                reset_x_ndim(nfitdim, ifit, ind_fit, natoms, NULL, fr.x, w_rls);
+                                reset_x_ndim(nfitdim, ifit, ind_fit, natoms, nullptr, fr.x, w_rls);
                                 if (bFit)
                                 {
                                     do_fit_ndim(nfitdim, natoms, w_rls, xp, fr.x);
@@ -1783,7 +1782,7 @@ int gmx_trjconv(int argc, char *argv[])
                                              clust->clust->index[my_clust]))
                                         {
                                             close_trx(clust_status[my_clust]);
-                                            clust_status[my_clust]    = NULL;
+                                            clust_status[my_clust]    = nullptr;
                                             clust_status_id[my_clust] = -2;
                                             ntrxopen--;
                                             if (ntrxopen < 0)
@@ -1811,7 +1810,7 @@ int gmx_trjconv(int argc, char *argv[])
                                 {
                                     case efGRO:
                                         write_hconf_p(out, title, &useatoms,
-                                                      frout.x, frout.bV ? frout.v : NULL, frout.box);
+                                                      frout.x, frout.bV ? frout.v : nullptr, frout.box);
                                         break;
                                     case efPDB:
                                         fprintf(out, "REMARK    GENERATED BY TRJCONV\n");
@@ -1831,10 +1830,10 @@ int gmx_trjconv(int argc, char *argv[])
                                                       frout.ePBC, frout.box, ' ', model_nr, gc, TRUE);
                                         break;
                                     case efG96:
-                                        frout.title = title;
+                                        const char *outputTitle = "";
                                         if (bSeparate || bTDump)
                                         {
-                                            frout.bTitle = TRUE;
+                                            outputTitle = title;
                                             if (bTPS)
                                             {
                                                 frout.bAtoms = TRUE;
@@ -1845,17 +1844,20 @@ int gmx_trjconv(int argc, char *argv[])
                                         }
                                         else
                                         {
-                                            frout.bTitle = (outframe == 0);
+                                            if (outframe == 0)
+                                            {
+                                                outputTitle = title;
+                                            }
                                             frout.bAtoms = FALSE;
                                             frout.bStep  = TRUE;
                                             frout.bTime  = TRUE;
                                         }
-                                        write_g96_conf(out, &frout, -1, NULL);
+                                        write_g96_conf(out, outputTitle, &frout, -1, nullptr);
                                 }
                                 if (bSeparate || bSplitHere)
                                 {
                                     gmx_ffclose(out);
-                                    out = NULL;
+                                    out = nullptr;
                                 }
                                 break;
                             default:
@@ -1893,7 +1895,7 @@ int gmx_trjconv(int argc, char *argv[])
         }
         fprintf(stderr, "\n");
 
-        close_trj(trxin);
+        close_trx(trxin);
         sfree(outf_base);
 
         if (bRmPBC)
@@ -1905,7 +1907,7 @@ int gmx_trjconv(int argc, char *argv[])
         {
             close_trx(trxout);
         }
-        else if (out != NULL)
+        else if (out != nullptr)
         {
             gmx_ffclose(out);
         }
@@ -1922,8 +1924,19 @@ int gmx_trjconv(int argc, char *argv[])
     }
 
     sfree(mtop);
-
-    do_view(oenv, out_file, NULL);
-
+    done_top(&top);
+    sfree(xp);
+    sfree(xmem);
+    sfree(vmem);
+    sfree(fmem);
+    sfree(grpnm);
+    sfree(index);
+    sfree(cindex);
+    done_filenms(NFILE, fnm);
+    done_frame(&fr);
+
+    do_view(oenv, out_file, nullptr);
+
+    output_env_done(oenv);
     return 0;
 }
index d43212679140708ab3f51b5754d7651ef397be78..59d25fcee720bcfac70321d713a17820a3500fd9 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,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.
@@ -136,24 +136,24 @@ int gmx_trjorder(int argc, char *argv[])
     int               natoms, nwat, ncut;
     char            **grpname;
     int               i, j, d, *isize, isize_ref = 0, isize_sol;
-    int               sa, sr, *swi, **index, *ind_ref = NULL, *ind_sol;
+    int               sa, sr, *swi, **index, *ind_ref = nullptr, *ind_sol;
     gmx_output_env_t *oenv;
     t_filenm          fnm[] = {
-        { efTRX, "-f", NULL, ffREAD  },
-        { efTPS, NULL, NULL, ffREAD  },
-        { efNDX, NULL, NULL, ffOPTRD },
+        { efTRX, "-f", nullptr, ffREAD  },
+        { efTPS, nullptr, nullptr, ffREAD  },
+        { efNDX, nullptr, nullptr, ffOPTRD },
         { efTRO, "-o", "ordered", ffOPTWR },
         { efXVG, "-nshell", "nshell", ffOPTWR }
     };
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, NULL, box, TRUE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, nullptr, box, TRUE);
     sfree(x);
 
     /* get index groups */
@@ -214,8 +214,8 @@ int gmx_trjorder(int argc, char *argv[])
         swi[i] = i;
     }
 
-    out     = NULL;
-    fp      = NULL;
+    out     = nullptr;
+    fp      = nullptr;
     bNShell = ((opt2bSet("-nshell", NFILE, fnm)) ||
                (opt2parg_bSet("-r", asize(pa), pa)));
     bPDBout = FALSE;
@@ -362,11 +362,11 @@ int gmx_trjorder(int argc, char *argv[])
                     }
                 }
             }
-            write_trx(out, natoms, swi, &top.atoms, 0, t, box, x, NULL, NULL);
+            write_trx(out, natoms, swi, &top.atoms, 0, t, box, x, nullptr, nullptr);
         }
     }
     while (read_next_x(oenv, status, &t, x, box));
-    close_trj(status);
+    close_trx(status);
     if (out)
     {
         close_trx(out);
index 02cdca3fce04624de4085d98899454e49be20eee..295facf30d4e187e44272351f47e9f66d37c51ab 100644 (file)
@@ -48,9 +48,9 @@
 #endif
 
 #include "gromacs/commandline/pargs.h"
+#include "gromacs/ewald/pme.h"
 #include "gromacs/fft/calcgrid.h"
 #include "gromacs/fileio/checkpoint.h"
-#include "gromacs/fileio/readinp.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/gmxana/gmx_ana.h"
 #include "gromacs/math/utilities.h"
@@ -59,6 +59,7 @@
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/mdtypes/state.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/timing/walltime_accounting.h"
 #include "gromacs/topology/topology.h"
@@ -69,6 +70,7 @@
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/stringutil.h"
 
 /* Enum for situations that can occur during log file parsing, the
  * corresponding string entries can be found in do_the_tests() in
@@ -168,7 +170,7 @@ static void finalize(const char *fn_out)
     fp = fopen(fn_out, "r");
     fprintf(stdout, "\n\n");
 
-    while (fgets(buf, STRLEN-1, fp) != NULL)
+    while (fgets(buf, STRLEN-1, fp) != nullptr)
     {
         fprintf(stdout, "%s", buf);
     }
@@ -218,13 +220,13 @@ static int parse_logfile(const char *logfile, const char *errfile,
         iFound = eFoundDDStr; /* Skip some case statements */
     }
 
-    while (fgets(line, STRLEN, fp) != NULL)
+    while (fgets(line, STRLEN, fp) != nullptr)
     {
         /* Remove leading spaces */
         ltrim(line);
 
         /* Check for TERM and INT signals from user: */
-        if (std::strstr(line, errSIG) != NULL)
+        if (std::strstr(line, errSIG) != nullptr)
         {
             fclose(fp);
             cleandata(perfdata, test_nr);
@@ -234,7 +236,7 @@ static int parse_logfile(const char *logfile, const char *errfile,
         /* Check whether cycle resetting  worked */
         if (presteps > 0 && !bFoundResetStr)
         {
-            if (std::strstr(line, matchstrcr) != NULL)
+            if (std::strstr(line, matchstrcr) != nullptr)
             {
                 sprintf(dumstring, "step %s", "%" GMX_SCNd64);
                 sscanf(line, dumstring, &resetsteps);
@@ -356,11 +358,11 @@ static int parse_logfile(const char *logfile, const char *errfile,
     if (gmx_fexist(errfile))
     {
         fp = fopen(errfile, "r");
-        while (fgets(line, STRLEN, fp) != NULL)
+        while (fgets(line, STRLEN, fp) != nullptr)
         {
             if (str_starts(line, "Fatal error:") )
             {
-                if (fgets(line, STRLEN, fp) != NULL)
+                if (fgets(line, STRLEN, fp) != nullptr)
                 {
                     fprintf(stderr, "\nWARNING: An error occurred during this benchmark:\n"
                             "%s\n", line);
@@ -607,7 +609,7 @@ static void get_program_paths(gmx_bool bThreads, char *cmd_mpirun[], char *cmd_m
     /* Get the commands we need to set up the runs from environment variables */
     if (!bThreads)
     {
-        if ( (cp = getenv("MPIRUN")) != NULL)
+        if ( (cp = getenv("MPIRUN")) != nullptr)
         {
             *cmd_mpirun = gmx_strdup(cp);
         }
@@ -621,12 +623,12 @@ static void get_program_paths(gmx_bool bThreads, char *cmd_mpirun[], char *cmd_m
         *cmd_mpirun = gmx_strdup(empty_mpirun);
     }
 
-    if (*cmd_mdrun == NULL)
+    if (*cmd_mdrun == nullptr)
     {
         /* The use of MDRUN is deprecated, but made available in 5.1
            for backward compatibility. It may be removed in a future
            version. */
-        if ( (cp = getenv("MDRUN" )) != NULL)
+        if ( (cp = getenv("MDRUN" )) != nullptr)
         {
             *cmd_mdrun = gmx_strdup(cp);
         }
@@ -649,7 +651,7 @@ static void check_mdrun_works(gmx_bool    bThreads,
                               const char *cmd_mdrun,
                               gmx_bool    bNeedGpuSupport)
 {
-    char      *command = NULL;
+    char      *command = nullptr;
     char      *cp;
     char       line[STRLEN];
     FILE      *fp;
@@ -692,7 +694,7 @@ static void check_mdrun_works(gmx_bool    bThreads,
     while (!feof(fp) )
     {
         cp = fgets(line, STRLEN, fp);
-        if (cp != NULL)
+        if (cp != nullptr)
         {
             if (str_starts(line, match_mdrun) )
             {
@@ -749,16 +751,8 @@ static void check_mdrun_works(gmx_bool    bThreads,
     sfree(command);
 }
 
-/*! \brief Helper struct so we can parse the string with eligible GPU
-    IDs outside do_the_tests. */
-typedef struct eligible_gpu_ids
-{
-    int  n;        /**< Length of ids */
-    int *ids;      /**< Array of length n. NULL if no GPUs in use */
-} t_eligible_gpu_ids;
-
 /* Handles the no-GPU case by emitting an empty string. */
-static char *make_gpu_id_command_line(int numRanks, int numPmeRanks, const t_eligible_gpu_ids *gpu_ids)
+static char *make_gpu_id_command_line(int numRanks, int numPmeRanks, const std::vector<int> &gpu_ids)
 {
     char       *command_line, *ptr;
     const char *flag = "-gpu_id ";
@@ -774,18 +768,17 @@ static char *make_gpu_id_command_line(int numRanks, int numPmeRanks, const t_eli
     /* If the user has given no eligible GPU IDs, or we're trying the
      * default behaviour, then there is nothing for g_tune_pme to give
      * to mdrun -gpu_id */
-    if (gpu_ids->n > 0 && numPmeRanks > -1)
+    if (!gpu_ids.empty() && numPmeRanks > -1)
     {
-        int   numPpRanks, max_num_ranks_for_each_GPU;
-        int   gpu_id, rank;
+        size_t numPpRanks, max_num_ranks_for_each_GPU;
 
         /* Write the option flag */
         std::strcpy(ptr, flag);
         ptr += flag_length;
 
         numPpRanks                 = numRanks - numPmeRanks;
-        max_num_ranks_for_each_GPU = numPpRanks / gpu_ids->n;
-        if (max_num_ranks_for_each_GPU * gpu_ids->n != numPpRanks)
+        max_num_ranks_for_each_GPU = numPpRanks / gpu_ids.size();
+        if (max_num_ranks_for_each_GPU * gpu_ids.size() != numPpRanks)
         {
             /* Some GPUs will receive more work than others, which
              * we choose to be those with the lowest indices */
@@ -793,16 +786,16 @@ static char *make_gpu_id_command_line(int numRanks, int numPmeRanks, const t_eli
         }
 
         /* Loop over all eligible GPU ids */
-        for (gpu_id = 0, rank = 0; gpu_id < gpu_ids->n; gpu_id++)
+        for (size_t gpu_id = 0, rank = 0; gpu_id < gpu_ids.size(); gpu_id++)
         {
-            int rank_for_this_GPU;
+            size_t rank_for_this_GPU;
             /* Loop over all PP ranks for GPU with ID gpu_id, building the
                assignment string. */
             for (rank_for_this_GPU = 0;
                  rank_for_this_GPU < max_num_ranks_for_each_GPU && rank < numPpRanks;
                  rank++, rank_for_this_GPU++)
             {
-                *ptr = '0' + gpu_ids->ids[gpu_id];
+                *ptr = '0' + gpu_ids[gpu_id];
                 ptr++;
             }
         }
@@ -823,7 +816,7 @@ static void launch_simulation(
         const char               *simulation_tpr, /* This tpr will be simulated */
         int                       nnodes,         /* Number of ranks to use */
         int                       nPMEnodes,      /* Number of PME ranks to use */
-        const t_eligible_gpu_ids *gpu_ids)        /* Struct containing GPU IDs for
+        const std::vector<int>   &gpu_ids)        /* Vector of GPU IDs for
                                                    * constructing mdrun command lines */
 {
     char  *command, *cmd_gpu_ids;
@@ -869,12 +862,12 @@ static void modify_PMEsettings(
         const char     *fn_best_tpr, /* tpr file with the best performance */
         const char     *fn_sim_tpr)  /* name of tpr file to be launched */
 {
-    t_inputrec   *ir;
-    t_state       state;
-    gmx_mtop_t    mtop;
-    char          buf[200];
+    t_state        state;
+    gmx_mtop_t     mtop;
+    char           buf[200];
 
-    snew(ir, 1);
+    t_inputrec     irInstance;
+    t_inputrec    *ir = &irInstance;
     read_tpx_state(fn_best_tpr, ir, &state, &mtop);
 
     /* Reset nsteps and init_step to the value of the input .tpr file */
@@ -886,8 +879,6 @@ static void modify_PMEsettings(
     fprintf(stdout, buf, ir->nsteps);
     fflush(stdout);
     write_tpx_state(fn_sim_tpr, ir, &state, &mtop);
-
-    sfree(ir);
 }
 
 static gmx_bool can_scale_rvdw(int vdwtype)
@@ -914,7 +905,6 @@ static void make_benchmark_tprs(
         FILE           *fp)              /* Write the output here                         */
 {
     int           i, j, d;
-    t_inputrec   *ir;
     t_state       state;
     gmx_mtop_t    mtop;
     real          nlist_buffer;     /* Thickness of the buffer regions for PME-switch potentials */
@@ -937,8 +927,8 @@ static void make_benchmark_tprs(
     }
     fprintf(stdout, ".\n");
 
-
-    snew(ir, 1);
+    t_inputrec  irInstance;
+    t_inputrec *ir = &irInstance;
     read_tpx_state(fn_sim_tpr, ir, &state, &mtop);
 
     /* Check if some kind of PME was chosen */
@@ -1079,7 +1069,8 @@ static void make_benchmark_tprs(
 
             /* Scale the Fourier grid spacing */
             ir->nkx = ir->nky = ir->nkz = 0;
-            calc_grid(NULL, state.box, fourierspacing*fac, &ir->nkx, &ir->nky, &ir->nkz);
+            calcFftGrid(nullptr, state.box, fourierspacing*fac, minimalPmeGridSize(ir->pme_order),
+                        &ir->nkx, &ir->nky, &ir->nkz);
 
             /* Adjust other radii since various conditions need to be fulfilled */
             if (eelPME == ir->coulombtype)
@@ -1169,7 +1160,6 @@ static void make_benchmark_tprs(
     }
     fflush(stdout);
     fflush(fp);
-    sfree(ir);
 }
 
 
@@ -1180,7 +1170,7 @@ static void cleanup(const t_filenm *fnm, int nfile, int k, int nnodes,
 {
     char        numstring[STRLEN];
     char        newfilename[STRLEN];
-    const char *fn = NULL;
+    const char *fn = nullptr;
     int         i;
     const char *opt;
 
@@ -1445,12 +1435,12 @@ static void do_the_tests(
         int                       presteps,       /* DLB equilibration steps, is checked    */
         gmx_int64_t               cpt_steps,      /* Time step counter in the checkpoint    */
         gmx_bool                  bCheck,         /* Check whether benchmark mdrun works    */
-        const t_eligible_gpu_ids *gpu_ids)        /* Struct containing GPU IDs for
+        const std::vector<int>   &gpu_ids)        /* Vector of GPU IDs for
                                                    * constructing mdrun command lines */
 {
     int      i, nr, k, ret, count = 0, totaltests;
-    int     *nPMEnodes = NULL;
-    t_perf  *pd        = NULL;
+    int     *nPMEnodes = nullptr;
+    t_perf  *pd        = nullptr;
     int      cmdline_length;
     char    *command, *cmd_stub;
     char     buf[STRLEN];
@@ -1532,7 +1522,7 @@ static void do_the_tests(
         /* Loop over various numbers of PME nodes: */
         for (i = 0; i < *pmeentries; i++)
         {
-            char *cmd_gpu_ids = NULL;
+            char *cmd_gpu_ids = nullptr;
 
             pd = &perfdata[k][i];
 
@@ -2047,20 +2037,21 @@ static float inspect_tpr(int nfile, t_filenm fnm[], real *rcoulomb)
     gmx_bool     bFree;     /* Is a free energy simulation requested?         */
     gmx_bool     bNM;       /* Is a normal mode analysis requested?           */
     gmx_bool     bSwap;     /* Is water/ion position swapping requested?      */
-    t_inputrec   ir;
     t_state      state;
     gmx_mtop_t   mtop;
 
 
     /* Check tpr file for options that trigger extra output files */
-    read_tpx_state(opt2fn("-s", nfile, fnm), &ir, &state, &mtop);
-    bFree = (efepNO  != ir.efep );
-    bNM   = (eiNM    == ir.eI   );
-    bSwap = (eswapNO != ir.eSwapCoords);
-    bTpi  = EI_TPI(ir.eI);
+    t_inputrec  irInstance;
+    t_inputrec *ir = &irInstance;
+    read_tpx_state(opt2fn("-s", nfile, fnm), ir, &state, &mtop);
+    bFree = (efepNO  != ir->efep );
+    bNM   = (eiNM    == ir->eI   );
+    bSwap = (eswapNO != ir->eSwapCoords);
+    bTpi  = EI_TPI(ir->eI);
 
     /* Set these output files on the tuning command-line */
-    if (ir.bPull)
+    if (ir->bPull)
     {
         setopt("-pf", nfile, fnm);
         setopt("-px", nfile, fnm);
@@ -2083,10 +2074,11 @@ static float inspect_tpr(int nfile, t_filenm fnm[], real *rcoulomb)
         setopt("-swap", nfile, fnm);
     }
 
-    *rcoulomb = ir.rcoulomb;
+    *rcoulomb = ir->rcoulomb;
 
     /* Return the estimate for the number of PME nodes */
-    return pme_load_estimate(&mtop, &ir, state.box);
+    float npme = pme_load_estimate(&mtop, ir, state.box);
+    return npme;
 }
 
 
@@ -2206,25 +2198,24 @@ int gmx_tune_pme(int argc, char *argv[])
     int             presteps       = 1500; /* Do a full cycle reset after presteps steps */
     gmx_bool        bOverwrite     = FALSE, bKeepTPR;
     gmx_bool        bLaunch        = FALSE;
-    char           *ExtraArgs      = NULL;
-    char          **tpr_names      = NULL;
-    const char     *simulation_tpr = NULL;
-    char           *deffnm         = NULL;
+    char           *ExtraArgs      = nullptr;
+    char          **tpr_names      = nullptr;
+    const char     *simulation_tpr = nullptr;
+    char           *deffnm         = nullptr;
     int             best_npme, best_tpr;
     int             sim_part = 1; /* For benchmarks with checkpoint files */
     char            bbuf[STRLEN];
 
 
     /* Default program names if nothing else is found */
-    char               *cmd_mpirun = NULL, *cmd_mdrun = NULL;
+    char               *cmd_mpirun = nullptr, *cmd_mdrun = nullptr;
     char               *cmd_args_bench, *cmd_args_launch;
-    char               *cmd_np           = NULL;
+    char               *cmd_np           = nullptr;
 
     /* IDs of GPUs that are eligible for computation */
-    char               *eligible_gpu_ids = NULL;
-    t_eligible_gpu_ids *gpu_ids          = NULL;
+    char               *eligible_gpu_ids = nullptr;
 
-    t_perf            **perfdata = NULL;
+    t_perf            **perfdata = nullptr;
     t_inputinfo        *info;
     int                 i;
     FILE               *fp;
@@ -2238,11 +2229,11 @@ int gmx_tune_pme(int argc, char *argv[])
         { efLOG, "-err",    "bencherr", ffWRITE },
         { efTPR, "-so",     "tuned",    ffWRITE },
         /* mdrun: */
-        { efTPR, NULL,      NULL,       ffREAD },
-        { efTRN, "-o",      NULL,       ffWRITE },
-        { efCOMPRESSED, "-x", NULL,     ffOPTWR },
-        { efCPT, "-cpi",    NULL,       ffOPTRD },
-        { efCPT, "-cpo",    NULL,       ffOPTWR },
+        { efTPR, nullptr,      nullptr,       ffREAD },
+        { efTRN, "-o",      nullptr,       ffWRITE },
+        { efCOMPRESSED, "-x", nullptr,     ffOPTWR },
+        { efCPT, "-cpi",    nullptr,       ffOPTRD },
+        { efCPT, "-cpo",    nullptr,       ffOPTWR },
         { efSTO, "-c",      "confout",  ffWRITE },
         { efEDR, "-e",      "ener",     ffWRITE },
         { efLOG, "-g",      "md",       ffWRITE },
@@ -2296,9 +2287,9 @@ int gmx_tune_pme(int argc, char *argv[])
     int             nthreads = 1;
 
     const char     *procstring[] =
-    { NULL, "np", "n", "none", NULL };
+    { nullptr, "np", "n", "none", nullptr };
     const char     *npmevalues_opt[] =
-    { NULL, "auto", "all", "subset", NULL };
+    { nullptr, "auto", "all", "subset", nullptr };
 
     gmx_bool          bAppendFiles          = TRUE;
     gmx_bool          bKeepAndNumCPT        = FALSE;
@@ -2306,7 +2297,7 @@ int gmx_tune_pme(int argc, char *argv[])
     gmx_bool          bBenchmark            = TRUE;
     gmx_bool          bCheck                = TRUE;
 
-    gmx_output_env_t *oenv = NULL;
+    gmx_output_env_t *oenv = nullptr;
 
     t_pargs           pa[] = {
         /***********************/
@@ -2375,13 +2366,13 @@ int gmx_tune_pme(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv, PCA_NOEXIT_ON_ARGS,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc,
-                           0, NULL, &oenv))
+                           0, nullptr, &oenv))
     {
         return 0;
     }
 
     // procstring[0] is used inside two different conditionals further down
-    GMX_RELEASE_ASSERT(procstring[0] != NULL, "Options inconsistency; procstring[0] is NULL");
+    GMX_RELEASE_ASSERT(procstring[0] != nullptr, "Options inconsistency; procstring[0] is NULL");
 
     /* Store the remaining unparsed command line entries in a string which
      * is then attached to the mdrun command line */
@@ -2464,8 +2455,7 @@ int gmx_tune_pme(int argc, char *argv[])
                 bench_nsteps, fnm, NFILE, sim_part, presteps,
                 asize(pa), pa);
     /* Check any GPU IDs passed make sense, and fill the data structure for them */
-    snew(gpu_ids, 1);
-    parse_digits_from_string(eligible_gpu_ids, &gpu_ids->n, &gpu_ids->ids);
+    auto gpu_ids = gmx::parseDigitsFromString(eligible_gpu_ids);
 
     /* Determine the maximum and minimum number of PME nodes to test,
      * the actual list of settings is build in do_the_tests(). */
@@ -2512,7 +2502,7 @@ int gmx_tune_pme(int argc, char *argv[])
     get_program_paths(bThreads, &cmd_mpirun, &cmd_mdrun);
     if (bBenchmark && repeats > 0)
     {
-        check_mdrun_works(bThreads, cmd_mpirun, cmd_np, cmd_mdrun, NULL != eligible_gpu_ids);
+        check_mdrun_works(bThreads, cmd_mpirun, cmd_np, cmd_mdrun, nullptr != eligible_gpu_ids);
     }
 
     /* Print some header info to file */
@@ -2609,7 +2599,7 @@ int gmx_tune_pme(int argc, char *argv[])
     snew(perfdata, ntprs);
     if (bBenchmark)
     {
-        GMX_RELEASE_ASSERT(npmevalues_opt[0] != NULL, "Options inconsistency; npmevalues_opt[0] is NULL");
+        GMX_RELEASE_ASSERT(npmevalues_opt[0] != nullptr, "Options inconsistency; npmevalues_opt[0] is NULL");
         do_the_tests(fp, tpr_names, maxPMEnodes, minPMEnodes, npme_fixed, npmevalues_opt[0], perfdata, &pmeentries,
                      repeats, nnodes, ntprs, bThreads, cmd_mpirun, cmd_np, cmd_mdrun,
                      cmd_args_bench, fnm, NFILE, presteps, cpt_steps, bCheck, gpu_ids);
index 0c660cc4b359639c1366d26a0101d917b5321634..dcd2374122cbe37bbf41554a09d4ee32b0066753 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,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.
@@ -122,9 +122,9 @@ int gmx_vanhove(int argc, char *argv[])
 #define NPA asize(pa)
 
     t_filenm fnm[] = {
-        { efTRX, NULL, NULL,  ffREAD },
-        { efTPS, NULL, NULL,  ffREAD },
-        { efNDX, NULL, NULL,  ffOPTRD },
+        { efTRX, nullptr, nullptr,  ffREAD },
+        { efTPS, nullptr, nullptr,  ffREAD },
+        { efNDX, nullptr, nullptr,  ffOPTRD },
         { efXPM, "-om", "vanhove", ffOPTWR },
         { efXVG, "-or", "vanhove_r", ffOPTWR },
         { efXVG, "-ot", "vanhove_t", ffOPTWR }
@@ -145,13 +145,13 @@ int gmx_vanhove(int argc, char *argv[])
     real             *time, t, invbin = 0, rmax2 = 0, rint2 = 0, d2;
     real              invsbin = 0, matmax, normfac, dt, *tickx, *ticky;
     char              buf[STRLEN], **legend;
-    real            **mat = NULL;
-    int              *pt  = NULL, **pr = NULL, *mcount = NULL, *tcount = NULL, *rcount = NULL;
+    real            **mat = nullptr;
+    int              *pt  = nullptr, **pr = nullptr, *mcount = nullptr, *tcount = nullptr, *rcount = nullptr;
     FILE             *fp;
     t_rgb             rlo = {1, 1, 1}, rhi = {0, 0, 0};
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -181,14 +181,14 @@ int gmx_vanhove(int argc, char *argv[])
         exit(0);
     }
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, NULL, boxtop,
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, nullptr, boxtop,
                   FALSE);
     get_index(&top.atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &isize, &index, &grpname);
 
     nalloc = 0;
-    time   = NULL;
-    sbox   = NULL;
-    sx     = NULL;
+    time   = nullptr;
+    sbox   = nullptr;
+    sx     = nullptr;
     clear_mat(avbox);
 
     read_first_x(oenv, &status, ftp2fn(efTRX, NFILE, fnm), &t, &x, box);
@@ -202,8 +202,8 @@ int gmx_vanhove(int argc, char *argv[])
             srenew(sbox, nalloc);
             srenew(sx, nalloc);
         }
-        GMX_RELEASE_ASSERT(time != NULL, "Memory allocation failure; time array is NULL");
-        GMX_RELEASE_ASSERT(sbox != NULL, "Memory allocation failure; sbox array is NULL");
+        GMX_RELEASE_ASSERT(time != nullptr, "Memory allocation failure; time array is NULL");
+        GMX_RELEASE_ASSERT(sbox != nullptr, "Memory allocation failure; sbox array is NULL");
 
         time[nfr] = t;
         copy_mat(box, sbox[nfr]);
@@ -223,7 +223,7 @@ int gmx_vanhove(int argc, char *argv[])
 
     /* clean up */
     sfree(x);
-    close_trj(status);
+    close_trx(status);
 
     fprintf(stderr, "Read %d frames\n", nfr);
 
@@ -481,9 +481,9 @@ int gmx_vanhove(int argc, char *argv[])
         xvgrclose(fp);
     }
 
-    do_view(oenv, matfile, NULL);
-    do_view(oenv, orfile, NULL);
-    do_view(oenv, otfile, NULL);
+    do_view(oenv, matfile, nullptr);
+    do_view(oenv, orfile, nullptr);
+    do_view(oenv, otfile, nullptr);
 
     return 0;
 }
index 27e9aa18400153596ec63491037885394e079636..902b9617cf1dfa504045e67f8f08bcb8b3c8b550 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,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.
@@ -218,15 +218,15 @@ int gmx_velacc(int argc, char *argv[])
     rvec              mv_mol;
     /* Array for the correlation function */
     real            **c1;
-    real             *normm = NULL;
+    real             *normm = nullptr;
     gmx_output_env_t *oenv;
 
 #define NHISTO 360
 
     t_filenm  fnm[] = {
-        { efTRN, "-f",    NULL,   ffREAD  },
-        { efTPS, NULL,    NULL,   ffOPTRD },
-        { efNDX, NULL,    NULL,   ffOPTRD },
+        { efTRN, "-f",    nullptr,   ffREAD  },
+        { efTPS, nullptr,    nullptr,   ffOPTRD },
+        { efNDX, nullptr,    nullptr,   ffOPTRD },
         { efXVG, "-o",    "vac",  ffWRITE },
         { efXVG, "-os",   "spectrum", ffOPTWR }
     };
@@ -237,8 +237,9 @@ int gmx_velacc(int argc, char *argv[])
     npargs = asize(pa);
     ppa    = add_acf_pargs(&npargs, pa);
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
-                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, nullptr, &oenv))
     {
+        sfree(ppa);
         return 0;
     }
 
@@ -249,7 +250,7 @@ int gmx_velacc(int argc, char *argv[])
 
     if (bTPS)
     {
-        bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, NULL, NULL, box,
+        bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, nullptr, nullptr, box,
                              TRUE);
         get_index(&top.atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &gnx, &index, &grpname);
     }
@@ -273,7 +274,7 @@ int gmx_velacc(int argc, char *argv[])
     snew(c1, gnx);
     for (i = 0; (i < gnx); i++)
     {
-        c1[i] = NULL;
+        c1[i] = nullptr;
     }
 
     read_first_frame(oenv, &status, ftp2fn(efTRN, NFILE, fnm), &fr, TRX_NEED_V);
@@ -342,7 +343,7 @@ int gmx_velacc(int argc, char *argv[])
     }
     while (read_next_frame(oenv, status, &fr));
 
-    close_trj(status);
+    close_trx(status);
 
     if (counter >= 4)
     {
index e3769e082379f3988834dd5016c3ea65f4b5fdc3..334995fe7d1dc9f1b6be9007ff33527dc7297da2 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,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.
@@ -44,6 +44,7 @@
 
 #include "config.h"
 
+#include <cassert>
 #include <cctype>
 #include <cmath>
 #include <cstdio>
@@ -63,6 +64,7 @@
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/mdtypes/pull-params.h"
+#include "gromacs/mdtypes/state.h"
 #include "gromacs/pulling/pull.h"
 #include "gromacs/random/tabulatednormaldistribution.h"
 #include "gromacs/random/threefry.h"
@@ -321,28 +323,28 @@ typedef struct
 } t_UmbrellaOptions;
 
 //! Make an umbrella window (may contain several histograms)
-t_UmbrellaWindow * initUmbrellaWindows(int nwin)
+static t_UmbrellaWindow * initUmbrellaWindows(int nwin)
 {
     t_UmbrellaWindow *win;
     int               i;
     snew(win, nwin);
     for (i = 0; i < nwin; i++)
     {
-        win[i].Histo    = win[i].cum  = 0;
-        win[i].k        = win[i].pos  = win[i].z = 0;
-        win[i].N        = win[i].Ntot = 0;
-        win[i].g        = win[i].tau  = win[i].tausmooth = 0;
-        win[i].bContrib = 0;
-        win[i].ztime    = 0;
-        win[i].forceAv  = 0;
-        win[i].aver     = win[i].sigma = 0;
-        win[i].bsWeight = 0;
+        win[i].Histo    = win[i].cum  = nullptr;
+        win[i].k        = win[i].pos  = win[i].z = nullptr;
+        win[i].N        = win[i].Ntot = nullptr;
+        win[i].g        = win[i].tau  = win[i].tausmooth = nullptr;
+        win[i].bContrib = nullptr;
+        win[i].ztime    = nullptr;
+        win[i].forceAv  = nullptr;
+        win[i].aver     = win[i].sigma = nullptr;
+        win[i].bsWeight = nullptr;
     }
     return win;
 }
 
 //! Delete an umbrella window (may contain several histograms)
-void freeUmbrellaWindows(t_UmbrellaWindow *win, int nwin)
+static void freeUmbrellaWindows(t_UmbrellaWindow *win, int nwin)
 {
     int i, j;
     for (i = 0; i < nwin; i++)
@@ -391,7 +393,7 @@ void freeUmbrellaWindows(t_UmbrellaWindow *win, int nwin)
 /*! \brief
  * Read and setup tabulated umbrella potential
  */
-void setup_tab(const char *fn, t_UmbrellaOptions *opt)
+static void setup_tab(const char *fn, t_UmbrellaOptions *opt)
 {
     int      i, ny, nl;
     double **y;
@@ -430,7 +432,7 @@ void setup_tab(const char *fn, t_UmbrellaOptions *opt)
 }
 
 //! Read the header of an PDO file (position, force const, nr of groups)
-void read_pdo_header(FILE * file, t_UmbrellaHeader * header, t_UmbrellaOptions *opt)
+static void read_pdo_header(FILE * file, t_UmbrellaHeader * header, t_UmbrellaOptions *opt)
 {
     char               line[2048];
     char               Buffer0[256], Buffer1[256], Buffer2[256], Buffer3[256], Buffer4[256];
@@ -438,7 +440,7 @@ void read_pdo_header(FILE * file, t_UmbrellaHeader * header, t_UmbrellaOptions *
     std::istringstream ist;
 
     /*  line 1 */
-    if (fgets(line, 2048, file) == NULL)
+    if (fgets(line, 2048, file) == nullptr)
     {
         gmx_fatal(FARGS, "Error reading header from pdo file\n");
     }
@@ -456,7 +458,7 @@ void read_pdo_header(FILE * file, t_UmbrellaHeader * header, t_UmbrellaOptions *
     }
 
     /*  line 2 */
-    if (fgets(line, 2048, file) == NULL)
+    if (fgets(line, 2048, file) == nullptr)
     {
         gmx_fatal(FARGS, "Error reading header from pdo file\n");
     }
@@ -471,7 +473,7 @@ void read_pdo_header(FILE * file, t_UmbrellaHeader * header, t_UmbrellaOptions *
     }
 
     /* line3 */
-    if (fgets(line, 2048, file) == NULL)
+    if (fgets(line, 2048, file) == nullptr)
     {
         gmx_fatal(FARGS, "Error reading header from pdo file\n");
     }
@@ -479,7 +481,7 @@ void read_pdo_header(FILE * file, t_UmbrellaHeader * header, t_UmbrellaOptions *
     ist >> Buffer0 >> Buffer1 >> header->nSkip;
 
     /* line 4 */
-    if (fgets(line, 2048, file) == NULL)
+    if (fgets(line, 2048, file) == nullptr)
     {
         gmx_fatal(FARGS, "Error reading header from pdo file\n");
     }
@@ -487,7 +489,7 @@ void read_pdo_header(FILE * file, t_UmbrellaHeader * header, t_UmbrellaOptions *
     ist >> Buffer0 >> Buffer1 >> Buffer2 >> header->Reference;
 
     /* line 5 */
-    if (fgets(line, 2048, file) == NULL)
+    if (fgets(line, 2048, file) == nullptr)
     {
         gmx_fatal(FARGS, "Error reading header from pdo file\n");
     }
@@ -502,7 +504,7 @@ void read_pdo_header(FILE * file, t_UmbrellaHeader * header, t_UmbrellaOptions *
 
     for (i = 0; i < header->nPull; ++i)
     {
-        if (fgets(line, 2048, file) == NULL)
+        if (fgets(line, 2048, file) == nullptr)
         {
             gmx_fatal(FARGS, "Error reading header from pdo file\n");
         }
@@ -518,7 +520,7 @@ void read_pdo_header(FILE * file, t_UmbrellaHeader * header, t_UmbrellaOptions *
         }
     }
 
-    if (fgets(line, 2048, file) == NULL)
+    if (fgets(line, 2048, file) == nullptr)
     {
         gmx_fatal(FARGS, "Cannot read from file\n");
     }
@@ -536,18 +538,18 @@ static char *fgets3(FILE *fp, char ptr[], int *len)
     char *p;
     int   slen;
 
-    if (fgets(ptr, *len-1, fp) == NULL)
+    if (fgets(ptr, *len-1, fp) == nullptr)
     {
-        return NULL;
+        return nullptr;
     }
     p = ptr;
-    while ((std::strchr(ptr, '\n') == NULL) && (!feof(fp)))
+    while ((std::strchr(ptr, '\n') == nullptr) && (!feof(fp)))
     {
         /* This line is longer than len characters, let's increase len! */
         *len += STRLEN;
         p    += STRLEN;
         srenew(ptr, *len);
-        if (fgets(p-1, STRLEN, fp) == NULL)
+        if (fgets(p-1, STRLEN, fp) == nullptr)
         {
             break;
         }
@@ -567,21 +569,21 @@ static char *fgets3(FILE *fp, char ptr[], int *len)
  *         At the moment, this warning is avoided by hiding the format string
  *         the variable fmtlf.
  */
-void read_pdo_data(FILE * file, t_UmbrellaHeader * header,
-                   int fileno, t_UmbrellaWindow * win,
-                   t_UmbrellaOptions *opt,
-                   gmx_bool bGetMinMax, real *mintmp, real *maxtmp)
+static void read_pdo_data(FILE * file, t_UmbrellaHeader * header,
+                          int fileno, t_UmbrellaWindow * win,
+                          t_UmbrellaOptions *opt,
+                          gmx_bool bGetMinMax, real *mintmp, real *maxtmp)
 {
     int                i, inttemp, bins, count, ntot;
     real               minval, maxval, minfound = 1e20, maxfound = -1e20;
     double             temp, time, time0 = 0, dt;
-    char              *ptr    = 0;
-    t_UmbrellaWindow * window = 0;
+    char              *ptr    = nullptr;
+    t_UmbrellaWindow * window = nullptr;
     gmx_bool           timeok, dt_ok = 1;
-    char              *tmpbuf   = 0, fmt[256], fmtign[256], fmtlf[5] = "%lf";
+    char              *tmpbuf   = nullptr, fmt[256], fmtign[256], fmtlf[5] = "%lf";
     int                len      = STRLEN, dstep = 1;
     const int          blocklen = 4096;
-    int               *lennow   = 0;
+    int               *lennow   = nullptr;
 
     if (!bGetMinMax)
     {
@@ -603,7 +605,7 @@ void read_pdo_data(FILE * file, t_UmbrellaHeader * header,
         snew(window->g, window->nPull);
         snew(window->bsWeight, window->nPull);
 
-        window->bContrib = 0;
+        window->bContrib = nullptr;
 
         if (opt->bCalcTauInt)
         {
@@ -611,7 +613,7 @@ void read_pdo_data(FILE * file, t_UmbrellaHeader * header,
         }
         else
         {
-            window->ztime = 0;
+            window->ztime = nullptr;
         }
         snew(lennow, window->nPull);
 
@@ -627,7 +629,7 @@ void read_pdo_data(FILE * file, t_UmbrellaHeader * header,
             window->g[i]    = 1.;
             if (opt->bCalcTauInt)
             {
-                window->ztime[i] = 0;
+                window->ztime[i] = nullptr;
             }
         }
 
@@ -642,7 +644,7 @@ void read_pdo_data(FILE * file, t_UmbrellaHeader * header,
 
     count = 0;
     snew(tmpbuf, len);
-    while ( (ptr = fgets3(file, tmpbuf, &len)) != NULL)
+    while ( (ptr = fgets3(file, tmpbuf, &len)) != nullptr)
     {
         trim(ptr);
 
@@ -778,7 +780,7 @@ void read_pdo_data(FILE * file, t_UmbrellaHeader * header,
  * by this routine (not recommended). Since we now support autocorrelations, it is better to set
  * an appropriate autocorrelation times instead of using this function.
  */
-void enforceEqualWeights(t_UmbrellaWindow * window, int nWindows)
+static void enforceEqualWeights(t_UmbrellaWindow * window, int nWindows)
 {
     int    i, k, j, NEnforced;
     double ratio;
@@ -804,7 +806,7 @@ void enforceEqualWeights(t_UmbrellaWindow * window, int nWindows)
 
 /*! \brief Simple linear interpolation between two given tabulated points
  */
-double tabulated_pot(double dist, t_UmbrellaOptions *opt)
+static double tabulated_pot(double dist, t_UmbrellaOptions *opt)
 {
     int    jl, ju;
     double pl, pu, dz, dp;
@@ -831,8 +833,8 @@ double tabulated_pot(double dist, t_UmbrellaOptions *opt)
  * After rapid convergence (using only substiantal contributions), we always switch to
  * full precision.
  */
-void setup_acc_wham(double *profile, t_UmbrellaWindow * window, int nWindows,
-                    t_UmbrellaOptions *opt)
+static void setup_acc_wham(double *profile, t_UmbrellaWindow * window, int nWindows,
+                           t_UmbrellaOptions *opt)
 {
     int           i, j, k, nGrptot = 0, nContrib = 0, nTot = 0;
     double        U, min = opt->min, dz = opt->dz, temp, ztot_half, distance, ztot, contrib1, contrib2;
@@ -932,8 +934,8 @@ void setup_acc_wham(double *profile, t_UmbrellaWindow * window, int nWindows,
 }
 
 //! Compute the PMF (one of the two main WHAM routines)
-void calc_profile(double *profile, t_UmbrellaWindow * window, int nWindows,
-                  t_UmbrellaOptions *opt, gmx_bool bExact)
+static void calc_profile(double *profile, t_UmbrellaWindow * window, int nWindows,
+                         t_UmbrellaOptions *opt, gmx_bool bExact)
 {
     double ztot_half, ztot, min = opt->min, dz = opt->dz;
 
@@ -999,8 +1001,8 @@ void calc_profile(double *profile, t_UmbrellaWindow * window, int nWindows,
 }
 
 //! Compute the free energy offsets z (one of the two main WHAM routines)
-double calc_z(double * profile, t_UmbrellaWindow * window, int nWindows,
-              t_UmbrellaOptions *opt, gmx_bool bExact)
+static double calc_z(double * profile, t_UmbrellaWindow * window, int nWindows,
+                     t_UmbrellaOptions *opt, gmx_bool bExact)
 {
     double min     = opt->min, dz = opt->dz, ztot_half, ztot;
     double maxglob = -1e20;
@@ -1093,7 +1095,7 @@ double calc_z(double * profile, t_UmbrellaWindow * window, int nWindows,
 }
 
 //! Make PMF symmetric around 0 (useful e.g. for membranes)
-void symmetrizeProfile(double* profile, t_UmbrellaOptions *opt)
+static void symmetrizeProfile(double* profile, t_UmbrellaOptions *opt)
 {
     int     i, j, bins = opt->bins;
     double *prof2, min = opt->min, max = opt->max, dz = opt->dz, zsym, deltaz, profsym;
@@ -1133,7 +1135,7 @@ void symmetrizeProfile(double* profile, t_UmbrellaOptions *opt)
 }
 
 //! Set energy unit (kJ/mol,kT,kCal/mol) and set it to zero at opt->zProf0
-void prof_normalization_and_unit(double * profile, t_UmbrellaOptions *opt)
+static void prof_normalization_and_unit(double * profile, t_UmbrellaOptions *opt)
 {
     int    i, bins, imin;
     double unit_factor = 1., diff;
@@ -1201,7 +1203,7 @@ void prof_normalization_and_unit(double * profile, t_UmbrellaOptions *opt)
 }
 
 //! Make an array of random integers (used for bootstrapping)
-void getRandomIntArray(int nPull, int blockLength, int* randomArray, gmx::DefaultRandomEngine * rng)
+static void getRandomIntArray(int nPull, int blockLength, int* randomArray, gmx::DefaultRandomEngine * rng)
 {
     gmx::UniformIntDistribution<int> dist(0, blockLength-1);
 
@@ -1238,8 +1240,8 @@ void getRandomIntArray(int nPull, int blockLength, int* randomArray, gmx::Defaul
  * This is used when bootstapping new trajectories and thereby create new histogtrams,
  * but it is not required if we bootstrap complete histograms.
  */
-void copy_pullgrp_to_synthwindow(t_UmbrellaWindow *synthWindow,
-                                 t_UmbrellaWindow *thisWindow, int pullid)
+static void copy_pullgrp_to_synthwindow(t_UmbrellaWindow *synthWindow,
+                                        t_UmbrellaWindow *thisWindow, int pullid)
 {
     synthWindow->N       [0] = thisWindow->N        [pullid];
     synthWindow->Histo   [0] = thisWindow->Histo    [pullid];
@@ -1257,13 +1259,13 @@ void copy_pullgrp_to_synthwindow(t_UmbrellaWindow *synthWindow,
  * which are distributed according to the histograms. Required to generate
  * the "synthetic" histograms for the Bootstrap method
  */
-void calc_cumulatives(t_UmbrellaWindow *window, int nWindows,
-                      t_UmbrellaOptions *opt, const char *fnhist, const char *xlabel)
+static void calc_cumulatives(t_UmbrellaWindow *window, int nWindows,
+                             t_UmbrellaOptions *opt, const char *fnhist, const char *xlabel)
 {
     int    i, j, k, nbin;
     double last;
-    char  *fn = 0, *buf = 0;
-    FILE  *fp = 0;
+    char  *fn = nullptr, *buf = nullptr;
+    FILE  *fp = nullptr;
 
     if (opt->bs_verbose)
     {
@@ -1322,7 +1324,7 @@ void calc_cumulatives(t_UmbrellaWindow *window, int nWindows,
  *
  *  This is used to generate a random sequence distributed according to a histogram
  */
-void searchCumulative(double xx[], int n, double x, int *j)
+static void searchCumulative(double xx[], int n, double x, int *j)
 {
     int ju, jm, jl;
 
@@ -1355,8 +1357,8 @@ void searchCumulative(double xx[], int n, double x, int *j)
 }
 
 //! Bootstrap new trajectories and thereby generate new (bootstrapped) histograms
-void create_synthetic_histo(t_UmbrellaWindow *synthWindow, t_UmbrellaWindow *thisWindow,
-                            int pullid, t_UmbrellaOptions *opt)
+static void create_synthetic_histo(t_UmbrellaWindow *synthWindow, t_UmbrellaWindow *thisWindow,
+                                   int pullid, t_UmbrellaOptions *opt)
 {
     int    N, i, nbins, r_index, ibin;
     double r, tausteps = 0.0, a, ap, dt, x, invsqrt2, g, y, sig = 0., z, mu = 0.;
@@ -1500,10 +1502,10 @@ void create_synthetic_histo(t_UmbrellaWindow *synthWindow, t_UmbrellaWindow *thi
  * If bs_index>=0, a number is added to the output file name to allow the ouput of all
  * sets of bootstrapped histograms.
  */
-void print_histograms(const char *fnhist, t_UmbrellaWindow * window, int nWindows,
-                      int bs_index, t_UmbrellaOptions *opt, const char *xlabel)
+static void print_histograms(const char *fnhist, t_UmbrellaWindow * window, int nWindows,
+                             int bs_index, t_UmbrellaOptions *opt, const char *xlabel)
 {
-    char *fn = 0, *buf = 0, title[256];
+    char *fn = nullptr, *buf = nullptr, title[256];
     FILE *fp;
     int   bins, l, i, j;
 
@@ -1547,7 +1549,7 @@ void print_histograms(const char *fnhist, t_UmbrellaWindow * window, int nWindow
 }
 
 //! Used for qsort to sort random numbers
-int func_wham_is_larger(const void *a, const void *b)
+static int func_wham_is_larger(const void *a, const void *b)
 {
     double *aa, *bb;
     aa = (double*)a;
@@ -1567,7 +1569,7 @@ int func_wham_is_larger(const void *a, const void *b)
 }
 
 //! Make random weights for histograms for the Bayesian bootstrap of complete histograms)
-void setRandomBsWeights(t_UmbrellaWindow *synthwin, int nAllPull, t_UmbrellaOptions *opt)
+static void setRandomBsWeights(t_UmbrellaWindow *synthwin, int nAllPull, t_UmbrellaOptions *opt)
 {
     int     i;
     double *r;
@@ -1602,13 +1604,13 @@ void setRandomBsWeights(t_UmbrellaWindow *synthwin, int nAllPull, t_UmbrellaOpti
 }
 
 //! The main bootstrapping routine
-void do_bootstrapping(const char *fnres, const char* fnprof, const char *fnhist,
-                      const char *xlabel, char* ylabel, double *profile,
-                      t_UmbrellaWindow * window, int nWindows, t_UmbrellaOptions *opt)
+static void do_bootstrapping(const char *fnres, const char* fnprof, const char *fnhist,
+                             const char *xlabel, char* ylabel, double *profile,
+                             t_UmbrellaWindow * window, int nWindows, t_UmbrellaOptions *opt)
 {
     t_UmbrellaWindow * synthWindow;
     double            *bsProfile, *bsProfiles_av, *bsProfiles_av2, maxchange = 1e20, tmp, stddev;
-    int                i, j, *randomArray = 0, winid, pullid, ib;
+    int                i, j, *randomArray = nullptr, winid, pullid, ib;
     int                iAllPull, nAllPull, *allPull_winId, *allPull_pullId;
     FILE              *fp;
     gmx_bool           bExact = FALSE;
@@ -1800,7 +1802,7 @@ void do_bootstrapping(const char *fnres, const char* fnprof, const char *fnhist,
 }
 
 //! Return type of input file based on file extension (xvg, pdo, or tpr)
-int whaminFileType(char *fn)
+static int whaminFileType(char *fn)
 {
     int len;
     len = std::strlen(fn);
@@ -1824,17 +1826,17 @@ int whaminFileType(char *fn)
 }
 
 //! Read the files names in pdo-files.dat, pullf/x-files.dat, tpr-files.dat
-void read_wham_in(const char *fn, char ***filenamesRet, int *nfilesRet,
-                  t_UmbrellaOptions *opt)
+static void read_wham_in(const char *fn, char ***filenamesRet, int *nfilesRet,
+                         t_UmbrellaOptions *opt)
 {
-    char **filename = 0, tmp[WHAM_MAXFILELEN+2];
+    char **filename = nullptr, tmp[WHAM_MAXFILELEN+2];
     int    nread, sizenow, i, block = 1;
     FILE  *fp;
 
     fp      = gmx_ffopen(fn, "r");
     nread   = 0;
     sizenow = 0;
-    while (fgets(tmp, sizeof(tmp), fp) != NULL)
+    while (fgets(tmp, sizeof(tmp), fp) != nullptr)
     {
         if (std::strlen(tmp) >= WHAM_MAXFILELEN)
         {
@@ -1866,10 +1868,10 @@ void read_wham_in(const char *fn, char ***filenamesRet, int *nfilesRet,
 }
 
 //! Open a file or a pipe to a gzipped file
-FILE *open_pdo_pipe(const char *fn, t_UmbrellaOptions *opt, gmx_bool *bPipeOpen)
+static FILE *open_pdo_pipe(const char *fn, t_UmbrellaOptions *opt, gmx_bool *bPipeOpen)
 {
-    char            Buffer[1024], gunzip[1024], *Path = 0;
-    FILE           *pipe   = 0;
+    char            Buffer[1024], gunzip[1024], *Path = nullptr;
+    FILE           *pipe   = nullptr;
     static gmx_bool bFirst = 1;
 
     /* gzipped pdo file? */
@@ -1917,7 +1919,7 @@ FILE *open_pdo_pipe(const char *fn, t_UmbrellaOptions *opt, gmx_bool *bPipeOpen)
             printf("Executing command '%s'\n", Buffer);
         }
 #if HAVE_PIPES
-        if ((pipe = popen(Buffer, "r")) == NULL)
+        if ((pipe = popen(Buffer, "r")) == nullptr)
         {
             gmx_fatal(FARGS, "Unable to open pipe to `%s'\n", Buffer);
         }
@@ -1936,7 +1938,7 @@ FILE *open_pdo_pipe(const char *fn, t_UmbrellaOptions *opt, gmx_bool *bPipeOpen)
 }
 
 //! Close file or pipe
-void pdo_close_file(FILE *fp)
+static void pdo_close_file(FILE *fp)
 {
 #if HAVE_PIPES
     pclose(fp);
@@ -1946,8 +1948,8 @@ void pdo_close_file(FILE *fp)
 }
 
 //! Reading all pdo files
-void read_pdo_files(char **fn, int nfiles, t_UmbrellaHeader* header,
-                    t_UmbrellaWindow *window, t_UmbrellaOptions *opt)
+static void read_pdo_files(char **fn, int nfiles, t_UmbrellaHeader* header,
+                           t_UmbrellaWindow *window, t_UmbrellaOptions *opt)
 {
     FILE    *file;
     real     mintmp, maxtmp, done = 0.;
@@ -1979,7 +1981,7 @@ void read_pdo_files(char **fn, int nfiles, t_UmbrellaHeader* header,
             }
             read_pdo_header(file, header, opt);
             /* here only determine min and max of this window */
-            read_pdo_data(file, header, i, NULL, opt, TRUE, &mintmp, &maxtmp);
+            read_pdo_data(file, header, i, nullptr, opt, TRUE, &mintmp, &maxtmp);
             if (maxtmp > opt->max)
             {
                 opt->max = maxtmp;
@@ -2021,7 +2023,7 @@ void read_pdo_files(char **fn, int nfiles, t_UmbrellaHeader* header,
         file = open_pdo_pipe(fn[i], opt, &bPipeOpen);
         read_pdo_header(file, header, opt);
         /* load data into window */
-        read_pdo_data(file, header, i, window, opt, FALSE, NULL, NULL);
+        read_pdo_data(file, header, i, window, opt, FALSE, nullptr, nullptr);
         if ((window+i)->Ntot[0] == 0)
         {
             fprintf(stderr, "\nWARNING, no data points read from file %s (check -b option)\n", fn[i]);
@@ -2047,56 +2049,56 @@ void read_pdo_files(char **fn, int nfiles, t_UmbrellaHeader* header,
 #define int2YN(a) (((a) == 0) ? ("N") : ("Y"))
 
 //! Read pull groups from a tpr file (including position, force const, geometry, number of groups)
-void read_tpr_header(const char *fn, t_UmbrellaHeader* header, t_UmbrellaOptions *opt, t_coordselection *coordsel)
+static void read_tpr_header(const char *fn, t_UmbrellaHeader* header, t_UmbrellaOptions *opt, t_coordselection *coordsel)
 {
-    t_inputrec  ir;
-    int         i;
-    t_state     state;
-    static int  first = 1;
+    t_inputrec      irInstance;
+    t_inputrec     *ir = &irInstance;
+    t_state         state;
+    static int      first = 1;
 
     /* printf("Reading %s \n",fn); */
-    read_tpx_state(fn, &ir, &state, NULL);
+    read_tpx_state(fn, ir, &state, nullptr);
 
-    if (!ir.bPull)
+    if (!ir->bPull)
     {
         gmx_fatal(FARGS, "This is not a tpr with COM pulling");
     }
-    if (ir.pull->ncoord == 0)
+    if (ir->pull->ncoord == 0)
     {
         gmx_fatal(FARGS, "No pull coordinates found in %s", fn);
     }
 
     /* Read overall pull info */
-    header->npullcrds      = ir.pull->ncoord;
-    header->bPrintCOM      = ir.pull->bPrintCOM;
-    header->bPrintRefValue = ir.pull->bPrintRefValue;
-    header->bPrintComp     = ir.pull->bPrintComp;
+    header->npullcrds      = ir->pull->ncoord;
+    header->bPrintCOM      = ir->pull->bPrintCOM;
+    header->bPrintRefValue = ir->pull->bPrintRefValue;
+    header->bPrintComp     = ir->pull->bPrintComp;
 
     /* Read pull coordinates */
     snew(header->pcrd, header->npullcrds);
-    for (i = 0; i < ir.pull->ncoord; i++)
+    for (int i = 0; i < ir->pull->ncoord; i++)
     {
-        header->pcrd[i].pull_type     = ir.pull->coord[i].eType;
-        header->pcrd[i].geometry      = ir.pull->coord[i].eGeom;
-        header->pcrd[i].ngroup        = ir.pull->coord[i].ngroup;
-        header->pcrd[i].k             = ir.pull->coord[i].k;
-        header->pcrd[i].init_dist     = ir.pull->coord[i].init;
+        header->pcrd[i].pull_type     = ir->pull->coord[i].eType;
+        header->pcrd[i].geometry      = ir->pull->coord[i].eGeom;
+        header->pcrd[i].ngroup        = ir->pull->coord[i].ngroup;
+        header->pcrd[i].k             = ir->pull->coord[i].k;
+        header->pcrd[i].init_dist     = ir->pull->coord[i].init;
 
-        copy_ivec(ir.pull->coord[i].dim, header->pcrd[i].dim);
+        copy_ivec(ir->pull->coord[i].dim, header->pcrd[i].dim);
         header->pcrd[i].ndim         = header->pcrd[i].dim[XX] + header->pcrd[i].dim[YY] + header->pcrd[i].dim[ZZ];
 
         std::strcpy(header->pcrd[i].coord_unit,
-                    pull_coordinate_units(&ir.pull->coord[i]));
+                    pull_coordinate_units(&ir->pull->coord[i]));
 
-        if (ir.efep != efepNO && ir.pull->coord[i].k != ir.pull->coord[i].kB)
+        if (ir->efep != efepNO && ir->pull->coord[i].k != ir->pull->coord[i].kB)
         {
             gmx_fatal(FARGS, "Seems like you did free-energy perturbation, and you perturbed the force constant."
                       " This is not supported.\n");
         }
-        if (coordsel && (coordsel->n != ir.pull->ncoord))
+        if (coordsel && (coordsel->n != ir->pull->ncoord))
         {
             gmx_fatal(FARGS, "Found %d pull coordinates in %s, but %d columns in the respective line\n"
-                      "coordinate selection file (option -is)\n", ir.pull->ncoord, fn, coordsel->n);
+                      "coordinate selection file (option -is)\n", ir->pull->ncoord, fn, coordsel->n);
         }
     }
 
@@ -2104,9 +2106,9 @@ void read_tpr_header(const char *fn, t_UmbrellaHeader* header, t_UmbrellaOptions
     int  geom          = -1;
     ivec thedim        = { 0, 0, 0 };
     bool geometryIsSet = false;
-    for (i = 0; i < ir.pull->ncoord; i++)
+    for (int i = 0; i < ir->pull->ncoord; i++)
     {
-        if (coordsel == NULL || coordsel->bUse[i])
+        if (coordsel == nullptr || coordsel->bUse[i])
         {
             if (header->pcrd[i].pull_type != epullUMBRELLA)
             {
@@ -2156,7 +2158,7 @@ void read_tpr_header(const char *fn, t_UmbrellaHeader* header, t_UmbrellaOptions
     {
         printf("\nFile %s, %d coordinates, with these options:\n", fn, header->npullcrds);
         int maxlen = 0;
-        for (i = 0; i < ir.pull->ncoord; i++)
+        for (int i = 0; i < ir->pull->ncoord; i++)
         {
             int lentmp = strlen(epullg_names[header->pcrd[i].geometry]);
             maxlen     = (lentmp > maxlen) ? lentmp : maxlen;
@@ -2164,14 +2166,14 @@ void read_tpr_header(const char *fn, t_UmbrellaHeader* header, t_UmbrellaOptions
         char fmt[STRLEN];
         sprintf(fmt, "\tGeometry %%-%ds  k = %%-8g  position = %%-8g  dimensions [%%s %%s %%s] (%%d dimensions). Used: %%s\n",
                 maxlen+1);
-        for (i = 0; i < ir.pull->ncoord; i++)
+        for (int i = 0; i < ir->pull->ncoord; i++)
         {
-            bool use = (coordsel == NULL || coordsel->bUse[i]);
+            bool use = (coordsel == nullptr || coordsel->bUse[i]);
             printf(fmt,
                    epullg_names[header->pcrd[i].geometry], header->pcrd[i].k, header->pcrd[i].init_dist,
                    int2YN(header->pcrd[i].dim[XX]), int2YN(header->pcrd[i].dim[YY]), int2YN(header->pcrd[i].dim[ZZ]),
                    header->pcrd[i].ndim, use ? "Yes" : "No");
-            printf("\tPull group coordinates of %d groups expected in pullx files.\n", ir.pull->bPrintCOM ? header->pcrd[i].ngroup : 0);
+            printf("\tPull group coordinates of %d groups expected in pullx files.\n", ir->pull->bPrintCOM ? header->pcrd[i].ngroup : 0);
         }
         printf("\tReference value of the coordinate%s expected in pullx files.\n",
                header->bPrintRefValue ? "" : " not");
@@ -2184,33 +2186,21 @@ void read_tpr_header(const char *fn, t_UmbrellaHeader* header, t_UmbrellaOptions
     first = 0;
 }
 
-//! 2-norm in a ndim-dimensional space
-double dist_ndim(double **dx, int ndim, int line)
-{
-    int    i;
-    double r2 = 0.;
-    for (i = 0; i < ndim; i++)
-    {
-        r2 += gmx::square(dx[i][line]);
-    }
-    return std::sqrt(r2);
-}
-
 //! Read pullx.xvg or pullf.xvg
-void read_pull_xf(const char *fn, t_UmbrellaHeader * header,
-                  t_UmbrellaWindow * window,
-                  t_UmbrellaOptions *opt,
-                  gmx_bool bGetMinMax, real *mintmp, real *maxtmp,
-                  t_coordselection *coordsel)
+static void read_pull_xf(const char *fn, t_UmbrellaHeader * header,
+                         t_UmbrellaWindow * window,
+                         t_UmbrellaOptions *opt,
+                         gmx_bool bGetMinMax, real *mintmp, real *maxtmp,
+                         t_coordselection *coordsel)
 {
-    double        **y = 0, pos = 0., t, force, time0 = 0., dt;
+    double        **y = nullptr, pos = 0., t, force, time0 = 0., dt;
     int             ny, nt, bins, ibin, i, g, gUsed, dstep = 1;
     int             nColExpect, ntot, column;
     real            min, max, minfound = 1e20, maxfound = -1e20;
     gmx_bool        dt_ok, timeok;
     const char     *quantity;
     const int       blocklen = 4096;
-    int            *lennow   = 0;
+    int            *lennow   = nullptr;
     static gmx_bool bFirst   = TRUE;
 
     /*
@@ -2294,6 +2284,7 @@ void read_pull_xf(const char *fn, t_UmbrellaHeader * header,
 
     if (!bGetMinMax)
     {
+        assert(window);
         bins = opt->bins;
         min  = opt->min;
         max  = opt->max;
@@ -2331,7 +2322,7 @@ void read_pull_xf(const char *fn, t_UmbrellaHeader * header,
         snew(window->Ntot,     window->nPull);
         snew(window->g,        window->nPull);
         snew(window->bsWeight, window->nPull);
-        window->bContrib = 0;
+        window->bContrib = nullptr;
 
         if (opt->bCalcTauInt)
         {
@@ -2339,7 +2330,7 @@ void read_pull_xf(const char *fn, t_UmbrellaHeader * header,
         }
         else
         {
-            window->ztime = NULL;
+            window->ztime = nullptr;
         }
         snew(lennow, window->nPull);
 
@@ -2354,7 +2345,7 @@ void read_pull_xf(const char *fn, t_UmbrellaHeader * header,
 
             if (opt->bCalcTauInt)
             {
-                window->ztime[g] = NULL;
+                window->ztime[g] = nullptr;
             }
         }
 
@@ -2530,9 +2521,9 @@ void read_pull_xf(const char *fn, t_UmbrellaHeader * header,
 }
 
 //! read pullf-files.dat or pullx-files.dat and tpr-files.dat
-void read_tpr_pullxf_files(char **fnTprs, char **fnPull, int nfiles,
-                           t_UmbrellaHeader* header,
-                           t_UmbrellaWindow *window, t_UmbrellaOptions *opt)
+static void read_tpr_pullxf_files(char **fnTprs, char **fnPull, int nfiles,
+                                  t_UmbrellaHeader* header,
+                                  t_UmbrellaWindow *window, t_UmbrellaOptions *opt)
 {
     int  i;
     real mintmp, maxtmp;
@@ -2551,13 +2542,13 @@ void read_tpr_pullxf_files(char **fnTprs, char **fnPull, int nfiles,
             {
                 gmx_fatal(FARGS, "Expected the %d'th file in input file to be a tpr file\n", i);
             }
-            read_tpr_header(fnTprs[i], header, opt, (opt->nCoordsel > 0) ? &opt->coordsel[i] : NULL);
+            read_tpr_header(fnTprs[i], header, opt, (opt->nCoordsel > 0) ? &opt->coordsel[i] : nullptr);
             if (whaminFileType(fnPull[i]) != whamin_pullxf)
             {
                 gmx_fatal(FARGS, "Expected the %d'th file in input file to be a xvg (pullx/pullf) file\n", i);
             }
-            read_pull_xf(fnPull[i], header, NULL, opt, TRUE, &mintmp, &maxtmp,
-                         (opt->nCoordsel > 0) ? &opt->coordsel[i] : NULL);
+            read_pull_xf(fnPull[i], header, nullptr, opt, TRUE, &mintmp, &maxtmp,
+                         (opt->nCoordsel > 0) ? &opt->coordsel[i] : nullptr);
             if (maxtmp > opt->max)
             {
                 opt->max = maxtmp;
@@ -2584,13 +2575,13 @@ void read_tpr_pullxf_files(char **fnTprs, char **fnPull, int nfiles,
         {
             gmx_fatal(FARGS, "Expected the %d'th file in input file to be a tpr file\n", i);
         }
-        read_tpr_header(fnTprs[i], header, opt, (opt->nCoordsel > 0) ? &opt->coordsel[i] : NULL);
+        read_tpr_header(fnTprs[i], header, opt, (opt->nCoordsel > 0) ? &opt->coordsel[i] : nullptr);
         if (whaminFileType(fnPull[i]) != whamin_pullxf)
         {
             gmx_fatal(FARGS, "Expected the %d'th file in input file to be a xvg (pullx/pullf) file\n", i);
         }
-        read_pull_xf(fnPull[i], header, window+i, opt, FALSE, NULL, NULL,
-                     (opt->nCoordsel > 0) ? &opt->coordsel[i] : NULL);
+        read_pull_xf(fnPull[i], header, window+i, opt, FALSE, nullptr, nullptr,
+                     (opt->nCoordsel > 0) ? &opt->coordsel[i] : nullptr);
         if (window[i].Ntot[0] == 0)
         {
             fprintf(stderr, "\nWARNING, no data points read from file %s (check -b option)\n", fnPull[i]);
@@ -2619,7 +2610,7 @@ void read_tpr_pullxf_files(char **fnTprs, char **fnPull, int nfiles,
  * Note: Here we consider tau[int] := int_0^inf ACF(t) as the integrated autocorrelation times.
  * The factor `g := 1 + 2*tau[int]` subsequently enters the uncertainty.
  */
-void readIntegratedAutocorrelationTimes(t_UmbrellaWindow *window, int nwins, const char* fn)
+static void readIntegratedAutocorrelationTimes(t_UmbrellaWindow *window, int nwins, const char* fn)
 {
     int      nlines, ny, i, ig;
     double **iact;
@@ -2662,7 +2653,7 @@ void readIntegratedAutocorrelationTimes(t_UmbrellaWindow *window, int nwins, con
  * If opt->bAllowReduceIact==FALSE, the ACTs are never reduced, only increased
  * by the smoothing
  */
-void smoothIact(t_UmbrellaWindow *window, int nwins, t_UmbrellaOptions *opt)
+static void smoothIact(t_UmbrellaWindow *window, int nwins, t_UmbrellaOptions *opt)
 {
     int    i, ig, j, jg;
     double pos, dpos2, siglim, siglim2, gaufact, invtwosig2, w, weight, tausm;
@@ -2716,13 +2707,13 @@ void smoothIact(t_UmbrellaWindow *window, int nwins, t_UmbrellaOptions *opt)
 
 /*! \brief Try to compute the autocorrelation time for each umbrealla window
  */
-void calcIntegratedAutocorrelationTimes(t_UmbrellaWindow *window, int nwins,
-                                        t_UmbrellaOptions *opt, const char *fn, const char *xlabel)
+static void calcIntegratedAutocorrelationTimes(t_UmbrellaWindow *window, int nwins,
+                                               t_UmbrellaOptions *opt, const char *fn, const char *xlabel)
 {
     int   i, ig, ncorr, ntot, j, k, *count, restart;
     real *corr, c0, dt, tmp;
     real *ztime, av, tausteps;
-    FILE *fp, *fpcorr = 0;
+    FILE *fp, *fpcorr = nullptr;
 
     if (opt->verbose)
     {
@@ -2884,7 +2875,7 @@ void calcIntegratedAutocorrelationTimes(t_UmbrellaWindow *window, int nwins,
 /*! \brief
  * compute average and sigma of each umbrella histogram
  */
-void averageSigma(t_UmbrellaWindow *window, int nwins)
+static void averageSigma(t_UmbrellaWindow *window, int nwins)
 {
     int  i, ig, ntot, k;
     real av, sum2, sig, diff, *ztime, nSamplesIndep;
@@ -2933,7 +2924,7 @@ void averageSigma(t_UmbrellaWindow *window, int nwins)
 /*! \brief
  * Use histograms to compute average force on pull group.
  */
-void computeAverageForce(t_UmbrellaWindow *window, int nWindows, t_UmbrellaOptions *opt)
+static void computeAverageForce(t_UmbrellaWindow *window, int nWindows, t_UmbrellaOptions *opt)
 {
     int    i, j, bins = opt->bins, k;
     double dz, min = opt->min, max = opt->max, displAv, temp, distance, ztot, ztot_half, w, weight;
@@ -2996,8 +2987,8 @@ void computeAverageForce(t_UmbrellaWindow *window, int nWindows, t_UmbrellaOptio
 /*! \brief
  * Check if the complete reaction coordinate is covered by the histograms
  */
-void  checkReactionCoordinateCovered(t_UmbrellaWindow *window, int nwins,
-                                     t_UmbrellaOptions *opt)
+static void  checkReactionCoordinateCovered(t_UmbrellaWindow *window, int nwins,
+                                            t_UmbrellaOptions *opt)
 {
     int  i, ig, j, bins = opt->bins, bBoundary;
     real avcount = 0, z, relcount, *count;
@@ -3039,7 +3030,7 @@ void  checkReactionCoordinateCovered(t_UmbrellaWindow *window, int nwins,
  *
  * This speeds up the convergence by roughly a factor of 2
  */
-void guessPotByIntegration(t_UmbrellaWindow *window, int nWindows, t_UmbrellaOptions *opt, const char *xlabel)
+static void guessPotByIntegration(t_UmbrellaWindow *window, int nWindows, t_UmbrellaOptions *opt, const char *xlabel)
 {
     int    i, j, ig, bins = opt->bins, nHist, winmin, groupmin;
     double dz, min = opt->min, *pot, pos, hispos, dist, diff, fAv, distmin, *f;
@@ -3162,21 +3153,21 @@ static int wordcount(char *ptr)
  *
  * TO DO: ptr=fgets(...) is never freed (small memory leak)
  */
-void readPullCoordSelection(t_UmbrellaOptions *opt, char **fnTpr, int nTpr)
+static void readPullCoordSelection(t_UmbrellaOptions *opt, char **fnTpr, int nTpr)
 {
     FILE *fp;
     int   i, iline, n, len = STRLEN, temp;
-    char *ptr = 0, *tmpbuf = 0;
+    char *ptr = nullptr, *tmpbuf = nullptr;
     char  fmt[1024], fmtign[1024];
     int   block = 1, sizenow;
 
     fp            = gmx_ffopen(opt->fnCoordSel, "r");
-    opt->coordsel = NULL;
+    opt->coordsel = nullptr;
 
     snew(tmpbuf, len);
     sizenow = 0;
     iline   = 0;
-    while ( (ptr = fgets3(fp, tmpbuf, &len)) != NULL)
+    while ( (ptr = fgets3(fp, tmpbuf, &len)) != nullptr)
     {
         trim(ptr);
         n = wordcount(ptr);
@@ -3403,9 +3394,9 @@ int gmx_wham(int argc, char *argv[])
         "the histograms."
     };
 
-    const char              *en_unit[]       = {NULL, "kJ", "kCal", "kT", NULL};
-    const char              *en_unit_label[] = {"", "E (kJ mol\\S-1\\N)", "E (kcal mol\\S-1\\N)", "E (kT)", NULL};
-    const char              *en_bsMethod[]   = { NULL, "b-hist", "hist", "traj", "traj-gauss", NULL };
+    const char              *en_unit[]       = {nullptr, "kJ", "kCal", "kT", nullptr};
+    const char              *en_unit_label[] = {"", "E (kJ mol\\S-1\\N)", "E (kcal mol\\S-1\\N)", "E (kT)", nullptr};
+    const char              *en_bsMethod[]   = { nullptr, "b-hist", "hist", "traj", "traj-gauss", nullptr };
     static t_UmbrellaOptions opt;
 
     t_pargs                  pa[] = {
@@ -3489,7 +3480,7 @@ int gmx_wham(int argc, char *argv[])
 
     int                      i, j, l, nfiles, nwins, nfiles2;
     t_UmbrellaHeader         header;
-    t_UmbrellaWindow       * window = NULL;
+    t_UmbrellaWindow       * window = nullptr;
     double                  *profile, maxchange = 1e20;
     gmx_bool                 bMinSet, bMaxSet, bAutoSet, bExact = FALSE;
     char                   **fninTpr, **fninPull, **fninPdo;
@@ -3508,7 +3499,7 @@ int gmx_wham(int argc, char *argv[])
     opt.max       = 0;
     opt.bAuto     = TRUE;
     opt.nCoordsel = 0;
-    opt.coordsel  = NULL;
+    opt.coordsel  = nullptr;
 
     /* bootstrapping stuff */
     opt.nBootStrap               = 0;
@@ -3534,7 +3525,7 @@ int gmx_wham(int argc, char *argv[])
     opt.stepUpdateContrib     = 100;
 
     if (!parse_common_args(&argc, argv, 0,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &opt.oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &opt.oenv))
     {
         return 0;
     }
@@ -3624,7 +3615,7 @@ int gmx_wham(int argc, char *argv[])
         }
 
         /* Read file that selects the pull group to be used */
-        if (opt.fnCoordSel != NULL)
+        if (opt.fnCoordSel != nullptr)
         {
             readPullCoordSelection(&opt, fninTpr, nfiles);
         }
@@ -3634,7 +3625,7 @@ int gmx_wham(int argc, char *argv[])
     }
     else
     {   /* reading pdo files */
-        if  (opt.fnCoordSel != NULL)
+        if  (opt.fnCoordSel != nullptr)
         {
             gmx_fatal(FARGS, "Reading a -is file is not supported with PDO input files.\n"
                       "Use awk or a similar tool to pick the required pull groups from your PDO files\n");
index 90d497be9777bb83a9dbcbbec23ef753b1b83c93..52d4fb8faad8fe259e2b41ac1f8ce6ec65748dbe 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,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.
@@ -74,7 +74,7 @@ static gmx_bool *bPhobics(int nres, char *resnm[])
     return bb;
 }
 
-void wheel(const char *fn, int nres, char *resnm[], int r0, real rot0, char *title)
+static void wheel(const char *fn, int nres, char *resnm[], int r0, real rot0, char *title)
 {
     const real fontsize  = 16;
     const real gray      = 0.9;
@@ -152,7 +152,7 @@ void wheel(const char *fn, int nres, char *resnm[], int r0, real rot0, char *tit
     ps_close(out);
 }
 
-void wheel2(const char *fn, int nres, char *resnm[], real rot0, char *title)
+static void wheel2(const char *fn, int nres, char *resnm[], real rot0, char *title)
 {
     const real fontsize  = 14;
     const real gray      = 0.9;
@@ -224,7 +224,7 @@ int gmx_wheel(int argc, char *argv[])
     gmx_output_env_t *oenv;
     static real       rot0  = 0;
     static gmx_bool   bNum  = TRUE;
-    static char      *title = NULL;
+    static char      *title = nullptr;
     static int        r0    = 1;
     t_pargs           pa [] = {
         { "-r0",  FALSE, etINT, {&r0},
@@ -237,8 +237,8 @@ int gmx_wheel(int argc, char *argv[])
           "Toggle numbers" }
     };
     t_filenm          fnm[] = {
-        { efDAT, "-f", NULL,  ffREAD  },
-        { efEPS, "-o", NULL,  ffWRITE }
+        { efDAT, "-f", nullptr,  ffREAD  },
+        { efEPS, "-o", nullptr,  ffWRITE }
     };
 #define NFILE asize(fnm)
 
@@ -246,7 +246,7 @@ int gmx_wheel(int argc, char *argv[])
     char **resnm;
 
     if (!parse_common_args(&argc, argv, 0, NFILE, fnm, asize(pa), pa,
-                           asize(desc), desc, 0, NULL, &oenv))
+                           asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -255,12 +255,12 @@ int gmx_wheel(int argc, char *argv[])
     {
         if (std::strcmp(argv[i], "-r0") == 0)
         {
-            r0 = std::strtol(argv[++i], NULL, 10);
+            r0 = std::strtol(argv[++i], nullptr, 10);
             fprintf(stderr, "First residue is %d\n", r0);
         }
         else if (std::strcmp(argv[i], "-rot0") == 0)
         {
-            rot0 = strtod(argv[++i], NULL);
+            rot0 = strtod(argv[++i], nullptr);
             fprintf(stderr, "Initial rotation is %g\n", rot0);
         }
         else if (std::strcmp(argv[i], "-T") == 0)
index be80038239315c36d666740d3598a118d8cd2edf..185844fc9a0f76a91aee900672eb91a0fbcda12c 100644 (file)
@@ -55,7 +55,9 @@
 #include "gromacs/gmxana/gmx_ana.h"
 #include "gromacs/utility/arraysize.h"
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/filestream.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
@@ -112,11 +114,11 @@ enum {
     ecSel, ecHalves, ecAdd, ecSub, ecMult, ecDiv, ecNR
 };
 
-void get_params(const char *mpin, const char *mpout, t_psrec *psr)
+static void get_params(const char *mpin, const char *mpout, t_psrec *psr)
 {
-    static const char *gmx_bools[BOOL_NR+1]  = { "no", "yes", NULL };
+    static const char *gmx_bools[BOOL_NR+1]  = { "no", "yes", nullptr };
     /* this must correspond to t_rgb *linecolors[] below */
-    static const char *colors[] = { "none", "black", "white", NULL };
+    static const char *colors[] = { "none", "black", "white", nullptr };
     warninp_t          wi;
     t_inpfile         *inp;
     const char        *tmp;
@@ -124,13 +126,14 @@ void get_params(const char *mpin, const char *mpout, t_psrec *psr)
 
     wi = init_warning(FALSE, 0);
 
-    if (mpin != NULL)
+    if (mpin != nullptr)
     {
-        inp = read_inpfile(mpin, &ninp, wi);
+        gmx::TextInputFile stream(mpin);
+        inp = read_inpfile(&stream, mpin, &ninp, wi);
     }
     else
     {
-        inp = NULL;
+        inp = nullptr;
     }
     ETYPE("black&white",    psr->bw,             gmx_bools);
     RTYPE("linewidth",      psr->linewidth,      1.0);
@@ -176,9 +179,11 @@ void get_params(const char *mpin, const char *mpout, t_psrec *psr)
 
     check_warning_error(wi, FARGS);
 
-    if (mpout != NULL)
+    if (mpout != nullptr)
     {
-        write_inpfile(mpout, ninp, inp, TRUE, wi);
+        gmx::TextOutputFile stream(mpout);
+        write_inpfile(&stream, mpout, ninp, inp, TRUE, WriteMdpHeader::yes, wi);
+        stream.close();
     }
 
     done_warning(wi, FARGS);
@@ -190,9 +195,9 @@ t_rgb red   = { 1, 0, 0 };
 t_rgb blue  = { 0, 0, 1 };
 #define BLACK (&black)
 /* this must correspond to *colors[] in get_params */
-t_rgb *linecolors[] = { NULL, &black, &white, NULL };
+t_rgb *linecolors[] = { nullptr, &black, &white, nullptr };
 
-gmx_bool diff_maps(int nmap1, t_mapping *map1, int nmap2, t_mapping *map2)
+static gmx_bool diff_maps(int nmap1, t_mapping *map1, int nmap2, t_mapping *map2)
 {
     int      i;
     gmx_bool bDiff, bColDiff = FALSE;
@@ -230,8 +235,8 @@ gmx_bool diff_maps(int nmap1, t_mapping *map1, int nmap2, t_mapping *map2)
     return bDiff;
 }
 
-void leg_discrete(t_psdata ps, real x0, real y0, char *label,
-                  real fontsize, char *font, int nmap, t_mapping map[])
+static void leg_discrete(t_psdata ps, real x0, real y0, char *label,
+                         real fontsize, char *font, int nmap, t_mapping map[])
 {
     int   i;
     real  yhh;
@@ -260,10 +265,10 @@ void leg_discrete(t_psdata ps, real x0, real y0, char *label,
     }
 }
 
-void leg_continuous(t_psdata ps, real x0, real x, real y0, char *label,
-                    real fontsize, char *font,
-                    int nmap, t_mapping map[],
-                    int mapoffset)
+static void leg_continuous(t_psdata ps, real x0, real x, real y0, char *label,
+                           real fontsize, char *font,
+                           int nmap, t_mapping map[],
+                           int mapoffset)
 {
     int   i;
     real  xx0;
@@ -280,7 +285,7 @@ void leg_continuous(t_psdata ps, real x0, real x, real y0, char *label,
         boxxh = fontsize;
     }
 
-    GMX_RELEASE_ASSERT(map != NULL, "NULL map array provided to leg_continuous()");
+    GMX_RELEASE_ASSERT(map != nullptr, "NULL map array provided to leg_continuous()");
 
     /* LANDSCAPE */
     xx0 = x0-((nmap-mapoffset)*boxxh)/2.0;
@@ -304,9 +309,9 @@ void leg_continuous(t_psdata ps, real x0, real x, real y0, char *label,
              - boxxh/2, yhh, map[nmap-1].desc, eXCenter);
 }
 
-void leg_bicontinuous(t_psdata ps, real x0, real x, real y0, char *label1,
-                      char *label2, real fontsize, char *font,
-                      int nmap1, t_mapping map1[], int nmap2, t_mapping map2[])
+static void leg_bicontinuous(t_psdata ps, real x0, real x, real y0, char *label1,
+                             char *label2, real fontsize, char *font,
+                             int nmap1, t_mapping map1[], int nmap2, t_mapping map2[])
 {
     real xx1, xx2, x1, x2;
 
@@ -631,8 +636,8 @@ static void box_dim(int nmat, t_matrix mat[], t_matrix *mat2, t_psrec *psr,
     *dh = dhh;
 }
 
-int add_maps(t_mapping **newmap,
-             int nmap1, t_mapping map1[], int nmap2, t_mapping map2[])
+static int add_maps(t_mapping **newmap,
+                    int nmap1, t_mapping map1[], int nmap2, t_mapping map2[])
 {
     static char mapper[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_=+{}|;:',<.>/?";
     int         nsymbols;
@@ -678,13 +683,13 @@ int add_maps(t_mapping **newmap,
     return nmap;
 }
 
-void xpm_mat(const char *outf, int nmat, t_matrix *mat, t_matrix *mat2,
-             gmx_bool bDiag, gmx_bool bFirstDiag)
+static void xpm_mat(const char *outf, int nmat, t_matrix *mat, t_matrix *mat2,
+                    gmx_bool bDiag, gmx_bool bFirstDiag)
 {
     FILE      *out;
     int        i, x, y, col;
     int        nmap;
-    t_mapping *map = NULL;
+    t_mapping *map = nullptr;
 
     out = gmx_ffopen(outf, "w");
 
@@ -781,11 +786,11 @@ static void tick_spacing(int n, real axis[], real offset, char axisnm,
             axisnm, *major, *minor);
 }
 
-void ps_mat(const char *outf, int nmat, t_matrix mat[], t_matrix mat2[],
-            gmx_bool bFrame, gmx_bool bDiag, gmx_bool bFirstDiag,
-            gmx_bool bTitle, gmx_bool bTitleOnce, gmx_bool bYonce, int elegend,
-            real size, real boxx, real boxy, const char *m2p, const char *m2pout,
-            int mapoffset)
+static void ps_mat(const char *outf, int nmat, t_matrix mat[], t_matrix mat2[],
+                   gmx_bool bFrame, gmx_bool bDiag, gmx_bool bFirstDiag,
+                   gmx_bool bTitle, gmx_bool bTitleOnce, gmx_bool bYonce, int elegend,
+                   real size, real boxx, real boxy, const char *m2p, const char *m2pout,
+                   int mapoffset)
 {
     const char   *libm2p;
     char         *legend;
@@ -796,12 +801,16 @@ void ps_mat(const char *outf, int nmat, t_matrix mat[], t_matrix mat2[],
     real          x0, y0, xx;
     real          w, h, dw, dh;
     int           nmap1 = 0, nmap2 = 0, leg_nmap;
-    t_mapping    *map1  = NULL, *map2 = NULL, *leg_map;
+    t_mapping    *map1  = nullptr, *map2 = nullptr, *leg_map;
     gmx_bool      bMap1, bNextMap1, bDiscrete;
 
     /* memory leak: */
     libm2p = m2p ? gmxlibfn(m2p) : m2p;
-    get_params(libm2p, m2pout, &psrec);
+    try
+    {
+        get_params(libm2p, m2pout, &psrec);
+    }
+    GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
 
     psr = &psrec;
 
@@ -1007,7 +1016,7 @@ void ps_mat(const char *outf, int nmat, t_matrix mat[], t_matrix mat2[],
     {
         ps_comment(out, "Now it's legend time!");
         ps_linewidth(out, static_cast<int>(psr->linewidth));
-        if (mat2 == NULL || elegend != elSecond)
+        if (mat2 == nullptr || elegend != elSecond)
         {
             bDiscrete = mat[0].bDiscrete;
             legend    = mat[0].legend;
@@ -1047,14 +1056,14 @@ void ps_mat(const char *outf, int nmat, t_matrix mat[], t_matrix mat2[],
     ps_close(out);
 }
 
-void make_axis_labels(int nmat, t_matrix *mat)
+static void make_axis_labels(int nmat, t_matrix *mat)
 {
     int i, j;
 
     for (i = 0; (i < nmat); i++)
     {
         /* Make labels for x axis */
-        if (mat[i].axis_x == NULL)
+        if (mat[i].axis_x == nullptr)
         {
             snew(mat[i].axis_x, mat[i].nx);
             for (j = 0; (j < mat[i].nx); j++)
@@ -1063,7 +1072,7 @@ void make_axis_labels(int nmat, t_matrix *mat)
             }
         }
         /* Make labels for y axis */
-        if (mat[i].axis_y == NULL)
+        if (mat[i].axis_y == nullptr)
         {
             snew(mat[i].axis_y, mat[i].ny);
             for (j = 0; (j < mat[i].ny); j++)
@@ -1074,7 +1083,7 @@ void make_axis_labels(int nmat, t_matrix *mat)
     }
 }
 
-void prune_mat(int nmat, t_matrix *mat, t_matrix *mat2, int skip)
+static void prune_mat(int nmat, t_matrix *mat, t_matrix *mat2, int skip)
 {
     int i, x, y, xs, ys;
 
@@ -1129,7 +1138,7 @@ void prune_mat(int nmat, t_matrix *mat, t_matrix *mat2, int skip)
     }
 }
 
-void zero_lines(int nmat, t_matrix *mat, t_matrix *mat2)
+static void zero_lines(int nmat, t_matrix *mat, t_matrix *mat2)
 {
     int       i, x, y, m;
     t_matrix *mats;
@@ -1170,9 +1179,9 @@ void zero_lines(int nmat, t_matrix *mat, t_matrix *mat2)
     }
 }
 
-void write_combined_matrix(int ecombine, const char *fn,
-                           int nmat, t_matrix *mat1, t_matrix *mat2,
-                           real *cmin, real *cmax)
+static void write_combined_matrix(int ecombine, const char *fn,
+                                  int nmat, t_matrix *mat1, t_matrix *mat2,
+                                  real *cmin, real *cmax)
 {
     int        i, j, k, nlevels;
     FILE      *out;
@@ -1188,13 +1197,13 @@ void write_combined_matrix(int ecombine, const char *fn,
                       " not match.\n", k, mat1[k].nx, mat1[k].ny, mat2[k].nx, mat2[k].ny);
         }
         printf("Combining two %dx%d matrices\n", mat1[k].nx, mat1[k].ny);
-        rmat1 = matrix2real(&mat1[k], NULL);
-        rmat2 = matrix2real(&mat2[k], NULL);
-        if (NULL == rmat1 || NULL == rmat2)
+        rmat1 = matrix2real(&mat1[k], nullptr);
+        rmat2 = matrix2real(&mat2[k], nullptr);
+        if (nullptr == rmat1 || nullptr == rmat2)
         {
             gmx_fatal(FARGS, "Could not extract real data from %s xpm matrices. Note that, e.g.,\n"
                       "g_rms and g_mdmat provide such data, but not do_dssp.\n",
-                      (NULL == rmat1 && NULL == rmat2) ? "both" : "one of the" );
+                      (nullptr == rmat1 && nullptr == rmat2) ? "both" : "one of the" );
         }
         rlo = 1e38;
         rhi = -1e38;
@@ -1253,12 +1262,12 @@ void write_combined_matrix(int ecombine, const char *fn,
     gmx_ffclose(out);
 }
 
-void do_mat(int nmat, t_matrix *mat, t_matrix *mat2,
-            gmx_bool bFrame, gmx_bool bZeroLine, gmx_bool bDiag, gmx_bool bFirstDiag, gmx_bool bTitle,
-            gmx_bool bTitleOnce, gmx_bool bYonce, int elegend,
-            real size, real boxx, real boxy,
-            const char *epsfile, const char *xpmfile, const char *m2p,
-            const char *m2pout, int skip, int mapoffset)
+static void do_mat(int nmat, t_matrix *mat, t_matrix *mat2,
+                   gmx_bool bFrame, gmx_bool bZeroLine, gmx_bool bDiag, gmx_bool bFirstDiag, gmx_bool bTitle,
+                   gmx_bool bTitleOnce, gmx_bool bYonce, int elegend,
+                   real size, real boxx, real boxy,
+                   const char *epsfile, const char *xpmfile, const char *m2p,
+                   const char *m2pout, int skip, int mapoffset)
 {
     int      i, j, k;
 
@@ -1297,19 +1306,19 @@ void do_mat(int nmat, t_matrix *mat, t_matrix *mat2,
         zero_lines(nmat, mat, mat);
     }
 
-    if (epsfile != NULL)
+    if (epsfile != nullptr)
     {
         ps_mat(epsfile, nmat, mat, mat2, bFrame, bDiag, bFirstDiag,
                bTitle, bTitleOnce, bYonce, elegend,
                size, boxx, boxy, m2p, m2pout, mapoffset);
     }
-    if (xpmfile != NULL)
+    if (xpmfile != nullptr)
     {
         xpm_mat(xpmfile, nmat, mat, mat2, bDiag, bFirstDiag);
     }
 }
 
-void gradient_map(rvec grad, int nmap, t_mapping map[])
+static void gradient_map(rvec grad, int nmap, t_mapping map[])
 {
     int  i;
     real c;
@@ -1323,7 +1332,7 @@ void gradient_map(rvec grad, int nmap, t_mapping map[])
     }
 }
 
-void gradient_mat(rvec grad, int nmat, t_matrix mat[])
+static void gradient_mat(rvec grad, int nmat, t_matrix mat[])
 {
     int m;
 
@@ -1333,7 +1342,7 @@ void gradient_mat(rvec grad, int nmat, t_matrix mat[])
     }
 }
 
-void rainbow_map(gmx_bool bBlue, int nmap, t_mapping map[])
+static void rainbow_map(gmx_bool bBlue, int nmap, t_mapping map[])
 {
     int  i;
     real c, r, g, b;
@@ -1379,7 +1388,7 @@ void rainbow_map(gmx_bool bBlue, int nmap, t_mapping map[])
     }
 }
 
-void rainbow_mat(gmx_bool bBlue, int nmat, t_matrix mat[])
+static void rainbow_mat(gmx_bool bBlue, int nmat, t_matrix mat[])
 {
     int m;
 
@@ -1435,9 +1444,9 @@ int gmx_xpm2ps(int argc, char *argv[])
     };
 
     gmx_output_env_t *oenv;
-    const char       *fn, *epsfile = NULL, *xpmfile = NULL;
+    const char       *fn, *epsfile = nullptr, *xpmfile = nullptr;
     int               i, nmat, nmat2, etitle, elegend, ediag, erainbow, ecombine;
-    t_matrix         *mat = NULL, *mat2 = NULL;
+    t_matrix         *mat = nullptr, *mat2 = nullptr;
     gmx_bool          bTitle, bTitleOnce, bDiag, bFirstDiag, bGrad;
     static gmx_bool   bFrame = TRUE, bZeroLine = FALSE, bYonce = FALSE;
     static real       size   = 400, boxx = 0, boxy = 0, cmin = 0, cmax = 0;
@@ -1445,20 +1454,20 @@ int gmx_xpm2ps(int argc, char *argv[])
     enum                    {
         etSel, etTop, etOnce, etYlabel, etNone, etNR
     };
-    const char *title[]   = { NULL, "top", "once", "ylabel", "none", NULL };
+    const char *title[]   = { nullptr, "top", "once", "ylabel", "none", nullptr };
     /* MUST correspond to enum elXxx as defined at top of file */
-    const char *legend[]  = { NULL, "both", "first", "second", "none", NULL };
+    const char *legend[]  = { nullptr, "both", "first", "second", "none", nullptr };
     enum                    {
         edSel, edFirst, edSecond, edNone, edNR
     };
-    const char *diag[]    = { NULL, "first", "second", "none", NULL };
+    const char *diag[]    = { nullptr, "first", "second", "none", nullptr };
     enum                    {
         erSel, erNo, erBlue, erRed, erNR
     };
-    const char *rainbow[] = { NULL, "no", "blue", "red", NULL };
+    const char *rainbow[] = { nullptr, "no", "blue", "red", nullptr };
     /* MUST correspond to enum ecXxx as defined at top of file */
     const char *combine[] = {
-        NULL, "halves", "add", "sub", "mult", "div", NULL
+        nullptr, "halves", "add", "sub", "mult", "div", nullptr
     };
     static int  skip = 1, mapoffset = 0;
     t_pargs     pa[] = {
@@ -1489,18 +1498,18 @@ int gmx_xpm2ps(int argc, char *argv[])
     };
 #define NPA asize(pa)
     t_filenm    fnm[] = {
-        { efXPM, "-f",  NULL,      ffREAD },
+        { efXPM, "-f",  nullptr,      ffREAD },
         { efXPM, "-f2", "root2",   ffOPTRD },
-        { efM2P, "-di", NULL,      ffLIBOPTRD },
+        { efM2P, "-di", nullptr,      ffLIBOPTRD },
         { efM2P, "-do", "out",     ffOPTWR },
-        { efEPS, "-o",  NULL,      ffOPTWR },
-        { efXPM, "-xpm", NULL,      ffOPTWR }
+        { efEPS, "-o",  nullptr,      ffOPTWR },
+        { efXPM, "-xpm", nullptr,      ffOPTWR }
     };
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW,
                            NFILE, fnm, NPA, pa,
-                           asize(desc), desc, 0, NULL, &oenv))
+                           asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -1526,7 +1535,7 @@ int gmx_xpm2ps(int argc, char *argv[])
 
     epsfile = ftp2fn_null(efEPS, NFILE, fnm);
     xpmfile = opt2fn_null("-xpm", NFILE, fnm);
-    if (epsfile == NULL && xpmfile == NULL)
+    if (epsfile == nullptr && xpmfile == nullptr)
     {
         if (ecombine != ecHalves)
         {
@@ -1543,7 +1552,7 @@ int gmx_xpm2ps(int argc, char *argv[])
                 "WARNING: can only write result of arithmetic combination "
                 "of two matrices to .xpm file\n"
                 "         file %s will not be written\n", epsfile);
-        epsfile = NULL;
+        epsfile = nullptr;
     }
 
     bDiag      = ediag != edNone;
@@ -1605,7 +1614,7 @@ int gmx_xpm2ps(int argc, char *argv[])
         }
     }
 
-    if ((mat2 == NULL) && (elegend != elNone))
+    if ((mat2 == nullptr) && (elegend != elNone))
     {
         elegend = elFirst;
     }
@@ -1613,8 +1622,8 @@ int gmx_xpm2ps(int argc, char *argv[])
     if (ecombine && ecombine != ecHalves)
     {
         write_combined_matrix(ecombine, xpmfile, nmat, mat, mat2,
-                              opt2parg_bSet("-cmin", NPA, pa) ? &cmin : NULL,
-                              opt2parg_bSet("-cmax", NPA, pa) ? &cmax : NULL);
+                              opt2parg_bSet("-cmin", NPA, pa) ? &cmin : nullptr,
+                              opt2parg_bSet("-cmax", NPA, pa) ? &cmax : nullptr);
     }
     else
     {
index 2d09699aee67f60879ef9617ac4d4c7b6b86bcf6..497281d13b6f21030fd99832d22f60cfe1d917b5 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,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.
@@ -200,7 +200,7 @@ real ca_phi(int gnx, int index[], rvec x[])
         ak  = index[i+2];
         al  = index[i+3];
         phi = RAD2DEG*
-            dih_angle(x[ai], x[aj], x[ak], x[al], NULL,
+            dih_angle(x[ai], x[aj], x[ak], x[al], nullptr,
                       r_ij, r_kj, r_kl, m, n,
                       &sign, &t1, &t2, &t3);
         phitot += phi;
@@ -513,11 +513,11 @@ void calc_hxprops(int nres, t_bb bb[], const rvec x[])
         }
 
         bb[i].phi = RAD2DEG*
-            dih_angle(x[bb[i].Cprev], x[bb[i].N], x[bb[i].CA], x[bb[i].C], NULL,
+            dih_angle(x[bb[i].Cprev], x[bb[i].N], x[bb[i].CA], x[bb[i].C], nullptr,
                       r_ij, r_kj, r_kl, m, n,
                       &sign, &t1, &t2, &t3);
         bb[i].psi = RAD2DEG*
-            dih_angle(x[bb[i].N], x[bb[i].CA], x[bb[i].C], x[bb[i].Nnext], NULL,
+            dih_angle(x[bb[i].N], x[bb[i].CA], x[bb[i].C], x[bb[i].Nnext], nullptr,
                       r_ij, r_kj, r_kl, m, n,
                       &sign, &t1, &t2, &t3);
         bb[i].pprms2 = gmx::square(bb[i].phi-PHI_AHX)+gmx::square(bb[i].psi-PSI_AHX);
index b909f345fd7b21b4693e998e1a3193c56d169662..435604be743dfde8cbcd4ad84d331a4240b5c0b0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,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.
@@ -43,7 +43,7 @@ typedef struct {
     real t; /* Interface thickness */
 } t_interf;
 
-static void init_interf(t_interf *surf)
+static inline void init_interf(t_interf *surf)
 {
     surf->Z = 0;
     surf->t = 0;
index 5b58fdd8d9aed72a82d84c2a798b04b19ba2a743..7a95fe66a471ced5f9ddd6b15edb4a61e3d79743 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,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.
@@ -41,6 +41,8 @@
 #include <cstdlib>
 #include <cstring>
 
+#include <algorithm>
+
 #include "gromacs/listed-forces/bonded.h"
 #include "gromacs/pbcutil/rmpbc.h"
 #include "gromacs/utility/cstringutil.h"
 static const char *pp_pat[] = { "C", "N", "CA", "C", "N" };
 #define NPP (sizeof(pp_pat)/sizeof(pp_pat[0]))
 
-static int d_comp(const void *a, const void *b)
+static bool d_comp(const t_dih &a, const t_dih &b)
 {
-    t_dih *da, *db;
-
-    da = (t_dih *)a;
-    db = (t_dih *)b;
-
-    if (da->ai[1] < db->ai[1])
+    if (a.ai[1] < b.ai[1])
     {
-        return -1;
+        return true;
     }
-    else if (da->ai[1] == db->ai[1])
+    else if (a.ai[1] == b.ai[1])
     {
-        return (da->ai[2] - db->ai[2]);
+        return a.ai[2] < b.ai[2];
     }
     else
     {
-        return 1;
+        return false;
     }
 }
 
@@ -79,7 +76,7 @@ static void calc_dihs(t_xrama *xr)
     rvec         r_ij, r_kj, r_kl, m, n;
     real         sign;
     t_dih       *dd;
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
 
     gpbc = gmx_rmpbc_init(xr->idef, xr->ePBC, xr->natoms);
     gmx_rmpbc(gpbc, xr->natoms, xr->box, xr->x);
@@ -90,7 +87,7 @@ static void calc_dihs(t_xrama *xr)
         dd      = &(xr->dih[i]);
         dd->ang = dih_angle(xr->x[dd->ai[0]], xr->x[dd->ai[1]],
                             xr->x[dd->ai[2]], xr->x[dd->ai[3]],
-                            NULL,
+                            nullptr,
                             r_ij, r_kj, r_kl, m, n, &sign, &t1, &t2, &t3);
     }
 }
@@ -217,8 +214,8 @@ static void get_dih_props(t_xrama *xr, const t_idef *idef, int mult)
 
         key.ai[1] = ia[2];
         key.ai[2] = ia[3];
-        if ((dd = (t_dih *)bsearch(&key, xr->dih, xr->ndih, (size_t)sizeof(key), d_comp))
-            != NULL)
+        dd        = std::lower_bound(xr->dih, xr->dih+xr->ndih, key, d_comp);
+        if (dd < xr->dih+xr->ndih && !d_comp(key, *dd))
         {
             dd->mult = idef->iparams[ft].pdihs.mult;
             dd->phi0 = idef->iparams[ft].pdihs.phiA;
index dd9a9ab8f380153c9892d2e8af0bfb4034e4f121..d05c9b616212e6f0d12a948c477bd41618f54e79 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,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.
@@ -148,12 +148,12 @@ gmx_neutron_atomic_structurefactors_t *gmx_neutronstructurefactors_init(const ch
 
     fclose(fp);
 
-    return (gmx_neutron_atomic_structurefactors_t *) gnsf;
+    return gnsf;
 }
 
 gmx_sans_t *gmx_sans_init (const t_topology *top, gmx_neutron_atomic_structurefactors_t *gnsf)
 {
-    gmx_sans_t    *gsans = NULL;
+    gmx_sans_t    *gsans = nullptr;
     int            i, j;
     /* Try to assing scattering length from nsfactor.dat */
     snew(gsans, 1);
@@ -186,7 +186,7 @@ gmx_sans_t *gmx_sans_init (const t_topology *top, gmx_neutron_atomic_structurefa
         }
     }
 
-    return (gmx_sans_t *) gsans;
+    return gsans;
 }
 
 gmx_radial_distribution_histogram_t *calc_radial_distribution_histogram (
@@ -201,7 +201,7 @@ gmx_radial_distribution_histogram_t *calc_radial_distribution_histogram (
         real         mcover,
         unsigned int seed)
 {
-    gmx_radial_distribution_histogram_t    *pr = NULL;
+    gmx_radial_distribution_histogram_t    *pr = nullptr;
     rvec                                    dist;
     double                                  rmax;
     int                                     i, j;
@@ -209,7 +209,7 @@ gmx_radial_distribution_histogram_t *calc_radial_distribution_histogram (
     double                                **tgr;
     int                                     tid;
     int                                     nthreads;
-    gmx::DefaultRandomEngine               *trng = NULL;
+    gmx::DefaultRandomEngine               *trng = nullptr;
 #endif
     gmx_int64_t                             mc  = 0, mc_max;
     gmx::DefaultRandomEngine                rng(seed);
@@ -364,12 +364,12 @@ gmx_radial_distribution_histogram_t *calc_radial_distribution_histogram (
         pr->r[i] = (pr->binwidth*i+pr->binwidth*0.5);
     }
 
-    return (gmx_radial_distribution_histogram_t *) pr;
+    return pr;
 }
 
 gmx_static_structurefactor_t *convert_histogram_to_intensity_curve (gmx_radial_distribution_histogram_t *pr, double start_q, double end_q, double q_step)
 {
-    gmx_static_structurefactor_t    *sq = NULL;
+    gmx_static_structurefactor_t    *sq = nullptr;
     int         i, j;
     /* init data */
     snew(sq, 1);
@@ -405,5 +405,5 @@ gmx_static_structurefactor_t *convert_histogram_to_intensity_curve (gmx_radial_d
         }
     }
 
-    return (gmx_static_structurefactor_t *) sq;
+    return sq;
 }
index dab595201643f3d2f8494c674b9893e35991c3be..442003ecdfd87bc54626881f2e27ef7362a52366 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,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.
@@ -44,7 +44,7 @@
 #include "gromacs/utility/real.h"
 #include "gromacs/utility/smalloc.h"
 
-void addtoavgenergy(t_complex *list, real *result, int size, int tsteps)
+static void addtoavgenergy(t_complex *list, real *result, int size, int tsteps)
 {
     int i;
     for (i = 0; i < size; i++)
index 7972fe364b297f749f150ada1f1283b2e89c2f08..e7da5b98efa0364983fa4bd67ef7e2ca7409065d 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,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.
@@ -306,10 +306,10 @@ void orient_princ(const t_atoms *atoms, int isize, const int *index,
             trans[ZZ][m] = -trans[ZZ][m];
         }
     }
-    rotate_atoms(natoms, NULL, x, trans);
+    rotate_atoms(natoms, nullptr, x, trans);
     if (v)
     {
-        rotate_atoms(natoms, NULL, v, trans);
+        rotate_atoms(natoms, nullptr, v, trans);
     }
 
     for (i = 0; i < natoms; i++)
index f7d5c314d3df681f2851be33e3212cbb770c9934..c0f7e44ee0f8229c81367fafb3fb2327230556ae 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,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.
@@ -282,7 +282,7 @@ extern gmx_structurefactors_t *gmx_structurefactors_init(const char *datfn)
     snew(gsf->b, nralloc);
     snew(gsf->c, nralloc);
     snew(gsf->p, nralloc);
-    gsf->n       = NULL;
+    gsf->n       = nullptr;
     gsf->nratoms = line_no;
     while (get_a_line(fp, line, STRLEN))
     {
@@ -475,7 +475,7 @@ extern int do_scattering_intensity (const char* fnTPS, const char* fnNDX,
     sf->energy = energy;
 
     /* Read the topology informations */
-    read_tps_conf (fnTPS, &top, &ePBC, &xtop, NULL, box, TRUE);
+    read_tps_conf (fnTPS, &top, &ePBC, &xtop, nullptr, box, TRUE);
     sfree (xtop);
 
     /* groups stuff... */
similarity index 85%
rename from src/gromacs/gmxana/legacytests/CMakeLists.txt
rename to src/gromacs/gmxana/tests/CMakeLists.txt
index af7a8080babb424ed4761fab9c4ca95f2cee4d02..4ff714b24d79a3337de7dda454584dc10731452f 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,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.
 # To help us fund GROMACS development, we humbly ask that you cite
 # the research papers on the package. Check out http://www.gromacs.org.
 
-set(testname "LegacyToolsTests")
-set(exename "legacy-tools-test")
+set(exename gmxana-test)
 
 gmx_add_gtest_executable(
     ${exename}
-    # files with code for test fixtures
-    gmx_traj_tests.cpp
-    )
-gmx_register_integration_test(
-    ${testname}
-    ${exename}
+    gmx_traj.cpp
+    gmx_trjconv.cpp
     )
+gmx_register_gtest_test(GmxAnaTest ${exename} INTEGRATION_TEST)
diff --git a/src/gromacs/gmxana/tests/gmx_traj.cpp b/src/gromacs/gmxana/tests/gmx_traj.cpp
new file mode 100644 (file)
index 0000000..4163bfa
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2013,2014,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.
+ */
+/*! \internal \file
+ * \brief
+ * Tests for gmx traj.
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ */
+#include "gmxpre.h"
+
+#include "config.h"
+
+#include "gromacs/gmxana/gmx_ana.h"
+
+#include "testutils/cmdlinetest.h"
+#include "testutils/stdiohelper.h"
+#include "testutils/textblockmatchers.h"
+
+namespace
+{
+
+class GmxTraj : public gmx::test::CommandLineTestBase,
+                public ::testing::WithParamInterface<const char *>
+{
+    public:
+        void runTest(const char *fileName)
+        {
+            auto &cmdline = commandLine();
+            cmdline.append("traj");
+            setInputFile("-s", "spc2.gro");
+            setInputFile("-f", fileName);
+            setOutputFile("-ox", "spc2.xvg", gmx::test::NoTextMatch());
+
+            gmx::test::StdioTestHelper stdioHelper(&fileManager());
+            stdioHelper.redirectStringToStdin("0\n");
+
+            ASSERT_EQ(0, gmx_traj(cmdline.argc(), cmdline.argv()));
+        }
+};
+
+/* TODO These tests are actually not very effective, because gmx-traj
+ * can only return 0 or exit via gmx_fatal() (which currently also
+ * exits the test binary). So, "no XDR/TNG support in the binary"
+ * leads to the reading test appearing to pass. Still, no fatal error
+ * and no segfault is useful information while modifying such code. */
+
+TEST_P(GmxTraj, WithDifferentInputFormats)
+{
+    runTest(GetParam());
+}
+
+/*! \brief Helper array of input files present in the source repo
+ * database. These all have two identical frames of two SPC water
+ * molecules, which were generated via trjconv from the .gro
+ * version. */
+const char *const trajectoryFileNames[] = {
+    "spc2-traj.trr",
+#if GMX_USE_TNG
+    "spc2-traj.tng",
+#endif
+    "spc2-traj.xtc",
+    "spc2-traj.gro",
+    "spc2-traj.pdb",
+    "spc2-traj.g96"
+};
+
+INSTANTIATE_TEST_CASE_P(NoFatalErrorWhenWritingFrom,
+                        GmxTraj, ::testing::ValuesIn(trajectoryFileNames));
+
+} // namespace
similarity index 54%
rename from src/gromacs/gmxana/legacytests/gmx_traj_tests.cpp
rename to src/gromacs/gmxana/tests/gmx_trjconv.cpp
index 820ba06471a4b5240145e1de0f9a584bff3e3546..eccd8ccaa47a6dea7a777e89ad45b187f6c19787 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,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.
  */
 /*! \internal \file
  * \brief
- * Tests for gmx traj
+ * Tests for gmx trjconv.
  *
  * \author Mark Abraham <mark.j.abraham@gmail.com>
  */
-
 #include "gmxpre.h"
 
 #include "config.h"
 
 #include "gromacs/gmxana/gmx_ana.h"
-#include "gromacs/utility/arrayref.h"
 
 #include "testutils/cmdlinetest.h"
-#include "testutils/integrationtests.h"
+#include "testutils/stdiohelper.h"
+#include "testutils/textblockmatchers.h"
 
 namespace
 {
 
-class GmxTraj : public gmx::test::IntegrationTestFixture,
-                public ::testing::WithParamInterface<const char *>
-{
-    public:
-        GmxTraj() : groFileName(fileManager_.getInputFilePath("spc2.gro")),
-                    xvgFileName(fileManager_.getTemporaryFilePath("spc2.xvg"))
-        {
-        }
-
-        int runTest(const char *fileName)
-        {
-            gmx::test::CommandLine caller;
-            caller.append("traj");
-
-            caller.addOption("-s",  groFileName);
-            caller.addOption("-ox", xvgFileName);
-
-            std::string inputTrajectoryFileName = fileManager_.getInputFilePath(fileName);
-            caller.addOption("-f", inputTrajectoryFileName);
-
-            redirectStringToStdin("0\n");
-
-            return gmx_traj(caller.argc(), caller.argv());
-        }
-
-        std::string groFileName;
-        std::string xvgFileName;
-};
-
-/* TODO These tests are actually not very effective, because gmx-traj
- * can only return 0 or exit via gmx_fatal() (which currently also
- * exits the test binary). So, "no XDR/TNG support in the binary"
- * leads to the reading test appearing to pass. Still, no fatal error
- * and no segfault is useful information while modifying such code. */
-
-TEST_P(GmxTraj, WithDifferentInputFormats)
-{
-    runTest(GetParam());
-}
-
-// ==
-
-class TrjconvWithIndexGroupSubset : public gmx::test::IntegrationTestFixture,
+class TrjconvWithIndexGroupSubset : public gmx::test::CommandLineTestBase,
                                     public ::testing::WithParamInterface<const char *>
 {
     public:
-        int runTest(const char *fileName)
+        void runTest(const char *fileName)
         {
-            gmx::test::CommandLine caller;
-            caller.append("trjconv");
+            auto &cmdline = commandLine();
+            cmdline.append("trjconv");
 
-            caller.addOption("-s", fileManager_.getInputFilePath("spc2.gro"));
+            setInputFile("-s", "spc2.gro");
+            setInputFile("-f", fileName);
+            setInputFile("-n", "spc2.ndx");
+            setOutputFile("-o", "spc-traj.tng", gmx::test::NoTextMatch());
 
-            std::string inputTrajectoryFileName = fileManager_.getInputFilePath(fileName);
-            caller.addOption("-f", inputTrajectoryFileName);
-
-            std::string ndxFileName = fileManager_.getInputFilePath("spc2.ndx");
-            caller.addOption("-n", ndxFileName);
-
-            caller.addOption("-o", fileManager_.getTemporaryFilePath("spc-traj.tng"));
-
-            redirectStringToStdin("SecondWaterMolecule\n");
+            gmx::test::StdioTestHelper stdioHelper(&fileManager());
+            stdioHelper.redirectStringToStdin("SecondWaterMolecule\n");
 
             /* TODO Ideally, we would then check that the output file
                has only 3 of the 6 atoms (which it does), but the
                infrastructure for doing that automatically is still
                being built. This would also fix the TODO below. */
-            return gmx_trjconv(caller.argc(), caller.argv());
+            ASSERT_EQ(0, gmx_trjconv(cmdline.argc(), cmdline.argv()));
         }
 };
 /* TODO These tests are actually not very effective, because trjconv
@@ -133,13 +86,11 @@ TEST_P(TrjconvWithIndexGroupSubset, WithDifferentInputFormats)
     runTest(GetParam());
 }
 
-// ==
-
 /*! \brief Helper array of input files present in the source repo
  * database. These all have two identical frames of two SPC water
  * molecules, which were generated via trjconv from the .gro
  * version. */
-const char *trajectoryFileNames[] = {
+const char *const trajectoryFileNames[] = {
     "spc2-traj.trr",
 #if GMX_USE_TNG
     "spc2-traj.tng",
@@ -150,16 +101,8 @@ const char *trajectoryFileNames[] = {
     "spc2-traj.g96"
 };
 
-#ifdef __INTEL_COMPILER
-#pragma warning( disable : 177 )
-#endif
-
-INSTANTIATE_TEST_CASE_P(NoFatalErrorWhenWritingFrom,
-                        GmxTraj,
-                            ::testing::ValuesIn(gmx::ArrayRef<const char*>(trajectoryFileNames)));
-
 INSTANTIATE_TEST_CASE_P(NoFatalErrorWhenWritingFrom,
                         TrjconvWithIndexGroupSubset,
-                            ::testing::ValuesIn(gmx::ArrayRef<const char*>(trajectoryFileNames)));
+                            ::testing::ValuesIn(trajectoryFileNames));
 
 } // namespace
index 2a2cf40dd5097463dd186c20fe39853bd6baa84b..a68e54d0a5e6492a72997530a684f38dae84744e 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,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.
@@ -69,6 +69,10 @@ void gmx_fill_commrec_from_mpi(t_commrec gmx_unused *cr)
 
     cr->nnodes           = gmx_node_num();
     cr->nodeid           = gmx_node_rank();
+    if (PAR(cr) || MULTISIM(cr))
+    {
+        MPI_Comm_split(MPI_COMM_WORLD, gmx_physicalnode_id_hash(), cr->nodeid, &cr->mpi_comm_physicalnode);
+    }
     cr->sim_nodeid       = cr->nodeid;
     cr->mpi_comm_mysim   = MPI_COMM_WORLD;
     cr->mpi_comm_mygroup = MPI_COMM_WORLD;
@@ -85,8 +89,8 @@ t_commrec *init_commrec()
 #if GMX_LIB_MPI
     gmx_fill_commrec_from_mpi(cr);
 #else
-    cr->mpi_comm_mysim   = NULL;
-    cr->mpi_comm_mygroup = NULL;
+    cr->mpi_comm_mysim   = nullptr;
+    cr->mpi_comm_mygroup = nullptr;
     cr->nnodes           = 1;
     cr->sim_nodeid       = 0;
     cr->nodeid           = cr->sim_nodeid;
@@ -111,6 +115,40 @@ t_commrec *init_commrec()
     return cr;
 }
 
+static void done_mpi_in_place_buf(mpi_in_place_buf_t *buf)
+{
+    if (nullptr != buf)
+    {
+        sfree(buf->ibuf);
+        sfree(buf->libuf);
+        sfree(buf->fbuf);
+        sfree(buf->dbuf);
+        sfree(buf);
+    }
+}
+
+void done_commrec(t_commrec *cr)
+{
+#if GMX_MPI
+    if (PAR(cr) || MULTISIM(cr))
+    {
+        MPI_Comm_free(&cr->mpi_comm_physicalnode);
+    }
+#endif
+    if (nullptr != cr->dd)
+    {
+        // 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)
 {
 #if GMX_THREAD_MPI
@@ -130,7 +168,7 @@ t_commrec *reinitialize_commrec_for_this_thread(const t_commrec gmx_unused *cro)
 
     return cr;
 #else
-    return NULL;
+    return nullptr;
 #endif
 }
 
@@ -191,7 +229,7 @@ void gmx_setup_nodecomm(FILE gmx_unused *fplog, t_commrec *cr)
                 ng, ni);
     }
 
-    if (getenv("GMX_NO_NODECOMM") == NULL &&
+    if (getenv("GMX_NO_NODECOMM") == nullptr &&
         ((ng > 1 && ng < n) || (ni > 1 && ni < n)))
     {
         nc->bUse = TRUE;
@@ -319,6 +357,15 @@ void gmx_barrier(const t_commrec gmx_unused *cr)
 #endif
 }
 
+void gmx_barrier_physical_node(const t_commrec gmx_unused *cr)
+{
+#if !GMX_MPI
+    gmx_call("gmx_barrier_physical_node");
+#else
+    MPI_Barrier(cr->mpi_comm_physicalnode);
+#endif
+}
+
 void gmx_bcast(int gmx_unused nbytes, void gmx_unused *b, const t_commrec gmx_unused *cr)
 {
 #if !GMX_MPI
@@ -358,7 +405,7 @@ void gmx_sumd(int gmx_unused nr, double gmx_unused r[], const t_commrec gmx_unus
         {
             /* This is here because of the silly MPI specification
                 that MPI_IN_PLACE should be put in sendbuf instead of recvbuf */
-            MPI_Reduce(r, NULL, nr, MPI_DOUBLE, MPI_SUM, 0, cr->nc.comm_intra);
+            MPI_Reduce(r, nullptr, nr, MPI_DOUBLE, MPI_SUM, 0, cr->nc.comm_intra);
         }
         MPI_Bcast(r, nr, MPI_DOUBLE, 0, cr->nc.comm_intra);
     }
@@ -421,7 +468,7 @@ void gmx_sumf(int gmx_unused nr, float gmx_unused r[], const t_commrec gmx_unuse
         {
             /* This is here because of the silly MPI specification
                 that MPI_IN_PLACE should be put in sendbuf instead of recvbuf */
-            MPI_Reduce(r, NULL, nr, MPI_FLOAT, MPI_SUM, 0, cr->nc.comm_intra);
+            MPI_Reduce(r, nullptr, nr, MPI_FLOAT, MPI_SUM, 0, cr->nc.comm_intra);
         }
         MPI_Bcast(r, nr, MPI_FLOAT, 0, cr->nc.comm_intra);
     }
@@ -481,7 +528,7 @@ void gmx_sumi(int gmx_unused nr, int gmx_unused r[], const t_commrec gmx_unused
         {
             /* This is here because of the silly MPI specification
                 that MPI_IN_PLACE should be put in sendbuf instead of recvbuf */
-            MPI_Reduce(r, NULL, nr, MPI_INT, MPI_SUM, 0, cr->nc.comm_intra);
+            MPI_Reduce(r, nullptr, nr, MPI_INT, MPI_SUM, 0, cr->nc.comm_intra);
         }
         MPI_Bcast(r, nr, MPI_INT, 0, cr->nc.comm_intra);
     }
@@ -541,7 +588,7 @@ void gmx_sumli(int gmx_unused nr, gmx_int64_t gmx_unused r[], const t_commrec gm
         {
             /* This is here because of the silly MPI specification
                 that MPI_IN_PLACE should be put in sendbuf instead of recvbuf */
-            MPI_Reduce(r, NULL, nr, MPI_INT64_T, MPI_SUM, 0, cr->nc.comm_intra);
+            MPI_Reduce(r, nullptr, nr, MPI_INT64_T, MPI_SUM, 0, cr->nc.comm_intra);
         }
         MPI_Bcast(r, nr, MPI_INT64_T, 0, cr->nc.comm_intra);
     }
@@ -704,7 +751,7 @@ void gmx_sumli_sim(int gmx_unused nr, gmx_int64_t gmx_unused r[], const gmx_mult
 const char *opt2fn_master(const char *opt, int nfile, const t_filenm fnm[],
                           t_commrec *cr)
 {
-    return SIMMASTER(cr) ? opt2fn(opt, nfile, fnm) : NULL;
+    return SIMMASTER(cr) ? opt2fn(opt, nfile, fnm) : nullptr;
 }
 
 void gmx_fatal_collective(int f_errno, const char *file, int line,
@@ -720,6 +767,7 @@ void gmx_fatal_collective(int f_errno, const char *file, int line,
     /* Any result except MPI_UNEQUAL allows us to call MPI_Finalize */
     bFinalize = (result != MPI_UNEQUAL);
 #else
+    GMX_UNUSED_VALUE(comm);
     bFinalize = TRUE;
 #endif
 
index f362475c511618f922d8f511da71aab39c60a57d..3297dc8d63eeef5d8b17a9c13b938a850edbe80e 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,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.
@@ -53,6 +53,9 @@ struct t_filenm;
 struct t_commrec *init_commrec(void);
 /* Allocate, initialize and return the commrec. */
 
+void done_commrec(struct t_commrec *cr);
+/* Free memory associated with the commrec. */
+
 struct t_commrec *reinitialize_commrec_for_this_thread(const struct t_commrec *cro);
 /* Initialize communication records for thread-parallel simulations.
    Must be called on all threads before any communication takes place by
@@ -72,6 +75,9 @@ void gmx_init_intranode_counters(struct t_commrec *cr);
 void gmx_barrier(const struct t_commrec *cr);
 /* Wait till all processes in cr->mpi_comm_mygroup have reached the barrier */
 
+void gmx_barrier_physical_node(const struct t_commrec *cr);
+/* Wait till all processes in cr->mpi_comm_physical_node have reached the barrier */
+
 void gmx_bcast(int nbytes, void *b, const struct t_commrec *cr);
 /* Broadcast nbytes bytes from the master to cr->mpi_comm_mygroup */
 
index 841e2f0112b465ceec3c98d3c6078137f8a4f618..f588792ad56e43c7550ebb64e27518d1ec8c17ba 100644 (file)
 # Sources that should always be built
 file(GLOB NONBONDED_SOURCES *.cpp nb_kernel_c/*.c)
 
-if("${GMX_SIMD}" STREQUAL "SSE2" AND NOT GMX_DOUBLE)
+if("${GMX_SIMD_ACTIVE}" STREQUAL "SSE2" AND NOT GMX_DOUBLE)
     file(GLOB NONBONDED_SSE2_SINGLE_SOURCES nb_kernel_sse2_single/*.c)
 endif()
 
-if("${GMX_SIMD}" STREQUAL "SSE4.1" AND NOT GMX_DOUBLE)
+if("${GMX_SIMD_ACTIVE}" STREQUAL "SSE4.1" AND NOT GMX_DOUBLE)
     file(GLOB NONBONDED_SSE4_1_SINGLE_SOURCES nb_kernel_sse4_1_single/*.c)
 endif()
 
-if("${GMX_SIMD}" STREQUAL "AVX_128_FMA" AND NOT GMX_DOUBLE)
+if("${GMX_SIMD_ACTIVE}" STREQUAL "AVX_128_FMA" AND NOT GMX_DOUBLE)
     file(GLOB NONBONDED_AVX_128_FMA_SINGLE_SOURCES nb_kernel_avx_128_fma_single/*.c)
 endif()
 
-if((("${GMX_SIMD}" STREQUAL "AVX_256")
-            OR ("${GMX_SIMD}" STREQUAL "AVX2_256")
-            OR ("${GMX_SIMD}" STREQUAL "AVX_512")
-            OR ("${GMX_SIMD}" STREQUAL "AVX_512_KNL"))
+if((("${GMX_SIMD_ACTIVE}" STREQUAL "AVX_256")
+    OR ("${GMX_SIMD_ACTIVE}" STREQUAL "AVX2_256")
+    OR ("${GMX_SIMD_ACTIVE}" STREQUAL "AVX_512")
+    OR ("${GMX_SIMD_ACTIVE}" STREQUAL "AVX_512_KNL"))
         AND NOT GMX_DOUBLE)
     file(GLOB NONBONDED_AVX_256_SINGLE_SOURCES nb_kernel_avx_256_single/*.c)
 endif()
 
-if("${GMX_SIMD}" STREQUAL "SSE2" AND GMX_DOUBLE)
+if("${GMX_SIMD_ACTIVE}" STREQUAL "SSE2" AND GMX_DOUBLE)
     file(GLOB NONBONDED_SSE2_DOUBLE_SOURCES nb_kernel_sse2_double/*.c)
 endif()
 
-if("${GMX_SIMD}" STREQUAL "SSE4.1" AND GMX_DOUBLE)
+if("${GMX_SIMD_ACTIVE}" STREQUAL "SSE4.1" AND GMX_DOUBLE)
     file(GLOB NONBONDED_SSE4_1_DOUBLE_SOURCES nb_kernel_sse4_1_double/*.c)
 endif()
 
-if("${GMX_SIMD}" STREQUAL "AVX_128_FMA" AND GMX_DOUBLE)
+if("${GMX_SIMD_ACTIVE}" STREQUAL "AVX_128_FMA" AND GMX_DOUBLE)
     file(GLOB NONBONDED_AVX_128_FMA_DOUBLE_SOURCES nb_kernel_avx_128_fma_double/*.c)
 endif()
 
-if((("${GMX_SIMD}" STREQUAL "AVX_256")
-            OR ("${GMX_SIMD}" STREQUAL "AVX2_256")
-            OR ("${GMX_SIMD}" STREQUAL "AVX_512")
-            OR ("${GMX_SIMD}" STREQUAL "AVX_512_KNL"))
+if((("${GMX_SIMD_ACTIVE}" STREQUAL "AVX_256")
+            OR ("${GMX_SIMD_ACTIVE}" STREQUAL "AVX2_256")
+            OR ("${GMX_SIMD_ACTIVE}" STREQUAL "AVX_512")
+            OR ("${GMX_SIMD_ACTIVE}" STREQUAL "AVX_512_KNL"))
         AND GMX_DOUBLE)
     file(GLOB NONBONDED_AVX_256_DOUBLE_SOURCES nb_kernel_avx_256_double/*.c)
 endif()
 
-if("${GMX_SIMD}" STREQUAL "SPARC64_HPC_ACE" AND GMX_DOUBLE)
+if("${GMX_SIMD_ACTIVE}" STREQUAL "SPARC64_HPC_ACE" AND GMX_DOUBLE)
     file(GLOB NONBONDED_SPARC64_HPC_ACE_DOUBLE_SOURCES nb_kernel_sparc64_hpc_ace_double/*.c)
 endif()
 
index 97d1e7e0811f6b9fd95212f3434a59fb9ca6766e..db50f9b3c5bd3c60acb35fe3cdc0ab56b17aa239 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,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.
@@ -99,7 +99,7 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
     const real *  shiftvec;
     real *        fshift;
     real          tabscale = 0;
-    const real *  VFtab    = NULL;
+    const real *  VFtab    = nullptr;
     const real *  x;
     real *        f;
     real          facel, krf, crf;
@@ -436,7 +436,7 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
             tj[STATE_A]      = ntiA+2*typeA[jnr];
             tj[STATE_B]      = ntiB+2*typeB[jnr];
 
-            if (nlist->excl_fep == NULL || nlist->excl_fep[k])
+            if (nlist->excl_fep == nullptr || nlist->excl_fep[k])
             {
                 c6[STATE_A]      = nbfp[tj[STATE_A]];
                 c6[STATE_B]      = nbfp[tj[STATE_B]];
index ffcfe5549985f5e89b216778dfcef86c1c141352..70244a9f684c1519a1abfdf3c71b5464f308ee28 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, by the GROMACS development team, led by
+ * 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.
@@ -117,7 +117,7 @@ gmx_nb_generic_kernel(t_nblist *                nlist,
     else
     {
         tabscale        = 0;
-        VFtab           = NULL;
+        VFtab           = nullptr;
     }
     ewtab               = fr->ic->tabq_coul_FDV0;
     ewtabscale          = fr->ic->tabq_scale;
index b93f586136ab0f413cc8cbb3c0dba6adfdb10140..9bddb02823cead9390815da173e20b7c8a015116 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,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.
@@ -108,7 +108,7 @@ gmx_nb_generic_cg_kernel(t_nblist *                nlist,
     else
     {
         tabscale        = 0;
-        VFtab           = NULL;
+        VFtab           = nullptr;
     }
 
     /* avoid compiler warnings for cases that cannot happen */
index 073711d2957a23cc7bf0fcb0685fab0b7fd40c46..77e36fed1be7c4510805df34c0fb31b0828c85a6 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,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.
@@ -45,9 +45,9 @@
 
 
 /* Static data structures to find kernels */
-static nb_kernel_info_t *   kernel_list           = NULL;
+static nb_kernel_info_t *   kernel_list           = nullptr;
 static unsigned int         kernel_list_size      = 0;
-static int *                kernel_list_hash      = NULL;
+static int *                kernel_list_hash      = nullptr;
 static unsigned int         kernel_list_hash_size = 0;
 
 static unsigned int
@@ -119,15 +119,6 @@ nb_kernel_list_hash_init(void)
     return 0;
 }
 
-void
-nb_kernel_list_hash_destroy()
-{
-    sfree(kernel_list_hash);
-    kernel_list_hash      = NULL;
-    kernel_list_hash_size = 0;
-}
-
-
 nb_kernel_t *
 nb_kernel_list_findkernel(FILE gmx_unused *   log,
                           const char *        arch,
@@ -145,7 +136,7 @@ nb_kernel_list_findkernel(FILE gmx_unused *   log,
 
     if (kernel_list_hash_size == 0)
     {
-        return NULL;
+        return nullptr;
     }
 
     index = nb_kernel_hash_func(arch,
@@ -157,7 +148,7 @@ nb_kernel_list_findkernel(FILE gmx_unused *   log,
                                 other,
                                 vf) % kernel_list_hash_size;
 
-    kernelinfo_ptr = NULL;
+    kernelinfo_ptr = nullptr;
     while ( (i = kernel_list_hash[index]) != -1)
     {
         if (!gmx_strcasecmp_min(kernel_list[i].architecture, arch) &&
@@ -175,7 +166,7 @@ nb_kernel_list_findkernel(FILE gmx_unused *   log,
         index = (index+1) % kernel_list_hash_size;
     }
 
-    if (debug && kernelinfo_ptr != NULL)
+    if (debug && kernelinfo_ptr != nullptr)
     {
         fprintf(debug,
                 "NB kernel %s() with architecture '%s' used for neighborlist with\n"
@@ -187,5 +178,5 @@ nb_kernel_list_findkernel(FILE gmx_unused *   log,
     }
 
     /* If we did not find any kernel the pointer will still be NULL */
-    return (kernelinfo_ptr != NULL) ? kernelinfo_ptr->kernelptr : NULL;
+    return (kernelinfo_ptr != nullptr) ? kernelinfo_ptr->kernelptr : nullptr;
 }
index ff7f2e46c415ffeba322fc33aa9290724f3bb17a..11f0f01ace08c2ad4a4cc8c278f0419e41d08094 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * 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.
@@ -79,7 +79,7 @@ typedef void
     nb_kernel_t (t_nblist *                nlist,
                  rvec *                    x,
                  rvec *                    f,
-                 t_forcerec *              fr,
+                 struct t_forcerec *       fr,
                  t_mdatoms *               mdatoms,
                  nb_kernel_data_t *        kernel_data,
                  t_nrnb *                  nrnb);
index f926dcc95ba6c48a15d50cc3a2cfd67ab1dfd1e6..6c87a80af01c96eb9ebf757fba1c6e6e834938b8 100755 (executable)
@@ -2,7 +2,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,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.
@@ -91,7 +91,7 @@ Arch       = 'avx_128_fma_double'
 # 'cutoff' means the interaction is set to 0.0 outside the cutoff
 #
 
-FileHeader = create_copyright_header('2012,2013,2014,2015')
+FileHeader = create_copyright_header('2012,2013,2014,2015,2017')
 FileHeader += """/*
  * Note: this file was generated by the GROMACS """+Arch+""" kernel generator.
  */
index 5b58bf2a7053f4a5508f5e0a0a6066928fdff14b..0e65e89c99b29535cb6c1b4f9b2462c88bc57ba6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -413,7 +413,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a640e8026309314e36f757d0bc5eb2e679d98794..92fbbaf1224a07b10a049b8c3c17e7384c16231b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -653,7 +653,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0ba9afb2aa1310bcf3d05c5b625d099d8239e811..8d2ae4dd338c9dd2d4d8ffadce7cd78b97aadeea 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1267,7 +1267,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 45c909c96cf2b9c7a2db4e35ce3c91bafca95c77..9e46466101ee22361e554d10e25657d9fcda56bd 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -735,7 +735,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1469c48330585e5a9b341c07c635dd9356acbfb8..fb86498f22d86b3d95a917da4c86c581e645452f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1355,7 +1355,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 89cb71e30e5b7070b55ef60feff29b57bd8c3c2a..fe34546856f525969abfcf65afc60f7ab9202c18 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -373,7 +373,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 083b6494bf0af15ae2c8e875adb4514532d4f5cb..d87961083161ae4a48717aeef45f351833894bd1 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -613,7 +613,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 054bc8aaead4ea74450ad906df545ec008440c9a..efffe1cf427881ec4b72967a8bff91fa5dacf5da 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1227,7 +1227,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 206285d891f6be1db5bd7a26b66de456fd251849..0aab8140633023ded0983d5d7b25d7fabcf1d063 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -667,7 +667,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5b4b4dc1d8f84cc9ee9c9cc6f9bb3fbb1b59d40c..88afde36ab4f1ad3c72389ec01621a9f1f2acd9c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1287,7 +1287,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 30533c0bbb2c3f552c82afffcafd4cac5752d8ea..86a8fca36052d0d60a5278b5ebbe1e9eb6185d34 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -332,7 +332,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index aa745e894a6a5981e0a940fc029f46b0660f507e..c811aaca84e434a6ecc2b826399f87863650f887 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -572,7 +572,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cb8a7e91ca9576f8e7441e7df527061a39cd8246..366031ecc6e7718c54f5754d1948607d4ed0ba45 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1189,7 +1189,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9aa26494bfce0f801c3c33e4bb901de067c63174..b12ba2f166d7a70a856321b60528e0a2a6b17c86 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -572,7 +572,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7692ff1e6a7cab45e9e393a04c50b34b52a41ea8..89d1e4c2713dbaf22b8d99e282df86b7e6fc3b87 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1189,7 +1189,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 774448079a5ed0d3fb81996f17785f1312d4f223..44b23225ee2512a0df065d8c0ba1fc63a67e97a3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -397,7 +397,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 29631c1d3e5fd2ff703cb90d7ff2a8bb6817fc47..f6b1b1853a4e9e1324acdcdeef43d0ea5f5b1b7b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -553,7 +553,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4d304694fb01a20e4311d1d627d9a41f3c098dd0..fe75f2486002a5d0c8aed761bf4c496f336c6134 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -915,7 +915,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 82c84a91f11e5ded9929ef2a099653ce5e74db5c..82bc65502d49f0b69cda4d0eea77828b4a0e1896 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -609,7 +609,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c30d2af6a1b9b0eca3726f227850e8f1713e148f..90cc63c230ccff43bca06523a05b008b3b620f06 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -977,7 +977,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9416bc02030061a579083418a7c9c5ffa9d6c315..f49ae6583f30dc2fc235309d13d67ee3c35d4e2d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -322,7 +322,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index db834fd6cab23c01850694008754bb87d7748390..8e4d1c50a430acfd101528aeaa7f73c09a1363b8 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -478,7 +478,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 98fa15a5ed730071792d5ad115afbadbcf32611c..2229a9ad135fa37c9087f7a10d66664b819687ef 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -840,7 +840,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 280af3725734f338e80b3a93e11a7322f325e6a9..c1611161e59868d49aab63eca09274d28ddcae67 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -534,7 +534,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6d389468c1d268fd0a2dac5e61342df3ecd537ca..d7cc28a6de5d4974c43bb9e7a1c4d9b612e3c151 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -902,7 +902,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ef708af181b433045939d65ba2c4d7378e1dbe5a..eb4825748666e0f3d7ce61f35b3806f70663db60 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -285,7 +285,7 @@ nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cb179c0c878ecbfa65017457cf1b32a6f5231289..8064b0fda1e2fe608e61d069484676da94ca4f0f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -441,7 +441,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0664a2911cdee8008936697856c52424e68a68b2..fe90389403cad93dcfb457de053d493becad3f82 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -806,7 +806,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 20f2e7535a87dabc1f92617456637c6df67e1911..9b7535dde763d0be19c29ea0a0f7bb0e438fdac4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -441,7 +441,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a3ae07b017238f908a86c72a36965587a4d920cf..ec3a0483f60a34dda8352e5f20ed785368fcf3c3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -806,7 +806,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 09724080640ed8e77e69626c0866a12c3d1b6464..f67834dae98979c034562b525379a0f2db5a4c33 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -428,7 +428,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2b1a570645d7f1bd49cb8cb110e91e1bddb2801f..05bab3160bfe532c2da6d291111d36a92b9ef073 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -710,7 +710,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 137f0a99abc27c073f1691e4b56f94ab6ec0ac3e..a49616cd4a7d0adef9a2b434f1f4a36affdb41d9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1448,7 +1448,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 378e4ce5096a3f9d4e84fbe6fdf617b7a27c2d17..0a7d64281c3ac44bc886b1cb65fa87767064184a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -791,7 +791,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index bf66074423e13a3f625c17351e4727c8e438b02a..9479c86c1a9ba9cd669469dac159c8f57d436390 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1535,7 +1535,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5734c7b71db70af864e0ae7d6e24528319a01404..73dc88749e458b9d584933cd913c51022827b322 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -404,7 +404,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f20572290692ab763f22609a56b95d58aec7833f..f52e488f92afc51d30a7f8b75b2d85c11424a9db 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -684,7 +684,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cbcb8100424350a09b411660699ea4baacc13c09..36c2a5b195a70439bd0b8a0201d47a1596183d3f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1418,7 +1418,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0d4d7bb7011128927e8969e83f3138056e591045..caa2070f356df35883afd402141efb92936c906f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -758,7 +758,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fee20e042e6b509799d793ff3223218cd4832052..1099b0c20e0c6af4d62249f62b4e10eba6344f5d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1498,7 +1498,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9e893c309d5ea5653550097f4846302a980cfa03..e7f4f6adbbea102ff9d694d697fe050b01d7d788 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -360,7 +360,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5ccbdd0c09bf15ae7d93b94b985aa2c4900b4eed..0d4eba09eddc27da5c96d879abe2474f1879241d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -640,7 +640,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 41674017222d6eecfbcf23440eae5d4f0129e8a7..80cd39408eb08f2491625cb040146fe0f626fc92 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3W3_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1377,7 +1377,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3W3_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4eb8acf3f397f124a290cfd2d5d4fc38dd34c7da..823af83bb2c2953e4a7335a683da3dafa42dc1e9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -640,7 +640,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b41b2ab2dac8f41e75610e65aaf8c2026fc291cd..fe16a5d591a26a61b066fd7f46534ef3da4a1e9d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4W4_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1377,7 +1377,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4W4_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1859830177c2f46b0f61c18a49a8af69b5425091..f2b1e90f742b2100622f06f82b705b84d17e6ece 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -439,7 +439,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d85c616b94b07d637f51829e1b7c2896355043d3..e7f6bdc11373ec69ca07174cf8bca468f9c8aa4f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -763,7 +763,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b4f479c4af27073c8a15f85a65982c6cd87a951e..108f0f6edce79279dead52781d5d205b52660353 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1629,7 +1629,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a90b91fe4268844eab449d73cbfcbfc23e7fb4f9..d8bf1ab38ffbfef2bfacbfaeb8731d6c1f15f43e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -861,7 +861,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 418b821a4cfaaa5e0bae02bbe287b8908a8215f9..52fcff6f00f9e83ebc6227587437c539f6c9bfb2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1733,7 +1733,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 687b4b787c47cf0042eef2352454fb4051d5ce3d..5dd95f8b988e44dff01d9fce548cd3b2c314d527 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -396,7 +396,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3a67efc198d82baa10d0838c4047d992c1912bef..d3be94306c37d7c74005d295e3cdfcadccffc674 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -720,7 +720,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8e2a17f823433cb6a554510fad16d018b80d14b5..cdc28f0b02875ce6d31e03e32dff26e5ef1e4d47 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3W3_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1589,7 +1589,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3W3_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 733ee68bb85d62fccb2f6b24394c6b09496139c1..90b4ff78c160ed03703dddecd158bcd44711fa15 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -720,7 +720,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3cf6951f159ce1e9b1c415f7d2f58669cc1051d6..742e57652632b2221a1b2bbb1d1c93fcba08c7d6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1589,7 +1589,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a631c8da2088106e838ae3e9d84570ea1596e391..d21ef2567d80a9b28caa260e09924433b303c184 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -443,7 +443,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b4c5402f99ddc725bf56b597be913b18c6e8cc73..4aae06351be2b30ef8cd40b7ed75ada72f19e7d1 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -683,7 +683,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8658bbf0a6e57210b9cec3c2845f85c5508ea4c8..21012ff48ed0aeb668ed1e9524ac4d8a9bb57623 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3W3_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1297,7 +1297,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3W3_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d4b4ec77b2edc64086011f308d4837587087628a..051e7bc29cab32474a3ca345d8fcfab529eee6b6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -743,7 +743,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 263dae452d17476aeeff808b4e1ddc40e7a0958a..f3f6e4be76e664ef86640126be0f7b2505ab883c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4W4_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1363,7 +1363,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4W4_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 290b98fdc2baaac8215bdf1a585cb74307cf51ae..c2d8af8a534b5b7b8d3547b79144ecdcdfc839cf 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -396,7 +396,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d9e5800a480c074024c1fbffa8a681b14be31ae5..663ce52f486f3dea5f02027ebc986de6563e6dad 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -638,7 +638,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d935c0748c567dac9538fae125037874fe3965c2..0bac9e742fa9c499d7485867ce8c68b559dbf273 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3W3_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1256,7 +1256,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3W3_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8d31587cd5ae559d3eacea0ce7a3a00066a7f019..95b2eabd2533a7dbfa792366c2711634c985905a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -701,7 +701,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3170b1146f1b22ed196609aac0cecfaab46b9157..a3f7ee07eb76a2b42d184338e680080d9fadc048 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4W4_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1325,7 +1325,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4W4_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 09091159403fb6bab473a1900cd00a8fd790d9d3..bce5bdc7b5a01f524696571aca84b13b07bfb4a7 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -372,7 +372,7 @@ nb_kernel_ElecEw_VdwLJ_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 64c90a3acfe95454c46be2942432252327ef49c4..51d0d76e6dd2e404bec31439da5d9db0652d173d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -612,7 +612,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ca37dbbbab2d0c838dfe9ddac41be76c5a72d1c9..af646cf0b5b1a32406974df98cd3c782d7f50ebf 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3W3_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1226,7 +1226,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3W3_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 21f0e2f19509c98f289dda81afdd5ce73f97c02f..9302265c3880f206cf58bcac69525a589bec4b73 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -668,7 +668,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 80a2b1edeb26d2ab01676a32f972fd2c75d9beef..b976b1d8995adfe6d3c8208f538d98d7a349a5a1 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4W4_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1288,7 +1288,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4W4_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 327893533ec8408a3512f75b185fe8515850224b..a57f6c1613e4746b769a63ee6fe74f3057551609 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -335,7 +335,7 @@ nb_kernel_ElecEw_VdwNone_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 56f070c64ea086b5f43504ed407a9391283c6bd4..e230a2d02b5b3f0caa34d427c05084154cb67c2c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -575,7 +575,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index da64526f158a894085d489dd7b897354eee4a555..10960bebc023a42c6659c1ed16b31f854adb563d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3W3_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1192,7 +1192,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3W3_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 02036a595e9ff78923cc51ab090d2badf21f4889..dc5a1530d7d6ef57a10b3d0c3b7e0916288f1a8a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -575,7 +575,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 141f8d6fd04e393030001472b3fb19c69ec8a895..55a399533993b853f34f9d995eba3a527a3c7c27 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4W4_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1192,7 +1192,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4W4_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 55eb0f5b2b6d99861f911baec9d81e8a1013164c..e09406991394885caf4bc1c8064fc98d7ec090d8 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -479,7 +479,7 @@ nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2909ad56a05bde9b4e5bb30471e691a4cce1e7cf..da4ee92929a354064cedb3f106ff6e9afacf80e6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -416,7 +416,7 @@ nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3c7e359d74168b80a5644b3a339c9d6b5802720b..90d43ca21a47418c6b649c1b476035483dc58559 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -375,7 +375,7 @@ nb_kernel_ElecGB_VdwNone_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5a95637e6677177453cf3f8a85a63ba1f9d62eeb..fbdf3e8b96b01949fe9a97bdd5f917baeac1c175 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -371,7 +371,7 @@ nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 09d9e18960c3b3ce8d88a96f9f4a8fed43dfa255..df9718c034e7da5b405db7efe0bd7d337d06b266 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -357,7 +357,7 @@ nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 39bafb76d1d1c468f7a10b15e0026fb892b1c8e3..667448d30cb66f5628a3c4fd29418fff5325b5e8 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -328,7 +328,7 @@ nb_kernel_ElecNone_VdwLJEw_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c8402d5b96bfb42ecf6059b09d9ef70fc28a06ad..4ad69bd5b870e020454bbedd1eb0c0e10647c513 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJSh_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -325,7 +325,7 @@ nb_kernel_ElecNone_VdwLJSh_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 89a760d5cae2cb990ac4f0e046fe6144488b180c..41998a53ec359a869b0b2c9f59834464f2550199 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJSw_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -364,7 +364,7 @@ nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 008cb931346ce30c1fb0c7af8e853a9118c93ebd..3b42fa7fef7a4a9f461c11df77a78bb7c46324f4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJ_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -296,7 +296,7 @@ nb_kernel_ElecNone_VdwLJ_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 77a72ffe1bf9afdf51e05498b9fa2cd2ada3c2d0..366b0c330775114e6c21ec29f70f41858e6a4af9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -427,7 +427,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9311a71db15934fbacfe9a0411018adda26c6b2c..5ddb1d3d75123e113769024958a0faeb65ed2b47 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -623,7 +623,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 92f36abfcad8846efbc48f9c0419ef92ec3fdacf..262209bca371b8192a00fba3e0d595a06fd5272c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1105,7 +1105,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6ed36a1ca0a30ea757776901fb5af54ce8e4ba78..a9de396e92ae3af98a3a65feb78e90938bdee2b3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -677,7 +677,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b23c6e03e0dedd3f7f4927344dd07815c23faf07..ab967781da96c62a587e998d41c49ed80ea98e75 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1165,7 +1165,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 37e7993b98c493bfba8384a7719372242392568d..431b1482425752452495e42a1be44221569262ab 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -357,7 +357,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a71c2c1f263f6e0a1681774652d96f8eff7edfb1..9a9ceec0424c6b3bc2f3bf5258d80f54c1215a19 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -553,7 +553,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7267c144c438eb12295501118ee475bdc1260763..4ab4266766783e9b30717290d7db59dca3ed2524 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1035,7 +1035,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c9bfe047b3d4edcde59c9d76ad22e44d9c59d257..2307aa7ac3b525c6637d0f54a54c8b6cc5ed102b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -627,7 +627,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 686bfbaf0e77ade0bc866a7fc4c92a81408bb45d..15b9770043f8e12ae5fd64fc8501bf809dec802f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1115,7 +1115,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 62f3227905c6814b18f59e73b25b4f7ce1c3c6ef..24785c9842cd7b543dad3253b8fea84ebeb8ea48 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -392,7 +392,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7a2d64d432960128f4de042caa6f4fb579909225..9c51ac2b8a5f4e94a60ce507a1f9633333130389 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -588,7 +588,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 43a99e2c4285dbc2b8ffce585eff88062cde4391..b0674c4d1bf86178239eeab5cd82e2828e005608 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1070,7 +1070,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d5467404682e8ca59ce601b4e43b6c54bdd7d616..66d1034f67ecf6b6c23f26313af1b0511ac1c5a5 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -664,7 +664,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 57edc058f50ce534f7221d529dc62b74682d3d50..265a7a06916a0c49e4f0bf6322a714831ed1af0c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1152,7 +1152,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5042addeb0296eabdeba05b5fdcbe3ee74826b7b..29e03792aac62fa3ff6622e403aac812c01bc600 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -313,7 +313,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5d0f0b06879bf977f89bf6ced7257565b78b4a5e..66f7e8fc7f538e85638eb025716f321eb7a0bffe 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -509,7 +509,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index aa9d9ab2a10d570c48906fea3ce062cc8385ab10..b3d3607a03cc007b2e185c60adf60c39656cc01a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3W3_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -994,7 +994,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3W3_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 86ec9924e93a114484c8e7daf83ed2a4ed3e4202..cf52799453637fe80000a59cd978a4e5ab54ec81 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -509,7 +509,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5f638866d89979cb5c2f6e79842b61fe8d98325e..4b8cdb58841d7df8ac1604ab2207555602a82085 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4W4_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -994,7 +994,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4W4_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e72ef3b43fd91155e6be0aa84d4e152b51c61569..fb02743e285ad109e519fe98221a3443cc345d1b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -400,7 +400,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0d0ab1dc36889e5aa10e5c5916a1b805f4947d7a..606c00966a9dc17069f70f43d1227dc234d21f02 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -556,7 +556,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1060845f2744de603c190fe6459f929eb85e6318..ebbbd66d84cdd76eb11fe09c0eaf965a13ddd73d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3W3_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -918,7 +918,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3W3_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0f07b1d0a819bbc9cc1f432b9b63f4538b4fa556..1debca5d42c30d2faf2265889c5e6f262764a639 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -612,7 +612,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f61f2cb8d4c074e9acba49ce3a82566c6a6a11ab..63312123e6df74a91ff797bfad8386a11d223118 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -980,7 +980,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ad71339b8f34dde481cc062f90d504f21c1b21fb..bbf4d5ea0173a1533657d823277334031fc06d3c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -325,7 +325,7 @@ nb_kernel_ElecRF_VdwLJ_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a868f1ff19ea5e676274048e08b64b91ac6840e5..93bfe58a2bc21c194cccb2b46c07d29bc8ac9f1b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -481,7 +481,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 21faca46dfc2b72090d7a7bbd5191fe5b0675918..a31ce01ad67ebde53f98b3f637a9b2da7d53004c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3W3_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -843,7 +843,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3W3_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fff9e5ca78189aba36f4d12ad1d7a5fe4b829bb4..d7eb7650078c30d0ebb4c490f158cc0f58fe6422 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -537,7 +537,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2e20e93ddd6ee80036005f1d8582ab90496a7eec..67f8c8896c1d18205860aaf98effb8b02c783e3e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4W4_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -905,7 +905,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4W4_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ab77ca88764a0972452ffa0927f8ea6d1ab5a872..042b25a9579bb934d590c0a6f5cd6d0a0e986569 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomP1P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -288,7 +288,7 @@ nb_kernel_ElecRF_VdwNone_GeomP1P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f3292a86c77bf03947b8ddbc26691d02ab3a7cf3..f7d5b4facfb7f7cc6ebe578bf0376642ea22ace0 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -444,7 +444,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 595570f094bf5ccf745a059d0264719fe3061f4c..89e16962fae467267113af5215f3a4b24c54c42b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3W3_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -809,7 +809,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3W3_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ca9c402eee52124b06358b14a360fea469832665..3ef97bc5f8b9b6f848913f4b298b9607592bebc9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4P1_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -444,7 +444,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4P1_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 811e5fe43e1ffd37d4684aa1e5cf74f8f4a5b9a5..8e6c3c9e6ca4a28db8630d478a9e38e9fa4752fd 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4W4_VF_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -809,7 +809,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4W4_F_avx_128_fma_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e1e5918e4aa68c1d820cd57097cac9dd3a5d9a50..9fa5fedd38c8d5aac839786cfa83f7ed7323fe9d 100644 (file)
@@ -2,7 +2,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,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.
@@ -93,7 +93,7 @@ void
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 25a7c83cd10314751b82eefa2c1cfac703c80d33..9285b21fa40f6bc6e25809cb8b16db1af4855178 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,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.
 #define gmx_mm_castsi128_ps   _mm_castsi128_ps
 #define gmx_mm_extract_epi32  _mm_extract_epi32
 
-/* Work around gcc bug with wrong type for mask formal parameter to maskload/maskstore */
-#if GMX_SIMD_X86_AVX_GCC_MASKLOAD_BUG
-#    define gmx_mm_maskload_ps(mem, mask)       _mm_maskload_ps((mem), _mm_castsi128_ps(mask))
-#    define gmx_mm_maskstore_ps(mem, mask, x)    _mm_maskstore_ps((mem), _mm_castsi128_ps(mask), (x))
-#    define gmx_mm256_maskload_ps(mem, mask)    _mm256_maskload_ps((mem), _mm256_castsi256_ps(mask))
-#    define gmx_mm256_maskstore_ps(mem, mask, x) _mm256_maskstore_ps((mem), _mm256_castsi256_ps(mask), (x))
-#else
-#    define gmx_mm_maskload_ps(mem, mask)       _mm_maskload_ps((mem), (mask))
-#    define gmx_mm_maskstore_ps(mem, mask, x)    _mm_maskstore_ps((mem), (mask), (x))
-#    define gmx_mm256_maskload_ps(mem, mask)    _mm256_maskload_ps((mem), (mask))
-#    define gmx_mm256_maskstore_ps(mem, mask, x) _mm256_maskstore_ps((mem), (mask), (x))
-#endif
+#define gmx_mm_maskload_ps(mem, mask)       _mm_maskload_ps((mem), (mask))
+#define gmx_mm_maskstore_ps(mem, mask, x)    _mm_maskstore_ps((mem), (mask), (x))
+#define gmx_mm256_maskload_ps(mem, mask)    _mm256_maskload_ps((mem), (mask))
+#define gmx_mm256_maskstore_ps(mem, mask, x) _mm256_maskstore_ps((mem), (mask), (x))
 
 /* Normal sum of four xmm registers */
 #define gmx_mm_sum4_ps(t0, t1, t2, t3)  _mm_add_ps(_mm_add_ps(t0, t1), _mm_add_ps(t2, t3))
index e09714d196088b6622f0461d7b32b5011d6f2894..7f264cad92c50042a8da89b7ee36316a1165f4d4 100755 (executable)
@@ -2,7 +2,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,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.
@@ -91,7 +91,7 @@ Arch       = 'avx_128_fma_single'
 # 'cutoff' means the interaction is set to 0.0 outside the cutoff
 #
 
-FileHeader = create_copyright_header('2012,2013,2014,2015')
+FileHeader = create_copyright_header('2012,2013,2014,2015,2017')
 FileHeader += """/*
  * Note: this file was generated by the GROMACS """+Arch+""" kernel generator.
  */
index e9dc792c98336d514f1871f8dbb31e4a98709b06..ebe940021c6e9efdffb6ab88c213fb13e4118d0b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -462,7 +462,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 38a0af715f6fbc286776602aeaf9f77f873ca3b3..39655f248bd67f711e0621013b96686f30c70846 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -702,7 +702,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1404cfefc0918373848c22329d57742880cf6f4a..4d75fb29cc19243436465192b7bb72d73dc4d6f3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1298,7 +1298,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a606658604961409b008e2b7315f091e1ff541b3..83e6e1f1d94c8ae1b97d9bd318d1d9221258adfd 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -785,7 +785,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b66d5ca86f732cc34039896487f7a36de189a059..585832f3c26e9e3f714477cb96651aa973aba27f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1389,7 +1389,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5fbba27470ab9112ab9c857358aec6f41fc67859..602dc70e6dfdc96421da7179d8ea83b8291adc24 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -426,7 +426,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c872d2cda7eeaf5bd35e9d377ec3e5974293c8dd..c8ff82934cf27600a12242e6ef71c968f364f3de 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -666,7 +666,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1faa7af96a77d24e0e0be9421676b7b192820054..7f63e631ebcb2c60b70b9500bf978d097f1d56dd 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1262,7 +1262,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c93edd68f492a1b12a8b9b93491c059dbeece01c..1944863fc7e0c94286ecfc3cf33a80483a0a705b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -720,7 +720,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 393a5e2deb6d75b543120397653eb793ed3218ac..8e57613175f07e41ea69ceaaf439394cad254f0a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1324,7 +1324,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8e4c966cb7c44386faaa6fd6ccd358f80567ff6d..64c16f8cc7aa552de298e09f50f4bd5ef636372d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -373,7 +373,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 56ddb939fb6e52b9991527b6f7b4e0891923b4cf..3b8b23c3db8976c4694de46c43fcfca77e19d1c9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -613,7 +613,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ff4ffe522d5f1cc686d3510cfd21bfe759349591..253103422e8074f89c82b98299242d4cec968cc3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1224,7 +1224,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 89f84e8f44a92bd1f6c42ef5ec1f0c8b9f245e56..3acb2e614da5084cf7f608b1ba320ce1806b0de3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -613,7 +613,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 46ed4729d4777004cf29dbbee354ca2765804d16..7cdf8e300df694373dde376081573d75ab21d992 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1224,7 +1224,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a163f411f921d630ab29d913834e5c3024c5a01d..437417a6d30c32b952a189482028158313e10008 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -448,7 +448,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 454098a468dcc01dccc0eb0073dbed8862c98a93..2b92910c73c7db3152ea4e4f7f07d8a9b38c0f2d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -606,7 +606,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6852d7538a0c91e85acabaffff433c171849494a..0b17195d2003899f1f903b56597ca04e4893e7e0 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -956,7 +956,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 84dced33e2a383b469f77c3bac4a88d0e38d93fc..54ec9edfdd9e50a66424441777ea61a1c0951caa 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -662,7 +662,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 65c5f51e616365aa5230c3d22117aa8157524a1d..3e309c9a7673342d534b7a31fd9c895ac58e032f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1020,7 +1020,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a12382c03b9430496fa9d64b1acda87449153a90..19a1c0c35447206316b9492bde6687bdb4b55e14 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -376,7 +376,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 21c71b3d646c81964408337f92e19d96a84ace8b..92ac844e5129bee3d34b0ab4d1255eb3bbe6a5eb 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -534,7 +534,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ae5787bedce2fb09bb725f3f9b40338e9534a3cc..fb6f7d9ac71abd1f5a3b5e53a3179b74ef839cfa 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -884,7 +884,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 76ae4bc08c00c4481188ff9470d4ab7106013055..b65f2fadae6c4783829d615501af316656002d1d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -590,7 +590,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 42deb0dd7141846cf094ca0ad66deb7c07d9fbc9..8af01fa282a0c4330279786b4d19b044a9e32224 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -948,7 +948,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f0cfd4051ccf8cf5737d2207503b772c49bcf8b6..292f91810d7498dece8a944ea137069baec506c3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -327,7 +327,7 @@ nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fc458954966e3c92eb6922afd98df15444885d96..48ef89dc4e428de9ad1098ee2e52bad4d4c85ce2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -485,7 +485,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9a59079bda8057e03b5a849f05432ab5754097c1..11351f75e53286a7b2481d2d43af6c0c244e71fc 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -850,7 +850,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index aef38c57180960d4f7eb31f5fe160d993558f761..7a20bf943cdcafda4d6d8d9d6aa5b2a22d94d0f6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -485,7 +485,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 54c953a8dc993b84e3d25b23ec0bc34ced79020c..5d687d87d2128a8eae772bb329506779e917bfc6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -850,7 +850,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 82fd9eec9755a974d71a080db605db0b484c5776..bcc37edd11631a7e4727c0487db936f54a4812cf 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -472,7 +472,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6408c279a8d4bea48e780d3c6dc96abd1d7541c0..241de8ebed09c0a246c8f16a478d5654580051ab 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -714,7 +714,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 80f79a47550b11dc5ae959f6ace5352d8d6a9648..e5e77dff24c98da21ced57c8efcc3afe5b2e49cd 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1307,7 +1307,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 53c95534121b7a780b8eb34e1a8a71b0ae3276b4..0d1ff3db392a929dde5ff9774d16f0a15000eb9a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -796,7 +796,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 75b694ad86a6e130964e8c5c7acb1fbc5abe838f..16c5e45d5ed6919e04fc44bcc0230aaf2ced6e8c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1397,7 +1397,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c21ae3e8697666c1071313f43f587a8abdff0e4f..d467f8d3378385344dd117cec0b326bce7411f06 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -441,7 +441,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fe73d15a6d0457b2c7f5085e36fbbd18566b6aca..44ce7190de504ec0de7e0bbb835c8a177425379b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -681,7 +681,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9321b599f2d7f3d3fce1bb42a9f3eb2c151c9950..0ca65becfb3de4d98f126c9bfafb691bb74a8aa1 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1277,7 +1277,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index dcb1ec4343b3aec740857af84b1ca692bde5569e..d1ee5d1b06797a976f48ccc09f8752eb63b15df5 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -755,7 +755,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4f16ca275de08d98e48f164801e5fe014fb5fe5e..885afddc0d1f9196598919680241c21b11c73e65 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1359,7 +1359,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9042f45557f028c9f57dd8b26abaf1ce85e63950..38c9cdc77e5fa12e2f2ae237f15b52070301bbb3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -385,7 +385,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7b1cf080fb500c5f82103d3af735739e06c5acc5..be07ff46be28466a29505f35757ff0fa5c816642 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -625,7 +625,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ea7a578daf304e6ba5e3229359f31d39f414ae0e..e8145470fb2fa878f77da85f6d0b035e5be94dbf 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3W3_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1236,7 +1236,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3W3_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 75b1eab51fd792806c0bc95a0bcd079a47458de5..8911cc8aee156a37d1dce8a0869b9e5c6dc54024 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -625,7 +625,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fca2a5ed2afed59043e3cf10cdd72ae807ea2f70..eba974630cf8bab5d4b24e7ffe4417569529d08a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4W4_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1236,7 +1236,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4W4_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 128c4c6c6a98b099a82b59f79de9e12432936016..23e4691f5303bd126ca26c6a3365b7408843632c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -476,7 +476,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e40dc265b7826d8c84ce2a02a6cdb481cf7c78fe..f64cc32d0f080295e0ef7b86393993d34ebc4900 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -760,7 +760,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index bfab0af2ddcede24ad0e1298e50a5ec51ae94ab7..8c5b7e33dcb78ef39f6e7973890ff39e50c210ad 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1488,7 +1488,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2f49b60ab5bd0e2b2ee4681b122cd908aa1560f2..b9c17acf8880b7376d51461ace7cc7e38c46b24d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -859,7 +859,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9616a7ef25b5dacb87ad7af2dab20972a471596b..ad4370f3089fd778e2de04570b4023cc439b75c0 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1595,7 +1595,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c621640e88d42fbc656cc0417c10c76752d2eca8..1499d2ceebac56c4fd319b03b386c63179d22f51 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -421,7 +421,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6f51ac0a7baa0f505744b8e9a320ad799a5f6f34..5fbf3135cc49da35e7317a5b5dbbbe2e6997ca16 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -705,7 +705,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fedc596009fabd7757f2d57f4f2b6de1676e5f97..a9113b3911d8f8f18298d35b900e5340e6276839 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3W3_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1448,7 +1448,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3W3_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 749299561cb7f70df146070a6c695562e08a5748..2f11d9b8baf5cdb43e2854b4c8f1d80e4fb5367b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -705,7 +705,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 85eb82a827e5da91f75c708f889255995e5ba5f3..75eef7d34ca1d068d5afb7b46700f5cd3af2001f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1448,7 +1448,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b8ad0b9eaa1cba962623acbe9473ef2e88dcb6d9..d53c043082e3073c5733bedf7419ac5c24d51a7c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -476,7 +476,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a844ed68d8f1796e4d8b95dff00bcbaa77d08465..39942c14e1c1d931e2f8cd606f7f26850b1ced24 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -676,7 +676,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fb26a29c63995f533ed47f0b20e6c64b5c034099..a1035e1db8ebba97c75b65836d86d68dbcc5564d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3W3_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1152,7 +1152,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3W3_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index bcbd2675efe8933ab1231dce814f275ea74ea29e..981029c825a30bf4da87d4a0f4d000e4ae396387 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -737,7 +737,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 31cbf5e6c1a16a275ca7df6fee2253f774ad4d86..a39f199b1d84d52344e5d6c01fd32f4a66d2e436 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4W4_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1221,7 +1221,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4W4_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e7f817d4509183921a259d96920594de3c4fc65a..de98c7a8d41c9b027fe2906e2dd57bf7a1f89e26 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -440,7 +440,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fec902909733bc7f7a9290125188ec9ac98394b7..85198b0721e4f0d19cf99afaec1a0357f1eb327e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -642,7 +642,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5e92be331d61d5962a0654132777b9b7bc0fada6..4d63520cbfa509ac9c6eeea679631080053ca82f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3W3_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1115,7 +1115,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3W3_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f58f82d8038ff7bc332244d57fef373223f0746b..ea40c93f800377900f16b7ab9104e55e99c71196 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -706,7 +706,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cc1ead3de9ff65275d0faea9c7799dd2f4f47250..45519b2a13032efec870d048f88a7bd2bc1df20f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4W4_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1187,7 +1187,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4W4_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8b039318a8e5abdb5e3f199dcf2efc2bf9cc6dce..ca06453c402fbce045733e71729a3a3f46654010 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -409,7 +409,7 @@ nb_kernel_ElecEw_VdwLJ_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 61f0e00ebadea92cc49a05a164d39798d59f9ac1..73d2d8b6362e0dca80963d8ebc219b9e65a9d3c3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -609,7 +609,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 35daa701801d9a6083e2abff0fd0c301983635a5..9c07d5ba6a399735ec1a2e6fc87b1aba79be1d2b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3W3_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1085,7 +1085,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3W3_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 919cbda1d99c9bd2fd1c83ca5de9a81ba11d84c0..9b92ca0a66950e16e0a4a5ab54acc4ed02c070f4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -665,7 +665,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9bfd7caf20e6b2c46f0d9f6c6720aa67db15c5c6..d2534add7d40f64a15b7538d42b49bd300083a67 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4W4_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1149,7 +1149,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4W4_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2a50762e86101e95a9dcb83c4ee6b5dcde1c40a5..5e87b13d7cef48a2ffc7d018bbd37481aa87337c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -360,7 +360,7 @@ nb_kernel_ElecEw_VdwNone_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e4929b4bef70fd1a1276ddc6275a8dd6bf714e24..bbe767d94f0e3a5826ed9e3bb414d84c4b58c114 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -560,7 +560,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0a4a7988d4a50745ce941ed64de24050d37723d1..6fadbb8144b3d57913503dfab8f93e118ecf24a7 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3W3_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1051,7 +1051,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3W3_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7a7bd0bd84e1b04b8c3efdade4cdeebfce77a78e..cf658453ae38d2c90551cde06c9f8f92b4c7c248 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -560,7 +560,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f7ad9c03651996dd8280ab939d4c6cf636c12c27..34074d1a311fe0d9a6d7cd73f5f531dfa8a584af 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4W4_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1051,7 +1051,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4W4_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ea8de4e2e3039d8793796648daeda0410df5470c..43a81eca9f11dabf743e129d4970495d2d61ed2f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -539,7 +539,7 @@ nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3c22ddb41c8c8496c2eb0807bad57068d02eb1a3..4f0b4966e44efb0417f571f795f79b3e6f4f4ff3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -480,7 +480,7 @@ nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8f513b354fc6ba9ab328ae7ad2efbcd82d127ebc..fbe99686e14f5636baea8a4ae1b71e2373e893ed 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -427,7 +427,7 @@ nb_kernel_ElecGB_VdwNone_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 633740a7cb7181b3e9bffde456af8feb9a322b6c..8d517f3e443c0d8f30b35a15f5f0e87b3b82852e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -420,7 +420,7 @@ nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 16b0edc31a7f285dac32af12aef47b64b80e4e18..581cb88d11494cc438e427d826d0bc567c08afcc 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -417,7 +417,7 @@ nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index af6f334a481d348cbcc564af747ac9c0c75e12f5..5b251431dec7eb6d06b40e8dee70cbdcea8f3eeb 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -388,7 +388,7 @@ nb_kernel_ElecNone_VdwLJEw_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 87d21fd44d127eee5724f8834a8b1ab24ec83df3..cc2b7c034c72e62e01e9f6b416948aa861d10490 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJSh_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -377,7 +377,7 @@ nb_kernel_ElecNone_VdwLJSh_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 49cb5cccccac6125b58a5b42d4424e5dd9211de7..462cf872f7396b3b094c284bc1be7c48ab0e1006 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJSw_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -417,7 +417,7 @@ nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 335a280df23ff0f6ddd2b6dcead3d3aac0acc72d..595362514dcecacbe91dc323a51efd7d9b8b6031 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJ_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -348,7 +348,7 @@ nb_kernel_ElecNone_VdwLJ_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5d1106f14fa2065b77766b4010b7ac99eb706c26..6c1fad7e2d872da7a6a60aaf77d2f27cbbf24109 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -478,7 +478,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 75b14d10ccdaa539c39499575d70a6090cd30c15..158875fc8ea60e71c3f93a2c22289243cf924ef3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -676,7 +676,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e93fc2de1e70c3c687828d4bd4b94e0d768c3a0e..648820a598c2cf7e6182c5d4a19905423b9fbf97 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1146,7 +1146,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cd2ef38662c4f0a3849b66b1ad5d75a0ac8175ca..b82b6056f7200a87efeeeae4e69295b38a7ef494 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -730,7 +730,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9228d6955e80284911b608304d44d3d177d3301d..db8e4f37865bcc5df8b573af00611880d5919eaa 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1228,7 +1228,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a51a8f91b54398ff09e2ec1006b47f59ac2f5ad0..233a806005239e0176d73f8710b518e7a8be754f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -411,7 +411,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 549d77f05020d8f6e86a7e39f301e4e5e1d1b03b..767f010346608f9fc6346bc27074871994a418f9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -609,7 +609,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9adbb0db1fd2cf0613bd82eb2c89f7af836265a2..4677de8daec7a28497530efeaed8908a67fa09b0 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1079,7 +1079,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fb0ec4fe0cac1f82ee122e61861d4c3db08484e9..f1debc5ad8630e208b062dd9e7409aa0d73e4cad 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -683,7 +683,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 20493bbb0b61998a037905af48307190bdead307..a6518afac24cd1618fda53218ead823f50459fba 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1161,7 +1161,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3370637051945a4a2d43ed895da71a2000eecbc0..5e1f35977bbcdbf197c1d8256a50b7738ef62c09 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -447,7 +447,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a8d0086938ab4b37223b9c12d5c2af3bb078953f..f3433719dac2bef8befb3af324668a27b16141f6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -645,7 +645,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d2e43a67199f9254635cc58ce6fc25e5f5113d2b..2f820c93cb52dc1dd1851ebd1037d140d1d22e1a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1115,7 +1115,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4b7cb06ae26c74cc2dec2169dac00e73aabc0381..64a4f31a2fca6d850cf7099639ac54f69bf502e9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -721,7 +721,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9d989c695e32a844159d7d09f2a7c88b62a9fe5d..396f8c4d24c3a123899d34b408ec4ab2776ba946 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1199,7 +1199,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d3f18319ec6f474cc0ce6070b8657bfe3eb03669..ef2e22e0d5120439126d60dd70823563ad1cff11 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -355,7 +355,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f244d42728dfde48ec44d6cf3930760e9c23a508..34d37441a281425a9b1d80b9108e379df9763f75 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -553,7 +553,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7bfc800643b49aa18398a6a080d6aa6038c138c1..e919be4b8f1999e80e709759051d9b97d559f1c2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3W3_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1038,7 +1038,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3W3_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d4428e5526884d83d50b35d8a4a857593b2771bc..dd6a7cd67a31bdf5c637e2c4c38cbb205e7f666c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -553,7 +553,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8f829346b324370ee38404d57478fb84573b4edb..3aaa98899a3de9f1ca69d6d777d382843645d024 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4W4_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1038,7 +1038,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4W4_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8b4e08739f5dc0c30b96237a9eeadfb9a2242415..5c99c96fe8219dab02047003696fdeca238d8d52 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -451,7 +451,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 639a5ad1cef6e871c30545559df23b83aa78ef2c..c005c8bb26c9cc02e13b42f6bd72b8bf681aee44 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -609,7 +609,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 29e158afba2e58f5e2e3ec22045bb9bacb334a58..adf842e1b14ce11449152db2d876bfd7a708b4c1 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3W3_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -959,7 +959,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3W3_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e873a8d472aaf2285619cd1128b67ba00dc04e72..e34cf8156f6d425fbb199989273c5153b6f36585 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -665,7 +665,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4a8a29459374f0152c3ee3fe10232e6df9e35303..9f67f56c7dd6478ea255bf6f0c49db9b8bd4049e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1023,7 +1023,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 63ec974b3fcf202c526c4b74bd00f43aa13b7aca..58007c92e68ba31ac35d163518aa391cb44417fb 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -379,7 +379,7 @@ nb_kernel_ElecRF_VdwLJ_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 02b1fbbe7c1c619ca6bc80101a57f3aa6e01115a..39d20e5052a27cf5c9c837be86396ef728f686c6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -537,7 +537,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cf6038db39fe0fc1828ace9b91ee147197f223cd..bd93fa0214a4684085719b26433cdf4eb7b5a64b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3W3_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -887,7 +887,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3W3_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index bde62d9d4104014e7266f5de77ff40d0368a91b7..bcdfefc1c413939fd0edd5a116002ad8dd1473d2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -593,7 +593,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a6f99309a219e316aed17ee3047fc6c6506af3fe..da2104c7e31766aad9d9fb03642754f856313806 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4W4_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -951,7 +951,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4W4_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b252e49b335e623380246ec82c6ea29b7f7b6411..22ecb9f0d66be28700de95d7df82f094c03e4889 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomP1P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -330,7 +330,7 @@ nb_kernel_ElecRF_VdwNone_GeomP1P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 478fae4f00bb9fd9d2c93d815d35b181c4e21330..30d4593cf71d03634714ac93bedc6ed9517db60b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -488,7 +488,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0f6f6774e3cc41c6908261d32d8a10831936d223..ff8bb0e56c1199746c4d18e2ab3a9f39c38a2981 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3W3_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -853,7 +853,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3W3_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9d63ccce5cb49878fb71959d222c4abf8246e8b7..9498f1009925e7d6d40a53b1887522e796900a15 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4P1_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -488,7 +488,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4P1_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3024d6d6b02973bab7c55107f3fae2be5d1f84b0..072cd9ddb92eac3f7f8fd2b3bf5cdb39e8a3c32f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4W4_VF_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -853,7 +853,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4W4_F_avx_128_fma_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 711d363f7750174c59844be7056375225aa64a53..c1f4e386a74806db46eebb60d420f81a282c1929 100644 (file)
@@ -2,7 +2,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,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.
@@ -93,7 +93,7 @@ void
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6ec10dde319834c49ebe4ba5a4cb5209bca89321..d4cfc542245e864b33e171838b65e3e8681b05cc 100755 (executable)
@@ -2,7 +2,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,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.
@@ -91,7 +91,7 @@ Arch       = 'avx_256_double'
 # 'cutoff' means the interaction is set to 0.0 outside the cutoff
 #
 
-FileHeader = create_copyright_header('2012,2013,2014,2015')
+FileHeader = create_copyright_header('2012,2013,2014,2015,2017')
 FileHeader += """/*
  * Note: this file was generated by the GROMACS """+Arch+""" kernel generator.
  */
index 8751937eb090463d285868ddc78facdf81296b42..924ba13429aa53a784b0d92eb13ae1cc3b9c14c5 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -469,7 +469,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3f729b0ecf4abaddd86299760b96f178c0035340..71b5971bec036ad2606f28c3deb822fbe4d78276 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -719,7 +719,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index bb8d48c38b2a6a83e44315204e47b758a64c85d9..061ad6f0625dbc19677525ebb22bb50c91f7cbe4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1327,7 +1327,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index bbf166abafbe0b0d99456a37432e75929ad3848e..d1a3523ddfd5aa915ef6404a27fa841224819219 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -802,7 +802,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9c4701fd1526d9da7c0d102f1e13b431abc51fd4..ef01eaded5cc59755d4362854bdfad805b21fbce 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1418,7 +1418,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3217ca05af2859fbdb92b0817d8649aec8990cc5..9b1391b9015ad19d5b141cb0879123ad3f84c413 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -429,7 +429,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 74fd6b97bae1628bf389ad1795f46cf2f6f1befc..98c21c6f0ba7dd8b549b37666ecc2ef327375d7a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -679,7 +679,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3fd016295fc1f73b88b1325121b41b5d2ca883fd..9afdcf70f9f5c64fb6389b7398ac7524ec15c7ef 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1287,7 +1287,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 999048dd5807ff7ca6a8305e353447c649ab81a5..7a957ddba11068e6f64282fbb470a13f61b3de83 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -743,7 +743,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 42591fd6bee5868d5976e59d169ee4986f145f0d..9cbf0771602ab1c06c6bb2158dbf14615ddd8d49 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1359,7 +1359,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0bf98dd1490b8c6eb78f54aaccd34535ff644341..4c9457850a20fae46283ad17c8c84193603aabf7 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -376,7 +376,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9b0b6b560c8fea2d4caabb741fcd747bb3922075..8838a011f8250679022d87b8e29c667c3b571068 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -626,7 +626,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index df7eea87015640749280cba21264c39da368493a..f6b69704609e2d74db99a37bc8e1392b8ccacfa4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1249,7 +1249,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 868c670fff2706214794ab6c62d93a9408a59933..220ae1a5c8f8add41b66549faf5eb2e8308a463c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -626,7 +626,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ebc1d4c6f6946e9bd81a74bbb7c2ceea83c9cb49..34538758152e98d455bba17af540685505cab838 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1249,7 +1249,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 97b0cd9e58201274c82f9ce1ef08d621800b043e..e6eb11730889285560c147a81631e33549d33dd6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -453,7 +453,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index bdd68b0fc4baa390b366fb10ab6470b118b934c1..41d0d467d7f5aac55500f88f6afa79c56b3e92f1 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -637,7 +637,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2be415b607c65d5ab5d740ebe79d4010bbe79b53..ca03597cd3ce9ae64eb8a8df4c9c326be56e2aa2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1047,7 +1047,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fc408bb2de2ade8d883d8a5f4f7384f1284f4d74..db15efed447cf7b6bf1fb1f5ad903b9c7d03095a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -703,7 +703,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 11437a6a8389bf62b2cc78a4505b0ccb111baa8f..bc2e3a0564c17e8f71cd387c4e0d2b40eb91870d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1121,7 +1121,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0bed0daabba5d8aaf0b0b94bfd9e0656fc92c0e2..425dd25d0fb0bb0db51f21cdf187c54e3b839cc5 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -387,7 +387,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c07e05efdc160bf97cb28f552bfff39baa37c435..b6190c846304b8bf41990350d7fe27fe58da3266 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -571,7 +571,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8c9e7fb2442f7fd0328e06dd88e0c3d19cfba491..33759af210281113bbb2b17ee482860e1485386d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -981,7 +981,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 41d602dde3b7d865aa64f5fec91b8fe39ead89fe..a188a94c9da8785a1e8e9215cdcbad6b4b235f8e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -637,7 +637,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7ddda0f7dd83b33a5ed40bee0f1c67522fff8531..21482bb95e03d1c18857f4ee1fff2fc576be70ac 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1055,7 +1055,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1f3732aff751af7b2ccdfe58bdc0535531c7032c..ec4b38a881033f5043281acc9001578018f99747 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -338,7 +338,7 @@ nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 13803c2e355c738decd0f0f19a4284d6deb1f709..00518c7c1797ae3debd391227b462b798f77fadd 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -522,7 +522,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d31fcc92bcbfc3dd55b2596b3871afc7ddd45d87..0287a845b518e0cc2035d326c357a9dc643fef9b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -947,7 +947,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5507dcbf56f3c4a5c2960fb3bea3e19c301fbcf1..a1456d4ad2bf395a13c7c55318f3dd107e92dc5d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -522,7 +522,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 88b4b172d65f1fe3ab8b68f64b71989d4ea7aa49..19496d610ced483483a1a7bd794c3f66c8d93677 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -947,7 +947,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2413df363f58e3b6b7c04697f184971f32489fd9..350221e7db34dd614765d8a0b7d3d59a1d2285c6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -496,7 +496,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cef0d13f07d58fea14d2f4081209d5a388fb224a..355815fc2aa502d68b30fd4981308723c6a63d03 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -786,7 +786,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1c995e26a77603a63ff54cdb77a5868f0b9e12f4..be002d77abcbcd37bbfdf4b7504edb5621225565 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1499,7 +1499,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b5c97e4de2d2d2c89e2067aa253c05b4b509545a..1ef5381ac4bc8db6e4fa912a4c80da302a66231e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -879,7 +879,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 65970d42e37bb929846aa5f81bde615e46dd580b..911a00a721601e8fa54bbd727a091e2143134664 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1600,7 +1600,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1cb805ff7ecfbc4dd7c06767758b06784e7baf26..cfbeea3a5af1eaeb3ea8831549acc7dacdaa806a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -463,7 +463,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index df471ae20665b6542054c4b13b97200daa08c0f3..b66cc1ff64e95a94e0980134bf281c58701c11e7 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -749,7 +749,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cd980929356e75a7a3ec598d30dee19fbcd2dc34..2f3c1c67dcdd4e2451a79ba0a3a1d04b44606fce 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1465,7 +1465,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a9c6a94cfa81160ac220efec81f3c0fe3349c5a3..81cb3d7379fd8e5c843b739fede97aebf0abe088 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -833,7 +833,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 60601c4e23b5f20657553d45c08a39e52830ae6b..d5e84adde72a8a77b01150bc94f32c39256cb1fc 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1557,7 +1557,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a4c5861ee542ba7633e2a9e3a59d810e14eaedb0..04dec911ae22bb88b29096d38dce2c098383c384 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -407,7 +407,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e775f32e48ec21a2bbf06aad0b038d49459fc846..ff23028783b465ebc48962002d66a85ba3954f5a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -693,7 +693,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 74dc290dab4da334faaab1a200e2010783c3f709..afccccc969571f82281a20cbd661b261afb074db 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3W3_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1424,7 +1424,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3W3_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b08200d7138c26a1db93876872332add1b5facd9..d33ebc5716aa6af4e35dd70686e5d20b8c259c53 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -693,7 +693,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f09a6bb47fdbc2d1634f13239f556d48cc844b5f..9f9011663a9881023d803932683637ab93d35c56 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4W4_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1424,7 +1424,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4W4_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 416939c631fc0367e7e6456fca685ef2ebd32d41..0b14e38d06861570939beb82a016c94dae838ac2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -498,7 +498,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a1328b0c545541f7f377e7b742d8f03b68ffd535..7e786ea006bfa759b95838627e14d97ee605ccd1 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -828,7 +828,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f23e7aa3768d4c1b8b7ade1ec63e32926f628d89..da7709b359e6e7d3ce24568e8e602e7d9a8669b8 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1676,7 +1676,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 912d0bb415570945c1596d90a8ab38740e3d7029..212f103bdf363064fb79712164c3efe3860d9396 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -937,7 +937,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 42e9cc4b5f5b3fab66bb986a22b1d4368580ab95..56c7f4224fa99bff2571e8ea04012a3b7136de7a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1793,7 +1793,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 48a286c3f3fbc9d3f2cdd19367050bde27812481..81ee1f1a651b7b857441c7104c4146bfecdd93f8 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -443,7 +443,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b1f0b067f37779b8d9c61a58a93dc64f4d024cda..7a9ad881661e5c5efb6f3374b65bf6233e16ac6b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -773,7 +773,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c76082fa15ce6c1c838557307c33d67360bad664..6166751bc9e27c781432e465bda8bdcd59cbf231 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3W3_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1636,7 +1636,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3W3_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 10c332f9405e7d169bdfa92036d5bb46786a5268..c70e2647893422ed2193142801fadaaa39d40233 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -773,7 +773,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cbec2271ad7959970b33eaa1a568a86fdc4299c5..2a975b41749466222ee818f62fadaaac84063540 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1636,7 +1636,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7cd9b6571ea9719e11dcd540838faeb413e6fe98..991140fa81f9a5df77866bcfa015bd836ed61051 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -492,7 +492,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 46cbad891ba0b079b3ab57f330783429d6a4074c..f98a0f010f59569957e4d6e08173a76907e6964d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -738,7 +738,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3c1e679b02c670124cf7f8c81f7adfe35e3c4da7..5bae4c1722c6f4c7c6db1ee33aabfb05bb83a2bd 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3W3_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1334,7 +1334,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3W3_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 691020930a60b0ea00f0dbe0ad732b196f01c008..37cf2cd163e1c2a3d6405dda7ffee2bef376a655 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -809,7 +809,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7dfc551b836f03ff233c857f64f117f653d8e483..679b4f1f072ea7b579d3d5b8edd1f8f3b57bf4f1 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4W4_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1413,7 +1413,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4W4_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8cc4ea83e2f5f37a53b61e8597cd5625faf17116..16279238b5c1cb99cf90cdfd913814b0994e4a6f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -464,7 +464,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1fb4b67a77fe09d6c76753bf3ffb8f88fe797d7d..dfba5c0ce9d91715615ce55e8831b538af68d99f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -714,7 +714,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5662c8d25357bd7ad59f116e70743ce32c636375..4ed95115915c62b8ce9307917d4e5d007a734276 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3W3_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1307,7 +1307,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3W3_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 73c20c206764c748424df33b4c1969a4914a641f..e6852efa9421902013d403ce9208a4d676b68fc8 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -789,7 +789,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 62bcce45a90a2b2011754ac09a2ca5ba23aa894b..1cf45997f1b5dee2d9169d8440bb5e4749849a33 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4W4_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1390,7 +1390,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4W4_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fdf9e9778f08c0e3c7908745ca46b9867cafce35..1c209d83c6beead034b03602f74013b94196759d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -431,7 +431,7 @@ nb_kernel_ElecEw_VdwLJ_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0d9f4f7f8958cd69c91bbb83e9c166acb1159560..1c2cfd7b37a881b1c26dc939b043c13fc8191271 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -677,7 +677,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d415ebbdddb7bac3cbccc9274367b526536211f1..f2828690eafe605a004110b49da69aebd7145b4e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3W3_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1273,7 +1273,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3W3_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fd799ee78e4f2ab7d51b6b60af96239c523f53a7..7b5bc72743988c5863adf3108c5ed9167577e5c4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -743,7 +743,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 61f602c568535dd1a0432cc4447e156143cda8c6..deeacd2a26e1a2e6e25a191d6f59128a99862872 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4W4_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1347,7 +1347,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4W4_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d7e46f5e522e0124a1bc7f4ede910786a88cd8b7..f12a95df89092389b123d4125b668f8d94fe160c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -382,7 +382,7 @@ nb_kernel_ElecEw_VdwNone_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 816125915c0f8adbc892a389ce5ad6de0ba31c60..e2483b95114d50563238595aa235b32f938e5c28 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -628,7 +628,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e515a7bfca81384c5c7374dd637eff778ccdce18..9d3167da8645b3aae203a46cc3e3c81f5178099a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3W3_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1239,7 +1239,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3W3_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 446bad1468c5bdcff92e1b77435135f7d26a7b98..fbd7c40395f1297507bee441e02301399cc7d825 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -628,7 +628,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 47ee1c82030c1551f37f4bc59142dafceb27b741..bc8d6614ed33df069a70ebd3b404081227a92f40 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4W4_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1239,7 +1239,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4W4_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5a522fa5d8fdb6b1cfbcd16918ce8e093578375f..17ce5326bc512225fbe23c92c8a9fe2b68078d61 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -536,7 +536,7 @@ nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 430dbd76fdadb23badddc461e13a147d34fcf60d..fa0c55449efec1098819e07b828438924bde4837 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -483,7 +483,7 @@ nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 64270f9de7a29bbb2e4e1a18e2f7b2ec331e382b..3c426e51f6a431a65f1d587c06443b1d09b0e570 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -430,7 +430,7 @@ nb_kernel_ElecGB_VdwNone_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5fe1a88c858d83499f1d6f249daffc9d083c25d2..7af41529ff6e4ac31b4556daa6970ed197974a91 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -425,7 +425,7 @@ nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a78e273c096f3960932bec983fd8ffbdadf24af6..ab04fad6bda7ce9dcfef394fd017c9fc5b76d340 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -430,7 +430,7 @@ nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ac79b0b7709d356fb8ac3825d866a2e9337c00e7..84ee42299347136e9c8730602eedd6dcb16de4a6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -401,7 +401,7 @@ nb_kernel_ElecNone_VdwLJEw_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f2dd3448074fee38de7116ef6c17492619d37980..4c70399bec6d4a0a3e76c1216ed74432244bec8f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJSh_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -388,7 +388,7 @@ nb_kernel_ElecNone_VdwLJSh_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1ca204075df68394aa9131fd893b24224be664e2..9163908ccf4a50b6c7b5dbe1665f485179031c69 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJSw_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -428,7 +428,7 @@ nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9a3432c24f945bf298a38da9e958758370bfbca8..21236d235d1788009285b9aafe085cd4ef0ea603 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJ_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -359,7 +359,7 @@ nb_kernel_ElecNone_VdwLJ_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c803500c0930201f1255b5f35366cb80d38918e3..1fafc0d3e6a97f8fd1ed53b1246a9f5e303afa94 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -483,7 +483,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9ce22d90744ca9c0fcdc9d71ef212621d7de343e..b16606273e5d6ce8d5ec6f9d416c0559099507b2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -707,7 +707,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5e6d3c65b797d5635ec32d4fa005c757f89f133d..8592825d8773a655fafc8198ce338e9c9e81761f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1237,7 +1237,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6b759efbc5110e28343dedaef91264226720e3f6..423770304d66bdb244bedf91000258fbb4ce147b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -771,7 +771,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5aa9cef8d605e6525844e1eba4b5db84c64d32b1..0b627d0b239d58d016e32ca3740497fac07ad5e2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1329,7 +1329,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 388bba0a3468106bc6a948ffe16c6fbdb1d22fd9..0ec9ad93b2560d693ccccb9784ae8a914e41151c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -422,7 +422,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 52fa89b99e5227c385478bb7213c58ecebda20f9..fc12d58657b497c498415b7f186bab999bd77f4f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -646,7 +646,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9f05c38db872a3092be2e81d37e01e095d95e059..9e4fce0af0a57611c2c17eb0d089bedfb4e55249 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1176,7 +1176,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 184bd2cacab5d514a3a894a2c48ea98cb19a2109..bbd860d34377fe8ff30e1030216577e2cd152550 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -730,7 +730,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0860a9bcf9085f37093de330fcb36899e0af1931..b2bf561a6ee9803f2cfa8c947eb1f19a881d08e0 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1268,7 +1268,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5a56b1c6ff454642eece66ae2ea34d377b52b5a5..0d39cdd512f9afaa6803d053eda9f51f6cb37f06 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -458,7 +458,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4f3efc63924a07c17a7d8b83bd641f2f294a6af5..f8f37747bee64d842f39accba03dc89250d15a14 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -682,7 +682,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f34f613c1eddec002bfe323a67e82e0b50a746b1..b3a80ece1fc9f169dbb2921b397e108a7e29e4e7 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1212,7 +1212,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ec989fef0bf126a4449bbbae4e3073fa0558da10..575e90da89b8c22908a7106f8ec6cfd62d8b4141 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -768,7 +768,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index eca5731c3513383474535c391c66e3cf50938858..23ab497c2bbbd8bf39a92eefdbbcd51ae81c57f0 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1306,7 +1306,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 59a93428ef7029a1e069c6cb922552aa7bf45820..415102ee59d8c66716acdd73b3f3723d56384a60 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -366,7 +366,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6b60befc6e1317f46453145e488f03a620ea85e4..3b51b83520c5e4382f6cea6ac2b83a8ac8834d60 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -590,7 +590,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 98492ebe8366e23a34431d7f591784a448b10662..4d1fb11687977c3c376113cfc396a546cb8ffe44 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3W3_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1135,7 +1135,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3W3_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e57f9426736601c24624d31cf17a2337b4f945d7..813c5294468b7d6eb3dd51fcee90d8dc11e9f0ec 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -590,7 +590,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b7519a79782ab4eac2f8ce2b0eac904c2b253df2..94f3b9c99a1966edccf6408f0b5a68c946aa6f69 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4W4_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1135,7 +1135,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4W4_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a7d74475f939d54baa0812035f900c62cc4e669e..dacf9a3aa47211128783939a0139e2d663e65b8b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -456,7 +456,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d5c87cd9cf907e46612dcc6ce127d8f5fad469ef..7f8a1c6454a64ae4f4820c893357dcee3892e3a5 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -640,7 +640,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 64bd64f655def4c8c7d5737074481182ff204241..3304f6c68c93de15ef1a1674136f4cdb7450c946 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3W3_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1050,7 +1050,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3W3_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6d51e2a0140616bb1480f781c5d7187e72ee451e..96ac6df45eb273a0248d14136f0c579431b17299 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -706,7 +706,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 59898a6c6a7766933dd3fd1a8d614a6b98ed1448..76f9fb7fb895fa17607c0adbc2f4c3c42464cfe6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1124,7 +1124,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 404634035ac141701e216918f8fab12034b6f659..d24a934eb8ef64d675e50e1cf3c7d2b1864e414c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -390,7 +390,7 @@ nb_kernel_ElecRF_VdwLJ_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 03ab5423e96604de7db4150b2d0c7b0f892dd57c..a2ea4479c9463cb3457db419a9cdb422a113851d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -574,7 +574,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9e881d909634ab35f6ca1a6907baa6697405f63c..b2ef0e03abf3d4f60f9e7e9cf7032874cf592485 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3W3_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -984,7 +984,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3W3_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5b7d5270d8bc0307b03bf383aab788452fa258b9..855753c6a525e652e35634f71d2b1fdd7fe2fe48 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -640,7 +640,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 91b533a10ed28c3ec2902380a407a13e41bad5f7..8f9e7b08fa9bade331aed0db68d5b946f25e58ac 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4W4_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1058,7 +1058,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4W4_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 58aa296ac55dccc0c516f774c54f0d264af1161e..5e2567d70ec0d481b1b2c1e3c38b9b549c541a96 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomP1P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -341,7 +341,7 @@ nb_kernel_ElecRF_VdwNone_GeomP1P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 103799a3db430a7682535554b0b24f652de45bd0..424d612ebd140368b6d5451493d9bee3ae0b72f4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -525,7 +525,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ea1341e196ee17d5a58aeff3884d913b477d9c5e..92810a82ae3b12bf457436e07a25a248556a1bdb 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3W3_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -950,7 +950,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3W3_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8dec4e13574a69b9fdf8e4fc542d7ca963514419..7d0a5358bd2cdcca519cd6334e763bb970a0a07b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4P1_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -525,7 +525,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4P1_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c02f92a0be5b54cbd7a0fa0a8bb0b3420a008d0a..e6c2e11f8159e316a742c75d0d222b7357c51370 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4W4_VF_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -950,7 +950,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4W4_F_avx_256_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ca84415be29737f726ded98d4acfdbf3560a6a5b..d8d84b68537771ed0d48b864a446c656013431e1 100644 (file)
@@ -2,7 +2,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,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.
@@ -93,7 +93,7 @@ void
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index bfbccd54deced3623f0ebebcc4a5dd52f8a6c821..ac489ea64b21db84737e635db5af0bfbbf9dca0c 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,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.
@@ -59,18 +59,10 @@ gmx_mm256_set_m128(__m128 hi, __m128 lo)
     return _mm256_insertf128_ps(_mm256_castps128_ps256(lo), hi, 0x1);
 }
 
-/* Work around gcc bug with wrong type for mask formal parameter to maskload/maskstore */
-#if GMX_SIMD_X86_AVX_GCC_MASKLOAD_BUG
-#    define gmx_mm_maskload_ps(mem, mask)       _mm_maskload_ps((mem), _mm_castsi128_ps(mask))
-#    define gmx_mm_maskstore_ps(mem, mask, x)    _mm_maskstore_ps((mem), _mm_castsi128_ps(mask), (x))
-#    define gmx_mm256_maskload_ps(mem, mask)    _mm256_maskload_ps((mem), _mm256_castsi256_ps(mask))
-#    define gmx_mm256_maskstore_ps(mem, mask, x) _mm256_maskstore_ps((mem), _mm256_castsi256_ps(mask), (x))
-#else
-#    define gmx_mm_maskload_ps(mem, mask)       _mm_maskload_ps((mem), (mask))
-#    define gmx_mm_maskstore_ps(mem, mask, x)    _mm_maskstore_ps((mem), (mask), (x))
-#    define gmx_mm256_maskload_ps(mem, mask)    _mm256_maskload_ps((mem), (mask))
-#    define gmx_mm256_maskstore_ps(mem, mask, x) _mm256_maskstore_ps((mem), (mask), (x))
-#endif
+#define gmx_mm_maskload_ps(mem, mask)       _mm_maskload_ps((mem), (mask))
+#define gmx_mm_maskstore_ps(mem, mask, x)    _mm_maskstore_ps((mem), (mask), (x))
+#define gmx_mm256_maskload_ps(mem, mask)    _mm256_maskload_ps((mem), (mask))
+#define gmx_mm256_maskstore_ps(mem, mask, x) _mm256_maskstore_ps((mem), (mask), (x))
 
 /* Transpose lower/upper half of 256-bit registers separately */
 #define GMX_MM256_HALFTRANSPOSE4_PS(ymm0, ymm1, ymm2, ymm3) {            \
index 33b51a37b2b3fbfa3b5613fa297595de946e196f..b44938008e8a9b19e992f3db18b1a80be72cda77 100755 (executable)
@@ -2,7 +2,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,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.
@@ -91,7 +91,7 @@ Arch       = 'avx_256_single'
 # 'cutoff' means the interaction is set to 0.0 outside the cutoff
 #
 
-FileHeader = create_copyright_header('2012,2013,2014,2015')
+FileHeader = create_copyright_header('2012,2013,2014,2015,2017')
 FileHeader += """/*
  * Note: this file was generated by the GROMACS """+Arch+""" kernel generator.
  */
index 9fab9f451ab6a357cccde0bb71ec7790dee02ff0..ef721c70809f69b92d30c25b7e368bb00d8fb910 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -560,7 +560,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 63b8cfdbee909641da478044b771a609467ab549..e9f328829df527e55a0c9c10a409d14c5a6b4d5a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -842,7 +842,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e7a49b877211787591b307e83da5d2d93c0a6b09..834c426f961509ee9213a3a19795713e038f3732 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1526,7 +1526,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1176027463a3ed59ca42578fcbf5dce0436047f6..9166476d95e4fdc219bdb2c6406a5cbf27138d1f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -933,7 +933,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5ed366a0d27372fceb5c8d0236520d7bf0521f68..7b9381324c979ba935cba87930a7bc9026440b3a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1625,7 +1625,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 61dcbf8e82bfe765035f02011ac78e94ab8b0343..12a2102c7531ccec5ba27ee5464709ca8bfeea7a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -500,7 +500,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d01d9045127fecad4009c855720524e19e4ea52a..724cca72a173ddd46ab8cf2d0c9c12828d8ee175 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -782,7 +782,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ecc3415566c4c775af551e25ab9fe2364f4fe69e..139741acc139f00e54e812584a8656aaac5e9bd8 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1466,7 +1466,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 06cd816330e05a5e756be73ba107497ce844b5c3..9541a3141163f41b290942423a25f684e7d2c916 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -846,7 +846,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index abf9ff1867286cf81dae1d5605721ad7e6299009..1add7575f8d3a8fa0e61e78ed3033c1c14083297 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1538,7 +1538,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d3bbc08b0f6f645d3a49e7343bc98172b087a02d..50963aeb70b90bea8686fe5c1a72db629544fb91 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -431,7 +431,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 11b4f59e230e4b27a7429ce2dd23181b3824001f..e64f37a51e3c7563351930d248255eba3e03d6e1 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -713,7 +713,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 05be1a53d445f33d5966a504879db29d9ee5b839..db0f5bed974d0abe25e14920935315a678e86d4d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1428,7 +1428,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2e7fd76bbe9f3a9c7d146a933cf374532470f280..e374911e109e7ff7a36a357a487a7e9eb53d39db 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -713,7 +713,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d506e97c7de927ab26e314f440cb0a567461b1da..dac9f8197edf8b52ad5bcd50779aec2b224bacea 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1430,7 +1430,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 56425273ac057f40d8d01f5eaa3fea0899ce8de5..0cd4ba84fc4586c66ba04140ec0767cafbb0659a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -534,7 +534,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b32c2761490031485af93aa5b2ef40e220ec3c39..f7731790dca91b1dac76e516853c7d8c9353a3b8 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -718,7 +718,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8bf3b55f26f729690124ff18b3c2fb69e4e8dd56..641608538a8c3cfbb9ce1a41dbcbac49d026aad0 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1108,7 +1108,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 26774b3d64ad882bc727eae98e00b10ceffbeb0b..2a0b6699b9f279633e55d7e03f88ccbcacfd277f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -784,7 +784,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7af60ae062b8df7259fb232bae95e952a442d0a5..2d0b063bef5604d2c49c3272bb4beba4cc69fac2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1182,7 +1182,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 069ef14ee772cc7df50992e9aba0b82dea1a9c4c..c9ddd5fc68d3dd5f9a95a9bfc167276f020187a5 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -441,7 +441,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f856070ec4eb004d5e310dbb742598357c5597b0..b75bc0b140ea2e09ad77f4b6359c57c18eb95bcf 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -625,7 +625,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a60228a72f43fe05d5a774d395826f9b1964d914..bbf554090422458f31fe2de798c139b67035dc21 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1015,7 +1015,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 93e89339d5a3bb57988392eff8cb4d3b4d803382..b5d449ba67245f67ecec5053512e1e438d1168b6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -691,7 +691,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7c02d12420558f3ff945ca606218bd289cb20f63..1fc19298e260b6e461d6a19947a100142f5aaf17 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1089,7 +1089,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2c823556c98976bc09e477dc44c80963fa4beecf..b99296f4dcb6b950fdf4526378f0b3eeb862db2c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -376,7 +376,7 @@ nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3d5ac3bf314a0f079b3f9d5b2b16c48bb4cc1a79..3178c560182ee926078a12166f7810090d2cbc7e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -560,7 +560,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0ab60c24d3f23853b9b11d65314dcbaf4a9ce84b..6ea44102f921f8762eb1bf001f5631347091f83d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -981,7 +981,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fdd2f679fe3a30592002c8fe0f8a24ea4f5e785b..41ee1117134f18bf6bb0335275eb49ff84eae09b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -560,7 +560,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a030bbdc095ab2501016690697a3ae7c72d0b4a7..a2a0e1287caa6518b1cc063cbd8b53236f18b9da 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -983,7 +983,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 428d81d4d85cdbca5e177de3bf5786cb73ef5f59..0d1d7cc2ab10b3f3d5aaaa22a4c8f34fcb1b611a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -551,7 +551,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c8efcccea84f4cd3055bbca2184623499b39a8ad..61259aa86d0f3607a0d6d5692012359a2913f617 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -825,7 +825,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7b72e5858c716c5d7771db2348c6ebba18fecba6..b61600df30bf3ac82fde758a66f0ef42c53a3ac2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1462,7 +1462,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 95037a6387b9f853215b84e9eb3043ec17134d28..26088dea438a0de210f60b1c3397da5f3d33a3cc 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -918,7 +918,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 673bcf097a1c45ccc5b59b1732f357b4cd6e81f6..9a200b351cde4d3ac2b5d4b295dff7b320a4962a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1563,7 +1563,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4593ff4158a91c16803ecd215725f073d146f963..588933552caaeba5036fdddbf184358e3eaabf83 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -510,7 +510,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ab9ae2291682dc62bbed02a133a275bb02283990..42a20f239aec558b837aef692e1b35d20b9bbbc1 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -780,7 +780,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9b20565c3d069f19306a561c6b22c7ea0c1b5951..4f43e0e52e87d803774abc388687af9207b484b8 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1428,7 +1428,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index dcdb6aecd9250b903e5272532c4f872093958784..8fdf6d9a0c0d80537c7d0ec743b710f45fd856fe 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -864,7 +864,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4d840729cc08425e1450a18688607d2803cdf28e..6190160d76699c7abcee03c6e85eb22d38212f05 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1520,7 +1520,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5fb902c97aa22688a4bf0310eee0afcb72eb0781..991114318ac7f8953ede5fc724fa584a13ea916c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -438,7 +438,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 67d3f88b5c8d7f55be70af76e1669f483077d402..510177f187943bf96f7eaaf4445d1e1f9e65d170 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -708,7 +708,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6fe8e28d65ace4b790011d33d0bddb952878ca21..00c83ab277fda1c4ce2328571ea8ad940b59d2ee 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3W3_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1387,7 +1387,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3W3_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 200f49a4b97cf74de458667d2ba33e75cde2c1dd..6311970b362f32d17364a2e5b4a7063a35efefa2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -708,7 +708,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 082aa1b70e482db8639363ac84c5d8f3c6b0e817..a153b694a6abec88257c0c46f916c099a24fa62b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4W4_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1389,7 +1389,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4W4_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 702d4170bdc465fbb69750e5b1a3a394b9a835ee..b0b05b28183b51a259dcfa58bcb0e7f95cf558a0 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -545,7 +545,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f21ce1ef22d5368c464bc5fa28ba3b51f455517a..a9fe19e39d8963d153be691ca58f1d59afc0737f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -859,7 +859,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7b0883c6a4b5b682b1ea2ac62f0c72434041033d..f1f43fed2637ff3506266fd03a42809646e6e550 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1639,7 +1639,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f9846ec47e1bafc00ebad8628afcd9f01a9ce6c9..3779dc70a72b1d2750e75b0c6614a693c372e1c9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -968,7 +968,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 376359d73af299575f033adb27ce1cb788a867c4..8244709307ae3e145b0da3dee28ece908000558c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1756,7 +1756,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cac1951e9ab7e105821c22965a51024b95fd5a22..787b094f6ef7aa53c2ae52214b563bcd208a2ede 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -474,7 +474,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8d0d18faf28dcc42e08b65c008961896ee08c2a6..809e5f06f0463e96c68829e9caff855436ea0652 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -788,7 +788,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ec3d6e493c89371bc2ba2862af4b0a30f76adc70..e4f1ccc09d4df2884f69c9f3635952a42cfd71e2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3W3_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1599,7 +1599,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3W3_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 688956ef6043a3155a98c26fbdf86003f3e9215f..9b07fcaf959407caa68379f6bb0debb2347296e6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -788,7 +788,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ca8da1ff87930e542375ea159c1b4a7541cf5a6d..5f0f57fc677d07250ae2eb70e0a4456c2e836e3c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1601,7 +1601,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 37a2ef75fedf53f33b9730fc0ad1e1b7678142a1..2bb21d964374beb4e5ee184f46ef59e8e723f943 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -566,7 +566,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 99d7cc564affd5605ddc2b8d5eb5246bcc20c72f..5408a149235d3a84b2c622b95dcd4ad7a3372156 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -796,7 +796,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a767352e7e71d6b9e6d9a3901ee22337f6ddd496..94618768dbe3edfb75473dfe5eefe31bbe43b8c6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3W3_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1324,7 +1324,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3W3_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3148fe166b4341446313e36a685a7147d9067c57..007437847a8dd8af8ac28a97a35ec75c96f4e026 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -867,7 +867,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index da60b0e56082ff616c5dc0a038efe71f4d762bba..63c15e694b85a77b72525c321e9184651a0b2c76 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4W4_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1403,7 +1403,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4W4_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 59eb7b3aea62c7cc2776adef4f8d9059fca30eaa..a8bdb6ba38720118833996e3756a623a8bae3624 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -519,7 +519,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d1e8cd6638280fd16557f388711e1df7999a0c42..4f96e7055d89cffcb11318024de65ce426508104 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -753,7 +753,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f170942de4a19e0261edb3b2e7594c8f4bf4566b..29c24aa00919cd3f592297249b8d5948b24971b9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3W3_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1270,7 +1270,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3W3_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 404f73a289c4d6f8cd24a7951598479d851057aa..d5af5cf4e57724dc6a5bd9531d665ad0de2bcee2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -828,7 +828,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 14f2aa2713a8cf5f8e50eaad6469942ddca481c7..6d45db3f80414c27dea9bc322640c68d73cbee1c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4W4_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1353,7 +1353,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4W4_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6432f912d814c6af7facc0571dd21a612825fe70..ecfbed170a857c5c7b61c0bd62d4b0f93006a502 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -478,7 +478,7 @@ nb_kernel_ElecEw_VdwLJ_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5bf681995b5ee67565a6adae4fb7a6ddb05e09b7..d96781322ff858dc42568a510d4804df59a9def8 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -708,7 +708,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 03951dfe09fc2cd5a1f828480338ac8be7322d99..dd5f9de67b13dc58aa46dfa059c6e3aba2431131 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3W3_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1236,7 +1236,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3W3_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b300f6baf15269f2764dbb794dcc2d6c237d1fe8..3ac6e80f25bcb0efb05f2c7ec168af2c64c64175 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -774,7 +774,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9455d414c653969cc7fe91429f384701318fcc2a..4b86f3d6c70d5579b0ebbef0e9685ca7b080035e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4W4_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1310,7 +1310,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4W4_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c8e1b30af79e2aa4a0c1e4c1c78cc39c833f1da3..9555ea5b358437ae2abfa3e420d8ca5121c2e1cd 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -413,7 +413,7 @@ nb_kernel_ElecEw_VdwNone_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 13419d062fd212509853f9383a099c2aa59c7816..e8194880ad5df6da054f9bd982bb6e85bcd14867 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -643,7 +643,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b247e4639fbcabbea0ebb9df9871e54b911cc399..8b3f92f8d160b2b49caa605d6ff49435bff3f820 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3W3_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1202,7 +1202,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3W3_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7f75c6ad49f8d6b92b994b17348400ec1402b7cc..d6e5e1a1e3aef715d196f5686c4d9e40e0587383 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -643,7 +643,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f2bafdaff5837e654c96fc3f16735d9b60f8f604..cb3998b41270dd0355a3d68c1a276abfb34cab44 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4W4_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1204,7 +1204,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4W4_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c110a8dd5bc7bd9b9fc10bd1ba466cdc00224850..dfb6b826613718832ec959e8120ebdf270738024 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -646,7 +646,7 @@ nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e3f6a8b9da9b154423bf038a49ac0e7216027b48..c997d0d7b25e14f1652fc3f3d6aaaf0a77f89ba2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -567,7 +567,7 @@ nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f6d12ca2629edfee9fcc3422970521776276388c..124c58491b4eec6bcc4507d5477ee3c30d7801f4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -498,7 +498,7 @@ nb_kernel_ElecGB_VdwNone_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 71438492c6a6065fb03fcdb0a520b49988481517..df7073463e08afe04f9841df1a76a4cbf9eb8a30 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -502,7 +502,7 @@ nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d7349b200742847b741dbf107672e9f2d0b59fea..d7d70a2008fa9545c7df87fb434e65e27e6d380e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -488,7 +488,7 @@ nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9d0bc95c046f2a147b33ba14d95091d5d04b3018..fcb00362fadb74721ac9b00d8ce9629c62201b70 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -459,7 +459,7 @@ nb_kernel_ElecNone_VdwLJEw_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b23793965b8ec9f5ebdda58078651e9304444ed7..8cad0ba0eda9e5d07855fc199ce44bee7d784b43 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJSh_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -438,7 +438,7 @@ nb_kernel_ElecNone_VdwLJSh_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2974563fe1c89c2dcc1067bdfed1b5b71e156398..95bdf3816ab2fa9bd5bf5a17f25f6484c141f358 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJSw_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -478,7 +478,7 @@ nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 428c2661787087a484a63489dc6bffd16d462d1a..5e535c4415c9fa68ae0f57997e043dbd4fffd7cd 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJ_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -409,7 +409,7 @@ nb_kernel_ElecNone_VdwLJ_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e1c4c7d88472a70fcb94f07e470b10f9b136a833..c828dab9cf43b985c2cebd6069fba7e6c14fbee6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -564,7 +564,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e133e87c19ef56c277d93417afd57e05466d0cac..ba9db710e5bdc6b0cdd185045c1cab3f26bb62b2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -788,7 +788,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 37072fb8953c82dd90806c84604f42f4379860e2..197dbb5208d6515f5efc87cbb441bb62aa8cdab4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1298,7 +1298,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3cf1d7973806125ba334de67e5dd9ab0c446d1b3..68183a41fa3ebb8ac574b50e002c30fb54861d23 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -852,7 +852,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7048e64972b5a3c8b423c0151c8e13f2d9f84c89..4f151f07a04a88af0466575d7d3dbfbc73380b90 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1390,7 +1390,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8021c179cb592117d2303dcc027bead7e1b3a4bd..3ef2a15d8811b33606c94da001b7f390afbd10aa 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -476,7 +476,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4014ca7072f01fe379531512701f3633d2cf4981..ee6c6476a5fea3aadabd5833a1ac5592b43baa0b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -700,7 +700,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index bfee852a91a6547832fde80a839fbcfb527b4d6d..76f6c61b4a83a2d93fd3b6e1935514177c5c4626 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1210,7 +1210,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f63b3fd1d4e96c3efe304e7a91d62a5e382a9413..0b5bca15b69bb0f79cbb09a2432c2fb30fae3f40 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -784,7 +784,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index bda2de8c61a88acec77dea2c90f038ab81f1e019..4d31a5ead2f55d20a73ae31f826373743e03c368 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1302,7 +1302,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cbce12f6b78f67de8cfc4d376f6a8afbc91d01df..02b38ae8727689c74fbdeccd42afe96a2ec34649 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -512,7 +512,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 487aba963c20beeb458595cc386306c1f03eb812..3696431daeb59a1378a2a5db7d889500f67b7e42 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -736,7 +736,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index bf244704706751e5ee2c5db808a3fafce6a10f4d..50d1b599a8735b690059eabffdf916ab429eb857 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1246,7 +1246,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 49121762302390daed4a864e48545777807daae4..b9147c65d5d085d6e98854c0a9d5897293be7077 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -822,7 +822,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 63d3b7047583ddd3eebab2c6dc3f8c640fb74462..7df08db4bbe100d90358b6f138713b2e2d70b0ba 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1340,7 +1340,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0906f40f06d3e85eebbb9f3d475d4baf1f59019f..a1de090380caa00f28c323ba08cbd50db6a7df67 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -404,7 +404,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6d9024f7f5de9ee8ed621c1a2dbfc21c20cc6b2f..b522eb7f7445a5c273890330787319d075e59ee8 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -628,7 +628,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2edf290fa989e7d6c71556492133f553c3a02e40..51a7e280e7ce9e1533146874fd075d32e1736742 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3W3_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1169,7 +1169,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3W3_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9a690f56d2e57e91eda0581e7c7e45693e78276a..ee808b452125c76119089aa73c0047c857334b2f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -628,7 +628,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ac67d225b9eb70fe1f2e48e7eb6b9944c4773e7d..e17d9e2f5d33806dbbc512cc52e768107baca320 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4W4_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1171,7 +1171,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4W4_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7c0bacbedbc588985963f3e12edd6c3035967108..45449e158acb9921ae2826618fe8f1af7ba7c4cf 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -537,7 +537,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0d2df8e9f2d48c6e33f2812b6af2c0c512981f03..c58f2cc2c4f10f45d9a39978b74170e0b6734b01 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -721,7 +721,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6136f2eb7444055c03ddee348f3fb2fb5663458a..53bd4e25b7cde3904ca7503275ced71343cf1ccb 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3W3_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1111,7 +1111,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3W3_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d03b2c685fe8f937626cef0aba42092f9071b9fc..d4b8baf2468d1e14d4f0dd527dc8d9d90a678001 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -787,7 +787,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a32953e335d8a160f43880899a1dfd05f44760d5..953f668b6c89698a8f34e20e823192f628946668 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1185,7 +1185,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 34416fb89acf6aa8dd2a3e9da0d874067db424e2..d336ce03b55ccf2acb2f033e7b478e3132870d19 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -444,7 +444,7 @@ nb_kernel_ElecRF_VdwLJ_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 432ca69b07a1c2a4c808b8db3c647ae3e27939f5..b3abd496afd08b402a830e6008f23aa96d3418ab 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -628,7 +628,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ac85366f7d608bd1c6ced1a565393117b402e077..2b4fed87c7bec06aecacfee4070de194c8671ef3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3W3_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1018,7 +1018,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3W3_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 94460605136036af0cda1b59719a0061eba68e6f..668b521026eeaf8c892465b983ec99952ea723e2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -694,7 +694,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e906bc401dd72cd9e4eacef1d162db956bc91e05..7839f2d4dff0602d52cd8e7e2148d2a246836ec0 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4W4_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1092,7 +1092,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4W4_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a0b679df0850ea861f7b9ca8d770bb5dddc553b1..4f4be7a802143b7aeb3aa205889d77aeb7be2491 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomP1P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -379,7 +379,7 @@ nb_kernel_ElecRF_VdwNone_GeomP1P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 731f22bebc3853384968d9a967de3ba4c84c5147..99f170df9ee5682992a7be1de93a0c025e4839ed 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -563,7 +563,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ba9406fe88a0b50baa676aa9e862e52866d01ae6..5724410cbc6765007e1e742b8831c97b2ef6d0a3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3W3_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -984,7 +984,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3W3_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 67f4350dff02e3214c383a8c5b1bb0afe96d3f2f..66f42f7eb51194a78b0978e028ecbfc76309674b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4P1_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -563,7 +563,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4P1_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4e55ae7c5e87475c8e354caf6fe0b898b2fbd30e..f202ba72027c2d19ca1a736706dfdead041e9357 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4W4_VF_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -986,7 +986,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4W4_F_avx_256_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ff436836ee744e4ba27bb210b6d4e356e4fbbe23..b2f53ec01598280107f48a7d38032b2b60d9000e 100644 (file)
@@ -2,7 +2,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,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.
@@ -96,7 +96,7 @@ void
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9093408c6858bc474d54d98f8ded52ec4e4eab32..53f5022bff5fa848e6843c0a74a42e52c8f2e6d2 100755 (executable)
@@ -2,7 +2,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,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.
@@ -91,7 +91,7 @@ Arch       = 'c'
 # 'cutoff' means the interaction is set to 0.0 outside the cutoff
 #
 
-FileHeader = create_copyright_header('2012,2013,2014.2015')
+FileHeader = create_copyright_header('2012,2013,2014.2015,2017')
 FileHeader += """/*
  * Note: this file was generated by the GROMACS """+Arch+""" kernel generator.
  */
index 0d7a10c016a3a0d615f71dc8df59b6956fc8265f..fd9565f095f161a5942770842ccecbd5ea9ad131 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCSTab_VdwBham_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -267,7 +267,7 @@ nb_kernel_ElecCSTab_VdwBham_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d237a0ee99a9c1a4c05728d85d3a6f6e73372fa8..046c15f2b69d1a0cf67b76c43eb97d8401b6a88b 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCSTab_VdwBham_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -396,7 +396,7 @@ nb_kernel_ElecCSTab_VdwBham_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 99bbd4867edad55a0aa6f88c16953a473e254180..41e78c81e7be57f536db1e88e65d42a0ab7565f6 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCSTab_VdwBham_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -692,7 +692,7 @@ nb_kernel_ElecCSTab_VdwBham_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 26b0ac23d7507b67df18e21369fb0eaad754d6f8..1af1e76b6fba8d12dcdef4eaa6d3d34e19a655a4 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCSTab_VdwBham_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -440,7 +440,7 @@ nb_kernel_ElecCSTab_VdwBham_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cea1a66cf3d5029e9588fe19bcf9a3761074620f..f53b7bc7f838ed14ee096b98bb78e47bc68c23e5 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCSTab_VdwBham_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -740,7 +740,7 @@ nb_kernel_ElecCSTab_VdwBham_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d40e006a65944f657e1429e3ce1ec32b0e7d4649..26cfb48f5ee1eec8112367b5923a88b6acb3ba96 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -281,7 +281,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ee67c3f451278bdd891e1707e9e6f109f5fd46ba..02e11fbc301cbd7c8ae2ea6cc748bdc03d62f308 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -410,7 +410,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 66f0aeda798d48c9ca9c71e9d3db176e71931c59..d07d2208c47d54b12059da4f542f541b6b50574e 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -706,7 +706,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 01760c40f43992f3d7d83a39ace3158d6f379c0c..a146b7ff21d0b5e1e4f7ba9ee27d3263769fe09d 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -460,7 +460,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6db227e3d5ef0c8b3d6411aa8dd08627f898df85..e5db3c59811911b2d27558be9b3b9c509c78aed1 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -760,7 +760,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index bf283391aba9862d509a9a8256e8ff02ad38c9b9..3a17fbf5826b4b1bfa2b3c5ef76ca93e371f9235 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -266,7 +266,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a9d7a79320977767091ad046e36de0b1ebd079f9..3af77f7e32f3a8f0fe4e456546ea2ade73f942eb 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -395,7 +395,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 69441935831a87be4bc4a1ad148bf2519fba1dd3..4b5598dd566ca27ff19cd311773d9f564d19b35b 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -691,7 +691,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 207de83f414261efa77554d2aad6fcb1195acd04..9aded273d7ea3ffd46f6a522f25564628ce2065d 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -436,7 +436,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b09eb8a08d6fcee9f639544858efaf7cb6468ebd..5b6672124e4b3b51bf50258a0c5ffa08e7d41e67 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -736,7 +736,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fa5d0570cff028bcfa1c3703977125c5e41a7c60..c77421e80e60fca9a1f0b2fc17ab0f03b01ee061 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -242,7 +242,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 14ead0b7213005feb4b21fa1e38fc8ac7ff05bac..a1cc316dbdfdd6369cb6977a3278173b5bdc67e3 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -371,7 +371,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8d3269ddcd0cb47d623223c4080719c23d2125bd..bcaffe0c0c278c9e96e7ed2ffa06ecaadd8fa35a 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -667,7 +667,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d74aa3b7f3e6c4c779141a4bceda074a184cfe43..b662e734c70eaaa0480af71128bd9892f39c7575 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -371,7 +371,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1cee8e9711642cccbdf961aac28c1d4339c4eb69..a9016be23c96b0f4c25e6e0d026fe1e8b9814c47 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -667,7 +667,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0d11666c83a149c5191ebd04a69c7ba04f3f2dae..9394447fd7f0f964a82b9e7f003e212dce9c3208 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCoul_VdwBham_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -248,7 +248,7 @@ nb_kernel_ElecCoul_VdwBham_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7d19918ddef780e5ce019f964f8d48836fc5b0bf..d0c7e9f4c385d2f399ffcc8a6a4b29f6f4676dd8 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCoul_VdwBham_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -349,7 +349,7 @@ nb_kernel_ElecCoul_VdwBham_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b30f36bdd84e40b03fe10d06619c9dfc41861608..6067542ab41bda3dd4d21895613f6d90d26cb1fa 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCoul_VdwBham_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -561,7 +561,7 @@ nb_kernel_ElecCoul_VdwBham_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 700bc4dbb6143f5fbb39109c5044d8df74060588..6c344ec8d3174b5b1bd14c52c26b41ac738d79eb 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCoul_VdwBham_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -392,7 +392,7 @@ nb_kernel_ElecCoul_VdwBham_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 653509287548c231fc8d78c5caf756c1f72ed0d9..6b4b48daef67976a462521d3869c926ca52e2dcd 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCoul_VdwBham_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -608,7 +608,7 @@ nb_kernel_ElecCoul_VdwBham_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index faf0f3832d56d452658e272be765a3e6198c76fb..6bf15a215ea51dd0e5b2c32ec13082c20e446768 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -276,7 +276,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 535c57dacb93da49c7af29951409ce62b9126576..072d469d10cebbb71b4a079b41feec1101bbfc2e 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -377,7 +377,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0b7e0891605a2249e7f9eb84ec2ae5f38d92b12d..88561d0b9a628ca1a2bf6f15e764935e94724a10 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -589,7 +589,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c0274149cd8f03e7c425b8d3610392cbff33fc42..a127f7d1da5e38573e536a6afcf20b47b7a9d439 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -419,7 +419,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 57c477e6ee76d4b07e769f4b800b63b59df9f664..d4403cfdc58f17c47fcca80d9d1c167a45c60ca0 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -635,7 +635,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5f8aea2a060d3005ca49cc2624d65cb211c1ad56..e5fc669c0d9edd3f4b6ead82ed67f8fb5d848c4b 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -245,7 +245,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 827bd44c088232554db33e2e1576bb48ed9d7d85..263c801e69981a205798fadffbce9cfc7a6aa9fe 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -346,7 +346,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5e6a60607c3eb0489ff761c0183a2efb9f5bed64..4a4e1deffe7dd02f3529ca62df279467b39e9099 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -558,7 +558,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 258e2c2f74361fba9e86f562d4b170781dcdb231..8fbb7f8868b0e60fa69880960e9c3ff191e4dda9 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -388,7 +388,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 62d5b1e23dccfa92b40964cc5e7bd9137b9ca5be..b0f4d8c62779352d3b0a324c3dae45e5ebb15b8a 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -604,7 +604,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fd3eae4ebf8f5b3f41d625507c6a4017b9fc057e..d895ceda2ccbd1764fc51c3064930d589336e395 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -223,7 +223,7 @@ nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f189b395faf3466b00cf5d44021728a3f6dd6dda..81ca904b106f690b6deb9ef05d1c50d804237749 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -324,7 +324,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4d1a0226e817c7f792bbcef5ffdabe103794d289..e6898b625f1560073bf86d550ab672c73b9a0f71 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -536,7 +536,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a498b5749dff9a8df6c6c17a6be90bcf487077d3..6b0a6d9895b2847f58d2d9c9679be5c2cd48831c 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -324,7 +324,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c50512deedcfff8d408c924da005260522eaa2a6..a15fc2bc8e674ef45c91f89a0dccf6207f892ca5 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -536,7 +536,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 376d8317d5f09cdd1cbe6f6c5a93b749fbc051ee..16d2366aceaea675b7e72c3ce67f93852a35e7ba 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSh_VdwBhamSh_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -275,7 +275,7 @@ nb_kernel_ElecEwSh_VdwBhamSh_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f08b4dd890025666c27cfc051374fdde6c3aa0aa..04864f09faa74f930b2d377265ba66882efb4f78 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSh_VdwBhamSh_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -404,7 +404,7 @@ nb_kernel_ElecEwSh_VdwBhamSh_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 38b658e6618a7165a0bd30affb70f4b72383c692..8efb94ab66ca56b516840d870c80c5c1022a54ea 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSh_VdwBhamSh_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -700,7 +700,7 @@ nb_kernel_ElecEwSh_VdwBhamSh_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 89410d96a380cc056f246b43a8d55e00e53a860c..1bc89905e4e3a3b494e96f1722ee00c43dbd9d49 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSh_VdwBhamSh_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -454,7 +454,7 @@ nb_kernel_ElecEwSh_VdwBhamSh_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6d96043c16329350f88dc4432e3deac9b6118966..35440382829c8a4e7d9fb8c46f8c57e32ef64cc3 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSh_VdwBhamSh_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -754,7 +754,7 @@ nb_kernel_ElecEwSh_VdwBhamSh_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8fd75bcfa08983f6770add2f1841264b29dbf070..b1af9e443fe636fe2de386f2be913ad70963e1cf 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -284,7 +284,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8cd28ccaa9a4f20c057c7379d66821b8177a1bec..dc4b7ace6f6904a40fe0700e93b3fb8c8182b8d1 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -415,7 +415,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ed72a029aae4ca137c09582afde3439c24905f75..6738fa23201b19035ed341eaefa1142817bcc091 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -717,7 +717,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 82fc4c4049fcbcfedf89d35df927afef342a219a..3ceac0d20e06910edb7c4754c847bcb57936ec94 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -466,7 +466,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b062fd3a22ab748f36203cdfc740ca6552e00251..12d2e72cac708b06185c859bf0f1fc1e921e58e6 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -772,7 +772,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ccf58775da96cf757749913187d04196f806c584..e12bf37083d537889f898d801affe935df299bfb 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -274,7 +274,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d62376a809be641bfea3ecea19f73a44e5261f3b..f54b51bea50c25261628c17b419b4c765b587115 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -403,7 +403,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index dfbf1e87cec746cafb63d75cc8cf0afe4caf716c..ebcef6fd7ad046d7bc1b5d1b3ce3e555bd83f22b 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -699,7 +699,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5136055e61153195ffad32045beb8488dd0f1b1f..3b36825f8b5085199be42476d0712b55e70f1a83 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -450,7 +450,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5767bc728bb3a0bad569a95b76681a8b26341536..32a7f2c007b361048a3074fd5fa91b7c64d3a3d9 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -750,7 +750,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cff43d685ae21babb7b6dd39f671daf31937b1fa..461d50cf5db36d7114204d8c4b7977b4b7d299b3 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -249,7 +249,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 286a09810a5304a7c4ced1151b97bfbb6ce3a6f5..f98685802ee325591f3ceabcbe672230574662f3 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -378,7 +378,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fdbe199a464f369f306d941b561fcaef30017ad0..9e41b49f0a1b5c0d97ff23fb1652ab670a3f157c 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -674,7 +674,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9ea849c45e8f86ec38ec6f10cc2b12449dd3f64d..ced2a08fa3f522d5503a8c9b837ca14fe04441d7 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -378,7 +378,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e8e8774d7b223adb9036aa4f165487509d50f4c0..41cbff7681e9db0b5c5a0f1b56ddf4bbffcf486a 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -674,7 +674,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 86825249469cda60767360c4c992141ac97ffc2d..6ec920aa4c13287887af414bd57e8a42f469e7ac 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSw_VdwBhamSw_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -297,7 +297,7 @@ nb_kernel_ElecEwSw_VdwBhamSw_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index aae45b0b39e87e2bf3267afd785bc2e042734da8..1d0e5ba2988a8289834883c0481a0853a62d5c5a 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSw_VdwBhamSw_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -450,7 +450,7 @@ nb_kernel_ElecEwSw_VdwBhamSw_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6f17bbfa929f8b436dc9bc944da34365770f7b82..d533ffbff124a64441534f01a1aaf4957f22114b 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSw_VdwBhamSw_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -818,7 +818,7 @@ nb_kernel_ElecEwSw_VdwBhamSw_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 92ec0133eaef27cc6f677d5ee967e8917b46fb45..66dde5ea68c31be5387bf754d80296e23c5e2b86 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSw_VdwBhamSw_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -510,7 +510,7 @@ nb_kernel_ElecEwSw_VdwBhamSw_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9bfbd8d93e081acfb12ead6e6992f4848b06cc21..f32c745c379b64752fdbf820afc8336d89e07586 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSw_VdwBhamSw_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -882,7 +882,7 @@ nb_kernel_ElecEwSw_VdwBhamSw_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d2cd13104d1c836146c92410fb3bd575342225bc..521eb64acb0dde3beee77d3dc0d5610eebac9ff4 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -296,7 +296,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2b2934449bac7a7e63f11a2a319aec4e174c1772..1377fbda137adc7d24ced6fd6fb209ab19b21d63 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -449,7 +449,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 02d23d1943b8b9bce9f448d3ce602dbd1d0c777c..dda77b0363895b637fc7917d68d01926b380b105 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -817,7 +817,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ce543bc06c4d20348973a134da8ee0db4bbffbb6..c6930a25bcea7fa4f0319815df7818d56bdb82eb 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -509,7 +509,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3081c38134362c71b80df212397ef41174d731a5..253139cf6156eb74ef3c3a82cc90d265f73e7200 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -881,7 +881,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index af1146a7496a29bb561b71b92e85e34009e8f334..283403d2072d5d617cac8c5a59a7a0297489f89e 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -272,7 +272,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4dee862d2ebf68209e98a89ba466e9ad2d18158d..1fec98a889d1c3fb05e12ce4687883637e9b1c65 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -425,7 +425,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b194bf6d3efb360eb9139dc5b40faf1940b3f024..193988292ef2f2b2e6a50b4eea47b171e3755344 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -793,7 +793,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 092048344b17ed253e9599284628c95c666f17f3..a18d3cd616c5050b96b66d1c65b962af2f660d56 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -425,7 +425,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f2eab858fe4dd5572fa2efe16f9a6e6cdd8a88d1..5a850638e9acadd33521f4b0456217da18ef55e7 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -793,7 +793,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4fea4cce3dc6d91a48eab5ff0ff6bb9847dd5cb1..701c1a465b30a4d78ba0ff87debdc33d41656323 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwBham_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -263,7 +263,7 @@ nb_kernel_ElecEw_VdwBham_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9ff0e93121d3bb8d384f3055a3d56c7e170d0fd3..5ba2d2c36fa9b832b0239ddd9056da5b29460d4f 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwBham_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -382,7 +382,7 @@ nb_kernel_ElecEw_VdwBham_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 36c2b5a34b41c7afa113c94a5ab5f4e6e9136018..2e6b5561502c9e6fc03ce135dcb5486c44c902cf 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwBham_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -648,7 +648,7 @@ nb_kernel_ElecEw_VdwBham_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4b9d13fab8912d9b64a682e6e13a14b2fcacc916..dc6e59b46e3288b283353fc50558ddd7c377dc56 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwBham_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -427,7 +427,7 @@ nb_kernel_ElecEw_VdwBham_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 85230bab43bf3b6f060c3512013a209034bc8867..8565ce07b43fc6e888ac59e9e1f65d14229d30a9 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwBham_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -697,7 +697,7 @@ nb_kernel_ElecEw_VdwBham_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a700ee8226db07a949ac5c50e48fa06dae2c4f36..b1689a317c48cccbe35910134c76e9c3e624488a 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -291,7 +291,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0e486cefa9cf75aa7672e52d8cdc8cac46444a1d..70ec28a1bf1f52c034f6986fd4e81baeda089c2a 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -410,7 +410,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e2c4a7f460ec922ebf70d9b961e34bfb50acfd13..61a86a4d1a016f08941de4054c73d0e421380d0f 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -676,7 +676,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e1ff6ab4062aaae4874469128d5a9f9499c2936e..efef0f223832b9d0c0408161edad0f9c3cb74632 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -454,7 +454,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4ff54371f4deed884a5e1cf46baf091a3962a58d..347a30b75f071cd32b48310a186a7370d3f412a7 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -724,7 +724,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c406921338b5607fe850adbdc947ab9613b28bbc..5e2e3460a9b42d3e88b18fd17d572594bcc6693b 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -272,7 +272,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b41dd650fdc5bb8354fc0ac2d75c08892eaf988e..aa2bb4422c495c92176fe4dd554bff2786da6d8a 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -393,7 +393,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 60a80ad1a2abedacf669ab281e04b080a35edabd..c5190919510ec173caf6a75c5cd8073e960f7bff 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -665,7 +665,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4df40f041b1af301951b04919d0be4812eb6d62f..cee1bd5e1514cad85c42c0629dd49bf8a5d8a6f4 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -439,7 +439,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7dc6b016d54be072ebede82a4677132507d2fe35..2ed78f509dda70a33c9d1435ef52b54d07612a5d 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -715,7 +715,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 911555f43d3a9ddcb25fa267b9a8f470b954952e..c2d055416c2b135f1d6938caa8f98062135ff4cf 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwLJ_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -262,7 +262,7 @@ nb_kernel_ElecEw_VdwLJ_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0dbed41f06a05ab844694e7ec349f43a42af4b99..ab133f182bf5e4ae57c8f7fa113c632add88589e 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -381,7 +381,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ef90330f447cec80f892f064010bbed52db17aed..291ddeb15c6aa83b7f924519d1f928d1bc5ba1c5 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -647,7 +647,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8b25b339ce60b7abde59eeb4c65928ff0158dfc2..c6355ebc9b896d42148eef5ce9cf97ed8f44932d 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -423,7 +423,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 695882d017855489fce3006fc57fd81014f7b525..c43c342bb6439bb2cad7441fc872f10cfd9d30de 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -693,7 +693,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 66128701f48c7f5f4af7f3d0ec14cff10c4b7df6..c79f811b3866f1e642b6a2d483083d9b9051d132 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwNone_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -240,7 +240,7 @@ nb_kernel_ElecEw_VdwNone_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3072fd12733345ecef0836e3664c85dce543e982..49d7cfcc3c1aff2f33051ec343feeeaac5c402c5 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -359,7 +359,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9c39bbf3117f36db879e4c08e482bf50484d1644..977db61c749b8488f05efbd1a40329ea83592a6e 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -625,7 +625,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6fe7bd99ac41e8b8d96be9ec46894d2775e72c3f..f0bebebdc748babd1a45d84b64253158c4b09007 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -359,7 +359,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 62962d62293dbf361f8da4f1f587e9e391b40461..b95f358f43684bbcf0b34377741f956a3858fc72 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -625,7 +625,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d7db5e4485d23a6c4f26dc95d66211ee2e67d915..9135cc334d8f2bb8ba71e44c17e7253d89bbc393 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecGB_VdwBham_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -293,7 +293,7 @@ nb_kernel_ElecGB_VdwBham_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e25f01970fe9a978924cca95736409faaed5bd20..0ea82ad68d8110ce293e9a44ae48fa539c15c32f 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -316,7 +316,7 @@ nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 083c1aa013d9ca4bdb1ff426be4be32ec5d04b0a..d243c45c26f3b6f3b79d9b4c7dba9d0160cf5556 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -292,7 +292,7 @@ nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 03aca5de02c211622727bcd719a3ca6013533978..b0577208196917a668ef6066c7e2d7c3cacadeae 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -268,7 +268,7 @@ nb_kernel_ElecGB_VdwNone_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index be062afb17631227b4ebe6e71174ed669dbf4290..65209a4d5c6d6e71d834fd93e0ddd43f8e28f8b9 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecNone_VdwBhamSh_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -245,7 +245,7 @@ nb_kernel_ElecNone_VdwBhamSh_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b278ad2c4d06f6a90cdc02da6c9f3c60d3b252b0..486a84cf688157ad54e3e9287efb2f20ccb5e4f1 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecNone_VdwBhamSw_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -265,7 +265,7 @@ nb_kernel_ElecNone_VdwBhamSw_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b5018b6d53053a1331aa404d50a6f7ecb0f65482..5e6e0e26fa16d9289767e552c355992d4089e04b 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecNone_VdwBham_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -234,7 +234,7 @@ nb_kernel_ElecNone_VdwBham_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 83b18cf993ba24ca029677df33b20d12d8cd57f5..f7563e13d9bc37d1e5b9cdb24e1ef0e42ce6570f 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -260,7 +260,7 @@ nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9493615dd1dce0c8cfda2b1b9d7e0c0f65cdf5ce..ca28ffa73587f8e1a545a308b13a8569ebb06f07 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -254,7 +254,7 @@ nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ede5a3002f461512a48669b68025939055279aee..9e22898187d2495ecb4f6a165f05b510bb900e71 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -243,7 +243,7 @@ nb_kernel_ElecNone_VdwLJEw_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f743cf005bab9088b64689d4542fe7293a30192e..d1e119e235b20e4488879ea93da0f7e95d5094f4 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecNone_VdwLJSh_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -240,7 +240,7 @@ nb_kernel_ElecNone_VdwLJSh_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 828d717fd0e4ca77618e4a2e65e381d80063addd..8e3b2f00c8eb2544f1408109490b82c91590ed42 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecNone_VdwLJSw_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -264,7 +264,7 @@ nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2ac35ddc1300defdbefe765881c146609c1bce9b..c293a0a057e5e5be071acd13cefd9a404fa993a8 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecNone_VdwLJ_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -229,7 +229,7 @@ nb_kernel_ElecNone_VdwLJ_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2016ac69d0a265f3702c7ce08dea4cba536e660f..e5ccc1f81600f27f0fa35cf83ce6661719becad8 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwBhamSh_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -263,7 +263,7 @@ nb_kernel_ElecRFCut_VdwBhamSh_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f119a74c366f797c022a7e1b8d8c6efec16519e1..8cc3adce2141e2a74de87e1203d88f19406f8644 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwBhamSh_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -374,7 +374,7 @@ nb_kernel_ElecRFCut_VdwBhamSh_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 81af12a3798f361e8887b3c0f4534be4d7f6252e..43b60a6a07bbc6cf43149764654ff0d003e74dc0 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwBhamSh_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -616,7 +616,7 @@ nb_kernel_ElecRFCut_VdwBhamSh_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0ae5d2aeac9b7ff9f507e7eb86a37e59c0fc7008..5c3cf6bf9c8db2bf0632f19841bf2b934815c80e 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwBhamSh_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -422,7 +422,7 @@ nb_kernel_ElecRFCut_VdwBhamSh_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b5b365a2bb9e4a936ff304eaacc61280fca3db58..95086b6534f4d6e44ddd7d42efbfc93324e4d25c 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwBhamSh_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -668,7 +668,7 @@ nb_kernel_ElecRFCut_VdwBhamSh_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 00b272546e07413a346795db7f305d1f72abb6bf..e930efbac3d02e8699ad538b8dd6e34ecce38692 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwBhamSw_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -283,7 +283,7 @@ nb_kernel_ElecRFCut_VdwBhamSw_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e2d4b95721a06cc1a6ce2abf8c952e59529deab4..0f8c3503fe3eccec2a081d274e2bc1ec31639c5a 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwBhamSw_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -394,7 +394,7 @@ nb_kernel_ElecRFCut_VdwBhamSw_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9ff424e18c9527d508e17d2983aed1464b8e1761..2db8d3340c7abd1d6f04e0f2bbb80f9748577376 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwBhamSw_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -636,7 +636,7 @@ nb_kernel_ElecRFCut_VdwBhamSw_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3450e0db1fa6331c9accf05244e90ac8ed2ed777..276c50a7ea17655244af4ddccb1bd76da83bd075 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwBhamSw_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -442,7 +442,7 @@ nb_kernel_ElecRFCut_VdwBhamSw_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 674b9b1e223eda4a027aa8f4c64ba7ae5a316d91..e69f252f965a9a651d87477c52ccde93f11e889a 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwBhamSw_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -688,7 +688,7 @@ nb_kernel_ElecRFCut_VdwBhamSw_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 288823836716cb39b04e8932124ba473cdcbd711..16cc6f32f9ce3ea91652f90002ad2e86e90279a9 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -288,7 +288,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 612e4d0b0d9d1aab13b091264d2df8528e563871..a85b1780f0952e8f075e3c7d2884b0ff0bc16954 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -399,7 +399,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2e220f3402cf0056418e34e46159560dc558ffcf..fd95cc7754ea317923ba207badec1a2f1e5d47c8 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -641,7 +641,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8c12e6aeafb44d20ee9e9d87535e2e774a448b52..47a1de5fb62bdddf54dd9a8c4c124032be4e97c8 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -441,7 +441,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 29eb463d8753faf14cd81ea4192df41325cdf432..505eef54ead22e4b5eec53ba71f0ae8def013860 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -692,7 +692,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a004a181cd6c0b99dd1df6e9467d67955ca25558..12bce6f3c760a1bb26043024570254c0b8789e92 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -260,7 +260,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7ac06a3a4f46945c1a56e5e16344cfd4696a1868..f8c5498fe2d8795dd40a4c79b544cf5608e42850 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -371,7 +371,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9af30bc53b8775766c1c0b1f1ce34a88455627fb..dc60b3c5833fb1a65db5bdb6693d20c6acf7a304 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -613,7 +613,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index df5244be9e8e9f8995be61644ce3d3f2e5ec278a..01354804a0f17dd7d31509c283cf59bc091ae35b 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -418,7 +418,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index dc0877818e89cd542ea0a78dc24c81421fcb03ed..90c7bf1d2f4a0a84203abe2cede2568d8889a698 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -664,7 +664,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ec4f4b8b5dddf5f446e42e5c670ec25bdac22f2c..9165896f09f455149638fa50efedfe72dac1f38d 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -282,7 +282,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d9bbe5611e1fa631b2d3f0e874107c029e3a49bd..8465ce770a77fddce4e6785271432d493c32193d 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -393,7 +393,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2e249c2a14be15f22816444901e1f5ffb747ef67..223f638aa9bf0feeb6e6db40759c4132e27389ec 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -635,7 +635,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7eb58db6f4ebec5a26782bbee251b32c19f6224c..f3d7a1681671feadaf4451e5792bf59e3462ff26 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -441,7 +441,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index dfa6548753ff92e75eb279301248669526c1da44..bad5f932e5ef1f49343b72eec0e8ac7de085a791 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -687,7 +687,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 85a59a25ba961e9bc133a7ad3c6bd67b7251dd2e..3af4a11a7f47670dafafe81ed68d07fbb37fe5be 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -235,7 +235,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 65d771ce0fe20b9d01c486eba12491e0c25a9484..deb7fc1996aedfc1382c321e7496a75a8ae1aad5 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -346,7 +346,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5d3f7ed9e15955074790ed9dca86f7daad78b203..629d69517255a478e9d13cf48b2af544e296d131 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -588,7 +588,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2df4ed430a868432e47b72b51b71f471c543be4d..43903f1f4957f6273b61e315a7295985df0194a6 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -346,7 +346,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 48859cd801438394b6ddd8fe899027322703f4e0..cb7b10409635e984bf92d77f282b4797cd917729 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -588,7 +588,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0087a3b487641c5cf8322691ef507e6a15e09940..a2b38d8b7a3781c0f897ea1b400df6ead4cc57fd 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRF_VdwBham_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -251,7 +251,7 @@ nb_kernel_ElecRF_VdwBham_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a7a73cc8dadd3f8afb2d24cac93f39eeae8edc6c..9082c3702ae50b363fed5ac0b7f9ea0de2787792 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRF_VdwBham_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -352,7 +352,7 @@ nb_kernel_ElecRF_VdwBham_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 54c363f7e55d92bd746bab78ef8cd9796b7847d0..cd38791b6e6b2a637aca91bc5826fbbd34f08faf 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRF_VdwBham_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -564,7 +564,7 @@ nb_kernel_ElecRF_VdwBham_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index bf969819d37e719ad4b8547a1ce5c2916f4720df..e005883e268de1995bc770d715adf604c05ee9f3 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRF_VdwBham_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -395,7 +395,7 @@ nb_kernel_ElecRF_VdwBham_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2c0165a0848e61d0f2997c6981d17ee7f4cb9aab..d300af7a9deff90d6b64d42860364bbf5f47b032 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRF_VdwBham_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -611,7 +611,7 @@ nb_kernel_ElecRF_VdwBham_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7abc0b02e4b0d807df15f224793a4ef51b5a598b..a089882588a191be56745385406b56e6cdb170e3 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -279,7 +279,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9dcf1504eac58d68838d36375fb4bb322e12ff57..037341d580942092aaa661fa471c9a3c91fe9b3c 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -380,7 +380,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5b13589cc12bd9f59fee98c8eaf5eb34a7041f99..fa278111d0ceabe9058580c177965c100640ef1d 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -592,7 +592,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0cea55c60dd2b5f36136a36b68cfa3288f9ec218..30aa9977c0919e152409d2eda25494e6a772947c 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -422,7 +422,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f59f8b8fd9a52216c738f86cf423061ee3552b35..7d1f53fc57d34f7b4f146c09432191208fefbaf2 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -638,7 +638,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 043b4b82089a49428da98f500b51d922a170b4d0..77bde448b95e63cf0405644609c8cb9d24f600fa 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRF_VdwLJ_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -248,7 +248,7 @@ nb_kernel_ElecRF_VdwLJ_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 77a5c539f23bff891858faf08ea77be62503bc27..186e4f040ab540bfe0f551d587026f0be10b13e0 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -349,7 +349,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 31fa445c7015c58b28f064c56eec01642d49345e..f6d23d0d5020f2eae7d0b002d90f97e41fa90539 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -561,7 +561,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1d4f9d22f5cb45a4137a3b689e04f1d137d00c6c..af559cfe1d5ee4433a00b5ed056b981ecc9f652d 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -391,7 +391,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1d32ecbe476931fc95c961e9d102f38187b6f068..6f527d222882e672cde5cf2c1257e5972dff7317 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -607,7 +607,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ba5cde69adbf44fac31f9cfc03f37c2226601f8c..ee97049cbf818fc3ffce1ab899aef13dc7f22325 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRF_VdwNone_GeomP1P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -226,7 +226,7 @@ nb_kernel_ElecRF_VdwNone_GeomP1P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a084b5b2ef78668b1992ce08e249695dc8541764..933b4fa75ca4f51fa46f7e4a19beb3b8e490c2fc 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -327,7 +327,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a550a75417b100dc283d89db781d029b9739837b..d8494fbcacfbf004a6a6b9c13185e277c8862548 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3W3_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -539,7 +539,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3W3_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8993752246c4139234c5b913346ff0075d5f1d0e..e0407a0aeb21d77b404e8e67ef0ce1c3d2e9d420 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4P1_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -327,7 +327,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4P1_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ce2507ba6b8d5102c6f62e65027c483d8625d1a3..563121e88840e87060fea45cfc716e42411916db 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,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.
@@ -56,7 +56,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4W4_VF_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -539,7 +539,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4W4_F_c
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b5f42da586f0a9130eeb5d78b676e9793172f001..9e1e281dcdf239888860c77792cd0322b99339a4 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, by the GROMACS development team, led by
+ * 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.
@@ -240,7 +240,7 @@ void
 nb_kernel_allvsall(t_nblist gmx_unused *     nlist,
                    rvec *                    xx,
                    rvec *                    ff,
-                   t_forcerec *              fr,
+                   struct t_forcerec *       fr,
                    t_mdatoms *               mdatoms,
                    nb_kernel_data_t *        kernel_data,
                    t_nrnb *                  nrnb)
index c76fe2d097465b3ecff8c36c47bf8d773829de47..c42bcde81cf1c9b7f3c1ed95837f704514053369 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * 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.
@@ -51,7 +51,7 @@ void
 nb_kernel_allvsall(t_nblist *                nlist,
                    rvec *                    x,
                    rvec *                    f,
-                   t_forcerec *              fr,
+                   struct t_forcerec *       fr,
                    t_mdatoms *               mdatoms,
                    nb_kernel_data_t *        kernel_data,
                    t_nrnb *                  nrnb);
index a82a3238442e8abf1c7cc3c644878e1983eb8b66..ceda39c8b53d1150b07389aa4e13eaa7e95f898d 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, by the GROMACS development team, led by
+ * 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.
@@ -241,7 +241,7 @@ void
 nb_kernel_allvsallgb(t_nblist gmx_unused *     nlist,
                      rvec *                    xx,
                      rvec *                    ff,
-                     t_forcerec *              fr,
+                     struct t_forcerec *       fr,
                      t_mdatoms *               mdatoms,
                      nb_kernel_data_t *        kernel_data,
                      t_nrnb *                  nrnb)
index 26634e0f34fc66467df3d0b35cd09f3259d38e8f..c50c3aee4a6cde21f8dd7e8d58384ae013b8afb1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * 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.
@@ -51,7 +51,7 @@ void
 nb_kernel_allvsallgb(t_nblist *                nlist,
                      rvec *                    x,
                      rvec *                    f,
-                     t_forcerec *              fr,
+                     struct t_forcerec *       fr,
                      t_mdatoms *               mdatoms,
                      nb_kernel_data_t *        kernel_data,
                      t_nrnb *                  nrnb);
index a8f357d17f4ddb8bd25197e1b4c7d00b1e961857..bf9b8385e732e114fc5a6625a48b5be8be2b7a18 100644 (file)
@@ -2,7 +2,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,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.
@@ -115,7 +115,7 @@ void
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index df8fb1b93f64d038534ea50e728f40e129f797a5..6352ce3c0d1042a319c2ea4c50c60a6c9edfaa48 100755 (executable)
@@ -2,7 +2,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,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.
@@ -91,7 +91,7 @@ Arch       = 'sparc64_hpc_ace_double'
 # 'cutoff' means the interaction is set to 0.0 outside the cutoff
 #
 
-FileHeader = create_copyright_header('2012,2013,2014,2015')
+FileHeader = create_copyright_header('2012,2013,2014,2015,2017')
 FileHeader += """/*
  * Note: this file was generated by the GROMACS """+Arch+""" kernel generator.
  */
index 16f8c5a0b182bdfec5eeafbe6ade8b5cb0ffe4ca..63faa4d9d247cf3411eaf54ae1fe1585cf362993 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -406,7 +406,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index daf9ae6debf62476ccc6e9783ca05abfecf27347..d65432f68a1e3f3e9166a77ef050c88d2770bfc7 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -648,7 +648,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d559591ec5414c151ac39309ba8884d0150905c4..fa9888787b9b4317cc8b96c454cd32312e7a070c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1249,7 +1249,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0781c0a4fcdd53b37b88f37555d6ef839e8be868..a7cb40dfda8712a7a9974e965db08f32a462e37b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -728,7 +728,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c7017a0d2a7494a53419db7ae31bb93c325fe162..6156b28a08d55226d037eded776d8b53b1c7d63c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1335,7 +1335,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c9483b61cb91db3fcc07adbae8a94a2009675b5a..aedb7b4611a4f149fc97aae03cad7fed0e6b8aa3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -366,7 +366,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f8a7fbcff9bce3a1a9da86f57416d27741b9ad5c..89d4c809a2badb1d73f570b0a6956e367f78e80f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -608,7 +608,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fd7243a2597f1fa480824325ef2dbeee08a1d91a..0776562faf3e65739ad728bf05b42de853d2bf22 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1209,7 +1209,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6c623e128d81a4e1f17f68bfa048789435d2ef51..d224c4b501971036b100e6484c64e21e91f24218 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -662,7 +662,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3f524f4eeaba7f9fc6d190cccd60db8449f50529..467004aa662f276925c00be67022fcb41cbe53fe 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1269,7 +1269,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f2d675c0492642c4ff7fa74ae6da62029ecc9060..693af7c59e1c481b45940920e4c72426f3e7f594 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -324,7 +324,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6a8dbeb066a87b564a9a1a095af163a8760e3a45..12c63c8cbed5364d0472974b0e258cbd1415ae77 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -566,7 +566,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index eff71244c1596ec3bf01ebc5f95d08727836d262..2d7a457ebb6af04fd0750434bf151c9d6032aa2d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1171,7 +1171,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 264b04652b09ebd6a83d8b3d76d827e56074db99..8a9a81af266a41ee421d64056f88c02d1a97c26b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -566,7 +566,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 380e92ff73d5ef58ee0d31e9e747064e7a076dac..d1c8198021b184d9007dd5d866852eaa2292fa2d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1171,7 +1171,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5eb7fe74366b5b0934c1e4e7fe1dee9698d4a355..ee4b67591b119f5c6f5446e021d3ed5434069699 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -388,7 +388,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a1aa2b6a31910340a1c4d9289f80594ac512edd3..8453b395a30e1166a6e690f99559d5cb4fff40bd 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -550,7 +550,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b128b75fe43365c9d227b2214a57e64e213c5912..4dae3d8cbda77375efba5c2b5bae0f8f5333bc69 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -911,7 +911,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 42d6e0ca2575bd368686f5540b38b02cd01f3fa4..72e17014e34a172c8565aaa462a4e878a92f3947 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -606,7 +606,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8df74488f58a7b0ceda8f80ab7621ab6f02a69fa..303997e0256548b11b2e4f70ca0bb08a921afb29 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -973,7 +973,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 63c36cab85941db40ad8fd200e11b2062b9dbb7d..009307a7a3d157f5c66dc879454c543650402601 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -319,7 +319,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9815ce539b935c501b320eb01e3824fd8bc5c23b..706c7fbb7ad804d024ff36c3235172a1eff442a5 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -481,7 +481,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index dfa9b8bc0f2ed77643c24aeec3d92e737ff5fcc3..cf61dd656443ff3ccdb9a13a583483a438b93847 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -842,7 +842,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 52c05ae97992452a223292e31dccaab096efa4e7..21241aeed5268893dfb7b0d0c8294fb83c95f5ef 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -537,7 +537,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4d16ba6ba21fc2a00d9a9aaef648403bd21ed5c0..2d813ccba06a4a17c6561e3b1eb105c4a9d0598f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -904,7 +904,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f42785de810ffd7d26d592f41841beec05ee0c9b..0c1a120239ac6c6da86b4c47e1e783e1bd7e33c5 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -281,7 +281,7 @@ nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 07a52ee68fff75f864f05c0582f59e23997075ce..b9420453a003bc0c92b8b2f875e164bc380f7d8d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -443,7 +443,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index eb3ef6629e42dc6a4c395a040df5af9dd00508b4..5947a28bb994080041ee2dfc2a7f7e4b2ae2a221 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -808,7 +808,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3c79ca974a81b11713641f8e53105b150c4a9920..2a2a1ef423fa719248636921bead697a3aa9ae5d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -443,7 +443,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 90295f6967e49e5488ed3489d0b3976ab6477ada..6c2b211b2351ed9a436fdc46848f719cbdf76d68 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -808,7 +808,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c02cbd3dc2b6b7f29d2db025e0dea4a47d9cb6a7..6210ef21e9766b751e9ef57f17419c0e7de16074 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -419,7 +419,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 817026df5395ebaa401d5649460a3ed94f76080f..6e4773b4c4688a941b82515c568473a56e9f27af 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -691,7 +691,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f5b6006dc4cdbf5884ef64c0b5f4547d155618b7..4b08eb1bf5fd548f60c16a013ff6232ae666de8a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1377,7 +1377,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 71ae9b51d05fb215f405394c1eb53026faefd215..cf1c9080dba39bf27de608e93d98795e4cf5c8a8 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -772,7 +772,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 777e0b3d6c1540b84e369a4c9bae320ce2561ccd..6abdb83bc349013a65b23db560baa7b06ea5b774 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1464,7 +1464,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 40b7e120254d0404115d7c5ac05f4eb737ace03c..ecc1a5f50010b8029ad99d89d06b431de86c5a5c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -392,7 +392,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1b6db120e4310813ee241ae01cd1646529c0ccac..c76adaa7bb6985bc88dd73d88dbc2a3d8abca87c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -662,7 +662,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 74beab81bdd0167f96bb7d8f057ab47484a0a696..b5e615d805a6f07a42fe29e45272c22bf56fe4d9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1347,7 +1347,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c4b8180b34945f66f80713c46b705c674add50af..c8c1c24022f3a791f94d9adaddc80d6c57cbfd8a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -736,7 +736,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3a78fd328dd355e3d44063358dee0a803b276db7..5f271a4c7944c1e87d9098c4ece69c572163c28e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1427,7 +1427,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 317317995049eb60562aea72f5bd66e42872d2f6..40b243e2f1785ca63c27c39788c8c91590fe955f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -347,7 +347,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7010653d9af8d8afd85b335d8cb9d8f56aa2d2cb..a4f85bd533a46ff71654b9c98e1f50417682b4a2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -617,7 +617,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8006310f8ff6519548cb0948ccdd876d7ca623a4..c160d5c1d0b809734c81c95b7c91490a17de5d07 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3W3_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1306,7 +1306,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3W3_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 79fabdf367e9d376f8cbf681a118f8792c44d67d..2fc5a89c2f479c4dd2a8fc3563bf3b0abdd46210 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -617,7 +617,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 24604aef8a789ff84ee4bec871748eebe3367011..2fe2faeac02de002491e88595e3054333bac0900 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4W4_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1306,7 +1306,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4W4_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 28fbac0eaa29426f08277bdad69ef47f97649f93..2cec3cfa4d0154a600a1b769a4279a40f0c78591 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -427,7 +427,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c1f270a4d51e348cbe710f592dcb30a8489bc573..26c590032f58c3dc2bb6fe0e3e5ba7240ad3cfe1 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -741,7 +741,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0b70266dbbf045cf8ffe4ddd1f8b621203069063..e89a5908d5fab190bf30217feb931692b5b43b4f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1558,7 +1558,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9988a3cd13e119eb8608789eae87272f5c1511aa..d4c65e130bbcb41a3141bb5636a8f5f9b072a89d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -839,7 +839,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 81ab7ee551aa047da6fde335a129368f7269d8fa..7070440f80d741807eaf52587d18eae374fc24b2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1662,7 +1662,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 760ff562e0d5aa69eab510bd9a2f00536e15e103..52d6dddd5a467b4492bf835bc2d9a39f808524e1 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -383,7 +383,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2602385fd86ba280d10ed867112c4a440895832a..0e02aec6d02f64468994e90c8cb4f161669f6f6d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -697,7 +697,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2fda4235ef3b7f02ff515a71aa11d4dcc9b65144..5168a2ec40296c9ab7867aea4134d71277398b33 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3W3_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1518,7 +1518,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3W3_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a155993cc07c08e423b82405a0090dd6fd0d15e7..da2f166128b3e25a95e5128265d93c94513049b0 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -697,7 +697,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3a71e72fbf4f4567c572b388408cf5a458c7cd8f..5e947d0aa63b4b17effc2ac1b1b7ffbd24fb6690 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1518,7 +1518,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3f8ec61912deadfb7df554e819336f5e870c42ca..76fda495f14a07d966d0b80afcb7d05728ae81c8 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -425,7 +425,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fba186922e0269c070d81ae1b060b84ed63af245..0b64b2cc02d1dcfd9bf00681174f5d0426c57a46 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -655,7 +655,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 52be43d1b688df47b94062586e178ef87d9dc1ad..05b3fdb3c7225bc219ca0f3538d499aedd174fd4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3W3_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1220,7 +1220,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3W3_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4f074416c45b48ab5fc747e849d019c908f06582..900200627402e000dcaccc4140d1c879c60a454e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -715,7 +715,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 89c08f69ede26a72b014c162e4d76b5288ba811a..63b27da8d082910503dee23a15f17a1800c31aa9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1286,7 +1286,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5f3df75a4d13465800ab6fe29afba86a9fba6123..0758ed845f73615624f46d14ede3f7df64594b09 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -387,7 +387,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e02ee71c1829edc23fc27765d8e43d5bed9fffa6..6b35c0bd2662aac3792dc84a2eb6123b75dbe2a2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -619,7 +619,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c2efe730b741f7c3610af10b02029a4169d2080e..34ebe42db8b39d332e04cc5df3ed8e6b7586f4b8 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3W3_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1185,7 +1185,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3W3_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b48bff01320c914ca3f76df23fbd26334f4cb656..7cfa02b0dfbceb3f062e00ff10827e56b54c05c5 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -682,7 +682,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1fce7c397fc7c4e26afca4f13594599974be4ac1..2da6403fa0daebb049d614f3eb21c97173562857 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4W4_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1254,7 +1254,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4W4_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b2c150031d7d1ba80bf05d142620419bea1ace24..7de71a80abd39e57d7f651c0213617dc01e101ca 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -360,7 +360,7 @@ nb_kernel_ElecEw_VdwLJ_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 09bde1920ed4c23ffa9d5c10d9432799a0532ba2..ba1ce3fe88f5f91fd6833a1550007a63e9a9e268 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -590,7 +590,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 76f7e7898f66d3f94c04370cc5006140b00a2f5c..521823ae64272e705c0921e76772c4ef808dd10c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3W3_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1155,7 +1155,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3W3_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 00817d2d8e6a2dfc6578ff2d07796d5ed7fd7c18..70145de6581198fce3c83411031db41a5b92b4cd 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -646,7 +646,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b58f416fee754498c6f8736966f8664f321f92cf..e31b5cdd6f7d9811489a0eeff0bf8db1b8eb241f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4W4_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1217,7 +1217,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4W4_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5da0ae7e96364a28c80abe15df517d9f16d92919..7de7e84415630c3115f23f630c1f2695f8c979a3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -322,7 +322,7 @@ nb_kernel_ElecEw_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 05bcec3da2994f45f17251638b8adeee07c41b0c..09da860ee98cbbd30dbeb73a001ab1d717e7ece5 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -552,7 +552,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 12f17351456cdc9d075abd2d4f19e9faf3ac054b..24da62fe7753cebed204760c861d3cab7539d031 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3W3_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1121,7 +1121,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3W3_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b63ed4be7ec5f6794982bdf4b22eb0a8127f012a..c8a9eb1a35bd36bd389a93f08ee533066db31fab 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -552,7 +552,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8acd68c267d18319f602dc3275d68b7d3636e4bc..3928c819ff7ced5184db1b0addffb89e60e55acb 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4W4_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1121,7 +1121,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4W4_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4a55df08bbaff364512c48fea89ff893a27ed366..af66e91dd4dfa4a3f64e711ebb21fc3c4ad3498e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -460,7 +460,7 @@ nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index eff8021263dd501a96161a274cd172a2a69adb81..9688988e4d6a92f195e1dc5bd56870b742b12ba6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -401,7 +401,7 @@ nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ab0c1408d18cc8198e9e5022886e2afe7e69ed8e..785a777d2ff0852127a19ad98b82f83b90693329 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -359,7 +359,7 @@ nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f7a1da7d6e11b880b16e075c1ebaf37ba8ddabba..03f73854ea2c3fc39c796c4ed23347fa89757f5a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -362,7 +362,7 @@ nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e5ff56b94c43952b2874ce106b072641504d4515..4f0a215153be01c5a17f7748f6e0cbf109c54234 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -357,7 +357,7 @@ nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8db96357a52b87a814b9f6cb2302475da46ee45d..544c6be9e3e9031d176e5677bde742a2ec6d6075 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -328,7 +328,7 @@ nb_kernel_ElecNone_VdwLJEw_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4975df23ce557a4fe2c103dcffaf3b1b0457ae29..f6fa566d1333ea0b0de8afebc3cd830725d781ac 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJSh_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -322,7 +322,7 @@ nb_kernel_ElecNone_VdwLJSh_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7dbb4b5eb9bbcd521a04b6ea4570ee79ee363cd8..18b9bcd4743f6e9346833c796a069a5d7936846e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJSw_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -361,7 +361,7 @@ nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ef74b171d0e9c9c0ef139dded0fb9b776de42c9b..46891e68de656f93900eecfabfa983e3b14afdc8 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJ_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -293,7 +293,7 @@ nb_kernel_ElecNone_VdwLJ_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9a4fb7eb21501bea7d582fa9a930da86a6a15b2b..3aa6c27059cf09f08d4c12813ba4de09dbebd45f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -418,7 +418,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f5436d9234010f9d8466697c729fee075994d1b9..b05c3ab7a2b8b976a83e68eba32008835eec3d4b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -620,7 +620,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3b0e2d905168e15e1811c8af9b26b7caed9fb24e..61deeee46a0e95982fea2e8e837e4a7632ffcb0d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1101,7 +1101,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 65a9831b8f06fe1fb947c680e1852e319614856c..d89556cb0697fc67f448790ecf558e654377ae66 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -674,7 +674,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e127ba3864118f47865d36c47b035a551c695a23..9e723235409746e1623f78824f64e5b0a8061bfe 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1161,7 +1161,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a076ee6eff057239f739d1b65812ff9b5d69788b..e06274a96b9d6724f77722b51a2826b0bd0d4334 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -354,7 +354,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 58fb0d10eaa86d35504a89b44185db440983f9ed..b992d13af4af90b7f81ad05b4137dfc7dfd9c38f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -556,7 +556,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e27ef1aab4d0218a23268a4d968b1e59401e39f3..4cff3299fbc1f00662b75d7ec36ceb06384cfadf 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1037,7 +1037,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7ce4b9aed70ea6d552b67dfbfe21f9498c576578..d8f6ed49ca986e466659e8d6102539d48a004096 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -630,7 +630,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8603690b1e118fa7c56ea43671590bba3f1794b7..6ba46b780984b056a396ad885c12c8c788369822 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1117,7 +1117,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 39f7a4fb2476459a49a5309ddc2429bf5eda4642..628951487774d2653f5a957a219185881211ac57 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -389,7 +389,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2981e28d44eed22b55c9bc12b793f9feda28d9d8..bfe9bb3b912b2c989da71baae7efd246b2f141dd 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -591,7 +591,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9621b8a43961ea2ea009435c8b01f200b127370e..984dd08da3fc8ea92403ab92dc6ad0aaf73f9be4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1072,7 +1072,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4624e98d743fc77d75cf8547b382e6c18dc438ab..94e5c48461c247d85a2cf2217788173321a6c474 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -667,7 +667,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9620b47d3d2676c6207094f01c38336f070113c2..4015f43ebe5d5aad9ec0d739e5bdff31267590d4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1154,7 +1154,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 77f76cbfae5a2f79021bcc4bf260d11a8f87020b..bb80ece6d5012b23b92e4a346bd530b584e8ff19 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -309,7 +309,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b42015f28693b5c0bac5c93b0b84d4670e299547..d61401fd4fb9f3e432ce861312b683de8ea54ddd 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -511,7 +511,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cdbdcaca1a2fd2bc79b14caeafd7d23ffa93c58d..dcab03da333612511e2bd4b34766328a24f57035 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3W3_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -996,7 +996,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3W3_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cad10aa75dd7efff2e02550d507039ac8e54b3e3..11809afdb3f15deed3f3e2da3464534bab2daa88 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -511,7 +511,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ec3e33dc4331556e102f46ba6b30fa34ca80e7c4..89ea6d5989affe70725c46c419c8a1acdb3cd0ee 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4W4_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -996,7 +996,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4W4_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5186637eb31919a2ffd8038a85a6d5f363c31ed7..4f1404f7ee574143650f6774ea1cffd25a96f8e5 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -391,7 +391,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6fcefdfa449b22554bacea8df00d116db7e6208d..9973111ded40f022b8a22a33465bc2778e2676ac 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -553,7 +553,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 05914df90be20a27a9d59492473c3caf16791670..603e7dbd7491d1a7efc4b61e07beaa6c879091b1 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3W3_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -914,7 +914,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3W3_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c32477a0ca2b300406f58fd5a94553812eddf62b..148bdb9f30a2010ad215e3dc78bc7d40887cdb12 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -609,7 +609,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 193b78bacef03ad9ebd4a82931df6d778d98862c..0cb449f8ef203d7ad302edbd1a42166bd47d4fb9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -976,7 +976,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c1b33d4dc07a6b5a84fb97b1e3597fb7f80acb20..f1027a489bc753f3cc203658b6a284dd73785e09 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -322,7 +322,7 @@ nb_kernel_ElecRF_VdwLJ_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fb3c26089ed992f5702f4184566f77437564cb59..20d57176b4c212806eb3325e5c3984d032b3a51a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -484,7 +484,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index bb0823ab5759582e018a2890d868f69c684e57ad..5369ee287c3bb48c802c4b27c9c30f1838ae998c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3W3_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -845,7 +845,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3W3_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 30d611780b6b17478a8a99eafbced4382a60a68f..81ce72df6d1f589083d86e1bde1ebd80db84bfb4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -540,7 +540,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9df43c0ba7bbeb84eaa4fb1523649aedd162ade6..d960d9a2cc28a140f423a7efdfbc38725e636699 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4W4_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -907,7 +907,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4W4_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 893b03cb765554af2484fef7382faa03fd4b67f7..90e69ebdcc3dcb4a04d96976ed69f54148b8468c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -284,7 +284,7 @@ nb_kernel_ElecRF_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4feb3d62187cfc501203171022682f6c8ab93673..bf0f6a884c65b58a2e58659d12690bfa33982e92 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -446,7 +446,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5fd6d839b8d32e17968bdfee1db8968b4595b950..241a216a190e48e72552d7804f5bc8052f83e92d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3W3_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -811,7 +811,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3W3_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 06844cf0eddd3b15827b0d5152b602e7f201e896..ebb564c03413332550adf3232888088ab2698342 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4P1_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -446,7 +446,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4P1_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5c5f4ea6242d0ddcaa236c4bc1339455d4c8420a..f3ec5659294a1c2d4e52352a09ccfacdd4311a1e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4W4_VF_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -811,7 +811,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4W4_F_sparc64_hpc_ace_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 08969aaafc4b812ac7af4e87a811de9eb4739e19..1855e9ed4e987153a196d2b39f2a52ce4b266101 100644 (file)
@@ -2,7 +2,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,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.
@@ -93,7 +93,7 @@ void
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7941448be0668c697c2f197c403aee4e6f215fc7..0fb6d3c14cad0541442a743de21bb6264369f331 100755 (executable)
@@ -2,7 +2,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,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.
@@ -91,7 +91,7 @@ Arch       = 'sse2_double'
 # 'cutoff' means the interaction is set to 0.0 outside the cutoff
 #
 
-FileHeader = create_copyright_header('2012,2013,2014')
+FileHeader = create_copyright_header('2012,2013,2014,2015,2017')
 FileHeader += """/*
  * Note: this file was generated by the GROMACS """+Arch+""" kernel generator.
  */
index 62b5bc30f80ba63905a6fa8a08bbb89a1531a5c3..e89a45619834fdb44f4ccd3746b47046b8ab92a9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -413,7 +413,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 207d54e509ab7ed221c68908974cd0cbdf6af877..220c0ad243ceeee6322a9dad62c7dd58920d6904 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -663,7 +663,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 910921a45af8e88d0228d0cb46f8205f303b90a5..9a253c7dcc656b510e03fedc63e03eeec9d2859f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1289,7 +1289,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b3ed7ad1a7c8a31c7ed83869c67de12bbdf99dc6..963fca56644b5627a9b5a257e0de47877f4e2d9c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -745,7 +745,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cccc4f86a136728053a6bfdf4fa569d9a2338231..fd6cf36cd725070b3f4e2583cee09b999ad5be8d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1377,7 +1377,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 269d290a2797fd8311cc36a8b2cfc6bfed88c372..eeab12ba4efbcfec3769a1b80a455a3439d1ef59 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -369,7 +369,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 808d7c46a5aa934700ee15aa1aaf313e966f32b4..c9b71a9b96061405934554cc480069e0ceafa9c3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -619,7 +619,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fc0c77e963c506a62d34dab770d5eeb7beb68a0a..0d9feba7976afab0dd656257ee6da0c58a34f612 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1245,7 +1245,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4572b97ed9159ac4a6798f88816262d7ecd453b5..2b085f9b2aa8071ec56c026787988120923031db 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -683,7 +683,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e1fa4093967fbe9ebce3d07924fe09640e90e1e1..46e50ad884e2e746d353cc0fb8e133cb34e00c06 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1315,7 +1315,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 110eb3fb078d3060447f816dce361fa1737e3227..96700a0ee684dc29652a450c00709ebec82742af 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -328,7 +328,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 09793174f84bd1efdf5593b6308a7162e605160c..3c0ddc9764674d1ab9aa13f6fbbd313f687d7874 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -578,7 +578,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 17c00506c4b222a18fc4b27bc493534ffd720bbf..03857a7fb312c1b8c6cef7d2a581b715982f6017 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1207,7 +1207,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4bcc2284097c35fa06d19fff1e17ed8d7e3be88a..8a8a97c7ea9c286562ae47f33d6db0af9abd2811 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -578,7 +578,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1be27016ae7e92dfa5b1fb5bb7b42f6b90719838..296e02c6aee7f08971b61189ced6a41834f4f194 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1207,7 +1207,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 564f5349870fb1388f722bdca448863101a64cfc..e18b8e4c52cf589c7db7c6e921ff62fb4b145398 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -395,7 +395,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 31a1a9a0f71b18352cb877c9f017488b0f71e449..8e487a90fd1830512c450ebda1f9a3e2a895109b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -577,7 +577,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6d1200715e8ef5e7a40fc17924b9c93e30af72c1..b49b0e1d8f10c6b573a549a3d86aa0342e13c295 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -999,7 +999,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 719bb56531f61ee6d6c279e2776793198d13a08a..329b9a36b560a5fd17c0eacabbaf978f54727eef 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -643,7 +643,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 61699234df34fcd08c8f2a60cd15d9300fa6ef00..5673b27ca3175cdcceb3ba3dcca8fe0cce6215a3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1071,7 +1071,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 142ca0e27e3b434724524db4666564084d7f392a..3a47ac8914b22ff457efb668e96e755d2146e45b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -326,7 +326,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 90a15f1b65efda70b6e20954890283a5bf250256..6c1942300f01a04a531f073d84fb3eafe2dbcf6a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -508,7 +508,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 51c349980f651e17b05fad58356879be922357e4..7871da9a93a60882c3c31fd8d2b06fd44963ae0c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -930,7 +930,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0d9778591696c5390eef068a26a89b9c0aa4033c..67acb9aaa1f8f3e0fb69bfdce03cda2fcafcee97 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -574,7 +574,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4b4b62f52e0a64c8ab9980c3d512882fb9de442d..9d8581e0babc71d32798a04bcc48b20e26268ea5 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1002,7 +1002,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e17617697dd9fd0a1775b11dd48868ead6723e29..f85418dc215188e9ac4b03645977064e1c4ed02d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -289,7 +289,7 @@ nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a1524be7c0de2407f3b32b09a916fe94e8a4fb6d..57e207835922bd616f4c9ae9d030d39b238e5b45 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -471,7 +471,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5ab7b925bd4241e7317c0e5c3b3391e56278e520..4f3cc873d6eb2e42b7a29fbcf89f0204727ea6f2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -896,7 +896,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 439432c84e357426e1230f87123c45dc2d22e5ed..d2132f1af514c64c27b4f8c9d812422b7762591c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -471,7 +471,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6dd0efe3e26249e93d6ab07871b270bad68ac012..476de03ab5b8d93b82befff06beb8527c70f3200 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -896,7 +896,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6553533a481ea6817826cff13e37b7c7f9fdbfb1..2e2bd4f48264120f00a018a52a4ac757fcb26fa7 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -424,7 +424,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cd651509f03d8fc567bac2890b7c52ccf2b4c8ae..fe050a5ba8b5b46c28783cfb067c1480be33c7ed 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -712,7 +712,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f8c76dde5e6674fd392a7dcaf1ef9fcf5cb0ea84..9a201c520e2b3a11aa405ed2cc9c333e0a068072 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1448,7 +1448,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9bbebb0ff471b54ccfea086611fbf4feacc8851d..9969680e34833cfbec597e3809d2a1dee3b954d1 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -803,7 +803,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 392ae7d6084b9bcf9f904fa6e0aabe6bf59fe4a4..9a0a46548e4b41b5307f1d2becc993edf67d6c60 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1545,7 +1545,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 960aa638f4a58be893fedb32887612d73b50f277..67455313a6dfe995b52549e1419a8c40c0feff33 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -398,7 +398,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a62689afbce791782877e462c793329ad23e0891..8d2edb25f3e0adf523bce76c17e1783f6fc8194d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -684,7 +684,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 89a90854e2d278845b6ce689fa8719399d2955d9..5b20fd5dc5abd00253f60a8cc911439921d9ad0c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1418,7 +1418,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a5ebcf61766733c7ed3c8d0144a970f3e7107cd4..f56b4d94f324a4c26cf3d6b27e825a5604b9c2c8 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -768,7 +768,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ab09139ee1a2bb0f27dbef48b3a8194b5c270c87..0c80cdbb532ceec5056aa78817f76f2c794a7e51 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1508,7 +1508,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0ca2ee30ee534804ce80c03127eced24059a00c2..5c308edc1aa2a9b4ee50733a3793c0db4445d9d5 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -354,7 +354,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3ad9f0b0c53b9001fee27aa33d62d1f99885ace2..2a8fa78a22272f59ceaa29822490fe6d18ca10c3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -640,7 +640,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d6852945ef54755ef2e133a5151c56c969f64640..d9f9701f48c97f95c4ca347f039e377ae0c7fc74 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3W3_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1377,7 +1377,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3W3_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8c2e12f01f7bcc50f38c04e438091d87ac66c74d..4f089f124f28e353efa5980b5855e1dedaab43c3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -640,7 +640,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 08cb736cca6eac4b00923b3ade3eb0103c7a1a2e..be14894d473b0fb0641eed40df1fdafbfb75cf17 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4W4_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1377,7 +1377,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4W4_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0059f48d0c6aee6492ed6416cf4ffb1761d3c88f..6cb2dc91c21f3c48e256b542167a6778f79196df 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -433,7 +433,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 25f494c7de597caba4c3d390172cd6a69b552371..66242c7fb5b42df523bda35aa717bfaa0d51c5bc 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -763,7 +763,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index adb58ecee316046e0930d56d192386857a1b09cd..2b531744bd6cda1e50da81e0e82e2d0114129b4c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1629,7 +1629,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 449cb4613349cae22cb4e75b7be6ec769970dae6..4f9dc00c30cd630646f966d48ec8577b28db1857 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -871,7 +871,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 539bc89e44c737009493acd7c4b32096bb633a18..67ca3e2c2c835a3b0f3216540863b877aaaf014c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1743,7 +1743,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a8650d3926981d3e1e1d1acd669cbaead976db71..55dc1da0487bc68f864bb3aee5dc5f6563d494f9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -390,7 +390,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ef63527aeb1d9eb9a37e4c2bdca621dbb572bd9b..765ef68b41e85b2e45b247947d2134baab6b8057 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -720,7 +720,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5ca68772270cbf0a8b6d1df4622f2127b4e379b8..ecd47e1e4482b677f331352d28e69e5677e6cf09 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3W3_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1589,7 +1589,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3W3_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b8e16e9088ff3e793508d9dd44d42a3fc64d238a..c9ac8374009b043d7988c126d48058f5965ca6f1 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -720,7 +720,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c5c34f97cec1be038bdbdea53a3604ad4dd6d8c4..8ba483aa5076d31b4da71a1e42cfe12f3650ec94 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1589,7 +1589,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 92aab16dd4a199c51bfc82ac77e11b880917fdd9..3e2168abd8dde79283db885253fb2f1a992aed63 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -431,7 +431,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e956dcc8453afdf78d9288bfcac02bd68fdff17b..42b7c18856b610dfde9ec42d4c1275d4afd7e5c0 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -677,7 +677,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 205d6b9d394e0bda6675bee1c9d90a691c0e4e67..2f4fd45589877c910994abbc06194b49786a1a4a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3W3_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1291,7 +1291,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3W3_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e860d2d6a01ce26af67857db24f7ee60d0072d67..676791b63e009b62c0d27cdb5e41aef26bbfec85 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -747,7 +747,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2949f7695ae06a0038e3f190ec127a8576ca50b9..7d82b83efee5d75b4f513dc2c3feff766d494565 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4W4_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1367,7 +1367,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4W4_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ecbb086f0b6afa897c5caf12872845197d674723..a73c609c274b50c17530c3415a76f6e9111c76ff 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -392,7 +392,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cff1ceef293df8ba485e77a29020f93da85eb95f..3c91435e79d2321c9546146dafb832adb9a6d234 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -640,7 +640,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f32125d5dff5b96d4e9b690255725493c0e36b64..52ff173cd60647a144369f08b420dad191fdcf5b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3W3_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1256,7 +1256,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3W3_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8b870a6eba29973e0ec2c9e07f9d3a5190f8a449..693d9ef0a1d5c0c2fe351f7fae1697a6af5d9e1e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -713,7 +713,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a62bd747f7546ceda96ebcd345951660d5f91df3..91cd03da22f686678c856f1d4aa38135ddab5fff 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4W4_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1335,7 +1335,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4W4_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a339e71b2d4ee62d0a75523bf9ea11d28a22b92a..0f3d86659d4889d42f8e46ad23d11bbff7eddba7 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -366,7 +366,7 @@ nb_kernel_ElecEw_VdwLJ_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index be79b1c9cc9f906e092ea04266ac8bf1239ac9c3..c56626bceba49c8b2128c9fa3586930448279f15 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -612,7 +612,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b77c34f5c92caff15d02b20649c21d01bce38c92..b03e34cd8f7c15d7d8ec266127f4d239caadc020 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3W3_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1226,7 +1226,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3W3_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index aef87e484ac4620c9cb29234fa89c50cc000b6c5..46502a56865e7b320982bc8fa0780c5495a1fb58 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -678,7 +678,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a7349d720d9acf8995a8e42ca2bcff849bb0fa71..6096385d5dc15e1bd2edcaf15ace756aa70366c4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4W4_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1298,7 +1298,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4W4_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 432db587ff0d0e5968246db23291849c4c828c86..54100af8662b304d38d19bca14a594182bb4aa6c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -329,7 +329,7 @@ nb_kernel_ElecEw_VdwNone_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 84ef255caed0fd1ff1e9009205a0c4d1ded88d62..af18fa4025cc59a6d4b193c636a90d107ba8cb19 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -575,7 +575,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 38cb582af4b07a40707179284874d2cab4d0645e..bc6496bbc915d73fe94c53d33147928c32779e97 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3W3_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1192,7 +1192,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3W3_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 109ae4729ae97512703016bcfadcab5913374a44..0cddf2ab1b96b6fdda300a0c596c622792062815 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -575,7 +575,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 667631f0a84817d7aadf9f440e8b45e705890f0b..b60c53fa7cdca2d834b8720cc1a977abce1d1414 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4W4_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1192,7 +1192,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4W4_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3ee22b2a6ec68f44cdbfac4abd315ae097881414..4ba62a043e5798687792d2da611bfb4cb0ab9a95 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -469,7 +469,7 @@ nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index df36ced65b80c1b9f4d60a4170fca13a710b3eca..fdc3ebf7591790041ae4a8357a45f2e65473186d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -412,7 +412,7 @@ nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 17b9609bbdaf714a5edb424bd2c0e72f80183234..64002a44210f66364230a7005da07a863d080ce9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -371,7 +371,7 @@ nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 04da0cea0fa920c6871057376dfd0553b7e31db3..f1ca71f38bb3e2a753356b039b82cfc3732f1e9a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -369,7 +369,7 @@ nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index bdcdc868f49312da7e67d8c5ab22dc41cad18884..4805ca270c76f8e46db02af798e553591539e138 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -363,7 +363,7 @@ nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6cc9cad6be0ff91e40b50a0204017f13c7f08690..85a7a61d5d3556428e00eed10bd88fc885aeabb4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -334,7 +334,7 @@ nb_kernel_ElecNone_VdwLJEw_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f1fc82db9720e4459574d45c62f500951d8d6afd..a51a732c1178720f5788df1522bcc4e654da544a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJSh_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -329,7 +329,7 @@ nb_kernel_ElecNone_VdwLJSh_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e53c272d9fbf144414581b562ca23f02a386049b..6cb0a794db799be6a5b7578f2c0d8f24acb8ef13 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJSw_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -368,7 +368,7 @@ nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 069f433b612adf4b1ece8cceedc0dcff537d7647..48719b82890f46da1f7b63baeaece4d43201542e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJ_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -300,7 +300,7 @@ nb_kernel_ElecNone_VdwLJ_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c50ed5bc5e0cb45cfe5c0550bf9c6454f2b5b32c..b64599261cbb9fa69ecaa37abcefe5504fe32a35 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -425,7 +425,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9b526af517a2d4967414f5620fb1a4a0925b9e01..c54e1921463ca44a8820445d1242b958503d75c1 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -647,7 +647,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c03329173c1eecf19c73f688f422b7f3fc8cbf49..2b5563e89576698f395d849e26d5b5f3c0c45a14 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1189,7 +1189,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8aead0127d55249018b52507543b33a939ec93ec..6627e0d82c4efd9af04f408cd717b2818bad2af0 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -711,7 +711,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6d4bba8c12d080f170873d2f2d46ec39cf1ec37d..286e2e2f7eb60d1ce06e648cc4ce927508019cfb 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1259,7 +1259,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3a5f5031ed2ec6d1cb592668e0b8794409a67223..1d0f6505b044d47c6b7f7ed7230d6bc6a379ed0a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -361,7 +361,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cdcb57262dfa4dc8630b67ee87d60bb1c2ce958b..c59f2752d28e17a11a5af5bd73544a31e3745c04 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -583,7 +583,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b2c7aa6c966bbe1f2f8295cd5da4ae94c1f2b228..1488265114990ccad2b0d8fb159f407f0907e3ca 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1125,7 +1125,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5e6238f57e720066c809b02abfc870bc7aad0e24..bed484f8a92a94328ec399a59e5ad66646ef3858 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -667,7 +667,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4a92129b0014b4fabad84e4e2a77eb8724435db0..902e2112cf14104ea95ae35b12d6fd5929810770 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1215,7 +1215,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 72356151e7c78b67976b0977b9ffea7e70d0e9d0..d5e8e7f4b52f2dc41d5447dcc5a7c90e5ebbc053 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -396,7 +396,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f418305980e42d68dab690e744c3d1e3d6e41a01..577b404b9e047150d15c009731233d6647255b37 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -618,7 +618,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7293a83c79249ac157cd6342dc1629ffb4d2fa1c..2ecc113c85faedf4da53b53be2ab5224184d16c2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1160,7 +1160,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 68d6cc641c71c829fcc274df936a0600ddfa24dc..b55bed19bb5b102b75a17b839d23a2fc73936075 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -704,7 +704,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 211dc5db853758c87cf96018e4c9e08065dba803..1bbfc92f80c51cbeb8b4304d22b05a19bce75750 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1252,7 +1252,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 059a8639e616feb993a4a4deea2179edecaded81..7fc2372caa916d2fc622d58c9763ed0febde6870 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -317,7 +317,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0cf6025655c770c4d623370e3dd1b94e224e278e..a38c9c9ed25937dea94303c2f7e6d01bda17f112 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -539,7 +539,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9ce9c3ee537112ab2409faf84a6fa582a94db763..ea7289278e54571302a6c3f230dd6eeabdbb29c4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3W3_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1084,7 +1084,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3W3_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4f6a136b4c8e20b9722b95be0d5f2ac629388f31..c830f21053c1ead45dced4d9a5671b3b15056535 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -539,7 +539,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index eb7148ad116790e6b609d4b541fea4b16a21a730..88a20556650dd081620876c098239e634bd9115a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4W4_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1084,7 +1084,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4W4_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 54680805c8fec2a47993980e0a917eb1e8673d9b..18960c339b56a214b6f06973c02e2e05d0bc1e8d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -398,7 +398,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3de679b494feb7df725a0909d3cdb71e7fe61827..60e7512a7c688a55687c6f25d5d0518f792890ba 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -580,7 +580,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fb3a740eaaceef1c47683afa16a8303e5759c070..644527871c3c8622d50099ec2b3920183b299963 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3W3_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1002,7 +1002,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3W3_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c2851b50933ef3ce390ce48d929831cbf1bbdc95..4cb2afb6d7f4fd1395f928b93f474668d92a4ec3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -646,7 +646,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1803aef4237dcaba62b960c3df24a792f678bffc..9e954a9b94b7d76874c173df418b7a14bdfbaf90 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1074,7 +1074,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 46589b1d79f9de1fdd3183ee1716467ff3845ad8..635cb8ec90c33667f78a5ef2161fc1daf6888f9a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -329,7 +329,7 @@ nb_kernel_ElecRF_VdwLJ_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e28aba49cc56551a2f2837a44fa6fb7e0fcc85ec..c0efc8b606173b8aee912bcd55364c0855bb64c5 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -511,7 +511,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d47dce61a9d1c07fa1387212cb58fe1dc1d9e34d..a1a44cdccac654539df35b5619c52f2281794a2b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3W3_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -933,7 +933,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3W3_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e4a702e080762a87fa18b04b485ea1da72ea449d..06f1bd8658fa88db68f1d6e469c59dd58b31f795 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -577,7 +577,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3c011e87c852acc09d6dc71fb1773c4fdbf634fe..31afac1de1d333cf0f8210a5a2e826bdd8831f7d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4W4_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1005,7 +1005,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4W4_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9513c93f2ffba9246fbc202a136aa149f0ca013a..acd673f422a1824f833e3f121387c8a20663d738 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomP1P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -292,7 +292,7 @@ nb_kernel_ElecRF_VdwNone_GeomP1P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 453a83d593cc5272bca0cf68146b9d8d16ec0244..3e3177ee98e53d4bb68fb84d259ed8f05d595663 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -474,7 +474,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 19099893b6a26aaa00ec231eddd9f4a3c6ba7f79..1cc423f29b09aeb536c59a81de5e2e48585f9d50 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3W3_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -899,7 +899,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3W3_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f79cc5b6b521b5dc7e178c630036f10126534177..7344aed9348253e5d1225925090a8daca79aef0d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4P1_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -474,7 +474,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4P1_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ec77933c5c6a9acef8f7411fc72692a510787804..522115770bb10a4a7983383788b9648b2e59d591 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4W4_VF_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -899,7 +899,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4W4_F_sse2_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 74c49e9e0a1ed85001a8ed4841d123d2faff08d7..1a4e0861dacd99727711ba04d70170466f0a568a 100644 (file)
@@ -2,7 +2,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,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.
@@ -93,7 +93,7 @@ void
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index bb92b11cff7d4318805ba5c88db70f80192b976d..1fa8fee8096d411f61c3ed3ca6b4e95cd001db68 100755 (executable)
@@ -2,7 +2,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,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.
@@ -91,7 +91,7 @@ Arch       = 'sse2_single'
 # 'cutoff' means the interaction is set to 0.0 outside the cutoff
 #
 
-FileHeader = create_copyright_header('2012,2013,2014,2015')
+FileHeader = create_copyright_header('2012,2013,2014,2015,2017')
 FileHeader += """/*
  * Note: this file was generated by the GROMACS """+Arch+""" kernel generator.
  */
index b963ce6b2a4ead22f09b8672dd9f25a3332ae2c4..6a978b5cc4b5641f994d35e9c6bce369f263b929 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -462,7 +462,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 357b3f5116e5bf56b861683dafba7de1be5c72bb..a64eb3875261e16c046b065e910490af82afd85a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -712,7 +712,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f4d7129fea4373196c60b92a75f936ffa2a5d56c..0cc97e6a5bc5a741ae28dfaaf11eace882f8f9d7 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1320,7 +1320,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cbbb82399dee177f4e8e91cd82b843cd2aac3050..04b518c4735ab9f99c3078b79dc12a7f18d5b67e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -795,7 +795,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 497f28048064da3ac4c42bd0c9d6306d33a72036..92f879b357f46329c9fdb1fd21c268f2b76eafdd 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1411,7 +1411,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index aee26fae42f0e818b39e7e3bfcdda82a585a156e..9f18c89bb3068af4fa50152deb770208f293d764 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -422,7 +422,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 636388cd1d1061091b12eaef270748680e2910a8..3e6dad91c81fd3eb4798bfe32a7a768864e8c36a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -672,7 +672,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 46f3687d28c040d10ed1936c37f607f9e1a2cd05..8545955625a8d8f8fa46614c3a78733f4db9670a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1280,7 +1280,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f79fc88962766e1ad6f69c23c7b1f03d8c86ce5d..9dccebb7ddb35584eefe8a23513acd1e4faa1659 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -736,7 +736,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e60bdd14bcdfde11abe42e11b560b2aad07ca686..1f2cdb404fa261c8d5f7d4b22b70c5df1f4f74c5 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1352,7 +1352,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a1cb973317e61572046c4a800ac15a41539ae651..3cbc71afe7cc048ef4d6b2e6c9d8d0f5df966ef6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -369,7 +369,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d5adae6474fae4fb26068fa14b43c4e3fe598bf3..396afef4f57b0aaeb435899b450f3ddefa538b20 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -619,7 +619,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f21bc052f22afea07a8271cc616dfba94cc2796e..a634ec170289effa639d64ff5dadad7367fafabe 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1242,7 +1242,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index faa1ee41df29786b5020da4c73537d8fb8184208..af2ee4fc63b8d173ce810d6d4fe73fa533865619 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -619,7 +619,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 942658ffa4667a7725ca645ad26d09f0e076b499..d207e399eb1d5dac4d4f4780fe8aa3a3055ca7f4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1242,7 +1242,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c5ec88cf491afa524bd3d5a31e0cd5dfa12dd423..b39f7862b613ade8a625d2fab0fef30ba2fbd381 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -446,7 +446,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index aade7c24da3c6108d4ea59e9b2a9c64d2dcd6f81..9d56c4b8d177f29b437f6c56adebfcea1b3f59a1 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -630,7 +630,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0436c04e3b9e6ccf6c68c74e6639c6766746a143..43c8f01f15517dd73298b4435cd0a08c41d290f2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1040,7 +1040,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7ca77150ede98291f27034936821b56bafd0da06..517fd1e03ecb5b8a534d0a8a37889f02133f6a90 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -696,7 +696,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a9a1dd6c8bb23e71f5b14550646ab12650cc80a2..20c70972544ea25c59d6250b423608dfa87e92c9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1114,7 +1114,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4366d4eb6ce6d481582593a3527a9f0f1fe1a2d3..18ff1d16f15f5db30dfd0881fc1da5eff6f47f0b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -380,7 +380,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d1491b31916c1095658844a48d3a2631ae60cc71..7e7bec36de56116174a1ba6f00cabee1b471ed73 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -564,7 +564,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0952c620b1ac937ccb053945ea6a5e2de6a15062..c13c55aa689fdabdccdf903bdc8b49bb47a56942 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -974,7 +974,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 30f6b26accabf6cf61381fce25bd24eec80271bc..065fe76dd97139e2d70381f1dd0c8420ddc01b2f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -630,7 +630,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 934aa863a6857563b648f229c46da99a97480687..9152bb038b738c25ded46a4add3f3ceba76f8a8d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1048,7 +1048,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 682baf652b5e961fe455385e54f6223f82926a56..8dcf6c6a054117e55cb82be52da9d46a3e58f7e6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -331,7 +331,7 @@ nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 979f0cc8836485f54a10b750671449d3065b163f..1e7dbc35807617a3a879c1a565111574b5cd8efc 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -515,7 +515,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2866fdef46a8a69e38e3d82f24f625e5a2c2364f..9bec395cb4d3b18b5081d4218151c20588c3eb5a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -940,7 +940,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1be5d67ada2af77b43c8cce43fb74ccd87fae1ff..05e0a9936eaee6a7ce9196d10f04765a6c758e6f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -515,7 +515,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 132ca8a1300dbc5454e7171067536e264d7e4a88..e8b39724ced9f748101aa69163368e846ed033f2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -940,7 +940,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 16ddac78ba1892f3473158afee1048699f1f5de7..53e4e5412c2297577599b5e684cb6d8d104d2e6d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -480,7 +480,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 281bb2aab492325143f67c719cda204e5ca7eaba..5d8d728abec5c5218cab7c748a0279b05237a64f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -768,7 +768,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index edfa79d33f4f5e7ef5c7b7e7e5c3978acdb89248..e455555380eb2ed099f84afcd8696bd26ec56560 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1483,7 +1483,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1269cac8344bd9af3fb004c194e36e36e78ac1cc..62dae76ea32398e94db8b1285274a39b44bc8b92 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -860,7 +860,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4e118957f5a0153fa1c6ed72debc7d4b6771a692..4d78c850fb98c9e30351ed2dd2fa6c0c6742c4c9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1583,7 +1583,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cce797ab4b30d09f398889dbe9a6a83eadd04796..63f148f118ab3293f3c472e437daa0f7625ea77c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -451,7 +451,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c92fa2d78a66621d2c6ba5bfc1ed8da8c18820fb..b37af4a18fc1ad3d0d409dd471c25e062d829cbe 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -737,7 +737,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 009fb3191dada6f87c7e86fb0aa4c0233111f5b2..8f1a04121148ee9dc52f2ff8287482d08eb6b4fb 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1453,7 +1453,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6e4ea6d5c1997e850f7327a3ee983a0b922a4b26..f4af2dbd15dd786ef7be8089f2a57f046b9c5163 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -821,7 +821,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3d1847c4411ae024e68f61071fd255a06a92ee2e..82b68bdc296f6fae3601055877fe69f2cf31e6e4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1545,7 +1545,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 69fc57b7b095bf2a05f3462dee9ccd3f25ef747b..d24f594c087198d0f8e24d9c60d84c5ee7933fd0 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -395,7 +395,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index dac1bccce8b9316b973f1d5858ed1b0580e77984..ad0b430d1f4b229121859e2daa033cf14f1a822a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -681,7 +681,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 167397f00482d0d8c956d25be8db3296163eec59..9c126ac7567c047edf4bfa514b9c25a2acfc5be4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3W3_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1412,7 +1412,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3W3_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3dca072dd16a78af46a117e739decf22f99f5afd..839c3a754e497b70ac2ddd678a3297c8e7f9785a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -681,7 +681,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e1ca56daacd8366f1218893118c6f13ffd805df4..8578fbf4acc751e115ed359db5c5a3e48ebe832e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4W4_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1412,7 +1412,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4W4_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c7ed93774fd6204fbf410099f24561c0c2c9d6b6..fa93f74291c045718fdbfe00751e7ee72d1e7fc4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -486,7 +486,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 29ea483fedf8aa1098a5813c5ed9526e48a1bfc4..8774dfbf0eaa1e8198e5bbe247bff8885291f7b8 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -816,7 +816,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 620dd11861c9dbaff9f212c4932838813be6bf86..370d107ba6e60541281a099c815ff098cf028f0d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1664,7 +1664,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 335f3178303b973663a5882502c7d70666070b3f..08b8c14017315a1b3f638d1ccb1c79216f2a1c8e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -925,7 +925,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a11fae941fc064e0ebec3a8b661f6b19873e304d..9b2ce3f47ee03d260d38bac0baa04e99fed979e7 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1781,7 +1781,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 759b3d5877365b64672ce957c2b64bfebe9b586b..2558e59cdee9a81bd0ea47d67b3a2546fa7d303e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -431,7 +431,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5ee0b3008809e20f21a20919f3336c6d38278801..c2915573e38d5423c44f908efeccbcdd6d911911 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -761,7 +761,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ba0e8224c904d36a31c21500119242afb931325c..40a4f7858441c6f514a76ea414cf34772357a2a3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3W3_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1624,7 +1624,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3W3_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 088cbae7bc9876e0cfb35e503b8d35dff0ff58ed..270d2b60d7f5465f11fd139ae8832101e2b9938f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -761,7 +761,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 79b9061f8340e14a3696fad388e46ac435c02522..d33597ce42cffd49ff81fc23bb5613ba7d028266 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1624,7 +1624,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 656665c2b2b12dec1fbed2e6da28b0f7a4cd3e8c..b90da7c333da5eb20c040a9442bd68c31d8ead56 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -480,7 +480,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index dcf1d00eec03e61233ca82d0aebc9b60314ef33d..0614d33d325c3c8b93571a3f81852f77416d2bde 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -726,7 +726,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a7c6dccc9b7620b94b127435f48fc360795f217d..54a5d9db2ddd781a61b45cc48d13524d7d724013 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3W3_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1322,7 +1322,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3W3_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ae01e3c491eb1b8463be28268f4a05c9f416a79d..696d69c8c8dbeba0eb9b7a7eac61a3ec14d02cf8 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -797,7 +797,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ab8b3491f0bf84f0ad74b738017d27f05816c73e..912da388326b8ef5e9ba651840413a0221b6370a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4W4_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1401,7 +1401,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4W4_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9e7c96cd45fbda6307a39e3b0050a9f4c3298e65..e1973f13ec1fe3e5a3a915394eebfe10f84f4ae9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -448,7 +448,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2e685b3f08463af0e842df64646985a1a8c68d17..366f15de995aaca63b48d7a2f924d3a986b61b88 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -696,7 +696,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b553f7ee225009a807fe531ddc32c8eb992a6e6d..3d5c9d1ded705a90ea98323cc7aea3a92212a095 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3W3_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1291,7 +1291,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3W3_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8c4a32e5f6f212b273f593078b4195b3aaa05fab..f67e36ba7e0a80bd85b10c023e81070535afbd25 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -770,7 +770,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5d8fd868422644e86c9a4e24f0c6c33de9567d29..569143418d077b423eb86fbc8d9483b4e947c136 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4W4_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1373,7 +1373,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4W4_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 96c164666f3d9f4b85bba06538e98cc5416c9006..cd37f2bb21a5ab0e6520b338573da47f67f50c22 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -419,7 +419,7 @@ nb_kernel_ElecEw_VdwLJ_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5dd1f2e0688b9c7598a34a6313ed935d81d34438..cc70234907385ec1af6125241de7aeaaaebec2cc 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -665,7 +665,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 30e1a985f5d05b7ae8aaedb67e461a3805601db5..5a148e98dd8a05407038c03f60e3016db662a836 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3W3_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1261,7 +1261,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3W3_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 82310413f1161ab5b22b40b809bebac864d76144..2ba23156813e2bcc21eb014b9cacef2357cbb0fa 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -731,7 +731,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7736183feb6ab7afece5f773ee552fe7684a2801..df73cf0be103b821b041201cf8e8683136ffea1c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4W4_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1335,7 +1335,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4W4_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0d315656b1b4ab5e3328f7de6ff0731d42081c06..545482a1aa4a9cf991bf82fea890b3bb1548c997 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -370,7 +370,7 @@ nb_kernel_ElecEw_VdwNone_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7e730fad57c9dcb22d50ff5c6ad7360ba667a380..a1babd40b6236304998d414e392e440884ae13ce 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -616,7 +616,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 78aefdeeac2ee18c67441ae1baa91b2b637da18b..7a5b2d1a282367b8b36389458bea9201ae29a2f1 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3W3_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1227,7 +1227,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3W3_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b284a4ab7728676aa257abdf30a37337d99a77d8..fb20e9eb888aa4c427ab06e3890a60fb0c35deff 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -616,7 +616,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9c55f72a8e6e35a330266007b23b6df3c41ef687..805725569c7cb5bfceae3c744bead53258bc7461 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4W4_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1227,7 +1227,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4W4_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 919ab10e6c2ed7f1708dc5fa25a4eb79571153b8..f120da09a7e3e40d6fd9f293383ec3c875f7f51a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -529,7 +529,7 @@ nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fb237b3a1af19d6936aa18acd92e258fe34c24e0..13d798b212de741b99b823fc41efa5ce996aee25 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -476,7 +476,7 @@ nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index bd8fd991739765cb8bbab53bdc20090522ff1bbd..f340e2bcdcd166f5f350379f50cebc117b008613 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -423,7 +423,7 @@ nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 18ac3b18f030240cc64ca87164a9ad223a93324e..908bef58284e5beddc791afcd5ba7063814cb4da 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -418,7 +418,7 @@ nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6e56e11da4c590c9a17333663066e2fbb07fc08a..4ff9acaa1ec6061069394741cc0936735abf4790 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -419,7 +419,7 @@ nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 050221bff398ce99888d40bc63c97c71f6acf86a..4e8d01c25cc4fc7dae4099477f3f1933932122ed 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -390,7 +390,7 @@ nb_kernel_ElecNone_VdwLJEw_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a8e364d4f02e70c1247524a2801c5b73c967a690..705044c1472b58aa4380a36dcbff97c0cc4fa7b7 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJSh_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -381,7 +381,7 @@ nb_kernel_ElecNone_VdwLJSh_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 682e0bd315436ef4091ba913c12b41bd0f5ffdb7..af286de91975640e0c5329e202d3924a89fbce71 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJSw_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -421,7 +421,7 @@ nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 66b81e06271af8cf283a271d6acf10cceeba0f2e..1881a272aaf5c45ca432bac82772a365f91bb1e4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJ_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -352,7 +352,7 @@ nb_kernel_ElecNone_VdwLJ_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index bacda3b4a020e03fdb75a911fce228ea8cecfb7b..0440bc9f7ffba01c80690f7bf32ace5eaf5272bc 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -476,7 +476,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 35a347c978e794253cb327f8b600978a1ec60160..c45c3e3ea44f2ce2bc34bb4528f21daa9ff683e2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -700,7 +700,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cd1fb5811fff5363ce98f91de044615d0d188809..6589ca44a2ca4021f1b0844fb3373b0450025e0c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1230,7 +1230,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 68a54c4673131b6a61e28f80b8640c964a131426..ed9850179d4645eb219a7449521cad9fa06ae81d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -764,7 +764,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7298ed26a866473151df16b1a0d92382f7420285..2ee3ebe303bbac47d40e01615ffe6bc45e65acb9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1322,7 +1322,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5b0e51b071b41598f93616fb40957c641a7f7950..2fa396adc2dd577f2bafb5ada13cee113dbe8a47 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -415,7 +415,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5a8fde8c862d1c74aa24b4695785c95d37266098..91bfce08cb3c7d659a58d358901cde9ca07ddc88 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -639,7 +639,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c30aac73f42a90f0379734044db5951b5d295af3..45d2ff73670b426caf81baf56099a3bd90a3ebec 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1169,7 +1169,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index bc104c9af2be165f6ca86b433866a010a88bf5ba..bd22453f3cc07f8433c2a05b62ced34a2384c618 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -723,7 +723,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 90801c8e16a9cb4a7764ccbd5d2a31e551fd6b13..928541365341a457456e9a2af399d2c3bd248e10 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1261,7 +1261,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b0971f64bac8a9021a784967c86748466410d9e0..e0ba449f02eccbfd453934f41286e44aa3abd59a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -451,7 +451,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 41dd0571e084622f8689eb7c9f296e5ac63a7610..9109a0abe680a3bb54162e3f3d92145360ff337e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -675,7 +675,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4c52ffae687d1eac32ade91081123176c07b19ae..d8d81a135267842cf0e62f5e84dc7f1644a8ca8e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1205,7 +1205,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f561820eddc880cb499d845459a2990614ac7db5..6f159706f565405fde6191cd27432556755f82da 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -761,7 +761,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2a57d6f5c7f72e04bcaed1ff23f227c9f6b80063..d8c114ac832c2016403dce3c9798969c5834912c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1299,7 +1299,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 80df2dc44091b279fe91e23eb7c969cbf75eea70..ac8f02b2d9144200195329050fdb11f15be11849 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -359,7 +359,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 42be5a6e01d5a458be1c296d2f902faaa50f4e7f..cfd729eb6744399f640c6532a44ac7991036dc41 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -583,7 +583,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6b88956d3efdb13f5159e4b79824607018939a1b..fef4603d532f1d70a8a46fda098e50c11f895771 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3W3_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1128,7 +1128,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3W3_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b440d90b7e1f62c3f06b00465a47a5dacb1d4548..af403d3b6ca670f60a5e2d7a31f2ee16e90386b0 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -583,7 +583,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 91b1662a1f51e89943f44fb18a1e68a2bb00f21d..eda582f59ec67ede348664428a6c127e9e33ef34 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4W4_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1128,7 +1128,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4W4_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 09ab902c8789b85a4a330258ac8ac98b6045d370..ace43e2178b146d4137ad23ec2458b6f57bf1713 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -449,7 +449,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5a331b7d14c38bd3d7073813dae544d669b84c43..bb12173903f96d4786d4f9998fd43d1f078f0863 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -633,7 +633,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a1630985f6b3b8debb7e49b6904e0736d1bead0b..2a2145df82607f53e5001a73125548429aa89462 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3W3_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1043,7 +1043,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3W3_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cd29695df9febdf6be4368b376c92a4c575f5368..43acf71e03c19e339d37154f83f9a59f312d37ca 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -699,7 +699,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cdd4da4ddfc6810838170c9a4c909842747d300d..38f9b2f6f8c97c3cfadc0aea4da81b838873676d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1117,7 +1117,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index dac9ce6b1bc8166269073b2ac635938cce123183..2edebb088bbd7fe6db75e3e6f3e0e2bbc1f913c9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -383,7 +383,7 @@ nb_kernel_ElecRF_VdwLJ_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cac92c2330be9a684bd06f025483f35c0641d380..31c715987b5dff0dd4c4c1327b28f0b4472e21ee 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -567,7 +567,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 687fb3b7348a9ec29d6684f9c3bc9ce22391834a..14e770137c60134e4af8c5d5c8647f19ddef3a24 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3W3_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -977,7 +977,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3W3_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7ee84eb6e4f7bc4359c69e0e7cbd51866474e0c3..249031959ea5eb7968917c0425d2ed8b5498a7ad 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -633,7 +633,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6b5ea9eba26664b028ea0dd8a5074be5b2d21ae1..6f10ac95902a7192d9821d6f0981f0634167a408 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4W4_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1051,7 +1051,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4W4_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6cfbced25bdffbe4c946f60160b396bf66ac4daf..e3702bd8e27b207bc0d96bf76898a8c121077a8b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomP1P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -334,7 +334,7 @@ nb_kernel_ElecRF_VdwNone_GeomP1P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b19aaab211417d9c4e1a576ec1969fba91eaf886..f268e200f0ede575ba13ef006264f7e274ac5f3a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -518,7 +518,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f31a492b3466b1f2353c1a733b6a0b0c7456a57d..1ddaab3624e6494baa99f4edf9d6e9b255c528b6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3W3_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -943,7 +943,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3W3_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9686ed32db518e9a832e6014c1f4c52243836f20..8623bc8656cdae85f463867b1aa1993f7c710fe2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4P1_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -518,7 +518,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4P1_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index abaa61d5983b4e693c8260a2ae115fff9c630d81..2dce5a402706b2c9971f09e7c7335dab3e0ef686 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4W4_VF_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -943,7 +943,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4W4_F_sse2_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index bd3b4a7f4499cff69db1f073c2c1d7a405af42bf..c59ea77633491e7d3016c6e088f4505fa1b26738 100644 (file)
@@ -2,7 +2,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,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.
@@ -93,7 +93,7 @@ void
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 25cc5c5c057c88df14e178a533bcf3e47d04edcd..ed5ac7fcae2b620f3353254dc7d11fdc646bffdb 100755 (executable)
@@ -2,7 +2,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,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.
@@ -91,7 +91,7 @@ Arch       = 'sse4_1_double'
 # 'cutoff' means the interaction is set to 0.0 outside the cutoff
 #
 
-FileHeader = create_copyright_header('2012,2013,2014,2015')
+FileHeader = create_copyright_header('2012,2013,2014,2015,2017')
 FileHeader += """/*
  * Note: this file was generated by the GROMACS """+Arch+""" kernel generator.
  */
index a4277dff4c9cc73adfa025e4fd2faf95da9382bb..adef7b87250d1bbe18e4a5c0f557354d2a3a3716 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -413,7 +413,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 310596799e2a5b0f652a66625ff023d9b7030da9..b7aa8e0d6694ef051e4f268b51fda80235e17713 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -663,7 +663,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 875ad7fbdd6c844d04e9929bd945650e02d35ab3..279296e52538b849b760b98c2fba8dc8f152e614 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1289,7 +1289,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2142e7b72f0ed6b93c573c141cf18232c5d1a52f..77f79963ea40a6112aaf5b712544f0ed51f8c8c3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -745,7 +745,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7f5dedfbac32dcee2b989bdfc261cfa6e9a87101..13e44472615d893e6ddfccf19bba47a3fcb04ce9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1377,7 +1377,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8a79c19c6a59177f2e831c718fa044460582afc9..5e28a2db9a002da5947bc35767c7e3fe73c031a9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -369,7 +369,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9025e77fb134226a93c4696cc614f8090be65185..6642658c5c327423f068a549bb5a505c20d2530e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -619,7 +619,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1342db400777566ddb6b2aa8de6ce22b674ad7c7..e7e8c64cd919141c161437e8c715a2f1b78de520 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1245,7 +1245,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0d20258f933f33b04ce4c3697670aa891dbb0472..add00a012658648a030b9f33e68a9a95d46ebdc4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -683,7 +683,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c70af554c74fb126fa8b2ba1f34711546976a3ba..d76e29347556c599d17108624a1f5a8de0a9a8a6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1315,7 +1315,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ea933dad7e07ff58333ee8ec51184f1d13a69a19..d42982cb6a1bcbf7a7d8b58068c9df2f47887277 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -328,7 +328,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fb598ac67c4e365e983adf0c778985cb962466fd..23b4a857f8c9c7995f3d6e421a070f06d232bc90 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -578,7 +578,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a8df65f0eac13f6719387168d9934d23e9ae1852..0bfa7ac5230dff35ce8d15799e7922730d93cc67 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1207,7 +1207,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 873c262fad1c99ecbe18466db06c60e20f8bfaed..a9fc753a4e84ba3ea420dff684dbba08d4d57bb5 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -578,7 +578,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 84875b9dba475619b2fa0678b61fb35922953eae..d383391746255f2710ad385819bb67e458cbccc9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1207,7 +1207,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 09a1c428aef25a1bd93e5f7c01e8ff4f7fe1ef55..5d8e48c0328a7806f7c55095c998b805d2e482ba 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -395,7 +395,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fa6ead32e340c2112c76dd7953608e2a0b757fbd..18fc13f679dfb4739c6f591766199afb4d846804 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -577,7 +577,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c7b200da0a6a06370fe3721c9df7550190ba6328..1172bc31ac14a97045ec29c8218f9a94dc33ecc5 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -999,7 +999,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9e0f8029c3c6dabf25547c3883970a15b9ce27c7..499563a297e0abe53b97aae7d1ad6190fd8a99d5 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -643,7 +643,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ce5fd921602a1f15939297474072a82ba0f38e3c..c74d432a312a5d3a7e0f23eda02eedf7790f2bec 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1071,7 +1071,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8b3068c16a684820e0f74e44dfe1bbb67e08de49..2053eb8147dbe9996f412131516432e2df52ddb1 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -326,7 +326,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ce7d119ecfb94e0546ffc305c7ce57d1d07186bd..f136a3c32ceb967d5b6805e3dbd0c9b3929ea90b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -508,7 +508,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8b148b56383f6c99ac05c1c14a0d3d42ef9b039c..c4d4aa27f3a5ffd95aa5f3bcdb22c96469dccee9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -930,7 +930,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1d97ce29d5f92afdd39b14b4d1335f69c7c2bfd9..1a3170d7614e11cc5b77a6e117574ac3d669b582 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -574,7 +574,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6e623d268ddc25776d76847668f24738c6a364a0..fd84bd05c32acc04886d0ac6c91f846bdb73f454 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1002,7 +1002,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ee3cab472fbb7cea88ec496fae172dd1f02d8ed9..05d1c9090b3d75fafad4296f4b8a4fa0f251ec28 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -289,7 +289,7 @@ nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 760ea92cca08c6fc26b7a44cad60fff99c33c7cf..d8f76109e0c861b06bba1dc21aa024d19126c91d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -471,7 +471,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 391fbf59169160d84ceab640cd8de933d5feeb5c..06f0f96f71b382338ea65f3087e104727461e264 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -896,7 +896,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 169dd074c39cd299a5661fcc495b3dc21b445402..389b2f1634e84ed34f8005a2809e5874712e2d6c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -471,7 +471,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3d649797b8ce514d61ad18075c652bdaa803bb7b..b143cee3f7ea2f20adf1f2fc98a59de0d6a873b8 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -896,7 +896,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1800303af037a7577c9fbce968c47e2000698e30..d152cb7c71059c0f6d84ae559600f9bdc5f5cecc 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -423,7 +423,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0c8748fa7141fd5170ddcb6d02e2de4671dd10e3..f6c5d1a2f02be6bfefca2627d0605f6fcf6389ea 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -711,7 +711,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f4e1e088ee4248399ce261f74b18986e85f83bc5..5a77b8dc4213658992e30a04d8f6f859fa0f5a68 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1448,7 +1448,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index bf2785b62279a0ea9533097768881976e8826ec6..e3dc18d8a6cd0fc0207e8a1a339bd2070d1b60aa 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -802,7 +802,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e163abb9fb8959dbbbb5d9204d663789e97ab8d9..cf88b0055b9dad0c3e37d68565bbbcea80e658ec 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1545,7 +1545,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e29463560147cdb8c27b50fb0937f09fc805a8a6..20ce4f8d6f026f9c5e280390b91bb0b849c664ae 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -398,7 +398,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 553ccd34125a28181047bdccec7fe257dd1ce728..334e583a9089503b50a42865e88ffe84dfcdcf52 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -684,7 +684,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3f455217b662af82072d6a46de39f4221cc59c5c..6e2cd506161acb2f011330b09536d5be162de2f4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1418,7 +1418,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 57f9b7a87b53adfca368f6182195a7090b9ed1f5..98a21df4123d5a06af61ffc918ef7b76973a7335 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -768,7 +768,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9831fcf9d63450624d90b1189f7a5b32a99d8afb..be01f847416e9ca3ff57f7c68fd49c27a8e7ec20 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1508,7 +1508,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5120e3e70491b8068449cb1543c567c0537beb1e..1dbce65b28e670d14f042e195937dc816ec3ee05 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -354,7 +354,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2b1d7df57bbff1d078650787a5526bd69c7f8c78..fdc029354f09d19c53db533ae6a7164a3245288f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -640,7 +640,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f608764f79f3eafca377b9f47401ea5f99f5bb7c..e6a8efa32c30669813925b0811d7a79c854ec830 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3W3_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1377,7 +1377,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3W3_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7cdaa63b30009816bc11b2c3faa12515d6440481..d17fb1fe5f924adfdcb25ef910a6a1e05f37eef0 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -640,7 +640,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 52a6d526bd8ca33ee548d5598d9eb1aac59d2fa6..b47ee81bba6eff4edcbae8e7fbe413c09a141518 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4W4_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1377,7 +1377,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4W4_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0746bfb77eb90539c03468694755a1585dc2f42d..da4a8e514a1fea71986aef3979a218c62dbd2bd4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -433,7 +433,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 94b3c291bd41140383054b013c8b20ebb47aa9af..191e8609d99aa093a33ce8b291acafe7dce6386d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -763,7 +763,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 95cd500171796024a9d33539a1cdcaba05a296ac..db5e74416b3743dc71f66e0daaf85677d1d518b9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1629,7 +1629,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 57dfb06c2abef1b8cc56ea9aa3c9f1f67195776f..bde798864baac71d15f2f7c5bbf621c018f058e6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -871,7 +871,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a2b8553c56dee8e2ee95f1d590e8045da8055586..a9220d19239831926eb5476bae4bf87942c02456 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1743,7 +1743,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1e1391f50bac8827b1aab7f15bff0ea41d0c1e01..3e66bcc9b16fd5c928269ce804845a96ae2b88b4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -390,7 +390,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index aa13ec442ab50d972ff13b09f9a455449e357efc..3ee6599d79d7710f8e7b5cf4d590a6937e085712 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -720,7 +720,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 34976c7023114103dff0c4061ac3ddd6c5a5b072..74a67a4cec7eb074bd2b0a8a6f2e296473b70e0a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3W3_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1589,7 +1589,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3W3_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1a73f1dc182b401b7ca12d78168d295f6f3c5bda..c7df10c1663cc576dbb0ab58a53a6bb267e53352 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -720,7 +720,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e2efb74e9afba00a9ac4622b412fe468075b338f..c0d86c07b211cacf79fbc477d0916aa6569230c6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1589,7 +1589,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 443a3c0dbeaa5da2a22d041ff5867b8d72418ea1..0e1f9495db92520bec764c2fb22aec30ea6eca41 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -431,7 +431,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 55d6b221d9a70f071bffac10fa604d2687f7e3bd..61ee158a648de38ac30b92008721ff8ab6b11642 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -677,7 +677,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 82685698fb6dcfa30afd52b44abb90b34e5c26af..c0150d6863cc6c32269e8dd181c297d468bb7ecd 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3W3_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1291,7 +1291,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3W3_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f2ac918d28f637b049cd5c0b8cf2241332e4a57b..5bada2d31b6dd1b436456909c5df2c061c16e259 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -747,7 +747,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3b43ccd1415b391a46e622a112fc0ee91e400421..1dc8026a1a63e2b23c087643a43a0363d1c429ff 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4W4_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1367,7 +1367,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4W4_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 39f1defa68735ee345444737da1cc2f333e41dc5..855a7b8b03197e4ce9ca4439f1460b4e7ec0273f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -391,7 +391,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 894e826d621a6284439d2330893aa6f38686080a..59891109f9c7394b28d303829d00635fa2214fcd 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -639,7 +639,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9b764c2c76545895dbdb6a35bf1f2e8fd7c6eb0e..e374efd8902e6bf075a0e1e38c4639f85ecd7df0 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3W3_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1256,7 +1256,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3W3_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3ca08aef034541cd817f083722eb7f51c18065c7..a1fa4198f3153e1fc9589ee3a93f9fd20a693029 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -712,7 +712,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2d3471098f8289843f66048f763f37cff2fe1e98..2116cb646de8e35eeb3c4037c1f903d18c6b3466 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4W4_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1335,7 +1335,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4W4_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 366519aadc401e357d4668bba8166a17e0453908..e38469da69f144e7d9229660d5f4d610c9604c18 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -366,7 +366,7 @@ nb_kernel_ElecEw_VdwLJ_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 67bbaca818331a1095628f6f5e7415abe77b054d..81b5fc0334a83f35edd0e8ff1afb17d4d8a2912f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -612,7 +612,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 50b95b62b8c224e93bd4ba5ce96e7617d4e6f182..72bd4932a5b3181c1e1fd6acf39ebab119b94409 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3W3_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1226,7 +1226,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3W3_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f541b96fa918eff6ccf9ec097bb8611e1354f1b5..c0669bdb8078db04b69d0711377f6e88b6ae154d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -678,7 +678,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7b6171c70b55b1db6389ba385b9d4cad8f8a2515..1b82e737a76455e3c51906b145568faee8076017 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4W4_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1298,7 +1298,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4W4_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 046e2fe4d48fe0b4629ab03f9b37839718433a0e..4e6dccd461e93c73f319619c7e1c5357a44bbfb6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -329,7 +329,7 @@ nb_kernel_ElecEw_VdwNone_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9cbd5555c29ad5926d49a012c4a19958bf25a43e..614a87cef5af7b73fd8a3ee4ff5198f5fc7dea65 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -575,7 +575,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 208053acf22e063663a29bd8940b96c1b0a1bfea..d306a1dbb66275c512eb7805cd6f5ebed8458d35 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3W3_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1192,7 +1192,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3W3_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7ee3b3b01dd10aaa5b5806a88f59f74c34262688..1cab099404d51a4f9d2e95d8ab87f5494f8f3495 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -575,7 +575,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b681a82e9601021ad12f26bcbe748f444b4fffe0..a6674910de24a2210f61b978a37e500f53ef44b1 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4W4_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1192,7 +1192,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4W4_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f06d13fbc89d48a301225bef8a01025c9c3632cd..7c26c26406ec07c8db0ce057f425d50ff2e36d9a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -469,7 +469,7 @@ nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4a4077b13af2e856329a9899af17cb0081b2b1b5..9ae2332dd38744212c9a83938b489fde679874c3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -412,7 +412,7 @@ nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d216e00a0853756c9330e05bca1c6d874bbc9109..eb2ba0c6af3a657c28b175d3dd721c04005fc568 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -371,7 +371,7 @@ nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 88bf696c26b3f1bf79d8b17ba0c9f5b9a5d27f1c..01779df0dd0cbe0360b97f01f2dd431c8cab9785 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -369,7 +369,7 @@ nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 23113d3c2079a742ea3d05a276a464ee681c69af..1fe4fad07180be85ef3d8d188e4c2babd83d1fbc 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -362,7 +362,7 @@ nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 79d492964fddb211489ac5dda4679b7719a9f353..3e51a34fdf2bb52bdf360528cd377bf714fcd307 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -333,7 +333,7 @@ nb_kernel_ElecNone_VdwLJEw_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d93e1744fe61cb7773cf21f9ffba8617c3e02e92..8d2b9687a79f2915348f64405cf96707fe27bda5 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJSh_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -329,7 +329,7 @@ nb_kernel_ElecNone_VdwLJSh_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f440bede8a47d7d4cb0247a8d4fdac1611398039..bb24983119b8ff6f04f547ebb8ab2499804851ea 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJSw_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -368,7 +368,7 @@ nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 667d06c021714393b99a30cf2667b326d625c2dc..3290a49d7e39533a7a10deb7df88df780c0b79b2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJ_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -300,7 +300,7 @@ nb_kernel_ElecNone_VdwLJ_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a80ba91763712a70188bb510b2be7c9717eb89de..5cbbaf280d4ccfad97497182cad65253e0f444a3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -425,7 +425,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3a24160d1eaebc420c00cc4f079e6faae2eef4f7..5acc5fd4143fbaf6f0a6015f8232191b27510ba3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -647,7 +647,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e11582cbddd93ab1098aa1bc435c2aad5e9108ef..f451aee7029d8964307f1685802f035bf59b9b5f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1189,7 +1189,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e37f1b3daf2305ecdfa35b7373d4a77e6ebbe3c6..76ae25a60da1d67527b5e61f044dfae6a6a802c0 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -711,7 +711,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 58b736296c39df55398fc3a846ce822069ac4030..f827533ab9fd822ab8d4899460c178a6cfc7ab58 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1259,7 +1259,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5216dfbcd13e3a40ce8fbefdb3cb3d965ab78f5f..78631d121a10bf540ca79a0702bf63c0a2920f47 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -361,7 +361,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d472a1f593ebebd6d1fe26e8203972c8e72705bb..446dc1122631070965493f96a3ee293075220533 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -583,7 +583,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ea01a026eae4a778d78d492b3c6e48be410e8781..186ff66ad409150067ccf94c35d3ab5c72f4333b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1125,7 +1125,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 14e1f692b906e61ed0bd64c27d2eccc3347fbd1e..69ee98c40b1e3bc9cb28f5d037be8acc2f05b45c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -667,7 +667,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1e1feea34f61812e25390c6bd823ce1159c0800e..36178adc11926e54a5376a47b16c540603523a3a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1215,7 +1215,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 727f783fcf459660db2a077a475f5e78cdb2c2df..e0e554f9844cc5bc5e795e733e85359b9e75c6ac 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -396,7 +396,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 39d3c808c86a16720e78bba8e91f228972191eb8..d601c98badcc81988711a2516a3776d113c126b1 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -618,7 +618,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6f42c5523583ad765f6a49a14595a58d1cd56e43..799f35f9f4af75b8cf2ac494d715b88b93dc5331 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1160,7 +1160,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 20d63a8b3d81d78d33def8fc8282403995884898..415fcaf3d20f8899cdb1a49f2ab50216e0ba9788 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -704,7 +704,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e538c9053246054eb37809fd4b5063912bbc0554..2b580e780d1358a8d15bf2c58adf2aa1b6845027 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1252,7 +1252,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ec2271be8245389ce427978beb5d22d298bc20fb..60fc48bce5c43641bf3b2b7578a1e5fcf7f85016 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -317,7 +317,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5dcf4145ce92057038203bb158e2e3ccb72c4240..39e4b3c848705f5b2068928abf13f69dc0053f74 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -539,7 +539,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3f94320e20871e76cb31894e73df83df2e39e136..c83215983ad26b5178a9cfebeab6972908357d6f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3W3_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1084,7 +1084,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3W3_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 51ee43737331f3d543ea062233b5b795f0c05962..4d926078a141f956d5cd5f6f4b8547b7ea3d4325 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -539,7 +539,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 98accf21d3513838b273e1becc8a913e487f2284..e583ea3512bef014b67adda2c72db7bed5518b1a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4W4_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1084,7 +1084,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4W4_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 75126b087e87f9a03eab90a0fc0dc791be736e4c..27e77e7ecb2f12543c116f8f757a85234ec01253 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -398,7 +398,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 99f91d7f011432bf4bf1c033bbfae124c8c5cdcb..67f87b0c10629b8964878eaf1bca3db3649b47e7 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -580,7 +580,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f88d0896aae06efc48058e70ca6c7d8c96f1cdc0..ed7e5f3a2f792874969749fa4a16fc4dc9c39f9d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3W3_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1002,7 +1002,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3W3_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index bc614d91e0bd767080de2b26bb31fdb5c2b8764e..406d46c9d1b2d1efe568be1bc9c1ee89154b9d6c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -646,7 +646,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a28116c15e382399aeb8f164ef13c7a7219c1892..7919fa5b180863ff26a36869ed27041f1b99b06f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1074,7 +1074,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index be60d66f723b346552dda26c866c27e6701a7add..716c1bbf07b26ec1fdd93c46cd3f4a217525852e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -329,7 +329,7 @@ nb_kernel_ElecRF_VdwLJ_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5ed6ae86615b073aa3112580425963f3f1b167fb..b8bad89bf8eed202bc059a5003a26c94d5b84e79 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -511,7 +511,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index df0de4fe8df01c01bc395fb0ccf02291bee8c2a4..5127183ab887ef7bbb8680648df0510f6d042cd0 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3W3_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -933,7 +933,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3W3_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7889df8512feaa39381e065029df49174fe8cf6e..3ba519c05dff642550b2fa81539850968c0b9f03 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -577,7 +577,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 382165a30d396eef6947ec8087813038e9ada85b..57f65ea45fe1b77a98afbad50b727d9430e91a88 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4W4_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1005,7 +1005,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4W4_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index eaa1c643b691c8471e04ecea597769022b43a8db..a1b0e1e39d88614f261a853b1a511528e8616882 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomP1P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -292,7 +292,7 @@ nb_kernel_ElecRF_VdwNone_GeomP1P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 72a5568043000f1447f8e7cad89052bc3410c582..900a44fce7f375e837521b2ac48c855a9f295921 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -474,7 +474,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c3b925572e9fce9a57c2cf04036f384a4fbd2584..eec43af5dc81fc470eaa7fa660f482096f22754f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3W3_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -899,7 +899,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3W3_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d464b17aaa4797e5ee16d4e92cf16f16cef706b7..19ef26af2b794923c9630cfd93f67045c4491bf4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4P1_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -474,7 +474,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4P1_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e07fe6db7f2fa86e65c48033990f657ca69210e7..4605d0fd0746db97c87fbeb0c62445a0f24ec5de 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4W4_VF_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -899,7 +899,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4W4_F_sse4_1_double
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1d823bffbd068ddb16b910288aee55bc215554cf..c607f2950d66faa80d841aff457a5f9ab385cdef 100644 (file)
@@ -2,7 +2,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,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.
@@ -93,7 +93,7 @@ void
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 926f51a00a39fc3d3eb8796def0b5200da13298f..1a29580a5e127a6bebf1906ba642284c165167d3 100755 (executable)
@@ -2,7 +2,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,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.
@@ -91,7 +91,7 @@ Arch       = 'sse4_1_single'
 # 'cutoff' means the interaction is set to 0.0 outside the cutoff
 #
 
-FileHeader = create_copyright_header('2012,2013,2014,2015')
+FileHeader = create_copyright_header('2012,2013,2014,2015,2017')
 FileHeader += """/*
  * Note: this file was generated by the GROMACS """+Arch+""" kernel generator.
  */
index 83ad58fc3b063a26379009945f2a229af022fe24..20d9a65d9abc8ebac3f95a0d67b10d5e76814283 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -462,7 +462,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4af9fd8566ce27b1e419231f2ca7b15586328aa4..382b1729a7f9468973591b693ce95cd5e382cb87 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -712,7 +712,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 280eb1922c65c1782068e8ab97e35b906fbcae76..747e1cfa6e04dabca39e3190665ebc19d09e7f0c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1320,7 +1320,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f98d0ea9be673b60e14a961deea6da0082b7a758..cac8092f325d5529955bf768cb7db126df34555b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -795,7 +795,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2f6772391666b51606d50d9ef9dd830619b2ac04..2a7ae754c995cec6c83e474d9c6ee86154e32d03 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1411,7 +1411,7 @@ nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cbf6301c597371391f99a56601a30cb97713bfe7..92e7c1e2e202aa05e184c631c690d5642d3d9eca 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -422,7 +422,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3dd7b3b21604760a6068d63454da23ccb60d2484..461b4ff795228aa721a72cf1387fb63468c29cb7 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -672,7 +672,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 31d7eb55c2d33aeb46163bf5d76b00d8917b57aa..d065285af8a58fac94651fa87797402fcee463ad 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1280,7 +1280,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e3fcb0a4212f0a1616840db8314fe42f406e3a90..715b659a37f05a5090457ed4e6a7ade0c3c3d69d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -736,7 +736,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6c5f4e60c334658b777a659a9c93ad0a9fc8db11..6812c0606d1cb096ff779046cf91979b67a88233 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1352,7 +1352,7 @@ nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 69efd7a4b5d79027b8ca7e39057d8e8a891c020f..76e2afd76e45c3834c9bf3a03229d2225a194b60 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -369,7 +369,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c9fcc3d030170f3d2d843836066a9d5b3e5a9875..89f5a309c7ce01bf98c01ff2d07e2d5d5d43dd68 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -619,7 +619,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a625696e76af85b6ca3afa73db760380c0fd9e23..9d31a49941b10915e571d982474b9002f4d4bf69 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1242,7 +1242,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 04f313a575f865fa6c610555ff503b151f697668..01649d5bbac2d566056012db1a945ddfaa3022b4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -619,7 +619,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d5f3ce1a86e52aead8efc31cbfb0663b64c7b8d7..c0cc593832d1ecad5d168de94d945c96c509f5b8 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1242,7 +1242,7 @@ nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f85faa9592764f331901f7bc0ee7ce67372714b5..066c7da4d65613f17663d682b18a2622b6100775 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -446,7 +446,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 97c6462d817f0ee4ed5d2304c224b8c2e91fc868..368501203047840aa69d8f26e7844cab658db6fb 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -630,7 +630,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index af9ec459683a82c3b83883bdfbe4e37980670a53..0b75564150b989d90886378cb5a28244e8d080a2 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1040,7 +1040,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d7a1a3cf682ac9bef1dd87483694c9755bbca15f..00e97475939100d1e1dbe5dac2c15b9142f4352b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -696,7 +696,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 7d7d2c79c0e375e6ffe9b49ddf7976fa6f2fdc8d..861d6bab116693e919fee4ac3ecee031b0cd1c5b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1114,7 +1114,7 @@ nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 73080de78df18f7d808e084f2f5c7205ddb3ea7e..95599520c8978a16094918a4fcac872657a7e070 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -380,7 +380,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b653f74aea090cae6afee8ce8278b82165b10f9e..6d7c3fb0b41b79f16564a3e9106f5eaa95a4def8 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -564,7 +564,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2cd4cde19ae2c48d4942f1bc3c3f39a49f7a4b7b..60ffd5e842aa80f516316f7acf9b30b337d83a79 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -974,7 +974,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index e36835dac410fea3fad391020a49b4ad426d8a56..09f07227213a660644f88c8da65351e1fcb98875 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -630,7 +630,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8e8232ebadd455ba506c9d5b7cb8c042c0005b1d..63e31526f7fec198c78031b9252893f412ee6f8f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1048,7 +1048,7 @@ nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 15f51ff511081563ef39d07acb2fbb565032ad47..337e2619f8e6a5a738866f76f199fc7330d22eb4 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -331,7 +331,7 @@ nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index beb7974dc025c26cc38c040e4faf3d2394a680ea..bd43453cc342ca18df309e5b251ffecd6422e8af 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -515,7 +515,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index dff76176a7d47a47f4fb21286799afcd015f3a6a..965d6cde240d53db442909af7ee38821c46489f9 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -940,7 +940,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8900f505762f52d866364010242ec7a1b138cc45..b4ca63bf14642d90c85096c45d8f643c603b49cf 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -515,7 +515,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0747616ab6f851ef4edc903039f4d8812b3a714f..5cb0e34b07f672b27ecab358e2defd5787e04c5f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -940,7 +940,7 @@ nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6441728c0357e6532071cc795191135a6c3fc2eb..bb936975874df11a04920d1ffce46780e64e077d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -482,7 +482,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c9b9a960034263375b7ba4c79a22c750eef8226e..4ae515a3e5ecf0b1bbcb246e5a9e438ff125eb4e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -770,7 +770,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 816e740f32de7898501098ad9203e8ba65be9e1c..31c35a160403be4593a0c42fb843f04f0f478784 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1483,7 +1483,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 13926bfa0bfb1d7a373beb9e783ab37b719066ad..5f62aa61034125c3331f5d5fcdc347066a676d36 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -862,7 +862,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 75829180e810c5fb1566e41467ba5648e3126bcd..446c70e4a6fc8509cba0100af429c072dce331d6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1583,7 +1583,7 @@ nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index aaae84463f102e23454832d7eddb785d6d8396cb..1af6577f6cea064e353407bf2d328f656ae8fd0f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -451,7 +451,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 283bbe225781154522fc11bcb15c8b48fdfcc88a..6618b49adc812022e50a879cca152729ed957596 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -737,7 +737,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4453b5d9c2076c0dfd4b5990b12f766c2826074c..7daee90ef69e4bc7cefe427b3e04f1f03585b368 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1453,7 +1453,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 008498763be59f6a7ac2b951f6b40720aa419095..3afea5d7cd8034f64611104d1fb9cf684b5bada7 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -821,7 +821,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b6a7d87f0559e2c61c2aafba34472b44c0d2a2de..afa02ba193f5230eee73447e209209f4e6b0bac1 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1545,7 +1545,7 @@ nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 301fd8871a3868b6395067daf38b6751d3541794..c4cb9966ee5476ad08272f5ef9df94e916c523cd 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -395,7 +395,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3e93b912962c344d84e75ae3460438f3609db553..4df45c431c14e6594bcb5d33a2ddad1394f84286 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -681,7 +681,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 264ed64a9fcaa950510e8dd3b8d98da6c9964383..f2ef2c7f64256aa6e79edf10b9e658d004ff133f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3W3_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1412,7 +1412,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW3W3_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f60cc6443e3fd7ec532e3ed455dfba35ac5ad02b..23da9f20db679679d473e148da6d2b6733ba1512 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -681,7 +681,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 978fa003482ea976b1d6a37ec128ed9a9e7f3efc..520044eb9da7199dc625a3cd43d2fff19f347989 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4W4_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1412,7 +1412,7 @@ nb_kernel_ElecEwSh_VdwNone_GeomW4W4_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ff451a42f9f1614952a7b59960a952aec8484464..4bda51e551690e58efdd2b4ec79ff2ecc5fff3ae 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -486,7 +486,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 01c05613a0db5e4dfcb71ae112482878222b81ac..ca906e67ee1e3aeddb2925bac5900fe6ffd07ab5 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -816,7 +816,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4a356f79cf5cf1047d4687db5af6cfd304bac18e..e8720c7ceca322e96baa277e090dedce27ef08c7 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1664,7 +1664,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9689274423988e8b11e03fd0c94da0732bd460f7..66201c28d414c6478508ab61713a1e4c882e8102 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -925,7 +925,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5ed7c9fd072224043620f724f74d74302fd930fb..06a8860963ff584ec0f293ff11977d7635d5b384 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1781,7 +1781,7 @@ nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3bc029e883e00d300858c2a2f84953ff0853c189..dc00e65e62d74ce0264e8dadb04a4c0d3cafd115 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -431,7 +431,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 412608713f7dfa11a5dfbecd0740541c5981eeb2..4982a17a7faefb269d94e6b26ec487ca0039dd35 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -761,7 +761,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b873746aff40dd44e0abcdf3e758a0587811c5c4..ca413ad6a76d5946550a266777f020d090e16175 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3W3_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1624,7 +1624,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW3W3_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 3dcb50db49d62b1c6dc89fa9126f04940bdd8798..a16bd5543d7f76fa0cf8af3224cd8bf3384eb498 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -761,7 +761,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 33146afd17382b88a8d47253438bd7c1c4984aaf..e7343ec22f2e8ab7fe6d53e3273c8bd748f0241b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1624,7 +1624,7 @@ nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9ca758628d60e23d21ae888e401100f5c8b94fd9..505853483731cf16e55b464e1389dca046e37014 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -480,7 +480,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 782d45d7a502577cb601e7f1c930b8618a229d6e..fd1e8bcfba2d34765f0b9401ab2cbe082476e9db 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -726,7 +726,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f8827a4d2d9d08ca4f48f54ab99e9d5300eb16e8..50fa47dbbfd900324ca82b4e4770ac04f6d1215b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3W3_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1322,7 +1322,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW3W3_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0716db7ea02fa1edce10a874be9fc75430d93ef8..4e9b090c73d78a1175a33e23b0cebc17c1d9dc93 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -797,7 +797,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a301fbb54aeb9174f88fba08ee6270f088e55cb8..72d4af0bb50d3258db16bbc6ce7476ace53a888b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4W4_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1401,7 +1401,7 @@ nb_kernel_ElecEw_VdwCSTab_GeomW4W4_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6737d9ebef2add8bad32ae40a71da80eb3540b54..5222b0e77de5e0cabe7f143e4ada353e11f87690 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -450,7 +450,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f14e647629f073757199b2947c9ce95c43ce8a13..abbcfada47203f8b4abb2b543fe43923033ceffc 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -698,7 +698,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b53958ed9eff7250e65f455e6917a2a22d678791..a9085e40c2a8e3236fbe05f103960ad07d11aae0 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3W3_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1291,7 +1291,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW3W3_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8160ebe50c9602585509f6c4de8ea1c737e93056..16a021ed73de3c0a0f615c90ace401c437cc7af3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -772,7 +772,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8264dc45af4e1c3746f2e233bcf3044304bef828..05af10eefa2ebca69c2ac7b73b0392d7e1a8c644 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4W4_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1373,7 +1373,7 @@ nb_kernel_ElecEw_VdwLJEw_GeomW4W4_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 09053b0fc00098eae63cdca8435ecc62c7b548ee..72a0cb8461d7619d1bf75d3c7e61f5b505d5483d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -419,7 +419,7 @@ nb_kernel_ElecEw_VdwLJ_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 82356e01f5c2ef2aead4deebd217fe8ffbbdb023..08b69ade870c6c8d38ad35c8cb31dc6059022d5f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -665,7 +665,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 23a51af603b2d5c3a5b78aca4cdd7f490602307c..60c189a5b80409be8f5ba9c9e8e1229f10c57525 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3W3_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1261,7 +1261,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW3W3_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c87bc6a5e1e2d947df59adfc23ba2e914753ecd1..784184d1a4f99039de10f88190c80d2528e8165b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -731,7 +731,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 89bf1d0f2275791eb6649969be119d0a1a021143..0457bb57f3f2e0625695c240e797adc6421165df 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4W4_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1335,7 +1335,7 @@ nb_kernel_ElecEw_VdwLJ_GeomW4W4_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0178dbca525e558a30e03db4bb78008cf5cfc9c7..37aa63e1359af658a93b89327ac6e36d79bc20aa 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -370,7 +370,7 @@ nb_kernel_ElecEw_VdwNone_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8b6932f7f0e6cfd6987de91108b356f480c96779..910fb87d3f033a9d031e81023c1f09078a48fc60 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -616,7 +616,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index d77ccf843c6a7a1fd12329a93ebe75063d143d92..148d494e01d8c6a5df29b087c312a7e1e9bb043a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3W3_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1227,7 +1227,7 @@ nb_kernel_ElecEw_VdwNone_GeomW3W3_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index ecc9a8de4651f26d7be01e8b8de3be7843988cea..e929fd894c8ac36361c0ff33ffc8de0abdadad79 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -616,7 +616,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 57212d989f6b42c29042cac6d628b19e12beb717..f983622dd688623850ce9d74f88347c2cdf9688f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4W4_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1227,7 +1227,7 @@ nb_kernel_ElecEw_VdwNone_GeomW4W4_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index deb30b05e542c36c2160f49aa0313b261a73567a..36f2ff536d132a7bf36b3a7d148140d1819c9a38 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -527,7 +527,7 @@ nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 18009b0d10ad6bff7ead5012412c5822ddd34c25..293c680a276c4c664aaecf488c4c13053e85226c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -474,7 +474,7 @@ nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 6548c729609b9e0043af4c8c64845eeafe38f049..9bc65d6b07a325d018d866cc157685f6ae3b3c50 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -421,7 +421,7 @@ nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2287163d0206350a2a14597437564785b3f756c6..b05f614289fac67f5f9837afa3d1b2c4ddc338ac 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -418,7 +418,7 @@ nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 1ce2b950cb651e3790516e2f33fcacaf2a309762..915d003c0dd2c964f8b8d565eab2baa6b4c1178d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -421,7 +421,7 @@ nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 59c521139cf58a8c7cc9c90a794d886b9d348696..9ab3970b3cc5c82dc3bbf016f094c9ca2ea8c43a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -392,7 +392,7 @@ nb_kernel_ElecNone_VdwLJEw_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0738456875abe236248be7885dc6ac19622614d1..f00257d89c12b2fb7a173dbfa4c5b4d4fdf920b3 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJSh_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -381,7 +381,7 @@ nb_kernel_ElecNone_VdwLJSh_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 74a1b75ef9b607e99433f050f8e33a489d09afa8..9cd0fea739c7c83a86b50f0638a470e3d3fc80d0 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJSw_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -421,7 +421,7 @@ nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index be7b955821a71920b6dc5fda510b6ada3e6c9ff0..4ccbf79c1af732a269b5127c7aad7cde464b2491 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecNone_VdwLJ_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -352,7 +352,7 @@ nb_kernel_ElecNone_VdwLJ_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4f73001fc6d24ab96ee6e32f48ba5450b21c236e..c151637ac28a7bf20ce2fe7a62c516a767d4b2ba 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -476,7 +476,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index badd4a9e0b5416aa6ac3b8ff42b237753cc3e7d1..10ea983867f025d81393d1009d96935d3a14df02 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -700,7 +700,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index abd172beb235e5bcb60d5962aea0854790583e86..84ff9024e9a2fc7a0278b796f3cecb995b00d2ca 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1230,7 +1230,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 79aa3314935e3031d243c4344335cb89f3ee4ff2..f8d1b9094fa3b239658a8811d13745fd883eefa6 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -764,7 +764,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 48618593f65a078aa92c17277c5ba7f621e16f02..ca1682ad354378ef4e24938d4074b95215619511 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1322,7 +1322,7 @@ nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 98968e45cb097ff52723da264ab059e58ee20af4..e7d883a6951e79ae441ff06d6024ac5a208a759a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -415,7 +415,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 089eb4e48e2e4d3b693fa3e13acf71aecb968660..7b3aa4c3f5fda9c2610e49796bf4aca8cb104403 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -639,7 +639,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 0da3a31985149e7cc88e2ff29d94778a45522cf9..dd1f4f89ace774fc48b179ba99474bb38353b020 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1169,7 +1169,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index f092465982a50ecdf7d6fd0a2934ce58c03c65cc..6503765302f80e1fd4024d7b7b30c656649cb7d5 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -723,7 +723,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 648656b9bacecb53defaddc0259bd09821bf2983..6d1ea3797d2f02cd42fb694b79b3dfcd35f35519 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1261,7 +1261,7 @@ nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 424f5a2774d4eb58e3c99ac26a6666f24f6a2ba4..0666ad3d9494bc145aa8649b3368a5574e73a313 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -451,7 +451,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fe61d80b02d8f546f1edce24853396466057ddf8..6687795609c9c68461dbf3b190a58d11ac51e9cd 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -675,7 +675,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index deb9bff80ba8e170b7228149951319b9d45e3aa5..efe1115da63d60f44577d234fbda9f25095b5bee 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1205,7 +1205,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index cf29062bdedb52a2c3c7677c98e55234cf479644..1291014b4af58918fd2e62ee5f4c8316c5ebb270 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -761,7 +761,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c3160a04c2e1b4043fcd4adeeebc5288a84b5b93..6c3a3272872ba2d1fdb474343a93d509718f24e8 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1299,7 +1299,7 @@ nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 00068065f14ac9bed63cda985d2a40356e7078ed..bbf6b4d26c3777dbcf9ebfbf46202e751990707f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -359,7 +359,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 91fdc710e0e2d9bcf4f6b4f21dd9c34bb8f51a5b..3a0e910fb7e959871807acef8f20f91805caad1c 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -583,7 +583,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 43664b27f6435628825eedb5fe1c0d918534c1fc..46c590249c280cdd54fdcaae8e035e0bb5d2f899 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3W3_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1128,7 +1128,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW3W3_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8f4a8547f1d88ee46c26ebfd46052da9f70c3e70..7de52daf0219c25dfa2aeea3fdab396ecfdb5692 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -583,7 +583,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 8dd528e75761df5253d1b5bad205b3bd4d65a978..b65bbeb00041f47eafb2dc9e8f2e119bbb992137 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4W4_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1128,7 +1128,7 @@ nb_kernel_ElecRFCut_VdwNone_GeomW4W4_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5af87a19fed5c8358dd150d3525389a063d27197..910842b6297c31e86cef42e3b13610eac432802b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -449,7 +449,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index a988d0d580b907da206b36ca01c9b799a4607a22..ec21d92bb263750cb29beaa5980f1bf3a140227b 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -633,7 +633,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 503b4c97ff418ea428932eae448ac91b525d1895..96599a3fdf3a4844f4be1b7d917345f637dee92f 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3W3_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1043,7 +1043,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW3W3_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 25a8131b0f6fcc4325100b76df221504c27c67a0..f74bb1452981b418ddd1be51e4abc76807b8ed66 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -699,7 +699,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b4603f173aaa7eb0d1835358f91a1ac173f45785..30ae5f340dd9f2f666d8678ce9b85b4dcab0bca1 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1117,7 +1117,7 @@ nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index bf743ff77a8b085190cf5259fda4af6225d4e7c6..e5e8fb066593300d180e3ffe566ce4ed64fe6f41 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -383,7 +383,7 @@ nb_kernel_ElecRF_VdwLJ_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 9fed4cd2ca99f2e14fbe7204c7b795cc11de2fa2..ca7ace6e589942617782a62810f96c3a0e38520d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -567,7 +567,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index b0d3dbd3d88f200d642585946e3bca5d28b97ef2..f7873e4648323bfdc7903d0579031456fdd99e82 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3W3_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -977,7 +977,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW3W3_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 5e747c2b60ccdf5841f94001e135dfb620f0dfe2..6d597c7e4a51e8064ee6cd8056bf94b463f9ce46 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -633,7 +633,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index bcdcb140ec8ad95a2c3d0b5561b7ffc1f2c5a792..bc53eee46a1db8a4005c6dfd4971db54a30ea6ee 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4W4_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -1051,7 +1051,7 @@ nb_kernel_ElecRF_VdwLJ_GeomW4W4_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4c9526c8145f9164a73a541f2cec69141fdce375..326ba8ad8b790072b27b1ebd3e0c224db9dbde01 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomP1P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -334,7 +334,7 @@ nb_kernel_ElecRF_VdwNone_GeomP1P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index c0dde17c03b0e33c36d3a9e2ddf0257ea7812aa0..3f1f49386bf8c7aad0775609af47197c637f900e 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -518,7 +518,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 27536122b242fea7de9e6533b8ccc82bcade30b4..c345451b416a0c60616292f111d42a4d37ba9029 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3W3_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -943,7 +943,7 @@ nb_kernel_ElecRF_VdwNone_GeomW3W3_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 4433b9554bda61eac6060271cc8e7ad9905c9162..1c806d3d396b593186c506c4ae7682e783d4051a 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4P1_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -518,7 +518,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4P1_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 2d80d39770604e72e36693b2a1297b82d35a77a2..2dcb81a66b75ecf8a52cb4e790557f18b567704d 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,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.
@@ -58,7 +58,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4W4_VF_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
@@ -943,7 +943,7 @@ nb_kernel_ElecRF_VdwNone_GeomW4W4_F_sse4_1_single
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index fab6aceef1a067bff299e78959a5009b41b57880..99f3622cb1103af753250e5b7d5e5f0f73d8dbf4 100644 (file)
@@ -2,7 +2,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,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.
@@ -93,7 +93,7 @@ void
                     (t_nblist                    * gmx_restrict       nlist,
                      rvec                        * gmx_restrict          xx,
                      rvec                        * gmx_restrict          ff,
-                     t_forcerec                  * gmx_restrict          fr,
+                     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)
index 90814968c855ffcdd7ca870c2b7413efea866c9d..2d683c34cb9a636229660b3c049383540bc50344 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,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.
@@ -117,7 +117,7 @@ gmx_nonbonded_setup(t_forcerec *   fr,
             /* Add the generic kernels to the structure stored statically in nb_kernel.c */
             nb_kernel_list_add_kernels(kernellist_c, kernellist_c_size);
 
-            if (!(fr != NULL && fr->use_simd_kernels == FALSE))
+            if (!(fr != nullptr && fr->use_simd_kernels == FALSE))
             {
                 /* Add interaction-specific kernels for different architectures */
                 /* Single precision */
@@ -225,15 +225,15 @@ gmx_nonbonded_set_kernel_pointers(FILE *log, t_nblist *nl, gmx_bool bElecAndVdwS
         /* We typically call this setup routine before starting timers,
          * but if that has not been done for whatever reason we do it now.
          */
-        gmx_nonbonded_setup(NULL, FALSE);
+        gmx_nonbonded_setup(nullptr, FALSE);
     }
 
     /* Not used yet */
     other = "";
 
-    nl->kernelptr_vf = NULL;
-    nl->kernelptr_v  = NULL;
-    nl->kernelptr_f  = NULL;
+    nl->kernelptr_vf = nullptr;
+    nl->kernelptr_v  = nullptr;
+    nl->kernelptr_f  = nullptr;
 
     elec     = gmx_nbkernel_elec_names[nl->ielec];
     elec_mod = eintmod_names[nl->ielecmod];
@@ -257,20 +257,20 @@ gmx_nonbonded_set_kernel_pointers(FILE *log, t_nblist *nl, gmx_bool bElecAndVdwS
     {
         /* Try to find a specific kernel first */
 
-        for (i = 0; i < narch && nl->kernelptr_vf == NULL; i++)
+        for (i = 0; i < narch && nl->kernelptr_vf == nullptr; i++)
         {
             nl->kernelptr_vf       = (void *) nb_kernel_list_findkernel(log, arch_and_padding[i].arch, elec, elec_mod, vdw, vdw_mod, geom, other, "PotentialAndForce");
             nl->simd_padding_width = arch_and_padding[i].simd_padding_width;
         }
-        for (i = 0; i < narch && nl->kernelptr_f == NULL; i++)
+        for (i = 0; i < narch && nl->kernelptr_f == nullptr; i++)
         {
             nl->kernelptr_f        = (void *) nb_kernel_list_findkernel(log, arch_and_padding[i].arch, elec, elec_mod, vdw, vdw_mod, geom, other, "Force");
             nl->simd_padding_width = arch_and_padding[i].simd_padding_width;
 
             /* If there is not force-only optimized kernel, is there a potential & force one? */
-            if (nl->kernelptr_f == NULL)
+            if (nl->kernelptr_f == nullptr)
             {
-                nl->kernelptr_f        = (void *) nb_kernel_list_findkernel(NULL, arch_and_padding[i].arch, elec, elec_mod, vdw, vdw_mod, geom, other, "PotentialAndForce");
+                nl->kernelptr_f        = (void *) nb_kernel_list_findkernel(nullptr, arch_and_padding[i].arch, elec, elec_mod, vdw, vdw_mod, geom, other, "PotentialAndForce");
                 nl->simd_padding_width = arch_and_padding[i].simd_padding_width;
             }
         }
@@ -290,15 +290,15 @@ gmx_nonbonded_set_kernel_pointers(FILE *log, t_nblist *nl, gmx_bool bElecAndVdwS
             (nl->ivdw  != GMX_NBKERNEL_VDW_NONE)  && (nl->ivdwmod  == eintmodPOTSWITCH) &&
             bElecAndVdwSwitchDiffers)
         {
-            nl->kernelptr_vf = NULL;
-            nl->kernelptr_f  = NULL;
+            nl->kernelptr_vf = nullptr;
+            nl->kernelptr_f  = nullptr;
         }
 
         /* Give up, pick a generic one instead.
          * We only do this for particle-particle kernels; by leaving the water-optimized kernel
          * pointers to NULL, the water optimization will automatically be disabled for this interaction.
          */
-        if (nl->kernelptr_vf == NULL && !gmx_strcasecmp_min(geom, "Particle-Particle"))
+        if (nl->kernelptr_vf == nullptr && !gmx_strcasecmp_min(geom, "Particle-Particle"))
         {
             nl->kernelptr_vf       = (void *) gmx_nb_generic_kernel;
             nl->kernelptr_f        = (void *) gmx_nb_generic_kernel;
@@ -326,7 +326,7 @@ void do_nonbonded(t_forcerec *fr,
     int               n, n0, n1, i, i0, i1;
     t_nblists *       nblists;
     nb_kernel_data_t  kernel_data;
-    nb_kernel_t *     kernelptr = NULL;
+    nb_kernel_t *     kernelptr = nullptr;
     rvec *            f;
 
     kernel_data.flags                   = flags;
@@ -414,7 +414,7 @@ void do_nonbonded(t_forcerec *fr,
                         continue;
                     }
                     /* Neighborlists whose kernelptr==NULL will always be empty */
-                    if (kernelptr != NULL)
+                    if (kernelptr != nullptr)
                     {
                         (*kernelptr)(&(nlist[i]), x, f, fr, mdatoms, &kernel_data, nrnb);
                     }
index 4509ac24a80172f627ec4b1f700a682a934190ee..c0509feb606207a47365a3caae88975aab46a620 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,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.
@@ -332,19 +332,19 @@ void print_flop(FILE *out, t_nrnb *nrnb, double *nbfs, double *mflop)
     *nbfs = 0.0;
     for (i = 0; (i < eNR_NBKERNEL_ALLVSALLGB); i++)
     {
-        if (std::strstr(nbdata[i].name, "W3-W3") != NULL)
+        if (std::strstr(nbdata[i].name, "W3-W3") != nullptr)
         {
             *nbfs += 9e-6*nrnb->n[i];
         }
-        else if (std::strstr(nbdata[i].name, "W3") != NULL)
+        else if (std::strstr(nbdata[i].name, "W3") != nullptr)
         {
             *nbfs += 3e-6*nrnb->n[i];
         }
-        else if (std::strstr(nbdata[i].name, "W4-W4") != NULL)
+        else if (std::strstr(nbdata[i].name, "W4-W4") != nullptr)
         {
             *nbfs += 10e-6*nrnb->n[i];
         }
-        else if (std::strstr(nbdata[i].name, "W4") != NULL)
+        else if (std::strstr(nbdata[i].name, "W4") != nullptr)
         {
             *nbfs += 4e-6*nrnb->n[i];
         }
@@ -412,7 +412,7 @@ void print_flop(FILE *out, t_nrnb *nrnb, double *nbfs, double *mflop)
             *mflop += mni*flop;
             frac    = 100.0*mni*flop/tflop;
             tfrac  += frac;
-            if (out != NULL)
+            if (out != nullptr)
             {
                 fprintf(out, " %-32s %16.6f %15.3f  %6.1f\n",
                         nbdata[i].name, mni, mni*flop, frac);
@@ -461,7 +461,7 @@ void print_perf(FILE *out, double time_per_thread, double time_per_node,
             mflop         = mflop/time_per_node;
             wallclocktime = nsteps*delta_t;
 
-            if (getenv("GMX_DETAILED_PERF_STATS") == NULL)
+            if (getenv("GMX_DETAILED_PERF_STATS") == nullptr)
             {
                 fprintf(out, "%12s %12s %12s\n",
                         "", "(ns/day)", "(hour/ns)");
@@ -480,7 +480,7 @@ void print_perf(FILE *out, double time_per_thread, double time_per_node,
         }
         else
         {
-            if (getenv("GMX_DETAILED_PERF_STATS") == NULL)
+            if (getenv("GMX_DETAILED_PERF_STATS") == nullptr)
             {
                 fprintf(out, "%12s %14s\n",
                         "", "(steps/hour)");
index dd8586a89c06b630104d1c87b477d606d41ac3c5..96cf768664d28ff62c5e5e5e0ef06b442808532f 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,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.
@@ -37,6 +37,8 @@
 /* This file is completely threadsafe - keep it that way! */
 #include "gmxpre.h"
 
+#include "add_par.h"
+
 #include <string.h>
 
 #include <algorithm>
@@ -81,7 +83,7 @@ void add_param(t_params *ps, int ai, int aj, real *c, char *s)
     ps->param[ps->nr].ai() = ai;
     ps->param[ps->nr].aj() = aj;
     clear_atom_list(2, ps->param[ps->nr].a);
-    if (c == NULL)
+    if (c == nullptr)
     {
         clear_force_param(0, ps->param[ps->nr].c);
     }
index 94dee2656415fada44214041c1d451082457b8c1..0a2f123d115652568d67ea7e3c861ea1041f52a0 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,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.
@@ -41,6 +41,7 @@
 
 #include <string.h>
 
+#include <cassert>
 #include <cmath>
 
 #include "gromacs/gmxpreprocess/gpp_atomtype.h"
@@ -560,6 +561,7 @@ static void enter_function(t_params *p, t_functype ftype, int comb, real reppow,
         /* Type==-1 is used as a signal that this interaction is all-zero and should not be added. */
         if (!bNB && type >= 0)
         {
+            assert(il);
             nral  = NRAL(ftype);
             delta = nr*(nral+1);
             srenew(il->iatoms, il->nr+delta);
@@ -584,13 +586,13 @@ void convert_params(int atnr, t_params nbtypes[],
     ffp           = &mtop->ffparams;
     ffp->ntypes   = 0;
     ffp->atnr     = atnr;
-    ffp->functype = NULL;
-    ffp->iparams  = NULL;
+    ffp->functype = nullptr;
+    ffp->iparams  = nullptr;
     ffp->reppow   = reppow;
 
-    enter_function(&(nbtypes[F_LJ]),  (t_functype)F_LJ,    comb, reppow, ffp, NULL,
+    enter_function(&(nbtypes[F_LJ]),  (t_functype)F_LJ,    comb, reppow, ffp, nullptr,
                    &maxtypes, TRUE, TRUE);
-    enter_function(&(nbtypes[F_BHAM]), (t_functype)F_BHAM,  comb, reppow, ffp, NULL,
+    enter_function(&(nbtypes[F_BHAM]), (t_functype)F_BHAM,  comb, reppow, ffp, nullptr,
                    &maxtypes, TRUE, TRUE);
 
     for (mt = 0; mt < mtop->nmoltype; mt++)
@@ -599,7 +601,7 @@ void convert_params(int atnr, t_params nbtypes[],
         for (i = 0; (i < F_NRE); i++)
         {
             molt->ilist[i].nr     = 0;
-            molt->ilist[i].iatoms = NULL;
+            molt->ilist[i].iatoms = nullptr;
 
             plist = mi[mt].plist;
 
@@ -616,7 +618,7 @@ void convert_params(int atnr, t_params nbtypes[],
     }
 
     mtop->bIntermolecularInteractions = FALSE;
-    if (intermolecular_interactions != NULL)
+    if (intermolecular_interactions != nullptr)
     {
         /* Process the intermolecular interaction list */
         snew(mtop->intermolecular_ilist, F_NRE);
@@ -624,7 +626,7 @@ void convert_params(int atnr, t_params nbtypes[],
         for (i = 0; (i < F_NRE); i++)
         {
             mtop->intermolecular_ilist[i].nr     = 0;
-            mtop->intermolecular_ilist[i].iatoms = NULL;
+            mtop->intermolecular_ilist[i].iatoms = nullptr;
 
             plist = intermolecular_interactions->plist;
 
index 23285ed8ce81e80f8cb54d7422648bb5d02b97f6..c906fea25ea50fec07d9880ad5fa3b57e560d2dc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,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.
@@ -73,7 +73,7 @@ void fflib_filename_base(const char *filename, char *filebase, int maxlen)
     char       *ptr;
 
     cptr = strrchr(filename, DIR_SEPARATOR);
-    if (cptr != NULL)
+    if (cptr != nullptr)
     {
         /* Skip the separator */
         cptr += 1;
@@ -90,7 +90,7 @@ void fflib_filename_base(const char *filename, char *filebase, int maxlen)
     strcpy(filebase, cptr);
     /* Remove the extension */
     ptr = strrchr(filebase, '.');
-    if (ptr != NULL)
+    if (ptr != nullptr)
     {
         ptr[0] = '\0';
     }
@@ -173,7 +173,7 @@ gmx_bool fflib_fexist(const char *file)
 
     file_fullpath = low_gmxlibfn(file, TRUE, FALSE);
 
-    if (file_fullpath == NULL)
+    if (file_fullpath == nullptr)
     {
         return FALSE;
     }
index ee7bf4cc3847401da96937dbf00b0187c6371e92..fe26641bc2863ff9af52c4d7a6581aa1267d57a6 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,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.
@@ -61,7 +61,7 @@
 #include "gromacs/utility/smalloc.h"
 
 #define DIHEDRAL_WAS_SET_IN_RTP 0
-static gmx_bool was_dihedral_set_in_rtp(t_param *dih)
+static gmx_bool was_dihedral_set_in_rtp(const t_param *dih)
 {
     return dih->c[MAXFORCEPARAM-1] == DIHEDRAL_WAS_SET_IN_RTP;
 }
@@ -70,11 +70,11 @@ typedef gmx_bool (*peq)(t_param *p1, t_param *p2);
 
 static int acomp(const void *a1, const void *a2)
 {
-    t_param *p1, *p2;
-    int      ac;
+    const t_param *p1, *p2;
+    int            ac;
 
-    p1 = (t_param *)a1;
-    p2 = (t_param *)a2;
+    p1 = static_cast<const t_param *>(a1);
+    p2 = static_cast<const t_param *>(a2);
     if ((ac = (p1->aj()-p2->aj())) != 0)
     {
         return ac;
@@ -91,11 +91,11 @@ static int acomp(const void *a1, const void *a2)
 
 static int pcomp(const void *a1, const void *a2)
 {
-    t_param *p1, *p2;
-    int      pc;
+    const t_param *p1, *p2;
+    int            pc;
 
-    p1 = (t_param *)a1;
-    p2 = (t_param *)a2;
+    p1 = static_cast<const t_param *>(a1);
+    p2 = static_cast<const t_param *>(a2);
     if ((pc = (p1->ai()-p2->ai())) != 0)
     {
         return pc;
@@ -108,11 +108,11 @@ static int pcomp(const void *a1, const void *a2)
 
 static int dcomp(const void *d1, const void *d2)
 {
-    t_param *p1, *p2;
-    int      dc;
+    const t_param *p1, *p2;
+    int            dc;
 
-    p1 = (t_param *)d1;
-    p2 = (t_param *)d2;
+    p1 = static_cast<const t_param *>(d1);
+    p2 = static_cast<const t_param *>(d2);
     /* First sort by J & K (the two central) atoms */
     if ((dc = (p1->aj()-p2->aj())) != 0)
     {
@@ -306,11 +306,11 @@ static int int_comp(const void *a, const void *b)
 
 static int idcomp(const void *a, const void *b)
 {
-    t_param *pa, *pb;
-    int      d;
+    const t_param *pa, *pb;
+    int            d;
 
-    pa = (t_param *)a;
-    pb = (t_param *)b;
+    pa = static_cast<const t_param *>(a);
+    pb = static_cast<const t_param *>(b);
     if ((d = (pa->a[0]-pb->a[0])) != 0)
     {
         return d;
@@ -497,7 +497,7 @@ static int get_impropers(t_atoms *atoms, t_hackblock hb[], t_param **improper,
     /* Add all the impropers from the residue database to the list. */
     nimproper = 0;
     start     = 0;
-    if (hb != NULL)
+    if (hb != nullptr)
     {
         for (i = 0; (i < atoms->nres); i++)
         {
@@ -523,7 +523,7 @@ static int get_impropers(t_atoms *atoms, t_hackblock hb[], t_param **improper,
                         srenew(*improper, nalloc);
                     }
                     /* Not broken out */
-                    set_p(&((*improper)[nimproper]), ai, NULL, impropers->b[j].s);
+                    set_p(&((*improper)[nimproper]), ai, nullptr, impropers->b[j].s);
                     nimproper++;
                 }
             }
@@ -564,7 +564,7 @@ static int nb_dist(t_nextnb *nnb, int ai, int aj)
     return NRE;
 }
 
-gmx_bool is_hydro(t_atoms *atoms, int ai)
+static gmx_bool is_hydro(t_atoms *atoms, int ai)
 {
     return ((*(atoms->atomname[ai]))[0] == 'H');
 }
index 6f25a14da8bc8516f72d0df0d6055c4bdbfdce17..350e1ad95176a82c4f356cf4e4cd1e7e346be393 100644 (file)
@@ -57,7 +57,7 @@ static void low_mspeed(real tempi,
     real                                    boltz, sd;
     real                                    ekin, temp, mass, scal;
     gmx_mtop_atomloop_all_t                 aloop;
-    t_atom                                 *atom;
+    const t_atom                           *atom;
     gmx::TabulatedNormalDistribution<real>  normalDist;
 
     boltz = BOLTZ*tempi;
index 8c4bed2ee4ad5aee8b3bb900132cafd737977d82..ca209eb4e64c18a5b71d9c06cc50a930f12119f4 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,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.
@@ -183,7 +183,7 @@ static void read_vsite_database(const char *ddbname,
     snew(vsiteconflist, 1);
     snew(vsitetoplist, 1);
 
-    while (fgets2(pline, STRLEN-2, ddb) != NULL)
+    while (fgets2(pline, STRLEN-2, ddb) != nullptr)
     {
         strip_comment(pline);
         trim(pline);
@@ -192,7 +192,7 @@ static void read_vsite_database(const char *ddbname,
             if (pline[0] == OPENDIR)
             {
                 strncpy(dirstr, pline+1, STRLEN-2);
-                if ((ch = strchr (dirstr, CLOSEDIR)) != NULL)
+                if ((ch = strchr (dirstr, CLOSEDIR)) != nullptr)
                 {
                     (*ch) = 0;
                 }
@@ -292,7 +292,7 @@ static void read_vsite_database(const char *ddbname,
                             srenew(vsitetoplist[i].bond, k+1);
                             strncpy(vsitetoplist[i].bond[k].atom1, s1, MAXNAME-1);
                             strncpy(vsitetoplist[i].bond[k].atom2, s2, MAXNAME-1);
-                            vsitetoplist[i].bond[k].value = strtod(s3, NULL);
+                            vsitetoplist[i].bond[k].value = strtod(s3, nullptr);
                         }
                         else if (n == 4)
                         {
@@ -302,7 +302,7 @@ static void read_vsite_database(const char *ddbname,
                             strncpy(vsitetoplist[i].angle[k].atom1, s1, MAXNAME-1);
                             strncpy(vsitetoplist[i].angle[k].atom2, s2, MAXNAME-1);
                             strncpy(vsitetoplist[i].angle[k].atom3, s3, MAXNAME-1);
-                            vsitetoplist[i].angle[k].value = strtod(s4, NULL);
+                            vsitetoplist[i].angle[k].value = strtod(s4, nullptr);
                         }
                         else
                         {
@@ -363,7 +363,7 @@ static char *get_dummymass_name(t_vsiteconf vsiteconflist[], int nvsiteconf, cha
     }
     else
     {
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -582,7 +582,7 @@ static void my_add_param(t_params *plist, int ai, int aj, real b)
     { NOTSET, NOTSET, NOTSET, NOTSET, NOTSET, NOTSET };
 
     c[0] = b;
-    add_param(plist, ai, aj, c, NULL);
+    add_param(plist, ai, aj, c, nullptr);
 }
 
 static void add_vsites(t_params plist[], int vsite_type[],
@@ -1030,7 +1030,7 @@ static int gen_vsites_trp(gpp_atomtype_t atype, rvec *newx[],
     srenew(*newcgnr, at->nr+*nadd);
     for (j = 0; j < NMASS; j++)
     {
-        (*newatomname)[at->nr+*nadd-1-j] = NULL;
+        (*newatomname)[at->nr+*nadd-1-j] = nullptr;
     }
 
     /* Dummy masses will be placed at the center-of-mass in each ring. */
@@ -1225,7 +1225,7 @@ static int gen_vsites_tyr(gpp_atomtype_t atype, rvec *newx[],
     srenew(*newatomname, at->nr+*nadd);
     srenew(*newvsite_type, at->nr+*nadd);
     srenew(*newcgnr, at->nr+*nadd);
-    (*newatomname)[at->nr+*nadd-1] = NULL;
+    (*newatomname)[at->nr+*nadd-1] = nullptr;
 
     /* Calc the dummy mass initial position */
     rvec_sub(x[ats[atHH]], x[ats[atOH]], r1);
@@ -1536,7 +1536,7 @@ void do_vsites(int nrtp, t_restp rtp[], gpp_atomtype_t atype,
     t_atom           *newatom;
     t_params         *params;
     char           ***newatomname;
-    char             *resnm = NULL;
+    char             *resnm = nullptr;
     int               ndb, f;
     char            **db;
     int               nvsiteconf, nvsitetop, cmplength;
@@ -1576,20 +1576,20 @@ void do_vsites(int nrtp, t_restp rtp[], gpp_atomtype_t atype,
         { "CG", /* PHE */
           "CD1", "HD1", "CD2", "HD2",
           "CE1", "HE1", "CE2", "HE2",
-          "CZ", "HZ", NULL },
+          "CZ", "HZ", nullptr },
         { "CB", /* TRP */
           "CG",
           "CD1", "HD1", "CD2",
           "NE1", "HE1", "CE2", "CE3", "HE3",
           "CZ2", "HZ2", "CZ3", "HZ3",
-          "CH2", "HH2", NULL },
+          "CH2", "HH2", nullptr },
         { "CG", /* TYR */
           "CD1", "HD1", "CD2", "HD2",
           "CE1", "HE1", "CE2", "HE2",
-          "CZ", "OH", "HH", NULL },
+          "CZ", "OH", "HH", nullptr },
         { "CG", /* HIS */
           "ND1", "HD1", "CD2", "HD2",
-          "CE1", "HE1", "NE2", "HE2", NULL }
+          "CE1", "HE1", "NE2", "HE2", nullptr }
     };
 
     if (debug)
@@ -1600,9 +1600,9 @@ void do_vsites(int nrtp, t_restp rtp[], gpp_atomtype_t atype,
 
     ndb           = fflib_search_file_end(ffdir, ".vsd", FALSE, &db);
     nvsiteconf    = 0;
-    vsiteconflist = NULL;
+    vsiteconflist = nullptr;
     nvsitetop     = 0;
-    vsitetop      = NULL;
+    vsitetop      = nullptr;
     for (f = 0; f < ndb; f++)
     {
         read_vsite_database(db[f], &vsiteconflist, &nvsiteconf, &vsitetop, &nvsitetop);
@@ -1873,7 +1873,7 @@ void do_vsites(int nrtp, t_restp rtp[], gpp_atomtype_t atype,
                     strcpy(nexttpname, get_atomtype_name(get_atype(heavies[0], at, nrtp, rtp, rt), atype));
                     ch = get_dummymass_name(vsiteconflist, nvsiteconf, tpname, nexttpname);
 
-                    if (ch == NULL)
+                    if (ch == nullptr)
                     {
                         if (ndb > 0)
                         {
@@ -1912,7 +1912,7 @@ void do_vsites(int nrtp, t_restp rtp[], gpp_atomtype_t atype,
 
                     for (j = 0; j < NMASS; j++)
                     {
-                        newatomname[at->nr+nadd-1-j] = NULL;
+                        newatomname[at->nr+nadd-1-j] = nullptr;
                     }
 
                     /* calculate starting position for the masses */
index 7759c00cd49f15f28107d717608fa3f13d61c296..00b8d11fa7fb00315895717cf587f4f5279b29bd 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,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.
@@ -40,7 +40,6 @@
 
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/confio.h"
-#include "gromacs/fileio/readinp.h"
 #include "gromacs/fileio/trxio.h"
 #include "gromacs/math/3dtransforms.h"
 #include "gromacs/math/utilities.h"
@@ -138,15 +137,15 @@ int gmx_genconf(int argc, char *argv[])
     t_filenm          fnm[] = {
         { efSTX, "-f", "conf", ffREAD  },
         { efSTO, "-o", "out",  ffWRITE },
-        { efTRX, "-trj", NULL,  ffOPTRD }
+        { efTRX, "-trj", nullptr,  ffOPTRD }
     };
 #define NFILE asize(fnm)
-    static rvec       nrbox    = {1, 1, 1};
-    static int        seed     = 0;               /* seed for random number generator */
-    static gmx_bool   bRandom  = FALSE;           /* False: no random rotations */
-    static gmx_bool   bRenum   = TRUE;            /* renumber residues */
-    static rvec       dist     = {0, 0, 0};       /* space added between molecules ? */
-    static rvec       max_rot  = {180, 180, 180}; /* maximum rotation */
+    rvec              nrbox    = {1, 1, 1};
+    int               seed     = 0;               /* seed for random number generator */
+    gmx_bool          bRandom  = FALSE;           /* False: no random rotations */
+    gmx_bool          bRenum   = TRUE;            /* renumber residues */
+    rvec              dist     = {0, 0, 0};       /* space added between molecules ? */
+    rvec              max_rot  = {180, 180, 180}; /* maximum rotation */
     t_pargs           pa[]     = {
         { "-nbox",   FALSE, etRVEC, {nrbox},   "Number of boxes" },
         { "-dist",   FALSE, etRVEC, {dist},    "Distance between boxes" },
@@ -285,7 +284,7 @@ int gmx_genconf(int argc, char *argv[])
     }
     if (bTRX)
     {
-        close_trj(status);
+        close_trx(status);
     }
 
     /* make box bigger */
@@ -313,5 +312,15 @@ int gmx_genconf(int argc, char *argv[])
 
     write_sto_conf(opt2fn("-o", NFILE, fnm), *top->name, atoms, x, v, ePBC, box);
 
+    sfree(x);
+    sfree(v);
+    sfree(xrot);
+    sfree(vrot);
+    sfree(xx);
+    done_top(top);
+    sfree(top);
+    done_filenms(NFILE, fnm);
+    output_env_done(oenv);
+
     return 0;
 }
index 88fd8dd49a2f0cfac1cab3b0209275e1dbdac28b..5f6643ec3a7f9b0411c15260b775c8f506440706 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,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.
@@ -108,7 +108,7 @@ static void hacksearch_atom(int *ii, int *jj, char *name,
     return;
 }
 
-void dump_ab(FILE *out, int natom, int nab[], t_hack *ab[], gmx_bool bHeader)
+static void dump_ab(FILE *out, int natom, int nab[], t_hack *ab[], gmx_bool bHeader)
 {
     int i, j;
 
@@ -149,11 +149,11 @@ static t_hackblock *get_hackblocks(t_atoms *pdba, int nah, t_hackblock ah[],
     /* first the termini */
     for (i = 0; i < nterpairs; i++)
     {
-        if (ntdb[i] != NULL)
+        if (ntdb[i] != nullptr)
         {
             copy_t_hackblock(ntdb[i], &hb[rN[i]]);
         }
-        if (ctdb[i] != NULL)
+        if (ctdb[i] != nullptr)
         {
             merge_t_hackblock(ctdb[i], &hb[rC[i]]);
         }
@@ -164,7 +164,7 @@ static t_hackblock *get_hackblocks(t_atoms *pdba, int nah, t_hackblock ah[],
         ahptr = search_h_db(nah, ah, *pdba->resinfo[rnr].rtp);
         if (ahptr)
         {
-            if (hb[rnr].name == NULL)
+            if (hb[rnr].name == nullptr)
             {
                 hb[rnr].name = gmx_strdup(ahptr->name);
             }
@@ -210,9 +210,9 @@ static void expand_hackblocks_one(t_hackblock *hbr, char *atomname,
         }
 
         if (!bIgnore &&
-            ( ( ( hbr->hack[j].tp > 0 || hbr->hack[j].oname == NULL ) &&
+            ( ( ( hbr->hack[j].tp > 0 || hbr->hack[j].oname == nullptr ) &&
                 strcmp(atomname, hbr->hack[j].ai()) == 0 ) ||
-              ( hbr->hack[j].oname != NULL &&
+              ( hbr->hack[j].oname != nullptr &&
                 strcmp(atomname, hbr->hack[j].oname) == 0) ) )
         {
             /* now expand all hacks for this atom */
@@ -227,9 +227,9 @@ static void expand_hackblocks_one(t_hackblock *hbr, char *atomname,
                 (*abi)[*nabi + k].bXSet = FALSE;
                 /* if we're adding (oname==NULL) and don't have a new name (nname)
                    yet, build it from atomname */
-                if ( (*abi)[*nabi + k].nname == NULL)
+                if ( (*abi)[*nabi + k].nname == nullptr)
                 {
-                    if ( (*abi)[*nabi + k].oname == NULL)
+                    if ( (*abi)[*nabi + k].oname == nullptr)
                     {
                         (*abi)[*nabi + k].nname    = gmx_strdup(atomname);
                         (*abi)[*nabi + k].nname[0] = 'H';
@@ -276,7 +276,7 @@ static void expand_hackblocks_one(t_hackblock *hbr, char *atomname,
             (*nabi) += hbr->hack[j].nr;
 
             /* add hacks to atoms we've just added */
-            if (hbr->hack[j].tp > 0 || hbr->hack[j].oname == NULL)
+            if (hbr->hack[j].tp > 0 || hbr->hack[j].oname == nullptr)
             {
                 for (k = 0; k < hbr->hack[j].nr; k++)
                 {
@@ -328,10 +328,10 @@ static int check_atoms_present(t_atoms *pdba, int nab[], t_hack *ab[])
         rnr = pdba->atom[i].resind;
         for (j = 0; j < nab[i]; j++)
         {
-            if (ab[i][j].oname == NULL)
+            if (ab[i][j].oname == nullptr)
             {
                 /* we're adding */
-                if (ab[i][j].nname == NULL)
+                if (ab[i][j].nname == nullptr)
                 {
                     gmx_incons("ab[i][j].nname not allocated");
                 }
@@ -355,7 +355,7 @@ static int check_atoms_present(t_atoms *pdba, int nab[], t_hack *ab[])
                     nadd++;
                 }
             }
-            else if (ab[i][j].nname == NULL)
+            else if (ab[i][j].nname == nullptr)
             {
                 /* we're deleting */
                 nadd--;
@@ -383,7 +383,7 @@ static void calc_all_pos(t_atoms *pdba, rvec x[], int nab[], t_hack *ab[],
         for (j = 0; j < nab[i]; j += ab[i][j].nr)
         {
             /* check if we're adding: */
-            if (ab[i][j].oname == NULL && ab[i][j].tp > 0)
+            if (ab[i][j].oname == nullptr && ab[i][j].tp > 0)
             {
                 bFoundAll = TRUE;
                 for (m = 0; (m < ab[i][j].nctl && bFoundAll); m++)
@@ -466,11 +466,11 @@ static int add_h_low(t_atoms **pdbaptr, rvec *xptr[],
                      int **nabptr, t_hack ***abptr,
                      gmx_bool bUpdate_pdba, gmx_bool bKeep_old_pdba)
 {
-    t_atoms        *newpdba = NULL, *pdba = NULL;
+    t_atoms        *newpdba = nullptr, *pdba = nullptr;
     int             nadd;
     int             i, newi, j, natoms, nalreadypresent;
-    int            *nab = NULL;
-    t_hack        **ab  = NULL;
+    int            *nab = nullptr;
+    t_hack        **ab  = nullptr;
     t_hackblock    *hb;
     rvec           *xn;
     gmx_bool        bKeep_ab;
@@ -584,7 +584,7 @@ static int add_h_low(t_atoms **pdbaptr, rvec *xptr[],
     for (i = 0; (i < natoms); i++)
     {
         /* check if this atom wasn't scheduled for deletion */
-        if (nab[i] == 0 || (ab[i][0].nname != NULL) )
+        if (nab[i] == 0 || (ab[i][0].nname != nullptr) )
         {
             if (newi >= natoms+nadd)
             {
@@ -613,7 +613,7 @@ static int add_h_low(t_atoms **pdbaptr, rvec *xptr[],
             nalreadypresent = 0;
             for (j = 0; j < nab[i]; j++)
             {
-                if (ab[i][j].oname == NULL) /* add */
+                if (ab[i][j].oname == nullptr) /* add */
                 {
                     newi++;
                     if (newi >= natoms+nadd)
@@ -636,12 +636,12 @@ static int add_h_low(t_atoms **pdbaptr, rvec *xptr[],
                         fprintf(debug, " + %d", newi+1);
                     }
                 }
-                if (ab[i][j].nname != NULL &&
-                    (ab[i][j].oname == NULL ||
+                if (ab[i][j].nname != nullptr &&
+                    (ab[i][j].oname == nullptr ||
                      strcmp(ab[i][j].oname, *newpdba->atomname[newi]) == 0))
                 {
                     /* add or replace */
-                    if (ab[i][j].oname == NULL && ab[i][j].bAlreadyPresent)
+                    if (ab[i][j].oname == nullptr && ab[i][j].bAlreadyPresent)
                     {
                         /* This atom is already present, copy it from the input. */
                         nalreadypresent++;
@@ -665,8 +665,8 @@ static int add_h_low(t_atoms **pdbaptr, rvec *xptr[],
                             }
                             snew(newpdba->atomname[newi], 1);
                             *newpdba->atomname[newi] = gmx_strdup(ab[i][j].nname);
-                            if (ab[i][j].oname != NULL && ab[i][j].atom) /* replace */
-                            {                                            /*          newpdba->atom[newi].m    = ab[i][j].atom->m; */
+                            if (ab[i][j].oname != nullptr && ab[i][j].atom) /* replace */
+                            {                                               /*          newpdba->atom[newi].m    = ab[i][j].atom->m; */
 /*        newpdba->atom[newi].q    = ab[i][j].atom->q; */
 /*        newpdba->atom[newi].type = ab[i][j].atom->type; */
                             }
index 6ab3934624849946fcc3c10680f634d2005772cb..2ce02ee6cda4a8c1e633f55480fc21abf7ddc768 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,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.
@@ -63,9 +63,9 @@ typedef struct {
 } t_define;
 
 static int        ndef   = 0;
-static t_define  *defs   = NULL;
+static t_define  *defs   = nullptr;
 static int        nincl  = 0;
-static char     **incl   = 0;
+static char     **incl   = nullptr;
 
 /* enum used for handling ifdefs */
 enum {
@@ -93,7 +93,7 @@ static const char *strstrw(const char *buf, const char *word)
 {
     const char *ptr;
 
-    while ((ptr = strstr(buf, word)) != NULL)
+    while ((ptr = strstr(buf, word)) != nullptr)
     {
         /* Check if we did not find part of a longer word */
         if (ptr &&
@@ -105,7 +105,7 @@ static const char *strstrw(const char *buf, const char *word)
 
         buf = ptr + strlen(word);
     }
-    return NULL;
+    return nullptr;
 }
 
 static gmx_bool find_directive(char *buf, char **name, char **val)
@@ -143,7 +143,7 @@ static gmx_bool find_directive(char *buf, char **name, char **val)
         }
     }
     /* Check if anything is remaining */
-    *val = (*buf != 0) ? buf : NULL;
+    *val = (*buf != 0) ? buf : nullptr;
     return TRUE;
 }
 
@@ -156,7 +156,7 @@ static void add_include(const char *include)
 {
     int i;
 
-    if (include == NULL)
+    if (include == nullptr)
     {
         return;
     }
@@ -184,7 +184,7 @@ static void done_includes()
         sfree(incl[i]);
     }
     sfree(incl);
-    incl  = NULL;
+    incl  = nullptr;
     nincl = 0;
 }
 
@@ -220,7 +220,7 @@ static void add_define(const char *name, const char *value)
     }
     else
     {
-        defs[i].def  = NULL;
+        defs[i].def  = nullptr;
     }
 }
 
@@ -233,7 +233,7 @@ static void done_defines()
         sfree(defs[i].def);
     }
     sfree(defs);
-    defs = NULL;
+    defs = nullptr;
     ndef = 0;
 }
 
@@ -269,7 +269,7 @@ int cpp_open_file(const char *filenm, gmx_cpp_t *handle, char **cppopts)
                 }
                 else
                 {
-                    add_define(cppopts[i] + 2, NULL);
+                    add_define(cppopts[i] + 2, nullptr);
                 }
             }
             i++;
@@ -282,7 +282,7 @@ int cpp_open_file(const char *filenm, gmx_cpp_t *handle, char **cppopts)
 
     snew(cpp, 1);
     *handle      = cpp;
-    cpp->fn      = NULL;
+    cpp->fn      = nullptr;
     /* Find the file. First check whether it is in the current directory. */
     if (gmx_fexist(filenm))
     {
@@ -312,7 +312,7 @@ int cpp_open_file(const char *filenm, gmx_cpp_t *handle, char **cppopts)
     {
         gmx_fatal(FARGS, "Topology include file \"%s\" not found", filenm);
     }
-    if (NULL != debug)
+    if (nullptr != debug)
     {
         fprintf(debug, "GMXCPP: cpp file open %s\n", cpp->fn);
     }
@@ -323,14 +323,14 @@ int cpp_open_file(const char *filenm, gmx_cpp_t *handle, char **cppopts)
     ptr  = strrchr(cpp->fn, '/');
     ptr2 = strrchr(cpp->fn, DIR_SEPARATOR);
 
-    if (ptr == NULL || (ptr2 != NULL && ptr2 > ptr))
+    if (ptr == nullptr || (ptr2 != nullptr && ptr2 > ptr))
     {
         ptr = ptr2;
     }
-    if (ptr == NULL)
+    if (ptr == nullptr)
     {
-        cpp->path = NULL;
-        cpp->cwd  = NULL;
+        cpp->path = nullptr;
+        cpp->cwd  = nullptr;
     }
     else
     {
@@ -340,33 +340,33 @@ int cpp_open_file(const char *filenm, gmx_cpp_t *handle, char **cppopts)
         snew(cpp->cwd, STRLEN);
 
         gmx_getcwd(cpp->cwd, STRLEN);
-        if (NULL != debug)
+        if (nullptr != debug)
         {
             fprintf(debug, "GMXCPP: cwd %s\n", cpp->cwd);
         }
         gmx_chdir(cpp->path);
 
-        if (NULL != debug)
+        if (nullptr != debug)
         {
             fprintf(debug, "GMXCPP: chdir to %s\n", cpp->path);
         }
     }
     cpp->line_len = 0;
-    cpp->line     = NULL;
+    cpp->line     = nullptr;
     cpp->line_nr  = 0;
     cpp->nifdef   = 0;
-    cpp->ifdefs   = NULL;
-    cpp->child    = NULL;
-    cpp->parent   = NULL;
-    if (cpp->fp == NULL)
+    cpp->ifdefs   = nullptr;
+    cpp->child    = nullptr;
+    cpp->parent   = nullptr;
+    if (cpp->fp == nullptr)
     {
-        if (NULL != debug)
+        if (nullptr != debug)
         {
             fprintf(debug, "GMXCPP: opening file %s\n", cpp->fn);
         }
         cpp->fp = fopen(cpp->fn, "r");
     }
-    if (cpp->fp == NULL)
+    if (cpp->fp == nullptr)
     {
         switch (errno)
         {
@@ -500,11 +500,11 @@ process_directive(gmx_cpp_t *handlep, const char *dname, const char *dval)
                     inc_fn, i0, len);
         }
         /* Open include file and store it as a child in the handle structure */
-        status = cpp_open_file(inc_fn, &(handle->child), NULL);
+        status = cpp_open_file(inc_fn, &(handle->child), nullptr);
         sfree(inc_fn);
         if (status != eCPP_OK)
         {
-            handle->child = NULL;
+            handle->child = nullptr;
             return status;
         }
         /* Make a linked list of open files and move on to the include file */
@@ -590,7 +590,7 @@ int cpp_read_line(gmx_cpp_t *handlep, int n, char buf[])
     if (!bEOF)
     {
         /* Read the actual line now. */
-        if (fgets2(buf, n-1, handle->fp) == NULL)
+        if (fgets2(buf, n-1, handle->fp) == nullptr)
         {
             /* Recheck EOF, since we could have been at the end before
              * the fgets2 call, but we need to read past the end to know.
@@ -608,13 +608,13 @@ int cpp_read_line(gmx_cpp_t *handlep, int n, char buf[])
 
     if (bEOF)
     {
-        if (handle->parent == NULL)
+        if (handle->parent == nullptr)
         {
             return eCPP_EOF;
         }
         cpp_close_file(handlep);
         *handlep      = handle->parent;
-        handle->child = NULL;
+        handle->child = nullptr;
         return cpp_read_line(handlep, n, buf);
     }
     else
@@ -663,7 +663,7 @@ int cpp_read_line(gmx_cpp_t *handlep, int n, char buf[])
         {
             nn  = 0;
             ptr = buf;
-            while ((ptr = strstrw(ptr, defs[i].name)) != NULL)
+            while ((ptr = strstrw(ptr, defs[i].name)) != nullptr)
             {
                 nn++;
                 ptr += strlen(defs[i].name);
@@ -675,7 +675,7 @@ int cpp_read_line(gmx_cpp_t *handlep, int n, char buf[])
                 len = strlen(buf) + nn*std::max(four, four+strlen(defs[i].def)-strlen(defs[i].name));
                 snew(name, len);
                 ptr = buf;
-                while ((ptr2 = strstrw(ptr, defs[i].name)) != NULL)
+                while ((ptr2 = strstrw(ptr, defs[i].name)) != nullptr)
                 {
                     strncat(name, ptr, (int)(ptr2-ptr));
                     strcat(name, defs[i].def);
@@ -719,9 +719,9 @@ int cpp_close_file(gmx_cpp_t *handlep)
         fprintf(debug, "GMXCPP: closing file %s\n", handle->fn);
     }
     fclose(handle->fp);
-    if (NULL != handle->cwd)
+    if (nullptr != handle->cwd)
     {
-        if (NULL != debug)
+        if (nullptr != debug)
         {
             fprintf(debug, "GMXCPP: chdir to %s\n", handle->cwd);
         }
@@ -748,28 +748,28 @@ int cpp_close_file(gmx_cpp_t *handlep)
                 return eCPP_UNKNOWN;
         }
     }
-    handle->fp      = NULL;
+    handle->fp      = nullptr;
     handle->line_nr = 0;
-    if (NULL != handle->fn)
+    if (nullptr != handle->fn)
     {
         sfree(handle->fn);
-        handle->fn = NULL;
+        handle->fn = nullptr;
     }
-    if (NULL != handle->line)
+    if (nullptr != handle->line)
     {
         sfree(handle->line);
-        handle->line = NULL;
+        handle->line = nullptr;
     }
-    if (NULL != handle->ifdefs)
+    if (nullptr != handle->ifdefs)
     {
         sfree(handle->ifdefs);
     }
     handle->nifdef = 0;
-    if (NULL != handle->path)
+    if (nullptr != handle->path)
     {
         sfree(handle->path);
     }
-    if (NULL != handle->cwd)
+    if (nullptr != handle->cwd)
     {
         sfree(handle->cwd);
     }
index 858e36d7b04443f9394721836eab3af47703f4f8..68538e842636e5c4a841583c3cae4f34413abebb 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,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.
@@ -92,7 +92,7 @@ char *get_atomtype_name(int nt, gpp_atomtype_t ga)
 {
     if ((nt < 0) || (nt >= ga->nr))
     {
-        return NULL;
+        return nullptr;
     }
 
     return *(ga->atomname[nt]);
@@ -238,16 +238,16 @@ gpp_atomtype_t init_atomtype(void)
     snew(ga, 1);
 
     ga->nr           = 0;
-    ga->atom         = NULL;
-    ga->atomname     = NULL;
-    ga->nb           = NULL;
-    ga->bondatomtype = NULL;
-    ga->radius       = NULL;
-    ga->vol          = NULL;
-    ga->surftens     = NULL;
-    ga->atomnumber   = NULL;
-    ga->gb_radius    = NULL;
-    ga->S_hct        = NULL;
+    ga->atom         = nullptr;
+    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;
 }
@@ -309,7 +309,7 @@ int add_atomtype(gpp_atomtype_t ga, t_symtab *tab,
     {
         if (strcmp(*ga->atomname[i], name) == 0)
         {
-            if (NULL != debug)
+            if (nullptr != debug)
             {
                 fprintf(debug, "Trying to add atomtype %s again. Skipping it.\n", name);
             }
@@ -528,7 +528,7 @@ void renum_atype(t_params plist[], gmx_mtop_t *mtop,
     }
 
     /* Renumber nlist */
-    nbsnew = NULL;
+    nbsnew = nullptr;
     snew(nbsnew, plist[ftype].nr);
 
     nrfp  = NRFP(ftype);
index 0b26182b75420a1dc2dbf50fda3b089a060fc14d..2d79963270a12666b2676a957d49e8e3a3b72ac3 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,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.
@@ -74,7 +74,7 @@ char *get_bond_atomtype_name(int nt, t_bond_atomtype at)
 
     if ((nt < 0) || (nt >= ga->nr))
     {
-        return NULL;
+        return nullptr;
     }
 
     return *(ga->atomname[nt]);
@@ -107,5 +107,5 @@ void done_bond_atomtype(t_bond_atomtype *at)
     ga->nr = 0;
     sfree(ga);
 
-    *at = NULL;
+    *at = nullptr;
 }
index 913afe9233f84ec0d839aab8ae6cc8580c45642f..d93b55b74a7c00ed2fb083ae42acb0bce1a09e3f 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,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.
@@ -63,10 +63,15 @@ typedef struct {
     real       c[MAXFORCEPARAM]; /* Force parameters (eg. b0 = c[0])   */
     char       s[MAXSLEN];       /* A string (instead of parameters),    *
                                   * read from the .rtp file in pdb2gmx   */
+    const int &ai() const { return a[0]; }
     int   &ai() { return a[0]; }
+    const int &aj() const { return a[1]; }
     int   &aj() { return a[1]; }
+    const int &ak() const { return a[2]; }
     int   &ak() { return a[2]; }
+    const int &al() const { return a[3]; }
     int   &al() { return a[3]; }
+    const int &am() const { return a[4]; }
     int   &am() { return a[4]; }
 
     real      &c0() { return c[0]; }
index be33e421c5067827141f017865d26577ec79a0bd..bc47e738fda926156d870671b6cd7babd0f59464 100644 (file)
@@ -49,6 +49,7 @@
 #include <sys/types.h>
 
 #include "gromacs/commandline/pargs.h"
+#include "gromacs/ewald/pme.h"
 #include "gromacs/fft/calcgrid.h"
 #include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/enxio.h"
@@ -76,6 +77,7 @@
 #include "gromacs/mdlib/constr.h"
 #include "gromacs/mdlib/genborn.h"
 #include "gromacs/mdlib/perf_est.h"
+#include "gromacs/mdrunutility/mdmodules.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/mdtypes/nblist.h"
@@ -91,6 +93,7 @@
 #include "gromacs/trajectory/trajectoryframe.h"
 #include "gromacs/utility/arraysize.h"
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxassert.h"
@@ -260,7 +263,7 @@ static void check_bonds_timestep(gmx_mtop_t *mtop, double dt, warninp_t wi)
     w_a1      = w_a2 = -1;
     w_period2 = -1.0;
 
-    w_moltype = NULL;
+    w_moltype = nullptr;
     for (molt = 0; molt < mtop->nmoltype; molt++)
     {
         moltype = &mtop->moltype[molt];
@@ -322,7 +325,7 @@ static void check_bonds_timestep(gmx_mtop_t *mtop, double dt, warninp_t wi)
                         }
                     }
                     if (!bFound &&
-                        (w_moltype == NULL || period2 < w_period2))
+                        (w_moltype == nullptr || period2 < w_period2))
                     {
                         w_moltype = moltype;
                         w_a1      = a1;
@@ -334,7 +337,7 @@ static void check_bonds_timestep(gmx_mtop_t *mtop, double dt, warninp_t wi)
         }
     }
 
-    if (w_moltype != NULL)
+    if (w_moltype != nullptr)
     {
         bWarn = (w_period2 < gmx::square(min_steps_warn*dt));
         /* A check that would recognize most water models */
@@ -363,7 +366,7 @@ static void check_bonds_timestep(gmx_mtop_t *mtop, double dt, warninp_t wi)
 static void check_vel(gmx_mtop_t *mtop, rvec v[])
 {
     gmx_mtop_atomloop_all_t aloop;
-    t_atom                 *atom;
+    const t_atom           *atom;
     int                     a;
 
     aloop = gmx_mtop_atomloop_all_init(mtop);
@@ -383,7 +386,7 @@ static void check_shells_inputrec(gmx_mtop_t *mtop,
                                   warninp_t   wi)
 {
     gmx_mtop_atomloop_all_t aloop;
-    t_atom                 *atom;
+    const t_atom           *atom;
     int                     a, nshells = 0;
     char                    warn_buf[STRLEN];
 
@@ -509,7 +512,7 @@ new_status(const char *topfile, const char *topppfile, const char *confin,
            gmx_bool bMorse,
            warninp_t wi)
 {
-    t_molinfo      *molinfo = NULL;
+    t_molinfo      *molinfo = nullptr;
     int             nmolblock;
     gmx_molblock_t *molblock, *molbs;
     int             mb, i, nrmols, nmismatch;
@@ -603,16 +606,39 @@ new_status(const char *topfile, const char *topppfile, const char *confin,
     }
 
     t_topology *conftop;
+    rvec       *x = nullptr;
+    rvec       *v = nullptr;
     snew(conftop, 1);
-    init_state(state, 0, 0, 0, 0, 0);
-    read_tps_conf(confin, conftop, NULL, &state->x, &state->v, state->box, FALSE);
-    state->natoms = state->nalloc = conftop->atoms.nr;
+    read_tps_conf(confin, conftop, nullptr, &x, &v, state->box, FALSE);
+    state->natoms = conftop->atoms.nr;
     if (state->natoms != sys->natoms)
     {
         gmx_fatal(FARGS, "number of coordinates in coordinate file (%s, %d)\n"
                   "             does not match topology (%s, %d)",
                   confin, state->natoms, topfile, sys->natoms);
     }
+    /* It would be nice to get rid of the copies below, but we don't know
+     * a priori if the number of atoms in confin matches what we expect.
+     */
+    state->flags |= (1 << estX);
+    if (v != NULL)
+    {
+        state->flags |= (1 << estV);
+    }
+    state_change_natoms(state, state->natoms);
+    for (int i = 0; i < state->natoms; i++)
+    {
+        copy_rvec(x[i], state->x[i]);
+    }
+    sfree(x);
+    if (v != nullptr)
+    {
+        for (int i = 0; i < state->natoms; i++)
+        {
+            copy_rvec(v[i], state->v[i]);
+        }
+        sfree(v);
+    }
     /* This call fixes the box shape for runs with pressure scaling */
     set_box_rel(ir, state);
 
@@ -648,7 +674,7 @@ new_status(const char *topfile, const char *topppfile, const char *confin,
     {
         real                   *mass;
         gmx_mtop_atomloop_all_t aloop;
-        t_atom                 *atom;
+        const t_atom           *atom;
 
         snew(mass, state->natoms);
         aloop = gmx_mtop_atomloop_all_init(sys);
@@ -662,9 +688,10 @@ new_status(const char *topfile, const char *topppfile, const char *confin,
             opts->seed = static_cast<int>(gmx::makeRandomSeed());
             fprintf(stderr, "Setting gen_seed to %d\n", opts->seed);
         }
-        maxwell_speed(opts->tempi, opts->seed, sys, state->v);
+        state->flags |= (1 << estV);
+        maxwell_speed(opts->tempi, opts->seed, sys, as_rvec_array(state->v.data()));
 
-        stop_cm(stdout, state->natoms, mass, state->x, state->v);
+        stop_cm(stdout, state->natoms, mass, as_rvec_array(state->x.data()), as_rvec_array(state->v.data()));
         sfree(mass);
     }
 
@@ -760,7 +787,7 @@ static void cont_status(const char *slog, const char *ener,
             {
                 clear_rvec(state->v[i]);
             }
-            close_trj(fp);
+            close_trx(fp);
             /* Search for a frame without velocities */
             bReadVel = FALSE;
             read_first_frame(oenv, &fp, slog, &fr, TRX_NEED_X);
@@ -783,7 +810,7 @@ static void cont_status(const char *slog, const char *ener,
         copy_state(slog, &fr, bReadVel, state, &use_time);
     }
 
-    close_trj(fp);
+    close_trx(fp);
 
     /* Set the relative box lengths for preserving the box shape.
      * Note that this call can lead to differences in the last bit
@@ -802,7 +829,7 @@ static void cont_status(const char *slog, const char *ener,
 }
 
 static void read_posres(gmx_mtop_t *mtop, t_molinfo *molinfo, gmx_bool bTopB,
-                        char *fn,
+                        const char *fn,
                         int rc_scaling, int ePBC,
                         rvec com,
                         warninp_t wi)
@@ -821,7 +848,7 @@ static void read_posres(gmx_mtop_t *mtop, t_molinfo *molinfo, gmx_bool bTopB,
     t_atom         *atom;
 
     snew(top, 1);
-    read_tps_conf(fn, top, NULL, &x, &v, box, FALSE);
+    read_tps_conf(fn, top, nullptr, &x, &v, box, FALSE);
     natoms = top->atoms.nr;
     done_top(top);
     sfree(top);
@@ -984,7 +1011,7 @@ static void read_posres(gmx_mtop_t *mtop, t_molinfo *molinfo, gmx_bool bTopB,
 }
 
 static void gen_posres(gmx_mtop_t *mtop, t_molinfo *mi,
-                       char *fnA, char *fnB,
+                       const char *fnA, const char *fnB,
                        int rc_scaling, int ePBC,
                        rvec com, rvec comB,
                        warninp_t wi)
@@ -1043,7 +1070,7 @@ static int nrdf_internal(t_atoms *atoms)
     return nrdf;
 }
 
-void
+static void
 spline1d( double        dx,
           double *      y,
           int           n,
@@ -1073,7 +1100,7 @@ spline1d( double        dx,
 }
 
 
-void
+static void
 interpolate1d( double     xmin,
                double     dx,
                double *   ya,
@@ -1095,7 +1122,7 @@ interpolate1d( double     xmin,
 }
 
 
-void
+static void
 setup_cmap (int              grid_spacing,
             int              nc,
             real *           grid,
@@ -1173,7 +1200,7 @@ setup_cmap (int              grid_spacing,
     }
 }
 
-void init_cmap_grid(gmx_cmap_t *cmap_grid, int ngrid, int grid_spacing)
+static void init_cmap_grid(gmx_cmap_t *cmap_grid, int ngrid, int grid_spacing)
 {
     int i, nelem;
 
@@ -1303,7 +1330,7 @@ static real calc_temp(const gmx_mtop_t *mtop,
                       rvec             *v)
 {
     gmx_mtop_atomloop_all_t aloop;
-    t_atom                 *atom;
+    const t_atom           *atom;
     int                     a;
 
     double                  sum_mv2 = 0;
@@ -1359,6 +1386,7 @@ static real get_max_reference_temp(const t_inputrec *ir,
  * Prints a note for each unbound atoms and a warning if any is present.
  */
 static void checkForUnboundAtoms(const gmx_moltype_t *molt,
+                                 gmx_bool             bVerbose,
                                  warninp_t            wi)
 {
     const t_atoms *atoms = &molt->atoms;
@@ -1396,9 +1424,11 @@ static void checkForUnboundAtoms(const gmx_moltype_t *molt,
         if (atoms->atom[a].ptype != eptVSite &&
             count[a] == 0)
         {
-            fprintf(stderr, "\nAtom %d '%s' in moleculetype '%s' is not bound by a potential or constraint to any other atom in the same moleculetype.\n",
-                    a + 1, *atoms->atomname[a], *molt->name);
-
+            if (bVerbose)
+            {
+                fprintf(stderr, "\nAtom %d '%s' in moleculetype '%s' is not bound by a potential or constraint to any other atom in the same moleculetype.\n",
+                        a + 1, *atoms->atomname[a], *molt->name);
+            }
             numDanglingAtoms++;
         }
     }
@@ -1406,7 +1436,7 @@ static void checkForUnboundAtoms(const gmx_moltype_t *molt,
     if (numDanglingAtoms > 0)
     {
         char buf[STRLEN];
-        sprintf(buf, "In moleculetype '%s' %d atoms are not bound by a potential or constraint to any other atom in the same moleculetype. Although technically this might not cause issues in a simulation, this often means that the user forgot to add a bond/potential/constraint or put multiple molecules in the same moleculetype definition by mistake.",
+        sprintf(buf, "In moleculetype '%s' %d atoms are not bound by a potential or constraint to any other atom in the same moleculetype. Although technically this might not cause issues in a simulation, this often means that the user forgot to add a bond/potential/constraint or put multiple molecules in the same moleculetype definition by mistake. Run with -v to get information for each atom.",
                 *molt->name, numDanglingAtoms);
         warning_note(wi, buf);
     }
@@ -1414,11 +1444,12 @@ static void checkForUnboundAtoms(const gmx_moltype_t *molt,
 
 /* Checks all moleculetypes for unbound atoms */
 static void checkForUnboundAtoms(const gmx_mtop_t *mtop,
+                                 gmx_bool          bVerbose,
                                  warninp_t         wi)
 {
     for (int mt = 0; mt < mtop->nmoltype; mt++)
     {
-        checkForUnboundAtoms(&mtop->moltype[mt], wi);
+        checkForUnboundAtoms(&mtop->moltype[mt], bVerbose, wi);
     }
 }
 
@@ -1606,13 +1637,13 @@ static void set_verlet_buffer(const gmx_mtop_t *mtop,
     /* Calculate the buffer size for simple atom vs atoms list */
     ls.cluster_size_i = 1;
     ls.cluster_size_j = 1;
-    calc_verlet_buffer_size(mtop, det(box), ir, buffer_temp,
-                            &ls, &n_nonlin_vsite, &rlist_1x1);
+    calc_verlet_buffer_size(mtop, det(box), ir, ir->nstlist, ir->nstlist - 1,
+                            buffer_temp, &ls, &n_nonlin_vsite, &rlist_1x1);
 
     /* Set the pair-list buffer size in ir */
     verletbuf_get_list_setup(FALSE, FALSE, &ls);
-    calc_verlet_buffer_size(mtop, det(box), ir, buffer_temp,
-                            &ls, &n_nonlin_vsite, &ir->rlist);
+    calc_verlet_buffer_size(mtop, det(box), ir, ir->nstlist, ir->nstlist - 1,
+                            buffer_temp, &ls, &n_nonlin_vsite, &ir->rlist);
 
     if (n_nonlin_vsite > 0)
     {
@@ -1637,7 +1668,7 @@ static void set_verlet_buffer(const gmx_mtop_t *mtop,
 
 int gmx_grompp(int argc, char *argv[])
 {
-    static const char *desc[] = {
+    const char        *desc[] = {
         "[THISMODULE] (the gromacs preprocessor)",
         "reads a molecular topology file, checks the validity of the",
         "file, expands the topology from a molecular description to an atomic",
@@ -1684,12 +1715,11 @@ int gmx_grompp(int argc, char *argv[])
         "Specifying the [TT]-pp[tt] flag will get the pre-processed",
         "topology file written out so that you can verify its contents.[PAR]",
 
-        "When using position restraints a file with restraint coordinates",
-        "can be supplied with [TT]-r[tt], otherwise restraining will be done",
-        "with respect to the conformation from the [TT]-c[tt] option.",
-        "For free energy calculation the the coordinates for the B topology",
-        "can be supplied with [TT]-rb[tt], otherwise they will be equal to",
-        "those of the A topology.[PAR]",
+        "When using position restraints, a file with restraint coordinates",
+        "must be supplied with [TT]-r[tt] (can be the same file as supplied",
+        "for [TT]-c[tt]). For free energy calculations, separate reference",
+        "coordinates for the B topology can be supplied with [TT]-rb[tt],",
+        "otherwise they will be equal to those of the A topology.[PAR]",
 
         "Starting coordinates can be read from trajectory with [TT]-t[tt].",
         "The last frame with coordinates and velocities will be read,",
@@ -1741,14 +1771,11 @@ int gmx_grompp(int argc, char *argv[])
     int                nmi;
     t_molinfo         *mi, *intermolecular_interactions;
     gpp_atomtype_t     atype;
-    t_inputrec        *ir;
     int                nvsite, comb, mt;
     t_params          *plist;
-    t_state           *state;
     matrix             box;
     real               fudgeQQ;
     double             reppow;
-    char               fn[STRLEN], fnB[STRLEN];
     const char        *mdparin;
     int                ntype;
     gmx_bool           bNeedVel, bGenVel;
@@ -1759,17 +1786,17 @@ int gmx_grompp(int argc, char *argv[])
     char               warn_buf[STRLEN];
 
     t_filenm           fnm[] = {
-        { efMDP, NULL,  NULL,        ffREAD  },
+        { efMDP, nullptr,  nullptr,        ffREAD  },
         { efMDP, "-po", "mdout",     ffWRITE },
-        { efSTX, "-c",  NULL,        ffREAD  },
-        { efSTX, "-r",  NULL,        ffOPTRD },
-        { efSTX, "-rb", NULL,        ffOPTRD },
-        { efNDX, NULL,  NULL,        ffOPTRD },
-        { efTOP, NULL,  NULL,        ffREAD  },
+        { efSTX, "-c",  nullptr,        ffREAD  },
+        { efSTX, "-r",  "restraint", ffOPTRD },
+        { efSTX, "-rb", "restraint", ffOPTRD },
+        { efNDX, nullptr,  nullptr,        ffOPTRD },
+        { efTOP, nullptr,  nullptr,        ffREAD  },
         { efTOP, "-pp", "processed", ffOPTWR },
-        { efTPR, "-o",  NULL,        ffWRITE },
-        { efTRN, "-t",  NULL,        ffOPTRD },
-        { efEDR, "-e",  NULL,        ffOPTRD },
+        { efTPR, "-o",  nullptr,        ffWRITE },
+        { efTRN, "-t",  nullptr,        ffOPTRD },
+        { efEDR, "-e",  nullptr,        ffOPTRD },
         /* This group is needed by the VMD viewer as the start configuration for IMD sessions: */
         { efGRO, "-imd", "imdgroup", ffOPTWR },
         { efTRN, "-ref", "rotref",   ffOPTRW }
@@ -1777,10 +1804,10 @@ int gmx_grompp(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     /* Command line options */
-    static gmx_bool bRenum   = TRUE;
-    static gmx_bool bRmVSBds = TRUE, bZero = FALSE;
-    static int      i, maxwarn = 0;
-    static real     fr_time = -1;
+    gmx_bool        bRenum   = TRUE;
+    gmx_bool        bRmVSBds = TRUE, bZero = FALSE;
+    int             i, maxwarn = 0;
+    real            fr_time = -1;
     t_pargs         pa[]    = {
         { "-v",       FALSE, etBOOL, {&bVerbose},
           "Be loud and noisy" },
@@ -1796,24 +1823,31 @@ int gmx_grompp(int argc, char *argv[])
           "Renumber atomtypes and minimize number of atomtypes" }
     };
 
-    /* Initiate some variables */
-    snew(ir, 1);
-    snew(opts, 1);
-    init_ir(ir, opts);
-
     /* Parse the command line */
     if (!parse_common_args(&argc, argv, 0, NFILE, fnm, asize(pa), pa,
-                           asize(desc), desc, 0, NULL, &oenv))
+                           asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
 
+    /* Initiate some variables */
+    gmx::MDModules mdModules;
+    t_inputrec     irInstance;
+    t_inputrec    *ir = &irInstance;
+    snew(opts, 1);
+    snew(opts->include, STRLEN);
+    snew(opts->define, STRLEN);
+
     wi = init_warning(TRUE, maxwarn);
 
     /* PARAMETER file processing */
     mdparin = opt2fn("-f", NFILE, fnm);
     set_warning_line(wi, mdparin, -1);
-    get_ir(mdparin, opt2fn("-po", NFILE, fnm), ir, opts, wi);
+    try
+    {
+        get_ir(mdparin, opt2fn("-po", NFILE, fnm), &mdModules, ir, opts, WriteMdpHeader::yes, wi);
+    }
+    GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
 
     if (bVerbose)
     {
@@ -1853,14 +1887,15 @@ int gmx_grompp(int argc, char *argv[])
         pr_symtab(debug, 0, "Just opened", &sys->symtab);
     }
 
-    strcpy(fn, ftp2fn(efTOP, NFILE, fnm));
+    const char *fn = ftp2fn(efTOP, NFILE, fnm);
     if (!gmx_fexist(fn))
     {
         gmx_fatal(FARGS, "%s does not exist", fn);
     }
-    snew(state, 1);
+
+    t_state state;
     new_status(fn, opt2fn_null("-pp", NFILE, fnm), opt2fn("-c", NFILE, fnm),
-               opts, ir, bZero, bGenVel, bVerbose, state,
+               opts, ir, bZero, bGenVel, bVerbose, &state,
                atype, sys, &nmi, &mi, &intermolecular_interactions,
                plist, &comb, &reppow, &fudgeQQ,
                opts->bMorse,
@@ -1941,25 +1976,21 @@ int gmx_grompp(int argc, char *argv[])
      */
     check_warning_error(wi, FARGS);
 
-    if (opt2bSet("-r", NFILE, fnm))
-    {
-        sprintf(fn, "%s", opt2fn("-r", NFILE, fnm));
-    }
-    else
-    {
-        sprintf(fn, "%s", opt2fn("-c", NFILE, fnm));
-    }
-    if (opt2bSet("-rb", NFILE, fnm))
-    {
-        sprintf(fnB, "%s", opt2fn("-rb", NFILE, fnm));
-    }
-    else
+    if (nint_ftype(sys, mi, F_POSRES) > 0 ||
+        nint_ftype(sys, mi, F_FBPOSRES) > 0)
     {
-        strcpy(fnB, fn);
-    }
+        const char *fn = opt2fn("-r", NFILE, fnm);
+        const char *fnB;
+
+        if (opt2bSet("-rb", NFILE, fnm))
+        {
+            fnB = opt2fn("-rb", NFILE, fnm);
+        }
+        else
+        {
+            fnB = fn;
+        }
 
-    if (nint_ftype(sys, mi, F_POSRES) > 0 || nint_ftype(sys, mi, F_FBPOSRES) > 0)
-    {
         if (bVerbose)
         {
             fprintf(stderr, "Reading position restraint coords from %s", fn);
@@ -2037,7 +2068,7 @@ int gmx_grompp(int argc, char *argv[])
     /* Check velocity for virtual sites and shells */
     if (bGenVel)
     {
-        check_vel(sys, state->v);
+        check_vel(sys, as_rvec_array(state.v.data()));
     }
 
     /* check for shells and inpurecs */
@@ -2046,7 +2077,7 @@ int gmx_grompp(int argc, char *argv[])
     /* check masses */
     check_mol(sys, wi);
 
-    checkForUnboundAtoms(sys, wi);
+    checkForUnboundAtoms(sys, bVerbose, wi);
 
     for (i = 0; i < sys->nmoltype; i++)
     {
@@ -2089,7 +2120,7 @@ int gmx_grompp(int argc, char *argv[])
                 }
                 else
                 {
-                    buffer_temp = calc_temp(sys, ir, state->v);
+                    buffer_temp = calc_temp(sys, ir, as_rvec_array(state.v.data()));
                 }
                 if (buffer_temp > 0)
                 {
@@ -2144,13 +2175,13 @@ int gmx_grompp(int argc, char *argv[])
                     }
                 }
 
-                set_verlet_buffer(sys, ir, buffer_temp, state->box, wi);
+                set_verlet_buffer(sys, ir, buffer_temp, state.box, wi);
             }
         }
     }
 
     /* Init the temperature coupling state */
-    init_gtc_state(state, ir->opts.ngtc, 0, ir->opts.nhchainlength); /* need to add nnhpres here? */
+    init_gtc_state(&state, ir->opts.ngtc, 0, ir->opts.nhchainlength); /* need to add nnhpres here? */
 
     if (bVerbose)
     {
@@ -2190,24 +2221,24 @@ int gmx_grompp(int argc, char *argv[])
             fprintf(stderr, "getting data from old trajectory ...\n");
         }
         cont_status(ftp2fn(efTRN, NFILE, fnm), ftp2fn_null(efEDR, NFILE, fnm),
-                    bNeedVel, bGenVel, fr_time, ir, state, sys, oenv);
+                    bNeedVel, bGenVel, fr_time, ir, &state, sys, oenv);
     }
 
     if (ir->ePBC == epbcXY && ir->nwall != 2)
     {
-        clear_rvec(state->box[ZZ]);
+        clear_rvec(state.box[ZZ]);
     }
 
     if (ir->cutoff_scheme != ecutsVERLET && ir->rlist > 0)
     {
         set_warning_line(wi, mdparin, -1);
-        check_chargegroup_radii(sys, ir, state->x, wi);
+        check_chargegroup_radii(sys, ir, as_rvec_array(state.x.data()), wi);
     }
 
     if (EEL_FULL(ir->coulombtype) || EVDW_PME(ir->vdwtype))
     {
         /* Calculate the optimal grid dimensions */
-        copy_mat(state->box, box);
+        copy_mat(state.box, box);
         if (ir->ePBC == epbcXY && ir->nwall == 2)
         {
             svmul(ir->wall_ewald_zfac, box[ZZ], box[ZZ]);
@@ -2222,8 +2253,15 @@ int gmx_grompp(int argc, char *argv[])
             set_warning_line(wi, mdparin, -1);
             warning_error(wi, "Some of the Fourier grid sizes are set, but all of them need to be set.");
         }
-        calc_grid(stdout, box, ir->fourier_spacing,
-                  &(ir->nkx), &(ir->nky), &(ir->nkz));
+        const int minGridSize = minimalPmeGridSize(ir->pme_order);
+        calcFftGrid(stdout, box, ir->fourier_spacing, minGridSize,
+                    &(ir->nkx), &(ir->nky), &(ir->nkz));
+        if (ir->nkx < minGridSize ||
+            ir->nky < minGridSize ||
+            ir->nkz < minGridSize)
+        {
+            warning_error(wi, "The PME grid size should be >= 2*(pme-order - 1); either manually increase the grid size or decrease pme-order");
+        }
     }
 
     /* MRS: eventually figure out better logic for initializing the fep
@@ -2231,33 +2269,33 @@ int gmx_grompp(int argc, char *argv[])
        potentially conflict if not handled correctly. */
     if (ir->efep != efepNO)
     {
-        state->fep_state = ir->fepvals->init_fep_state;
+        state.fep_state = ir->fepvals->init_fep_state;
         for (i = 0; i < efptNR; i++)
         {
             /* init_lambda trumps state definitions*/
             if (ir->fepvals->init_lambda >= 0)
             {
-                state->lambda[i] = ir->fepvals->init_lambda;
+                state.lambda[i] = ir->fepvals->init_lambda;
             }
             else
             {
-                if (ir->fepvals->all_lambda[i] == NULL)
+                if (ir->fepvals->all_lambda[i] == nullptr)
                 {
                     gmx_fatal(FARGS, "Values of lambda not set for a free energy calculation!");
                 }
                 else
                 {
-                    state->lambda[i] = ir->fepvals->all_lambda[i][state->fep_state];
+                    state.lambda[i] = ir->fepvals->all_lambda[i][state.fep_state];
                 }
             }
         }
     }
 
-    struct pull_t *pull = NULL;
+    struct pull_t *pull = nullptr;
 
     if (ir->bPull)
     {
-        pull = set_pull_init(ir, sys, state->x, state->box, state->lambda[efptMASS], oenv);
+        pull = set_pull_init(ir, sys, as_rvec_array(state.x.data()), state.box, state.lambda[efptMASS], oenv);
     }
 
     /* Modules that supply external potential for pull coordinates
@@ -2272,7 +2310,7 @@ int gmx_grompp(int argc, char *argv[])
 
     if (ir->bRot)
     {
-        set_reference_positions(ir->rot, state->x, state->box,
+        set_reference_positions(ir->rot, as_rvec_array(state.x.data()), state.box,
                                 opt2fn("-ref", NFILE, fnm), opt2bSet("-ref", NFILE, fnm),
                                 wi);
     }
@@ -2281,7 +2319,7 @@ int gmx_grompp(int argc, char *argv[])
 
     if (EEL_PME(ir->coulombtype))
     {
-        float ratio = pme_load_estimate(sys, ir, state->box);
+        float ratio = pme_load_estimate(sys, ir, state.box);
         fprintf(stderr, "Estimate for the relative computational load of the PME mesh part: %.2f\n", ratio);
         /* With free energy we might need to do PME both for the A and B state
          * charges. This will double the cost, but the optimal performance will
@@ -2323,15 +2361,13 @@ int gmx_grompp(int argc, char *argv[])
     }
 
     done_warning(wi, FARGS);
-    write_tpx_state(ftp2fn(efTPR, NFILE, fnm), ir, state, sys);
+    write_tpx_state(ftp2fn(efTPR, NFILE, fnm), ir, &state, sys);
 
     /* Output IMD group, if bIMD is TRUE */
-    write_IMDgroup_to_file(ir->bIMD, ir, state, sys, NFILE, fnm);
+    write_IMDgroup_to_file(ir->bIMD, ir, &state, sys, NFILE, fnm);
 
-    done_state(state);
-    sfree(state);
     done_atomtype(atype);
-    done_mtop(sys, TRUE);
+    done_mtop(sys);
     done_inputrec_strings();
 
     return 0;
index 61cb60f705c6dc55c160ba784872572e9c4655db..1c90db36ecd76e7bff17dc928d3463229581d628 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,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.
@@ -63,10 +63,10 @@ const int ncontrol[] = { -1, 3, 3, 3, 3, 4, 3, 1, 3, 3, 1, 1 };
 
 int compaddh(const void *a, const void *b)
 {
-    t_hackblock *ah, *bh;
+    const t_hackblock *ah, *bh;
 
-    ah = (t_hackblock *)a;
-    bh = (t_hackblock *)b;
+    ah = static_cast<const t_hackblock *>(a);
+    bh = static_cast<const t_hackblock *>(b);
     return gmx_strcasecmp(ah->name, bh->name);
 }
 
@@ -105,7 +105,7 @@ void read_ab(char *line, const char *fn, t_hack *hack)
     hack->nctl = ns - 3;
     if ((hack->nctl != ncontrol[hack->tp]) && (ncontrol[hack->tp] != -1))
     {
-        gmx_fatal(FARGS, "Error in hdb file %s:\nWrong number of control atoms (%d iso %d) on line:\n%s\n", fn, hack->nctl, ncontrol[hack->tp], line);
+        gmx_fatal(FARGS, "Error in hdb file %s:\nWrong number of control atoms (%d instead of %d) on line:\n%s\n", fn, hack->nctl, ncontrol[hack->tp], line);
     }
     for (i = 0; (i < hack->nctl); i++)
     {
@@ -113,11 +113,11 @@ void read_ab(char *line, const char *fn, t_hack *hack)
     }
     for (; i < 4; i++)
     {
-        hack->a[i] = NULL;
+        hack->a[i] = nullptr;
     }
-    hack->oname = NULL;
+    hack->oname = nullptr;
     hack->nname = gmx_strdup(hn);
-    hack->atom  = NULL;
+    hack->atom  = nullptr;
     hack->cgnr  = NOTSET;
     hack->bXSet = FALSE;
     for (i = 0; i < DIM; i++)
@@ -181,7 +181,7 @@ static void read_h_db_file(const char *hfn, int *nahptr, t_hackblock **ah)
                               "while reading Hydrogen Database %s residue %s",
                               nab, i-1, aah[nah].name, hfn);
                 }
-                if (NULL == fgets(buf, STRLEN, in))
+                if (nullptr == fgets(buf, STRLEN, in))
                 {
                     gmx_fatal(FARGS, "Error reading from file %s", hfn);
                 }
@@ -218,7 +218,7 @@ int read_h_db(const char *ffdir, t_hackblock **ah)
      */
     nhdbf = fflib_search_file_end(ffdir, ".hdb", FALSE, &hdbf);
     nah   = 0;
-    *ah   = NULL;
+    *ah   = nullptr;
     for (f = 0; f < nhdbf; f++)
     {
         read_h_db_file(hdbf[f], &nah, ah);
@@ -235,12 +235,12 @@ t_hackblock *search_h_db(int nh, t_hackblock ah[], char *key)
 
     if (nh <= 0)
     {
-        return NULL;
+        return nullptr;
     }
 
     ahkey.name = key;
 
-    result = (t_hackblock *)bsearch(&ahkey, ah, nh, (size_t)sizeof(ah[0]), compaddh);
+    result = static_cast<t_hackblock *>(bsearch(&ahkey, ah, nh, (size_t)sizeof(ah[0]), compaddh));
 
     return result;
 }
index 6e8026e922630e83641ecfa8e5dc8f65d4528847..cf81e0e10cbe4922bc27b22102cc2a073e998aef 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,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.
@@ -72,7 +72,7 @@ static void free_t_bondeds(t_rbondeds *rbs)
         free_t_bonded(&rbs->b[i]);
     }
     sfree(rbs->b);
-    rbs->b  = NULL;
+    rbs->b  = nullptr;
     rbs->nb = 0;
 }
 
@@ -114,7 +114,7 @@ void free_t_hack(int nh, t_hack **h)
         }
     }
     sfree(*h);
-    *h = NULL;
+    *h = nullptr;
 }
 
 void free_t_hackblock(int nhb, t_hackblock **hb)
@@ -137,14 +137,14 @@ void clear_t_hackblock(t_hackblock *hb)
 {
     int i;
 
-    hb->name    = NULL;
+    hb->name    = nullptr;
     hb->nhack   = 0;
     hb->maxhack = 0;
-    hb->hack    = NULL;
+    hb->hack    = nullptr;
     for (i = 0; i < ebtsNR; i++)
     {
         hb->rb[i].nb = 0;
-        hb->rb[i].b  = NULL;
+        hb->rb[i].b  = nullptr;
     }
 }
 
@@ -153,15 +153,15 @@ void clear_t_hack(t_hack *hack)
     int i;
 
     hack->nr    = 0;
-    hack->oname = NULL;
-    hack->nname = NULL;
-    hack->atom  = NULL;
+    hack->oname = nullptr;
+    hack->nname = nullptr;
+    hack->atom  = nullptr;
     hack->cgnr  = NOTSET;
     hack->tp    = 0;
     hack->nctl  = 0;
     for (i = 0; i < 4; i++)
     {
-        hack->a[i]  = NULL;
+        hack->a[i]  = nullptr;
     }
     for (i = 0; i < DIM; i++)
     {
@@ -200,7 +200,7 @@ static gmx_bool contains_char(t_rbonded *s, char c)
     return bRet;
 }
 
-int
+static int
 rbonded_find_atoms_in_list(t_rbonded *b, t_rbonded blist[], int nlist, int natoms)
 {
     int      i, k;
@@ -346,7 +346,7 @@ void copy_t_restp(t_restp *s, t_restp *d)
     {
         d->rb[i].type = s->rb[i].type;
         d->rb[i].nb   = 0;
-        d->rb[i].b    = NULL;
+        d->rb[i].b    = nullptr;
     }
     merge_t_bondeds(s->rb, d->rb, FALSE, FALSE);
 }
@@ -365,7 +365,7 @@ void copy_t_hack(t_hack *s, t_hack *d)
     }
     else
     {
-        d->atom = NULL;
+        d->atom = nullptr;
     }
     for (i = 0; i < 4; i++)
     {
@@ -407,11 +407,11 @@ void copy_t_hackblock(t_hackblock *s, t_hackblock *d)
     *d       = *s;
     d->name  = safe_strdup(s->name);
     d->nhack = 0;
-    d->hack  = NULL;
+    d->hack  = nullptr;
     for (i = 0; i < ebtsNR; i++)
     {
         d->rb[i].nb = 0;
-        d->rb[i].b  = NULL;
+        d->rb[i].b  = nullptr;
     }
     merge_t_hackblock(s, d);
 }
index a6800c5221e48366e2cd250b0dcf62cb73b7d20d..5dfbe4947beb5d61a45a85927ac0b3bd7e0fcf83 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,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.
@@ -37,6 +37,8 @@
 /* This file is completely threadsafe - keep it that way! */
 #include "gmxpre.h"
 
+#include "hizzie.h"
+
 #include <stdio.h>
 #include <string.h>
 
index 5bdcb8801c037e0941aedfac80383602b07da8d4..7de66843a9ac398fc317c642a1d07f86b7ec160d 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,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.
@@ -38,6 +38,9 @@
 #ifndef GMX_GMXPREPROCESS_HIZZIE_H
 #define GMX_GMXPREPROCESS_HIZZIE_H
 
+#include "gromacs/math/vectypes.h"
+#include "gromacs/topology/atoms.h"
+
 void set_histp(t_atoms *pdba, rvec *x, real angle, real distance);
 /* calculate HIStidine protonation state */
 
index 019327750f78017892159246d42ca6004eca5a41..90de8972be21c5cd5dab93f8532e2682ec5b8ac8 100644 (file)
@@ -67,6 +67,7 @@
 #include "gromacs/topology/atomprop.h"
 #include "gromacs/topology/atoms.h"
 #include "gromacs/topology/atomsbuilder.h"
+#include "gromacs/topology/mtop_util.h"
 #include "gromacs/topology/topology.h"
 #include "gromacs/trajectory/trajectoryframe.h"
 #include "gromacs/utility/cstringutil.h"
@@ -124,7 +125,7 @@ static void generate_trial_conf(const std::vector<RVec> &xin,
     }
     if (enum_rot == en_rotXYZ || enum_rot == en_rotZ)
     {
-        rotate_conf(xout->size(), as_rvec_array(xout->data()), NULL, alfa, beta, gamma);
+        rotate_conf(xout->size(), as_rvec_array(xout->data()), nullptr, alfa, beta, gamma);
     }
     for (size_t i = 0; i < xout->size(); ++i)
     {
@@ -163,7 +164,7 @@ static bool isInsertionAllowed(gmx::AnalysisNeighborhoodSearch *search,
 
 static void insert_mols(int nmol_insrt, int ntry, int seed,
                         real defaultDistance, real scaleFactor,
-                        t_topology *top, std::vector<RVec> *x,
+                        t_atoms *atoms, t_symtab *symtab, std::vector<RVec> *x,
                         const std::set<int> &removableAtoms,
                         const t_atoms &atoms_insrt, const std::vector<RVec> &x_insrt,
                         int ePBC, matrix box,
@@ -173,7 +174,7 @@ static void insert_mols(int nmol_insrt, int ntry, int seed,
     fprintf(stderr, "Initialising inter-atomic distances...\n");
     gmx_atomprop_t          aps = gmx_atomprop_init();
     std::vector<real>       exclusionDistances(
-            makeExclusionDistances(&top->atoms, aps, defaultDistance, scaleFactor));
+            makeExclusionDistances(atoms, aps, defaultDistance, scaleFactor));
     const std::vector<real> exclusionDistances_insrt(
             makeExclusionDistances(&atoms_insrt, aps, defaultDistance, scaleFactor));
     gmx_atomprop_destroy(aps);
@@ -207,7 +208,7 @@ static void insert_mols(int nmol_insrt, int ntry, int seed,
     set_pbc(&pbc, ePBC, box);
 
     /* With -ip, take nmol_insrt from file posfn */
-    double     **rpos              = NULL;
+    double     **rpos              = nullptr;
     const bool   insertAtPositions = !posfn.empty();
     if (insertAtPositions)
     {
@@ -222,11 +223,11 @@ static void insert_mols(int nmol_insrt, int ntry, int seed,
                 nmol_insrt, posfn.c_str());
     }
 
-    gmx::AtomsBuilder builder(&top->atoms, &top->symtab);
-    gmx::AtomsRemover remover(top->atoms);
+    gmx::AtomsBuilder builder(atoms, symtab);
+    gmx::AtomsRemover remover(*atoms);
     {
-        const int finalAtomCount    = top->atoms.nr + nmol_insrt * atoms_insrt.nr;
-        const int finalResidueCount = top->atoms.nres + nmol_insrt * atoms_insrt.nres;
+        const int finalAtomCount    = atoms->nr + nmol_insrt * atoms_insrt.nr;
+        const int finalResidueCount = atoms->nres + nmol_insrt * atoms_insrt.nres;
         builder.reserve(finalAtomCount, finalResidueCount);
         x->reserve(finalAtomCount);
         exclusionDistances.reserve(finalAtomCount);
@@ -276,7 +277,7 @@ static void insert_mols(int nmol_insrt, int ntry, int seed,
         gmx::AnalysisNeighborhoodPositions pos(*x);
         gmx::AnalysisNeighborhoodSearch    search = nb.initSearch(&pbc, pos);
         if (isInsertionAllowed(&search, exclusionDistances, x_n, exclusionDistances_insrt,
-                               top->atoms, removableAtoms, &remover))
+                               *atoms, removableAtoms, &remover))
         {
             x->insert(x->end(), x_n.begin(), x_n.end());
             exclusionDistances.insert(exclusionDistances.end(),
@@ -294,19 +295,19 @@ static void insert_mols(int nmol_insrt, int ntry, int seed,
     fprintf(stderr, "Added %d molecules (out of %d requested)\n",
             mol - failed, nmol_insrt);
 
-    const int originalAtomCount    = top->atoms.nr;
-    const int originalResidueCount = top->atoms.nres;
-    remover.refreshAtomCount(top->atoms);
+    const int originalAtomCount    = atoms->nr;
+    const int originalResidueCount = atoms->nres;
+    remover.refreshAtomCount(*atoms);
     remover.removeMarkedElements(x);
-    remover.removeMarkedAtoms(&top->atoms);
-    if (top->atoms.nr < originalAtomCount)
+    remover.removeMarkedAtoms(atoms);
+    if (atoms->nr < originalAtomCount)
     {
         fprintf(stderr, "Replaced %d residues (%d atoms)\n",
-                originalResidueCount - top->atoms.nres,
-                originalAtomCount - top->atoms.nr);
+                originalResidueCount - atoms->nres,
+                originalAtomCount - atoms->nr);
     }
 
-    if (rpos != NULL)
+    if (rpos != nullptr)
     {
         for (int i = 0; i < DIM; ++i)
         {
@@ -328,7 +329,7 @@ class InsertMolecules : public ICommandLineOptionsModule, public ITopologyProvid
         InsertMolecules()
             : bBox_(false), nmolIns_(0), nmolTry_(10), seed_(0),
               defaultDistance_(0.105), scaleFactor_(0.57), enumRot_(en_rotXYZ),
-              top_(NULL), ePBC_(-1)
+              top_(nullptr), ePBC_(-1)
         {
             clear_rvec(newBox_);
             clear_rvec(deltaR_);
@@ -336,15 +337,15 @@ class InsertMolecules : public ICommandLineOptionsModule, public ITopologyProvid
         }
         virtual ~InsertMolecules()
         {
-            if (top_ != NULL)
+            if (top_ != nullptr)
             {
-                done_top(top_);
+                done_mtop(top_);
                 sfree(top_);
             }
         }
 
         // From ITopologyProvider
-        virtual t_topology *getTopology(bool /*required*/) { return top_; }
+        virtual gmx_mtop_t *getTopology(bool /*required*/) { return top_; }
         virtual int getAtomCount() { return 0; }
 
         // From ICommandLineOptionsModule
@@ -376,7 +377,7 @@ class InsertMolecules : public ICommandLineOptionsModule, public ITopologyProvid
         RotationType        enumRot_;
         Selection           replaceSel_;
 
-        t_topology         *top_;
+        gmx_mtop_t         *top_;
         std::vector<RVec>   x_;
         matrix              box_;
         int                 ePBC_;
@@ -510,9 +511,9 @@ void InsertMolecules::optionsFinished()
     snew(top_, 1);
     if (!inputConfFile_.empty())
     {
-        readConformation(inputConfFile_.c_str(), top_, &x_, NULL,
+        readConformation(inputConfFile_.c_str(), top_, &x_, nullptr,
                          &ePBC_, box_, "solute");
-        if (top_->atoms.nr == 0)
+        if (top_->natoms == 0)
         {
             fprintf(stderr, "Note: no atoms in %s\n", inputConfFile_.c_str());
         }
@@ -561,13 +562,13 @@ int InsertMolecules::run()
         int         ePBC_dummy;
         matrix      box_dummy;
         readConformation(insertConfFile_.c_str(), top_insrt, &x_insrt,
-                         NULL, &ePBC_dummy, box_dummy, "molecule");
+                         nullptr, &ePBC_dummy, box_dummy, "molecule");
         if (top_insrt->atoms.nr == 0)
         {
             gmx_fatal(FARGS, "No molecule in %s, please check your input",
                       insertConfFile_.c_str());
         }
-        if (top_->name == NULL)
+        if (top_->name == nullptr)
         {
             top_->name = top_insrt->name;
         }
@@ -577,22 +578,26 @@ int InsertMolecules::run()
         }
     }
 
+    // TODO: Adapt to use mtop throughout.
+    t_atoms atoms = gmx_mtop_global_atoms(top_);
+
     /* add nmol_ins molecules of atoms_ins
        in random orientation at random place */
     insert_mols(nmolIns_, nmolTry_, seed_, defaultDistance_, scaleFactor_,
-                top_, &x_, removableAtoms, top_insrt->atoms, x_insrt,
+                &atoms, &top_->symtab, &x_, removableAtoms, top_insrt->atoms, x_insrt,
                 ePBC_, box_, positionFile_, deltaR_, enumRot_);
 
     /* write new configuration to file confout */
     fprintf(stderr, "Writing generated configuration to %s\n",
             outputConfFile_.c_str());
-    write_sto_conf(outputConfFile_.c_str(), *top_->name, &top_->atoms,
-                   as_rvec_array(x_.data()), NULL, ePBC_, box_);
+    write_sto_conf(outputConfFile_.c_str(), *top_->name, &atoms,
+                   as_rvec_array(x_.data()), nullptr, ePBC_, box_);
 
     /* print size of generated configuration */
     fprintf(stderr, "\nOutput configuration contains %d atoms in %d residues\n",
-            top_->atoms.nr, top_->atoms.nres);
+            atoms.nr, atoms.nres);
 
+    done_atom(&atoms);
     done_top(top_insrt);
     sfree(top_insrt);
 
diff --git a/src/gromacs/gmxpreprocess/keyvaluetreemdpwriter.cpp b/src/gromacs/gmxpreprocess/keyvaluetreemdpwriter.cpp
new file mode 100644 (file)
index 0000000..5285d3c
--- /dev/null
@@ -0,0 +1,110 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Defines a function to write a flat key-value tree to look like
+ * old-style mdp output.
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ * \ingroup module_gmxpreprocess
+ */
+#include "gmxpre.h"
+
+#include "keyvaluetreemdpwriter.h"
+
+#include <string>
+
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/keyvaluetree.h"
+#include "gromacs/utility/strconvert.h"
+#include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/textwriter.h"
+
+namespace gmx
+{
+
+void writeKeyValueTreeAsMdp(TextWriter               *writer,
+                            const KeyValueTreeObject &tree)
+{
+    for (const auto &prop : tree.properties())
+    {
+        const auto &value = prop.value();
+        GMX_RELEASE_ASSERT(!value.isObject(), "Only flat key-value trees can be written as mdp");
+
+        // Recognize a special key prefix that identifies comment
+        // lines. This mechanism is not pretty, but our plan is to
+        // write key-value trees, rather than old-style mdp, and
+        // comments will need different handling then.
+        if (prop.key().compare(0, 7, "comment") == 0)
+        {
+            GMX_RELEASE_ASSERT(prop.value().isType<std::string>(), "Comments must have string-typed values");
+            auto comment = prop.value().cast<std::string>();
+            // TODO Consider implementing an MdpTextWriter that can
+            // format an array of strings suitably, e.g. by prefixing
+            // each line like "; %s". We'd need to implement arrays of
+            // objects, such a comment key to be able to refer to an
+            // array of strings. Also, we'd want to have a plan to
+            // write such comments in whatever replaces the mdp
+            // format.
+            writer->writeLine(comment);
+        }
+        else
+        {
+            writer->writeString(formatString("%-24s = ", prop.key().c_str()));
+            if (value.isArray())
+            {
+                bool first = true;
+                for (const auto &elem : value.asArray().values())
+                {
+                    GMX_RELEASE_ASSERT(!elem.isObject() && !elem.isArray(),
+                                       "Arrays of objects not currently implemented");
+                    if (!first)
+                    {
+                        writer->writeString(" ");
+                    }
+                    writer->writeString(simpleValueToString(elem));
+                    first = false;
+                }
+            }
+            else
+            {
+                writer->writeString(simpleValueToString(value));
+            }
+            writer->writeLine();
+        }
+    }
+}
+
+} // namespace gmx
diff --git a/src/gromacs/gmxpreprocess/keyvaluetreemdpwriter.h b/src/gromacs/gmxpreprocess/keyvaluetreemdpwriter.h
new file mode 100644 (file)
index 0000000..745e8db
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares a function to write a flat key-value tree to look like
+ * old-style mdp output.
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_gmxpreprocess
+ */
+#ifndef GMX_GMXPREPROCESS_KEYVALUETREEMDPWRITER_H
+#define GMX_GMXPREPROCESS_KEYVALUETREEMDPWRITER_H
+
+namespace gmx
+{
+
+class KeyValueTreeObject;
+class TextWriter;
+
+/*! \brief Write a flat key-value \c tree to \c writer in mdp style.
+ *
+ * Sub-objects will output nothing, so they can be used to
+ * contain a special key-value pair to create a comment, as
+ * well as the normal key and value. The comment pair will
+ * have a key of "comment", and the value will be used as a
+ * comment (if non-empty). */
+void writeKeyValueTreeAsMdp(TextWriter               *writer,
+                            const KeyValueTreeObject &tree);
+
+} // namespace gmx
+
+#endif
index 9359354cfa0c89b22887c0e1693cc2d3e9fc1a42..25f770f7f068bcc1f4ef6c0e46f618e0efedc982 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
@@ -44,7 +44,6 @@
 #include <algorithm>
 
 #include "gromacs/fileio/confio.h"
-#include "gromacs/fileio/readinp.h"
 #include "gromacs/gmxpreprocess/fflibutil.h"
 #include "gromacs/gmxpreprocess/gpp_atomtype.h"
 #include "gromacs/gmxpreprocess/gpp_nextnb.h"
@@ -68,10 +67,10 @@ static void rd_nm2type_file(const char *fn, int *nnm, t_nm2type **nmp)
     char          buf[1024], elem[16], type[16], nbbuf[16], **newbuf;
     int           i, nb, nnnm, line = 1;
     double        qq, mm;
-    t_nm2type    *nm2t = NULL;
+    t_nm2type    *nm2t = nullptr;
 
     fp = fflib_open(fn);
-    if (NULL == fp)
+    if (nullptr == fp)
     {
         gmx_fatal(FARGS, "Can not find %s in library directory", fn);
     }
@@ -81,7 +80,7 @@ static void rd_nm2type_file(const char *fn, int *nnm, t_nm2type **nmp)
     do
     {
         /* Read a line from the file */
-        bCont = (fgets2(buf, 1023, fp) != NULL);
+        bCont = (fgets2(buf, 1023, fp) != nullptr);
 
         if (bCont)
         {
@@ -111,7 +110,7 @@ static void rd_nm2type_file(const char *fn, int *nnm, t_nm2type **nmp)
                 }
                 else
                 {
-                    newbuf = NULL;
+                    newbuf = nullptr;
                 }
                 nm2t[nnnm].elem   = gmx_strdup(elem);
                 nm2t[nnnm].type   = gmx_strdup(type);
@@ -139,7 +138,7 @@ t_nm2type *rd_nm2type(const char *ffdir, int *nnm)
 
     nff  = fflib_search_file_end(ffdir, ".n2t", FALSE, &ff);
     *nnm = 0;
-    nm   = NULL;
+    nm   = nullptr;
     for (f = 0; f < nff; f++)
     {
         rd_nm2type_file(ff[f], nnm, &nm);
index d8884265f5c8516022a122d282f108c2a6caa7dc..ab093624d9c1a43e8ff1667b0a29d4da88f9620a 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,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.
@@ -47,7 +47,6 @@
 #include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/pdbio.h"
-#include "gromacs/fileio/readinp.h"
 #include "gromacs/gmxlib/conformation-utilities.h"
 #include "gromacs/gmxpreprocess/fflibutil.h"
 #include "gromacs/gmxpreprocess/genhydro.h"
@@ -277,7 +276,7 @@ static char *search_resrename(int nrr, rtprename_t *rr,
     char *nn;
     int   i;
 
-    nn = NULL;
+    nn = nullptr;
 
     i = 0;
     while (i < nrr && ((!bCompareFFRTPname && strcmp(name, rr[i].gmx)  != 0) ||
@@ -327,7 +326,7 @@ static void rename_resrtp(t_atoms *pdba, int nterpairs, int *r_start, int *r_end
     char    *nn;
     gmx_bool bFFRTPTERRNM;
 
-    bFFRTPTERRNM = (getenv("GMX_NO_FFRTP_TER_RENAME") == NULL);
+    bFFRTPTERRNM = (getenv("GMX_NO_FFRTP_TER_RENAME") == nullptr);
 
     for (r = 0; r < pdba->nres; r++)
     {
@@ -350,7 +349,7 @@ static void rename_resrtp(t_atoms *pdba, int nterpairs, int *r_start, int *r_end
 
         nn = search_resrename(nrr, rr, *pdba->resinfo[r].rtp, bStart, bEnd, FALSE);
 
-        if (bFFRTPTERRNM && nn == NULL && (bStart || bEnd))
+        if (bFFRTPTERRNM && nn == nullptr && (bStart || bEnd))
         {
             /* This is a terminal residue, but the residue name,
              * currently stored in .rtp, is not a standard residue name,
@@ -361,7 +360,7 @@ static void rename_resrtp(t_atoms *pdba, int nterpairs, int *r_start, int *r_end
                                   *pdba->resinfo[r].rtp, bStart, bEnd, TRUE);
         }
 
-        if (nn != NULL && strcmp(*pdba->resinfo[r].rtp, nn) != 0)
+        if (nn != nullptr && strcmp(*pdba->resinfo[r].rtp, nn) != 0)
         {
             if (bVerbose)
             {
@@ -379,7 +378,7 @@ static void pdbres_to_gmxrtp(t_atoms *pdba)
 
     for (i = 0; (i < pdba->nres); i++)
     {
-        if (pdba->resinfo[i].rtp == NULL)
+        if (pdba->resinfo[i].rtp == nullptr)
         {
             pdba->resinfo[i].rtp = pdba->resinfo[i].name;
         }
@@ -396,7 +395,7 @@ static void rename_pdbres(t_atoms *pdba, const char *oldnm, const char *newnm,
     {
         resnm = *pdba->resinfo[i].name;
         if ((bFullCompare && (gmx_strcasecmp(resnm, oldnm) == 0)) ||
-            (!bFullCompare && strstr(resnm, oldnm) != NULL))
+            (!bFullCompare && strstr(resnm, oldnm) != nullptr))
         {
             /* Rename the residue name (not the rtp name) */
             pdba->resinfo[i].name = put_symtab(symtab, newnm);
@@ -415,7 +414,7 @@ static void rename_bb(t_atoms *pdba, const char *oldnm, const char *newnm,
         /* We have not set the rtp name yes, use the residue name */
         bbnm = *pdba->resinfo[i].name;
         if ((bFullCompare && (gmx_strcasecmp(bbnm, oldnm) == 0)) ||
-            (!bFullCompare && strstr(bbnm, oldnm) != NULL))
+            (!bFullCompare && strstr(bbnm, oldnm) != nullptr))
         {
             /* Change the rtp builing block name */
             pdba->resinfo[i].rtp = put_symtab(symtab, newnm);
@@ -438,7 +437,7 @@ static void rename_bbint(t_atoms *pdba, const char *oldnm,
         /* We have not set the rtp name yes, use the residue name */
         bbnm = *pdba->resinfo[i].name;
         if ((bFullCompare && (strcmp(bbnm, oldnm) == 0)) ||
-            (!bFullCompare && strstr(bbnm, oldnm) != NULL))
+            (!bFullCompare && strstr(bbnm, oldnm) != nullptr))
         {
             ptr                  = gettp(i, nrr, rr);
             pdba->resinfo[i].rtp = put_symtab(symtab, ptr);
@@ -501,7 +500,7 @@ static void check_occupancy(t_atoms *atoms, const char *filename, gmx_bool bVerb
     }
 }
 
-void write_posres(char *fn, t_atoms *pdba, real fc)
+static void write_posres(char *fn, t_atoms *pdba, real fc)
 {
     FILE *fp;
     int   i;
@@ -539,13 +538,13 @@ static int read_pdball(const char *inf, const char *outf, char *title,
     printf("Reading %s...\n", inf);
     t_topology *top;
     snew(top, 1);
-    read_tps_conf(inf, top, ePBC, x, NULL, box, FALSE);
+    read_tps_conf(inf, top, ePBC, x, nullptr, box, FALSE);
     strncpy(title, *top->name, STRLEN);
     title[STRLEN-1] = '\0';
     *atoms          = top->atoms;
     sfree(top);
     natom = atoms->nr;
-    if (atoms->pdbinfo == NULL)
+    if (atoms->pdbinfo == nullptr)
     {
         snew(atoms->pdbinfo, atoms->nr);
     }
@@ -583,8 +582,8 @@ static int read_pdball(const char *inf, const char *outf, char *title,
     rename_pdbres(atoms, "SOL", watres, FALSE, symtab);
     rename_pdbres(atoms, "WAT", watres, FALSE, symtab);
 
-    rename_atoms("xlateat.dat", NULL,
-                 atoms, symtab, NULL, TRUE, rt, TRUE, bVerbose);
+    rename_atoms("xlateat.dat", nullptr,
+                 atoms, symtab, nullptr, TRUE, rt, TRUE, bVerbose);
 
     if (natom == 0)
     {
@@ -593,18 +592,18 @@ static int read_pdball(const char *inf, const char *outf, char *title,
 
     if (outf)
     {
-        write_sto_conf(outf, title, atoms, *x, NULL, *ePBC, box);
+        write_sto_conf(outf, title, atoms, *x, nullptr, *ePBC, box);
     }
 
     return natom;
 }
 
-void process_chain(t_atoms *pdba, rvec *x,
-                   gmx_bool bTrpU, gmx_bool bPheU, gmx_bool bTyrU,
-                   gmx_bool bLysMan, gmx_bool bAspMan, gmx_bool bGluMan,
-                   gmx_bool bHisMan, gmx_bool bArgMan, gmx_bool bGlnMan,
-                   real angle, real distance, t_symtab *symtab,
-                   int nrr, const rtprename_t *rr)
+static void process_chain(t_atoms *pdba, rvec *x,
+                          gmx_bool bTrpU, gmx_bool bPheU, gmx_bool bTyrU,
+                          gmx_bool bLysMan, gmx_bool bAspMan, gmx_bool bGluMan,
+                          gmx_bool bHisMan, gmx_bool bArgMan, gmx_bool bGlnMan,
+                          real angle, real distance, t_symtab *symtab,
+                          int nrr, const rtprename_t *rr)
 {
     /* Rename aromatics, lys, asp and histidine */
     if (bTyrU)
@@ -678,7 +677,7 @@ typedef struct {
     char altloc; /* alternate location indicator */
 } t_pdbindex;
 
-int pdbicomp(const void *a, const void *b)
+static int pdbicomp(const void *a, const void *b)
 {
     t_pdbindex *pa, *pb;
     int         d;
@@ -717,7 +716,7 @@ static void sort_pdbatoms(t_restp restp[],
 
     pdba   = *pdbaptr;
     natoms = pdba->nr;
-    pdbnew = NULL;
+    pdbnew = nullptr;
     snew(xnew, 1);
     snew(pdbi, natoms);
 
@@ -860,8 +859,8 @@ static int remove_duplicate_atoms(t_atoms *pdba, rvec x[], gmx_bool bVerbose)
     return pdba->nr;
 }
 
-void find_nc_ter(t_atoms *pdba, int r0, int r1, int *r_start, int *r_end,
-                 gmx_residuetype_t *rt)
+static void find_nc_ter(t_atoms *pdba, int r0, int r1, int *r_start, int *r_end,
+                        gmx_residuetype_t *rt)
 {
     int         i;
     const char *p_startrestype;
@@ -1010,9 +1009,9 @@ modify_chain_numbers(t_atoms *       pdba,
     old_prev_chainnum = -1;
     new_chainnum      = -1;
 
-    this_atomname       = NULL;
+    this_atomname       = nullptr;
     this_atomnum        = -1;
-    this_resname        = NULL;
+    this_resname        = nullptr;
     this_resnum         = -1;
     this_chainid        = '?';
 
@@ -1029,7 +1028,7 @@ modify_chain_numbers(t_atoms *       pdba,
         prev_chainid       = this_chainid;
 
         this_atomname      = *(pdba->atomname[i]);
-        this_atomnum       = (pdba->pdbinfo != NULL) ? pdba->pdbinfo[i].atomnr : i+1;
+        this_atomnum       = (pdba->pdbinfo != nullptr) ? pdba->pdbinfo[i].atomnr : i+1;
         this_resname       = *ri->name;
         this_resnum        = ri->nr;
         this_chainid       = ri->chainid;
@@ -1073,7 +1072,7 @@ modify_chain_numbers(t_atoms *       pdba,
                                prev_resname, prev_resnum, prev_chainid, prev_atomnum, prev_atomname,
                                this_resname, this_resnum, this_chainid, this_atomnum, this_atomname);
 
-                        if (NULL == fgets(select, STRLEN-1, stdin))
+                        if (nullptr == fgets(select, STRLEN-1, stdin))
                         {
                             gmx_fatal(FARGS, "Error reading from stdin");
                         }
@@ -1234,7 +1233,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
     };
 
 
-    FILE             *fp, *top_file, *top_file2, *itp_file = NULL;
+    FILE             *fp, *top_file, *top_file2, *itp_file = nullptr;
     int               natom, nres;
     t_atoms           pdba_all, *pdba;
     t_atoms          *atoms;
@@ -1270,7 +1269,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
     int               nrrn;
     char            **rrn;
     int               nrtprename;
-    rtprename_t      *rtprename = NULL;
+    rtprename_t      *rtprename = nullptr;
     int               nah, nNtdb, nCtdb, ntdblist;
     t_hackblock      *ntdb, *ctdb, **tdblist;
     int               nssbonds;
@@ -1306,30 +1305,28 @@ int gmx_pdb2gmx(int argc, char *argv[])
     t_filenm          fnm[] = {
         { efSTX, "-f", "eiwit.pdb", ffREAD  },
         { efSTO, "-o", "conf",      ffWRITE },
-        { efTOP, NULL, NULL,        ffWRITE },
+        { efTOP, nullptr, nullptr,        ffWRITE },
         { efITP, "-i", "posre",     ffWRITE },
         { efNDX, "-n", "clean",     ffOPTWR },
         { efSTO, "-q", "clean.pdb", ffOPTWR }
     };
 #define NFILE asize(fnm)
 
-
-    /* Command line arguments must be static */
-    static gmx_bool    bNewRTP        = FALSE;
-    static gmx_bool    bInter         = FALSE, bCysMan = FALSE;
-    static gmx_bool    bLysMan        = FALSE, bAspMan = FALSE, bGluMan = FALSE, bHisMan = FALSE;
-    static gmx_bool    bGlnMan        = FALSE, bArgMan = FALSE;
-    static gmx_bool    bTerMan        = FALSE, bUnA = FALSE, bHeavyH;
-    static gmx_bool    bSort          = TRUE, bAllowMissing = FALSE, bRemoveH = FALSE;
-    static gmx_bool    bDeuterate     = FALSE, bVerbose = FALSE, bChargeGroups = TRUE, bCmap = TRUE;
-    static gmx_bool    bRenumRes      = FALSE, bRTPresname = FALSE;
-    static real        angle          = 135.0, distance = 0.3, posre_fc = 1000;
-    static real        long_bond_dist = 0.25, short_bond_dist = 0.05;
-    static const char *vsitestr[]     = { NULL, "none", "hydrogens", "aromatics", NULL };
-    static const char *watstr[]       = { NULL, "select", "none", "spc", "spce", "tip3p", "tip4p", "tip5p", NULL };
-    static const char *chainsep[]     = { NULL, "id_or_ter", "id_and_ter", "ter", "id", "interactive", NULL };
-    static const char *merge[]        = {NULL, "no", "all", "interactive", NULL };
-    static const char *ff             = "select";
+    gmx_bool           bNewRTP        = FALSE;
+    gmx_bool           bInter         = FALSE, bCysMan = FALSE;
+    gmx_bool           bLysMan        = FALSE, bAspMan = FALSE, bGluMan = FALSE, bHisMan = FALSE;
+    gmx_bool           bGlnMan        = FALSE, bArgMan = FALSE;
+    gmx_bool           bTerMan        = FALSE, bUnA = FALSE, bHeavyH = FALSE;
+    gmx_bool           bSort          = TRUE, bAllowMissing = FALSE, bRemoveH = FALSE;
+    gmx_bool           bDeuterate     = FALSE, bVerbose = FALSE, bChargeGroups = TRUE, bCmap = TRUE;
+    gmx_bool           bRenumRes      = FALSE, bRTPresname = FALSE;
+    real               angle          = 135.0, distance = 0.3, posre_fc = 1000;
+    real               long_bond_dist = 0.25, short_bond_dist = 0.05;
+    const char        *vsitestr[]     = { nullptr, "none", "hydrogens", "aromatics", nullptr };
+    const char        *watstr[]       = { nullptr, "select", "none", "spc", "spce", "tip3p", "tip4p", "tip5p", nullptr };
+    const char        *chainsep[]     = { nullptr, "id_or_ter", "id_and_ter", "ter", "id", "interactive", nullptr };
+    const char        *merge[]        = {nullptr, "no", "all", "interactive", nullptr };
+    const char        *ff             = "select";
 
     t_pargs            pa[] = {
         { "-newrtp", FALSE, etBOOL, {&bNewRTP},
@@ -1399,13 +1396,13 @@ int gmx_pdb2gmx(int argc, char *argv[])
 #define NPARGS asize(pa)
 
     if (!parse_common_args(&argc, argv, 0, NFILE, fnm, asize(pa), pa, asize(desc), desc,
-                           0, NULL, &oenv))
+                           0, nullptr, &oenv))
     {
         return 0;
     }
 
     /* Force field selection, interactive or direct */
-    choose_ff(strcmp(ff, "select") == 0 ? NULL : ff,
+    choose_ff(strcmp(ff, "select") == 0 ? nullptr : ff,
               forcefield, sizeof(forcefield),
               ffdir, sizeof(ffdir));
 
@@ -1482,7 +1479,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
     nrrn = fflib_search_file_end(ffdir, ".r2b", FALSE, &rrn);
 
     nrtprename = 0;
-    rtprename  = NULL;
+    rtprename  = nullptr;
     for (i = 0; i < nrrn; i++)
     {
         fp = fflib_open(rrn[i]);
@@ -1508,13 +1505,13 @@ int gmx_pdb2gmx(int argc, char *argv[])
     }
 
     clear_mat(box);
-    if (watermodel != NULL && (strstr(watermodel, "4p") ||
-                               strstr(watermodel, "4P")))
+    if (watermodel != nullptr && (strstr(watermodel, "4p") ||
+                                  strstr(watermodel, "4P")))
     {
         watres = "HO4";
     }
-    else if (watermodel != NULL && (strstr(watermodel, "5p") ||
-                                    strstr(watermodel, "5P")))
+    else if (watermodel != nullptr && (strstr(watermodel, "5p") ||
+                                       strstr(watermodel, "5P")))
     {
         watres = "HO5";
     }
@@ -1540,9 +1537,9 @@ int gmx_pdb2gmx(int argc, char *argv[])
 
     nchainmerges        = 0;
 
-    this_atomname       = NULL;
+    this_atomname       = nullptr;
     this_atomnum        = -1;
-    this_resname        = NULL;
+    this_resname        = nullptr;
     this_resnum         = -1;
     this_chainid        = '?';
     this_chainnumber    = -1;
@@ -1573,7 +1570,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
         }
 
         this_atomname      = *pdba_all.atomname[i];
-        this_atomnum       = (pdba_all.pdbinfo != NULL) ? pdba_all.pdbinfo[i].atomnr : i+1;
+        this_atomnum       = (pdba_all.pdbinfo != nullptr) ? pdba_all.pdbinfo[i].atomnr : i+1;
         this_resname       = *ri->name;
         this_resnum        = ri->nr;
         this_chainid       = ri->chainid;
@@ -1594,7 +1591,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
                            prev_resname, prev_resnum, prev_chainid, prev_atomnum, prev_atomname,
                            this_resname, this_resnum, this_chainid, this_atomnum, this_atomname);
 
-                    if (NULL == fgets(select, STRLEN-1, stdin))
+                    if (nullptr == fgets(select, STRLEN-1, stdin))
                     {
                         gmx_fatal(FARGS, "Error reading from stdin");
                     }
@@ -1764,7 +1761,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
     printf("Reading residue database... (%s)\n", forcefield);
     nrtpf = fflib_search_file_end(ffdir, ".rtp", TRUE, &rtpf);
     nrtp  = 0;
-    restp = NULL;
+    restp = nullptr;
     for (i = 0; i < nrtpf; i++)
     {
         read_resall(rtpf[i], &nrtp, &restp, atype, &symtab, FALSE);
@@ -1793,8 +1790,8 @@ int gmx_pdb2gmx(int argc, char *argv[])
 
     nincl = 0;
     nmol  = 0;
-    incls = NULL;
-    mols  = NULL;
+    incls = nullptr;
+    mols  = nullptr;
     for (chain = 0; (chain < nch); chain++)
     {
         cc = &(chains[chain]);
@@ -1859,7 +1856,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
             {
                 sprintf(fn, "chain_%c%d.pdb", cc->chainid, cc->chainnum);
             }
-            write_sto_conf(fn, title, pdba, x, NULL, ePBC, box);
+            write_sto_conf(fn, title, pdba, x, nullptr, ePBC, box);
         }
 
 
@@ -1882,7 +1879,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
                 {
                     printf("No suitable end (N or 5') terminus found in database - assuming this residue\n"
                            "is already in a terminus-specific form and skipping terminus selection.\n");
-                    cc->ntdb[i] = NULL;
+                    cc->ntdb[i] = nullptr;
                 }
                 else
                 {
@@ -1907,7 +1904,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
             }
             else
             {
-                cc->ntdb[i] = NULL;
+                cc->ntdb[i] = nullptr;
             }
 
             /* And the C terminus */
@@ -1921,7 +1918,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
                 {
                     printf("No suitable end (C or 3') terminus found in database - assuming this residue\n"
                            "is already in a terminus-specific form and skipping terminus selection.\n");
-                    cc->ctdb[i] = NULL;
+                    cc->ctdb[i] = nullptr;
                 }
                 else
                 {
@@ -1945,7 +1942,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
             }
             else
             {
-                cc->ctdb[i] = NULL;
+                cc->ctdb[i] = nullptr;
             }
         }
         /* lookup hackblocks and rtp for all residues */
@@ -1957,7 +1954,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
            requires some re-thinking of code in gen_vsite.c, which I won't
            do now :( AF 26-7-99 */
 
-        rename_atoms(NULL, ffdir,
+        rename_atoms(nullptr, ffdir,
                      pdba, &symtab, restp_chain, FALSE, rt, FALSE, bVerbose);
 
         match_atomnames_with_rtp(restp_chain, hb_chain, pdba, x, bVerbose);
@@ -1996,12 +1993,12 @@ int gmx_pdb2gmx(int argc, char *argv[])
         printf("Generating any missing hydrogen atoms and/or adding termini.\n");
         natom = add_h(&pdba, &x, nah, ah,
                       cc->nterpairs, cc->ntdb, cc->ctdb, cc->r_start, cc->r_end, bAllowMissing,
-                      NULL, NULL, TRUE, FALSE);
+                      nullptr, nullptr, TRUE, FALSE);
         printf("Now there are %d residues with %d atoms\n",
                pdba->nres, pdba->nr);
         if (debug)
         {
-            write_pdbfile(debug, title, pdba, x, ePBC, box, ' ', 0, NULL, TRUE);
+            write_pdbfile(debug, title, pdba, x, ePBC, box, ' ', 0, nullptr, TRUE);
         }
 
         if (debug)
@@ -2113,7 +2110,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
 
         if (cc->bAllWat)
         {
-            top_file2 = NULL;
+            top_file2 = nullptr;
         }
         else
         if (bITP)
@@ -2158,11 +2155,11 @@ int gmx_pdb2gmx(int argc, char *argv[])
             {
                 sprintf(fn, "chain_%c.pdb", cc->chainid);
             }
-            write_sto_conf(fn, "", pdba, x, NULL, ePBC, box);
+            write_sto_conf(fn, "", pdba, x, nullptr, ePBC, box);
         }
     }
 
-    if (watermodel == NULL)
+    if (watermodel == nullptr)
     {
         for (chain = 0; chain < nch; chain++)
         {
@@ -2246,12 +2243,12 @@ int gmx_pdb2gmx(int argc, char *argv[])
     {
         make_new_box(atoms->nr, x, box, box_space, FALSE);
     }
-    write_sto_conf(ftp2fn(efSTO, NFILE, fnm), title, atoms, x, NULL, ePBC, box);
+    write_sto_conf(ftp2fn(efSTO, NFILE, fnm), title, atoms, x, nullptr, ePBC, box);
 
     printf("\t\t--------- PLEASE NOTE ------------\n");
     printf("You have successfully generated a topology from: %s.\n",
            opt2fn("-f", NFILE, fnm));
-    if (watermodel != NULL)
+    if (watermodel != nullptr)
     {
         printf("The %s force field and the %s water model are used.\n",
                ffname, watermodel);
index ff2f86e5705c5462c4bfe7e69395c8fb864db49e..5686b15245dbd17e020fef85957f50c894046f66 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,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.
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
+#include "gromacs/utility/niceheader.h"
 #include "gromacs/utility/path.h"
 #include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/strdb.h"
 #include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/textwriter.h"
 
 /* this must correspond to enum in pdb2top.h */
 const char *hh[ehisNR]   = { "HISD", "HISE", "HISH", "HIS1" };
@@ -155,7 +157,7 @@ choose_ff_impl(const char *ffsel,
     }
 
     int sel;
-    if (ffsel != NULL)
+    if (ffsel != nullptr)
     {
         sel         = -1;
         int cwdsel  = -1;
@@ -226,7 +228,7 @@ choose_ff_impl(const char *ffsel,
                 FILE *fp = gmx_ffopen(docFileName.c_str(), "r");
                 get_a_line(fp, buf, STRLEN);
                 gmx_ffclose(fp);
-                desc.push_back(buf);
+                desc.emplace_back(buf);
             }
             else
             {
@@ -277,13 +279,13 @@ choose_ff_impl(const char *ffsel,
         {
             pret = fgets(buf, STRLEN, stdin);
 
-            if (pret != NULL)
+            if (pret != nullptr)
             {
-                sel = strtol(buf, NULL, 10);
+                sel = strtol(buf, nullptr, 10);
                 sel--;
             }
         }
-        while (pret == NULL || (sel < 0) || (sel >= nff));
+        while (pret == nullptr || (sel < 0) || (sel >= nff));
 
         /* Check for a current limitation of the fflib code.
          * It will always read from the first ff directory in the list.
@@ -365,7 +367,7 @@ void choose_watermodel(const char *wmsel, const char *ffdir,
 
     if (strcmp(wmsel, "none") == 0)
     {
-        *watermodel = NULL;
+        *watermodel = nullptr;
 
         return;
     }
@@ -382,7 +384,7 @@ void choose_watermodel(const char *wmsel, const char *ffdir,
     {
         fprintf(stderr, "No file '%s' found, will not include a water model\n",
                 fn_watermodels);
-        *watermodel = NULL;
+        *watermodel = nullptr;
 
         return;
     }
@@ -390,7 +392,7 @@ void choose_watermodel(const char *wmsel, const char *ffdir,
     fp = fflib_open(fn_list);
     printf("\nSelect the Water Model:\n");
     nwm   = 0;
-    model = NULL;
+    model = nullptr;
     while (get_a_line(fp, buf, STRLEN))
     {
         srenew(model, nwm+1);
@@ -415,17 +417,17 @@ void choose_watermodel(const char *wmsel, const char *ffdir,
     {
         pret = fgets(buf, STRLEN, stdin);
 
-        if (pret != NULL)
+        if (pret != nullptr)
         {
-            sel = strtol(buf, NULL, 10);
+            sel = strtol(buf, nullptr, 10);
             sel--;
         }
     }
-    while (pret == NULL || sel < 0 || sel > nwm);
+    while (pret == nullptr || sel < 0 || sel > nwm);
 
     if (sel == nwm)
     {
-        *watermodel = NULL;
+        *watermodel = nullptr;
     }
     else
     {
@@ -549,18 +551,21 @@ void print_top_comment(FILE       *out,
     char  ffdir_parent[STRLEN];
     char *p;
 
-    nice_header(out, filename);
-    fprintf(out, ";\tThis is a %s topology file\n;\n", bITP ? "include" : "standalone");
     try
     {
+        gmx::TextWriter writer(out);
+        gmx::niceHeader(&writer, filename, ';');
+        writer.writeLine(gmx::formatString(";\tThis is a %s topology file", bITP ? "include" : "standalone"));
+        writer.writeLine(";");
+
         gmx::BinaryInformationSettings settings;
         settings.generatedByHeader(true);
         settings.linePrefix(";\t");
-        gmx::printBinaryInformation(out, gmx::getProgramContext(), settings);
+        gmx::printBinaryInformation(&writer, gmx::getProgramContext(), settings);
     }
     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
 
-    if (strchr(ffdir, '/') == NULL)
+    if (strchr(ffdir, '/') == nullptr)
     {
         fprintf(out, ";\tForce field was read from the standard GROMACS share directory.\n;\n\n");
     }
@@ -599,7 +604,7 @@ void print_top_header(FILE *out, const char *filename,
     fprintf(out, "; Include forcefield parameters\n");
 
     p = strrchr(ffdir, '/');
-    p = (ffdir[0] == '.' || p == NULL) ? ffdir : p+1;
+    p = (ffdir[0] == '.' || p == nullptr) ? ffdir : p+1;
 
     fprintf(out, "#include \"%s/%s\"\n\n", p, fflib_forcefield_itp());
 }
@@ -620,7 +625,7 @@ static void print_top_water(FILE *out, const char *ffdir, const char *water)
     fprintf(out, "; Include water topology\n");
 
     p = strrchr(ffdir, '/');
-    p = (ffdir[0] == '.' || p == NULL) ? ffdir : p+1;
+    p = (ffdir[0] == '.' || p == nullptr) ? ffdir : p+1;
     fprintf(out, "#include \"%s/%s.itp\"\n", p, water);
 
     fprintf(out, "\n");
@@ -662,7 +667,7 @@ void print_top_mols(FILE *out,
         for (i = 0; (i < nincl); i++)
         {
             incl = strrchr(incls[i], DIR_SEPARATOR);
-            if (incl == NULL)
+            if (incl == nullptr)
             {
                 incl = incls[i];
             }
@@ -753,7 +758,7 @@ static void do_ssbonds(t_params *ps, t_atoms *atoms,
             gmx_fatal(FARGS, "Trying to make impossible special bond (%s-%s)!",
                       ssbonds[i].a1, ssbonds[i].a2);
         }
-        add_param(ps, ai, aj, NULL, NULL);
+        add_param(ps, ai, aj, nullptr, nullptr);
     }
 }
 
@@ -808,7 +813,7 @@ static void at2bonds(t_params *psb, t_hackblock *hb,
                     fprintf(stderr, "Warning: Short Bond (%d-%d = %g nm)\n",
                             ai+1, aj+1, std::sqrt(dist2));
                 }
-                add_param(psb, ai, aj, NULL, hb[resind].rb[ebtsBONDS].b[j].s);
+                add_param(psb, ai, aj, nullptr, hb[resind].rb[ebtsBONDS].b[j].s);
             }
         }
         /* add bonds from list of hacks (each added atom gets a bond) */
@@ -817,20 +822,20 @@ static void at2bonds(t_params *psb, t_hackblock *hb,
             for (j = 0; j < hb[resind].nhack; j++)
             {
                 if ( ( hb[resind].hack[j].tp > 0 ||
-                       hb[resind].hack[j].oname == NULL ) &&
+                       hb[resind].hack[j].oname == nullptr ) &&
                      strcmp(hb[resind].hack[j].a[0], *(atoms->atomname[i])) == 0)
                 {
                     switch (hb[resind].hack[j].tp)
                     {
-                        case 9:                                   /* COOH terminus */
-                            add_param(psb, i, i+1, NULL, NULL);   /* C-O  */
-                            add_param(psb, i, i+2, NULL, NULL);   /* C-OA */
-                            add_param(psb, i+2, i+3, NULL, NULL); /* OA-H */
+                        case 9:                                         /* COOH terminus */
+                            add_param(psb, i, i+1, nullptr, nullptr);   /* C-O  */
+                            add_param(psb, i, i+2, nullptr, nullptr);   /* C-OA */
+                            add_param(psb, i+2, i+3, nullptr, nullptr); /* OA-H */
                             break;
                         default:
                             for (k = 0; (k < hb[resind].hack[j].nr); k++)
                             {
-                                add_param(psb, i, i+k+1, NULL, NULL);
+                                add_param(psb, i, i+k+1, nullptr, nullptr);
                             }
                     }
                 }
@@ -843,10 +848,10 @@ static void at2bonds(t_params *psb, t_hackblock *hb,
 
 static int pcompar(const void *a, const void *b)
 {
-    t_param *pa, *pb;
-    int      d;
-    pa = (t_param *)a;
-    pb = (t_param *)b;
+    const t_param *pa, *pb;
+    int            d;
+    pa = static_cast<const t_param *>(a);
+    pb = static_cast<const t_param *>(b);
 
     d = pa->a[0] - pb->a[0];
     if (d == 0)
@@ -957,7 +962,7 @@ static void check_restp_types(t_restp *r0, t_restp *r1)
     }
 }
 
-void add_atom_to_restp(t_restp *restp, int at_start, const t_hack *hack)
+static void add_atom_to_restp(t_restp *restp, int at_start, const t_hack *hack)
 {
     char        buf[STRLEN];
     int         k;
@@ -1030,11 +1035,11 @@ void get_hackblocks_rtp(t_hackblock **hb, t_restp **restp,
     /* first the termini */
     for (i = 0; i < nterpairs; i++)
     {
-        if (rn[i] >= 0 && ntdb[i] != NULL)
+        if (rn[i] >= 0 && ntdb[i] != nullptr)
         {
             copy_t_hackblock(ntdb[i], &(*hb)[rn[i]]);
         }
-        if (rc[i] >= 0 && ctdb[i] != NULL)
+        if (rc[i] >= 0 && ctdb[i] != nullptr)
         {
             merge_t_hackblock(ctdb[i], &(*hb)[rc[i]]);
         }
@@ -1077,8 +1082,8 @@ void get_hackblocks_rtp(t_hackblock **hb, t_restp **restp,
         }
         bRM = merge_t_bondeds(res->rb, (*hb)[i].rb, tern >= 0, terc >= 0);
 
-        if (bRM && ((tern >= 0 && ntdb[tern] == NULL) ||
-                    (terc >= 0 && ctdb[terc] == NULL)))
+        if (bRM && ((tern >= 0 && ntdb[tern] == nullptr) ||
+                    (terc >= 0 && ctdb[terc] == nullptr)))
         {
             gmx_fatal(FARGS, "There is a dangling bond at at least one of the terminal ends and the force field does not provide terminal entries or files. Fix your terminal residues so that they match the residue database (.rtp) entries, or provide terminal database entries (.tdb).");
         }
@@ -1102,9 +1107,9 @@ void get_hackblocks_rtp(t_hackblock **hb, t_restp **restp,
                 /* find atom in restp */
                 for (l = 0; l < (*restp)[i].natom; l++)
                 {
-                    if ( ( (*hb)[i].hack[j].oname == NULL &&
+                    if ( ( (*hb)[i].hack[j].oname == nullptr &&
                            strcmp((*hb)[i].hack[j].a[0], *(*restp)[i].atomname[l]) == 0 ) ||
-                         ( (*hb)[i].hack[j].oname != NULL &&
+                         ( (*hb)[i].hack[j].oname != nullptr &&
                            strcmp((*hb)[i].hack[j].oname, *(*restp)[i].atomname[l]) == 0 ) )
                     {
                         break;
@@ -1119,22 +1124,22 @@ void get_hackblocks_rtp(t_hackblock **hb, t_restp **restp,
                     /* Deleting can happen also only on the input atoms,
                      * not necessarily always on the rtp entry.
                      */
-                    if (!((*hb)[i].hack[j].oname != NULL &&
-                          (*hb)[i].hack[j].nname != NULL) &&
-                        !((*hb)[i].hack[j].oname != NULL &&
-                          (*hb)[i].hack[j].nname == NULL))
+                    if (!((*hb)[i].hack[j].oname != nullptr &&
+                          (*hb)[i].hack[j].nname != nullptr) &&
+                        !((*hb)[i].hack[j].oname != nullptr &&
+                          (*hb)[i].hack[j].nname == nullptr))
                     {
                         gmx_fatal(FARGS,
                                   "atom %s not found in buiding block %d%s "
                                   "while combining tdb and rtp",
-                                  (*hb)[i].hack[j].oname != NULL ?
+                                  (*hb)[i].hack[j].oname != nullptr ?
                                   (*hb)[i].hack[j].oname : (*hb)[i].hack[j].a[0],
                                   i+1, *resinfo[i].rtp);
                     }
                 }
                 else
                 {
-                    if ( (*hb)[i].hack[j].oname == NULL)
+                    if ( (*hb)[i].hack[j].oname == nullptr)
                     {
                         /* we're adding: */
                         add_atom_to_restp(&(*restp)[i], l, &(*hb)[i].hack[j]);
@@ -1142,7 +1147,7 @@ void get_hackblocks_rtp(t_hackblock **hb, t_restp **restp,
                     else
                     {
                         /* oname != NULL */
-                        if ( (*hb)[i].hack[j].nname == NULL)
+                        if ( (*hb)[i].hack[j].nname == nullptr)
                         {
                             /* we're deleting */
                             if (debug)
@@ -1237,7 +1242,7 @@ static gmx_bool match_atomnames_with_rtp_atom(t_atoms *pdba, rvec *x, int atind,
     bDeleted = FALSE;
     for (j = 0; j < hbr->nhack; j++)
     {
-        if (hbr->hack[j].oname != NULL && hbr->hack[j].nname != NULL &&
+        if (hbr->hack[j].oname != nullptr && hbr->hack[j].nname != nullptr &&
             gmx_strcasecmp(oldnm, hbr->hack[j].oname) == 0)
         {
             /* This is a replace entry. */
@@ -1246,7 +1251,7 @@ static gmx_bool match_atomnames_with_rtp_atom(t_atoms *pdba, rvec *x, int atind,
             for (k = 0; k < hbr->nhack; k++)
             {
                 if (k != j &&
-                    hbr->hack[k].oname != NULL && hbr->hack[k].nname != NULL &&
+                    hbr->hack[k].oname != nullptr && hbr->hack[k].nname != nullptr &&
                     gmx_strcasecmp(hbr->hack[k].nname, hbr->hack[j].oname) == 0)
                 {
                     /* The replace in hack[j] replaces an atom that
@@ -1283,8 +1288,8 @@ static gmx_bool match_atomnames_with_rtp_atom(t_atoms *pdba, rvec *x, int atind,
                 bFoundInAdd = FALSE;
                 for (k = 0; k < hbr->nhack; k++)
                 {
-                    if (hbr->hack[k].oname == NULL &&
-                        hbr->hack[k].nname != NULL &&
+                    if (hbr->hack[k].oname == nullptr &&
+                        hbr->hack[k].nname != nullptr &&
                         atomname_cmp_nr(newnm, &hbr->hack[k], &anmnr))
                     {
                         if (anmnr <= 1)
@@ -1333,7 +1338,7 @@ static gmx_bool match_atomnames_with_rtp_atom(t_atoms *pdba, rvec *x, int atind,
             snew(pdba->atomname[atind], 1);
             *pdba->atomname[atind] = gmx_strdup(newnm);
         }
-        else if (hbr->hack[j].oname != NULL && hbr->hack[j].nname == NULL &&
+        else if (hbr->hack[j].oname != nullptr && hbr->hack[j].nname == nullptr &&
                  gmx_strcasecmp(oldnm, hbr->hack[j].oname) == 0)
         {
             /* This is a delete entry, check if this atom is present
@@ -1454,8 +1459,8 @@ static void gen_cmap(t_params *psb, t_restp *restp, t_atoms *atoms)
                 /* Skip this CMAP entry if it refers to residues before the
                  * first or after the last residue.
                  */
-                if (((strchr(pname, '-') != NULL) && (residx == 0)) ||
-                    ((strchr(pname, '+') != NULL) && (residx == nres-1)))
+                if (((strchr(pname, '-') != nullptr) && (residx == 0)) ||
+                    ((strchr(pname, '+') != nullptr) && (residx == nres-1)))
                 {
                     bAddCMAP = FALSE;
                     break;
index 7a187208a2e3e2da79762d2cbf3af7bd2d4d2fb3..a4418abf9ab85a3894843dbcd15df63666607fdb 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, by the GROMACS development team, led by
+ * 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.
@@ -96,8 +96,8 @@ int search_atom(const char *type, int start,
     t_atom         *at     = atoms->atom;
     char ** const * anm    = atoms->atomname;
 
-    bPrevious = (strchr(type, '-') != NULL);
-    bNext     = (strchr(type, '+') != NULL);
+    bPrevious = (strchr(type, '-') != nullptr);
+    bNext     = (strchr(type, '+') != nullptr);
 
     if (!bPrevious)
     {
index de1a1ebeb0eef240201235fe29ad0940427b7a98..950f751acbb28347abd8c9f0afd5bdca466c2812 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,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.
 #include "gromacs/fileio/confio.h"
 #include "gromacs/topology/atomprop.h"
 #include "gromacs/topology/atoms.h"
+#include "gromacs/topology/mtop_util.h"
 #include "gromacs/topology/topology.h"
 #include "gromacs/utility/cstringutil.h"
-#include "gromacs/utility/scoped_cptr.h"
 #include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/unique_cptr.h"
 
 using gmx::RVec;
 
@@ -73,16 +74,39 @@ makeExclusionDistances(const t_atoms *a, gmx_atomprop_t aps,
     return exclusionDistances;
 }
 
+void readConformation(const char *confin, gmx_mtop_t *top,
+                      std::vector<RVec> *x, std::vector<RVec> *v,
+                      int *ePBC, matrix box, const char *statusTitle)
+{
+    fprintf(stderr, "Reading %s configuration%s\n", statusTitle,
+            v ? " and velocities" : "");
+    rvec                   *x_tmp = nullptr, *v_tmp = nullptr;
+    bool                    dummy;
+    readConfAndTopology(confin, &dummy, top, ePBC, x ? &x_tmp : nullptr, v ? &v_tmp : nullptr, box);
+    const gmx::sfree_guard  xguard(x_tmp);
+    const gmx::sfree_guard  vguard(v_tmp);
+    if (x && x_tmp)
+    {
+        *x = std::vector<RVec>(x_tmp, x_tmp + top->natoms);
+    }
+    if (v && v_tmp)
+    {
+        *v = std::vector<RVec>(v_tmp, v_tmp + top->natoms);
+    }
+    fprintf(stderr, "%s\nContaining %d atoms in %d residues\n",
+            *top->name, top->natoms, gmx_mtop_nres(top));
+}
+
 void readConformation(const char *confin, t_topology *top,
                       std::vector<RVec> *x, std::vector<RVec> *v,
                       int *ePBC, matrix box, const char *statusTitle)
 {
     fprintf(stderr, "Reading %s configuration%s\n", statusTitle,
             v ? " and velocities" : "");
-    rvec                   *x_tmp = NULL, *v_tmp = NULL;
-    read_tps_conf(confin, top, ePBC, x ? &x_tmp : NULL, v ? &v_tmp : NULL, box, FALSE);
-    gmx::scoped_guard_sfree xguard(x_tmp);
-    gmx::scoped_guard_sfree vguard(v_tmp);
+    rvec                   *x_tmp = nullptr, *v_tmp = nullptr;
+    read_tps_conf(confin, top, ePBC, x ? &x_tmp : nullptr, v ? &v_tmp : nullptr, box, FALSE);
+    const gmx::sfree_guard  xguard(x_tmp);
+    const gmx::sfree_guard  vguard(v_tmp);
     if (x && x_tmp)
     {
         *x = std::vector<RVec>(x_tmp, x_tmp + top->atoms.nr);
index 984a126ae00b52a144760246bb5bc4e8a80160f9..63e0afcec2e8d4f5709bc32bc0e2c5c833f4c63d 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,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.
@@ -41,6 +41,7 @@
 #include "gromacs/utility/real.h"
 
 struct gmx_atomprop;
+struct gmx_mtop_t;
 struct t_atoms;
 struct t_topology;
 
@@ -54,6 +55,9 @@ std::vector<real>
 makeExclusionDistances(const t_atoms *a, gmx_atomprop *aps,
                        real defaultDistance, real scaleFactor);
 
+void readConformation(const char *confin, gmx_mtop_t *top,
+                      std::vector<gmx::RVec> *x, std::vector<gmx::RVec> *v,
+                      int *ePBC, matrix box, const char *statusTitle);
 /*! \brief Read a conformation from a file, allocate and fill data structures.
  *
  * Used by solvate and insert-molecules. The returned pointers *x and
index cae5b27a6403d33c141e615bb916ef9066f1f807..e30ff84b901ae34dadcb1ec8d050d19a0ff81f4d 100644 (file)
 #include "gromacs/fileio/warninp.h"
 #include "gromacs/gmxlib/chargegroup.h"
 #include "gromacs/gmxlib/network.h"
+#include "gromacs/gmxpreprocess/keyvaluetreemdpwriter.h"
 #include "gromacs/gmxpreprocess/toputil.h"
 #include "gromacs/math/functions.h"
 #include "gromacs/math/units.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/calc_verletbuf.h"
+#include "gromacs/mdrunutility/mdmodules.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/mdtypes/pull-params.h"
+#include "gromacs/options/options.h"
+#include "gromacs/options/treesupport.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/topology/block.h"
 #include "gromacs/topology/ifunc.h"
 #include "gromacs/topology/symtab.h"
 #include "gromacs/topology/topology.h"
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/filestream.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/ikeyvaluetreeerror.h"
+#include "gromacs/utility/keyvaluetree.h"
+#include "gromacs/utility/keyvaluetreebuilder.h"
+#include "gromacs/utility/keyvaluetreetransform.h"
 #include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/stringcompare.h"
 #include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/textwriter.h"
 
 #define MAXPTR 254
 #define NOGID  255
@@ -98,12 +111,10 @@ typedef struct t_inputrec_strings
     char   QMmethod[STRLEN], QMbasis[STRLEN], QMcharge[STRLEN], QMmult[STRLEN],
            bSH[STRLEN], CASorbitals[STRLEN], CASelectrons[STRLEN], SAon[STRLEN],
            SAoff[STRLEN], SAsteps[STRLEN], bTS[STRLEN], bOPT[STRLEN];
-    char efield_x[STRLEN], efield_xt[STRLEN], efield_y[STRLEN],
-         efield_yt[STRLEN], efield_z[STRLEN], efield_zt[STRLEN];
 
 } gmx_inputrec_strings;
 
-static gmx_inputrec_strings *is = NULL;
+static gmx_inputrec_strings *is = nullptr;
 
 void init_inputrec_strings()
 {
@@ -117,7 +128,7 @@ void init_inputrec_strings()
 void done_inputrec_strings()
 {
     sfree(is);
-    is = NULL;
+    is = nullptr;
 }
 
 
@@ -132,22 +143,13 @@ enum {
 };
 
 static const char *constraints[eshNR+1]    = {
-    "none", "h-bonds", "all-bonds", "h-angles", "all-angles", NULL
+    "none", "h-bonds", "all-bonds", "h-angles", "all-angles", nullptr
 };
 
 static const char *couple_lam[ecouplamNR+1]    = {
-    "vdw-q", "vdw", "q", "none", NULL
+    "vdw-q", "vdw", "q", "none", nullptr
 };
 
-void init_ir(t_inputrec *ir, t_gromppopts *opts)
-{
-    snew(opts->include, STRLEN);
-    snew(opts->define, STRLEN);
-    snew(ir->fepvals, 1);
-    snew(ir->expandedvals, 1);
-    snew(ir->simtempvals, 1);
-}
-
 static void GetSimTemps(int ntemps, t_simtemp *simtemp, double *temperature_lambdas)
 {
 
@@ -1062,7 +1064,7 @@ void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts,
         CHECK(EEL_FULL(ir->coulombtype) || ir->implicit_solvent == eisGBSA);
     }
 
-    if (getenv("GMX_DO_GALACTIC_DYNAMICS") == NULL)
+    if (getenv("GMX_DO_GALACTIC_DYNAMICS") == nullptr)
     {
         sprintf(err_buf, "epsilon-r must be >= 0 instead of %g\n", ir->epsilon_r);
         CHECK(ir->epsilon_r < 0);
@@ -1180,9 +1182,14 @@ void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts,
 
     if (EEL_PME(ir->coulombtype) || EVDW_PME(ir->vdwtype))
     {
-        if (ir->pme_order < 3)
+        // TODO: Move these checks into the ewald module with the options class
+        int orderMin = 3;
+        int orderMax = (ir->coulombtype == eelP3M_AD ? 8 : 12);
+
+        if (ir->pme_order < orderMin || ir->pme_order > orderMax)
         {
-            warning_error(wi, "pme-order can not be smaller than 3");
+            sprintf(warn_buf, "With coulombtype = %s, you should have %d <= pme-order <= %d", eel_names[ir->coulombtype], orderMin, orderMax);
+            warning_error(wi, warn_buf);
         }
     }
 
@@ -1428,7 +1435,7 @@ int str_nelem(const char *str, int maxptr, char *ptr[])
         }
         ltrim(copy);
     }
-    if (ptr == NULL)
+    if (ptr == nullptr)
     {
         sfree(copy0);
     }
@@ -1645,8 +1652,8 @@ static void do_wall_params(t_inputrec *ir,
     char  *names[MAXPTR];
     double dbl;
 
-    opts->wall_atomtype[0] = NULL;
-    opts->wall_atomtype[1] = NULL;
+    opts->wall_atomtype[0] = nullptr;
+    opts->wall_atomtype[1] = nullptr;
 
     ir->wall_atomtype[0] = -1;
     ir->wall_atomtype[1] = -1;
@@ -1709,8 +1716,8 @@ static void add_wall_energrps(gmx_groups_t *groups, int nwall, t_symtab *symtab)
     }
 }
 
-void read_expandedparams(int *ninp_p, t_inpfile **inp_p,
-                         t_expanded *expand, warninp_t wi)
+static void read_expandedparams(int *ninp_p, t_inpfile **inp_p,
+                                t_expanded *expand, warninp_t wi)
 {
     int        ninp;
     t_inpfile *inp;
@@ -1762,9 +1769,53 @@ static gmx_bool couple_lambda_has_vdw_on(int couple_lambda_value)
             couple_lambda_value == ecouplamVDWQ);
 }
 
+namespace
+{
+
+class MdpErrorHandler : public gmx::IKeyValueTreeErrorHandler
+{
+    public:
+        explicit MdpErrorHandler(warninp_t wi)
+            : wi_(wi), mapping_(nullptr)
+        {
+        }
+
+        void setBackMapping(const gmx::IKeyValueTreeBackMapping &mapping)
+        {
+            mapping_ = &mapping;
+        }
+
+        virtual bool onError(gmx::UserInputError *ex, const gmx::KeyValueTreePath &context)
+        {
+            ex->prependContext(gmx::formatString("Error in mdp option \"%s\":",
+                                                 getOptionName(context).c_str()));
+            std::string message = gmx::formatExceptionMessageToString(*ex);
+            warning_error(wi_, message.c_str());
+            return true;
+        }
+
+    private:
+        std::string getOptionName(const gmx::KeyValueTreePath &context)
+        {
+            if (mapping_ != nullptr)
+            {
+                gmx::KeyValueTreePath path = mapping_->originalPath(context);
+                GMX_ASSERT(path.size() == 1, "Inconsistent mapping back to mdp options");
+                return path[0];
+            }
+            GMX_ASSERT(context.size() == 1, "Inconsistent context for mdp option parsing");
+            return context[0];
+        }
+
+        warninp_t                            wi_;
+        const gmx::IKeyValueTreeBackMapping *mapping_;
+};
+
+} // namespace
+
 void get_ir(const char *mdparin, const char *mdparout,
-            t_inputrec *ir, t_gromppopts *opts,
-            warninp_t wi)
+            gmx::MDModules *mdModules, t_inputrec *ir, t_gromppopts *opts,
+            WriteMdpHeader writeMdpHeader, warninp_t wi)
 {
     char       *dumstr[2];
     double      dumdub[2][6];
@@ -1776,7 +1827,8 @@ void get_ir(const char *mdparin, const char *mdparout,
     t_expanded *expand = ir->expandedvals;
 
     init_inputrec_strings();
-    inp = read_inpfile(mdparin, &ninp, wi);
+    gmx::TextInputFile stream(mdparin);
+    inp = read_inpfile(&stream, mdparin, &ninp, wi);
 
     snew(dumstr[0], STRLEN);
     snew(dumstr[1], STRLEN);
@@ -1831,9 +1883,9 @@ void get_ir(const char *mdparin, const char *mdparout,
     CCTYPE ("VARIOUS PREPROCESSING OPTIONS");
     CTYPE ("Preprocessor information: use cpp syntax.");
     CTYPE ("e.g.: -I/home/joe/doe -I/home/mary/roe");
-    STYPE ("include", opts->include,  NULL);
+    STYPE ("include", opts->include,  nullptr);
     CTYPE ("e.g.: -DPOSRES -DFLEXIBLE (note these variable names are case sensitive)");
-    STYPE ("define",  opts->define,   NULL);
+    STYPE ("define",  opts->define,   nullptr);
 
     CCTYPE ("RUN CONTROL PARAMETERS");
     EETYPE("integrator",  ir->eI,         ei_names);
@@ -1850,7 +1902,7 @@ void get_ir(const char *mdparin, const char *mdparout,
     CTYPE ("number of steps for center of mass motion removal");
     ITYPE ("nstcomm", ir->nstcomm,    100);
     CTYPE ("group(s) for center of mass motion removal");
-    STYPE ("comm-grps",   is->vcm,            NULL);
+    STYPE ("comm-grps",   is->vcm,            nullptr);
 
     CCTYPE ("LANGEVIN DYNAMICS OPTIONS");
     CTYPE ("Friction coefficient (amu/ps) and random seed");
@@ -1889,9 +1941,9 @@ void get_ir(const char *mdparin, const char *mdparout,
     CTYPE ("This selects the subset of atoms for the compressed");
     CTYPE ("trajectory file. You can select multiple groups. By");
     CTYPE ("default, all atoms will be written.");
-    STYPE ("compressed-x-grps", is->x_compressed_groups, NULL);
+    STYPE ("compressed-x-grps", is->x_compressed_groups, nullptr);
     CTYPE ("Selection of energy groups");
-    STYPE ("energygrps",  is->energy,         NULL);
+    STYPE ("energygrps",  is->energy,         nullptr);
 
     /* Neighbor searching */
     CCTYPE ("NEIGHBORSEARCHING PARAMETERS");
@@ -1933,7 +1985,7 @@ void get_ir(const char *mdparin, const char *mdparout,
     CTYPE ("Extension of the potential lookup tables beyond the cut-off");
     RTYPE ("table-extension", ir->tabext, 1.0);
     CTYPE ("Separate tables between energy group pairs");
-    STYPE ("energygrp-table", is->egptable,   NULL);
+    STYPE ("energygrp-table", is->egptable,   nullptr);
     CTYPE ("Spacing for the PME/PPPM FFT grid");
     RTYPE ("fourierspacing", ir->fourier_spacing, 0.12);
     CTYPE ("FFT grid size, when a value is 0 fourierspacing will be used");
@@ -1981,18 +2033,18 @@ void get_ir(const char *mdparin, const char *mdparout,
     ITYPE("nh-chain-length",     ir->opts.nhchainlength, 10);
     EETYPE("print-nose-hoover-chain-variables", ir->bPrintNHChains, yesno_names);
     CTYPE ("Groups to couple separately");
-    STYPE ("tc-grps",     is->tcgrps,         NULL);
+    STYPE ("tc-grps",     is->tcgrps,         nullptr);
     CTYPE ("Time constant (ps) and reference temperature (K)");
-    STYPE ("tau-t",   is->tau_t,      NULL);
-    STYPE ("ref-t",   is->ref_t,      NULL);
+    STYPE ("tau-t",   is->tau_t,      nullptr);
+    STYPE ("ref-t",   is->ref_t,      nullptr);
     CTYPE ("pressure coupling");
     EETYPE("pcoupl",  ir->epc,        epcoupl_names);
     EETYPE("pcoupltype",  ir->epct,       epcoupltype_names);
     ITYPE ("nstpcouple", ir->nstpcouple,  -1);
     CTYPE ("Time constant (ps), compressibility (1/bar) and reference P (bar)");
     RTYPE ("tau-p",   ir->tau_p,  1.0);
-    STYPE ("compressibility", dumstr[0],  NULL);
-    STYPE ("ref-p",       dumstr[1],      NULL);
+    STYPE ("compressibility", dumstr[0],  nullptr);
+    STYPE ("ref-p",       dumstr[1],      nullptr);
     CTYPE ("Scaling of reference coordinates, No, All or COM");
     EETYPE ("refcoord-scaling", ir->refcoord_scaling, erefscaling_names);
 
@@ -2000,41 +2052,41 @@ void get_ir(const char *mdparin, const char *mdparout,
     CCTYPE ("OPTIONS FOR QMMM calculations");
     EETYPE("QMMM", ir->bQMMM, yesno_names);
     CTYPE ("Groups treated Quantum Mechanically");
-    STYPE ("QMMM-grps",  is->QMMM,          NULL);
+    STYPE ("QMMM-grps",  is->QMMM,          nullptr);
     CTYPE ("QM method");
-    STYPE("QMmethod",     is->QMmethod, NULL);
+    STYPE("QMmethod",     is->QMmethod, nullptr);
     CTYPE ("QMMM scheme");
     EETYPE("QMMMscheme",  ir->QMMMscheme,    eQMMMscheme_names);
     CTYPE ("QM basisset");
-    STYPE("QMbasis",      is->QMbasis, NULL);
+    STYPE("QMbasis",      is->QMbasis, nullptr);
     CTYPE ("QM charge");
-    STYPE ("QMcharge",    is->QMcharge, NULL);
+    STYPE ("QMcharge",    is->QMcharge, nullptr);
     CTYPE ("QM multiplicity");
-    STYPE ("QMmult",      is->QMmult, NULL);
+    STYPE ("QMmult",      is->QMmult, nullptr);
     CTYPE ("Surface Hopping");
-    STYPE ("SH",          is->bSH, NULL);
+    STYPE ("SH",          is->bSH, nullptr);
     CTYPE ("CAS space options");
-    STYPE ("CASorbitals",      is->CASorbitals,   NULL);
-    STYPE ("CASelectrons",     is->CASelectrons,  NULL);
-    STYPE ("SAon", is->SAon, NULL);
-    STYPE ("SAoff", is->SAoff, NULL);
-    STYPE ("SAsteps", is->SAsteps, NULL);
+    STYPE ("CASorbitals",      is->CASorbitals,   nullptr);
+    STYPE ("CASelectrons",     is->CASelectrons,  nullptr);
+    STYPE ("SAon", is->SAon, nullptr);
+    STYPE ("SAoff", is->SAoff, nullptr);
+    STYPE ("SAsteps", is->SAsteps, nullptr);
     CTYPE ("Scale factor for MM charges");
     RTYPE ("MMChargeScaleFactor", ir->scalefactor, 1.0);
     CTYPE ("Optimization of QM subsystem");
-    STYPE ("bOPT",          is->bOPT, NULL);
-    STYPE ("bTS",          is->bTS, NULL);
+    STYPE ("bOPT",          is->bOPT, nullptr);
+    STYPE ("bTS",          is->bTS, nullptr);
 
     /* Simulated annealing */
     CCTYPE("SIMULATED ANNEALING");
     CTYPE ("Type of annealing for each temperature group (no/single/periodic)");
-    STYPE ("annealing",   is->anneal,      NULL);
+    STYPE ("annealing",   is->anneal,      nullptr);
     CTYPE ("Number of time points to use for specifying annealing in each group");
-    STYPE ("annealing-npoints", is->anneal_npoints, NULL);
+    STYPE ("annealing-npoints", is->anneal_npoints, nullptr);
     CTYPE ("List of times at the annealing points for each group");
-    STYPE ("annealing-time",       is->anneal_time,       NULL);
+    STYPE ("annealing-time",       is->anneal_time,       nullptr);
     CTYPE ("Temp. at each annealing point, for each group.");
-    STYPE ("annealing-temp",  is->anneal_temp,  NULL);
+    STYPE ("annealing-temp",  is->anneal_temp,  nullptr);
 
     /* Startup run */
     CCTYPE ("GENERATE VELOCITIES FOR STARTUP RUN");
@@ -2068,7 +2120,7 @@ void get_ir(const char *mdparin, const char *mdparout,
     /* Energy group exclusions */
     CCTYPE ("ENERGY GROUP EXCLUSIONS");
     CTYPE ("Pairs of energy groups for which all non-bonded interactions are excluded");
-    STYPE ("energygrp-excl", is->egpexcl,     NULL);
+    STYPE ("energygrp-excl", is->egpexcl,     nullptr);
 
     /* Walls */
     CCTYPE ("WALLS");
@@ -2076,8 +2128,8 @@ void get_ir(const char *mdparin, const char *mdparout,
     ITYPE ("nwall", ir->nwall, 0);
     EETYPE("wall-type",     ir->wall_type,   ewt_names);
     RTYPE ("wall-r-linpot", ir->wall_r_linpot, -1);
-    STYPE ("wall-atomtype", is->wall_atomtype, NULL);
-    STYPE ("wall-density",  is->wall_density,  NULL);
+    STYPE ("wall-atomtype", is->wall_atomtype, nullptr);
+    STYPE ("wall-density",  is->wall_density,  nullptr);
     RTYPE ("wall-ewald-zfac", ir->wall_ewald_zfac, 3);
 
     /* COM pulling */
@@ -2102,7 +2154,7 @@ void get_ir(const char *mdparin, const char *mdparout,
     /* Interactive MD */
     ir->bIMD = FALSE;
     CCTYPE("Group to display and/or manipulate in interactive MD session");
-    STYPE ("IMD-group", is->imd_grp, NULL);
+    STYPE ("IMD-group", is->imd_grp, nullptr);
     if (is->imd_grp[0] != '\0')
     {
         snew(ir->imd, 1);
@@ -2126,14 +2178,14 @@ void get_ir(const char *mdparin, const char *mdparout,
     CTYPE ("Orientation restraints force constant and tau for time averaging");
     RTYPE ("orire-fc",    ir->orires_fc,  0.0);
     RTYPE ("orire-tau",   ir->orires_tau, 0.0);
-    STYPE ("orire-fitgrp", is->orirefitgrp,    NULL);
+    STYPE ("orire-fitgrp", is->orirefitgrp,    nullptr);
     CTYPE ("Output frequency for trace(SD) and S to energy file");
     ITYPE ("nstorireout", ir->nstorireout, 100);
 
     /* free energy variables */
     CCTYPE ("Free energy variables");
     EETYPE("free-energy", ir->efep, efep_names);
-    STYPE ("couple-moltype",  is->couple_moltype,  NULL);
+    STYPE ("couple-moltype",  is->couple_moltype,  nullptr);
     EETYPE("couple-lambda0", opts->couple_lam0, couple_lam);
     EETYPE("couple-lambda1", opts->couple_lam1, couple_lam);
     EETYPE("couple-intramol", opts->bCoupleIntra, yesno_names);
@@ -2144,15 +2196,15 @@ void get_ir(const char *mdparin, const char *mdparout,
     ITYPE ("init-lambda-state", fep->init_fep_state, -1);
     RTYPE ("delta-lambda", fep->delta_lambda, 0.0);
     ITYPE ("nstdhdl", fep->nstdhdl, 50);
-    STYPE ("fep-lambdas", is->fep_lambda[efptFEP], NULL);
-    STYPE ("mass-lambdas", is->fep_lambda[efptMASS], NULL);
-    STYPE ("coul-lambdas", is->fep_lambda[efptCOUL], NULL);
-    STYPE ("vdw-lambdas", is->fep_lambda[efptVDW], NULL);
-    STYPE ("bonded-lambdas", is->fep_lambda[efptBONDED], NULL);
-    STYPE ("restraint-lambdas", is->fep_lambda[efptRESTRAINT], NULL);
-    STYPE ("temperature-lambdas", is->fep_lambda[efptTEMPERATURE], NULL);
+    STYPE ("fep-lambdas", is->fep_lambda[efptFEP], nullptr);
+    STYPE ("mass-lambdas", is->fep_lambda[efptMASS], nullptr);
+    STYPE ("coul-lambdas", is->fep_lambda[efptCOUL], nullptr);
+    STYPE ("vdw-lambdas", is->fep_lambda[efptVDW], nullptr);
+    STYPE ("bonded-lambdas", is->fep_lambda[efptBONDED], nullptr);
+    STYPE ("restraint-lambdas", is->fep_lambda[efptRESTRAINT], nullptr);
+    STYPE ("temperature-lambdas", is->fep_lambda[efptTEMPERATURE], nullptr);
     ITYPE ("calc-lambda-neighbors", fep->lambda_neighbors, 1);
-    STYPE ("init-lambda-weights", is->lambda_weights, NULL);
+    STYPE ("init-lambda-weights", is->lambda_weights, nullptr);
     EETYPE("dhdl-print-energy", fep->edHdLPrintEnergy, edHdLPrintEnergy_names);
     RTYPE ("sc-alpha", fep->sc_alpha, 0.0);
     ITYPE ("sc-power", fep->sc_power, 1);
@@ -2169,12 +2221,12 @@ void get_ir(const char *mdparin, const char *mdparout,
 
     /* Non-equilibrium MD stuff */
     CCTYPE("Non-equilibrium MD stuff");
-    STYPE ("acc-grps",    is->accgrps,        NULL);
-    STYPE ("accelerate",  is->acc,            NULL);
-    STYPE ("freezegrps",  is->freeze,         NULL);
-    STYPE ("freezedim",   is->frdim,          NULL);
+    STYPE ("acc-grps",    is->accgrps,        nullptr);
+    STYPE ("accelerate",  is->acc,            nullptr);
+    STYPE ("freezegrps",  is->freeze,         nullptr);
+    STYPE ("freezedim",   is->frdim,          nullptr);
     RTYPE ("cos-acceleration", ir->cos_accel, 0);
-    STYPE ("deform",      is->deform,         NULL);
+    STYPE ("deform",      is->deform,         nullptr);
 
     /* simulated tempering variables */
     CCTYPE("simulated tempering variables");
@@ -2190,18 +2242,25 @@ void get_ir(const char *mdparin, const char *mdparout,
     }
 
     /* Electric fields */
-    CCTYPE("Electric fields");
-    CTYPE ("Format is number of terms (int) and for all terms an amplitude (real)");
-    CTYPE ("and a phase angle (real)");
-    STYPE ("E-x",     is->efield_x,   NULL);
-    CTYPE ("Time dependent (pulsed) electric field. Format is omega, time for pulse");
-    CTYPE ("peak, and sigma (width) for pulse. Sigma = 0 removes pulse, leaving");
-    CTYPE ("the field to be a cosine function.");
-    STYPE ("E-xt",    is->efield_xt,  NULL);
-    STYPE ("E-y",     is->efield_y,   NULL);
-    STYPE ("E-yt",    is->efield_yt,  NULL);
-    STYPE ("E-z",     is->efield_z,   NULL);
-    STYPE ("E-zt",    is->efield_zt,  NULL);
+    {
+        gmx::KeyValueTreeObject      convertedValues = flatKeyValueTreeFromInpFile(ninp, inp);
+        gmx::KeyValueTreeTransformer transform;
+        transform.rules()->addRule()
+            .keyMatchType("/", gmx::StringCompareType::CaseAndDashInsensitive);
+        mdModules->initMdpTransform(transform.rules());
+        for (const auto &path : transform.mappedPaths())
+        {
+            GMX_ASSERT(path.size() == 1, "Inconsistent mapping back to mdp options");
+            mark_einp_set(ninp, inp, path[0].c_str());
+        }
+        MdpErrorHandler              errorHandler(wi);
+        auto                         result
+                   = transform.transform(convertedValues, &errorHandler);
+        ir->params = new gmx::KeyValueTreeObject(result.object());
+        mdModules->adjustInputrecBasedOnModules(ir);
+        errorHandler.setBackMapping(result.backMapping());
+        mdModules->assignOptionsToModules(*ir->params, &errorHandler);
+    }
 
     /* Ion/water position swapping ("computational electrophysiology") */
     CCTYPE("Ion/water position swapping for computational electrophysiology setups");
@@ -2229,14 +2288,14 @@ void get_ir(const char *mdparin, const char *mdparout,
             snew(ir->swap->grp[i].molname, STRLEN);
         }
         CTYPE("Two index groups that contain the compartment-partitioning atoms");
-        STYPE("split-group0", ir->swap->grp[eGrpSplit0].molname, NULL);
-        STYPE("split-group1", ir->swap->grp[eGrpSplit1].molname, NULL);
+        STYPE("split-group0", ir->swap->grp[eGrpSplit0].molname, nullptr);
+        STYPE("split-group1", ir->swap->grp[eGrpSplit1].molname, nullptr);
         CTYPE("Use center of mass of split groups (yes/no), otherwise center of geometry is used");
         EETYPE("massw-split0", ir->swap->massw_split[0], yesno_names);
         EETYPE("massw-split1", ir->swap->massw_split[1], yesno_names);
 
         CTYPE("Name of solvent molecules");
-        STYPE("solvent-group", ir->swap->grp[eGrpSolvent].molname, NULL);
+        STYPE("solvent-group", ir->swap->grp[eGrpSolvent].molname, nullptr);
 
         CTYPE("Split cylinder: radius, upper and lower extension (nm) (this will define the channels)");
         CTYPE("Note that the split cylinder settings do not have an influence on the swapping protocol,");
@@ -2259,7 +2318,7 @@ void get_ir(const char *mdparin, const char *mdparout,
             int ig = eSwapFixedGrpNR + i;
 
             sprintf(buf, "iontype%d-name", i);
-            STYPE(buf, ir->swap->grp[ig].molname, NULL);
+            STYPE(buf, ir->swap->grp[ig].molname, nullptr);
             sprintf(buf, "iontype%d-in-A", i);
             ITYPE(buf, ir->swap->grp[ig].nmolReq[0], -1);
             sprintf(buf, "iontype%d-in-B", i);
@@ -2287,8 +2346,8 @@ void get_ir(const char *mdparin, const char *mdparout,
 
     /* User defined thingies */
     CCTYPE ("User defined thingies");
-    STYPE ("user1-grps",  is->user1,          NULL);
-    STYPE ("user2-grps",  is->user2,          NULL);
+    STYPE ("user1-grps",  is->user1,          nullptr);
+    STYPE ("user2-grps",  is->user2,          nullptr);
     ITYPE ("userint1",    ir->userint1,   0);
     ITYPE ("userint2",    ir->userint2,   0);
     ITYPE ("userint3",    ir->userint3,   0);
@@ -2299,7 +2358,21 @@ void get_ir(const char *mdparin, const char *mdparout,
     RTYPE ("userreal4",   ir->userreal4,  0);
 #undef CTYPE
 
-    write_inpfile(mdparout, ninp, inp, FALSE, wi);
+    {
+        gmx::TextOutputFile stream(mdparout);
+        write_inpfile(&stream, mdparout, ninp, inp, FALSE, writeMdpHeader, wi);
+
+        // Transform module data into a flat key-value tree for output.
+        gmx::KeyValueTreeBuilder       builder;
+        gmx::KeyValueTreeObjectBuilder builderObject = builder.rootObject();
+        mdModules->buildMdpOutput(&builderObject);
+        {
+            gmx::TextWriter writer(&stream);
+            writeKeyValueTreeAsMdp(&writer, builder.build());
+        }
+        stream.close();
+    }
+
     for (i = 0; (i < ninp); i++)
     {
         sfree(inp[i].name);
@@ -2381,7 +2454,7 @@ void get_ir(const char *mdparin, const char *mdparout,
         ir->nstcomm = 0;
     }
 
-    opts->couple_moltype = NULL;
+    opts->couple_moltype = nullptr;
     if (strlen(is->couple_moltype) > 0)
     {
         if (ir->efep != efepNO)
@@ -2470,7 +2543,7 @@ void get_ir(const char *mdparin, const char *mdparout,
 
     /* ORIENTATION RESTRAINT PARAMETERS */
 
-    if (opts->bOrire && str_nelem(is->orirefitgrp, MAXPTR, NULL) != 1)
+    if (opts->bOrire && str_nelem(is->orirefitgrp, MAXPTR, nullptr) != 1)
     {
         warning_error(wi, "ERROR: Need one orientation restraint fit group\n");
     }
@@ -2722,7 +2795,7 @@ static gmx_bool do_numbering(int natoms, gmx_groups_t *groups, int ng, char *ptr
     {
         /* All atoms are part of one (or no) group, no index required */
         groups->ngrpnr[gtype] = 0;
-        groups->grpnr[gtype]  = NULL;
+        groups->grpnr[gtype]  = nullptr;
     }
     else
     {
@@ -2750,7 +2823,6 @@ static void calc_nrdf(gmx_mtop_t *mtop, t_inputrec *ir, char **gnames)
     double                 *nrdf_tc, *nrdf_vcm, nrdf_uc, *nrdf_vcm_sub;
     ivec                   *dof_vcm;
     gmx_mtop_atomloop_all_t aloop;
-    t_atom                 *atom;
     int                     mb, mol, ftype, as;
     gmx_molblock_t         *molb;
     gmx_moltype_t          *molt;
@@ -2791,6 +2863,7 @@ static void calc_nrdf(gmx_mtop_t *mtop, t_inputrec *ir, char **gnames)
 
     snew(nrdf2, natoms);
     aloop = gmx_mtop_atomloop_all_init(mtop);
+    const t_atom *atom;
     while (gmx_mtop_atomloop_all_next(aloop, &i, &atom))
     {
         nrdf2[i] = 0;
@@ -3025,54 +3098,6 @@ static void calc_nrdf(gmx_mtop_t *mtop, t_inputrec *ir, char **gnames)
     sfree(nrdf_vcm_sub);
 }
 
-static void decode_cos(char *s, t_cosines *cosine)
-{
-    char              *t;
-    char               format[STRLEN], f1[STRLEN];
-    double             a, phi;
-    int                i;
-
-    t = gmx_strdup(s);
-    trim(t);
-
-    cosine->n   = 0;
-    cosine->a   = NULL;
-    cosine->phi = NULL;
-    if (strlen(t))
-    {
-        if (sscanf(t, "%d", &(cosine->n)) != 1)
-        {
-            gmx_fatal(FARGS, "Cannot parse cosine multiplicity from string '%s'", t);
-        }
-        if (cosine->n <= 0)
-        {
-            cosine->n = 0;
-        }
-        else
-        {
-            snew(cosine->a, cosine->n);
-            snew(cosine->phi, cosine->n);
-
-            sprintf(format, "%%*d");
-            for (i = 0; (i < cosine->n); i++)
-            {
-                double  gmx_unused canary;
-
-                strcpy(f1, format);
-                strcat(f1, "%lf%lf%lf");
-                if (sscanf(t, f1, &a, &phi, &canary) != 2)
-                {
-                    gmx_fatal(FARGS, "Invalid input for electric field shift: '%s'", t);
-                }
-                cosine->a[i]   = a;
-                cosine->phi[i] = phi;
-                strcat(format, "%*lf%*lf");
-            }
-        }
-    }
-    sfree(t);
-}
-
 static gmx_bool do_egp_flag(t_inputrec *ir, gmx_groups_t *groups,
                             const char *option, const char *val, int flag)
 {
@@ -3172,7 +3197,7 @@ static void make_swap_groups(
 }
 
 
-void make_IMD_group(t_IMD *IMDgroup, char *IMDgname, t_blocka *grps, char **gnames)
+static void make_IMD_group(t_IMD *IMDgroup, char *IMDgname, t_blocka *grps, char **gnames)
 {
     int      ig, i;
 
@@ -3220,7 +3245,7 @@ void do_index(const char* mdparin, const char *ndx,
     {
         fprintf(stderr, "processing index file...\n");
     }
-    if (ndx == NULL)
+    if (ndx == nullptr)
     {
         snew(grps, 1);
         snew(grps->index, 1);
@@ -3398,8 +3423,8 @@ void do_index(const char* mdparin, const char *ndx,
         {
             ir->opts.annealing[i]      = eannNO;
             ir->opts.anneal_npoints[i] = 0;
-            ir->opts.anneal_time[i]    = NULL;
-            ir->opts.anneal_temp[i]    = NULL;
+            ir->opts.anneal_time[i]    = nullptr;
+            ir->opts.anneal_temp[i]    = nullptr;
         }
         if (nSA > 0)
         {
@@ -3791,13 +3816,6 @@ void do_index(const char* mdparin, const char *ndx,
         gmx_fatal(FARGS, "Can only have energy group pair tables in combination with user tables for VdW and/or Coulomb");
     }
 
-    decode_cos(is->efield_x, &(ir->ex[XX]));
-    decode_cos(is->efield_xt, &(ir->et[XX]));
-    decode_cos(is->efield_y, &(ir->ex[YY]));
-    decode_cos(is->efield_yt, &(ir->et[YY]));
-    decode_cos(is->efield_z, &(ir->ex[ZZ]));
-    decode_cos(is->efield_zt, &(ir->et[ZZ]));
-
     for (i = 0; (i < grps->nr); i++)
     {
         sfree(gnames[i]);
@@ -3959,7 +3977,7 @@ check_combination_rule_differences(const gmx_mtop_t *mtop, int state,
      */
     tol = 1e-5;
     ptr = getenv("GMX_LJCOMB_TOL");
-    if (ptr != NULL)
+    if (ptr != nullptr)
     {
         double            dbl;
         double gmx_unused canary;
@@ -4077,7 +4095,6 @@ void triple_check(const char *mdparin, t_inputrec *ir, gmx_mtop_t *sys,
     rvec                      acc;
     gmx_mtop_atomloop_block_t aloopb;
     gmx_mtop_atomloop_all_t   aloop;
-    t_atom                   *atom;
     ivec                      AbsRef;
     char                      warn_buf[STRLEN];
 
@@ -4174,6 +4191,7 @@ void triple_check(const char *mdparin, t_inputrec *ir, gmx_mtop_t *sys,
 
     bCharge = FALSE;
     aloopb  = gmx_mtop_atomloop_block_init(sys);
+    const t_atom *atom;
     while (gmx_mtop_atomloop_block_next(aloopb, &atom, &nmol))
     {
         if (atom->q != 0 || atom->qB != 0)
@@ -4242,6 +4260,7 @@ void triple_check(const char *mdparin, t_inputrec *ir, gmx_mtop_t *sys,
         clear_rvec(acc);
         snew(mgrp, sys->groups.grps[egcACC].nr);
         aloop = gmx_mtop_atomloop_all_init(sys);
+        const t_atom *atom;
         while (gmx_mtop_atomloop_all_next(aloop, &i, &atom))
         {
             mgrp[ggrpnr(&sys->groups, egcACC, i)] += atom->m;
index 3552fea317a4b0aef54ecc51e766eb1870954e95..88f04363007803a57b4a15ebf8c1204c466f3b97 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,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.
 #include "gromacs/fileio/readinp.h"
 #include "gromacs/gmxpreprocess/grompp-impl.h"
 
+namespace gmx
+{
+class MDModules;
+}
+
 struct gmx_groups_t;
 struct gmx_mtop_t;
 struct gmx_output_env_t;
 struct pull_params_t;
 struct pull_t;
 struct t_grpopts;
+struct t_inpfile;
 struct t_inputrec;
 struct t_rot;
+struct warninp;
+typedef warninp *warninp_t;
 
 enum {
     eshNONE, eshHBONDS, eshALLBONDS, eshHANGLES, eshALLANGLES, eshNR
@@ -58,7 +66,8 @@ enum {
     ecouplamVDWQ, ecouplamVDW, ecouplamQ, ecouplamNONE, ecouplamNR
 };
 
-typedef struct {
+struct t_gromppopts
+{
     int      warnings;
     int      nshake;
     char    *include;
@@ -74,7 +83,7 @@ typedef struct {
     int      couple_lam0;
     int      couple_lam1;
     gmx_bool bCoupleIntra;
-} t_gromppopts;
+};
 
 /*! \brief Initialise object to hold strings parsed from an .mdp file */
 void init_inputrec_strings();
@@ -82,9 +91,6 @@ void init_inputrec_strings();
 /*! \brief Clean up object that holds strings parsed from an .mdp file */
 void done_inputrec_strings();
 
-void init_ir(t_inputrec *ir, t_gromppopts *opts);
-/* Initiate stuff */
-
 void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts,
               warninp_t wi);
 /* Validate inputrec data.
@@ -109,8 +115,8 @@ void check_chargegroup_radii(const gmx_mtop_t *mtop, const t_inputrec *ir,
 /* Even more checks, charge group radii vs. cut-off's only. */
 
 void get_ir(const char *mdparin, const char *mdparout,
-            t_inputrec *ir, t_gromppopts *opts,
-            warninp_t wi);
+            gmx::MDModules *mdModules, t_inputrec *ir, t_gromppopts *opts,
+            WriteMdpHeader writeMdpHeader, warninp_t wi);
 /* Read the input file, and retrieve data for inputrec.
  * More data are read, but the are only evaluated when the next
  * function is called. Also prints the input file back to mdparout.
index e49696700de5adbd41065207a169289546fd78b2..96bcf9fb5c6b84c19243734eda70d4a4cae5a5b4 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,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.
 #include <string.h>
 
 #include "gromacs/fileio/readinp.h"
+#include "gromacs/fileio/warninp.h"
 #include "gromacs/gmxpreprocess/readir.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/mdatoms.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/mdtypes/pull-params.h"
@@ -362,7 +364,7 @@ char **read_pullparams(int *ninp_p, t_inpfile **inp_p,
         {
             sprintf(wbuf, "%s should contain %d pull group indices with geometry %s",
                     buf, pcrd->ngroup, epullg_names[pcrd->eGeom]);
-            set_warning_line(wi, NULL, -1);
+            set_warning_line(wi, nullptr, -1);
             warning_error(wi, wbuf);
         }
         for (int g = 0; g < pcrd->ngroup; g++)
@@ -512,9 +514,9 @@ pull_t *set_pull_init(t_inputrec *ir, const gmx_mtop_t *mtop,
     double         t_start;
 
     pull      = ir->pull;
-    pull_work = init_pull(NULL, pull, ir, 0, NULL, mtop, NULL, oenv, lambda, FALSE, 0);
-    md        = init_mdatoms(NULL, mtop, ir->efep);
-    atoms2md(mtop, ir, 0, NULL, mtop->natoms, md);
+    pull_work = init_pull(nullptr, pull, ir, 0, nullptr, mtop, nullptr, oenv, lambda, FALSE, ContinuationOptions());
+    md        = init_mdatoms(nullptr, mtop, ir->efep);
+    atoms2md(mtop, ir, -1, nullptr, mtop->natoms, md);
     if (ir->efep)
     {
         update_mdatoms(md, lambda);
@@ -524,7 +526,7 @@ pull_t *set_pull_init(t_inputrec *ir, const gmx_mtop_t *mtop,
 
     t_start = ir->init_t + ir->init_step*ir->delta_t;
 
-    pull_calc_coms(NULL, pull_work, md, &pbc, t_start, x, NULL);
+    pull_calc_coms(nullptr, pull_work, md, &pbc, t_start, x, nullptr);
 
     fprintf(stderr, "Pull group  natoms  pbc atom  distance at start  reference at t=0\n");
     for (c = 0; c < pull->ncoord; c++)
index c144c7d2b83fa61adc50781925a851b3558b90a5..e92b8e45a34c38308454f303aaf8b4b93fe28fc3 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,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.
  */
 #include "gmxpre.h"
 
+#include "gromacs/fileio/readinp.h"
 #include "gromacs/fileio/trrio.h"
+#include "gromacs/fileio/warninp.h"
 #include "gromacs/gmxpreprocess/readir.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/math/vecdump.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/topology/block.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
@@ -283,7 +286,7 @@ extern void set_reference_positions(
                 gmx_fatal(FARGS, "Number of atoms in file %s (%d) does not match the number of atoms in rotation group (%d)!\n",
                           reffile, header.natoms, rotg->nat);
             }
-            gmx_trr_read_single_frame(reffile, &header.step, &header.t, &header.lambda, f_box, &header.natoms, rotg->x_ref, NULL, NULL);
+            gmx_trr_read_single_frame(reffile, &header.step, &header.t, &header.lambda, f_box, &header.natoms, rotg->x_ref, nullptr, nullptr);
 
             /* Check whether the box is unchanged and output a warning if not: */
             check_box_unchanged(f_box, box, reffile, wi);
@@ -296,7 +299,7 @@ extern void set_reference_positions(
                 ii = rotg->ind[i];
                 copy_rvec(x[ii], rotg->x_ref[i]);
             }
-            gmx_trr_write_single_frame(reffile, g, 0.0, 0.0, box, rotg->nat, rotg->x_ref, NULL, NULL);
+            gmx_trr_write_single_frame(reffile, g, 0.0, 0.0, box, rotg->nat, rotg->x_ref, nullptr, nullptr);
         }
     }
 }
index 3e121c8078bbbf8c0cccbc72d7bcc652ad2f7f88..689eae682f8b61b5e6c052289527eb5c57e85f07 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,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.
@@ -79,7 +79,7 @@ gpp_atomtype_t read_atype(const char *ffdir, t_symtab *tab)
             /* Skip blank or comment-only lines */
             do
             {
-                if (fgets2(buf, STRLEN, in) != NULL)
+                if (fgets2(buf, STRLEN, in) != nullptr)
                 {
                     strip_comment(buf);
                     trim(buf);
@@ -122,7 +122,7 @@ static void print_resatoms(FILE *out, gpp_atomtype_t atype, t_restp *rtp)
     {
         tp   = rtp->atom[j].type;
         tpnm = get_atomtype_name(tp, atype);
-        if (tpnm == NULL)
+        if (tpnm == nullptr)
         {
             gmx_fatal(FARGS, "Incorrect atomtype (%d)", tp);
         }
@@ -140,11 +140,11 @@ static gmx_bool read_atoms(FILE *in, char *line,
 
     /* Read Atoms */
     maxentries   = 0;
-    r0->atom     =     NULL;
-    r0->atomname = NULL;
-    r0->cgnr     =     NULL;
+    r0->atom     =     nullptr;
+    r0->atomname = nullptr;
+    r0->cgnr     =     nullptr;
     i            = 0;
-    while (get_a_line(in, line, STRLEN) && (strchr(line, '[') == NULL))
+    while (get_a_line(in, line, STRLEN) && (strchr(line, '[') == nullptr))
     {
         if (sscanf(line, "%s%s%lf%d", buf, buf1, &q, &cg) != 4)
         {
@@ -178,13 +178,13 @@ static gmx_bool read_atoms(FILE *in, char *line,
     return TRUE;
 }
 
-gmx_bool read_bondeds(int bt, FILE *in, char *line, t_restp *rtp)
+static gmx_bool read_bondeds(int bt, FILE *in, char *line, t_restp *rtp)
 {
     char str[STRLEN];
     int  j, n, ni, maxrb;
 
     maxrb = rtp->rb[bt].nb;
-    while (get_a_line(in, line, STRLEN) && (strchr(line, '[') == NULL))
+    while (get_a_line(in, line, STRLEN) && (strchr(line, '[') == nullptr))
     {
         if (rtp->rb[bt].nb >= maxrb)
         {
@@ -206,7 +206,7 @@ gmx_bool read_bondeds(int bt, FILE *in, char *line, t_restp *rtp)
         }
         for (; j < MAXATOMLIST; j++)
         {
-            rtp->rb[bt].b[rtp->rb[bt].nb].a[j] = NULL;
+            rtp->rb[bt].b[rtp->rb[bt].nb].a[j] = nullptr;
         }
         while (isspace(line[n]))
         {
@@ -260,17 +260,7 @@ static void check_rtp(int nrtp, t_restp rtp[], char *libfn)
     }
 }
 
-static int comprtp(const void *a, const void *b)
-{
-    t_restp *ra, *rb;
-
-    ra = (t_restp *)a;
-    rb = (t_restp *)b;
-
-    return gmx_strcasecmp(ra->resname, rb->resname);
-}
-
-int get_bt(char* header)
+static int get_bt(char* header)
 {
     int i;
 
@@ -284,13 +274,13 @@ int get_bt(char* header)
     return NOTSET;
 }
 
-void clear_t_restp(t_restp *rrtp)
+static void clear_t_restp(t_restp *rrtp)
 {
     memset((void *)rrtp, 0, sizeof(t_restp));
 }
 
 /* print all the ebtsNR type numbers */
-void print_resall_header(FILE *out, t_restp rtp[])
+static void print_resall_header(FILE *out, t_restp rtp[])
 {
     fprintf(out, "[ bondedtypes ]\n");
     fprintf(out, "; bonds  angles  dihedrals  impropers all_dihedrals nr_exclusions  HH14  remove_dih\n");
@@ -551,7 +541,7 @@ void read_resall(char *rrdb, int *nrtpptr, t_restp **rtp,
     srenew(rrtp, nrtp);
 
     fprintf(stderr, "\nSorting it all out...\n");
-    qsort(rrtp, nrtp, (size_t)sizeof(rrtp[0]), comprtp);
+    std::sort(rrtp, rrtp+nrtp, [](const t_restp &a, const t_restp &b) {return gmx_strcasecmp(a.resname, b.resname) < 0; });
 
     check_rtp(nrtp, rrtp, rrdb);
 
index 601f1f841d0ee5192eb3fdb222dceef70d3be84f..1a73fe22afcc3cfbd27a6702540129c7ab439d5e 100644 (file)
@@ -51,6 +51,7 @@
 #include "gromacs/math/functions.h"
 #include "gromacs/math/units.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/boxutilities.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/selection/nbsearch.h"
 #include "gromacs/topology/atomprop.h"
@@ -74,16 +75,19 @@ typedef struct {
     int   res0;
 } t_moltypes;
 
-static void sort_molecule(t_atoms *atoms, std::vector<RVec> *x,
+static void sort_molecule(t_atoms **atoms_solvt, std::vector<RVec> *x,
                           std::vector<RVec> *v)
 {
     int         atnr, i, j, moltp = 0, nrmoltypes, resi_o, resi_n, resnr;
     t_moltypes *moltypes;
+    t_atoms    *atoms, *newatoms;
 
     fprintf(stderr, "Sorting configuration\n");
 
-    /* copy each residue from atoms to a molecule in *molecule */
-    moltypes   = NULL;
+    atoms = *atoms_solvt;
+
+    /* copy each residue from *atoms to a molecule in *molecule */
+    moltypes   = nullptr;
     nrmoltypes = 0;
     for (i = 0; i < atoms->nr; i++)
     {
@@ -149,11 +153,10 @@ static void sort_molecule(t_atoms *atoms, std::vector<RVec> *x,
         }
 
         /* now put them there: */
-        t_atoms *newatoms;
         snew(newatoms, 1);
         init_t_atoms(newatoms, atoms->nr, FALSE);
         newatoms->nres = atoms->nres;
-        srenew(newatoms->resinfo, atoms->nres);
+        snew(newatoms->resinfo, atoms->nres);
         std::vector<RVec> newx(x->size());
         std::vector<RVec> newv(v->size());
 
@@ -206,8 +209,8 @@ static void sort_molecule(t_atoms *atoms, std::vector<RVec> *x,
         sfree(atoms->atomname);
         sfree(atoms->resinfo);
         sfree(atoms->atom);
-        *atoms = *newatoms;
-        sfree(newatoms);
+        sfree(atoms);
+        *atoms_solvt = newatoms;
         std::swap(*x, newx);
         std::swap(*v, newv);
     }
@@ -309,7 +312,7 @@ static void replicateSolventBox(t_atoms *atoms, std::vector<RVec> *x,
     // but not in all).
     t_atoms           newAtoms;
     init_t_atoms(&newAtoms, 0, FALSE);
-    gmx::AtomsBuilder builder(&newAtoms, NULL);
+    gmx::AtomsBuilder builder(&newAtoms, nullptr);
     builder.reserve(atoms->nr * nmol, atoms->nres * nmol);
     std::vector<RVec> newX(atoms->nr * nmol);
     std::vector<RVec> newV(!v->empty() ? atoms->nr * nmol : 0);
@@ -372,13 +375,11 @@ static void replicateSolventBox(t_atoms *atoms, std::vector<RVec> *x,
     sfree(atoms->atom);
     sfree(atoms->atomname);
     sfree(atoms->resinfo);
-    sfree(atoms->pdbinfo);
     atoms->nr       = newAtoms.nr;
     atoms->nres     = newAtoms.nres;
     atoms->atom     = newAtoms.atom;
     atoms->atomname = newAtoms.atomname;
     atoms->resinfo  = newAtoms.resinfo;
-    atoms->pdbinfo  = newAtoms.pdbinfo;
 
     newX.resize(atoms->nr);
     std::swap(*x, newX);
@@ -651,7 +652,7 @@ static void add_solv(const char *fn, t_topology *top,
 
     char             *filename = gmxlibfn(fn);
     snew(top_solvt, 1);
-    readConformation(filename, top_solvt, &x_solvt, !v->empty() ? &v_solvt : NULL,
+    readConformation(filename, top_solvt, &x_solvt, !v->empty() ? &v_solvt : nullptr,
                      &ePBC_solvt, box_solvt, "solvent");
     t_atoms *atoms_solvt = &top_solvt->atoms;
     if (0 == atoms_solvt->nr)
@@ -661,9 +662,6 @@ static void add_solv(const char *fn, t_topology *top,
     sfree(filename);
     fprintf(stderr, "\n");
 
-    /* apply pbc for solvent configuration for whole molecules */
-    rm_res_pbc(atoms_solvt, &x_solvt, box_solvt);
-
     /* initialise distance arrays for solvent configuration */
     fprintf(stderr, "Initialising inter-atomic distances...\n");
     const std::vector<real> exclusionDistances(
@@ -675,11 +673,21 @@ static void add_solv(const char *fn, t_topology *top,
     fprintf(stderr, "Generating solvent configuration\n");
     t_pbc pbc;
     set_pbc(&pbc, ePBC, box);
-    replicateSolventBox(atoms_solvt, &x_solvt, &v_solvt, &exclusionDistances_solvt,
-                        box_solvt, box);
-    if (ePBC != epbcNONE)
+    if (!gmx::boxesAreEqual(box_solvt, box))
     {
-        removeSolventBoxOverlap(atoms_solvt, &x_solvt, &v_solvt, &exclusionDistances_solvt, pbc);
+        if (TRICLINIC(box_solvt))
+        {
+            gmx_fatal(FARGS, "Generating from non-rectangular solvent boxes is currently not supported.\n"
+                      "You can try to pass the same box for -cp and -cs.");
+        }
+        /* apply pbc for solvent configuration for whole molecules */
+        rm_res_pbc(atoms_solvt, &x_solvt, box_solvt);
+        replicateSolventBox(atoms_solvt, &x_solvt, &v_solvt, &exclusionDistances_solvt,
+                            box_solvt, box);
+        if (ePBC != epbcNONE)
+        {
+            removeSolventBoxOverlap(atoms_solvt, &x_solvt, &v_solvt, &exclusionDistances_solvt, pbc);
+        }
     }
     if (top->atoms.nr > 0)
     {
@@ -700,7 +708,7 @@ static void add_solv(const char *fn, t_topology *top,
     }
 
     /* Sort the solvent mixture, not the protein... */
-    sort_molecule(atoms_solvt, &x_solvt, &v_solvt);
+    sort_molecule(&atoms_solvt, &x_solvt, &v_solvt);
 
     // Merge the two configurations.
     x->insert(x->end(), x_solvt.begin(), x_solvt.end());
@@ -774,7 +782,7 @@ static void update_top(t_atoms *atoms, matrix box, int NFILE, t_filenm fnm[],
             bSkip = FALSE;
             line++;
             strcpy(buf2, buf);
-            if ((temp = strchr(buf2, '\n')) != NULL)
+            if ((temp = strchr(buf2, '\n')) != nullptr)
             {
                 temp[0] = '\0';
             }
@@ -782,7 +790,7 @@ static void update_top(t_atoms *atoms, matrix box, int NFILE, t_filenm fnm[],
             if (buf2[0] == '[')
             {
                 buf2[0] = ' ';
-                if ((temp = strchr(buf2, '\n')) != NULL)
+                if ((temp = strchr(buf2, '\n')) != nullptr)
                 {
                     temp[0] = '\0';
                 }
@@ -823,7 +831,7 @@ static void update_top(t_atoms *atoms, matrix box, int NFILE, t_filenm fnm[],
             }
             if (bSkip)
             {
-                if ((temp = strchr(buf, '\n')) != NULL)
+                if ((temp = strchr(buf, '\n')) != nullptr)
                 {
                     temp[0] = '\0';
                 }
@@ -920,15 +928,15 @@ int gmx_solvate(int argc, char *argv[])
     t_filenm    fnm[] = {
         { efSTX, "-cp", "protein", ffOPTRD },
         { efSTX, "-cs", "spc216",  ffLIBRD},
-        { efSTO, NULL,  NULL,      ffWRITE},
-        { efTOP, NULL,  NULL,      ffOPTRW},
+        { efSTO, nullptr,  nullptr,      ffWRITE},
+        { efTOP, nullptr,  nullptr,      ffOPTRW},
     };
 #define NFILE asize(fnm)
 
-    static real       defaultDistance = 0.105, r_shell = 0, scaleFactor = 0.57;
-    static rvec       new_box         = {0.0, 0.0, 0.0};
-    static gmx_bool   bReadV          = FALSE;
-    static int        max_sol         = 0;
+    real              defaultDistance = 0.105, r_shell = 0, scaleFactor = 0.57;
+    rvec              new_box         = {0.0, 0.0, 0.0};
+    gmx_bool          bReadV          = FALSE;
+    int               max_sol         = 0;
     gmx_output_env_t *oenv;
     t_pargs           pa[]              = {
         { "-box",    FALSE, etRVEC, {new_box},
@@ -972,7 +980,7 @@ int gmx_solvate(int argc, char *argv[])
         /* Generate a solute configuration */
         conf_prot = opt2fn("-cp", NFILE, fnm);
         readConformation(conf_prot, top, &x,
-                         bReadV ? &v : NULL, &ePBC, box, "solute");
+                         bReadV ? &v : nullptr, &ePBC, box, "solute");
         if (bReadV && v.empty())
         {
             fprintf(stderr, "Note: no velocities found\n");
@@ -1005,7 +1013,7 @@ int gmx_solvate(int argc, char *argv[])
     fprintf(stderr, "Writing generated configuration to %s\n", confout);
     const char *outputTitle = (bProt ? *top->name : "Generated by gmx solvate");
     write_sto_conf(confout, outputTitle, &top->atoms, as_rvec_array(x.data()),
-                   !v.empty() ? as_rvec_array(v.data()) : NULL, ePBC, box);
+                   !v.empty() ? as_rvec_array(v.data()) : nullptr, ePBC, box);
 
     /* print size of generated configuration */
     fprintf(stderr, "\nOutput configuration contains %d atoms in %d residues\n",
index 74145c5cd244299318a357287c7716edebd75fed..912c9e38bec8b5bd87af0e95fa446eb0c25afcc5 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,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.
@@ -70,7 +70,7 @@ t_specbond *get_specbonds(int *nspecbond)
 {
     const char  *sbfile = "specbond.dat";
 
-    t_specbond  *sb = NULL;
+    t_specbond  *sb = nullptr;
     char         r1buf[32], r2buf[32], a1buf[32], a2buf[32], nr1buf[32], nr2buf[32];
     double       length;
     int          nb1, nb2;
@@ -226,8 +226,8 @@ static void rename_1res(t_atoms *pdba, int resind, char *newres, gmx_bool bVerbo
 int mk_specbonds(t_atoms *pdba, rvec x[], gmx_bool bInteractive,
                  t_ssbond **specbonds, gmx_bool bVerbose)
 {
-    t_specbond *sb    = NULL;
-    t_ssbond   *bonds = NULL;
+    t_specbond *sb    = nullptr;
+    t_ssbond   *bonds = nullptr;
     int         nsb;
     int         nspec, nbonds;
     int        *specp, *sgp;
index 08643245516406d5b46c9c8561913acbbb4f0c8d..079726dc03d044d545a0bcd9bbc5d12daaa42d0f 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,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.
@@ -62,7 +62,7 @@ const char *kw_names[ekwNR] = {
     "replace", "add", "delete"
 };
 
-int find_kw(char *keyw)
+static int find_kw(char *keyw)
 {
     int i;
 
@@ -122,7 +122,7 @@ static void read_atom(char *line, gmx_bool bAdd,
         }
         else
         {
-            *nname = NULL;
+            *nname = nullptr;
         }
     }
     a->type = get_atomtype_type(buf[i++], atype);
@@ -166,19 +166,19 @@ static void print_ter_db(const char *ff, char C, int nb, t_hackblock tb[],
         ndel  = 0;
         for (j = 0; j < tb[i].nhack; j++)
         {
-            if (tb[i].hack[j].oname != NULL && tb[i].hack[j].nname != NULL)
+            if (tb[i].hack[j].oname != nullptr && tb[i].hack[j].nname != nullptr)
             {
                 nrepl++;
             }
-            else if (tb[i].hack[j].oname == NULL && tb[i].hack[j].nname != NULL)
+            else if (tb[i].hack[j].oname == nullptr && tb[i].hack[j].nname != nullptr)
             {
                 nadd++;
             }
-            else if (tb[i].hack[j].oname != NULL && tb[i].hack[j].nname == NULL)
+            else if (tb[i].hack[j].oname != nullptr && tb[i].hack[j].nname == nullptr)
             {
                 ndel++;
             }
-            else if (tb[i].hack[j].oname == NULL && tb[i].hack[j].nname == NULL)
+            else if (tb[i].hack[j].oname == nullptr && tb[i].hack[j].nname == nullptr)
             {
                 gmx_fatal(FARGS, "invalid hack (%s) in termini database", tb[i].name);
             }
@@ -188,7 +188,7 @@ static void print_ter_db(const char *ff, char C, int nb, t_hackblock tb[],
             fprintf(out, "[ %s ]\n", kw_names[ekwRepl-ebtsNR-1]);
             for (j = 0; j < tb[i].nhack; j++)
             {
-                if (tb[i].hack[j].oname != NULL && tb[i].hack[j].nname != NULL)
+                if (tb[i].hack[j].oname != nullptr && tb[i].hack[j].nname != nullptr)
                 {
                     fprintf(out, "%s\t", tb[i].hack[j].oname);
                     print_atom(out, tb[i].hack[j].atom, atype);
@@ -200,7 +200,7 @@ static void print_ter_db(const char *ff, char C, int nb, t_hackblock tb[],
             fprintf(out, "[ %s ]\n", kw_names[ekwAdd-ebtsNR-1]);
             for (j = 0; j < tb[i].nhack; j++)
             {
-                if (tb[i].hack[j].oname == NULL && tb[i].hack[j].nname != NULL)
+                if (tb[i].hack[j].oname == nullptr && tb[i].hack[j].nname != nullptr)
                 {
                     print_ab(out, &(tb[i].hack[j]), tb[i].hack[j].nname);
                     print_atom(out, tb[i].hack[j].atom, atype);
@@ -212,7 +212,7 @@ static void print_ter_db(const char *ff, char C, int nb, t_hackblock tb[],
             fprintf(out, "[ %s ]\n", kw_names[ekwDel-ebtsNR-1]);
             for (j = 0; j < tb[i].nhack; j++)
             {
-                if (tb[i].hack[j].oname != NULL && tb[i].hack[j].nname == NULL)
+                if (tb[i].hack[j].oname != nullptr && tb[i].hack[j].nname == nullptr)
                 {
                     fprintf(out, "%s\n", tb[i].hack[j].oname);
                 }
@@ -255,7 +255,7 @@ static void read_ter_db_file(char *fn,
     fflib_filename_base(fn, filebase, STRLEN);
     /* Remove the C/N termini extension */
     ptr = strrchr(filebase, '.');
-    if (ptr != NULL)
+    if (ptr != nullptr)
     {
         ptr[0] = '\0';
     }
@@ -314,7 +314,7 @@ static void read_ter_db_file(char *fn,
                 clear_t_hack(&(tb[nb].hack[nh]));
                 for (i = 0; i < 4; i++)
                 {
-                    tb[nb].hack[nh].a[i] = NULL;
+                    tb[nb].hack[nh].a[i] = nullptr;
                 }
                 tb[nb].nhack++;
 
@@ -347,9 +347,9 @@ static void read_ter_db_file(char *fn,
                     read_atom(line+n, kwnr == ekwAdd,
                               &tb[nb].hack[nh].nname, tb[nb].hack[nh].atom, atype,
                               &tb[nb].hack[nh].cgnr);
-                    if (tb[nb].hack[nh].nname == NULL)
+                    if (tb[nb].hack[nh].nname == nullptr)
                     {
-                        if (tb[nb].hack[nh].oname != NULL)
+                        if (tb[nb].hack[nh].oname != nullptr)
                         {
                             tb[nb].hack[nh].nname = gmx_strdup(tb[nb].hack[nh].oname);
                         }
@@ -379,7 +379,7 @@ static void read_ter_db_file(char *fn,
                 }
                 for (; j < MAXATOMLIST; j++)
                 {
-                    tb[nb].rb[kwnr].b[tb[nb].rb[kwnr].nb].a[j] = NULL;
+                    tb[nb].rb[kwnr].b[tb[nb].rb[kwnr].nb].a[j] = nullptr;
                 }
                 strcpy(buf, "");
                 sscanf(line+n, "%s", buf);
@@ -418,7 +418,7 @@ int read_ter_db(const char *ffdir, char ter,
      */
     ntdbf  = fflib_search_file_end(ffdir, ext, FALSE, &tdbf);
     ntb    = 0;
-    *tbptr = NULL;
+    *tbptr = nullptr;
     for (f = 0; f < ntdbf; f++)
     {
         read_ter_db_file(tdbf[f], &ntb, tbptr, atype);
@@ -472,7 +472,7 @@ t_hackblock **filter_ter(int nrtp, t_restp rtp[],
     restp         = get_restp(rtpname_match, nrtp, rtp);
 
     n    = 0;
-    list = NULL;
+    list = nullptr;
 
     for (i = 0; i < nb; i++)
     {
@@ -497,13 +497,13 @@ t_hackblock **filter_ter(int nrtp, t_restp rtp[],
             {
                 /* advance to next |-separated field */
                 s = strchr(s, '|');
-                if (s != NULL)
+                if (s != nullptr)
                 {
                     s++;
                 }
             }
         }
-        while (!found && s != NULL);
+        while (!found && s != nullptr);
     }
 
     /* All residue-specific termini have been added. We might have to fall
@@ -536,7 +536,7 @@ t_hackblock **filter_ter(int nrtp, t_restp rtp[],
                 /* A conjunction hyphen normally indicates a residue-specific
                    terminus, which is named like "GLY-COOH". A generic terminus
                    won't have a hyphen. */
-                bool bFoundAnyHyphen = (c != NULL);
+                bool bFoundAnyHyphen = (c != nullptr);
                 /* '-' as the last character indicates charge, so if that's
                    the only one found e.g. "COO-", then it was not a conjunction
                    hyphen, so this is a generic terminus */
@@ -549,7 +549,7 @@ t_hackblock **filter_ter(int nrtp, t_restp rtp[],
                     /* Check that we haven't already added a residue-specific version
                      * of this terminus.
                      */
-                    for (j = 0; j < n && strstr((*list[j]).name, s) == NULL; j++)
+                    for (j = 0; j < n && strstr((*list[j]).name, s) == nullptr; j++)
                     {
                         ;
                     }
index 37d1b8714e36d63e2a06c229c43760b254f4f6eb..3940c3898d0b83319fa9daf474adacce89f62f80 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,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.
@@ -35,5 +35,6 @@
 gmx_add_unit_test(GmxPreprocessTests gmxpreprocess-test
                   genconf.cpp
                   insert-molecules.cpp
+                  readir.cpp
                   solvate.cpp
                   )
diff --git a/src/gromacs/gmxpreprocess/tests/readir.cpp b/src/gromacs/gmxpreprocess/tests/readir.cpp
new file mode 100644 (file)
index 0000000..04c5b70
--- /dev/null
@@ -0,0 +1,174 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Test routines that parse mdp fields from grompp input and writes
+ * mdp back out.
+ *
+ * In particular these will provide test coverage as we refactor to
+ * use a new Options-based key-value-style mdp implementation to
+ * support a more modular mdrun.
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ */
+#include "gmxpre.h"
+
+#include "gromacs/gmxpreprocess/readir.h"
+
+#include <string>
+
+#include <gtest/gtest.h>
+
+#include "gromacs/fileio/warninp.h"
+#include "gromacs/mdrunutility/mdmodules.h"
+#include "gromacs/mdtypes/inputrec.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/textreader.h"
+#include "gromacs/utility/textwriter.h"
+#include "gromacs/utility/unique_cptr.h"
+
+#include "testutils/refdata.h"
+#include "testutils/testfilemanager.h"
+
+namespace gmx
+{
+namespace test
+{
+
+class GetIrTest : public ::testing::Test
+{
+    public:
+        GetIrTest() : fileManager_(), data_(), checker_(data_.rootChecker()),
+                      ir_(), mdModules_(), opts_(),
+                      wi_(init_warning(FALSE, 0)), wiGuard_(wi_)
+
+        {
+            snew(opts_.include, STRLEN);
+            snew(opts_.define, STRLEN);
+        }
+        ~GetIrTest()
+        {
+            done_inputrec_strings();
+            sfree(opts_.include);
+            sfree(opts_.define);
+        }
+        /*! \brief Test mdp reading and writing
+         *
+         * \todo Modernize read_inp and write_inp to use streams,
+         * which will make these tests run faster, because they don't
+         * use disk files. */
+        void runTest(const std::string &inputMdpFileContents)
+        {
+            auto inputMdpFilename  = fileManager_.getTemporaryFilePath("input.mdp");
+            auto outputMdpFilename = fileManager_.getTemporaryFilePath("output.mdp");
+
+            TextWriter::writeFileFromString(inputMdpFilename, inputMdpFileContents);
+
+            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");
+            warning_reset(wi_);
+
+            auto outputMdpContents = TextReader::readFileToString(outputMdpFilename);
+            checker_.checkString(outputMdpContents, "OutputMdpFile");
+        }
+
+        TestFileManager                    fileManager_;
+        TestReferenceData                  data_;
+        TestReferenceChecker               checker_;
+        t_inputrec                         ir_;
+        MDModules                          mdModules_;
+        t_gromppopts                       opts_;
+        warninp_t                          wi_;
+        unique_cptr<warninp, free_warning> wiGuard_;
+};
+
+TEST_F(GetIrTest, HandlesDifferentKindsOfMdpLines)
+{
+    const char *inputMdpFile[] = {
+        "; File to run my simulation",
+        "title = simulation",
+        ";",
+        "xtc_grps = System ; was Protein",
+        "include = -I/home/me/stuff",
+        "",
+        "tau-t = 0.1 0.3",
+        "tinit = 0.3",
+        "init_step = 0",
+        "nstcomm = 100",
+        "integrator = steep"
+    };
+    runTest(joinStrings(inputMdpFile, "\n"));
+}
+
+// This case is used often by SimulationRunner::useEmptyMdpFile (see
+// comments there for explanation). When we remove the group scheme,
+// that usage will have to disappear, and so can this test.
+TEST_F(GetIrTest, HandlesOnlyCutoffScheme)
+{
+    const char *inputMdpFile = "cutoff-scheme = Group\n";
+    runTest(inputMdpFile);
+}
+
+// TODO Stop accepting any of these
+TEST_F(GetIrTest, UserErrorsSilentlyTolerated)
+{
+    const char *inputMdpFile[] = {
+        "title simulation",
+        "xtc_grps = ",
+        "= -I/home/me/stuff",
+        "="
+    };
+    runTest(joinStrings(inputMdpFile, "\n"));
+}
+
+TEST_F(GetIrTest, EmptyInputWorks)
+{
+    const char *inputMdpFile = "";
+    runTest(inputMdpFile);
+}
+
+// This test observes how the electric-field keys behave, since they
+// are currently the only ones using the new Options-style handling.
+TEST_F(GetIrTest, ProducesOutputFromElectricField)
+{
+    const char *inputMdpFile = "E-x = 1 1.2 -1";
+    runTest(inputMdpFile);
+}
+
+} // namespace
+} // namespace
index d402d2aad7d2ba6e4144f0fc81d540f195c6e215..3247c5bddd719fddad5347c1b0918241fb5ade73 100644 (file)
@@ -13,72 +13,72 @@ Test system for solvate/insert-molecules
     2SOL     OW    4   1.555   1.511   0.703  0.8690  1.2450  1.6650
     2SOL    HW1    5   1.498   1.495   0.784  0.1690  0.2750  1.5650
     2SOL    HW2    6   1.496   1.521   0.623  0.2690  2.2750  1.4650
-    1MeOH   Me1    7   1.970   1.460   4.319 -0.8587 -0.1344 -0.0643
-    1MeOH    O2    8   1.978   1.415   4.192  0.0623 -0.1787  0.0036
-    1MeOH    H3    9   1.905   1.460   4.140 -0.5020 -0.9564  0.0997
-    2SOL     OW   10   1.555   1.511   3.813  0.8690  1.2450  1.6650
-    2SOL    HW1   11   1.498   1.495   3.894  0.1690  0.2750  1.5650
-    2SOL    HW2   12   1.496   1.521   3.733  0.2690  2.2750  1.4650
-    1MeOH   Me1   13   1.970   1.460   7.429 -0.8587 -0.1344 -0.0643
-    1MeOH    O2   14   1.978   1.415   7.302  0.0623 -0.1787  0.0036
-    1MeOH    H3   15   1.905   1.460   7.250 -0.5020 -0.9564  0.0997
-    2SOL     OW   16   1.555   1.511   6.923  0.8690  1.2450  1.6650
-    2SOL    HW1   17   1.498   1.495   7.004  0.1690  0.2750  1.5650
-    2SOL    HW2   18   1.496   1.521   6.843  0.2690  2.2750  1.4650
-    1MeOH   Me1   19   1.970   4.570   1.209 -0.8587 -0.1344 -0.0643
-    1MeOH    O2   20   1.978   4.525   1.082  0.0623 -0.1787  0.0036
-    1MeOH    H3   21   1.905   4.570   1.030 -0.5020 -0.9564  0.0997
-    2SOL     OW   22   1.555   4.621   0.703  0.8690  1.2450  1.6650
-    2SOL    HW1   23   1.498   4.605   0.784  0.1690  0.2750  1.5650
-    2SOL    HW2   24   1.496   4.631   0.623  0.2690  2.2750  1.4650
-    1MeOH   Me1   25   1.970   4.570   4.319 -0.8587 -0.1344 -0.0643
-    1MeOH    O2   26   1.978   4.525   4.192  0.0623 -0.1787  0.0036
-    1MeOH    H3   27   1.905   4.570   4.140 -0.5020 -0.9564  0.0997
-    2SOL     OW   28   1.555   4.621   3.813  0.8690  1.2450  1.6650
-    2SOL    HW1   29   1.498   4.605   3.894  0.1690  0.2750  1.5650
-    2SOL    HW2   30   1.496   4.631   3.733  0.2690  2.2750  1.4650
-    1MeOH   Me1   31   1.970   4.570   7.429 -0.8587 -0.1344 -0.0643
-    1MeOH    O2   32   1.978   4.525   7.302  0.0623 -0.1787  0.0036
-    1MeOH    H3   33   1.905   4.570   7.250 -0.5020 -0.9564  0.0997
-    2SOL     OW   34   1.555   4.621   6.923  0.8690  1.2450  1.6650
-    2SOL    HW1   35   1.498   4.605   7.004  0.1690  0.2750  1.5650
-    2SOL    HW2   36   1.496   4.631   6.843  0.2690  2.2750  1.4650
-    1MeOH   Me1   37   5.080   1.460   1.209 -0.8587 -0.1344 -0.0643
-    1MeOH    O2   38   5.088   1.415   1.082  0.0623 -0.1787  0.0036
-    1MeOH    H3   39   5.015   1.460   1.030 -0.5020 -0.9564  0.0997
-    2SOL     OW   40   4.665   1.511   0.703  0.8690  1.2450  1.6650
-    2SOL    HW1   41   4.608   1.495   0.784  0.1690  0.2750  1.5650
-    2SOL    HW2   42   4.606   1.521   0.623  0.2690  2.2750  1.4650
-    1MeOH   Me1   43   5.080   1.460   4.319 -0.8587 -0.1344 -0.0643
-    1MeOH    O2   44   5.088   1.415   4.192  0.0623 -0.1787  0.0036
-    1MeOH    H3   45   5.015   1.460   4.140 -0.5020 -0.9564  0.0997
-    2SOL     OW   46   4.665   1.511   3.813  0.8690  1.2450  1.6650
-    2SOL    HW1   47   4.608   1.495   3.894  0.1690  0.2750  1.5650
-    2SOL    HW2   48   4.606   1.521   3.733  0.2690  2.2750  1.4650
-    1MeOH   Me1   49   5.080   1.460   7.429 -0.8587 -0.1344 -0.0643
-    1MeOH    O2   50   5.088   1.415   7.302  0.0623 -0.1787  0.0036
-    1MeOH    H3   51   5.015   1.460   7.250 -0.5020 -0.9564  0.0997
-    2SOL     OW   52   4.665   1.511   6.923  0.8690  1.2450  1.6650
-    2SOL    HW1   53   4.608   1.495   7.004  0.1690  0.2750  1.5650
-    2SOL    HW2   54   4.606   1.521   6.843  0.2690  2.2750  1.4650
-    1MeOH   Me1   55   5.080   4.570   1.209 -0.8587 -0.1344 -0.0643
-    1MeOH    O2   56   5.088   4.525   1.082  0.0623 -0.1787  0.0036
-    1MeOH    H3   57   5.015   4.570   1.030 -0.5020 -0.9564  0.0997
-    2SOL     OW   58   4.665   4.621   0.703  0.8690  1.2450  1.6650
-    2SOL    HW1   59   4.608   4.605   0.784  0.1690  0.2750  1.5650
-    2SOL    HW2   60   4.606   4.631   0.623  0.2690  2.2750  1.4650
-    1MeOH   Me1   61   5.080   4.570   4.319 -0.8587 -0.1344 -0.0643
-    1MeOH    O2   62   5.088   4.525   4.192  0.0623 -0.1787  0.0036
-    1MeOH    H3   63   5.015   4.570   4.140 -0.5020 -0.9564  0.0997
-    2SOL     OW   64   4.665   4.621   3.813  0.8690  1.2450  1.6650
-    2SOL    HW1   65   4.608   4.605   3.894  0.1690  0.2750  1.5650
-    2SOL    HW2   66   4.606   4.631   3.733  0.2690  2.2750  1.4650
-    1MeOH   Me1   67   5.080   4.570   7.429 -0.8587 -0.1344 -0.0643
-    1MeOH    O2   68   5.088   4.525   7.302  0.0623 -0.1787  0.0036
-    1MeOH    H3   69   5.015   4.570   7.250 -0.5020 -0.9564  0.0997
-    2SOL     OW   70   4.665   4.621   6.923  0.8690  1.2450  1.6650
-    2SOL    HW1   71   4.608   4.605   7.004  0.1690  0.2750  1.5650
-    2SOL    HW2   72   4.606   4.631   6.843  0.2690  2.2750  1.4650
+    3MeOH   Me1    7   1.970   1.460   4.319 -0.8587 -0.1344 -0.0643
+    3MeOH    O2    8   1.978   1.415   4.192  0.0623 -0.1787  0.0036
+    3MeOH    H3    9   1.905   1.460   4.140 -0.5020 -0.9564  0.0997
+    4SOL     OW   10   1.555   1.511   3.813  0.8690  1.2450  1.6650
+    4SOL    HW1   11   1.498   1.495   3.894  0.1690  0.2750  1.5650
+    4SOL    HW2   12   1.496   1.521   3.733  0.2690  2.2750  1.4650
+    5MeOH   Me1   13   1.970   1.460   7.429 -0.8587 -0.1344 -0.0643
+    5MeOH    O2   14   1.978   1.415   7.302  0.0623 -0.1787  0.0036
+    5MeOH    H3   15   1.905   1.460   7.250 -0.5020 -0.9564  0.0997
+    6SOL     OW   16   1.555   1.511   6.923  0.8690  1.2450  1.6650
+    6SOL    HW1   17   1.498   1.495   7.004  0.1690  0.2750  1.5650
+    6SOL    HW2   18   1.496   1.521   6.843  0.2690  2.2750  1.4650
+    7MeOH   Me1   19   1.970   4.570   1.209 -0.8587 -0.1344 -0.0643
+    7MeOH    O2   20   1.978   4.525   1.082  0.0623 -0.1787  0.0036
+    7MeOH    H3   21   1.905   4.570   1.030 -0.5020 -0.9564  0.0997
+    8SOL     OW   22   1.555   4.621   0.703  0.8690  1.2450  1.6650
+    8SOL    HW1   23   1.498   4.605   0.784  0.1690  0.2750  1.5650
+    8SOL    HW2   24   1.496   4.631   0.623  0.2690  2.2750  1.4650
+    9MeOH   Me1   25   1.970   4.570   4.319 -0.8587 -0.1344 -0.0643
+    9MeOH    O2   26   1.978   4.525   4.192  0.0623 -0.1787  0.0036
+    9MeOH    H3   27   1.905   4.570   4.140 -0.5020 -0.9564  0.0997
+   10SOL     OW   28   1.555   4.621   3.813  0.8690  1.2450  1.6650
+   10SOL    HW1   29   1.498   4.605   3.894  0.1690  0.2750  1.5650
+   10SOL    HW2   30   1.496   4.631   3.733  0.2690  2.2750  1.4650
+   11MeOH   Me1   31   1.970   4.570   7.429 -0.8587 -0.1344 -0.0643
+   11MeOH    O2   32   1.978   4.525   7.302  0.0623 -0.1787  0.0036
+   11MeOH    H3   33   1.905   4.570   7.250 -0.5020 -0.9564  0.0997
+   12SOL     OW   34   1.555   4.621   6.923  0.8690  1.2450  1.6650
+   12SOL    HW1   35   1.498   4.605   7.004  0.1690  0.2750  1.5650
+   12SOL    HW2   36   1.496   4.631   6.843  0.2690  2.2750  1.4650
+   13MeOH   Me1   37   5.080   1.460   1.209 -0.8587 -0.1344 -0.0643
+   13MeOH    O2   38   5.088   1.415   1.082  0.0623 -0.1787  0.0036
+   13MeOH    H3   39   5.015   1.460   1.030 -0.5020 -0.9564  0.0997
+   14SOL     OW   40   4.665   1.511   0.703  0.8690  1.2450  1.6650
+   14SOL    HW1   41   4.608   1.495   0.784  0.1690  0.2750  1.5650
+   14SOL    HW2   42   4.606   1.521   0.623  0.2690  2.2750  1.4650
+   15MeOH   Me1   43   5.080   1.460   4.319 -0.8587 -0.1344 -0.0643
+   15MeOH    O2   44   5.088   1.415   4.192  0.0623 -0.1787  0.0036
+   15MeOH    H3   45   5.015   1.460   4.140 -0.5020 -0.9564  0.0997
+   16SOL     OW   46   4.665   1.511   3.813  0.8690  1.2450  1.6650
+   16SOL    HW1   47   4.608   1.495   3.894  0.1690  0.2750  1.5650
+   16SOL    HW2   48   4.606   1.521   3.733  0.2690  2.2750  1.4650
+   17MeOH   Me1   49   5.080   1.460   7.429 -0.8587 -0.1344 -0.0643
+   17MeOH    O2   50   5.088   1.415   7.302  0.0623 -0.1787  0.0036
+   17MeOH    H3   51   5.015   1.460   7.250 -0.5020 -0.9564  0.0997
+   18SOL     OW   52   4.665   1.511   6.923  0.8690  1.2450  1.6650
+   18SOL    HW1   53   4.608   1.495   7.004  0.1690  0.2750  1.5650
+   18SOL    HW2   54   4.606   1.521   6.843  0.2690  2.2750  1.4650
+   19MeOH   Me1   55   5.080   4.570   1.209 -0.8587 -0.1344 -0.0643
+   19MeOH    O2   56   5.088   4.525   1.082  0.0623 -0.1787  0.0036
+   19MeOH    H3   57   5.015   4.570   1.030 -0.5020 -0.9564  0.0997
+   20SOL     OW   58   4.665   4.621   0.703  0.8690  1.2450  1.6650
+   20SOL    HW1   59   4.608   4.605   0.784  0.1690  0.2750  1.5650
+   20SOL    HW2   60   4.606   4.631   0.623  0.2690  2.2750  1.4650
+   21MeOH   Me1   61   5.080   4.570   4.319 -0.8587 -0.1344 -0.0643
+   21MeOH    O2   62   5.088   4.525   4.192  0.0623 -0.1787  0.0036
+   21MeOH    H3   63   5.015   4.570   4.140 -0.5020 -0.9564  0.0997
+   22SOL     OW   64   4.665   4.621   3.813  0.8690  1.2450  1.6650
+   22SOL    HW1   65   4.608   4.605   3.894  0.1690  0.2750  1.5650
+   22SOL    HW2   66   4.606   4.631   3.733  0.2690  2.2750  1.4650
+   23MeOH   Me1   67   5.080   4.570   7.429 -0.8587 -0.1344 -0.0643
+   23MeOH    O2   68   5.088   4.525   7.302  0.0623 -0.1787  0.0036
+   23MeOH    H3   69   5.015   4.570   7.250 -0.5020 -0.9564  0.0997
+   24SOL     OW   70   4.665   4.621   6.923  0.8690  1.2450  1.6650
+   24SOL    HW1   71   4.608   4.605   7.004  0.1690  0.2750  1.5650
+   24SOL    HW2   72   4.606   4.631   6.843  0.2690  2.2750  1.4650
    6.22000   6.22000   9.33000
 ]]></String>
     </File>
index 0f3a3892bb1de0d63a505dc52d5809eaee66c088..3f903f0094d5e71366e23db26cd47fcb6b1f1fc0 100644 (file)
@@ -13,73 +13,73 @@ Test system for solvate/insert-molecules
     2SOL     OW    4   1.698   1.407   0.645 -1.2387  0.8962  1.6553
     2SOL    HW1    5   1.659   1.331   0.696 -0.6962 -0.1507  1.4304
     2SOL    HW2    6   1.692   1.387   0.547 -2.2872  1.0137  1.0656
-    1MeOH   Me1    7   1.585   1.592   4.352  0.8537 -0.1691 -0.0463
-    1MeOH    O2    8   1.685   1.637   4.273 -0.0004  0.1383  0.1293
-    1MeOH    H3    9   1.676   1.592   4.184  0.7621  0.3943  0.6637
-    2SOL     OW   10   1.814   1.383   3.773 -1.4910 -1.6216  0.4741
-    2SOL    HW1   11   1.793   1.301   3.826 -0.5070 -1.1559  0.9799
-    2SOL    HW2   12   1.848   1.357   3.683 -1.2346 -2.3848 -0.4273
-    1MeOH   Me1   13   1.762   1.718   7.425  0.2370 -0.8319  0.1066
-    1MeOH    O2   14   1.849   1.637   7.361  0.1204  0.0852  0.1186
-    1MeOH    H3   15   1.807   1.609   7.275  0.6829 -0.3736  0.7554
-    2SOL     OW   16   1.692   1.322   6.906 -2.1305  0.6607  0.3189
-    2SOL    HW1   17   1.607   1.312   6.959 -1.2802  0.0971  0.9514
-    2SOL    HW2   18   1.685   1.264   6.824 -2.6759 -0.0653 -0.4788
-    1MeOH   Me1   19   1.778   4.890   1.139 -0.7633 -0.1096 -0.4061
-    1MeOH    O2   20   1.689   4.789   1.133 -0.0583  0.0804  0.1611
-    1MeOH    H3   21   1.726   4.720   1.071 -0.9541  0.4031  0.3223
-    2SOL     OW   22   1.730   4.376   0.734  1.6869  1.1401 -0.9653
-    2SOL    HW1   23   1.757   4.453   0.677  0.5389  1.3424 -0.6790
-    2SOL    HW2   24   1.722   4.294   0.677  1.8069  0.4843 -1.9735
-    1MeOH   Me1   25   1.915   4.493   3.688 -0.0613  0.8412  0.2196
-    1MeOH    O2   26   1.950   4.564   3.798  0.1668  0.0002 -0.0894
-    1MeOH    H3   27   1.882   4.545   3.868  0.6563  0.7941 -0.3396
-    2SOL     OW   28   1.589   4.631   4.241 -1.6140 -1.0182 -1.1982
-    2SOL    HW1   29   1.522   4.638   4.167 -0.9032 -0.0582 -1.3169
-    2SOL    HW2   30   1.544   4.650   4.328 -2.5524 -0.8151 -0.4639
-    1MeOH   Me1   31   1.890   4.570   6.773 -0.8166  0.2929  0.0827
-    1MeOH    O2   32   1.833   4.669   6.846  0.0582  0.1025 -0.1481
-    1MeOH    H3   33   1.826   4.636   6.940 -0.5178  0.6434 -0.7033
-    2SOL     OW   34   1.638   4.576   7.380  0.4363 -2.1961 -0.2531
-    2SOL    HW1   35   1.611   4.489   7.339 -0.2236 -1.3607 -0.8074
-    2SOL    HW2   36   1.604   4.582   7.473 -0.0878 -2.6112  0.7539
-    1MeOH   Me1   37   4.610   1.735   0.740  0.4965  0.2520  0.6705
-    1MeOH    O2   38   4.743   1.732   0.764 -0.0063  0.1606 -0.1000
-    1MeOH    H3   39   4.766   1.637   0.789  0.3066  1.0179  0.2155
-    2SOL     OW   40   4.989   1.276   1.016 -2.0450 -0.8883  0.3261
-    2SOL    HW1   41   4.904   1.277   1.069 -1.4679  0.1226  0.6194
-    2SOL    HW2   42   5.050   1.206   1.053 -1.7367 -1.8215  1.0296
-    1MeOH   Me1   43   5.153   1.247   4.010  0.1022  0.8451 -0.1869
-    1MeOH    O2   44   5.123   1.361   4.075  0.1661 -0.0369  0.0830
-    1MeOH    H3   45   5.024   1.376   4.065  0.9227  0.5631  0.0906
-    2SOL     OW   46   4.611   1.617   4.010 -0.5106 -1.5002 -1.6019
-    2SOL    HW1   47   4.624   1.587   3.915  0.3484 -0.6863 -1.4003
-    2SOL    HW2   48   4.528   1.673   4.015 -1.5361 -1.0046 -2.0063
-    1MeOH   Me1   49   4.557   1.735   7.114  0.3121 -0.2458  0.7757
-    1MeOH    O2   50   4.681   1.735   7.169 -0.0478  0.1792  0.0377
-    1MeOH    H3   51   4.731   1.657   7.129 -0.0685  0.5690  0.9210
-    2SOL     OW   52   5.034   1.284   7.111 -1.6638 -1.1382 -1.0069
-    2SOL    HW1   53   4.949   1.233   7.121 -1.4843 -0.5900  0.0458
-    2SOL    HW2   54   5.111   1.219   7.108 -1.1439 -2.2280 -1.0590
-    1MeOH   Me1   55   5.110   4.719   1.150 -0.7942 -0.1897  0.3047
-    1MeOH    O2   56   5.033   4.609   1.147  0.1057 -0.0432  0.1510
-    1MeOH    H3   57   4.994   4.602   1.055 -0.2441 -0.2414  1.0290
-    2SOL     OW   58   4.668   4.510   0.713  0.4804  2.0402 -0.8273
-    2SOL    HW1   59   4.655   4.609   0.720  0.0534  1.5847  0.1980
-    2SOL    HW2   60   4.603   4.473   0.646 -0.3570  2.0943 -1.6972
-    1MeOH   Me1   61   4.704   4.648   4.369  0.7064 -0.5020 -0.0927
-    1MeOH    O2   62   4.825   4.667   4.312  0.0359  0.0786  0.1684
-    1MeOH    H3   63   4.813   4.659   4.213  0.7429 -0.1979  0.7652
-    2SOL     OW   64   4.916   4.545   3.756 -2.0765 -0.8670 -0.1174
-    2SOL    HW1   65   4.855   4.468   3.778 -1.0802 -1.0537  0.5256
-    2SOL    HW2   66   4.949   4.535   3.663 -2.0165 -1.3549 -1.2216
-    1MeOH   Me1   67   5.133   4.487   6.891 -0.0721 -0.4007  0.7706
-    1MeOH    O2   68   5.034   4.419   6.951  0.0725 -0.1401 -0.1046
-    1MeOH    H3   69   4.967   4.486   6.985  0.4032 -0.9760  0.2481
-    2SOL     OW   70   4.642   4.683   7.280  1.1586  1.9203 -0.2175
-    2SOL    HW1   71   4.722   4.737   7.308  1.3671  0.8073  0.1808
-    2SOL    HW2   72   4.564   4.710   7.336  0.5573  2.5967  0.5836
-   6.22000   6.22000   9.33000
+    3MeOH   Me1    7   1.585   1.592   4.252  0.8537 -0.1691 -0.0463
+    3MeOH    O2    8   1.685   1.637   4.173 -0.0004  0.1383  0.1293
+    3MeOH    H3    9   1.676   1.592   4.084  0.7621  0.3943  0.6637
+    4SOL     OW   10   1.814   1.383   3.673 -1.4910 -1.6216  0.4741
+    4SOL    HW1   11   1.793   1.301   3.726 -0.5070 -1.1559  0.9799
+    4SOL    HW2   12   1.848   1.357   3.583 -1.2346 -2.3848 -0.4273
+    5MeOH   Me1   13   1.762   1.718   7.225  0.2370 -0.8319  0.1066
+    5MeOH    O2   14   1.849   1.637   7.161  0.1204  0.0852  0.1186
+    5MeOH    H3   15   1.807   1.609   7.075  0.6829 -0.3736  0.7554
+    6SOL     OW   16   1.692   1.322   6.706 -2.1305  0.6607  0.3189
+    6SOL    HW1   17   1.607   1.312   6.759 -1.2802  0.0971  0.9514
+    6SOL    HW2   18   1.685   1.264   6.624 -2.6759 -0.0653 -0.4788
+    7MeOH   Me1   19   1.778   4.790   1.139 -0.7633 -0.1096 -0.4061
+    7MeOH    O2   20   1.689   4.689   1.133 -0.0583  0.0804  0.1611
+    7MeOH    H3   21   1.726   4.620   1.071 -0.9541  0.4031  0.3223
+    8SOL     OW   22   1.730   4.276   0.734  1.6869  1.1401 -0.9653
+    8SOL    HW1   23   1.757   4.353   0.677  0.5389  1.3424 -0.6790
+    8SOL    HW2   24   1.722   4.194   0.677  1.8069  0.4843 -1.9735
+    9MeOH   Me1   25   1.915   4.393   3.588 -0.0613  0.8412  0.2196
+    9MeOH    O2   26   1.950   4.464   3.698  0.1668  0.0002 -0.0894
+    9MeOH    H3   27   1.882   4.445   3.768  0.6563  0.7941 -0.3396
+   10SOL     OW   28   1.589   4.531   4.141 -1.6140 -1.0182 -1.1982
+   10SOL    HW1   29   1.522   4.538   4.067 -0.9032 -0.0582 -1.3169
+   10SOL    HW2   30   1.544   4.550   4.228 -2.5524 -0.8151 -0.4639
+   11MeOH   Me1   31   1.890   4.470   6.573 -0.8166  0.2929  0.0827
+   11MeOH    O2   32   1.833   4.569   6.646  0.0582  0.1025 -0.1481
+   11MeOH    H3   33   1.826   4.536   6.740 -0.5178  0.6434 -0.7033
+   12SOL     OW   34   1.638   4.476   7.180  0.4363 -2.1961 -0.2531
+   12SOL    HW1   35   1.611   4.389   7.139 -0.2236 -1.3607 -0.8074
+   12SOL    HW2   36   1.604   4.482   7.273 -0.0878 -2.6112  0.7539
+   13MeOH   Me1   37   4.510   1.735   0.740  0.4965  0.2520  0.6705
+   13MeOH    O2   38   4.643   1.732   0.764 -0.0063  0.1606 -0.1000
+   13MeOH    H3   39   4.666   1.637   0.789  0.3066  1.0179  0.2155
+   14SOL     OW   40   4.889   1.276   1.016 -2.0450 -0.8883  0.3261
+   14SOL    HW1   41   4.804   1.277   1.069 -1.4679  0.1226  0.6194
+   14SOL    HW2   42   4.950   1.206   1.053 -1.7367 -1.8215  1.0296
+   15MeOH   Me1   43   5.053   1.247   3.910  0.1022  0.8451 -0.1869
+   15MeOH    O2   44   5.023   1.361   3.975  0.1661 -0.0369  0.0830
+   15MeOH    H3   45   4.924   1.376   3.965  0.9227  0.5631  0.0906
+   16SOL     OW   46   4.511   1.617   3.910 -0.5106 -1.5002 -1.6019
+   16SOL    HW1   47   4.524   1.587   3.815  0.3484 -0.6863 -1.4003
+   16SOL    HW2   48   4.428   1.673   3.915 -1.5361 -1.0046 -2.0063
+   17MeOH   Me1   49   4.457   1.735   6.914  0.3121 -0.2458  0.7757
+   17MeOH    O2   50   4.581   1.735   6.969 -0.0478  0.1792  0.0377
+   17MeOH    H3   51   4.631   1.657   6.929 -0.0685  0.5690  0.9210
+   18SOL     OW   52   4.934   1.284   6.911 -1.6638 -1.1382 -1.0069
+   18SOL    HW1   53   4.849   1.233   6.921 -1.4843 -0.5900  0.0458
+   18SOL    HW2   54   5.011   1.219   6.908 -1.1439 -2.2280 -1.0590
+   19MeOH   Me1   55   5.010   4.619   1.150 -0.7942 -0.1897  0.3047
+   19MeOH    O2   56   4.933   4.509   1.147  0.1057 -0.0432  0.1510
+   19MeOH    H3   57   4.894   4.502   1.055 -0.2441 -0.2414  1.0290
+   20SOL     OW   58   4.568   4.410   0.713  0.4804  2.0402 -0.8273
+   20SOL    HW1   59   4.555   4.509   0.720  0.0534  1.5847  0.1980
+   20SOL    HW2   60   4.503   4.373   0.646 -0.3570  2.0943 -1.6972
+   21MeOH   Me1   61   4.604   4.548   4.269  0.7064 -0.5020 -0.0927
+   21MeOH    O2   62   4.725   4.567   4.212  0.0359  0.0786  0.1684
+   21MeOH    H3   63   4.713   4.559   4.113  0.7429 -0.1979  0.7652
+   22SOL     OW   64   4.816   4.445   3.656 -2.0765 -0.8670 -0.1174
+   22SOL    HW1   65   4.755   4.368   3.678 -1.0802 -1.0537  0.5256
+   22SOL    HW2   66   4.849   4.435   3.563 -2.0165 -1.3549 -1.2216
+   23MeOH   Me1   67   5.033   4.387   6.691 -0.0721 -0.4007  0.7706
+   23MeOH    O2   68   4.934   4.319   6.751  0.0725 -0.1401 -0.1046
+   23MeOH    H3   69   4.867   4.386   6.785  0.4032 -0.9760  0.2481
+   24SOL     OW   70   4.542   4.583   7.080  1.1586  1.9203 -0.2175
+   24SOL    HW1   71   4.622   4.637   7.108  1.3671  0.8073  0.1808
+   24SOL    HW2   72   4.464   4.610   7.136  0.5573  2.5967  0.5836
+   6.02000   6.02000   9.03000
 ]]></String>
     </File>
   </OutputFiles>
diff --git a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_EmptyInputWorks.xml b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_EmptyInputWorks.xml
new file mode 100644 (file)
index 0000000..ec270ff
--- /dev/null
@@ -0,0 +1,350 @@
+<?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
+include                  = 
+; e.g.: -DPOSRES -DFLEXIBLE (note these variable names are case sensitive)
+define                   = 
+
+; RUN CONTROL PARAMETERS
+integrator               = md
+; Start time and timestep in ps
+tinit                    = 0
+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)
+simulation-part          = 1
+; mode for center of mass motion removal
+comm-mode                = Linear
+; number of steps for center of mass motion removal
+nstcomm                  = 100
+; group(s) for center of mass motion removal
+comm-grps                = 
+
+; LANGEVIN DYNAMICS OPTIONS
+; Friction coefficient (amu/ps) and random seed
+bd-fric                  = 0
+ld-seed                  = -1
+
+; ENERGY MINIMIZATION OPTIONS
+; Force tolerance and initial step-size
+emtol                    = 10
+emstep                   = 0.01
+; Max number of iterations in relax-shells
+niter                    = 20
+; Step size (ps^2) for minimization of flexible constraints
+fcstep                   = 0
+; Frequency of steepest descents steps when doing CG
+nstcgsteep               = 1000
+nbfgscorr                = 10
+
+; TEST PARTICLE INSERTION OPTIONS
+rtpi                     = 0.05
+
+; OUTPUT CONTROL OPTIONS
+; Output frequency for coords (x), velocities (v) and forces (f)
+nstxout                  = 0
+nstvout                  = 0
+nstfout                  = 0
+; Output frequency for energies to log file and energy file
+nstlog                   = 1000
+nstcalcenergy            = 100
+nstenergy                = 1000
+; Output frequency and precision for .xtc file
+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 (Verlet: particle based cut-offs, group: using charge groups)
+cutoff-scheme            = Verlet
+; nblist update frequency
+nstlist                  = 10
+; ns algorithm (simple or grid)
+ns-type                  = Grid
+; Periodic boundary conditions: xyz, no, xy
+pbc                      = xyz
+periodic-molecules       = no
+; Allowed energy error due to the Verlet buffer in kJ/mol/ps per atom,
+; a value of -1 means: use rlist
+verlet-buffer-tolerance  = 0.005
+; nblist cut-off        
+rlist                    = 1
+; long-range cut-off for switched potentials
+
+; OPTIONS FOR ELECTROSTATICS AND VDW
+; Method for doing electrostatics
+coulombtype              = Cut-off
+coulomb-modifier         = Potential-shift-Verlet
+rcoulomb-switch          = 0
+rcoulomb                 = 1
+; Relative dielectric constant for the medium and the reaction field
+epsilon-r                = 1
+epsilon-rf               = 0
+; Method for doing Van der Waals
+vdw-type                 = Cut-off
+vdw-modifier             = Potential-shift-Verlet
+; cut-off lengths       
+rvdw-switch              = 0
+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
+; 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               = 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
+
+; 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
+
+; OPTIONS FOR WEAK COUPLING ALGORITHMS
+; Temperature coupling  
+tcoupl                   = No
+nsttcouple               = -1
+nh-chain-length          = 10
+print-nose-hoover-chain-variables = no
+; Groups to couple separately
+tc-grps                  = 
+; Time constant (ps) and reference temperature (K)
+tau-t                    = 
+ref-t                    = 
+; pressure coupling     
+pcoupl                   = No
+pcoupltype               = Isotropic
+nstpcouple               = -1
+; Time constant (ps), compressibility (1/bar) and reference P (bar)
+tau-p                    = 1
+compressibility          = 
+ref-p                    = 
+; Scaling of reference coordinates, No, All or COM
+refcoord-scaling         = No
+
+; OPTIONS FOR QMMM calculations
+QMMM                     = no
+; Groups treated Quantum Mechanically
+QMMM-grps                = 
+; QM method             
+QMmethod                 = 
+; QMMM scheme           
+QMMMscheme               = normal
+; QM basisset           
+QMbasis                  = 
+; QM charge             
+QMcharge                 = 
+; QM multiplicity       
+QMmult                   = 
+; Surface Hopping       
+SH                       = 
+; CAS space options     
+CASorbitals              = 
+CASelectrons             = 
+SAon                     = 
+SAoff                    = 
+SAsteps                  = 
+; Scale factor for MM charges
+MMChargeScaleFactor      = 1
+; Optimization of QM subsystem
+bOPT                     = 
+bTS                      = 
+
+; SIMULATED ANNEALING  
+; Type of annealing for each temperature group (no/single/periodic)
+annealing                = 
+; Number of time points to use for specifying annealing in each group
+annealing-npoints        = 
+; List of times at the annealing points for each group
+annealing-time           = 
+; Temp. at each annealing point, for each group.
+annealing-temp           = 
+
+; GENERATE VELOCITIES FOR STARTUP RUN
+gen-vel                  = no
+gen-temp                 = 300
+gen-seed                 = -1
+
+; OPTIONS FOR BONDS    
+constraints              = none
+; Type of constraint algorithm
+constraint-algorithm     = Lincs
+; Do not constrain the start configuration
+continuation             = no
+; Use successive overrelaxation to reduce the number of shake iterations
+Shake-SOR                = no
+; Relative tolerance of shake
+shake-tol                = 0.0001
+; Highest order in the expansion of the constraint coupling matrix
+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               = 1
+; Lincs will write a warning to the stderr if in one step a bond
+; rotates over more degrees than
+lincs-warnangle          = 30
+; Convert harmonic bonds to morse potentials
+morse                    = no
+
+; ENERGY GROUP EXCLUSIONS
+; Pairs of energy groups for which all non-bonded interactions are excluded
+energygrp-excl           = 
+
+; WALLS                
+; Number of walls, type, atom types, densities and box-z scale factor for Ewald
+nwall                    = 0
+wall-type                = 9-3
+wall-r-linpot            = -1
+wall-atomtype            = 
+wall-density             = 
+wall-ewald-zfac          = 3
+
+; COM PULLING          
+pull                     = 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
+; Force weighting of pairs in one distance restraint: Conservative or Equal
+disre-weighting          = Conservative
+; Use sqrt of the time averaged times the instantaneous violation
+disre-mixed              = no
+disre-fc                 = 1000
+disre-tau                = 0
+; Output frequency for pair distances to energy file
+nstdisreout              = 100
+; Orientation restraints: No or Yes
+orire                    = no
+; Orientation restraints force constant and tau for time averaging
+orire-fc                 = 0
+orire-tau                = 0
+orire-fitgrp             = 
+; Output frequency for trace(SD) and S to energy file
+nstorireout              = 100
+
+; Free energy variables
+free-energy              = no
+couple-moltype           = 
+couple-lambda0           = vdw-q
+couple-lambda1           = vdw-q
+couple-intramol          = no
+init-lambda              = -1
+init-lambda-state        = -1
+delta-lambda             = 0
+nstdhdl                  = 50
+fep-lambdas              = 
+mass-lambdas             = 
+coul-lambdas             = 
+vdw-lambdas              = 
+bonded-lambdas           = 
+restraint-lambdas        = 
+temperature-lambdas      = 
+calc-lambda-neighbors    = 1
+init-lambda-weights      = 
+dhdl-print-energy        = no
+sc-alpha                 = 0
+sc-power                 = 1
+sc-r-power               = 6
+sc-sigma                 = 0.3
+sc-coul                  = no
+separate-dhdl-file       = yes
+dhdl-derivatives         = yes
+dh_hist_size             = 0
+dh_hist_spacing          = 0.1
+
+; Non-equilibrium MD stuff
+acc-grps                 = 
+accelerate               = 
+freezegrps               = 
+freezedim                = 
+cos-acceleration         = 0
+deform                   = 
+
+; simulated tempering variables
+simulated-tempering      = no
+simulated-tempering-scaling = geometric
+sim-temp-low             = 300
+sim-temp-high            = 300
+
+; Ion/water position swapping for computational electrophysiology setups
+; Swap positions along direction: no, X, Y, Z
+swapcoords               = no
+adress                   = no
+
+; User defined thingies
+user1-grps               = 
+user2-grps               = 
+userint1                 = 0
+userint2                 = 0
+userint3                 = 0
+userint4                 = 0
+userreal1                = 0
+userreal2                = 0
+userreal3                = 0
+userreal4                = 0
+; Electric fields
+; Format for E-x, etc. is: number of cosines (int; only 1 is supported),
+; amplitude (real; V/nm), and phase (real; value is meaningless
+; for a cosine of frequency 0.
+; Format for E-xt, etc. is: omega (1/ps), time for the pulse peak (ps),
+; and sigma (ps) width of the pulse. Sigma = 0 removes the pulse,
+; leaving the field to be a cosine function.
+E-x                      = 1 0 -1
+E-xt                     = 0 0 0
+E-y                      = 1 0 -1
+E-yt                     = 0 0 0
+E-z                      = 1 0 -1
+E-zt                     = 0 0 0
+</String>
+</ReferenceData>
diff --git a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_HandlesDifferentKindsOfMdpLines.xml b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_HandlesDifferentKindsOfMdpLines.xml
new file mode 100644 (file)
index 0000000..40156a2
--- /dev/null
@@ -0,0 +1,350 @@
+<?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
+include                  = -I/home/me/stuff
+; e.g.: -DPOSRES -DFLEXIBLE (note these variable names are case sensitive)
+define                   = 
+
+; RUN CONTROL PARAMETERS
+integrator               = steep
+; Start time and timestep in ps
+tinit                    = 0.3
+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)
+simulation-part          = 1
+; mode for center of mass motion removal
+comm-mode                = Linear
+; number of steps for center of mass motion removal
+nstcomm                  = 100
+; group(s) for center of mass motion removal
+comm-grps                = 
+
+; LANGEVIN DYNAMICS OPTIONS
+; Friction coefficient (amu/ps) and random seed
+bd-fric                  = 0
+ld-seed                  = -1
+
+; ENERGY MINIMIZATION OPTIONS
+; Force tolerance and initial step-size
+emtol                    = 10
+emstep                   = 0.01
+; Max number of iterations in relax-shells
+niter                    = 20
+; Step size (ps^2) for minimization of flexible constraints
+fcstep                   = 0
+; Frequency of steepest descents steps when doing CG
+nstcgsteep               = 1000
+nbfgscorr                = 10
+
+; TEST PARTICLE INSERTION OPTIONS
+rtpi                     = 0.05
+
+; OUTPUT CONTROL OPTIONS
+; Output frequency for coords (x), velocities (v) and forces (f)
+nstxout                  = 0
+nstvout                  = 0
+nstfout                  = 0
+; Output frequency for energies to log file and energy file
+nstlog                   = 1000
+nstcalcenergy            = 100
+nstenergy                = 1000
+; Output frequency and precision for .xtc file
+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        = System
+; Selection of energy groups
+energygrps               = 
+
+; NEIGHBORSEARCHING PARAMETERS
+; 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)
+ns-type                  = Grid
+; Periodic boundary conditions: xyz, no, xy
+pbc                      = xyz
+periodic-molecules       = no
+; Allowed energy error due to the Verlet buffer in kJ/mol/ps per atom,
+; a value of -1 means: use rlist
+verlet-buffer-tolerance  = 0.005
+; nblist cut-off        
+rlist                    = 1
+; long-range cut-off for switched potentials
+
+; OPTIONS FOR ELECTROSTATICS AND VDW
+; Method for doing electrostatics
+coulombtype              = Cut-off
+coulomb-modifier         = Potential-shift-Verlet
+rcoulomb-switch          = 0
+rcoulomb                 = 1
+; Relative dielectric constant for the medium and the reaction field
+epsilon-r                = 1
+epsilon-rf               = 0
+; Method for doing Van der Waals
+vdw-type                 = Cut-off
+vdw-modifier             = Potential-shift-Verlet
+; cut-off lengths       
+rvdw-switch              = 0
+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
+; 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               = 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
+
+; 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
+
+; OPTIONS FOR WEAK COUPLING ALGORITHMS
+; Temperature coupling  
+tcoupl                   = No
+nsttcouple               = -1
+nh-chain-length          = 10
+print-nose-hoover-chain-variables = no
+; Groups to couple separately
+tc-grps                  = 
+; Time constant (ps) and reference temperature (K)
+tau-t                    = 0.1 0.3
+ref-t                    = 
+; pressure coupling     
+pcoupl                   = No
+pcoupltype               = Isotropic
+nstpcouple               = -1
+; Time constant (ps), compressibility (1/bar) and reference P (bar)
+tau-p                    = 1
+compressibility          = 
+ref-p                    = 
+; Scaling of reference coordinates, No, All or COM
+refcoord-scaling         = No
+
+; OPTIONS FOR QMMM calculations
+QMMM                     = no
+; Groups treated Quantum Mechanically
+QMMM-grps                = 
+; QM method             
+QMmethod                 = 
+; QMMM scheme           
+QMMMscheme               = normal
+; QM basisset           
+QMbasis                  = 
+; QM charge             
+QMcharge                 = 
+; QM multiplicity       
+QMmult                   = 
+; Surface Hopping       
+SH                       = 
+; CAS space options     
+CASorbitals              = 
+CASelectrons             = 
+SAon                     = 
+SAoff                    = 
+SAsteps                  = 
+; Scale factor for MM charges
+MMChargeScaleFactor      = 1
+; Optimization of QM subsystem
+bOPT                     = 
+bTS                      = 
+
+; SIMULATED ANNEALING  
+; Type of annealing for each temperature group (no/single/periodic)
+annealing                = 
+; Number of time points to use for specifying annealing in each group
+annealing-npoints        = 
+; List of times at the annealing points for each group
+annealing-time           = 
+; Temp. at each annealing point, for each group.
+annealing-temp           = 
+
+; GENERATE VELOCITIES FOR STARTUP RUN
+gen-vel                  = no
+gen-temp                 = 300
+gen-seed                 = -1
+
+; OPTIONS FOR BONDS    
+constraints              = none
+; Type of constraint algorithm
+constraint-algorithm     = Lincs
+; Do not constrain the start configuration
+continuation             = no
+; Use successive overrelaxation to reduce the number of shake iterations
+Shake-SOR                = no
+; Relative tolerance of shake
+shake-tol                = 0.0001
+; Highest order in the expansion of the constraint coupling matrix
+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               = 1
+; Lincs will write a warning to the stderr if in one step a bond
+; rotates over more degrees than
+lincs-warnangle          = 30
+; Convert harmonic bonds to morse potentials
+morse                    = no
+
+; ENERGY GROUP EXCLUSIONS
+; Pairs of energy groups for which all non-bonded interactions are excluded
+energygrp-excl           = 
+
+; WALLS                
+; Number of walls, type, atom types, densities and box-z scale factor for Ewald
+nwall                    = 0
+wall-type                = 9-3
+wall-r-linpot            = -1
+wall-atomtype            = 
+wall-density             = 
+wall-ewald-zfac          = 3
+
+; COM PULLING          
+pull                     = 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
+; Force weighting of pairs in one distance restraint: Conservative or Equal
+disre-weighting          = Conservative
+; Use sqrt of the time averaged times the instantaneous violation
+disre-mixed              = no
+disre-fc                 = 1000
+disre-tau                = 0
+; Output frequency for pair distances to energy file
+nstdisreout              = 100
+; Orientation restraints: No or Yes
+orire                    = no
+; Orientation restraints force constant and tau for time averaging
+orire-fc                 = 0
+orire-tau                = 0
+orire-fitgrp             = 
+; Output frequency for trace(SD) and S to energy file
+nstorireout              = 100
+
+; Free energy variables
+free-energy              = no
+couple-moltype           = 
+couple-lambda0           = vdw-q
+couple-lambda1           = vdw-q
+couple-intramol          = no
+init-lambda              = -1
+init-lambda-state        = -1
+delta-lambda             = 0
+nstdhdl                  = 50
+fep-lambdas              = 
+mass-lambdas             = 
+coul-lambdas             = 
+vdw-lambdas              = 
+bonded-lambdas           = 
+restraint-lambdas        = 
+temperature-lambdas      = 
+calc-lambda-neighbors    = 1
+init-lambda-weights      = 
+dhdl-print-energy        = no
+sc-alpha                 = 0
+sc-power                 = 1
+sc-r-power               = 6
+sc-sigma                 = 0.3
+sc-coul                  = no
+separate-dhdl-file       = yes
+dhdl-derivatives         = yes
+dh_hist_size             = 0
+dh_hist_spacing          = 0.1
+
+; Non-equilibrium MD stuff
+acc-grps                 = 
+accelerate               = 
+freezegrps               = 
+freezedim                = 
+cos-acceleration         = 0
+deform                   = 
+
+; simulated tempering variables
+simulated-tempering      = no
+simulated-tempering-scaling = geometric
+sim-temp-low             = 300
+sim-temp-high            = 300
+
+; Ion/water position swapping for computational electrophysiology setups
+; Swap positions along direction: no, X, Y, Z
+swapcoords               = no
+adress                   = no
+
+; User defined thingies
+user1-grps               = 
+user2-grps               = 
+userint1                 = 0
+userint2                 = 0
+userint3                 = 0
+userint4                 = 0
+userreal1                = 0
+userreal2                = 0
+userreal3                = 0
+userreal4                = 0
+; Electric fields
+; Format for E-x, etc. is: number of cosines (int; only 1 is supported),
+; amplitude (real; V/nm), and phase (real; value is meaningless
+; for a cosine of frequency 0.
+; Format for E-xt, etc. is: omega (1/ps), time for the pulse peak (ps),
+; and sigma (ps) width of the pulse. Sigma = 0 removes the pulse,
+; leaving the field to be a cosine function.
+E-x                      = 1 0 -1
+E-xt                     = 0 0 0
+E-y                      = 1 0 -1
+E-yt                     = 0 0 0
+E-z                      = 1 0 -1
+E-zt                     = 0 0 0
+</String>
+</ReferenceData>
diff --git a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_HandlesOnlyCutoffScheme.xml b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_HandlesOnlyCutoffScheme.xml
new file mode 100644 (file)
index 0000000..7770c96
--- /dev/null
@@ -0,0 +1,350 @@
+<?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
+include                  = 
+; e.g.: -DPOSRES -DFLEXIBLE (note these variable names are case sensitive)
+define                   = 
+
+; RUN CONTROL PARAMETERS
+integrator               = md
+; Start time and timestep in ps
+tinit                    = 0
+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)
+simulation-part          = 1
+; mode for center of mass motion removal
+comm-mode                = Linear
+; number of steps for center of mass motion removal
+nstcomm                  = 100
+; group(s) for center of mass motion removal
+comm-grps                = 
+
+; LANGEVIN DYNAMICS OPTIONS
+; Friction coefficient (amu/ps) and random seed
+bd-fric                  = 0
+ld-seed                  = -1
+
+; ENERGY MINIMIZATION OPTIONS
+; Force tolerance and initial step-size
+emtol                    = 10
+emstep                   = 0.01
+; Max number of iterations in relax-shells
+niter                    = 20
+; Step size (ps^2) for minimization of flexible constraints
+fcstep                   = 0
+; Frequency of steepest descents steps when doing CG
+nstcgsteep               = 1000
+nbfgscorr                = 10
+
+; TEST PARTICLE INSERTION OPTIONS
+rtpi                     = 0.05
+
+; OUTPUT CONTROL OPTIONS
+; Output frequency for coords (x), velocities (v) and forces (f)
+nstxout                  = 0
+nstvout                  = 0
+nstfout                  = 0
+; Output frequency for energies to log file and energy file
+nstlog                   = 1000
+nstcalcenergy            = 100
+nstenergy                = 1000
+; Output frequency and precision for .xtc file
+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 (Verlet: particle based cut-offs, group: using charge groups)
+cutoff-scheme            = Group
+; nblist update frequency
+nstlist                  = 10
+; ns algorithm (simple or grid)
+ns-type                  = Grid
+; Periodic boundary conditions: xyz, no, xy
+pbc                      = xyz
+periodic-molecules       = no
+; Allowed energy error due to the Verlet buffer in kJ/mol/ps per atom,
+; a value of -1 means: use rlist
+verlet-buffer-tolerance  = 0.005
+; nblist cut-off        
+rlist                    = 1
+; long-range cut-off for switched potentials
+
+; OPTIONS FOR ELECTROSTATICS AND VDW
+; Method for doing electrostatics
+coulombtype              = Cut-off
+coulomb-modifier         = Potential-shift-Verlet
+rcoulomb-switch          = 0
+rcoulomb                 = 1
+; Relative dielectric constant for the medium and the reaction field
+epsilon-r                = 1
+epsilon-rf               = 0
+; Method for doing Van der Waals
+vdw-type                 = Cut-off
+vdw-modifier             = Potential-shift-Verlet
+; cut-off lengths       
+rvdw-switch              = 0
+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
+; 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               = 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
+
+; 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
+
+; OPTIONS FOR WEAK COUPLING ALGORITHMS
+; Temperature coupling  
+tcoupl                   = No
+nsttcouple               = -1
+nh-chain-length          = 10
+print-nose-hoover-chain-variables = no
+; Groups to couple separately
+tc-grps                  = 
+; Time constant (ps) and reference temperature (K)
+tau-t                    = 
+ref-t                    = 
+; pressure coupling     
+pcoupl                   = No
+pcoupltype               = Isotropic
+nstpcouple               = -1
+; Time constant (ps), compressibility (1/bar) and reference P (bar)
+tau-p                    = 1
+compressibility          = 
+ref-p                    = 
+; Scaling of reference coordinates, No, All or COM
+refcoord-scaling         = No
+
+; OPTIONS FOR QMMM calculations
+QMMM                     = no
+; Groups treated Quantum Mechanically
+QMMM-grps                = 
+; QM method             
+QMmethod                 = 
+; QMMM scheme           
+QMMMscheme               = normal
+; QM basisset           
+QMbasis                  = 
+; QM charge             
+QMcharge                 = 
+; QM multiplicity       
+QMmult                   = 
+; Surface Hopping       
+SH                       = 
+; CAS space options     
+CASorbitals              = 
+CASelectrons             = 
+SAon                     = 
+SAoff                    = 
+SAsteps                  = 
+; Scale factor for MM charges
+MMChargeScaleFactor      = 1
+; Optimization of QM subsystem
+bOPT                     = 
+bTS                      = 
+
+; SIMULATED ANNEALING  
+; Type of annealing for each temperature group (no/single/periodic)
+annealing                = 
+; Number of time points to use for specifying annealing in each group
+annealing-npoints        = 
+; List of times at the annealing points for each group
+annealing-time           = 
+; Temp. at each annealing point, for each group.
+annealing-temp           = 
+
+; GENERATE VELOCITIES FOR STARTUP RUN
+gen-vel                  = no
+gen-temp                 = 300
+gen-seed                 = -1
+
+; OPTIONS FOR BONDS    
+constraints              = none
+; Type of constraint algorithm
+constraint-algorithm     = Lincs
+; Do not constrain the start configuration
+continuation             = no
+; Use successive overrelaxation to reduce the number of shake iterations
+Shake-SOR                = no
+; Relative tolerance of shake
+shake-tol                = 0.0001
+; Highest order in the expansion of the constraint coupling matrix
+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               = 1
+; Lincs will write a warning to the stderr if in one step a bond
+; rotates over more degrees than
+lincs-warnangle          = 30
+; Convert harmonic bonds to morse potentials
+morse                    = no
+
+; ENERGY GROUP EXCLUSIONS
+; Pairs of energy groups for which all non-bonded interactions are excluded
+energygrp-excl           = 
+
+; WALLS                
+; Number of walls, type, atom types, densities and box-z scale factor for Ewald
+nwall                    = 0
+wall-type                = 9-3
+wall-r-linpot            = -1
+wall-atomtype            = 
+wall-density             = 
+wall-ewald-zfac          = 3
+
+; COM PULLING          
+pull                     = 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
+; Force weighting of pairs in one distance restraint: Conservative or Equal
+disre-weighting          = Conservative
+; Use sqrt of the time averaged times the instantaneous violation
+disre-mixed              = no
+disre-fc                 = 1000
+disre-tau                = 0
+; Output frequency for pair distances to energy file
+nstdisreout              = 100
+; Orientation restraints: No or Yes
+orire                    = no
+; Orientation restraints force constant and tau for time averaging
+orire-fc                 = 0
+orire-tau                = 0
+orire-fitgrp             = 
+; Output frequency for trace(SD) and S to energy file
+nstorireout              = 100
+
+; Free energy variables
+free-energy              = no
+couple-moltype           = 
+couple-lambda0           = vdw-q
+couple-lambda1           = vdw-q
+couple-intramol          = no
+init-lambda              = -1
+init-lambda-state        = -1
+delta-lambda             = 0
+nstdhdl                  = 50
+fep-lambdas              = 
+mass-lambdas             = 
+coul-lambdas             = 
+vdw-lambdas              = 
+bonded-lambdas           = 
+restraint-lambdas        = 
+temperature-lambdas      = 
+calc-lambda-neighbors    = 1
+init-lambda-weights      = 
+dhdl-print-energy        = no
+sc-alpha                 = 0
+sc-power                 = 1
+sc-r-power               = 6
+sc-sigma                 = 0.3
+sc-coul                  = no
+separate-dhdl-file       = yes
+dhdl-derivatives         = yes
+dh_hist_size             = 0
+dh_hist_spacing          = 0.1
+
+; Non-equilibrium MD stuff
+acc-grps                 = 
+accelerate               = 
+freezegrps               = 
+freezedim                = 
+cos-acceleration         = 0
+deform                   = 
+
+; simulated tempering variables
+simulated-tempering      = no
+simulated-tempering-scaling = geometric
+sim-temp-low             = 300
+sim-temp-high            = 300
+
+; Ion/water position swapping for computational electrophysiology setups
+; Swap positions along direction: no, X, Y, Z
+swapcoords               = no
+adress                   = no
+
+; User defined thingies
+user1-grps               = 
+user2-grps               = 
+userint1                 = 0
+userint2                 = 0
+userint3                 = 0
+userint4                 = 0
+userreal1                = 0
+userreal2                = 0
+userreal3                = 0
+userreal4                = 0
+; Electric fields
+; Format for E-x, etc. is: number of cosines (int; only 1 is supported),
+; amplitude (real; V/nm), and phase (real; value is meaningless
+; for a cosine of frequency 0.
+; Format for E-xt, etc. is: omega (1/ps), time for the pulse peak (ps),
+; and sigma (ps) width of the pulse. Sigma = 0 removes the pulse,
+; leaving the field to be a cosine function.
+E-x                      = 1 0 -1
+E-xt                     = 0 0 0
+E-y                      = 1 0 -1
+E-yt                     = 0 0 0
+E-z                      = 1 0 -1
+E-zt                     = 0 0 0
+</String>
+</ReferenceData>
diff --git a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_ProducesOutputFromElectricField.xml b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_ProducesOutputFromElectricField.xml
new file mode 100644 (file)
index 0000000..5122199
--- /dev/null
@@ -0,0 +1,350 @@
+<?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
+include                  = 
+; e.g.: -DPOSRES -DFLEXIBLE (note these variable names are case sensitive)
+define                   = 
+
+; RUN CONTROL PARAMETERS
+integrator               = md
+; Start time and timestep in ps
+tinit                    = 0
+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)
+simulation-part          = 1
+; mode for center of mass motion removal
+comm-mode                = Linear
+; number of steps for center of mass motion removal
+nstcomm                  = 100
+; group(s) for center of mass motion removal
+comm-grps                = 
+
+; LANGEVIN DYNAMICS OPTIONS
+; Friction coefficient (amu/ps) and random seed
+bd-fric                  = 0
+ld-seed                  = -1
+
+; ENERGY MINIMIZATION OPTIONS
+; Force tolerance and initial step-size
+emtol                    = 10
+emstep                   = 0.01
+; Max number of iterations in relax-shells
+niter                    = 20
+; Step size (ps^2) for minimization of flexible constraints
+fcstep                   = 0
+; Frequency of steepest descents steps when doing CG
+nstcgsteep               = 1000
+nbfgscorr                = 10
+
+; TEST PARTICLE INSERTION OPTIONS
+rtpi                     = 0.05
+
+; OUTPUT CONTROL OPTIONS
+; Output frequency for coords (x), velocities (v) and forces (f)
+nstxout                  = 0
+nstvout                  = 0
+nstfout                  = 0
+; Output frequency for energies to log file and energy file
+nstlog                   = 1000
+nstcalcenergy            = 100
+nstenergy                = 1000
+; Output frequency and precision for .xtc file
+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 (Verlet: particle based cut-offs, group: using charge groups)
+cutoff-scheme            = Verlet
+; nblist update frequency
+nstlist                  = 10
+; ns algorithm (simple or grid)
+ns-type                  = Grid
+; Periodic boundary conditions: xyz, no, xy
+pbc                      = xyz
+periodic-molecules       = no
+; Allowed energy error due to the Verlet buffer in kJ/mol/ps per atom,
+; a value of -1 means: use rlist
+verlet-buffer-tolerance  = 0.005
+; nblist cut-off        
+rlist                    = 1
+; long-range cut-off for switched potentials
+
+; OPTIONS FOR ELECTROSTATICS AND VDW
+; Method for doing electrostatics
+coulombtype              = Cut-off
+coulomb-modifier         = Potential-shift-Verlet
+rcoulomb-switch          = 0
+rcoulomb                 = 1
+; Relative dielectric constant for the medium and the reaction field
+epsilon-r                = 1
+epsilon-rf               = 0
+; Method for doing Van der Waals
+vdw-type                 = Cut-off
+vdw-modifier             = Potential-shift-Verlet
+; cut-off lengths       
+rvdw-switch              = 0
+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
+; 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               = 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
+
+; 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
+
+; OPTIONS FOR WEAK COUPLING ALGORITHMS
+; Temperature coupling  
+tcoupl                   = No
+nsttcouple               = -1
+nh-chain-length          = 10
+print-nose-hoover-chain-variables = no
+; Groups to couple separately
+tc-grps                  = 
+; Time constant (ps) and reference temperature (K)
+tau-t                    = 
+ref-t                    = 
+; pressure coupling     
+pcoupl                   = No
+pcoupltype               = Isotropic
+nstpcouple               = -1
+; Time constant (ps), compressibility (1/bar) and reference P (bar)
+tau-p                    = 1
+compressibility          = 
+ref-p                    = 
+; Scaling of reference coordinates, No, All or COM
+refcoord-scaling         = No
+
+; OPTIONS FOR QMMM calculations
+QMMM                     = no
+; Groups treated Quantum Mechanically
+QMMM-grps                = 
+; QM method             
+QMmethod                 = 
+; QMMM scheme           
+QMMMscheme               = normal
+; QM basisset           
+QMbasis                  = 
+; QM charge             
+QMcharge                 = 
+; QM multiplicity       
+QMmult                   = 
+; Surface Hopping       
+SH                       = 
+; CAS space options     
+CASorbitals              = 
+CASelectrons             = 
+SAon                     = 
+SAoff                    = 
+SAsteps                  = 
+; Scale factor for MM charges
+MMChargeScaleFactor      = 1
+; Optimization of QM subsystem
+bOPT                     = 
+bTS                      = 
+
+; SIMULATED ANNEALING  
+; Type of annealing for each temperature group (no/single/periodic)
+annealing                = 
+; Number of time points to use for specifying annealing in each group
+annealing-npoints        = 
+; List of times at the annealing points for each group
+annealing-time           = 
+; Temp. at each annealing point, for each group.
+annealing-temp           = 
+
+; GENERATE VELOCITIES FOR STARTUP RUN
+gen-vel                  = no
+gen-temp                 = 300
+gen-seed                 = -1
+
+; OPTIONS FOR BONDS    
+constraints              = none
+; Type of constraint algorithm
+constraint-algorithm     = Lincs
+; Do not constrain the start configuration
+continuation             = no
+; Use successive overrelaxation to reduce the number of shake iterations
+Shake-SOR                = no
+; Relative tolerance of shake
+shake-tol                = 0.0001
+; Highest order in the expansion of the constraint coupling matrix
+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               = 1
+; Lincs will write a warning to the stderr if in one step a bond
+; rotates over more degrees than
+lincs-warnangle          = 30
+; Convert harmonic bonds to morse potentials
+morse                    = no
+
+; ENERGY GROUP EXCLUSIONS
+; Pairs of energy groups for which all non-bonded interactions are excluded
+energygrp-excl           = 
+
+; WALLS                
+; Number of walls, type, atom types, densities and box-z scale factor for Ewald
+nwall                    = 0
+wall-type                = 9-3
+wall-r-linpot            = -1
+wall-atomtype            = 
+wall-density             = 
+wall-ewald-zfac          = 3
+
+; COM PULLING          
+pull                     = 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
+; Force weighting of pairs in one distance restraint: Conservative or Equal
+disre-weighting          = Conservative
+; Use sqrt of the time averaged times the instantaneous violation
+disre-mixed              = no
+disre-fc                 = 1000
+disre-tau                = 0
+; Output frequency for pair distances to energy file
+nstdisreout              = 100
+; Orientation restraints: No or Yes
+orire                    = no
+; Orientation restraints force constant and tau for time averaging
+orire-fc                 = 0
+orire-tau                = 0
+orire-fitgrp             = 
+; Output frequency for trace(SD) and S to energy file
+nstorireout              = 100
+
+; Free energy variables
+free-energy              = no
+couple-moltype           = 
+couple-lambda0           = vdw-q
+couple-lambda1           = vdw-q
+couple-intramol          = no
+init-lambda              = -1
+init-lambda-state        = -1
+delta-lambda             = 0
+nstdhdl                  = 50
+fep-lambdas              = 
+mass-lambdas             = 
+coul-lambdas             = 
+vdw-lambdas              = 
+bonded-lambdas           = 
+restraint-lambdas        = 
+temperature-lambdas      = 
+calc-lambda-neighbors    = 1
+init-lambda-weights      = 
+dhdl-print-energy        = no
+sc-alpha                 = 0
+sc-power                 = 1
+sc-r-power               = 6
+sc-sigma                 = 0.3
+sc-coul                  = no
+separate-dhdl-file       = yes
+dhdl-derivatives         = yes
+dh_hist_size             = 0
+dh_hist_spacing          = 0.1
+
+; Non-equilibrium MD stuff
+acc-grps                 = 
+accelerate               = 
+freezegrps               = 
+freezedim                = 
+cos-acceleration         = 0
+deform                   = 
+
+; simulated tempering variables
+simulated-tempering      = no
+simulated-tempering-scaling = geometric
+sim-temp-low             = 300
+sim-temp-high            = 300
+
+; Ion/water position swapping for computational electrophysiology setups
+; Swap positions along direction: no, X, Y, Z
+swapcoords               = no
+adress                   = no
+
+; User defined thingies
+user1-grps               = 
+user2-grps               = 
+userint1                 = 0
+userint2                 = 0
+userint3                 = 0
+userint4                 = 0
+userreal1                = 0
+userreal2                = 0
+userreal3                = 0
+userreal4                = 0
+; Electric fields
+; Format for E-x, etc. is: number of cosines (int; only 1 is supported),
+; amplitude (real; V/nm), and phase (real; value is meaningless
+; for a cosine of frequency 0.
+; Format for E-xt, etc. is: omega (1/ps), time for the pulse peak (ps),
+; and sigma (ps) width of the pulse. Sigma = 0 removes the pulse,
+; leaving the field to be a cosine function.
+E-x                      = 1 1.2 -1
+E-xt                     = 0 0 0
+E-y                      = 1 0 -1
+E-yt                     = 0 0 0
+E-z                      = 1 0 -1
+E-zt                     = 0 0 0
+</String>
+</ReferenceData>
diff --git a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_UserErrorsSilentlyTolerated.xml b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_UserErrorsSilentlyTolerated.xml
new file mode 100644 (file)
index 0000000..ec270ff
--- /dev/null
@@ -0,0 +1,350 @@
+<?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
+include                  = 
+; e.g.: -DPOSRES -DFLEXIBLE (note these variable names are case sensitive)
+define                   = 
+
+; RUN CONTROL PARAMETERS
+integrator               = md
+; Start time and timestep in ps
+tinit                    = 0
+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)
+simulation-part          = 1
+; mode for center of mass motion removal
+comm-mode                = Linear
+; number of steps for center of mass motion removal
+nstcomm                  = 100
+; group(s) for center of mass motion removal
+comm-grps                = 
+
+; LANGEVIN DYNAMICS OPTIONS
+; Friction coefficient (amu/ps) and random seed
+bd-fric                  = 0
+ld-seed                  = -1
+
+; ENERGY MINIMIZATION OPTIONS
+; Force tolerance and initial step-size
+emtol                    = 10
+emstep                   = 0.01
+; Max number of iterations in relax-shells
+niter                    = 20
+; Step size (ps^2) for minimization of flexible constraints
+fcstep                   = 0
+; Frequency of steepest descents steps when doing CG
+nstcgsteep               = 1000
+nbfgscorr                = 10
+
+; TEST PARTICLE INSERTION OPTIONS
+rtpi                     = 0.05
+
+; OUTPUT CONTROL OPTIONS
+; Output frequency for coords (x), velocities (v) and forces (f)
+nstxout                  = 0
+nstvout                  = 0
+nstfout                  = 0
+; Output frequency for energies to log file and energy file
+nstlog                   = 1000
+nstcalcenergy            = 100
+nstenergy                = 1000
+; Output frequency and precision for .xtc file
+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 (Verlet: particle based cut-offs, group: using charge groups)
+cutoff-scheme            = Verlet
+; nblist update frequency
+nstlist                  = 10
+; ns algorithm (simple or grid)
+ns-type                  = Grid
+; Periodic boundary conditions: xyz, no, xy
+pbc                      = xyz
+periodic-molecules       = no
+; Allowed energy error due to the Verlet buffer in kJ/mol/ps per atom,
+; a value of -1 means: use rlist
+verlet-buffer-tolerance  = 0.005
+; nblist cut-off        
+rlist                    = 1
+; long-range cut-off for switched potentials
+
+; OPTIONS FOR ELECTROSTATICS AND VDW
+; Method for doing electrostatics
+coulombtype              = Cut-off
+coulomb-modifier         = Potential-shift-Verlet
+rcoulomb-switch          = 0
+rcoulomb                 = 1
+; Relative dielectric constant for the medium and the reaction field
+epsilon-r                = 1
+epsilon-rf               = 0
+; Method for doing Van der Waals
+vdw-type                 = Cut-off
+vdw-modifier             = Potential-shift-Verlet
+; cut-off lengths       
+rvdw-switch              = 0
+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
+; 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               = 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
+
+; 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
+
+; OPTIONS FOR WEAK COUPLING ALGORITHMS
+; Temperature coupling  
+tcoupl                   = No
+nsttcouple               = -1
+nh-chain-length          = 10
+print-nose-hoover-chain-variables = no
+; Groups to couple separately
+tc-grps                  = 
+; Time constant (ps) and reference temperature (K)
+tau-t                    = 
+ref-t                    = 
+; pressure coupling     
+pcoupl                   = No
+pcoupltype               = Isotropic
+nstpcouple               = -1
+; Time constant (ps), compressibility (1/bar) and reference P (bar)
+tau-p                    = 1
+compressibility          = 
+ref-p                    = 
+; Scaling of reference coordinates, No, All or COM
+refcoord-scaling         = No
+
+; OPTIONS FOR QMMM calculations
+QMMM                     = no
+; Groups treated Quantum Mechanically
+QMMM-grps                = 
+; QM method             
+QMmethod                 = 
+; QMMM scheme           
+QMMMscheme               = normal
+; QM basisset           
+QMbasis                  = 
+; QM charge             
+QMcharge                 = 
+; QM multiplicity       
+QMmult                   = 
+; Surface Hopping       
+SH                       = 
+; CAS space options     
+CASorbitals              = 
+CASelectrons             = 
+SAon                     = 
+SAoff                    = 
+SAsteps                  = 
+; Scale factor for MM charges
+MMChargeScaleFactor      = 1
+; Optimization of QM subsystem
+bOPT                     = 
+bTS                      = 
+
+; SIMULATED ANNEALING  
+; Type of annealing for each temperature group (no/single/periodic)
+annealing                = 
+; Number of time points to use for specifying annealing in each group
+annealing-npoints        = 
+; List of times at the annealing points for each group
+annealing-time           = 
+; Temp. at each annealing point, for each group.
+annealing-temp           = 
+
+; GENERATE VELOCITIES FOR STARTUP RUN
+gen-vel                  = no
+gen-temp                 = 300
+gen-seed                 = -1
+
+; OPTIONS FOR BONDS    
+constraints              = none
+; Type of constraint algorithm
+constraint-algorithm     = Lincs
+; Do not constrain the start configuration
+continuation             = no
+; Use successive overrelaxation to reduce the number of shake iterations
+Shake-SOR                = no
+; Relative tolerance of shake
+shake-tol                = 0.0001
+; Highest order in the expansion of the constraint coupling matrix
+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               = 1
+; Lincs will write a warning to the stderr if in one step a bond
+; rotates over more degrees than
+lincs-warnangle          = 30
+; Convert harmonic bonds to morse potentials
+morse                    = no
+
+; ENERGY GROUP EXCLUSIONS
+; Pairs of energy groups for which all non-bonded interactions are excluded
+energygrp-excl           = 
+
+; WALLS                
+; Number of walls, type, atom types, densities and box-z scale factor for Ewald
+nwall                    = 0
+wall-type                = 9-3
+wall-r-linpot            = -1
+wall-atomtype            = 
+wall-density             = 
+wall-ewald-zfac          = 3
+
+; COM PULLING          
+pull                     = 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
+; Force weighting of pairs in one distance restraint: Conservative or Equal
+disre-weighting          = Conservative
+; Use sqrt of the time averaged times the instantaneous violation
+disre-mixed              = no
+disre-fc                 = 1000
+disre-tau                = 0
+; Output frequency for pair distances to energy file
+nstdisreout              = 100
+; Orientation restraints: No or Yes
+orire                    = no
+; Orientation restraints force constant and tau for time averaging
+orire-fc                 = 0
+orire-tau                = 0
+orire-fitgrp             = 
+; Output frequency for trace(SD) and S to energy file
+nstorireout              = 100
+
+; Free energy variables
+free-energy              = no
+couple-moltype           = 
+couple-lambda0           = vdw-q
+couple-lambda1           = vdw-q
+couple-intramol          = no
+init-lambda              = -1
+init-lambda-state        = -1
+delta-lambda             = 0
+nstdhdl                  = 50
+fep-lambdas              = 
+mass-lambdas             = 
+coul-lambdas             = 
+vdw-lambdas              = 
+bonded-lambdas           = 
+restraint-lambdas        = 
+temperature-lambdas      = 
+calc-lambda-neighbors    = 1
+init-lambda-weights      = 
+dhdl-print-energy        = no
+sc-alpha                 = 0
+sc-power                 = 1
+sc-r-power               = 6
+sc-sigma                 = 0.3
+sc-coul                  = no
+separate-dhdl-file       = yes
+dhdl-derivatives         = yes
+dh_hist_size             = 0
+dh_hist_spacing          = 0.1
+
+; Non-equilibrium MD stuff
+acc-grps                 = 
+accelerate               = 
+freezegrps               = 
+freezedim                = 
+cos-acceleration         = 0
+deform                   = 
+
+; simulated tempering variables
+simulated-tempering      = no
+simulated-tempering-scaling = geometric
+sim-temp-low             = 300
+sim-temp-high            = 300
+
+; Ion/water position swapping for computational electrophysiology setups
+; Swap positions along direction: no, X, Y, Z
+swapcoords               = no
+adress                   = no
+
+; User defined thingies
+user1-grps               = 
+user2-grps               = 
+userint1                 = 0
+userint2                 = 0
+userint3                 = 0
+userint4                 = 0
+userreal1                = 0
+userreal2                = 0
+userreal3                = 0
+userreal4                = 0
+; Electric fields
+; Format for E-x, etc. is: number of cosines (int; only 1 is supported),
+; amplitude (real; V/nm), and phase (real; value is meaningless
+; for a cosine of frequency 0.
+; Format for E-xt, etc. is: omega (1/ps), time for the pulse peak (ps),
+; and sigma (ps) width of the pulse. Sigma = 0 removes the pulse,
+; leaving the field to be a cosine function.
+E-x                      = 1 0 -1
+E-xt                     = 0 0 0
+E-y                      = 1 0 -1
+E-yt                     = 0 0 0
+E-z                      = 1 0 -1
+E-zt                     = 0 0 0
+</String>
+</ReferenceData>
index c2e1ebe4b41eb6ccccb47e1e5fbd5448148e37dc..97523622ec38fb414f814b8c3562ce937627a969 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,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.
@@ -65,7 +65,7 @@ static t_2morse *read_dissociation_energies(int *n2morse)
     char        ai[32], aj[32];
     double      e_diss;
     const char *fn     = "edissoc.dat";
-    t_2morse   *t2m    = NULL;
+    t_2morse   *t2m    = nullptr;
     int         maxn2m = 0, n2m = 0;
     int         nread;
 
index 6120e2d155a76b8ac59849e2c8806cce1b170b4a..b955ba2d91ad3dfd5dedff082b2af3d4e3c5ed9f 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,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.
@@ -331,7 +331,7 @@ directive str2dir (char *dstr)
     return d_invalid;
 }
 
-static directive **necessary = NULL;
+static directive **necessary = nullptr;
 
 static void set_nec(directive **n, ...)
 /* Must always have at least one extra argument */
@@ -353,7 +353,7 @@ static void set_nec(directive **n, ...)
 
 void DS_Init(DirStack **DS)
 {
-    if (necessary == NULL)
+    if (necessary == nullptr)
     {
         int i;
 
@@ -423,7 +423,7 @@ void DS_Init(DirStack **DS)
             }
         }
     }
-    *DS = NULL;
+    *DS = nullptr;
 
 }
 
@@ -431,7 +431,7 @@ void DS_Done (DirStack **DS)
 {
     DirStack *D;
 
-    while (*DS != NULL)
+    while (*DS != nullptr)
     {
         D   = *DS;
         *DS = (*DS)->prev;
@@ -454,12 +454,12 @@ int DS_Search(DirStack *DS, directive d)
     DirStack *D;
 
     D = DS;
-    while ((D != NULL) && (D->d != d))
+    while ((D != nullptr) && (D->d != d))
     {
         D = D->prev;
     }
 
-    return (D != NULL);
+    return (D != nullptr);
 }
 
 int DS_Check_Order(DirStack *DS, directive d)
index e37e6d3c31aa28afa7b37f598bea299527392c66..905e27da4e3452bbe6b5043ff406f6f310b93d24 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,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.
@@ -47,6 +47,8 @@
 #include <cassert>
 #include <cmath>
 
+#include <algorithm>
+
 #include <sys/types.h>
 
 #include "gromacs/fileio/gmxfio.h"
@@ -55,6 +57,7 @@
 #include "gromacs/gmxpreprocess/gpp_bond_atomtype.h"
 #include "gromacs/gmxpreprocess/gpp_nextnb.h"
 #include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/gmxpreprocess/readir.h"
 #include "gromacs/gmxpreprocess/topdirs.h"
 #include "gromacs/gmxpreprocess/toppush.h"
 #include "gromacs/gmxpreprocess/topshake.h"
@@ -65,6 +68,7 @@
 #include "gromacs/mdlib/genborn.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/topology/block.h"
 #include "gromacs/topology/ifunc.h"
 #include "gromacs/topology/symtab.h"
@@ -73,6 +77,7 @@
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/pleasecite.h"
 #include "gromacs/utility/smalloc.h"
 
 #define OPENDIR     '[' /* starting sign for directive */
@@ -230,29 +235,60 @@ double check_mol(gmx_mtop_t *mtop, warninp_t wi)
     return q;
 }
 
-static void sum_q(t_atoms *atoms, int n, double *qt, double *qBt)
+/*! \brief Returns the rounded charge of a molecule, when close to integer, otherwise returns the original charge.
+ *
+ * The results of this routine are only used for checking and for
+ * printing warning messages. Thus we can assume that charges of molecules
+ * should be integer. If the user wanted non-integer molecular charge,
+ * an undesired warning is printed and the user should use grompp -maxwarn 1.
+ *
+ * \param qMol     The total, unrounded, charge of the molecule
+ * \param sumAbsQ  The sum of absolute values of the charges, used for determining the tolerance for the rounding.
+ */
+static double roundedMoleculeCharge(double qMol, double sumAbsQ)
 {
-    double  qmolA, qmolB;
-    int     i;
-
-    /* sum charge */
-    qmolA = 0;
-    qmolB = 0;
-    for (i = 0; i < atoms->nr; i++)
+    /* We use a tolerance of 1e-6 for inaccuracies beyond the 6th decimal
+     * of the charges for ascii float truncation in the topology files.
+     * Although the summation here uses double precision, the charges
+     * are read and stored in single precision when real=float. This can
+     * lead to rounding errors of half the least significant bit.
+     * Note that, unfortunately, we can not assume addition of random
+     * rounding errors. It is not entirely unlikely that many charges
+     * have a near half-bit rounding error with the same sign.
+     */
+    double tolAbs = 1e-6;
+    double tol    = std::max(tolAbs, 0.5*GMX_REAL_EPS*sumAbsQ);
+    double qRound = std::round(qMol);
+    if (std::abs(qMol - qRound) <= tol)
     {
-        qmolA += atoms->atom[i].q;
-        qmolB += atoms->atom[i].qB;
+        return qRound;
     }
-    /* Unfortunately an absolute comparison,
-     * but this avoids unnecessary warnings and gmx-users mails.
-     */
-    if (fabs(qmolA) >= 1e-6 || fabs(qmolB) >= 1e-6)
+    else
     {
-        *qt  += n*qmolA;
-        *qBt += n*qmolB;
+        return qMol;
     }
 }
 
+static void sum_q(const t_atoms *atoms, int numMols,
+                  double *qTotA, double *qTotB)
+{
+    /* sum charge */
+    double qmolA    = 0;
+    double qmolB    = 0;
+    double sumAbsQA = 0;
+    double sumAbsQB = 0;
+    for (int i = 0; i < atoms->nr; i++)
+    {
+        qmolA    += atoms->atom[i].q;
+        qmolB    += atoms->atom[i].qB;
+        sumAbsQA += std::abs(atoms->atom[i].q);
+        sumAbsQB += std::abs(atoms->atom[i].qB);
+    }
+
+    *qTotA += numMols*roundedMoleculeCharge(qmolA, sumAbsQA);
+    *qTotB += numMols*roundedMoleculeCharge(qmolB, sumAbsQB);
+}
+
 static void get_nbparm(char *nb_str, char *comb_str, int *nb, int *comb,
                        warninp_t wi)
 {
@@ -269,7 +305,7 @@ static void get_nbparm(char *nb_str, char *comb_str, int *nb, int *comb,
     }
     if (*nb == -1)
     {
-        *nb = strtol(nb_str, NULL, 10);
+        *nb = strtol(nb_str, nullptr, 10);
     }
     if ((*nb < 1) || (*nb >= eNBF_NR))
     {
@@ -288,7 +324,7 @@ static void get_nbparm(char *nb_str, char *comb_str, int *nb, int *comb,
     }
     if (*comb == -1)
     {
-        *comb = strtol(comb_str, NULL, 10);
+        *comb = strtol(comb_str, nullptr, 10);
     }
     if ((*comb < 1) || (*comb >= eCOMB_NR))
     {
@@ -305,7 +341,7 @@ static char ** cpp_opts(const char *define, const char *include,
     int         n, len;
     int         ncppopts = 0;
     const char *cppadds[2];
-    char      **cppopts   = NULL;
+    char      **cppopts   = nullptr;
     const char *option[2] = { "-D", "-I" };
     const char *nopt[2]   = { "define", "include" };
     const char *ptr;
@@ -354,13 +390,13 @@ static char ** cpp_opts(const char *define, const char *include,
         }
     }
     srenew(cppopts, ++ncppopts);
-    cppopts[ncppopts-1] = NULL;
+    cppopts[ncppopts-1] = nullptr;
 
     return cppopts;
 }
 
 
-int
+static int
 find_gb_bondlength(t_params *plist, int ai, int aj, real *length)
 {
     int i, j, a1, a2;
@@ -392,7 +428,7 @@ find_gb_bondlength(t_params *plist, int ai, int aj, real *length)
 }
 
 
-int
+static int
 find_gb_anglelength(t_params *plist, int ai, int ak, real *length)
 {
     int  i, j, a1, a2, a3;
@@ -436,7 +472,7 @@ find_gb_anglelength(t_params *plist, int ai, int ak, real *length)
     return status;
 }
 
-int
+static int
 generate_gb_exclusion_interactions(t_molinfo *mi, gpp_atomtype_t atype, t_nextnb *nnb)
 {
     int          j, n, ai, aj, ti, tj;
@@ -544,7 +580,7 @@ static void make_atoms_sys(int nmolb, const gmx_molblock_t *molb,
     const t_atoms *mol_atoms;
 
     atoms->nr   = 0;
-    atoms->atom = NULL;
+    atoms->atom = nullptr;
 
     for (mb = 0; mb < nmolb; mb++)
     {
@@ -581,18 +617,19 @@ static char **read_topol(const char *infile, const char *outfile,
                          gmx_bool        bFEP,
                          gmx_bool        bGenborn,
                          gmx_bool        bZero,
-                         warninp_t   wi)
+                         gmx_bool        usingFullRangeElectrostatics,
+                         warninp_t       wi)
 {
     FILE           *out;
     int             i, sl, nb_funct;
-    char           *pline = NULL, **title = NULL;
+    char           *pline = nullptr, **title = nullptr;
     char            line[STRLEN], errbuf[256], comb_str[256], nb_str[256];
     char            genpairs[32];
     char           *dirstr, *dummy2;
     int             nrcopies, nmol, nmolb = 0, nscan, ncombs, ncopy;
     double          fLJ, fQQ, fPOW;
-    gmx_molblock_t *molb  = NULL;
-    t_molinfo      *mi0   = NULL;
+    gmx_molblock_t *molb  = nullptr;
+    t_molinfo      *mi0   = nullptr;
     DirStack       *DS;
     directive       d, newd;
     t_nbparam     **nbparam, **pair;
@@ -606,7 +643,7 @@ static char **read_topol(const char *infile, const char *outfile,
     /* File handling variables */
     int             status, done;
     gmx_cpp_t       handle;
-    char           *tmp_line = NULL;
+    char           *tmp_line = nullptr;
     char            warn_buf[STRLEN];
     const char     *floating_point_arithmetic_tip =
         "Total charge should normally be an integer. See\n"
@@ -621,7 +658,7 @@ static char **read_topol(const char *infile, const char *outfile,
     }
     else
     {
-        out = NULL;
+        out = nullptr;
     }
 
     /* open input file */
@@ -635,14 +672,14 @@ static char **read_topol(const char *infile, const char *outfile,
     DS_Init(&DS);         /* directive stack                    */
     nmol     = 0;         /* no molecules yet...                        */
     d        = d_invalid; /* first thing should be a directive   */
-    nbparam  = NULL;      /* The temporary non-bonded matrix       */
-    pair     = NULL;      /* The temporary pair interaction matrix */
-    block2   = NULL;      /* the extra exclusions                       */
+    nbparam  = nullptr;   /* The temporary non-bonded matrix       */
+    pair     = nullptr;   /* The temporary pair interaction matrix */
+    block2   = nullptr;   /* the extra exclusions                       */
     nb_funct = F_LJ;
 
     *reppow  = 12.0;      /* Default value for repulsion power     */
 
-    *intermolecular_interactions = NULL;
+    *intermolecular_interactions = nullptr;
 
     /* Init the number of CMAP torsion angles  and grid spacing */
     plist[F_CMAP].grid_spacing = 0;
@@ -732,7 +769,7 @@ static char **read_topol(const char *infile, const char *outfile,
                      * skip spaces and tabs on either side of directive
                      */
                     dirstr = gmx_strdup((pline+1));
-                    if ((dummy2 = strchr (dirstr, CLOSEDIR)) != NULL)
+                    if ((dummy2 = strchr (dirstr, CLOSEDIR)) != nullptr)
                     {
                         (*dummy2) = 0;
                     }
@@ -766,7 +803,7 @@ static char **read_topol(const char *infile, const char *outfile,
 
                         if (d == d_intermolecular_interactions)
                         {
-                            if (*intermolecular_interactions == NULL)
+                            if (*intermolecular_interactions == nullptr)
                             {
                                 /* We (mis)use the moleculetype processing
                                  * to process the intermolecular interactions
@@ -836,14 +873,14 @@ static char **read_topol(const char *infile, const char *outfile,
                             break;
                         case d_atomtypes:
                             push_at(symtab, atype, batype, pline, nb_funct,
-                                    &nbparam, bGenPairs ? &pair : NULL, wi);
+                                    &nbparam, bGenPairs ? &pair : nullptr, wi);
                             break;
 
                         case d_bondtypes:
-                            push_bt(d, plist, 2, NULL, batype, pline, wi);
+                            push_bt(d, plist, 2, nullptr, batype, pline, wi);
                             break;
                         case d_constrainttypes:
-                            push_bt(d, plist, 2, NULL, batype, pline, wi);
+                            push_bt(d, plist, 2, nullptr, batype, pline, wi);
                             break;
                         case d_pairtypes:
                             if (bGenPairs)
@@ -852,11 +889,11 @@ static char **read_topol(const char *infile, const char *outfile,
                             }
                             else
                             {
-                                push_bt(d, plist, 2, atype, NULL, pline, wi);
+                                push_bt(d, plist, 2, atype, nullptr, pline, wi);
                             }
                             break;
                         case d_angletypes:
-                            push_bt(d, plist, 3, NULL, batype, pline, wi);
+                            push_bt(d, plist, 3, nullptr, batype, pline, wi);
                             break;
                         case d_dihedraltypes:
                             /* Special routine that can read both 2 and 4 atom dihedral definitions. */
@@ -896,14 +933,14 @@ static char **read_topol(const char *infile, const char *outfile,
                             if (!bReadMolType)
                             {
                                 int ntype;
-                                if (opts->couple_moltype != NULL &&
+                                if (opts->couple_moltype != nullptr &&
                                     (opts->couple_lam0 == ecouplamNONE ||
                                      opts->couple_lam0 == ecouplamQ ||
                                      opts->couple_lam1 == ecouplamNONE ||
                                      opts->couple_lam1 == ecouplamQ))
                                 {
                                     dcatt = add_atomtype_decoupled(symtab, atype,
-                                                                   &nbparam, bGenPairs ? &pair : NULL);
+                                                                   &nbparam, bGenPairs ? &pair : nullptr);
                                 }
                                 ntype  = get_atomtype_ntypes(atype);
                                 ncombs = (ntype*(ntype+1))/2;
@@ -927,8 +964,13 @@ static char **read_topol(const char *infile, const char *outfile,
 
                             push_molt(symtab, &nmol, molinfo, pline, wi);
                             srenew(block2, nmol);
-                            block2[nmol-1].nr = 0;
-                            mi0               = &((*molinfo)[nmol-1]);
+                            block2[nmol-1].nr      = 0;
+                            mi0                    = &((*molinfo)[nmol-1]);
+                            mi0->atoms.haveMass    = TRUE;
+                            mi0->atoms.haveCharge  = TRUE;
+                            mi0->atoms.haveType    = TRUE;
+                            mi0->atoms.haveBState  = TRUE;
+                            mi0->atoms.havePdbInfo = FALSE;
                             break;
                         }
                         case d_atoms:
@@ -995,7 +1037,7 @@ static char **read_topol(const char *infile, const char *outfile,
                             molb[nmolb].nmol = nrcopies;
                             nmolb++;
 
-                            bCouple = (opts->couple_moltype != NULL &&
+                            bCouple = (opts->couple_moltype != nullptr &&
                                        (gmx_strcasecmp("system", opts->couple_moltype) == 0 ||
                                         strcmp(*(mi0->name), opts->couple_moltype) == 0));
                             if (bCouple)
@@ -1055,7 +1097,7 @@ static char **read_topol(const char *infile, const char *outfile,
                 }
             }
             sfree(pline);
-            pline = NULL;
+            pline = nullptr;
         }
     }
     while (!done);
@@ -1086,6 +1128,7 @@ static char **read_topol(const char *infile, const char *outfile,
     {
         title = put_symtab(symtab, "");
     }
+
     if (fabs(qt) > 1e-4)
     {
         sprintf(warn_buf, "System has non-zero total charge: %.6f\n%s\n", qt, floating_point_arithmetic_tip);
@@ -1096,6 +1139,12 @@ static char **read_topol(const char *infile, const char *outfile,
         sprintf(warn_buf, "State B has non-zero total charge: %.6f\n%s\n", qBt, floating_point_arithmetic_tip);
         warning_note(wi, warn_buf);
     }
+    if (usingFullRangeElectrostatics && (fabs(qt) > 1e-4 || fabs(qBt) > 1e-4))
+    {
+        warning(wi, "You are using Ewald electrostatics in a system with net charge. This can lead to severe artifacts, such as ions moving into regions with low dielectric, due to the uniform background charge. We suggest to neutralize your system with counter ions, possibly in combination with a physiological salt concentration.");
+        please_cite(stdout, "Hub2014a");
+    }
+
     DS_Done (&DS);
     for (i = 0; i < nmol; i++)
     {
@@ -1105,7 +1154,7 @@ static char **read_topol(const char *infile, const char *outfile,
 
     done_bond_atomtype(&batype);
 
-    if (*intermolecular_interactions != NULL)
+    if (*intermolecular_interactions != nullptr)
     {
         sfree(mi0->atoms.atom);
     }
@@ -1148,7 +1197,7 @@ char **do_top(gmx_bool          bVerbose,
     }
     else
     {
-        tmpfile = NULL;
+        tmpfile = nullptr;
     }
 
     if (bVerbose)
@@ -1160,7 +1209,9 @@ char **do_top(gmx_bool          bVerbose,
                        nrmols, molinfo, intermolecular_interactions,
                        plist, combination_rule, repulsion_power,
                        opts, fudgeQQ, nmolblock, molblock,
-                       ir->efep != efepNO, bGenborn, bZero, wi);
+                       ir->efep != efepNO, bGenborn, bZero,
+                       EEL_FULL(ir->coulombtype), wi);
+
     if ((*combination_rule != eCOMB_GEOMETRIC) &&
         (ir->vdwtype == evdwUSER))
     {
@@ -1183,7 +1234,7 @@ static void generate_qmexcl_moltype(gmx_moltype_t *molt, unsigned char *grpnr,
      * not by the gromacs routines
      */
     int       qm_max = 0, qm_nr = 0, link_nr = 0, link_max = 0;
-    int      *qm_arr = NULL, *link_arr = NULL;
+    int      *qm_arr = nullptr, *link_arr = nullptr;
     gmx_bool *bQMMM, *blink;
 
     /* First we search and select the QM atoms in an qm_arr array that
index 27d8e70c4af0d4ff62243f4b02c55c18fd4842c5..4023f8fceb031ae6a01206c2197cff3801fc7bfd 100644 (file)
 
 #include "gromacs/gmxpreprocess/gpp_atomtype.h"
 #include "gromacs/gmxpreprocess/grompp-impl.h"
-#include "gromacs/gmxpreprocess/readir.h"
 
 struct gmx_molblock_t;
+struct gmx_mtop_t;
+struct t_gromppopts;
+struct t_inputrec;
+struct warninp;
+typedef warninp *warninp_t;
 
 double check_mol(gmx_mtop_t *mtop, warninp_t wi);
 /* Check mass and charge */
index ddf0bc79f275febc73bb0b905c502d1c6d2e22f5..2abdf809033d32e0c0538199981f9aac6b6158bd 100644 (file)
@@ -42,6 +42,7 @@
 #include <stdlib.h>
 
 #include <cmath>
+#include <cstring>
 
 #include <algorithm>
 
@@ -729,7 +730,7 @@ void push_bt(directive d, t_params bt[], int nral,
         return;
     }
 
-    ft    = strtol(alc[nral], NULL, 10);
+    ft    = strtol(alc[nral], nullptr, 10);
     ftype = ifunc_index(d, ft);
     nrfp  = NRFP(ftype);
     nrfpA = interaction_function[ftype].nrfpA;
@@ -838,7 +839,7 @@ void push_dihedraltype(directive d, t_params bt[],
     if (nn >= 3 && strlen(alc[2]) == 1 && isdigit(alc[2][0]))
     {
         nral  = 2;
-        ft    = strtol(alc[nral], NULL, 10);
+        ft    = strtol(alc[nral], nullptr, 10);
         /* Move atom types around a bit and use 'X' for wildcard atoms
          * to create a 4-atom dihedral definition with arbitrary atoms in
          * position 1 and 4.
@@ -863,7 +864,7 @@ void push_dihedraltype(directive d, t_params bt[],
     else if (nn == 5 && strlen(alc[4]) == 1 && isdigit(alc[4][0]))
     {
         nral  = 4;
-        ft    = strtol(alc[nral], NULL, 10);
+        ft    = strtol(alc[nral], nullptr, 10);
     }
     else
     {
@@ -1137,9 +1138,9 @@ push_cmaptype(directive d, t_params bt[], int nral, gpp_atomtype_t at,
     }
     start += nchar_consumed;
 
-    ft     = strtol(alc[nral], NULL, 10);
-    nxcmap = strtol(alc[nral+1], NULL, 10);
-    nycmap = strtol(alc[nral+2], NULL, 10);
+    ft     = strtol(alc[nral], nullptr, 10);
+    nxcmap = strtol(alc[nral+1], nullptr, 10);
+    nycmap = strtol(alc[nral+2], nullptr, 10);
 
     /* Check for equal grid spacing in x and y dims */
     if (nxcmap != nycmap)
@@ -1150,8 +1151,8 @@ push_cmaptype(directive d, t_params bt[], int nral, gpp_atomtype_t at,
 
     ncmap  = nxcmap*nycmap;
     ftype  = ifunc_index(d, ft);
-    nrfpA  = strtol(alc[6], NULL, 10)*strtol(alc[6], NULL, 10);
-    nrfpB  = strtol(alc[7], NULL, 10)*strtol(alc[7], NULL, 10);
+    nrfpA  = strtol(alc[6], nullptr, 10)*strtol(alc[6], nullptr, 10);
+    nrfpB  = strtol(alc[7], nullptr, 10)*strtol(alc[7], nullptr, 10);
     nrfp   = nrfpA+nrfpB;
 
     /* Allocate memory for the CMAP grid */
@@ -1168,7 +1169,7 @@ push_cmaptype(directive d, t_params bt[], int nral, gpp_atomtype_t at,
         }
         nn  = sscanf(line+start+sl, " %s ", s);
         sl += strlen(s);
-        bt[F_CMAP].cmap[i+(bt[F_CMAP].ncmap)-nrfp] = strtod(s, NULL);
+        bt[F_CMAP].cmap[i+(bt[F_CMAP].ncmap)-nrfp] = strtod(s, nullptr);
 
         if (nn == 1)
         {
@@ -1289,7 +1290,7 @@ static void push_atom_now(t_symtab *symtab, t_atoms *at, int atomnr,
             warning_error_and_exit(wi, errbuf, FARGS);
         }
     }
-    resnr = strtol(resnumberic, NULL, 10);
+    resnr = strtol(resnumberic, nullptr, 10);
 
     if (nr > 0)
     {
@@ -1343,7 +1344,7 @@ static void push_atom_now(t_symtab *symtab, t_atoms *at, int atomnr,
     at->nr++;
 }
 
-void push_cg(t_block *block, int *lastindex, int index, int a)
+static void push_cg(t_block *block, int *lastindex, int index, int a)
 {
     if (debug)
     {
@@ -1486,7 +1487,7 @@ static gmx_bool default_nb_params(int ftype, t_params bt[], t_atoms *at,
 {
     int          i, j, ti, tj, ntype;
     gmx_bool     bFound;
-    t_param     *pi    = NULL;
+    t_param     *pi    = nullptr;
     int          nr    = bt[ftype].nr;
     int          nral  = NRAL(ftype);
     int          nrfp  = interaction_function[ftype].nrfpA;
@@ -1660,8 +1661,8 @@ static gmx_bool default_params(int ftype, t_params bt[],
 {
     int          nparam_found;
     gmx_bool     bFound, bSame;
-    t_param     *pi    = NULL;
-    t_param     *pj    = NULL;
+    t_param     *pi    = nullptr;
+    t_param     *pj    = nullptr;
     int          nr    = bt[ftype].nr;
     int          nral  = NRAL(ftype);
     int          nrfpA = interaction_function[ftype].nrfpA;
@@ -1881,10 +1882,22 @@ void push_bond(directive d, t_params bondtype[], t_params bond[],
         }
         for (j = i+1; (j < nral); j++)
         {
+            GMX_ASSERT(j < MAXATOMLIST + 1, "Values from nral=NRAL() will satisfy this, we assert to keep gcc 4 happy");
             if (aa[i] == aa[j])
             {
                 sprintf(errbuf, "Duplicate atom index (%d) in %s", aa[i], dir2str(d));
-                warning(wi, errbuf);
+                if (ftype == F_ANGRES)
+                {
+                    /* Since the angle restraints uses 2 pairs of atoms to
+                     * defines an angle between vectors, it can be useful
+                     * to use one atom twice, so we only issue a note here.
+                     */
+                    warning_note(wi, errbuf);
+                }
+                else
+                {
+                    warning_error(wi, errbuf);
+                }
             }
         }
     }
@@ -2221,7 +2234,7 @@ void push_cmap(directive d, t_params bondtype[], t_params bond[],
             if (aa[i] == aa[j])
             {
                 sprintf(errbuf, "Duplicate atom index (%d) in %s", aa[i], dir2str(d));
-                warning(wi, errbuf);
+                warning_error(wi, errbuf);
             }
         }
     }
@@ -2263,8 +2276,8 @@ void push_vsitesn(directive d, t_params bond[],
 {
     char   *ptr;
     int     type, ftype, j, n, ret, nj, a;
-    int    *atc    = NULL;
-    double *weight = NULL, weight_tot;
+    int    *atc    = nullptr;
+    double *weight = nullptr, weight_tot;
     t_param param;
     char    errbuf[STRLEN];
 
@@ -2437,7 +2450,7 @@ void init_block2(t_block2 *b2, int natom)
     snew(b2->a, b2->nr);
     for (i = 0; (i < b2->nr); i++)
     {
-        b2->a[i] = NULL;
+        b2->a[i] = nullptr;
     }
 }
 
@@ -2690,7 +2703,7 @@ static void convert_pairs_to_pairsQ(t_params *plist,
 
     /* Empty the LJ14 pairlist */
     plist[F_LJ14].nr    = 0;
-    plist[F_LJ14].param = NULL;
+    plist[F_LJ14].param = nullptr;
 }
 
 static void generate_LJCpairsNB(t_molinfo *mol, int nb_funct, t_params *nbp, warninp_t wi)
index ddd2bd95d80545df1878439bac4947369c02459d..6e84f4a3afd0aefbc688074c45a4bbfb74d1cbaa 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, by the GROMACS development team, led by
+ * 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.
@@ -119,15 +119,15 @@ void init_plist(t_params plist[])
     {
         plist[i].nr    = 0;
         plist[i].maxnr = 0;
-        plist[i].param = NULL;
+        plist[i].param = nullptr;
 
         /* CMAP */
         plist[i].ncmap        = 0;
-        plist[i].cmap         = NULL;
+        plist[i].cmap         = nullptr;
         plist[i].grid_spacing = 0;
         plist[i].nc           = 0;
         plist[i].nct          = 0;
-        plist[i].cmap_types   = NULL;
+        plist[i].cmap_types   = nullptr;
     }
 }
 
@@ -182,7 +182,7 @@ void init_molinfo(t_molinfo *mol)
 
 /* FREEING MEMORY */
 
-void done_bt (t_params *pl)
+static void done_bt (t_params *pl)
 {
     sfree(pl->param);
 }
@@ -202,9 +202,9 @@ void done_mi(t_molinfo *mi)
 
 /* PRINTING STRUCTURES */
 
-void print_bt(FILE *out, directive d, gpp_atomtype_t at,
-              int ftype, int fsubtype, t_params plist[],
-              gmx_bool bFullDih)
+static void print_bt(FILE *out, directive d, gpp_atomtype_t at,
+                     int ftype, int fsubtype, t_params plist[],
+                     gmx_bool bFullDih)
 {
     /* This dihp is a DIRTY patch because the dih-types do not use
      * all four atoms to determine the type.
@@ -459,7 +459,7 @@ void print_atoms(FILE *out, gpp_atomtype_t atype, t_atoms *at, int *cgnr,
         {
             ri = at->atom[i].resind;
             if ((i == 0 || ri != at->atom[i-1].resind) &&
-                at->resinfo[ri].rtp != NULL)
+                at->resinfo[ri].rtp != nullptr)
             {
                 qres = get_residue_charge(at, i);
                 fprintf(out, "; residue %3d %-3s rtp %-4s q ",
@@ -477,7 +477,7 @@ void print_atoms(FILE *out, gpp_atomtype_t atype, t_atoms *at, int *cgnr,
                 fprintf(out, "\n");
             }
             tpA = at->atom[i].type;
-            if ((tpnmA = get_atomtype_name(tpA, atype)) == NULL)
+            if ((tpnmA = get_atomtype_name(tpA, atype)) == nullptr)
             {
                 gmx_fatal(FARGS, "tpA = %d, i= %d in print_atoms", tpA, i);
             }
@@ -496,7 +496,7 @@ void print_atoms(FILE *out, gpp_atomtype_t atype, t_atoms *at, int *cgnr,
             if (PERTURBED(at->atom[i]))
             {
                 tpB = at->atom[i].typeB;
-                if ((tpnmB = get_atomtype_name(tpB, atype)) == NULL)
+                if ((tpnmB = get_atomtype_name(tpB, atype)) == nullptr)
                 {
                     gmx_fatal(FARGS, "tpB = %d, i= %d in print_atoms", tpB, i);
                 }
index bd8d37a190670c561689081e1f4b9077fe399ed1..1b9ea7770a401f6383b43b0ab989c5b179f3ff11 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,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.
@@ -59,7 +59,7 @@
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/strconvert.h"
 
 typedef struct {
     t_iatom  a[4];
@@ -873,9 +873,9 @@ int set_vsites(gmx_bool bVerbose, t_atoms *atoms, gpp_atomtype_t atype,
                     }
 
                     nrbond = nrang = nridih = 0;
-                    bonds  = NULL;
-                    angles = NULL;
-                    idihs  = NULL;
+                    bonds  = nullptr;
+                    angles = nullptr;
+                    idihs  = nullptr;
                     nrset++;
                     /* now set the vsite parameters: */
                     get_bondeds(NRAL(ftype), plist[ftype].param[i].a, at2vb,
@@ -1050,7 +1050,7 @@ static void clean_vsite_bonds(t_params *plist, t_pindex pindex[],
     for (i = 0; (i < ps->nr); i++) /* for all bonds in the plist */
     {
         int            vsnral      = 0;
-        const int     *first_atoms = NULL;
+        const int     *first_atoms = nullptr;
 
         bKeep   = FALSE;
         bRemove = FALSE;
@@ -1307,7 +1307,7 @@ static void clean_vsite_angles(t_params *plist, t_pindex pindex[],
     for (i = 0; (i < ps->nr); i++) /* for all angles in the plist */
     {
         int            vsnral      = 0;
-        const int     *first_atoms = NULL;
+        const int     *first_atoms = nullptr;
 
         bKeep    = FALSE;
         bAll3FAD = TRUE;
@@ -1443,7 +1443,7 @@ static void clean_vsite_dihs(t_params *plist, t_pindex pindex[],
     {
         int            k, m, n, nvsite;
         int            vsnral      = 0;
-        const int     *first_atoms = NULL;
+        const int     *first_atoms = nullptr;
         int            atom;
         gmx_bool       bKeep, bUsed, bPresent;
 
@@ -1561,7 +1561,7 @@ void clean_vsite_bondeds(t_params *plist, int natoms, gmx_bool bRmVSiteBds)
     t_pindex      *pindex;
     at2vsitecon_t *at2vc;
 
-    pindex = 0; /* avoid warnings */
+    pindex = nullptr; /* avoid warnings */
     /* make vsite_type array */
     snew(vsite_type, natoms);
     for (i = 0; i < natoms; i++)
index 3307dba8c51b4fcd8212aacbe58ebf1ac6706def..e9e85fb4a0dfdb6a3d602e5c1317fdc6d901d2ff 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
 #include "x2top.h"
 
 #include <cmath>
+#include <cstring>
 
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/gmxfio.h"
-#include "gromacs/fileio/readinp.h"
 #include "gromacs/gmxpreprocess/gen_ad.h"
 #include "gromacs/gmxpreprocess/gpp_nextnb.h"
 #include "gromacs/gmxpreprocess/hackblock.h"
@@ -101,9 +101,9 @@ static gmx_bool is_bond(int nnm, t_nm2type nmt[], char *ai, char *aj, real blen)
     return FALSE;
 }
 
-void mk_bonds(int nnm, t_nm2type nmt[],
-              t_atoms *atoms, const rvec x[], t_params *bond, int nbond[],
-              gmx_bool bPBC, matrix box)
+static void mk_bonds(int nnm, t_nm2type nmt[],
+                     t_atoms *atoms, const rvec x[], t_params *bond, int nbond[],
+                     gmx_bool bPBC, matrix box)
 {
     t_param b;
     int     i, j;
@@ -164,7 +164,7 @@ void mk_bonds(int nnm, t_nm2type nmt[],
     fflush(stderr);
 }
 
-int *set_cgnr(t_atoms *atoms, gmx_bool bUsePDBcharge, real *qtot, real *mtot)
+static int *set_cgnr(t_atoms *atoms, gmx_bool bUsePDBcharge, real *qtot, real *mtot)
 {
     int     i, n = 1;
     int    *cgnr;
@@ -191,8 +191,8 @@ int *set_cgnr(t_atoms *atoms, gmx_bool bUsePDBcharge, real *qtot, real *mtot)
     return cgnr;
 }
 
-gpp_atomtype_t set_atom_type(t_symtab *tab, t_atoms *atoms, t_params *bonds,
-                             int *nbonds, int nnm, t_nm2type nm2t[])
+static gpp_atomtype_t set_atom_type(t_symtab *tab, t_atoms *atoms, t_params *bonds,
+                                    int *nbonds, int nnm, t_nm2type nm2t[])
 {
     gpp_atomtype_t atype;
     int            nresolved;
@@ -212,8 +212,8 @@ gpp_atomtype_t set_atom_type(t_symtab *tab, t_atoms *atoms, t_params *bonds,
     return atype;
 }
 
-void lo_set_force_const(t_params *plist, real c[], int nrfp, gmx_bool bRound,
-                        gmx_bool bDih, gmx_bool bParam)
+static void lo_set_force_const(t_params *plist, real c[], int nrfp, gmx_bool bRound,
+                               gmx_bool bDih, gmx_bool bParam)
 {
     int    i, j;
     double cc;
@@ -262,8 +262,8 @@ void lo_set_force_const(t_params *plist, real c[], int nrfp, gmx_bool bRound,
     }
 }
 
-void set_force_const(t_params plist[], real kb, real kt, real kp, gmx_bool bRound,
-                     gmx_bool bParam)
+static void set_force_const(t_params plist[], real kb, real kt, real kp, gmx_bool bRound,
+                            gmx_bool bParam)
 {
     real c[MAXFORCEPARAM];
 
@@ -277,8 +277,8 @@ void set_force_const(t_params plist[], real kb, real kt, real kp, gmx_bool bRoun
     lo_set_force_const(&plist[F_PDIHS], c, 3, bRound, TRUE, bParam);
 }
 
-void calc_angles_dihs(t_params *ang, t_params *dih, const rvec x[], gmx_bool bPBC,
-                      matrix box)
+static void calc_angles_dihs(t_params *ang, t_params *dih, const rvec x[], gmx_bool bPBC,
+                             matrix box)
 {
     int    i, ai, aj, ak, al, t1, t2, t3;
     rvec   r_ij, r_kj, r_kl, m, n;
@@ -298,7 +298,7 @@ void calc_angles_dihs(t_params *ang, t_params *dih, const rvec x[], gmx_bool bPB
         ai = ang->param[i].ai();
         aj = ang->param[i].aj();
         ak = ang->param[i].ak();
-        th = RAD2DEG*bond_angle(x[ai], x[aj], x[ak], bPBC ? &pbc : NULL,
+        th = RAD2DEG*bond_angle(x[ai], x[aj], x[ak], bPBC ? &pbc : nullptr,
                                 r_ij, r_kj, &costh, &t1, &t2);
         if (debug)
         {
@@ -313,7 +313,7 @@ void calc_angles_dihs(t_params *ang, t_params *dih, const rvec x[], gmx_bool bPB
         aj = dih->param[i].aj();
         ak = dih->param[i].ak();
         al = dih->param[i].al();
-        ph = RAD2DEG*dih_angle(x[ai], x[aj], x[ak], x[al], bPBC ? &pbc : NULL,
+        ph = RAD2DEG*dih_angle(x[ai], x[aj], x[ak], x[al], bPBC ? &pbc : nullptr,
                                r_ij, r_kj, r_kl, m, n, &sign, &t1, &t2, &t3);
         if (debug)
         {
@@ -379,7 +379,7 @@ static void print_rtp(const char *filenm, const char *title, t_atoms *atoms,
     for (i = 0; (i < atoms->nr); i++)
     {
         tp = atoms->atom[i].type;
-        if ((tpnm = get_atomtype_name(tp, atype)) == NULL)
+        if ((tpnm = get_atomtype_name(tp, atype)) == nullptr)
         {
             gmx_fatal(FARGS, "tp = %d, i = %d in print_rtp", tp, i);
         }
@@ -451,17 +451,17 @@ int gmx_x2top(int argc, char *argv[])
         { efRTP, "-r", "out",  ffOPTWR }
     };
 #define NFILE asize(fnm)
-    static real        kb = 4e5, kt = 400, kp = 5;
-    static t_restp     rtp_header_settings;
-    static gmx_bool    bRemoveDihedralIfWithImproper = FALSE;
-    static gmx_bool    bGenerateHH14Interactions     = TRUE;
-    static gmx_bool    bKeepAllGeneratedDihedrals    = FALSE;
-    static int         nrexcl                        = 3;
-    static gmx_bool    bParam                        = TRUE, bRound = TRUE;
-    static gmx_bool    bPairs                        = TRUE, bPBC = TRUE;
-    static gmx_bool    bUsePDBcharge                 = FALSE, bVerbose = FALSE;
-    static const char *molnm                         = "ICE";
-    static const char *ff                            = "oplsaa";
+    real               kb                            = 4e5, kt = 400, kp = 5;
+    t_restp            rtp_header_settings           = { 0 };
+    gmx_bool           bRemoveDihedralIfWithImproper = FALSE;
+    gmx_bool           bGenerateHH14Interactions     = TRUE;
+    gmx_bool           bKeepAllGeneratedDihedrals    = FALSE;
+    int                nrexcl                        = 3;
+    gmx_bool           bParam                        = TRUE, bRound = TRUE;
+    gmx_bool           bPairs                        = TRUE, bPBC = TRUE;
+    gmx_bool           bUsePDBcharge                 = FALSE, bVerbose = FALSE;
+    const char        *molnm                         = "ICE";
+    const char        *ff                            = "oplsaa";
     t_pargs            pa[]                          = {
         { "-ff",     FALSE, etSTR, {&ff},
           "Force field for your simulation. Type \"select\" for interactive selection." },
@@ -515,7 +515,7 @@ int gmx_x2top(int argc, char *argv[])
     }
 
     /* Force field selection, interactive or direct */
-    choose_ff(strcmp(ff, "select") == 0 ? NULL : ff,
+    choose_ff(strcmp(ff, "select") == 0 ? nullptr : ff,
               forcefield, sizeof(forcefield),
               ffdir, sizeof(ffdir));
 
@@ -531,10 +531,10 @@ int gmx_x2top(int argc, char *argv[])
     /* Read coordinates */
     t_topology *top;
     snew(top, 1);
-    read_tps_conf(opt2fn("-f", NFILE, fnm), top, &epbc, &x, NULL, box, FALSE);
+    read_tps_conf(opt2fn("-f", NFILE, fnm), top, &epbc, &x, nullptr, box, FALSE);
     t_atoms  *atoms = &top->atoms;
     natoms = atoms->nr;
-    if (atoms->pdbinfo == NULL)
+    if (atoms->pdbinfo == nullptr)
     {
         snew(atoms->pdbinfo, natoms);
     }
@@ -567,7 +567,7 @@ int gmx_x2top(int argc, char *argv[])
     init_nnb(&nnb, atoms->nr, 4);
     gen_nnb(&nnb, plist);
     print_nnb(&nnb, "NNB");
-    gen_pad(&nnb, atoms, &rtp_header_settings, plist, excls, NULL, TRUE);
+    gen_pad(&nnb, atoms, &rtp_header_settings, plist, excls, nullptr, TRUE);
     done_nnb(&nnb);
 
     if (!bPairs)
@@ -599,9 +599,9 @@ int gmx_x2top(int argc, char *argv[])
         fp = ftp2FILE(efTOP, NFILE, fnm, "w");
         print_top_header(fp, ftp2fn(efTOP, NFILE, fnm), TRUE, ffdir, 1.0);
 
-        write_top(fp, NULL, mymol.name, atoms, FALSE, bts, plist, excls, atype,
+        write_top(fp, nullptr, mymol.name, atoms, FALSE, bts, plist, excls, atype,
                   cgnr, rtp_header_settings.nrexcl);
-        print_top_mols(fp, mymol.name, ffdir, NULL, 0, NULL, 1, &mymol);
+        print_top_mols(fp, mymol.name, ffdir, nullptr, 0, nullptr, 1, &mymol);
 
         gmx_ffclose(fp);
     }
index c89244bff66cf17426997fe353a0bfa41aad60fe..760fd0c1d73ecbcc42f018a386483f02b5dfff46 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,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.
@@ -98,11 +98,11 @@ static void get_xlatoms(const char *fn, FILE *fp,
         }
         else
         {
-            xl[n].res = NULL;
+            xl[n].res = nullptr;
         }
 
         /* Replace underscores in the string by spaces */
-        while ((_ptr = strchr(abuf, '_')) != 0)
+        while ((_ptr = strchr(abuf, '_')) != nullptr)
         {
             *_ptr = ' ';
         }
@@ -123,7 +123,7 @@ static void done_xlatom(int nxlate, t_xlate_atom *xlatom)
     for (i = 0; (i < nxlate); i++)
     {
         sfree(xlatom[i].filebase);
-        if (xlatom[i].res != NULL)
+        if (xlatom[i].res != nullptr)
         {
             sfree(xlatom[i].res);
         }
@@ -148,8 +148,8 @@ void rename_atoms(const char *xlfile, const char *ffdir,
     gmx_bool      bStartTerm, bEndTerm;
 
     nxlate = 0;
-    xlatom = NULL;
-    if (xlfile != NULL)
+    xlatom = nullptr;
+    if (xlfile != nullptr)
     {
         fp = libopen(xlfile);
         get_xlatoms(xlfile, fp, &nxlate, &xlatom);
@@ -203,11 +203,11 @@ void rename_atoms(const char *xlfile, const char *ffdir,
         for (i = 0; (i < nxlate) && !bRenamed; i++)
         {
             /* Check if the base file name of the rtp and arn entry match */
-            if (restp == NULL ||
+            if (restp == nullptr ||
                 gmx_strcasecmp(restp[resind].filebase, xlatom[i].filebase) == 0)
             {
                 /* Match the residue name */
-                bMatch = (xlatom[i].res == NULL ||
+                bMatch = (xlatom[i].res == nullptr ||
                           (gmx_strcasecmp("protein-nterm", xlatom[i].res) == 0 &&
                            gmx_residuetype_is_protein(rt, rnm) && bStartTerm) ||
                           (gmx_strcasecmp("protein-cterm", xlatom[i].res) == 0 &&
index b6a23047267fd4b9428b8f006ecaebc829c7e9b8..7cceb1a04d96e5286fed9b796fa90ae2e3d68867 100644 (file)
@@ -37,6 +37,8 @@
 
 #include "config.h"
 
+#include "gromacs/utility/basedefinitions.h"
+
 /*! \file
  *  \brief CUDA arch dependent definitions.
  *
@@ -109,13 +111,14 @@ template <typename T>
 static __forceinline__ __device__
 T gmx_shfl_up_sync(const unsigned int activeMask,
                    const T            var,
-                   unsigned int       offset)
+                   unsigned int       offset,
+                   int                width = warp_size)
 {
 #if GMX_CUDA_VERSION < 9000
     GMX_UNUSED_VALUE(activeMask);
-    return __shfl_up(var, offset);
+    return __shfl_up(var, offset, width);
 #else
-    return __shfl_up_sync(activeMask, var, offset);
+    return __shfl_up_sync(activeMask, var, offset, width);
 #endif
 }
 
@@ -124,14 +127,52 @@ template <typename T>
 static __forceinline__ __device__
 T gmx_shfl_down_sync(const unsigned int activeMask,
                      const T            var,
-                     unsigned int       offset)
+                     unsigned int       offset,
+                     int                width = warp_size)
 {
 #if GMX_CUDA_VERSION < 9000
     GMX_UNUSED_VALUE(activeMask);
-    return __shfl_down(var, offset);
+    return __shfl_down(var, offset, width);
 #else
-    return __shfl_down_sync(activeMask, var, offset);
+    return __shfl_down_sync(activeMask, var, offset, width);
 #endif
 }
 
+/*! \brief Allow disabling CUDA textures using the GMX_DISABLE_CUDA_TEXTURES macro.
+ *
+ *  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
+#define DISABLE_CUDA_TEXTURES 1
+#else
+#define DISABLE_CUDA_TEXTURES 0
+#endif
+
+/* CUDA architecture technical characteristics. Needs macros because it is used
+ * in the __launch_bounds__ function qualifiers and might need it in preprocessor
+ * conditionals.
+ *
+ */
+#if GMX_PTX_ARCH > 0
+    #if   GMX_PTX_ARCH <= 210  // CC 2.x
+        #define GMX_CUDA_MAX_BLOCKS_PER_MP   8
+        #define GMX_CUDA_MAX_THREADS_PER_MP  1536
+    #elif GMX_PTX_ARCH <= 370  // CC 3.x
+        #define GMX_CUDA_MAX_BLOCKS_PER_MP   16
+        #define GMX_CUDA_MAX_THREADS_PER_MP  2048
+    #else // CC 5.x, 6.x
+          /* Note that this final branch covers all future architectures (current gen
+           * is 6.x as of writing), hence assuming that these *currently defined* upper
+           * limits will not be lowered.
+           */
+        #define GMX_CUDA_MAX_BLOCKS_PER_MP   32
+        #define GMX_CUDA_MAX_THREADS_PER_MP  2048
+    #endif
+#else
+        #define GMX_CUDA_MAX_BLOCKS_PER_MP   0
+        #define GMX_CUDA_MAX_THREADS_PER_MP  0
+#endif
+
 #endif /* CUDA_ARCH_UTILS_CUH_ */
diff --git a/src/gromacs/gpu_utils/cuda_kernel_utils.cuh b/src/gromacs/gpu_utils/cuda_kernel_utils.cuh
new file mode 100644 (file)
index 0000000..e96edb3
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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_GPU_UTILS_CUDA_KERNEL_UTILS_CUH
+#define GMX_GPU_UTILS_CUDA_KERNEL_UTILS_CUH
+
+/*! \file
+ *  \brief CUDA device util functions (callable from GPU kernels).
+ *
+ *  \author Szilard Pall <pall.szilard@gmail.com>
+ */
+
+#include "gromacs/gpu_utils/cuda_arch_utils.cuh"
+
+/*! Load directly or using __ldg() when supported. */
+template<typename T>
+__device__ __forceinline__ T LDG(const T* ptr)
+{
+#if GMX_PTX_ARCH >= 350
+    /* CC >=3.5 supports constant loads through texture or L1 */
+    return __ldg(ptr);
+#else
+    /* Device does not have LDG support, fall back to direct load. */
+    return *ptr;
+#endif
+}
+
+
+#endif /* GMX_GPU_UTILS_CUDA_KERNEL_UTILS_CUH */
index dde0bb3669e6150f87ea0c3d703ab8bc0e34b956..6021331ffb4740684113555b319579d683fda89a 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,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.
@@ -126,21 +126,6 @@ int cu_copy_H2D_async(void * d_dest, void * h_src, size_t bytes, cudaStream_t s
     return cu_copy_H2D_generic(d_dest, h_src, bytes, true, s);
 }
 
-int cu_copy_H2D_alloc(void ** d_dest, void * h_src, size_t bytes)
-{
-    cudaError_t stat;
-
-    if (d_dest == NULL || h_src == NULL || bytes == 0)
-    {
-        return -1;
-    }
-
-    stat = cudaMalloc(d_dest, bytes);
-    CU_RET_ERR(stat, "cudaMalloc failed in cu_copy_H2D_alloc");
-
-    return cu_copy_H2D(*d_dest, h_src, bytes);
-}
-
 float cu_event_elapsed(cudaEvent_t start, cudaEvent_t end)
 {
     float       t = 0.0;
index f26d134f84e494b105e4336f003b832a6a346375..604e54b42cad81dd0dfad9033ce3193b475650b9 100644 (file)
  * The CUDA device information is queried and set at detection and contains
  * both information about the device/hardware returned by the runtime as well
  * as additional data like support status.
+ *
+ * \todo extract an object to manage NVML details
  */
 struct gmx_device_info_t
 {
     int                 id;                      /* id of the CUDA device */
     cudaDeviceProp      prop;                    /* CUDA device properties */
     int                 stat;                    /* result of the device check */
-    gmx_bool            nvml_initialized;        /* If NVML was initialized */
     unsigned int        nvml_orig_app_sm_clock;  /* The original SM clock before we changed it */
     unsigned int        nvml_orig_app_mem_clock; /* The original memory clock before we changed it */
     gmx_bool            nvml_app_clocks_changed; /* If application clocks have been changed */
@@ -126,6 +127,7 @@ struct gmx_device_info_t
     unsigned int        nvml_set_app_mem_clock;  /* The memory clock we set */
 #if HAVE_NVML
     nvmlDevice_t        nvml_device_id;          /* NVML device id */
+    // TODO This can become a bool with a more useful name
     nvmlEnableState_t   nvml_is_restricted;      /* Status of application clocks permission */
 #endif                                           /* HAVE_NVML */
 };
@@ -143,9 +145,6 @@ int cu_copy_H2D(void * /*d_dest*/, void * /*h_src*/, size_t /*bytes*/);
 /*! Launches asynchronous host to device memory copy in stream s. */
 int cu_copy_H2D_async(void * /*d_dest*/, void * /*h_src*/, size_t /*bytes*/, cudaStream_t /*s = 0*/);
 
-/*! Allocates device memory and launches synchronous host to device memory copy. */
-int cu_copy_H2D_alloc(void ** /*d_dest*/, void * /*h_src*/, size_t /*bytes*/);
-
 /*! Frees device memory and resets the size and allocation size to -1. */
 void cu_free_buffered(void *d_ptr, int *n = NULL, int *nalloc = NULL);
 
index ba107a4ae7b2febb32ad2e9da61c1f5887b0e3d3..182c2035bead423318fee60f6690800b2f39c40f 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,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.
@@ -45,7 +45,7 @@
 #define REAL_FUNC_TERM ;
 #define REAL_FUNC_TERM_WITH_RETURN(arg) ;
 
-#define NULL_FUNC_QUALIFIER static
+#define NULL_FUNC_QUALIFIER gmx_unused static
 #define NULL_FUNC_ARGUMENT(arg) /*arg*/
 #define NULL_FUNC_TERM {}
 #define NULL_FUNC_TERM_WITH_RETURN(arg) { return (arg); }
index f2e423edfbea9d0a656dc138b83b55713b0e4147..fcaed80d22eb83c273d185b5d88d3c1456d3d255 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,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.
@@ -49,6 +49,6 @@ void gpu_set_host_malloc_and_free(bool,
                                   gmx_host_alloc_t **nb_alloc,
                                   gmx_host_free_t  **nb_free)
 {
-    *nb_alloc = NULL;
-    *nb_free  = NULL;
+    *nb_alloc = nullptr;
+    *nb_free  = nullptr;
 }
index da06317af679791820140795c1b16fa9163833f1..0369333811f67243ac1198789ef3ff2faa773e84 100644 (file)
@@ -55,7 +55,9 @@
 #include "gromacs/hardware/gpu_hw_info.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/logger.h"
 #include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/snprintf.h"
 
 #if HAVE_NVML
 #include <nvml.h>
@@ -206,59 +208,6 @@ static int do_sanity_checks(int dev_id, cudaDeviceProp *dev_prop)
     return 0;
 }
 
-#if HAVE_NVML
-/* TODO: We should actually be using md_print_warn in md_logging.c,
- * but we can't include mpi.h in CUDA code.
- */
-static void md_print_info(FILE       *fplog,
-                          const char *fmt, ...)
-{
-    va_list ap;
-
-    if (fplog != NULL)
-    {
-        /* We should only print to stderr on the master node,
-         * in most cases fplog is only set on the master node, so this works.
-         */
-        va_start(ap, fmt);
-        vfprintf(stderr, fmt, ap);
-        va_end(ap);
-
-        va_start(ap, fmt);
-        vfprintf(fplog, fmt, ap);
-        va_end(ap);
-    }
-}
-#endif /*HAVE_NVML*/
-
-/* TODO: We should actually be using md_print_warn in md_logging.c,
- * but we can't include mpi.h in CUDA code.
- * This is replicated from nbnxn_cuda_data_mgmt.cu.
- */
-static void md_print_warn(FILE       *fplog,
-                          const char *fmt, ...)
-{
-    va_list ap;
-
-    if (fplog != NULL)
-    {
-        /* We should only print to stderr on the master node,
-         * in most cases fplog is only set on the master node, so this works.
-         */
-        va_start(ap, fmt);
-        fprintf(stderr, "\n");
-        vfprintf(stderr, fmt, ap);
-        fprintf(stderr, "\n");
-        va_end(ap);
-
-        va_start(ap, fmt);
-        fprintf(fplog, "\n");
-        vfprintf(fplog, fmt, ap);
-        fprintf(fplog, "\n");
-        va_end(ap);
-    }
-}
-
 #if HAVE_NVML_APPLICATION_CLOCKS
 /*! \brief Determines and adds the NVML device ID to the passed \cuda_dev.
  *
@@ -271,9 +220,9 @@ static void md_print_warn(FILE       *fplog,
 static bool addNVMLDeviceId(gmx_device_info_t* cuda_dev)
 {
     nvmlDevice_t nvml_device_id;
-    unsigned int nvml_device_count = 0;
-    nvmlReturn_t nvml_stat         = nvmlDeviceGetCount ( &nvml_device_count );
-    cuda_dev->nvml_initialized = false;
+    unsigned int nvml_device_count  = 0;
+    nvmlReturn_t nvml_stat          = nvmlDeviceGetCount ( &nvml_device_count );
+    bool         nvmlWasInitialized = false;
     HANDLE_NVML_RET_ERR( nvml_stat, "nvmlDeviceGetCount failed" );
     for (unsigned int nvml_device_idx = 0; nvml_stat == NVML_SUCCESS && nvml_device_idx < nvml_device_count; ++nvml_device_idx)
     {
@@ -295,12 +244,12 @@ static bool addNVMLDeviceId(gmx_device_info_t* cuda_dev)
             static_cast<unsigned int>(cuda_dev->prop.pciDeviceID) == nvml_pci_info.device &&
             static_cast<unsigned int>(cuda_dev->prop.pciDomainID) == nvml_pci_info.domain)
         {
-            cuda_dev->nvml_initialized = true;
+            nvmlWasInitialized         = true;
             cuda_dev->nvml_device_id   = nvml_device_id;
             break;
         }
     }
-    return cuda_dev->nvml_initialized;
+    return nvmlWasInitialized;
 }
 
 /*! \brief Reads and returns the application clocks for device.
@@ -331,49 +280,45 @@ static bool getApplicationClocks(const gmx_device_info_t *cuda_dev,
 
 /*! \brief Tries to set application clocks for the GPU with the given index.
  *
- * The variable \gpuid is the index of the GPU in the gpu_info.cuda_dev array
- * to handle the application clocks for. Application clocks are set to the
- * max supported value to increase performance if application clock permissions
- * allow this. For future GPU architectures a more sophisticated scheme might be
- * required.
+ * Application clocks are set to the max supported value to increase
+ * performance if application clock permissions allow this. For future
+ * GPU architectures a more sophisticated scheme might be required.
+ *
+ * \todo Refactor this into a detection phase and a work phase. Also
+ * refactor to remove compile-time dependence on logging header.
  *
- * \param[out] fplog        log file to write to
- * \param[in] gpuid         index of the GPU to set application clocks for
- * \param[in] gpu_info      GPU info of all detected devices in the system.
+ * \param     mdlog         log file to write to
+ * \param[in] cuda_dev      GPU device info for the GPU in use
  * \returns                 true if no error occurs during application clocks handling.
  */
-static gmx_bool init_gpu_application_clocks(FILE gmx_unused *fplog, int gmx_unused gpuid, const gmx_gpu_info_t gmx_unused *gpu_info)
+static gmx_bool init_gpu_application_clocks(
+        const gmx::MDLogger &mdlog,
+        gmx_device_info_t   *cuda_dev)
 {
-    const cudaDeviceProp *prop                        = &gpu_info->gpu_dev[gpuid].prop;
-    int                   cuda_version_number         = prop->major * 10 + prop->minor;
+    const cudaDeviceProp *prop                        = &cuda_dev->prop;
+    int                   cuda_compute_capability     = prop->major * 10 + prop->minor;
     gmx_bool              bGpuCanUseApplicationClocks =
-        ((0 == gmx_wcmatch("*Tesla*", prop->name) && cuda_version_number >= 35 ) ||
-         (0 == gmx_wcmatch("*Quadro*", prop->name) && cuda_version_number >= 52 ));
+        ((0 == gmx_wcmatch("*Tesla*", prop->name) && cuda_compute_capability >= 35 ) ||
+         (0 == gmx_wcmatch("*Quadro*", prop->name) && cuda_compute_capability >= 52 ));
     if (!bGpuCanUseApplicationClocks)
     {
         return true;
     }
 #if !HAVE_NVML
-    int cuda_driver  = 0;
-    int cuda_runtime = 0;
-    cudaDriverGetVersion(&cuda_driver);
-    cudaRuntimeGetVersion(&cuda_runtime);
-    md_print_warn( fplog, "NOTE: GROMACS was configured without NVML support hence it can not exploit\n"
-                   "      application clocks of the detected %s GPU to improve performance.\n"
-                   "      Recompile with the NVML library (compatible with the driver used) or set application clocks manually.\n",
-                   prop->name);
+    GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
+            "NOTE: GROMACS was configured without NVML support hence it can not exploit\n"
+            "      application clocks of the detected %s GPU to improve performance.\n"
+            "      Recompile with the NVML library (compatible with the driver used) or set application clocks manually.",
+            prop->name);
     return true;
 #else
     if (!bCompiledWithApplicationClockSupport)
     {
-        int cuda_driver  = 0;
-        int cuda_runtime = 0;
-        cudaDriverGetVersion(&cuda_driver);
-        cudaRuntimeGetVersion(&cuda_runtime);
-        md_print_warn( fplog, "NOTE: GROMACS was compiled with an old NVML library which does not support\n"
-                       "      managing application clocks of the detected %s GPU to improve performance.\n"
-                       "      If your GPU supports application clocks, upgrade NVML (and driver) and recompile or set the clocks manually.\n",
-                       prop->name );
+        GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
+                "NOTE: GROMACS was compiled with an old NVML library which does not support\n"
+                "      managing application clocks of the detected %s GPU to improve performance.\n"
+                "      If your GPU supports application clocks, upgrade NVML (and driver) and recompile or set the clocks manually.",
+                prop->name );
         return true;
     }
 
@@ -396,8 +341,6 @@ static gmx_bool init_gpu_application_clocks(FILE gmx_unused *fplog, int gmx_unus
         return false;
     }
 
-    gmx_device_info_t *cuda_dev = &(gpu_info->gpu_dev[gpuid]);
-
     if (!addNVMLDeviceId(cuda_dev))
     {
         return false;
@@ -420,33 +363,54 @@ static gmx_bool init_gpu_application_clocks(FILE gmx_unused *fplog, int gmx_unus
     cuda_dev->nvml_is_restricted      = NVML_FEATURE_ENABLED;
     cuda_dev->nvml_app_clocks_changed = false;
 
-    nvml_stat = nvmlDeviceGetAPIRestriction(cuda_dev->nvml_device_id, NVML_RESTRICTED_API_SET_APPLICATION_CLOCKS, &(cuda_dev->nvml_is_restricted));
-    HANDLE_NVML_RET_ERR( nvml_stat, "nvmlDeviceGetAPIRestriction failed" );
-
-    /* Note: Distinguishing between different types of GPUs here might be necessary in the future,
-       e.g. if max application clocks should not be used for certain GPUs. */
-    if (nvml_stat == NVML_SUCCESS && cuda_dev->nvml_orig_app_sm_clock < max_sm_clock && cuda_dev->nvml_is_restricted == NVML_FEATURE_DISABLED)
+    if (cuda_dev->nvml_orig_app_sm_clock >= max_sm_clock)
     {
-        md_print_info(fplog, "Changing GPU application clocks for %s to (%d,%d)\n", cuda_dev->prop.name, max_mem_clock, max_sm_clock);
-        nvml_stat = nvmlDeviceSetApplicationsClocks(cuda_dev->nvml_device_id, max_mem_clock, max_sm_clock);
-        HANDLE_NVML_RET_ERR( nvml_stat, "nvmlDeviceSetApplicationsClock failed" );
-        cuda_dev->nvml_app_clocks_changed = true;
-        cuda_dev->nvml_set_app_sm_clock   = max_sm_clock;
-        cuda_dev->nvml_set_app_mem_clock  = max_mem_clock;
+        //TODO: This should probably be integrated into the GPU Properties table.
+        GMX_LOG(mdlog.info).appendTextFormatted(
+                "Application clocks (GPU clocks) for %s are (%d,%d)",
+                cuda_dev->prop.name, cuda_dev->nvml_orig_app_mem_clock, cuda_dev->nvml_orig_app_sm_clock);
+        return true;
     }
-    else if (nvml_stat == NVML_SUCCESS && cuda_dev->nvml_orig_app_sm_clock < max_sm_clock)
+
+    if (cuda_compute_capability >= 60)
     {
-        md_print_warn(fplog, "Can not change application clocks for %s to optimal values due to insufficient permissions. Current values are (%d,%d), max values are (%d,%d).\nUse sudo nvidia-smi -acp UNRESTRICTED or contact your admin to change application clocks.\n", cuda_dev->prop.name, cuda_dev->nvml_orig_app_mem_clock, cuda_dev->nvml_orig_app_sm_clock, max_mem_clock, max_sm_clock);
+        GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
+                "Cannot change application clocks for %s to optimal values due to insufficient permissions. Current values are (%d,%d), max values are (%d,%d).\nPlease contact your admin to change application clocks.\n",
+                cuda_dev->prop.name, cuda_dev->nvml_orig_app_mem_clock, cuda_dev->nvml_orig_app_sm_clock, max_mem_clock, max_sm_clock);
+        return true;
     }
-    else if (nvml_stat == NVML_SUCCESS && cuda_dev->nvml_orig_app_sm_clock == max_sm_clock)
+
+    nvml_stat = nvmlDeviceGetAPIRestriction(cuda_dev->nvml_device_id, NVML_RESTRICTED_API_SET_APPLICATION_CLOCKS, &(cuda_dev->nvml_is_restricted));
+    HANDLE_NVML_RET_ERR( nvml_stat, "nvmlDeviceGetAPIRestriction failed" );
+
+    if (nvml_stat != NVML_SUCCESS)
     {
-        md_print_info(fplog, "Application clocks (GPU clocks) for %s are (%d,%d)\n", cuda_dev->prop.name, cuda_dev->nvml_orig_app_mem_clock, cuda_dev->nvml_orig_app_sm_clock);
+        GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
+                "Cannot change GPU application clocks to optimal values due to NVML error (%d): %s.",
+                nvml_stat, nvmlErrorString(nvml_stat));
+        return false;
     }
-    else
+
+    if (cuda_dev->nvml_is_restricted != NVML_FEATURE_DISABLED)
     {
-        md_print_warn( fplog,  "Can not change GPU application clocks to optimal values due to NVML error (%d): %s.\n", nvml_stat, nvmlErrorString(nvml_stat));
+        GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
+                "Cannot change application clocks for %s to optimal values due to insufficient permissions. Current values are (%d,%d), max values are (%d,%d).\nUse sudo nvidia-smi -acp UNRESTRICTED or contact your admin to change application clocks.",
+                cuda_dev->prop.name, cuda_dev->nvml_orig_app_mem_clock, cuda_dev->nvml_orig_app_sm_clock, max_mem_clock, max_sm_clock);
+        return true;
     }
-    return (nvml_stat == NVML_SUCCESS);
+
+    /* Note: Distinguishing between different types of GPUs here might be necessary in the future,
+       e.g. if max application clocks should not be used for certain GPUs. */
+    GMX_LOG(mdlog.warning).appendTextFormatted(
+            "Changing GPU application clocks for %s to (%d,%d)",
+            cuda_dev->prop.name, max_mem_clock, max_sm_clock);
+    nvml_stat = nvmlDeviceSetApplicationsClocks(cuda_dev->nvml_device_id, max_mem_clock, max_sm_clock);
+    HANDLE_NVML_RET_ERR( nvml_stat, "nvmlDeviceGetApplicationsClock failed" );
+    cuda_dev->nvml_app_clocks_changed = true;
+    cuda_dev->nvml_set_app_sm_clock   = max_sm_clock;
+    cuda_dev->nvml_set_app_mem_clock  = max_mem_clock;
+
+    return true;
 #endif /* HAVE_NVML */
 }
 
@@ -484,52 +448,36 @@ static gmx_bool reset_gpu_application_clocks(const gmx_device_info_t gmx_unused
 #endif /* HAVE_NVML_APPLICATION_CLOCKS */
 }
 
-gmx_bool init_gpu(FILE gmx_unused *fplog, int mygpu, char *result_str,
-                  const struct gmx_gpu_info_t *gpu_info,
-                  const struct gmx_gpu_opt_t *gpu_opt)
+void init_gpu(const gmx::MDLogger &mdlog, int rank,
+              gmx_device_info_t *deviceInfo)
 {
     cudaError_t stat;
     char        sbuf[STRLEN];
-    int         gpuid;
 
-    assert(gpu_info);
-    assert(result_str);
+    assert(deviceInfo);
 
-    if (mygpu < 0 || mygpu >= gpu_opt->n_dev_use)
+    stat = cudaSetDevice(deviceInfo->id);
+    if (stat != cudaSuccess)
     {
-        sprintf(sbuf, "Trying to initialize an inexistent GPU: "
-                "there are %d %s-selected GPU(s), but #%d was requested.",
-                gpu_opt->n_dev_use, gpu_opt->bUserSet ? "user" : "auto", mygpu);
-        gmx_incons(sbuf);
+        snprintf(sbuf, STRLEN, "On rank %d failed to initialize GPU #%d",
+                 rank, deviceInfo->id);
+        CU_RET_ERR(stat, sbuf);
     }
 
-    gpuid = gpu_info->gpu_dev[gpu_opt->dev_use[mygpu]].id;
-
-    stat = cudaSetDevice(gpuid);
-    strncpy(result_str, cudaGetErrorString(stat), STRLEN);
-
     if (debug)
     {
-        fprintf(stderr, "Initialized GPU ID #%d: %s\n", gpuid, gpu_info->gpu_dev[gpuid].prop.name);
+        fprintf(stderr, "Initialized GPU ID #%d: %s\n", deviceInfo->id, deviceInfo->prop.name);
     }
 
     //Ignoring return value as NVML errors should be treated not critical.
-    if (stat == cudaSuccess)
-    {
-        init_gpu_application_clocks(fplog, gpuid, gpu_info);
-    }
-    return (stat == cudaSuccess);
+    init_gpu_application_clocks(mdlog, deviceInfo);
 }
 
-gmx_bool free_cuda_gpu(
-        int gmx_unused mygpu, char *result_str,
-        const gmx_gpu_info_t gmx_unused *gpu_info,
-        const gmx_gpu_opt_t gmx_unused *gpu_opt
-        )
+gmx_bool free_cuda_gpu(const gmx_device_info_t *deviceInfo,
+                       char                    *result_str)
 {
     cudaError_t  stat;
     gmx_bool     reset_gpu_application_clocks_status = true;
-    int          gpuid;
 
     assert(result_str);
 
@@ -541,10 +489,9 @@ gmx_bool free_cuda_gpu(
         fprintf(stderr, "Cleaning up context on GPU ID #%d\n", gpuid);
     }
 
-    gpuid = gpu_opt ? gpu_opt->dev_use[mygpu] : -1;
-    if (gpuid != -1)
+    if (deviceInfo != nullptr)
     {
-        reset_gpu_application_clocks_status = reset_gpu_application_clocks( &(gpu_info->gpu_dev[gpuid]) );
+        reset_gpu_application_clocks_status = reset_gpu_application_clocks(deviceInfo);
     }
 
     stat = cudaDeviceReset();
@@ -552,6 +499,16 @@ gmx_bool free_cuda_gpu(
     return (stat == cudaSuccess) && reset_gpu_application_clocks_status;
 }
 
+gmx_device_info_t *getDeviceInfo(const gmx_gpu_info_t &gpu_info,
+                                 int                   deviceId)
+{
+    if (deviceId < 0 || deviceId >= gpu_info.n_dev)
+    {
+        gmx_incons("Invalid GPU deviceId requested");
+    }
+    return &gpu_info.gpu_dev[deviceId];
+}
+
 /*! \brief Returns true if the gpu characterized by the device properties is
  *  supported by the native gpu acceleration.
  *
@@ -564,16 +521,6 @@ static bool is_gmx_supported_gpu(const cudaDeviceProp *dev_prop)
     return (dev_prop->major >= 2);
 }
 
-/*! \brief Helper function that checks whether a given GPU status indicates compatible GPU.
- *
- * \param[in] stat  GPU status.
- * \returns         true if the provided status is egpuCompatible, otherwise false.
- */
-static bool is_compatible_gpu(int stat)
-{
-    return (stat == egpuCompatible);
-}
-
 /*! \brief Checks if a GPU with a given ID is supported by the native GROMACS acceleration.
  *
  *  Returns a status value which indicates compatibility or one of the following
@@ -676,69 +623,22 @@ int detect_gpus(gmx_gpu_info_t *gpu_info, char *err_str)
     return retval;
 }
 
-void pick_compatible_gpus(const gmx_gpu_info_t *gpu_info,
-                          gmx_gpu_opt_t        *gpu_opt)
+bool isGpuCompatible(const gmx_gpu_info_t &gpu_info,
+                     int                   index)
 {
-    int  i, ncompat;
-    int *compat;
-
-    assert(gpu_info);
-    /* gpu_dev/n_dev have to be either NULL/0 or not (NULL/0) */
-    assert((gpu_info->n_dev != 0 ? 0 : 1) ^ (gpu_info->gpu_dev == NULL ? 0 : 1));
-
-    snew(compat, gpu_info->n_dev);
-    ncompat = 0;
-    for (i = 0; i < gpu_info->n_dev; i++)
-    {
-        if (is_compatible_gpu(gpu_info->gpu_dev[i].stat))
-        {
-            ncompat++;
-            compat[ncompat - 1] = i;
-        }
-    }
+    assert(gpu_info.n_dev == 0 || gpu_info.gpu_dev);
 
-    gpu_opt->n_dev_compatible = ncompat;
-    snew(gpu_opt->dev_compatible, ncompat);
-    memcpy(gpu_opt->dev_compatible, compat, ncompat*sizeof(*compat));
-    sfree(compat);
+    return (index >= gpu_info.n_dev ?
+            false :
+            gpu_info.gpu_dev[index].stat == egpuCompatible);
 }
 
-gmx_bool check_selected_gpus(int                  *checkres,
-                             const gmx_gpu_info_t *gpu_info,
-                             gmx_gpu_opt_t        *gpu_opt)
+const char *getGpuCompatibilityDescription(const gmx_gpu_info_t &gpu_info,
+                                           int                   index)
 {
-    int  i, id;
-    bool bAllOk;
-
-    assert(checkres);
-    assert(gpu_info);
-    assert(gpu_opt->n_dev_use >= 0);
-
-    if (gpu_opt->n_dev_use == 0)
-    {
-        return TRUE;
-    }
-
-    assert(gpu_opt->dev_use);
-
-    /* we will assume that all GPUs requested are valid IDs,
-       otherwise we'll bail anyways */
-
-    bAllOk = true;
-    for (i = 0; i < gpu_opt->n_dev_use; i++)
-    {
-        id = gpu_opt->dev_use[i];
-
-        /* devices are stored in increasing order of IDs in gpu_dev */
-        gpu_opt->dev_use[i] = id;
-
-        checkres[i] = (id >= gpu_info->n_dev) ?
-            egpuNonexistent : gpu_info->gpu_dev[id].stat;
-
-        bAllOk = bAllOk && is_compatible_gpu(checkres[i]);
-    }
-
-    return bAllOk;
+    return (index >= gpu_info.n_dev ?
+            gpu_detect_res_str[egpuNonexistent] :
+            gpu_detect_res_str[gpu_info.gpu_dev[index].stat]);
 }
 
 void free_gpu_info(const gmx_gpu_info_t *gpu_info)
@@ -751,17 +651,16 @@ void free_gpu_info(const gmx_gpu_info_t *gpu_info)
     sfree(gpu_info->gpu_dev);
 }
 
-void get_gpu_device_info_string(char *s, const gmx_gpu_info_t *gpu_info, int index)
+void get_gpu_device_info_string(char *s, const gmx_gpu_info_t &gpu_info, int index)
 {
     assert(s);
-    assert(gpu_info);
 
-    if (index < 0 && index >= gpu_info->n_dev)
+    if (index < 0 && index >= gpu_info.n_dev)
     {
         return;
     }
 
-    gmx_device_info_t *dinfo = &gpu_info->gpu_dev[index];
+    gmx_device_info_t *dinfo = &gpu_info.gpu_dev[index];
 
     bool               bGpuExists =
         dinfo->stat == egpuCompatible ||
@@ -783,17 +682,6 @@ void get_gpu_device_info_string(char *s, const gmx_gpu_info_t *gpu_info, int ind
     }
 }
 
-int get_gpu_device_id(const gmx_gpu_info_t *gpu_info,
-                      const gmx_gpu_opt_t  *gpu_opt,
-                      int                   idx)
-{
-    assert(gpu_info);
-    assert(gpu_opt);
-    assert(idx >= 0 && idx < gpu_opt->n_dev_use);
-
-    return gpu_info->gpu_dev[gpu_opt->dev_use[idx]].id;
-}
-
 int get_current_cuda_gpu_device_id(void)
 {
     int gpuid;
index f485abb0fb4f1ff8b7b7661ff8c713180ab3919f..b4371049be23ac5a520952a8df8b15ae25ff7c7f 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, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,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.
 #include "gromacs/gpu_utils/gpu_macros.h"
 #include "gromacs/utility/basedefinitions.h"
 
+struct gmx_device_info_t;
 struct gmx_gpu_info_t;
-struct gmx_gpu_opt_t;
+
+namespace gmx
+{
+class MDLogger;
+}
 
 /*! \brief Detect all GPUs in the system.
  *
@@ -69,39 +74,25 @@ struct gmx_gpu_opt_t;
 GPU_FUNC_QUALIFIER
 int detect_gpus(struct gmx_gpu_info_t *GPU_FUNC_ARGUMENT(gpu_info), char *GPU_FUNC_ARGUMENT(err_str)) GPU_FUNC_TERM_WITH_RETURN(-1)
 
-/*! \brief Select the compatible GPUs
- *
- * This function selects the compatible gpus and initializes
- * gpu_info->dev_use and gpu_info->n_dev_use.
+/*! \brief Return whether the GPU with given \c index is compatible, ie suitable for use.
  *
- * Given the list of GPUs available in the system check each device in
- * gpu_info->gpu_dev and place the indices of the compatible GPUs into
- * dev_use with this marking the respective GPUs as "available for use."
- * Note that \p detect_gpus must have been called before.
- *
- * \param[in]     gpu_info    pointer to structure holding GPU information
- * \param[in,out] gpu_opt     pointer to structure holding GPU options
+ * \param[in]   gpu_info    Information about detected GPUs
+ * \param[in]   index       index of GPU to ask about
+ * \returns                 Whether the GPU is compatible.
  */
 GPU_FUNC_QUALIFIER
-void pick_compatible_gpus(const struct gmx_gpu_info_t *GPU_FUNC_ARGUMENT(gpu_info),
-                          gmx_gpu_opt_t *GPU_FUNC_ARGUMENT(gpu_opt)) GPU_FUNC_TERM
+bool isGpuCompatible(const gmx_gpu_info_t &GPU_FUNC_ARGUMENT(gpu_info),
+                     int GPU_FUNC_ARGUMENT(index)) GPU_FUNC_TERM_WITH_RETURN(false)
 
-/*! \brief Check the existence/compatibility of a set of GPUs specified by their device IDs.
- *
- * Given the a list of gpu_opt->n_dev_use GPU device IDs stored in
- * gpu_opt->dev_use check the existence and compatibility
- * of the respective GPUs. Also provide the caller with an array containing
- * the result of checks in \p checkres.
+/*! \brief Return a string describing how compatible the GPU with given \c index is.
  *
- * \param[out]  checkres    check result for each ID passed in requested_devs
- * \param[in]   gpu_info    pointer to structure holding GPU information
- * \param[out]  gpu_opt     pointer to structure holding GPU options
- * \returns                 TRUE if every the requested GPUs are compatible
+ * \param[in]   gpu_info    Information about detected GPUs
+ * \param[in]   index       index of GPU to ask about
+ * \returns                 A null-terminated C string describing the compatibility status, useful for error messages.
  */
 GPU_FUNC_QUALIFIER
-gmx_bool check_selected_gpus(int *GPU_FUNC_ARGUMENT(checkres),
-                             const struct gmx_gpu_info_t *GPU_FUNC_ARGUMENT(gpu_info),
-                             gmx_gpu_opt_t *GPU_FUNC_ARGUMENT(gpu_opt)) GPU_FUNC_TERM_WITH_RETURN(-1)
+const char *getGpuCompatibilityDescription(const gmx_gpu_info_t &GPU_FUNC_ARGUMENT(gpu_info),
+                                           int GPU_FUNC_ARGUMENT(index)) GPU_FUNC_TERM_WITH_RETURN("")
 
 /*! \brief Frees the gpu_dev and dev_use array fields of \p gpu_info.
  *
@@ -110,84 +101,57 @@ gmx_bool check_selected_gpus(int *GPU_FUNC_ARGUMENT(checkres),
 GPU_FUNC_QUALIFIER
 void free_gpu_info(const struct gmx_gpu_info_t *GPU_FUNC_ARGUMENT(gpu_info)) GPU_FUNC_TERM
 
-/*! \brief Initializes the GPU with the given index.
+/*! \brief Initializes the GPU described by \c deviceInfo.
  *
- * The varible \p mygpu is the index of the GPU to initialize in the
- * gpu_info.gpu_dev array.
+ * TODO Doxygen complains about these - probably a Doxygen bug, since
+ * the patterns here are the same as elsewhere in this header.
  *
- * \param[out] fplog        log file to write to
- * \param[in]  mygpu        index of the GPU to initialize
- * \param[out] result_str   the message related to the error that occurred
- *                          during the initialization (if there was any).
- * \param[in] gpu_info      GPU info of all detected devices in the system.
- * \param[in] gpu_opt       options for using the GPUs in gpu_info
- * \returns                 true if no error occurs during initialization.
+ *  param[in]    mdlog        log file to write to
+ *  param[in]    rank         MPI rank of this process (for error output)
+ * \param[inout] deviceInfo   device info of the GPU to initialize
+ *
+ * Issues a fatal error for any critical errors that occur during
+ * initialization.
  */
 GPU_FUNC_QUALIFIER
-gmx_bool init_gpu(FILE *GPU_FUNC_ARGUMENT(fplog),
-                  int GPU_FUNC_ARGUMENT(mygpu),
-                  char *GPU_FUNC_ARGUMENT(result_str),
-                  const struct gmx_gpu_info_t *GPU_FUNC_ARGUMENT(gpu_info),
-                  const gmx_gpu_opt_t *GPU_FUNC_ARGUMENT(gpu_opt)) GPU_FUNC_TERM_WITH_RETURN(-1)
+void init_gpu(const gmx::MDLogger &GPU_FUNC_ARGUMENT(mdlog),
+              int GPU_FUNC_ARGUMENT(rank),
+              gmx_device_info_t *GPU_FUNC_ARGUMENT(deviceInfo)) GPU_FUNC_TERM
 
 /*! \brief Frees up the CUDA GPU used by the active context at the time of calling.
  *
  * The context is explicitly destroyed and therefore all data uploaded to the GPU
  * is lost. This should only be called when none of this data is required anymore.
  *
- * \param[in]  mygpu        index of the GPU clean up for
+ * \param[in]  deviceInfo   device info of the GPU to clean up for
  * \param[out] result_str   the message related to the error that occurred
  *                          during the initialization (if there was any).
- * \param[in] gpu_info      GPU info of all detected devices in the system.
- * \param[in] gpu_opt       options for using the GPUs in gpu_info
- * \returns                 true if no error occurs during the freeing.
- */
-CUDA_FUNC_QUALIFIER
-gmx_bool free_cuda_gpu(int CUDA_FUNC_ARGUMENT(mygpu),
-                       char *CUDA_FUNC_ARGUMENT(result_str),
-                       const gmx_gpu_info_t *CUDA_FUNC_ARGUMENT(gpu_info),
-                       const gmx_gpu_opt_t *CUDA_FUNC_ARGUMENT(gpu_opt)) CUDA_FUNC_TERM_WITH_RETURN(TRUE)
-
-/*! \brief Returns the device ID of the CUDA GPU currently in use.
- *
- * The GPU used is the one that is active at the time of the call in the active context.
  *
- * \returns                 device ID of the GPU in use at the time of the call
+ * \returns                 true if no error occurs during the freeing.
  */
 CUDA_FUNC_QUALIFIER
-int get_current_cuda_gpu_device_id(void) CUDA_FUNC_TERM_WITH_RETURN(-1)
+gmx_bool free_cuda_gpu(const gmx_device_info_t *CUDA_FUNC_ARGUMENT(deviceInfo),
+                       char *CUDA_FUNC_ARGUMENT(result_str)) CUDA_FUNC_TERM_WITH_RETURN(TRUE)
 
-/*! \brief Returns an identifier for the GPU with a given index into the array of used GPUs.
+/*! \brief Return a pointer to the device info for \c deviceId
  *
- * Getter function which, given an index into the array of GPUs in use
- * (dev_use) -- typically an MPI rank --, returns an identifier of the
- * respective GPU.
+ * \param[in] gpu_info      GPU info of all detected devices in the system.
+ * \param[in] deviceId      ID for the GPU device requested.
  *
- * \param[in]    gpu_info   Pointer to structure holding GPU information
- * \param[in]    gpu_opt    Pointer to structure holding GPU options
- * \param[in]    idx        Index into the array of used GPUs
- * \returns                 device ID of the requested GPU
+ * \returns                 Pointer to the device info for \c deviceId.
  */
 GPU_FUNC_QUALIFIER
-int get_gpu_device_id(const struct gmx_gpu_info_t *GPU_FUNC_ARGUMENT(gpu_info),
-                      const gmx_gpu_opt_t *GPU_FUNC_ARGUMENT(gpu_opt),
-                      int GPU_FUNC_ARGUMENT(idx)) GPU_FUNC_TERM_WITH_RETURN(-1)
+gmx_device_info_t *getDeviceInfo(const gmx_gpu_info_t &GPU_FUNC_ARGUMENT(gpu_info),
+                                 int GPU_FUNC_ARGUMENT(deviceId)) GPU_FUNC_TERM_WITH_RETURN(NULL)
 
-/*! \brief Returns the name for the OpenCL GPU with a given index into the array of used GPUs.
+/*! \brief Returns the device ID of the CUDA GPU currently in use.
  *
- * Getter function which, given an index into the array of GPUs in use
- * (dev_use) -- typically a tMPI/MPI rank --, returns the device name for the
- * respective OpenCL GPU.
+ * The GPU used is the one that is active at the time of the call in the active context.
  *
- * \param[in]    gpu_info   Pointer to structure holding GPU information
- * \param[in]    gpu_opt    Pointer to structure holding GPU options
- * \param[in]    idx        Index into the array of used GPUs
- * \returns                 A string with the name of the requested OpenCL GPU
+ * \returns                 device ID of the GPU in use at the time of the call
  */
-OPENCL_FUNC_QUALIFIER
-char* get_ocl_gpu_device_name(const struct gmx_gpu_info_t *OPENCL_FUNC_ARGUMENT(gpu_info),
-                              const gmx_gpu_opt_t  *OPENCL_FUNC_ARGUMENT(gpu_opt),
-                              int                  OPENCL_FUNC_ARGUMENT(idx)) OPENCL_FUNC_TERM_WITH_RETURN(NULL)
+CUDA_FUNC_QUALIFIER
+int get_current_cuda_gpu_device_id(void) CUDA_FUNC_TERM_WITH_RETURN(-1)
 
 /*! \brief Formats and returns a device information string for a given GPU.
  *
@@ -196,12 +160,12 @@ char* get_ocl_gpu_device_name(const struct gmx_gpu_info_t *OPENCL_FUNC_ARGUMENT(
  * ID, name, compute capability, and detection status.
  *
  * \param[out]  s           pointer to output string (has to be allocated externally)
- * \param[in]   gpu_info    pointer to structure holding GPU information
+ * \param[in]   gpu_info    Information about detected GPUs
  * \param[in]   index       an index *directly* into the array of available GPUs
  */
 GPU_FUNC_QUALIFIER
 void get_gpu_device_info_string(char *GPU_FUNC_ARGUMENT(s),
-                                const struct gmx_gpu_info_t *GPU_FUNC_ARGUMENT(gpu_info),
+                                const struct gmx_gpu_info_t &GPU_FUNC_ARGUMENT(gpu_info),
                                 int GPU_FUNC_ARGUMENT(index)) GPU_FUNC_TERM
 
 /*! \brief Returns the size of the gpu_dev_info struct.
index 3a41f41bb976d10597d5dd6e340538ee3662a5e9..9ffb558588ee3252c14927e3ede0fb9ceebecafd 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,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.
 }
 
 
-/*! \brief Helper function that checks whether a given GPU status indicates compatible GPU.
- *
- * \param[in] stat  GPU status.
- * \returns         true if the provided status is egpuCompatible, otherwise false.
- */
-static bool is_compatible_gpu(int stat)
-{
-    return (stat == egpuCompatible);
-}
-
 /*! \brief Return true if executing on compatible OS for AMD OpenCL.
  *
  * This is assumed to be true for OS X version of at least 10.10.4 and
@@ -124,6 +114,11 @@ runningOnCompatibleOSForAmd()
  */
 static int is_gmx_supported_gpu_id(struct gmx_device_info_t *ocl_gpu_device)
 {
+    if ((getenv("GMX_OCL_DISABLE_COMPATIBILITY_CHECK")) != NULL)
+    {
+        return egpuCompatible;
+    }
+
     /* Only AMD and NVIDIA GPUs are supported for now */
     switch (ocl_gpu_device->vendor_e)
     {
@@ -348,84 +343,34 @@ void free_gpu_info(const gmx_gpu_info_t gmx_unused *gpu_info)
 }
 
 //! This function is documented in the header file
-void pick_compatible_gpus(const gmx_gpu_info_t *gpu_info,
-                          gmx_gpu_opt_t        *gpu_opt)
+bool isGpuCompatible(const gmx_gpu_info_t &gpu_info,
+                     int                   index)
 {
-    int  i, ncompat;
-    int *compat;
-
-    assert(gpu_info);
-    /* gpu_dev/n_dev have to be either NULL/0 or not (NULL/0) */
-    assert((gpu_info->n_dev != 0 ? 0 : 1) ^ (gpu_info->gpu_dev == NULL ? 0 : 1));
-
-    snew(compat, gpu_info->n_dev);
-    ncompat = 0;
-    for (i = 0; i < gpu_info->n_dev; i++)
-    {
-        if (is_compatible_gpu(gpu_info->gpu_dev[i].stat))
-        {
-            ncompat++;
-            compat[ncompat - 1] = i;
-        }
-    }
-
-    gpu_opt->n_dev_compatible = ncompat;
-    snew(gpu_opt->dev_compatible, ncompat);
-    memcpy(gpu_opt->dev_compatible, compat, ncompat*sizeof(*compat));
-    sfree(compat);
+    return (index >= gpu_info.n_dev ?
+            false :
+            gpu_info.gpu_dev[index].stat == egpuCompatible);
 }
 
 //! This function is documented in the header file
-gmx_bool check_selected_gpus(int                  *checkres,
-                             const gmx_gpu_info_t *gpu_info,
-                             gmx_gpu_opt_t        *gpu_opt)
+const char *getGpuCompatibilityDescription(const gmx_gpu_info_t &gpu_info,
+                                           int                   index)
 {
-    int  i, id;
-    bool bAllOk;
-
-    assert(checkres);
-    assert(gpu_info);
-    assert(gpu_opt->n_dev_use >= 0);
-
-    if (gpu_opt->n_dev_use == 0)
-    {
-        return TRUE;
-    }
-
-    assert(gpu_opt->dev_use);
-
-    /* we will assume that all GPUs requested are valid IDs,
-       otherwise we'll bail anyways */
-
-    bAllOk = true;
-    for (i = 0; i < gpu_opt->n_dev_use; i++)
-    {
-        id = gpu_opt->dev_use[i];
-
-        /* devices are stored in increasing order of IDs in gpu_dev */
-        gpu_opt->dev_use[i] = id;
-
-        checkres[i] = (id >= gpu_info->n_dev) ?
-            egpuNonexistent : gpu_info->gpu_dev[id].stat;
-
-        bAllOk = bAllOk && is_compatible_gpu(checkres[i]);
-    }
-
-    return bAllOk;
+    return (index >= gpu_info.n_dev ?
+            gpu_detect_res_str[egpuNonexistent] :
+            gpu_detect_res_str[gpu_info.gpu_dev[index].stat]);
 }
 
 //! This function is documented in the header file
-void get_gpu_device_info_string(char gmx_unused *s, const gmx_gpu_info_t gmx_unused *gpu_info, int gmx_unused index)
+void get_gpu_device_info_string(char *s, const gmx_gpu_info_t &gpu_info, int index)
 {
     assert(s);
-    assert(gpu_info);
 
-    if (index < 0 && index >= gpu_info->n_dev)
+    if (index < 0 && index >= gpu_info.n_dev)
     {
         return;
     }
 
-    gmx_device_info_t  *dinfo = &gpu_info->gpu_dev[index];
+    gmx_device_info_t  *dinfo = &gpu_info.gpu_dev[index];
 
     bool                bGpuExists =
         dinfo->stat == egpuCompatible ||
@@ -447,32 +392,18 @@ void get_gpu_device_info_string(char gmx_unused *s, const gmx_gpu_info_t gmx_unu
 }
 
 //! This function is documented in the header file
-gmx_bool init_gpu(FILE gmx_unused                 *fplog,
-                  int                              mygpu,
-                  char                            *result_str,
-                  const gmx_gpu_info_t gmx_unused *gpu_info,
-                  const gmx_gpu_opt_t             *gpu_opt
-                  )
+void init_gpu(const gmx::MDLogger               & /*mdlog*/,
+              int                               /* rank */,
+              gmx_device_info_t                *deviceInfo)
 {
-    assert(result_str);
-
-    result_str[0] = 0;
-
-    if (mygpu < 0 || mygpu >= gpu_opt->n_dev_use)
-    {
-        char        sbuf[STRLEN];
-        sprintf(sbuf, "Trying to initialize an inexistent GPU: "
-                "there are %d %s-selected GPU(s), but #%d was requested.",
-                gpu_opt->n_dev_use, gpu_opt->bUserSet ? "user" : "auto", mygpu);
-        gmx_incons(sbuf);
-    }
+    assert(deviceInfo);
 
     // If the device is NVIDIA, for safety reasons we disable the JIT
     // caching as this is known to be broken at least until driver 364.19;
     // the cache does not always get regenerated when the source code changes,
     // e.g. if the path to the kernel sources remains the same
 
-    if (gpu_info->gpu_dev[mygpu].vendor_e == OCL_VENDOR_NVIDIA)
+    if (deviceInfo->vendor_e == OCL_VENDOR_NVIDIA)
     {
         // Ignore return values, failing to set the variable does not mean
         // that something will go wrong later.
@@ -483,31 +414,17 @@ gmx_bool init_gpu(FILE gmx_unused                 *fplog,
         setenv("CUDA_CACHE_DISABLE", "1", 0);
 #endif
     }
-
-    return TRUE;
-}
-
-//! This function is documented in the header file
-int get_gpu_device_id(const gmx_gpu_info_t  *,
-                      const gmx_gpu_opt_t  *gpu_opt,
-                      int                   idx)
-{
-    assert(gpu_opt);
-    assert(idx >= 0 && idx < gpu_opt->n_dev_use);
-
-    return gpu_opt->dev_use[idx];
 }
 
 //! This function is documented in the header file
-char* get_ocl_gpu_device_name(const gmx_gpu_info_t *gpu_info,
-                              const gmx_gpu_opt_t  *gpu_opt,
-                              int                   idx)
+gmx_device_info_t *getDeviceInfo(const gmx_gpu_info_t &gpu_info,
+                                 int                   deviceId)
 {
-    assert(gpu_info);
-    assert(gpu_opt);
-    assert(idx >= 0 && idx < gpu_opt->n_dev_use);
-
-    return gpu_info->gpu_dev[gpu_opt->dev_use[idx]].device_name;
+    if (deviceId < 0 || deviceId >= gpu_info.n_dev)
+    {
+        gmx_incons("Invalid GPU deviceId requested");
+    }
+    return &gpu_info.gpu_dev[deviceId];
 }
 
 //! This function is documented in the header file
index d48fdb5de4ba6785f412efe10abd6d7851c922ee..d6016671ef17214787877cf63c9d018f6af3cec3 100644 (file)
 
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/programcontext.h"
-#include "gromacs/utility/scoped_cptr.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/stringutil.h"
 #include "gromacs/utility/textreader.h"
+#include "gromacs/utility/unique_cptr.h"
 
 namespace gmx
 {
 namespace ocl
 {
 
-/*! \brief RAII helper to use with scoped_cptr
- *
- * Can't use fclose because the template requires a function that
- * returns void.
- *
- * \todo Either generalise scoped_cptr somehow, or (better) make
- * general infrastructure for reading and writing binary lumps.
- * Neither of these is a priority while JIT caching is inactive.
- */
-static void fclose_wrapper(FILE *fp)
-{
-    assert(fp != NULL);
-    fclose(fp);
-}
-
 std::string makeBinaryCacheFilename(const std::string &kernelFilename,
                                     cl_device_id       deviceId)
 {
@@ -119,22 +104,21 @@ makeProgramFromCache(const std::string &filename,
                      cl_device_id       deviceId)
 {
     // TODO all this file reading stuff should become gmx::BinaryReader
-    FILE *f = fopen(filename.c_str(), "rb");
-    scoped_cptr<FILE, fclose_wrapper> fileGuard(f);
+    const auto f = create_unique_with_deleter(fopen(filename.c_str(), "rb"), fclose);
     if (!f)
     {
         GMX_THROW(FileIOError("Failed to open binary cache file " + filename));
     }
 
     // TODO more stdio error handling
-    fseek(f, 0, SEEK_END);
+    fseek(f.get(), 0, SEEK_END);
     unsigned char             *binary;
-    scoped_cptr<unsigned char> binaryGuard;
-    size_t                     fileSize = ftell(f);
+    unique_cptr<unsigned char> binaryGuard;
+    size_t                     fileSize = ftell(f.get());
     snew(binary, fileSize);
     binaryGuard.reset(binary);
-    fseek(f, 0, SEEK_SET);
-    size_t readCount = fread(binary, 1, fileSize, f);
+    fseek(f.get(), 0, SEEK_SET);
+    size_t readCount = fread(binary, 1, fileSize, f.get());
 
     if (readCount != fileSize)
     {
@@ -176,9 +160,9 @@ writeBinaryToCache(cl_program program, const std::string &filename)
     }
 
     // TODO all this file writing stuff should become gmx::BinaryWriter
-    unsigned char             *binary;
+    unsigned char                   *binary;
     snew(binary, fileSize);
-    scoped_cptr<unsigned char> binaryGuard(binary);
+    const unique_cptr<unsigned char> binaryGuard(binary);
 
     cl_error = clGetProgramInfo(program, CL_PROGRAM_BINARIES, sizeof(binary), &binary, NULL);
     if (cl_error != CL_SUCCESS)
@@ -186,14 +170,13 @@ writeBinaryToCache(cl_program program, const std::string &filename)
         GMX_THROW(InternalError("Could not get OpenCL program binary, error was " + ocl_get_error_string(cl_error)));
     }
 
-    FILE *f = fopen(filename.c_str(), "wb");
-    scoped_cptr<FILE, fclose_wrapper> fileGuard(f);
+    const auto f = create_unique_with_deleter(fopen(filename.c_str(), "wb"), fclose);
     if (!f)
     {
         GMX_THROW(FileIOError("Failed to open binary cache file " + filename));
     }
 
-    fwrite(binary, 1, fileSize, f);
+    fwrite(binary, 1, fileSize, f.get());
 }
 
 } // namespace
index 3c5e500b42c98de42acc684963ff06e015cf2c2f..76f439e1bd6eaa4b62b1ec574e6b13835be41305 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,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.
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/path.h"
 #include "gromacs/utility/programcontext.h"
-#include "gromacs/utility/scoped_cptr.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/stringutil.h"
 #include "gromacs/utility/textreader.h"
+#include "gromacs/utility/unique_cptr.h"
 
 #include "ocl_caching.h"
 
@@ -120,7 +120,7 @@ writeOclBuildLog(FILE              *fplog,
     }
 
     char             *buildLog = nullptr;
-    scoped_cptr<char> buildLogGuard;
+    unique_cptr<char> buildLogGuard;
     if (buildLogSize != 0)
     {
         /* Allocate memory to fit the build log,
@@ -366,7 +366,7 @@ static std::string makeKernelIncludePathOption(const std::string &unescapedKerne
 /*! \brief Builds a string with build options for the OpenCL kernels
  *
  * \throws std::bad_alloc  if out of memory. */
-std::string
+static std::string
 makePreprocessorOptions(const std::string   &kernelRootPath,
                         size_t               warpSize,
                         ocl_vendor_id_t      deviceVendorId,
index b5db76eb4cca5222a440ed4a17a9344fca999333..33e64941ceb107215c8ab192608ede8319ca1fb4 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,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.
@@ -47,7 +47,6 @@
 #include <string>
 
 #include "gromacs/gpu_utils/oclutils.h"
-#include "gromacs/hardware/gpu_hw_info.h"
 
 namespace gmx
 {
index f733bdb65be547d983b9783d3815c2f370cd2c3c..0e38ddb8eabd91ac4922624885bfe1ad25967ad0 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) 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.
@@ -115,11 +115,11 @@ int ocl_copy_H2D(cl_mem d_dest, void * h_src,
  *  identifying this particular device to host operation. The event can further
  *  be used to queue a wait for this operation or to query profiling information.
  */
-int ocl_copy_D2H_generic(void * h_dest, cl_mem d_src,
-                         size_t offset, size_t bytes,
-                         bool bAsync,
-                         cl_command_queue command_queue,
-                         cl_event *copy_event)
+static int ocl_copy_D2H_generic(void * h_dest, cl_mem d_src,
+                                size_t offset, size_t bytes,
+                                bool bAsync,
+                                cl_command_queue command_queue,
+                                cl_event *copy_event)
 {
     cl_int gmx_unused cl_error;
 
@@ -271,6 +271,7 @@ std::string ocl_get_error_string(cl_int error)
         case -1003: return "CL_INVALID_D3D10_RESOURCE_KHR";
         case -1004: return "CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR";
         case -1005: return "CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR";
-        default: return "Unknown OpenCL error";
+        default:    return "Unknown OpenCL error: " +
+                   std::to_string(static_cast<int32_t>(error));
     }
 }
index 77a50db495d3ff9460fe99611b9eb77fc1099b6e..116b24fe71f4a56823d27fbf4915e8306d5af48c 100644 (file)
@@ -57,6 +57,13 @@ endif()
 include(${_gmx_import_file})
 unset(_gmx_import_file)
 
+get_target_property(_libs libgromacs INTERFACE_LINK_LIBRARIES)
+if (_libs MATCHES "tng_io::tng_io")
+    include(CMakeFindDependencyMacro)
+    find_dependency(TNG_IO)
+endif()
+unset(_libs)
+
 set(GROMACS_INCLUDE_DIRS)
 set(_include_dirs "@INSTALLED_HEADER_INCLUDE_DIRS@")
 foreach (_dir ${_include_dirs})
index 83016454f57456d86461bfafa2a7f16bdad8059b..19f17d80133b8bc2e99f64b10e850fb34d8c4f67 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2015, by the GROMACS development team, led by
+# Copyright (c) 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.
 gmx_add_libgromacs_sources(
     cpuinfo.cpp
     detecthardware.cpp
+    hardwareassign.cpp
     hardwaretopology.cpp
+    gpu_hw_info.cpp
+    printhardware.cpp
     )
 
 if (BUILD_TESTING)
diff --git a/src/gromacs/hardware/architecture.h b/src/gromacs/hardware/architecture.h
new file mode 100644 (file)
index 0000000..2161e25
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Declares and defines architecture booleans to minimize preprocessed code
+ *
+ * \ingroup module_hardware
+ */
+#ifndef GMX_ARCHITECTURE_H
+#define GMX_ARCHITECTURE_H
+
+namespace gmx
+{
+
+//! Enum for GROMACS CPU hardware detection support
+enum class Architecture
+{
+    Unknown, //! Not one of the cases below
+    X86,     //! X86
+    Arm,     //! ARM
+    PowerPC  //! IBM PowerPC
+};
+
+//! Constant that tells what the architecture is
+static constexpr Architecture c_architecture =
+#if defined __i386__ || defined __i386 || defined _X86_ || defined _M_IX86 || \
+    defined __x86_64__ || defined __amd64__ || defined _M_X64 || defined _M_AMD64
+    Architecture::X86;
+#elif defined __arm__ || defined __arm || defined _M_ARM || defined __aarch64_
+    Architecture::Arm;
+#elif defined __powerpc__ || defined __ppc__ || defined __PPC__
+    Architecture::PowerPC;
+#else
+    Architecture::Unknown;
+#endif
+
+}      // namespace gmx
+
+#endif // GMX_ARCHITECTURE_H
index df8d70086f945ca8b10f640af6d69e6f1358c9f1..3ff092d2846e4aabead3563da5bd2e1d6b3143f7 100644 (file)
@@ -99,6 +99,8 @@
 #    include "gromacs/utility/basedefinitions.h"
 #endif
 
+#include "architecture.h"
+
 namespace gmx
 {
 
@@ -152,62 +154,60 @@ executeX86CpuID(unsigned int     gmx_unused level,
                 unsigned int *              ecx,
                 unsigned int *              edx)
 {
-#if defined __i386__ || defined __i386 || defined _X86_ || defined _M_IX86 || \
-    defined __x86_64__ || defined __amd64__ || defined _M_X64 || defined _M_AMD64
-
-#    if defined __GNUC__ || GMX_X86_GCC_INLINE_ASM
-
-    // any compiler that understands gcc inline assembly
-    *eax = level;
-    *ecx = ecxval;
-    *ebx = 0;
-    *edx = 0;
-
-#        if (defined __i386__ || defined __i386 || defined _X86_ || defined _M_IX86) && defined(__PIC__)
-    // Avoid clobbering the global offset table in 32-bit pic code (ebx register)
-    __asm__ __volatile__ ("xchgl %%ebx, %1  \n\t"
-                          "cpuid            \n\t"
-                          "xchgl %%ebx, %1  \n\t"
-                          : "+a" (*eax), "+r" (*ebx), "+c" (*ecx), "+d" (*edx));
-#        else
-    // i386 without PIC, or x86-64. Things are easy and we can clobber any reg we want
-    __asm__ __volatile__ ("cpuid            \n\t"
-                          : "+a" (*eax), "+b" (*ebx), "+c" (*ecx), "+d" (*edx));
-#        endif
-    return 0;
-
-#    elif defined _MSC_VER
-
-    // MSVC (and icc on windows) on ia32 or x86-64
-    int cpuInfo[4];
-    __cpuidex(cpuInfo, level, ecxval);
-    *eax = static_cast<unsigned int>(cpuInfo[0]);
-    *ebx = static_cast<unsigned int>(cpuInfo[1]);
-    *ecx = static_cast<unsigned int>(cpuInfo[2]);
-    *edx = static_cast<unsigned int>(cpuInfo[3]);
-    return 0;
-
+    if (c_architecture == Architecture::X86)
+    {
+#if defined __GNUC__ || GMX_X86_GCC_INLINE_ASM
+
+        // any compiler that understands gcc inline assembly
+        *eax = level;
+        *ecx = ecxval;
+        *ebx = 0;
+        *edx = 0;
+
+#    if (defined __i386__ || defined __i386 || defined _X86_ || defined _M_IX86) && defined(__PIC__)
+        // Avoid clobbering the global offset table in 32-bit pic code (ebx register)
+        __asm__ __volatile__ ("xchgl %%ebx, %1  \n\t"
+                              "cpuid            \n\t"
+                              "xchgl %%ebx, %1  \n\t"
+                              : "+a" (*eax), "+r" (*ebx), "+c" (*ecx), "+d" (*edx));
 #    else
+        // i386 without PIC, or x86-64. Things are easy and we can clobber any reg we want
+        __asm__ __volatile__ ("cpuid            \n\t"
+                              : "+a" (*eax), "+b" (*ebx), "+c" (*ecx), "+d" (*edx));
+#    endif
+        return 0;
 
-    // We are on x86, but without compiler support for cpuid if we get here
-    *eax = 0;
-    *ebx = 0;
-    *ecx = 0;
-    *edx = 0;
-    return 1;
+#elif defined _MSC_VER
 
-#    endif  // check for inline asm on x86
+        // MSVC (and icc on windows) on ia32 or x86-64
+        int cpuInfo[4];
+        __cpuidex(cpuInfo, level, ecxval);
+        *eax = static_cast<unsigned int>(cpuInfo[0]);
+        *ebx = static_cast<unsigned int>(cpuInfo[1]);
+        *ecx = static_cast<unsigned int>(cpuInfo[2]);
+        *edx = static_cast<unsigned int>(cpuInfo[3]);
+        return 0;
 
 #else
 
-    // We are not on x86
-    *eax = 0;
-    *ebx = 0;
-    *ecx = 0;
-    *edx = 0;
-    return 1;
+        // We are on x86, but without compiler support for cpuid if we get here
+        *eax = 0;
+        *ebx = 0;
+        *ecx = 0;
+        *edx = 0;
+        return 1;
 
-#endif      // x86
+#endif          // check for inline asm on x86
+    }
+    else
+    {
+        // We are not on x86
+        *eax = 0;
+        *ebx = 0;
+        *ecx = 0;
+        *edx = 0;
+        return 1;
+    }
 }
 
 
@@ -777,7 +777,7 @@ detectProcCpuInfoArm(const std::map<std::string, std::string>   &cpuInfo,
     }
     if (cpuInfo.count("CPU architecture"))
     {
-        *family = std::strtol(cpuInfo.at("CPU architecture").c_str(), NULL, 10);
+        *family = std::strtol(cpuInfo.at("CPU architecture").c_str(), nullptr, 10);
         // For some 64-bit CPUs it appears to say 'AArch64' instead
         if (*family == 0 && cpuInfo.at("CPU architecture").find("AArch64") != std::string::npos)
         {
@@ -786,11 +786,11 @@ detectProcCpuInfoArm(const std::map<std::string, std::string>   &cpuInfo,
     }
     if (cpuInfo.count("CPU variant"))
     {
-        *model    = std::strtol(cpuInfo.at("CPU variant").c_str(), NULL, 16);
+        *model    = std::strtol(cpuInfo.at("CPU variant").c_str(), nullptr, 16);
     }
     if (cpuInfo.count("CPU revision"))
     {
-        *stepping = std::strtol(cpuInfo.at("CPU revision").c_str(), NULL, 10);
+        *stepping = std::strtol(cpuInfo.at("CPU revision").c_str(), nullptr, 10);
     }
 
     if (cpuInfo.count("Features"))
@@ -873,36 +873,48 @@ CpuInfo CpuInfo::detect()
 {
     CpuInfo result;
 
-#if defined __i386__ || defined __i386 || defined _X86_ || defined _M_IX86 || \
-    defined __x86_64__ || defined __amd64__ || defined _M_X64 || defined _M_AMD64
-
-    result.vendor_            = detectX86Vendor();
-    detectX86Features(&result.brandString_, &result.family_, &result.model_,
-                      &result.stepping_, &result.features_);
-    result.logicalProcessors_ = detectX86LogicalProcessors();
-#else   // not x86
-
-#    if defined __arm__ || defined __arm || defined _M_ARM || defined __aarch64__
-    result.vendor_  = CpuInfo::Vendor::Arm;
-#    elif defined __powerpc__ || defined __ppc__ || defined __PPC__
-    result.vendor_  = CpuInfo::Vendor::Ibm;
-#    endif
+    if (c_architecture == Architecture::X86)
+    {
+        result.vendor_ = detectX86Vendor();
 
-#    if defined __aarch64__ || ( defined _M_ARM && _M_ARM >= 8 )
-    result.features_.insert(Feature::Arm_Neon);      // ARMv8 always has Neon
-    result.features_.insert(Feature::Arm_NeonAsimd); // ARMv8 always has Neon-asimd
-#    endif
+        if (result.vendor_ == CpuInfo::Vendor::Intel)
+        {
+            result.features_.insert(CpuInfo::Feature::X86_Intel);
+        }
+        else if (result.vendor_ == CpuInfo::Vendor::Amd)
+        {
+            result.features_.insert(CpuInfo::Feature::X86_Amd);
+        }
+        detectX86Features(&result.brandString_, &result.family_, &result.model_,
+                          &result.stepping_, &result.features_);
+        result.logicalProcessors_ = detectX86LogicalProcessors();
+    }
+    else
+    {
+        // Not x86
+        if (c_architecture == Architecture::Arm)
+        {
+            result.vendor_  = CpuInfo::Vendor::Arm;
+        }
+        else if (c_architecture == Architecture::PowerPC)
+        {
+            result.vendor_  = CpuInfo::Vendor::Ibm;
+        }
 
-#    if defined sun
-    result.vendor_ = CpuInfo::Vendor::Oracle;
-#    endif
+#if defined __aarch64__ || ( defined _M_ARM && _M_ARM >= 8 )
+        result.features_.insert(Feature::Arm_Neon);      // ARMv8 always has Neon
+        result.features_.insert(Feature::Arm_NeonAsimd); // ARMv8 always has Neon-asimd
+#endif
 
-    // On Linux we might be able to find information in /proc/cpuinfo. If vendor or brand
-    // is set to a known value this routine will not overwrite it.
-    detectProcCpuInfo(&result.vendor_, &result.brandString_, &result.family_,
-                      &result.model_, &result.stepping_, &result.features_);
+#if defined sun
+        result.vendor_ = CpuInfo::Vendor::Oracle;
+#endif
 
-#endif  // x86 or not
+        // On Linux we might be able to find information in /proc/cpuinfo. If vendor or brand
+        // is set to a known value this routine will not overwrite it.
+        detectProcCpuInfo(&result.vendor_, &result.brandString_, &result.family_,
+                          &result.model_, &result.stepping_, &result.features_);
+    }
 
     if (!result.logicalProcessors_.empty())
     {
@@ -950,6 +962,7 @@ const std::map<CpuInfo::Feature, std::string>
 CpuInfo::s_featureStrings_ =
 {
     { 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"                          },
@@ -968,6 +981,7 @@ CpuInfo::s_featureStrings_ =
     { 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"                            },
@@ -1057,11 +1071,15 @@ main(int argc, char **argv)
     }
     else if (arg == "-features")
     {
+        // Separate the feature strings with spaces. Note that in the
+        // GROMACS cmake code, surrounding whitespace is first
+        // stripped by the CPU detection routine, and then added back
+        // in the code for making the SIMD suggestion.
         for (auto &f : cpuInfo.featureSet() )
         {
-            printf(" %s", cpuInfo.featureString(f).c_str());
+            printf("%s ", cpuInfo.featureString(f).c_str());
         }
-        printf(" \n"); // extra space so we can grep output for " <feature> " in CMake
+        printf("\n");
     }
     else if (arg == "-topology")
     {
index bd2be6bc24d786b2de89cb1687cbc575cf9ce65b..33c7875850875e14a20930f9fa1b9660c79d80b6 100644 (file)
@@ -98,6 +98,7 @@ class CpuInfo
         enum class Feature
         {
             X86_Aes,         //!< x86 advanced encryption standard accel.
+            X86_Amd,         //!< This is an AMD x86 processor
             X86_Apic,        //!< APIC support
             X86_Avx,         //!< Advanced vector extensions
             X86_Avx2,        //!< AVX2 including gather support (not used yet)
@@ -116,6 +117,7 @@ class CpuInfo
             X86_Fma4,        //!< 4-operand FMA, only on AMD for now
             X86_Hle,         //!< Hardware lock elision
             X86_Htt,         //!< Hyper-Threading supported (but maybe not enabled)
+            X86_Intel,       //!< This is an Intel x86 processor
             X86_Lahf,        //!< LAHF/SAHF support in 64 bits
             X86_MisalignSse, //!< Support for misaligned SSE data instructions
             X86_Mmx,         //!< MMX registers and instructions
index 5dccfa37d4865738f4306f6dbc7bc467c9f47067..177ef1087757a95d4f4e976da1c49e85793dae40 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,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.
 
 #include "thread_mpi/threads.h"
 
-#include "gromacs/gmxlib/md_logging.h"
-#include "gromacs/gmxlib/network.h"
 #include "gromacs/gpu_utils/gpu_utils.h"
 #include "gromacs/hardware/cpuinfo.h"
-#include "gromacs/hardware/gpu_hw_info.h"
 #include "gromacs/hardware/hardwaretopology.h"
 #include "gromacs/hardware/hw_info.h"
 #include "gromacs/mdtypes/commrec.h"
-#include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/simd/support.h"
-#include "gromacs/utility/arrayref.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/basenetwork.h"
 #include "gromacs/utility/baseversion.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/logger.h"
 #include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/stringutil.h"
 #include "gromacs/utility/sysinfo.h"
 
+#include "architecture.h"
+
 #ifdef HAVE_UNISTD_H
 #    include <unistd.h>       // sysconf()
 #endif
 
+namespace gmx
+{
+
 //! Convenience macro to help us avoid ifdefs each time we use sysconf
 #if !defined(_SC_NPROCESSORS_ONLN) && defined(_SC_NPROC_ONLN)
 #    define _SC_NPROCESSORS_ONLN _SC_NPROC_ONLN
 #    define _SC_NPROCESSORS_CONF _SC_NPROC_CONF
 #endif
 
-#if defined (__i386__) || defined (__x86_64__) || defined (_M_IX86) || defined (_M_X64)
-//! Constant used to help minimize preprocessed code
-static const bool isX86 = true;
-#else
-//! Constant used to help minimize preprocessed code
-static const bool isX86 = false;
-#endif
-
-#if defined __powerpc__ || defined __ppc__ || defined __PPC__
-static const bool isPowerPC = true;
-#else
-static const bool isPowerPC = false;
-#endif
-
 //! Constant used to help minimize preprocessed code
 static const bool bGPUBinary     = GMX_GPU != GMX_GPU_NONE;
 
-/* Note that some of the following arrays must match the "GPU support
- * enumeration" in src/config.h.cmakein, so that GMX_GPU looks up an
- * array entry. */
-
-/* Both CUDA and OpenCL (on the supported/tested platforms) supports
- * GPU device sharing.
- */
-static const bool gpuSharingSupport[] = { false, true, true };
-static const bool bGpuSharingSupported = gpuSharingSupport[GMX_GPU];
-
-/* Both CUDA and OpenCL (on the tested/supported platforms) supports everything.
- */
-static const bool multiGpuSupport[] = {
-    false, true, true
-};
-static const bool bMultiGpuPerNodeSupported = multiGpuSupport[GMX_GPU];
-
-/* Names of the GPU detection/check results (see e_gpu_detect_res_t in hw_info.h). */
-const char * const gpu_detect_res_str[egpuNR] =
-{
-    "compatible", "inexistent", "incompatible", "insane"
-};
-
-static const char * invalid_gpuid_hint =
-    "A delimiter-free sequence of valid numeric IDs of available GPUs is expected.";
-
-/* The globally shared hwinfo structure. */
+//! The globally shared hwinfo structure
 static gmx_hw_info_t      *hwinfo_g;
-/* A reference counter for the hwinfo structure */
+//! A reference counter for the hwinfo structure
 static int                 n_hwinfo = 0;
-/* A lock to protect the hwinfo structure */
+//! A lock to protect the hwinfo structure
 static tMPI_Thread_mutex_t hw_info_lock = TMPI_THREAD_MUTEX_INITIALIZER;
 
-#define HOSTNAMELEN 80
-
-/* FW decl. */
-static void set_gpu_ids(gmx_gpu_opt_t *gpu_opt, int nrank, int rank);
-static int gmx_count_gpu_dev_unique(const gmx_gpu_info_t *gpu_info,
-                                    const gmx_gpu_opt_t  *gpu_opt);
-
-gmx_bool gmx_multiple_gpu_per_node_supported()
-{
-    return bMultiGpuPerNodeSupported;
-}
-
-gmx_bool gmx_gpu_sharing_supported()
+//! Detect GPUs, if that makes sense to attempt.
+static void gmx_detect_gpus(const gmx::MDLogger &mdlog, const t_commrec *cr)
 {
-    return bGpuSharingSupported;
-}
-
-static void sprint_gpus(char *sbuf, const gmx_gpu_info_t *gpu_info)
-{
-    int      i, ndev;
-    char     stmp[STRLEN];
-
-    ndev = gpu_info->n_dev;
-
-    sbuf[0] = '\0';
-    for (i = 0; i < ndev; i++)
-    {
-        get_gpu_device_info_string(stmp, gpu_info, i);
-        strcat(sbuf, "    ");
-        strcat(sbuf, stmp);
-        if (i < ndev - 1)
-        {
-            strcat(sbuf, "\n");
-        }
-    }
-}
-
-static void print_gpu_detection_stats(FILE                 *fplog,
-                                      const gmx_gpu_info_t *gpu_info,
-                                      const t_commrec      *cr)
-{
-    char onhost[HOSTNAMELEN+10], stmp[STRLEN];
-    int  ngpu;
-
-    if (!gpu_info->bDetectGPUs)
-    {
-        /* We skipped the detection, so don't print detection stats */
-        return;
-    }
-
-    ngpu = gpu_info->n_dev;
-
 #if GMX_LIB_MPI
-    /* We only print the detection on one, of possibly multiple, nodes */
-    std::strncpy(onhost, " on host ", 10);
-    gmx_gethostname(onhost + 9, HOSTNAMELEN);
-#else
-    /* We detect all relevant GPUs */
-    std::strncpy(onhost, "", 1);
-#endif
-
-    if (ngpu > 0)
-    {
-        sprint_gpus(stmp, gpu_info);
-        md_print_warn(cr, fplog, "%d GPU%s detected%s:\n%s\n",
-                      ngpu, (ngpu > 1) ? "s" : "", onhost, stmp);
-    }
-    else
-    {
-        md_print_warn(cr, fplog, "No GPUs detected%s\n", onhost);
-    }
-}
-
-/*! \brief Helper function for reporting GPU usage information
- * in the mdrun log file
- *
- * \param[in] gpu_info       Pointer to per-node GPU info struct
- * \param[in] gpu_opt        Pointer to per-node GPU options struct
- * \param[in] numPpRanks     Number of PP ranks per node
- * \param[in] bPrintHostName Print the hostname in the usage information
- * \return                   String to write to the log file
- * \throws                   std::bad_alloc if out of memory */
-static std::string
-makeGpuUsageReport(const gmx_gpu_info_t *gpu_info,
-                   const gmx_gpu_opt_t  *gpu_opt,
-                   size_t                numPpRanks,
-                   bool                  bPrintHostName)
-{
-    int  ngpu_use  = gpu_opt->n_dev_use;
-    int  ngpu_comp = gpu_info->n_dev_compatible;
-    char host[HOSTNAMELEN];
-
-    if (bPrintHostName)
-    {
-        gmx_gethostname(host, HOSTNAMELEN);
-    }
-
-    /* Issue a note if GPUs are available but not used */
-    if (ngpu_comp > 0 && ngpu_use < 1)
-    {
-        return gmx::formatString("%d compatible GPU%s detected in the system, but none will be used.\n"
-                                 "Consider trying GPU acceleration with the Verlet scheme!\n",
-                                 ngpu_comp, (ngpu_comp > 1) ? "s" : "");
-    }
-
-    std::string output;
-    if (!gpu_opt->bUserSet)
-    {
-        // gpu_opt->dev_compatible is only populated during auto-selection
-        std::string gpuIdsString =
-            formatAndJoin(gmx::constArrayRefFromArray(gpu_opt->dev_compatible,
-                                                      gpu_opt->n_dev_compatible),
-                          ",", gmx::StringFormatter("%d"));
-        bool bPluralGpus = gpu_opt->n_dev_compatible > 1;
-
-        if (bPrintHostName)
-        {
-            output += gmx::formatString("On host %s ", host);
-        }
-        output += gmx::formatString("%d compatible GPU%s %s present, with ID%s %s\n",
-                                    gpu_opt->n_dev_compatible,
-                                    bPluralGpus ? "s" : "",
-                                    bPluralGpus ? "are" : "is",
-                                    bPluralGpus ? "s" : "",
-                                    gpuIdsString.c_str());
-    }
-
-    {
-        std::vector<int> gpuIdsInUse;
-        for (int i = 0; i < ngpu_use; i++)
-        {
-            gpuIdsInUse.push_back(get_gpu_device_id(gpu_info, gpu_opt, i));
-        }
-        std::string gpuIdsString =
-            formatAndJoin(gpuIdsInUse, ",", gmx::StringFormatter("%d"));
-        int         numGpusInUse = gmx_count_gpu_dev_unique(gpu_info, gpu_opt);
-        bool        bPluralGpus  = numGpusInUse > 1;
-
-        if (bPrintHostName)
-        {
-            output += gmx::formatString("On host %s ", host);
-        }
-        output += gmx::formatString("%d GPU%s %sselected for this run.\n"
-                                    "Mapping of GPU ID%s to the %d PP rank%s in this node: %s\n",
-                                    numGpusInUse, bPluralGpus ? "s" : "",
-                                    gpu_opt->bUserSet ? "user-" : "auto-",
-                                    bPluralGpus ? "s" : "",
-                                    numPpRanks,
-                                    (numPpRanks > 1) ? "s" : "",
-                                    gpuIdsString.c_str());
-    }
-
-    return output;
-}
-
-/* Give a suitable fatal error or warning if the build configuration
-   and runtime CPU do not match. */
-static void
-check_use_of_rdtscp_on_this_cpu(FILE                  *fplog,
-                                const t_commrec       *cr,
-                                const gmx::CpuInfo    &cpuInfo)
-{
-#ifdef HAVE_RDTSCP
-    bool binaryUsesRdtscp = TRUE;
-#else
-    bool binaryUsesRdtscp = FALSE;
+    int              rank_world;
+    MPI_Comm         physicalnode_comm;
 #endif
+    int              rank_local;
 
-    const char *programName = gmx::getProgramContext().displayName();
-
-    if (cpuInfo.supportLevel() < gmx::CpuInfo::SupportLevel::Features)
-    {
-        if (binaryUsesRdtscp)
-        {
-            md_print_warn(cr, fplog, "The %s executable was compiled to use the rdtscp CPU instruction. "
-                          "We cannot detect the features of your current CPU, but will proceed anyway. "
-                          "If you get a crash, rebuild GROMACS with the GMX_USE_RDTSCP=OFF CMake option.",
-                          programName);
-        }
-    }
-    else
-    {
-        bool cpuHasRdtscp = cpuInfo.feature(gmx::CpuInfo::Feature::X86_Rdtscp);
-
-        if (!cpuHasRdtscp && binaryUsesRdtscp)
-        {
-            gmx_fatal(FARGS, "The %s executable was compiled to use the rdtscp CPU instruction. "
-                      "However, this is not supported by the current hardware and continuing would lead to a crash. "
-                      "Please rebuild GROMACS with the GMX_USE_RDTSCP=OFF CMake option.",
-                      programName);
-        }
-
-        if (cpuHasRdtscp && !binaryUsesRdtscp)
-        {
-            md_print_warn(cr, fplog, "The current CPU can measure timings more accurately than the code in\n"
-                          "%s was configured to use. This might affect your simulation\n"
-                          "speed as accurate timings are needed for load-balancing.\n"
-                          "Please consider rebuilding %s with the GMX_USE_RDTSCP=ON CMake option.\n",
-                          programName, programName);
-        }
-    }
-}
-
-void gmx_check_hw_runconf_consistency(FILE                *fplog,
-                                      const gmx_hw_info_t *hwinfo,
-                                      const t_commrec     *cr,
-                                      const gmx_hw_opt_t  *hw_opt,
-                                      gmx_bool             bUseGPU)
-{
-    int      npppn;
-    char     th_or_proc[STRLEN], th_or_proc_plural[STRLEN], pernode[STRLEN];
-    gmx_bool btMPI, bMPI, bNthreadsAuto, bEmulateGPU;
-
-    GMX_RELEASE_ASSERT(hwinfo, "hwinfo must be a non-NULL pointer");
-    GMX_RELEASE_ASSERT(cr, "cr must be a non-NULL pointer");
-
-    /* Below we only do consistency checks for PP and GPUs,
-     * this is irrelevant for PME only nodes, so in that case we return
-     * here.
-     */
-    if (!(cr->duty & DUTY_PP))
+    hwinfo_g->gpu_info.bDetectGPUs =
+        (bGPUBinary && getenv("GMX_DISABLE_GPU_DETECTION") == nullptr);
+    if (!hwinfo_g->gpu_info.bDetectGPUs)
     {
         return;
     }
 
-#if GMX_THREAD_MPI
-    bMPI          = FALSE;
-    btMPI         = TRUE;
-    bNthreadsAuto = (hw_opt->nthreads_tmpi < 1);
-#elif GMX_LIB_MPI
-    bMPI          = TRUE;
-    btMPI         = FALSE;
-    bNthreadsAuto = FALSE;
-#else
-    bMPI          = FALSE;
-    btMPI         = FALSE;
-    bNthreadsAuto = FALSE;
-#endif
-
-    /* GPU emulation detection is done later, but we need here as well
-     * -- uncool, but there's no elegant workaround */
-    bEmulateGPU       = (getenv("GMX_EMULATE_GPU") != NULL);
-
-    if (hwinfo->gpu_info.n_dev_compatible > 0)
-    {
-        std::string gpuUseageReport;
-        try
-        {
-            gpuUseageReport = makeGpuUsageReport(&hwinfo->gpu_info,
-                                                 &hw_opt->gpu_opt,
-                                                 cr->nrank_pp_intranode,
-                                                 bMPI && cr->nnodes > 1);
-        }
-        GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
-
-        /* NOTE: this print is only for and on one physical node */
-        md_print_info(cr, fplog, "%s\n", gpuUseageReport.c_str());
-    }
-
-    /* Need to ensure that we have enough GPUs:
-     * - need one GPU per PP node
-     * - no GPU oversubscription with tMPI
-     * */
-    /* number of PP processes per node */
-    npppn = cr->nrank_pp_intranode;
-
-    pernode[0]           = '\0';
-    th_or_proc_plural[0] = '\0';
-    if (btMPI)
-    {
-        sprintf(th_or_proc, "thread-MPI thread");
-        if (npppn > 1)
-        {
-            sprintf(th_or_proc_plural, "s");
-        }
-    }
-    else if (bMPI)
-    {
-        sprintf(th_or_proc, "MPI process");
-        if (npppn > 1)
-        {
-            sprintf(th_or_proc_plural, "es");
-        }
-        sprintf(pernode, " per node");
-    }
-    else
-    {
-        /* neither MPI nor tMPI */
-        sprintf(th_or_proc, "process");
-    }
-
-    if (bUseGPU && hwinfo->gpu_info.n_dev_compatible > 0 &&
-        !bEmulateGPU)
-    {
-        int  ngpu_comp, ngpu_use;
-        char gpu_comp_plural[2], gpu_use_plural[2];
-
-        ngpu_comp = hwinfo->gpu_info.n_dev_compatible;
-        ngpu_use  = hw_opt->gpu_opt.n_dev_use;
-
-        sprintf(gpu_comp_plural, "%s", (ngpu_comp > 1) ? "s" : "");
-        sprintf(gpu_use_plural,  "%s", (ngpu_use > 1) ? "s" : "");
-
-        const char *programName = gmx::getProgramContext().displayName();
-
-        /* number of tMPI threads auto-adjusted */
-        if (btMPI && bNthreadsAuto)
-        {
-            if (hw_opt->gpu_opt.bUserSet && npppn < ngpu_use)
-            {
-                /* The user manually provided more GPUs than threads we
-                   could automatically start. */
-                gmx_fatal(FARGS,
-                          "%d GPU%s provided, but only %d PP thread-MPI thread%s coud be started.\n"
-                          "%s requires one PP tread-MPI thread per GPU; use fewer GPUs.",
-                          ngpu_use, gpu_use_plural,
-                          npppn, th_or_proc_plural,
-                          programName);
-            }
-
-            if (!hw_opt->gpu_opt.bUserSet && npppn < ngpu_comp)
-            {
-                /* There are more GPUs than tMPI threads; we have
-                   limited the number GPUs used. */
-                md_print_warn(cr, fplog,
-                              "NOTE: %d GPU%s were detected, but only %d PP thread-MPI thread%s can be started.\n"
-                              "      %s can use one GPU per PP tread-MPI thread, so only %d GPU%s will be used.\n",
-                              ngpu_comp, gpu_comp_plural,
-                              npppn, th_or_proc_plural,
-                              programName, npppn,
-                              npppn > 1 ? "s" : "");
-            }
-        }
-
-        if (hw_opt->gpu_opt.bUserSet)
-        {
-            if (ngpu_use != npppn)
-            {
-                gmx_fatal(FARGS,
-                          "Incorrect launch configuration: mismatching number of PP %s%s and GPUs%s.\n"
-                          "%s was started with %d PP %s%s%s, but you provided %d GPU%s.",
-                          th_or_proc, btMPI ? "s" : "es", pernode,
-                          programName, npppn, th_or_proc,
-                          th_or_proc_plural, pernode,
-                          ngpu_use, gpu_use_plural);
-            }
-        }
-        else
-        {
-            /* TODO Should we have a gpu_opt->n_dev_supported field? */
-            if (ngpu_comp > npppn && gmx_multiple_gpu_per_node_supported())
-            {
-                md_print_warn(cr, fplog,
-                              "NOTE: potentially sub-optimal launch configuration, %s started with less\n"
-                              "      PP %s%s%s than GPU%s available.\n"
-                              "      Each PP %s can use only one GPU, %d GPU%s%s will be used.\n",
-                              programName, th_or_proc,
-                              th_or_proc_plural, pernode, gpu_comp_plural,
-                              th_or_proc, npppn, gpu_use_plural, pernode);
-            }
-
-            if (ngpu_use != npppn)
-            {
-                /* Avoid duplicate error messages.
-                 * Unfortunately we can only do this at the physical node
-                 * level, since the hardware setup and MPI process count
-                 * might differ between physical nodes.
-                 */
-                if (cr->rank_pp_intranode == 0)
-                {
-                    std::string reasonForLimit;
-                    if (ngpu_comp > 1 &&
-                        ngpu_use == 1 &&
-                        !gmx_multiple_gpu_per_node_supported())
-                    {
-                        reasonForLimit  = "can be used by ";
-                        reasonForLimit += getGpuImplementationString();
-                        reasonForLimit += " in GROMACS";
-                    }
-                    else
-                    {
-                        reasonForLimit = "was detected";
-                    }
-                    gmx_fatal(FARGS,
-                              "Incorrect launch configuration: mismatching number of PP %s%s and GPUs%s.\n"
-                              "%s was started with %d PP %s%s%s, but only %d GPU%s %s.",
-                              th_or_proc, btMPI ? "s" : "es", pernode,
-                              programName, npppn, th_or_proc,
-                              th_or_proc_plural, pernode,
-                              ngpu_use, gpu_use_plural, reasonForLimit.c_str());
-                }
-            }
-        }
-
-        {
-            int      same_count;
-
-            same_count = gmx_count_gpu_dev_shared(&hw_opt->gpu_opt);
-
-            if (same_count > 0)
-            {
-                md_print_info(cr, fplog,
-                              "NOTE: You assigned %s to multiple %s%s.\n",
-                              same_count > 1 ? "GPUs" : "a GPU", th_or_proc, btMPI ? "s" : "es");
-            }
-        }
-    }
-
-#if GMX_MPI
-    if (PAR(cr))
-    {
-        /* Avoid other ranks to continue after
-           inconsistency */
-        MPI_Barrier(cr->mpi_comm_mygroup);
-    }
-#endif
-
-}
-
-/* Return 0 if none of the GPU (per node) are shared among PP ranks.
- *
- * Sharing GPUs among multiple PP ranks is possible when the user passes
- * GPU IDs. Here we check for sharing and return a non-zero value when
- * this is detected. Note that the return value represents the number of
- * PP rank pairs that share a device.
- */
-int gmx_count_gpu_dev_shared(const gmx_gpu_opt_t *gpu_opt)
-{
-    int      same_count    = 0;
-    int      ngpu          = gpu_opt->n_dev_use;
-
-    if (gpu_opt->bUserSet)
-    {
-        int      i, j;
-
-        for (i = 0; i < ngpu - 1; i++)
-        {
-            for (j = i + 1; j < ngpu; j++)
-            {
-                same_count      += (gpu_opt->dev_use[i] ==
-                                    gpu_opt->dev_use[j]);
-            }
-        }
-    }
-
-    return same_count;
-}
-
-/* Count and return the number of unique GPUs (per node) selected.
- *
- * As sharing GPUs among multiple PP ranks is possible when the user passes
- * GPU IDs, the number of GPUs user (per node) can be different from the
- * number of GPU IDs selected.
- */
-static int gmx_count_gpu_dev_unique(const gmx_gpu_info_t *gpu_info,
-                                    const gmx_gpu_opt_t  *gpu_opt)
-{
-    int  i, uniq_count, ngpu;
-    int *uniq_ids;
-
-    GMX_RELEASE_ASSERT(gpu_info, "gpu_info must be a non-NULL pointer");
-    GMX_RELEASE_ASSERT(gpu_opt, "gpu_opt must be a non-NULL pointer");
-
-    ngpu = gpu_info->n_dev;
-
-    uniq_count  = 0;
-
-    snew(uniq_ids, ngpu);
-
-    /* Each element in uniq_ids will be set to 0 or 1. The n-th element set
-     * to 1 indicates that the respective GPU was selected to be used. */
-    for (i = 0; i < gpu_opt->n_dev_use; i++)
-    {
-        int device_id;
-
-        device_id           = gmx_gpu_sharing_supported() ? get_gpu_device_id(gpu_info, gpu_opt, i) : i;
-        uniq_ids[device_id] = 1;
-    }
-    /* Count the devices used. */
-    for (i = 0; i < ngpu; i++)
-    {
-        uniq_count += uniq_ids[i];
-    }
-
-    sfree(uniq_ids);
-
-    return uniq_count;
-}
-
-static void gmx_detect_gpus(FILE *fplog, const t_commrec *cr)
-{
-#if GMX_LIB_MPI
-    int              rank_world;
-    MPI_Comm         physicalnode_comm;
-#endif
-    int              rank_local;
-
     /* Under certain circumstances MPI ranks on the same physical node
      * can not simultaneously access the same GPU(s). Therefore we run
      * the detection only on one MPI rank per node and broadcast the info.
@@ -654,6 +134,7 @@ static void gmx_detect_gpus(FILE *fplog, const t_commrec *cr)
     MPI_Comm_split(MPI_COMM_WORLD, gmx_physicalnode_id_hash(),
                    rank_world, &physicalnode_comm);
     MPI_Comm_rank(physicalnode_comm, &rank_local);
+    GMX_UNUSED_VALUE(cr);
 #else
     /* Here there should be only one process, check this */
     GMX_RELEASE_ASSERT(cr->nnodes == 1 && cr->sim_nodeid == 0, "Only a single (master) process should execute here");
@@ -679,10 +160,10 @@ static void gmx_detect_gpus(FILE *fplog, const t_commrec *cr)
             {
                 sprintf(sbuf, ".");
             }
-            md_print_warn(cr, fplog,
-                          "NOTE: Error occurred during GPU detection%s"
-                          "      Can not use GPU acceleration, will fall back to CPU kernels.\n",
-                          sbuf);
+            GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
+                    "NOTE: Error occurred during GPU detection%s"
+                    "      Can not use GPU acceleration, will fall back to CPU kernels.",
+                    sbuf);
         }
     }
 
@@ -714,6 +195,7 @@ static void gmx_detect_gpus(FILE *fplog, const t_commrec *cr)
 #endif
 }
 
+//! Reduce the locally collected \p hwinfo_g over MPI ranks
 static void gmx_collect_hardware_mpi(const gmx::CpuInfo &cpuInfo)
 {
     const int ncore = hwinfo_g->hardwareTopology->numberOfCores();
@@ -742,7 +224,7 @@ static void gmx_collect_hardware_mpi(const gmx::CpuInfo &cpuInfo)
          * the GPUs affects the hash. Also two identical GPUs won't give
          * a gpu_hash of zero after XORing.
          */
-        get_gpu_device_info_string(stmp, &hwinfo_g->gpu_info, i);
+        get_gpu_device_info_string(stmp, hwinfo_g->gpu_info, i);
         gpu_hash ^= gmx_string_fullhash_func(stmp, gmx_string_hash_init);
     }
 
@@ -857,14 +339,12 @@ static void
 spinUpCore() noexcept
 {
 #if defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_CONF) && defined(_SC_NPROCESSORS_ONLN)
-    // steady_clock is better than system_clock, but unsupported in gcc-4.6.4.
-    // For release-2017 we can retire gcc-4.6 support and move to steady_clock.
     float dummy           = 0.1;
     int   countConfigured = sysconf(_SC_NPROCESSORS_CONF);    // noexcept
-    auto  start           = std::chrono::system_clock::now(); // noexcept
+    auto  start           = std::chrono::steady_clock::now(); // noexcept
 
     while (sysconf(_SC_NPROCESSORS_ONLN) < countConfigured &&
-           std::chrono::system_clock::now() - start < std::chrono::seconds(2))
+           std::chrono::steady_clock::now() - start < std::chrono::seconds(2))
     {
         for (int i = 1; i < 10000; i++)
         {
@@ -906,7 +386,8 @@ hardwareTopologyPrepareDetection()
     (defined(THREAD_PTHREADS) || defined(THREAD_WINDOWS))
 
     // Modify this conditional when/if x86 or PowerPC starts to sleep some cores
-    if (!isX86 && !isPowerPC)
+    if (c_architecture != Architecture::X86 &&
+        c_architecture != Architecture::PowerPC)
     {
         int                      countConfigured  = sysconf(_SC_NPROCESSORS_CONF);
         std::vector<std::thread> workThreads(countConfigured);
@@ -924,19 +405,17 @@ hardwareTopologyPrepareDetection()
 #endif
 }
 
-/*! \brief Sanity check hardware topology and optionally print some notes to log
+/*! \brief Sanity check hardware topology and print some notes to log
  *
- *  \param fplog            Log file pointer. This can be NULL, but the then routine
- *                          will not do anything.
+ *  \param mdlog            Logger.
  *  \param hardwareTopology Reference to hardwareTopology object.
  */
 static void
-hardwareTopologyDoubleCheckDetection(FILE gmx_unused                          *fplog,
-                                     const gmx::HardwareTopology gmx_unused   &hardwareTopology)
+hardwareTopologyDoubleCheckDetection(const gmx::MDLogger gmx_unused         &mdlog,
+                                     const gmx::HardwareTopology gmx_unused &hardwareTopology)
 {
 #if defined HAVE_SYSCONF && defined(_SC_NPROCESSORS_CONF)
-    if (fplog == NULL ||
-        hardwareTopology.supportLevel() < gmx::HardwareTopology::SupportLevel::LogicalProcessorCount)
+    if (hardwareTopology.supportLevel() < gmx::HardwareTopology::SupportLevel::LogicalProcessorCount)
     {
         return;
     }
@@ -951,25 +430,29 @@ hardwareTopologyDoubleCheckDetection(FILE gmx_unused                          *f
      */
     if (countConfigured >= 0 && countConfigured != countFromDetection)
     {
-        fprintf(fplog, "Note: %d CPUs configured, but only %d were detected to be online.\n", countConfigured, countFromDetection);
+        GMX_LOG(mdlog.info).
+            appendTextFormatted("Note: %d CPUs configured, but only %d were detected to be online.\n", countConfigured, countFromDetection);
 
-        if (isX86 && countConfigured == 2*countFromDetection)
+        if (c_architecture == Architecture::X86 &&
+            countConfigured == 2*countFromDetection)
         {
-            fprintf(fplog, "      X86 Hyperthreading is likely disabled; enable it for better performance.\n");
+            GMX_LOG(mdlog.info).
+                appendText("      X86 Hyperthreading is likely disabled; enable it for better performance.");
         }
         // For PowerPC (likely Power8) it is possible to set SMT to either 2,4, or 8-way hardware threads.
         // We only warn if it is completely disabled since default performance drops with SMT8.
-        if (isPowerPC && countConfigured == 8*countFromDetection)
+        if (c_architecture == Architecture::PowerPC &&
+            countConfigured == 8*countFromDetection)
         {
-            fprintf(fplog, "      PowerPC SMT is likely disabled; enable SMT2/SMT4 for better performance.\n");
+            GMX_LOG(mdlog.info).
+                appendText("      PowerPC SMT is likely disabled; enable SMT2/SMT4 for better performance.");
         }
     }
 #endif
 }
 
 
-gmx_hw_info_t *gmx_detect_hardware(FILE *fplog, const t_commrec *cr,
-                                   gmx_bool bDetectGPUs)
+gmx_hw_info_t *gmx_detect_hardware(const gmx::MDLogger &mdlog, const t_commrec *cr)
 {
     int ret;
 
@@ -993,7 +476,7 @@ gmx_hw_info_t *gmx_detect_hardware(FILE *fplog, const t_commrec *cr,
         // If we detected the topology on this system, double-check that it makes sense
         if (hwinfo_g->hardwareTopology->isThisSystem())
         {
-            hardwareTopologyDoubleCheckDetection(fplog, *(hwinfo_g->hardwareTopology));
+            hardwareTopologyDoubleCheckDetection(mdlog, *(hwinfo_g->hardwareTopology));
         }
 
         // TODO: Get rid of this altogether.
@@ -1002,19 +485,9 @@ gmx_hw_info_t *gmx_detect_hardware(FILE *fplog, const t_commrec *cr,
         /* detect GPUs */
         hwinfo_g->gpu_info.n_dev            = 0;
         hwinfo_g->gpu_info.n_dev_compatible = 0;
-        hwinfo_g->gpu_info.gpu_dev          = NULL;
-
-        /* Run the detection if the binary was compiled with GPU support
-         * and we requested detection.
-         */
-        hwinfo_g->gpu_info.bDetectGPUs =
-            (bGPUBinary && bDetectGPUs &&
-             getenv("GMX_DISABLE_GPU_DETECTION") == NULL);
-        if (hwinfo_g->gpu_info.bDetectGPUs)
-        {
-            gmx_detect_gpus(fplog, cr);
-        }
+        hwinfo_g->gpu_info.gpu_dev          = nullptr;
 
+        gmx_detect_gpus(mdlog, cr);
         gmx_collect_hardware_mpi(*hwinfo_g->cpuInfo);
     }
     /* increase the reference counter */
@@ -1029,464 +502,9 @@ gmx_hw_info_t *gmx_detect_hardware(FILE *fplog, const t_commrec *cr,
     return hwinfo_g;
 }
 
-static std::string detected_hardware_string(const gmx_hw_info_t *hwinfo,
-                                            bool                 bFullCpuInfo)
-{
-    std::string                  s;
-
-    const gmx::CpuInfo          &cpuInfo = *hwinfo_g->cpuInfo;
-    const gmx::HardwareTopology &hwTop   = *hwinfo->hardwareTopology;
-
-    s  = gmx::formatString("\n");
-    s += gmx::formatString("Running on %d node%s with total",
-                           hwinfo->nphysicalnode,
-                           hwinfo->nphysicalnode == 1 ? "" : "s");
-    if (hwinfo->ncore_tot > 0)
-    {
-        s += gmx::formatString(" %d cores,", hwinfo->ncore_tot);
-    }
-    s += gmx::formatString(" %d logical cores", hwinfo->nhwthread_tot);
-    if (hwinfo->gpu_info.bDetectGPUs)
-    {
-        s += gmx::formatString(", %d compatible GPU%s",
-                               hwinfo->ngpu_compatible_tot,
-                               hwinfo->ngpu_compatible_tot == 1 ? "" : "s");
-    }
-    else if (bGPUBinary)
-    {
-        s += gmx::formatString(" (GPU detection deactivated)");
-    }
-    s += gmx::formatString("\n");
-
-    if (hwinfo->nphysicalnode > 1)
-    {
-        /* Print per node hardware feature counts */
-        if (hwinfo->ncore_max > 0)
-        {
-            s += gmx::formatString("  Cores per node:           %2d", hwinfo->ncore_min);
-            if (hwinfo->ncore_max > hwinfo->ncore_min)
-            {
-                s += gmx::formatString(" - %2d", hwinfo->ncore_max);
-            }
-            s += gmx::formatString("\n");
-        }
-        s += gmx::formatString("  Logical cores per node:   %2d", hwinfo->nhwthread_min);
-        if (hwinfo->nhwthread_max > hwinfo->nhwthread_min)
-        {
-            s += gmx::formatString(" - %2d", hwinfo->nhwthread_max);
-        }
-        s += gmx::formatString("\n");
-        if (bGPUBinary)
-        {
-            s += gmx::formatString("  Compatible GPUs per node: %2d",
-                                   hwinfo->ngpu_compatible_min);
-            if (hwinfo->ngpu_compatible_max > hwinfo->ngpu_compatible_min)
-            {
-                s += gmx::formatString(" - %2d", hwinfo->ngpu_compatible_max);
-            }
-            s += gmx::formatString("\n");
-            if (hwinfo->ngpu_compatible_tot > 0)
-            {
-                if (hwinfo->bIdenticalGPUs)
-                {
-                    s += gmx::formatString("  All nodes have identical type(s) of GPUs\n");
-                }
-                else
-                {
-                    /* This message will also appear with identical GPU types
-                     * when at least one node has no GPU.
-                     */
-                    s += gmx::formatString("  Different nodes have different type(s) and/or order of GPUs\n");
-                }
-            }
-        }
-    }
-
-#if GMX_LIB_MPI
-    char host[HOSTNAMELEN];
-    int  rank;
-
-    gmx_gethostname(host, HOSTNAMELEN);
-    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-
-    s += gmx::formatString("Hardware detected on host %s (the node of MPI rank %d):\n",
-                           host, rank);
-#else
-    s += gmx::formatString("Hardware detected:\n");
-#endif
-    s += gmx::formatString("  CPU info:\n");
-
-    s += gmx::formatString("    Vendor: %s\n", cpuInfo.vendorString().c_str());
-
-    s += gmx::formatString("    Brand:  %s\n", cpuInfo.brandString().c_str());
-
-    if (bFullCpuInfo)
-    {
-        s += gmx::formatString("    Family: %d   Model: %d   Stepping: %d\n",
-                               cpuInfo.family(), cpuInfo.model(), cpuInfo.stepping());
-
-        s += gmx::formatString("    Features:");
-        for (auto &f : cpuInfo.featureSet())
-        {
-            s += gmx::formatString(" %s", cpuInfo.featureString(f).c_str());;
-        }
-        s += gmx::formatString("\n");
-    }
-
-    s += gmx::formatString("    SIMD instructions most likely to fit this hardware: %s",
-                           gmx::simdString(static_cast<gmx::SimdType>(hwinfo->simd_suggest_min)).c_str());
-
-    if (hwinfo->simd_suggest_max > hwinfo->simd_suggest_min)
-    {
-        s += gmx::formatString(" - %s", gmx::simdString(static_cast<gmx::SimdType>(hwinfo->simd_suggest_max)).c_str());
-    }
-    s += gmx::formatString("\n");
-
-    s += gmx::formatString("    SIMD instructions selected at GROMACS compile time: %s\n",
-                           gmx::simdString(gmx::simdCompiled()).c_str());
-
-    s += gmx::formatString("\n");
-
-    s += gmx::formatString("  Hardware topology: ");
-    switch (hwTop.supportLevel())
-    {
-        case gmx::HardwareTopology::SupportLevel::None:
-            s += gmx::formatString("None\n");
-            break;
-        case gmx::HardwareTopology::SupportLevel::LogicalProcessorCount:
-            s += gmx::formatString("Only logical processor count\n");
-            break;
-        case gmx::HardwareTopology::SupportLevel::Basic:
-            s += gmx::formatString("Basic\n");
-            break;
-        case gmx::HardwareTopology::SupportLevel::Full:
-            s += gmx::formatString("Full\n");
-            break;
-        case gmx::HardwareTopology::SupportLevel::FullWithDevices:
-            s += gmx::formatString("Full, with devices\n");
-            break;
-    }
-
-    if (!hwTop.isThisSystem())
-    {
-        s += gmx::formatString("  NOTE: Hardware topology cached or synthetic, not detected.\n");
-        if (char *p = getenv("HWLOC_XMLFILE"))
-        {
-            s += gmx::formatString("        HWLOC_XMLFILE=%s\n", p);
-        }
-    }
-
-    if (bFullCpuInfo)
-    {
-        if (hwTop.supportLevel() >= gmx::HardwareTopology::SupportLevel::Basic)
-        {
-            s += gmx::formatString("    Sockets, cores, and logical processors:\n");
-
-            for (auto &socket : hwTop.machine().sockets)
-            {
-                s += gmx::formatString("      Socket %2d:", socket.id);
-                for (auto &c : socket.cores)
-                {
-                    s += gmx::formatString(" [");
-                    for (auto &t : c.hwThreads)
-                    {
-                        s += gmx::formatString(" %3d", t.logicalProcessorId);
-                    }
-                    s += gmx::formatString("]");
-                }
-                s += gmx::formatString("\n");
-            }
-        }
-        if (hwTop.supportLevel() >= gmx::HardwareTopology::SupportLevel::Full)
-        {
-            s += gmx::formatString("    Numa nodes:\n");
-            for (auto &n : hwTop.machine().numa.nodes)
-            {
-                s += gmx::formatString("      Node %2d (%" GMX_PRIu64 " bytes mem):", n.id, n.memory);
-                for (auto &l : n.logicalProcessorId)
-                {
-                    s += gmx::formatString(" %3d", l);
-                }
-                s += gmx::formatString("\n");
-            }
-            s += gmx::formatString("      Latency:\n          ");
-            for (std::size_t j = 0; j < hwTop.machine().numa.nodes.size(); j++)
-            {
-                s += gmx::formatString(" %5d", j);
-            }
-            s += gmx::formatString("\n");
-            for (std::size_t i = 0; i < hwTop.machine().numa.nodes.size(); i++)
-            {
-                s += gmx::formatString("     %5d", i);
-                for (std::size_t j = 0; j < hwTop.machine().numa.nodes.size(); j++)
-                {
-                    s += gmx::formatString(" %5.2f", hwTop.machine().numa.relativeLatency[i][j]);
-                }
-                s += gmx::formatString("\n");
-            }
-
-
-            s += gmx::formatString("    Caches:\n");
-            for (auto &c : hwTop.machine().caches)
-            {
-                s += gmx::formatString("      L%d: %" GMX_PRIu64 " bytes, linesize %d bytes, assoc. %d, shared %d ways\n",
-                                       c.level, c.size, c.linesize, c.associativity, c.shared);
-            }
-        }
-        if (hwTop.supportLevel() >= gmx::HardwareTopology::SupportLevel::FullWithDevices)
-        {
-            s += gmx::formatString("    PCI devices:\n");
-            for (auto &d : hwTop.machine().devices)
-            {
-                s += gmx::formatString("      %04x:%02x:%02x.%1x  Id: %04x:%04x  Class: 0x%04x  Numa: %d\n",
-                                       d.domain, d.bus, d.dev, d.func, d.vendorId, d.deviceId, d.classId, d.numaNodeId);
-            }
-        }
-    }
-
-    if (bGPUBinary && (hwinfo->ngpu_compatible_tot > 0 ||
-                       hwinfo->gpu_info.n_dev > 0))
-    {
-        s += gmx::formatString("  GPU info:\n");
-        s += gmx::formatString("    Number of GPUs detected: %d\n",
-                               hwinfo->gpu_info.n_dev);
-        if (hwinfo->gpu_info.n_dev > 0)
-        {
-            char buf[STRLEN];
-
-            sprint_gpus(buf, &hwinfo->gpu_info);
-            s += gmx::formatString("%s\n", buf);
-        }
-    }
-    return s;
-}
-
-void gmx_print_detected_hardware(FILE *fplog, const t_commrec *cr,
-                                 const gmx_hw_info_t *hwinfo)
-{
-    const gmx::CpuInfo &cpuInfo = *hwinfo_g->cpuInfo;
-
-    if (fplog != NULL)
-    {
-        std::string detected;
-
-        detected = detected_hardware_string(hwinfo, TRUE);
-
-        fprintf(fplog, "%s\n", detected.c_str());
-    }
-
-    if (MULTIMASTER(cr))
-    {
-        std::string detected;
-
-        detected = detected_hardware_string(hwinfo, FALSE);
-
-        fprintf(stderr, "%s\n", detected.c_str());
-    }
-
-    /* Check the compiled SIMD instruction set against that of the node
-     * with the lowest SIMD level support (skip if SIMD detection did not work)
-     */
-    if (cpuInfo.supportLevel() >= gmx::CpuInfo::SupportLevel::Features)
-    {
-        gmx::simdCheck(static_cast<gmx::SimdType>(hwinfo->simd_suggest_min), fplog, MULTIMASTER(cr));
-    }
-
-    /* For RDTSCP we only check on our local node and skip the MPI reduction */
-    check_use_of_rdtscp_on_this_cpu(fplog, cr, cpuInfo);
-}
-
-//! \brief Return if any GPU ID (e.g in a user-supplied string) is repeated
-static gmx_bool anyGpuIdIsRepeated(const gmx_gpu_opt_t *gpu_opt)
+bool compatibleGpusFound(const gmx_gpu_info_t &gpu_info)
 {
-    /* Loop over IDs in the string */
-    for (int i = 0; i < gpu_opt->n_dev_use - 1; ++i)
-    {
-        /* Look for the ID in location i in the following part of the
-           string */
-        for (int j = i + 1; j < gpu_opt->n_dev_use; ++j)
-        {
-            if (gpu_opt->dev_use[i] == gpu_opt->dev_use[j])
-            {
-                /* Same ID found in locations i and j */
-                return TRUE;
-            }
-        }
-    }
-
-    return FALSE;
-}
-
-void gmx_parse_gpu_ids(gmx_gpu_opt_t *gpu_opt)
-{
-    char *env;
-
-    if (gpu_opt->gpu_id != NULL && !bGPUBinary)
-    {
-        gmx_fatal(FARGS, "GPU ID string set, but %s was compiled without GPU support!",
-                  gmx::getProgramContext().displayName());
-    }
-
-    env = getenv("GMX_GPU_ID");
-    if (env != NULL && gpu_opt->gpu_id != NULL)
-    {
-        gmx_fatal(FARGS, "GMX_GPU_ID and -gpu_id can not be used at the same time");
-    }
-    if (env == NULL)
-    {
-        env = gpu_opt->gpu_id;
-    }
-
-    /* parse GPU IDs if the user passed any */
-    if (env != NULL)
-    {
-        /* Parse a "plain" or comma-separated GPU ID string which contains a
-         * sequence of digits corresponding to GPU IDs; the order will
-         * indicate the process/tMPI thread - GPU assignment. */
-        parse_digits_from_string(env, &gpu_opt->n_dev_use, &gpu_opt->dev_use);
-
-        if (!gmx_multiple_gpu_per_node_supported() && 1 < gpu_opt->n_dev_use)
-        {
-            gmx_fatal(FARGS, "The %s implementation only supports using exactly one PP rank per node", getGpuImplementationString());
-        }
-        if (!gmx_gpu_sharing_supported() && anyGpuIdIsRepeated(gpu_opt))
-        {
-            gmx_fatal(FARGS, "The %s implementation only supports using exactly one PP rank per GPU", getGpuImplementationString());
-        }
-        if (gpu_opt->n_dev_use == 0)
-        {
-            gmx_fatal(FARGS, "Empty GPU ID string encountered.\n%s\n",
-                      invalid_gpuid_hint);
-        }
-
-        gpu_opt->bUserSet = TRUE;
-    }
-}
-
-void gmx_select_gpu_ids(FILE *fplog, const t_commrec *cr,
-                        const gmx_gpu_info_t *gpu_info,
-                        gmx_bool bForceUseGPU,
-                        gmx_gpu_opt_t *gpu_opt)
-{
-    int              i;
-    char             sbuf[STRLEN], stmp[STRLEN];
-
-    /* Bail if binary is not compiled with GPU acceleration, but this is either
-     * explicitly (-nb gpu) or implicitly (gpu ID passed) requested. */
-    if (bForceUseGPU && !bGPUBinary)
-    {
-        gmx_fatal(FARGS, "GPU acceleration requested, but %s was compiled without GPU support!",
-                  gmx::getProgramContext().displayName());
-    }
-
-    if (!(cr->duty & DUTY_PP))
-    {
-        /* Our rank is not doing PP, we don't use a GPU */
-        return;
-    }
-
-    if (gpu_opt->bUserSet)
-    {
-        /* Check the GPU IDs passed by the user.
-         * (GPU IDs have been parsed by gmx_parse_gpu_ids before)
-         */
-        int *checkres;
-        int  res;
-
-        snew(checkres, gpu_opt->n_dev_use);
-
-        res = check_selected_gpus(checkres, gpu_info, gpu_opt);
-
-        if (!res)
-        {
-            print_gpu_detection_stats(fplog, gpu_info, cr);
-
-            sprintf(sbuf, "Some of the requested GPUs do not exist, behave strangely, or are not compatible:\n");
-            for (i = 0; i < gpu_opt->n_dev_use; i++)
-            {
-                if (checkres[i] != egpuCompatible)
-                {
-                    sprintf(stmp, "    GPU #%d: %s\n",
-                            gpu_opt->dev_use[i],
-                            gpu_detect_res_str[checkres[i]]);
-                    strcat(sbuf, stmp);
-                }
-            }
-            gmx_fatal(FARGS, "%s", sbuf);
-        }
-
-        sfree(checkres);
-    }
-    else if (getenv("GMX_EMULATE_GPU") == NULL)
-    {
-        pick_compatible_gpus(&hwinfo_g->gpu_info, gpu_opt);
-        set_gpu_ids(gpu_opt, cr->nrank_pp_intranode, cr->rank_pp_intranode);
-    }
-
-    /* If the user asked for a GPU, check whether we have a GPU */
-    if (bForceUseGPU && gpu_info->n_dev_compatible == 0)
-    {
-        gmx_fatal(FARGS, "GPU acceleration requested, but no compatible GPUs were detected.");
-    }
-}
-
-/* Select the GPUs we will use. This is an operation local to each physical
- * node. If we have less MPI ranks than GPUs, we will waste some GPUs.
- * nrank and rank are the rank count and id for PP processes in our node.
- */
-static void set_gpu_ids(gmx_gpu_opt_t *gpu_opt, int nrank, int rank)
-{
-    GMX_RELEASE_ASSERT(gpu_opt, "Invalid gpu_opt pointer passed");
-    GMX_RELEASE_ASSERT(nrank >= 1,
-                       gmx::formatString("Invalid limit (%d) for the number of GPUs (detected %d compatible GPUs)",
-                                         rank, gpu_opt->n_dev_compatible).c_str());
-
-    if (gpu_opt->n_dev_compatible == 0)
-    {
-        char host[HOSTNAMELEN];
-
-        gmx_gethostname(host, HOSTNAMELEN);
-        gmx_fatal(FARGS, "A GPU was requested on host %s, but no compatible GPUs were detected. All nodes with PP ranks need to have GPUs. If you intended to use GPU acceleration in a parallel run, you can either avoid using the nodes that don't have GPUs or place PME ranks on these nodes.", host);
-    }
-
-    int nshare;
-
-    nshare = 1;
-    if (nrank > gpu_opt->n_dev_compatible)
-    {
-        if (nrank % gpu_opt->n_dev_compatible == 0)
-        {
-            nshare = gmx_gpu_sharing_supported() ? nrank/gpu_opt->n_dev_compatible : 1;
-        }
-        else
-        {
-            if (rank == 0)
-            {
-                gmx_fatal(FARGS, "The number of MPI ranks (%d) in a physical node is not a multiple of the number of GPUs (%d). Select a different number of MPI ranks or use the -gpu_id option to manually specify the GPU to be used.",
-                          nrank, gpu_opt->n_dev_compatible);
-            }
-
-#if GMX_MPI
-            /* We use a global barrier to prevent ranks from continuing with
-             * an invalid setup.
-             */
-            MPI_Barrier(MPI_COMM_WORLD);
-#endif
-        }
-    }
-
-    /* Here we will waste GPUs when nrank < gpu_opt->n_dev_compatible */
-    gpu_opt->n_dev_use = std::min(gpu_opt->n_dev_compatible*nshare, nrank);
-    if (!gmx_multiple_gpu_per_node_supported())
-    {
-        gpu_opt->n_dev_use = std::min(gpu_opt->n_dev_use, 1);
-    }
-    snew(gpu_opt->dev_use, gpu_opt->n_dev_use);
-    for (int i = 0; i != gpu_opt->n_dev_use; ++i)
-    {
-        /* TODO: improve this implementation: either sort GPUs or remove the weakest here */
-        gpu_opt->dev_use[i] = gpu_opt->dev_compatible[i/nshare];
-    }
+    return gpu_info.n_dev_compatible > 0;
 }
 
 void gmx_hardware_info_free(gmx_hw_info_t *hwinfo)
@@ -1527,3 +545,5 @@ void gmx_hardware_info_free(gmx_hw_info_t *hwinfo)
         gmx_fatal(FARGS, "Error unlocking hwinfo mutex: %s", strerror(errno));
     }
 }
+
+}  // namespace gmx
index e002d47d16e3bee26e21863002e9617232e05c13..3990ce78c7ace6dc7db9b476a56eec5de153ca4b 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,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.
 
 #include <cstdio>
 
+#include <string>
+#include <vector>
+
 #include "gromacs/utility/basedefinitions.h"
 
 struct gmx_gpu_info_t;
-struct gmx_gpu_opt_t;
 struct gmx_hw_info_t;
 struct gmx_hw_opt_t;
 struct t_commrec;
 
 namespace gmx
 {
-
-class HardwareTopology;
-
-} // namespace
-
-/*! \brief Return whether mdrun can use more than one GPU per node
- *
- * The OpenCL implementation cannot use more than one GPU per node,
- * for example. */
-gmx_bool gmx_multiple_gpu_per_node_supported();
-
-/*! \brief Return whether PP ranks can share a GPU
- *
- * The OpenCL implementation cannot share a GPU between ranks, for
- * example. */
-gmx_bool gmx_gpu_sharing_supported();
+class MDLogger;
 
 /*! \brief Run detection, consistency checks, and make available on all ranks.
  *
@@ -72,38 +59,15 @@ gmx_bool gmx_gpu_sharing_supported();
  * available on all nodes.
  * Caller is responsible for freeing this pointer.
  */
-gmx_hw_info_t *gmx_detect_hardware(FILE *fplog, const t_commrec *cr,
-                                   gmx_bool bDetectGPUs);
-
-/* Print information about the detected hardware to fplog (if != NULL)
- * and to stderr the master rank.
- */
-void gmx_print_detected_hardware(FILE *fplog, const t_commrec *cr,
-                                 const gmx_hw_info_t *hwinfo);
+gmx_hw_info_t *gmx_detect_hardware(const gmx::MDLogger &mdlog,
+                                   const t_commrec     *cr);
 
+/*! \brief Free the hwinfo structure */
 void gmx_hardware_info_free(gmx_hw_info_t *hwinfo);
 
-void gmx_parse_gpu_ids(gmx_gpu_opt_t *gpu_opt);
-
-void gmx_select_gpu_ids(FILE *fplog, const t_commrec *cr,
-                        const gmx_gpu_info_t *gpu_info,
-                        gmx_bool bForceUseGPU,
-                        gmx_gpu_opt_t *gpu_opt);
-
-/* Check the consistency of hw_opt with hwinfo.
-   This function should be called once on each MPI rank. */
-void gmx_check_hw_runconf_consistency(FILE                *fplog,
-                                      const gmx_hw_info_t *hwinfo,
-                                      const t_commrec     *cr,
-                                      const gmx_hw_opt_t  *hw_opt,
-                                      gmx_bool             bUseGPU);
-
-/* Check whether a GPU is shared among ranks, and return the number of shared
-   gpus
-
-   gpu_opt       = the gpu options struct
-
-   returns: The number of GPUs shared among ranks, or 0 */
-int gmx_count_gpu_dev_shared(const gmx_gpu_opt_t *gpu_opt);
+//! Return whether compatible GPUs were found.
+bool compatibleGpusFound(const gmx_gpu_info_t &gpu_info);
 
 #endif
+
+} // namespace gmx
diff --git a/src/gromacs/hardware/gpu_hw_info.cpp b/src/gromacs/hardware/gpu_hw_info.cpp
new file mode 100644 (file)
index 0000000..38749a9
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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 "gpu_hw_info.h"
+
+#include "config.h"
+
+/* Note that some of the following arrays must match the "GPU support
+ * enumeration" in src/config.h.cmakein, so that GMX_GPU looks up an
+ * array entry. */
+
+// TODO If/when we unify CUDA and OpenCL support code, this should
+// move to a single place in gpu_utils.
+/* Names of the GPU detection/check results (see e_gpu_detect_res_t in hw_info.h). */
+const char * const gpu_detect_res_str[egpuNR] =
+{
+    "compatible", "inexistent", "incompatible", "insane"
+};
index b78ee6e75998e1c440ddf433912c318488b90278..77ce7f5afec50cba535046d0f3237639e40eff7c 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,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.
@@ -69,18 +69,6 @@ struct gmx_gpu_info_t
     int                       n_dev_compatible; /* number of compatible GPUs */
 };
 
-/* GPU device selection information -- includes either CUDA or OpenCL devices */
-typedef struct gmx_gpu_opt_t
-{
-    char     *gpu_id;           /* GPU id's to use, each specified as chars */
-    gmx_bool  bUserSet;         /* true if the GPUs in dev_use are manually provided by the user */
-
-    int       n_dev_compatible; /* number of compatible GPU devices that could be used */
-    int      *dev_compatible;   /* array of compatible GPU device IDs, from which automatic selection occurs */
-    int       n_dev_use;        /* number of GPU devices selected to be used, either by the user or automatically */
-    int      *dev_use;          /* array mapping from PP rank index to GPU device ID; GPU IDs can be listed multiple times when ranks share them */
-} gmx_gpu_opt_t;
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/gromacs/hardware/hardwareassign.cpp b/src/gromacs/hardware/hardwareassign.cpp
new file mode 100644 (file)
index 0000000..fda0b96
--- /dev/null
@@ -0,0 +1,254 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+#include "gmxpre.h"
+
+#include "hardwareassign.h"
+
+#include "config.h"
+
+#include <cstring>
+
+#include <algorithm>
+#include <string>
+#include <vector>
+
+#include "gromacs/gmxlib/network.h"
+#include "gromacs/gpu_utils/gpu_utils.h"
+#include "gromacs/hardware/gpu_hw_info.h"
+#include "gromacs/hardware/hw_info.h"
+#include "gromacs/mdtypes/commrec.h"
+#include "gromacs/utility/basenetwork.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/logger.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/sysinfo.h"
+
+#define HOSTNAMELEN 80
+
+namespace gmx
+{
+
+std::vector<int> parseGpuTaskAssignment(const std::string &gpuTaskAssignment)
+{
+    std::vector<int> digits;
+    if (gpuTaskAssignment.empty())
+    {
+        return digits;
+    }
+
+    /* Parse a "plain" or comma-separated GPU ID string which contains
+     * a sequence of digits corresponding to GPU IDs; the order will
+     * indicate the assignment of GPU tasks on this node to GPU
+     * device IDs on this node. */
+    try
+    {
+        digits = parseDigitsFromString(gpuTaskAssignment);
+    }
+    GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
+
+    if (digits.empty())
+    {
+        gmx_fatal(FARGS, "Empty GPU ID string encountered.\n"
+                  "An empty, delimiter-free, or comma-separated sequence of valid numeric IDs of available GPUs is required.\n");
+    }
+    return digits;
+}
+
+/*! \brief This function is responsible for the automated mapping the
+ * GPUs to the processes on a single node.
+ *
+ * This selects the GPUs we will use. This is an operation local to each physical node.
+ * If we have less MPI ranks than GPUs, we will waste some GPUs.
+ *
+ * \param[in]        compatibleGpus       Vector of GPUs that are compatible
+ * \param[in]        nrank                Number of PP GPU ranks on the node.
+ * \param[in]        rank                 Index of PP GPU rank on the node.
+ *
+ * \returns The assignment of GPU tasks on ranks of this node to GPU devices on this node.
+ */
+static std::vector<int> assign_rank_gpu_ids(const std::vector<int> &compatibleGpus,
+                                            int nrank, int rank)
+{
+    int numCompatibleGpus = static_cast<int>(compatibleGpus.size());
+    GMX_RELEASE_ASSERT(nrank >= 1,
+                       gmx::formatString("Invalid limit (%d) for the number of GPUs (detected %d compatible GPUs)",
+                                         rank, numCompatibleGpus).c_str());
+
+    if (numCompatibleGpus == 0)
+    {
+        char host[HOSTNAMELEN];
+
+        gmx_gethostname(host, HOSTNAMELEN);
+        gmx_fatal(FARGS, "A GPU was requested on host %s, but no compatible GPUs were detected. All nodes with PP ranks need to have GPUs. If you intended to use GPU acceleration in a parallel run, you can either avoid using the nodes that don't have GPUs or place PME ranks on these nodes.", host);
+    }
+
+    int nshare;
+
+    nshare = 1;
+    if (nrank > numCompatibleGpus)
+    {
+        if (nrank % numCompatibleGpus == 0)
+        {
+            nshare = nrank/numCompatibleGpus;
+        }
+        else
+        {
+            if (rank == 0)
+            {
+                gmx_fatal(FARGS, "The number of MPI ranks (%d) in a physical node is not a multiple of the number of GPUs (%d). Select a different number of MPI ranks or use the -gpu_id option to manually specify the GPU to be used.",
+                          nrank, numCompatibleGpus);
+            }
+
+#if GMX_MPI
+            /* We use a global barrier to prevent ranks from continuing with
+             * an invalid setup.
+             */
+            MPI_Barrier(MPI_COMM_WORLD);
+#endif
+        }
+    }
+
+    /* Here we will waste GPUs when nrank < numCompatibleGpus */
+    std::vector<int> taskAssignment;
+    taskAssignment.resize(std::min(numCompatibleGpus*nshare, nrank));
+    for (size_t i = 0; i != taskAssignment.size(); ++i)
+    {
+        /* TODO: improve this implementation: either sort GPUs or remove the weakest here */
+        taskAssignment[i] = compatibleGpus[i/nshare];
+    }
+    return taskAssignment;
+}
+
+/*! \brief Check that all user-selected GPUs are compatible.
+ *
+ * Given the \c userGpuTaskAssignment and \c compatibleGPUs, give a fatal
+ * error if any selected GPUs is not compatible
+ *
+ * The error is given with a suitable descriptive message, which will
+ * have context if this check is done after the hardware detection
+ * results have been reported to the user. However, note that only the
+ * GPUs detected on the master rank are reported, because of the
+ * existing limitations of that reporting.
+ *
+ * \todo Note that the selected GPUs can be different on each rank,
+ * and the IDs of compatible GPUs can be different on each node, so
+ * this routine ought to do communication to determine whether all
+ * ranks are able to proceed. Currently this relies on the MPI runtime
+ * to kill the other processes because GROMACS lacks the appropriate
+ * infrastructure to do a good job of coordinating error messages and
+ * behaviour across MPMD ranks and multiple simulations.
+ *
+ * \param[in]   gpu_info               GPU information including device description.
+ * \param[in]   compatibleGpus         Vector of compatible GPUs
+ * \param[in]   userGpuTaskAssignment  The GPU selection from the user.
+ */
+static void exitUnlessUserGpuTaskAssignmentIsValid(const gmx_gpu_info_t   &gpu_info,
+                                                   const std::vector<int> &compatibleGpus,
+                                                   const std::vector<int> &userGpuTaskAssignment)
+{
+    int         numIncompatibleGpuIds = 0;
+    std::string message
+        = "Some of the requested GPUs do not exist, behave strangely, or are not compatible:\n";
+
+    for (const auto &gpuId : userGpuTaskAssignment)
+    {
+        if (std::find(compatibleGpus.begin(), compatibleGpus.end(), gpuId) == compatibleGpus.end())
+        {
+            numIncompatibleGpuIds++;
+            message += gmx::formatString("    GPU #%d: %s\n",
+                                         gpuId,
+                                         getGpuCompatibilityDescription(gpu_info, gpuId));
+        }
+    }
+
+    if (numIncompatibleGpuIds > 0)
+    {
+        gmx_fatal(FARGS, message.c_str());
+    }
+}
+
+/*! \brief Filter the compatible GPUs
+ *
+ * This function filters gpu_info.gpu_dev for compatible GPUs based
+ * on the previously run compatibility tests.
+ *
+ * \param[in]     gpu_info    Information detected about GPUs, including compatibility
+ * \return                    vector of IDs of GPUs already recorded as compatible */
+static std::vector<int> getCompatibleGpus(const gmx_gpu_info_t &gpu_info)
+{
+    // Possible minor over-allocation here, but not important for anything
+    std::vector<int> compatibleGpus;
+    compatibleGpus.reserve(gpu_info.n_dev);
+    for (int i = 0; i < gpu_info.n_dev; i++)
+    {
+        GMX_ASSERT(gpu_info.gpu_dev, "Invalid gpu_info.gpu_dev");
+        if (isGpuCompatible(gpu_info, i))
+        {
+            compatibleGpus.push_back(i);
+        }
+    }
+    return compatibleGpus;
+}
+
+std::vector<int> mapPpRanksToGpus(bool                    rankCanUseGpu,
+                                  const t_commrec        *cr,
+                                  const gmx_gpu_info_t   &gpu_info,
+                                  const gmx_hw_opt_t     &hw_opt)
+{
+    std::vector<int> taskAssignment;
+
+    if (!rankCanUseGpu)
+    {
+        return taskAssignment;
+    }
+
+    auto compatibleGpus = getCompatibleGpus(gpu_info);
+    if (!hw_opt.gpuIdTaskAssignment.empty())
+    {
+        auto userGpuTaskAssignment = parseGpuTaskAssignment(hw_opt.gpuIdTaskAssignment);
+        exitUnlessUserGpuTaskAssignmentIsValid(gpu_info, compatibleGpus, userGpuTaskAssignment);
+        taskAssignment = userGpuTaskAssignment;
+    }
+    else
+    {
+        taskAssignment = assign_rank_gpu_ids(compatibleGpus, cr->nrank_pp_intranode, cr->rank_pp_intranode);
+    }
+    return taskAssignment;
+}
+
+} // namespace
diff --git a/src/gromacs/hardware/hardwareassign.h b/src/gromacs/hardware/hardwareassign.h
new file mode 100644 (file)
index 0000000..f5ac536
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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_HARDWARE_HARDWAREASSIGN_H
+#define GMX_HARDWARE_HARDWAREASSIGN_H
+
+#include <string>
+#include <vector>
+
+#include "gromacs/utility/basedefinitions.h"
+
+struct gmx_gpu_info_t;
+struct gmx_hw_opt_t;
+struct t_commrec;
+
+namespace gmx
+{
+
+/*! \brief Parse a GPU assignment string into digits
+ *
+ * \param[in]   gpuTaskAssignment  String like "013" or "0,1,3" typically
+ *                                 supplied by the user to mdrun -gpu_id.
+ *
+ * \returns  A vector of integer GPU ids, like {0, 1, 3}.
+ *
+ * \throws   std::bad_alloc     If out of memory.
+ *           InvalidInputError  If an invalid character is found (ie not a digit or ',').
+ */
+std::vector<int> parseGpuTaskAssignment(const std::string &gpuTaskAssignment);
+
+/*! \brief Assign PP ranks to valid GPU IDs.
+ *
+ * Will return a validated mapping from PP ranks (ie tasks that can
+ * run on GPUs) to the device IDs of compatible GPUs on their node.
+ * This will be from any non-empty assignment in hw_opt, otherwise a
+ * default automated mapping is generated.
+ *
+ * Note that PME-only ranks have always ignored mdrun -gpu_id, so do
+ * not attempt to validate -gpu_id. They should continue this behaviour
+ * until PME tasks can use GPUs.
+ *
+ * \param[in]     rankCanUseGpu          Whether this rank can execute a task on a GPU.
+ * \param[in]     cr                     Communication record.
+ * \param[in]     gpu_info               Information detected about GPUs, including compatibility.
+ * \param[in]     hw_opt                 Parallelisation options, including any user-specified GPU task assignment.
+ *
+ * \returns  A valid GPU selection.
+ */
+std::vector<int> mapPpRanksToGpus(bool                    rankCanUseGpu,
+                                  const t_commrec        *cr,
+                                  const gmx_gpu_info_t   &gpu_info,
+                                  const gmx_hw_opt_t     &hw_opt);
+
+} // namespace
+
+#endif
index 84b8e3cb38acf71ad462f96889de05cd537dc621..44a8a120381d2f3559f057871d5eaf5fce2a5e78 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,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.
@@ -299,8 +299,8 @@ parseHwLocCache(const hwloc_topology_t             topo,
 
         if (depth >= 0)
         {
-            hwloc_obj_t cache = hwloc_get_next_obj_by_depth(topo, depth, NULL);
-            if (cache != NULL)
+            hwloc_obj_t cache = hwloc_get_next_obj_by_depth(topo, depth, nullptr);
+            if (cache != nullptr)
             {
                 std::vector<hwloc_obj_t> hwThreads = getHwLocDescendantsByType(cache, HWLOC_OBJ_PU);
 
@@ -376,7 +376,7 @@ parseHwLocNuma(const hwloc_topology_t             topo,
 
         int depth = hwloc_get_type_depth(topo, HWLOC_OBJ_NUMANODE);
         const struct hwloc_distances_s * dist = hwloc_get_whole_distance_matrix_by_depth(topo, depth);
-        if (dist != NULL && dist->nbobjs == hwlocNumaNodes.size())
+        if (dist != nullptr && dist->nbobjs == hwlocNumaNodes.size())
         {
             machine->numa.baseLatency        = dist->latency_base;
             machine->numa.maxRelativeLatency = dist->latency_max;
@@ -398,9 +398,9 @@ parseHwLocNuma(const hwloc_topology_t             topo,
     else
     {
         // No numa nodes found. Use the entire machine as a numa node.
-        const hwloc_obj_t hwlocMachine = hwloc_get_next_obj_by_type(topo, HWLOC_OBJ_MACHINE, NULL);
+        const hwloc_obj_t hwlocMachine = hwloc_get_next_obj_by_type(topo, HWLOC_OBJ_MACHINE, nullptr);
 
-        if (hwlocMachine != NULL)
+        if (hwlocMachine != nullptr)
         {
             machine->numa.nodes.resize(1);
             machine->numa.nodes[0].id           = 0;
@@ -462,7 +462,7 @@ parseHwLocDevices(const hwloc_topology_t             topo,
     {
         const hwloc_obj_t ancestor = hwloc_get_ancestor_obj_by_type(topo, HWLOC_OBJ_NUMANODE, p);
         int               numaId;
-        if (ancestor != NULL)
+        if (ancestor != nullptr)
         {
             numaId = ancestor->logical_index;
         }
@@ -506,7 +506,7 @@ parseHwLoc(HardwareTopology::Machine *        machine,
 
     hwloc_topology_set_flags(topo, HWLOC_TOPOLOGY_FLAG_IO_DEVICES);
 
-    if (hwloc_topology_load(topo) != 0 || hwloc_get_root_obj(topo) == NULL)
+    if (hwloc_topology_load(topo) != 0 || hwloc_get_root_obj(topo) == nullptr)
     {
         hwloc_topology_destroy(topo);
         return; // SupportLevel::None.
@@ -582,13 +582,6 @@ HardwareTopology HardwareTopology::detect()
 {
     HardwareTopology result;
 
-    // Default values for machine and numa stuff
-    result.machine_.logicalProcessorCount   = 0;
-    result.machine_.numa.baseLatency        = 0.0;
-    result.machine_.numa.maxRelativeLatency = 0.0;
-    result.supportLevel_                    = SupportLevel::None;
-    result.isThisSystem_                    = true;
-
 #if GMX_HWLOC
     parseHwLoc(&result.machine_, &result.supportLevel_, &result.isThisSystem_);
 #endif
@@ -613,12 +606,33 @@ HardwareTopology HardwareTopology::detect()
     return result;
 }
 
+HardwareTopology::Machine::Machine()
+{
+    logicalProcessorCount   = 0;
+    numa.baseLatency        = 0.0;
+    numa.maxRelativeLatency = 0.0;
+}
+
 
 HardwareTopology::HardwareTopology()
-    : supportLevel_(SupportLevel::None)
+    : supportLevel_(SupportLevel::None),
+      machine_(),
+      isThisSystem_(true)
 {
 }
 
+HardwareTopology::HardwareTopology(int logicalProcessorCount)
+    : supportLevel_(SupportLevel::None),
+      machine_(),
+      isThisSystem_(true)
+{
+    if (logicalProcessorCount > 0)
+    {
+        machine_.logicalProcessorCount = logicalProcessorCount;
+        supportLevel_                  = SupportLevel::LogicalProcessorCount;
+    }
+}
+
 int HardwareTopology::numberOfCores() const
 {
     if (supportLevel() >= SupportLevel::Basic)
index f766a4d695d9eeb4266a5a1eac1ff069d6276f20..b2dcf352cb8fe65511f50cc06babb039e7216567 100644 (file)
@@ -177,6 +177,8 @@ class HardwareTopology
          */
         struct Machine
         {
+            Machine();
+
             int                            logicalProcessorCount; //!< Number of logical processors in system
             std::vector<LogicalProcessor>  logicalProcessors;     //!< Map logical processors to socket/core
             std::vector<Socket>            sockets;               //!< All the sockets in the system
@@ -190,6 +192,14 @@ class HardwareTopology
         /*! \brief Detects the hardware topology. */
         static HardwareTopology detect();
 
+        /*! \brief Creates a topology with given number of logical cores.
+         *
+         * The support level will be either None or LogicalProcessorCount.
+         *
+         * Intended for testing of code that uses the hardware topology.
+         */
+        explicit HardwareTopology(int logicalProcessorCount);
+
         /*! \brief Check what topology information that is available and valid
          *
          *  The amount of hardware topology information that can be detected depends
index 26ad31ba401b13906e62728c64fe94937f5124c3..401421b5215f59f7310fe2e856ab51b9f43c9237 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,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.
@@ -35,6 +35,8 @@
 #ifndef GMX_HARDWARE_HWINFO_H
 #define GMX_HARDWARE_HWINFO_H
 
+#include <string>
+
 #include "gromacs/hardware/gpu_hw_info.h"
 #include "gromacs/utility/basedefinitions.h"
 
@@ -84,17 +86,33 @@ enum {
     threadaffSEL, threadaffAUTO, threadaffON, threadaffOFF, threadaffNR
 };
 
-/* Threading and GPU options, can be set automatically or by the user */
-typedef struct gmx_hw_opt_t {
-    int           nthreads_tot;        /* Total number of threads requested (TMPI) */
-    int           nthreads_tmpi;       /* Number of TMPI threads requested         */
-    int           nthreads_omp;        /* Number of OpenMP threads requested       */
-    int           nthreads_omp_pme;    /* As nthreads_omp, but for PME only nodes  */
-    int           thread_affinity;     /* Thread affinity switch, see enum above   */
-    int           core_pinning_stride; /* Logical core pinning stride              */
-    int           core_pinning_offset; /* Logical core pinning offset              */
-
-    gmx_gpu_opt_t gpu_opt;             /* The GPU options                          */
-} gmx_hw_opt_t;
+/*! \internal \brief Threading and GPU options, can be set automatically or by the user
+ *
+ * \todo During mdrunner(), if the user has left any of these values
+ * at their defaults (which tends to mean "choose automatically"),
+ * then those values are over-written with the result of such
+ * automation. This creates problems for the subsequent code in
+ * knowing what was done, why, and reporting correctly to the
+ * user. Find a way to improve this.
+ */
+struct gmx_hw_opt_t
+{
+    //! Total number of threads requested (thread-MPI + OpenMP).
+    int           nthreads_tot = 0;
+    //! Number of thread-MPI threads requested.
+    int           nthreads_tmpi = 0;
+    //! Number of OpenMP threads requested.
+    int           nthreads_omp = 0;
+    //! Number of OpenMP threads to use on PME_only ranks.
+    int           nthreads_omp_pme = 0;
+    //! Thread affinity switch, see enum above.
+    int           thread_affinity = threadaffSEL;
+    //! Logical core pinning stride.
+    int           core_pinning_stride = 0;
+    //! Logical core pinning offset.
+    int           core_pinning_offset = 0;
+    //! Empty, or a GPU task-assignment string provided by the user.
+    std::string   gpuIdTaskAssignment = "";
+};
 
 #endif
diff --git a/src/gromacs/hardware/printhardware.cpp b/src/gromacs/hardware/printhardware.cpp
new file mode 100644 (file)
index 0000000..e26c4ab
--- /dev/null
@@ -0,0 +1,492 @@
+/*
+ * 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
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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 "printhardware.h"
+
+#include "config.h"
+
+#include <cstdlib>
+
+#include <algorithm>
+#include <string>
+#include <vector>
+
+#include "gromacs/gpu_utils/gpu_utils.h"
+#include "gromacs/hardware/cpuinfo.h"
+#include "gromacs/hardware/gpu_hw_info.h"
+#include "gromacs/hardware/hardwaretopology.h"
+#include "gromacs/hardware/hw_info.h"
+#include "gromacs/mdtypes/commrec.h"
+#include "gromacs/simd/support.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/basenetwork.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/logger.h"
+#include "gromacs/utility/programcontext.h"
+#include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/sysinfo.h"
+
+//! Constant used to help minimize preprocessed code
+static const bool bGPUBinary     = GMX_GPU != GMX_GPU_NONE;
+
+/*! \brief Return the number of PP rank pairs that share a GPU device between them.
+ *
+ * Sharing GPUs among multiple PP ranks is possible via either user or
+ * automated selection. */
+static int gmx_count_gpu_dev_shared(const std::vector<int> &gpuTaskAssignment,
+                                    bool                    userSetGpuIds)
+{
+    int      same_count    = 0;
+
+    if (userSetGpuIds)
+    {
+        GMX_RELEASE_ASSERT(!gpuTaskAssignment.empty(),
+                           "The user cannot choose an empty set of GPU IDs, code is wrong somewhere");
+        size_t ngpu = gpuTaskAssignment.size();
+
+        for (size_t i = 0; i < ngpu - 1; i++)
+        {
+            for (size_t j = i + 1; j < ngpu; j++)
+            {
+                same_count      += (gpuTaskAssignment[i] ==
+                                    gpuTaskAssignment[j]);
+            }
+        }
+    }
+
+    return same_count;
+}
+
+/* Count and return the number of unique GPUs (per node) selected.
+ *
+ * As sharing GPUs among multiple PP ranks is possible, the number of
+ * GPUs used (per node) can be different from the number of GPU IDs
+ * used.
+ */
+static size_t gmx_count_gpu_dev_unique(const std::vector<int> &gpuTaskAssignment)
+{
+    std::set<int> uniqIds;
+    for (const auto &deviceId : gpuTaskAssignment)
+    {
+        uniqIds.insert(deviceId);
+    }
+    return uniqIds.size();
+}
+
+/*! \internal \brief
+ * Returns the GPU information text, one GPU per line.
+ */
+static std::string sprint_gpus(const gmx_gpu_info_t &gpu_info)
+{
+    char                     stmp[STRLEN];
+    std::vector<std::string> gpuStrings;
+    for (int i = 0; i < gpu_info.n_dev; i++)
+    {
+        get_gpu_device_info_string(stmp, gpu_info, i);
+        gpuStrings.push_back(gmx::formatString("    %s", stmp));
+    }
+    return gmx::joinStrings(gpuStrings, "\n");
+}
+
+void reportGpuUsage(const gmx::MDLogger    &mdlog,
+                    const gmx_gpu_info_t   &gpu_info,
+                    bool                    userSetGpuIds,
+                    const std::vector<int> &gpuTaskAssignment,
+                    size_t                  numPpRanks,
+                    bool                    bPrintHostName)
+{
+    if (gpuTaskAssignment.empty())
+    {
+        return;
+    }
+
+    std::string output;
+    {
+        std::string gpuIdsString =
+            formatAndJoin(gpuTaskAssignment, ",", gmx::StringFormatter("%d"));
+        size_t      numGpusInUse = gmx_count_gpu_dev_unique(gpuTaskAssignment);
+        bool        bPluralGpus  = numGpusInUse > 1;
+
+        if (bPrintHostName)
+        {
+            char host[STRLEN];
+            gmx_gethostname(host, STRLEN);
+            output += gmx::formatString("On host %s ", host);
+        }
+        output += gmx::formatString("%zu GPU%s %sselected for this run.\n"
+                                    "Mapping of GPU ID%s to the %d PP rank%s in this node: %s\n",
+                                    numGpusInUse, bPluralGpus ? "s" : "",
+                                    userSetGpuIds ? "user-" : "auto-",
+                                    bPluralGpus ? "s" : "",
+                                    numPpRanks,
+                                    (numPpRanks > 1) ? "s" : "",
+                                    gpuIdsString.c_str());
+    }
+
+    int same_count = gmx_count_gpu_dev_shared(gpuTaskAssignment, userSetGpuIds);
+
+    if (same_count > 0)
+    {
+        output += gmx::formatString("NOTE: You assigned %s to multiple ranks.\n",
+                                    same_count > 1 ? "GPU IDs" : "a GPU ID");
+    }
+
+    if (static_cast<size_t>(gpu_info.n_dev_compatible) > numPpRanks)
+    {
+        /* TODO In principle, this warning could be warranted only on
+         * ranks on some nodes, but we lack the infrastructure to do a
+         * good job of reporting that. */
+        output += gmx::formatString("NOTE: potentially sub-optimal launch configuration using fewer\n"
+                                    "      PP ranks on a node than GPUs available on that node.\n");
+    }
+
+    /* NOTE: this print is only for and on one physical node */
+    GMX_LOG(mdlog.warning).appendText(output);
+}
+
+/* Give a suitable fatal error or warning if the build configuration
+   and runtime CPU do not match. */
+static void
+check_use_of_rdtscp_on_this_cpu(const gmx::MDLogger   &mdlog,
+                                const gmx::CpuInfo    &cpuInfo)
+{
+    bool        binaryUsesRdtscp = HAVE_RDTSCP;
+
+    const char *programName = gmx::getProgramContext().displayName();
+
+    if (cpuInfo.supportLevel() < gmx::CpuInfo::SupportLevel::Features)
+    {
+        if (binaryUsesRdtscp)
+        {
+            GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
+                    "The %s executable was compiled to use the rdtscp CPU instruction. "
+                    "We cannot detect the features of your current CPU, but will proceed anyway. "
+                    "If you get a crash, rebuild GROMACS with the GMX_USE_RDTSCP=OFF CMake option.",
+                    programName);
+        }
+    }
+    else
+    {
+        bool cpuHasRdtscp = cpuInfo.feature(gmx::CpuInfo::Feature::X86_Rdtscp);
+
+        if (!cpuHasRdtscp && binaryUsesRdtscp)
+        {
+            gmx_fatal(FARGS, "The %s executable was compiled to use the rdtscp CPU instruction. "
+                      "However, this is not supported by the current hardware and continuing would lead to a crash. "
+                      "Please rebuild GROMACS with the GMX_USE_RDTSCP=OFF CMake option.",
+                      programName);
+        }
+
+        if (cpuHasRdtscp && !binaryUsesRdtscp)
+        {
+            GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
+                    "The current CPU can measure timings more accurately than the code in\n"
+                    "%s was configured to use. This might affect your simulation\n"
+                    "speed as accurate timings are needed for load-balancing.\n"
+                    "Please consider rebuilding %s with the GMX_USE_RDTSCP=ON CMake option.",
+                    programName, programName);
+        }
+    }
+}
+
+static std::string detected_hardware_string(const gmx_hw_info_t *hwinfo,
+                                            bool                 bFullCpuInfo)
+{
+    std::string                  s;
+
+    const gmx::CpuInfo          &cpuInfo = *hwinfo->cpuInfo;
+    const gmx::HardwareTopology &hwTop   = *hwinfo->hardwareTopology;
+
+    s  = gmx::formatString("\n");
+    s += gmx::formatString("Running on %d node%s with total",
+                           hwinfo->nphysicalnode,
+                           hwinfo->nphysicalnode == 1 ? "" : "s");
+    if (hwinfo->ncore_tot > 0)
+    {
+        s += gmx::formatString(" %d cores,", hwinfo->ncore_tot);
+    }
+    s += gmx::formatString(" %d logical cores", hwinfo->nhwthread_tot);
+    if (hwinfo->gpu_info.bDetectGPUs)
+    {
+        s += gmx::formatString(", %d compatible GPU%s",
+                               hwinfo->ngpu_compatible_tot,
+                               hwinfo->ngpu_compatible_tot == 1 ? "" : "s");
+    }
+    else if (bGPUBinary)
+    {
+        s += gmx::formatString(" (GPU detection deactivated)");
+    }
+    s += gmx::formatString("\n");
+
+    if (hwinfo->nphysicalnode > 1)
+    {
+        /* Print per node hardware feature counts */
+        if (hwinfo->ncore_max > 0)
+        {
+            s += gmx::formatString("  Cores per node:           %2d", hwinfo->ncore_min);
+            if (hwinfo->ncore_max > hwinfo->ncore_min)
+            {
+                s += gmx::formatString(" - %2d", hwinfo->ncore_max);
+            }
+            s += gmx::formatString("\n");
+        }
+        s += gmx::formatString("  Logical cores per node:   %2d", hwinfo->nhwthread_min);
+        if (hwinfo->nhwthread_max > hwinfo->nhwthread_min)
+        {
+            s += gmx::formatString(" - %2d", hwinfo->nhwthread_max);
+        }
+        s += gmx::formatString("\n");
+        if (bGPUBinary)
+        {
+            s += gmx::formatString("  Compatible GPUs per node: %2d",
+                                   hwinfo->ngpu_compatible_min);
+            if (hwinfo->ngpu_compatible_max > hwinfo->ngpu_compatible_min)
+            {
+                s += gmx::formatString(" - %2d", hwinfo->ngpu_compatible_max);
+            }
+            s += gmx::formatString("\n");
+            if (hwinfo->ngpu_compatible_tot > 0)
+            {
+                if (hwinfo->bIdenticalGPUs)
+                {
+                    s += gmx::formatString("  All nodes have identical type(s) of GPUs\n");
+                }
+                else
+                {
+                    /* This message will also appear with identical GPU types
+                     * when at least one node has no GPU.
+                     */
+                    s += gmx::formatString("  Different nodes have different type(s) and/or order of GPUs\n");
+                }
+            }
+        }
+    }
+
+#if GMX_LIB_MPI
+    int  rank;
+    char host[STRLEN];
+
+    gmx_gethostname(host, STRLEN);
+
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+
+    // TODO Use a wrapper around MPI_Get_processor_name instead.
+    s += gmx::formatString("Hardware detected on host %s (the node of MPI rank %d):\n",
+                           host, rank);
+#else
+    s += gmx::formatString("Hardware detected:\n");
+#endif
+    s += gmx::formatString("  CPU info:\n");
+
+    s += gmx::formatString("    Vendor: %s\n", cpuInfo.vendorString().c_str());
+
+    s += gmx::formatString("    Brand:  %s\n", cpuInfo.brandString().c_str());
+
+    if (bFullCpuInfo)
+    {
+        s += gmx::formatString("    Family: %d   Model: %d   Stepping: %d\n",
+                               cpuInfo.family(), cpuInfo.model(), cpuInfo.stepping());
+
+        s += gmx::formatString("    Features:");
+        for (auto &f : cpuInfo.featureSet())
+        {
+            s += gmx::formatString(" %s", cpuInfo.featureString(f).c_str());;
+        }
+        s += gmx::formatString("\n");
+    }
+
+    s += gmx::formatString("    SIMD instructions most likely to fit this hardware: %s",
+                           gmx::simdString(static_cast<gmx::SimdType>(hwinfo->simd_suggest_min)).c_str());
+
+    if (hwinfo->simd_suggest_max > hwinfo->simd_suggest_min)
+    {
+        s += gmx::formatString(" - %s", gmx::simdString(static_cast<gmx::SimdType>(hwinfo->simd_suggest_max)).c_str());
+    }
+    s += gmx::formatString("\n");
+
+    s += gmx::formatString("    SIMD instructions selected at GROMACS compile time: %s\n",
+                           gmx::simdString(gmx::simdCompiled()).c_str());
+
+    s += gmx::formatString("\n");
+
+    s += gmx::formatString("  Hardware topology: ");
+    switch (hwTop.supportLevel())
+    {
+        case gmx::HardwareTopology::SupportLevel::None:
+            s += gmx::formatString("None\n");
+            break;
+        case gmx::HardwareTopology::SupportLevel::LogicalProcessorCount:
+            s += gmx::formatString("Only logical processor count\n");
+            break;
+        case gmx::HardwareTopology::SupportLevel::Basic:
+            s += gmx::formatString("Basic\n");
+            break;
+        case gmx::HardwareTopology::SupportLevel::Full:
+            s += gmx::formatString("Full\n");
+            break;
+        case gmx::HardwareTopology::SupportLevel::FullWithDevices:
+            s += gmx::formatString("Full, with devices\n");
+            break;
+    }
+
+    if (!hwTop.isThisSystem())
+    {
+        s += gmx::formatString("  NOTE: Hardware topology cached or synthetic, not detected.\n");
+        if (char *p = std::getenv("HWLOC_XMLFILE"))
+        {
+            s += gmx::formatString("        HWLOC_XMLFILE=%s\n", p);
+        }
+    }
+
+    if (bFullCpuInfo)
+    {
+        if (hwTop.supportLevel() >= gmx::HardwareTopology::SupportLevel::Basic)
+        {
+            s += gmx::formatString("    Sockets, cores, and logical processors:\n");
+
+            for (auto &socket : hwTop.machine().sockets)
+            {
+                s += gmx::formatString("      Socket %2d:", socket.id);
+                for (auto &c : socket.cores)
+                {
+                    s += gmx::formatString(" [");
+                    for (auto &t : c.hwThreads)
+                    {
+                        s += gmx::formatString(" %3d", t.logicalProcessorId);
+                    }
+                    s += gmx::formatString("]");
+                }
+                s += gmx::formatString("\n");
+            }
+        }
+        if (hwTop.supportLevel() >= gmx::HardwareTopology::SupportLevel::Full)
+        {
+            s += gmx::formatString("    Numa nodes:\n");
+            for (auto &n : hwTop.machine().numa.nodes)
+            {
+                s += gmx::formatString("      Node %2d (%" GMX_PRIu64 " bytes mem):", n.id, n.memory);
+                for (auto &l : n.logicalProcessorId)
+                {
+                    s += gmx::formatString(" %3d", l);
+                }
+                s += gmx::formatString("\n");
+            }
+            s += gmx::formatString("      Latency:\n          ");
+            for (std::size_t j = 0; j < hwTop.machine().numa.nodes.size(); j++)
+            {
+                s += gmx::formatString(" %5d", j);
+            }
+            s += gmx::formatString("\n");
+            for (std::size_t i = 0; i < hwTop.machine().numa.nodes.size(); i++)
+            {
+                s += gmx::formatString("     %5d", i);
+                for (std::size_t j = 0; j < hwTop.machine().numa.nodes.size(); j++)
+                {
+                    s += gmx::formatString(" %5.2f", hwTop.machine().numa.relativeLatency[i][j]);
+                }
+                s += gmx::formatString("\n");
+            }
+
+
+            s += gmx::formatString("    Caches:\n");
+            for (auto &c : hwTop.machine().caches)
+            {
+                s += gmx::formatString("      L%d: %" GMX_PRIu64 " bytes, linesize %d bytes, assoc. %d, shared %d ways\n",
+                                       c.level, c.size, c.linesize, c.associativity, c.shared);
+            }
+        }
+        if (hwTop.supportLevel() >= gmx::HardwareTopology::SupportLevel::FullWithDevices)
+        {
+            s += gmx::formatString("    PCI devices:\n");
+            for (auto &d : hwTop.machine().devices)
+            {
+                s += gmx::formatString("      %04x:%02x:%02x.%1x  Id: %04x:%04x  Class: 0x%04x  Numa: %d\n",
+                                       d.domain, d.bus, d.dev, d.func, d.vendorId, d.deviceId, d.classId, d.numaNodeId);
+            }
+        }
+    }
+
+    if (bGPUBinary && (hwinfo->ngpu_compatible_tot > 0 ||
+                       hwinfo->gpu_info.n_dev > 0))
+    {
+        s += gmx::formatString("  GPU info:\n");
+        s += gmx::formatString("    Number of GPUs detected: %d\n",
+                               hwinfo->gpu_info.n_dev);
+        if (hwinfo->gpu_info.n_dev > 0)
+        {
+            s += sprint_gpus(hwinfo->gpu_info) + "\n";
+        }
+    }
+    return s;
+}
+
+void gmx_print_detected_hardware(FILE *fplog, const t_commrec *cr,
+                                 const gmx::MDLogger &mdlog,
+                                 const gmx_hw_info_t *hwinfo)
+{
+    const gmx::CpuInfo &cpuInfo = *hwinfo->cpuInfo;
+
+    if (fplog != nullptr)
+    {
+        std::string detected;
+
+        detected = detected_hardware_string(hwinfo, TRUE);
+
+        fprintf(fplog, "%s\n", detected.c_str());
+    }
+
+    if (MULTIMASTER(cr))
+    {
+        std::string detected;
+
+        detected = detected_hardware_string(hwinfo, FALSE);
+
+        fprintf(stderr, "%s\n", detected.c_str());
+    }
+
+    /* Check the compiled SIMD instruction set against that of the node
+     * with the lowest SIMD level support (skip if SIMD detection did not work)
+     */
+    if (cpuInfo.supportLevel() >= gmx::CpuInfo::SupportLevel::Features)
+    {
+        gmx::simdCheck(static_cast<gmx::SimdType>(hwinfo->simd_suggest_min), fplog, MULTIMASTER(cr));
+    }
+
+    /* For RDTSCP we only check on our local node and skip the MPI reduction */
+    check_use_of_rdtscp_on_this_cpu(mdlog, cpuInfo);
+}
diff --git a/src/gromacs/hardware/printhardware.h b/src/gromacs/hardware/printhardware.h
new file mode 100644 (file)
index 0000000..bd56368
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * 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
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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_HARDWARE_PRINTHARDWARE_H
+#define GMX_HARDWARE_PRINTHARDWARE_H
+
+#include <cstdio>
+
+#include <string>
+#include <vector>
+
+struct gmx_gpu_info_t;
+struct gmx_hw_info_t;
+struct t_commrec;
+
+namespace gmx
+{
+class MDLogger;
+}
+
+/* Print information about the detected hardware to fplog (if != NULL)
+ * and to stderr the master rank.
+ */
+void gmx_print_detected_hardware(FILE *fplog, const t_commrec *cr,
+                                 const gmx::MDLogger &mdlog,
+                                 const gmx_hw_info_t *hwinfo);
+
+/*! \brief Log a report on how GPUs are (or could be) being used on
+ * the ranks of the physical node of rank 0 of the simulation.
+ *
+ * \todo It could be useful to report also whether any nodes differed,
+ * and in what way.
+ *
+ * \param[out] mdlog              Logging object.
+ * \param[in]  gpu_info           Information detected about GPUs
+ * \param[in]  userSetGpuIds      Whether the user selected the GPU ids
+ * \param[in]  gpuTaskAssignment  The selected GPU IDs.
+ * \param[in]  numPpRanks         Number of PP ranks per node
+ * \param[in]  bPrintHostName     Print the hostname in the usage information
+ *
+ * \throws                        std::bad_alloc if out of memory */
+void reportGpuUsage(const gmx::MDLogger    &mdlog,
+                    const gmx_gpu_info_t   &gpu_info,
+                    bool                    userSetGpuIds,
+                    const std::vector<int> &gpuTaskAssignment,
+                    size_t                  numPpRanks,
+                    bool                    bPrintHostName);
+
+#endif
index 17a3273211297ece5f0fd715cd3ed1e22f7ff52d..1d2d157bedc9b753c845f9a80353249ee75297ca 100644 (file)
 #include "gromacs/imd/imdsocket.h"
 #include "gromacs/math/units.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/mdlib/broadcaststructs.h"
 #include "gromacs/mdlib/groupcoord.h"
 #include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/sighandler.h"
 #include "gromacs/mdlib/sim_util.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/mdtypes/state.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/topology/mtop_util.h"
 /*! \brief IMD Protocol Version. */
 #define IMDVERSION 2
 
-/*! \brief Broadcast d to all nodes */
-#define  block_bc(cr, d) gmx_bcast(sizeof(d), &(d), (cr))
-
-/*! \brief Broadcast nr elements of d to all nodes */
-#define  nblock_bc(cr, nr, d) gmx_bcast((nr)*sizeof((d)[0]), (d), (cr))
-
 
 /*! \internal
  * \brief
@@ -239,7 +235,7 @@ const char *eIMDType_names[IMD_NR + 1] = {
     "IMD_PAUSE",
     "IMD_TRATE",
     "IMD_IOERROR",
-    NULL
+    nullptr
 };
 
 
@@ -415,7 +411,7 @@ void write_IMDgroup_to_file(gmx_bool bIMD, t_inputrec *ir, t_state *state,
     {
         IMDatoms = gmx_mtop_global_atoms(sys);
         write_sto_conf_indexed(opt2fn("-imd", nfile, fnm), "IMDgroup", &IMDatoms,
-                               state->x, state->v, ir->ePBC, state->box, ir->imd->nat, ir->imd->ind);
+                               as_rvec_array(state->x.data()), as_rvec_array(state->v.data()), ir->ePBC, state->box, ir->imd->nat, ir->imd->ind);
     }
 }
 
@@ -470,7 +466,7 @@ static int imd_send_rvecs(IMDSocket *socket, int nat, rvec *x, char *buffer)
 /*! \brief Initializes the IMD private data. */
 static t_gmx_IMD_setup* imd_create(int imdatoms, int nstimddef, int imdport)
 {
-    t_gmx_IMD_setup *IMDsetup = NULL;
+    t_gmx_IMD_setup *IMDsetup = nullptr;
 
 
     snew(IMDsetup, 1);
@@ -560,7 +556,7 @@ static void imd_disconnect(t_gmx_IMD_setup *IMDsetup)
 
     /* then we reset the IMD step to its default, and reset the connection boolean */
     IMDsetup->nstimd_new   = IMDsetup->nstimd_def;
-    IMDsetup->clientsocket = NULL;
+    IMDsetup->clientsocket = nullptr;
     IMDsetup->bConnected   = FALSE;
 }
 
@@ -982,11 +978,11 @@ static void imd_readcommand(t_gmx_IMD_setup *IMDsetup)
  *
  * Call on master only.
  */
-static FILE *open_imd_out(const char             *fn,
-                          t_gmx_IMD_setup        *IMDsetup,
-                          int                     nat_total,
-                          const gmx_output_env_t *oenv,
-                          unsigned long           Flags)
+static FILE *open_imd_out(const char                *fn,
+                          t_gmx_IMD_setup           *IMDsetup,
+                          int                        nat_total,
+                          const gmx_output_env_t    *oenv,
+                          const ContinuationOptions &continuationOptions)
 {
     FILE       *fp;
 
@@ -995,7 +991,7 @@ static FILE *open_imd_out(const char             *fn,
     if (fn && oenv)
     {
         /* If we append to an existing file, all the header information is already there */
-        if (Flags & MD_APPENDFILES)
+        if (continuationOptions.appendFiles)
         {
             fp = gmx_fio_fopen(fn, "a+");
         }
@@ -1029,7 +1025,7 @@ static FILE *open_imd_out(const char             *fn,
     fprintf(stdout, "%s For a log of the IMD pull forces explicitly specify '-if' on the command line.\n"
             "%s (Not possible with energy minimization.)\n", IMDstr, IMDstr);
 
-    return NULL;
+    return nullptr;
 }
 #endif
 
@@ -1298,8 +1294,7 @@ void init_IMD(t_inputrec             *ir,
               int                     nfile,
               const t_filenm          fnm[],
               const gmx_output_env_t *oenv,
-              int                     imdport,
-              unsigned long           Flags)
+              const MdrunOptions     &mdrunOptions)
 {
     int              i;
     int              nat_total;
@@ -1314,12 +1309,14 @@ void init_IMD(t_inputrec             *ir,
         return;
     }
 
+    const ImdOptions &options = mdrunOptions.imdOptions;
+
     /* It seems we have a .tpr file that defines an IMD group and thus allows IMD sessions.
      * Check whether we can actually provide the IMD functionality for this setting: */
     if (MASTER(cr))
     {
         /* Check whether IMD was enabled by one of the command line switches: */
-        if ((Flags & MD_IMDWAIT) || (Flags & MD_IMDTERM) || (Flags & MD_IMDPULL))
+        if (options.wait || options.terminatable || options.pull)
         {
             /* Multiple simulations or replica exchange */
             if (MULTISIM(cr))
@@ -1377,13 +1374,13 @@ void init_IMD(t_inputrec             *ir,
     /* Initialize IMD setup structure. If we read in a pre-IMD .tpr file, imd->nat
      * will be zero. For those cases we transfer _all_ atomic positions */
     ir->imd->setup = imd_create(ir->imd->nat > 0 ? ir->imd->nat : nat_total,
-                                defnstimd, imdport);
+                                defnstimd, options.port);
     IMDsetup       = ir->imd->setup;
 
     /* We might need to open an output file for IMD forces data */
     if (MASTER(cr))
     {
-        IMDsetup->outf = open_imd_out(opt2fn("-if", nfile, fnm), ir->imd->setup, nat_total, oenv, Flags);
+        IMDsetup->outf = open_imd_out(opt2fn("-if", nfile, fnm), ir->imd->setup, nat_total, oenv, mdrunOptions.continuationOptions);
     }
 
     /* Make sure that we operate with a valid atom index array for the IMD atoms */
@@ -1410,21 +1407,21 @@ void init_IMD(t_inputrec             *ir,
         snew(IMDsetup->energysendbuf, recsize);
 
         /* Shall we wait for a connection? */
-        if (Flags & MD_IMDWAIT)
+        if (options.wait)
         {
             IMDsetup->bWConnect = TRUE;
             fprintf(stderr, "%s Pausing simulation while no IMD connection present (-imdwait).\n", IMDstr);
         }
 
         /* Will the IMD clients be able to terminate the simulation? */
-        if (Flags & MD_IMDTERM)
+        if (options.terminatable)
         {
             IMDsetup->bTerminatable = TRUE;
             fprintf(stderr, "%s Allow termination of the simulation from IMD client (-imdterm).\n", IMDstr);
         }
 
         /* Is pulling from IMD client allowed? */
-        if (Flags & MD_IMDPULL)
+        if (options.pull)
         {
             IMDsetup->bForceActivated = TRUE;
             fprintf(stderr, "%s Pulling from IMD remote is enabled (-imdpull).\n", IMDstr);
@@ -1484,7 +1481,7 @@ gmx_bool do_IMD(gmx_bool        bIMD,
                 rvec            x[],
                 t_inputrec     *ir,
                 double          t,
-                gmx_wallcycle_t wcycle)
+                gmx_wallcycle  *wcycle)
 {
     gmx_bool         imdstep = FALSE;
     t_gmx_IMD_setup *IMDsetup;
@@ -1632,7 +1629,7 @@ void IMD_send_positions(t_IMD *imd)
 void IMD_prep_energies_send_positions(gmx_bool bIMD, gmx_bool bIMDstep,
                                       t_IMD *imd, gmx_enerdata_t *enerd,
                                       gmx_int64_t step, gmx_bool bHaveNewEnergies,
-                                      gmx_wallcycle_t wcycle)
+                                      gmx_wallcycle *wcycle)
 {
     if (bIMD)
     {
@@ -1660,8 +1657,9 @@ int IMD_get_step(t_gmx_IMD *IMDsetup)
     return IMDsetup->nstimd;
 }
 
+
 void IMD_apply_forces(gmx_bool bIMD, t_IMD *imd, t_commrec *cr, rvec *f,
-                      gmx_wallcycle_t wcycle)
+                      gmx_wallcycle *wcycle)
 {
     int              i, j;
     int              locndx;
index cd27b816a9370cc5d12eaf97157036e21860dfeb..089174a68a5b5d7293b50756bf09726bcf4b0f16 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) 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.
 
 #include "config.h"
 
+#include <cstdio>
+
 #include "gromacs/math/vectypes.h"
-#include "gromacs/timing/wallcycle.h"
+#include "gromacs/utility/basedefinitions.h"
+
 
 #if GMX_NATIVE_WINDOWS
 #include <Windows.h>
@@ -74,11 +77,14 @@ struct gmx_domdec_t;
 struct gmx_enerdata_t;
 struct gmx_mtop_t;
 struct gmx_output_env_t;
+struct gmx_wallcycle;
+struct MdrunOptions;
+struct t_commrec;
 struct t_filenm;
 struct t_gmx_IMD;
 struct t_IMD;
 struct t_inputrec;
-struct t_state;
+class t_state;
 
 static const char IMDstr[] = "IMD:";  /**< Tag output from the IMD module with this string. */
 
@@ -130,14 +136,12 @@ void dd_make_local_IMD_atoms(gmx_bool bIMD, gmx_domdec_t *dd, t_IMD *imd);
  * \param nfile        Number of files.
  * \param fnm          Struct containing file names etc.
  * \param oenv         Output options.
- * \param imdport      Port to use for IMD connections.
- * \param Flags        Flags passed over from main, used to determine
- *                     whether or not we are appending.
+ * \param mdrunOptions Options for mdrun.
  */
 void init_IMD(t_inputrec *ir, t_commrec *cr, gmx_mtop_t *top_global,
               FILE *fplog, int defnstimd, rvec x[],
               int nfile, const t_filenm fnm[], const gmx_output_env_t *oenv,
-              int imdport, unsigned long  Flags);
+              const MdrunOptions &mdrunOptions);
 
 
 /*! \brief IMD required in this time step?
@@ -159,7 +163,7 @@ void init_IMD(t_inputrec *ir, t_commrec *cr, gmx_mtop_t *top_global,
 gmx_bool do_IMD(gmx_bool bIMD, gmx_int64_t step, t_commrec *cr,
                 gmx_bool bNS,
                 matrix box, rvec x[], t_inputrec *ir, double t,
-                gmx_wallcycle_t wcycle);
+                gmx_wallcycle *wcycle);
 
 
 /*! \brief Get the IMD update frequency.
@@ -181,7 +185,7 @@ int IMD_get_step(t_gmx_IMD *IMDsetup);
  */
 void IMD_apply_forces(gmx_bool bIMD, t_IMD *imd,
                       t_commrec *cr, rvec *f,
-                      gmx_wallcycle_t wcycle);
+                      gmx_wallcycle *wcycle);
 
 
 /*! \brief Copy energies and convert to float from enerdata to the IMD energy record.
@@ -220,7 +224,7 @@ void IMD_send_positions(t_IMD *imd);
 void IMD_prep_energies_send_positions(gmx_bool bIMD, gmx_bool bIMDstep,
                                       t_IMD *imd, gmx_enerdata_t *enerd,
                                       gmx_int64_t step, gmx_bool bHaveNewEnergies,
-                                      gmx_wallcycle_t wcycle);
+                                      gmx_wallcycle *wcycle);
 
 /*! \brief Finalize IMD and do some cleaning up.
  *
index b34e3e8975797f4ac9714cafb05c99effee1a365..afaa54dc9ccb94f8f00d3138f9768cd8eed0c422 100644 (file)
@@ -106,7 +106,7 @@ static void print_IMD_error(const char *file, int line, char *msg)
 {
     fprintf(stderr, "%s Error in file %s on line %d.\n", IMDstr, file, line);
 
-    if (NULL != msg)
+    if (nullptr != msg)
     {
         fprintf(stderr, "%s\n", msg);
     }
@@ -115,7 +115,7 @@ static void print_IMD_error(const char *file, int line, char *msg)
 
 extern IMDSocket* imdsock_create()
 {
-    IMDSocket *sock = NULL;
+    IMDSocket *sock = nullptr;
 
 
 #ifdef GMX_IMD
@@ -126,7 +126,7 @@ extern IMDSocket* imdsock_create()
         print_IMD_error(ERR_ARGS);
         sfree(sock);
 
-        return NULL;
+        return nullptr;
     }
     else
 #endif
@@ -209,7 +209,7 @@ extern IMDSocket* imdsock_accept(IMDSocket *sock)
     {
         print_IMD_error(ERR_ARGS);
 
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -277,7 +277,7 @@ extern void imdsock_shutdown(IMDSocket *sock)
 
 
     /* is the socket already NULL? */
-    if (sock == NULL)
+    if (sock == nullptr)
     {
         return;
     }
@@ -300,7 +300,7 @@ extern int imdsock_destroy(IMDSocket *sock)
     int ret = -1;
 
 
-    if (sock == NULL)
+    if (sock == nullptr)
     {
         return 1;
     }
@@ -350,7 +350,7 @@ extern int imdsock_tryread(IMDSocket *sock, int timeoutsec, int timeoutusec)
     do
     {
         /* check the set for read readiness. */
-        ret = select(sock->sockfd + 1, &readfds, NULL, NULL, tval);
+        ret = select(sock->sockfd + 1, &readfds, nullptr, nullptr, tval);
         /* redo on system interrupt */
     }
     while (ret < 0 && errno == EINTR);
index 85e625cdf477dad53c3e7e324bec2bb0d874fb6c..2195e5e8adfe9a5c0403445f511ee269d7c48c2b 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,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,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.
@@ -76,7 +76,7 @@ eigensolver(real *   a,
     /* Make jobz point to the character "V" if eigenvectors
      * should be calculated, otherwise "N" (only eigenvalues).
      */
-    jobz = (eigenvectors != NULL) ? "V" : "N";
+    jobz = (eigenvectors != nullptr) ? "V" : "N";
 
     /* allocate lapack stuff */
     snew(isuppz, 2*n);
@@ -293,7 +293,7 @@ sparse_eigensolver(gmx_sparsematrix_t *    A,
     }
 #endif
 
-    if (eigenvectors != NULL)
+    if (eigenvectors != nullptr)
     {
         dovec = 1;
     }
@@ -373,12 +373,12 @@ sparse_eigensolver(gmx_sparsematrix_t *    A,
 
 #if GMX_DOUBLE
     F77_FUNC(dseupd, DSEUPD) (&dovec, "A", select, eigenvalues, eigenvectors,
-                              &n, NULL, "I", &n, "SA", &neig, &abstol,
+                              &n, nullptr, "I", &n, "SA", &neig, &abstol,
                               resid, &ncv, v, &n, iparam, ipntr,
                               workd, workl, &lworkl, &info);
 #else
     F77_FUNC(sseupd, SSEUPD) (&dovec, "A", select, eigenvalues, eigenvectors,
-                              &n, NULL, "I", &n, "SA", &neig, &abstol,
+                              &n, nullptr, "I", &n, "SA", &neig, &abstol,
                               resid, &ncv, v, &n, iparam, ipntr,
                               workd, workl, &lworkl, &info);
 #endif
index 03185f084316873609abe9187ec32a6e034729fe..a63915e096094722ab28b4c4cf9e93de1123e254 100644 (file)
@@ -1647,7 +1647,7 @@ L65:
         F77_FUNC(dgemv, DGEMV) ("T", n, &iwork[12], &c_b18, &v[v_offset], ldv, &workd[iwork[8]],
                                 &c__1, &c_b42, &workd[iwork[9]], &c__1);
     }
-    else if (*mode == 2)
+    else
     {
         F77_FUNC(dgemv, DGEMV) ("T", n, &iwork[12], &c_b18, &v[v_offset], ldv, &workd[iwork[10]
                                 ], &c__1, &c_b42, &workd[iwork[9]], &c__1);
@@ -4510,7 +4510,7 @@ L65:
         F77_FUNC(sgemv, SGEMV) ("T", n, &iwork[12], &c_b18, &v[v_offset], ldv, &workd[iwork[8]],
                                 &c__1, &c_b42, &workd[iwork[9]], &c__1);
     }
-    else if (*mode == 2)
+    else
     {
         F77_FUNC(sgemv, SGEMV) ("T", n, &iwork[12], &c_b18, &v[v_offset], ldv, &workd[iwork[10]
                                 ], &c__1, &c_b42, &workd[iwork[9]], &c__1);
index 950d9392aac3d2501b6079bd3a4ba988c43192f0..7c9fdb5aae5f3e7d8469aa578147ad52ad1ddad1 100644 (file)
@@ -48,7 +48,7 @@ F77_FUNC(dbdsqr,DBDSQR)(const char *uplo,
     double unfl, sinl, cosr, smin, smax, sinr;
     double oldcs;
     int oldll;
-    double shift, sigmn, oldsn;
+    double shift, sigmn, oldsn = 0.;
     int maxit;
     double sminl;
     double sigmx;
index 0b3004b0693bf89a993a04483d7ee9aecc7ed3b0..a9513588b193c1be5e9abf799a2d628fb2187ac2 100644 (file)
@@ -121,6 +121,7 @@ F77_FUNC(dstebz,DSTEBZ)(const char *range,
     ulp = 2*GMX_DOUBLE_EPS;
     rtoli = ulp * 2.;
     nb = DSTEBZ_BLOCKSIZE;
+    // cppcheck-suppress knownConditionTrueFalse
     if (nb <= 1) {
        nb = 0;
     }
index 2cd91a2fe4ac5ad5aa12bf7c42194fe443b407d8..18f302a5153242669b663caf30411215a02dca10 100644 (file)
@@ -48,7 +48,7 @@ F77_FUNC(sbdsqr,SBDSQR)(const char *uplo,
     float unfl, sinl, cosr, smin, smax, sinr;
     float oldcs;
     int oldll;
-    float shift, sigmn, oldsn;
+    float shift, sigmn, oldsn = 0.;
     int maxit;
     float sminl;
     float sigmx;
index 652f2cc539fab215868ba8b78db6c99de9048235..26ed314ae049e32e59764148afb1f4f48561ce3a 100644 (file)
@@ -121,6 +121,7 @@ F77_FUNC(sstebz,SSTEBZ)(const char *range,
     ulp = 2*GMX_FLOAT_EPS;
     rtoli = ulp * 2.;
     nb = DSTEBZ_BLOCKSIZE;
+    // cppcheck-suppress knownConditionTrueFalse
     if (nb <= 1) {
        nb = 0;
     }
index 3673fd0bbb0fe6745bb24bd369558c11b13a81c9..bd1b9510a75acc7a0896e8aa496f7e0aef800c55 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) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * 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.
@@ -126,7 +126,7 @@ static void dump_matrix(FILE *fp, const char *title, int n, double **a)
 int matrix_invert(FILE *fp, int n, double **a)
 {
     int      i, j, m, lda, *ipiv, lwork, info;
-    double **test = NULL, **id, *work;
+    double **test = nullptr, **id, *work;
 
 #ifdef DEBUG_MATRIX
     if (fp)
index 37de48e9510aefc62ac6885aafdee6645d53463b..85e4151eb378c10fc8bf52ba0267eb4f00fda48c 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, by the GROMACS development team, led by
+ * 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.
@@ -165,7 +165,7 @@ void jacobi(double **a, int n, double d[], double **v, int *nrot)
     gmx_fatal(FARGS, "Error: Too many iterations in routine JACOBI\n");
 }
 
-int m_inv_gen(real **m, int n, real **minv)
+int m_inv_gen(real *m, int n, real *minv)
 {
     double **md, **v, *eig, tol, s;
     int      nzero, i, j, k, nrot;
@@ -185,7 +185,7 @@ int m_inv_gen(real **m, int n, real **minv)
     {
         for (j = 0; j < n; j++)
         {
-            md[i][j] = m[i][j];
+            md[i][j] = m[i*n + j];
         }
     }
 
@@ -221,7 +221,7 @@ int m_inv_gen(real **m, int n, real **minv)
             {
                 s += eig[k]*v[i][k]*v[j][k];
             }
-            minv[i][j] = s;
+            minv[i*n + j] = s;
         }
     }
 
index 007f3f800dbfe8c264c685c84198e75a2b8b94d9..331913da2e453aa7a2dfff32e389d2d041e216e7 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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,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.
@@ -53,8 +53,8 @@ void jacobi(double **a, int n, double d[], double **v, int *nrot);
  * int      *irot = number of jacobi rotations
  */
 
-int m_inv_gen(real **m, int n, real **minv);
-/* Produces minv, a generalized inverse of m.
+int m_inv_gen(real *m, int n, real *minv);
+/* Produces minv, a generalized inverse of m, both stored as linear arrays.
  * Inversion is done via diagonalization,
  * eigenvalues smaller than 1e-6 times the average diagonal element
  * are assumed to be zero.
index 5dea002f70bdf325b9adcae302f051d6cefedf35..79ec5912f09e9d0e51e19ecbddb2b901d11fcd6c 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, by the GROMACS development team, led by
+ * 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.
@@ -62,7 +62,7 @@ gmx_sparsematrix_init(int                    nrow)
     {
         A->ndata[i]    = 0;
         A->nalloc[i]   = 0;
-        A->data[i]     = NULL;
+        A->data[i]     = nullptr;
     }
     return A;
 }
@@ -77,7 +77,7 @@ gmx_sparsematrix_destroy(gmx_sparsematrix_t *   A)
     /* Release each row */
     for (i = 0; i < A->nrow; i++)
     {
-        if (A->data[i] != NULL)
+        if (A->data[i] != nullptr)
         {
             sfree(A->data[i]);
         }
@@ -186,7 +186,7 @@ gmx_sparsematrix_increment_value(gmx_sparsematrix_t *    A,
         if (A->ndata[row] == A->nalloc[row])
         {
             A->nalloc[row] += 100;
-            if (A->data[row] == NULL)
+            if (A->data[row] == nullptr)
             {
                 snew(A->data[row], A->nalloc[row]);
             }
index f56c61cb81c9e4d161b427546d5d3a8453289573..10d77d224c19e0240d6ba2eaf90302d086b4be2c 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,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.
@@ -38,5 +38,5 @@ set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${LISTED_FORCES_SOURCES} PARENT_SCO
 gmx_install_headers(listed-forces.h)
 
 if (BUILD_TESTING)
-#    add_subdirectory(tests)
+     add_subdirectory(tests)
 endif()
index fd46ab180ae62b6834bcba910daa48525f1aa9ba..4b05207a8015b27bcf0eb1ba777834b056e09ba0 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,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.
@@ -330,8 +330,8 @@ real FENE_bonds(int nbonds,
     return vtot;
 }
 
-real harmonic(real kA, real kB, real xA, real xB, real x, real lambda,
-              real *V, real *F)
+static real harmonic(real kA, real kB, real xA, real xB, real x, real lambda,
+                     real *V, real *F)
 {
     const real half = 0.5;
     real       L1, kk, x0, dx, dx2;
@@ -947,7 +947,7 @@ real angles(int nbonds,
                 f[aj][m] += f_j[m];
                 f[ak][m] += f_k[m];
             }
-            if (g != NULL)
+            if (g != nullptr)
             {
                 copy_ivec(SHIFT_IVEC(g, aj), jt);
 
@@ -1659,8 +1659,8 @@ do_dih_fup_noshiftf_simd(const int *ai, const int *aj, const int *ak, const int
 }
 #endif // GMX_SIMD_HAVE_REAL
 
-real dopdihs(real cpA, real cpB, real phiA, real phiB, int mult,
-             real phi, real lambda, real *V, real *F)
+static real dopdihs(real cpA, real cpB, real phiA, real phiB, int mult,
+                    real phi, real lambda, real *V, real *F)
 {
     real v, dvdlambda, mdphi, v1, sdphi, ddphi;
     real L1   = 1.0 - lambda;
@@ -3259,8 +3259,8 @@ cmap_dihs(int nbonds,
  *   G R O M O S  9 6   F U N C T I O N S
  *
  ***********************************************************/
-real g96harmonic(real kA, real kB, real xA, real xB, real x, real lambda,
-                 real *V, real *F)
+static real g96harmonic(real kA, real kB, real xA, real xB, real x, real lambda,
+                        real *V, real *F)
 {
     const real half = 0.5;
     real       L1, kk, x0, dx, dx2;
@@ -3340,9 +3340,9 @@ real g96bonds(int nbonds,
     return vtot;
 }
 
-real g96bond_angle(const rvec xi, const rvec xj, const rvec xk, const t_pbc *pbc,
-                   rvec r_ij, rvec r_kj,
-                   int *t1, int *t2)
+static real g96bond_angle(const rvec xi, const rvec xj, const rvec xk, const t_pbc *pbc,
+                          rvec r_ij, rvec r_kj,
+                          int *t1, int *t2)
 /* Return value is the angle between the bonds i-j and j-k */
 {
     real costh;
index ce1d20659fb028517db2e854b62b35ea5edbd84a..0c86e8a127f55a1ec02e8d9409409fa54e2b37bc 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,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.
@@ -47,7 +47,7 @@
 #ifndef GMX_LISTED_FORCES_BONDED_H
 #define GMX_LISTED_FORCES_BONDED_H
 
-#include <stdio.h>
+#include <cstdio>
 
 #include "gromacs/gmxlib/nrnb.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/topology/ifunc.h"
 #include "gromacs/utility/basedefinitions.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
 
-struct gmx_wallcycle;
 struct t_graph;
 struct t_pbc;
 
@@ -165,8 +161,4 @@ void
 
 //! \endcond
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif
index 46ba97584201b7820d74e9390993473b48f2b6f4..d2c7e42889875d24955c52aae1b3e4cbf4202373 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,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.
@@ -132,7 +132,7 @@ void init_disres(FILE *fplog, const gmx_mtop_t *mtop,
     iloop     = gmx_mtop_ilistloop_init(mtop);
     while (gmx_mtop_ilistloop_next(iloop, &il, &nmol))
     {
-        if (nmol > 1 && ir->eDisre != edrEnsemble)
+        if (nmol > 1 && il[F_DISRES].nr > 0 && ir->eDisre != edrEnsemble)
         {
             gmx_fatal(FARGS, "NMR distance restraints with multiple copies of the same molecule are currently only supported with ensemble averaging. If you just want to restrain distances between atom pairs using a flat-bottomed potential, use a restraint potential (bonds type 10) instead.");
         }
@@ -201,7 +201,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 != NULL && ptr != NULL && !bIsREMD)
+    if (cr && cr->ms != nullptr && ptr != nullptr && !bIsREMD)
     {
 #if GMX_MPI
         dd->nsystems = 0;
index 183847d3709d1df0fc41a12f4b49d13f8bfbfa79..7c1bb1062d9e661f701ffdfd94fe0f671c516516 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,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.
 #include "gromacs/utility/basedefinitions.h"
 
 struct gmx_mtop_t;
-struct history_t;
+class history_t;
 struct t_commrec;
 struct t_inputrec;
 struct t_pbc;
-struct t_state;
+class t_state;
 
 /*! \brief
  * Initiates *fcd data.
index 7e88289b4c8e8ba67feed054bda9cdaceb2d2ebd..a18ba160c89ba7ccd7d503d285e5bceffad1bc9c 100644 (file)
@@ -203,10 +203,7 @@ reduce_thread_output(int n, rvec *f, rvec *fshift,
                      gmx_bool bCalcEnerVir,
                      gmx_bool bDHDL)
 {
-    if (!bt->haveBondeds)
-    {
-        return;
-    }
+    assert(bt->haveBondeds);
 
     if (bt->nblock_used > 0)
     {
@@ -259,15 +256,15 @@ reduce_thread_output(int n, rvec *f, rvec *fshift,
 
 /*! \brief Calculate one element of the list of bonded interactions
     for this thread */
-real
+static real
 calc_one_bond(int thread,
               int ftype, const t_idef *idef,
               const rvec x[], rvec4 f[], rvec fshift[],
-              t_forcerec *fr,
+              const t_forcerec *fr,
               const t_pbc *pbc, const t_graph *g,
               gmx_grppairener_t *grpp,
               t_nrnb *nrnb,
-              real *lambda, real *dvdl,
+              const real *lambda, real *dvdl,
               const t_mdatoms *md, t_fcdata *fcd,
               gmx_bool bCalcEnerVir,
               int *global_atom_index)
@@ -361,17 +358,6 @@ calc_one_bond(int thread,
             v = 0;
         }
 #endif
-        else if (ftype == F_ORIRES)
-        {
-            if (thread == 0)
-            {
-                v = interaction_function[ftype].ifunc(nbonds*nat1, iatoms,
-                                                      idef->iparams,
-                                                      x, f, fshift,
-                                                      pbc, g, lambda[efptFTYPE], &(dvdl[efptFTYPE]),
-                                                      md, fcd, global_atom_index);
-            }
-        }
         else
         {
             v = interaction_function[ftype].ifunc(nbn, iatoms+nb0,
@@ -411,6 +397,74 @@ ftype_is_bonded_potential(int ftype)
         (ftype < F_GB12 || ftype > F_GB14);
 }
 
+/*! \brief Compute the bonded part of the listed forces, parallelized over threads
+ */
+static void
+calcBondedForces(const t_idef     *idef,
+                 const rvec        x[],
+                 const t_forcerec *fr,
+                 const t_pbc      *pbc_null,
+                 const t_graph    *g,
+                 gmx_enerdata_t   *enerd,
+                 t_nrnb           *nrnb,
+                 const real       *lambda,
+                 real             *dvdl,
+                 const t_mdatoms  *md,
+                 t_fcdata         *fcd,
+                 gmx_bool          bCalcEnerVir,
+                 int              *global_atom_index)
+{
+    struct bonded_threading_t *bt = fr->bonded_threading;
+
+#pragma omp parallel for num_threads(bt->nthreads) schedule(static)
+    for (int thread = 0; thread < bt->nthreads; thread++)
+    {
+        try
+        {
+            int                ftype;
+            real              *epot, v;
+            /* thread stuff */
+            rvec4             *ft;
+            rvec              *fshift;
+            real              *dvdlt;
+            gmx_grppairener_t *grpp;
+
+            zero_thread_output(bt, thread);
+
+            ft = bt->f_t[thread].f;
+
+            if (thread == 0)
+            {
+                fshift = fr->fshift;
+                epot   = enerd->term;
+                grpp   = &enerd->grpp;
+                dvdlt  = dvdl;
+            }
+            else
+            {
+                fshift = bt->f_t[thread].fshift;
+                epot   = bt->f_t[thread].ener;
+                grpp   = &bt->f_t[thread].grpp;
+                dvdlt  = bt->f_t[thread].dvdl;
+            }
+            /* Loop over all bonded force types to calculate the bonded forces */
+            for (ftype = 0; (ftype < F_NRE); ftype++)
+            {
+                if (idef->il[ftype].nr > 0 && ftype_is_bonded_potential(ftype))
+                {
+                    v = calc_one_bond(thread, ftype, idef, x,
+                                      ft, fshift, fr, pbc_null, g, grpp,
+                                      nrnb, lambda, dvdlt,
+                                      md, fcd, bCalcEnerVir,
+                                      global_atom_index);
+                    epot[ftype] += v;
+                }
+            }
+        }
+        GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
+    }
+}
+
 void calc_listed(const t_commrec             *cr,
                  struct gmx_wallcycle        *wcycle,
                  const t_idef *idef,
@@ -420,19 +474,14 @@ void calc_listed(const t_commrec             *cr,
                  const struct t_pbc *pbc_full,
                  const struct t_graph *g,
                  gmx_enerdata_t *enerd, t_nrnb *nrnb,
-                 real *lambda,
+                 const real *lambda,
                  const t_mdatoms *md,
                  t_fcdata *fcd, int *global_atom_index,
                  int force_flags)
 {
     struct bonded_threading_t *bt;
     gmx_bool                   bCalcEnerVir;
-    int                        i;
-    /* The dummy array is to have a place to store the dhdl at other values
-       of lambda, which will be thrown away in the end */
-    real                       dvdl[efptNR];
     const  t_pbc              *pbc_null;
-    int                        thread;
 
     bt = fr->bonded_threading;
 
@@ -440,25 +489,14 @@ void calc_listed(const t_commrec             *cr,
 
     bCalcEnerVir = (force_flags & (GMX_FORCE_VIRIAL | GMX_FORCE_ENERGY));
 
-    for (i = 0; i < efptNR; i++)
-    {
-        dvdl[i] = 0.0;
-    }
     if (fr->bMolPBC)
     {
         pbc_null = pbc;
     }
     else
     {
-        pbc_null = NULL;
-    }
-
-#ifdef DEBUG
-    if (g && debug)
-    {
-        p_graph(debug, "Bondage is fun", g);
+        pbc_null = nullptr;
     }
-#endif
 
     if ((idef->il[F_POSRES].nr > 0) ||
         (idef->il[F_FBPOSRES].nr > 0) ||
@@ -485,6 +523,13 @@ void calc_listed(const t_commrec             *cr,
         /* Do pre force calculation stuff which might require communication */
         if (fcd->orires.nr > 0)
         {
+            /* This assertion is to ensure we have whole molecules.
+             * Unfortunately we do not have an mdrun state variable that tells
+             * us if molecules in x are not broken over PBC, so we have to make
+             * do with checking graph!=nullptr, which should tell us if we made
+             * molecules whole before calling the current function.
+             */
+            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,
                                 idef->il[F_ORIRES].iatoms,
@@ -503,79 +548,37 @@ void calc_listed(const t_commrec             *cr,
         wallcycle_sub_stop(wcycle, ewcsRESTRAINTS);
     }
 
-    /* TODO: Skip this whole loop with a system/domain without listeds */
-    wallcycle_sub_start(wcycle, ewcsLISTED);
-#pragma omp parallel for num_threads(bt->nthreads) schedule(static)
-    for (thread = 0; thread < bt->nthreads; thread++)
+    if (bt->haveBondeds)
     {
-        try
+        wallcycle_sub_start(wcycle, ewcsLISTED);
+        /* The dummy array is to have a place to store the dhdl at other values
+           of lambda, which will be thrown away in the end */
+        real dvdl[efptNR] = {0};
+        calcBondedForces(idef, x, fr, pbc_null, g, enerd, nrnb, lambda, dvdl, md,
+                         fcd, bCalcEnerVir, global_atom_index);
+        wallcycle_sub_stop(wcycle, ewcsLISTED);
+
+        wallcycle_sub_start(wcycle, ewcsLISTED_BUF_OPS);
+        reduce_thread_output(fr->natoms_force, f, fr->fshift,
+                             enerd->term, &enerd->grpp, dvdl,
+                             bt,
+                             bCalcEnerVir,
+                             force_flags & GMX_FORCE_DHDL);
+
+        if (force_flags & GMX_FORCE_DHDL)
         {
-            int                ftype;
-            real              *epot, v;
-            /* thread stuff */
-            rvec4             *ft;
-            rvec              *fshift;
-            real              *dvdlt;
-            gmx_grppairener_t *grpp;
-
-            zero_thread_output(bt, thread);
-
-            ft = bt->f_t[thread].f;
-
-            if (thread == 0)
-            {
-                fshift = fr->fshift;
-                epot   = enerd->term;
-                grpp   = &enerd->grpp;
-                dvdlt  = dvdl;
-            }
-            else
-            {
-                fshift = bt->f_t[thread].fshift;
-                epot   = bt->f_t[thread].ener;
-                grpp   = &bt->f_t[thread].grpp;
-                dvdlt  = bt->f_t[thread].dvdl;
-            }
-            /* Loop over all bonded force types to calculate the bonded forces */
-            for (ftype = 0; (ftype < F_NRE); ftype++)
+            for (int i = 0; i < efptNR; i++)
             {
-                if (idef->il[ftype].nr > 0 && ftype_is_bonded_potential(ftype))
-                {
-                    v = calc_one_bond(thread, ftype, idef, x,
-                                      ft, fshift, fr, pbc_null, g, grpp,
-                                      nrnb, lambda, dvdlt,
-                                      md, fcd, bCalcEnerVir,
-                                      global_atom_index);
-                    epot[ftype] += v;
-                }
+                enerd->dvdl_nonlin[i] += dvdl[i];
             }
         }
-        GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
-    }
-    wallcycle_sub_stop(wcycle, ewcsLISTED);
-
-    wallcycle_sub_start(wcycle, ewcsLISTED_BUF_OPS);
-    reduce_thread_output(fr->natoms_force, f, fr->fshift,
-                         enerd->term, &enerd->grpp, dvdl,
-                         bt,
-                         bCalcEnerVir,
-                         force_flags & GMX_FORCE_DHDL);
-    wallcycle_sub_stop(wcycle, ewcsLISTED_BUF_OPS);
-
-    /* Remaining code does not have enough flops to bother counting */
-    if (force_flags & GMX_FORCE_DHDL)
-    {
-        for (i = 0; i < efptNR; i++)
-        {
-            enerd->dvdl_nonlin[i] += dvdl[i];
-        }
+        wallcycle_sub_stop(wcycle, ewcsLISTED_BUF_OPS);
     }
 
     /* Copy the sum of violations for the distance restraints from fcd */
     if (fcd)
     {
         enerd->term[F_DISRESVIOL] = fcd->disres.sumviol;
-
     }
 }
 
@@ -584,7 +587,7 @@ void calc_listed_lambda(const t_idef *idef,
                         t_forcerec *fr,
                         const struct t_pbc *pbc, const struct t_graph *g,
                         gmx_grppairener_t *grpp, real *epot, t_nrnb *nrnb,
-                        real *lambda,
+                        const real *lambda,
                         const t_mdatoms *md,
                         t_fcdata *fcd,
                         int *global_atom_index)
@@ -603,7 +606,7 @@ void calc_listed_lambda(const t_idef *idef,
     }
     else
     {
-        pbc_null = NULL;
+        pbc_null = nullptr;
     }
 
     /* Copy the whole idef, so we can modify the contents locally */
@@ -661,7 +664,7 @@ do_force_listed(struct gmx_wallcycle        *wcycle,
                 const struct t_graph        *graph,
                 gmx_enerdata_t              *enerd,
                 t_nrnb                      *nrnb,
-                real                        *lambda,
+                const real                  *lambda,
                 const t_mdatoms             *md,
                 t_fcdata                    *fcd,
                 int                         *global_atom_index,
index acb95107dce6431d07efab3dd9862ec1fd015d2d..29b3f23f4d2b2481fd214640c786a184f857096d 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) 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.
@@ -71,7 +71,7 @@
 
 struct gmx_enerdata_t;
 struct gmx_grppairener_t;
-struct history_t;
+class history_t;
 struct t_commrec;
 struct t_fcdata;
 struct t_forcerec;
@@ -80,7 +80,7 @@ struct t_inputrec;
 struct t_lambda;
 struct t_mdatoms;
 struct t_nrnb;
-struct t_state;
+class t_state;
 
 #ifdef __cplusplus
 extern "C" {
@@ -106,7 +106,7 @@ void calc_listed(const t_commrec *cr,
                  rvec f[], t_forcerec *fr,
                  const struct t_pbc *pbc, const struct t_pbc *pbc_full,
                  const struct t_graph *g,
-                 gmx_enerdata_t *enerd, t_nrnb *nrnb, real *lambda,
+                 gmx_enerdata_t *enerd, t_nrnb *nrnb, const real *lambda,
                  const t_mdatoms *md,
                  struct t_fcdata *fcd, int *ddgatindex,
                  int force_flags);
@@ -120,7 +120,7 @@ void calc_listed_lambda(const t_idef *idef,
                         t_forcerec *fr,
                         const struct t_pbc *pbc, const struct t_graph *g,
                         gmx_grppairener_t *grpp, real *epot, t_nrnb *nrnb,
-                        real *lambda,
+                        const real *lambda,
                         const t_mdatoms *md,
                         struct t_fcdata *fcd, int *global_atom_index);
 
@@ -140,7 +140,7 @@ do_force_listed(struct gmx_wallcycle           *wcycle,
                 const struct t_graph           *graph,
                 gmx_enerdata_t                 *enerd,
                 t_nrnb                         *nrnb,
-                real                           *lambda,
+                const real                     *lambda,
                 const t_mdatoms                *md,
                 struct t_fcdata                *fcd,
                 int                            *global_atom_index,
index fd69378866cd4955e7d251ef4c176f1bc7f2ce4c..ce1dc3003828c0546cb4f5a3644434b4db63995c 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,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.
@@ -49,7 +49,7 @@ int glatnr(int *global_atom_index, int i)
 {
     int atnr;
 
-    if (global_atom_index == NULL)
+    if (global_atom_index == nullptr)
     {
         atnr = i + 1;
     }
index afc7e84c73ff5f8ff09a1535dfc3dd79e80e33d3..9ad61308d655ec05bc753ee088a1938cdd70842c 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,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.
@@ -504,7 +504,7 @@ void init_bonded_threading(FILE *fplog, int nenergrp,
             /* Note that thread 0 uses the global fshift and energy arrays,
              * but to keep the code simple, we initialize all data here.
              */
-            bt->f_t[t].f        = NULL;
+            bt->f_t[t].f        = nullptr;
             bt->f_t[t].f_nalloc = 0;
             snew(bt->f_t[t].fshift, SHIFTS);
             bt->f_t[t].grpp.nener = nenergrp*nenergrp;
@@ -517,8 +517,8 @@ void init_bonded_threading(FILE *fplog, int nenergrp,
     }
 
     bt->nblock_used  = 0;
-    bt->block_index  = NULL;
-    bt->mask         = NULL;
+    bt->block_index  = nullptr;
+    bt->mask         = nullptr;
     bt->block_nalloc = 0;
 
     /* The optimal value after which to switch from uniform to localized
@@ -528,10 +528,10 @@ void init_bonded_threading(FILE *fplog, int nenergrp,
     const int max_nthread_uniform = 4;
     char *    ptr;
 
-    if ((ptr = getenv("GMX_BONDED_NTHREAD_UNIFORM")) != NULL)
+    if ((ptr = getenv("GMX_BONDED_NTHREAD_UNIFORM")) != nullptr)
     {
         sscanf(ptr, "%d", &bt->bonded_max_nthread_uniform);
-        if (fplog != NULL)
+        if (fplog != nullptr)
         {
             fprintf(fplog, "\nMax threads for uniform bonded distribution set to %d by env.var.\n",
                     bt->bonded_max_nthread_uniform);
index 109b86e24629c711cfdc28b81fc52cabfdea78ab..78418cc2eb9077ba8d3761bea33275b0c0c74612 100644 (file)
@@ -38,6 +38,7 @@
 
 #include "orires.h"
 
+#include <climits>
 #include <cmath>
 
 #include "gromacs/gmxlib/network.h"
@@ -70,15 +71,6 @@ void init_orires(FILE *fplog, const gmx_mtop_t *mtop,
                  const t_commrec *cr, t_oriresdata *od,
                  t_state *state)
 {
-    int                     i, j, d, ex, nmol, *nr_ex;
-    double                  mtot;
-    rvec                    com;
-    gmx_mtop_ilistloop_t    iloop;
-    t_ilist                *il;
-    gmx_mtop_atomloop_all_t aloop;
-    t_atom                 *atom;
-    const gmx_multisim_t   *ms;
-
     od->nr = gmx_mtop_ftype_count(mtop, F_ORIRES);
     if (0 == od->nr)
     {
@@ -93,6 +85,14 @@ void init_orires(FILE *fplog, const gmx_mtop_t *mtop,
                   od->nr, numFitParams + 1, numFitParams);
     }
 
+    if (ir->bPeriodicMols)
+    {
+        /* Since we apply fitting, we need to make molecules whole and this
+         * can not be done when periodic molecules are present.
+         */
+        gmx_fatal(FARGS, "Orientation restraints can not be applied when periodic molecules are present in the system");
+    }
+
     if (PAR(cr))
     {
         gmx_fatal(FARGS, "Orientation restraints do not work with MPI parallelization. Choose 1 MPI rank, if possible.");
@@ -103,40 +103,59 @@ void init_orires(FILE *fplog, const gmx_mtop_t *mtop,
         /* Nothing to do */
         return;
     }
-    ms = cr->ms;
 
     od->fc  = ir->orires_fc;
     od->nex = 0;
-    od->S   = NULL;
-    od->M   = NULL;
-    od->eig = NULL;
-    od->v   = NULL;
-
-    nr_ex = NULL;
-
-    iloop = gmx_mtop_ilistloop_init(mtop);
+    od->S   = nullptr;
+    od->M   = nullptr;
+    od->eig = nullptr;
+    od->v   = nullptr;
+
+    int                  *nr_ex   = nullptr;
+    int                   typeMin = INT_MAX;
+    int                   typeMax = 0;
+    gmx_mtop_ilistloop_t  iloop   = gmx_mtop_ilistloop_init(mtop);
+    t_ilist              *il;
+    int                   nmol;
     while (gmx_mtop_ilistloop_next(iloop, &il, &nmol))
     {
-        for (i = 0; i < il[F_ORIRES].nr; i += 3)
+        if (nmol > 1)
+        {
+            gmx_fatal(FARGS, "Found %d copies of a molecule with orientation restrains while the current code only supports a single copy. If you want to ensemble average, run multiple copies of the system using the multi-sim feature of mdrun.", nmol);
+        }
+
+        for (int i = 0; i < il[F_ORIRES].nr; i += 3)
         {
-            ex = mtop->ffparams.iparams[il[F_ORIRES].iatoms[i]].orires.ex;
+            int type = il[F_ORIRES].iatoms[i];
+            int ex   = mtop->ffparams.iparams[type].orires.ex;
             if (ex >= od->nex)
             {
                 srenew(nr_ex, ex+1);
-                for (j = od->nex; j < ex+1; j++)
+                for (int j = od->nex; j < ex+1; j++)
                 {
                     nr_ex[j] = 0;
                 }
                 od->nex = ex+1;
             }
+            GMX_ASSERT(nr_ex, "Check for allocated nr_ex to keep the static analyzer happy");
             nr_ex[ex]++;
+
+            typeMin = std::min(typeMin, type);
+            typeMax = std::max(typeMax, type);
         }
     }
+    /* With domain decomposition we use the type index for indexing in global arrays */
+    GMX_RELEASE_ASSERT(typeMax - typeMin + 1 == od->nr, "All orientation restraint parameter entries in the topology should be consecutive");
+    /* Store typeMin so we can index array with the type offset */
+    od->typeMin = typeMin;
+
     snew(od->S, od->nex);
     /* When not doing time averaging, the instaneous and time averaged data
      * are indentical and the pointers can point to the same memory.
      */
     snew(od->Dinsl, od->nr);
+
+    const gmx_multisim_t *ms = cr->ms;
     if (ms)
     {
         snew(od->Dins, od->nr);
@@ -183,19 +202,10 @@ void init_orires(FILE *fplog, const gmx_mtop_t *mtop,
     {
         snew(od->otav, od->nr);
     }
-    snew(od->tmp, od->nex);
-    snew(od->TMP, od->nex);
-    for (ex = 0; ex < od->nex; ex++)
-    {
-        snew(od->TMP[ex], 5);
-        for (i = 0; i < 5; i++)
-        {
-            snew(od->TMP[ex][i], 5);
-        }
-    }
+    snew(od->tmpEq, od->nex);
 
     od->nref = 0;
-    for (i = 0; i < mtop->natoms; i++)
+    for (int i = 0; i < mtop->natoms; i++)
     {
         if (ggrpnr(&mtop->groups, egcORFIT, i) == 0)
         {
@@ -212,21 +222,23 @@ void init_orires(FILE *fplog, const gmx_mtop_t *mtop,
      * Copy it to the other nodes after checking multi compatibility,
      * so we are sure the subsystems match before copying.
      */
-    clear_rvec(com);
-    mtot  = 0.0;
-    j     = 0;
-    aloop = gmx_mtop_atomloop_all_init(mtop);
+    rvec                     com   = { 0, 0, 0 };
+    double                   mtot  = 0.0;
+    int                      j     = 0;
+    gmx_mtop_atomloop_all_t  aloop = gmx_mtop_atomloop_all_init(mtop);
+    int                      i     = -1;
+    const t_atom            *atom;
     while (gmx_mtop_atomloop_all_next(aloop, &i, &atom))
     {
-        if (mtop->groups.grpnr[egcORFIT] == NULL ||
+        if (mtop->groups.grpnr[egcORFIT] == nullptr ||
             mtop->groups.grpnr[egcORFIT][i] == 0)
         {
             /* Not correct for free-energy with changing masses */
             od->mref[j] = atom->m;
-            if (ms == NULL || MASTERSIM(ms))
+            if (ms == nullptr || MASTERSIM(ms))
             {
                 copy_rvec(xref[i], od->xref[j]);
-                for (d = 0; d < DIM; d++)
+                for (int d = 0; d < DIM; d++)
                 {
                     com[d] += od->mref[j]*xref[i][d];
                 }
@@ -236,16 +248,16 @@ void init_orires(FILE *fplog, const gmx_mtop_t *mtop,
         }
     }
     svmul(1.0/mtot, com, com);
-    if (ms == NULL || MASTERSIM(ms))
+    if (ms == nullptr || MASTERSIM(ms))
     {
-        for (j = 0; j < od->nref; j++)
+        for (int j = 0; j < od->nref; j++)
         {
             rvec_dec(od->xref[j], com);
         }
     }
 
     fprintf(fplog, "Found %d orientation experiments\n", od->nex);
-    for (i = 0; i < od->nex; i++)
+    for (int i = 0; i < od->nex; i++)
     {
         fprintf(fplog, "  experiment %d has %d restraints\n", i+1, nr_ex[i]);
     }
@@ -275,63 +287,63 @@ void init_orires(FILE *fplog, const gmx_mtop_t *mtop,
 
 void diagonalize_orires_tensors(t_oriresdata *od)
 {
-    int           ex, i, j, nrot, ord[DIM], t;
-    matrix        S, TMP;
-
-    if (od->M == NULL)
+    if (od->M == nullptr)
     {
         snew(od->M, DIM);
-        for (i = 0; i < DIM; i++)
+        for (int i = 0; i < DIM; i++)
         {
             snew(od->M[i], DIM);
         }
         snew(od->eig_diag, DIM);
         snew(od->v, DIM);
-        for (i = 0; i < DIM; i++)
+        for (int i = 0; i < DIM; i++)
         {
             snew(od->v[i], DIM);
         }
     }
 
-    for (ex = 0; ex < od->nex; ex++)
+    for (int ex = 0; ex < od->nex; ex++)
     {
         /* Rotate the S tensor back to the reference frame */
+        matrix S, TMP;
         mmul(od->R, od->S[ex], TMP);
         mtmul(TMP, od->R, S);
-        for (i = 0; i < DIM; i++)
+        for (int i = 0; i < DIM; i++)
         {
-            for (j = 0; j < DIM; j++)
+            for (int j = 0; j < DIM; j++)
             {
                 od->M[i][j] = S[i][j];
             }
         }
 
+        int nrot;
         jacobi(od->M, DIM, od->eig_diag, od->v, &nrot);
 
-        for (i = 0; i < DIM; i++)
+        int ord[DIM];
+        for (int i = 0; i < DIM; i++)
         {
             ord[i] = i;
         }
-        for (i = 0; i < DIM; i++)
+        for (int i = 0; i < DIM; i++)
         {
-            for (j = i+1; j < DIM; j++)
+            for (int j = i+1; j < DIM; j++)
             {
                 if (gmx::square(od->eig_diag[ord[j]]) > gmx::square(od->eig_diag[ord[i]]))
                 {
-                    t      = ord[i];
+                    int t  = ord[i];
                     ord[i] = ord[j];
                     ord[j] = t;
                 }
             }
         }
 
-        for (i = 0; i < DIM; i++)
+        for (int i = 0; i < DIM; i++)
         {
             od->eig[ex*12 + i] = od->eig_diag[ord[i]];
         }
-        for (i = 0; i < DIM; i++)
+        for (int i = 0; i < DIM; i++)
         {
-            for (j = 0; j < DIM; j++)
+            for (int j = 0; j < DIM; j++)
             {
                 od->eig[ex*12 + 3 + 3*i + j] = od->v[j][ord[i]];
             }
@@ -341,17 +353,16 @@ void diagonalize_orires_tensors(t_oriresdata *od)
 
 void print_orires_log(FILE *log, t_oriresdata *od)
 {
-    int   ex, i;
     real *eig;
 
     diagonalize_orires_tensors(od);
 
-    for (ex = 0; ex < od->nex; ex++)
+    for (int ex = 0; ex < od->nex; ex++)
     {
         eig = od->eig + ex*12;
         fprintf(log, "  Orientation experiment %d:\n", ex+1);
         fprintf(log, "    order parameter: %g\n", eig[0]);
-        for (i = 0; i < DIM; i++)
+        for (int i = 0; i < DIM; i++)
         {
             fprintf(log, "    eig: %6.3f   %6.3f %6.3f %6.3f\n",
                     (eig[0] != 0) ? eig[i]/eig[0] : eig[i],
@@ -368,11 +379,10 @@ real calc_orires_dev(const gmx_multisim_t *ms,
                      const t_mdatoms *md, const rvec x[], const t_pbc *pbc,
                      t_fcdata *fcd, history_t *hist)
 {
-    int              fa, d, i, j, type, ex, nref;
-    real             edt, edt_1, invn, pfac, r2, invr, corrfac, weight, wsv2, sw, dev;
-    tensor          *S, R, TMP;
-    rvec5           *Dinsl, *Dins, *Dtav, *rhs;
-    real            *mref, ***T;
+    int              nref;
+    real             edt, edt_1, invn, pfac, r2, invr, corrfac, wsv2, sw, dev;
+    OriresMatEq     *matEq;
+    real            *mref;
     double           mtot;
     rvec            *xref, *xtmp, com, r_unrot, r;
     t_oriresdata    *od;
@@ -390,12 +400,7 @@ real calc_orires_dev(const gmx_multisim_t *ms,
     bTAV  = (od->edt != 0);
     edt   = od->edt;
     edt_1 = od->edt_1;
-    S     = od->S;
-    Dinsl = od->Dinsl;
-    Dins  = od->Dins;
-    Dtav  = od->Dtav;
-    T     = od->TMP;
-    rhs   = od->tmp;
+    matEq = od->tmpEq;
     nref  = od->nref;
     mref  = od->mref;
     xref  = od->xref;
@@ -425,15 +430,15 @@ real calc_orires_dev(const gmx_multisim_t *ms,
     }
 
     clear_rvec(com);
-    mtot = 0;
-    j    = 0;
-    for (i = 0; i < md->nr; i++)
+    mtot  = 0;
+    int j = 0;
+    for (int i = 0; i < md->nr; i++)
     {
         if (md->cORF[i] == 0)
         {
             copy_rvec(x[i], xtmp[j]);
             mref[j] = md->massT[i];
-            for (d = 0; d < DIM; d++)
+            for (int d = 0; d < DIM; d++)
             {
                 com[d] += mref[j]*xtmp[j][d];
             }
@@ -442,18 +447,17 @@ real calc_orires_dev(const gmx_multisim_t *ms,
         }
     }
     svmul(1.0/mtot, com, com);
-    for (j = 0; j < nref; j++)
+    for (int j = 0; j < nref; j++)
     {
         rvec_dec(xtmp[j], com);
     }
     /* Calculate the rotation matrix to rotate x to the reference orientation */
-    calc_fit_R(DIM, nref, mref, xref, xtmp, R);
-    copy_mat(R, od->R);
+    calc_fit_R(DIM, nref, mref, xref, xtmp, od->R);
 
-    d = 0;
-    for (fa = 0; fa < nfa; fa += 3)
+    for (int fa = 0; fa < nfa; fa += 3)
     {
-        type = forceatoms[fa];
+        const int type           = forceatoms[fa];
+        const int restraintIndex = type - od->typeMin;
         if (pbc)
         {
             pbc_dx_aiuc(pbc, x[forceatoms[fa+1]], x[forceatoms[fa+2]], r_unrot);
@@ -462,157 +466,166 @@ real calc_orires_dev(const gmx_multisim_t *ms,
         {
             rvec_sub(x[forceatoms[fa+1]], x[forceatoms[fa+2]], r_unrot);
         }
-        mvmul(R, r_unrot, r);
+        mvmul(od->R, r_unrot, r);
         r2   = norm2(r);
         invr = gmx::invsqrt(r2);
         /* Calculate the prefactor for the D tensor, this includes the factor 3! */
         pfac = ip[type].orires.c*invr*invr*3;
-        for (i = 0; i < ip[type].orires.power; i++)
+        for (int i = 0; i < ip[type].orires.power; i++)
         {
             pfac *= invr;
         }
-        Dinsl[d][0] = pfac*(2*r[0]*r[0] + r[1]*r[1] - r2);
-        Dinsl[d][1] = pfac*(2*r[0]*r[1]);
-        Dinsl[d][2] = pfac*(2*r[0]*r[2]);
-        Dinsl[d][3] = pfac*(2*r[1]*r[1] + r[0]*r[0] - r2);
-        Dinsl[d][4] = pfac*(2*r[1]*r[2]);
+        rvec5 &Dinsl = od->Dinsl[restraintIndex];
+        Dinsl[0] = pfac*(2*r[0]*r[0] + r[1]*r[1] - r2);
+        Dinsl[1] = pfac*(2*r[0]*r[1]);
+        Dinsl[2] = pfac*(2*r[0]*r[2]);
+        Dinsl[3] = pfac*(2*r[1]*r[1] + r[0]*r[0] - r2);
+        Dinsl[4] = pfac*(2*r[1]*r[2]);
 
         if (ms)
         {
-            for (i = 0; i < 5; i++)
+            for (int i = 0; i < 5; i++)
             {
-                Dins[d][i] = Dinsl[d][i]*invn;
+                od->Dins[restraintIndex][i] = Dinsl[i]*invn;
             }
         }
-
-        d++;
     }
 
     if (ms)
     {
-        gmx_sum_sim(5*od->nr, Dins[0], ms);
+        gmx_sum_sim(5*od->nr, od->Dins[0], ms);
     }
 
     /* Calculate the order tensor S for each experiment via optimization */
-    for (ex = 0; ex < od->nex; ex++)
+    for (int ex = 0; ex < od->nex; ex++)
     {
-        for (i = 0; i < 5; i++)
+        for (int i = 0; i < 5; i++)
         {
-            rhs[ex][i] = 0;
-            for (j = 0; j <= i; j++)
+            matEq[ex].rhs[i] = 0;
+            for (int j = 0; j <= i; j++)
             {
-                T[ex][i][j] = 0;
+                matEq[ex].mat[i][j] = 0;
             }
         }
     }
-    d = 0;
-    for (fa = 0; fa < nfa; fa += 3)
+
+    for (int fa = 0; fa < nfa; fa += 3)
     {
+        const int  type           = forceatoms[fa];
+        const int  restraintIndex = type - od->typeMin;
+        rvec5     &Dtav           = od->Dtav[restraintIndex];
         if (bTAV)
         {
             /* Here we update Dtav in t_fcdata using the data in history_t.
              * Thus the results stay correct when this routine
              * is called multiple times.
              */
-            for (i = 0; i < 5; i++)
+            for (int i = 0; i < 5; i++)
             {
-                Dtav[d][i] = edt*hist->orire_Dtav[d*5+i] + edt_1*Dins[d][i];
+                Dtav[i] =
+                    edt*hist->orire_Dtav[restraintIndex*5 + i] +
+                    edt_1*od->Dins[restraintIndex][i];
             }
         }
 
-        type   = forceatoms[fa];
-        ex     = ip[type].orires.ex;
-        weight = ip[type].orires.kfac;
+        int  ex     = ip[type].orires.ex;
+        real weight = ip[type].orires.kfac;
         /* Calculate the vector rhs and half the matrix T for the 5 equations */
-        for (i = 0; i < 5; i++)
+        for (int i = 0; i < 5; i++)
         {
-            rhs[ex][i] += Dtav[d][i]*ip[type].orires.obs*weight;
-            for (j = 0; j <= i; j++)
+            matEq[ex].rhs[i] += Dtav[i]*ip[type].orires.obs*weight;
+            for (int j = 0; j <= i; j++)
             {
-                T[ex][i][j] += Dtav[d][i]*Dtav[d][j]*weight;
+                matEq[ex].mat[i][j] += Dtav[i]*Dtav[j]*weight;
             }
         }
-        d++;
     }
     /* Now we have all the data we can calculate S */
-    for (ex = 0; ex < od->nex; ex++)
+    for (int ex = 0; ex < od->nex; ex++)
     {
+        OriresMatEq &eq = matEq[ex];
         /* Correct corrfac and copy one half of T to the other half */
-        for (i = 0; i < 5; i++)
+        for (int i = 0; i < 5; i++)
         {
-            rhs[ex][i]  *= corrfac;
-            T[ex][i][i] *= gmx::square(corrfac);
-            for (j = 0; j < i; j++)
+            eq.rhs[i]    *= corrfac;
+            eq.mat[i][i] *= gmx::square(corrfac);
+            for (int j = 0; j < i; j++)
             {
-                T[ex][i][j] *= gmx::square(corrfac);
-                T[ex][j][i]  = T[ex][i][j];
+                eq.mat[i][j] *= gmx::square(corrfac);
+                eq.mat[j][i]  = eq.mat[i][j];
             }
         }
-        m_inv_gen(T[ex], 5, T[ex]);
+        m_inv_gen(&eq.mat[0][0], 5, &eq.mat[0][0]);
         /* Calculate the orientation tensor S for this experiment */
-        S[ex][0][0] = 0;
-        S[ex][0][1] = 0;
-        S[ex][0][2] = 0;
-        S[ex][1][1] = 0;
-        S[ex][1][2] = 0;
-        for (i = 0; i < 5; i++)
+        matrix &S = od->S[ex];
+        S[0][0] = 0;
+        S[0][1] = 0;
+        S[0][2] = 0;
+        S[1][1] = 0;
+        S[1][2] = 0;
+        for (int i = 0; i < 5; i++)
         {
-            S[ex][0][0] += 1.5*T[ex][0][i]*rhs[ex][i];
-            S[ex][0][1] += 1.5*T[ex][1][i]*rhs[ex][i];
-            S[ex][0][2] += 1.5*T[ex][2][i]*rhs[ex][i];
-            S[ex][1][1] += 1.5*T[ex][3][i]*rhs[ex][i];
-            S[ex][1][2] += 1.5*T[ex][4][i]*rhs[ex][i];
+            S[0][0] += 1.5*eq.mat[0][i]*eq.rhs[i];
+            S[0][1] += 1.5*eq.mat[1][i]*eq.rhs[i];
+            S[0][2] += 1.5*eq.mat[2][i]*eq.rhs[i];
+            S[1][1] += 1.5*eq.mat[3][i]*eq.rhs[i];
+            S[1][2] += 1.5*eq.mat[4][i]*eq.rhs[i];
         }
-        S[ex][1][0] = S[ex][0][1];
-        S[ex][2][0] = S[ex][0][2];
-        S[ex][2][1] = S[ex][1][2];
-        S[ex][2][2] = -S[ex][0][0] - S[ex][1][1];
+        S[1][0] = S[0][1];
+        S[2][0] = S[0][2];
+        S[2][1] = S[1][2];
+        S[2][2] = -S[0][0] - S[1][1];
     }
 
-    wsv2 = 0;
-    sw   = 0;
+    const matrix *S = od->S;
 
-    d = 0;
-    for (fa = 0; fa < nfa; fa += 3)
+    wsv2            = 0;
+    sw              = 0;
+
+    for (int fa = 0; fa < nfa; fa += 3)
     {
-        type = forceatoms[fa];
-        ex   = ip[type].orires.ex;
+        const int    type           = forceatoms[fa];
+        const int    restraintIndex = type - od->typeMin;
+        const int    ex             = ip[type].orires.ex;
 
-        od->otav[d] = two_thr*
-            corrfac*(S[ex][0][0]*Dtav[d][0] + S[ex][0][1]*Dtav[d][1] +
-                     S[ex][0][2]*Dtav[d][2] + S[ex][1][1]*Dtav[d][3] +
-                     S[ex][1][2]*Dtav[d][4]);
+        const rvec5 &Dtav           = od->Dtav[restraintIndex];
+        od->otav[restraintIndex]    = two_thr*
+            corrfac*(S[ex][0][0]*Dtav[0] + S[ex][0][1]*Dtav[1] +
+                     S[ex][0][2]*Dtav[2] + S[ex][1][1]*Dtav[3] +
+                     S[ex][1][2]*Dtav[4]);
         if (bTAV)
         {
-            od->oins[d] = two_thr*(S[ex][0][0]*Dins[d][0] + S[ex][0][1]*Dins[d][1] +
-                                   S[ex][0][2]*Dins[d][2] + S[ex][1][1]*Dins[d][3] +
-                                   S[ex][1][2]*Dins[d][4]);
+            const rvec5 &Dins = od->Dins[restraintIndex];
+            od->oins[restraintIndex] = two_thr*
+                (S[ex][0][0]*Dins[0] + S[ex][0][1]*Dins[1] +
+                 S[ex][0][2]*Dins[2] + S[ex][1][1]*Dins[3] +
+                 S[ex][1][2]*Dins[4]);
         }
         if (ms)
         {
             /* When ensemble averaging is used recalculate the local orientation
              * for output to the energy file.
              */
-            od->oinsl[d] = two_thr*
-                (S[ex][0][0]*Dinsl[d][0] + S[ex][0][1]*Dinsl[d][1] +
-                 S[ex][0][2]*Dinsl[d][2] + S[ex][1][1]*Dinsl[d][3] +
-                 S[ex][1][2]*Dinsl[d][4]);
+            const rvec5 &Dinsl = od->Dinsl[restraintIndex];
+            od->oinsl[restraintIndex] = two_thr*
+                (S[ex][0][0]*Dinsl[0] + S[ex][0][1]*Dinsl[1] +
+                 S[ex][0][2]*Dinsl[2] + S[ex][1][1]*Dinsl[3] +
+                 S[ex][1][2]*Dinsl[4]);
         }
 
-        dev = od->otav[d] - ip[type].orires.obs;
+        dev = od->otav[restraintIndex] - ip[type].orires.obs;
 
         wsv2 += ip[type].orires.kfac*gmx::square(dev);
         sw   += ip[type].orires.kfac;
-
-        d++;
     }
     od->rmsdev = std::sqrt(wsv2/sw);
 
     /* Rotate the S matrices back, so we get the correct grad(tr(S D)) */
-    for (ex = 0; ex < od->nex; ex++)
+    for (int ex = 0; ex < od->nex; ex++)
     {
-        tmmul(R, S[ex], TMP);
-        mmul(TMP, R, S[ex]);
+        matrix RS;
+        tmmul(od->R, od->S[ex], RS);
+        mmul(RS, od->R, od->S[ex]);
     }
 
     return od->rmsdev;
@@ -627,8 +640,7 @@ real orires(int nfa, const t_iatom forceatoms[], const t_iparams ip[],
             const t_mdatoms gmx_unused *md, t_fcdata *fcd,
             int gmx_unused *global_atom_index)
 {
-    int                 ai, aj;
-    int                 fa, d, i, type, ex, power, ki = CENTRAL;
+    int                 ex, power, ki = CENTRAL;
     ivec                dt;
     real                r2, invr, invr2, fc, smooth_fc, dev, devins, pfac;
     rvec                r, Sr, fij;
@@ -650,12 +662,12 @@ real orires(int nfa, const t_iatom forceatoms[], const t_iparams ip[],
             smooth_fc *= (1.0 - od->exp_min_t_tau);
         }
 
-        d = 0;
-        for (fa = 0; fa < nfa; fa += 3)
+        for (int fa = 0; fa < nfa; fa += 3)
         {
-            type  = forceatoms[fa];
-            ai    = forceatoms[fa+1];
-            aj    = forceatoms[fa+2];
+            const int type           = forceatoms[fa];
+            const int ai             = forceatoms[fa + 1];
+            const int aj             = forceatoms[fa + 2];
+            const int restraintIndex = type - od->typeMin;
             if (pbc)
             {
                 ki = pbc_dx_aiuc(pbc, x[ai], x[aj], r);
@@ -670,7 +682,7 @@ real orires(int nfa, const t_iatom forceatoms[], const t_iparams ip[],
             ex    = ip[type].orires.ex;
             power = ip[type].orires.power;
             fc    = smooth_fc*ip[type].orires.kfac;
-            dev   = od->otav[d] - ip[type].orires.obs;
+            dev   = od->otav[restraintIndex] - ip[type].orires.obs;
 
             /* NOTE:
              * there is no real potential when time averaging is applied
@@ -680,7 +692,7 @@ real orires(int nfa, const t_iatom forceatoms[], const t_iparams ip[],
             if (bTAV)
             {
                 /* Calculate the force as the sqrt of tav times instantaneous */
-                devins = od->oins[d] - ip[type].orires.obs;
+                devins = od->oins[restraintIndex] - ip[type].orires.obs;
                 if (dev*devins <= 0)
                 {
                     dev = 0;
@@ -696,12 +708,12 @@ real orires(int nfa, const t_iatom forceatoms[], const t_iparams ip[],
             }
 
             pfac  = fc*ip[type].orires.c*invr2;
-            for (i = 0; i < power; i++)
+            for (int i = 0; i < power; i++)
             {
                 pfac *= invr;
             }
             mvmul(od->S[ex], r, Sr);
-            for (i = 0; i < DIM; i++)
+            for (int i = 0; i < DIM; i++)
             {
                 fij[i] =
                     -pfac*dev*(4*Sr[i] - 2*(2+power)*invr2*iprod(Sr, r)*r[i]);
@@ -713,14 +725,13 @@ real orires(int nfa, const t_iatom forceatoms[], const t_iparams ip[],
                 ki = IVEC2IS(dt);
             }
 
-            for (i = 0; i < DIM; i++)
+            for (int i = 0; i < DIM; i++)
             {
                 f[ai][i]           += fij[i];
                 f[aj][i]           -= fij[i];
                 fshift[ki][i]      += fij[i];
                 fshift[CENTRAL][i] -= fij[i];
             }
-            d++;
         }
     }
 
@@ -731,19 +742,17 @@ real orires(int nfa, const t_iatom forceatoms[], const t_iparams ip[],
 
 void update_orires_history(t_fcdata *fcd, history_t *hist)
 {
-    t_oriresdata *od;
-    int           pair, i;
+    t_oriresdata *od = &(fcd->orires);
 
-    od = &(fcd->orires);
     if (od->edt != 0)
     {
         /* Copy the new time averages that have been calculated
          *  in calc_orires_dev.
          */
         hist->orire_initf = od->exp_min_t_tau;
-        for (pair = 0; pair < od->nr; pair++)
+        for (int pair = 0; pair < od->nr; pair++)
         {
-            for (i = 0; i < 5; i++)
+            for (int i = 0; i < 5; i++)
             {
                 hist->orire_Dtav[pair*5+i] = od->Dtav[pair][i];
             }
index c245898f054880e17e5e3231cf9a8bea64d6bd29..eac50d6e619e1dd29a373cf5d791fe78e6e8a5e7 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, by the GROMACS development team, led by
+ * 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.
 
 struct gmx_mtop_t;
 struct gmx_multisim_t;
-struct history_t;
+class history_t;
 struct t_inputrec;
 struct t_pbc;
 struct t_commrec;
 struct t_fcdata;
 struct t_oriresdata;
-struct t_state;
+class t_state;
 
 /*! \brief
  * Decides whether orientation restraints can work, and initializes
index 670eb6b0eb74ae570b7380dd501ac726a9cd36f3..08e6844cddd8a0eecf4a150313b9911028aea334 100644 (file)
@@ -94,7 +94,7 @@ warning_rlimit(const rvec *x, int ai, int aj, int * global_atom_index, real r, r
 }
 
 /*! \brief Compute the energy and force for a single pair interaction */
-real
+static real
 evaluate_single(real r2, real tabscale, real *vftab, real tableStride,
                 real qq, real c6, real c12, real *velec, real *vvdw)
 {
@@ -143,7 +143,7 @@ evaluate_single(real r2, real tabscale, real *vftab, real tableStride,
 }
 
 /*! \brief Compute the energy and force for a single pair interaction under FEP */
-real
+static real
 free_energy_evaluate_single(real r2, real sc_r_power, real alpha_coul,
                             real alpha_vdw, real tabscale, real *vftab, real tableStride,
                             real qqA, real c6A, real c12A, real qqB,
@@ -342,7 +342,7 @@ do_pairs_general(int ftype, int nbonds,
                  const t_iatom iatoms[], const t_iparams iparams[],
                  const rvec x[], rvec4 f[], rvec fshift[],
                  const struct t_pbc *pbc, const struct t_graph *g,
-                 real *lambda, real *dvdl,
+                 const real *lambda, real *dvdl,
                  const t_mdatoms *md,
                  const t_forcerec *fr, gmx_grppairener_t *grppener,
                  int *global_atom_index)
@@ -374,8 +374,8 @@ do_pairs_general(int ftype, int nbonds,
             energygrp_vdw  = grppener->ener[egLJSR];
             break;
         default:
-            energygrp_elec = NULL; /* Keep compiler happy */
-            energygrp_vdw  = NULL; /* Keep compiler happy */
+            energygrp_elec = nullptr; /* Keep compiler happy */
+            energygrp_vdw  = nullptr; /* Keep compiler happy */
             gmx_fatal(FARGS, "Unknown function type %d in do_nonbonded14", ftype);
             break;
     }
@@ -637,7 +637,7 @@ do_pairs(int ftype, int nbonds,
          const t_iatom iatoms[], const t_iparams iparams[],
          const rvec x[], rvec4 f[], rvec fshift[],
          const struct t_pbc *pbc, const struct t_graph *g,
-         real *lambda, real *dvdl,
+         const real *lambda, real *dvdl,
          const t_mdatoms *md,
          const t_forcerec *fr,
          gmx_bool bCalcEnergyAndVirial, gmx_grppairener_t *grppener,
@@ -668,13 +668,13 @@ do_pairs(int ftype, int nbonds,
         t_pbc        pbc_no;
         const t_pbc *pbc_nonnull;
 
-        if (pbc != NULL)
+        if (pbc != nullptr)
         {
             pbc_nonnull   = pbc;
         }
         else
         {
-            set_pbc(&pbc_no, epbcNONE, NULL);
+            set_pbc(&pbc_no, epbcNONE, nullptr);
             pbc_nonnull   = &pbc_no;
         }
 
index 7c285fe56c07e5187ca1bd30e470493cd3c921ae..c6dbcc256b035cdbc1cdde507b05b50f77745ddf 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) 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.
@@ -63,7 +63,7 @@ void
 do_pairs(int ftype, int nbonds, const t_iatom iatoms[], const t_iparams iparams[],
          const rvec x[], rvec4 f[], rvec fshift[],
          const struct t_pbc *pbc, const struct t_graph *g,
-         real *lambda, real *dvdl, const t_mdatoms *md, const t_forcerec *fr,
+         const real *lambda, real *dvdl, const t_mdatoms *md, const t_forcerec *fr,
          gmx_bool bCalcEnergyAndVirial, gmx_grppairener_t *grppener,
          int *global_atom_index);
 
index 34416aa18835cd9f5df818b146f28c0df57cceb1..850eaefa172a913560c078451833c9066894d133 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,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.
@@ -323,7 +323,7 @@ real posres(int nbonds,
     rvec             comA_sc, comB_sc, rdist, dpdl, dx;
     gmx_bool         bForceValid = TRUE;
 
-    if ((f == NULL) || (vir_diag == NULL))    /* should both be null together! */
+    if ((f == nullptr) || (vir_diag == nullptr))    /* should both be null together! */
     {
         bForceValid = FALSE;
     }
@@ -389,7 +389,7 @@ posres_wrapper(t_nrnb             *nrnb,
                const struct t_pbc *pbc,
                const rvec          x[],
                gmx_enerdata_t     *enerd,
-               real               *lambda,
+               const real         *lambda,
                t_forcerec         *fr)
 {
     real  v, dvdl;
@@ -397,8 +397,8 @@ posres_wrapper(t_nrnb             *nrnb,
     dvdl = 0;
     v    = posres(idef->il[F_POSRES].nr, idef->il[F_POSRES].iatoms,
                   idef->iparams_posres,
-                  x, fr->f_novirsum, fr->vir_diag_posres,
-                  fr->ePBC == epbcNONE ? NULL : pbc,
+                  x, as_rvec_array(fr->f_novirsum->data()), fr->vir_diag_posres,
+                  fr->ePBC == epbcNONE ? nullptr : pbc,
                   lambda[efptRESTRAINT], &dvdl,
                   fr->rc_scaling, fr->ePBC, fr->posres_com, fr->posres_comB);
     enerd->term[F_POSRES] += v;
@@ -416,7 +416,7 @@ posres_wrapper_lambda(struct gmx_wallcycle *wcycle,
                       const struct t_pbc   *pbc,
                       const rvec            x[],
                       gmx_enerdata_t       *enerd,
-                      real                 *lambda,
+                      const real           *lambda,
                       t_forcerec           *fr)
 {
     real  v;
@@ -435,8 +435,8 @@ posres_wrapper_lambda(struct gmx_wallcycle *wcycle,
         lambda_dum = (i == 0 ? lambda[efptRESTRAINT] : fepvals->all_lambda[efptRESTRAINT][i-1]);
         v          = posres(idef->il[F_POSRES].nr, idef->il[F_POSRES].iatoms,
                             idef->iparams_posres,
-                            x, NULL, NULL,
-                            fr->ePBC == epbcNONE ? NULL : pbc, lambda_dum, &dvdl_dum,
+                            x, nullptr, nullptr,
+                            fr->ePBC == epbcNONE ? nullptr : pbc, lambda_dum, &dvdl_dum,
                             fr->rc_scaling, fr->ePBC, fr->posres_com, fr->posres_comB);
         enerd->enerpart_lambda[i] += v;
     }
@@ -456,8 +456,8 @@ void fbposres_wrapper(t_nrnb             *nrnb,
 
     v = fbposres(idef->il[F_FBPOSRES].nr, idef->il[F_FBPOSRES].iatoms,
                  idef->iparams_fbposres,
-                 x, fr->f_novirsum, fr->vir_diag_posres,
-                 fr->ePBC == epbcNONE ? NULL : pbc,
+                 x, as_rvec_array(fr->f_novirsum->data()), fr->vir_diag_posres,
+                 fr->ePBC == epbcNONE ? nullptr : pbc,
                  fr->rc_scaling, fr->ePBC, fr->posres_com);
     enerd->term[F_FBPOSRES] += v;
     inc_nrnb(nrnb, eNR_FBPOSRES, idef->il[F_FBPOSRES].nr/2);
index badef1dabed4c4dc77ad73e6355a287b67f88704..b2cceb637139cf6416f1dea4496e78f93ca6c244 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,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.
@@ -72,7 +72,7 @@ posres_wrapper(t_nrnb             *nrnb,
                const struct t_pbc *pbc,
                const rvec          x[],
                gmx_enerdata_t     *enerd,
-               real               *lambda,
+               const real         *lambda,
                t_forcerec         *fr);
 
 /*! \brief Helper function that wraps calls to posres for free-energy
@@ -84,7 +84,7 @@ posres_wrapper_lambda(struct gmx_wallcycle *wcycle,
                       const struct t_pbc   *pbc,
                       const rvec            x[],
                       gmx_enerdata_t       *enerd,
-                      real                 *lambda,
+                      const real           *lambda,
                       t_forcerec           *fr);
 
 /*! \brief Helper function that wraps calls to fbposres for
diff --git a/src/gromacs/listed-forces/tests/CMakeLists.txt b/src/gromacs/listed-forces/tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..254fc1b
--- /dev/null
@@ -0,0 +1,37 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 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.
+
+gmx_add_unit_test(ListedForcesTest listed-forces-test
+  bonded.cpp)
+
diff --git a/src/gromacs/listed-forces/tests/bonded.cpp b/src/gromacs/listed-forces/tests/bonded.cpp
new file mode 100644 (file)
index 0000000..e7b72be
--- /dev/null
@@ -0,0 +1,279 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Implements test of bonded force routines
+ *
+ * \author David van der Spoel <david.vanderspoel@icm.uu.se>
+ * \ingroup module_listed-forces
+ */
+#include "gmxpre.h"
+
+#include "gromacs/listed-forces/bonded.h"
+
+#include <cmath>
+
+#include <memory>
+
+#include <gtest/gtest.h>
+
+#include "gromacs/math/units.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/pbcutil/pbc.h"
+
+#include "testutils/refdata.h"
+#include "testutils/testasserts.h"
+#include "testutils/testfilemanager.h"
+
+namespace gmx
+{
+namespace
+{
+
+//! Number of atoms used in these tests.
+#define NATOMS 4
+
+class BondedTest : public ::testing::Test
+{
+    protected:
+        rvec   x[NATOMS];
+        matrix box;
+        test::TestReferenceData           refData_;
+        test::TestReferenceChecker        checker_;
+        BondedTest( ) :
+            checker_(refData_.rootChecker())
+        {
+            test::FloatingPointTolerance tolerance(test::relativeToleranceAsFloatingPoint(1.0, 1e-6));
+            checker_.setDefaultTolerance(tolerance);
+            clear_rvecs(NATOMS, x);
+            x[1][2] = 1;
+            x[2][1] = x[2][2] = 1;
+            x[3][0] = x[3][1] = x[3][2] = 1;
+
+            clear_mat(box);
+            box[0][0] = box[1][1] = box[2][2] = 1.5;
+        }
+
+        void testBondAngle(int epbc)
+        {
+            rvec  r_ij, r_kj;
+            real  cosine_angle, angle;
+            int   t1, t2;
+            t_pbc pbc;
+
+            set_pbc(&pbc, epbc, box);
+            angle = bond_angle(x[0], x[1], x[2], &pbc,
+                               r_ij, r_kj, &cosine_angle,
+                               &t1, &t2);
+            checker_.checkReal(angle, "angle");
+            checker_.checkReal(cosine_angle, "cosine_angle");
+            checker_.checkInteger(t1, "t1");
+            checker_.checkInteger(t2, "t2");
+        }
+
+        void testDihedralAngle(int epbc)
+        {
+            rvec  r_ij, r_kj, r_kl, m, n;
+            real  cosine_angle, angle;
+            int   t1, t2, t3;
+            t_pbc pbc;
+
+            set_pbc(&pbc, epbc, box);
+            angle = dih_angle(x[0], x[1], x[2], x[3], &pbc,
+                              r_ij, r_kj, r_kl, m, n, &cosine_angle,
+                              &t1, &t2, &t3);
+
+            checker_.checkReal(angle, "angle");
+            checker_.checkReal(cosine_angle, "cosine_angle");
+            checker_.checkInteger(t1, "t1");
+            checker_.checkInteger(t2, "t2");
+            checker_.checkInteger(t3, "t3");
+        }
+
+        void testIfunc(int                         ftype,
+                       const std::vector<t_iatom> &iatoms,
+                       const t_iparams             iparams[],
+                       int                         epbc)
+        {
+            real  lambda    = 0;
+            real  dvdlambda = 0;
+            rvec4 f[NATOMS];
+            for (int i = 0; i < NATOMS; i++)
+            {
+                for (int j = 0; j < 4; j++)
+                {
+                    f[i][j] = 0;
+                }
+            }
+            rvec  fshift[N_IVEC];
+            clear_rvecs(N_IVEC, fshift);
+            t_pbc pbc;
+            set_pbc(&pbc, epbc, box);
+            int   ddgatindex = 0;
+            real  energy     = interaction_function[ftype].ifunc(iatoms.size(),
+                                                                 iatoms.data(),
+                                                                 iparams,
+                                                                 x, f, fshift,
+                                                                 &pbc,
+                                                                 /* const struct t_graph *g */ nullptr,
+                                                                 lambda, &dvdlambda,
+                                                                 /* const struct t_mdatoms *md */ nullptr,
+                                                                 /* struct t_fcdata *fcd */ nullptr,
+                                                                 &ddgatindex);
+            checker_.checkReal(energy, interaction_function[ftype].longname);
+        }
+
+};
+
+TEST_F (BondedTest, BondAnglePbcNone)
+{
+    testBondAngle(epbcNONE);
+}
+
+TEST_F (BondedTest, BondAnglePbcXy)
+{
+    testBondAngle(epbcXY);
+}
+
+TEST_F (BondedTest, BondAnglePbcXyz)
+{
+    testBondAngle(epbcXYZ);
+}
+
+TEST_F (BondedTest, DihedralAnglePbcNone)
+{
+    testDihedralAngle(epbcNONE);
+}
+
+TEST_F (BondedTest, DihedralAnglePbcXy)
+{
+    testDihedralAngle(epbcXY);
+}
+
+TEST_F (BondedTest, DihedralAnglePbcXyz)
+{
+    testDihedralAngle(epbcXYZ);
+}
+
+TEST_F (BondedTest, IfuncBondsPbcNo)
+{
+    std::vector<t_iatom> iatoms = { 0, 0, 1, 0, 1, 2, 0, 2, 3 };
+    t_iparams            iparams;
+    iparams.harmonic.rA  = iparams.harmonic.rB  = 0.8;
+    iparams.harmonic.krA = iparams.harmonic.krB = 50;
+    testIfunc(F_BONDS, iatoms, &iparams, epbcNONE);
+}
+
+TEST_F (BondedTest, IfuncBondsPbcXy)
+{
+    std::vector<t_iatom> iatoms = { 0, 0, 1, 0, 1, 2, 0, 2, 3 };
+    t_iparams            iparams;
+    iparams.harmonic.rA  = iparams.harmonic.rB  = 0.8;
+    iparams.harmonic.krA = iparams.harmonic.krB = 50;
+    testIfunc(F_BONDS, iatoms, &iparams, epbcXY);
+}
+
+TEST_F (BondedTest, IfuncBondsPbcXyz)
+{
+    std::vector<t_iatom> iatoms = { 0, 0, 1, 0, 1, 2, 0, 2, 3 };
+    t_iparams            iparams;
+    iparams.harmonic.rA  = iparams.harmonic.rB  = 0.8;
+    iparams.harmonic.krA = iparams.harmonic.krB = 50;
+    testIfunc(F_BONDS, iatoms, &iparams, epbcXYZ);
+}
+
+TEST_F (BondedTest, IfuncAnglesPbcNo)
+{
+    std::vector<t_iatom> iatoms = { 0, 0, 1, 2, 0, 1, 2, 3 };
+    t_iparams            iparams;
+    real                 k = 50;
+    iparams.harmonic.rA  = iparams.harmonic.rB  = 100;
+    iparams.harmonic.krA = iparams.harmonic.krB = k;
+    testIfunc(F_ANGLES, iatoms, &iparams, epbcNONE);
+}
+
+TEST_F (BondedTest, IfuncAnglesPbcXy)
+{
+    std::vector<t_iatom> iatoms  = { 0, 0, 1, 2, 0, 1, 2, 3 };
+    t_iparams            iparams;
+    real                 k = 50;
+    iparams.harmonic.rA  = iparams.harmonic.rB  = 100;
+    iparams.harmonic.krA = iparams.harmonic.krB = k;
+    testIfunc(F_ANGLES, iatoms, &iparams, epbcXY);
+}
+
+TEST_F (BondedTest, IfuncAnglesPbcXYZ)
+{
+    std::vector<t_iatom> iatoms = { 0, 0, 1, 2, 0, 1, 2, 3 };
+    t_iparams            iparams;
+    real                 k = 50;
+    iparams.harmonic.rA  = iparams.harmonic.rB  = 100;
+    iparams.harmonic.krA = iparams.harmonic.krB = k;
+    testIfunc(F_ANGLES, iatoms, &iparams, epbcXYZ);
+}
+
+TEST_F (BondedTest, IfuncProperDihedralsPbcNo)
+{
+    std::vector<t_iatom> iatoms = { 0, 0, 1, 2, 3 };
+    t_iparams            iparams;
+    iparams.pdihs.phiA = iparams.pdihs.phiB = -100;
+    iparams.pdihs.cpA  = iparams.pdihs.cpB  = 10;
+    iparams.pdihs.mult = 1;
+    testIfunc(F_PDIHS, iatoms, &iparams, epbcNONE);
+}
+
+TEST_F (BondedTest, IfuncProperDihedralsPbcXy)
+{
+    std::vector<t_iatom> iatoms = { 0, 0, 1, 2, 3 };
+    t_iparams            iparams;
+    iparams.pdihs.phiA = iparams.pdihs.phiB = -100;
+    iparams.pdihs.cpA  = iparams.pdihs.cpB  = 10;
+    iparams.pdihs.mult = 1;
+    testIfunc(F_PDIHS, iatoms, &iparams, epbcXY);
+}
+
+TEST_F (BondedTest, IfuncProperDihedralsPbcXyz)
+{
+    std::vector<t_iatom> iatoms  = { 0, 0, 1, 2, 3 };
+    t_iparams            iparams;
+    iparams.pdihs.phiA = iparams.pdihs.phiB = -100;
+    iparams.pdihs.cpA  = iparams.pdihs.cpB  = 10;
+    iparams.pdihs.mult = 1;
+    testIfunc(F_PDIHS, iatoms, &iparams, epbcXYZ);
+}
+
+}
+
+}
diff --git a/src/gromacs/listed-forces/tests/refdata/BondedTest_BondAnglePbcNone.xml b/src/gromacs/listed-forces/tests/refdata/BondedTest_BondAnglePbcNone.xml
new file mode 100644 (file)
index 0000000..d84a3e1
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Real Name="angle">1.5707964</Real>
+  <Real Name="cosine_angle">0</Real>
+  <Int Name="t1">22</Int>
+  <Int Name="t2">22</Int>
+</ReferenceData>
diff --git a/src/gromacs/listed-forces/tests/refdata/BondedTest_BondAnglePbcXy.xml b/src/gromacs/listed-forces/tests/refdata/BondedTest_BondAnglePbcXy.xml
new file mode 100644 (file)
index 0000000..0f7474a
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Real Name="angle">1.5707964</Real>
+  <Real Name="cosine_angle">0</Real>
+  <Int Name="t1">22</Int>
+  <Int Name="t2">17</Int>
+</ReferenceData>
diff --git a/src/gromacs/listed-forces/tests/refdata/BondedTest_BondAnglePbcXyz.xml b/src/gromacs/listed-forces/tests/refdata/BondedTest_BondAnglePbcXyz.xml
new file mode 100644 (file)
index 0000000..5d778a1
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Real Name="angle">1.5707964</Real>
+  <Real Name="cosine_angle">0</Real>
+  <Int Name="t1">37</Int>
+  <Int Name="t2">17</Int>
+</ReferenceData>
diff --git a/src/gromacs/listed-forces/tests/refdata/BondedTest_DihedralAnglePbcNone.xml b/src/gromacs/listed-forces/tests/refdata/BondedTest_DihedralAnglePbcNone.xml
new file mode 100644 (file)
index 0000000..5458d88
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Real Name="angle">-1.5707964</Real>
+  <Real Name="cosine_angle">-1</Real>
+  <Int Name="t1">22</Int>
+  <Int Name="t2">22</Int>
+  <Int Name="t3">22</Int>
+</ReferenceData>
diff --git a/src/gromacs/listed-forces/tests/refdata/BondedTest_DihedralAnglePbcXy.xml b/src/gromacs/listed-forces/tests/refdata/BondedTest_DihedralAnglePbcXy.xml
new file mode 100644 (file)
index 0000000..3bf5d9b
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Real Name="angle">-1.5707964</Real>
+  <Real Name="cosine_angle">-1</Real>
+  <Int Name="t1">22</Int>
+  <Int Name="t2">17</Int>
+  <Int Name="t3">23</Int>
+</ReferenceData>
diff --git a/src/gromacs/listed-forces/tests/refdata/BondedTest_DihedralAnglePbcXyz.xml b/src/gromacs/listed-forces/tests/refdata/BondedTest_DihedralAnglePbcXyz.xml
new file mode 100644 (file)
index 0000000..8941df4
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Real Name="angle">1.5707964</Real>
+  <Real Name="cosine_angle">1</Real>
+  <Int Name="t1">37</Int>
+  <Int Name="t2">17</Int>
+  <Int Name="t3">23</Int>
+</ReferenceData>
diff --git a/src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncAnglesPbcNo.xml b/src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncAnglesPbcNo.xml
new file mode 100644 (file)
index 0000000..0bf9b85
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Real Name="Angle">1.5230865</Real>
+</ReferenceData>
diff --git a/src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncAnglesPbcXYZ.xml b/src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncAnglesPbcXYZ.xml
new file mode 100644 (file)
index 0000000..0bf9b85
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Real Name="Angle">1.5230865</Real>
+</ReferenceData>
diff --git a/src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncAnglesPbcXy.xml b/src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncAnglesPbcXy.xml
new file mode 100644 (file)
index 0000000..0bf9b85
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Real Name="Angle">1.5230865</Real>
+</ReferenceData>
diff --git a/src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncBondsPbcNo.xml b/src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncBondsPbcNo.xml
new file mode 100644 (file)
index 0000000..71c61f3
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Real Name="Bond">2.9999995</Real>
+</ReferenceData>
diff --git a/src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncBondsPbcXy.xml b/src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncBondsPbcXy.xml
new file mode 100644 (file)
index 0000000..8582d6a
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Real Name="Bond">5.5</Real>
+</ReferenceData>
diff --git a/src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncBondsPbcXyz.xml b/src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncBondsPbcXyz.xml
new file mode 100644 (file)
index 0000000..2d98ef2
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Real Name="Bond">6.75</Real>
+</ReferenceData>
diff --git a/src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncProperDihedralsPbcNo.xml b/src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncProperDihedralsPbcNo.xml
new file mode 100644 (file)
index 0000000..47d7e15
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Real Name="Proper Dih.">19.848078</Real>
+</ReferenceData>
diff --git a/src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncProperDihedralsPbcXy.xml b/src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncProperDihedralsPbcXy.xml
new file mode 100644 (file)
index 0000000..47d7e15
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Real Name="Proper Dih.">19.848078</Real>
+</ReferenceData>
diff --git a/src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncProperDihedralsPbcXyz.xml b/src/gromacs/listed-forces/tests/refdata/BondedTest_IfuncProperDihedralsPbcXyz.xml
new file mode 100644 (file)
index 0000000..f8dc6c0
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Real Name="Proper Dih.">0.1519227</Real>
+</ReferenceData>
index 181e149961af825babb45d25ee213da37ec54369..e57c053241a1f4a10cd3054ef715922c8ad3da20 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,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.
@@ -45,6 +45,7 @@ gmx_install_headers(
     utilities.h
     vec.h
     vectypes.h
+    paddedvector.h
     )
 
 if (BUILD_TESTING)
index 83cd9dc5b4a55094e775516dfa4068d709c1ddd3..64eb87d16d775596c33db3a9b9ee000e22e10263 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,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.
@@ -97,7 +97,7 @@ real rmsdev_ind(int nind, int index[], real mass[], rvec x[], rvec xp[])
 
 real rmsdev(int natoms, real mass[], rvec x[], rvec xp[])
 {
-    return calc_similar_ind(FALSE, natoms, NULL, mass, x, xp);
+    return calc_similar_ind(FALSE, natoms, nullptr, mass, x, xp);
 }
 
 real rhodev_ind(int nind, int index[], real mass[], rvec x[], rvec xp[])
@@ -107,7 +107,7 @@ real rhodev_ind(int nind, int index[], real mass[], rvec x[], rvec xp[])
 
 real rhodev(int natoms, real mass[], rvec x[], rvec xp[])
 {
-    return calc_similar_ind(TRUE, natoms, NULL, mass, x, xp);
+    return calc_similar_ind(TRUE, natoms, nullptr, mass, x, xp);
 }
 
 void calc_fit_R(int ndim, int natoms, real *w_rls, const rvec *xp, rvec *x, matrix R)
@@ -305,7 +305,7 @@ void reset_x_ndim(int ndim, int ncm, const int *ind_cm,
     }
     tm = 0.0;
     clear_rvec(xcm);
-    if (ind_cm != NULL)
+    if (ind_cm != nullptr)
     {
         for (i = 0; i < ncm; i++)
         {
@@ -335,7 +335,7 @@ void reset_x_ndim(int ndim, int ncm, const int *ind_cm,
         xcm[m] /= tm;
     }
 
-    if (ind_reset != NULL)
+    if (ind_reset != nullptr)
     {
         for (i = 0; i < nreset; i++)
         {
index 8fa0c8ad6a8570b0fc45cfcbac2d6aa201908e8f..aabddbaebb91f4821c99ddd4da35627745e25eb2 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, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,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.
@@ -58,7 +58,7 @@ static t_complex rcmul(real r, t_complex c)
     return d;
 }
 
-static t_complex rcexp(real r)
+static inline t_complex rcexp(real r)
 {
     t_complex c;
 
@@ -69,7 +69,7 @@ static t_complex rcexp(real r)
 }
 
 
-static t_complex cadd(t_complex a, t_complex b)
+static inline t_complex cadd(t_complex a, t_complex b)
 {
     t_complex c;
 
@@ -79,7 +79,7 @@ static t_complex cadd(t_complex a, t_complex b)
     return c;
 }
 
-static t_complex csub(t_complex a, t_complex b)
+static inline t_complex csub(t_complex a, t_complex b)
 {
     t_complex c;
 
@@ -109,7 +109,7 @@ static t_complex conjugate(t_complex c)
     return d;
 }
 
-static real cabs2(t_complex c)
+static inline real cabs2(t_complex c)
 {
     real abs2;
     abs2 = (c.re*c.re)+(c.im*c.im);
@@ -117,9 +117,7 @@ static real cabs2(t_complex c)
     return abs2;
 }
 
-
-
-static t_complex cdiv(t_complex teller, t_complex noemer)
+static inline t_complex cdiv(t_complex teller, t_complex noemer)
 {
     t_complex res, anoemer;
 
@@ -128,4 +126,8 @@ static t_complex cdiv(t_complex teller, t_complex noemer)
 
     return rcmul(1.0/anoemer.re, res);
 }
+
+inline bool operator==(const t_complex &lhs, const t_complex &rhs){ return (lhs.re == rhs.re) && (lhs.im == rhs.im); }
+inline bool operator!=(const t_complex &lhs, const t_complex &rhs){ return !(lhs == rhs); }
+
 #endif
diff --git a/src/gromacs/math/paddedvector.h b/src/gromacs/math/paddedvector.h
new file mode 100644 (file)
index 0000000..7b73dee
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \file
+ * \brief
+ * Declares gmx::PaddedRVecVector
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ * \inpublicapi
+ * \ingroup module_math
+ */
+#ifndef GMX_MATH_PADDEDVECTOR_H
+#define GMX_MATH_PADDEDVECTOR_H
+
+#include <vector>
+
+#include "gromacs/math/vectypes.h"
+
+namespace gmx
+{
+
+/*! \brief Temporary definition of a type usable for SIMD-style loads of RVec quantities.
+ *
+ * \todo This vector is not padded yet, padding will be added soon */
+using PaddedRVecVector = std::vector<gmx::RVec>;
+
+} // namespace gmx
+
+// TODO This is a hack to avoid littering gmx:: all over code that is
+// almost all destined to move into the gmx namespace at some point.
+// An alternative would be about 20 files with using statements.
+using gmx::PaddedRVecVector;
+
+#endif
index 94fe43128c4f99ea808b287fe5bf9b05d71da0d8..30505b0e5fc795a896b3ee61228ca8a42363eb05 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,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.
@@ -61,7 +61,7 @@ using gmx::RVec;
 TEST(RVecTest, CanBeStoredInVector)
 {
     std::vector<RVec> v;
-    v.push_back(RVec(1, 2, 3));
+    v.emplace_back(1, 2, 3);
     v.resize(2);
     EXPECT_EQ(1, v[0][XX]);
     EXPECT_EQ(2, v[0][YY]);
@@ -72,7 +72,7 @@ TEST(RVecTest, ConvertsImplicitlyFrom_rvec)
 {
     std::vector<RVec> v;
     rvec              x = { 1, 2, 3 };
-    v.push_back(x);
+    v.emplace_back(x);
     EXPECT_EQ(1, v[0][XX]);
     EXPECT_EQ(2, v[0][YY]);
     EXPECT_EQ(3, v[0][ZZ]);
@@ -81,7 +81,7 @@ TEST(RVecTest, ConvertsImplicitlyFrom_rvec)
 TEST(RVecTest, ConvertsImplicitlyTo_rvec)
 {
     std::vector<RVec> v;
-    v.push_back(RVec(1, 2, 3));
+    v.emplace_back(1, 2, 3);
     rvec              x;
     copy_rvec(v[0], x);
     EXPECT_EQ(1, x[XX]);
@@ -92,7 +92,7 @@ TEST(RVecTest, ConvertsImplicitlyTo_rvec)
 TEST(RVecTest, WorksAsMutable_rvec)
 {
     std::vector<RVec> v;
-    v.push_back(RVec(1, 2, 3));
+    v.emplace_back(1, 2, 3);
     rvec              x = {2, 3, 4};
     copy_rvec(x, v[0]);
     EXPECT_EQ(2, v[0][XX]);
@@ -103,8 +103,8 @@ TEST(RVecTest, WorksAsMutable_rvec)
 TEST(RVecTest, WorksAs_rvec_Array)
 {
     std::vector<RVec> v;
-    v.push_back(RVec(1, 2, 3));
-    v.push_back(RVec(2, 3, 4));
+    v.emplace_back(1, 2, 3);
+    v.emplace_back(2, 3, 4);
     const rvec *r = as_rvec_array(v.data());
     EXPECT_EQ(1, r[0][XX]);
     EXPECT_EQ(2, r[0][YY]);
index 13c34786a3325183332b5428155111344569e7fb..c4fb43ed079df1fac1408a7f06920867379901b9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,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.
@@ -132,5 +132,5 @@ const char *unit2string(int unit)
         return eg2c_names[unit];
     }
 
-    return NULL;
+    return nullptr;
 }
index d0885651b162a311e4f25991762952edc22d2102..91f12fdfcf3e6b8eb7988810fd5b15845e108790 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,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.
@@ -82,6 +82,28 @@ extern "C" {
 #define M_2_SQRTPI  1.128379167095513
 #endif
 
+/*! \brief Enum to select safe or highly unsafe (faster) math functions.
+ *
+ *  Normally all the Gromacs math functions should apply reasonable care with
+ *  input arguments. While we do not necessarily adhere strictly to IEEE
+ *  (in particular not for arguments that might result in NaN, inf, etc.), the
+ *  functions should return reasonable values or e.g. clamp results to zero.
+ *
+ *  However, in a few cases where we are extremely performance-sensitive it
+ *  makes sense to forego these checks too in cases where we know the exact
+ *  properties if the input data, and we really need to save every cycle we can.
+ *
+ *  This class is typically used as a template parameter to such calls to enable
+ *  the caller to select the level of aggressiveness. We should always use the
+ *  safe alternative as the default value, and document carefully what might
+ *  happen with the unsafe alternative.
+ */
+enum class MathOptimization
+{
+    Safe,    //!< Don't do unsafe optimizations. This should always be default.
+    Unsafe   //!< Allow optimizations that can be VERY dangerous for general code.
+};
+
 /*! \brief Check if two numbers are within a tolerance
  *
  *  This routine checks if the relative difference between two numbers is
diff --git a/src/gromacs/math/veccompare.cpp b/src/gromacs/math/veccompare.cpp
new file mode 100644 (file)
index 0000000..54eece9
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * 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
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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 "veccompare.h"
+
+#include <cmath>
+#include <cstdio>
+
+#include "gromacs/utility/compare.h"
+
+void cmp_rvec(FILE *fp, const char *s, int index, const rvec i1, const rvec i2, real ftol, real abstol)
+{
+    if (!equal_real(i1[XX], i2[XX], ftol, abstol) ||
+        !equal_real(i1[YY], i2[YY], ftol, abstol) ||
+        !equal_real(i1[ZZ], i2[ZZ], ftol, abstol))
+    {
+        if (index != -1)
+        {
+            fprintf(fp, "%s[%5d] (%12.5e %12.5e %12.5e) - (%12.5e %12.5e %12.5e)\n",
+                    s, index, i1[XX], i1[YY], i1[ZZ], i2[XX], i2[YY], i2[ZZ]);
+        }
+        else
+        {
+            fprintf(fp, "%s (%12.5e %12.5e %12.5e) - (%12.5e %12.5e %12.5e)\n",
+                    s, i1[XX], i1[YY], i1[ZZ], i2[XX], i2[YY], i2[ZZ]);
+        }
+    }
+}
+
+void cmp_ivec(FILE *fp, const char *s, int index, const ivec i1, const ivec i2)
+{
+    if ((i1[XX] != i2[XX]) || (i1[YY] != i2[YY]) || (i1[ZZ] != i2[ZZ]))
+    {
+        if (index != -1)
+        {
+            fprintf(fp, "%s[%5d] (%8d,%8d,%8d - %8d,%8d,%8d)\n", s, index,
+                    i1[XX], i1[YY], i1[ZZ], i2[XX], i2[YY], i2[ZZ]);
+        }
+        else
+        {
+            fprintf(fp, "%s (%8d,%8d,%8d - %8d,%8d,%8d)\n", s,
+                    i1[XX], i1[YY], i1[ZZ], i2[XX], i2[YY], i2[ZZ]);
+        }
+    }
+}
+
+static void cmp_rvecs_rmstol(FILE *fp, const char *title, int n, const rvec x1[], const rvec x2[],
+                             real ftol, real abstol)
+{
+    int    i, m;
+    double rms;
+
+    /* For a vector you are usally not interested in a relative difference
+     * on a component that is very small compared to the other components.
+     * Therefore we do the relative comparision relative to the RMS component.
+     */
+    rms = 0.0;
+    for (i = 0; (i < n); i++)
+    {
+        for (m = 0; m < DIM; m++)
+        {
+            rms += x1[i][m]*x1[i][m] + x2[i][m]*x2[i][m];
+        }
+    }
+    rms = sqrt(rms/(2*n*DIM));
+
+    /* Convert the relative tolerance into an absolute tolerance */
+    if (ftol*rms < abstol)
+    {
+        abstol = ftol*rms;
+    }
+
+    /* And now do the actual comparision */
+    for (i = 0; (i < n); i++)
+    {
+        cmp_rvec(fp, title, i, x1[i], x2[i], 0.0, abstol);
+    }
+}
+
+void cmp_rvecs(FILE *fp, const char *title, int n, const rvec x1[], const rvec x2[],
+               gmx_bool bRMSD, real ftol, real abstol)
+{
+    int    i, m;
+    double d, ssd;
+
+    if (bRMSD)
+    {
+        ssd = 0;
+        for (i = 0; (i < n); i++)
+        {
+            for (m = 0; m < DIM; m++)
+            {
+                d    = x1[i][m] - x2[i][m];
+                ssd += d*d;
+            }
+        }
+        fprintf(fp, "%s RMSD %g\n", title, std::sqrt(ssd/n));
+    }
+    else
+    {
+        cmp_rvecs_rmstol(fp, title, n, x1, x2, ftol, abstol);
+    }
+}
similarity index 70%
rename from src/gromacs/tools/compare.h
rename to src/gromacs/math/veccompare.h
index 1ea889841a8e9225933c83bb8eea35f1f553c315..4b8ccca57598e4b5151e6a09d53ff4d5e5870a41 100644 (file)
  * 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_MATH_VECCOMPARE_H
+#define GMX_MATH_VECCOMPARE_H
 
-#ifndef GMX_TOOLS_COMPARE_H
-#define GMX_TOOLS_COMPARE_H
+#include <cstdio>
 
-struct gmx_output_env_t;
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
-/* Routines for comparing data structures from non-trajectory binary
-   file formats (e.g. as used by gmx check). */
+void cmp_rvec(FILE *fp, const char *s, int index, const rvec i1, const rvec i2, real ftol, real abstol);
 
-void
-comp_tpx(const char *fn1, const char *fn2, gmx_bool bRMSD, real ftol, real abstol);
-/* Compare two binary run input files */
+void cmp_ivec(FILE *fp, const char *s, int index, const ivec i1, const ivec i2);
 
-void comp_tpx_a_and_b_states(const char *fn, real ftol, real abstol);
-/* Compare two A and B states of a free-energy run input file. */
-
-void
-comp_trx(const gmx_output_env_t *oenv, const char *fn1, const char *fn2,
-         gmx_bool bRMSD, real ftol, real abstol);
-/* Compare two binary trajectory files */
-
-void
-comp_enx(const char *fn1, const char *fn2, real ftol, real abstol,
-         const char *lastener);
-/* Compare two binary energy files */
+void cmp_rvecs(FILE *fp, const char *title, int n, const rvec x1[], const rvec x2[],
+               gmx_bool bRMSD, real ftol, real abstol);
 
 #endif
index 2306951c07fee3d1616c95233463c1d56e04351b..b97f64f3c31236bb67a3cac53aca91defb6604d8 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,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.
@@ -42,7 +42,7 @@
 #include <cstdlib>
 
 #include "gromacs/math/vec.h"
-#include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/strconvert.h"
 #include "gromacs/utility/txtdump.h"
 
 void pr_ivec(FILE *fp, int indent, const char *title, const int vec[], int n, gmx_bool bShowNumbers)
@@ -140,14 +140,13 @@ void pr_ivecs(FILE *fp, int indent, const char *title, const ivec vec[], int n,
     }
 }
 
-void pr_rvec(FILE *fp, int indent, const char *title, const real vec[], int n, gmx_bool bShowNumbers)
+template <typename T>
+static void printRealVector(FILE *fp, int indent, const char *title, const T vec[], int n, gmx_bool bShowNumbers)
 {
-    int i;
-
     if (available(fp, vec, indent, title))
     {
         indent = pr_title_n(fp, indent, title, n);
-        for (i = 0; i < n; i++)
+        for (int i = 0; i < n; i++)
         {
             pr_indent(fp, indent);
             fprintf(fp, "%s[%d]=%12.5e\n", title, bShowNumbers ? i : -1, vec[i]);
@@ -155,19 +154,19 @@ void pr_rvec(FILE *fp, int indent, const char *title, const real vec[], int n, g
     }
 }
 
-void pr_dvec(FILE *fp, int indent, const char *title, const double vec[], int n, gmx_bool bShowNumbers)
+void pr_rvec(FILE *fp, int indent, const char *title, const real vec[], int n, gmx_bool bShowNumbers)
 {
-    int i;
+    printRealVector<real>(fp, indent, title, vec, n, bShowNumbers);
+}
 
-    if (available(fp, vec, indent, title))
-    {
-        indent = pr_title_n(fp, indent, title, n);
-        for (i = 0; i < n; i++)
-        {
-            pr_indent(fp, indent);
-            fprintf(fp, "%s[%d]=%12.5e\n", title, bShowNumbers ? i : -1, vec[i]);
-        }
-    }
+void pr_fvec(FILE *fp, int indent, const char *title, const float vec[], int n, gmx_bool bShowNumbers)
+{
+    printRealVector<float>(fp, indent, title, vec, n, bShowNumbers);
+}
+
+void pr_dvec(FILE *fp, int indent, const char *title, const double vec[], int n, gmx_bool bShowNumbers)
+{
+    printRealVector<double>(fp, indent, title, vec, n, bShowNumbers);
 }
 
 
@@ -202,7 +201,7 @@ void pr_rvecs(FILE *fp, int indent, const char *title, const rvec vec[], int n)
     const char *format;
     int         i, j;
 
-    if (getenv("GMX_PRINT_LONGFORMAT") != NULL)
+    if (getenv("GMX_PRINT_LONGFORMAT") != nullptr)
     {
         format = flong;
     }
@@ -239,7 +238,7 @@ void pr_rvecs_of_dim(FILE *fp, int indent, const char *title, const rvec vec[],
     const char *format;
     int         i, j;
 
-    if (getenv("GMX_PRINT_LONGFORMAT") != NULL)
+    if (getenv("GMX_PRINT_LONGFORMAT") != nullptr)
     {
         format = flong;
     }
index 4adb88bbb323e7ea8e09282ecfe2e6fa97339c6e..3c91d3f6a39f78d3567321dffa4ab23809651eaa 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,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.
@@ -48,6 +48,7 @@ void pr_ivecs(FILE *fp, int indent, const char *title, const ivec vec[], int n,
 void pr_bvec(FILE *fp, int indent, const char *title, const gmx_bool vec[], int n, gmx_bool bShowNnumbers);
 void pr_rvec(FILE *fp, int indent, const char *title, const real vec[], int n, gmx_bool bShowNumbers);
 void pr_rvecs_of_dim(FILE *fp, int indent, const char *title, const rvec vec[], int n, int dim);
+void pr_fvec(FILE *fp, int indent, const char *title, const float vec[], int n, gmx_bool bShowNumbers);
 void pr_dvec(FILE *fp, int indent, const char *title, const double vec[], int n, gmx_bool bShowNumbers);
 void pr_rvecs(FILE *fp, int indent, const char *title, const rvec vec[], int n);
 void pr_rvecs_len(FILE *fp, int indent, const char *title, const rvec vec[], int n);
index 91b6d7c9a85102b32b8d75aaa86e8c2ca0ea7334..71511750c720a5ea83e1c4404806f5956112e39c 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,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.
@@ -54,8 +54,6 @@ typedef real    tensor[DIM][DIM];
 
 typedef int     ivec[DIM];
 
-typedef int     imatrix[DIM][DIM];
-
 #ifdef __cplusplus
 
 namespace gmx
@@ -167,6 +165,9 @@ static inline const rvec *as_rvec_array(const RVec *x)
     return as_vec_array(x);
 }
 
+//! Shorthand for C++ `ivec`-equivalent type.
+typedef BasicVector<int> IVec;
+
 } // namespace gmx
 
 #endif
index 6e9f04785c2244e6c209e34e9d622ed8c3f34c0d..dd8c46071b58f5a20695fb91a93068f05bb6fd25 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,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.
@@ -37,6 +37,8 @@
 /* This file is completely threadsafe - keep it that way! */
 #include "gmxpre.h"
 
+#include "broadcaststructs.h"
+
 #include <string.h>
 
 #include "gromacs/gmxlib/network.h"
 #include "gromacs/topology/symtab.h"
 #include "gromacs/topology/topology.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/inmemoryserializer.h"
+#include "gromacs/utility/keyvaluetree.h"
+#include "gromacs/utility/keyvaluetreeserializer.h"
 #include "gromacs/utility/smalloc.h"
 
-#define   block_bc(cr,   d) gmx_bcast(     sizeof(d),     &(d), (cr))
-/* Probably the test for (nr) > 0 in the next macro is only needed
- * on BlueGene(/L), where IBM's MPI_Bcast will segfault after
- * dereferencing a null pointer, even when no data is to be transferred. */
-#define  nblock_bc(cr, nr, d) { if ((nr) > 0) {gmx_bcast((nr)*sizeof((d)[0]), (d), (cr)); }}
-#define    snew_bc(cr, d, nr) { if (!MASTER(cr)) {snew((d), (nr)); }}
-/* Dirty macro with bAlloc not as an argument */
-#define nblock_abc(cr, nr, d) { if (bAlloc) {snew((d), (nr)); } nblock_bc(cr, (nr), (d)); }
-
 static void bc_cstring(const t_commrec *cr, char **s)
 {
     int size = 0;
 
-    if (MASTER(cr) && *s != NULL)
+    if (MASTER(cr) && *s != nullptr)
     {
         /* Size of the char buffer is string length + 1 for '\0' */
         size = strlen(*s) + 1;
@@ -80,10 +76,10 @@ static void bc_cstring(const t_commrec *cr, char **s)
         }
         nblock_bc(cr, size, *s);
     }
-    else if (!MASTER(cr) && *s != NULL)
+    else if (!MASTER(cr) && *s != nullptr)
     {
         sfree(*s);
-        *s = NULL;
+        *s = nullptr;
     }
 }
 
@@ -248,7 +244,7 @@ static void bc_groups(const t_commrec *cr, t_symtab *symtab,
         block_bc(cr, n);
         if (n == 0)
         {
-            groups->grpnr[g] = NULL;
+            groups->grpnr[g] = nullptr;
         }
         else
         {
@@ -262,10 +258,18 @@ static void bc_groups(const t_commrec *cr, t_symtab *symtab,
     }
 }
 
+static void bcastPaddedRVecVector(const t_commrec *cr, PaddedRVecVector *v, unsigned int n)
+{
+    /* We need to allocate one element extra, since we might use
+     * (unaligned) 4-wide SIMD loads to access rvec entries.
+     */
+    (*v).resize(n + 1);
+    nblock_bc(cr, n, as_rvec_array(v->data()));
+}
+
 void bcast_state(const t_commrec *cr, t_state *state)
 {
     int      i, nnht, nnhtp;
-    gmx_bool bAlloc;
 
     if (!PAR(cr) || (cr->nnodes - cr->npmenodes <= 1))
     {
@@ -279,10 +283,6 @@ void bcast_state(const t_commrec *cr, t_state *state)
     block_bc(cr, state->nnhpres);
     block_bc(cr, state->nhchainlength);
     block_bc(cr, state->flags);
-    if (state->lambda == NULL)
-    {
-        snew_bc(cr, state->lambda, efptNR)
-    }
 
     if (cr->dd)
     {
@@ -295,21 +295,13 @@ void bcast_state(const t_commrec *cr, t_state *state)
     nnht  = (state->ngtc)*(state->nhchainlength);
     nnhtp = (state->nnhpres)*(state->nhchainlength);
 
-    /* We still need to allocate the arrays in state for non-master
-     * ranks, which is done (implicitly via bAlloc) in the dirty,
-     * dirty nblock_abc macro. */
-    bAlloc = !MASTER(cr);
-    if (bAlloc)
-    {
-        state->nalloc = state->natoms;
-    }
     for (i = 0; i < estNR; i++)
     {
         if (state->flags & (1<<i))
         {
             switch (i)
             {
-                case estLAMBDA:  nblock_bc(cr, efptNR, state->lambda); break;
+                case estLAMBDA:  nblock_bc(cr, efptNR, state->lambda.data()); break;
                 case estFEPSTATE: block_bc(cr, state->fep_state); break;
                 case estBOX:     block_bc(cr, state->box); break;
                 case estBOX_REL: block_bc(cr, state->box_rel); break;
@@ -317,25 +309,26 @@ void bcast_state(const t_commrec *cr, t_state *state)
                 case estPRES_PREV: block_bc(cr, state->pres_prev); break;
                 case estSVIR_PREV: block_bc(cr, state->svir_prev); break;
                 case estFVIR_PREV: block_bc(cr, state->fvir_prev); break;
-                case estNH_XI:   nblock_abc(cr, nnht, state->nosehoover_xi); break;
-                case estNH_VXI:  nblock_abc(cr, nnht, state->nosehoover_vxi); break;
-                case estNHPRES_XI:   nblock_abc(cr, nnhtp, state->nhpres_xi); break;
-                case estNHPRES_VXI:  nblock_abc(cr, nnhtp, state->nhpres_vxi); break;
-                case estTC_INT:  nblock_abc(cr, state->ngtc, state->therm_integral); break;
+                case estNH_XI:   nblock_abc(cr, nnht, &state->nosehoover_xi); break;
+                case estNH_VXI:  nblock_abc(cr, nnht, &state->nosehoover_vxi); break;
+                case estNHPRES_XI:   nblock_abc(cr, nnhtp, &state->nhpres_xi); break;
+                case estNHPRES_VXI:  nblock_abc(cr, nnhtp, &state->nhpres_vxi); break;
+                case estTHERM_INT: nblock_abc(cr, state->ngtc, &state->therm_integral); break;
+                case estBAROS_INT: block_bc(cr, state->baros_integral); break;
                 case estVETA:    block_bc(cr, state->veta); break;
                 case estVOL0:    block_bc(cr, state->vol0); break;
-                case estX:       nblock_abc(cr, state->natoms, state->x); break;
-                case estV:       nblock_abc(cr, state->natoms, state->v); break;
-                case estCGP:     nblock_abc(cr, state->natoms, state->cg_p); break;
+                case estX:       bcastPaddedRVecVector(cr, &state->x, state->natoms); break;
+                case estV:       bcastPaddedRVecVector(cr, &state->v, state->natoms); break;
+                case estCGP:     bcastPaddedRVecVector(cr, &state->cg_p, state->natoms); break;
                 case estDISRE_INITF: block_bc(cr, state->hist.disre_initf); break;
                 case estDISRE_RM3TAV:
                     block_bc(cr, state->hist.ndisrepairs);
-                    nblock_abc(cr, state->hist.ndisrepairs, state->hist.disre_rm3tav);
+                    nblock_abc(cr, state->hist.ndisrepairs, &state->hist.disre_rm3tav);
                     break;
                 case estORIRE_INITF: block_bc(cr, state->hist.orire_initf); break;
                 case estORIRE_DTAV:
                     block_bc(cr, state->hist.norire_Dtav);
-                    nblock_abc(cr, state->hist.norire_Dtav, state->hist.orire_Dtav);
+                    nblock_abc(cr, state->hist.norire_Dtav, &state->hist.orire_Dtav);
                     break;
                 default:
                     gmx_fatal(FARGS,
@@ -493,18 +486,6 @@ static void bc_grpopts(const t_commrec *cr, t_grpopts *g)
     }
 }
 
-static void bc_cosines(const t_commrec *cr, t_cosines *cs)
-{
-    block_bc(cr, cs->n);
-    snew_bc(cr, cs->a, cs->n);
-    snew_bc(cr, cs->phi, cs->n);
-    if (cs->n > 0)
-    {
-        nblock_bc(cr, cs->n, cs->a);
-        nblock_bc(cr, cs->n, cs->phi);
-    }
-}
-
 static void bc_pull_group(const t_commrec *cr, t_pull_group *pgrp)
 {
     block_bc(cr, *pgrp);
@@ -536,7 +517,7 @@ static void bc_pull(const t_commrec *cr, pull_params_t *pull)
     {
         if (!MASTER(cr))
         {
-            pull->coord[c].externalPotentialProvider = NULL;
+            pull->coord[c].externalPotentialProvider = nullptr;
         }
         if (pull->coord[c].eType == epullEXTERNAL)
         {
@@ -687,9 +668,33 @@ static void bc_swapions(const t_commrec *cr, t_swapcoords *swap)
 
 static void bc_inputrec(const t_commrec *cr, t_inputrec *inputrec)
 {
-    int      i;
-
+    // Note that this overwrites pointers in inputrec, so all pointer fields
+    // Must be initialized separately below.
     block_bc(cr, *inputrec);
+    if (SIMMASTER(cr))
+    {
+        gmx::InMemorySerializer serializer;
+        gmx::serializeKeyValueTree(*inputrec->params, &serializer);
+        std::vector<char>       buffer = serializer.finishAndGetBuffer();
+        size_t                  size   = buffer.size();
+        block_bc(cr, size);
+        nblock_bc(cr, size, buffer.data());
+    }
+    else
+    {
+        // block_bc() above overwrites the old pointer, so set it to a
+        // reasonable value in case code below throws.
+        // cppcheck-suppress redundantAssignment
+        inputrec->params = nullptr;
+        std::vector<char> buffer;
+        size_t            size;
+        block_bc(cr, size);
+        nblock_abc(cr, size, &buffer);
+        gmx::InMemoryDeserializer serializer(buffer);
+        // cppcheck-suppress redundantAssignment
+        inputrec->params = new gmx::KeyValueTreeObject(
+                    gmx::deserializeKeyValueTree(&serializer));
+    }
 
     bc_grpopts(cr, &(inputrec->opts));
 
@@ -727,11 +732,6 @@ static void bc_inputrec(const t_commrec *cr, t_inputrec *inputrec)
         snew_bc(cr, inputrec->imd, 1);
         bc_imd(cr, inputrec->imd);
     }
-    for (i = 0; (i < DIM); i++)
-    {
-        bc_cosines(cr, &(inputrec->ex[i]));
-        bc_cosines(cr, &(inputrec->et[i]));
-    }
     if (inputrec->eSwapCoords != eswapNO)
     {
         snew_bc(cr, inputrec->swap, 1);
@@ -756,16 +756,12 @@ static void bc_moltype(const t_commrec *cr, t_symtab *symtab,
 
 static void bc_molblock(const t_commrec *cr, gmx_molblock_t *molb)
 {
-    block_bc(cr, molb->type);
-    block_bc(cr, molb->nmol);
-    block_bc(cr, molb->natoms_mol);
-    block_bc(cr, molb->nposres_xA);
+    block_bc(cr, *molb);
     if (molb->nposres_xA > 0)
     {
         snew_bc(cr, molb->posres_xA, molb->nposres_xA);
         nblock_bc(cr, molb->nposres_xA*DIM, molb->posres_xA[0]);
     }
-    block_bc(cr, molb->nposres_xB);
     if (molb->nposres_xB > 0)
     {
         snew_bc(cr, molb->posres_xB, molb->nposres_xB);
diff --git a/src/gromacs/mdlib/broadcaststructs.h b/src/gromacs/mdlib/broadcaststructs.h
new file mode 100644 (file)
index 0000000..fa5503e
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+
+/*! \libinternal \file
+ *
+ * \brief Convenience wrappers for broadcasting structs.
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ *
+ * \inlibraryapi
+ * \ingroup module_mdlib
+ */
+#ifndef GMX_MDLIB_BROADCASTSTRUCTS_H
+#define GMX_MDLIB_BROADCASTSTRUCTS_H
+
+#include <vector>
+
+#include "gromacs/gmxlib/network.h"
+#include "gromacs/mdtypes/commrec.h"
+#include "gromacs/utility/smalloc.h"
+
+//! Convenience wrapper for gmx_bcast of a single value.
+template <typename T>
+void block_bc(const t_commrec *cr, T &data)
+{
+    gmx_bcast(sizeof(T), static_cast<void *>(&data), cr);
+}
+//! Convenience wrapper for gmx_bcast of a C-style array.
+template <typename T>
+void nblock_bc(const t_commrec *cr, int numElements, T *data)
+{
+    gmx_bcast(numElements * sizeof(T), static_cast<void *>(data), cr);
+}
+//! Convenience wrapper for allocation with snew of vectors that need allocation on non-master ranks.
+template <typename T>
+void snew_bc(const t_commrec *cr, T * &data, int numElements)
+{
+    if (!MASTER(cr))
+    {
+        snew(data, numElements);
+    }
+}
+//! Convenience wrapper for gmx_bcast of a C-style array which needs allocation on non-master ranks.
+template <typename T>
+static void nblock_abc(const t_commrec *cr, int numElements, T **v)
+{
+    snew_bc(cr, v, numElements);
+    nblock_bc(cr, numElements, *v);
+}
+//! Convenience wrapper for gmx_bcast of a std::vector which needs resizing on non-master ranks.
+template <typename T>
+static void nblock_abc(const t_commrec *cr, int numElements, std::vector<T> *v)
+{
+    if (!MASTER(cr))
+    {
+        v->resize(numElements);
+    }
+    gmx_bcast(numElements*sizeof(T), v->data(), cr);
+}
+
+#endif
index ae929e3d2f1c67c66e45713eff421b5ea05f77c8..5a5e8be919f43c1eaa54873ea28185d28863184a 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,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.
  */
 
 
-/* Struct for unique atom type for calculating the energy drift.
- * The atom displacement depends on mass and constraints.
- * The energy jump for given distance depend on LJ type and q.
- */
-typedef struct
-{
-    real     mass;     /* mass */
-    int      type;     /* type (used for LJ parameters) */
-    real     q;        /* charge */
-    gmx_bool bConstr;  /* constrained, if TRUE, use #DOF=2 iso 3 */
-    real     con_mass; /* mass of heaviest atom connected by constraints */
-    real     con_len;  /* constraint length to the heaviest atom */
-} atom_nonbonded_kinetic_prop_t;
-
 /* Struct for unique atom type for calculating the energy drift.
  * The atom displacement depends on mass and constraints.
  * The energy jump for given distance depend on LJ type and q.
@@ -121,8 +107,8 @@ typedef struct
     real  md3; // -V''' at the cutoff
 } pot_derivatives_t;
 
-void verletbuf_get_list_setup(gmx_bool gmx_unused     bSIMD,
-                              gmx_bool                bGPU,
+void verletbuf_get_list_setup(bool                    makeSimdPairList,
+                              bool                    makeGpuPairList,
                               verletbuf_list_setup_t *list_setup)
 {
     /* When calling this function we often don't know which kernel type we
@@ -133,9 +119,9 @@ void verletbuf_get_list_setup(gmx_bool gmx_unused     bSIMD,
      * of size 1, 2 or 4, so for 4x8 or 8x8 we use the estimate for 4x4.
      */
 
-    if (bGPU)
+    if (makeGpuPairList)
     {
-        /* The CUDA kernels split the j-clusters in two halves */
+        /* The GPU kernels split the j-clusters in two halves */
         list_setup->cluster_size_i = nbnxn_kernel_to_cluster_i_size(nbnxnk8x8x8_GPU);
         list_setup->cluster_size_j = nbnxn_kernel_to_cluster_j_size(nbnxnk8x8x8_GPU)/2;
     }
@@ -145,8 +131,7 @@ void verletbuf_get_list_setup(gmx_bool gmx_unused     bSIMD,
 
         kernel_type = nbnxnk4x4_PlainC;
 
-#if GMX_SIMD
-        if (bSIMD)
+        if (GMX_SIMD && makeSimdPairList)
         {
 #ifdef GMX_NBNXN_SIMD_2XNN
             /* We use the smallest cluster size to be on the safe side */
@@ -155,7 +140,6 @@ void verletbuf_get_list_setup(gmx_bool gmx_unused     bSIMD,
             kernel_type = nbnxnk4xN_SIMD_4xN;
 #endif
         }
-#endif
 
         list_setup->cluster_size_i = nbnxn_kernel_to_cluster_i_size(kernel_type);
         list_setup->cluster_size_j = nbnxn_kernel_to_cluster_j_size(kernel_type);
@@ -351,10 +335,10 @@ static void get_verlet_buffer_atomtypes(const gmx_mtop_t      *mtop,
     real                          *vsite_m;
     int                            n_nonlin_vsite_mol;
 
-    att  = NULL;
+    att  = nullptr;
     natt = 0;
 
-    if (n_nonlin_vsite != NULL)
+    if (n_nonlin_vsite != nullptr)
     {
         *n_nonlin_vsite = 0;
     }
@@ -420,7 +404,7 @@ static void get_verlet_buffer_atomtypes(const gmx_mtop_t      *mtop,
                          &mtop->ffparams,
                          vsite_m,
                          &n_nonlin_vsite_mol);
-        if (n_nonlin_vsite != NULL)
+        if (n_nonlin_vsite != nullptr)
         {
             *n_nonlin_vsite += nmol*n_nonlin_vsite_mol;
         }
@@ -479,69 +463,60 @@ static void get_verlet_buffer_atomtypes(const gmx_mtop_t      *mtop,
  * into account. If an atom has multiple constraints, this will result in
  * an overestimate of the displacement, which gives a larger drift and buffer.
  */
-static void constrained_atom_sigma2(real                                 kT_fac,
-                                    const atom_nonbonded_kinetic_prop_t *prop,
-                                    real                                *sigma2_2d,
-                                    real                                *sigma2_3d)
+void constrained_atom_sigma2(real                                 kT_fac,
+                             const atom_nonbonded_kinetic_prop_t *prop,
+                             real                                *sigma2_2d,
+                             real                                *sigma2_3d)
 {
-    real sigma2_rot;
-    real com_dist;
-    real sigma2_rel;
-    real scale;
-
     /* Here we decompose the motion of a constrained atom into two
      * components: rotation around the COM and translation of the COM.
      */
 
-    /* Determine the variance for the displacement of the rotational mode */
-    sigma2_rot = kT_fac/(prop->mass*(prop->mass + prop->con_mass)/prop->con_mass);
+    /* Determine the variance of the arc length for the two rotational DOFs */
+    real massFraction = prop->con_mass/(prop->mass + prop->con_mass);
+    real sigma2_rot   = kT_fac*massFraction/prop->mass;
 
     /* The distance from the atom to the COM, i.e. the rotational arm */
-    com_dist = prop->con_len*prop->con_mass/(prop->mass + prop->con_mass);
+    real comDistance  = prop->con_len*massFraction;
 
     /* The variance relative to the arm */
-    sigma2_rel = sigma2_rot/(com_dist*com_dist);
-    /* At 6 the scaling formula has slope 0,
-     * so we keep sigma2_2d constant after that.
+    real sigma2_rel   = sigma2_rot/gmx::square(comDistance);
+
+    /* For sigma2_rel << 1 we don't notice the rotational effect and
+     * we have a normal, Gaussian displacement distribution.
+     * For larger sigma2_rel the displacement is much less, in fact it can
+     * not exceed 2*comDistance. We can calculate MSD/arm^2 as:
+     *   integral_x=0-inf distance2(x) x/sigma2_rel exp(-x^2/(2 sigma2_rel)) dx
+     * where x is angular displacement and distance2(x) is the distance^2
+     * between points at angle 0 and x:
+     *   distance2(x) = (sin(x) - sin(0))^2 + (cos(x) - cos(0))^2
+     * The limiting value of this MSD is 2, which is also the value for
+     * a uniform rotation distribution that would be reached at long time.
+     * The maximum is 2.5695 at sigma2_rel = 4.5119.
+     * We approximate this integral with a rational polynomial with
+     * coefficients from a Taylor expansion. This approximation is an
+     * overestimate for all values of sigma2_rel. Its maximum value
+     * of 2.6491 is reached at sigma2_rel = sqrt(45/2) = 4.7434.
+     * We keep the approximation constant after that.
+     * We use this approximate MSD as the variance for a Gaussian distribution.
+     *
+     * NOTE: For any sensible buffer tolerance this will result in a (large)
+     * overestimate of the buffer size, since the Gaussian has a long tail,
+     * whereas the actual distribution can not reach values larger than 2.
      */
-    if (sigma2_rel < 6)
-    {
-        /* A constrained atom rotates around the atom it is constrained to.
-         * This results in a smaller linear displacement than for a free atom.
-         * For a perfectly circular displacement, this lowers the displacement
-         * by: 1/arcsin(arc_length)
-         * and arcsin(x) = 1 + x^2/6 + ...
-         * For sigma2_rel<<1 the displacement distribution is erfc
-         * (exact formula is provided below). For larger sigma, it is clear
-         * that the displacement can't be larger than 2*com_dist.
-         * It turns out that the distribution becomes nearly uniform.
-         * For intermediate sigma2_rel, scaling down sigma with the third
-         * order expansion of arcsin with argument sigma_rel turns out
-         * to give a very good approximation of the distribution and variance.
-         * Even for larger values, the variance is only slightly overestimated.
-         * Note that the most relevant displacements are in the long tail.
-         * This rotation approximation always overestimates the tail (which
-         * runs to infinity, whereas it should be <= 2*com_dist).
-         * Thus we always overestimate the drift and the buffer size.
-         */
-        scale      = 1/(1 + sigma2_rel/6);
-        *sigma2_2d = sigma2_rot*scale*scale;
-    }
-    else
-    {
-        /* sigma_2d is set to the maximum given by the scaling above.
-         * For large sigma2 the real displacement distribution is close
-         * to uniform over -2*con_len to 2*com_dist.
-         * Our erfc with sigma_2d=sqrt(1.5)*com_dist (which means the sigma
-         * of the erfc output distribution is con_dist) overestimates
-         * the variance and additionally has a long tail. This means
-         * we have a (safe) overestimation of the drift.
-         */
-        *sigma2_2d = 1.5*com_dist*com_dist;
-    }
+    /* Coeffients obtained from a Taylor expansion */
+    const real a = 1.0/3.0;
+    const real b = 2.0/45.0;
+
+    /* Our approximation is constant after sigma2_rel = 1/sqrt(b) */
+    sigma2_rel   = std::min(sigma2_rel, 1/std::sqrt(b));
+
+    /* Compute the approximate sigma^2 for 2D motion due to the rotation */
+    *sigma2_2d   = gmx::square(comDistance)*
+        sigma2_rel/(1 + a*sigma2_rel + b*gmx::square(sigma2_rel));
 
     /* The constrained atom also moves (in 3D) with the COM of both atoms */
-    *sigma2_3d = kT_fac/(prop->mass + prop->con_mass);
+    *sigma2_3d   = kT_fac/(prop->mass + prop->con_mass);
 }
 
 static void get_atom_sigma2(real                                 kT_fac,
@@ -821,6 +796,8 @@ static real md3_force_switch(real p, real rswitch, real rc)
 
 void calc_verlet_buffer_size(const gmx_mtop_t *mtop, real boxvol,
                              const t_inputrec *ir,
+                             int               nstlist,
+                             int               list_lifetime,
                              real reference_temperature,
                              const verletbuf_list_setup_t *list_setup,
                              int *n_nonlin_vsite,
@@ -832,7 +809,7 @@ void calc_verlet_buffer_size(const gmx_mtop_t *mtop, real boxvol,
     real                  particle_distance;
     real                  nb_clust_frac_pairs_not_in_list_at_cutoff;
 
-    verletbuf_atomtype_t *att  = NULL;
+    verletbuf_atomtype_t *att  = nullptr;
     int                   natt = -1, i;
     real                  elfac;
     real                  kT_fac, mass_min;
@@ -876,7 +853,7 @@ void calc_verlet_buffer_size(const gmx_mtop_t *mtop, real boxvol,
     resolution = 0.001;
 
     env = getenv("GMX_VERLET_BUFFER_RES");
-    if (env != NULL)
+    if (env != nullptr)
     {
         sscanf(env, "%lf", &resolution);
     }
@@ -1024,7 +1001,7 @@ void calc_verlet_buffer_size(const gmx_mtop_t *mtop, real boxvol,
     }
 
     /* Determine the variance of the atomic displacement
-     * over nstlist-1 steps: kT_fac
+     * over list_lifetime steps: kT_fac
      * For inertial dynamics (not Brownian dynamics) the mass factor
      * is not included in kT_fac, it is added later.
      */
@@ -1035,7 +1012,7 @@ void calc_verlet_buffer_size(const gmx_mtop_t *mtop, real boxvol,
          * should be negligible (unless nstlist is extremely large, which
          * you wouldn't do anyhow).
          */
-        kT_fac = 2*BOLTZ*reference_temperature*(ir->nstlist-1)*ir->delta_t;
+        kT_fac = 2*BOLTZ*reference_temperature*list_lifetime*ir->delta_t;
         if (ir->bd_fric > 0)
         {
             /* This is directly sigma^2 of the displacement */
@@ -1066,7 +1043,7 @@ void calc_verlet_buffer_size(const gmx_mtop_t *mtop, real boxvol,
     }
     else
     {
-        kT_fac = BOLTZ*reference_temperature*gmx::square((ir->nstlist-1)*ir->delta_t);
+        kT_fac = BOLTZ*reference_temperature*gmx::square(list_lifetime*ir->delta_t);
     }
 
     mass_min = att[0].prop.mass;
@@ -1116,7 +1093,7 @@ void calc_verlet_buffer_size(const gmx_mtop_t *mtop, real boxvol,
         drift *= nb_clust_frac_pairs_not_in_list_at_cutoff;
 
         /* Convert the drift to drift per unit time per atom */
-        drift /= ir->nstlist*ir->delta_t*mtop->natoms;
+        drift /= nstlist*ir->delta_t*mtop->natoms;
 
         if (debug)
         {
index 5ceccb84049354ec8082346a48fba30de2331f8f..c494e137ec90a0efd78d9801edf0d2185f50f8d9 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,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.
@@ -67,17 +67,20 @@ static const real verlet_buffer_ratio_NVE_T0     = 0.10;
 /* Sets the pair-list setup assumed for the current Gromacs configuration.
  * The setup with smallest cluster sizes is return, such that the Verlet
  * buffer size estimated with this setup will be conservative.
- * bSIMD tells if to take into account SIMD, when supported.
- * bGPU tells to estimate for GPU kernels (bSIMD is ignored with bGPU=TRUE)
+ * makeSimdPairList tells if to take into account SIMD, when supported.
+ * makeGpuPairList tells to estimate for GPU kernels (makeSimdPairList is ignored with makeGpuPairList==true)
  */
-void verletbuf_get_list_setup(gmx_bool                bSIMD,
-                              gmx_bool                bGPU,
+void verletbuf_get_list_setup(bool                    makeSimdPairList,
+                              bool                    makeGpuPairList,
                               verletbuf_list_setup_t *list_setup);
 
 
 /* Calculate the non-bonded pair-list buffer size for the Verlet list
  * based on the particle masses, temperature, LJ types, charges
  * and constraints as well as the non-bonded force behavior at the cut-off.
+ * The pair list update frequency and the list lifetime, which is nstlist-1
+ * for normal pair-list buffering, are passed separately, as in some cases
+ * we want an estimate for different values than the ones set in the inputrec.
  * If reference_temperature < 0, the maximum coupling temperature will be used.
  * The target is a maximum energy drift of ir->verletbuf_tol.
  * Returns the number of non-linear virtual sites. For these it's difficult
@@ -86,11 +89,41 @@ void verletbuf_get_list_setup(gmx_bool                bSIMD,
  */
 void calc_verlet_buffer_size(const gmx_mtop_t *mtop, real boxvol,
                              const t_inputrec *ir,
+                             int               nstlist,
+                             int               list_lifetime,
                              real reference_temperature,
                              const verletbuf_list_setup_t *list_setup,
                              int *n_nonlin_vsite,
                              real *rlist);
 
+/* Struct for unique atom type for calculating the energy drift.
+ * The atom displacement depends on mass and constraints.
+ * The energy jump for given distance depend on LJ type and q.
+ */
+struct atom_nonbonded_kinetic_prop_t
+{
+    real     mass;     /* mass */
+    int      type;     /* type (used for LJ parameters) */
+    real     q;        /* charge */
+    gmx_bool bConstr;  /* constrained, if TRUE, use #DOF=2 iso 3 */
+    real     con_mass; /* mass of heaviest atom connected by constraints */
+    real     con_len;  /* constraint length to the heaviest atom */
+};
+
+/* This function computes two components of the estimate of the variance
+ * in the displacement of one atom in a system of two constrained atoms.
+ * Returns in sigma2_2d the variance due to rotation of the constrained
+ * atom around the atom to which it constrained.
+ * Returns in sigma2_3d the variance due to displacement of the COM
+ * of the whole system of the two constrained atoms.
+ *
+ * Only exposed here for testing purposes.
+ */
+void constrained_atom_sigma2(real                                 kT_fac,
+                             const atom_nonbonded_kinetic_prop_t *prop,
+                             real                                *sigma2_2d,
+                             real                                *sigma2_3d);
+
 #ifdef __cplusplus
 }
 #endif
index 7a47c46910dfe2874b0a48de03c9e3b1c2ceb024..7a0d823b96be4757fb6a27ea86d2c469ed202a47 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,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.
@@ -293,7 +293,7 @@ static void lincs_update_atoms_noind(int ncons, const int *bla,
     int  b, i, j;
     real mvb, im1, im2, tmp0, tmp1, tmp2;
 
-    if (invmass != NULL)
+    if (invmass != nullptr)
     {
         for (b = 0; b < ncons; b++)
         {
@@ -342,7 +342,7 @@ static void lincs_update_atoms_ind(int ncons, const int *ind, const int *bla,
     int  bi, b, i, j;
     real mvb, im1, im2, tmp0, tmp1, tmp2;
 
-    if (invmass != NULL)
+    if (invmass != nullptr)
     {
         for (bi = 0; bi < ncons; bi++)
         {
@@ -637,7 +637,7 @@ static void do_lincsp(rvec *x, rvec *f, rvec *fp, t_pbc *pbc,
      * so we pass invmass=NULL, which results in the use of 1 for all atoms.
      */
     lincs_update_atoms(lincsd, th, 1.0, sol, r,
-                       (econq != econqForce) ? invmass : NULL, fp);
+                       (econq != econqForce) ? invmass : nullptr, fp);
 
     if (bCalcDHDL)
     {
@@ -753,17 +753,18 @@ calc_dr_x_xp_simd(int                       b0,
 #endif // GMX_SIMD_HAVE_REAL
 
 /* Determine the distances and right-hand side for the next iteration */
-static void calc_dist_iter(int                       b0,
-                           int                       b1,
-                           const int *               bla,
-                           const rvec * gmx_restrict xp,
-                           const real * gmx_restrict bllen,
-                           const real * gmx_restrict blc,
-                           const t_pbc *             pbc,
-                           real                      wfac,
-                           real * gmx_restrict       rhs,
-                           real * gmx_restrict       sol,
-                           gmx_bool *                bWarn)
+gmx_unused static void calc_dist_iter(
+        int                       b0,
+        int                       b1,
+        const int *               bla,
+        const rvec * gmx_restrict xp,
+        const real * gmx_restrict bllen,
+        const real * gmx_restrict blc,
+        const t_pbc *             pbc,
+        real                      wfac,
+        real * gmx_restrict       rhs,
+        real * gmx_restrict       sol,
+        gmx_bool *                bWarn)
 {
     int b;
 
@@ -1042,7 +1043,7 @@ static void do_lincs(rvec *x, rvec *xp, matrix box, t_pbc *pbc,
                 /* Communicate the corrected non-local coordinates */
                 if (DOMAINDECOMP(cr))
                 {
-                    dd_move_x_constraints(cr->dd, box, xp, NULL, FALSE);
+                    dd_move_x_constraints(cr->dd, box, xp, nullptr, FALSE);
                 }
             }
 #pragma omp barrier
@@ -1089,14 +1090,14 @@ static void do_lincs(rvec *x, rvec *xp, matrix box, t_pbc *pbc,
     }
     /* nit*ncons*(37+9*nrec) flops */
 
-    if (v != NULL)
+    if (v != nullptr)
     {
         /* Update the velocities */
         lincs_update_atoms(lincsd, th, invdt, mlambda, r, invmass, v);
         /* 16 ncons flops */
     }
 
-    if (nlocat != NULL && (bCalcDHDL || bCalcVir))
+    if (nlocat != nullptr && (bCalcDHDL || bCalcVir))
     {
         if (lincsd->bTaskDep)
         {
@@ -1253,7 +1254,7 @@ static void set_lincs_matrix_task(struct gmx_lincsdata *li,
 }
 
 /* Sets the elements in the LINCS matrix */
-void set_lincs_matrix(struct gmx_lincsdata *li, real *invmass, real lambda)
+static void set_lincs_matrix(struct gmx_lincsdata *li, real *invmass, real lambda)
 {
     int        i;
     const real invsqrt2 = 0.7071067811865475244;
@@ -2153,7 +2154,7 @@ void set_lincs(const t_idef         *idef,
 
     done_blocka(&at2con);
 
-    if (cr->dd == NULL)
+    if (cr->dd == nullptr)
     {
         /* Since the matrix is static, we should free some memory */
         li->ncc_alloc = li->ncc;
@@ -2167,7 +2168,7 @@ void set_lincs(const t_idef         *idef,
         srenew(li->tmpncc, li->ncc_alloc);
     }
 
-    if (DOMAINDECOMP(cr) && dd_constraints_nlocalatoms(cr->dd) != NULL)
+    if (DOMAINDECOMP(cr) && dd_constraints_nlocalatoms(cr->dd) != nullptr)
     {
         int *nlocat_dd;
 
@@ -2181,7 +2182,7 @@ void set_lincs(const t_idef         *idef,
     }
     else
     {
-        li->nlocat = NULL;
+        li->nlocat = nullptr;
     }
 
     if (debug)
@@ -2297,12 +2298,12 @@ static void cconerr(const struct gmx_lincsdata *lincsd,
             r2  = norm2(dx);
             len = r2*gmx::invsqrt(r2);
             d   = std::abs(len/bllen[b]-1);
-            if (d > ma && (nlocat == NULL || nlocat[b]))
+            if (d > ma && (nlocat == nullptr || nlocat[b]))
             {
                 ma = d;
                 im = b;
             }
-            if (nlocat == NULL)
+            if (nlocat == nullptr)
             {
                 ssd2 += d*d;
                 count++;
@@ -2348,9 +2349,9 @@ gmx_bool constrain_lincs(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
      * We can also easily check if any constraint length is changed,
      * if not dH/dlambda=0 and we can also set the boolean to FALSE.
      */
-    bCalcDHDL = (ir->efep != efepNO && dvdlambda != NULL);
+    bCalcDHDL = (ir->efep != efepNO && dvdlambda != nullptr);
 
-    if (lincsd->nc == 0 && cr->dd == NULL)
+    if (lincsd->nc == 0 && cr->dd == nullptr)
     {
         if (bLog || bEner)
         {
@@ -2382,7 +2383,7 @@ gmx_bool constrain_lincs(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
         if (lincsd->ncg_flex)
         {
             /* Set the flexible constraint lengths to the old lengths */
-            if (pbc != NULL)
+            if (pbc != nullptr)
             {
                 for (i = 0; i < lincsd->nc; i++)
                 {
index acbcf6db6d8b065a133ec818c3642de363904cf1..f3df0b4f2e384ed810dd7318908d590230ef1834 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, by the GROMACS development team, led by
+ * 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.
@@ -75,7 +75,7 @@ double compute_io(t_inputrec *ir, int natoms, gmx_groups_t *groups,
     {
         for (i = 0; i < natoms; i++)
         {
-            if (groups->grpnr[egcCompressedX] == NULL || groups->grpnr[egcCompressedX][i] == 0)
+            if (groups->grpnr[egcCompressedX] == nullptr || groups->grpnr[egcCompressedX][i] == 0)
             {
                 nxtcatoms++;
             }
@@ -145,7 +145,7 @@ double compute_io(t_inputrec *ir, int natoms, gmx_groups_t *groups,
             }
         }
     }
-    if (ir->pull != NULL)
+    if (ir->pull != nullptr)
     {
         cio += div_nsteps(nsteps, ir->pull->nstxout)*20; /* roughly 20 chars per line */
         cio += div_nsteps(nsteps, ir->pull->nstfout)*20; /* roughly 20 chars per line */
index 8b9e70309bf2d098b28a440f54957923dd3654a7..452c156ff02f4b184f7e5fc745d65eab1add2513 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,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.
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/mdtypes/state.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/pulling/pull.h"
 #include "gromacs/topology/block.h"
 #include "gromacs/topology/invblock.h"
+#include "gromacs/topology/mtop_lookup.h"
 #include "gromacs/topology/mtop_util.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
@@ -183,9 +185,9 @@ static void write_constr_pdb(const char *fn, const char *title,
     FILE         *out;
     int           dd_ac0 = 0, dd_ac1 = 0, i, ii, resnr;
     gmx_domdec_t *dd;
-    char         *anm, *resnm;
+    const char   *anm, *resnm;
 
-    dd = NULL;
+    dd = nullptr;
     if (DOMAINDECOMP(cr))
     {
         dd = cr->dd;
@@ -207,9 +209,10 @@ static void write_constr_pdb(const char *fn, const char *title,
 
     fprintf(out, "TITLE     %s\n", title);
     gmx_write_pdb_box(out, -1, box);
+    int molb = 0;
     for (i = start; i < start+homenr; i++)
     {
-        if (dd != NULL)
+        if (dd != nullptr)
         {
             if (i >= dd->nat_home && i < dd_ac0)
             {
@@ -221,7 +224,7 @@ static void write_constr_pdb(const char *fn, const char *title,
         {
             ii = i;
         }
-        gmx_mtop_atominfo_global(mtop, ii, &anm, &resnr, &resnm);
+        mtopGetAtomAndResidueName(mtop, ii, &molb, &anm, &resnr, &resnm, nullptr);
         gmx_fprintf_pdb_atomline(out, epdbATOM, ii+1, anm, ' ', resnm, ' ', resnr, ' ',
                                  10*x[i][XX], 10*x[i][YY], 10*x[i][ZZ], 1.0, 0.0, "");
     }
@@ -324,7 +327,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
         lambda += delta_step*ir->fepvals->delta_lambda;
     }
 
-    if (vir != NULL)
+    if (vir != nullptr)
     {
         clear_mat(vir_r_m_dr);
     }
@@ -349,7 +352,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
      * For constraints there is both forward and backward communication.
      */
     if (ir->ePBC != epbcNONE &&
-        (cr->dd || bMolPBC) && !(cr->dd && cr->dd->constraint_comm == NULL))
+        (cr->dd || bMolPBC) && !(cr->dd && cr->dd->constraint_comm == nullptr))
     {
         /* With pbc=screw the screw has been changed to a shift
          * by the constraint coordinate communication routine,
@@ -361,7 +364,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
     }
     else
     {
-        pbc_null = NULL;
+        pbc_null = nullptr;
     }
 
     /* Communicate the coordinates required for the non-local constraints
@@ -371,7 +374,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
     {
         dd_move_x_constraints(cr->dd, box, x, xprime, econq == econqCoord);
 
-        if (v != NULL)
+        if (v != nullptr)
         {
             /* We need to initialize the non-local components of v.
              * We never actually use these values, but we do increment them,
@@ -381,17 +384,17 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
         }
     }
 
-    if (constr->lincsd != NULL)
+    if (constr->lincsd != nullptr)
     {
         bOK = constrain_lincs(fplog, bLog, bEner, ir, step, constr->lincsd, md, cr,
                               x, xprime, min_proj,
                               box, pbc_null, lambda, dvdlambda,
-                              invdt, v, vir != NULL, vir_r_m_dr,
+                              invdt, v, vir != nullptr, vir_r_m_dr,
                               econq, nrnb,
                               constr->maxwarn, &constr->warncount_lincs);
         if (!bOK && constr->maxwarn < INT_MAX)
         {
-            if (fplog != NULL)
+            if (fplog != nullptr)
             {
                 fprintf(fplog, "Constraint error in algorithm %s at step %s\n",
                         econstr_names[econtLINCS], gmx_step_str(step, buf));
@@ -409,7 +412,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
                               md->invmass, constr->nblocks, constr->sblock,
                               idef, ir, x, xprime, nrnb,
                               constr->lagr, lambda, dvdlambda,
-                              invdt, v, vir != NULL, vir_r_m_dr,
+                              invdt, v, vir != nullptr, vir_r_m_dr,
                               constr->maxwarn < INT_MAX, econq);
                 break;
             case (econqVeloc):
@@ -417,7 +420,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
                               md->invmass, constr->nblocks, constr->sblock,
                               idef, ir, x, min_proj, nrnb,
                               constr->lagr, lambda, dvdlambda,
-                              invdt, NULL, vir != NULL, vir_r_m_dr,
+                              invdt, nullptr, vir != nullptr, vir_r_m_dr,
                               constr->maxwarn < INT_MAX, econq);
                 break;
             default:
@@ -427,7 +430,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
 
         if (!bOK && constr->maxwarn < INT_MAX)
         {
-            if (fplog != NULL)
+            if (fplog != nullptr)
             {
                 fprintf(fplog, "Constraint error in algorithm %s at step %s\n",
                         econstr_names[econtSHAKE], gmx_step_str(step, buf));
@@ -457,19 +460,19 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
                                 nth, th,
                                 pbc_null,
                                 x[0], xprime[0],
-                                invdt, v ? v[0] : NULL,
-                                vir != NULL,
+                                invdt, v ? v[0] : nullptr,
+                                vir != nullptr,
                                 th == 0 ? vir_r_m_dr : constr->vir_r_m_dr_th[th],
                                 th == 0 ? &bSettleErrorHasOccurred : &constr->bSettleErrorHasOccurred[th]);
                     }
                     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
                 }
                 inc_nrnb(nrnb, eNR_SETTLE, nsettle);
-                if (v != NULL)
+                if (v != nullptr)
                 {
                     inc_nrnb(nrnb, eNR_CONSTR_V, nsettle*3);
                 }
-                if (vir != NULL)
+                if (vir != nullptr)
                 {
                     inc_nrnb(nrnb, eNR_CONSTR_VIR, nsettle*3);
                 }
@@ -485,7 +488,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
                     {
                         int calcvir_atom_end;
 
-                        if (vir == NULL)
+                        if (vir == nullptr)
                         {
                             calcvir_atom_end = 0;
                         }
@@ -525,7 +528,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
                 gmx_incons("Unknown constraint quantity for settle");
         }
 
-        if (vir != NULL)
+        if (vir != nullptr)
         {
             /* Reduce the virial contributions over the threads */
             for (int th = 1; th < nth; th++)
@@ -565,7 +568,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
         }
     }
 
-    if (vir != NULL)
+    if (vir != nullptr)
     {
         /* The normal uses of constrain() pass step_scaling = 1.0.
          * The call to constrain() for SD1 that passes step_scaling =
@@ -626,7 +629,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
         }
         if (constr->ed && delta_step > 0)
         {
-            /* apply the essential dynamcs constraints here */
+            /* apply the essential dynamics constraints here */
             do_edsam(ir, step, cr, xprime, v, box, constr->ed);
         }
     }
@@ -642,7 +645,7 @@ real *constr_rmsd_data(struct gmx_constr *constr)
     }
     else
     {
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -674,7 +677,7 @@ static void make_shake_sblock_serial(struct gmx_constr *constr,
     ncons = idef->il[F_CONSTR].nr/3;
 
     init_blocka(&sblocks);
-    gen_sblocks(NULL, 0, md->homenr, idef, &sblocks, FALSE);
+    gen_sblocks(nullptr, 0, md->homenr, idef, &sblocks, FALSE);
 
     /*
        bstart=(idef->nodeid > 0) ? blocks->multinr[idef->nodeid-1] : 0;
@@ -1145,7 +1148,7 @@ real constr_r_max(FILE *fplog, const gmx_mtop_t *mtop, const t_inputrec *ir)
 
 gmx_constr_t init_constraints(FILE *fplog,
                               const gmx_mtop_t *mtop, const t_inputrec *ir,
-                              gmx_edsam_t ed, t_state *state,
+                              bool doEssentialDynamics,
                               t_commrec *cr)
 {
     int nconstraints =
@@ -1154,13 +1157,13 @@ gmx_constr_t init_constraints(FILE *fplog,
     int nsettles =
         gmx_mtop_ftype_count(mtop, F_SETTLE);
 
-    GMX_RELEASE_ASSERT(!ir->bPull || ir->pull_work != NULL, "init_constraints called with COM pulling before/without initializing the pull code");
+    GMX_RELEASE_ASSERT(!ir->bPull || ir->pull_work != nullptr, "init_constraints called with COM pulling before/without initializing the pull code");
 
     if (nconstraints + nsettles == 0 &&
         !(ir->bPull && pull_have_constraint(ir->pull_work)) &&
-        ed == NULL)
+        !doEssentialDynamics)
     {
-        return NULL;
+        return nullptr;
     }
 
     struct gmx_constr *constr;
@@ -1259,7 +1262,7 @@ gmx_constr_t init_constraints(FILE *fplog,
 
         /* Allocate thread-local work arrays */
         int nthreads = gmx_omp_nthreads_get(emntSETTLE);
-        if (nthreads > 1 && constr->vir_r_m_dr_th == NULL)
+        if (nthreads > 1 && constr->vir_r_m_dr_th == nullptr)
         {
             snew(constr->vir_r_m_dr_th, nthreads);
             snew(constr->bSettleErrorHasOccurred, nthreads);
@@ -1297,19 +1300,17 @@ gmx_constr_t init_constraints(FILE *fplog,
     constr->warncount_lincs  = 0;
     constr->warncount_settle = 0;
 
-    /* Initialize the essential dynamics sampling.
-     * Put the pointer to the ED struct in constr */
-    constr->ed = ed;
-    if (ed != NULL || state->edsamstate.nED > 0)
-    {
-        init_edsam(mtop, ir, cr, ed, state->x, state->box, &state->edsamstate);
-    }
-
-    constr->warn_mtop = mtop;
+    constr->warn_mtop        = mtop;
 
     return constr;
 }
 
+/* Put a pointer to the essential dynamics constraints into the constr struct */
+void saveEdsamPointer(gmx_constr_t constr, gmx_edsam_t ed)
+{
+    constr->ed = ed;
+}
+
 const t_blocka *atom2constraints_moltype(gmx_constr_t constr)
 {
     return constr->at2con_mt;
index 50c9a1b463fbc85c60d0ed59f4c9475f1ba1bdfb..fb3c8e8e4f68e465850dd7124a32ae5098982e02 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,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.
@@ -38,7 +38,6 @@
 #ifndef GMX_MBLIB_CONSTR_H
 #define GMX_MBLIB_CONSTR_H
 
-#include "gromacs/essentialdynamics/edsam.h"
 #include "gromacs/gmxlib/nrnb.h"
 #include "gromacs/topology/idef.h"
 #include "gromacs/topology/ifunc.h"
@@ -64,7 +63,7 @@ extern "C" {
 #endif
 
 struct t_pbc;
-struct t_state;
+class t_state;
 
 enum
 {
@@ -118,6 +117,8 @@ gmx_bool bshakef(FILE           *log,          /* Log file                  */
 gmx_settledata_t settle_init(const gmx_mtop_t *mtop);
 /* Initializes and returns a structure with SETTLE parameters */
 
+void settle_free(gmx_settledata_t settled);
+
 void settle_set_constraints(gmx_settledata_t  settled,
                             const t_ilist    *il_settle,
                             const t_mdatoms  *mdatoms);
@@ -204,10 +205,14 @@ gmx_bool constrain(FILE *log, gmx_bool bLog, gmx_bool bEner,
 
 gmx_constr_t init_constraints(FILE *log,
                               const gmx_mtop_t *mtop, const t_inputrec *ir,
-                              gmx_edsam_t ed, t_state *state,
+                              bool doEssentialDynamics,
                               struct t_commrec *cr);
 /* Initialize constraints stuff */
 
+void saveEdsamPointer(gmx_constr_t      constr,
+                      struct gmx_edsam *ed);
+/* Put a pointer to the essential dynamics constraints into the constr struct */
+
 void set_constraints(gmx_constr_t             constr,
                      gmx_localtop_t          *top,
                      const t_inputrec        *ir,
index abafb2b8b050576fceadd4c939dbdae57904b9ff..d44687058e5d16a48e79e3bb0961bb5626ec77ea 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,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.
 #include "gromacs/math/units.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/math/vecdump.h"
+#include "gromacs/mdlib/expanded.h"
 #include "gromacs/mdlib/gmx_omp_nthreads.h"
-#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/sim_util.h"
 #include "gromacs/mdlib/update.h"
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/group.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/mdtypes/state.h"
 #include "gromacs/pbcutil/boxutilities.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/random/gammadistribution.h"
@@ -82,11 +83,11 @@ static const double  sy_const_3[] = { 0.828981543588751, -0.657963087177502, 0.8
 static const double  sy_const_5[] = { 0.2967324292201065, 0.2967324292201065, -0.186929716880426, 0.2967324292201065, 0.2967324292201065 };
 
 static const double* sy_const[] = {
-    NULL,
+    nullptr,
     sy_const_1,
-    NULL,
+    nullptr,
     sy_const_3,
-    NULL,
+    nullptr,
     sy_const_5
 };
 
@@ -125,7 +126,7 @@ static void NHC_trotter(t_grpopts *opts, int nvar, gmx_ekindata_t *ekind, real d
 /* if scalefac is NULL, we are doing the NHC of the barostat */
 
     bBarostat = FALSE;
-    if (scalefac == NULL)
+    if (scalefac == nullptr)
     {
         bBarostat = TRUE;
     }
@@ -342,8 +343,27 @@ real calc_temp(real ekin, real nrdf)
     }
 }
 
+/*! \brief Sets 1/mass for Parrinello-Rahman in wInv; NOTE: PRESFAC is not included, so not in GROMACS units! */
+static void calcParrinelloRahmanInvMass(const t_inputrec *ir, const matrix box,
+                                        tensor wInv)
+{
+    real maxBoxLength;
+
+    /* TODO: See if we can make the mass independent of the box size */
+    maxBoxLength = std::max(box[XX][XX], box[YY][YY]);
+    maxBoxLength = std::max(maxBoxLength, box[ZZ][ZZ]);
+
+    for (int d = 0; d < DIM; d++)
+    {
+        for (int n = 0; n < DIM; n++)
+        {
+            wInv[d][n] = (4*M_PI*M_PI*ir->compress[d][n])/(3*ir->tau_p*ir->tau_p*maxBoxLength);
+        }
+    }
+}
+
 void parrinellorahman_pcoupl(FILE *fplog, gmx_int64_t step,
-                             t_inputrec *ir, real dt, tensor pres,
+                             const t_inputrec *ir, real dt, const tensor pres,
                              tensor box, tensor box_rel, tensor boxv,
                              tensor M, matrix mu, gmx_bool bFirstStep)
 {
@@ -372,14 +392,10 @@ void parrinellorahman_pcoupl(FILE *fplog, gmx_int64_t step,
      *   b = vol/W inv(box') * (P-ref_P)     (=h')
      */
 
-    int    d, n;
-    tensor winv;
     real   vol = box[XX][XX]*box[YY][YY]*box[ZZ][ZZ];
-    real   atot, arel, change, maxchange, xy_pressure;
+    real   atot, arel, change;
     tensor invbox, pdiff, t1, t2;
 
-    real   maxl;
-
     gmx::invertBoxMatrix(box, invbox);
 
     if (!bFirstStep)
@@ -388,16 +404,8 @@ void parrinellorahman_pcoupl(FILE *fplog, gmx_int64_t step,
          * The pressure and compressibility always occur as a product,
          * therefore the pressure unit drops out.
          */
-        maxl = std::max(box[XX][XX], box[YY][YY]);
-        maxl = std::max(maxl, box[ZZ][ZZ]);
-        for (d = 0; d < DIM; d++)
-        {
-            for (n = 0; n < DIM; n++)
-            {
-                winv[d][n] =
-                    (4*M_PI*M_PI*ir->compress[d][n])/(3*ir->tau_p*ir->tau_p*maxl);
-            }
-        }
+        tensor winv;
+        calcParrinelloRahmanInvMass(ir, box, winv);
 
         m_sub(pres, ir->ref_p, pdiff);
 
@@ -407,8 +415,8 @@ void parrinellorahman_pcoupl(FILE *fplog, gmx_int64_t step,
              * pressure correction here? On the other hand we don't scale the
              * box momentarily, but change accelerations, so it might not be crucial.
              */
-            xy_pressure = 0.5*(pres[XX][XX]+pres[YY][YY]);
-            for (d = 0; d < ZZ; d++)
+            real xy_pressure = 0.5*(pres[XX][XX]+pres[YY][YY]);
+            for (int d = 0; d < ZZ; d++)
             {
                 pdiff[d][d] = (xy_pressure-(pres[ZZ][ZZ]-ir->ref_p[d][d]/box[d][d]));
             }
@@ -418,9 +426,9 @@ void parrinellorahman_pcoupl(FILE *fplog, gmx_int64_t step,
         /* Move the off-diagonal elements of the 'force' to one side to ensure
          * that we obey the box constraints.
          */
-        for (d = 0; d < DIM; d++)
+        for (int d = 0; d < DIM; d++)
         {
-            for (n = 0; n < d; n++)
+            for (int n = 0; n < d; n++)
             {
                 t1[d][n] += t1[n][d];
                 t1[n][d]  = 0;
@@ -430,9 +438,9 @@ void parrinellorahman_pcoupl(FILE *fplog, gmx_int64_t step,
         switch (ir->epct)
         {
             case epctANISOTROPIC:
-                for (d = 0; d < DIM; d++)
+                for (int d = 0; d < DIM; d++)
                 {
-                    for (n = 0; n <= d; n++)
+                    for (int n = 0; n <= d; n++)
                     {
                         t1[d][n] *= winv[d][n]*vol;
                     }
@@ -446,9 +454,9 @@ void parrinellorahman_pcoupl(FILE *fplog, gmx_int64_t step,
                 arel = atot/(3*vol);
                 /* set all RELATIVE box accelerations equal, and maintain total V
                  * change speed */
-                for (d = 0; d < DIM; d++)
+                for (int d = 0; d < DIM; d++)
                 {
-                    for (n = 0; n <= d; n++)
+                    for (int n = 0; n <= d; n++)
                     {
                         t1[d][n] = winv[0][0]*vol*arel*box[d][n];
                     }
@@ -463,16 +471,16 @@ void parrinellorahman_pcoupl(FILE *fplog, gmx_int64_t step,
                 arel = atot/(2*box[XX][XX]*box[YY][YY]);
                 /* set RELATIVE XY box accelerations equal, and maintain total V
                  * change speed. Dont change the third box vector accelerations */
-                for (d = 0; d < ZZ; d++)
+                for (int d = 0; d < ZZ; d++)
                 {
-                    for (n = 0; n <= d; n++)
+                    for (int n = 0; n <= d; n++)
                     {
                         t1[d][n] = winv[d][n]*vol*arel*box[d][n];
                     }
                 }
-                for (n = 0; n < DIM; n++)
+                for (int n = 0; n < DIM; n++)
                 {
-                    t1[ZZ][n] *= winv[d][n]*vol;
+                    t1[ZZ][n] *= winv[ZZ][n]*vol;
                 }
                 break;
             default:
@@ -481,10 +489,10 @@ void parrinellorahman_pcoupl(FILE *fplog, gmx_int64_t step,
                 break;
         }
 
-        maxchange = 0;
-        for (d = 0; d < DIM; d++)
+        real maxchange = 0;
+        for (int d = 0; d < DIM; d++)
         {
-            for (n = 0; n <= d; n++)
+            for (int n = 0; n <= d; n++)
             {
                 boxv[d][n] += dt*t1[d][n];
 
@@ -528,9 +536,9 @@ void parrinellorahman_pcoupl(FILE *fplog, gmx_int64_t step,
     mtmul(t2, invbox, M);
 
     /* Determine the scaling matrix mu for the coordinates */
-    for (d = 0; d < DIM; d++)
+    for (int d = 0; d < DIM; d++)
     {
-        for (n = 0; n <= d; n++)
+        for (int n = 0; n <= d; n++)
         {
             t1[d][n] = box[d][n] + dt*boxv[d][n];
         }
@@ -541,8 +549,10 @@ void parrinellorahman_pcoupl(FILE *fplog, gmx_int64_t step,
 }
 
 void berendsen_pcoupl(FILE *fplog, gmx_int64_t step,
-                      t_inputrec *ir, real dt, tensor pres, matrix box,
-                      matrix mu)
+                      const t_inputrec *ir, real dt,
+                      const tensor pres, const matrix box,
+                      const matrix force_vir, const matrix constraint_vir,
+                      matrix mu, double *baros_integral)
 {
     int     d, n;
     real    scalar_pressure, xy_pressure, p_corr_z;
@@ -630,6 +640,23 @@ void berendsen_pcoupl(FILE *fplog, gmx_int64_t step,
     mu[XX][ZZ]  = 0;
     mu[YY][ZZ]  = 0;
 
+    /* Keep track of the work the barostat applies on the system.
+     * Without constraints force_vir tells us how Epot changes when scaling.
+     * With constraints constraint_vir gives us the constraint contribution
+     * to both Epot and Ekin. Although we are not scaling velocities, scaling
+     * the coordinates leads to scaling of distances involved in constraints.
+     * This in turn changes the angular momentum (even if the constrained
+     * distances are corrected at the next step). The kinetic component
+     * of the constraint virial captures the angular momentum change.
+     */
+    for (int d = 0; d < DIM; d++)
+    {
+        for (int n = 0; n <= d; n++)
+        {
+            *baros_integral -= 2*(mu[d][n] - (n == d ? 1 : 0))*(force_vir[d][n] + constraint_vir[d][n]);
+        }
+    }
+
     if (debug)
     {
         pr_rvecs(debug, 0, "PC: pres ", pres, 3);
@@ -652,10 +679,10 @@ void berendsen_pcoupl(FILE *fplog, gmx_int64_t step,
     }
 }
 
-void berendsen_pscale(t_inputrec *ir, matrix mu,
+void berendsen_pscale(const t_inputrec *ir, const matrix mu,
                       matrix box, matrix box_rel,
                       int start, int nr_atoms,
-                      rvec x[], unsigned short cFREEZE[],
+                      rvec x[], const unsigned short cFREEZE[],
                       t_nrnb *nrnb)
 {
     ivec   *nFreeze = ir->opts.nFreeze;
@@ -674,7 +701,7 @@ void berendsen_pscale(t_inputrec *ir, matrix mu,
         // Trivial OpenMP region that does not throw
         int g;
 
-        if (cFREEZE == NULL)
+        if (cFREEZE == nullptr)
         {
             g = 0;
         }
@@ -712,29 +739,30 @@ void berendsen_pscale(t_inputrec *ir, matrix mu,
     inc_nrnb(nrnb, eNR_PCOUPL, nr_atoms);
 }
 
-void berendsen_tcoupl(t_inputrec *ir, gmx_ekindata_t *ekind, real dt)
+void berendsen_tcoupl(const t_inputrec *ir, const gmx_ekindata_t *ekind, real dt,
+                      std::vector<double> &therm_integral)
 {
-    t_grpopts *opts;
-    int        i;
-    real       T, reft = 0, lll;
-
-    opts = &ir->opts;
+    const t_grpopts *opts = &ir->opts;
 
-    for (i = 0; (i < opts->ngtc); i++)
+    for (int i = 0; (i < opts->ngtc); i++)
     {
+        real Ek, T;
+
         if (ir->eI == eiVV)
         {
-            T = ekind->tcstat[i].T;
+            Ek = trace(ekind->tcstat[i].ekinf);
+            T  = ekind->tcstat[i].T;
         }
         else
         {
-            T = ekind->tcstat[i].Th;
+            Ek = trace(ekind->tcstat[i].ekinh);
+            T  = ekind->tcstat[i].Th;
         }
 
         if ((opts->tau_t[i] > 0) && (T > 0.0))
         {
-            reft                    = std::max<real>(0, opts->ref_t[i]);
-            lll                     = std::sqrt(1.0 + (dt/opts->tau_t[i])*(reft/T-1.0));
+            real reft               = std::max<real>(0, opts->ref_t[i]);
+            real lll                = std::sqrt(1.0 + (dt/opts->tau_t[i])*(reft/T-1.0));
             ekind->tcstat[i].lambda = std::max<real>(std::min<real>(lll, 1.25), 0.8);
         }
         else
@@ -742,6 +770,9 @@ void berendsen_tcoupl(t_inputrec *ir, gmx_ekindata_t *ekind, real dt)
             ekind->tcstat[i].lambda = 1.0;
         }
 
+        /* Keep track of the amount of energy we are adding to the system */
+        therm_integral[i] -= (gmx::square(ekind->tcstat[i].lambda) - 1)*Ek;
+
         if (debug)
         {
             fprintf(debug, "TC: group %d: T: %g, Lambda: %g\n",
@@ -753,7 +784,7 @@ void berendsen_tcoupl(t_inputrec *ir, gmx_ekindata_t *ekind, real dt)
 void andersen_tcoupl(t_inputrec *ir, gmx_int64_t step,
                      const t_commrec *cr, const t_mdatoms *md, t_state *state, real rate, const gmx_bool *randomize, const real *boltzfac)
 {
-    const int                                 *gatindex = (DOMAINDECOMP(cr) ? cr->dd->gatindex : NULL);
+    const int                                 *gatindex = (DOMAINDECOMP(cr) ? cr->dd->gatindex : nullptr);
     int                                        i;
     int                                        gc = 0;
     gmx::ThreeFry2x64<0>                       rng(ir->andersen_seed, gmx::RandomDomain::Thermostat);
@@ -822,32 +853,6 @@ void nosehoover_tcoupl(t_grpopts *opts, gmx_ekindata_t *ekind, real dt,
     }
 }
 
-t_state *init_bufstate(const t_state *template_state)
-{
-    t_state *state;
-    int      nc = template_state->nhchainlength;
-    snew(state, 1);
-    snew(state->nosehoover_xi, nc*template_state->ngtc);
-    snew(state->nosehoover_vxi, nc*template_state->ngtc);
-    snew(state->therm_integral, template_state->ngtc);
-    snew(state->nhpres_xi, nc*template_state->nnhpres);
-    snew(state->nhpres_vxi, nc*template_state->nnhpres);
-
-    return state;
-}
-
-void destroy_bufstate(t_state *state)
-{
-    sfree(state->x);
-    sfree(state->v);
-    sfree(state->nosehoover_xi);
-    sfree(state->nosehoover_vxi);
-    sfree(state->therm_integral);
-    sfree(state->nhpres_xi);
-    sfree(state->nhpres_vxi);
-    sfree(state);
-}
-
 void trotter_update(t_inputrec *ir, gmx_int64_t step, gmx_ekindata_t *ekind,
                     gmx_enerdata_t *enerd, t_state *state,
                     tensor vir, t_mdatoms *md,
@@ -917,13 +922,13 @@ void trotter_update(t_inputrec *ir, gmx_int64_t step, gmx_ekindata_t *ekind,
                 break;
             case etrtBARONHC:
             case etrtBARONHC2:
-                NHC_trotter(opts, state->nnhpres, ekind, dt, state->nhpres_xi,
-                            state->nhpres_vxi, NULL, &(state->veta), MassQ, FALSE);
+                NHC_trotter(opts, state->nnhpres, ekind, dt, state->nhpres_xi.data(),
+                            state->nhpres_vxi.data(), nullptr, &(state->veta), MassQ, FALSE);
                 break;
             case etrtNHC:
             case etrtNHC2:
-                NHC_trotter(opts, opts->ngtc, ekind, dt, state->nosehoover_xi,
-                            state->nosehoover_vxi, scalefac, NULL, MassQ, (ir->eI == eiVV));
+                NHC_trotter(opts, opts->ngtc, ekind, dt, state->nosehoover_xi.data(),
+                            state->nosehoover_vxi.data(), scalefac, nullptr, MassQ, (ir->eI == eiVV));
                 /* need to rescale the kinetic energies and velocities here.  Could
                    scale the velocities later, but we need them scaled in order to
                    produce the correct outputs, so we'll scale them here. */
@@ -1264,124 +1269,180 @@ int **init_npt_vars(t_inputrec *ir, t_state *state, t_extmass *MassQ, gmx_bool b
     return trotter_seq;
 }
 
-real NPT_energy(t_inputrec *ir, t_state *state, t_extmass *MassQ)
+static real energyNoseHoover(const t_inputrec *ir, const t_state *state, const t_extmass *MassQ)
 {
-    int     i, j;
-    real    nd, ndj;
-    real    ener_npt, reft, kT;
-    double *ivxi, *ixi;
-    double *iQinv;
-    real    vol;
-    int     nh = state->nhchainlength;
-
-    ener_npt = 0;
+    real energy = 0;
 
-    /* now we compute the contribution of the pressure to the conserved quantity*/
+    int  nh     = state->nhchainlength;
 
-    if (ir->epc == epcMTTK)
+    for (int i = 0; i < ir->opts.ngtc; i++)
     {
-        /* find the volume, and the kinetic energy of the volume */
+        const double *ixi   = &state->nosehoover_xi[i*nh];
+        const double *ivxi  = &state->nosehoover_vxi[i*nh];
+        const double *iQinv = &(MassQ->Qinv[i*nh]);
 
-        switch (ir->epct)
-        {
-
-            case epctISOTROPIC:
-                /* contribution from the pressure momenenta */
-                ener_npt += 0.5*gmx::square(state->veta)/MassQ->Winv;
+        int           nd    = ir->opts.nrdf[i];
+        real          reft  = std::max<real>(ir->opts.ref_t[i], 0);
+        real          kT    = BOLTZ * reft;
 
-                /* contribution from the PV term */
-                vol       = det(state->box);
-                ener_npt += vol*trace(ir->ref_p)/(DIM*PRESFAC);
+        if (nd > 0.0)
+        {
+            if (inputrecNvtTrotter(ir))
+            {
+                /* contribution from the thermal momenta of the NH chain */
+                for (int j = 0; j < nh; j++)
+                {
+                    if (iQinv[j] > 0)
+                    {
+                        energy += 0.5*gmx::square(ivxi[j])/iQinv[j];
+                        /* contribution from the thermal variable of the NH chain */
+                        int ndj;
+                        if (j == 0)
+                        {
+                            ndj = nd;
+                        }
+                        else
+                        {
+                            ndj = 1.0;
+                        }
+                        energy += ndj*ixi[j]*kT;
+                    }
+                }
+            }
+            else  /* Other non Trotter temperature NH control  -- no chains yet. */
+            {
+                energy += 0.5*BOLTZ*nd*gmx::square(ivxi[0])/iQinv[0];
+                energy += nd*ixi[0]*kT;
+            }
+        }
+    }
 
-                break;
-            case epctANISOTROPIC:
+    return energy;
+}
 
-                break;
+/* Returns the energy from the barostat thermostat chain */
+static real energyPressureMTTK(const t_inputrec *ir, const t_state *state, const t_extmass *MassQ)
+{
+    real energy = 0;
 
-            case epctSURFACETENSION:
+    int  nh     = state->nhchainlength;
 
-                break;
-            case epctSEMIISOTROPIC:
+    for (int i = 0; i < state->nnhpres; i++)
+    {
+        /* note -- assumes only one degree of freedom that is thermostatted in barostat */
+        real    reft  = std::max<real>(ir->opts.ref_t[0], 0.0); /* using 'System' temperature */
+        real    kT    = BOLTZ * reft;
 
-                break;
-            default:
-                break;
+        for (int j = 0; j < nh; j++)
+        {
+            double iQinv = MassQ->QPinv[i*nh + j];
+            if (iQinv > 0)
+            {
+                energy += 0.5*gmx::square(state->nhpres_vxi[i*nh + j]/iQinv);
+                /* contribution from the thermal variable of the NH chain */
+                energy += state->nhpres_xi[i*nh + j]*kT;
+            }
+            if (debug)
+            {
+                fprintf(debug, "P-T-group: %10d Chain %4d ThermV: %15.8f ThermX: %15.8f", i, j, state->nhpres_vxi[i*nh + j], state->nhpres_xi[i*nh + j]);
+            }
         }
     }
 
-    if (inputrecNptTrotter(ir) || inputrecNphTrotter(ir))
+    return energy;
+}
+
+/* Returns the energy accumulated by the V-rescale or Berendsen thermostat */
+static real energyVrescale(const t_inputrec *ir, const t_state *state)
+{
+    real energy = 0;
+    for (int i = 0; i < ir->opts.ngtc; i++)
     {
-        /* add the energy from the barostat thermostat chain */
-        for (i = 0; i < state->nnhpres; i++)
-        {
+        energy += state->therm_integral[i];
+    }
 
-            /* note -- assumes only one degree of freedom that is thermostatted in barostat */
-            ivxi  = &state->nhpres_vxi[i*nh];
-            ixi   = &state->nhpres_xi[i*nh];
-            iQinv = &(MassQ->QPinv[i*nh]);
-            reft  = std::max<real>(ir->opts.ref_t[0], 0.0); /* using 'System' temperature */
-            kT    = BOLTZ * reft;
+    return energy;
+}
 
-            for (j = 0; j < nh; j++)
-            {
-                if (iQinv[j] > 0)
-                {
-                    ener_npt += 0.5*gmx::square(ivxi[j])/iQinv[j];
-                    /* contribution from the thermal variable of the NH chain */
-                    ener_npt += ixi[j]*kT;
-                }
-                if (debug)
-                {
-                    fprintf(debug, "P-T-group: %10d Chain %4d ThermV: %15.8f ThermX: %15.8f", i, j, ivxi[j], ixi[j]);
-                }
-            }
-        }
-    }
+real NPT_energy(const t_inputrec *ir, const t_state *state, const t_extmass *MassQ)
+{
+    real energyNPT = 0;
 
-    if (ir->etc)
+    if (ir->epc != epcNO)
     {
-        for (i = 0; i < ir->opts.ngtc; i++)
-        {
-            ixi   = &state->nosehoover_xi[i*nh];
-            ivxi  = &state->nosehoover_vxi[i*nh];
-            iQinv = &(MassQ->Qinv[i*nh]);
+        /* Compute the contribution of the pressure to the conserved quantity*/
 
-            nd   = ir->opts.nrdf[i];
-            reft = std::max<real>(ir->opts.ref_t[i], 0);
-            kT   = BOLTZ * reft;
+        real vol  = det(state->box);
 
-            if (nd > 0.0)
+        switch (ir->epc)
+        {
+            case epcPARRINELLORAHMAN:
             {
-                if (inputrecNvtTrotter(ir))
+                /* contribution from the pressure momenta */
+                tensor invMass;
+                calcParrinelloRahmanInvMass(ir, state->box, invMass);
+                for (int d = 0; d < DIM; d++)
                 {
-                    /* contribution from the thermal momenta of the NH chain */
-                    for (j = 0; j < nh; j++)
+                    for (int n = 0; n <= d; n++)
                     {
-                        if (iQinv[j] > 0)
+                        if (invMass[d][n] > 0)
                         {
-                            ener_npt += 0.5*gmx::square(ivxi[j])/iQinv[j];
-                            /* contribution from the thermal variable of the NH chain */
-                            if (j == 0)
-                            {
-                                ndj = nd;
-                            }
-                            else
-                            {
-                                ndj = 1.0;
-                            }
-                            ener_npt += ndj*ixi[j]*kT;
+                            energyNPT += 0.5*gmx::square(state->boxv[d][n])/(invMass[d][n]*PRESFAC);
                         }
                     }
                 }
-                else  /* Other non Trotter temperature NH control  -- no chains yet. */
+
+                /* Contribution from the PV term.
+                 * Not that with non-zero off-diagonal reference pressures,
+                 * i.e. applied shear stresses, there are additional terms.
+                 * We don't support this here, since that requires keeping
+                 * track of unwrapped box diagonal elements. This case is
+                 * excluded in integratorHasConservedEnergyQuantity().
+                 */
+                energyNPT += vol*trace(ir->ref_p)/(DIM*PRESFAC);
+                break;
+            }
+            case epcMTTK:
+                /* contribution from the pressure momenta */
+                energyNPT += 0.5*gmx::square(state->veta)/MassQ->Winv;
+
+                /* contribution from the PV term */
+                energyNPT += vol*trace(ir->ref_p)/(DIM*PRESFAC);
+
+                if (ir->epc == epcMTTK)
                 {
-                    ener_npt += 0.5*BOLTZ*nd*gmx::square(ivxi[0])/iQinv[0];
-                    ener_npt += nd*ixi[0]*kT;
+                    /* contribution from the MTTK chain */
+                    energyNPT += energyPressureMTTK(ir, state, MassQ);
                 }
-            }
+                break;
+            case epcBERENDSEN:
+                energyNPT += state->baros_integral;
+                break;
+            default:
+                GMX_RELEASE_ASSERT(false, "Conserved energy quantity for pressure coupling is not handled. A case should be added with either the conserved quantity added or nothing added and an exclusion added to integratorHasConservedEnergyQuantity().");
         }
     }
-    return ener_npt;
+
+    switch (ir->etc)
+    {
+        case etcNO:
+            break;
+        case etcVRESCALE:
+        case etcBERENDSEN:
+            energyNPT += energyVrescale(ir, state);
+            break;
+        case etcNOSEHOOVER:
+            energyNPT += energyNoseHoover(ir, state, MassQ);
+            break;
+        case etcANDERSEN:
+        case etcANDERSENMASSIVE:
+            // Not supported, excluded in integratorHasConservedEnergyQuantity()
+            break;
+        default:
+            GMX_RELEASE_ASSERT(false, "Conserved energy quantity for temperature coupling is not handled. A case should be added with either the conserved quantity added or nothing added and an exclusion added to integratorHasConservedEnergyQuantity().");
+    }
+
+    return energyNPT;
 }
 
 
@@ -1517,20 +1578,6 @@ void vrescale_tcoupl(t_inputrec *ir, gmx_int64_t step,
     }
 }
 
-real vrescale_energy(t_grpopts *opts, double therm_integral[])
-{
-    int  i;
-    real ener;
-
-    ener = 0;
-    for (i = 0; i < opts->ngtc; i++)
-    {
-        ener += therm_integral[i];
-    }
-
-    return ener;
-}
-
 void rescale_velocities(gmx_ekindata_t *ekind, t_mdatoms *mdatoms,
                         int start, int end, rvec v[])
 {
index 092ee94ac94b6eca9922bc0bafcddd167f7c6a9f..1dbaff73fae5746eca598ffd21d196c57a440ae3 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,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.
@@ -94,44 +94,43 @@ typedef struct gmx_settledata
 } t_gmx_settledata;
 
 
-static void init_proj_matrix(settleparam_t *p,
-                             real invmO, real invmH, real dOH, real dHH)
+static void init_proj_matrix(real invmO, real invmH, real dOH, real dHH,
+                             matrix inverseCouplingMatrix)
 {
-    real   imOn, imHn;
-    matrix mat;
-
-    p->imO = invmO;
-    p->imH = invmH;
-    /* We normalize the inverse masses with imO for the matrix inversion.
+    /* We normalize the inverse masses with invmO for the matrix inversion.
      * so we can keep using masses of almost zero for frozen particles,
      * without running out of the float range in invertMatrix.
      */
-    imOn = 1;
-    imHn = p->imH/p->imO;
+    double invmORelative = 1.0;
+    double invmHRelative = invmH/static_cast<double>(invmO);
+    double distanceRatio = dHH/static_cast<double>(dOH);
 
     /* Construct the constraint coupling matrix */
-    mat[0][0] = imOn + imHn;
-    mat[0][1] = imOn*(1 - 0.5*dHH*dHH/(dOH*dOH));
-    mat[0][2] = imHn*0.5*dHH/dOH;
+    matrix mat;
+    mat[0][0] = invmORelative + invmHRelative;
+    mat[0][1] = invmORelative*(1.0 - 0.5*gmx::square(distanceRatio));
+    mat[0][2] = invmHRelative*0.5*distanceRatio;
     mat[1][1] = mat[0][0];
     mat[1][2] = mat[0][2];
-    mat[2][2] = imHn + imHn;
+    mat[2][2] = invmHRelative + invmHRelative;
     mat[1][0] = mat[0][1];
     mat[2][0] = mat[0][2];
     mat[2][1] = mat[1][2];
 
-    gmx::invertMatrix(mat, p->invmat);
+    invertMatrix(mat, inverseCouplingMatrix);
 
-    msmul(p->invmat, 1/p->imO, p->invmat);
-
-    p->invdOH = 1/dOH;
-    p->invdHH = 1/dHH;
+    msmul(inverseCouplingMatrix, 1/invmO, inverseCouplingMatrix);
 }
 
 static void settleparam_init(settleparam_t *p,
                              real mO, real mH, real invmO, real invmH,
                              real dOH, real dHH)
 {
+    /* We calculate parameters in double precision to minimize errors.
+     * The velocity correction applied during SETTLE coordinate constraining
+     * introduces a systematic error of approximately 1 bit per atom,
+     * depending on what the compiler does with the code.
+     */
     double wohh;
 
     p->mO     = mO;
@@ -140,13 +139,21 @@ static void settleparam_init(settleparam_t *p,
     p->wh     = mH/wohh;
     p->dOH    = dOH;
     p->dHH    = dHH;
-    p->rc     = dHH/2.0;
-    p->ra     = 2.0*mH*sqrt(dOH*dOH - p->rc*p->rc)/wohh;
-    p->rb     = sqrt(dOH*dOH - p->rc*p->rc) - p->ra;
+    double rc = dHH/2.0;
+    double ra = 2.0*mH*std::sqrt(dOH*dOH - rc*rc)/wohh;
+    p->rb     = std::sqrt(dOH*dOH - rc*rc) - ra;
+    p->rc     = rc;
+    p->ra     = ra;
     p->irc2   = 1.0/dHH;
 
-    /* For projection: connection matrix inversion */
-    init_proj_matrix(p, invmO, invmH, dOH, dHH);
+    /* For projection: inverse masses and coupling matrix inversion */
+    p->imO    = invmO;
+    p->imH    = invmH;
+
+    p->invdOH = 1.0/dOH;
+    p->invdHH = 1.0/dHH;
+
+    init_proj_matrix(invmO, invmH, dOH, dHH, p->invmat);
 
     if (debug)
     {
@@ -201,18 +208,27 @@ gmx_settledata_t settle_init(const gmx_mtop_t *mtop)
     real dHH = mtop->ffparams.iparams[settle_type].settle.dhh;
     settleparam_init(&settled->mass1, 1.0, 1.0, 1.0, 1.0, dOH, dHH);
 
-    settled->ow1    = NULL;
-    settled->hw2    = NULL;
-    settled->hw3    = NULL;
-    settled->virfac = NULL;
+    settled->ow1    = nullptr;
+    settled->hw2    = nullptr;
+    settled->hw3    = nullptr;
+    settled->virfac = nullptr;
     settled->nalloc = 0;
 
     /* Without SIMD configured, this bool is not used */
-    settled->bUseSimd = (getenv("GMX_DISABLE_SIMD_KERNELS") == NULL);
+    settled->bUseSimd = (getenv("GMX_DISABLE_SIMD_KERNELS") == nullptr);
 
     return settled;
 }
 
+void settle_free(gmx_settledata_t settled)
+{
+    sfree_aligned(settled->ow1);
+    sfree_aligned(settled->hw2);
+    sfree_aligned(settled->hw3);
+    sfree_aligned(settled->virfac);
+    sfree(settled);
+}
+
 void settle_set_constraints(gmx_settledata_t  settled,
                             const t_ilist    *il_settle,
                             const t_mdatoms  *mdatoms)
@@ -332,7 +348,7 @@ void settle_proj(gmx_settledata_t settled, int econq,
         hw2 = iatoms[i*nral1 + 2];
         hw3 = iatoms[i*nral1 + 3];
 
-        if (pbc == NULL)
+        if (pbc == nullptr)
         {
             rvec_sub(x[ow1], x[hw2], roh2);
             rvec_sub(x[ow1], x[hw3], roh3);
@@ -761,7 +777,7 @@ static void settleTemplateWrapper(gmx_settledata_t settled,
     int settleStart    = ((numSettlePacks* thread      + nthread - 1)/nthread)*packSize;
     int settleEnd      = ((numSettlePacks*(thread + 1) + nthread - 1)/nthread)*packSize;
 
-    if (v != NULL)
+    if (v != nullptr)
     {
         if (!bCalcVirial)
         {
@@ -773,7 +789,7 @@ static void settleTemplateWrapper(gmx_settledata_t settled,
                 pbc,
                 x, xprime,
                 invdt, v,
-                NULL,
+                nullptr,
                 bErrorHasOccurred);
         }
         else
@@ -802,7 +818,7 @@ static void settleTemplateWrapper(gmx_settledata_t settled,
                 pbc,
                 x, xprime,
                 invdt, v,
-                NULL,
+                nullptr,
                 bErrorHasOccurred);
         }
         else
@@ -853,13 +869,13 @@ void csettle(gmx_settledata_t settled,
         t_pbc        pbcNo;
         const t_pbc *pbcNonNull;
 
-        if (pbc != NULL)
+        if (pbc != nullptr)
         {
             pbcNonNull = pbc;
         }
         else
         {
-            set_pbc(&pbcNo, epbcNONE, NULL);
+            set_pbc(&pbcNo, epbcNONE, nullptr);
             pbcNonNull = &pbcNo;
         }
 
index 9777c3e14241177f0c044d96a22de4a99fcb390e..e882f75eb558bfe8ecfe36f77278163d4e30456a 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, by the GROMACS development team, led by
+ * 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.
@@ -79,7 +79,7 @@ int get_ebin_space(t_ebin *eb, int nener, const char *enm[], const char *unit)
         eb->e_sim[i].eav  = 0;
         eb->e_sim[i].esum = 0;
         eb->enm[i].name   = gmx_strdup(enm[i-index]);
-        if (unit != NULL)
+        if (unit != nullptr)
         {
             eb->enm[i].unit = gmx_strdup(unit);
         }
index 3136c480a0707735719bc42f52220c62e7290a1c..cd1b2981de77bce2f68d876c924630fc9443ae80 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,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.
@@ -34,6 +34,8 @@
  */
 #include "gmxpre.h"
 
+#include "expanded.h"
+
 #include <stdio.h>
 
 #include <cmath>
 #include "gromacs/mdlib/calcmu.h"
 #include "gromacs/mdlib/constr.h"
 #include "gromacs/mdlib/force.h"
-#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/update.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/mdtypes/state.h"
 #include "gromacs/random/threefry.h"
 #include "gromacs/random/uniformrealdistribution.h"
 #include "gromacs/timing/wallcycle.h"
@@ -79,7 +81,7 @@ static void init_df_history_weights(df_history_t *dfhist, t_expanded *expand, in
 
 /* Eventually should contain all the functions needed to initialize expanded ensemble
    before the md loop starts */
-extern void init_expanded_ensemble(gmx_bool bStateFromCP, t_inputrec *ir, df_history_t *dfhist)
+void init_expanded_ensemble(gmx_bool bStateFromCP, t_inputrec *ir, df_history_t *dfhist)
 {
     if (!bStateFromCP)
     {
@@ -168,36 +170,7 @@ static void GenerateWeightedGibbsProbabilities(real *ene, double *p_k, double *p
     sfree(nene);
 }
 
-real do_logsum(int N, real *a_n)
-{
-
-    /*     RETURN VALUE */
-    /* log(\sum_{i=0}^(N-1) exp[a_n]) */
-    real maxarg;
-    real sum;
-    int  i;
-    real logsum;
-    /*     compute maximum argument to exp(.) */
-
-    maxarg = a_n[0];
-    for (i = 1; i < N; i++)
-    {
-        maxarg = std::max(maxarg, a_n[i]);
-    }
-
-    /* compute sum of exp(a_n - maxarg) */
-    sum = 0.0;
-    for (i = 0; i < N; i++)
-    {
-        sum = sum + std::exp(a_n[i] - maxarg);
-    }
-
-    /*     compute log sum */
-    logsum = std::log(sum) + maxarg;
-    return logsum;
-}
-
-int FindMinimum(real *min_metric, int N)
+static int FindMinimum(real *min_metric, int N)
 {
 
     real min_val;
@@ -1015,8 +988,8 @@ static int ChooseNewLambda(int nlim, t_expanded *expand, df_history_t *dfhist, i
 }
 
 /* print out the weights to the log, along with current state */
-extern void PrintFreeEnergyInfoToFile(FILE *outfile, t_lambda *fep, t_expanded *expand, t_simtemp *simtemp, df_history_t *dfhist,
-                                      int fep_state, int frequency, gmx_int64_t step)
+void PrintFreeEnergyInfoToFile(FILE *outfile, t_lambda *fep, t_expanded *expand, t_simtemp *simtemp, df_history_t *dfhist,
+                               int fep_state, int frequency, gmx_int64_t step)
 {
     int         nlim, i, ifep, jfep;
     real        dw, dg, dv, Tprint;
@@ -1024,7 +997,7 @@ extern void PrintFreeEnergyInfoToFile(FILE *outfile, t_lambda *fep, t_expanded *
     gmx_bool    bSimTemp            = FALSE;
 
     nlim = fep->n_lambda;
-    if (simtemp != NULL)
+    if (simtemp != nullptr)
     {
         bSimTemp = TRUE;
     }
@@ -1182,10 +1155,10 @@ extern void PrintFreeEnergyInfoToFile(FILE *outfile, t_lambda *fep, t_expanded *
     }
 }
 
-extern int ExpandedEnsembleDynamics(FILE *log, t_inputrec *ir, gmx_enerdata_t *enerd,
-                                    t_state *state, t_extmass *MassQ, int fep_state, df_history_t *dfhist,
-                                    gmx_int64_t step,
-                                    rvec *v, t_mdatoms *mdatoms)
+int ExpandedEnsembleDynamics(FILE *log, t_inputrec *ir, gmx_enerdata_t *enerd,
+                             t_state *state, t_extmass *MassQ, int fep_state, df_history_t *dfhist,
+                             gmx_int64_t step,
+                             rvec *v, t_mdatoms *mdatoms)
 /* Note that the state variable is only needed for simulated tempering, not
    Hamiltonian expanded ensemble.  May be able to remove it after integrator refactoring. */
 {
diff --git a/src/gromacs/mdlib/expanded.h b/src/gromacs/mdlib/expanded.h
new file mode 100644 (file)
index 0000000..335c91c
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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_MDLIB_EXPANDED_H
+#define GMX_MDLIB_EXPANDED_H
+
+#include <stdio.h>
+
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+
+struct df_history_t;
+struct gmx_enerdata_t;
+struct t_expanded;
+struct t_extmass;
+struct t_inputrec;
+struct t_lambda;
+struct t_mdatoms;
+struct t_simtemp;
+class t_state;
+
+void init_npt_masses(t_inputrec *ir, t_state *state, t_extmass *MassQ, gmx_bool bInit);
+
+void init_expanded_ensemble(gmx_bool bStateFromCP, t_inputrec *ir, df_history_t *dfhist);
+
+int ExpandedEnsembleDynamics(FILE *log, t_inputrec *ir, gmx_enerdata_t *enerd,
+                             t_state *state, t_extmass *MassQ, int fep_state, df_history_t *dfhist,
+                             gmx_int64_t step,
+                             rvec *v, t_mdatoms *mdatoms);
+
+void PrintFreeEnergyInfoToFile(FILE *outfile, t_lambda *fep, t_expanded *expand, t_simtemp *simtemp, df_history_t *dfhist,
+                               int fep_state, int frequency, gmx_int64_t step);
+
+#endif
index fa592e1993b0a7736fe2c524975858c6f2c0bf29..8142fc23e5407753bf068709bd713e3fd883f2da 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,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.
@@ -362,7 +362,7 @@ void do_force_lowlevel(t_forcerec *fr,      t_inputrec *ir,
     do_force_listed(wcycle, box, ir->fepvals, cr,
                     idef, (const rvec *) x, hist, f, fr,
                     &pbc, graph, enerd, nrnb, lambda, md, fcd,
-                    DOMAINDECOMP(cr) ? cr->dd->gatindex : NULL,
+                    DOMAINDECOMP(cr) ? cr->dd->gatindex : nullptr,
                     flags);
 
     where();
@@ -459,7 +459,8 @@ void do_force_lowlevel(t_forcerec *fr,      t_inputrec *ir,
                                            excl, x, bSB ? boxs : box, mu_tot,
                                            ir->ewald_geometry,
                                            ir->epsilon_surface,
-                                           fr->f_novirsum, *vir_q, *vir_lj,
+                                           as_rvec_array(fr->f_novirsum->data()),
+                                           *vir_q, *vir_lj,
                                            Vcorrt_q, Vcorrt_lj,
                                            lambda[efptCOUL], lambda[efptVDW],
                                            dvdlt_q, dvdlt_lj);
@@ -496,14 +497,7 @@ void do_force_lowlevel(t_forcerec *fr,      t_inputrec *ir,
                 if (fr->n_tpi == 0 || (flags & GMX_FORCE_STATECHANGED))
                 {
                     pme_flags = GMX_PME_SPREAD | GMX_PME_SOLVE;
-                    if (EEL_PME(fr->eeltype))
-                    {
-                        pme_flags     |= GMX_PME_DO_COULOMB;
-                    }
-                    if (EVDW_PME(fr->vdwtype))
-                    {
-                        pme_flags |= GMX_PME_DO_LJ;
-                    }
+
                     if (flags & GMX_FORCE_FORCES)
                     {
                         pme_flags |= GMX_PME_CALC_F;
@@ -517,10 +511,21 @@ void do_force_lowlevel(t_forcerec *fr,      t_inputrec *ir,
                         /* We don't calculate f, but we do want the potential */
                         pme_flags |= GMX_PME_CALC_POT;
                     }
+
+                    /* With domain decomposition we close the CPU side load
+                     * balancing region here, because PME does global
+                     * communication that acts as a global barrier.
+                     */
+                    if (DOMAINDECOMP(cr))
+                    {
+                        ddCloseBalanceRegionCpu(cr->dd);
+                    }
+
                     wallcycle_start(wcycle, ewcPMEMESH);
                     status = gmx_pme_do(fr->pmedata,
                                         0, md->homenr - fr->n_tpi,
-                                        x, fr->f_novirsum,
+                                        x,
+                                        as_rvec_array(fr->f_novirsum->data()),
                                         md->chargeA, md->chargeB,
                                         md->sqrt_c6A, md->sqrt_c6B,
                                         md->sigmaA, md->sigmaB,
@@ -528,8 +533,7 @@ void do_force_lowlevel(t_forcerec *fr,      t_inputrec *ir,
                                         DOMAINDECOMP(cr) ? dd_pme_maxshift_x(cr->dd) : 0,
                                         DOMAINDECOMP(cr) ? dd_pme_maxshift_y(cr->dd) : 0,
                                         nrnb, wcycle,
-                                        fr->vir_el_recip, fr->ewaldcoeff_q,
-                                        fr->vir_lj_recip, fr->ewaldcoeff_lj,
+                                        fr->vir_el_recip, fr->vir_lj_recip,
                                         &Vlr_q, &Vlr_lj,
                                         lambda[efptCOUL], lambda[efptVDW],
                                         &dvdl_long_range_q, &dvdl_long_range_lj, pme_flags);
@@ -566,7 +570,7 @@ void do_force_lowlevel(t_forcerec *fr,      t_inputrec *ir,
 
         if (!EEL_PME(fr->eeltype) && EEL_PME_EWALD(fr->eeltype))
         {
-            Vlr_q = do_ewald(ir, x, fr->f_novirsum,
+            Vlr_q = do_ewald(ir, x, as_rvec_array(fr->f_novirsum->data()),
                              md->chargeA, md->chargeB,
                              box_size, cr, md->homenr,
                              fr->vir_el_recip, fr->ewaldcoeff_q,
@@ -740,14 +744,14 @@ void sum_epot(gmx_grppairener_t *grpp, real *epot)
     }
 }
 
-void sum_dhdl(gmx_enerdata_t *enerd, real *lambda, t_lambda *fepvals)
+void sum_dhdl(gmx_enerdata_t *enerd, gmx::ConstArrayRef<real> lambda, t_lambda *fepvals)
 {
-    int    i, j, index;
+    int    index;
     double dlam;
 
     enerd->dvdl_lin[efptVDW] += enerd->term[F_DVDL_VDW];  /* include dispersion correction */
     enerd->term[F_DVDL]       = 0.0;
-    for (i = 0; i < efptNR; i++)
+    for (int i = 0; i < efptNR; i++)
     {
         if (fepvals->separate_dvdl[i])
         {
@@ -808,7 +812,7 @@ void sum_dhdl(gmx_enerdata_t *enerd, real *lambda, t_lambda *fepvals)
     }
     enerd->term[F_DVDL_CONSTR] = 0;
 
-    for (i = 0; i < fepvals->n_lambda; i++)
+    for (int i = 0; i < fepvals->n_lambda; i++)
     {
         /* note we are iterating over fepvals here!
            For the current lam, dlam = 0 automatically,
@@ -819,10 +823,10 @@ void sum_dhdl(gmx_enerdata_t *enerd, real *lambda, t_lambda *fepvals)
            current lambda, because the contributions to the current
            lambda are automatically zeroed */
 
-        for (j = 0; j < efptNR; j++)
+        for (size_t j = 0; j < lambda.size(); j++)
         {
             /* Note that this loop is over all dhdl components, not just the separated ones */
-            dlam = (fepvals->all_lambda[j][i]-lambda[j]);
+            dlam = (fepvals->all_lambda[j][i] - lambda[j]);
             enerd->enerpart_lambda[i+1] += dlam*enerd->dvdl_lin[j];
             if (debug)
             {
index 3fe505cf0b4f3397ac061371fdc115d1a1b5d8fb..93cd302140f55506ec8134256fd2e671fe12ddc8 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,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.
 #ifndef GMX_MDLIB_FORCE_H
 #define GMX_MDLIB_FORCE_H
 
+#include "gromacs/domdec/dlbtiming.h"
 #include "gromacs/mdlib/force_flags.h"
 #include "gromacs/mdlib/vsite.h"
 #include "gromacs/mdtypes/fcdata.h"
 #include "gromacs/mdtypes/forcerec.h"
 #include "gromacs/timing/wallcycle.h"
+#include "gromacs/utility/arrayref.h"
 
+struct gmx_device_info_t;
 struct gmx_edsam;
 struct gmx_gpu_info_t;
 struct gmx_groups_t;
 struct gmx_vsite_t;
-struct history_t;
+class history_t;
 struct nonbonded_verlet_t;
 struct t_blocka;
 struct t_commrec;
@@ -60,6 +63,11 @@ struct t_mdatoms;
 struct t_nrnb;
 struct t_pbc;
 
+namespace gmx
+{
+class MDLogger;
+}
+
 void calc_vir(int nxf, rvec x[], rvec f[], tensor vir,
               gmx_bool bScrewPBC, matrix box);
 /* Calculate virial for nxf atoms, and add it to vir */
@@ -105,20 +113,8 @@ gmx_bool can_use_allvsall(const t_inputrec *ir,
  * and fp (if !=NULL) on the master node.
  */
 
-
-gmx_bool nbnxn_gpu_acceleration_supported(FILE             *fplog,
-                                          const t_commrec  *cr,
-                                          const t_inputrec *ir,
-                                          gmx_bool          bRerunMD);
-/* Return if GPU acceleration is supported with the given settings.
- *
- * If the return value is FALSE and fplog/cr != NULL, prints a fallback
- * message to fplog/stderr.
- */
-
-gmx_bool nbnxn_simd_supported(FILE             *fplog,
-                              const t_commrec  *cr,
-                              const t_inputrec *ir);
+gmx_bool nbnxn_simd_supported(const gmx::MDLogger &mdlog,
+                              const t_inputrec    *ir);
 /* Return if CPU SIMD support exists for the given inputrec
  * If the return value is FALSE and fplog/cr != NULL, prints a fallback
  * message to fplog/stderr.
@@ -146,7 +142,7 @@ void reset_enerdata(gmx_enerdata_t *enerd);
 void sum_epot(gmx_grppairener_t *grpp, real *epot);
 /* Locally sum the non-bonded potential energy terms */
 
-void sum_dhdl(gmx_enerdata_t *enerd, real *lambda, t_lambda *fepvals);
+void sum_dhdl(gmx_enerdata_t *enerd, gmx::ConstArrayRef<real> lambda, t_lambda *fepvals);
 /* Sum the free energy contributions */
 
 /* Compute the average C6 and C12 params for LJ corrections */
@@ -158,17 +154,19 @@ void do_force(FILE *log, t_commrec *cr,
               gmx_int64_t step, struct t_nrnb *nrnb, gmx_wallcycle_t wcycle,
               gmx_localtop_t *top,
               gmx_groups_t *groups,
-              matrix box, rvec x[], history_t *hist,
-              rvec f[],
+              matrix box, PaddedRVecVector *coordinates, history_t *hist,
+              PaddedRVecVector *force,
               tensor vir_force,
               t_mdatoms *mdatoms,
               gmx_enerdata_t *enerd, t_fcdata *fcd,
-              real *lambda, struct t_graph *graph,
+              gmx::ArrayRef<real> lambda, t_graph *graph,
               t_forcerec *fr,
               gmx_vsite_t *vsite, rvec mu_tot,
-              double t, FILE *field, struct gmx_edsam *ed,
+              double t, struct gmx_edsam *ed,
               gmx_bool bBornRadii,
-              int flags);
+              int flags,
+              DdOpenBalanceRegionBeforeForceComputation ddOpenBalanceRegion,
+              DdCloseBalanceRegionAfterForceComputation ddCloseBalanceRegion);
 
 /* Communicate coordinates (if parallel).
  * Do neighbor searching (if necessary).
@@ -217,7 +215,6 @@ void do_force_lowlevel(t_forcerec   *fr,
 
 void free_gpu_resources(const t_forcerec            *fr,
                         const t_commrec             *cr,
-                        const gmx_gpu_info_t        *gpu_info,
-                        const gmx_gpu_opt_t         *gpu_opt);
+                        const gmx_device_info_t     *deviceInfo);
 
 #endif
index 7c3a56e8133fb23a1148c1f2fdbb186376bf84e2..07b9eea0736ebc78a2cefaab56d23f7360f2356d 100644 (file)
@@ -53,7 +53,6 @@
 #include "gromacs/domdec/domdec_struct.h"
 #include "gromacs/ewald/ewald.h"
 #include "gromacs/fileio/filetypes.h"
-#include "gromacs/gmxlib/md_logging.h"
 #include "gromacs/gmxlib/network.h"
 #include "gromacs/gmxlib/nonbonded/nonbonded.h"
 #include "gromacs/gpu_utils/gpu_utils.h"
@@ -74,6 +73,7 @@
 #include "gromacs/mdlib/nbnxn_gpu_data_mgmt.h"
 #include "gromacs/mdlib/nbnxn_search.h"
 #include "gromacs/mdlib/nbnxn_simd.h"
+#include "gromacs/mdlib/nbnxn_tuning.h"
 #include "gromacs/mdlib/nbnxn_util.h"
 #include "gromacs/mdlib/ns.h"
 #include "gromacs/mdlib/qmmm.h"
@@ -81,6 +81,7 @@
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/fcdata.h"
 #include "gromacs/mdtypes/group.h"
+#include "gromacs/mdtypes/iforceprovider.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/pbcutil/ishift.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/logger.h"
 #include "gromacs/utility/pleasecite.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/strconvert.h"
 
 #include "nbnxn_gpu_jit_support.h"
 
 const char *egrp_nm[egNR+1] = {
     "Coul-SR", "LJ-SR", "Buck-SR",
-    "Coul-14", "LJ-14", NULL
+    "Coul-14", "LJ-14", nullptr
 };
 
 t_forcerec *mk_forcerec(void)
@@ -349,7 +351,7 @@ check_solvent_cg(const gmx_moltype_t    *molt,
 
     /* Check if we are doing QM on this group */
     qm = FALSE;
-    if (qm_grpnr != NULL)
+    if (qm_grpnr != nullptr)
     {
         for (j = j0; j < j1 && !qm; j++)
         {
@@ -543,7 +545,7 @@ check_solvent(FILE  *                fp,
     }
 
     n_solvent_parameters = 0;
-    solvent_parameters   = NULL;
+    solvent_parameters   = nullptr;
     /* Allocate temporary array for solvent type */
     snew(cg_sp, mtop->nmolblock);
 
@@ -566,7 +568,7 @@ check_solvent(FILE  *                fp,
             {
                 check_solvent_cg(molt, cg_mol, nmol,
                                  mtop->groups.grpnr[egcQMMM] ?
-                                 mtop->groups.grpnr[egcQMMM]+at_offset+am : 0,
+                                 mtop->groups.grpnr[egcQMMM]+at_offset+am : nullptr,
                                  &mtop->groups.grps[egcQMMM],
                                  fr,
                                  &n_solvent_parameters, &solvent_parameters,
@@ -622,7 +624,7 @@ check_solvent(FILE  *                fp,
     }
     sfree(cg_sp);
 
-    if (bestsol != esolNO && fp != NULL)
+    if (bestsol != esolNO && fp != nullptr)
     {
         fprintf(fp, "\nEnabling %s-like water optimization for %d molecules.\n\n",
                 esol_names[bestsol],
@@ -702,7 +704,7 @@ static cginfo_mb_t *init_cginfo_mb(FILE *fplog, const gmx_mtop_t *mtop,
                 {
                     bId = FALSE;
                 }
-                if (mtop->groups.grpnr[egcQMMM] != NULL)
+                if (mtop->groups.grpnr[egcQMMM] != nullptr)
                 {
                     for (ai = a0; ai < a1; ai++)
                     {
@@ -991,7 +993,7 @@ void update_forcerec(t_forcerec *fr, matrix box)
 {
     if (fr->eeltype == eelGRF)
     {
-        calc_rffac(NULL, fr->eeltype, fr->epsilon_r, fr->epsilon_rf,
+        calc_rffac(nullptr, fr->eeltype, fr->epsilon_r, fr->epsilon_rf,
                    fr->rcoulomb, fr->temp, fr->zsquare, box,
                    &fr->kappa, &fr->k_rf, &fr->c_rf);
     }
@@ -1007,7 +1009,7 @@ void set_avcsixtwelve(FILE *fplog, t_forcerec *fr, const gmx_mtop_t *mtop)
     int             ntp, *typecount;
     gmx_bool        bBHAM;
     real           *nbfp;
-    real           *nbfp_comb = NULL;
+    real           *nbfp_comb = nullptr;
 
     ntp   = fr->ntype;
     bBHAM = fr->bBHAM;
@@ -1214,7 +1216,7 @@ void set_avcsixtwelve(FILE *fplog, t_forcerec *fr, const gmx_mtop_t *mtop)
         sfree(nbfp_comb);
     }
 
-    if (fplog != NULL)
+    if (fplog != nullptr)
     {
         if (fr->eDispCorr == edispcAllEner ||
             fr->eDispCorr == edispcAllEnerPres)
@@ -1296,7 +1298,7 @@ static void make_nbf_tables(FILE *fp,
     char buf[STRLEN];
     int  i, j;
 
-    if (tabfn == NULL)
+    if (tabfn == nullptr)
     {
         if (debug)
         {
@@ -1433,10 +1435,10 @@ static bondedtable_t *make_bonded_tables(FILE *fplog,
     int            ncount, *count;
     bondedtable_t *tab;
 
-    tab = NULL;
+    tab = nullptr;
 
     ncount = 0;
-    count  = NULL;
+    count  = nullptr;
     count_tables(ftype1, ftype2, mtop, &ncount, &count);
 
     // Are there any relevant tabulated bond interactions?
@@ -1504,16 +1506,8 @@ void forcerec_set_ranges(t_forcerec *fr,
 
     if (fr->bF_NoVirSum)
     {
-        fr->f_novirsum_n = natoms_f_novirsum;
-        if (fr->f_novirsum_n > fr->f_novirsum_nalloc)
-        {
-            fr->f_novirsum_nalloc = over_alloc_dd(fr->f_novirsum_n);
-            srenew(fr->f_novirsum_alloc, fr->f_novirsum_nalloc);
-        }
-    }
-    else
-    {
-        fr->f_novirsum_n = 0;
+        /* TODO: remove this + 1 when padding is properly implemented */
+        fr->forceBufferNoVirialSummation->resize(natoms_f_novirsum + 1);
     }
 }
 
@@ -1544,7 +1538,7 @@ gmx_bool can_use_allvsall(const t_inputrec *ir, gmx_bool bPrintNote, t_commrec *
              (ir->implicit_solvent == eisGBSA && (ir->gb_algorithm == egbSTILL ||
                                                   ir->gb_algorithm == egbHCT   ||
                                                   ir->gb_algorithm == egbOBC))) &&
-            getenv("GMX_NO_ALLVSALL") == NULL
+            getenv("GMX_NO_ALLVSALL") == nullptr
         );
 
     if (bAllvsAll && ir->opts.ngener > 1)
@@ -1553,11 +1547,7 @@ gmx_bool can_use_allvsall(const t_inputrec *ir, gmx_bool bPrintNote, t_commrec *
 
         if (bPrintNote)
         {
-            if (MASTER(cr))
-            {
-                fprintf(stderr, "\n%s\n", note);
-            }
-            if (fp != NULL)
+            if (fp != nullptr)
             {
                 fprintf(fp, "\n%s\n", note);
             }
@@ -1574,38 +1564,15 @@ gmx_bool can_use_allvsall(const t_inputrec *ir, gmx_bool bPrintNote, t_commrec *
 }
 
 
-gmx_bool nbnxn_gpu_acceleration_supported(FILE             *fplog,
-                                          const t_commrec  *cr,
-                                          const t_inputrec *ir,
-                                          gmx_bool          bRerunMD)
-{
-    if (bRerunMD && ir->opts.ngener > 1)
-    {
-        /* Rerun execution time is dominated by I/O and pair search,
-         * so GPUs are not very useful, plus they do not support more
-         * than one energy group. If the user requested GPUs
-         * explicitly, a fatal error is given later.  With non-reruns,
-         * we fall back to a single whole-of system energy group
-         * (which runs much faster than a multiple-energy-groups
-         * implementation would), and issue a note in the .log
-         * file. Users can re-run if they want the information. */
-        md_print_warn(cr, fplog, "Rerun with energy groups is not implemented for GPUs, falling back to the CPU\n");
-        return FALSE;
-    }
-
-    return TRUE;
-}
-
-gmx_bool nbnxn_simd_supported(FILE             *fplog,
-                              const t_commrec  *cr,
-                              const t_inputrec *ir)
+gmx_bool nbnxn_simd_supported(const gmx::MDLogger &mdlog,
+                              const t_inputrec    *ir)
 {
     if (ir->vdwtype == evdwPME && ir->ljpme_combination_rule == eljpmeLB)
     {
         /* LJ PME with LB combination rule does 7 mesh operations.
          * This so slow that we don't compile SIMD non-bonded kernels
          * for that. */
-        md_print_warn(cr, fplog, "LJ-PME with Lorentz-Berthelot is not supported with SIMD kernels, falling back to plain C kernels\n");
+        GMX_LOG(mdlog.warning).asParagraph().appendText("LJ-PME with Lorentz-Berthelot is not supported with SIMD kernels, falling back to plain C kernels");
         return FALSE;
     }
 
@@ -1661,7 +1628,7 @@ static void pick_nbnxn_kernel_cpu(const t_inputrec gmx_unused *ir,
 #endif  /* GMX_NBNXN_SIMD_2XNN && GMX_NBNXN_SIMD_4XN */
 
 
-        if (getenv("GMX_NBNXN_SIMD_4XN") != NULL)
+        if (getenv("GMX_NBNXN_SIMD_4XN") != nullptr)
         {
 #ifdef GMX_NBNXN_SIMD_4XN
             *kernel_type = nbnxnk4xN_SIMD_4xN;
@@ -1669,7 +1636,7 @@ static void pick_nbnxn_kernel_cpu(const t_inputrec gmx_unused *ir,
             gmx_fatal(FARGS, "SIMD 4xN kernels requested, but GROMACS has been compiled without support for these kernels");
 #endif
         }
-        if (getenv("GMX_NBNXN_SIMD_2XNN") != NULL)
+        if (getenv("GMX_NBNXN_SIMD_2XNN") != nullptr)
         {
 #ifdef GMX_NBNXN_SIMD_2XNN
             *kernel_type = nbnxnk4xN_SIMD_2xNN;
@@ -1685,16 +1652,17 @@ static void pick_nbnxn_kernel_cpu(const t_inputrec gmx_unused *ir,
          * 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.
+         * On Skylake table is faster in single and double. TODO: Test 5xxx series.
          */
-#if GMX_SIMD_REAL_WIDTH >= 8 || \
-        (GMX_SIMD_REAL_WIDTH >= 4 && GMX_SIMD_HAVE_FMA && !GMX_DOUBLE) || GMX_SIMD_IBM_QPX
+#if ((GMX_SIMD_REAL_WIDTH >= 8 || (GMX_SIMD_REAL_WIDTH >= 4 && GMX_SIMD_HAVE_FMA && !GMX_DOUBLE)) \
+        && !GMX_SIMD_X86_AVX_512) || GMX_SIMD_IBM_QPX
         *ewald_excl = ewaldexclAnalytical;
 #endif
-        if (getenv("GMX_NBNXN_EWALD_TABLE") != NULL)
+        if (getenv("GMX_NBNXN_EWALD_TABLE") != nullptr)
         {
             *ewald_excl = ewaldexclTable;
         }
-        if (getenv("GMX_NBNXN_EWALD_ANALYTICAL") != NULL)
+        if (getenv("GMX_NBNXN_EWALD_ANALYTICAL") != nullptr)
         {
             *ewald_excl = ewaldexclAnalytical;
         }
@@ -1706,7 +1674,7 @@ static void pick_nbnxn_kernel_cpu(const t_inputrec gmx_unused *ir,
 
 const char *lookup_nbnxn_kernel_name(int kernel_type)
 {
-    const char *returnvalue = NULL;
+    const char *returnvalue = nullptr;
     switch (kernel_type)
     {
         case nbnxnkNotSet:
@@ -1729,17 +1697,17 @@ const char *lookup_nbnxn_kernel_name(int kernel_type)
         case nbnxnkNR:
         default:
             gmx_fatal(FARGS, "Illegal kernel type selected");
-            returnvalue = NULL;
+            returnvalue = nullptr;
             break;
     }
     return returnvalue;
 };
 
 static void pick_nbnxn_kernel(FILE                *fp,
-                              const t_commrec     *cr,
+                              const gmx::MDLogger &mdlog,
                               gmx_bool             use_simd_kernels,
                               gmx_bool             bUseGPU,
-                              gmx_bool             bEmulateGPU,
+                              EmulateGpuNonbonded  emulateGpu,
                               const t_inputrec    *ir,
                               int                 *kernel_type,
                               int                 *ewald_excl,
@@ -1750,13 +1718,13 @@ static void pick_nbnxn_kernel(FILE                *fp,
     *kernel_type = nbnxnkNotSet;
     *ewald_excl  = ewaldexclTable;
 
-    if (bEmulateGPU)
+    if (emulateGpu == EmulateGpuNonbonded::Yes)
     {
         *kernel_type = nbnxnk8x8x8_PlainC;
 
         if (bDoNonbonded)
         {
-            md_print_warn(cr, fp, "Emulating a GPU run on the CPU (slow)");
+            GMX_LOG(mdlog.warning).asParagraph().appendText("Emulating a GPU run on the CPU (slow)");
         }
     }
     else if (bUseGPU)
@@ -1767,7 +1735,7 @@ static void pick_nbnxn_kernel(FILE                *fp,
     if (*kernel_type == nbnxnkNotSet)
     {
         if (use_simd_kernels &&
-            nbnxn_simd_supported(fp, cr, ir))
+            nbnxn_simd_supported(mdlog, ir))
         {
             pick_nbnxn_kernel_cpu(ir, kernel_type, ewald_excl);
         }
@@ -1777,7 +1745,7 @@ static void pick_nbnxn_kernel(FILE                *fp,
         }
     }
 
-    if (bDoNonbonded && fp != NULL)
+    if (bDoNonbonded && fp != nullptr)
     {
         fprintf(fp, "\nUsing %s %dx%d non-bonded kernels\n\n",
                 lookup_nbnxn_kernel_name(*kernel_type),
@@ -1787,66 +1755,11 @@ static void pick_nbnxn_kernel(FILE                *fp,
         if (nbnxnk4x4_PlainC == *kernel_type ||
             nbnxnk8x8x8_PlainC == *kernel_type)
         {
-            md_print_warn(cr, fp,
-                          "WARNING: Using the slow %s kernels. This should\n"
-                          "not happen during routine usage on supported platforms.\n\n",
-                          lookup_nbnxn_kernel_name(*kernel_type));
-        }
-    }
-}
-
-static void pick_nbnxn_resources(FILE                *fp,
-                                 const t_commrec     *cr,
-                                 const gmx_hw_info_t *hwinfo,
-                                 gmx_bool             bDoNonbonded,
-                                 gmx_bool            *bUseGPU,
-                                 gmx_bool            *bEmulateGPU,
-                                 const gmx_gpu_opt_t *gpu_opt)
-{
-    gmx_bool bEmulateGPUEnvVarSet;
-    char     gpu_err_str[STRLEN];
-
-    *bUseGPU = FALSE;
-
-    bEmulateGPUEnvVarSet = (getenv("GMX_EMULATE_GPU") != NULL);
-
-    /* Run GPU emulation mode if GMX_EMULATE_GPU is defined. Because
-     * GPUs (currently) only handle non-bonded calculations, we will
-     * automatically switch to emulation if non-bonded calculations are
-     * turned off via GMX_NO_NONBONDED - this is the simple and elegant
-     * way to turn off GPU initialization, data movement, and cleanup.
-     *
-     * GPU emulation can be useful to assess the performance one can expect by
-     * adding GPU(s) to the machine. The conditional below allows this even
-     * if mdrun is compiled without GPU acceleration support.
-     * Note that you should freezing the system as otherwise it will explode.
-     */
-    *bEmulateGPU = (bEmulateGPUEnvVarSet ||
-                    (!bDoNonbonded && gpu_opt->n_dev_use > 0));
-
-    /* Enable GPU mode when GPUs are available or no GPU emulation is requested.
-     */
-    if (gpu_opt->n_dev_use > 0 && !(*bEmulateGPU))
-    {
-        /* Each PP node will use the intra-node id-th device from the
-         * list of detected/selected GPUs. */
-        if (!init_gpu(fp, cr->rank_pp_intranode, gpu_err_str,
-                      &hwinfo->gpu_info, gpu_opt))
-        {
-            /* At this point the init should never fail as we made sure that
-             * we have all the GPUs we need. If it still does, we'll bail. */
-            /* TODO the decorating of gpu_err_str is nicer if it
-               happens inside init_gpu. Out here, the decorating with
-               the MPI rank makes sense. */
-            gmx_fatal(FARGS, "On rank %d failed to initialize GPU #%d: %s",
-                      cr->nodeid,
-                      get_gpu_device_id(&hwinfo->gpu_info, gpu_opt,
-                                        cr->rank_pp_intranode),
-                      gpu_err_str);
+            GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
+                    "WARNING: Using the slow %s kernels. This should\n"
+                    "not happen during routine usage on supported platforms.",
+                    lookup_nbnxn_kernel_name(*kernel_type));
         }
-
-        /* Here we actually turn on hardware GPU acceleration */
-        *bUseGPU = TRUE;
     }
 }
 
@@ -1929,7 +1842,7 @@ void init_interaction_const_tables(FILE                *fp,
     {
         init_ewald_f_table(ic, rtab);
 
-        if (fp != NULL)
+        if (fp != nullptr)
         {
             fprintf(fp, "Initialized non-bonded Ewald correction tables, spacing: %.2e size: %d\n\n",
                     1/ic->tabq_scale, ic->tabq_size);
@@ -1999,8 +1912,6 @@ init_interaction_const(FILE                       *fp,
     snew_aligned(ic->tabq_coul_F, 16, 32);
     snew_aligned(ic->tabq_coul_V, 16, 32);
 
-    ic->rlist           = fr->rlist;
-
     /* Lennard-Jones */
     ic->vdwtype         = fr->vdwtype;
     ic->vdw_modifier    = fr->vdw_modifier;
@@ -2088,7 +1999,7 @@ init_interaction_const(FILE                       *fp,
         }
     }
 
-    if (fp != NULL)
+    if (fp != nullptr)
     {
         real dispersion_shift;
 
@@ -2114,55 +2025,68 @@ init_interaction_const(FILE                       *fp,
     *interaction_const = ic;
 }
 
+/* TODO deviceInfo should be logically const, but currently
+ * init_gpu modifies it to set up NVML support. This could
+ * happen during the detection phase, and deviceInfo could
+ * the become const. */
 static void init_nb_verlet(FILE                *fp,
+                           const gmx::MDLogger &mdlog,
                            nonbonded_verlet_t **nb_verlet,
                            gmx_bool             bFEP_NonBonded,
                            const t_inputrec    *ir,
                            const t_forcerec    *fr,
                            const t_commrec     *cr,
-                           const char          *nbpu_opt)
+                           const char          *nbpu_opt,
+                           gmx_device_info_t   *deviceInfo,
+                           const gmx_mtop_t    *mtop,
+                           matrix               box)
 {
     nonbonded_verlet_t *nbv;
     int                 i;
     char               *env;
-    gmx_bool            bEmulateGPU, bHybridGPURun = FALSE;
+    gmx_bool            bHybridGPURun = FALSE;
 
     nbnxn_alloc_t      *nb_alloc;
     nbnxn_free_t       *nb_free;
 
-    snew(nbv, 1);
+    nbv = new nonbonded_verlet_t();
+
+    nbv->emulateGpu = ((getenv("GMX_EMULATE_GPU") != nullptr) ? EmulateGpuNonbonded::Yes : EmulateGpuNonbonded::No);
+    nbv->bUseGPU    = deviceInfo != nullptr;
 
-    pick_nbnxn_resources(fp, cr, fr->hwinfo,
-                         fr->bNonbonded,
-                         &nbv->bUseGPU,
-                         &bEmulateGPU,
-                         fr->gpu_opt);
+    GMX_RELEASE_ASSERT(!(nbv->emulateGpu == EmulateGpuNonbonded::Yes && nbv->bUseGPU), "When GPU emulation is active, there cannot be a GPU assignment");
+
+    if (nbv->bUseGPU)
+    {
+        /* Use the assigned GPU. */
+        init_gpu(mdlog, cr->nodeid, deviceInfo);
+    }
 
-    nbv->nbs             = NULL;
+    nbv->nbs             = nullptr;
     nbv->min_ci_balanced = 0;
 
     nbv->ngrp = (DOMAINDECOMP(cr) ? 2 : 1);
     for (i = 0; i < nbv->ngrp; i++)
     {
         nbv->grp[i].nbl_lists.nnbl = 0;
-        nbv->grp[i].nbat           = NULL;
+        nbv->grp[i].nbat           = nullptr;
         nbv->grp[i].kernel_type    = nbnxnkNotSet;
 
         if (i == 0) /* local */
         {
-            pick_nbnxn_kernel(fp, cr, fr->use_simd_kernels,
-                              nbv->bUseGPU, bEmulateGPU, ir,
+            pick_nbnxn_kernel(fp, mdlog, fr->use_simd_kernels,
+                              nbv->bUseGPU, nbv->emulateGpu, ir,
                               &nbv->grp[i].kernel_type,
                               &nbv->grp[i].ewald_excl,
                               fr->bNonbonded);
         }
         else /* non-local */
         {
-            if (nbpu_opt != NULL && strcmp(nbpu_opt, "gpu_cpu") == 0)
+            if (nbpu_opt != nullptr && strcmp(nbpu_opt, "gpu_cpu") == 0)
             {
                 /* Use GPU for local, select a CPU kernel for non-local */
-                pick_nbnxn_kernel(fp, cr, fr->use_simd_kernels,
-                                  FALSE, FALSE, ir,
+                pick_nbnxn_kernel(fp, mdlog, fr->use_simd_kernels,
+                                  FALSE, EmulateGpuNonbonded::No, ir,
                                   &nbv->grp[i].kernel_type,
                                   &nbv->grp[i].ewald_excl,
                                   fr->bNonbonded);
@@ -2178,9 +2102,13 @@ static void init_nb_verlet(FILE                *fp,
         }
     }
 
+    nbv->listParams = std::unique_ptr<NbnxnListParameters>(new NbnxnListParameters(ir->rlist));
+    setupDynamicPairlistPruning(fp, ir, mtop, box, nbv->bUseGPU, fr->ic,
+                                nbv->listParams.get());
+
     nbnxn_init_search(&nbv->nbs,
-                      DOMAINDECOMP(cr) ? &cr->dd->nc : NULL,
-                      DOMAINDECOMP(cr) ? domdec_zones(cr->dd) : NULL,
+                      DOMAINDECOMP(cr) ? &cr->dd->nc : nullptr,
+                      DOMAINDECOMP(cr) ? domdec_zones(cr->dd) : nullptr,
                       bFEP_NonBonded,
                       gmx_omp_nthreads_get(emntPairsearch));
 
@@ -2206,7 +2134,7 @@ static void init_nb_verlet(FILE                *fp,
             if (fr->vdwtype == evdwCUT &&
                 (fr->vdw_modifier == eintmodNONE ||
                  fr->vdw_modifier == eintmodPOTSHIFT) &&
-                getenv("GMX_NO_LJ_COMB_RULE") == NULL)
+                getenv("GMX_NO_LJ_COMB_RULE") == nullptr)
             {
                 /* Plain LJ cut-off: we can optimize with combination rules */
                 enbnxninitcombrule = enbnxninitcombruleDETECT;
@@ -2251,11 +2179,10 @@ static void init_nb_verlet(FILE                *fp,
         /* init the NxN GPU data; the last argument tells whether we'll have
          * both local and non-local NB calculation on GPU */
         nbnxn_gpu_init(&nbv->gpu_nbv,
-                       &fr->hwinfo->gpu_info,
-                       fr->gpu_opt,
+                       deviceInfo,
                        fr->ic,
+                       nbv->listParams.get(),
                        nbv->grp,
-                       cr->rank_pp_intranode,
                        cr->nodeid,
                        (nbv->ngrp > 1) && !bHybridGPURun);
 
@@ -2278,7 +2205,7 @@ static void init_nb_verlet(FILE                *fp,
         }
 #endif  /* GMX_THREAD_MPI */
 
-        if ((env = getenv("GMX_NB_MIN_CI")) != NULL)
+        if ((env = getenv("GMX_NB_MIN_CI")) != nullptr)
         {
             char *end;
 
@@ -2311,22 +2238,24 @@ static void init_nb_verlet(FILE                *fp,
 
 gmx_bool usingGpu(nonbonded_verlet_t *nbv)
 {
-    return nbv != NULL && nbv->bUseGPU;
+    return nbv != nullptr && nbv->bUseGPU;
 }
 
-void init_forcerec(FILE              *fp,
-                   t_forcerec        *fr,
-                   t_fcdata          *fcd,
-                   const t_inputrec  *ir,
-                   const gmx_mtop_t  *mtop,
-                   const t_commrec   *cr,
-                   matrix             box,
-                   const char        *tabfn,
-                   const char        *tabpfn,
-                   const t_filenm    *tabbfnm,
-                   const char        *nbpu_opt,
-                   gmx_bool           bNoSolvOpt,
-                   real               print_force)
+void init_forcerec(FILE                *fp,
+                   const gmx::MDLogger &mdlog,
+                   t_forcerec          *fr,
+                   t_fcdata            *fcd,
+                   const t_inputrec    *ir,
+                   const gmx_mtop_t    *mtop,
+                   const t_commrec     *cr,
+                   matrix               box,
+                   const char          *tabfn,
+                   const char          *tabpfn,
+                   const t_filenm      *tabbfnm,
+                   const char          *nbpu_opt,
+                   gmx_device_info_t   *deviceInfo,
+                   gmx_bool             bNoSolvOpt,
+                   real                 print_force)
 {
     int            i, m, negp_pp, negptable, egi, egj;
     real           rtab;
@@ -2338,15 +2267,6 @@ void init_forcerec(FILE              *fp,
     gmx_bool       bFEP_NonBonded;
     int           *nm_ind, egp_flags;
 
-    if (fr->hwinfo == NULL)
-    {
-        /* Detect hardware, gather information.
-         * In mdrun, hwinfo has already been set before calling init_forcerec.
-         * Here we ignore GPUs, as tools will not use them anyhow.
-         */
-        fr->hwinfo = gmx_detect_hardware(fp, cr, FALSE);
-    }
-
     /* By default we turn SIMD kernels on, but it might be turned off further down... */
     fr->use_simd_kernels = TRUE;
 
@@ -2421,7 +2341,7 @@ void init_forcerec(FILE              *fp,
     fr->sc_sigma6_def = gmx::power6(ir->fepvals->sc_sigma);
 
     env = getenv("GMX_SCSIGMA_MIN");
-    if (env != NULL)
+    if (env != nullptr)
     {
         dbl = 0;
         sscanf(env, "%20lf", &dbl);
@@ -2433,13 +2353,13 @@ void init_forcerec(FILE              *fp,
     }
 
     fr->bNonbonded = TRUE;
-    if (getenv("GMX_NO_NONBONDED") != NULL)
+    if (getenv("GMX_NO_NONBONDED") != nullptr)
     {
         /* turn off non-bonded calculations */
         fr->bNonbonded = FALSE;
-        md_print_warn(cr, fp,
-                      "Found environment variable GMX_NO_NONBONDED.\n"
-                      "Disabling nonbonded calculations.\n");
+        GMX_LOG(mdlog.warning).asParagraph().appendText(
+                "Found environment variable GMX_NO_NONBONDED.\n"
+                "Disabling nonbonded calculations.");
     }
 
     bGenericKernelOnly = FALSE;
@@ -2448,9 +2368,9 @@ void init_forcerec(FILE              *fp,
      * can be used with water optimization, and disable it if that is not the case.
      */
 
-    if (getenv("GMX_NB_GENERIC") != NULL)
+    if (getenv("GMX_NB_GENERIC") != nullptr)
     {
-        if (fp != NULL)
+        if (fp != nullptr)
         {
             fprintf(fp,
                     "Found environment variable GMX_NB_GENERIC.\n"
@@ -2465,10 +2385,10 @@ void init_forcerec(FILE              *fp,
         bNoSolvOpt         = TRUE;
     }
 
-    if ( (getenv("GMX_DISABLE_SIMD_KERNELS") != NULL) || (getenv("GMX_NOOPTIMIZEDKERNELS") != NULL) )
+    if ( (getenv("GMX_DISABLE_SIMD_KERNELS") != nullptr) || (getenv("GMX_NOOPTIMIZEDKERNELS") != nullptr) )
     {
         fr->use_simd_kernels = FALSE;
-        if (fp != NULL)
+        if (fp != nullptr)
         {
             fprintf(fp,
                     "\nFound environment variable GMX_DISABLE_SIMD_KERNELS.\n"
@@ -2480,16 +2400,16 @@ void init_forcerec(FILE              *fp,
     fr->bBHAM = (mtop->ffparams.functype[0] == F_BHAM);
 
     /* Check if we can/should do all-vs-all kernels */
-    fr->bAllvsAll       = can_use_allvsall(ir, FALSE, NULL, NULL);
-    fr->AllvsAll_work   = NULL;
-    fr->AllvsAll_workgb = NULL;
+    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. */
     if (fr->bAllvsAll)
     {
         fr->bAllvsAll            = FALSE;
-        if (fp != NULL)
+        if (fp != nullptr)
         {
             fprintf(fp,
                     "\nYour simulation settings would have triggered the efficient all-vs-all\n"
@@ -2513,10 +2433,18 @@ void init_forcerec(FILE              *fp,
         {
             fprintf(stderr, "\n%s\n", note);
         }
-        if (fp != NULL)
+        if (fp != nullptr)
         {
             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.");
+        }
     }
 
     /* Determine if we will do PBC for distances in bonded interactions */
@@ -2551,22 +2479,27 @@ void init_forcerec(FILE              *fp,
             }
             else
             {
-                fr->bMolPBC = TRUE;
+                /* Not making molecules whole is faster in most cases,
+                 * but With orientation restraints we need whole molecules.
+                 */
+                fr->bMolPBC = (fcd->orires.nr == 0);
 
-                if (getenv("GMX_USE_GRAPH") != NULL)
+                if (getenv("GMX_USE_GRAPH") != nullptr)
                 {
                     fr->bMolPBC = FALSE;
                     if (fp)
                     {
-                        md_print_warn(cr, fp, "GMX_USE_GRAPH is set, using the graph for bonded interactions\n");
+                        GMX_LOG(mdlog.warning).asParagraph().appendText("GMX_USE_GRAPH is set, using the graph for bonded interactions");
                     }
 
                     if (mtop->bIntermolecularInteractions)
                     {
-                        md_print_warn(cr, fp, "WARNING: Molecules linked by intermolecular interactions have to reside in the same periodic image, otherwise artifacts will occur!\n");
+                        GMX_LOG(mdlog.warning).asParagraph().appendText("WARNING: Molecules linked by intermolecular interactions have to reside in the same periodic image, otherwise artifacts will occur!");
                     }
                 }
 
+                GMX_RELEASE_ASSERT(fr->bMolPBC || !mtop->bIntermolecularInteractions, "We need to use PBC within molecules with inter-molecular interactions");
+
                 if (bSHAKE && fr->bMolPBC)
                 {
                     gmx_fatal(FARGS, "SHAKE is not properly supported with intermolecular interactions. For short simulations where linked molecules remain in the same periodic image, the environment variable GMX_USE_GRAPH can be used to override this check.\n");
@@ -2754,6 +2687,9 @@ void init_forcerec(FILE              *fp,
         fr->bcoultab = FALSE;
     }
 
+    /* This now calculates sum for q and C6 */
+    set_chargesum(fp, fr, mtop);
+
     /* Tables are used for direct ewald sum */
     if (fr->bEwald)
     {
@@ -2775,11 +2711,18 @@ void init_forcerec(FILE              *fp,
 
             if (ir->ewald_geometry == eewg3DC)
             {
+                bool haveNetCharge = (fabs(fr->qsum[0]) > 1e-4 ||
+                                      fabs(fr->qsum[1]) > 1e-4);
                 if (fp)
                 {
-                    fprintf(fp, "Using the Ewald3DC correction for systems with a slab geometry.\n");
+                    fprintf(fp, "Using the Ewald3DC correction for systems with a slab geometry%s.\n",
+                            haveNetCharge ? " and net charge" : "");
                 }
                 please_cite(fp, "In-Chul99a");
+                if (haveNetCharge)
+                {
+                    please_cite(fp, "Ballenegger2009");
+                }
             }
         }
         fr->ewaldcoeff_q = calc_ewaldcoeff_q(ir->rcoulomb, ir->ewald_rtol);
@@ -2821,10 +2764,14 @@ void init_forcerec(FILE              *fp,
     }
 
     fr->bF_NoVirSum = (EEL_FULL(fr->eeltype) || EVDW_PME(fr->vdwtype) ||
+                       fr->forceProviders->hasForcesWithoutVirialContribution() ||
                        gmx_mtop_ftype_count(mtop, F_POSRES) > 0 ||
-                       gmx_mtop_ftype_count(mtop, F_FBPOSRES) > 0 ||
-                       inputrecElecField(ir)
-                       );
+                       gmx_mtop_ftype_count(mtop, F_FBPOSRES) > 0);
+
+    if (fr->bF_NoVirSum)
+    {
+        fr->forceBufferNoVirialSummation = new PaddedRVecVector;
+    }
 
     if (fr->cutoff_scheme == ecutsGROUP &&
         ncg_mtop(mtop) > fr->cg_nalloc && !DOMAINDECOMP(cr))
@@ -2833,17 +2780,17 @@ void init_forcerec(FILE              *fp,
         fr->cg_nalloc = ncg_mtop(mtop);
         srenew(fr->cg_cm, fr->cg_nalloc);
     }
-    if (fr->shift_vec == NULL)
+    if (fr->shift_vec == nullptr)
     {
         snew(fr->shift_vec, SHIFTS);
     }
 
-    if (fr->fshift == NULL)
+    if (fr->fshift == nullptr)
     {
         snew(fr->fshift, SHIFTS);
     }
 
-    if (fr->nbfp == NULL)
+    if (fr->nbfp == nullptr)
     {
         fr->ntype = mtop->ffparams.atnr;
         fr->nbfp  = mk_nbfp(&mtop->ffparams, fr->bBHAM);
@@ -2980,9 +2927,6 @@ void init_forcerec(FILE              *fp,
                    &fr->kappa, &fr->k_rf, &fr->c_rf);
     }
 
-    /*This now calculates sum for q and c6*/
-    set_chargesum(fp, fr, mtop);
-
     /* Construct tables for the group scheme. A little unnecessary to
      * make both vdw and coul tables sometimes, but what the
      * heck. Note that both cutoff schemes construct Ewald tables in
@@ -3045,7 +2989,7 @@ void init_forcerec(FILE              *fp,
         /* make tables for ordinary interactions */
         if (bSomeNormalNbListsAreInUse)
         {
-            make_nbf_tables(fp, fr, rtab, tabfn, NULL, NULL, &fr->nblists[0]);
+            make_nbf_tables(fp, fr, rtab, tabfn, nullptr, nullptr, &fr->nblists[0]);
             m = 1;
         }
         else
@@ -3151,7 +3095,7 @@ void init_forcerec(FILE              *fp,
                                    &fr->bExcl_IntraCGAll_InterCGNone);
     if (DOMAINDECOMP(cr))
     {
-        fr->cginfo = NULL;
+        fr->cginfo = nullptr;
     }
     else
     {
@@ -3205,7 +3149,9 @@ void init_forcerec(FILE              *fp,
             GMX_RELEASE_ASSERT(ir->rcoulomb == ir->rvdw, "With Verlet lists and no PME rcoulomb and rvdw should be identical");
         }
 
-        init_nb_verlet(fp, &fr->nbv, bFEP_NonBonded, ir, fr, cr, nbpu_opt);
+        init_nb_verlet(fp, mdlog, &fr->nbv, bFEP_NonBonded, ir, fr,
+                       cr, nbpu_opt, deviceInfo,
+                       mtop, box);
     }
 
     if (ir->eDispCorr != edispcNO)
@@ -3244,10 +3190,9 @@ void pr_forcerec(FILE *fp, t_forcerec *fr)
  * in this run because the PME ranks have no knowledge of whether GPUs
  * are used or not, but all ranks need to enter the barrier below.
  */
-void free_gpu_resources(const t_forcerec     *fr,
-                        const t_commrec      *cr,
-                        const gmx_gpu_info_t *gpu_info,
-                        const gmx_gpu_opt_t  *gpu_opt)
+void free_gpu_resources(const t_forcerec        *fr,
+                        const t_commrec         *cr,
+                        const gmx_device_info_t *deviceInfo)
 {
     gmx_bool bIsPPrankUsingGPU;
     char     gpu_err_str[STRLEN];
@@ -3260,26 +3205,29 @@ void free_gpu_resources(const t_forcerec     *fr,
         nbnxn_gpu_free(fr->nbv->gpu_nbv);
         /* stop the GPU profiler (only CUDA) */
         stopGpuProfiler();
+    }
 
-        /* With tMPI we need to wait for all ranks to finish deallocation before
-         * destroying the CUDA context in free_gpu() as some tMPI ranks may be sharing
-         * GPU and context.
-         *
-         * This is not a concern in OpenCL where we use one context per rank which
-         * is freed in nbnxn_gpu_free().
-         *
-         * Note: as only PP ranks need to free GPU resources, so it is safe to
-         * not call the barrier on PME ranks.
-         */
+    /* With tMPI we need to wait for all ranks to finish deallocation before
+     * destroying the CUDA context in free_gpu() as some tMPI ranks may be sharing
+     * GPU and context.
+     *
+     * This is not a concern in OpenCL where we use one context per rank which
+     * is freed in nbnxn_gpu_free().
+     *
+     * 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
-        if (PAR(cr))
-        {
-            gmx_barrier(cr);
-        }
+    if (PAR(cr) || MULTISIM(cr))
+    {
+        gmx_barrier_physical_node(cr);
+    }
 #endif  /* GMX_THREAD_MPI */
 
+    if (bIsPPrankUsingGPU)
+    {
         /* uninitialize GPU (by destroying the context) */
-        if (!free_cuda_gpu(cr->rank_pp_intranode, gpu_err_str, gpu_info, gpu_opt))
+        if (!free_cuda_gpu(deviceInfo, gpu_err_str))
         {
             gmx_warning("On rank %d failed to free GPU #%d: %s",
                         cr->nodeid, get_current_cuda_gpu_device_id(), gpu_err_str);
index 274d909bf82446a41c62461e03acac7e2639f165..c235a8701560dc752e598dd7799853271457c928 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,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.
 #include "gromacs/mdtypes/forcerec.h"
 #include "gromacs/timing/wallcycle.h"
 
+struct gmx_device_info_t;
 struct t_commrec;
 struct t_fcdata;
 struct t_filenm;
 
+namespace gmx
+{
+class MDLogger;
+}
+
 /*! \brief Create a new forcerec structure */
 t_forcerec *mk_forcerec(void);
 
@@ -91,6 +97,7 @@ void init_interaction_const_tables(FILE                   *fp,
  *
  * The Force rec struct must be created with mk_forcerec.
  * \param[in]  fplog       File for printing
+ * \param[in]  mdlog       File for printing
  * \param[out] fr          The forcerec
  * \param[in]  fcd         Force constant data
  * \param[in]  ir          Inputrec structure
@@ -101,10 +108,12 @@ void init_interaction_const_tables(FILE                   *fp,
  * \param[in]  tabpfn      Table potential file for pair interactions
  * \param[in]  tabbfnm     Table potential files for bonded interactions
  * \param[in]  nbpu_opt    Nonbonded Processing Unit (GPU/CPU etc.)
+ * \param[in]  deviceInfo  Info about GPU device to use for short-ranged work
  * \param[in]  bNoSolvOpt  Do not use solvent optimization
  * \param[in]  print_force Print forces for atoms with force >= print_force
  */
 void init_forcerec(FILE                   *fplog,
+                   const gmx::MDLogger    &mdlog,
                    t_forcerec             *fr,
                    t_fcdata               *fcd,
                    const t_inputrec       *ir,
@@ -115,6 +124,7 @@ void init_forcerec(FILE                   *fplog,
                    const char             *tabpfn,
                    const t_filenm         *tabbfnm,
                    const char             *nbpu_opt,
+                   gmx_device_info_t      *deviceInfo,
                    gmx_bool                bNoSolvOpt,
                    real                    print_force);
 
index bc43ba9076603902c3e661784e632dd32608d274..e71150331cd117c6178d84af6afb1eff9a213e3f 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, by the GROMACS development team, led by
+ * 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.
@@ -103,11 +103,11 @@ static int init_gb_nblist(int natoms, t_nblist *nl)
     nl->maxnrj      = 0;
     nl->nri         = 0;
     nl->nrj         = 0;
-    nl->iinr        = NULL;
-    nl->gid         = NULL;
-    nl->shift       = NULL;
-    nl->jindex      = NULL;
-    nl->jjnr        = NULL;
+    nl->iinr        = nullptr;
+    nl->gid         = nullptr;
+    nl->shift       = nullptr;
+    nl->jindex      = nullptr;
+    nl->jjnr        = nullptr;
     /*nl->nltype      = nltype;*/
 
     srenew(nl->iinr,   nl->maxnri);
@@ -265,11 +265,11 @@ int init_gb(gmx_genborn_t **p_born,
     snew(fr->invsqrta, natoms);
     snew(fr->dvda,     natoms);
 
-    fr->dadx              = NULL;
-    fr->dadx_rawptr       = NULL;
+    fr->dadx              = nullptr;
+    fr->dadx_rawptr       = nullptr;
     fr->nalloc_dadx       = 0;
-    born->gpol_still_work = NULL;
-    born->gpol_hct_work   = NULL;
+    born->gpol_still_work = nullptr;
+    born->gpol_hct_work   = nullptr;
 
     /* snew(born->asurf,natoms); */
     /* snew(born->dasurf,natoms); */
@@ -927,7 +927,7 @@ int calc_gb_rad(t_commrec *cr, t_forcerec *fr, t_inputrec *ir, gmx_localtop_t *t
     int   cnt;
     int   ndadx;
 
-    if (fr->bAllvsAll && fr->dadx == NULL)
+    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.
@@ -1131,8 +1131,8 @@ real gb_bonds_tab(rvec x[], rvec f[], rvec fshift[], real *charge, real *p_gbtab
     return vctot;
 }
 
-real calc_gb_selfcorrections(t_commrec *cr, int natoms,
-                             real *charge, gmx_genborn_t *born, real *dvda, double facel)
+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;
@@ -1177,8 +1177,8 @@ real calc_gb_selfcorrections(t_commrec *cr, int natoms,
 
 }
 
-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)
+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;
@@ -1224,8 +1224,8 @@ real calc_gb_nonpolar(t_commrec *cr, t_forcerec *fr, int natoms, gmx_genborn_t *
 
 
 
-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)
+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;
@@ -1355,7 +1355,7 @@ calc_gb_forces(t_commrec *cr, t_mdatoms *md, gmx_genborn_t *born, gmx_localtop_t
     }
     else
     {
-        pbc_null = NULL;
+        pbc_null = nullptr;
     }
 
     if (sa_algorithm == esaAPPROX)
@@ -1426,7 +1426,7 @@ static gbtmpnbl_t *find_gbtmplist(struct gbtmpnbls *lists, int shift)
             srenew(lists->list, lists->list_nalloc);
             for (i = lists->nlist; i < lists->list_nalloc; i++)
             {
-                lists->list[i].aj        = NULL;
+                lists->list[i].aj        = nullptr;
                 lists->list[i].aj_nalloc = 0;
             }
 
@@ -1455,7 +1455,7 @@ static void add_bondeds_to_gblist(t_ilist *il,
         aj = il->iatoms[ind+2];
 
         int shift = CENTRAL;
-        if (g != NULL)
+        if (g != nullptr)
         {
             rvec_sub(x[ai], x[aj], dx);
             ivec_sub(SHIFT_IVEC(g, ai), SHIFT_IVEC(g, aj), dt);
@@ -1504,7 +1504,7 @@ int make_gb_nblist(t_commrec *cr, int gb_algorithm,
     t_pbc             pbc;
 
     struct gbtmpnbls *nls;
-    gbtmpnbl_t       *list = NULL;
+    gbtmpnbl_t       *list = nullptr;
 
     set_pbc(&pbc, fr->ePBC, box);
     nls   = born->nblist_work;
@@ -1620,7 +1620,7 @@ int make_gb_nblist(t_commrec *cr, int gb_algorithm,
 void make_local_gb(const t_commrec *cr, gmx_genborn_t *born, int gb_algorithm)
 {
     int           i, at0, at1;
-    gmx_domdec_t *dd = NULL;
+    gmx_domdec_t *dd = nullptr;
 
     if (DOMAINDECOMP(cr))
     {
index e459f597f2f9e9cc9509b8843a544f2b0c2c5eca..1d96860895bcb9c0fe0e05868ccd7cdeeb8f634a 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) 2010,2014,2015, by the GROMACS development team, led by
+ * 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.
@@ -377,7 +377,7 @@ genborn_allvsall_calc_still_radii(t_forcerec *           fr,
 
     aadata = *((gmx_allvsallgb2_data_t **)work);
 
-    if (aadata == NULL)
+    if (aadata == nullptr)
     {
         genborn_allvsall_setup(&aadata, top->idef.il, mdatoms->nr,
                                FALSE, FALSE, TRUE);
@@ -590,7 +590,7 @@ genborn_allvsall_calc_hct_obc_radii(t_forcerec *           fr,
 
     aadata = *((gmx_allvsallgb2_data_t **)work);
 
-    if (aadata == NULL)
+    if (aadata == nullptr)
     {
         genborn_allvsall_setup(&aadata, top->idef.il, mdatoms->nr,
                                TRUE, TRUE, TRUE);
index 479ca6592817f2fd06b65680c8148f141563adbd..211bc2b9515d52aba59e86bd2a5e93f8e3c113d0 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,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.
 #include <cstdlib>
 #include <cstring>
 
-#include "gromacs/gmxlib/md_logging.h"
 #include "gromacs/gmxlib/network.h"
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/gmxomp.h"
+#include "gromacs/utility/logger.h"
 #include "gromacs/utility/programcontext.h"
 
 /** Structure with the number of threads for each OpenMP multi-threaded
@@ -107,14 +107,12 @@ static omp_module_nthreads_t modth = { 0, 0, {0, 0, 0, 0, 0, 0, 0, 0, 0}, FALSE}
  *  The "group" scheme supports OpenMP only in PME and in thise case all but
  *  the PME nthread values default to 1.
  */
-static void pick_module_nthreads(FILE *fplog, int m,
-                                 gmx_bool bSimMaster,
+static void pick_module_nthreads(const gmx::MDLogger &mdlog, int m,
                                  gmx_bool bFullOmpSupport,
                                  gmx_bool bSepPME)
 {
     char      *env;
     int        nth;
-    char       sbuf[STRLEN];
 
     const bool bOMP = GMX_OPENMP;
 
@@ -126,10 +124,11 @@ static void pick_module_nthreads(FILE *fplog, int m,
     }
 
     /* check the environment variable */
-    if ((env = getenv(modth_env_var[m])) != NULL)
+    if ((env = getenv(modth_env_var[m])) != nullptr)
     {
         sscanf(env, "%d", &nth);
 
+        // cppcheck-suppress knownConditionTrueFalse
         if (!bOMP)
         {
             gmx_warning("%s=%d is set, but %s is compiled without OpenMP!",
@@ -139,7 +138,7 @@ static void pick_module_nthreads(FILE *fplog, int m,
 
         /* with the verlet codepath, when any GMX_*_NUM_THREADS env var is set,
          * OMP_NUM_THREADS also has to be set */
-        if (bFullOmpSupport && getenv("OMP_NUM_THREADS") == NULL)
+        if (bFullOmpSupport && getenv("OMP_NUM_THREADS") == nullptr)
         {
             gmx_warning("%s=%d is set, the default number of threads also "
                         "needs to be set with OMP_NUM_THREADS!",
@@ -161,16 +160,9 @@ static void pick_module_nthreads(FILE *fplog, int m,
         /* only babble if we are really overriding with a different value */
         if ((bSepPME && m == emntPME && nth != modth.gnth_pme) || (nth != modth.gnth))
         {
-            sprintf(sbuf, "%s=%d set, overriding the default number of %s threads",
+            GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
+                    "%s=%d set, overriding the default number of %s threads",
                     modth_env_var[m], nth, mod_name[m]);
-            if (bSimMaster)
-            {
-                fprintf(stderr, "\n%s\n", sbuf);
-            }
-            if (fplog)
-            {
-                fprintf(fplog, "%s\n", sbuf);
-            }
         }
     }
     else
@@ -192,7 +184,7 @@ void gmx_omp_nthreads_read_env(int     *nthreads_omp,
 
     GMX_RELEASE_ASSERT(nthreads_omp, "nthreads_omp must be a non-NULL pointer");
 
-    if ((env = getenv("OMP_NUM_THREADS")) != NULL)
+    if ((env = getenv("OMP_NUM_THREADS")) != nullptr)
     {
         int nt_omp;
 
@@ -235,16 +227,16 @@ void gmx_omp_nthreads_read_env(int     *nthreads_omp,
 /*! \brief Helper function for parsing various input about the number
     of OpenMP threads to use in various modules and deciding what to
     do about it. */
-static void manage_number_of_openmp_threads(FILE               *fplog,
-                                            const t_commrec    *cr,
-                                            bool                bOMP,
-                                            int                 nthreads_hw_avail,
-                                            int                 omp_nthreads_req,
-                                            int                 omp_nthreads_pme_req,
-                                            gmx_bool gmx_unused bThisNodePMEOnly,
-                                            gmx_bool            bFullOmpSupport,
-                                            int                 nppn,
-                                            gmx_bool            bSepPME)
+static void manage_number_of_openmp_threads(const gmx::MDLogger &mdlog,
+                                            const t_commrec     *cr,
+                                            bool                 bOMP,
+                                            int                  nthreads_hw_avail,
+                                            int                  omp_nthreads_req,
+                                            int                  omp_nthreads_pme_req,
+                                            gmx_bool gmx_unused  bThisNodePMEOnly,
+                                            gmx_bool             bFullOmpSupport,
+                                            int                  nppn,
+                                            gmx_bool             bSepPME)
 {
     int      nth;
     char    *env;
@@ -258,6 +250,8 @@ static void manage_number_of_openmp_threads(FILE               *fplog,
     {
         return;
     }
+#else
+    GMX_UNUSED_VALUE(cr);
 #endif
 
     if (modth.initialized)
@@ -289,7 +283,7 @@ static void manage_number_of_openmp_threads(FILE               *fplog,
      * - 1
      */
     nth = 1;
-    if ((env = getenv("OMP_NUM_THREADS")) != NULL)
+    if ((env = getenv("OMP_NUM_THREADS")) != nullptr)
     {
         if (!bOMP && (std::strncmp(env, "1", 1) != 0))
         {
@@ -352,15 +346,15 @@ static void manage_number_of_openmp_threads(FILE               *fplog,
 
     /* now set the per-module values */
     modth.nth[emntDefault] = modth.gnth;
-    pick_module_nthreads(fplog, emntDomdec, SIMMASTER(cr), bFullOmpSupport, bSepPME);
-    pick_module_nthreads(fplog, emntPairsearch, SIMMASTER(cr), bFullOmpSupport, bSepPME);
-    pick_module_nthreads(fplog, emntNonbonded, SIMMASTER(cr), bFullOmpSupport, bSepPME);
-    pick_module_nthreads(fplog, emntBonded, SIMMASTER(cr), bFullOmpSupport, bSepPME);
-    pick_module_nthreads(fplog, emntPME, SIMMASTER(cr), bFullOmpSupport, bSepPME);
-    pick_module_nthreads(fplog, emntUpdate, SIMMASTER(cr), bFullOmpSupport, bSepPME);
-    pick_module_nthreads(fplog, emntVSITE, SIMMASTER(cr), bFullOmpSupport, bSepPME);
-    pick_module_nthreads(fplog, emntLINCS, SIMMASTER(cr), bFullOmpSupport, bSepPME);
-    pick_module_nthreads(fplog, emntSETTLE, SIMMASTER(cr), bFullOmpSupport, bSepPME);
+    pick_module_nthreads(mdlog, emntDomdec, bFullOmpSupport, bSepPME);
+    pick_module_nthreads(mdlog, emntPairsearch, bFullOmpSupport, bSepPME);
+    pick_module_nthreads(mdlog, emntNonbonded, bFullOmpSupport, bSepPME);
+    pick_module_nthreads(mdlog, emntBonded, bFullOmpSupport, bSepPME);
+    pick_module_nthreads(mdlog, emntPME, bFullOmpSupport, bSepPME);
+    pick_module_nthreads(mdlog, emntUpdate, bFullOmpSupport, bSepPME);
+    pick_module_nthreads(mdlog, emntVSITE, bFullOmpSupport, bSepPME);
+    pick_module_nthreads(mdlog, emntLINCS, bFullOmpSupport, bSepPME);
+    pick_module_nthreads(mdlog, emntSETTLE, bFullOmpSupport, bSepPME);
 
     /* set the number of threads globally */
     if (bOMP)
@@ -389,11 +383,11 @@ static void manage_number_of_openmp_threads(FILE               *fplog,
 
 /*! \brief Report on the OpenMP settings that will be used */
 static void
-reportOpenmpSettings(FILE            *fplog,
-                     const t_commrec *cr,
-                     gmx_bool         bOMP,
-                     gmx_bool         bFullOmpSupport,
-                     gmx_bool         bSepPME)
+reportOpenmpSettings(const gmx::MDLogger &mdlog,
+                     const t_commrec     *cr,
+                     gmx_bool             bOMP,
+                     gmx_bool             bFullOmpSupport,
+                     gmx_bool             bSepPME)
 {
 #if GMX_THREAD_MPI
     const char *mpi_str = "per tMPI thread";
@@ -440,31 +434,35 @@ reportOpenmpSettings(FILE            *fplog,
     {
         if (nth_max == nth_min)
         {
-            md_print_info(cr, fplog, "Using %d OpenMP thread%s %s\n",
-                          nth_min, nth_min > 1 ? "s" : "",
-                          cr->nnodes > 1 ? mpi_str : "");
+            GMX_LOG(mdlog.warning).appendTextFormatted(
+                    "Using %d OpenMP thread%s %s",
+                    nth_min, nth_min > 1 ? "s" : "",
+                    cr->nnodes > 1 ? mpi_str : "");
         }
         else
         {
-            md_print_info(cr, fplog, "Using %d - %d OpenMP threads %s\n",
-                          nth_min, nth_max, mpi_str);
+            GMX_LOG(mdlog.warning).appendTextFormatted(
+                    "Using %d - %d OpenMP threads %s",
+                    nth_min, nth_max, mpi_str);
         }
     }
     if (bSepPME && (nth_pme_min != nth_min || nth_pme_max != nth_max))
     {
         if (nth_pme_max == nth_pme_min)
         {
-            md_print_info(cr, fplog, "Using %d OpenMP thread%s %s for PME\n",
-                          nth_pme_min, nth_pme_min > 1 ? "s" : "",
-                          cr->nnodes > 1 ? mpi_str : "");
+            GMX_LOG(mdlog.warning).appendTextFormatted(
+                    "Using %d OpenMP thread%s %s for PME",
+                    nth_pme_min, nth_pme_min > 1 ? "s" : "",
+                    cr->nnodes > 1 ? mpi_str : "");
         }
         else
         {
-            md_print_info(cr, fplog, "Using %d - %d OpenMP threads %s for PME\n",
-                          nth_pme_min, nth_pme_max, mpi_str);
+            GMX_LOG(mdlog.warning).appendTextFormatted(
+                    "Using %d - %d OpenMP threads %s for PME",
+                    nth_pme_min, nth_pme_max, mpi_str);
         }
     }
-    md_print_info(cr, fplog, "\n");
+    GMX_LOG(mdlog.warning);
 }
 
 /*! \brief Detect and warn about oversubscription of cores.
@@ -474,11 +472,11 @@ reportOpenmpSettings(FILE            *fplog,
  *
  * \todo Enable this for separate PME nodes as well! */
 static void
-issueOversubscriptionWarning(FILE            *fplog,
-                             const t_commrec *cr,
-                             int              nthreads_hw_avail,
-                             int              nppn,
-                             gmx_bool         bSepPME)
+issueOversubscriptionWarning(const gmx::MDLogger &mdlog,
+                             const t_commrec     *cr,
+                             int                  nthreads_hw_avail,
+                             int                  nppn,
+                             gmx_bool             bSepPME)
 {
     char sbuf[STRLEN], sbuf1[STRLEN], sbuf2[STRLEN];
 
@@ -504,14 +502,14 @@ issueOversubscriptionWarning(FILE            *fplog,
 #endif
         }
 #endif
-        md_print_warn(cr, fplog,
-                      "WARNING: %sversubscribing the available %d logical CPU cores%s with %d %s.\n"
-                      "         This will cause considerable performance loss!",
-                      sbuf2, nthreads_hw_avail, sbuf1, nppn*modth.gnth, sbuf);
+        GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
+                "WARNING: %sversubscribing the available %d logical CPU cores%s with %d %s.\n"
+                "         This will cause considerable performance loss!",
+                sbuf2, nthreads_hw_avail, sbuf1, nppn*modth.gnth, sbuf);
     }
 }
 
-void gmx_omp_nthreads_init(FILE *fplog, t_commrec *cr,
+void gmx_omp_nthreads_init(const gmx::MDLogger &mdlog, t_commrec *cr,
                            int nthreads_hw_avail,
                            int omp_nthreads_req,
                            int omp_nthreads_pme_req,
@@ -529,7 +527,7 @@ void gmx_omp_nthreads_init(FILE *fplog, t_commrec *cr,
     bSepPME = ( (cr->duty & DUTY_PP) && !(cr->duty & DUTY_PME)) ||
         (!(cr->duty & DUTY_PP) &&  (cr->duty & DUTY_PME));
 
-    manage_number_of_openmp_threads(fplog, cr, bOMP,
+    manage_number_of_openmp_threads(mdlog, cr, bOMP,
                                     nthreads_hw_avail,
                                     omp_nthreads_req, omp_nthreads_pme_req,
                                     bThisNodePMEOnly, bFullOmpSupport,
@@ -544,8 +542,8 @@ void gmx_omp_nthreads_init(FILE *fplog, t_commrec *cr,
     }
 #endif
 
-    reportOpenmpSettings(fplog, cr, bOMP, bFullOmpSupport, bSepPME);
-    issueOversubscriptionWarning(fplog, cr, nthreads_hw_avail, nppn, bSepPME);
+    reportOpenmpSettings(mdlog, cr, bOMP, bFullOmpSupport, bSepPME);
+    issueOversubscriptionWarning(mdlog, cr, nthreads_hw_avail, nppn, bSepPME);
 }
 
 int gmx_omp_nthreads_get(int mod)
index 92ac2ceb54485b3613485c9c0fbccad5d9f124a7..510825bb83435829b5b673cf878d574550adc7b7 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,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.
 
 struct t_commrec;
 
+namespace gmx
+{
+class MDLogger;
+}
+
 /** Enum values corresponding to multithreaded algorithmic modules. */
 typedef enum module_nth
 {
@@ -58,7 +63,7 @@ typedef enum module_nth
  * It is compatible with tMPI, thread-safety is ensured (for the features
  * available with tMPI).
  * This function should caled only once during the initialization of mdrun. */
-void gmx_omp_nthreads_init(FILE *fplog, t_commrec *cr,
+void gmx_omp_nthreads_init(const gmx::MDLogger &fplog, t_commrec *cr,
                            int nthreads_hw_avail,
                            int omp_nthreads_req,
                            int omp_nthreads_pme_req,
@@ -77,7 +82,7 @@ int gmx_omp_nthreads_get(int mod);
  * the reduction in computional cost due to parallelization. This routine
  * returns 1 when the overhead is expected to be higher than the gain.
  */
-static int gmx_omp_nthreads_get_simple_rvec_task(int mod, int nrvec)
+static inline int gmx_omp_nthreads_get_simple_rvec_task(int mod, int nrvec)
 {
     /* There can be a relatively large overhead to an OpenMP parallel for loop.
      * This overhead increases, slowly, with the numbe of threads used.
index 72da57236925941987e081d94957c990577d6d36..3d84a7fa82043468882bea428c13b7af5dc3ecdc 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) 2012,2014,2015, by the GROMACS development team, led by
+ * 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.
@@ -38,7 +38,6 @@
 
 #include "groupcoord.h"
 
-#include "gromacs/domdec/domdec_struct.h"
 #include "gromacs/domdec/ga2la.h"
 #include "gromacs/gmxlib/network.h"
 #include "gromacs/math/vec.h"
@@ -84,7 +83,7 @@ void dd_make_local_group_indices(gmx_ga2la_t     *ga2la,
             /* Save the atoms index in the local atom numbers array */
             (*anrs_loc)[localnr] = ii;
 
-            if (coll_ind != NULL)
+            if (coll_ind != nullptr)
             {
                 /* Keep track of where this local atom belongs in the collective index array.
                  * This is needed when reducing the local arrays to a collective/global array
@@ -233,7 +232,7 @@ extern void communicate_group_positions(
      * The rest of the code is for making the group whole again in case atoms changed
      * their PBC representation / crossed a box boundary. We only do that if the
      * shifts array is allocated. */
-    if (NULL != shifts)
+    if (nullptr != shifts)
     {
         /* To make the group whole, start with a whole group and each
          * step move the assembled positions at closest distance to the positions
@@ -281,7 +280,7 @@ extern double get_sum_of_positions(rvec x[], real weight[], const int nat, dvec
     clear_dvec(dsumvec);
 
     /* Loop over all atoms and add their weighted position vectors */
-    if (weight != NULL)
+    if (weight != nullptr)
     {
         for (i = 0; i < nat; i++)
         {
@@ -314,7 +313,7 @@ extern void get_center(rvec x[], real weight[], const int nr, rvec rcenter)
 
     weight_sum = get_sum_of_positions(x, weight, nr, dcenter);
 
-    if (weight != NULL)
+    if (weight != nullptr)
     {
         denom = weight_sum; /* Divide by the sum of weight */
     }
@@ -367,7 +366,7 @@ extern void get_center_comm(
         weight_sum  = buf[3];
     }
 
-    if (weight_loc != NULL)
+    if (weight_loc != nullptr)
     {
         denom = 1.0/weight_sum; /* Divide by the sum of weight to get center of mass e.g. */
     }
index aea0ec37ab5f7d9ea6f7fc0c970547fd6a113aaa..9ac0b817305c23e527364e9d99bc391f0d40630a 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,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.
 #include "gromacs/mdtypes/fcdata.h"
 #include "gromacs/mdtypes/forcerec.h"
 #include "gromacs/mdtypes/mdatom.h"
-#include "gromacs/mdtypes/state.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/timing/walltime_accounting.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/real.h"
 
+class energyhistory_t;
 struct gmx_mtop_t;
 struct gmx_membed_t;
 struct gmx_output_env_t;
+struct MdrunOptions;
+struct ObservablesHistory;
+struct ReplicaExchangeParameters;
 struct t_commrec;
 struct t_filenm;
 struct t_inputrec;
+class t_state;
 
 namespace gmx
 {
+
+class IMDOutputProvider;
+class MDLogger;
+
 /*! \brief Integrator algorithm implementation.
  *
  * \param[in] fplog               Log file for output
  * \param[in] cr                  Communication record
+ * \param[in] mdlog               Log writer for important output
  * \param[in] nfile               Number of files
  * \param[in] fnm                 Filename structure array
  * \param[in] oenv                Output information
- * \param[in] bVerbose            Verbose output or not
- * \param[in] nstglobalcomm       How often global communication is done
+ * \param[in] mdrunOptions        Options for mdrun
  * \param[in] vsite               Virtual site information
  * \param[in] constr              Constraint information
- * \param[in] stepout             How often we writen to the console
+ * \param[in] outputProvider      Additional output provider
  * \param[in] inputrec            Input record with mdp options
  * \param[in] top_global          Molecular topology for the whole system
  * \param[in] fcd                 Force and constraint data
  * \param[in] state_global        The state (x, v, f, box etc.) of the whole system
+ * \param[in] observablesHistory  The observables statistics history
  * \param[in] mdatoms             Structure containing atom information
  * \param[in] nrnb                Accounting for floating point operations
  * \param[in] wcycle              Wall cycle timing information
- * \param[in] ed                  Essential dynamics sampling information
  * \param[in] fr                  Force record with cut-off information and more
- * \param[in] repl_ex_nst         How often we do replica exchange (in steps)
- * \param[in] repl_ex_nex         How many replicas we have
- * \param[in] repl_ex_seed        The seed for Monte Carlo swaps
+ * \param[in] replExParams        Parameters for the replica exchange algorithm
  * \param[in] membed              Membrane embedding data structure
- * \param[in] cpt_period          How often to checkpoint the simulation
- * \param[in] max_hours           Maximume length of the simulation (wall time)
- * \param[in] imdport             Interactive MD port (socket)
- * \param[in] Flags               Flags to control mdrun
  * \param[in] walltime_accounting More timing information
  */
-typedef double integrator_t (FILE *fplog, t_commrec *cr,
+typedef double integrator_t (FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
                              int nfile, const t_filenm fnm[],
-                             const gmx_output_env_t *oenv, gmx_bool bVerbose,
-                             int nstglobalcomm,
+                             const gmx_output_env_t *oenv,
+                             const MdrunOptions &mdrunOptions,
                              gmx_vsite_t *vsite, gmx_constr_t constr,
-                             int stepout,
+                             gmx::IMDOutputProvider *outputProvider,
                              t_inputrec *inputrec,
                              gmx_mtop_t *top_global, t_fcdata *fcd,
                              t_state *state_global,
+                             ObservablesHistory *observablesHistory,
                              t_mdatoms *mdatoms,
                              t_nrnb *nrnb, gmx_wallcycle_t wcycle,
-                             gmx_edsam_t ed,
                              t_forcerec *fr,
-                             int repl_ex_nst, int repl_ex_nex, int repl_ex_seed,
+                             const ReplicaExchangeParameters &replExParams,
                              gmx_membed_t gmx_unused * membed,
-                             real cpt_period, real max_hours,
-                             int imdport,
-                             unsigned long Flags,
                              gmx_walltime_accounting_t walltime_accounting);
 
 }      // namespace gmx
index bc812c25c2d8e0da6dbe5c6e3c4e81a7bcc27d05..06fef9dbf8ed645fbaed30dcd3a211334a6a75d3 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,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.
@@ -74,12 +74,12 @@ void check_multi_int(FILE *log, const gmx_multisim_t *ms, int val,
     int     *ibuf, p;
     gmx_bool bCompatible;
 
-    if (NULL != log && !bQuiet)
+    if (nullptr != log && !bQuiet)
     {
         fprintf(log, "Multi-checking %s ... ", name);
     }
 
-    if (ms == NULL)
+    if (ms == nullptr)
     {
         gmx_fatal(FARGS,
                   "check_multi_int called with a NULL communication pointer");
@@ -97,14 +97,14 @@ void check_multi_int(FILE *log, const gmx_multisim_t *ms, int val,
 
     if (bCompatible)
     {
-        if (NULL != log && !bQuiet)
+        if (nullptr != log && !bQuiet)
         {
             fprintf(log, "OK\n");
         }
     }
     else
     {
-        if (NULL != log)
+        if (nullptr != log)
         {
             fprintf(log, "\n%s is not equal for all subsystems\n", name);
             for (p = 0; p < ms->nsim; p++)
@@ -127,12 +127,12 @@ void check_multi_int64(FILE *log, const gmx_multisim_t *ms,
     int               p;
     gmx_bool          bCompatible;
 
-    if (NULL != log && !bQuiet)
+    if (nullptr != log && !bQuiet)
     {
         fprintf(log, "Multi-checking %s ... ", name);
     }
 
-    if (ms == NULL)
+    if (ms == nullptr)
     {
         gmx_fatal(FARGS,
                   "check_multi_int called with a NULL communication pointer");
@@ -150,7 +150,7 @@ void check_multi_int64(FILE *log, const gmx_multisim_t *ms,
 
     if (bCompatible)
     {
-        if (NULL != log && !bQuiet)
+        if (nullptr != log && !bQuiet)
         {
             fprintf(log, "OK\n");
         }
@@ -159,7 +159,7 @@ void check_multi_int64(FILE *log, const gmx_multisim_t *ms,
     {
         // TODO Part of this error message would also be good to go to
         // stderr (from one rank of one sim only)
-        if (NULL != log)
+        if (nullptr != log)
         {
             fprintf(log, "\n%s is not equal for all subsystems\n", name);
             for (p = 0; p < ms->nsim; p++)
@@ -232,7 +232,7 @@ void gmx_log_close(FILE *fp)
 {
     if (fp)
     {
-        gmx_fatal_set_log_file(NULL);
+        gmx_fatal_set_log_file(nullptr);
         gmx_fio_fclose(fp);
     }
 }
index 1a21fd2e600fb5050f8e635290aa255f49c5067f..31e9955475076af26b220387920fc18d474c24dd 100644 (file)
@@ -44,7 +44,6 @@
 #include <algorithm>
 
 #include "gromacs/domdec/domdec.h"
-#include "gromacs/gmxlib/md_logging.h"
 #include "gromacs/gmxlib/network.h"
 #include "gromacs/gmxlib/nrnb.h"
 #include "gromacs/math/vec.h"
@@ -69,6 +68,7 @@
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/logger.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/snprintf.h"
 
@@ -146,93 +146,6 @@ int multisim_min(const gmx_multisim_t *ms, int nmin, int n)
     return nmin;
 }
 
-void copy_coupling_state(t_state *statea, t_state *stateb,
-                         gmx_ekindata_t *ekinda, gmx_ekindata_t *ekindb, t_grpopts* opts)
-{
-
-    /* MRS note -- might be able to get rid of some of the arguments.  Look over it when it's all debugged */
-
-    int i, j, nc;
-
-    /* Make sure we have enough space for x and v */
-    if (statea->nalloc > stateb->nalloc)
-    {
-        stateb->nalloc = statea->nalloc;
-        /* We need to allocate one element extra, since we might use
-         * (unaligned) 4-wide SIMD loads to access rvec entries.
-         */
-        srenew(stateb->x, stateb->nalloc + 1);
-        srenew(stateb->v, stateb->nalloc + 1);
-    }
-
-    stateb->natoms     = statea->natoms;
-    stateb->ngtc       = statea->ngtc;
-    stateb->nnhpres    = statea->nnhpres;
-    stateb->veta       = statea->veta;
-    if (ekinda)
-    {
-        copy_mat(ekinda->ekin, ekindb->ekin);
-        for (i = 0; i < stateb->ngtc; i++)
-        {
-            ekindb->tcstat[i].T  = ekinda->tcstat[i].T;
-            ekindb->tcstat[i].Th = ekinda->tcstat[i].Th;
-            copy_mat(ekinda->tcstat[i].ekinh, ekindb->tcstat[i].ekinh);
-            copy_mat(ekinda->tcstat[i].ekinf, ekindb->tcstat[i].ekinf);
-            ekindb->tcstat[i].ekinscalef_nhc =  ekinda->tcstat[i].ekinscalef_nhc;
-            ekindb->tcstat[i].ekinscaleh_nhc =  ekinda->tcstat[i].ekinscaleh_nhc;
-            ekindb->tcstat[i].vscale_nhc     =  ekinda->tcstat[i].vscale_nhc;
-        }
-    }
-    copy_rvecn(statea->x, stateb->x, 0, stateb->natoms);
-    copy_rvecn(statea->v, stateb->v, 0, stateb->natoms);
-    copy_mat(statea->box, stateb->box);
-    copy_mat(statea->box_rel, stateb->box_rel);
-    copy_mat(statea->boxv, stateb->boxv);
-
-    for (i = 0; i < stateb->ngtc; i++)
-    {
-        nc = i*opts->nhchainlength;
-        for (j = 0; j < opts->nhchainlength; j++)
-        {
-            stateb->nosehoover_xi[nc+j]  = statea->nosehoover_xi[nc+j];
-            stateb->nosehoover_vxi[nc+j] = statea->nosehoover_vxi[nc+j];
-        }
-    }
-    if (stateb->nhpres_xi != NULL)
-    {
-        for (i = 0; i < stateb->nnhpres; i++)
-        {
-            nc = i*opts->nhchainlength;
-            for (j = 0; j < opts->nhchainlength; j++)
-            {
-                stateb->nhpres_xi[nc+j]  = statea->nhpres_xi[nc+j];
-                stateb->nhpres_vxi[nc+j] = statea->nhpres_vxi[nc+j];
-            }
-        }
-    }
-}
-
-real compute_conserved_from_auxiliary(t_inputrec *ir, t_state *state, t_extmass *MassQ)
-{
-    real quantity = 0;
-    switch (ir->etc)
-    {
-        case etcNO:
-            break;
-        case etcBERENDSEN:
-            break;
-        case etcNOSEHOOVER:
-            quantity = NPT_energy(ir, state, MassQ);
-            break;
-        case etcVRESCALE:
-            quantity = vrescale_energy(&(ir->opts), state->therm_integral);
-            break;
-        default:
-            break;
-    }
-    return quantity;
-}
-
 /* TODO Specialize this routine into init-time and loop-time versions?
    e.g. bReadEkin is only true when restoring from checkpoint */
 void compute_globals(FILE *fplog, gmx_global_stat *gstat, t_commrec *cr, t_inputrec *ir,
@@ -240,7 +153,7 @@ void compute_globals(FILE *fplog, gmx_global_stat *gstat, t_commrec *cr, t_input
                      t_state *state, t_mdatoms *mdatoms,
                      t_nrnb *nrnb, t_vcm *vcm, gmx_wallcycle_t wcycle,
                      gmx_enerdata_t *enerd, tensor force_vir, tensor shake_vir, tensor total_vir,
-                     tensor pres, rvec mu_tot, gmx_constr_t constr,
+                     tensor pres, rvec mu_tot, struct gmx_constr *constr,
                      gmx::SimulationSignaller *signalCoordinator,
                      matrix box, int *totalNumberOfBondedInteractions,
                      gmx_bool *bSumEkinhOld, int flags)
@@ -291,7 +204,7 @@ void compute_globals(FILE *fplog, gmx_global_stat *gstat, t_commrec *cr, t_input
     if (bStopCM)
     {
         calc_vcm_grp(0, mdatoms->homenr, mdatoms,
-                     state->x, state->v, vcm);
+                     as_rvec_array(state->x.data()), as_rvec_array(state->v.data()), vcm);
     }
 
     if (bTemp || bStopCM || bPres || bEner || bConstrain)
@@ -311,7 +224,7 @@ void compute_globals(FILE *fplog, gmx_global_stat *gstat, t_commrec *cr, t_input
             {
                 wallcycle_start(wcycle, ewcMoveE);
                 global_stat(gstat, cr, enerd, force_vir, shake_vir, mu_tot,
-                            ir, ekind, constr, bStopCM ? vcm : NULL,
+                            ir, ekind, constr, bStopCM ? vcm : nullptr,
                             signalBuffer.size(), signalBuffer.data(),
                             totalNumberOfBondedInteractions,
                             *bSumEkinhOld, flags);
@@ -326,7 +239,7 @@ void compute_globals(FILE *fplog, gmx_global_stat *gstat, t_commrec *cr, t_input
     {
         correct_ekin(debug,
                      0, mdatoms->homenr,
-                     state->v, vcm->group_p[0],
+                     as_rvec_array(state->v.data()), vcm->group_p[0],
                      mdatoms->massT, mdatoms->tmass, ekind->ekin);
     }
 
@@ -335,7 +248,7 @@ void compute_globals(FILE *fplog, gmx_global_stat *gstat, t_commrec *cr, t_input
     {
         check_cm_grp(fplog, vcm, ir, 1);
         do_stopcm_grp(0, mdatoms->homenr, mdatoms->cVCM,
-                      state->x, state->v, vcm);
+                      as_rvec_array(state->x.data()), as_rvec_array(state->v.data()), vcm);
         inc_nrnb(nrnb, eNR_STOPCM, mdatoms->homenr);
     }
 
@@ -400,16 +313,18 @@ void compute_globals(FILE *fplog, gmx_global_stat *gstat, t_commrec *cr, t_input
     }
 }
 
-void check_nst_param(FILE *fplog, t_commrec *cr,
-                     const char *desc_nst, int nst,
-                     const char *desc_p, int *p)
+/* check whether an 'nst'-style parameter p is a multiple of nst, and
+   set it to be one if not, with a warning. */
+static void check_nst_param(const gmx::MDLogger &mdlog,
+                            const char *desc_nst, int nst,
+                            const char *desc_p, int *p)
 {
     if (*p > 0 && *p % nst != 0)
     {
         /* Round up to the next multiple of nst */
         *p = ((*p)/nst + 1)*nst;
-        md_print_warn(cr, fplog,
-                      "NOTE: %s changes %s to %d\n", desc_nst, desc_p, *p);
+        GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
+                "NOTE: %s changes %s to %d", desc_nst, desc_p, *p);
     }
 }
 
@@ -536,8 +451,7 @@ static int lcd4(int i1, int i2, int i3, int i4)
     return nst;
 }
 
-int check_nstglobalcomm(FILE *fplog, t_commrec *cr,
-                        int nstglobalcomm, t_inputrec *ir)
+int check_nstglobalcomm(const gmx::MDLogger &mdlog, int nstglobalcomm, t_inputrec *ir)
 {
     if (!EI_DYNAMICS(ir->eI))
     {
@@ -585,42 +499,43 @@ int check_nstglobalcomm(FILE *fplog, t_commrec *cr,
             nstglobalcomm > ir->nstlist && nstglobalcomm % ir->nstlist != 0)
         {
             nstglobalcomm = (nstglobalcomm / ir->nstlist)*ir->nstlist;
-            md_print_warn(cr, fplog, "WARNING: nstglobalcomm is larger than nstlist, but not a multiple, setting it to %d\n", nstglobalcomm);
+            GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
+                    "WARNING: nstglobalcomm is larger than nstlist, but not a multiple, setting it to %d",
+                    nstglobalcomm);
         }
         if (ir->nstcalcenergy > 0)
         {
-            check_nst_param(fplog, cr, "-gcom", nstglobalcomm,
+            check_nst_param(mdlog, "-gcom", nstglobalcomm,
                             "nstcalcenergy", &ir->nstcalcenergy);
         }
         if (ir->etc != etcNO && ir->nsttcouple > 0)
         {
-            check_nst_param(fplog, cr, "-gcom", nstglobalcomm,
+            check_nst_param(mdlog, "-gcom", nstglobalcomm,
                             "nsttcouple", &ir->nsttcouple);
         }
         if (ir->epc != epcNO && ir->nstpcouple > 0)
         {
-            check_nst_param(fplog, cr, "-gcom", nstglobalcomm,
+            check_nst_param(mdlog, "-gcom", nstglobalcomm,
                             "nstpcouple", &ir->nstpcouple);
         }
 
-        check_nst_param(fplog, cr, "-gcom", nstglobalcomm,
+        check_nst_param(mdlog, "-gcom", nstglobalcomm,
                         "nstenergy", &ir->nstenergy);
 
-        check_nst_param(fplog, cr, "-gcom", nstglobalcomm,
+        check_nst_param(mdlog, "-gcom", nstglobalcomm,
                         "nstlog", &ir->nstlog);
     }
 
     if (ir->comm_mode != ecmNO && ir->nstcomm < nstglobalcomm)
     {
-        md_print_warn(cr, fplog, "WARNING: Changing nstcomm from %d to %d\n",
-                      ir->nstcomm, nstglobalcomm);
+        GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
+                "WARNING: Changing nstcomm from %d to %d",
+                ir->nstcomm, nstglobalcomm);
         ir->nstcomm = nstglobalcomm;
     }
 
-    if (fplog)
-    {
-        fprintf(fplog, "Intra-simulation communication will occur every %d steps.\n", nstglobalcomm);
-    }
+    GMX_LOG(mdlog.info).appendTextFormatted(
+            "Intra-simulation communication will occur every %d steps.\n", nstglobalcomm);
     return nstglobalcomm;
 }
 
@@ -643,6 +558,7 @@ void rerun_parallel_comm(t_commrec *cr, t_trxframe *fr,
 
 }
 
+// TODO Most of this logic seems to belong in the respective modules
 void set_state_entries(t_state *state, const t_inputrec *ir)
 {
     /* The entries in the state in the tpx file might not correspond
@@ -655,33 +571,10 @@ void set_state_entries(t_state *state, const t_inputrec *ir)
         state->flags |= (1<<estFEPSTATE);
     }
     state->flags |= (1<<estX);
-    if (state->lambda == NULL)
-    {
-        snew(state->lambda, efptNR);
-    }
-    if (state->x == NULL)
-    {
-        /* We need to allocate one element extra, since we might use
-         * (unaligned) 4-wide SIMD loads to access rvec entries.
-         */
-        snew(state->x, state->nalloc + 1);
-    }
+    GMX_RELEASE_ASSERT(state->x.size() >= static_cast<unsigned int>(state->natoms), "We should start a run with an initialized state->x");
     if (EI_DYNAMICS(ir->eI))
     {
         state->flags |= (1<<estV);
-        if (state->v == NULL)
-        {
-            snew(state->v, state->nalloc + 1);
-        }
-    }
-    if (ir->eI == eiCG)
-    {
-        state->flags |= (1<<estCGP);
-        if (state->cg_p == NULL)
-        {
-            /* cg_p is not stored in the tpx file, so we need to allocate it */
-            snew(state->cg_p, state->nalloc + 1);
-        }
     }
 
     state->nnhpres = 0;
@@ -695,23 +588,21 @@ void set_state_entries(t_state *state, const t_inputrec *ir)
         if ((ir->epc == epcPARRINELLORAHMAN) || (ir->epc == epcMTTK))
         {
             state->flags |= (1<<estBOXV);
+            state->flags |= (1<<estPRES_PREV);
         }
-        if (ir->epc != epcNO)
+        if (inputrecNptTrotter(ir) || (inputrecNphTrotter(ir)))
         {
-            if (inputrecNptTrotter(ir) || (inputrecNphTrotter(ir)))
-            {
-                state->nnhpres = 1;
-                state->flags  |= (1<<estNHPRES_XI);
-                state->flags  |= (1<<estNHPRES_VXI);
-                state->flags  |= (1<<estSVIR_PREV);
-                state->flags  |= (1<<estFVIR_PREV);
-                state->flags  |= (1<<estVETA);
-                state->flags  |= (1<<estVOL0);
-            }
-            else
-            {
-                state->flags |= (1<<estPRES_PREV);
-            }
+            state->nnhpres = 1;
+            state->flags  |= (1<<estNHPRES_XI);
+            state->flags  |= (1<<estNHPRES_VXI);
+            state->flags  |= (1<<estSVIR_PREV);
+            state->flags  |= (1<<estFVIR_PREV);
+            state->flags  |= (1<<estVETA);
+            state->flags  |= (1<<estVOL0);
+        }
+        if (ir->epc == epcBERENDSEN)
+        {
+            state->flags  |= (1<<estBAROS_INT);
         }
     }
 
@@ -721,15 +612,17 @@ void set_state_entries(t_state *state, const t_inputrec *ir)
         state->flags |= (1<<estNH_VXI);
     }
 
-    if (ir->etc == etcVRESCALE)
+    if (ir->etc == etcVRESCALE || ir->etc == etcBERENDSEN)
     {
-        state->flags |= (1<<estTC_INT);
+        state->flags |= (1<<estTHERM_INT);
     }
 
     init_gtc_state(state, state->ngtc, state->nnhpres, ir->opts.nhchainlength); /* allocate the space for nose-hoover chains */
     init_ekinstate(&state->ekinstate, ir);
-    snew(state->enerhist, 1);
-    init_energyhistory(state->enerhist);
-    init_df_history(&state->dfhist, ir->fepvals->n_lambda);
-    state->swapstate.eSwapCoords = ir->eSwapCoords;
+
+    if (ir->bExpanded)
+    {
+        snew(state->dfhist, 1);
+        init_df_history(state->dfhist, ir->fepvals->n_lambda);
+    }
 }
index b2b8b25b8ce5b6e39f3f0ba71c09f4282c1a9429..0ad1879c35c65c7f4294dc69a34c70347ae834e8 100644 (file)
@@ -51,14 +51,13 @@ struct t_forcerec;
 struct t_grpopts;
 struct t_lambda;
 struct t_nrnb;
-struct t_state;
+class t_state;
 struct t_trxframe;
 
 namespace gmx
 {
-
+class MDLogger;
 class SimulationSignaller;
-
 }
 
 /* Define a number of flags to better control the information
@@ -92,16 +91,9 @@ class SimulationSignaller;
 /*! \brief Return the number of steps that will take place between
  * intra-simulation communications, given the constraints of the
  * inputrec and the value of mdrun -gcom. */
-int check_nstglobalcomm(FILE       *fplog,
-                        t_commrec  *cr,
-                        int         nstglobalcomm,
-                        t_inputrec *ir);
-
-/* check whether an 'nst'-style parameter p is a multiple of nst, and
-   set it to be one if not, with a warning. */
-void check_nst_param(FILE *fplog, t_commrec *cr,
-                     const char *desc_nst, int nst,
-                     const char *desc_p, int *p);
+int check_nstglobalcomm(const gmx::MDLogger &mdlog,
+                        int                  nstglobalcomm,
+                        t_inputrec          *ir);
 
 /*! \brief Return true if the \p value is equal across the set of multi-simulations
  *
@@ -112,10 +104,6 @@ bool multisim_int_all_are_equal(const gmx_multisim_t *ms,
 void rerun_parallel_comm(t_commrec *cr, t_trxframe *fr,
                          gmx_bool *bLastStep);
 
-/* get the conserved energy associated with the ensemble type*/
-real compute_conserved_from_auxiliary(t_inputrec *ir, t_state *state,
-                                      t_extmass *MassQ);
-
 /* set the lambda values at each step of mdrun when they change */
 void set_current_lambdas(gmx_int64_t step, t_lambda *fepvals, gmx_bool bRerunMD,
                          t_trxframe *rerun_fr, t_state *state_global, t_state *state, double lam0[]);
@@ -123,10 +111,6 @@ void set_current_lambdas(gmx_int64_t step, t_lambda *fepvals, gmx_bool bRerunMD,
 int multisim_min(const gmx_multisim_t *ms, int nmin, int n);
 /* Set an appropriate value for n across the whole multi-simulation */
 
-void copy_coupling_state(t_state *statea, t_state *stateb,
-                         gmx_ekindata_t *ekinda, gmx_ekindata_t *ekindb, t_grpopts* opts);
-/* Copy stuff from state A to state B */
-
 void compute_globals(FILE *fplog, gmx_global_stat *gstat, t_commrec *cr, t_inputrec *ir,
                      t_forcerec *fr, gmx_ekindata_t *ekind,
                      t_state *state, t_mdatoms *mdatoms,
index dd37ca26eb1d3279e96df8de04dd88154087b602..823858ed37ab13c76aeff0481f28a4bc683d7821 100644 (file)
@@ -45,6 +45,7 @@
 #include "gromacs/mdlib/qmmm.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/topology/mtop_lookup.h"
 #include "gromacs/topology/mtop_util.h"
 #include "gromacs/topology/topology.h"
 #include "gromacs/utility/exceptions.h"
 
 t_mdatoms *init_mdatoms(FILE *fp, const gmx_mtop_t *mtop, gmx_bool bFreeEnergy)
 {
-    int                     a;
-    double                  tmA, tmB;
-    t_atom                 *atom;
-    t_mdatoms              *md;
-    gmx_mtop_atomloop_all_t aloop;
-
+    t_mdatoms *md;
     snew(md, 1);
 
     md->nenergrp = mtop->groups.grps[egcENER].nr;
-    md->bVCMgrps = FALSE;
-    tmA          = 0.0;
-    tmB          = 0.0;
+    md->bVCMgrps = (mtop->groups.grps[egcVCM].nr > 1);
+
+    /* Determine the total system mass and perturbed atom counts */
+    double                     totalMassA = 0.0;
+    double                     totalMassB = 0.0;
 
-    aloop = gmx_mtop_atomloop_all_init(mtop);
-    while (gmx_mtop_atomloop_all_next(aloop, &a, &atom))
+    gmx_mtop_atomloop_block_t  aloop = gmx_mtop_atomloop_block_init(mtop);
+    const t_atom              *atom;
+    int                        nmol;
+    while (gmx_mtop_atomloop_block_next(aloop, &atom, &nmol))
     {
-        if (ggrpnr(&mtop->groups, egcVCM, a) > 0)
-        {
-            md->bVCMgrps = TRUE;
-        }
+        totalMassA += nmol*atom->m;
+        totalMassB += nmol*atom->mB;
 
         if (bFreeEnergy && PERTURBED(*atom))
         {
             md->nPerturbed++;
             if (atom->mB != atom->m)
             {
-                md->nMassPerturbed++;
+                md->nMassPerturbed += nmol;
             }
             if (atom->qB != atom->q)
             {
-                md->nChargePerturbed++;
+                md->nChargePerturbed += nmol;
             }
             if (atom->typeB != atom->type)
             {
-                md->nTypePerturbed++;
+                md->nTypePerturbed += nmol;
             }
         }
-
-        tmA += atom->m;
-        tmB += atom->mB;
     }
 
-    md->tmassA = tmA;
-    md->tmassB = tmB;
+    md->tmassA = totalMassA;
+    md->tmassB = totalMassB;
 
     if (bFreeEnergy && fp)
     {
@@ -117,8 +112,6 @@ void atoms2md(const gmx_mtop_t *mtop, const t_inputrec *ir,
               t_mdatoms *md)
 {
     gmx_bool              bLJPME;
-    gmx_mtop_atomlookup_t alook;
-    int                   i;
     const t_grpopts      *opts;
     const gmx_groups_t   *groups;
     int                   nthreads gmx_unused;
@@ -129,17 +122,14 @@ void atoms2md(const gmx_mtop_t *mtop, const t_inputrec *ir,
 
     groups = &mtop->groups;
 
-    /* Index==NULL indicates no DD (unless we have a DD node with no
-     * atoms), so also check for homenr. This should be
-     * signaled properly with an extra parameter or nindex==-1.
-     */
-    if (index == NULL && (homenr > 0))
+    /* nindex>=0 indicates DD where we use an index */
+    if (nindex >= 0)
     {
-        md->nr = mtop->natoms;
+        md->nr = nindex;
     }
     else
     {
-        md->nr = nindex;
+        md->nr = mtop->natoms;
     }
 
     if (md->nr > md->nalloc)
@@ -153,6 +143,7 @@ void atoms2md(const gmx_mtop_t *mtop, const t_inputrec *ir,
         }
         srenew(md->massT, md->nalloc);
         srenew(md->invmass, md->nalloc);
+        srenew(md->invMassPerDim, md->nalloc);
         srenew(md->chargeA, md->nalloc);
         srenew(md->typeA, md->nalloc);
         if (md->nPerturbed)
@@ -207,11 +198,11 @@ void atoms2md(const gmx_mtop_t *mtop, const t_inputrec *ir,
          * Therefore, when adding code, the user should use something like:
          * gprnrU1 = (md->cU1==NULL ? 0 : md->cU1[localatindex])
          */
-        if (mtop->groups.grpnr[egcUser1] != NULL)
+        if (mtop->groups.grpnr[egcUser1] != nullptr)
         {
             srenew(md->cU1, md->nalloc);
         }
-        if (mtop->groups.grpnr[egcUser2] != NULL)
+        if (mtop->groups.grpnr[egcUser2] != nullptr)
         {
             srenew(md->cU2, md->nalloc);
         }
@@ -222,29 +213,28 @@ void atoms2md(const gmx_mtop_t *mtop, const t_inputrec *ir,
         }
     }
 
-    alook = gmx_mtop_atomlookup_init(mtop);
+    int molb = 0;
 
     // cppcheck-suppress unreadVariable
     nthreads = gmx_omp_nthreads_get(emntDefault);
-#pragma omp parallel for num_threads(nthreads) schedule(static)
-    for (i = 0; i < md->nr; i++)
+#pragma omp parallel for num_threads(nthreads) schedule(static) firstprivate(molb)
+    for (int i = 0; i < md->nr; i++)
     {
         try
         {
             int      g, ag;
             real     mA, mB, fac;
             real     c6, c12;
-            t_atom  *atom;
 
-            if (index == NULL)
+            if (index == nullptr)
             {
                 ag = i;
             }
             else
             {
-                ag   = index[i];
+                ag = index[i];
             }
-            gmx_mtop_atomnr_to_atom(alook, ag, &atom);
+            const t_atom &atom = mtopGetAtomParameters(mtop, ag, &molb);
 
             if (md->cFREEZE)
             {
@@ -277,14 +267,14 @@ void atoms2md(const gmx_mtop_t *mtop, const t_inputrec *ir,
                 {
                     /* The friction coefficient is mass/tau_t */
                     fac = ir->delta_t/opts->tau_t[md->cTC ? groups->grpnr[egcTC][ag] : 0];
-                    mA  = 0.5*atom->m*fac;
-                    mB  = 0.5*atom->mB*fac;
+                    mA  = 0.5*atom.m*fac;
+                    mB  = 0.5*atom.mB*fac;
                 }
             }
             else
             {
-                mA = atom->m;
-                mB = atom->mB;
+                mA = atom.m;
+                mB = atom.mB;
             }
             if (md->nMassPerturbed)
             {
@@ -292,9 +282,13 @@ void atoms2md(const gmx_mtop_t *mtop, const t_inputrec *ir,
                 md->massB[i]  = mB;
             }
             md->massT[i]    = mA;
+
             if (mA == 0.0)
             {
-                md->invmass[i]    = 0;
+                md->invmass[i]           = 0;
+                md->invMassPerDim[i][XX] = 0;
+                md->invMassPerDim[i][YY] = 0;
+                md->invMassPerDim[i][ZZ] = 0;
             }
             else if (md->cFREEZE)
             {
@@ -314,17 +308,26 @@ void atoms2md(const gmx_mtop_t *mtop, const t_inputrec *ir,
                      */
                     md->invmass[i]  = 1.0/mA;
                 }
+                for (int d = 0; d < DIM; d++)
+                {
+                    md->invMassPerDim[i][d] = (opts->nFreeze[g][d] ? 0 : 1.0/mA);
+                }
             }
             else
             {
-                md->invmass[i]    = 1.0/mA;
+                md->invmass[i]  = 1.0/mA;
+                for (int d = 0; d < DIM; d++)
+                {
+                    md->invMassPerDim[i][d] = 1.0/mA;
+                }
             }
-            md->chargeA[i]      = atom->q;
-            md->typeA[i]        = atom->type;
+
+            md->chargeA[i]      = atom.q;
+            md->typeA[i]        = atom.type;
             if (bLJPME)
             {
-                c6                = mtop->ffparams.iparams[atom->type*(mtop->ffparams.atnr+1)].lj.c6;
-                c12               = mtop->ffparams.iparams[atom->type*(mtop->ffparams.atnr+1)].lj.c12;
+                c6                = mtop->ffparams.iparams[atom.type*(mtop->ffparams.atnr+1)].lj.c6;
+                c12               = mtop->ffparams.iparams[atom.type*(mtop->ffparams.atnr+1)].lj.c12;
                 md->sqrt_c6A[i]   = sqrt(c6);
                 if (c6 == 0.0 || c12 == 0)
                 {
@@ -338,13 +341,13 @@ void atoms2md(const gmx_mtop_t *mtop, const t_inputrec *ir,
             }
             if (md->nPerturbed)
             {
-                md->bPerturbed[i] = PERTURBED(*atom);
-                md->chargeB[i]    = atom->qB;
-                md->typeB[i]      = atom->typeB;
+                md->bPerturbed[i] = PERTURBED(atom);
+                md->chargeB[i]    = atom.qB;
+                md->typeB[i]      = atom.typeB;
                 if (bLJPME)
                 {
-                    c6                = mtop->ffparams.iparams[atom->typeB*(mtop->ffparams.atnr+1)].lj.c6;
-                    c12               = mtop->ffparams.iparams[atom->typeB*(mtop->ffparams.atnr+1)].lj.c12;
+                    c6                = mtop->ffparams.iparams[atom.typeB*(mtop->ffparams.atnr+1)].lj.c6;
+                    c12               = mtop->ffparams.iparams[atom.typeB*(mtop->ffparams.atnr+1)].lj.c12;
                     md->sqrt_c6B[i]   = sqrt(c6);
                     if (c6 == 0.0 || c12 == 0)
                     {
@@ -357,7 +360,7 @@ void atoms2md(const gmx_mtop_t *mtop, const t_inputrec *ir,
                     md->sigma3B[i]    = 1/(md->sigmaB[i]*md->sigmaB[i]*md->sigmaB[i]);
                 }
             }
-            md->ptype[i]    = atom->ptype;
+            md->ptype[i]    = atom.ptype;
             if (md->cTC)
             {
                 md->cTC[i]    = groups->grpnr[egcTC][ag];
@@ -387,7 +390,7 @@ void atoms2md(const gmx_mtop_t *mtop, const t_inputrec *ir,
 
             if (ir->bQMMM)
             {
-                if (groups->grpnr[egcQMMM] == 0 ||
+                if (groups->grpnr[egcQMMM] == nullptr ||
                     groups->grpnr[egcQMMM][ag] < groups->grps[egcQMMM].nr-1)
                 {
                     md->bQM[i]      = TRUE;
@@ -401,37 +404,49 @@ void atoms2md(const gmx_mtop_t *mtop, const t_inputrec *ir,
         GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
     }
 
-    gmx_mtop_atomlookup_destroy(alook);
-
     md->homenr = homenr;
+    /* We set mass, invmass, invMassPerDim and tmass for lambda=0.
+     * For free-energy runs, these should be updated using update_mdatoms().
+     */
+    md->tmass  = md->tmassA;
     md->lambda = 0;
 }
 
 void update_mdatoms(t_mdatoms *md, real lambda)
 {
-    int    al, end;
-    real   L1 = 1.0-lambda;
-
-    end = md->nr;
-
-    if (md->nMassPerturbed)
+    if (md->nMassPerturbed && lambda != md->lambda)
     {
-        for (al = 0; (al < end); al++)
+        real L1 = 1 - lambda;
+
+        /* Update masses of perturbed atoms for the change in lambda */
+        // cppcheck-suppress unreadVariable
+        int gmx_unused nthreads = gmx_omp_nthreads_get(emntDefault);
+#pragma omp parallel for num_threads(nthreads) schedule(static)
+        for (int i = 0; i < md->nr; i++)
         {
-            if (md->bPerturbed[al])
+            if (md->bPerturbed[i])
             {
-                md->massT[al] = L1*md->massA[al]+ lambda*md->massB[al];
-                if (md->invmass[al] > 1.1*ALMOST_ZERO)
+                md->massT[i] = L1*md->massA[i] + lambda*md->massB[i];
+                /* Atoms with invmass 0 or ALMOST_ZERO are massless or frozen
+                 * and their invmass does not depend on lambda.
+                 */
+                if (md->invmass[i] > 1.1*ALMOST_ZERO)
                 {
-                    md->invmass[al] = 1.0/md->massT[al];
+                    md->invmass[i] = 1.0/md->massT[i];
+                    for (int d = 0; d < DIM; d++)
+                    {
+                        if (md->invMassPerDim[i][d] > 1.1*ALMOST_ZERO)
+                        {
+                            md->invMassPerDim[i][d] = md->invmass[i];
+                        }
+                    }
                 }
             }
         }
-        md->tmass = L1*md->tmassA + lambda*md->tmassB;
-    }
-    else
-    {
-        md->tmass = md->tmassA;
+
+        /* Update the system mass for the change in lambda */
+        md->tmass  = L1*md->tmassA + lambda*md->tmassB;
     }
+
     md->lambda = lambda;
 }
index 3b811031ed5445efe327e7695ddc43d20a1c5fb4..dd9dc111d7a8b7939bce21e13f38f09ab068cca0 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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,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.
@@ -54,9 +54,16 @@ void atoms2md(const gmx_mtop_t *mtop, const t_inputrec *ir,
               t_mdatoms *md);
 /* This routine copies the atoms->atom struct into md.
  * If index!=NULL only the indexed atoms are copied.
+ * For the masses the A-state (lambda=0) mass is used.
+ * Sets md->lambda = 0.
+ * In free-energy runs, update_mdatoms() should be called after atoms2md()
+ * to set the masses corresponding to the value of lambda at each step.
  */
 
 void update_mdatoms(t_mdatoms *md, real lambda);
-/* (Re)set all the mass parameters */
+/* When necessary, sets all the mass parameters to values corresponding
+ * to the free-energy parameter lambda.
+ * Sets md->lambda = lambda.
+ */
 
 #endif
index 040311b646cfbaad81105c077e36e093c14fd715..12c0d21ca2ba865445479f3da74353f01815c012 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,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.
@@ -59,6 +59,7 @@
 #include "gromacs/mdtypes/group.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/mdtypes/state.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/pulling/pull.h"
 #include "gromacs/topology/mtop_util.h"
@@ -169,7 +170,7 @@ t_mdebin *init_mdebin(ener_file_t       fp_ene,
         {
             md->nCrmsd = 1;
         }
-        md->bConstrVir = (getenv("GMX_CONSTRAINTVIR") != NULL);
+        md->bConstrVir = (getenv("GMX_CONSTRAINTVIR") != nullptr);
     }
     else
     {
@@ -277,8 +278,7 @@ t_mdebin *init_mdebin(ener_file_t       fp_ene,
         }
         else if (i == F_ECONSERVED)
         {
-            md->bEner[i] = ((ir->etc == etcNOSEHOOVER || ir->etc == etcVRESCALE) &&
-                            (ir->epc == epcNO || ir->epc == epcMTTK));
+            md->bEner[i] = (integratorHasConservedEnergyQuantity(ir));
         }
         else
         {
@@ -311,7 +311,7 @@ t_mdebin *init_mdebin(ener_file_t       fp_ene,
     /* Pass NULL for unit to let get_ebin_space determine the units
      * for interaction_function[i].longname
      */
-    md->ie    = get_ebin_space(md->ebin, md->f_nre, ener_nm, NULL);
+    md->ie    = get_ebin_space(md->ebin, md->f_nre, ener_nm, nullptr);
     if (md->nCrmsd)
     {
         /* This should be called directly after the call for md->ie,
@@ -567,10 +567,10 @@ t_mdebin *init_mdebin(ener_file_t       fp_ene,
         do_enxnms(fp_ene, &md->ebin->nener, &md->ebin->enm);
     }
 
-    md->print_grpnms = NULL;
+    md->print_grpnms = nullptr;
 
     /* check whether we're going to write dh histograms */
-    md->dhc = NULL;
+    md->dhc = nullptr;
     if (ir->fepvals->separate_dhdl_file == esepdhdlfileNO)
     {
         /* Currently dh histograms are only written with dynamics */
@@ -580,7 +580,7 @@ t_mdebin *init_mdebin(ener_file_t       fp_ene,
 
             mde_delta_h_coll_init(md->dhc, ir);
         }
-        md->fp_dhdl = NULL;
+        md->fp_dhdl = nullptr;
         snew(md->dE, ir->fepvals->n_lambda);
     }
     else
@@ -1105,7 +1105,7 @@ void upd_mdebin(t_mdebin       *md,
         {
             /* zero for simulated tempering */
             md->dE[i] = enerd->enerpart_lambda[i+1]-enerd->enerpart_lambda[0];
-            if (md->temperatures != NULL)
+            if (md->temperatures != nullptr)
             {
                 /* MRS: is this right, given the way we have defined the exchange probabilities? */
                 /* is this even useful to have at all? */
@@ -1437,7 +1437,7 @@ void print_ebin(ener_file_t fp_ene, gmx_bool bEne, gmx_bool bDR, gmx_bool bOR,
 
             if (md->nE > 1)
             {
-                if (md->print_grpnms == NULL)
+                if (md->print_grpnms == nullptr)
                 {
                     snew(md->print_grpnms, md->nE);
                     n = 0;
@@ -1493,43 +1493,36 @@ void print_ebin(ener_file_t fp_ene, gmx_bool bEne, gmx_bool bDR, gmx_bool bOR,
 
 }
 
-void update_energyhistory(energyhistory_t * enerhist, t_mdebin * mdebin)
+void update_energyhistory(energyhistory_t * enerhist, const t_mdebin * mdebin)
 {
-    int i;
+    const t_ebin * const ebin = mdebin->ebin;
 
-    enerhist->nsteps     = mdebin->ebin->nsteps;
-    enerhist->nsum       = mdebin->ebin->nsum;
-    enerhist->nsteps_sim = mdebin->ebin->nsteps_sim;
-    enerhist->nsum_sim   = mdebin->ebin->nsum_sim;
-    enerhist->nener      = mdebin->ebin->nener;
+    enerhist->nsteps     = ebin->nsteps;
+    enerhist->nsum       = ebin->nsum;
+    enerhist->nsteps_sim = ebin->nsteps_sim;
+    enerhist->nsum_sim   = ebin->nsum_sim;
 
-    if (mdebin->ebin->nsum > 0)
+    if (ebin->nsum > 0)
     {
-        /* Check if we need to allocate first */
-        if (enerhist->ener_ave == NULL)
-        {
-            snew(enerhist->ener_ave, enerhist->nener);
-            snew(enerhist->ener_sum, enerhist->nener);
-        }
+        /* This will only actually resize the first time */
+        enerhist->ener_ave.resize(ebin->nener);
+        enerhist->ener_sum.resize(ebin->nener);
 
-        for (i = 0; i < enerhist->nener; i++)
+        for (int i = 0; i < ebin->nener; i++)
         {
-            enerhist->ener_ave[i] = mdebin->ebin->e[i].eav;
-            enerhist->ener_sum[i] = mdebin->ebin->e[i].esum;
+            enerhist->ener_ave[i] = ebin->e[i].eav;
+            enerhist->ener_sum[i] = ebin->e[i].esum;
         }
     }
 
-    if (mdebin->ebin->nsum_sim > 0)
+    if (ebin->nsum_sim > 0)
     {
-        /* Check if we need to allocate first */
-        if (enerhist->ener_sum_sim == NULL)
-        {
-            snew(enerhist->ener_sum_sim, enerhist->nener);
-        }
+        /* This will only actually resize the first time */
+        enerhist->ener_sum_sim.resize(ebin->nener);
 
-        for (i = 0; i < enerhist->nener; i++)
+        for (int i = 0; i < ebin->nener; i++)
         {
-            enerhist->ener_sum_sim[i] = mdebin->ebin->e_sim[i].esum;
+            enerhist->ener_sum_sim[i] = ebin->e_sim[i].esum;
         }
     }
     if (mdebin->dhc)
@@ -1538,16 +1531,16 @@ void update_energyhistory(energyhistory_t * enerhist, t_mdebin * mdebin)
     }
 }
 
-void restore_energyhistory_from_state(t_mdebin        * mdebin,
-                                      energyhistory_t * enerhist)
+void restore_energyhistory_from_state(t_mdebin              * mdebin,
+                                      const energyhistory_t * enerhist)
 {
-    int i;
+    unsigned int nener = static_cast<unsigned int>(mdebin->ebin->nener);
 
-    if ((enerhist->nsum > 0 || enerhist->nsum_sim > 0) &&
-        mdebin->ebin->nener != enerhist->nener)
+    if ((enerhist->nsum     > 0 && nener != enerhist->ener_sum.size()) ||
+        (enerhist->nsum_sim > 0 && nener != enerhist->ener_sum_sim.size()))
     {
-        gmx_fatal(FARGS, "Mismatch between number of energies in run input (%d) and checkpoint file (%d).",
-                  mdebin->ebin->nener, enerhist->nener);
+        gmx_fatal(FARGS, "Mismatch between number of energies in run input (%d) and checkpoint file (%u or %u).",
+                  nener, enerhist->ener_sum.size(), enerhist->ener_sum_sim.size());
     }
 
     mdebin->ebin->nsteps     = enerhist->nsteps;
@@ -1555,7 +1548,7 @@ void restore_energyhistory_from_state(t_mdebin        * mdebin,
     mdebin->ebin->nsteps_sim = enerhist->nsteps_sim;
     mdebin->ebin->nsum_sim   = enerhist->nsum_sim;
 
-    for (i = 0; i < mdebin->ebin->nener; i++)
+    for (int i = 0; i < mdebin->ebin->nener; i++)
     {
         mdebin->ebin->e[i].eav  =
             (enerhist->nsum > 0 ? enerhist->ener_ave[i] : 0);
@@ -1566,6 +1559,6 @@ void restore_energyhistory_from_state(t_mdebin        * mdebin,
     }
     if (mdebin->dhc)
     {
-        mde_delta_h_coll_restore_energyhistory(mdebin->dhc, enerhist);
+        mde_delta_h_coll_restore_energyhistory(mdebin->dhc, enerhist->deltaHForeignLambdas.get());
     }
 }
index d5980f9feef56e0947fbabed2a8e69ee71306a04..b79eb1607c3f93557304a7c80e986933eace9e23 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,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.
@@ -42,8 +42,8 @@
 #include "gromacs/fileio/enxio.h"
 #include "gromacs/mdlib/ebin.h"
 #include "gromacs/mdtypes/forcerec.h"
-#include "gromacs/mdtypes/state.h"
 
+class energyhistory_t;
 struct gmx_constr;
 struct gmx_ekindata_t;
 struct gmx_mtop_t;
@@ -52,6 +52,7 @@ struct t_expanded;
 struct t_fcdata;
 struct t_grpopts;
 struct t_lambda;
+class t_state;
 
 /* The functions & data structures here determine the content for outputting
    the .edr file; the file format and actual writing is done with functions
@@ -159,14 +160,14 @@ void print_ebin(ener_file_t fp_ene, gmx_bool bEne, gmx_bool bDR, gmx_bool bOR,
 
 /* Between .edr writes, the averages are history dependent,
    and that history needs to be retained in checkpoints.
-   These functions set/read the energyhistory_t structure
+   These functions set/read the energyhistory_t class
    that is written to checkpoints in checkpoint.c */
 
-/* Set the energyhistory_t data structure from a mdebin structure */
-void update_energyhistory(energyhistory_t * enerhist, t_mdebin * mdebin);
+/* Set the energyhistory_t data from a mdebin structure */
+void update_energyhistory(energyhistory_t * enerhist, const t_mdebin * mdebin);
 
-/* Read the energyhistory_t data structure to a mdebin structure*/
-void restore_energyhistory_from_state(t_mdebin        * mdebin,
-                                      energyhistory_t * enerhist);
+/* Read the energyhistory_t data to a mdebin structure*/
+void restore_energyhistory_from_state(t_mdebin              * mdebin,
+                                      const energyhistory_t * enerhist);
 
 #endif
index a7d886b73b29200f338adbb9530c4946b88d0d2d..1b455879102ae62c29376b64e29d73266640844a 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,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.
 #include <math.h>
 #include <string.h>
 
+#include <cassert>
+
 #include "gromacs/fileio/enxio.h"
 #include "gromacs/mdlib/mdebin.h"
 #include "gromacs/mdtypes/energyhistory.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
 
 /* reset the delta_h list to prepare it for new values */
@@ -67,12 +70,12 @@ static void mde_delta_h_init(t_mde_delta_h *dh, int nbins,
 
     dh->type       = type;
     dh->derivative = derivative;
-    dh->lambda     = lambda;
     dh->nlambda    = nlambda;
 
     snew(dh->lambda, nlambda);
     for (i = 0; i < nlambda; i++)
     {
+        assert(lambda);
         dh->lambda[i] = lambda[i];
     }
 
@@ -82,7 +85,7 @@ static void mde_delta_h_init(t_mde_delta_h *dh, int nbins,
     dh->ndhmax = ndhmax+2;
     for (i = 0; i < 2; i++)
     {
-        dh->bin[i] = NULL;
+        dh->bin[i] = nullptr;
     }
 
     snew(dh->dh, dh->ndhmax);
@@ -205,7 +208,7 @@ static void mde_delta_h_make_hist(t_mde_delta_h *dh, int hi, gmx_bool invert)
 }
 
 
-void mde_delta_h_handle_block(t_mde_delta_h *dh, t_enxblock *blk)
+static void mde_delta_h_handle_block(t_mde_delta_h *dh, t_enxblock *blk)
 {
     /* first check which type we should use: histogram or raw data */
     if (dh->nhist == 0)
@@ -262,7 +265,7 @@ void mde_delta_h_handle_block(t_mde_delta_h *dh, t_enxblock *blk)
         {
             blk->sub[2].nr   = 0;
             blk->sub[2].type = xdr_datatype_float;
-            blk->sub[2].fval = NULL;
+            blk->sub[2].fval = nullptr;
         }
     }
     else
@@ -407,9 +410,9 @@ void mde_delta_h_coll_init(t_mde_delta_h_coll *dhc, const t_inputrec *ir)
     else
     {
         /* don't allocate the meta-data subblocks for lambda vectors */
-        dhc->native_lambda_vec        = NULL;
+        dhc->native_lambda_vec        = nullptr;
         dhc->n_lambda_vec             = 0;
-        dhc->native_lambda_components = 0;
+        dhc->native_lambda_components = nullptr;
         dhc->lambda_index             = -1;
     }
     /* allocate metadata subblocks */
@@ -419,9 +422,9 @@ void mde_delta_h_coll_init(t_mde_delta_h_coll *dhc, const t_inputrec *ir)
     /* now decide which data to write out */
     dhc->nlambda     = 0;
     dhc->ndhdl       = 0;
-    dhc->dh_expanded = NULL;
-    dhc->dh_energy   = NULL;
-    dhc->dh_pv       = NULL;
+    dhc->dh_expanded = nullptr;
+    dhc->dh_energy   = nullptr;
+    dhc->dh_pv       = nullptr;
 
     /* total number of raw data point collections in the sample */
     dhc->ndh = 0;
@@ -483,7 +486,7 @@ void mde_delta_h_coll_init(t_mde_delta_h_coll *dhc, const t_inputrec *ir)
             dhc->dh_expanded = dhc->dh+n;
             mde_delta_h_init(dhc->dh+n, ir->fepvals->dh_hist_size,
                              ir->fepvals->dh_hist_spacing, ndhmax,
-                             dhbtEXPANDED, 0, 0, NULL);
+                             dhbtEXPANDED, 0, 0, nullptr);
             n++;
         }
         if (bEnergy)
@@ -491,7 +494,7 @@ void mde_delta_h_coll_init(t_mde_delta_h_coll *dhc, const t_inputrec *ir)
             dhc->dh_energy = dhc->dh+n;
             mde_delta_h_init(dhc->dh+n, ir->fepvals->dh_hist_size,
                              ir->fepvals->dh_hist_spacing, ndhmax,
-                             dhbtEN, 0, 0, NULL);
+                             dhbtEN, 0, 0, nullptr);
             n++;
         }
         /* add the dhdl's */
@@ -550,7 +553,7 @@ void mde_delta_h_coll_init(t_mde_delta_h_coll *dhc, const t_inputrec *ir)
             dhc->dh_pv = dhc->dh+n;
             mde_delta_h_init(dhc->dh+n, ir->fepvals->dh_hist_size,
                              ir->fepvals->dh_hist_spacing, ndhmax,
-                             dhbtPV, 0, 0, NULL);
+                             dhbtPV, 0, 0, nullptr);
             n++;
         }
     }
@@ -581,15 +584,15 @@ void mde_delta_h_coll_add_dh(t_mde_delta_h_coll *dhc,
     {
         mde_delta_h_add_dh(dhc->dh_du+i, foreign_dU[i]);
     }
-    if (dhc->dh_pv != NULL)
+    if (dhc->dh_pv != nullptr)
     {
         mde_delta_h_add_dh(dhc->dh_pv, pV);
     }
-    if (dhc->dh_energy != NULL)
+    if (dhc->dh_energy != nullptr)
     {
         mde_delta_h_add_dh(dhc->dh_energy, energy);
     }
-    if (dhc->dh_expanded != NULL)
+    if (dhc->dh_expanded != nullptr)
     {
         mde_delta_h_add_dh(dhc->dh_expanded, fep_state);
     }
@@ -611,7 +614,7 @@ void mde_delta_h_coll_handle_block(t_mde_delta_h_coll *dhc,
 
     /* only allocate lambda vector component blocks if they must be written out
        for backward compatibility */
-    if (dhc->native_lambda_components != NULL)
+    if (dhc->native_lambda_components != nullptr)
     {
         add_subblocks_enxblock(blk, 2);
     }
@@ -626,7 +629,7 @@ void mde_delta_h_coll_handle_block(t_mde_delta_h_coll *dhc,
     dhc->subblock_d[3] = dhc->start_lambda; /* old-style lambda at starttime */
     dhc->subblock_d[4] = dhc->delta_lambda; /* lambda diff. between samples */
     /* set the lambda vector components if they exist */
-    if (dhc->native_lambda_components != NULL)
+    if (dhc->native_lambda_components != nullptr)
     {
         for (i = 0; i < dhc->n_lambda_vec; i++)
         {
@@ -638,7 +641,7 @@ void mde_delta_h_coll_handle_block(t_mde_delta_h_coll *dhc,
     blk->sub[0].type = xdr_datatype_double;
     blk->sub[0].dval = dhc->subblock_d;
 
-    if (dhc->native_lambda_components != NULL)
+    if (dhc->native_lambda_components != nullptr)
     {
         dhc->subblock_i[0] = dhc->lambda_index;
         /* set the lambda vector component IDs if they exist */
@@ -678,67 +681,51 @@ void mde_delta_h_coll_reset(t_mde_delta_h_coll *dhc)
 }
 
 /* set the energyhistory variables to save state */
-void mde_delta_h_coll_update_energyhistory(t_mde_delta_h_coll *dhc,
-                                           energyhistory_t    *enerhist)
+void mde_delta_h_coll_update_energyhistory(const t_mde_delta_h_coll *dhc,
+                                           energyhistory_t          *enerhist)
 {
-    int i;
-    if (!enerhist->dht)
+    if (enerhist->deltaHForeignLambdas == nullptr)
     {
-        snew(enerhist->dht, 1);
-        snew(enerhist->dht->ndh, dhc->ndh);
-        snew(enerhist->dht->dh, dhc->ndh);
-        enerhist->dht->nndh = dhc->ndh;
+        enerhist->deltaHForeignLambdas.reset(new delta_h_history_t);
+        enerhist->deltaHForeignLambdas->dh.resize(dhc->ndh);
     }
-    else
-    {
-        if (enerhist->dht->nndh != dhc->ndh)
-        {
-            gmx_incons("energy history number of delta_h histograms != inputrec's number");
-        }
-    }
-    for (i = 0; i < dhc->ndh; i++)
+
+    delta_h_history_t * const deltaH = enerhist->deltaHForeignLambdas.get();
+
+    GMX_RELEASE_ASSERT(deltaH->dh.size() == static_cast<size_t>(dhc->ndh), "energy history number of delta_h histograms should match inputrec's number");
+
+    for (int i = 0; i < dhc->ndh; i++)
     {
-        enerhist->dht->dh[i]  = dhc->dh[i].dh;
-        enerhist->dht->ndh[i] = dhc->dh[i].ndh;
+        std::vector<real> &dh = deltaH->dh[i];
+        dh.resize(dhc->dh[i].ndh);
+        std::copy(dh.begin(), dh.end(), dhc->dh[i].dh);
     }
-    enerhist->dht->start_time   = dhc->start_time;
-    enerhist->dht->start_lambda = dhc->start_lambda;
+    deltaH->start_time   = dhc->start_time;
+    deltaH->start_lambda = dhc->start_lambda;
 }
 
 
 
 /* restore the variables from an energyhistory */
-void mde_delta_h_coll_restore_energyhistory(t_mde_delta_h_coll *dhc,
-                                            energyhistory_t    *enerhist)
+void mde_delta_h_coll_restore_energyhistory(t_mde_delta_h_coll      *dhc,
+                                            const delta_h_history_t *deltaH)
 {
-    int          i;
-    unsigned int j;
-
-    if (!dhc)
-    {
-        gmx_incons("No delta_h histograms found");
-    }
-    if (!enerhist->dht)
-    {
-        gmx_incons("No delta_h histograms found in energy history");
-    }
-    if (enerhist->dht->nndh != dhc->ndh)
-    {
-        gmx_incons("energy history number of delta_h histograms != inputrec's number");
-    }
+    GMX_RELEASE_ASSERT(dhc, "Should have delta_h histograms");
+    GMX_RELEASE_ASSERT(deltaH, "Should have delta_h histograms in energy history");
+    GMX_RELEASE_ASSERT(deltaH->dh.size() == static_cast<size_t>(dhc->ndh), "energy history number of delta_h histograms should match inputrec's number");
 
-    for (i = 0; i < enerhist->dht->nndh; i++)
+    for (unsigned int i = 0; i < deltaH->dh.size(); i++)
     {
-        dhc->dh[i].ndh = enerhist->dht->ndh[i];
-        for (j = 0; j < dhc->dh[i].ndh; j++)
+        dhc->dh[i].ndh = deltaH->dh[i].size();
+        for (unsigned int j = 0; j < dhc->dh[i].ndh; j++)
         {
-            dhc->dh[i].dh[j] = enerhist->dht->dh[i][j];
+            dhc->dh[i].dh[j] = deltaH->dh[i][j];
         }
     }
-    dhc->start_time = enerhist->dht->start_time;
-    if (enerhist->dht->start_lambda_set)
+    dhc->start_time = deltaH->start_time;
+    if (deltaH->start_lambda_set)
     {
-        dhc->start_lambda = enerhist->dht->start_lambda;
+        dhc->start_lambda = deltaH->start_lambda;
     }
     if (dhc->dh[0].ndh > 0)
     {
index b0af7caec5dd0b0631ff5ceb5d4f0bb507f24a05..a506d7e0d23154511e2ef30c3f8d9d808ae6e66f 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,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.
 
 #include "gromacs/mdlib/mdebin.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
 /* The functions & data structures here describe writing
    energy differences (or their histogram )for use with g_bar */
 
+class delta_h_history_t;
+
 /* Data for one foreign lambda, or derivative. */
 typedef struct
 {
@@ -170,16 +167,11 @@ void mde_delta_h_coll_reset(t_mde_delta_h_coll *dhc);
 
 
 /* set the energyhistory variables to save state */
-void mde_delta_h_coll_update_energyhistory(t_mde_delta_h_coll *dhc,
-                                           energyhistory_t    *enerhist);
+void mde_delta_h_coll_update_energyhistory(const t_mde_delta_h_coll *dhc,
+                                           energyhistory_t          *enerhist);
 
 /* restore the variables from an energyhistory */
-void mde_delta_h_coll_restore_energyhistory(t_mde_delta_h_coll *dhc,
-                                            energyhistory_t    *enerhist);
-
-
-#ifdef __cplusplus
-}
-#endif
+void mde_delta_h_coll_restore_energyhistory(t_mde_delta_h_coll      *dhc,
+                                            const delta_h_history_t *deltaH);
 
 #endif  /* _mdebin_bar_h */
index 1335ad8fe2737c2184bd80247c234f564a5622f0..7f93e20d5db7551859be4ca603acf15bd1e3c8f7 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,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.
 #include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/trajectory_writing.h"
 #include "gromacs/mdtypes/commrec.h"
+#include "gromacs/mdtypes/imdoutputprovider.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/mdtypes/state.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/pleasecite.h"
 #include "gromacs/utility/smalloc.h"
 
 struct gmx_mdoutf {
-    t_fileio         *fp_trn;
-    t_fileio         *fp_xtc;
-    tng_trajectory_t  tng;
-    tng_trajectory_t  tng_low_prec;
-    int               x_compression_precision; /* only used by XTC output */
-    ener_file_t       fp_ene;
-    const char       *fn_cpt;
-    gmx_bool          bKeepAndNumCPT;
-    int               eIntegrator;
-    gmx_bool          bExpanded;
-    int               elamstats;
-    int               simulation_part;
-    FILE             *fp_dhdl;
-    FILE             *fp_field;
-    int               natoms_global;
-    int               natoms_x_compressed;
-    gmx_groups_t     *groups; /* for compressed position writing */
-    gmx_wallcycle_t   wcycle;
-    rvec             *f_global;
+    t_fileio               *fp_trn;
+    t_fileio               *fp_xtc;
+    tng_trajectory_t        tng;
+    tng_trajectory_t        tng_low_prec;
+    int                     x_compression_precision; /* only used by XTC output */
+    ener_file_t             fp_ene;
+    const char             *fn_cpt;
+    gmx_bool                bKeepAndNumCPT;
+    int                     eIntegrator;
+    gmx_bool                bExpanded;
+    int                     elamstats;
+    int                     simulation_part;
+    FILE                   *fp_dhdl;
+    int                     natoms_global;
+    int                     natoms_x_compressed;
+    gmx_groups_t           *groups; /* for compressed position writing */
+    gmx_wallcycle_t         wcycle;
+    rvec                   *f_global;
+    gmx::IMDOutputProvider *outputProvider;
 };
 
 
 gmx_mdoutf_t init_mdoutf(FILE *fplog, int nfile, const t_filenm fnm[],
-                         int mdrun_flags, const t_commrec *cr,
+                         const MdrunOptions &mdrunOptions,
+                         const t_commrec *cr,
+                         gmx::IMDOutputProvider *outputProvider,
                          const t_inputrec *ir, gmx_mtop_t *top_global,
                          const gmx_output_env_t *oenv, gmx_wallcycle_t wcycle)
 {
@@ -91,13 +95,12 @@ gmx_mdoutf_t init_mdoutf(FILE *fplog, int nfile, const t_filenm fnm[],
 
     snew(of, 1);
 
-    of->fp_trn       = NULL;
-    of->fp_ene       = NULL;
-    of->fp_xtc       = NULL;
-    of->tng          = NULL;
-    of->tng_low_prec = NULL;
-    of->fp_dhdl      = NULL;
-    of->fp_field     = NULL;
+    of->fp_trn       = nullptr;
+    of->fp_ene       = nullptr;
+    of->fp_xtc       = nullptr;
+    of->tng          = nullptr;
+    of->tng_low_prec = nullptr;
+    of->fp_dhdl      = nullptr;
 
     of->eIntegrator             = ir->eI;
     of->bExpanded               = ir->bExpanded;
@@ -105,13 +108,14 @@ gmx_mdoutf_t init_mdoutf(FILE *fplog, int nfile, const t_filenm fnm[],
     of->simulation_part         = ir->simulation_part;
     of->x_compression_precision = static_cast<int>(ir->x_compression_precision);
     of->wcycle                  = wcycle;
-    of->f_global                = NULL;
+    of->f_global                = nullptr;
+    of->outputProvider          = outputProvider;
 
     if (MASTER(cr))
     {
-        bAppendFiles = (mdrun_flags & MD_APPENDFILES);
+        bAppendFiles = mdrunOptions.continuationOptions.appendFiles;
 
-        of->bKeepAndNumCPT = (mdrun_flags & MD_KEEPANDNUMCPT);
+        of->bKeepAndNumCPT = mdrunOptions.checkpointOptions.keepAndNumberCheckpointFiles;
 
         filemode = bAppendFiles ? appendMode : writeMode;
 
@@ -194,21 +198,7 @@ gmx_mdoutf_t init_mdoutf(FILE *fplog, int nfile, const t_filenm fnm[],
             }
         }
 
-        if (opt2bSet("-field", nfile, fnm) &&
-            (ir->ex[XX].n || ir->ex[YY].n || ir->ex[ZZ].n))
-        {
-            if (bAppendFiles)
-            {
-                of->fp_field = gmx_fio_fopen(opt2fn("-field", nfile, fnm),
-                                             filemode);
-            }
-            else
-            {
-                of->fp_field = xvgropen(opt2fn("-field", nfile, fnm),
-                                        "Applied electric field", "Time (ps)",
-                                        "E (V/nm)", oenv);
-            }
-        }
+        outputProvider->initOutput(fplog, nfile, fnm, bAppendFiles, oenv);
 
         /* Set up atom counts so they can be passed to actual
            trajectory-writing routines later. Also, XTC writing needs
@@ -239,11 +229,6 @@ gmx_mdoutf_t init_mdoutf(FILE *fplog, int nfile, const t_filenm fnm[],
     return of;
 }
 
-FILE *mdoutf_get_fp_field(gmx_mdoutf_t of)
-{
-    return of->fp_field;
-}
-
 ener_file_t mdoutf_get_fp_ene(gmx_mdoutf_t of)
 {
     return of->fp_ene;
@@ -265,18 +250,11 @@ void mdoutf_write_to_trajectory_files(FILE *fplog, t_commrec *cr,
                                       gmx_mtop_t *top_global,
                                       gmx_int64_t step, double t,
                                       t_state *state_local, t_state *state_global,
-                                      rvec *f_local)
+                                      ObservablesHistory *observablesHistory,
+                                      PaddedRVecVector *f_local)
 {
-    rvec *local_v;
-    rvec *global_v;
     rvec *f_global;
 
-    /* MRS -- defining these variables is to manage the difference
-     * between half step and full step velocities, but there must be a better way . . . */
-
-    local_v  = state_local->v;
-    global_v = state_global->v;
-
     if (DOMAINDECOMP(cr))
     {
         if (mdof_flags & MDOF_CPT)
@@ -287,13 +265,13 @@ void mdoutf_write_to_trajectory_files(FILE *fplog, t_commrec *cr,
         {
             if (mdof_flags & (MDOF_X | MDOF_X_COMPRESSED))
             {
-                dd_collect_vec(cr->dd, state_local, state_local->x,
-                               state_global->x);
+                dd_collect_vec(cr->dd, state_local, &state_local->x,
+                               &state_global->x);
             }
             if (mdof_flags & MDOF_V)
             {
-                dd_collect_vec(cr->dd, state_local, local_v,
-                               global_v);
+                dd_collect_vec(cr->dd, state_local, &state_local->v,
+                               &state_global->v);
             }
         }
         f_global = of->f_global;
@@ -304,21 +282,10 @@ void mdoutf_write_to_trajectory_files(FILE *fplog, t_commrec *cr,
     }
     else
     {
-        if (mdof_flags & MDOF_CPT)
-        {
-            /* All pointers in state_local are equal to state_global,
-             * but we need to copy the non-pointer entries.
-             */
-            state_global->lambda = state_local->lambda;
-            state_global->veta   = state_local->veta;
-            state_global->vol0   = state_local->vol0;
-            copy_mat(state_local->box, state_global->box);
-            copy_mat(state_local->boxv, state_global->boxv);
-            copy_mat(state_local->svir_prev, state_global->svir_prev);
-            copy_mat(state_local->fvir_prev, state_global->fvir_prev);
-            copy_mat(state_local->pres_prev, state_global->pres_prev);
-        }
-        f_global = f_local;
+        /* We have the whole state locally: copy the local state pointer */
+        state_global = state_local;
+
+        f_global     = as_rvec_array(f_local->data());
     }
 
     if (MASTER(cr))
@@ -333,18 +300,21 @@ void mdoutf_write_to_trajectory_files(FILE *fplog, t_commrec *cr,
                              DOMAINDECOMP(cr) ? cr->dd->nc : one_ivec,
                              DOMAINDECOMP(cr) ? cr->dd->nnodes : cr->nnodes,
                              of->eIntegrator, of->simulation_part,
-                             of->bExpanded, of->elamstats, step, t, state_global);
+                             of->bExpanded, of->elamstats, step, t,
+                             state_global, observablesHistory);
         }
 
         if (mdof_flags & (MDOF_X | MDOF_V | MDOF_F))
         {
+            const rvec *x = (mdof_flags & MDOF_X) ? as_rvec_array(state_global->x.data()) : nullptr;
+            const rvec *v = (mdof_flags & MDOF_V) ? as_rvec_array(state_global->v.data()) : nullptr;
+            const rvec *f = (mdof_flags & MDOF_F) ? f_global : nullptr;
+
             if (of->fp_trn)
             {
                 gmx_trr_write_frame(of->fp_trn, step, t, state_local->lambda[efptFEP],
                                     state_local->box, top_global->natoms,
-                                    (mdof_flags & MDOF_X) ? state_global->x : NULL,
-                                    (mdof_flags & MDOF_V) ? global_v : NULL,
-                                    (mdof_flags & MDOF_F) ? f_global : NULL);
+                                    x, v, f);
                 if (gmx_fio_flush(of->fp_trn) != 0)
                 {
                     gmx_file("Cannot write trajectory; maybe you are out of disk space?");
@@ -358,9 +328,7 @@ void mdoutf_write_to_trajectory_files(FILE *fplog, t_commrec *cr,
                 gmx_fwrite_tng(of->tng, FALSE, step, t, state_local->lambda[efptFEP],
                                state_local->box,
                                top_global->natoms,
-                               (mdof_flags & MDOF_X) ? state_global->x : NULL,
-                               (mdof_flags & MDOF_V) ? global_v : NULL,
-                               (mdof_flags & MDOF_F) ? f_global : NULL);
+                               x, v, f);
             }
             /* If only a TNG file is open for compressed coordinate output (no uncompressed
                coordinate output) also write forces and velocities to it. */
@@ -369,20 +337,18 @@ void mdoutf_write_to_trajectory_files(FILE *fplog, t_commrec *cr,
                 gmx_fwrite_tng(of->tng_low_prec, FALSE, step, t, state_local->lambda[efptFEP],
                                state_local->box,
                                top_global->natoms,
-                               (mdof_flags & MDOF_X) ? state_global->x : NULL,
-                               (mdof_flags & MDOF_V) ? global_v : NULL,
-                               (mdof_flags & MDOF_F) ? f_global : NULL);
+                               x, v, f);
             }
         }
         if (mdof_flags & MDOF_X_COMPRESSED)
         {
-            rvec *xxtc = NULL;
+            rvec *xxtc = nullptr;
 
             if (of->natoms_x_compressed == of->natoms_global)
             {
                 /* We are writing the positions of all of the atoms to
                    the compressed output */
-                xxtc = state_global->x;
+                xxtc = as_rvec_array(state_global->x.data());
             }
             else
             {
@@ -413,8 +379,8 @@ void mdoutf_write_to_trajectory_files(FILE *fplog, t_commrec *cr,
                            state_local->box,
                            of->natoms_x_compressed,
                            xxtc,
-                           NULL,
-                           NULL);
+                           nullptr,
+                           nullptr);
             if (of->natoms_x_compressed != of->natoms_global)
             {
                 sfree(xxtc);
@@ -436,7 +402,7 @@ void mdoutf_tng_close(gmx_mdoutf_t of)
 
 void done_mdoutf(gmx_mdoutf_t of)
 {
-    if (of->fp_ene != NULL)
+    if (of->fp_ene != nullptr)
     {
         close_enx(of->fp_ene);
     }
@@ -448,18 +414,12 @@ void done_mdoutf(gmx_mdoutf_t of)
     {
         gmx_trr_close(of->fp_trn);
     }
-    if (of->fp_dhdl != NULL)
+    if (of->fp_dhdl != nullptr)
     {
         gmx_fio_fclose(of->fp_dhdl);
     }
-    if (of->fp_field != NULL)
-    {
-        /* This is opened sometimes with xvgropen, sometimes with
-         * gmx_fio_fopen, so we use the least common denominator for closing.
-         */
-        gmx_fio_fclose(of->fp_field);
-    }
-    if (of->f_global != NULL)
+    of->outputProvider->finishOutput();
+    if (of->f_global != nullptr)
     {
         sfree(of->f_global);
     }
index f2db7264bfd455d6dd2d0a9d3ee6265b67ba88d5..612982182fceeb91d82539e7952cd49271e0c1b5 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,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.
 #include <stdio.h>
 
 #include "gromacs/fileio/enxio.h"
+#include "gromacs/math/paddedvector.h"
 #include "gromacs/math/vectypes.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/utility/basedefinitions.h"
 
+class energyhistory_t;
 struct gmx_mtop_t;
 struct gmx_output_env_t;
+struct MdrunOptions;
+struct ObservablesHistory;
 struct t_commrec;
 struct t_filenm;
 struct t_inputrec;
 
+namespace gmx
+{
+class IMDOutputProvider;
+}
+
 typedef struct gmx_mdoutf *gmx_mdoutf_t;
 
 /*! \brief Allocate and initialize object to manager trajectory writing output
@@ -58,16 +67,14 @@ typedef struct gmx_mdoutf *gmx_mdoutf_t;
 gmx_mdoutf_t init_mdoutf(FILE                   *fplog,
                          int                     nfile,
                          const t_filenm          fnm[],
-                         int                     mdrun_flags,
+                         const MdrunOptions     &mdrunOptions,
                          const t_commrec        *cr,
+                         gmx::IMDOutputProvider *outputProvider,
                          const t_inputrec       *ir,
                          gmx_mtop_t             *mtop,
                          const gmx_output_env_t *oenv,
                          gmx_wallcycle_t         wcycle);
 
-/*! \brief Getter for file pointer */
-FILE *mdoutf_get_fp_field(gmx_mdoutf_t of);
-
 /*! \brief Getter for file pointer */
 ener_file_t mdoutf_get_fp_ene(gmx_mdoutf_t of);
 
@@ -91,7 +98,8 @@ void done_mdoutf(gmx_mdoutf_t of);
  *
  * Writes data to trn, xtc and/or checkpoint. What is written is
  * determined by the mdof_flags defined below. Data is collected to
- * the master node only when necessary.
+ * the master node only when necessary. Without domain decomposition
+ * only data from state_local is used and state_global is ignored.
  */
 void mdoutf_write_to_trajectory_files(FILE *fplog, t_commrec *cr,
                                       gmx_mdoutf_t of,
@@ -99,7 +107,8 @@ void mdoutf_write_to_trajectory_files(FILE *fplog, t_commrec *cr,
                                       gmx_mtop_t *top_global,
                                       gmx_int64_t step, double t,
                                       t_state *state_local, t_state *state_global,
-                                      rvec *f_local);
+                                      ObservablesHistory *observablesHistory,
+                                      PaddedRVecVector *f_local);
 
 #define MDOF_X            (1<<0)
 #define MDOF_V            (1<<1)
index ec62537731eef23503061a662807d4490cea2597..ea03f188f2bb8ddfe71a53b61f4e06ddb5b60909 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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
+
+/*! \libinternal \file
+ *
+ * \brief This file declares types and functions for initializing an MD run
+ *
+ * \author Berk Hess <hess@kth.se>
+ * \inlibraryapi
+ */
+
 #ifndef GMX_MDLIB_MDRUN_H
 #define GMX_MDLIB_MDRUN_H
 
-#include <stdio.h>
-#include <time.h>
-
 #include "gromacs/timing/wallcycle.h"
 
-struct df_history_t;
-struct gmx_constr;
-struct gmx_edsam;
-struct gmx_enerdata_t;
 struct gmx_mtop_t;
 struct t_commrec;
-struct t_expanded;
-struct t_extmass;
 struct t_inputrec;
-struct t_lambda;
-struct t_mdatoms;
-struct t_simtemp;
-struct t_state;
-
-#define MD_POLARISE       (1<<2)
-#define MD_RERUN          (1<<4)
-#define MD_RERUN_VSITE    (1<<5)
-#define MD_DDBONDCHECK    (1<<10)
-#define MD_DDBONDCOMM     (1<<11)
-#define MD_CONFOUT        (1<<12)
-#define MD_REPRODUCIBLE   (1<<13)
-#define MD_APPENDFILES    (1<<15)
-#define MD_APPENDFILESSET (1<<21)
-#define MD_KEEPANDNUMCPT  (1<<16)
-#define MD_READ_EKIN      (1<<17)
-#define MD_STARTFROMCPT   (1<<18)
-#define MD_RESETCOUNTERSHALFWAY (1<<19)
-#define MD_TUNEPME        (1<<20)
-#define MD_NTOMPSET       (1<<21)
-#define MD_IMDWAIT        (1<<23)
-#define MD_IMDTERM        (1<<24)
-#define MD_IMDPULL        (1<<25)
-
-/* The options for the domain decomposition MPI task ordering */
-enum {
-    ddrankorderSEL, ddrankorderINTERLEAVE, ddrankorderPP_PME, ddrankorderCARTESIAN, ddrankorderNR
+class t_state;
+
+//! \internal \brief Options and settings for continuing from checkpoint
+struct ContinuationOptions
+{
+    //! \brief Constructor
+    ContinuationOptions() :
+        appendFiles(false),
+        appendFilesOptionSet(false),
+        startedFromCheckpoint(false),
+        haveReadEkin(false)
+    {
+    }
+
+    //! True if we are continuing from a checkpoint and should append output files
+    bool appendFiles;
+    //! True if the -append option was explicitly set by the user (either to true of false
+    bool appendFilesOptionSet;
+    //! True if we started from a checkpoint file
+    bool startedFromCheckpoint;
+    //! True if we read the kinetic energy from checkpoint file
+    bool haveReadEkin;
 };
 
-void init_npt_masses(t_inputrec *ir, t_state *state, t_extmass *MassQ, gmx_bool bInit);
+//! \internal \brief Options for writing checkpoint files
+struct CheckpointOptions
+{
+    //! \brief Constructor
+    CheckpointOptions() :
+        keepAndNumberCheckpointFiles(FALSE),
+        period(15)
+    {
+    }
 
-void init_expanded_ensemble(gmx_bool bStateFromCP, t_inputrec *ir, df_history_t *dfhist);
+    //! True means keep all checkpoint file and add the step number to the name
+    gmx_bool keepAndNumberCheckpointFiles;
+    //! The period in minutes for writing checkpoint files
+    real     period;
+};
 
-int ExpandedEnsembleDynamics(FILE *log, t_inputrec *ir, gmx_enerdata_t *enerd,
-                             t_state *state, t_extmass *MassQ, int fep_state, df_history_t *dfhist,
-                             gmx_int64_t step,
-                             rvec *v, t_mdatoms *mdatoms);
+//! \internal \brief Options for timing (parts of) mdrun
+struct TimingOptions
+{
+    //! \brief Constructor
+    TimingOptions() :
+        resetStep(-1),
+        resetHalfway(FALSE)
+    {
+    }
 
-void PrintFreeEnergyInfoToFile(FILE *outfile, t_lambda *fep, t_expanded *expand, t_simtemp *simtemp, df_history_t *dfhist,
-                               int fep_state, int frequency, gmx_int64_t step);
+    //! Reset timers at the start of this MD step, -1 means do not reset
+    int      resetStep;
+    //! If true, reset timers half-way the run
+    gmx_bool resetHalfway;
+};
+
+//! \internal \brief Options for IMD
+struct ImdOptions
+{
+    //! Constructor
+    ImdOptions() :
+        port(8888),
+        wait(FALSE),
+        terminatable(FALSE),
+        pull(FALSE)
+    {
+    }
+
+    //! IMD listening port
+    int      port;
+    //! If true, pause the simulation while no IMD client is connected
+    gmx_bool wait;
+    //! If true, allow termination of the simulation from IMD client
+    gmx_bool terminatable;
+    //! If true, allow COM pulling in the simulation from IMD client
+    gmx_bool pull;
+};
 
-/* Allocate and initialize node-local state entries. */
+//! \internal \brief Collection of all options of mdrun that are not processed separately
+struct MdrunOptions
+{
+    //! \brief Constructor
+    MdrunOptions() :
+        rerun(FALSE),
+        rerunConstructVsites(FALSE),
+        globalCommunicationInterval(-1),
+        reproducible(FALSE),
+        writeConfout(TRUE),
+        continuationOptions(),
+        checkpointOptions(),
+        numStepsCommandline(-2),
+        maximumHoursToRun(-1),
+        timingOptions(),
+        tunePme(TRUE),
+        ntompOptionIsSet(FALSE),
+        imdOptions(),
+        verbose(FALSE),
+        verboseStepPrintInterval(100)
+    {
+    }
+
+    //! Re-compute energies, and possibly forces, for frames from an input tracjectory
+    gmx_bool            rerun;
+    //! Re-construct virual sites durin a rerun simulation
+    gmx_bool            rerunConstructVsites;
+    //! Request to do global communication at this interval in steps, -1 is determine from inputrec
+    int                 globalCommunicationInterval;
+    //! Try to make the simulation binary reproducible
+    gmx_bool            reproducible;
+    //! Write confout.gro at the end of the run
+    gmx_bool            writeConfout;
+    //! Options for continuing a simulation from a checkpoint file
+    ContinuationOptions continuationOptions;
+    //! Options for checkpointing th simulation
+    CheckpointOptions   checkpointOptions;
+    //! Number of steps to run, -2 is use inputrec, -1 is infinite
+    gmx_int64_t         numStepsCommandline;
+    //! Maximum duration of this simulation in wall-clock hours, -1 is no limit
+    real                maximumHoursToRun;
+    //! Options for timing the run
+    TimingOptions       timingOptions;
+    //! If true and supported, will tune the PP-PME load balance
+    gmx_bool            tunePme;
+    //! True if the user explicitly set the -ntomp command line option
+    gmx_bool            ntompOptionIsSet;
+    //! Options for IMD
+    ImdOptions          imdOptions;
+    //! Increase the verbosity level in the logging and/or stdout/stderr
+    gmx_bool            verbose;
+    //! If verbose=true, print remaining runtime at this step interval
+    int                 verboseStepPrintInterval;
+};
+
+//! \brief Allocate and initialize node-local state entries
 void set_state_entries(t_state *state, const t_inputrec *ir);
 
-/* Broadcast the data for a simulation, and allocate node-specific settings */
+//! \brief Broadcast inputrec and mtop and allocate node-specific settings
 void init_parallel(t_commrec *cr, t_inputrec *inputrec,
                    gmx_mtop_t *mtop);
 
+//! \brief Broadcasts state from the master to all ranks in cr->mpi_comm_mygroup
 void bcast_state(const t_commrec *cr, t_state *state);
-/* Broadcasts state from the master to all nodes in cr->mpi_comm_mygroup.
- */
 
 #endif
diff --git a/src/gromacs/mdlib/mdsetup.cpp b/src/gromacs/mdlib/mdsetup.cpp
new file mode 100644 (file)
index 0000000..bbc42e5
--- /dev/null
@@ -0,0 +1,142 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+#include "gmxpre.h"
+
+#include "mdsetup.h"
+
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/domdec/domdec_struct.h"
+#include "gromacs/listed-forces/manage-threading.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/pbcutil/pbc.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/topology/topology.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/smalloc.h"
+
+/* TODO: Add a routine that collects the initial setup of the algorithms.
+ *
+ * The final solution should be an MD algorithm base class with methods
+ * for initialization and atom-data setup.
+ */
+
+void mdAlgorithmsSetupAtomData(t_commrec         *cr,
+                               const t_inputrec  *ir,
+                               const gmx_mtop_t  *top_global,
+                               gmx_localtop_t    *top,
+                               t_forcerec        *fr,
+                               t_graph          **graph,
+                               t_mdatoms         *mdatoms,
+                               gmx_vsite_t       *vsite,
+                               gmx_shellfc_t     *shellfc)
+{
+    bool  usingDomDec = DOMAINDECOMP(cr);
+
+    int   numAtomIndex, numHomeAtoms;
+    int  *atomIndex;
+
+    if (usingDomDec)
+    {
+        numAtomIndex = dd_natoms_mdatoms(cr->dd);
+        atomIndex    = cr->dd->gatindex;
+        numHomeAtoms = cr->dd->nat_home;
+    }
+    else
+    {
+        numAtomIndex = -1;
+        atomIndex    = nullptr;
+        numHomeAtoms = top_global->natoms;
+    }
+    atoms2md(top_global, ir, numAtomIndex, atomIndex, numHomeAtoms, mdatoms);
+
+    if (usingDomDec)
+    {
+        dd_sort_local_top(cr->dd, mdatoms, top);
+    }
+    else
+    {
+        /* Currently gmx_generate_local_top allocates and returns a pointer.
+         * We should implement a more elegant solution.
+         */
+        gmx_localtop_t *tmpTop;
+
+        tmpTop = gmx_mtop_generate_local_top(top_global, ir->efep != efepNO);
+        *top   = *tmpTop;
+        sfree(tmpTop);
+    }
+
+    if (vsite)
+    {
+        if (usingDomDec)
+        {
+            /* The vsites were already assigned by the domdec topology code.
+             * We only need to do the thread division here.
+             */
+            split_vsites_over_threads(top->idef.il, top->idef.iparams,
+                                      mdatoms, FALSE, vsite);
+        }
+        else
+        {
+            set_vsite_top(vsite, top, mdatoms, cr);
+        }
+    }
+
+    if (!usingDomDec && ir->ePBC != epbcNONE && !fr->bMolPBC)
+    {
+        GMX_ASSERT(graph != NULL, "We use a graph with PBC (no periodic mols) and without DD");
+
+        *graph = mk_graph(nullptr, &(top->idef), 0, top_global->natoms, FALSE, FALSE);
+    }
+    else if (graph != nullptr)
+    {
+        *graph = nullptr;
+    }
+
+    /* Note that with DD only flexible constraints, not shells, are supported
+     * and these don't require setup in make_local_shells().
+     */
+    if (!usingDomDec && shellfc)
+    {
+        make_local_shells(cr, mdatoms, shellfc);
+    }
+
+    setup_bonded_threading(fr, &top->idef);
+}
diff --git a/src/gromacs/mdlib/mdsetup.h b/src/gromacs/mdlib/mdsetup.h
new file mode 100644 (file)
index 0000000..c261643
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+#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"
+
+/*! \brief Sets atom data for several MD algorithms
+ *
+ * Most MD algorithms require two different setup calls:
+ * one for initialization and parameter setting and one for atom data setup.
+ * This routine sets the atom data for the (locally available) atoms.
+ * This is called at the start of serial runs and during domain decomposition.
+ *
+ * \param[in]     cr         Communication record
+ * \param[in]     ir         Input parameter record
+ * \param[in]     top_global The global topology
+ * \param[in,out] top        The local topology
+ * \param[in,out] fr         The force calculation parameter/data record
+ * \param[out]    graph      The molecular graph, can be NULL
+ * \param[out]    mdatoms    The MD atom data
+ * \param[in,out] vsite      The virtual site data, can be NULL
+ * \param[in,out] shellfc    The shell/flexible-constraint data, can be NULL
+ */
+void mdAlgorithmsSetupAtomData(t_commrec         *cr,
+                               const t_inputrec  *ir,
+                               const gmx_mtop_t  *top_global,
+                               gmx_localtop_t    *top,
+                               t_forcerec        *fr,
+                               t_graph          **graph,
+                               t_mdatoms         *mdatoms,
+                               gmx_vsite_t       *vsite,
+                               gmx_shellfc_t     *shellfc);
+
+#endif
index dd00b95f1beee1b82c5140610a0a21e017c4cabd..b98b8a0703feae002510f554423acf07fce3d467 100644 (file)
@@ -61,7 +61,6 @@
 #include "gromacs/ewald/pme.h"
 #include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/mtxio.h"
-#include "gromacs/gmxlib/md_logging.h"
 #include "gromacs/gmxlib/network.h"
 #include "gromacs/gmxlib/nrnb.h"
 #include "gromacs/imd/imd.h"
@@ -77,6 +76,7 @@
 #include "gromacs/mdlib/mdatoms.h"
 #include "gromacs/mdlib/mdebin.h"
 #include "gromacs/mdlib/mdrun.h"
+#include "gromacs/mdlib/mdsetup.h"
 #include "gromacs/mdlib/ns.h"
 #include "gromacs/mdlib/shellfc.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"
 #include "gromacs/pbcutil/mshift.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/timing/walltime_accounting.h"
 #include "gromacs/topology/mtop_util.h"
+#include "gromacs/topology/topology.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/logger.h"
 #include "gromacs/utility/smalloc.h"
 
 //! Utility structure for manipulating states during EM
 typedef struct {
     //! Copy of the global state
-    t_state  s;
+    t_state          s;
     //! Force array
-    rvec    *f;
+    PaddedRVecVector f;
     //! Potential energy
-    real     epot;
+    real             epot;
     //! Norm of the force
-    real     fnorm;
+    real             fnorm;
     //! Maximum force
-    real     fmax;
+    real             fmax;
     //! Direction
-    int      a_fmax;
+    int              a_fmax;
 } em_state_t;
 
-//! Initiate em_state_t structure and return pointer to it
-static em_state_t *init_em_state()
-{
-    em_state_t *ems;
-
-    snew(ems, 1);
-
-    /* does this need to be here?  Should the array be declared differently (staticaly)in the state definition? */
-    snew(ems->s.lambda, efptNR);
-
-    return ems;
-}
-
 //! Print the EM starting conditions
 static void print_em_start(FILE                     *fplog,
                            t_commrec                *cr,
@@ -195,7 +185,7 @@ static void warn_step(FILE *fp, real ftol, gmx_bool bLastStep, gmx_bool bConstra
 //! Print message about convergence of the EM
 static void print_converged(FILE *fp, const char *alg, real ftol,
                             gmx_int64_t count, gmx_bool bDone, gmx_int64_t nsteps,
-                            real epot, real fmax, int nfmax, real fnorm)
+                            const em_state_t *ems, double sqrtNumAtoms)
 {
     char buf[STEPSTRSIZE];
 
@@ -217,19 +207,19 @@ static void print_converged(FILE *fp, const char *alg, real ftol,
     }
 
 #if GMX_DOUBLE
-    fprintf(fp, "Potential Energy  = %21.14e\n", epot);
-    fprintf(fp, "Maximum force     = %21.14e on atom %d\n", fmax, nfmax+1);
-    fprintf(fp, "Norm of force     = %21.14e\n", fnorm);
+    fprintf(fp, "Potential Energy  = %21.14e\n", ems->epot);
+    fprintf(fp, "Maximum force     = %21.14e on atom %d\n", ems->fmax, ems->a_fmax + 1);
+    fprintf(fp, "Norm of force     = %21.14e\n", ems->fnorm/sqrtNumAtoms);
 #else
-    fprintf(fp, "Potential Energy  = %14.7e\n", epot);
-    fprintf(fp, "Maximum force     = %14.7e on atom %d\n", fmax, nfmax+1);
-    fprintf(fp, "Norm of force     = %14.7e\n", fnorm);
+    fprintf(fp, "Potential Energy  = %14.7e\n", ems->epot);
+    fprintf(fp, "Maximum force     = %14.7e on atom %d\n", ems->fmax, ems->a_fmax + 1);
+    fprintf(fp, "Norm of force     = %14.7e\n", ems->fnorm/sqrtNumAtoms);
 #endif
 }
 
 //! Compute the norm and max of the force array in parallel
 static void get_f_norm_max(t_commrec *cr,
-                           t_grpopts *opts, t_mdatoms *mdatoms, rvec *f,
+                           t_grpopts *opts, t_mdatoms *mdatoms, const rvec *f,
                            real *fnorm, real *fmax, int *a_fmax)
 {
     double fnorm2, *sum;
@@ -326,25 +316,25 @@ static void get_state_f_norm_max(t_commrec *cr,
                                  t_grpopts *opts, t_mdatoms *mdatoms,
                                  em_state_t *ems)
 {
-    get_f_norm_max(cr, opts, mdatoms, ems->f, &ems->fnorm, &ems->fmax, &ems->a_fmax);
+    get_f_norm_max(cr, opts, mdatoms, as_rvec_array(ems->f.data()),
+                   &ems->fnorm, &ems->fmax, &ems->a_fmax);
 }
 
 //! Initialize the energy minimization
-void init_em(FILE *fplog, const char *title,
-             t_commrec *cr, t_inputrec *ir,
-             t_state *state_global, gmx_mtop_t *top_global,
-             em_state_t *ems, gmx_localtop_t **top,
-             rvec **f,
-             t_nrnb *nrnb, rvec mu_tot,
-             t_forcerec *fr, gmx_enerdata_t **enerd,
-             t_graph **graph, t_mdatoms *mdatoms, gmx_global_stat_t *gstat,
-             gmx_vsite_t *vsite, gmx_constr_t constr,
-             int nfile, const t_filenm fnm[],
-             gmx_mdoutf_t *outf, t_mdebin **mdebin,
-             int imdport, unsigned long gmx_unused Flags,
-             gmx_wallcycle_t wcycle)
+static void init_em(FILE *fplog, const char *title,
+                    t_commrec *cr, gmx::IMDOutputProvider *outputProvider,
+                    t_inputrec *ir,
+                    const MdrunOptions &mdrunOptions,
+                    t_state *state_global, gmx_mtop_t *top_global,
+                    em_state_t *ems, gmx_localtop_t **top,
+                    t_nrnb *nrnb, rvec mu_tot,
+                    t_forcerec *fr, gmx_enerdata_t **enerd,
+                    t_graph **graph, t_mdatoms *mdatoms, gmx_global_stat_t *gstat,
+                    gmx_vsite_t *vsite, gmx_constr_t constr, gmx_shellfc_t **shellfc,
+                    int nfile, const t_filenm fnm[],
+                    gmx_mdoutf_t *outf, t_mdebin **mdebin,
+                    gmx_wallcycle_t wcycle)
 {
-    int  i;
     real dvdl_constr;
 
     if (fplog)
@@ -355,13 +345,36 @@ void init_em(FILE *fplog, const char *title,
     state_global->ngtc = 0;
 
     /* Initialize lambda variables */
-    initialize_lambdas(fplog, ir, &(state_global->fep_state), state_global->lambda, NULL);
+    initialize_lambdas(fplog, ir, &(state_global->fep_state), state_global->lambda, nullptr);
 
     init_nrnb(nrnb);
 
     /* Interactive molecular dynamics */
-    init_IMD(ir, cr, top_global, fplog, 1, state_global->x,
-             nfile, fnm, NULL, imdport, Flags);
+    init_IMD(ir, cr, top_global, fplog, 1, as_rvec_array(state_global->x.data()),
+             nfile, fnm, nullptr, mdrunOptions);
+
+    if (ir->eI == eiNM)
+    {
+        GMX_ASSERT(shellfc != NULL, "With NM we always support shells");
+
+        *shellfc = init_shell_flexcon(stdout,
+                                      top_global,
+                                      n_flexible_constraints(constr),
+                                      ir->nstcalcenergy,
+                                      DOMAINDECOMP(cr));
+    }
+    else
+    {
+        GMX_ASSERT(EI_ENERGY_MINIMIZATION(ir->eI), "This else currently only handles energy minimizers, consider if your algorithm needs shell/flexible-constraint support");
+
+        /* With energy minimization, shells and flexible constraints are
+         * automatically minimized when treated like normal DOFS.
+         */
+        if (shellfc != nullptr)
+        {
+            *shellfc = nullptr;
+        }
+    }
 
     if (DOMAINDECOMP(cr))
     {
@@ -369,50 +382,31 @@ void init_em(FILE *fplog, const char *title,
 
         dd_init_local_state(cr->dd, state_global, &ems->s);
 
-        *f = NULL;
-
         /* Distribute the charge groups over the nodes from the master node */
         dd_partition_system(fplog, ir->init_step, cr, TRUE, 1,
                             state_global, top_global, ir,
                             &ems->s, &ems->f, mdatoms, *top,
                             fr, vsite, constr,
-                            nrnb, NULL, FALSE);
+                            nrnb, nullptr, FALSE);
         dd_store_state(cr->dd, &ems->s);
 
-        *graph = NULL;
+        *graph = nullptr;
     }
     else
     {
-        snew(*f, top_global->natoms);
-
+        state_change_natoms(state_global, state_global->natoms);
         /* Just copy the state */
         ems->s = *state_global;
+        state_change_natoms(&ems->s, ems->s.natoms);
         /* We need to allocate one element extra, since we might use
          * (unaligned) 4-wide SIMD loads to access rvec entries.
          */
-        snew(ems->s.x, ems->s.nalloc + 1);
-        snew(ems->f, ems->s.nalloc+1);
-        snew(ems->s.v, ems->s.nalloc+1);
-        for (i = 0; i < state_global->natoms; i++)
-        {
-            copy_rvec(state_global->x[i], ems->s.x[i]);
-        }
-        copy_mat(state_global->box, ems->s.box);
-
-        *top      = gmx_mtop_generate_local_top(top_global, ir->efep != efepNO);
-
-        setup_bonded_threading(fr, &(*top)->idef);
-
-        if (ir->ePBC != epbcNONE && !fr->bMolPBC)
-        {
-            *graph = mk_graph(fplog, &((*top)->idef), 0, top_global->natoms, FALSE, FALSE);
-        }
-        else
-        {
-            *graph = NULL;
-        }
+        ems->f.resize(ems->s.natoms + 1);
 
-        atoms2md(top_global, ir, 0, NULL, top_global->natoms, mdatoms);
+        snew(*top, 1);
+        mdAlgorithmsSetupAtomData(cr, ir, top_global, *top, fr,
+                                  graph, mdatoms,
+                                  vsite, shellfc ? *shellfc : nullptr);
 
         if (vsite)
         {
@@ -440,11 +434,14 @@ void init_em(FILE *fplog, const char *title,
         {
             /* Constrain the starting coordinates */
             dvdl_constr = 0;
-            constrain(PAR(cr) ? NULL : fplog, TRUE, TRUE, constr, &(*top)->idef,
+            constrain(PAR(cr) ? nullptr : fplog, TRUE, TRUE, constr, &(*top)->idef,
                       ir, cr, -1, 0, 1.0, mdatoms,
-                      ems->s.x, ems->s.x, NULL, fr->bMolPBC, ems->s.box,
+                      as_rvec_array(ems->s.x.data()),
+                      as_rvec_array(ems->s.x.data()),
+                      nullptr,
+                      fr->bMolPBC, ems->s.box,
                       ems->s.lambda[efptFEP], &dvdl_constr,
-                      NULL, NULL, nrnb, econqCoord);
+                      nullptr, nullptr, nrnb, econqCoord);
         }
     }
 
@@ -454,19 +451,19 @@ void init_em(FILE *fplog, const char *title,
     }
     else
     {
-        *gstat = NULL;
+        *gstat = nullptr;
     }
 
-    *outf = init_mdoutf(fplog, nfile, fnm, 0, cr, ir, top_global, NULL, wcycle);
+    *outf = init_mdoutf(fplog, nfile, fnm, mdrunOptions, cr, outputProvider, ir, top_global, nullptr, wcycle);
 
     snew(*enerd, 1);
     init_enerdata(top_global->groups.grps[egcENER].nr, ir->fepvals->n_lambda,
                   *enerd);
 
-    if (mdebin != NULL)
+    if (mdebin != nullptr)
     {
         /* Init bin for energy stuff */
-        *mdebin = init_mdebin(mdoutf_get_fp_ene(*outf), top_global, ir, NULL);
+        *mdebin = init_mdebin(mdoutf_get_fp_ene(*outf), top_global, ir, nullptr);
     }
 
     clear_rvec(mu_tot);
@@ -490,26 +487,15 @@ static void finish_em(t_commrec *cr, gmx_mdoutf_t outf,
 }
 
 //! Swap two different EM states during minimization
-static void swap_em_state(em_state_t *ems1, em_state_t *ems2)
+static void swap_em_state(em_state_t **ems1, em_state_t **ems2)
 {
-    em_state_t tmp;
+    em_state_t *tmp;
 
     tmp   = *ems1;
     *ems1 = *ems2;
     *ems2 = tmp;
 }
 
-//! Copy coordinate from an EM state to a "normal" state structure
-static void copy_em_coords(em_state_t *ems, t_state *state)
-{
-    int i;
-
-    for (i = 0; (i < state->natoms); i++)
-    {
-        copy_rvec(ems->s.x[i], state->x[i]);
-    }
-}
-
 //! Save the EM trajectory
 static void write_em_traj(FILE *fplog, t_commrec *cr,
                           gmx_mdoutf_t outf,
@@ -517,24 +503,11 @@ static void write_em_traj(FILE *fplog, t_commrec *cr,
                           gmx_mtop_t *top_global,
                           t_inputrec *ir, gmx_int64_t step,
                           em_state_t *state,
-                          t_state *state_global)
+                          t_state *state_global,
+                          ObservablesHistory *observablesHistory)
 {
-    int      mdof_flags;
-    gmx_bool bIMDout = FALSE;
-
-
-    /* Shall we do IMD output? */
-    if (ir->bIMD)
-    {
-        bIMDout = do_per_step(step, IMD_get_step(ir->imd->setup));
-    }
-
-    if ((bX || bF || bIMDout || confout != NULL) && !DOMAINDECOMP(cr))
-    {
-        copy_em_coords(state, state_global);
-    }
+    int mdof_flags = 0;
 
-    mdof_flags = 0;
     if (bX)
     {
         mdof_flags |= MDOF_X;
@@ -552,20 +525,30 @@ static void write_em_traj(FILE *fplog, t_commrec *cr,
 
     mdoutf_write_to_trajectory_files(fplog, cr, outf, mdof_flags,
                                      top_global, step, (double)step,
-                                     &state->s, state_global, state->f);
+                                     &state->s, state_global, observablesHistory,
+                                     &state->f);
 
-    if (confout != NULL && MASTER(cr))
+    if (confout != nullptr && MASTER(cr))
     {
+        GMX_RELEASE_ASSERT(bX, "The code below assumes that (with domain decomposition), x is collected to state_global in the call above.");
+        /* With domain decomposition the call above collected the state->s.x
+         * into state_global->x. Without DD we copy the local state pointer.
+         */
+        if (!DOMAINDECOMP(cr))
+        {
+            state_global = &state->s;
+        }
+
         if (ir->ePBC != epbcNONE && !ir->bPeriodicMols && DOMAINDECOMP(cr))
         {
             /* Make molecules whole only for confout writing */
-            do_pbc_mtop(fplog, ir->ePBC, state_global->box, top_global,
-                        state_global->x);
+            do_pbc_mtop(fplog, ir->ePBC, state->s.box, top_global,
+                        as_rvec_array(state_global->x.data()));
         }
 
         write_sto_conf_mtop(confout,
                             *top_global->name, top_global,
-                            state_global->x, NULL, ir->ePBC, state_global->box);
+                            as_rvec_array(state_global->x.data()), nullptr, ir->ePBC, state->s.box);
     }
 }
 
@@ -574,7 +557,8 @@ static void write_em_traj(FILE *fplog, t_commrec *cr,
 // \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,
                        gmx_bool bMolPBC,
-                       em_state_t *ems1, real a, rvec *f, em_state_t *ems2,
+                       em_state_t *ems1, real a, const PaddedRVecVector *force,
+                       em_state_t *ems2,
                        gmx_constr_t constr, gmx_localtop_t *top,
                        t_nrnb *nrnb, gmx_wallcycle_t wcycle,
                        gmx_int64_t count)
@@ -597,27 +581,22 @@ static bool do_em_step(t_commrec *cr, t_inputrec *ir, t_mdatoms *md,
 
     s2->flags = s1->flags;
 
-    if (s2->nalloc != s1->nalloc)
+    if (s2->natoms != s1->natoms)
     {
-        s2->nalloc = s1->nalloc;
+        state_change_natoms(s2, s1->natoms);
         /* We need to allocate one element extra, since we might use
          * (unaligned) 4-wide SIMD loads to access rvec entries.
          */
-        srenew(s2->x, s1->nalloc + 1);
-        srenew(ems2->f,  s1->nalloc);
-        if (s2->flags & (1<<estCGP))
-        {
-            srenew(s2->cg_p,  s1->nalloc + 1);
-        }
+        ems2->f.resize(s2->natoms + 1);
+    }
+    if (DOMAINDECOMP(cr) && s2->cg_gl.size() != s1->cg_gl.size())
+    {
+        s2->cg_gl.resize(s1->cg_gl.size());
     }
 
-    s2->natoms = s1->natoms;
     copy_mat(s1->box, s2->box);
     /* Copy free energy state */
-    for (int i = 0; i < efptNR; i++)
-    {
-        s2->lambda[i] = s1->lambda[i];
-    }
+    s2->lambda = s1->lambda;
     copy_mat(s1->box, s2->box);
 
     start = 0;
@@ -627,10 +606,11 @@ static bool do_em_step(t_commrec *cr, t_inputrec *ir, t_mdatoms *md,
     nthreads = gmx_omp_nthreads_get(emntUpdate);
 #pragma omp parallel num_threads(nthreads)
     {
-        rvec *x1 = s1->x;
-        rvec *x2 = s2->x;
+        const rvec *x1 = as_rvec_array(s1->x.data());
+        rvec       *x2 = as_rvec_array(s2->x.data());
+        const rvec *f  = as_rvec_array(force->data());
 
-        int   gf = 0;
+        int         gf = 0;
 #pragma omp for schedule(static) nowait
         for (int i = start; i < end; i++)
         {
@@ -658,8 +638,8 @@ static bool do_em_step(t_commrec *cr, t_inputrec *ir, t_mdatoms *md,
         if (s2->flags & (1<<estCGP))
         {
             /* Copy the CG p vector */
-            rvec *p1 = s1->cg_p;
-            rvec *p2 = s2->cg_p;
+            const rvec *p1 = as_rvec_array(s1->cg_p.data());
+            rvec       *p2 = as_rvec_array(s2->cg_p.data());
 #pragma omp for schedule(static) nowait
             for (int i = start; i < end; i++)
             {
@@ -671,23 +651,10 @@ static bool do_em_step(t_commrec *cr, t_inputrec *ir, t_mdatoms *md,
         if (DOMAINDECOMP(cr))
         {
             s2->ddp_count = s1->ddp_count;
-            if (s2->cg_gl_nalloc < s1->cg_gl_nalloc)
-            {
-#pragma omp barrier
-                s2->cg_gl_nalloc = s1->cg_gl_nalloc;
-                try
-                {
-                    /* We need to allocate one element extra, since we might use
-                     * (unaligned) 4-wide SIMD loads to access rvec entries.
-                     */
-                    srenew(s2->cg_gl, s2->cg_gl_nalloc + 1);
-                }
-                GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
-#pragma omp barrier
-            }
-            s2->ncg_gl = s1->ncg_gl;
+
+            /* OpenMP does not supported unsigned loop variables */
 #pragma omp for schedule(static) nowait
-            for (int i = 0; i < s2->ncg_gl; i++)
+            for (int i = 0; i < static_cast<int>(s2->cg_gl.size()); i++)
             {
                 s2->cg_gl[i] = s1->cg_gl[i];
             }
@@ -700,11 +667,12 @@ static bool do_em_step(t_commrec *cr, t_inputrec *ir, t_mdatoms *md,
         wallcycle_start(wcycle, ewcCONSTR);
         dvdl_constr = 0;
         validStep   =
-            constrain(NULL, TRUE, TRUE, constr, &top->idef,
+            constrain(nullptr, TRUE, TRUE, constr, &top->idef,
                       ir, cr, count, 0, 1.0, md,
-                      s1->x, s2->x, NULL, bMolPBC, s2->box,
+                      as_rvec_array(s1->x.data()), as_rvec_array(s2->x.data()),
+                      nullptr, bMolPBC, s2->box,
                       s2->lambda[efptBONDED], &dvdl_constr,
-                      NULL, NULL, nrnb, econqCoord);
+                      nullptr, nullptr, nrnb, econqCoord);
         wallcycle_stop(wcycle, ewcCONSTR);
 
         // We should move this check to the different minimizers
@@ -728,7 +696,7 @@ static void em_dd_partition_system(FILE *fplog, int step, t_commrec *cr,
 {
     /* Repartition the domain decomposition */
     dd_partition_system(fplog, step, cr, FALSE, 1,
-                        NULL, top_global, ir,
+                        nullptr, top_global, ir,
                         &ems->s, &ems->f,
                         mdatoms, top, fr, vsite, constr,
                         nrnb, wcycle, FALSE);
@@ -775,7 +743,7 @@ static void evaluate_energy(FILE *fplog, t_commrec *cr,
 
     if (vsite)
     {
-        construct_vsites(vsite, ems->s.x, 1, NULL,
+        construct_vsites(vsite, as_rvec_array(ems->s.x.data()), 1, nullptr,
                          top->idef.iparams, top->idef.il,
                          fr->ePBC, fr->bMolPBC, cr, ems->s.box);
     }
@@ -794,12 +762,18 @@ static void evaluate_energy(FILE *fplog, t_commrec *cr,
      */
     do_force(fplog, cr, inputrec,
              count, nrnb, wcycle, top, &top_global->groups,
-             ems->s.box, ems->s.x, &ems->s.hist,
-             ems->f, force_vir, mdatoms, enerd, fcd,
-             ems->s.lambda, graph, fr, vsite, mu_tot, t, NULL, NULL, TRUE,
+             ems->s.box, &ems->s.x, &ems->s.hist,
+             &ems->f, force_vir, mdatoms, enerd, fcd,
+             ems->s.lambda, graph, fr, vsite, mu_tot, t, nullptr, TRUE,
              GMX_FORCE_STATECHANGED | GMX_FORCE_ALLFORCES |
              GMX_FORCE_VIRIAL | GMX_FORCE_ENERGY |
-             (bNS ? GMX_FORCE_NS : 0));
+             (bNS ? GMX_FORCE_NS : 0),
+             DOMAINDECOMP(cr) ?
+             DdOpenBalanceRegionBeforeForceComputation::yes :
+             DdOpenBalanceRegionBeforeForceComputation::no,
+             DOMAINDECOMP(cr) ?
+             DdCloseBalanceRegionAfterForceComputation::yes :
+             DdCloseBalanceRegionAfterForceComputation::no);
 
     /* Clear the unused shake virial and pressure */
     clear_mat(shake_vir);
@@ -811,8 +785,8 @@ static void evaluate_energy(FILE *fplog, t_commrec *cr,
         wallcycle_start(wcycle, ewcMoveE);
 
         global_stat(gstat, cr, enerd, force_vir, shake_vir, mu_tot,
-                    inputrec, NULL, NULL, NULL, 1, &terminate,
-                    NULL, FALSE,
+                    inputrec, nullptr, nullptr, nullptr, 1, &terminate,
+                    nullptr, FALSE,
                     CGLO_ENERGY |
                     CGLO_PRESSURE |
                     CGLO_CONSTRAINT);
@@ -835,11 +809,13 @@ static void evaluate_energy(FILE *fplog, t_commrec *cr,
         /* Project out the constraint components of the force */
         wallcycle_start(wcycle, ewcCONSTR);
         dvdl_constr = 0;
-        constrain(NULL, FALSE, FALSE, constr, &top->idef,
+        rvec *f_rvec = as_rvec_array(ems->f.data());
+        constrain(nullptr, FALSE, FALSE, constr, &top->idef,
                   inputrec, cr, count, 0, 1.0, mdatoms,
-                  ems->s.x, ems->f, ems->f, fr->bMolPBC, ems->s.box,
+                  as_rvec_array(ems->s.x.data()), f_rvec, f_rvec,
+                  fr->bMolPBC, ems->s.box,
                   ems->s.lambda[efptBONDED], &dvdl_constr,
-                  NULL, &shake_vir, nrnb, econqForceDispl);
+                  nullptr, &shake_vir, nrnb, econqForceDispl);
         enerd->term[F_DVDL_CONSTR] += dvdl_constr;
         m_add(force_vir, shake_vir, vir);
         wallcycle_stop(wcycle, ewcCONSTR);
@@ -866,7 +842,6 @@ static double reorder_partsum(t_commrec *cr, t_grpopts *opts, t_mdatoms *mdatoms
                               gmx_mtop_t *top_global,
                               em_state_t *s_min, em_state_t *s_b)
 {
-    rvec          *fm, *fb, *fmg;
     t_block       *cgs_gl;
     int            ncg, *cg_gl, *index, c, cg, i, a0, a1, a, gf, m;
     double         partsum;
@@ -877,8 +852,8 @@ static double reorder_partsum(t_commrec *cr, t_grpopts *opts, t_mdatoms *mdatoms
         fprintf(debug, "Doing reorder_partsum\n");
     }
 
-    fm = s_min->f;
-    fb = s_b->f;
+    const rvec *fm = as_rvec_array(s_min->f.data());
+    const rvec *fb = as_rvec_array(s_b->f.data());
 
     cgs_gl = dd_charge_groups_global(cr->dd);
     index  = cgs_gl->index;
@@ -887,10 +862,11 @@ static double reorder_partsum(t_commrec *cr, t_grpopts *opts, t_mdatoms *mdatoms
      * This conflicts with the spirit of domain decomposition,
      * but to fully optimize this a much more complicated algorithm is required.
      */
+    rvec *fmg;
     snew(fmg, top_global->natoms);
 
-    ncg   = s_min->s.ncg_gl;
-    cg_gl = s_min->s.cg_gl;
+    ncg   = s_min->s.cg_gl.size();
+    cg_gl = s_min->s.cg_gl.data();
     i     = 0;
     for (c = 0; c < ncg; c++)
     {
@@ -906,8 +882,8 @@ static double reorder_partsum(t_commrec *cr, t_grpopts *opts, t_mdatoms *mdatoms
     gmx_sum(top_global->natoms*3, fmg[0], cr);
 
     /* Now we will determine the part of the sum for the cgs in state s_b */
-    ncg         = s_b->s.ncg_gl;
-    cg_gl       = s_b->s.cg_gl;
+    ncg         = s_b->s.cg_gl.size();
+    cg_gl       = s_b->s.cg_gl.data();
     partsum     = 0;
     i           = 0;
     gf          = 0;
@@ -944,9 +920,7 @@ static real pr_beta(t_commrec *cr, t_grpopts *opts, t_mdatoms *mdatoms,
                     gmx_mtop_t *top_global,
                     em_state_t *s_min, em_state_t *s_b)
 {
-    rvec  *fm, *fb;
     double sum;
-    int    gf, i, m;
 
     /* This is just the classical Polak-Ribiere calculation of beta;
      * it looks a bit complicated since we take freeze groups into account,
@@ -957,20 +931,20 @@ static real pr_beta(t_commrec *cr, t_grpopts *opts, t_mdatoms *mdatoms,
         (s_min->s.ddp_count == cr->dd->ddp_count &&
          s_b->s.ddp_count   == cr->dd->ddp_count))
     {
-        fm  = s_min->f;
-        fb  = s_b->f;
-        sum = 0;
-        gf  = 0;
+        const rvec *fm  = as_rvec_array(s_min->f.data());
+        const rvec *fb  = as_rvec_array(s_b->f.data());
+        sum             = 0;
+        int         gf  = 0;
         /* This part of code can be incorrect with DD,
          * since the atom ordering in s_b and s_min might differ.
          */
-        for (i = 0; i < mdatoms->homenr; i++)
+        for (int i = 0; i < mdatoms->homenr; i++)
         {
             if (mdatoms->cFREEZE)
             {
                 gf = mdatoms->cFREEZE[i];
             }
-            for (m = 0; m < DIM; m++)
+            for (int m = 0; m < DIM; m++)
             {
                 if (!opts->nFreeze[gf][m])
                 {
@@ -996,12 +970,12 @@ namespace gmx
 {
 
 /*! \brief Do conjugate gradients minimization
-    \copydoc integrator_t (FILE *fplog, t_commrec *cr,
+    \copydoc integrator_t(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
                            int nfile, const t_filenm fnm[],
-                           const gmx_output_env_t *oenv, gmx_bool bVerbose,
-                           int nstglobalcomm,
+                           const gmx_output_env_t *oenv,
+                           const MdrunOptions &mdrunOptions,
                            gmx_vsite_t *vsite, gmx_constr_t constr,
-                           int stepout,
+                           gmx::IMDOutputProvider *outputProvider,
                            t_inputrec *inputrec,
                            gmx_mtop_t *top_global, t_fcdata *fcd,
                            t_state *state_global,
@@ -1009,44 +983,34 @@ namespace gmx
                            t_nrnb *nrnb, gmx_wallcycle_t wcycle,
                            gmx_edsam_t ed,
                            t_forcerec *fr,
-                           int repl_ex_nst, int repl_ex_nex, int repl_ex_seed,
+                           const ReplicaExchangeParameters &replExParams,
                            gmx_membed_t gmx_unused *membed,
-                           real cpt_period, real max_hours,
-                           int imdport,
-                           unsigned long Flags,
                            gmx_walltime_accounting_t walltime_accounting)
  */
-double do_cg(FILE *fplog, t_commrec *cr,
+double do_cg(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
              int nfile, const t_filenm fnm[],
-             const gmx_output_env_t gmx_unused *oenv, gmx_bool bVerbose,
-             int gmx_unused nstglobalcomm,
+             const gmx_output_env_t gmx_unused *oenv,
+             const MdrunOptions &mdrunOptions,
              gmx_vsite_t *vsite, gmx_constr_t constr,
-             int gmx_unused stepout,
+             gmx::IMDOutputProvider *outputProvider,
              t_inputrec *inputrec,
              gmx_mtop_t *top_global, t_fcdata *fcd,
              t_state *state_global,
+             ObservablesHistory *observablesHistory,
              t_mdatoms *mdatoms,
              t_nrnb *nrnb, gmx_wallcycle_t wcycle,
-             gmx_edsam_t gmx_unused ed,
              t_forcerec *fr,
-             int gmx_unused repl_ex_nst, int gmx_unused repl_ex_nex, int gmx_unused repl_ex_seed,
+             const ReplicaExchangeParameters gmx_unused &replExParams,
              gmx_membed_t gmx_unused *membed,
-             real gmx_unused cpt_period, real gmx_unused max_hours,
-             int imdport,
-             unsigned long gmx_unused Flags,
              gmx_walltime_accounting_t walltime_accounting)
 {
     const char       *CG = "Polak-Ribiere Conjugate Gradients";
 
-    em_state_t       *s_min, *s_a, *s_b, *s_c;
     gmx_localtop_t   *top;
     gmx_enerdata_t   *enerd;
-    rvec             *f;
     gmx_global_stat_t gstat;
     t_graph          *graph;
-    rvec             *p, *sf;
-    double            gpa, gpb, gpc, tmp, minstep;
-    real              fnormn;
+    double            tmp, minstep;
     real              stepsize;
     real              a, b, c, beta = 0.0;
     real              epot_repl = 0;
@@ -1058,20 +1022,26 @@ double do_cg(FILE *fplog, t_commrec *cr,
     tensor            vir, pres;
     int               number_steps, neval = 0, nstcg = inputrec->nstcgsteep;
     gmx_mdoutf_t      outf;
-    int               i, m, gf, step, nminstep;
+    int               m, step, nminstep;
 
     step = 0;
 
-    s_min = init_em_state();
-    s_a   = init_em_state();
-    s_b   = init_em_state();
-    s_c   = init_em_state();
+    // Ensure the extra per-atom state array gets allocated
+    state_global->flags |= (1<<estCGP);
+
+    /* Create 4 states on the stack and extract pointers that we will swap */
+    em_state_t  s0 {}, s1 {}, s2 {}, s3 {};
+    em_state_t *s_min = &s0;
+    em_state_t *s_a   = &s1;
+    em_state_t *s_b   = &s2;
+    em_state_t *s_c   = &s3;
 
     /* Init em and store the local state in s_min */
-    init_em(fplog, CG, cr, inputrec,
-            state_global, top_global, s_min, &top, &f,
-            nrnb, mu_tot, fr, &enerd, &graph, mdatoms, &gstat, vsite, constr,
-            nfile, fnm, &outf, &mdebin, imdport, Flags, wcycle);
+    init_em(fplog, CG, cr, outputProvider, inputrec, mdrunOptions,
+            state_global, top_global, s_min, &top,
+            nrnb, mu_tot, fr, &enerd, &graph, mdatoms, &gstat,
+            vsite, constr, nullptr,
+            nfile, fnm, &outf, &mdebin, wcycle);
 
     /* Print to log file */
     print_em_start(fplog, cr, walltime_accounting, wcycle, CG);
@@ -1104,7 +1074,7 @@ double do_cg(FILE *fplog, t_commrec *cr,
         /* Copy stuff to the energy bin for easy printing etc. */
         upd_mdebin(mdebin, FALSE, FALSE, (double)step,
                    mdatoms->tmass, enerd, &s_min->s, inputrec->fepvals, inputrec->expandedvals, s_min->s.box,
-                   NULL, NULL, vir, pres, NULL, mu_tot, constr);
+                   nullptr, nullptr, vir, pres, nullptr, mu_tot, constr);
 
         print_ebin_header(fplog, step, step);
         print_ebin(mdoutf_get_fp_ene(outf), TRUE, FALSE, FALSE, fplog, step, step, eprNORMAL,
@@ -1144,11 +1114,11 @@ double do_cg(FILE *fplog, t_commrec *cr,
          */
 
         /* Calculate the new direction in p, and the gradient in this direction, gpa */
-        p   = s_min->s.cg_p;
-        sf  = s_min->f;
-        gpa = 0;
-        gf  = 0;
-        for (i = 0; i < mdatoms->homenr; i++)
+        rvec       *pm  = as_rvec_array(s_min->s.cg_p.data());
+        const rvec *sfm = as_rvec_array(s_min->f.data());
+        double      gpa = 0;
+        int         gf  = 0;
+        for (int i = 0; i < mdatoms->homenr; i++)
         {
             if (mdatoms->cFREEZE)
             {
@@ -1158,13 +1128,13 @@ double do_cg(FILE *fplog, t_commrec *cr,
             {
                 if (!inputrec->opts.nFreeze[gf][m])
                 {
-                    p[i][m] = sf[i][m] + beta*p[i][m];
-                    gpa    -= p[i][m]*sf[i][m];
+                    pm[i][m] = sfm[i][m] + beta*pm[i][m];
+                    gpa     -= pm[i][m]*sfm[i][m];
                     /* f is negative gradient, thus the sign */
                 }
                 else
                 {
-                    p[i][m] = 0;
+                    pm[i][m] = 0;
                 }
             }
         }
@@ -1176,7 +1146,7 @@ double do_cg(FILE *fplog, t_commrec *cr,
         }
 
         /* Calculate the norm of the search vector */
-        get_f_norm_max(cr, &(inputrec->opts), mdatoms, p, &pnorm, NULL, NULL);
+        get_f_norm_max(cr, &(inputrec->opts), mdatoms, pm, &pnorm, nullptr, nullptr);
 
         /* Just in case stepsize reaches zero due to numerical precision... */
         if (stepsize <= 0)
@@ -1201,7 +1171,7 @@ double do_cg(FILE *fplog, t_commrec *cr,
          * relative change in coordinate is smaller than precision
          */
         minstep = 0;
-        for (i = 0; i < mdatoms->homenr; i++)
+        for (int i = 0; i < mdatoms->homenr; i++)
         {
             for (m = 0; m < DIM; m++)
             {
@@ -1210,7 +1180,7 @@ double do_cg(FILE *fplog, t_commrec *cr,
                 {
                     tmp = 1.0;
                 }
-                tmp      = p[i][m]/tmp;
+                tmp      = pm[i][m]/tmp;
                 minstep += tmp*tmp;
             }
         }
@@ -1232,9 +1202,9 @@ double do_cg(FILE *fplog, t_commrec *cr,
         do_x = do_per_step(step, inputrec->nstxout);
         do_f = do_per_step(step, inputrec->nstfout);
 
-        write_em_traj(fplog, cr, outf, do_x, do_f, NULL,
+        write_em_traj(fplog, cr, outf, do_x, do_f, nullptr,
                       top_global, inputrec, step,
-                      s_min, state_global);
+                      s_min, state_global, observablesHistory);
 
         /* Take a step downhill.
          * In theory, we should minimize the function along this direction.
@@ -1265,7 +1235,7 @@ double do_cg(FILE *fplog, t_commrec *cr,
         }
 
         /* 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, inputrec, mdatoms, fr->bMolPBC, s_min, c, &s_min->s.cg_p, s_c,
                    constr, top, nrnb, wcycle, -1);
 
         neval++;
@@ -1277,14 +1247,14 @@ double do_cg(FILE *fplog, t_commrec *cr,
                         mu_tot, enerd, vir, pres, -1, FALSE);
 
         /* Calc derivative along line */
-        p   = s_c->s.cg_p;
-        sf  = s_c->f;
-        gpc = 0;
-        for (i = 0; i < mdatoms->homenr; i++)
+        const rvec *pc  = as_rvec_array(s_c->s.cg_p.data());
+        const rvec *sfc = as_rvec_array(s_c->f.data());
+        double      gpc = 0;
+        for (int i = 0; i < mdatoms->homenr; i++)
         {
             for (m = 0; m < DIM; m++)
             {
-                gpc -= p[i][m]*sf[i][m]; /* f is negative gradient, thus the sign */
+                gpc -= pc[i][m]*sfc[i][m]; /* f is negative gradient, thus the sign */
             }
         }
         /* Sum the gradient along the line across CPUs */
@@ -1337,6 +1307,7 @@ double do_cg(FILE *fplog, t_commrec *cr,
          *
          * If we already found a lower value we just skip this step and continue to the update.
          */
+        double gpb;
         if (!foundlower)
         {
             nminstep = 0;
@@ -1373,7 +1344,7 @@ double do_cg(FILE *fplog, t_commrec *cr,
                 }
 
                 /* 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, inputrec, mdatoms, fr->bMolPBC, s_min, b, &s_min->s.cg_p, s_b,
                            constr, top, nrnb, wcycle, -1);
 
                 neval++;
@@ -1387,14 +1358,14 @@ double do_cg(FILE *fplog, t_commrec *cr,
                 /* p does not change within a step, but since the domain decomposition
                  * might change, we have to use cg_p of s_b here.
                  */
-                p   = s_b->s.cg_p;
-                sf  = s_b->f;
-                gpb = 0;
-                for (i = 0; i < mdatoms->homenr; i++)
+                const rvec *pb  = as_rvec_array(s_b->s.cg_p.data());
+                const rvec *sfb = as_rvec_array(s_b->f.data());
+                gpb             = 0;
+                for (int i = 0; i < mdatoms->homenr; i++)
                 {
                     for (m = 0; m < DIM; m++)
                     {
-                        gpb -= p[i][m]*sf[i][m]; /* f is negative gradient, thus the sign */
+                        gpb -= pb[i][m]*sfb[i][m]; /* f is negative gradient, thus the sign */
                     }
                 }
                 /* Sum the gradient along the line across CPUs */
@@ -1415,14 +1386,14 @@ double do_cg(FILE *fplog, t_commrec *cr,
                 if (gpb > 0)
                 {
                     /* Replace c endpoint with b */
-                    swap_em_state(s_b, s_c);
+                    swap_em_state(&s_b, &s_c);
                     c   = b;
                     gpc = gpb;
                 }
                 else
                 {
                     /* Replace a endpoint with b */
-                    swap_em_state(s_b, s_a);
+                    swap_em_state(&s_b, &s_a);
                     a   = b;
                     gpa = gpb;
                 }
@@ -1466,7 +1437,7 @@ double do_cg(FILE *fplog, t_commrec *cr,
                     fprintf(debug, "CGE: C (%f) is lower than A (%f), moving C to B\n",
                             s_c->epot, s_a->epot);
                 }
-                swap_em_state(s_b, s_c);
+                swap_em_state(&s_b, &s_c);
                 gpb = gpc;
             }
             else
@@ -1476,7 +1447,7 @@ double do_cg(FILE *fplog, t_commrec *cr,
                     fprintf(debug, "CGE: A (%f) is lower than C (%f), moving A to B\n",
                             s_a->epot, s_c->epot);
                 }
-                swap_em_state(s_b, s_a);
+                swap_em_state(&s_b, &s_a);
                 gpb = gpa;
             }
 
@@ -1488,7 +1459,7 @@ double do_cg(FILE *fplog, t_commrec *cr,
                 fprintf(debug, "CGE: Found a lower energy %f, moving C to B\n",
                         s_c->epot);
             }
-            swap_em_state(s_b, s_c);
+            swap_em_state(&s_b, &s_c);
             gpb = gpc;
         }
 
@@ -1517,13 +1488,13 @@ double do_cg(FILE *fplog, t_commrec *cr,
 
 
         /* update positions */
-        swap_em_state(s_min, s_b);
+        swap_em_state(&s_min, &s_b);
         gpa = gpb;
 
         /* Print it if necessary */
         if (MASTER(cr))
         {
-            if (bVerbose)
+            if (mdrunOptions.verbose)
             {
                 double sqrtNumAtoms = sqrt(static_cast<double>(state_global->natoms));
                 fprintf(stderr, "\rStep %d, Epot=%12.6e, Fnorm=%9.3e, Fmax=%9.3e (atom %d)\n",
@@ -1534,7 +1505,7 @@ double do_cg(FILE *fplog, t_commrec *cr,
             /* Store the new (lower) energies */
             upd_mdebin(mdebin, FALSE, FALSE, (double)step,
                        mdatoms->tmass, enerd, &s_min->s, inputrec->fepvals, inputrec->expandedvals, s_min->s.box,
-                       NULL, NULL, vir, pres, NULL, mu_tot, constr);
+                       nullptr, nullptr, vir, pres, nullptr, mu_tot, constr);
 
             do_log = do_per_step(step, inputrec->nstlog);
             do_ene = do_per_step(step, inputrec->nstenergy);
@@ -1547,12 +1518,12 @@ double do_cg(FILE *fplog, t_commrec *cr,
                 print_ebin_header(fplog, step, step);
             }
             print_ebin(mdoutf_get_fp_ene(outf), do_ene, FALSE, FALSE,
-                       do_log ? fplog : NULL, step, step, eprNORMAL,
+                       do_log ? fplog : nullptr, step, step, eprNORMAL,
                        mdebin, fcd, &(top_global->groups), &(inputrec->opts));
         }
 
         /* Send energies and positions to the IMD client if bIMD is TRUE. */
-        if (do_IMD(inputrec->bIMD, step, cr, TRUE, state_global->box, state_global->x, inputrec, 0, wcycle) && MASTER(cr))
+        if (do_IMD(inputrec->bIMD, step, cr, TRUE, state_global->box, as_rvec_array(state_global->x.data()), inputrec, 0, wcycle) && MASTER(cr))
         {
             IMD_send_positions(inputrec->imd);
         }
@@ -1596,7 +1567,7 @@ double do_cg(FILE *fplog, t_commrec *cr,
         {
             /* Write final energy file entries */
             print_ebin(mdoutf_get_fp_ene(outf), !do_ene, FALSE, FALSE,
-                       !do_log ? fplog : NULL, step, step, eprNORMAL,
+                       !do_log ? fplog : nullptr, step, step, eprNORMAL,
                        mdebin, fcd, &(top_global->groups), &(inputrec->opts));
         }
     }
@@ -1619,17 +1590,16 @@ double do_cg(FILE *fplog, t_commrec *cr,
 
     write_em_traj(fplog, cr, outf, do_x, do_f, ftp2fn(efSTO, nfile, fnm),
                   top_global, inputrec, step,
-                  s_min, state_global);
+                  s_min, state_global, observablesHistory);
 
 
     if (MASTER(cr))
     {
         double sqrtNumAtoms = sqrt(static_cast<double>(state_global->natoms));
-        fnormn = s_min->fnorm/sqrtNumAtoms;
         print_converged(stderr, CG, inputrec->em_tol, step, converged, number_steps,
-                        s_min->epot, s_min->fmax, s_min->a_fmax, fnormn);
+                        s_min, sqrtNumAtoms);
         print_converged(fplog, CG, inputrec->em_tol, step, converged, number_steps,
-                        s_min->epot, s_min->fmax, s_min->a_fmax, fnormn);
+                        s_min, sqrtNumAtoms);
 
         fprintf(fplog, "\nPerformed %d energy evaluations in total.\n", neval);
     }
@@ -1644,68 +1614,60 @@ double do_cg(FILE *fplog, t_commrec *cr,
 
 
 /*! \brief Do L-BFGS conjugate gradients minimization
-    \copydoc integrator_t (FILE *fplog, t_commrec *cr,
-                           int nfile, const t_filenm fnm[],
-                           const gmx_output_env_t *oenv, gmx_bool bVerbose,
-                           int nstglobalcomm,
-                           gmx_vsite_t *vsite, gmx_constr_t constr,
-                           int stepout,
-                           t_inputrec *inputrec,
-                           gmx_mtop_t *top_global, t_fcdata *fcd,
-                           t_state *state_global,
-                           t_mdatoms *mdatoms,
-                           t_nrnb *nrnb, gmx_wallcycle_t wcycle,
-                           gmx_edsam_t ed,
-                           t_forcerec *fr,
-                           int repl_ex_nst, int repl_ex_nex, int repl_ex_seed,
-                           real cpt_period, real max_hours,
-                           int imdport,
-                           unsigned long Flags,
-                           gmx_walltime_accounting_t walltime_accounting)
+    \copydoc integrator_t(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
+                          int nfile, const t_filenm fnm[],
+                          const gmx_output_env_t *oenv,
+                          const MdrunOptions &mdrunOptions,
+                          gmx_vsite_t *vsite, gmx_constr_t constr,
+                          gmx::IMDOutputProvider *outputProvider,
+                          t_inputrec *inputrec,
+                          gmx_mtop_t *top_global, t_fcdata *fcd,
+                          t_state *state_global,
+                          t_mdatoms *mdatoms,
+                          t_nrnb *nrnb, gmx_wallcycle_t wcycle,
+                          gmx_edsam_t ed,
+                          t_forcerec *fr,
+                          const ReplicaExchangeParameters &replExParams,
+                          gmx_membed_t gmx_unused *membed,
+                          gmx_walltime_accounting_t walltime_accounting)
  */
-double do_lbfgs(FILE *fplog, t_commrec *cr,
+double do_lbfgs(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
                 int nfile, const t_filenm fnm[],
-                const gmx_output_env_t gmx_unused *oenv, gmx_bool bVerbose,
-                int gmx_unused nstglobalcomm,
+                const gmx_output_env_t gmx_unused *oenv,
+                const MdrunOptions &mdrunOptions,
                 gmx_vsite_t *vsite, gmx_constr_t constr,
-                int gmx_unused stepout,
+                gmx::IMDOutputProvider *outputProvider,
                 t_inputrec *inputrec,
                 gmx_mtop_t *top_global, t_fcdata *fcd,
                 t_state *state_global,
+                ObservablesHistory *observablesHistory,
                 t_mdatoms *mdatoms,
                 t_nrnb *nrnb, gmx_wallcycle_t wcycle,
-                gmx_edsam_t gmx_unused ed,
                 t_forcerec *fr,
-                int gmx_unused repl_ex_nst, int gmx_unused repl_ex_nex, int gmx_unused repl_ex_seed,
+                const ReplicaExchangeParameters gmx_unused &replExParams,
                 gmx_membed_t gmx_unused *membed,
-                real gmx_unused cpt_period, real gmx_unused max_hours,
-                int imdport,
-                unsigned long gmx_unused Flags,
                 gmx_walltime_accounting_t walltime_accounting)
 {
     static const char *LBFGS = "Low-Memory BFGS Minimizer";
     em_state_t         ems;
     gmx_localtop_t    *top;
     gmx_enerdata_t    *enerd;
-    rvec              *f;
     gmx_global_stat_t  gstat;
     t_graph           *graph;
     int                ncorr, nmaxcorr, point, cp, neval, nminstep;
     double             stepsize, step_taken, gpa, gpb, gpc, tmp, minstep;
-    real              *rho, *alpha, *ff, *xx, *p, *s, *lastx, *lastf, **dx, **dg;
-    real              *xa, *xb, *xc, *fa, *fb, *fc, *xtmp, *ftmp;
+    real              *rho, *alpha, *p, *s, **dx, **dg;
     real               a, b, c, maxdelta, delta;
-    real               diag, Epot0, Epot, EpotA, EpotB, EpotC;
+    real               diag, Epot0;
     real               dgdx, dgdg, sq, yr, beta;
     t_mdebin          *mdebin;
     gmx_bool           converged;
     rvec               mu_tot;
-    real               fnorm, fmax;
     gmx_bool           do_log, do_ene, do_x, do_f, foundlower, *frozen;
     tensor             vir, pres;
     int                start, end, number_steps;
     gmx_mdoutf_t       outf;
-    int                i, k, m, n, nfmax, gf, step;
+    int                i, k, m, n, gf, step;
     int                mdof_flags;
 
     if (PAR(cr))
@@ -1713,7 +1675,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
         gmx_fatal(FARGS, "Cannot do parallel L-BFGS Minimization - yet.\n");
     }
 
-    if (NULL != constr)
+    if (nullptr != constr)
     {
         gmx_fatal(FARGS, "The combination of constraints and L-BFGS minimization is not implemented. Either do not use constraints, or use another minimizer (e.g. steepest descent).");
     }
@@ -1721,23 +1683,9 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
     n        = 3*state_global->natoms;
     nmaxcorr = inputrec->nbfgscorr;
 
-    /* Allocate memory */
-    /* Use pointers to real so we dont have to loop over both atoms and
-     * dimensions all the time...
-     * x/f are allocated as rvec *, so make new x0/f0 pointers-to-real
-     * that point to the same memory.
-     */
-    snew(xa, n);
-    snew(xb, n);
-    snew(xc, n);
-    snew(fa, n);
-    snew(fb, n);
-    snew(fc, n);
     snew(frozen, n);
 
     snew(p, n);
-    snew(lastx, n);
-    snew(lastf, n);
     snew(rho, nmaxcorr);
     snew(alpha, nmaxcorr);
 
@@ -1757,22 +1705,26 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
     neval = 0;
 
     /* Init em */
-    init_em(fplog, LBFGS, cr, inputrec,
-            state_global, top_global, &ems, &top, &f,
-            nrnb, mu_tot, fr, &enerd, &graph, mdatoms, &gstat, vsite, constr,
-            nfile, fnm, &outf, &mdebin, imdport, Flags, wcycle);
-    /* Do_lbfgs is not completely updated like do_steep and do_cg,
-     * so we free some memory again.
-     */
-    sfree(ems.s.x);
-    sfree(ems.f);
-
-    xx = (real *)state_global->x;
-    ff = (real *)f;
+    init_em(fplog, LBFGS, cr, outputProvider, inputrec, mdrunOptions,
+            state_global, top_global, &ems, &top,
+            nrnb, mu_tot, fr, &enerd, &graph, mdatoms, &gstat,
+            vsite, constr, nullptr,
+            nfile, fnm, &outf, &mdebin, wcycle);
 
     start = 0;
     end   = mdatoms->homenr;
 
+    /* We need 4 working states */
+    em_state_t  s0 {}, s1 {}, s2 {}, s3 {};
+    em_state_t *sa   = &s0;
+    em_state_t *sb   = &s1;
+    em_state_t *sc   = &s2;
+    em_state_t *last = &s3;
+    /* Initialize by copying the state from ems (we could skip x and f here) */
+    *sa              = ems;
+    *sb              = ems;
+    *sc              = ems;
+
     /* Print to log file */
     print_em_start(fplog, cr, walltime_accounting, wcycle, LBFGS);
 
@@ -1805,7 +1757,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
 
     if (vsite)
     {
-        construct_vsites(vsite, state_global->x, 1, NULL,
+        construct_vsites(vsite, as_rvec_array(state_global->x.data()), 1, nullptr,
                          top->idef.iparams, top->idef.il,
                          fr->ePBC, fr->bMolPBC, cr, state_global->box);
     }
@@ -1815,8 +1767,6 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
      * We do not unshift, so molecules are always whole
      */
     neval++;
-    ems.s.x = state_global->x;
-    ems.f   = f;
     evaluate_energy(fplog, cr,
                     top_global, &ems, top,
                     inputrec, nrnb, wcycle, gstat,
@@ -1829,7 +1779,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
         /* Copy stuff to the energy bin for easy printing etc. */
         upd_mdebin(mdebin, FALSE, FALSE, (double)step,
                    mdatoms->tmass, enerd, state_global, inputrec->fepvals, inputrec->expandedvals, state_global->box,
-                   NULL, NULL, vir, pres, NULL, mu_tot, constr);
+                   nullptr, nullptr, vir, pres, nullptr, mu_tot, constr);
 
         print_ebin_header(fplog, step, step);
         print_ebin(mdoutf_get_fp_ene(outf), TRUE, FALSE, FALSE, fplog, step, step, eprNORMAL,
@@ -1837,13 +1787,6 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
     }
     where();
 
-    /* This is the starting energy */
-    Epot = enerd->term[F_EPOT];
-
-    fnorm = ems.fnorm;
-    fmax  = ems.fmax;
-    nfmax = ems.a_fmax;
-
     /* Set the initial step.
      * since it will be multiplied by the non-normalized search direction
      * vector (force vector the first time), we scale it by the
@@ -1854,13 +1797,13 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
     {
         double sqrtNumAtoms = sqrt(static_cast<double>(state_global->natoms));
         fprintf(stderr, "Using %d BFGS correction steps.\n\n", nmaxcorr);
-        fprintf(stderr, "   F-max             = %12.5e on atom %d\n", fmax, nfmax+1);
-        fprintf(stderr, "   F-Norm            = %12.5e\n", fnorm/sqrtNumAtoms);
+        fprintf(stderr, "   F-max             = %12.5e on atom %d\n", ems.fmax, ems.a_fmax + 1);
+        fprintf(stderr, "   F-Norm            = %12.5e\n", ems.fnorm/sqrtNumAtoms);
         fprintf(stderr, "\n");
         /* and copy to the log file too... */
         fprintf(fplog, "Using %d BFGS correction steps.\n\n", nmaxcorr);
-        fprintf(fplog, "   F-max             = %12.5e on atom %d\n", fmax, nfmax+1);
-        fprintf(fplog, "   F-Norm            = %12.5e\n", fnorm/sqrtNumAtoms);
+        fprintf(fplog, "   F-max             = %12.5e on atom %d\n", ems.fmax, ems.a_fmax + 1);
+        fprintf(fplog, "   F-Norm            = %12.5e\n", ems.fnorm/sqrtNumAtoms);
         fprintf(fplog, "\n");
     }
 
@@ -1868,11 +1811,12 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
     point = 0;
 
     // Set initial search direction to the force (-gradient), or 0 for frozen particles.
+    real *fInit = static_cast<real *>(as_rvec_array(ems.f.data())[0]);
     for (i = 0; i < n; i++)
     {
         if (!frozen[i])
         {
-            dx[point][i] = ff[i]; /* Initial search direction */
+            dx[point][i] = fInit[i]; /* Initial search direction */
         }
         else
         {
@@ -1884,7 +1828,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
     // (the main efficiency in the algorithm comes from changing directions), but
     // we still need an initial value, so estimate it as the inverse of the norm
     // so we take small steps where the potential fluctuates a lot.
-    stepsize  = 1.0/fnorm;
+    stepsize  = 1.0/ems.fnorm;
 
     /* Start the loop over BFGS steps.
      * Each successful step is counted, and we continue until
@@ -1919,13 +1863,16 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
         }
 
         mdoutf_write_to_trajectory_files(fplog, cr, outf, mdof_flags,
-                                         top_global, step, (real)step, state_global, state_global, f);
+                                         top_global, step, (real)step, &ems.s, state_global, observablesHistory, &ems.f);
 
         /* Do the linesearching in the direction dx[point][0..(n-1)] */
 
         /* make s a pointer to current search direction - point=0 first time we get here */
         s = dx[point];
 
+        real *xx = static_cast<real *>(as_rvec_array(ems.s.x.data())[0]);
+        real *ff = static_cast<real *>(as_rvec_array(ems.f.data())[0]);
+
         // calculate line gradient in position A
         for (gpa = 0, i = 0; i < n; i++)
         {
@@ -1954,17 +1901,12 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
         }
 
         // Before taking any steps along the line, store the old position
-        for (i = 0; i < n; i++)
-        {
-            lastx[i] = xx[i];
-            lastf[i] = ff[i];
-        }
-        Epot0 = Epot;
+        *last       = ems;
+        real *lastx = static_cast<real *>(as_rvec_array(last->s.x.data())[0]);
+        real *lastf = static_cast<real *>(as_rvec_array(last->f.data())[0]);
+        Epot0       = ems.epot;
 
-        for (i = 0; i < n; i++)
-        {
-            xa[i] = xx[i];
-        }
+        *sa         = ems;
 
         /* Take a step downhill.
          * In theory, we should find the actual minimum of the function in this
@@ -1993,7 +1935,6 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
 
         // State "A" is the first position along the line.
         // reference position along line is initially zero
-        EpotA      = Epot0;
         a          = 0.0;
 
         // Check stepsize first. We do not allow displacements
@@ -2024,6 +1965,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
         while (maxdelta > inputrec->em_stepsize);
 
         // Take a trial step and move the coordinate array xc[] to position C
+        real *xc = static_cast<real *>(as_rvec_array(sc->s.x.data())[0]);
         for (i = 0; i < n; i++)
         {
             xc[i] = lastx[i] + c*s[i];
@@ -2031,16 +1973,14 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
 
         neval++;
         // Calculate energy for the trial step in position C
-        ems.s.x = (rvec *)xc;
-        ems.f   = (rvec *)fc;
         evaluate_energy(fplog, cr,
-                        top_global, &ems, top,
+                        top_global, sc, top,
                         inputrec, nrnb, wcycle, gstat,
                         vsite, constr, fcd, graph, mdatoms, fr,
                         mu_tot, enerd, vir, pres, step, FALSE);
-        EpotC = ems.epot;
 
         // Calc line gradient in position C
+        real *fc = static_cast<real *>(as_rvec_array(sc->f.data())[0]);
         for (gpc = 0, i = 0; i < n; i++)
         {
             gpc -= s[i]*fc[i]; /* f is negative gradient, thus the sign */
@@ -2054,11 +1994,11 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
         // This is the max amount of increase in energy we tolerate.
         // By allowing VERY small changes (close to numerical precision) we
         // frequently find even better (lower) final energies.
-        tmp = sqrt(GMX_REAL_EPS)*fabs(EpotA);
+        tmp = sqrt(GMX_REAL_EPS)*fabs(sa->epot);
 
         // Accept the step if the energy is lower in the new position C (compared to A),
         // or if it is not significantly higher and the line derivative is still negative.
-        if (EpotC < EpotA || (gpc < 0 && EpotC < (EpotA+tmp)))
+        if (sc->epot < sa->epot || (gpc < 0 && sc->epot < (sa->epot + tmp)))
         {
             // Great, we found a better energy. We no longer try to alter the
             // stepsize, but simply accept this new better position. The we select a new
@@ -2066,7 +2006,6 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
             // to take smaller steps along a line. Set fnorm based on the new C position,
             // which will be used to update the stepsize to 1/fnorm further down.
             foundlower = TRUE;
-            fnorm      = ems.fnorm;
         }
         else
         {
@@ -2091,7 +2030,8 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
             // I also have a safeguard for potentially really pathological functions so we never
             // take more than 20 steps before we give up.
             // If we already found a lower value we just skip this step and continue to the update.
-            nminstep = 0;
+            real fnorm = 0;
+            nminstep   = 0;
             do
             {
                 // Select a new trial point B in the interval [A,C].
@@ -2116,6 +2056,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
                 }
 
                 // Take a trial step to point B
+                real *xb = static_cast<real *>(as_rvec_array(sb->s.x.data())[0]);
                 for (i = 0; i < n; i++)
                 {
                     xb[i] = lastx[i] + b*s[i];
@@ -2123,17 +2064,15 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
 
                 neval++;
                 // Calculate energy for the trial step in point B
-                ems.s.x = (rvec *)xb;
-                ems.f   = (rvec *)fb;
                 evaluate_energy(fplog, cr,
-                                top_global, &ems, top,
+                                top_global, sb, top,
                                 inputrec, nrnb, wcycle, gstat,
                                 vsite, constr, fcd, graph, mdatoms, fr,
                                 mu_tot, enerd, vir, pres, step, FALSE);
-                EpotB = ems.epot;
-                fnorm = ems.fnorm;
+                fnorm = sb->fnorm;
 
                 // Calculate gradient in point B
+                real *fb = static_cast<real *>(as_rvec_array(sb->f.data())[0]);
                 for (gpb = 0, i = 0; i < n; i++)
                 {
                     gpb -= s[i]*fb[i]; /* f is negative gradient, thus the sign */
@@ -2150,30 +2089,16 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
                 if (gpb > 0)
                 {
                     /* Replace c endpoint with b */
-                    EpotC = EpotB;
-                    c     = b;
-                    gpc   = gpb;
-                    /* swap coord pointers b/c */
-                    xtmp = xb;
-                    ftmp = fb;
-                    xb   = xc;
-                    fb   = fc;
-                    xc   = xtmp;
-                    fc   = ftmp;
+                    c   = b;
+                    /* swap states b and c */
+                    swap_em_state(&sb, &sc);
                 }
                 else
                 {
                     /* Replace a endpoint with b */
-                    EpotA = EpotB;
-                    a     = b;
-                    gpa   = gpb;
-                    /* swap coord pointers a/b */
-                    xtmp = xb;
-                    ftmp = fb;
-                    xb   = xa;
-                    fb   = fa;
-                    xa   = xtmp;
-                    fa   = ftmp;
+                    a   = b;
+                    /* swap states a and b */
+                    swap_em_state(&sa, &sb);
                 }
 
                 /*
@@ -2183,9 +2108,9 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
                  */
                 nminstep++;
             }
-            while ((EpotB > EpotA || EpotB > EpotC) && (nminstep < 20));
+            while ((sb->epot > sa->epot || sb->epot > sc->epot) && (nminstep < 20));
 
-            if (fabs(EpotB-Epot0) < GMX_REAL_EPS || nminstep >= 20)
+            if (fabs(sb->epot - Epot0) < GMX_REAL_EPS || nminstep >= 20)
             {
                 /* OK. We couldn't find a significantly lower energy.
                  * If ncorr==0 this was steepest descent, and then we give up.
@@ -2214,26 +2139,16 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
 
             /* Select min energy state of A & C, put the best in xx/ff/Epot
              */
-            if (EpotC < EpotA)
+            if (sc->epot < sa->epot)
             {
-                Epot = EpotC;
                 /* Use state C */
-                for (i = 0; i < n; i++)
-                {
-                    xx[i] = xc[i];
-                    ff[i] = fc[i];
-                }
+                ems        = *sc;
                 step_taken = c;
             }
             else
             {
-                Epot = EpotA;
                 /* Use state A */
-                for (i = 0; i < n; i++)
-                {
-                    xx[i] = xa[i];
-                    ff[i] = fa[i];
-                }
+                ems        = *sa;
                 step_taken = a;
             }
 
@@ -2241,13 +2156,8 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
         else
         {
             /* found lower */
-            Epot = EpotC;
             /* Use state C */
-            for (i = 0; i < n; i++)
-            {
-                xx[i] = xc[i];
-                ff[i] = fc[i];
-            }
+            ems        = *sc;
             step_taken = c;
         }
 
@@ -2357,23 +2267,20 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
             }
         }
 
-        /* Test whether the convergence criterion is met */
-        get_f_norm_max(cr, &(inputrec->opts), mdatoms, f, &fnorm, &fmax, &nfmax);
-
         /* Print it if necessary */
         if (MASTER(cr))
         {
-            if (bVerbose)
+            if (mdrunOptions.verbose)
             {
                 double sqrtNumAtoms = sqrt(static_cast<double>(state_global->natoms));
                 fprintf(stderr, "\rStep %d, Epot=%12.6e, Fnorm=%9.3e, Fmax=%9.3e (atom %d)\n",
-                        step, Epot, fnorm/sqrtNumAtoms, fmax, nfmax+1);
+                        step, ems.epot, ems.fnorm/sqrtNumAtoms, ems.fmax, ems.a_fmax + 1);
                 fflush(stderr);
             }
             /* Store the new (lower) energies */
             upd_mdebin(mdebin, FALSE, FALSE, (double)step,
                        mdatoms->tmass, enerd, state_global, inputrec->fepvals, inputrec->expandedvals, state_global->box,
-                       NULL, NULL, vir, pres, NULL, mu_tot, constr);
+                       nullptr, nullptr, vir, pres, nullptr, mu_tot, constr);
             do_log = do_per_step(step, inputrec->nstlog);
             do_ene = do_per_step(step, inputrec->nstenergy);
             if (do_log)
@@ -2381,23 +2288,23 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
                 print_ebin_header(fplog, step, step);
             }
             print_ebin(mdoutf_get_fp_ene(outf), do_ene, FALSE, FALSE,
-                       do_log ? fplog : NULL, step, step, eprNORMAL,
+                       do_log ? fplog : nullptr, step, step, eprNORMAL,
                        mdebin, fcd, &(top_global->groups), &(inputrec->opts));
         }
 
         /* Send x and E to IMD client, if bIMD is TRUE. */
-        if (do_IMD(inputrec->bIMD, step, cr, TRUE, state_global->box, state_global->x, inputrec, 0, wcycle) && MASTER(cr))
+        if (do_IMD(inputrec->bIMD, step, cr, TRUE, state_global->box, as_rvec_array(state_global->x.data()), inputrec, 0, wcycle) && MASTER(cr))
         {
             IMD_send_positions(inputrec->imd);
         }
 
         // Reset stepsize in we are doing more iterations
-        stepsize = 1.0/fnorm;
+        stepsize = 1.0/ems.fnorm;
 
         /* Stop when the maximum force lies below tolerance.
          * If we have reached machine precision, converged is already set to true.
          */
-        converged = converged || (fmax < inputrec->em_tol);
+        converged = converged || (ems.fmax < inputrec->em_tol);
 
     }   /* End of the loop */
 
@@ -2409,7 +2316,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
         step--; /* we never took that last step in this case */
 
     }
-    if (fmax > inputrec->em_tol)
+    if (ems.fmax > inputrec->em_tol)
     {
         if (MASTER(cr))
         {
@@ -2429,7 +2336,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
     if (!do_ene || !do_log) /* Write final energy file entries */
     {
         print_ebin(mdoutf_get_fp_ene(outf), !do_ene, FALSE, FALSE,
-                   !do_log ? fplog : NULL, step, step, eprNORMAL,
+                   !do_log ? fplog : nullptr, step, step, eprNORMAL,
                    mdebin, fcd, &(top_global->groups), &(inputrec->opts));
     }
 
@@ -2450,15 +2357,15 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
     do_f = !do_per_step(step, inputrec->nstfout);
     write_em_traj(fplog, cr, outf, do_x, do_f, ftp2fn(efSTO, nfile, fnm),
                   top_global, inputrec, step,
-                  &ems, state_global);
+                  &ems, state_global, observablesHistory);
 
     if (MASTER(cr))
     {
         double sqrtNumAtoms = sqrt(static_cast<double>(state_global->natoms));
         print_converged(stderr, LBFGS, inputrec->em_tol, step, converged,
-                        number_steps, Epot, fmax, nfmax, fnorm/sqrtNumAtoms);
+                        number_steps, &ems, sqrtNumAtoms);
         print_converged(fplog, LBFGS, inputrec->em_tol, step, converged,
-                        number_steps, Epot, fmax, nfmax, fnorm/sqrtNumAtoms);
+                        number_steps, &ems, sqrtNumAtoms);
 
         fprintf(fplog, "\nPerformed %d energy evaluations in total.\n", neval);
     }
@@ -2472,54 +2379,46 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
 }   /* That's all folks */
 
 /*! \brief Do steepest descents minimization
-    \copydoc integrator_t (FILE *fplog, t_commrec *cr,
-                           int nfile, const t_filenm fnm[],
-                           const gmx_output_env_t *oenv, gmx_bool bVerbose,
-                           int nstglobalcomm,
-                           gmx_vsite_t *vsite, gmx_constr_t constr,
-                           int stepout,
-                           t_inputrec *inputrec,
-                           gmx_mtop_t *top_global, t_fcdata *fcd,
-                           t_state *state_global,
-                           t_mdatoms *mdatoms,
-                           t_nrnb *nrnb, gmx_wallcycle_t wcycle,
-                           gmx_edsam_t ed,
-                           t_forcerec *fr,
-                           int repl_ex_nst, int repl_ex_nex, int repl_ex_seed,
-                           real cpt_period, real max_hours,
-                           int imdport,
-                           unsigned long Flags,
-                           gmx_walltime_accounting_t walltime_accounting)
+    \copydoc integrator_t(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
+                          int nfile, const t_filenm fnm[],
+                          const gmx_output_env_t *oenv,
+                          const MdrunOptions &mdrunOptions,
+                          gmx_vsite_t *vsite, gmx_constr_t constr,
+                          gmx::IMDOutputProvider *outputProvider,
+                          t_inputrec *inputrec,
+                          gmx_mtop_t *top_global, t_fcdata *fcd,
+                          t_state *state_global,
+                          t_mdatoms *mdatoms,
+                          t_nrnb *nrnb, gmx_wallcycle_t wcycle,
+                          gmx_edsam_t ed,
+                          t_forcerec *fr,
+                          const ReplicaExchangeParameters &replExParams,
+                          gmx_walltime_accounting_t walltime_accounting)
  */
-double do_steep(FILE *fplog, t_commrec *cr,
+double do_steep(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
                 int nfile, const t_filenm fnm[],
-                const gmx_output_env_t gmx_unused *oenv, gmx_bool bVerbose,
-                int gmx_unused nstglobalcomm,
+                const gmx_output_env_t gmx_unused *oenv,
+                const MdrunOptions &mdrunOptions,
                 gmx_vsite_t *vsite, gmx_constr_t constr,
-                int gmx_unused stepout,
+                gmx::IMDOutputProvider *outputProvider,
                 t_inputrec *inputrec,
                 gmx_mtop_t *top_global, t_fcdata *fcd,
                 t_state *state_global,
+                ObservablesHistory *observablesHistory,
                 t_mdatoms *mdatoms,
                 t_nrnb *nrnb, gmx_wallcycle_t wcycle,
-                gmx_edsam_t gmx_unused  ed,
                 t_forcerec *fr,
-                int gmx_unused repl_ex_nst, int gmx_unused repl_ex_nex, int gmx_unused repl_ex_seed,
+                const ReplicaExchangeParameters gmx_unused &replExParams,
                 gmx_membed_t gmx_unused *membed,
-                real gmx_unused cpt_period, real gmx_unused max_hours,
-                int imdport,
-                unsigned long gmx_unused Flags,
                 gmx_walltime_accounting_t walltime_accounting)
 {
     const char       *SD = "Steepest Descents";
-    em_state_t       *s_min, *s_try;
     gmx_localtop_t   *top;
     gmx_enerdata_t   *enerd;
-    rvec             *f;
     gmx_global_stat_t gstat;
     t_graph          *graph;
     real              stepsize;
-    real              ustep, fnormn;
+    real              ustep;
     gmx_mdoutf_t      outf;
     t_mdebin         *mdebin;
     gmx_bool          bDone, bAbort, do_x, do_f;
@@ -2529,14 +2428,17 @@ double do_steep(FILE *fplog, t_commrec *cr,
     int               count          = 0;
     int               steps_accepted = 0;
 
-    s_min = init_em_state();
-    s_try = init_em_state();
+    /* Create 2 states on the stack and extract pointers that we will swap */
+    em_state_t  s0 {}, s1 {};
+    em_state_t *s_min = &s0;
+    em_state_t *s_try = &s1;
 
     /* Init em and store the local state in s_try */
-    init_em(fplog, SD, cr, inputrec,
-            state_global, top_global, s_try, &top, &f,
-            nrnb, mu_tot, fr, &enerd, &graph, mdatoms, &gstat, vsite, constr,
-            nfile, fnm, &outf, &mdebin, imdport, Flags, wcycle);
+    init_em(fplog, SD, cr, outputProvider, inputrec, mdrunOptions,
+            state_global, top_global, s_try, &top,
+            nrnb, mu_tot, fr, &enerd, &graph, mdatoms, &gstat,
+            vsite, constr, nullptr,
+            nfile, fnm, &outf, &mdebin, wcycle);
 
     /* Print to log file  */
     print_em_start(fplog, cr, walltime_accounting, wcycle, SD);
@@ -2579,7 +2481,7 @@ double do_steep(FILE *fplog, t_commrec *cr,
         {
             validStep =
                 do_em_step(cr, inputrec, mdatoms, fr->bMolPBC,
-                           s_min, stepsize, s_min->f, s_try,
+                           s_min, stepsize, &s_min->f, s_try,
                            constr, top, nrnb, wcycle, count);
         }
 
@@ -2610,7 +2512,7 @@ double do_steep(FILE *fplog, t_commrec *cr,
         /* Print it if necessary  */
         if (MASTER(cr))
         {
-            if (bVerbose)
+            if (mdrunOptions.verbose)
             {
                 fprintf(stderr, "Step=%5d, Dmax= %6.1e nm, Epot= %12.5e Fmax= %11.5e, atom= %d%c",
                         count, ustep, s_try->epot, s_try->fmax, s_try->a_fmax+1,
@@ -2623,7 +2525,7 @@ double do_steep(FILE *fplog, t_commrec *cr,
                 /* Store the new (lower) energies  */
                 upd_mdebin(mdebin, FALSE, FALSE, (double)count,
                            mdatoms->tmass, enerd, &s_try->s, inputrec->fepvals, inputrec->expandedvals,
-                           s_try->s.box, NULL, NULL, vir, pres, NULL, mu_tot, constr);
+                           s_try->s.box, nullptr, nullptr, vir, pres, nullptr, mu_tot, constr);
 
                 /* Prepare IMD energy record, if bIMD is TRUE. */
                 IMD_fill_energy_record(inputrec->bIMD, inputrec->imd, enerd, count, TRUE);
@@ -2652,7 +2554,7 @@ double do_steep(FILE *fplog, t_commrec *cr,
             /* Copy the arrays for force, positions and energy  */
             /* The 'Min' array always holds the coords and forces of the minimal
                sampled energy  */
-            swap_em_state(s_min, s_try);
+            swap_em_state(&s_min, &s_try);
             if (count > 0)
             {
                 ustep *= 1.2;
@@ -2661,9 +2563,9 @@ double do_steep(FILE *fplog, t_commrec *cr,
             /* Write to trn, if necessary */
             do_x = do_per_step(steps_accepted, inputrec->nstxout);
             do_f = do_per_step(steps_accepted, inputrec->nstfout);
-            write_em_traj(fplog, cr, outf, do_x, do_f, NULL,
+            write_em_traj(fplog, cr, outf, do_x, do_f, nullptr,
                           top_global, inputrec, count,
-                          s_min, state_global);
+                          s_min, state_global, observablesHistory);
         }
         else
         {
@@ -2691,14 +2593,14 @@ double do_steep(FILE *fplog, t_commrec *cr,
         {
             if (MASTER(cr))
             {
-                warn_step(stderr, inputrec->em_tol, count == nsteps, constr != NULL);
-                warn_step(fplog, inputrec->em_tol, count == nsteps, constr != NULL);
+                warn_step(stderr, inputrec->em_tol, count == nsteps, constr != nullptr);
+                warn_step(fplog, inputrec->em_tol, count == nsteps, constr != nullptr);
             }
             bAbort = TRUE;
         }
 
         /* Send IMD energies and positions, if bIMD is TRUE. */
-        if (do_IMD(inputrec->bIMD, count, cr, TRUE, state_global->box, state_global->x, inputrec, 0, wcycle) && MASTER(cr))
+        if (do_IMD(inputrec->bIMD, count, cr, TRUE, state_global->box, as_rvec_array(state_global->x.data()), inputrec, 0, wcycle) && MASTER(cr))
         {
             IMD_send_positions(inputrec->imd);
         }
@@ -2716,17 +2618,16 @@ double do_steep(FILE *fplog, t_commrec *cr,
     }
     write_em_traj(fplog, cr, outf, TRUE, inputrec->nstfout, ftp2fn(efSTO, nfile, fnm),
                   top_global, inputrec, count,
-                  s_min, state_global);
+                  s_min, state_global, observablesHistory);
 
     if (MASTER(cr))
     {
         double sqrtNumAtoms = sqrt(static_cast<double>(state_global->natoms));
-        fnormn = s_min->fnorm/sqrtNumAtoms;
 
         print_converged(stderr, SD, inputrec->em_tol, count, bDone, nsteps,
-                        s_min->epot, s_min->fmax, s_min->a_fmax, fnormn);
+                        s_min, sqrtNumAtoms);
         print_converged(fplog, SD, inputrec->em_tol, count, bDone, nsteps,
-                        s_min->epot, s_min->fmax, s_min->a_fmax, fnormn);
+                        s_min, sqrtNumAtoms);
     }
 
     finish_em(cr, outf, walltime_accounting, wcycle);
@@ -2740,43 +2641,37 @@ double do_steep(FILE *fplog, t_commrec *cr,
 }   /* That's all folks */
 
 /*! \brief Do normal modes analysis
-    \copydoc integrator_t (FILE *fplog, t_commrec *cr,
-                           int nfile, const t_filenm fnm[],
-                           const gmx_output_env_t *oenv, gmx_bool bVerbose,
-                           int nstglobalcomm,
-                           gmx_vsite_t *vsite, gmx_constr_t constr,
-                           int stepout,
-                           t_inputrec *inputrec,
-                           gmx_mtop_t *top_global, t_fcdata *fcd,
-                           t_state *state_global,
-                           t_mdatoms *mdatoms,
-                           t_nrnb *nrnb, gmx_wallcycle_t wcycle,
-                           gmx_edsam_t ed,
-                           t_forcerec *fr,
-                           int repl_ex_nst, int repl_ex_nex, int repl_ex_seed,
-                           real cpt_period, real max_hours,
-                           int imdport,
-                           unsigned long Flags,
-                           gmx_walltime_accounting_t walltime_accounting)
+    \copydoc integrator_t(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
+                          int nfile, const t_filenm fnm[],
+                          const gmx_output_env_t *oenv,
+                          const MdrunOptions &mdrunOptions,
+                          gmx_vsite_t *vsite, gmx_constr_t constr,
+                          gmx::IMDOutputProvider *outputProvider,
+                          t_inputrec *inputrec,
+                          gmx_mtop_t *top_global, t_fcdata *fcd,
+                          t_state *state_global,
+                          t_mdatoms *mdatoms,
+                          t_nrnb *nrnb, gmx_wallcycle_t wcycle,
+                          gmx_edsam_t ed,
+                          t_forcerec *fr,
+                          const ReplicaExchangeParameters &replExParams,
+                          gmx_walltime_accounting_t walltime_accounting)
  */
-double do_nm(FILE *fplog, t_commrec *cr,
+double do_nm(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
              int nfile, const t_filenm fnm[],
-             const gmx_output_env_t gmx_unused *oenv, gmx_bool bVerbose,
-             int gmx_unused nstglobalcomm,
+             const gmx_output_env_t gmx_unused *oenv,
+             const MdrunOptions &mdrunOptions,
              gmx_vsite_t *vsite, gmx_constr_t constr,
-             int gmx_unused stepout,
+             gmx::IMDOutputProvider *outputProvider,
              t_inputrec *inputrec,
              gmx_mtop_t *top_global, t_fcdata *fcd,
              t_state *state_global,
+             ObservablesHistory gmx_unused *observablesHistory,
              t_mdatoms *mdatoms,
              t_nrnb *nrnb, gmx_wallcycle_t wcycle,
-             gmx_edsam_t  gmx_unused ed,
              t_forcerec *fr,
-             int gmx_unused repl_ex_nst, int gmx_unused repl_ex_nex, int gmx_unused repl_ex_seed,
+             const ReplicaExchangeParameters gmx_unused &replExParams,
              gmx_membed_t gmx_unused *membed,
-             real gmx_unused cpt_period, real gmx_unused max_hours,
-             int imdport,
-             unsigned long gmx_unused Flags,
              gmx_walltime_accounting_t walltime_accounting)
 {
     const char          *NM = "Normal Mode Analysis";
@@ -2784,7 +2679,6 @@ double do_nm(FILE *fplog, t_commrec *cr,
     int                  nnodes, node;
     gmx_localtop_t      *top;
     gmx_enerdata_t      *enerd;
-    rvec                *f;
     gmx_global_stat_t    gstat;
     t_graph             *graph;
     tensor               vir, pres;
@@ -2792,9 +2686,8 @@ double do_nm(FILE *fplog, t_commrec *cr,
     rvec                *fneg, *dfdx;
     gmx_bool             bSparse; /* use sparse matrix storage format */
     size_t               sz;
-    gmx_sparsematrix_t * sparse_matrix           = NULL;
-    real           *     full_matrix             = NULL;
-    em_state_t       *   state_work;
+    gmx_sparsematrix_t * sparse_matrix           = nullptr;
+    real           *     full_matrix             = nullptr;
 
     /* added with respect to mdrun */
     int                       row, col;
@@ -2802,30 +2695,22 @@ double do_nm(FILE *fplog, t_commrec *cr,
     real                      x_min;
     bool                      bIsMaster = MASTER(cr);
 
-    if (constr != NULL)
+    if (constr != nullptr)
     {
         gmx_fatal(FARGS, "Constraints present with Normal Mode Analysis, this combination is not supported");
     }
 
-    state_work = init_em_state();
+    gmx_shellfc_t *shellfc;
 
-    /* Init em and store the local state in state_minimum */
-    init_em(fplog, NM, cr, inputrec,
-            state_global, top_global, state_work, &top,
-            &f,
-            nrnb, mu_tot, fr, &enerd, &graph, mdatoms, &gstat, vsite, constr,
-            nfile, fnm, &outf, NULL, imdport, Flags, wcycle);
+    em_state_t     state_work {};
 
-    gmx_shellfc_t *shellfc = init_shell_flexcon(stdout,
-                                                top_global,
-                                                n_flexible_constraints(constr),
-                                                inputrec->nstcalcenergy,
-                                                DOMAINDECOMP(cr));
+    /* Init em and store the local state in state_minimum */
+    init_em(fplog, NM, cr, outputProvider, inputrec, mdrunOptions,
+            state_global, top_global, &state_work, &top,
+            nrnb, mu_tot, fr, &enerd, &graph, mdatoms, &gstat,
+            vsite, constr, &shellfc,
+            nfile, fnm, &outf, nullptr, wcycle);
 
-    if (shellfc)
-    {
-        make_local_shells(cr, mdatoms, shellfc);
-    }
     std::vector<size_t> atom_index = get_atom_index(top_global);
     snew(fneg, atom_index.size());
     snew(dfdx, atom_index.size());
@@ -2849,17 +2734,18 @@ double do_nm(FILE *fplog, t_commrec *cr,
      */
     if (EEL_FULL(fr->eeltype) || fr->rlist == 0.0)
     {
-        md_print_info(cr, fplog, "Non-cutoff electrostatics used, forcing full Hessian format.\n");
+        GMX_LOG(mdlog.warning).appendText("Non-cutoff electrostatics used, forcing full Hessian format.");
         bSparse = FALSE;
     }
     else if (atom_index.size() < 1000)
     {
-        md_print_info(cr, fplog, "Small system size (N=%d), using full Hessian format.\n", atom_index.size());
+        GMX_LOG(mdlog.warning).appendTextFormatted("Small system size (N=%d), using full Hessian format.",
+                                                   atom_index.size());
         bSparse = FALSE;
     }
     else
     {
-        md_print_info(cr, fplog, "Using compressed symmetric sparse Hessian format.\n");
+        GMX_LOG(mdlog.warning).appendText("Using compressed symmetric sparse Hessian format.");
         bSparse = TRUE;
     }
 
@@ -2899,23 +2785,23 @@ double do_nm(FILE *fplog, t_commrec *cr,
     /* Make evaluate_energy do a single node force calculation */
     cr->nnodes = 1;
     evaluate_energy(fplog, cr,
-                    top_global, state_work, top,
+                    top_global, &state_work, top,
                     inputrec, nrnb, wcycle, gstat,
                     vsite, constr, fcd, graph, mdatoms, fr,
                     mu_tot, enerd, vir, pres, -1, TRUE);
     cr->nnodes = nnodes;
 
     /* if forces are not small, warn user */
-    get_state_f_norm_max(cr, &(inputrec->opts), mdatoms, state_work);
+    get_state_f_norm_max(cr, &(inputrec->opts), mdatoms, &state_work);
 
-    md_print_info(cr, fplog, "Maximum force:%12.5e\n", state_work->fmax);
-    if (state_work->fmax > 1.0e-3)
+    GMX_LOG(mdlog.warning).appendTextFormatted("Maximum force:%12.5e", state_work.fmax);
+    if (state_work.fmax > 1.0e-3)
     {
-        md_print_info(cr, fplog,
-                      "The force is probably not small enough to "
-                      "ensure that you are at a minimum.\n"
-                      "Be aware that negative eigenvalues may occur\n"
-                      "when the resulting matrix is diagonalized.\n\n");
+        GMX_LOG(mdlog.warning).appendText(
+                "The force is probably not small enough to "
+                "ensure that you are at a minimum.\n"
+                "Be aware that negative eigenvalues may occur\n"
+                "when the resulting matrix is diagonalized.");
     }
 
     /***********************************************************
@@ -2939,17 +2825,17 @@ double do_nm(FILE *fplog, t_commrec *cr,
             int         force_flags = GMX_FORCE_STATECHANGED | GMX_FORCE_ALLFORCES;
             double      t           = 0;
 
-            x_min = state_work->s.x[atom][d];
+            x_min = state_work.s.x[atom][d];
 
             for (unsigned int dx = 0; (dx < 2); dx++)
             {
                 if (dx == 0)
                 {
-                    state_work->s.x[atom][d] = x_min - der_range;
+                    state_work.s.x[atom][d] = x_min - der_range;
                 }
                 else
                 {
-                    state_work->s.x[atom][d] = x_min + der_range;
+                    state_work.s.x[atom][d] = x_min + der_range;
                 }
 
                 /* Make evaluate_energy do a single node force calculation */
@@ -2957,21 +2843,23 @@ double do_nm(FILE *fplog, t_commrec *cr,
                 if (shellfc)
                 {
                     /* Now is the time to relax the shells */
-                    (void) relax_shell_flexcon(fplog, cr, bVerbose, step,
+                    (void) relax_shell_flexcon(fplog, cr, mdrunOptions.verbose, step,
                                                inputrec, bNS, force_flags,
                                                top,
                                                constr, enerd, fcd,
-                                               &state_work->s, state_work->f, vir, mdatoms,
+                                               &state_work.s, &state_work.f, vir, mdatoms,
                                                nrnb, wcycle, graph, &top_global->groups,
                                                shellfc, fr, bBornRadii, t, mu_tot,
-                                               vsite, NULL);
+                                               vsite,
+                                               DdOpenBalanceRegionBeforeForceComputation::no,
+                                               DdCloseBalanceRegionAfterForceComputation::no);
                     bNS = false;
                     step++;
                 }
                 else
                 {
                     evaluate_energy(fplog, cr,
-                                    top_global, state_work, top,
+                                    top_global, &state_work, top,
                                     inputrec, nrnb, wcycle, gstat,
                                     vsite, constr, fcd, graph, mdatoms, fr,
                                     mu_tot, enerd, vir, pres, atom*2+dx, FALSE);
@@ -2983,20 +2871,20 @@ double do_nm(FILE *fplog, t_commrec *cr,
                 {
                     for (size_t i = 0; i < atom_index.size(); i++)
                     {
-                        copy_rvec(state_work->f[atom_index[i]], fneg[i]);
+                        copy_rvec(state_work.f[atom_index[i]], fneg[i]);
                     }
                 }
             }
 
             /* x is restored to original */
-            state_work->s.x[atom][d] = x_min;
+            state_work.s.x[atom][d] = x_min;
 
             for (size_t j = 0; j < atom_index.size(); j++)
             {
                 for (size_t k = 0; (k < DIM); k++)
                 {
                     dfdx[j][k] =
-                        -(state_work->f[atom_index[j]][k] - fneg[j][k])/(2*der_range);
+                        -(state_work.f[atom_index[j]][k] - fneg[j][k])/(2*der_range);
                 }
             }
 
@@ -3047,13 +2935,13 @@ double do_nm(FILE *fplog, t_commrec *cr,
                 }
             }
 
-            if (bVerbose && fplog)
+            if (mdrunOptions.verbose && fplog)
             {
                 fflush(fplog);
             }
         }
         /* write progress */
-        if (bIsMaster && bVerbose)
+        if (bIsMaster && mdrunOptions.verbose)
         {
             fprintf(stderr, "\rFinished step %d out of %d",
                     static_cast<int>(std::min(atom+nnodes, atom_index.size())),
index 67bb46cccb3725a7d180fe4b881bad8855b5ccae..9d744b7f5924f523805e232cf407a1b499fccf9e 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,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.
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
+// FIXME: remove the "__" prefix in front of the group def when we move the
+//        nonbonded code into separate dir.
+
+/*! \libinternal \defgroup __module_nb_verlet Short-range non-bonded interaction module
+ * \ingroup group_mdrun
+ *
+ * \brief Computes forces and energies for short-range pair-interactions
+ * based on the Verlet algorithm. The algorithm uses pair-lists generated
+ * at fixed intervals as well as various flavors of pair interaction kernels
+ * implemented for a wide range of CPU and GPU architectures.
+ *
+ * The module includes support for flavors of Coulomb and Lennard-Jones interaction
+ * treatment implemented for a large range of SIMD instruction sets for CPU
+ * architectures as well as in CUDA and OpenCL for GPU architectures.
+ * Additionally there is a reference CPU non-SIMD and a reference CPU
+ * for GPU pair-list setup interaction kernel.
+ *
+ * The implementation of the kernels is based on the cluster non-bonded algorithm
+ * which in the code is referred to as the NxN algorithms ("nbnxn_" prefix);
+ * for details of the algorithm see DOI:10.1016/j.cpc.2013.06.003.
+ *
+ * Algorithmically, the non-bonded computation has two different modes:
+ * A "classical" mode: generate a list every nstlist steps containing at least
+ * all atom pairs up to a distance of rlistOuter and compute pair interactions
+ * for all pairs that are within the interaction cut-off.
+ * A "dynamic pruning" mode: generate an "outer-list" up to cut-off rlistOuter
+ * every nstlist steps and prune the outer-list using a cut-off of rlistInner
+ * every nstlistPrune steps to obtain a, smaller, "inner-list". This
+ * results in fewer interaction computations and allows for a larger nstlist.
+ * On a GPU, this dynamic pruning is performed in a rolling fashion, pruning
+ * only a sub-part of the list each (second) step. This way it can often
+ * overlap with integration and constraints on the CPU.
+ * Currently a simple heuristic determines which mode will be used.
+ *
+ * TODO: add a summary list and brief descriptions of the different submodules:
+ * search, CPU kernels, GPU glue code + kernels.
+ *
+ * \author Berk Hess <hess@kth.se>
+ * \author Szilárd Páll <pall.szilard@gmail.com>
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ * \author Anca Hamuraru <anca@streamcomputing.eu>
+ * \author Teemu Virolainen <teemu@streamcomputing.eu>
+ * \author Dimitrios Karkoulis <dimitris.karkoulis@gmail.com>
+ *
+ * TODO: add more authors!
+ */
+
+/*! \libinternal \file
+ *
+ * \brief This file contains the public interface of the non-bonded Verlet module
+ * that implements the NxN cluster non-bonded algorithm to efficiently compute
+ * pair forces.
+ *
+ *
+ * \author Berk Hess <hess@kth.se>
+ * \author Szilárd Páll <pall.szilard@gmail.com>
+ *
+ * \inlibraryapi
+ * \ingroup __module_nb_verlet
+ */
+
+
 #ifndef NB_VERLET_H
 #define NB_VERLET_H
 
+#include <memory>
+
 #include "gromacs/mdlib/nbnxn_gpu_types.h"
 #include "gromacs/mdlib/nbnxn_pairlist.h"
 
+//! Help pass GPU-emulation parameters with type safety.
+enum class EmulateGpuNonbonded : bool
+{
+    //! Do not emulate GPUs.
+    No,
+    //! Do emulate GPUs.
+    Yes
+};
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 
-/** Nonbonded NxN kernel types: plain C, CPU SIMD, GPU, GPU emulation */
+/*! \brief Nonbonded NxN kernel types: plain C, CPU SIMD, GPU, GPU emulation */
 typedef enum
 {
     nbnxnkNotSet = 0,
@@ -56,55 +129,77 @@ typedef enum
     nbnxnkNR
 } nbnxn_kernel_type;
 
-/** Return a string indentifying the kernel type */
+/*! \brief Return a string identifying the kernel type.
+ *
+ * \param [in] kernel_type   nonbonded kernel types, takes values from the nbnxn_kernel_type enum
+ * \returns                  a string identifying the kernel corresponding to the type passed as argument
+ */
 const char *lookup_nbnxn_kernel_name(int kernel_type);
 
+/*! \brief Ewald exclusion types */
 enum {
     ewaldexclTable, ewaldexclAnalytical
 };
 
-/* Atom locality indicator: local, non-local, all, used for calls to:
-   gridding, pair-search, force calculation, x/f buffer operations */
+/*! \brief Atom locality indicator: local, non-local, all.
+ *
+ * Used for calls to:
+ * gridding, pair-search, force calculation, x/f buffer operations
+ * */
 enum {
     eatLocal = 0, eatNonlocal = 1, eatAll
 };
 
+/*! \brief Tests for local atom range */
 #define LOCAL_A(x)               ((x) == eatLocal)
+/*! \brief Tests for non-local atom range */
 #define NONLOCAL_A(x)            ((x) == eatNonlocal)
+/*! \brief Tests for either local or non-local atom range */
 #define LOCAL_OR_NONLOCAL_A(x)   (LOCAL_A(x) || NONLOCAL_A(x))
 
-/* Interaction locality indicator (used in pair-list search/calculations):
-    - local interactions require local atom data and affect local output only;
-    - non-local interactions require both local and non-local atom data and
-      affect both local- and non-local output. */
+/*! \brief Interaction locality indicator
+ *
+ * Used in pair-list search/calculations in the following manner:
+ *  - local interactions require local atom data and affect local output only;
+ *  - non-local interactions require both local and non-local atom data and
+ *    affect both local- and non-local output.
+ */
 enum {
     eintLocal = 0, eintNonlocal = 1
 };
 
+/*! \brief Tests for local interaction indicator */
 #define LOCAL_I(x)               ((x) == eintLocal)
+/*! \brief Tests for non-local interaction indicator */
 #define NONLOCAL_I(x)            ((x) == eintNonlocal)
 
+/*! \brief Flag to tell the nonbonded kernels whether to clear the force output buffers */
 enum {
     enbvClearFNo, enbvClearFYes
 };
 
+/*! \libinternal
+ *  \brief Non-bonded interaction group data structure. */
 typedef struct nonbonded_verlet_group_t {
-    nbnxn_pairlist_set_t  nbl_lists;   /* pair list(s)                       */
-    nbnxn_atomdata_t     *nbat;        /* atom data                          */
-    int                   kernel_type; /* non-bonded kernel - see enum above */
-    int                   ewald_excl;  /* Ewald exclusion - see enum above   */
+    nbnxn_pairlist_set_t  nbl_lists;   /**< pair list(s)                       */
+    nbnxn_atomdata_t     *nbat;        /**< atom data                          */
+    int                   kernel_type; /**< non-bonded kernel - see enum above */
+    int                   ewald_excl;  /**< Ewald exclusion - see enum above   */
 } nonbonded_verlet_group_t;
 
-/* non-bonded data structure with Verlet-type cut-off */
+/*! \libinternal
+ *  \brief Top-level non-bonded data structure for the Verlet-type cut-off scheme. */
 typedef struct nonbonded_verlet_t {
-    nbnxn_search_t           nbs;             /* n vs n atom pair searching data       */
-    int                      ngrp;            /* number of interaction groups          */
-    nonbonded_verlet_group_t grp[2];          /* local and non-local interaction group */
-
-    gmx_bool                 bUseGPU;         /* TRUE when GPU acceleration is used */
-    gmx_nbnxn_gpu_t         *gpu_nbv;         /* pointer to GPU nb verlet data     */
-    int                      min_ci_balanced; /* pair list balancing parameter
-                                                 used for the 8x8x8 GPU kernels    */
+    std::unique_ptr<NbnxnListParameters> listParams;      /**< Parameters for the search and list pruning setup */
+    nbnxn_search_t                       nbs;             /**< n vs n atom pair searching data       */
+    int                                  ngrp;            /**< number of interaction groups          */
+    nonbonded_verlet_group_t             grp[2];          /**< local and non-local interaction group */
+
+    gmx_bool                             bUseGPU;         /**< TRUE when non-bonded interactions are computed on a physical GPU */
+    EmulateGpuNonbonded                  emulateGpu;      /**< true when non-bonded interactions are computed on the CPU using GPU-style pair lists */
+    gmx_nbnxn_gpu_t                     *gpu_nbv;         /**< pointer to GPU nb verlet data     */
+    int                                  min_ci_balanced; /**< pair list balancing parameter
+                                                               used for the 8x8x8 GPU kernels    */
 } nonbonded_verlet_t;
 
 /*! \brief Getter for bUseGPU */
index 39a84ed5768fd52b2c8deec1baa94001b9222f52..66f93481788dc895a274996e14367ce4c594221b 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,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.
@@ -37,8 +37,6 @@
 
 #include "nbnxn_atomdata.h"
 
-#include "config.h"
-
 #include <assert.h>
 #include <stdlib.h>
 #include <string.h>
@@ -89,7 +87,7 @@ void nbnxn_realloc_void(void **ptr,
 
     ma(&ptr_new, nbytes_new);
 
-    if (nbytes_new > 0 && ptr_new == NULL)
+    if (nbytes_new > 0 && ptr_new == nullptr)
     {
         gmx_fatal(FARGS, "Allocation of %d bytes failed", nbytes_new);
     }
@@ -102,7 +100,7 @@ void nbnxn_realloc_void(void **ptr,
         }
         memcpy(ptr_new, *ptr, nbytes_copy);
     }
-    if (*ptr != NULL)
+    if (*ptr != nullptr)
     {
         mf(*ptr);
     }
@@ -157,7 +155,7 @@ static void nbnxn_atomdata_output_init(nbnxn_atomdata_output_t *out,
                                        int nenergrp, int stride,
                                        nbnxn_alloc_t *ma)
 {
-    out->f = NULL;
+    out->f = nullptr;
     ma((void **)&out->fshift, SHIFTS*DIM*sizeof(*out->fshift));
     out->nV = nenergrp*nenergrp;
     ma((void **)&out->Vvdw, out->nV*sizeof(*out->Vvdw));
@@ -194,67 +192,6 @@ static void copy_int_to_nbat_int(const int *a, int na, int na_round,
     }
 }
 
-static void clear_nbat_real(int na, int nbatFormat, real *xnb, int a0)
-{
-    int j, c;
-
-    switch (nbatFormat)
-    {
-        case nbatXYZ:
-            for (int a = 0; a < na; a++)
-            {
-                for (int d = 0; d < DIM; d++)
-                {
-                    xnb[(a0+a)*STRIDE_XYZ+d] = 0;
-                }
-            }
-            break;
-        case nbatXYZQ:
-            for (int a = 0; a < na; a++)
-            {
-                for (int d = 0; d < DIM; d++)
-                {
-                    xnb[(a0+a)*STRIDE_XYZQ+d] = 0;
-                }
-            }
-            break;
-        case nbatX4:
-            j = atom_to_x_index<c_packX4>(a0);
-            c = a0 & (c_packX4 - 1);
-            for (int a = 0; a < na; a++)
-            {
-                xnb[j+XX*c_packX4] = 0;
-                xnb[j+YY*c_packX4] = 0;
-                xnb[j+ZZ*c_packX4] = 0;
-                j++;
-                c++;
-                if (c == c_packX4)
-                {
-                    j += (DIM-1)*c_packX4;
-                    c  = 0;
-                }
-            }
-            break;
-        case nbatX8:
-            j = atom_to_x_index<c_packX8>(a0);
-            c = a0 & (c_packX8-1);
-            for (int a = 0; a < na; a++)
-            {
-                xnb[j+XX*c_packX8] = 0;
-                xnb[j+YY*c_packX8] = 0;
-                xnb[j+ZZ*c_packX8] = 0;
-                j++;
-                c++;
-                if (c == c_packX8)
-                {
-                    j += (DIM-1)*c_packX8;
-                    c  = 0;
-                }
-            }
-            break;
-    }
-}
-
 void copy_rvec_to_nbat_real(const int *a, int na, int na_round,
                             const rvec *x, int nbatFormat,
                             real *xnb, int a0)
@@ -557,7 +494,7 @@ void nbnxn_atomdata_init(FILE *fp,
     char    *ptr;
     gmx_bool simple, bCombGeom, bCombLB, bSIMD;
 
-    if (alloc == NULL)
+    if (alloc == nullptr)
     {
         nbat->alloc = nbnxn_alloc_aligned;
     }
@@ -565,7 +502,7 @@ void nbnxn_atomdata_init(FILE *fp,
     {
         nbat->alloc = alloc;
     }
-    if (free == NULL)
+    if (free == nullptr)
     {
         nbat->free = nbnxn_free_aligned;
     }
@@ -588,7 +525,7 @@ void nbnxn_atomdata_init(FILE *fp,
      */
     tol = 1e-5;
     ptr = getenv("GMX_LJCOMB_TOL");
-    if (ptr != NULL)
+    if (ptr != nullptr)
     {
         double dbl;
 
@@ -723,8 +660,8 @@ void nbnxn_atomdata_init(FILE *fp,
     set_lj_parameter_data(nbat, bSIMD);
 
     nbat->natoms  = 0;
-    nbat->type    = NULL;
-    nbat->lj_comb = NULL;
+    nbat->type    = nullptr;
+    nbat->lj_comb = nullptr;
     if (simple)
     {
         int pack_x;
@@ -757,12 +694,12 @@ void nbnxn_atomdata_init(FILE *fp,
         nbat->XFormat = nbatXYZQ;
         nbat->FFormat = nbatXYZ;
     }
-    nbat->q        = NULL;
+    nbat->q        = nullptr;
     nbat->nenergrp = n_energygroups;
     if (!simple)
     {
         /* Energy groups not supported yet for super-sub lists */
-        if (n_energygroups > 1 && fp != NULL)
+        if (n_energygroups > 1 && fp != nullptr)
         {
             fprintf(fp, "\nNOTE: With GPUs, reporting energy group contributions is not supported\n\n");
         }
@@ -778,11 +715,11 @@ void nbnxn_atomdata_init(FILE *fp,
     {
         nbat->neg_2log++;
     }
-    nbat->energrp = NULL;
+    nbat->energrp = nullptr;
     nbat->alloc((void **)&nbat->shift_vec, SHIFTS*sizeof(*nbat->shift_vec));
     nbat->xstride = (nbat->XFormat == nbatXYZQ ? STRIDE_XYZQ : DIM);
     nbat->fstride = (nbat->FFormat == nbatXYZQ ? STRIDE_XYZQ : DIM);
-    nbat->x       = NULL;
+    nbat->x       = nullptr;
 
 #if GMX_SIMD
     if (simple)
@@ -802,15 +739,15 @@ void nbnxn_atomdata_init(FILE *fp,
                                    nbat->nenergrp, 1<<nbat->neg_2log,
                                    nbat->alloc);
     }
-    nbat->buffer_flags.flag        = NULL;
+    nbat->buffer_flags.flag        = nullptr;
     nbat->buffer_flags.flag_nalloc = 0;
 
     nth = gmx_omp_nthreads_get(emntNonbonded);
 
     ptr = getenv("GMX_USE_TREEREDUCE");
-    if (ptr != NULL)
+    if (ptr != nullptr)
     {
-        nbat->bUseTreeReduce = strtol(ptr, 0, 10);
+        nbat->bUseTreeReduce = strtol(ptr, nullptr, 10);
     }
 #if defined __MIC__
     else if (nth > 8) /*on the CPU we currently don't benefit even at 32*/
@@ -1222,7 +1159,7 @@ nbnxn_atomdata_clear_reals(real * gmx_restrict dest,
     }
 }
 
-static void
+gmx_unused static void
 nbnxn_atomdata_reduce_reals(real * gmx_restrict dest,
                             gmx_bool bDestSet,
                             real ** gmx_restrict src,
@@ -1254,7 +1191,7 @@ nbnxn_atomdata_reduce_reals(real * gmx_restrict dest,
     }
 }
 
-static void
+gmx_unused static void
 nbnxn_atomdata_reduce_reals_simd(real gmx_unused * gmx_restrict dest,
                                  gmx_bool gmx_unused bDestSet,
                                  real gmx_unused ** gmx_restrict src,
index 9e5ea950658cd9f8e0767fed02133a7352d2be68..0a47b7c1c13c5744ecd104e40a8384e60ffbf47b 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,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.
@@ -36,6 +36,8 @@
 #ifndef _nbnxn_atomdata_h
 #define _nbnxn_atomdata_h
 
+#include <cstdio>
+
 #include "gromacs/math/vectypes.h"
 #include "gromacs/mdlib/nbnxn_pairlist.h"
 #include "gromacs/utility/basedefinitions.h"
index 0b6abd3fc9119d885a170117283bfd9bf00c936d..4d45ce553b0a0eb97ee8c41e4a9e7ad1df4eae46 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,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.
@@ -38,7 +38,8 @@ if(GMX_USE_CUDA)
                 nbnxn_cuda_kernel_F_noprune.cu
                 nbnxn_cuda_kernel_F_prune.cu
                 nbnxn_cuda_kernel_VF_noprune.cu
-                nbnxn_cuda_kernel_VF_prune.cu)
+                nbnxn_cuda_kernel_VF_prune.cu
+                nbnxn_cuda_kernel_pruneonly.cu)
     endif()
 
     file(GLOB NBNXN_CUDA_SOURCES
index 39464192315a153f2931594c615d404cce44c7ff..4df4cdf49f749e923d5c82841565962459ef6911 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,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.
@@ -51,6 +51,8 @@
 #endif
 
 
+#include "nbnxn_cuda.h"
+
 #include "gromacs/gpu_utils/cudautils.cuh"
 #include "gromacs/mdlib/force_flags.h"
 #include "gromacs/mdlib/nb_verlet.h"
 
 #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;
 
@@ -98,6 +110,9 @@ texture<float, 1, cudaReadModeElementType> coulomb_tab_texref;
 #include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernels.cuh"
 #undef CALC_ENERGIES
 #undef PRUNE_NBL
+
+/* Prune-only kernels */
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_pruneonly.cuh"
 #undef FUNCTION_DECLARATION_ONLY
 
 /* Now generate the function definitions if we are using a single compilation unit. */
@@ -106,6 +121,7 @@ texture<float, 1, cudaReadModeElementType> coulomb_tab_texref;
 #include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_F_prune.cu"
 #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
@@ -117,7 +133,6 @@ texture<float, 1, cudaReadModeElementType> coulomb_tab_texref;
 #endif /* GMX_CUDA_NB_SINGLE_COMPILATION_UNIT */
 
 
-
 /*! Nonbonded kernel function pointer type */
 typedef void (*nbnxn_cu_kfunc_ptr_t)(const cu_atomdata_t,
                                      const cu_nbparam_t,
@@ -138,7 +153,7 @@ static bool always_prune = (getenv("GMX_GPU_ALWAYS_PRUNE") != NULL);
 
 
 /*! Returns the number of blocks to be used for the nonbonded GPU kernel. */
-static inline int calc_nb_kernel_nblock(int nwork_units, gmx_device_info_t *dinfo)
+static inline int calc_nb_kernel_nblock(int nwork_units, const gmx_device_info_t *dinfo)
 {
     int max_grid_x_size;
 
@@ -221,7 +236,7 @@ static inline nbnxn_cu_kfunc_ptr_t select_nbnxn_kernel(int
                                                        int                                  evdwtype,
                                                        bool                                 bDoEne,
                                                        bool                                 bDoPrune,
-                                                       struct gmx_device_info_t gmx_unused *devInfo)
+                                                       const gmx_device_info_t gmx_unused  *devInfo)
 {
     nbnxn_cu_kfunc_ptr_t res;
 
@@ -260,8 +275,8 @@ static inline nbnxn_cu_kfunc_ptr_t select_nbnxn_kernel(int
     return res;
 }
 
-/*! Calculates the amount of shared memory required by the CUDA kernel in use. */
-static inline int calc_shmem_required(const int num_threads_z, gmx_device_info_t gmx_unused *dinfo, const cu_nbparam_t *nbp)
+/*! \brief Calculates the amount of shared memory required by the nonbonded kernel in use. */
+static inline int calc_shmem_required_nonbonded(const int num_threads_z, const gmx_device_info_t gmx_unused *dinfo, const cu_nbparam_t *nbp)
 {
     int shmem;
 
@@ -348,6 +363,8 @@ void nbnxn_gpu_launch_kernel(gmx_nbnxn_cuda_t       *nb,
        call is taken care of later in this function. */
     if (iloc == eintNonlocal && plist->nsci == 0)
     {
+        plist->haveFreshList = false;
+
         return;
     }
 
@@ -397,6 +414,15 @@ void nbnxn_gpu_launch_kernel(gmx_nbnxn_cuda_t       *nb,
         CU_RET_ERR(stat, "cudaEventRecord failed");
     }
 
+    if (nbp->useDynamicPruning && plist->haveFreshList)
+    {
+        /* Prunes for rlistOuter and rlistInner, sets plist->haveFreshList=false
+           (TODO: ATM that's the way the timing accounting can distinguish between
+           separate prune kernel and combined force+prune, maybe we need a better way?).
+         */
+        nbnxn_gpu_launch_kernel_pruneonly(nb, iloc, 1);
+    }
+
     if (plist->nsci == 0)
     {
         /* Don't launch an empty local kernel (not allowed with CUDA) */
@@ -414,7 +440,7 @@ void nbnxn_gpu_launch_kernel(gmx_nbnxn_cuda_t       *nb,
     nb_kernel = select_nbnxn_kernel(nbp->eeltype,
                                     nbp->vdwtype,
                                     bCalcEner,
-                                    plist->bDoPrune || always_prune,
+                                    (plist->haveFreshList && !nb->timers->didPrune[iloc]) || always_prune,
                                     nb->dev_info);
 
     /* Kernel launch config:
@@ -430,12 +456,12 @@ void nbnxn_gpu_launch_kernel(gmx_nbnxn_cuda_t       *nb,
     nblock    = calc_nb_kernel_nblock(plist->nsci, nb->dev_info);
     dim_block = dim3(c_clSize, c_clSize, num_threads_z);
     dim_grid  = dim3(nblock, 1, 1);
-    shmem     = calc_shmem_required(num_threads_z, nb->dev_info, nbp);
+    shmem     = calc_shmem_required_nonbonded(num_threads_z, nb->dev_info, nbp);
 
     if (debug)
     {
-        fprintf(debug, "GPU launch configuration:\n\tThread block: %dx%dx%d\n\t"
-                "\tGrid: %dx%d\n\t#Super-clusters/clusters: %d/%d (%d)\n"
+        fprintf(debug, "Non-bonded GPU launch configuration:\n\tThread block: %ux%ux%u\n\t"
+                "\tGrid: %ux%u\n\t#Super-clusters/clusters: %d/%d (%d)\n"
                 "\tShMem: %d\n",
                 dim_block.x, dim_block.y, dim_block.z,
                 dim_grid.x, dim_grid.y, plist->nsci*c_numClPerSupercl,
@@ -473,6 +499,170 @@ void nbnxn_gpu_launch_kernel(gmx_nbnxn_cuda_t       *nb,
 #endif
 }
 
+/*! Calculates the amount of shared memory required by the CUDA kernel in use. */
+static inline int calc_shmem_required_prune(const int num_threads_z)
+{
+    int shmem;
+
+    /* i-atom x in shared memory */
+    shmem  = c_numClPerSupercl * c_clSize * sizeof(float4);
+    /* cj in shared memory, for each warp separately */
+    shmem += num_threads_z * c_nbnxnGpuClusterpairSplit * c_nbnxnGpuJgroupSize * sizeof(int);
+
+    return shmem;
+}
+
+void nbnxn_gpu_launch_kernel_pruneonly(gmx_nbnxn_cuda_t       *nb,
+                                       int                     iloc,
+                                       int                     numParts)
+{
+    cudaError_t          stat;
+
+    cu_atomdata_t       *adat    = nb->atdat;
+    cu_nbparam_t        *nbp     = nb->nbparam;
+    cu_plist_t          *plist   = nb->plist[iloc];
+    cu_timers_t         *t       = nb->timers;
+    cudaStream_t         stream  = nb->stream[iloc];
+
+    bool                 bDoTime = nb->bDoTime;
+
+    if (plist->haveFreshList)
+    {
+        GMX_ASSERT(numParts == 1, "With first pruning we expect 1 part");
+
+        /* Set rollingPruningNumParts to signal that it is not set */
+        plist->rollingPruningNumParts = 0;
+        plist->rollingPruningPart     = 0;
+    }
+    else
+    {
+        if (plist->rollingPruningNumParts == 0)
+        {
+            plist->rollingPruningNumParts = numParts;
+        }
+        else
+        {
+            GMX_ASSERT(numParts == plist->rollingPruningNumParts, "It is not allowed to change numParts in between list generation steps");
+        }
+    }
+
+    /* Use a local variable for part and update in plist, so we can return here
+     * without duplicating the part increment code.
+     */
+    int part = plist->rollingPruningPart;
+
+    plist->rollingPruningPart++;
+    if (plist->rollingPruningPart >= plist->rollingPruningNumParts)
+    {
+        plist->rollingPruningPart = 0;
+    }
+
+    /* Compute the number of list entries to prune in this pass */
+    int numSciInPart = (plist->nsci - part)/numParts;
+
+    /* Don't launch the kernel if there is no work to do (not allowed with CUDA) */
+    if (numSciInPart <= 0)
+    {
+        plist->haveFreshList = false;
+
+        return;
+    }
+
+    cudaEvent_t startEvent, stopEvent;
+    if (bDoTime)
+    {
+        startEvent = (plist->haveFreshList ? t->start_prune_k[iloc] : t->start_rollingPrune_k[iloc]);
+        stopEvent  = (plist->haveFreshList ? t->stop_prune_k[iloc]  : t->stop_rollingPrune_k[iloc]);
+    }
+
+    /* beginning of timed prune calculation section */
+    if (bDoTime)
+    {
+        stat = cudaEventRecord(startEvent, stream);
+        CU_RET_ERR(stat, "cudaEventRecord failed");
+    }
+
+    /* Kernel launch config:
+     * - The thread block dimensions match the size of i-clusters, j-clusters,
+     *   and j-cluster concurrency, in x, y, and z, respectively.
+     * - The 1D block-grid contains as many blocks as super-clusters.
+     */
+    int  num_threads_z  = c_cudaPruneKernelJ4Concurrency;
+    int  nblock         = calc_nb_kernel_nblock(numSciInPart, nb->dev_info);
+    dim3 dim_block      = dim3(c_clSize, c_clSize, num_threads_z);
+    dim3 dim_grid       = dim3(nblock, 1, 1);
+    int  shmem          = calc_shmem_required_prune(num_threads_z);
+
+    if (debug)
+    {
+        fprintf(debug, "Pruning GPU kernel launch configuration:\n\tThread block: %dx%dx%d\n\t"
+                "\tGrid: %dx%d\n\t#Super-clusters/clusters: %d/%d (%d)\n"
+                "\tShMem: %d\n",
+                dim_block.x, dim_block.y, dim_block.z,
+                dim_grid.x, dim_grid.y, numSciInPart*c_numClPerSupercl,
+                c_numClPerSupercl, plist->na_c,
+                shmem);
+    }
+
+    if (bUseCudaLaunchKernel)
+    {
+        gmx_unused void* kernel_args[5];
+        kernel_args[0] = adat;
+        kernel_args[1] = nbp;
+        kernel_args[2] = plist;
+        kernel_args[3] = &numParts;
+        kernel_args[4] = &part;
+
+#if GMX_CUDA_VERSION >= 7000
+        if (plist->haveFreshList)
+        {
+            cudaLaunchKernel((void *)nbnxn_kernel_prune_cuda<true>, dim_grid, dim_block, kernel_args, shmem, stream);
+        }
+        else
+        {
+            cudaLaunchKernel((void *)nbnxn_kernel_prune_cuda<false>, dim_grid, dim_block, kernel_args, shmem, stream);
+        }
+#endif
+    }
+    else
+    {
+        if (plist->haveFreshList)
+        {
+            nbnxn_kernel_prune_cuda<true><<< dim_grid, dim_block, shmem, stream>>> (*adat, *nbp, *plist, numParts, part);
+        }
+        else
+        {
+            nbnxn_kernel_prune_cuda<false><<< dim_grid, dim_block, shmem, stream>>> (*adat, *nbp, *plist, numParts, part);
+        }
+    }
+    CU_LAUNCH_ERR("k_pruneonly");
+
+    /* TODO: consider a more elegant way to track which kernel has been called
+       (combined or separate 1st pass prune, rolling prune). */
+    if (plist->haveFreshList)
+    {
+        plist->haveFreshList         = false;
+        /* Mark that pruning has been done */
+        nb->timers->didPrune[iloc] = true;
+    }
+    else
+    {
+        /* Mark that rolling pruning has been done */
+        nb->timers->didRollingPrune[iloc] = true;
+    }
+
+    if (bDoTime)
+    {
+        stat = cudaEventRecord(stopEvent, stream);
+        CU_RET_ERR(stat, "cudaEventRecord failed");
+    }
+
+#if (defined(WIN32) || defined( _WIN32 ))
+    /* Windows: force flushing WDDM queue */
+    stat = cudaStreamQuery(stream);
+#endif
+}
+
 void nbnxn_gpu_launch_cpyback(gmx_nbnxn_cuda_t       *nb,
                               const nbnxn_atomdata_t *nbatom,
                               int                     flags,
@@ -581,6 +771,43 @@ void nbnxn_gpu_launch_cpyback(gmx_nbnxn_cuda_t       *nb,
     }
 }
 
+/*! \brief Count pruning kernel time if either kernel has been triggered
+ *
+ *  We do the accounting for either of the two pruning kernel flavors:
+ *   - 1st pass prune: ran during the current step (prior to the force kernel);
+ *   - rolling prune:  ran at the end of the previous step (prior to the current step H2D xq);
+ *
+ * Note that the resetting of cu_timers_t::didPrune and cu_timers_t::didRollingPrune should happen
+ * after calling this function.
+ *
+ * \param[in] timers      structs with CUDA timer objects
+ * \param[inout] timings  GPU task timing data
+ * \param[in] iloc        interaction locality
+ */
+static void countPruneKernelTime(const cu_timers_t   *timers,
+                                 gmx_wallclock_gpu_t *timings,
+                                 const int            iloc)
+{
+    // We might have not done any pruning (e.g. if we skipped with empty domains).
+    if (!timers->didPrune[iloc] && !timers->didRollingPrune[iloc])
+    {
+        return;
+    }
+
+    if (timers->didPrune[iloc])
+    {
+        timings->pruneTime.c++;
+        timings->pruneTime.t += cu_event_elapsed(timers->start_prune_k[iloc],
+                                                 timers->stop_prune_k[iloc]);
+    }
+    if (timers->didRollingPrune[iloc])
+    {
+        timings->dynamicPruneTime.c++;
+        timings->dynamicPruneTime.t += cu_event_elapsed(timers->start_rollingPrune_k[iloc],
+                                                        timers->stop_rollingPrune_k[iloc]);
+    }
+}
+
 void nbnxn_gpu_wait_for_gpu(gmx_nbnxn_cuda_t *nb,
                             int flags, int aloc,
                             real *e_lj, real *e_el, rvec *fshift)
@@ -617,102 +844,112 @@ void nbnxn_gpu_wait_for_gpu(gmx_nbnxn_cuda_t *nb,
     /* turn energy calculation always on/off (for debugging/testing only) */
     bCalcEner = (bCalcEner || always_ener) && !never_ener;
 
-    /* Launch wait/update timers & counters, unless doing the non-local phase
-       when there is not actually work to do. This is consistent with
-       nbnxn_cuda_launch_kernel.
+    /* Launch wait/update timers & counters and do reduction into staging buffers
+       BUT skip it when during the non-local phase there was actually no work to do.
+       This is consistent with nbnxn_gpu_launch_kernel.
 
        NOTE: if timing with multiple GPUs (streams) becomes possible, the
        counters could end up being inconsistent due to not being incremented
        on some of the nodes! */
-    if (iloc == eintNonlocal && nb->plist[iloc]->nsci == 0)
+    if (!(iloc == eintNonlocal && nb->plist[iloc]->nsci == 0))
     {
-        return;
-    }
-
-    stat = cudaStreamSynchronize(nb->stream[iloc]);
-    CU_RET_ERR(stat, "cudaStreamSynchronize failed in cu_blockwait_nb");
+        stat = cudaStreamSynchronize(nb->stream[iloc]);
+        CU_RET_ERR(stat, "cudaStreamSynchronize failed in cu_blockwait_nb");
 
-    /* timing data accumulation */
-    if (nb->bDoTime)
-    {
-        /* only increase counter once (at local F wait) */
-        if (LOCAL_I(iloc))
+        /* timing data accumulation */
+        if (nb->bDoTime)
         {
-            timings->nb_c++;
-            timings->ktime[plist->bDoPrune ? 1 : 0][bCalcEner ? 1 : 0].c += 1;
-        }
-
-        /* kernel timings */
-        timings->ktime[plist->bDoPrune ? 1 : 0][bCalcEner ? 1 : 0].t +=
-            cu_event_elapsed(timers->start_nb_k[iloc], timers->stop_nb_k[iloc]);
-
-        /* X/q H2D and F D2H timings */
-        timings->nb_h2d_t += cu_event_elapsed(timers->start_nb_h2d[iloc],
-                                              timers->stop_nb_h2d[iloc]);
-        timings->nb_d2h_t += cu_event_elapsed(timers->start_nb_d2h[iloc],
-                                              timers->stop_nb_d2h[iloc]);
-
-        /* only count atdat and pair-list H2D at pair-search step */
-        if (plist->bDoPrune)
-        {
-            /* atdat transfer timing (add only once, at local F wait) */
-            if (LOCAL_A(aloc))
+            /* only increase counter once (at local F wait) */
+            if (LOCAL_I(iloc))
             {
-                timings->pl_h2d_c++;
-                timings->pl_h2d_t += cu_event_elapsed(timers->start_atdat,
-                                                      timers->stop_atdat);
+                timings->nb_c++;
+                timings->ktime[plist->haveFreshList ? 1 : 0][bCalcEner ? 1 : 0].c += 1;
             }
 
-            timings->pl_h2d_t += cu_event_elapsed(timers->start_pl_h2d[iloc],
-                                                  timers->stop_pl_h2d[iloc]);
+            /* kernel timings */
+            timings->ktime[plist->haveFreshList ? 1 : 0][bCalcEner ? 1 : 0].t +=
+                cu_event_elapsed(timers->start_nb_k[iloc], timers->stop_nb_k[iloc]);
+
+            /* X/q H2D and F D2H timings */
+            timings->nb_h2d_t += cu_event_elapsed(timers->start_nb_h2d[iloc],
+                                                  timers->stop_nb_h2d[iloc]);
+            timings->nb_d2h_t += cu_event_elapsed(timers->start_nb_d2h[iloc],
+                                                  timers->stop_nb_d2h[iloc]);
+
+            /* Count the pruning kernel times for both cases:1st pass (at search step)
+               and rolling pruning (if called at the previous step).
+               We do the accounting here as this is the only sync point where we
+               know (without checking or additional sync-ing) that prune tasks in
+               in the current stream have completed (having just blocking-waited
+               for the force D2H). */
+            countPruneKernelTime(timers, timings, iloc);
+
+            /* only count atdat and pair-list H2D at pair-search step */
+            if (timers->didPairlistH2D[iloc])
+            {
+                /* atdat transfer timing (add only once, at local F wait) */
+                if (LOCAL_A(aloc))
+                {
+                    timings->pl_h2d_c++;
+                    timings->pl_h2d_t += cu_event_elapsed(timers->start_atdat,
+                                                          timers->stop_atdat);
+                }
+
+                timings->pl_h2d_t += cu_event_elapsed(timers->start_pl_h2d[iloc],
+                                                      timers->stop_pl_h2d[iloc]);
+
+                /* Clear the timing flag for the next step */
+                timers->didPairlistH2D[iloc] = false;
+            }
         }
-    }
 
-    /* add up energies and shift forces (only once at local F wait) */
-    if (LOCAL_I(iloc))
-    {
-        if (bCalcEner)
+        /* add up energies and shift forces (only once at local F wait) */
+        if (LOCAL_I(iloc))
         {
-            *e_lj += *nbst.e_lj;
-            *e_el += *nbst.e_el;
-        }
+            if (bCalcEner)
+            {
+                *e_lj += *nbst.e_lj;
+                *e_el += *nbst.e_el;
+            }
 
-        if (bCalcFshift)
-        {
-            for (int i = 0; i < SHIFTS; i++)
+            if (bCalcFshift)
             {
-                fshift[i][0] += nbst.fshift[i].x;
-                fshift[i][1] += nbst.fshift[i].y;
-                fshift[i][2] += nbst.fshift[i].z;
+                for (int i = 0; i < SHIFTS; i++)
+                {
+                    fshift[i][0] += nbst.fshift[i].x;
+                    fshift[i][1] += nbst.fshift[i].y;
+                    fshift[i][2] += nbst.fshift[i].z;
+                }
             }
         }
     }
 
-    /* turn off pruning (doesn't matter if this is pair-search step or not) */
-    plist->bDoPrune = false;
+    /* Always reset both pruning flags (doesn't hurt doing it even when timing is off). */
+    timers->didPrune[iloc] = timers->didRollingPrune[iloc] = false;
+
+    /* Turn off initial list pruning (doesn't hurt if this is not pair-search step). */
+    plist->haveFreshList = false;
 }
 
-/*! Return the reference to the nbfp texture. */
 const struct texture<float, 1, cudaReadModeElementType> &nbnxn_cuda_get_nbfp_texref()
 {
+    assert(!c_disableCudaTextures);
     return nbfp_texref;
 }
 
-/*! Return the reference to the nbfp_comb texture. */
 const struct texture<float, 1, cudaReadModeElementType> &nbnxn_cuda_get_nbfp_comb_texref()
 {
+    assert(!c_disableCudaTextures);
     return nbfp_comb_texref;
 }
 
-/*! Return the reference to the coulomb_tab. */
 const struct texture<float, 1, cudaReadModeElementType> &nbnxn_cuda_get_coulomb_tab_texref()
 {
+    assert(!c_disableCudaTextures);
     return coulomb_tab_texref;
 }
 
-/*! Set up the cache configuration for the non-bonded kernels,
- */
-void nbnxn_cuda_set_cacheconfig(gmx_device_info_t *devinfo)
+void nbnxn_cuda_set_cacheconfig(const gmx_device_info_t *devinfo)
 {
     cudaError_t stat;
 
diff --git a/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.h b/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.h
new file mode 100644 (file)
index 0000000..ba70b3a
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Declares nbnxn cuda cache and texture helper functions
+ */
+#ifndef GMX_MDLIB_NBNXN_CUDA_NBNXN_CUDA_H
+#define GMX_MDLIB_NBNXN_CUDA_NBNXN_CUDA_H
+
+#include "nbnxn_cuda_types.h"
+
+//! Set up the cache configuration for the non-bonded kernels.
+void nbnxn_cuda_set_cacheconfig(const gmx_device_info_t *devinfo);
+//! Return the reference to the nbfp texture.
+const struct texture<float, 1, cudaReadModeElementType> &nbnxn_cuda_get_nbfp_texref();
+//! Return the reference to the nbfp_comb texture.
+const struct texture<float, 1, cudaReadModeElementType> &nbnxn_cuda_get_nbfp_comb_texref();
+//! Return the reference to the coulomb_tab.
+const struct texture<float, 1, cudaReadModeElementType> &nbnxn_cuda_get_coulomb_tab_texref();
+
+#endif
index a061f795f3f8082b3c237f39371da78deb8af9a8..5aa1db803fae62504c2f9c99dead4abb34df0168 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,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.
@@ -39,8 +39,6 @@
  */
 #include "gmxpre.h"
 
-#include "config.h"
-
 #include <assert.h>
 #include <stdarg.h>
 #include <stdio.h>
@@ -49,7 +47,6 @@
 #include "gromacs/gpu_utils/cudautils.cuh"
 #include "gromacs/gpu_utils/gpu_utils.h"
 #include "gromacs/gpu_utils/pmalloc_cuda.h"
-#include "gromacs/hardware/detecthardware.h"
 #include "gromacs/hardware/gpu_hw_info.h"
 #include "gromacs/math/vectypes.h"
 #include "gromacs/mdlib/force_flags.h"
@@ -66,6 +63,7 @@
 #include "gromacs/utility/real.h"
 #include "gromacs/utility/smalloc.h"
 
+#include "nbnxn_cuda.h"
 #include "nbnxn_cuda_types.h"
 
 static bool bUseCudaEventBlockingSync = false; /* makes the CPU thread block */
@@ -80,13 +78,6 @@ static bool bUseCudaEventBlockingSync = false; /* makes the CPU thread block */
  */
 static unsigned int gpu_min_ci_balanced_factor = 44;
 
-/* Functions from nbnxn_cuda.cu */
-extern void nbnxn_cuda_set_cacheconfig(gmx_device_info_t *devinfo);
-extern const struct texture<float, 1, cudaReadModeElementType> &nbnxn_cuda_get_nbfp_texref();
-extern const struct texture<float, 1, cudaReadModeElementType> &nbnxn_cuda_get_nbfp_comb_texref();
-extern const struct texture<float, 1, cudaReadModeElementType> &nbnxn_cuda_get_coulomb_tab_texref();
-
-
 /* Fw. decl. */
 static void nbnxn_cuda_clear_e_fshift(gmx_nbnxn_cuda_t *nb);
 
@@ -102,6 +93,7 @@ static void nbnxn_cuda_free_nbparam_table(cu_nbparam_t            *nbparam,
  */
 static bool use_texobj(const gmx_device_info_t *dev_info)
 {
+    assert(!c_disableCudaTextures);
     /* Only device CC >= 3.0 (Kepler and later) support texture objects */
     return (dev_info->prop.major >= 3);
 }
@@ -130,6 +122,8 @@ static void setup1DFloatTexture(cudaTextureObject_t &texObj,
                                 void                *devPtr,
                                 size_t               sizeInBytes)
 {
+    assert(!c_disableCudaTextures);
+
     cudaError_t      stat;
     cudaResourceDesc rd;
     cudaTextureDesc  td;
@@ -160,6 +154,8 @@ static void setup1DFloatTexture(const struct texture<float, 1, cudaReadModeEleme
                                 const void                                              *devPtr,
                                 size_t                                                   sizeInBytes)
 {
+    assert(!c_disableCudaTextures);
+
     cudaError_t           stat;
     cudaChannelFormatDesc cd;
 
@@ -196,15 +192,18 @@ static void init_ewald_coulomb_force_table(const interaction_const_t *ic,
     nbp->coulomb_tab_size  = ic->tabq_size;
     nbp->coulomb_tab_scale = ic->tabq_scale;
 
-    if (use_texobj(dev_info))
-    {
-        setup1DFloatTexture(nbp->coulomb_tab_texobj, nbp->coulomb_tab,
-                            nbp->coulomb_tab_size*sizeof(*nbp->coulomb_tab));
-    }
-    else
+    if (!c_disableCudaTextures)
     {
-        setup1DFloatTexture(&nbnxn_cuda_get_coulomb_tab_texref(), nbp->coulomb_tab,
-                            nbp->coulomb_tab_size*sizeof(*nbp->coulomb_tab));
+        if (use_texobj(dev_info))
+        {
+            setup1DFloatTexture(nbp->coulomb_tab_texobj, nbp->coulomb_tab,
+                                nbp->coulomb_tab_size*sizeof(*nbp->coulomb_tab));
+        }
+        else
+        {
+            setup1DFloatTexture(&nbnxn_cuda_get_coulomb_tab_texref(), nbp->coulomb_tab,
+                                nbp->coulomb_tab_size*sizeof(*nbp->coulomb_tab));
+        }
     }
 }
 
@@ -293,24 +292,27 @@ static int pick_ewald_kernel_type(bool                     bTwinCut,
 
 /*! Copies all parameters related to the cut-off from ic to nbp */
 static void set_cutoff_parameters(cu_nbparam_t              *nbp,
-                                  const interaction_const_t *ic)
+                                  const interaction_const_t *ic,
+                                  const NbnxnListParameters *listParams)
 {
-    nbp->ewald_beta       = ic->ewaldcoeff_q;
-    nbp->sh_ewald         = ic->sh_ewald;
-    nbp->epsfac           = ic->epsfac;
-    nbp->two_k_rf         = 2.0 * ic->k_rf;
-    nbp->c_rf             = ic->c_rf;
-    nbp->rvdw_sq          = ic->rvdw * ic->rvdw;
-    nbp->rcoulomb_sq      = ic->rcoulomb * ic->rcoulomb;
-    nbp->rlist_sq         = ic->rlist * ic->rlist;
-
-    nbp->sh_lj_ewald      = ic->sh_lj_ewald;
-    nbp->ewaldcoeff_lj    = ic->ewaldcoeff_lj;
-
-    nbp->rvdw_switch      = ic->rvdw_switch;
-    nbp->dispersion_shift = ic->dispersion_shift;
-    nbp->repulsion_shift  = ic->repulsion_shift;
-    nbp->vdw_switch       = ic->vdw_switch;
+    nbp->ewald_beta        = ic->ewaldcoeff_q;
+    nbp->sh_ewald          = ic->sh_ewald;
+    nbp->epsfac            = ic->epsfac;
+    nbp->two_k_rf          = 2.0 * ic->k_rf;
+    nbp->c_rf              = ic->c_rf;
+    nbp->rvdw_sq           = ic->rvdw * ic->rvdw;
+    nbp->rcoulomb_sq       = ic->rcoulomb * ic->rcoulomb;
+    nbp->rlistOuter_sq     = listParams->rlistOuter * listParams->rlistOuter;
+    nbp->rlistInner_sq     = listParams->rlistInner * listParams->rlistInner;
+    nbp->useDynamicPruning = listParams->useDynamicPruning;
+
+    nbp->sh_lj_ewald       = ic->sh_lj_ewald;
+    nbp->ewaldcoeff_lj     = ic->ewaldcoeff_lj;
+
+    nbp->rvdw_switch       = ic->rvdw_switch;
+    nbp->dispersion_shift  = ic->dispersion_shift;
+    nbp->repulsion_shift   = ic->repulsion_shift;
+    nbp->vdw_switch        = ic->vdw_switch;
 }
 
 /*! \brief Initialize LJ parameter lookup table.
@@ -341,19 +343,23 @@ static void initParamLookupTable(float                    * &devPtr,
     CU_RET_ERR(stat, "cudaMalloc failed in initParamLookupTable");
     cu_copy_H2D(devPtr, (void *)hostPtr, sizeInBytes);
 
-    if (use_texobj(devInfo))
-    {
-        setup1DFloatTexture(texObj, devPtr, sizeInBytes);
-    }
-    else
+    if (!c_disableCudaTextures)
     {
-        setup1DFloatTexture(texRef, devPtr, sizeInBytes);
+        if (use_texobj(devInfo))
+        {
+            setup1DFloatTexture(texObj, devPtr, sizeInBytes);
+        }
+        else
+        {
+            setup1DFloatTexture(texRef, devPtr, sizeInBytes);
+        }
     }
 }
 
 /*! Initializes the nonbonded parameter data structure. */
 static void init_nbparam(cu_nbparam_t              *nbp,
                          const interaction_const_t *ic,
+                         const NbnxnListParameters *listParams,
                          const nbnxn_atomdata_t    *nbat,
                          const gmx_device_info_t   *dev_info)
 {
@@ -361,7 +367,7 @@ static void init_nbparam(cu_nbparam_t              *nbp,
 
     ntypes  = nbat->ntype;
 
-    set_cutoff_parameters(nbp, ic);
+    set_cutoff_parameters(nbp, ic, listParams);
 
     /* The kernel code supports LJ combination rules (geometric and LB) for
      * all kernel types, but we only generate useful combination rule kernels.
@@ -469,7 +475,8 @@ static void init_nbparam(cu_nbparam_t              *nbp,
 /*! Re-generate the GPU Ewald force table, resets rlist, and update the
  *  electrostatic type switching to twin cut-off (or back) if needed. */
 void nbnxn_gpu_pme_loadbal_update_param(const nonbonded_verlet_t    *nbv,
-                                        const interaction_const_t   *ic)
+                                        const interaction_const_t   *ic,
+                                        const NbnxnListParameters   *listParams)
 {
     if (!nbv || nbv->grp[0].kernel_type != nbnxnk8x8x8_GPU)
     {
@@ -478,7 +485,7 @@ void nbnxn_gpu_pme_loadbal_update_param(const nonbonded_verlet_t    *nbv,
     gmx_nbnxn_cuda_t *nb    = nbv->gpu_nbv;
     cu_nbparam_t     *nbp   = nb->nbparam;
 
-    set_cutoff_parameters(nbp, ic);
+    set_cutoff_parameters(nbp, ic, listParams);
 
     nbp->eeltype        = pick_ewald_kernel_type(ic->rcoulomb != ic->rvdw,
                                                  nb->dev_info);
@@ -491,19 +498,22 @@ static void init_plist(cu_plist_t *pl)
 {
     /* initialize to NULL pointers to data that is not allocated here and will
        need reallocation in nbnxn_gpu_init_pairlist */
-    pl->sci     = NULL;
-    pl->cj4     = NULL;
-    pl->excl    = NULL;
+    pl->sci      = NULL;
+    pl->cj4      = NULL;
+    pl->imask    = NULL;
+    pl->excl     = NULL;
 
     /* size -1 indicates that the respective array hasn't been initialized yet */
-    pl->na_c        = -1;
-    pl->nsci        = -1;
-    pl->sci_nalloc  = -1;
-    pl->ncj4        = -1;
-    pl->cj4_nalloc  = -1;
-    pl->nexcl       = -1;
-    pl->excl_nalloc = -1;
-    pl->bDoPrune    = false;
+    pl->na_c           = -1;
+    pl->nsci           = -1;
+    pl->sci_nalloc     = -1;
+    pl->ncj4           = -1;
+    pl->cj4_nalloc     = -1;
+    pl->nimask         = -1;
+    pl->imask_nalloc   = -1;
+    pl->nexcl          = -1;
+    pl->excl_nalloc    = -1;
+    pl->haveFreshList  = false;
 }
 
 /*! Initializes the timer data structure. */
@@ -525,6 +535,15 @@ static void init_timers(cu_timers_t *t, bool bUseTwoStreams)
         stat = cudaEventCreateWithFlags(&(t->stop_nb_k[i]), eventflags);
         CU_RET_ERR(stat, "cudaEventCreate on stop_nb_k failed");
 
+        stat = cudaEventCreateWithFlags(&(t->start_prune_k[i]), eventflags);
+        CU_RET_ERR(stat, "cudaEventCreate on start_prune_k failed");
+        stat = cudaEventCreateWithFlags(&(t->stop_prune_k[i]), eventflags);
+        CU_RET_ERR(stat, "cudaEventCreate on stop_prune_k failed");
+
+        stat = cudaEventCreateWithFlags(&(t->start_rollingPrune_k[i]), eventflags);
+        CU_RET_ERR(stat, "cudaEventCreate on start_rollingPrune_k failed");
+        stat = cudaEventCreateWithFlags(&(t->stop_rollingPrune_k[i]), eventflags);
+        CU_RET_ERR(stat, "cudaEventCreate on stop_rollingPrune_k failed");
 
         stat = cudaEventCreateWithFlags(&(t->start_pl_h2d[i]), eventflags);
         CU_RET_ERR(stat, "cudaEventCreate on start_pl_h2d failed");
@@ -540,6 +559,10 @@ static void init_timers(cu_timers_t *t, bool bUseTwoStreams)
         CU_RET_ERR(stat, "cudaEventCreate on start_nb_d2h failed");
         stat = cudaEventCreateWithFlags(&(t->stop_nb_d2h[i]), eventflags);
         CU_RET_ERR(stat, "cudaEventCreate on stop_nb_d2h failed");
+
+        t->didPairlistH2D[i]  = false;
+        t->didPrune[i]        = false;
+        t->didRollingPrune[i] = false;
     }
 }
 
@@ -561,34 +584,36 @@ static void init_timings(gmx_wallclock_gpu_t *t)
             t->ktime[i][j].c = 0;
         }
     }
+    t->pruneTime.c        = 0;
+    t->pruneTime.t        = 0.0;
+    t->dynamicPruneTime.c = 0;
+    t->dynamicPruneTime.t = 0.0;
 }
 
 /*! Initializes simulation constant data. */
 static void nbnxn_cuda_init_const(gmx_nbnxn_cuda_t               *nb,
                                   const interaction_const_t      *ic,
+                                  const NbnxnListParameters      *listParams,
                                   const nonbonded_verlet_group_t *nbv_group)
 {
     init_atomdata_first(nb->atdat, nbv_group[0].nbat->ntype);
-    init_nbparam(nb->nbparam, ic, nbv_group[0].nbat, nb->dev_info);
+    init_nbparam(nb->nbparam, ic, listParams, nbv_group[0].nbat, nb->dev_info);
 
     /* clear energy and shift force outputs */
     nbnxn_cuda_clear_e_fshift(nb);
 }
 
 void nbnxn_gpu_init(gmx_nbnxn_cuda_t         **p_nb,
-                    const gmx_gpu_info_t      *gpu_info,
-                    const gmx_gpu_opt_t       *gpu_opt,
+                    const gmx_device_info_t   *deviceInfo,
                     const interaction_const_t *ic,
+                    const NbnxnListParameters *listParams,
                     nonbonded_verlet_group_t  *nbv_grp,
-                    int                        my_gpu_index,
                     int                        /*rank*/,
                     gmx_bool                   bLocalAndNonlocal)
 {
     cudaError_t       stat;
     gmx_nbnxn_cuda_t *nb;
 
-    assert(gpu_info);
-
     if (p_nb == NULL)
     {
         return;
@@ -616,7 +641,7 @@ void nbnxn_gpu_init(gmx_nbnxn_cuda_t         **p_nb,
     init_plist(nb->plist[eintLocal]);
 
     /* set device info, just point it to the right GPU among the detected ones */
-    nb->dev_info = &gpu_info->gpu_dev[get_gpu_device_id(gpu_info, gpu_opt, my_gpu_index)];
+    nb->dev_info = deviceInfo;
 
     /* local/non-local GPU streams */
     stat = cudaStreamCreate(&nb->stream[eintLocal]);
@@ -625,26 +650,18 @@ void nbnxn_gpu_init(gmx_nbnxn_cuda_t         **p_nb,
     {
         init_plist(nb->plist[eintNonlocal]);
 
-        /* CUDA stream priority available in the CUDA RT 5.5 API.
-         * Note that the device we're running on does not have to support
+        /* Note that the device we're running on does not have to support
          * priorities, because we are querying the priority range which in this
          * case will be a single value.
          */
-#if GMX_CUDA_VERSION >= 5050
-        {
-            int highest_priority;
-            stat = cudaDeviceGetStreamPriorityRange(NULL, &highest_priority);
-            CU_RET_ERR(stat, "cudaDeviceGetStreamPriorityRange failed");
-
-            stat = cudaStreamCreateWithPriority(&nb->stream[eintNonlocal],
-                                                cudaStreamDefault,
-                                                highest_priority);
-            CU_RET_ERR(stat, "cudaStreamCreateWithPriority on stream[eintNonlocal] failed");
-        }
-#else
-        stat = cudaStreamCreate(&nb->stream[eintNonlocal]);
-        CU_RET_ERR(stat, "cudaStreamCreate on stream[eintNonlocal] failed");
-#endif
+        int highest_priority;
+        stat = cudaDeviceGetStreamPriorityRange(NULL, &highest_priority);
+        CU_RET_ERR(stat, "cudaDeviceGetStreamPriorityRange failed");
+
+        stat = cudaStreamCreateWithPriority(&nb->stream[eintNonlocal],
+                                            cudaStreamDefault,
+                                            highest_priority);
+        CU_RET_ERR(stat, "cudaStreamCreateWithPriority on stream[eintNonlocal] failed");
     }
 
     /* init events for sychronization (timing disabled for performance reasons!) */
@@ -671,7 +688,7 @@ void nbnxn_gpu_init(gmx_nbnxn_cuda_t         **p_nb,
     /* pick L1 cache configuration */
     nbnxn_cuda_set_cacheconfig(nb->dev_info);
 
-    nbnxn_cuda_init_const(nb, ic, nbv_grp);
+    nbnxn_cuda_init_const(nb, ic, listParams, nbv_grp);
 
     *p_nb = nb;
 
@@ -709,6 +726,7 @@ void nbnxn_gpu_init_pairlist(gmx_nbnxn_cuda_t       *nb,
     {
         stat = cudaEventRecord(nb->timers->start_pl_h2d[iloc], stream);
         CU_RET_ERR(stat, "cudaEventRecord failed");
+        nb->timers->didPairlistH2D[iloc] = true;
     }
 
     cu_realloc_buffered((void **)&d_plist->sci, h_plist->sci, sizeof(*d_plist->sci),
@@ -721,6 +739,12 @@ void nbnxn_gpu_init_pairlist(gmx_nbnxn_cuda_t       *nb,
                         h_plist->ncj4,
                         stream, true);
 
+    /* this call only allocates space on the device (no data is transferred) */
+    cu_realloc_buffered((void **)&d_plist->imask, NULL, sizeof(*d_plist->imask),
+                        &d_plist->nimask, &d_plist->imask_nalloc,
+                        h_plist->ncj4*c_nbnxnGpuClusterpairSplit,
+                        stream, true);
+
     cu_realloc_buffered((void **)&d_plist->excl, h_plist->excl, sizeof(*d_plist->excl),
                         &d_plist->nexcl, &d_plist->excl_nalloc,
                         h_plist->nexcl,
@@ -732,8 +756,8 @@ void nbnxn_gpu_init_pairlist(gmx_nbnxn_cuda_t       *nb,
         CU_RET_ERR(stat, "cudaEventRecord failed");
     }
 
-    /* need to prune the pair list during the next step */
-    d_plist->bDoPrune = true;
+    /* the next use of thist list we be the first one, so we need to prune */
+    d_plist->haveFreshList = true;
 }
 
 void nbnxn_gpu_upload_shiftvec(gmx_nbnxn_cuda_t       *nb,
@@ -877,17 +901,20 @@ static void nbnxn_cuda_free_nbparam_table(cu_nbparam_t            *nbparam,
 
     if (nbparam->eeltype == eelCuEWALD_TAB || nbparam->eeltype == eelCuEWALD_TAB_TWIN)
     {
-        /* Only device CC >= 3.0 (Kepler and later) support texture objects */
-        if (use_texobj(dev_info))
-        {
-            stat = cudaDestroyTextureObject(nbparam->coulomb_tab_texobj);
-            CU_RET_ERR(stat, "cudaDestroyTextureObject on coulomb_tab_texobj failed");
-        }
-        else
+        if (!c_disableCudaTextures)
         {
-            GMX_UNUSED_VALUE(dev_info);
-            stat = cudaUnbindTexture(nbnxn_cuda_get_coulomb_tab_texref());
-            CU_RET_ERR(stat, "cudaUnbindTexture on coulomb_tab_texref failed");
+            /* Only device CC >= 3.0 (Kepler and later) support texture objects */
+            if (use_texobj(dev_info))
+            {
+                stat = cudaDestroyTextureObject(nbparam->coulomb_tab_texobj);
+                CU_RET_ERR(stat, "cudaDestroyTextureObject on coulomb_tab_texobj failed");
+            }
+            else
+            {
+                GMX_UNUSED_VALUE(dev_info);
+                stat = cudaUnbindTexture(nbnxn_cuda_get_coulomb_tab_texref());
+                CU_RET_ERR(stat, "cudaUnbindTexture on coulomb_tab_texref failed");
+            }
         }
         cu_free_buffered(nbparam->coulomb_tab, &nbparam->coulomb_tab_size);
     }
@@ -934,6 +961,16 @@ void nbnxn_gpu_free(gmx_nbnxn_cuda_t *nb)
             stat = cudaEventDestroy(timers->stop_nb_k[i]);
             CU_RET_ERR(stat, "cudaEventDestroy failed on timers->stop_nb_k");
 
+            stat = cudaEventDestroy(timers->start_prune_k[i]);
+            CU_RET_ERR(stat, "cudaEventDestroy failed on timers->start_prune_k");
+            stat = cudaEventDestroy(timers->stop_prune_k[i]);
+            CU_RET_ERR(stat, "cudaEventDestroy failed on timers->stop_prune_k");
+
+            stat = cudaEventDestroy(timers->start_rollingPrune_k[i]);
+            CU_RET_ERR(stat, "cudaEventDestroy failed on timers->start_rollingPrune_k");
+            stat = cudaEventDestroy(timers->stop_rollingPrune_k[i]);
+            CU_RET_ERR(stat, "cudaEventDestroy failed on timers->stop_rollingPrune_k");
+
             stat = cudaEventDestroy(timers->start_pl_h2d[i]);
             CU_RET_ERR(stat, "cudaEventDestroy failed on timers->start_pl_h2d");
             stat = cudaEventDestroy(timers->stop_pl_h2d[i]);
@@ -956,32 +993,38 @@ void nbnxn_gpu_free(gmx_nbnxn_cuda_t *nb)
 
     if (!useLjCombRule(nb->nbparam))
     {
-        /* Only device CC >= 3.0 (Kepler and later) support texture objects */
-        if (use_texobj(nb->dev_info))
+        if (!c_disableCudaTextures)
         {
-            stat = cudaDestroyTextureObject(nbparam->nbfp_texobj);
-            CU_RET_ERR(stat, "cudaDestroyTextureObject on nbfp_texobj failed");
-        }
-        else
-        {
-            stat = cudaUnbindTexture(nbnxn_cuda_get_nbfp_texref());
-            CU_RET_ERR(stat, "cudaUnbindTexture on nbfp_texref failed");
+            /* Only device CC >= 3.0 (Kepler and later) support texture objects */
+            if (use_texobj(nb->dev_info))
+            {
+                stat = cudaDestroyTextureObject(nbparam->nbfp_texobj);
+                CU_RET_ERR(stat, "cudaDestroyTextureObject on nbfp_texobj failed");
+            }
+            else
+            {
+                stat = cudaUnbindTexture(nbnxn_cuda_get_nbfp_texref());
+                CU_RET_ERR(stat, "cudaUnbindTexture on nbfp_texref failed");
+            }
         }
         cu_free_buffered(nbparam->nbfp);
     }
 
     if (nbparam->vdwtype == evdwCuEWALDGEOM || nbparam->vdwtype == evdwCuEWALDLB)
     {
-        /* Only device CC >= 3.0 (Kepler and later) support texture objects */
-        if (use_texobj(nb->dev_info))
-        {
-            stat = cudaDestroyTextureObject(nbparam->nbfp_comb_texobj);
-            CU_RET_ERR(stat, "cudaDestroyTextureObject on nbfp_comb_texobj failed");
-        }
-        else
+        if (!c_disableCudaTextures)
         {
-            stat = cudaUnbindTexture(nbnxn_cuda_get_nbfp_comb_texref());
-            CU_RET_ERR(stat, "cudaUnbindTexture on nbfp_comb_texref failed");
+            /* Only device CC >= 3.0 (Kepler and later) support texture objects */
+            if (use_texobj(nb->dev_info))
+            {
+                stat = cudaDestroyTextureObject(nbparam->nbfp_comb_texobj);
+                CU_RET_ERR(stat, "cudaDestroyTextureObject on nbfp_comb_texobj failed");
+            }
+            else
+            {
+                stat = cudaUnbindTexture(nbnxn_cuda_get_nbfp_comb_texref());
+                CU_RET_ERR(stat, "cudaUnbindTexture on nbfp_comb_texref failed");
+            }
         }
         cu_free_buffered(nbparam->nbfp_comb);
     }
@@ -1003,11 +1046,13 @@ void nbnxn_gpu_free(gmx_nbnxn_cuda_t *nb)
 
     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);
     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);
     }
 
@@ -1028,15 +1073,6 @@ void nbnxn_gpu_free(gmx_nbnxn_cuda_t *nb)
     }
 }
 
-void cu_synchstream_atdat(gmx_nbnxn_cuda_t *nb, int iloc)
-{
-    cudaError_t  stat;
-    cudaStream_t stream = nb->stream[iloc];
-
-    stat = cudaStreamWaitEvent(stream, nb->timers->stop_atdat, 0);
-    CU_RET_ERR(stat, "cudaStreamWaitEvent failed");
-}
-
 gmx_wallclock_gpu_t * nbnxn_gpu_get_timings(gmx_nbnxn_cuda_t *nb)
 {
     return (nb != NULL && nb->bDoTime) ? nb->timings : NULL;
index 00bc3b2b926f16ada3d90bd4a3906186036179f3..c0ef88571064e342206c18a5594ece1d153b73fa 100644 (file)
@@ -46,6 +46,7 @@
  */
 
 #include "gromacs/gpu_utils/cuda_arch_utils.cuh"
+#include "gromacs/gpu_utils/cuda_kernel_utils.cuh"
 #include "gromacs/math/utilities.h"
 #include "gromacs/pbcutil/ishift.h"
 /* Note that floating-point constants in CUDA code should be suffixed
@@ -53,8 +54,8 @@
  * code that is in double precision.
  */
 
-#if GMX_PTX_ARCH < 300
-#error "nbnxn_cuda_kernel.cuh included with GMX_PTX_ARCH < 300"
+#if GMX_PTX_ARCH < 300 && GMX_PTX_ARCH != 0
+#error "nbnxn_cuda_kernel.cuh included with GMX_PTX_ARCH < 300 or host pass"
 #endif
 
 #if defined EL_EWALD_ANA || defined EL_EWALD_TAB
@@ -85,7 +86,7 @@
    Kernel launch parameters:
     - #blocks   = #pair lists, blockId = pair list Id
     - #threads  = NTHREAD_Z * c_clSize^2
-    - shmem     = see nbnxn_cuda.cu:calc_shmem_required()
+    - shmem     = see nbnxn_cuda.cu:calc_shmem_required_nonbonded()
 
     Each thread calculates an i force-component taking one pair of i-j atoms.
  */
@@ -198,15 +199,12 @@ __global__ void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_cuda)
 #ifdef EL_RF
     float two_k_rf              = nbparam.two_k_rf;
 #endif
-#ifdef EL_EWALD_TAB
-    float coulomb_tab_scale     = nbparam.coulomb_tab_scale;
-#endif
 #ifdef EL_EWALD_ANA
     float beta2                 = nbparam.ewald_beta*nbparam.ewald_beta;
     float beta3                 = nbparam.ewald_beta*nbparam.ewald_beta*nbparam.ewald_beta;
 #endif
 #ifdef PRUNE_NBL
-    float rlist_sq              = nbparam.rlist_sq;
+    float rlist_sq              = nbparam.rlistOuter_sq;
 #endif
 
 #ifdef CALC_ENERGIES
@@ -289,7 +287,8 @@ __global__ void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_cuda)
         ci = sci * c_numClPerSupercl + tidxj;
         ai = ci * c_clSize + tidxi;
 
-        xqbuf    = xq[ai] + shift_vec[nb_sci.shift];
+        float  *shiftptr = (float *)&shift_vec[nb_sci.shift];
+        xqbuf    = xq[ai] + make_float4(LDG(shiftptr), LDG(shiftptr + 1), LDG(shiftptr + 2), 0.0f);
         xqbuf.w *= nbparam.epsfac;
         xqib[tidxj * c_clSize + tidxi] = xqbuf;
 
@@ -331,7 +330,11 @@ __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<float>(nbparam.nbfp_texobj, atom_types[(sci*c_numClPerSupercl + i)*c_clSize + tidxi]*(ntypes + 1)*2);
+    #endif
 #endif
         }
 
@@ -355,6 +358,10 @@ __global__ void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_cuda)
 
 #endif                                  /* CALC_ENERGIES */
 
+#ifdef EXCLUSION_FORCES
+    const int nonSelfInteraction  = !(nb_sci.shift == CENTRAL & tidxj <= tidxi);
+#endif
+
     int          j4LoopStart = cij4_start + tidxz;
     /* loop over the j clusters = seen by any of the atoms in the current super-cluster */
     for (j4 = j4LoopStart; j4 < cij4_end; j4 += NTHREAD_Z)
@@ -368,7 +375,7 @@ __global__ void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_cuda)
 #endif
         {
             /* Pre-load cj into shared memory on both warps separately */
-            if ((tidxj == 0 || tidxj == 4) && tidxi < c_nbnxnGpuJgroupSize)
+            if ((tidxj == 0 | tidxj == 4) & (tidxi < c_nbnxnGpuJgroupSize))
             {
                 cjs[tidxi + tidxj * c_nbnxnGpuJgroupSize/c_splitClSize] = pl_cj4[j4].cj[tidxi];
             }
@@ -432,10 +439,9 @@ __global__ void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_cuda)
 
                             /* cutoff & exclusion check */
 #ifdef EXCLUSION_FORCES
-                            if (r2 < rcoulomb_sq *
-                                (nb_sci.shift != CENTRAL || ci != cj || tidxj > tidxi))
+                            if ((r2 < rcoulomb_sq) * (nonSelfInteraction | (ci != cj)))
 #else
-                            if (r2 < rcoulomb_sq * int_bit)
+                            if ((r2 < rcoulomb_sq) * int_bit)
 #endif
                             {
                                 /* load the rest of the i-atom parameters */
@@ -444,8 +450,7 @@ __global__ void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_cuda)
 #ifndef LJ_COMB
                                 /* LJ 6*C6 and 12*C12 */
                                 typei   = atib[i * c_clSize + tidxi];
-                                c6      = tex1Dfetch<float>(nbparam.nbfp_texobj, 2 * (ntypes * typei + typej));
-                                c12     = tex1Dfetch<float>(nbparam.nbfp_texobj, 2 * (ntypes * typei + typej) + 1);
+                                fetch_nbfp_c6_c12(c6, c12, nbparam, ntypes * typei + typej);
 #else
                                 ljcp_i  = ljcpib[i * c_clSize + tidxi];
 #ifdef LJ_COMB_GEOM
@@ -519,9 +524,9 @@ __global__ void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_cuda)
 
 #ifdef LJ_POT_SWITCH
 #ifdef CALC_ENERGIES
-                                calculate_potential_switch_F_E(nbparam, c6, c12, inv_r, r2, &F_invr, &E_lj_p);
+                                calculate_potential_switch_F_E(nbparam, inv_r, r2, &F_invr, &E_lj_p);
 #else
-                                calculate_potential_switch_F(nbparam, c6, c12, inv_r, r2, &F_invr, &E_lj_p);
+                                calculate_potential_switch_F(nbparam, inv_r, r2, &F_invr, &E_lj_p);
 #endif /* CALC_ENERGIES */
 #endif /* LJ_POT_SWITCH */
 
@@ -555,7 +560,7 @@ __global__ void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_cuda)
                                 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 -
-                                                        interpolate_coulomb_force_r(nbparam.coulomb_tab_texobj, r2 * inv_r, coulomb_tab_scale)) * inv_r;
+                                                        interpolate_coulomb_force_r(nbparam, r2 * inv_r)) * inv_r;
 #endif                          /* EL_EWALD_ANA/TAB */
 
 #ifdef CALC_ENERGIES
index a84f45a54d87b63cb67617c0a115f131a755eb95..518c48c9ac7dfcfbe489884d3a2ac7cfe5711283 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,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.
@@ -46,6 +46,7 @@
  */
 
 #include "gromacs/gpu_utils/cuda_arch_utils.cuh"
+#include "gromacs/gpu_utils/cuda_kernel_utils.cuh"
 #include "gromacs/math/utilities.h"
 #include "gromacs/pbcutil/ishift.h"
 /* Note that floating-point constants in CUDA code should be suffixed
@@ -85,7 +86,7 @@
    Kernel launch parameters:
     - #blocks   = #pair lists, blockId = pair list Id
     - #threads  = c_clSize^2
-    - shmem     = see nbnxn_cuda.cu:calc_shmem_required()
+    - shmem     = see nbnxn_cuda.cu:calc_shmem_required_nonbonded()
 
     Each thread calculates an i force-component taking one pair of i-j atoms.
  */
@@ -147,15 +148,12 @@ __global__ void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_cuda)
 #ifdef EL_RF
     float two_k_rf              = nbparam.two_k_rf;
 #endif
-#ifdef EL_EWALD_TAB
-    float coulomb_tab_scale     = nbparam.coulomb_tab_scale;
-#endif
 #ifdef EL_EWALD_ANA
     float beta2                 = nbparam.ewald_beta*nbparam.ewald_beta;
     float beta3                 = nbparam.ewald_beta*nbparam.ewald_beta*nbparam.ewald_beta;
 #endif
 #ifdef PRUNE_NBL
-    float rlist_sq              = nbparam.rlist_sq;
+    float rlistOuter_sq         = nbparam.rlistOuter_sq;
 #endif
 
 #ifdef CALC_ENERGIES
@@ -260,7 +258,11 @@ __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
         }
 
@@ -284,6 +286,10 @@ __global__ void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_cuda)
 
 #endif                                  /* CALC_ENERGIES */
 
+#ifdef EXCLUSION_FORCES
+    const int nonSelfInteraction = !(nb_sci.shift == CENTRAL & tidxj <= tidxi);
+#endif
+
     /* loop over the j clusters = seen by any of the atoms in the current super-cluster */
     for (j4 = cij4_start; j4 < cij4_end; j4++)
     {
@@ -296,7 +302,7 @@ __global__ void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_cuda)
 #endif
         {
             /* Pre-load cj into shared memory on both warps separately */
-            if ((tidxj == 0 || tidxj == 4) && tidxi < c_nbnxnGpuJgroupSize)
+            if ((tidxj == 0 | tidxj == 4) & (tidxi < c_nbnxnGpuJgroupSize))
             {
                 cjs[tidxi + tidxj * c_nbnxnGpuJgroupSize/c_splitClSize] = pl_cj4[j4].cj[tidxi];
             }
@@ -349,7 +355,7 @@ __global__ void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_cuda)
                             /* If _none_ of the atoms pairs are in cutoff range,
                                the bit corresponding to the current
                                cluster-pair in imask gets set to 0. */
-                            if (!__any(r2 < rlist_sq))
+                            if (!__any(r2 < rlistOuter_sq))
                             {
                                 imask &= ~mask_ji;
                             }
@@ -359,10 +365,9 @@ __global__ void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_cuda)
 
                             /* cutoff & exclusion check */
 #ifdef EXCLUSION_FORCES
-                            if (r2 < rcoulomb_sq *
-                                (nb_sci.shift != CENTRAL || ci != cj || tidxj > tidxi))
+                            if ((r2 < rcoulomb_sq) * (nonSelfInteraction | (ci != cj)))
 #else
-                            if (r2 < rcoulomb_sq * int_bit)
+                            if ((r2 < rcoulomb_sq) * int_bit)
 #endif
                             {
                                 /* load the rest of the i-atom parameters */
@@ -371,8 +376,7 @@ __global__ void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_cuda)
 #ifndef LJ_COMB
                                 /* LJ 6*C6 and 12*C12 */
                                 typei   = atom_types[ai];
-                                c6      = tex1Dfetch(nbfp_texref, 2 * (ntypes * typei + typej));
-                                c12     = tex1Dfetch(nbfp_texref, 2 * (ntypes * typei + typej) + 1);
+                                fetch_nbfp_c6_c12(c6, c12, nbparam, ntypes * typei + typej);
 #else
                                 ljcp_i  = lj_comb[ai];
 #ifdef LJ_COMB_GEOM
@@ -446,15 +450,15 @@ __global__ void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_cuda)
 
 #ifdef LJ_POT_SWITCH
 #ifdef CALC_ENERGIES
-                                calculate_potential_switch_F_E(nbparam, c6, c12, inv_r, r2, &F_invr, &E_lj_p);
+                                calculate_potential_switch_F_E(nbparam, inv_r, r2, &F_invr, &E_lj_p);
 #else
-                                calculate_potential_switch_F(nbparam, c6, c12, inv_r, r2, &F_invr, &E_lj_p);
+                                calculate_potential_switch_F(nbparam, inv_r, r2, &F_invr, &E_lj_p);
 #endif /* CALC_ENERGIES */
 #endif /* LJ_POT_SWITCH */
 
 #ifdef VDW_CUTOFF_CHECK
                                 /* Separate VDW cut-off check to enable twin-range cut-offs
-                                 * (rvdw < rcoulomb <= rlist)
+                                 * (rvdw < rcoulomb <= rlistOuter)
                                  */
                                 vdw_in_range  = (r2 < rvdw_sq) ? 1.0f : 0.0f;
                                 F_invr       *= vdw_in_range;
@@ -482,7 +486,7 @@ __global__ void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_cuda)
                                 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 -
-                                                        interpolate_coulomb_force_r(r2 * inv_r, coulomb_tab_scale)) * inv_r;
+                                                        interpolate_coulomb_force_r(nbparam, r2 * inv_r)) * inv_r;
 #endif                          /* EL_EWALD_ANA/TAB */
 
 #ifdef CALC_ENERGIES
diff --git a/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_pruneonly.cu b/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_pruneonly.cu
new file mode 100644 (file)
index 0000000..27520ff
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+#include "gmxpre.h"
+
+#include "nbnxn_cuda_kernel_pruneonly.cuh"
+
+#ifndef FUNCTION_DECLARATION_ONLY
+/* Instantiate external template functions */
+template __global__ void nbnxn_kernel_prune_cuda<false>(const cu_atomdata_t, const cu_nbparam_t, const cu_plist_t, int, int);
+template __global__ void nbnxn_kernel_prune_cuda<true>(const cu_atomdata_t, const cu_nbparam_t, const cu_plist_t, int, int);
+#endif
diff --git a/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_pruneonly.cuh b/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_pruneonly.cuh
new file mode 100644 (file)
index 0000000..c184fa6
--- /dev/null
@@ -0,0 +1,254 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+
+/*! \internal \file
+ *  \brief
+ *  CUDA non-bonded prune-only kernel.
+ *
+ *  Unlike the non-bonded interaction kernels, this is not preprocessor-generated,
+ *  the two flavors achieved by templating.
+ *
+ *  \author Szilárd Páll <pall.szilard@gmail.com>
+ *  \author Berk Hess <hess@kth.se>
+ *  \ingroup module_mdlib
+ */
+#include "gmxpre.h"
+
+#include "gromacs/gpu_utils/cuda_arch_utils.cuh"
+#include "gromacs/math/utilities.h"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_utils.cuh"
+#include "gromacs/pbcutil/ishift.h"
+
+#include "nbnxn_cuda_types.h"
+
+/* Note that floating-point constants in CUDA code should be suffixed
+ * with f (e.g. 0.5f), to stop the compiler producing intermediate
+ * code that is in double precision.
+ */
+
+/**@{*/
+/*! \brief Compute capability dependent definition of kernel launch configuration parameters.
+ *
+ * Kernel launch bounds for different compute capabilities. The value of NTHREAD_Z
+ * represents the j-concurrency, hence it determines the number of threads per block.
+ * It is chosen such that 100% occupancy is maintained (on Maxwell and later for any NTHREAD_Z,
+ * requires >=4 warp/block, NTHREAD_Z>=2 on Kepler).
+ *
+ * Hence, values NTHREAD_Z >= 2 trade inter- for intra-block parallelism
+ * which has the advantage of lowering the overhead of starting up a block, filling shmem
+ * and registers, etc. Ideally we'd want to expose as much intra-block work as possible
+ * As we also split lists to cater for the block-parallelization needed by the register-
+ * limited non-bonded kernels, for very short j-loops large NTHREAD_Z will cause slowdown
+ * as it leads to intra-block warp imbalance. Ideally, we'd want to auto-tune the choice
+ * of NTHREAD_Z, but for now we instead pick a reasonable tradeoff-value.
+ *
+ * Note that given the above input size tradeoffs and that performance depends on
+ * additional factors including GPU arch, #SM's, we'll accept performance tradeoffs
+ * of using a fixed NTHREAD_Z=4. The following outliers have been observed:
+ *   - up to 25% faster (rolling) prune kernels with NTHREAD_Z=8 in the regime where lists
+ *     are not split (much), but the rolling chunks are small;
+ *   - with large inputs NTHREAD_Z=1 is 2-3% faster (on CC>=5.0)
+ */
+#define NTHREAD_Z           (GMX_NBNXN_PRUNE_KERNEL_J4_CONCURRENCY)
+#define THREADS_PER_BLOCK   (c_clSize*c_clSize*NTHREAD_Z)
+// we want 100% occupancy, so max threads/block
+#define MIN_BLOCKS_PER_MP   (GMX_CUDA_MAX_THREADS_PER_MP/THREADS_PER_BLOCK)
+/**@}*/
+
+/*! \brief Nonbonded list pruning kernel.
+ *
+ *  The \p haveFreshList template parameter defines the two flavors of the kernel; when
+ *  true a new list from immediately after pair-list generation is pruned using rlistOuter,
+ *  the pruned masks are stored in a separate buffer and the outer-list is pruned
+ *  using the rlistInner distance; when false only the pruning with rlistInner is performed.
+ *
+ *  Kernel launch parameters:
+ *   - #blocks   = #pair lists, blockId = pair list Id
+ *   - #threads  = NTHREAD_Z * c_clSize^2
+ *   - shmem     = see nbnxn_cuda.cu:calc_shmem_required_prune()
+ *
+ *   Each thread calculates an i-j atom distance..
+ */
+template <bool haveFreshList>
+__launch_bounds__(THREADS_PER_BLOCK, MIN_BLOCKS_PER_MP)
+__global__ void nbnxn_kernel_prune_cuda(const cu_atomdata_t atdat,
+                                        const cu_nbparam_t  nbparam,
+                                        const cu_plist_t    plist,
+                                        int                 numParts,
+                                        int                 part)
+#ifdef FUNCTION_DECLARATION_ONLY
+;     /* Only do function declaration, omit the function body. */
+#else
+{
+
+    /* convenience variables */
+    const nbnxn_sci_t  *pl_sci      = plist.sci;
+    nbnxn_cj4_t        *pl_cj4      = plist.cj4;
+    const float4       *xq          = atdat.xq;
+    const float3       *shift_vec   = atdat.shift_vec;
+
+    float               rlistOuter_sq = nbparam.rlistOuter_sq;
+    float               rlistInner_sq = nbparam.rlistInner_sq;
+
+    /* thread/block/warp id-s */
+    unsigned int tidxi  = threadIdx.x;
+    unsigned int tidxj  = threadIdx.y;
+#if NTHREAD_Z == 1
+    unsigned int tidxz  = 0;
+#else
+    unsigned int tidxz  = threadIdx.z;
+#endif
+    unsigned int bidx   = blockIdx.x;
+    unsigned int widx   = (threadIdx.y * c_clSize) / warp_size; /* warp index */
+
+    /* shmem buffer for i x pre-loading */
+    extern __shared__  float4 xib[];
+
+    /* shmem buffer for cj, for each warp separately */
+    int        *cjs    = ((int *)(xib + c_numClPerSupercl * c_clSize)) + tidxz * c_nbnxnGpuClusterpairSplit * c_nbnxnGpuJgroupSize;
+
+    nbnxn_sci_t nb_sci      = pl_sci[bidx*numParts + part]; /* my i super-cluster's index = sciOffset + current bidx * numParts + part */
+    int         sci         = nb_sci.sci;                   /* super-cluster */
+    int         cij4_start  = nb_sci.cj4_ind_start;         /* first ...*/
+    int         cij4_end    = nb_sci.cj4_ind_end;           /* and last index of j clusters */
+
+    if (tidxz == 0)
+    {
+        /* Pre-load i-atom x and q into shared memory */
+        int ci = sci * c_numClPerSupercl + tidxj;
+        int ai = ci * c_clSize + tidxi;
+
+        /* We don't need q, but using float4 in shmem avoids bank conflicts.
+           (but it also wastes L2 bandwidth). */
+        float4 tmp = xq[ai];
+        float4 xi  = tmp + shift_vec[nb_sci.shift];
+        xib[tidxj * c_clSize + tidxi] = xi;
+    }
+    __syncthreads();
+
+    /* loop over the j clusters = seen by any of the atoms in the current super-cluster */
+    for (int j4 = cij4_start + tidxz; j4 < cij4_end; j4 += NTHREAD_Z)
+    {
+        unsigned int imaskFull, imaskCheck, imaskNew;
+
+        if (haveFreshList)
+        {
+            /* Read the mask from the list transferred from the CPU */
+            imaskFull = pl_cj4[j4].imei[widx].imask;
+            /* We attempt to prune all pairs present in the original list */
+            imaskCheck = imaskFull;
+            imaskNew   = 0;
+        }
+        else
+        {
+            /* Read the mask from the "warp-pruned" by rlistOuter mask array */
+            imaskFull = plist.imask[j4*c_nbnxnGpuClusterpairSplit + widx];
+            /* Read the old rolling pruned mask, use as a base for new */
+            imaskNew = pl_cj4[j4].imei[widx].imask;
+            /* We only need to check pairs with different mask */
+            imaskCheck = (imaskNew ^ imaskFull);
+        }
+
+        if (imaskCheck)
+        {
+            /* Pre-load cj into shared memory on both warps separately */
+            if ((tidxj == 0 || tidxj == 4) && tidxi < c_nbnxnGpuJgroupSize)
+            {
+                cjs[tidxi + tidxj * c_nbnxnGpuJgroupSize/c_splitClSize] = pl_cj4[j4].cj[tidxi];
+            }
+
+#pragma unroll 4
+            for (int jm = 0; jm < c_nbnxnGpuJgroupSize; jm++)
+            {
+                if (imaskCheck & (superClInteractionMask << (jm * c_numClPerSupercl)))
+                {
+                    unsigned int mask_ji = (1U << (jm * c_numClPerSupercl));
+
+                    int          cj      = cjs[jm + (tidxj & 4) * c_nbnxnGpuJgroupSize/c_splitClSize];
+                    int          aj      = cj * c_clSize + tidxj;
+
+                    /* load j atom data */
+                    float4 tmp  = xq[aj];
+                    float3 xj   = make_float3(tmp.x, tmp.y, tmp.z);
+
+#pragma unroll 8
+                    for (int i = 0; i < c_numClPerSupercl; i++)
+                    {
+                        if (imaskCheck & mask_ji)
+                        {
+                            /* load i-cluster coordinates from shmem */
+                            float4 xi = xib[i * c_clSize + tidxi];
+
+
+                            /* distance between i and j atoms */
+                            float3 rv = make_float3(xi.x, xi.y, xi.z) - xj;
+                            float  r2 = norm2(rv);
+
+                            /* If _none_ of the atoms pairs are in rlistOuter
+                               range, the bit corresponding to the current
+                               cluster-pair in imask gets set to 0. */
+                            if (haveFreshList && !__any(r2 < rlistOuter_sq))
+                            {
+                                imaskFull &= ~mask_ji;
+                            }
+                            /* If any atom pair is within range, set the bit
+                               corresponding to the current cluster-pair. */
+                            if (__any(r2 < rlistInner_sq))
+                            {
+                                imaskNew |= mask_ji;
+                            }
+                        }
+
+                        /* shift the mask bit by 1 */
+                        mask_ji += mask_ji;
+                    }
+                }
+            }
+
+            if (haveFreshList)
+            {
+                /* copy the list pruned to rlistOuter to a separate buffer */
+                plist.imask[j4*c_nbnxnGpuClusterpairSplit + widx] = imaskFull;
+            }
+            /* update the imask with only the pairs up to rlistInner */
+            plist.cj4[j4].imei[widx].imask = imaskNew;
+        }
+    }
+}
+#endif /* FUNCTION_DECLARATION_ONLY */
+
+#undef NTHREAD_Z
+#undef MIN_BLOCKS_PER_MP
+#undef THREADS_PER_BLOCK
index 82077bb96a2655d8559a46fe4bd9ab1f709e1168..71f1901434c914cb5ef53782aca3070d42f0bac2 100644 (file)
  *  \author Szilárd Páll <pall.szilard@gmail.com>
  *  \ingroup module_mdlib
  */
-#include "config.h"
-
 #include <assert.h>
 
 /* Note that floating-point constants in CUDA code should be suffixed
  * with f (e.g. 0.5f), to stop the compiler producing intermediate
  * code that is in double precision.
  */
-#include "config.h"
 
 #include "gromacs/gpu_utils/cuda_arch_utils.cuh"
+#include "gromacs/gpu_utils/cuda_kernel_utils.cuh"
 #include "gromacs/gpu_utils/vectype_ops.cuh"
 
 #include "nbnxn_cuda_types.h"
@@ -60,8 +58,8 @@
 #ifndef NBNXN_CUDA_KERNEL_UTILS_CUH
 #define NBNXN_CUDA_KERNEL_UTILS_CUH
 
-/* Use texture objects if supported by the target hardware. */
-#if GMX_PTX_ARCH >= 300
+/* 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
@@ -75,22 +73,12 @@ static const int          c_clSizeSq    = c_clSize*c_clSize;
 static const int          c_splitClSize = c_clSize/c_nbnxnGpuClusterpairSplit;
 /*! \brief Stride in the force accumualation buffer */
 static const int          c_fbufStride  = c_clSizeSq;
+/*! \brief i-cluster interaction mask for a super-cluster with all c_numClPerSupercl=8 bits set */
+static const unsigned     superClInteractionMask = ((1U << c_numClPerSupercl) - 1U);
 
 static const float        c_oneSixth    = 0.16666667f;
 static const float        c_oneTwelveth = 0.08333333f;
 
-/* With multiple compilation units this ensures that texture refs are available
-   in the the kernels' compilation units. */
-#if !GMX_CUDA_NB_SINGLE_COMPILATION_UNIT
-/*! Texture reference for LJ C6/C12 parameters; bound to cu_nbparam_t.nbfp */
-extern texture<float, 1, cudaReadModeElementType> nbfp_texref;
-
-/*! Texture reference for LJ-PME parameters; bound to cu_nbparam_t.nbfp_comb */
-extern texture<float, 1, cudaReadModeElementType> nbfp_comb_texref;
-
-/*! Texture reference for Ewald coulomb force table; bound to cu_nbparam_t.coulomb_tab */
-extern texture<float, 1, cudaReadModeElementType> coulomb_tab_texref;
-#endif /* GMX_CUDA_NB_SINGLE_COMPILATION_UNIT */
 
 /*! Convert LJ sigma,epsilon parameters to C6,C12. */
 static __forceinline__ __device__
@@ -171,8 +159,6 @@ void calculate_force_switch_F_E(const  cu_nbparam_t nbparam,
 /*! Apply potential switch, force-only version. */
 static __forceinline__ __device__
 void calculate_potential_switch_F(const  cu_nbparam_t nbparam,
-                                  float               c6,
-                                  float               c12,
                                   float               inv_r,
                                   float               r2,
                                   float              *F_invr,
@@ -205,8 +191,6 @@ void calculate_potential_switch_F(const  cu_nbparam_t nbparam,
 /*! Apply potential switch, force + energy version. */
 static __forceinline__ __device__
 void calculate_potential_switch_F_E(const  cu_nbparam_t nbparam,
-                                    float               c6,
-                                    float               c12,
                                     float               inv_r,
                                     float               r2,
                                     float              *F_invr,
@@ -235,6 +219,29 @@ void calculate_potential_switch_F_E(const  cu_nbparam_t nbparam,
     *E_lj   *= sw;
 }
 
+
+/*! \brief Fetch C6 grid contribution coefficients and return the product of these.
+ *
+ *  Depending on what is supported, it fetches parameters either
+ *  using direct load, texture objects, or texrefs.
+ */
+static __forceinline__ __device__
+float calculate_lj_ewald_c6grid(const cu_nbparam_t nbparam,
+                                int                typei,
+                                int                typej)
+{
+#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 */
+}
+
+
 /*! Calculate LJ-PME grid force contribution with
  *  geometric combination rule.
  */
@@ -250,11 +257,7 @@ void calculate_lj_ewald_comb_geom_F(const cu_nbparam_t nbparam,
 {
     float c6grid, inv_r6_nm, cr2, expmcr2, poly;
 
-#ifdef USE_TEXOBJ
-    c6grid    = tex1Dfetch<float>(nbparam.nbfp_comb_texobj, 2*typei) * tex1Dfetch<float>(nbparam.nbfp_comb_texobj, 2*typej);
-#else
-    c6grid    = tex1Dfetch(nbfp_comb_texref, 2*typei) * tex1Dfetch(nbfp_comb_texref, 2*typej);
-#endif /* USE_TEXOBJ */
+    c6grid = calculate_lj_ewald_c6grid(nbparam, typei, typej);
 
     /* Recalculate inv_r6 without exclusion mask */
     inv_r6_nm = inv_r2*inv_r2*inv_r2;
@@ -266,6 +269,7 @@ void calculate_lj_ewald_comb_geom_F(const cu_nbparam_t nbparam,
     *F_invr  += c6grid*(inv_r6_nm - expmcr2*(inv_r6_nm*poly + lje_coeff6_6))*inv_r2;
 }
 
+
 /*! Calculate LJ-PME grid force + energy contribution with
  *  geometric combination rule.
  */
@@ -283,11 +287,7 @@ void calculate_lj_ewald_comb_geom_F_E(const cu_nbparam_t nbparam,
 {
     float c6grid, inv_r6_nm, cr2, expmcr2, poly, sh_mask;
 
-#ifdef USE_TEXOBJ
-    c6grid    = tex1Dfetch<float>(nbparam.nbfp_comb_texobj, 2*typei) * tex1Dfetch<float>(nbparam.nbfp_comb_texobj, 2*typej);
-#else
-    c6grid    = tex1Dfetch(nbfp_comb_texref, 2*typei) * tex1Dfetch(nbfp_comb_texref, 2*typej);
-#endif /* USE_TEXOBJ */
+    c6grid = calculate_lj_ewald_c6grid(nbparam, typei, typej);
 
     /* Recalculate inv_r6 without exclusion mask */
     inv_r6_nm = inv_r2*inv_r2*inv_r2;
@@ -303,6 +303,36 @@ void calculate_lj_ewald_comb_geom_F_E(const cu_nbparam_t nbparam,
     *E_lj    += c_oneSixth*c6grid*(inv_r6_nm*(1.0f - expmcr2*poly) + sh_mask);
 }
 
+/*! Fetch per-type LJ parameters.
+ *
+ *  Depending on what is supported, it fetches parameters either
+ *  using direct load, texture objects, or texrefs.
+ */
+static __forceinline__ __device__
+float2 fetch_nbfp_comb_c6_c12(const cu_nbparam_t nbparam,
+                              int                type)
+{
+    float2 c6c12;
+#if DISABLE_CUDA_TEXTURES
+    /* Force an 8-byte fetch to save a memory instruction. */
+    float2 *nbfp_comb = (float2 *)nbparam.nbfp_comb;
+    c6c12 = LDG(&nbfp_comb[type]);
+#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;
+}
+
+
 /*! Calculate LJ-PME grid force + energy contribution (if E_lj != NULL) with
  *  Lorentz-Berthelot combination rule.
  *  We use a single F+E kernel with conditional because the performance impact
@@ -324,13 +354,12 @@ void calculate_lj_ewald_comb_LB_F_E(const cu_nbparam_t nbparam,
     float sigma, sigma2, epsilon;
 
     /* sigma and epsilon are scaled to give 6*C6 */
-#ifdef USE_TEXOBJ
-    sigma   = tex1Dfetch<float>(nbparam.nbfp_comb_texobj, 2*typei    ) + tex1Dfetch<float>(nbparam.nbfp_comb_texobj, 2*typej    );
-    epsilon = tex1Dfetch<float>(nbparam.nbfp_comb_texobj, 2*typei + 1) * tex1Dfetch<float>(nbparam.nbfp_comb_texobj, 2*typej + 1);
-#else
-    sigma   = tex1Dfetch(nbfp_comb_texref, 2*typei    ) + tex1Dfetch(nbfp_comb_texref, 2*typej    );
-    epsilon = tex1Dfetch(nbfp_comb_texref, 2*typei + 1) * tex1Dfetch(nbfp_comb_texref, 2*typej + 1);
-#endif /* USE_TEXOBJ */
+    float2 c6c12_i = fetch_nbfp_comb_c6_c12(nbparam, typei);
+    float2 c6c12_j = fetch_nbfp_comb_c6_c12(nbparam, typej);
+
+    sigma   = c6c12_i.x + c6c12_j.x;
+    epsilon = c6c12_i.y * c6c12_j.y;
+
     sigma2  = sigma*sigma;
     c6grid  = epsilon*sigma2*sigma2*sigma2;
 
@@ -353,34 +382,96 @@ void calculate_lj_ewald_comb_LB_F_E(const cu_nbparam_t nbparam,
     }
 }
 
-/*! Interpolate Ewald coulomb force using the table through the tex_nbfp texture.
- *  Original idea: from the OpenMM project
+
+/*! Fetch two consecutive values from the Ewald correction F*r table.
+ *
+ *  Depending on what is supported, it fetches parameters either
+ *  using direct load, texture objects, or texrefs.
  */
 static __forceinline__ __device__
-float interpolate_coulomb_force_r(float r, float scale)
+float2 fetch_coulomb_force_r(const cu_nbparam_t nbparam,
+                             int                index)
 {
-    float   normalized = scale * r;
-    int     index      = (int) normalized;
-    float   fract2     = normalized - index;
-    float   fract1     = 1.0f - fract2;
+    float2 d;
+
+#if DISABLE_CUDA_TEXTURES
+    /* Can't do 8-byte fetch because some of the addresses will be misaligned. */
+    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 fract1 * tex1Dfetch(coulomb_tab_texref, index)
-           + fract2 * tex1Dfetch(coulomb_tab_texref, index + 1);
+    return d;
 }
 
+/*! Linear interpolation using exactly two FMA operations.
+ *
+ *  Implements numeric equivalent of: (1-t)*d0 + t*d1
+ *  Note that CUDA does not have fnms, otherwise we'd use
+ *  fma(t, d1, fnms(t, d0, d0)
+ *  but input modifiers are designed for this and are fast.
+ */
+template <typename T>
+__forceinline__ __host__ __device__
+T lerp(T d0, T d1, T t)
+{
+    return fma(t, d1, fma(-t, d0, d0));
+}
+
+/*! Interpolate Ewald coulomb force correction using the F*r table.
+ */
 static __forceinline__ __device__
-float interpolate_coulomb_force_r(cudaTextureObject_t texobj_coulomb_tab,
-                                  float r, float scale)
+float interpolate_coulomb_force_r(const cu_nbparam_t nbparam,
+                                  float              r)
 {
-    float   normalized = scale * r;
-    int     index      = (int) normalized;
-    float   fract2     = normalized - index;
-    float   fract1     = 1.0f - fract2;
+    float  normalized = nbparam.coulomb_tab_scale * r;
+    int    index      = (int) normalized;
+    float  fraction   = normalized - index;
+
+    float2 d01 = fetch_coulomb_force_r(nbparam, index);
 
-    return fract1 * tex1Dfetch<float>(texobj_coulomb_tab, index) +
-           fract2 * tex1Dfetch<float>(texobj_coulomb_tab, index + 1);
+    return lerp(d01.x, d01.y, fraction);
 }
 
+/*! Fetch C6 and C12 from the parameter table.
+ *
+ *  Depending on what is supported, it fetches parameters either
+ *  using direct load, texture objects, or texrefs.
+ */
+static __forceinline__ __device__
+void fetch_nbfp_c6_c12(float               &c6,
+                       float               &c12,
+                       const cu_nbparam_t   nbparam,
+                       int                  baseIndex)
+{
+#if DISABLE_CUDA_TEXTURES
+    /* Force an 8-byte fetch to save a memory instruction. */
+    float2 *nbfp = (float2 *)nbparam.nbfp;
+    float2  c6c12;
+    c6c12 = LDG(&nbfp[baseIndex]);
+    c6    = c6c12.x;
+    c12   = c6c12.y;
+#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
+}
+
+
 /*! Calculate analytical Ewald correction term. */
 static __forceinline__ __device__
 float pmecorrF(float z2)
@@ -443,7 +534,7 @@ void reduce_force_j_generic(float *f_buf, float3 *fout,
 /*! Final j-force reduction; this implementation only with power of two
  *  array sizes and with sm >= 3.0
  */
-#if GMX_PTX_ARCH >= 300
+#if GMX_PTX_ARCH >= 300 || GMX_PTX_ARCH == 0
 static __forceinline__ __device__
 void reduce_force_j_warp_shfl(float3 f, float3 *fout,
                               int tidxi, int aidx,
@@ -570,7 +661,7 @@ void reduce_force_i(float *f_buf, float3 *f,
 /*! Final i-force reduction; this implementation works only with power of two
  *  array sizes and with sm >= 3.0
  */
-#if GMX_PTX_ARCH >= 300
+#if GMX_PTX_ARCH >= 300 || GMX_PTX_ARCH == 0
 static __forceinline__ __device__
 void reduce_force_i_warp_shfl(float3 fin, float3 *fout,
                               float *fshift_buf, bool bCalcFshift,
@@ -648,7 +739,7 @@ void reduce_energy_pow2(volatile float *buf,
 /*! Energy reduction; this implementation works only with power of two
  *  array sizes and with sm >= 3.0
  */
-#if GMX_PTX_ARCH >= 300
+#if GMX_PTX_ARCH >= 300 || GMX_PTX_ARCH == 0
 static __forceinline__ __device__
 void reduce_energy_warp_shfl(float E_lj, float E_el,
                              float *e_lj, float *e_el,
index e56ce654115f66ce9325ae877c78d9737865b8e3..a9be593e841510ab9989c47f4ea4f09b4da507ae 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,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.
@@ -52,7 +52,8 @@
  *  \ingroup module_mdlib
  */
 
-#if GMX_PTX_ARCH >= 300
+/* Use the standard non-Fermi kernel in host pass too (to avoid texref API calls). */
+#if GMX_PTX_ARCH >= 300 || GMX_PTX_ARCH == 0
 #define FLAVOR_LEVEL_GENERATOR "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #else
 #define FLAVOR_LEVEL_GENERATOR "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_fermi.cuh"
index 8519b5598ea6cb39b35b45580e8004e288f1cc96..27f774f54f7b6fe42c359b4631455eff20fa5bf5 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, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,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.
@@ -46,6 +46,7 @@
 #ifndef NBNXN_CUDA_TYPES_H
 #define NBNXN_CUDA_TYPES_H
 
+#include "gromacs/gpu_utils/cuda_arch_utils.cuh"
 #include "gromacs/gpu_utils/cudautils.cuh"
 #include "gromacs/mdlib/nbnxn_consts.h"
 #include "gromacs/mdlib/nbnxn_pairlist.h"
 #include "gromacs/timing/gpu_timing.h"
 
 
+/*! \brief Macro definining default for the prune kernel's j4 processing concurrency.
+ *
+ *  The GMX_NBNXN_PRUNE_KERNEL_J4_CONCURRENCY macro allows compile-time override.
+ */
+#ifndef GMX_NBNXN_PRUNE_KERNEL_J4_CONCURRENCY
+#define GMX_NBNXN_PRUNE_KERNEL_J4_CONCURRENCY 4
+#endif
+/*! \brief Default for the prune kernel's j4 processing concurrency.
+ *
+ *  Initialized using the #GMX_NBNXN_PRUNE_KERNEL_J4_CONCURRENCY macro which allows compile-time override.
+ */
+const int c_cudaPruneKernelJ4Concurrency = GMX_NBNXN_PRUNE_KERNEL_J4_CONCURRENCY;
+
 /* TODO: consider moving this to kernel_utils */
 /* Convenience defines */
 /*! \brief number of clusters per supercluster. */
@@ -60,6 +74,10 @@ static const int c_numClPerSupercl = c_nbnxnGpuNumClusterPerSupercluster;
 /*! \brief cluster size = number of atoms per cluster. */
 static const int c_clSize          = c_nbnxnGpuClusterSize;
 
+/*! \brief True if the use of texture fetch in the CUDA kernels is disabled. */
+static const bool c_disableCudaTextures = DISABLE_CUDA_TEXTURES;
+
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -150,26 +168,28 @@ struct cu_atomdata
 struct cu_nbparam
 {
 
-    int             eeltype;          /**< type of electrostatics, takes values from #eelCu */
-    int             vdwtype;          /**< type of VdW impl., takes values from #evdwCu     */
+    int             eeltype;              /**< type of electrostatics, takes values from #eelCu */
+    int             vdwtype;              /**< type of VdW impl., takes values from #evdwCu     */
 
-    float           epsfac;           /**< charge multiplication factor                      */
-    float           c_rf;             /**< Reaction-field/plain cutoff electrostatics const. */
-    float           two_k_rf;         /**< Reaction-field electrostatics constant            */
-    float           ewald_beta;       /**< Ewald/PME parameter                               */
-    float           sh_ewald;         /**< Ewald/PME correction term substracted from the direct-space potential */
-    float           sh_lj_ewald;      /**< LJ-Ewald/PME correction term added to the correction potential        */
-    float           ewaldcoeff_lj;    /**< LJ-Ewald/PME coefficient                          */
+    float           epsfac;               /**< charge multiplication factor                      */
+    float           c_rf;                 /**< Reaction-field/plain cutoff electrostatics const. */
+    float           two_k_rf;             /**< Reaction-field electrostatics constant            */
+    float           ewald_beta;           /**< Ewald/PME parameter                               */
+    float           sh_ewald;             /**< Ewald/PME correction term substracted from the direct-space potential */
+    float           sh_lj_ewald;          /**< LJ-Ewald/PME correction term added to the correction potential        */
+    float           ewaldcoeff_lj;        /**< LJ-Ewald/PME coefficient                          */
 
-    float           rcoulomb_sq;      /**< Coulomb cut-off squared                           */
+    float           rcoulomb_sq;          /**< Coulomb cut-off squared                           */
 
-    float           rvdw_sq;          /**< VdW cut-off squared                               */
-    float           rvdw_switch;      /**< VdW switched cut-off                              */
-    float           rlist_sq;         /**< pair-list cut-off squared                         */
+    float           rvdw_sq;              /**< VdW cut-off squared                               */
+    float           rvdw_switch;          /**< VdW switched cut-off                              */
+    float           rlistOuter_sq;        /**< Full, outer pair-list cut-off squared             */
+    float           rlistInner_sq;        /**< Inner, dynamic pruned pair-list cut-off squared   */
+    bool            useDynamicPruning;    /**< True if we use dynamic pair-list pruning          */
 
-    shift_consts_t  dispersion_shift; /**< VdW shift dispersion constants           */
-    shift_consts_t  repulsion_shift;  /**< VdW shift repulsion constants            */
-    switch_consts_t vdw_switch;       /**< VdW switch constants                     */
+    shift_consts_t  dispersion_shift;     /**< VdW shift dispersion constants           */
+    shift_consts_t  repulsion_shift;      /**< VdW shift repulsion constants            */
+    switch_consts_t vdw_switch;           /**< VdW switch constants                     */
 
     /* LJ non-bonded parameters - accessed through texture memory */
     float               *nbfp;             /**< nonbonded parameter table with C6/C12 pairs per atom type-pair, 2*ntype^2 elements */
@@ -189,22 +209,27 @@ struct cu_nbparam
  */
 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            */
-    nbnxn_excl_t    *excl;        /**< atom interaction bits                        */
-    int              nexcl;       /**< count for excl                               */
-    int              excl_nalloc; /**< allocation size of excl                      */
-
-    bool             bDoPrune;    /**< true if pair-list pruning needs to be
-                                       done during the  current step                */
+    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 */
 };
 
 /** \internal
@@ -215,16 +240,23 @@ struct cu_plist
  */
 struct cu_timers
 {
-    cudaEvent_t start_atdat;     /**< start event for atom data transfer (every PS step)             */
-    cudaEvent_t stop_atdat;      /**< stop event for atom data transfer (every PS step)              */
-    cudaEvent_t start_nb_h2d[2]; /**< start events for x/q H2D transfers (l/nl, every step)          */
-    cudaEvent_t stop_nb_h2d[2];  /**< stop events for x/q H2D transfers (l/nl, every step)           */
-    cudaEvent_t start_nb_d2h[2]; /**< start events for f D2H transfer (l/nl, every step)             */
-    cudaEvent_t stop_nb_d2h[2];  /**< stop events for f D2H transfer (l/nl, every step)              */
-    cudaEvent_t start_pl_h2d[2]; /**< start events for pair-list H2D transfers (l/nl, every PS step) */
-    cudaEvent_t stop_pl_h2d[2];  /**< start events for pair-list H2D transfers (l/nl, every PS step) */
-    cudaEvent_t start_nb_k[2];   /**< start event for non-bonded kernels (l/nl, every step)          */
-    cudaEvent_t stop_nb_k[2];    /**< stop event non-bonded kernels (l/nl, every step)               */
+    cudaEvent_t start_atdat;             /**< start event for atom data transfer (every PS step)             */
+    cudaEvent_t stop_atdat;              /**< stop event for atom data transfer (every PS step)              */
+    cudaEvent_t start_nb_h2d[2];         /**< start events for x/q H2D transfers (l/nl, every step)          */
+    cudaEvent_t stop_nb_h2d[2];          /**< stop events for x/q H2D transfers (l/nl, every step)           */
+    cudaEvent_t start_nb_d2h[2];         /**< start events for f D2H transfer (l/nl, every step)             */
+    cudaEvent_t stop_nb_d2h[2];          /**< stop events for f D2H transfer (l/nl, every step)              */
+    cudaEvent_t start_pl_h2d[2];         /**< start events for pair-list H2D transfers (l/nl, every PS step) */
+    cudaEvent_t stop_pl_h2d[2];          /**< start events for pair-list H2D transfers (l/nl, every PS step) */
+    bool        didPairlistH2D[2];       /**< true when a pair-list transfer has been done at this step      */
+    cudaEvent_t start_nb_k[2];           /**< start event for non-bonded kernels (l/nl, every step)          */
+    cudaEvent_t stop_nb_k[2];            /**< stop event non-bonded kernels (l/nl, every step)               */
+    cudaEvent_t start_prune_k[2];        /**< start event for the 1st pass list pruning kernel (l/nl, every PS step)   */
+    cudaEvent_t stop_prune_k[2];         /**< stop event for the 1st pass list pruning kernel (l/nl, every PS step)   */
+    bool        didPrune[2];             /**< true when we timed pruning and the timings need to be accounted for */
+    cudaEvent_t start_rollingPrune_k[2]; /**< start event for rolling pruning kernels (l/nl, frequency depends on chunk size)   */
+    cudaEvent_t stop_rollingPrune_k[2];  /**< stop event for rolling pruning kernels (l/nl, frequency depends on chunk size)   */
+    bool        didRollingPrune[2];      /**< true when we timed rolling pruning (at the previous step) and the timings need to be accounted for */
 };
 
 /** \internal
@@ -232,7 +264,7 @@ struct cu_timers
  */
 struct gmx_nbnxn_cuda_t
 {
-    struct gmx_device_info_t *dev_info;       /**< CUDA device information                              */
+    const gmx_device_info_t  *dev_info;       /**< CUDA device information                              */
     bool                      bUseTwoStreams; /**< true if doing both local/non-local NB work on GPU    */
     cu_atomdata_t            *atdat;          /**< atom data                                            */
     cu_nbparam_t             *nbparam;        /**< parameters required for the non-bonded calc.         */
index 318824de45ca1e19ead172e60d3241e795f9c445..1b903f13366e7c14a4025e078c981c3df2c9ea0b 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,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.
@@ -71,6 +71,46 @@ void nbnxn_gpu_launch_kernel(gmx_nbnxn_gpu_t gmx_unused               *nb,
                              int gmx_unused                            flags,
                              int gmx_unused                            iloc) GPU_FUNC_TERM
 
+/*! \brief
+ * Launch asynchronously the nonbonded prune-only kernel.
+ *
+ *  The local and non-local list pruning are launched in their separate streams.
+ *
+ *  Notes for future scheduling tuning:
+ *  Currently we schedule the dynamic pruning between two MD steps *after* both local and
+ *  nonlocal force D2H transfers completed. We could launch already after the cpyback
+ *  is launched, but we want to avoid prune kernels (especially in the non-local
+ *  high prio-stream) competing with nonbonded work.
+ *
+ *  However, this is not ideal as this schedule does not expose the available
+ *  concurrency. The dynamic pruning kernel:
+ *    - should be allowed to overlap with any task other than force compute, including
+ *      transfers (F D2H and the next step's x H2D as well as force clearing).
+ *    - we'd prefer to avoid competition with non-bonded force kernels belonging
+ *      to the same rank and ideally other ranks too.
+ *
+ *  In the most general case, the former would require scheduling pruning in a separate
+ *  stream and adding additional event sync points to ensure that force kernels read
+ *  consistent pair list data. This would lead to some overhead (due to extra
+ *  cudaStreamWaitEvent calls, 3-5 us/call) which we might be able to live with.
+ *  The gains from additional overlap might not be significant as long as
+ *  update+constraints anyway takes longer than pruning, but there will still
+ *  be use-cases where more overlap may help (e.g. multiple ranks per GPU,
+ *  no/hbonds only constraints).
+ *  The above second point is harder to address given that multiple ranks will often
+ *  share a GPU. Ranks that complete their nonbondeds sooner can schedule pruning earlier
+ *  and without a third priority level it is difficult to avoid some interference of
+ *  prune kernels with force tasks (in particular preemption of low-prio local force task).
+ *
+ * \param [inout] nb        GPU nonbonded data.
+ * \param [in]    iloc      Interaction locality flag.
+ * \param [in]    numParts  Number of parts the pair list is split into in the rolling kernel.
+ */
+GPU_FUNC_QUALIFIER
+void nbnxn_gpu_launch_kernel_pruneonly(gmx_nbnxn_gpu_t gmx_unused *nb,
+                                       int gmx_unused              iloc,
+                                       int gmx_unused              numParts) GPU_FUNC_TERM
+
 /*! \brief
  * Launch asynchronously the download of nonbonded forces from the GPU
  * (and energies/shift forces if required).
index 0e16d5cfd9f6155d92b21eeb69f88285a1ec6716..ebc1d5171bdf9e74c3e7ea7f5bf1d4cd8ceb35cf 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,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.
@@ -54,18 +54,17 @@ extern "C" {
 struct nonbonded_verlet_group_t;
 struct nbnxn_pairlist_t;
 struct nbnxn_atomdata_t;
+struct NbnxnListParameters;
 struct gmx_wallclock_gpu_t;
 struct gmx_gpu_info_t;
-struct gmx_gpu_opt_t;
 
 /** Initializes the data structures related to GPU nonbonded calculations. */
 GPU_FUNC_QUALIFIER
 void nbnxn_gpu_init(gmx_nbnxn_gpu_t gmx_unused            **p_nb,
-                    const struct gmx_gpu_info_t gmx_unused *gpu_info,
-                    const struct gmx_gpu_opt_t gmx_unused  *gpu_opt,
+                    const gmx_device_info_t gmx_unused     *deviceInfo,
                     const interaction_const_t gmx_unused   *ic,
+                    const NbnxnListParameters gmx_unused   *listParams,
                     nonbonded_verlet_group_t gmx_unused    *nbv_grp,
-                    int gmx_unused                          my_gpu_index,
                     int gmx_unused                          rank,
                     /* true if both local and non-local are done on GPU */
                     gmx_bool gmx_unused                     bLocalAndNonlocal) GPU_FUNC_TERM
@@ -86,7 +85,8 @@ void nbnxn_gpu_init_atomdata(gmx_nbnxn_gpu_t gmx_unused               *nb,
  */
 GPU_FUNC_QUALIFIER
 void nbnxn_gpu_pme_loadbal_update_param(const struct nonbonded_verlet_t gmx_unused *nbv,
-                                        const interaction_const_t gmx_unused       *ic) GPU_FUNC_TERM
+                                        const interaction_const_t gmx_unused       *ic,
+                                        const NbnxnListParameters gmx_unused       *listParams) GPU_FUNC_TERM
 
 /** Uploads shift vector to the GPU if the box is dynamic (otherwise just returns). */
 GPU_FUNC_QUALIFIER
index 2727b06c9854e838b7068fe3ce686fee5ca32692..513d0c9e0845950fecd0db2162ee37cf5a0789fd 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,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.
@@ -65,11 +65,11 @@ struct gmx_domdec_zones_t;
 
 static void nbnxn_grid_init(nbnxn_grid_t * grid)
 {
-    grid->cxy_na      = NULL;
-    grid->cxy_ind     = NULL;
+    grid->cxy_na      = nullptr;
+    grid->cxy_ind     = nullptr;
     grid->cxy_nalloc  = 0;
-    grid->bb          = NULL;
-    grid->bbj         = NULL;
+    grid->bb          = nullptr;
+    grid->bbj         = nullptr;
     grid->nc_nalloc   = 0;
 }
 
@@ -505,8 +505,8 @@ static void calc_bounding_box_x_x8(int na, const real *x, nbnxn_bb_t *bb)
 }
 
 /* Packed coordinates, bb order xyz0 */
-static void calc_bounding_box_x_x4_halves(int na, const real *x,
-                                          nbnxn_bb_t *bb, nbnxn_bb_t *bbj)
+gmx_unused static void calc_bounding_box_x_x4_halves(int na, const real *x,
+                                                     nbnxn_bb_t *bb, nbnxn_bb_t *bbj)
 {
     // TODO: During SIMDv2 transition only some archs use namespace (remove when done)
     using namespace gmx;
@@ -1008,7 +1008,7 @@ static void sort_columns_simple(const nbnxn_search_t nbs,
 
             fill_cell(nbs, grid, nbat,
                       ash_c, ash_c+na_c, atinfo, x,
-                      NULL);
+                      nullptr);
 
             /* This copy to bbcz is not really necessary.
              * But it allows to use the same grid search code
@@ -1162,7 +1162,7 @@ static void calc_column_indices(nbnxn_grid_t *grid,
         /* Home zone */
         for (int i = n0; i < n1; i++)
         {
-            if (move == NULL || move[i] >= 0)
+            if (move == nullptr || move[i] >= 0)
             {
                 /* We need to be careful with rounding,
                  * particles might be a few bits outside the local zone.
@@ -1409,21 +1409,6 @@ static void calc_cell_indices(const nbnxn_search_t nbs,
     }
 }
 
-static void init_buffer_flags(nbnxn_buffer_flags_t *flags,
-                              int                   natoms)
-{
-    flags->nflag = (natoms + NBNXN_BUFFERFLAG_SIZE - 1)/NBNXN_BUFFERFLAG_SIZE;
-    if (flags->nflag > flags->flag_nalloc)
-    {
-        flags->flag_nalloc = over_alloc_large(flags->nflag);
-        srenew(flags->flag, flags->flag_nalloc);
-    }
-    for (int b = 0; b < flags->nflag; b++)
-    {
-        bitmask_clear(&(flags->flag[b]));
-    }
-}
-
 /* Sets up a grid and puts the atoms on the grid.
  * This function only operates on one domain of the domain decompostion.
  * Note that without domain decomposition there is only one domain.
@@ -1562,14 +1547,14 @@ void nbnxn_put_on_grid_nonlocal(nbnxn_search_t                   nbs,
             c1[d] = zones->size[zone].bb_x1[d];
         }
 
-        nbnxn_put_on_grid(nbs, nbs->ePBC, NULL,
+        nbnxn_put_on_grid(nbs, nbs->ePBC, nullptr,
                           zone, c0, c1,
                           zones->cg_range[zone],
                           zones->cg_range[zone+1],
                           -1,
                           atinfo,
                           x,
-                          0, NULL,
+                          0, nullptr,
                           nb_kernel_type,
                           nbat);
     }
index 6b51f14cec0b2d3a1a347b6e6f35b47616bc2a4b..625e595546651e78bac67a0e8781c8faf1ca9e12 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,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.
@@ -226,13 +226,6 @@ typedef void
                        int stride, const real *x,
                        nbnxn_list_work_t *work);
 
-static gmx_icell_set_x_t icell_set_x_simple;
-#if GMX_SIMD
-static gmx_icell_set_x_t icell_set_x_simple_simd_4xn;
-static gmx_icell_set_x_t icell_set_x_simple_simd_2xnn;
-#endif
-static gmx_icell_set_x_t icell_set_x_supersub;
-
 /* Local cycle count struct for profiling */
 typedef struct {
     int          count;
@@ -298,12 +291,12 @@ typedef struct nbnxn_search {
 } nbnxn_search_t_t;
 
 
-static void nbs_cycle_start(nbnxn_cycle_t *cc)
+static inline void nbs_cycle_start(nbnxn_cycle_t *cc)
 {
     cc->start = gmx_cycles_read();
 }
 
-static void nbs_cycle_stop(nbnxn_cycle_t *cc)
+static inline void nbs_cycle_stop(nbnxn_cycle_t *cc)
 {
     cc->c += gmx_cycles_read() - cc->start;
     cc->count++;
index 422cd8d5a8597f03c1da7ab35230c5e4c4014270..4edc4c2495684c1c87166ddafba07127f522b53d 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,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.
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
+/*! \internal \file
+ *
+ * \brief
+ * Declares the nbnxn pair interaction kernel function types and kind counts, also declares utility functions used in nbnxn_kernel.cpp.
+ *
+ * \author Berk Hess <hess@kth.se>
+ */
+
 #ifndef _nbnxn_kernel_common_h
 #define _nbnxn_kernel_common_h
 
 #include "gromacs/math/vectypes.h"
+/* nbnxn_atomdata_t and nbnxn_pairlist_t could be forward declared, but that requires modifications in all SIMD kernel files */
+#include "gromacs/mdlib/nbnxn_atomdata.h"
 #include "gromacs/mdlib/nbnxn_pairlist.h"
 #include "gromacs/utility/real.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-}
-#endif
+struct interaction_const_t;
 
-/* Clear the force buffer f. Either the whole buffer or only the parts
- * used by the current thread when nbat->bUseBufferFlags is set.
+/*! \brief Pair-interaction kernel type that also calculates energies.
+ */
+typedef void (nbk_func_ener)(const nbnxn_pairlist_t     *nbl,
+                             const nbnxn_atomdata_t     *nbat,
+                             const interaction_const_t  *ic,
+                             rvec                       *shift_vec,
+                             real                       *f,
+                             real                       *fshift,
+                             real                       *Vvdw,
+                             real                       *Vc);
+
+/*! \brief Pointer to \p nbk_func_ener.
+ */
+typedef nbk_func_ener *p_nbk_func_ener;
+
+/*! \brief Pair-interaction kernel type that does not calculates energies.
+ */
+typedef void (nbk_func_noener)(const nbnxn_pairlist_t     *nbl,
+                               const nbnxn_atomdata_t     *nbat,
+                               const interaction_const_t  *ic,
+                               rvec                       *shift_vec,
+                               real                       *f,
+                               real                       *fshift);
+
+/*! \brief Pointer to \p nbk_func_noener.
+ */
+typedef nbk_func_noener *p_nbk_func_noener;
+
+/*! \brief Kinds of electrostatic treatments in SIMD Verlet kernels
+ */
+enum {
+    coulktRF, coulktTAB, coulktTAB_TWIN, coulktEWALD, coulktEWALD_TWIN, coulktNR
+};
+
+/*! \brief Kinds of Van der Waals treatments in SIMD Verlet kernels
+ *
+ * The \p LJCUT_COMB refers to the LJ combination rule for the short range.
+ * The \p EWALDCOMB refers to the combination rule for the grid part.
+ * \p vdwktNR is the number of VdW treatments for the SIMD kernels.
+ * \p vdwktNR_ref is the number of VdW treatments for the C reference kernels.
+ * These two numbers differ, because currently only the reference kernels
+ * support LB combination rules for the LJ-Ewald grid part.
+ */
+enum {
+    vdwktLJCUT_COMBGEOM, vdwktLJCUT_COMBLB, vdwktLJCUT_COMBNONE, vdwktLJFORCESWITCH, vdwktLJPOTSWITCH, vdwktLJEWALDCOMBGEOM, vdwktLJEWALDCOMBLB, vdwktNR = vdwktLJEWALDCOMBLB, vdwktNR_ref
+};
+
+/*! \brief Clears the force buffer.
+ *
+ * Either the whole buffer is cleared or only the parts used
+ * by the current thread when nbat->bUseBufferFlags is set.
  * In the latter case output_index is the task/thread list/buffer index.
  */
 void
 clear_f(const nbnxn_atomdata_t *nbat, int output_index, real *f);
 
-/* Clear the shift forces */
+/*! \brief Clears the shift forces.
+ */
 void
 clear_fshift(real *fshift);
 
-/* Reduce the collected energy terms over the pair-lists/threads */
+/*! \brief Reduces the collected energy terms over the pair-lists/threads.
+ */
 void
 reduce_energies_over_lists(const nbnxn_atomdata_t     *nbat,
                            int                         nlist,
                            real                       *Vvdw,
                            real                       *Vc);
 
-#if 0
-{
-#endif
-#ifdef __cplusplus
-}
-#endif
-
 #endif
diff --git a/src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_cpu.cpp b/src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_cpu.cpp
new file mode 100644 (file)
index 0000000..cd9fbce
--- /dev/null
@@ -0,0 +1,413 @@
+/*
+ * 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
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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 "nbnxn_kernel_cpu.h"
+
+#include "gromacs/math/vectypes.h"
+#include "gromacs/mdlib/force_flags.h"
+#include "gromacs/mdlib/gmx_omp_nthreads.h"
+#include "gromacs/mdlib/nb_verlet.h"
+#include "gromacs/mdlib/nbnxn_consts.h"
+#include "gromacs/mdlib/nbnxn_simd.h"
+#include "gromacs/mdtypes/interaction_const.h"
+#include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/simd/simd.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/real.h"
+
+#include "nbnxn_kernel_common.h"
+#define INCLUDE_KERNELFUNCTION_TABLES
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref.h"
+#ifdef GMX_NBNXN_SIMD_2XNN
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
+#endif
+#ifdef GMX_NBNXN_SIMD_4XN
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
+#endif
+#undef INCLUDE_FUNCTION_TABLES
+
+/*! \brief Clears the energy group output buffers
+ *
+ * \param[in,out] out  nbnxn kernel output struct
+ */
+static void clearGroupEnergies(nbnxn_atomdata_output_t *out)
+{
+    for (int i = 0; i < out->nV; i++)
+    {
+        out->Vvdw[i] = 0;
+        out->Vc[i]   = 0;
+    }
+
+    for (int i = 0; i < out->nVS; i++)
+    {
+        out->VSvdw[i] = 0;
+    }
+    for (int i = 0; i < out->nVS; i++)
+    {
+        out->VSc[i] = 0;
+    }
+}
+
+/*! \brief Reduce the group-pair energy buffers produced by a SIMD kernel
+ * to single terms in the output buffers.
+ *
+ * The SIMD kernels produce a large number of energy buffer in SIMD registers
+ * to avoid scattered reads and writes.
+ *
+ * \tparam        unrollj         The unroll size for j-particles in the SIMD kernel
+ * \param[in]     numGroups       The number of energy groups
+ * \param[in]     numGroups_2log  Log2 of numGroups, rounded up
+ * \param[in]     vVdwSimd        SIMD Van der Waals energy buffers
+ * \param[in]     vCoulombSimd    SIMD Coulomb energy buffers
+ * \param[in,out] vVdw            Van der Waals energy output buffer
+ * \param[in,out] vCoulomb        Coulomb energy output buffer
+ */
+template <int unrollj> static void
+reduceGroupEnergySimdBuffers(int                       numGroups,
+                             int                       numGroups_2log,
+                             const real * gmx_restrict vVdwSimd,
+                             const real * gmx_restrict vCoulombSimd,
+                             real * gmx_restrict       vVdw,
+                             real * gmx_restrict       vCoulomb)
+{
+    // cppcheck-suppress duplicateExpression
+    const int unrollj_half     = unrollj/2;
+    /* Energies are stored in SIMD registers with size 2^numGroups_2log */
+    const int numGroupsStorage = (1 << numGroups_2log);
+
+    /* The size of the SIMD energy group buffer array is:
+     * numGroups*numGroups*numGroupsStorage*unrollj_half*simd_width
+     */
+    for (int i = 0; i < numGroups; i++)
+    {
+        for (int j1 = 0; j1 < numGroups; j1++)
+        {
+            for (int j0 = 0; j0 < numGroups; j0++)
+            {
+                int c = ((i*numGroups + j1)*numGroupsStorage + j0)*unrollj_half*unrollj;
+                for (int s = 0; s < unrollj_half; s++)
+                {
+                    vVdw    [i*numGroups + j0] += vVdwSimd    [c + 0];
+                    vVdw    [i*numGroups + j1] += vVdwSimd    [c + 1];
+                    vCoulomb[i*numGroups + j0] += vCoulombSimd[c + 0];
+                    vCoulomb[i*numGroups + j1] += vCoulombSimd[c + 1];
+                    c                          += unrollj + 2;
+                }
+            }
+        }
+    }
+}
+
+void
+nbnxn_kernel_cpu(nonbonded_verlet_group_t  *nbvg,
+                 const interaction_const_t *ic,
+                 rvec                      *shiftVectors,
+                 int                        forceFlags,
+                 int                        clearF,
+                 real                      *fshift,
+                 real                      *vCoulomb,
+                 real                      *vVdw)
+{
+    const nbnxn_atomdata_t  *nbat = nbvg->nbat;
+
+    int                      coulkt;
+    if (EEL_RF(ic->eeltype) || ic->eeltype == eelCUT)
+    {
+        coulkt = coulktRF;
+    }
+    else
+    {
+        if (nbvg->ewald_excl == ewaldexclTable)
+        {
+            if (ic->rcoulomb == ic->rvdw)
+            {
+                coulkt = coulktTAB;
+            }
+            else
+            {
+                coulkt = coulktTAB_TWIN;
+            }
+        }
+        else
+        {
+            if (ic->rcoulomb == ic->rvdw)
+            {
+                coulkt = coulktEWALD;
+            }
+            else
+            {
+                coulkt = coulktEWALD_TWIN;
+            }
+        }
+    }
+
+    int vdwkt = 0;
+    if (ic->vdwtype == evdwCUT)
+    {
+        switch (ic->vdw_modifier)
+        {
+            case eintmodNONE:
+            case eintmodPOTSHIFT:
+                switch (nbat->comb_rule)
+                {
+                    case ljcrGEOM: vdwkt = vdwktLJCUT_COMBGEOM; break;
+                    case ljcrLB:   vdwkt = vdwktLJCUT_COMBLB;   break;
+                    case ljcrNONE: vdwkt = vdwktLJCUT_COMBNONE; break;
+                    default:
+                        GMX_RELEASE_ASSERT(false, "Unknown combination rule");
+                }
+                break;
+            case eintmodFORCESWITCH:
+                vdwkt = vdwktLJFORCESWITCH;
+                break;
+            case eintmodPOTSWITCH:
+                vdwkt = vdwktLJPOTSWITCH;
+                break;
+            default:
+                GMX_RELEASE_ASSERT(false, "Unsupported VdW interaction modifier");
+        }
+    }
+    else if (ic->vdwtype == evdwPME)
+    {
+        if (ic->ljpme_comb_rule == eljpmeGEOM)
+        {
+            vdwkt = vdwktLJEWALDCOMBGEOM;
+        }
+        else
+        {
+            vdwkt = vdwktLJEWALDCOMBLB;
+            /* At setup we (should have) selected the C reference kernel */
+            GMX_RELEASE_ASSERT(nbvg->kernel_type == nbnxnk4x4_PlainC, "Only the C reference nbnxn SIMD kernel supports LJ-PME with LB combination rules");
+        }
+    }
+    else
+    {
+        GMX_RELEASE_ASSERT(false, "Unsupported VdW interaction type");
+    }
+
+    int                nnbl = nbvg->nbl_lists.nnbl;
+    nbnxn_pairlist_t **nbl  = nbvg->nbl_lists.nbl;
+
+    GMX_ASSERT(nbl[0]->nci >= 0, "nci<0, which signals an invalid pair-list");
+
+    // cppcheck-suppress unreadVariable
+    int gmx_unused nthreads = gmx_omp_nthreads_get(emntNonbonded);
+#pragma omp parallel for schedule(static) num_threads(nthreads)
+    for (int nb = 0; nb < nnbl; nb++)
+    {
+        // Presently, the kernels do not call C++ code that can throw,
+        // so no need for a try/catch pair in this OpenMP region.
+        nbnxn_atomdata_output_t *out = &nbat->out[nb];
+
+        if (clearF == enbvClearFYes)
+        {
+            clear_f(nbat, nb, out->f);
+        }
+
+        real *fshift_p;
+        if ((forceFlags & GMX_FORCE_VIRIAL) && nnbl == 1)
+        {
+            fshift_p = fshift;
+        }
+        else
+        {
+            fshift_p = out->fshift;
+
+            if (clearF == enbvClearFYes)
+            {
+                clear_fshift(fshift_p);
+            }
+        }
+
+        if (!(forceFlags & GMX_FORCE_ENERGY))
+        {
+            /* Don't calculate energies */
+            switch (nbvg->kernel_type)
+            {
+                case nbnxnk4x4_PlainC:
+                    nbnxn_kernel_noener_ref[coulkt][vdwkt](nbl[nb], nbat,
+                                                           ic,
+                                                           shiftVectors,
+                                                           out->f,
+                                                           fshift_p);
+                    break;
+#ifdef GMX_NBNXN_SIMD_2XNN
+                case nbnxnk4xN_SIMD_2xNN:
+                    nbnxn_kernel_noener_simd_2xnn[coulkt][vdwkt](nbl[nb], nbat,
+                                                                 ic,
+                                                                 shiftVectors,
+                                                                 out->f,
+                                                                 fshift_p);
+                    break;
+#endif
+#ifdef GMX_NBNXN_SIMD_4XN
+                case nbnxnk4xN_SIMD_4xN:
+                    nbnxn_kernel_noener_simd_4xn[coulkt][vdwkt](nbl[nb], nbat,
+                                                                ic,
+                                                                shiftVectors,
+                                                                out->f,
+                                                                fshift_p);
+                    break;
+#endif
+                default:
+                    GMX_RELEASE_ASSERT(false, "Unsupported kernel architecture");
+            }
+        }
+        else if (out->nV == 1)
+        {
+            /* A single energy group (pair) */
+            out->Vvdw[0] = 0;
+            out->Vc[0]   = 0;
+
+            switch (nbvg->kernel_type)
+            {
+                case nbnxnk4x4_PlainC:
+                    nbnxn_kernel_ener_ref[coulkt][vdwkt](nbl[nb], nbat,
+                                                         ic,
+                                                         shiftVectors,
+                                                         out->f,
+                                                         fshift_p,
+                                                         out->Vvdw,
+                                                         out->Vc);
+                    break;
+#ifdef GMX_NBNXN_SIMD_2XNN
+                case nbnxnk4xN_SIMD_2xNN:
+                    nbnxn_kernel_ener_simd_2xnn[coulkt][vdwkt](nbl[nb], nbat,
+                                                               ic,
+                                                               shiftVectors,
+                                                               out->f,
+                                                               fshift_p,
+                                                               out->Vvdw,
+                                                               out->Vc);
+                    break;
+#endif
+#ifdef GMX_NBNXN_SIMD_4XN
+                case nbnxnk4xN_SIMD_4xN:
+                    nbnxn_kernel_ener_simd_4xn[coulkt][vdwkt](nbl[nb], nbat,
+                                                              ic,
+                                                              shiftVectors,
+                                                              out->f,
+                                                              fshift_p,
+                                                              out->Vvdw,
+                                                              out->Vc);
+                    break;
+#endif
+                default:
+                    GMX_RELEASE_ASSERT(false, "Unsupported kernel architecture");
+            }
+        }
+        else
+        {
+            /* Calculate energy group contributions */
+            clearGroupEnergies(out);
+
+            int unrollj = 0;
+
+            switch (nbvg->kernel_type)
+            {
+                case nbnxnk4x4_PlainC:
+                    unrollj = NBNXN_CPU_CLUSTER_I_SIZE;
+                    nbnxn_kernel_energrp_ref[coulkt][vdwkt](nbl[nb], nbat,
+                                                            ic,
+                                                            shiftVectors,
+                                                            out->f,
+                                                            fshift_p,
+                                                            out->Vvdw,
+                                                            out->Vc);
+                    break;
+#ifdef GMX_NBNXN_SIMD_2XNN
+                case nbnxnk4xN_SIMD_2xNN:
+                    unrollj = GMX_SIMD_REAL_WIDTH/2;
+                    nbnxn_kernel_energrp_simd_2xnn[coulkt][vdwkt](nbl[nb], nbat,
+                                                                  ic,
+                                                                  shiftVectors,
+                                                                  out->f,
+                                                                  fshift_p,
+                                                                  out->VSvdw,
+                                                                  out->VSc);
+                    break;
+#endif
+#ifdef GMX_NBNXN_SIMD_4XN
+                case nbnxnk4xN_SIMD_4xN:
+                    unrollj = GMX_SIMD_REAL_WIDTH;
+                    nbnxn_kernel_energrp_simd_4xn[coulkt][vdwkt](nbl[nb], nbat,
+                                                                 ic,
+                                                                 shiftVectors,
+                                                                 out->f,
+                                                                 fshift_p,
+                                                                 out->VSvdw,
+                                                                 out->VSc);
+                    break;
+#endif
+                default:
+                    GMX_RELEASE_ASSERT(false, "Unsupported kernel architecture");
+            }
+
+            if (nbvg->kernel_type != nbnxnk4x4_PlainC)
+            {
+                switch (unrollj)
+                {
+                    case 2:
+                        reduceGroupEnergySimdBuffers<2>(nbat->nenergrp,
+                                                        nbat->neg_2log,
+                                                        out->VSvdw, out->VSc,
+                                                        out->Vvdw, out->Vc);
+                        break;
+                    case 4:
+                        reduceGroupEnergySimdBuffers<4>(nbat->nenergrp,
+                                                        nbat->neg_2log,
+                                                        out->VSvdw, out->VSc,
+                                                        out->Vvdw, out->Vc);
+                        break;
+                    case 8:
+                        reduceGroupEnergySimdBuffers<8>(nbat->nenergrp,
+                                                        nbat->neg_2log,
+                                                        out->VSvdw, out->VSc,
+                                                        out->Vvdw, out->Vc);
+                        break;
+                    default:
+                        GMX_RELEASE_ASSERT(false, "Unsupported j-unroll size");
+                }
+            }
+        }
+    }
+
+    if (forceFlags & GMX_FORCE_ENERGY)
+    {
+        reduce_energies_over_lists(nbat, nnbl, vVdw, vCoulomb);
+    }
+}
diff --git a/src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_cpu.h b/src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_cpu.h
new file mode 100644 (file)
index 0000000..43bcbb7
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+
+/*! \libinternal \file
+ *
+ * \brief
+ * Declares the nbnxn pair interaction kernel dispatcher.
+ *
+ * \author Berk Hess <hess@kth.se>
+ */
+
+#ifndef _nbnxn_kernel_cpu_h
+#define _nbnxn_kernel_cpu_h
+
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/real.h"
+
+struct interaction_const_t;
+struct nonbonded_verlet_group_t;
+
+/*! \brief Dispatches the non-bonded N versus M atom cluster CPU kernels.
+ *
+ * OpenMP parallelization is performed within this function.
+ * Energy reduction, but not force and shift force reduction, is performed
+ * within this function.
+ *
+ * \param[in,out] nbvg          The group (local/non-local) to compute interaction for
+ * \param[in]     ic            Non-bonded interaction constants
+ * \param[in]     shiftVectors  The PBC shift vectors
+ * \param[in]     forceFlags    Flags that tell what to compute
+ * \param[in]     clearF        Enum that tells if to clear the force output buffer
+ * \param[out]    fshift        Shift force output buffer
+ * \param[out]    vCoulomb      Output buffer for Coulomb energies
+ * \param[out]    vVdw          Output buffer for Van der Waals energies
+ */
+void
+nbnxn_kernel_cpu(nonbonded_verlet_group_t  *nbvg,
+                 const interaction_const_t *ic,
+                 rvec                      *shiftVectors,
+                 int                        forceFlags,
+                 int                        clearF,
+                 real                      *fshift,
+                 real                      *vCoulomb,
+                 real                      *vVdw);
+
+#endif
index 0b541e752d20174f60e5fcac29b69464d81d1038..333018a3febddec36c24e4a6164b4123071780e1 100755 (executable)
@@ -2,7 +2,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,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.
 # are:
 #
 #   A single header file that declares all the kernel functions for
-#   this nbnxn kernel structure type, including the function that does
-#   the dispatch via the function pointer table.
-#
-#   A single C kernel dispatcher file that defines the function that
-#   decides at run time which kernel to call.
+#   this nbnxn kernel structure type and a function pointer table.
 #
 #   Many C kernel files, each defining a single kernel function. These
 #   functions can take a noticeable time to compile, and should tend
@@ -151,13 +147,11 @@ VerletKernelTypeDict = {
     },
 }
 
-KernelDispatcherTemplate = read_kernel_template("nbnxn_kernel_simd_template.cpp.pre")
 KernelsHeaderTemplate = read_kernel_template("nbnxn_kernel_simd_template.h.pre")
 
-# For each Verlet kernel type, write three kinds of files:
-#   a header file defining the functions for all the kernels,
-#   a code file containing the kernel function lookup table and
-#     the kernel dispatcher function
+# For each Verlet kernel type, write two kinds of files:
+#   a header file defining the functions for all the kernels and
+#     the kernel function lookup table
 #   for each kernel, a file defining the single C function for that kernel
 for type in VerletKernelTypeDict:
     DirName = "../simd_{0}".format(type)
@@ -210,26 +204,11 @@ for type in VerletKernelTypeDict:
     with open('{0}/{1}'.format(DirName,KernelsHeaderFileName),'w') as fp:
         fp.write(FileHeader.format(type))
         fp.write(KernelsHeaderTemplate
-                 .format(KernelsName,
-                         " " * (len(KernelsName) + 1),
-                         KernelDeclarations))
-
-    # Write the file defining the kernel dispatcher
-    # function for this type
-    with open('{0}/{1}'.format(DirName,"{0}.cpp".format(KernelsName,type)),'w') as fp:
-        fp.write(FileHeader.format(type))
-        fp.write(KernelDispatcherTemplate
-                 .format(VerletKernelTypeDict[type]['Define'],
-                         VerletKernelTypeDict[type]['WidthSetup'],
-                         VerletKernelTypeDict[type]['WidthCheck'],
-                         VerletKernelTypeDict[type]['UnrollSize'],
-                         KernelsHeaderFileName,
-                         KernelsName,
-                         ' ' * (len(KernelsName)+1),
+                 .format(KernelDeclarations,
+                         type,
                          KernelFunctionLookupTable['F'],
                          KernelFunctionLookupTable['VF'],
-                         KernelFunctionLookupTable['VgrpF'],
-                     )
+                         KernelFunctionLookupTable['VgrpF'])
              )
 
 sys.exit()
diff --git a/src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_file_generator/nbnxn_kernel_simd_template.cpp.pre b/src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_file_generator/nbnxn_kernel_simd_template.cpp.pre
deleted file mode 100644 (file)
index 7c412dc..0000000
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,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.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include "gromacs/math/vectypes.h"
-#include "gromacs/mdlib/nb_verlet.h"
-#include "gromacs/mdlib/nbnxn_simd.h"
-#include "gromacs/mdtypes/interaction_const.h"
-#include "gromacs/mdtypes/md_enums.h"
-
-#ifdef {0}
-
-{1}#include "gromacs/simd/vector_operations.h"
-
-{2}
-#define GMX_SIMD_J_UNROLL_SIZE {3}
-#include "{4}"
-
-#include "gromacs/mdlib/force_flags.h"
-#include "gromacs/mdlib/gmx_omp_nthreads.h"
-#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_common.h"
-#include "gromacs/simd/simd.h"
-#include "gromacs/utility/fatalerror.h"
-#include "gromacs/utility/real.h"
-
-/*! \brief Kinds of electrostatic treatments in SIMD Verlet kernels
- */
-enum {{
-    coulktRF, coulktTAB, coulktTAB_TWIN, coulktEWALD, coulktEWALD_TWIN, coulktNR
-}};
-
-/*! \brief Kinds of Van der Waals treatments in SIMD Verlet kernels
- */
-enum {{
-    vdwktLJCUT_COMBGEOM, vdwktLJCUT_COMBLB, vdwktLJCUT_COMBNONE, vdwktLJFORCESWITCH, vdwktLJPOTSWITCH, vdwktLJEWALDCOMBGEOM, vdwktNR
-}};
-
-/* Declare and define the kernel function pointer lookup tables.
- * The minor index of the array goes over both the LJ combination rules,
- * which is only supported by plain cut-off, and the LJ switch/PME functions.
- */
-static p_nbk_func_noener p_nbk_noener[coulktNR][vdwktNR] =
-{7}
-static p_nbk_func_ener p_nbk_ener[coulktNR][vdwktNR] =
-{8}
-static p_nbk_func_ener p_nbk_energrp[coulktNR][vdwktNR] =
-{9}
-
-static void
-reduce_group_energies(int ng, int ng_2log,
-                      const real *VSvdw, const real *VSc,
-                      real *Vvdw, real *Vc)
-{{
-    const int unrollj      = GMX_SIMD_REAL_WIDTH/GMX_SIMD_J_UNROLL_SIZE;
-    const int unrollj_half = unrollj/2;
-    int       ng_p2, i, j, j0, j1, c, s;
-
-    ng_p2 = (1<<ng_2log);
-
-    /* The size of the x86 SIMD energy group buffer array is:
-     * ng*ng*ng_p2*unrollj_half*simd_width
-     */
-    for (i = 0; i < ng; i++)
-    {{
-        for (j = 0; j < ng; j++)
-        {{
-            Vvdw[i*ng+j] = 0;
-            Vc[i*ng+j]   = 0;
-        }}
-
-        for (j1 = 0; j1 < ng; j1++)
-        {{
-            for (j0 = 0; j0 < ng; j0++)
-            {{
-                c = ((i*ng + j1)*ng_p2 + j0)*unrollj_half*unrollj;
-                for (s = 0; s < unrollj_half; s++)
-                {{
-                    Vvdw[i*ng+j0] += VSvdw[c+0];
-                    Vvdw[i*ng+j1] += VSvdw[c+1];
-                    Vc  [i*ng+j0] += VSc  [c+0];
-                    Vc  [i*ng+j1] += VSc  [c+1];
-                    c             += unrollj + 2;
-                }}
-            }}
-        }}
-    }}
-}}
-
-#else /* {0} */
-
-#include "gromacs/utility/fatalerror.h"
-
-#endif /* {0} */
-
-void
-{5}(nbnxn_pairlist_set_t      gmx_unused *nbl_list,
-{6}const nbnxn_atomdata_t    gmx_unused *nbat,
-{6}const interaction_const_t gmx_unused *ic,
-{6}int                       gmx_unused  ewald_excl,
-{6}rvec                      gmx_unused *shift_vec,
-{6}int                       gmx_unused  force_flags,
-{6}int                       gmx_unused  clearF,
-{6}real                      gmx_unused *fshift,
-{6}real                      gmx_unused *Vc,
-{6}real                      gmx_unused *Vvdw)
-#ifdef {0}
-{{
-    int                nnbl;
-    nbnxn_pairlist_t **nbl;
-    int                coulkt, vdwkt = 0;
-    int                nb, nthreads;
-
-    nnbl = nbl_list->nnbl;
-    nbl  = nbl_list->nbl;
-
-    if (EEL_RF(ic->eeltype) || ic->eeltype == eelCUT)
-    {{
-        coulkt = coulktRF;
-    }}
-    else
-    {{
-        if (ewald_excl == ewaldexclTable)
-        {{
-            if (ic->rcoulomb == ic->rvdw)
-            {{
-                coulkt = coulktTAB;
-            }}
-            else
-            {{
-                coulkt = coulktTAB_TWIN;
-            }}
-        }}
-        else
-        {{
-            if (ic->rcoulomb == ic->rvdw)
-            {{
-                coulkt = coulktEWALD;
-            }}
-            else
-            {{
-                coulkt = coulktEWALD_TWIN;
-            }}
-        }}
-    }}
-
-    if (ic->vdwtype == evdwCUT)
-    {{
-        switch (ic->vdw_modifier)
-        {{
-            case eintmodNONE:
-            case eintmodPOTSHIFT:
-                switch (nbat->comb_rule)
-                {{
-                    case ljcrGEOM: vdwkt = vdwktLJCUT_COMBGEOM; break;
-                    case ljcrLB:   vdwkt = vdwktLJCUT_COMBLB;   break;
-                    case ljcrNONE: vdwkt = vdwktLJCUT_COMBNONE; break;
-                    default:       gmx_incons("Unknown combination rule");
-                }}
-                break;
-            case eintmodFORCESWITCH:
-                vdwkt = vdwktLJFORCESWITCH;
-                break;
-            case eintmodPOTSWITCH:
-                vdwkt = vdwktLJPOTSWITCH;
-                break;
-            default:
-                gmx_incons("Unsupported VdW interaction modifier");
-        }}
-    }}
-    else if (ic->vdwtype == evdwPME)
-    {{
-        if (ic->ljpme_comb_rule == eljpmeLB)
-        {{
-            gmx_incons("The nbnxn SIMD kernels don't support LJ-PME with LB");
-        }}
-        vdwkt = vdwktLJEWALDCOMBGEOM;
-    }}
-    else
-    {{
-        gmx_incons("Unsupported VdW interaction type");
-    }}
-    // cppcheck-suppress unreadVariable
-    nthreads = gmx_omp_nthreads_get(emntNonbonded);
-#pragma omp parallel for schedule(static) num_threads(nthreads)
-    for (nb = 0; nb < nnbl; nb++)
-    {{
-        // Presently, the kernels do not call C++ code that can throw, so
-        // no need for a try/catch pair in this OpenMP region.
-        nbnxn_atomdata_output_t *out;
-        real                    *fshift_p;
-
-        out = &nbat->out[nb];
-
-        if (clearF == enbvClearFYes)
-        {{
-            clear_f(nbat, nb, out->f);
-        }}
-
-        if ((force_flags & GMX_FORCE_VIRIAL) && nnbl == 1)
-        {{
-            fshift_p = fshift;
-        }}
-        else
-        {{
-            fshift_p = out->fshift;
-
-            if (clearF == enbvClearFYes)
-            {{
-                clear_fshift(fshift_p);
-            }}
-        }}
-
-        if (!(force_flags & GMX_FORCE_ENERGY))
-        {{
-            /* Don't calculate energies */
-            p_nbk_noener[coulkt][vdwkt](nbl[nb], nbat,
-                                        ic,
-                                        shift_vec,
-                                        out->f,
-                                        fshift_p);
-        }}
-        else if (out->nV == 1)
-        {{
-            /* No energy groups */
-            out->Vvdw[0] = 0;
-            out->Vc[0]   = 0;
-
-            p_nbk_ener[coulkt][vdwkt](nbl[nb], nbat,
-                                      ic,
-                                      shift_vec,
-                                      out->f,
-                                      fshift_p,
-                                      out->Vvdw,
-                                      out->Vc);
-        }}
-        else
-        {{
-            /* Calculate energy group contributions */
-            int i;
-
-            for (i = 0; i < out->nVS; i++)
-            {{
-                out->VSvdw[i] = 0;
-            }}
-            for (i = 0; i < out->nVS; i++)
-            {{
-                out->VSc[i] = 0;
-            }}
-
-            p_nbk_energrp[coulkt][vdwkt](nbl[nb], nbat,
-                                         ic,
-                                         shift_vec,
-                                         out->f,
-                                         fshift_p,
-                                         out->VSvdw,
-                                         out->VSc);
-
-            reduce_group_energies(nbat->nenergrp, nbat->neg_2log,
-                                  out->VSvdw, out->VSc,
-                                  out->Vvdw, out->Vc);
-        }}
-    }}
-
-    if (force_flags & GMX_FORCE_ENERGY)
-    {{
-        reduce_energies_over_lists(nbat, nnbl, Vvdw, Vc);
-    }}
-}}
-#else
-{{
-    gmx_incons("{5} called when such kernels "
-               " are not enabled.");
-}}
-#endif
-#undef GMX_SIMD_J_UNROLL_SIZE
index 40ac05818008886bb4a949abe1726e185ef12745..eab6de081bc4c21361ab4b9c5ac32c35c6acb5f6 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,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.
  * 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 "gromacs/math/vectypes.h"
-#include "gromacs/mdlib/nbnxn_pairlist.h"
-#include "gromacs/mdtypes/interaction_const.h"
-#include "gromacs/utility/real.h"
 
-/*! \brief Run-time dispatcher for nbnxn kernel functions. */
-void
-{0}(nbnxn_pairlist_set_t       *nbl_list,
-{1}const nbnxn_atomdata_t     *nbat,
-{1}const interaction_const_t  *ic,
-{1}int                         ewald_excl,
-{1}rvec                       *shift_vec,
-{1}int                         force_flags,
-{1}int                         clearF,
-{1}real                       *fshift,
-{1}real                       *Vc,
-{1}real                       *Vvdw);
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_common.h"
 
-/* Need an #include guard so that sim_util.c can include all
- * such files. */
-#ifndef _nbnxn_kernel_simd_include_h
-#define _nbnxn_kernel_simd_include_h
-/*! \brief Typedefs for declaring kernel functions. */
-typedef void (nbk_func_ener)(const nbnxn_pairlist_t     *nbl,
-                             const nbnxn_atomdata_t     *nbat,
-                             const interaction_const_t  *ic,
-                             rvec                       *shift_vec,
-                             real                       *f,
-                             real                       *fshift,
-                             real                       *Vvdw,
-                             real                       *Vc);
-typedef nbk_func_ener *p_nbk_func_ener;
+/* Declare all the different kernel functions.
+ */
+{0}
 
-typedef void (nbk_func_noener)(const nbnxn_pairlist_t     *nbl,
-                               const nbnxn_atomdata_t     *nbat,
-                               const interaction_const_t  *ic,
-                               rvec                       *shift_vec,
-                               real                       *f,
-                               real                       *fshift);
-typedef nbk_func_noener *p_nbk_func_noener;
-#endif
+#ifdef INCLUDE_KERNELFUNCTION_TABLES
 
+/* Declare and define the kernel function pointer lookup tables.
+ * The minor index of the array goes over both the LJ combination rules,
+ * which is only supported by plain cut-off, and the LJ switch/PME functions.
+ */
+p_nbk_func_noener nbnxn_kernel_noener_simd_{1}[coulktNR][vdwktNR] =
 {2}
+p_nbk_func_ener nbnxn_kernel_ener_simd_{1}[coulktNR][vdwktNR] =
+{3}
+p_nbk_func_ener nbnxn_kernel_energrp_simd_{1}[coulktNR][vdwktNR] =
+{4}
+
+#endif /* INCLUDE_KERNELFUNCTION_TABLES */
index 92946aeea5a130fd80765f7af7cacc5632703ab3..309d9a33e421e947944cf81a9e6697bc31d26853 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,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.
 #include "gromacs/mdlib/force.h"
 #include "gromacs/mdlib/nb_verlet.h"
 #include "gromacs/mdlib/nbnxn_consts.h"
-#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_common.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/pbcutil/ishift.h"
 #include "gromacs/utility/fatalerror.h"
 
+#include "nbnxn_kernel_common.h"
+
 static const int c_numClPerSupercl = c_nbnxnGpuNumClusterPerSupercluster;
 static const int c_clSize          = c_nbnxnGpuClusterSize;
 
@@ -72,7 +73,7 @@ nbnxn_kernel_gpu_ref(const nbnxn_pairlist_t     *nbl,
     const real         *x;
     gmx_bool            bEner;
     gmx_bool            bEwald;
-    const real         *Ftab = NULL;
+    const real         *Ftab = nullptr;
     real                rcut2, rvdw2, rlist2;
     int                 ntype;
     real                facel;
diff --git a/src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_prune.cpp b/src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_prune.cpp
new file mode 100644 (file)
index 0000000..aefeafc
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+
+#include "gmxpre.h"
+
+#include "nbnxn_kernel_prune.h"
+
+#include "gromacs/mdlib/gmx_omp_nthreads.h"
+#include "gromacs/mdlib/nb_verlet.h"
+#include "gromacs/mdlib/nbnxn_pairlist.h"
+#include "gromacs/utility/gmxassert.h"
+
+#include "nbnxn_kernel_ref_prune.h"
+#include "simd_2xnn/nbnxn_kernel_simd_2xnn_prune.h"
+#include "simd_4xn/nbnxn_kernel_simd_4xn_prune.h"
+
+
+void nbnxn_kernel_cpu_prune(nonbonded_verlet_group_t *nbvg,
+                            const rvec               *shift_vec,
+                            real                      rlistInner)
+{
+    nbnxn_pairlist_set_t   *nbl_lists = &nbvg->nbl_lists;
+    const nbnxn_atomdata_t *nbat      = nbvg->nbat;
+
+    GMX_ASSERT(nbl_lists->nbl[0]->nciOuter >= 0, "nciOuter<0, which signals an invalid pair-list");
+
+    // cppcheck-suppress unreadVariable
+    int gmx_unused nthreads = gmx_omp_nthreads_get(emntNonbonded);
+#pragma omp parallel for schedule(static) num_threads(nthreads)
+    for (int i = 0; i < nbl_lists->nnbl; i++)
+    {
+        nbnxn_pairlist_t *nbl = nbl_lists->nbl[i];
+
+        switch (nbvg->kernel_type)
+        {
+            case nbnxnk4xN_SIMD_4xN:
+                nbnxn_kernel_prune_4xn(nbl, nbat, shift_vec, rlistInner);
+                break;
+            case nbnxnk4xN_SIMD_2xNN:
+                nbnxn_kernel_prune_2xnn(nbl, nbat, shift_vec, rlistInner);
+                break;
+            case nbnxnk4x4_PlainC:
+                nbnxn_kernel_prune_ref(nbl, nbat, shift_vec, rlistInner);
+                break;
+            default:
+                GMX_RELEASE_ASSERT(false, "kernel type not handled (yet)");
+        }
+    }
+}
diff --git a/src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_prune.h b/src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_prune.h
new file mode 100644 (file)
index 0000000..ac6161e
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+
+/*! \libinternal \file
+ *
+ * \brief
+ * Declares the pair-list pruning kernel wrapper function.
+ *
+ * The wrapper function internally performs the OpenMP parallelization
+ * and calls the selected kernel flavor (different SIMD types / C reference).
+ *
+ * \author Berk Hess <hess@kth.se>
+ */
+
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/real.h"
+
+struct nonbonded_verlet_group_t;
+
+/*! \brief Prune all pair-lists in the set with distance \p rlistInner
+ *
+ * For all pair-lists in the set takes the outer list and prunes out
+ * pairs beyond \p rlistInner and writes the result to a list that is
+ * to be consumed by the non-bonded kernel.
+ */
+void nbnxn_kernel_cpu_prune(nonbonded_verlet_group_t  *nbvg,
+                            const rvec                *shift_vec,
+                            real                       rlistInner);
index fe8d744083284b7f28c432e5c4bc832fe2c97b60..cc13cbc67abbaff0cf8f153922d4da96267ffb41 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,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.
 #include "gromacs/mdlib/gmx_omp_nthreads.h"
 #include "gromacs/mdlib/nb_verlet.h"
 #include "gromacs/mdlib/nbnxn_consts.h"
-#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_common.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/pbcutil/ishift.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
-/*! \brief Typedefs for declaring lookup tables of kernel functions.
- */
-
-typedef void (*p_nbk_func_noener)(const nbnxn_pairlist_t     *nbl,
-                                  const nbnxn_atomdata_t     *nbat,
-                                  const interaction_const_t  *ic,
-                                  rvec                       *shift_vec,
-                                  real                       *f,
-                                  real                       *fshift);
-
-typedef void (*p_nbk_func_ener)(const nbnxn_pairlist_t     *nbl,
-                                const nbnxn_atomdata_t     *nbat,
-                                const interaction_const_t  *ic,
-                                rvec                       *shift_vec,
-                                real                       *f,
-                                real                       *fshift,
-                                real                       *Vvdw,
-                                real                       *Vc);
 
 /* Analytical reaction-field kernels */
 #define CALC_COUL_RF
@@ -143,191 +124,3 @@ typedef void (*p_nbk_func_ener)(const nbnxn_pairlist_t     *nbl,
 #undef LJ_EWALD
 #undef VDW_CUTOFF_CHECK
 #undef CALC_COUL_TAB
-
-
-enum {
-    coultRF, coultTAB, coultTAB_TWIN, coultNR
-};
-
-enum {
-    vdwtCUT, vdwtFSWITCH, vdwtPSWITCH, vdwtEWALDGEOM, vdwtEWALDLB, vdwtNR
-};
-
-p_nbk_func_noener p_nbk_c_noener[coultNR][vdwtNR] =
-{
-    { nbnxn_kernel_ElecRF_VdwLJ_F_ref,           nbnxn_kernel_ElecRF_VdwLJFsw_F_ref,           nbnxn_kernel_ElecRF_VdwLJPsw_F_ref,           nbnxn_kernel_ElecRF_VdwLJEwCombGeom_F_ref,           nbnxn_kernel_ElecRF_VdwLJEwCombLB_F_ref           },
-    { nbnxn_kernel_ElecQSTab_VdwLJ_F_ref,        nbnxn_kernel_ElecQSTab_VdwLJFsw_F_ref,        nbnxn_kernel_ElecQSTab_VdwLJPsw_F_ref,        nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_F_ref,        nbnxn_kernel_ElecQSTab_VdwLJEwCombLB_F_ref        },
-    { nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_ref, nbnxn_kernel_ElecQSTabTwinCut_VdwLJFsw_F_ref, nbnxn_kernel_ElecQSTabTwinCut_VdwLJPsw_F_ref, nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_F_ref, nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombLB_F_ref }
-};
-
-p_nbk_func_ener p_nbk_c_ener[coultNR][vdwtNR] =
-{
-    { nbnxn_kernel_ElecRF_VdwLJ_VF_ref,           nbnxn_kernel_ElecRF_VdwLJFsw_VF_ref,           nbnxn_kernel_ElecRF_VdwLJPsw_VF_ref,           nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VF_ref,           nbnxn_kernel_ElecRF_VdwLJEwCombLB_VF_ref            },
-    { nbnxn_kernel_ElecQSTab_VdwLJ_VF_ref,        nbnxn_kernel_ElecQSTab_VdwLJFsw_VF_ref,        nbnxn_kernel_ElecQSTab_VdwLJPsw_VF_ref,        nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VF_ref,        nbnxn_kernel_ElecQSTab_VdwLJEwCombLB_VF_ref         },
-    { nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_ref, nbnxn_kernel_ElecQSTabTwinCut_VdwLJFsw_VF_ref, nbnxn_kernel_ElecQSTabTwinCut_VdwLJPsw_VF_ref, nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VF_ref, nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombLB_VF_ref  }
-};
-
-p_nbk_func_ener p_nbk_c_energrp[coultNR][vdwtNR] =
-{
-    { nbnxn_kernel_ElecRF_VdwLJ_VgrpF_ref,           nbnxn_kernel_ElecRF_VdwLJFsw_VgrpF_ref,           nbnxn_kernel_ElecRF_VdwLJPsw_VgrpF_ref,           nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VgrpF_ref,           nbnxn_kernel_ElecRF_VdwLJEwCombLB_VgrpF_ref           },
-    { nbnxn_kernel_ElecQSTab_VdwLJ_VgrpF_ref,        nbnxn_kernel_ElecQSTab_VdwLJFsw_VgrpF_ref,        nbnxn_kernel_ElecQSTab_VdwLJPsw_VgrpF_ref,        nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VgrpF_ref,        nbnxn_kernel_ElecQSTab_VdwLJEwCombLB_VgrpF_ref        },
-    { nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_ref, nbnxn_kernel_ElecQSTabTwinCut_VdwLJFsw_VgrpF_ref, nbnxn_kernel_ElecQSTabTwinCut_VdwLJPsw_VgrpF_ref, nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VgrpF_ref, nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombLB_VgrpF_ref }
-};
-
-void
-nbnxn_kernel_ref(const nbnxn_pairlist_set_t *nbl_list,
-                 const nbnxn_atomdata_t     *nbat,
-                 const interaction_const_t  *ic,
-                 rvec                       *shift_vec,
-                 int                         force_flags,
-                 int                         clearF,
-                 real                       *fshift,
-                 real                       *Vc,
-                 real                       *Vvdw)
-{
-    int                nnbl;
-    nbnxn_pairlist_t **nbl;
-    int                coult;
-    int                vdwt;
-    int                nb;
-    int                nthreads gmx_unused;
-
-    nnbl = nbl_list->nnbl;
-    nbl  = nbl_list->nbl;
-
-    if (EEL_RF(ic->eeltype) || ic->eeltype == eelCUT)
-    {
-        coult = coultRF;
-    }
-    else
-    {
-        if (ic->rcoulomb == ic->rvdw)
-        {
-            coult = coultTAB;
-        }
-        else
-        {
-            coult = coultTAB_TWIN;
-        }
-    }
-
-    if (ic->vdwtype == evdwCUT)
-    {
-        switch (ic->vdw_modifier)
-        {
-            case eintmodPOTSHIFT:
-            case eintmodNONE:
-                vdwt = vdwtCUT;
-                break;
-            case eintmodFORCESWITCH:
-                vdwt = vdwtFSWITCH;
-                break;
-            case eintmodPOTSWITCH:
-                vdwt = vdwtPSWITCH;
-                break;
-            default:
-                gmx_incons("Unsupported VdW modifier");
-                break;
-        }
-    }
-    else if (ic->vdwtype == evdwPME)
-    {
-        if (ic->ljpme_comb_rule == ljcrGEOM)
-        {
-            assert(nbat->comb_rule == ljcrGEOM);
-            vdwt = vdwtEWALDGEOM;
-        }
-        else
-        {
-            assert(nbat->comb_rule == ljcrLB);
-            vdwt = vdwtEWALDLB;
-        }
-    }
-    else
-    {
-        gmx_incons("Unsupported vdwtype in nbnxn reference kernel");
-    }
-
-    // cppcheck-suppress unreadVariable
-    nthreads = gmx_omp_nthreads_get(emntNonbonded);
-#pragma omp parallel for schedule(static) num_threads(nthreads)
-    for (nb = 0; nb < nnbl; nb++)
-    {
-        // Presently, the kernels do not call C++ code that can throw, so
-        // no need for a try/catch pair in this OpenMP region.
-        nbnxn_atomdata_output_t *out;
-        real                    *fshift_p;
-
-        out = &nbat->out[nb];
-
-        if (clearF == enbvClearFYes)
-        {
-            clear_f(nbat, nb, out->f);
-        }
-
-        if ((force_flags & GMX_FORCE_VIRIAL) && nnbl == 1)
-        {
-            fshift_p = fshift;
-        }
-        else
-        {
-            fshift_p = out->fshift;
-
-            if (clearF == enbvClearFYes)
-            {
-                clear_fshift(fshift_p);
-            }
-        }
-
-        if (!(force_flags & GMX_FORCE_ENERGY))
-        {
-            /* Don't calculate energies */
-            p_nbk_c_noener[coult][vdwt](nbl[nb], nbat,
-                                        ic,
-                                        shift_vec,
-                                        out->f,
-                                        fshift_p);
-        }
-        else if (out->nV == 1)
-        {
-            /* No energy groups */
-            out->Vvdw[0] = 0;
-            out->Vc[0]   = 0;
-
-            p_nbk_c_ener[coult][vdwt](nbl[nb], nbat,
-                                      ic,
-                                      shift_vec,
-                                      out->f,
-                                      fshift_p,
-                                      out->Vvdw,
-                                      out->Vc);
-        }
-        else
-        {
-            /* Calculate energy group contributions */
-            int i;
-
-            for (i = 0; i < out->nV; i++)
-            {
-                out->Vvdw[i] = 0;
-            }
-            for (i = 0; i < out->nV; i++)
-            {
-                out->Vc[i] = 0;
-            }
-
-            p_nbk_c_energrp[coult][vdwt](nbl[nb], nbat,
-                                         ic,
-                                         shift_vec,
-                                         out->f,
-                                         fshift_p,
-                                         out->Vvdw,
-                                         out->Vc);
-        }
-    }
-
-    if (force_flags & GMX_FORCE_ENERGY)
-    {
-        reduce_energies_over_lists(nbat, nnbl, Vvdw, Vc);
-    }
-}
index 184f0a424c8a3ff35cf1ca8a48302ed3637994c2..39d53e74c50dcd4b2d23a71f557f65a3230a1377 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,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.
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifndef _nbnxn_kernel_ref_h
-#define _nbnxn_kernel_ref_h
+#include "nbnxn_kernel_common.h"
 
-#include "gromacs/math/vectypes.h"
-#include "gromacs/mdlib/nbnxn_pairlist.h"
-#include "gromacs/mdtypes/forcerec.h"
-#include "gromacs/utility/real.h"
+/* Declare all the different kernel functions.
+ */
+nbk_func_noener nbnxn_kernel_ElecRF_VdwLJ_F_ref;
+nbk_func_noener nbnxn_kernel_ElecRF_VdwLJFsw_F_ref;
+nbk_func_noener nbnxn_kernel_ElecRF_VdwLJPsw_F_ref;
+nbk_func_noener nbnxn_kernel_ElecRF_VdwLJEwCombGeom_F_ref;
+nbk_func_noener nbnxn_kernel_ElecRF_VdwLJEwCombLB_F_ref;
+nbk_func_noener nbnxn_kernel_ElecQSTab_VdwLJ_F_ref;
+nbk_func_noener nbnxn_kernel_ElecQSTab_VdwLJFsw_F_ref;
+nbk_func_noener nbnxn_kernel_ElecQSTab_VdwLJPsw_F_ref;
+nbk_func_noener nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_F_ref;
+nbk_func_noener nbnxn_kernel_ElecQSTab_VdwLJEwCombLB_F_ref;
+nbk_func_noener nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_ref;
+nbk_func_noener nbnxn_kernel_ElecQSTabTwinCut_VdwLJFsw_F_ref;
+nbk_func_noener nbnxn_kernel_ElecQSTabTwinCut_VdwLJPsw_F_ref;
+nbk_func_noener nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_F_ref;
+nbk_func_noener nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombLB_F_ref;
+
+nbk_func_ener   nbnxn_kernel_ElecRF_VdwLJ_VF_ref;
+nbk_func_ener   nbnxn_kernel_ElecRF_VdwLJFsw_VF_ref;
+nbk_func_ener   nbnxn_kernel_ElecRF_VdwLJPsw_VF_ref;
+nbk_func_ener   nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VF_ref;
+nbk_func_ener   nbnxn_kernel_ElecRF_VdwLJEwCombLB_VF_ref;
+nbk_func_ener   nbnxn_kernel_ElecQSTab_VdwLJ_VF_ref;
+nbk_func_ener   nbnxn_kernel_ElecQSTab_VdwLJFsw_VF_ref;
+nbk_func_ener   nbnxn_kernel_ElecQSTab_VdwLJPsw_VF_ref;
+nbk_func_ener   nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VF_ref;
+nbk_func_ener   nbnxn_kernel_ElecQSTab_VdwLJEwCombLB_VF_ref;
+nbk_func_ener   nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_ref;
+nbk_func_ener   nbnxn_kernel_ElecQSTabTwinCut_VdwLJFsw_VF_ref;
+nbk_func_ener   nbnxn_kernel_ElecQSTabTwinCut_VdwLJPsw_VF_ref;
+nbk_func_ener   nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VF_ref;
+nbk_func_ener   nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombLB_VF_ref;
+
+nbk_func_ener   nbnxn_kernel_ElecRF_VdwLJ_VgrpF_ref;
+nbk_func_ener   nbnxn_kernel_ElecRF_VdwLJFsw_VgrpF_ref;
+nbk_func_ener   nbnxn_kernel_ElecRF_VdwLJPsw_VgrpF_ref;
+nbk_func_ener   nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VgrpF_ref;
+nbk_func_ener   nbnxn_kernel_ElecRF_VdwLJEwCombLB_VgrpF_ref;
+nbk_func_ener   nbnxn_kernel_ElecQSTab_VdwLJ_VgrpF_ref;
+nbk_func_ener   nbnxn_kernel_ElecQSTab_VdwLJFsw_VgrpF_ref;
+nbk_func_ener   nbnxn_kernel_ElecQSTab_VdwLJPsw_VgrpF_ref;
+nbk_func_ener   nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VgrpF_ref;
+nbk_func_ener   nbnxn_kernel_ElecQSTab_VdwLJEwCombLB_VgrpF_ref;
+nbk_func_ener   nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_ref;
+nbk_func_ener   nbnxn_kernel_ElecQSTabTwinCut_VdwLJFsw_VgrpF_ref;
+nbk_func_ener   nbnxn_kernel_ElecQSTabTwinCut_VdwLJPsw_VgrpF_ref;
+nbk_func_ener   nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VgrpF_ref;
+nbk_func_ener   nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombLB_VgrpF_ref;
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+#ifdef INCLUDE_KERNELFUNCTION_TABLES
+
+/* Declare and define the kernel function pointer lookup tables.
+ * The minor index of the array goes over both the LJ combination rules,
+ * which is only supported by plain cut-off, and the LJ switch/PME functions.
+ * For the C reference kernels, unlike the SIMD kernels, there is not much
+ * advantage in using combination rules, so we (re-)use the same kernel.
+ */
+p_nbk_func_noener nbnxn_kernel_noener_ref[coulktNR][vdwktNR_ref] =
+{
+    {
+        nbnxn_kernel_ElecRF_VdwLJ_F_ref,
+        nbnxn_kernel_ElecRF_VdwLJ_F_ref,
+        nbnxn_kernel_ElecRF_VdwLJ_F_ref,
+        nbnxn_kernel_ElecRF_VdwLJFsw_F_ref,
+        nbnxn_kernel_ElecRF_VdwLJPsw_F_ref,
+        nbnxn_kernel_ElecRF_VdwLJEwCombGeom_F_ref,
+        nbnxn_kernel_ElecRF_VdwLJEwCombLB_F_ref
+    },
+    {
+        nbnxn_kernel_ElecQSTab_VdwLJ_F_ref,
+        nbnxn_kernel_ElecQSTab_VdwLJ_F_ref,
+        nbnxn_kernel_ElecQSTab_VdwLJ_F_ref,
+        nbnxn_kernel_ElecQSTab_VdwLJFsw_F_ref,
+        nbnxn_kernel_ElecQSTab_VdwLJPsw_F_ref,
+        nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_F_ref,
+        nbnxn_kernel_ElecQSTab_VdwLJEwCombLB_F_ref
+    },
+    {
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJFsw_F_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJPsw_F_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_F_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombLB_F_ref
+    },
+    {
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJFsw_F_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJPsw_F_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_F_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombLB_F_ref
+    }
+};
 
-/* Wrapper call for the non-bonded n vs n reference kernels */
-void
-nbnxn_kernel_ref(const nbnxn_pairlist_set_t *nbl_list,
-                 const nbnxn_atomdata_t     *nbat,
-                 const interaction_const_t  *ic,
-                 rvec                       *shift_vec,
-                 int                         force_flags,
-                 int                         clearF,
-                 real                       *fshift,
-                 real                       *Vc,
-                 real                       *Vvdw);
+p_nbk_func_ener nbnxn_kernel_ener_ref[coulktNR][vdwktNR_ref] =
+{
+    {
+        nbnxn_kernel_ElecRF_VdwLJ_VF_ref,
+        nbnxn_kernel_ElecRF_VdwLJ_VF_ref,
+        nbnxn_kernel_ElecRF_VdwLJ_VF_ref,
+        nbnxn_kernel_ElecRF_VdwLJFsw_VF_ref,
+        nbnxn_kernel_ElecRF_VdwLJPsw_VF_ref,
+        nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VF_ref,
+        nbnxn_kernel_ElecRF_VdwLJEwCombLB_VF_ref
+    },
+    {
+        nbnxn_kernel_ElecQSTab_VdwLJ_VF_ref,
+        nbnxn_kernel_ElecQSTab_VdwLJ_VF_ref,
+        nbnxn_kernel_ElecQSTab_VdwLJ_VF_ref,
+        nbnxn_kernel_ElecQSTab_VdwLJFsw_VF_ref,
+        nbnxn_kernel_ElecQSTab_VdwLJPsw_VF_ref,
+        nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VF_ref,
+        nbnxn_kernel_ElecQSTab_VdwLJEwCombLB_VF_ref
+    },
+    {
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJFsw_VF_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJPsw_VF_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VF_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombLB_VF_ref
+    },
+    {
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJFsw_VF_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJPsw_VF_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VF_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombLB_VF_ref
+    }
+};
 
-#ifdef __cplusplus
-}
-#endif
+p_nbk_func_ener nbnxn_kernel_energrp_ref[coulktNR][vdwktNR_ref] =
+{
+    {
+        nbnxn_kernel_ElecRF_VdwLJ_VgrpF_ref,
+        nbnxn_kernel_ElecRF_VdwLJ_VgrpF_ref,
+        nbnxn_kernel_ElecRF_VdwLJ_VgrpF_ref,
+        nbnxn_kernel_ElecRF_VdwLJFsw_VgrpF_ref,
+        nbnxn_kernel_ElecRF_VdwLJPsw_VgrpF_ref,
+        nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VgrpF_ref,
+        nbnxn_kernel_ElecRF_VdwLJEwCombLB_VgrpF_ref
+    },
+    {
+        nbnxn_kernel_ElecQSTab_VdwLJ_VgrpF_ref,
+        nbnxn_kernel_ElecQSTab_VdwLJ_VgrpF_ref,
+        nbnxn_kernel_ElecQSTab_VdwLJ_VgrpF_ref,
+        nbnxn_kernel_ElecQSTab_VdwLJFsw_VgrpF_ref,
+        nbnxn_kernel_ElecQSTab_VdwLJPsw_VgrpF_ref,
+        nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VgrpF_ref,
+        nbnxn_kernel_ElecQSTab_VdwLJEwCombLB_VgrpF_ref
+    },
+    {
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJFsw_VgrpF_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJPsw_VgrpF_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VgrpF_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombLB_VgrpF_ref
+    },
+    {
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJFsw_VgrpF_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJPsw_VgrpF_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VgrpF_ref,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombLB_VgrpF_ref
+    }
+};
 
-#endif
+#endif /* INCLUDE_KERNELFUNCTION_TABLES */
index 846a281037a762a79ffd16910a90d619da019aba..62f5cc96a8f5c4e531c832c961a69754d83d721e 100644 (file)
                 {
                     real skipmask_rvdw;
 
-                    skipmask_rvdw = (rsq < rvdw2);
+                    skipmask_rvdw = (rsq < rvdw2) ? 1.0 : 0.0;
                     frLJ         *= skipmask_rvdw;
 #ifdef CALC_ENERGIES
                     VLJ    *= skipmask_rvdw;
index 1173f432fa54bc79dadf5112c92f6ac85db65d04..c68cb3a00c7d292864ec5371936b650819138284 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,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.
@@ -79,7 +79,7 @@
 #error "No VdW type defined"
 #endif
 
-static void
+void
 #ifndef CALC_ENERGIES
 NBK_FUNC_NAME(_F)
 #else
@@ -95,11 +95,8 @@ NBK_FUNC_NAME(_VgrpF)
  const nbnxn_atomdata_t     *nbat,
  const interaction_const_t  *ic,
  rvec                       *shift_vec,
- real                       *f
-#ifdef CALC_SHIFTFORCES
- ,
- real                       *fshift
-#endif
+ real                       *f,
+ real gmx_unused            *fshift
 #ifdef CALC_ENERGIES
  ,
  real                       *Vvdw,
@@ -380,7 +377,7 @@ NBK_FUNC_NAME(_VgrpF)
             }
         }
 #ifdef CALC_SHIFTFORCES
-        if (fshift != NULL)
+        if (fshift != nullptr)
         {
             /* Add i forces to shifted force list */
             for (i = 0; i < UNROLLI; i++)
diff --git a/src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_prune.cpp b/src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_prune.cpp
new file mode 100644 (file)
index 0000000..b9b90d8
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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 "nbnxn_kernel_ref_prune.h"
+
+#include "gromacs/mdlib/nbnxn_consts.h"
+#include "gromacs/mdlib/nbnxn_pairlist.h"
+#include "gromacs/utility/gmxassert.h"
+
+
+/* Prune a single nbnxn_pairlist_t entry with distance rlistInner */
+void
+nbnxn_kernel_prune_ref(nbnxn_pairlist_t *         nbl,
+                       const nbnxn_atomdata_t *   nbat,
+                       const rvec * gmx_restrict  shift_vec,
+                       real                       rlistInner)
+{
+    const nbnxn_ci_t * gmx_restrict ciOuter  = nbl->ciOuter;
+    nbnxn_ci_t       * gmx_restrict ciInner  = nbl->ci;
+
+    const nbnxn_cj_t * gmx_restrict cjOuter   = nbl->cjOuter;
+    nbnxn_cj_t       * gmx_restrict cjInner   = nbl->cj;
+
+    const real       * gmx_restrict shiftvec = shift_vec[0];
+    const real       * gmx_restrict x        = nbat->x;
+
+    const real                      rlist2   = rlistInner*rlistInner;
+
+    /* Use compile time constants to speed up the code */
+    constexpr int c_xStride  = 3;
+    GMX_ASSERT(c_xStride == nbat->xstride, "xStride should match nbat->xstride");
+    constexpr int c_xiStride = 3;
+
+    constexpr int c_iUnroll  = NBNXN_CPU_CLUSTER_I_SIZE;
+    constexpr int c_jUnroll  = NBNXN_CPU_CLUSTER_I_SIZE;
+
+    /* Initialize the new list as empty and add pairs that are in range */
+    int nciInner = 0;
+    int ncjInner = 0;
+    for (int ciIndex = 0; ciIndex < nbl->nciOuter; ciIndex++)
+    {
+        const nbnxn_ci_t * gmx_restrict ciEntry = &ciOuter[ciIndex];
+
+        /* Copy the original list entry to the pruned entry */
+        ciInner[nciInner].ci           = ciEntry->ci;
+        ciInner[nciInner].shift        = ciEntry->shift;
+        ciInner[nciInner].cj_ind_start = ncjInner;
+
+        /* Extract shift data */
+        int ish = (ciEntry->shift & NBNXN_CI_SHIFT);
+        int ci  = ciEntry->ci;
+
+        /* Load i atom coordinates */
+        real xi[c_iUnroll*c_xiStride];
+        for (int i = 0; i < c_iUnroll; i++)
+        {
+            for (int d = 0; d < DIM; d++)
+            {
+                xi[i*c_xiStride + d] = x[(ci*c_iUnroll + i)*c_xStride + d] + shiftvec[ish*DIM + d];
+            }
+        }
+
+        for (int cjind = ciEntry->cj_ind_start; cjind < ciEntry->cj_ind_end; cjind++)
+        {
+            /* j-cluster index */
+            int  cj        = cjOuter[cjind].cj;
+
+            bool isInRange = false;
+            for (int i = 0; i < c_iUnroll && !isInRange; i++)
+            {
+                for (int j = 0; j < c_jUnroll; j++)
+                {
+                    int  aj  = cj*c_jUnroll + j;
+
+                    real dx  = xi[i*c_xiStride + XX] - x[aj*c_xStride + XX];
+                    real dy  = xi[i*c_xiStride + YY] - x[aj*c_xStride + YY];
+                    real dz  = xi[i*c_xiStride + ZZ] - x[aj*c_xStride + ZZ];
+
+                    real rsq = dx*dx + dy*dy + dz*dz;
+
+                    if (rsq < rlist2)
+                    {
+                        isInRange = true;
+                    }
+                }
+            }
+
+            if (isInRange)
+            {
+                /* This cluster is in range, put it in the pruned list */
+                cjInner[ncjInner++] = cjOuter[cjind];
+            }
+        }
+
+        /* Check if there are any j's in the list, if so, add the i-entry */
+        if (ncjInner > ciInner[nciInner].cj_ind_start)
+        {
+            ciInner[nciInner].cj_ind_end = ncjInner;
+            nciInner++;
+        }
+    }
+
+    nbl->nci = nciInner;
+}
diff --git a/src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_prune.h b/src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_prune.h
new file mode 100644 (file)
index 0000000..3719ec0
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+
+/*! \internal \file
+ *
+ * \brief
+ * Declares the C reference pruning only kernel.
+ *
+ * \author Berk Hess <hess@kth.se>
+ */
+
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
+
+struct nbnxn_atomdata_t;
+struct nbnxn_pairlist_t;
+
+/*! \brief Prune a single nbnxn_pairlist_t entry with distance \p rlistInner
+ *
+ * Reads a cluster pairlist \p nbl->ciOuter, \p nbl->cjOuter and writes
+ * all cluster pairs within \p rlistInner to \p nbl->ci, \p nbl->cj.
+ */
+void
+nbnxn_kernel_prune_ref(nbnxn_pairlist_t *         nbl,
+                       const nbnxn_atomdata_t *   nbat,
+                       const rvec * gmx_restrict  shift_vec,
+                       real                       rlistInner);
diff --git a/src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.cpp b/src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.cpp
deleted file mode 100644 (file)
index 0f97061..0000000
+++ /dev/null
@@ -1,444 +0,0 @@
-/*
- * 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
- * Mark Abraham, David van der Spoel, Berk Hess, and 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 Verlet kernel generator for
- * kernel type 2xnn.
- */
-
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include "gromacs/math/vectypes.h"
-#include "gromacs/mdlib/nb_verlet.h"
-#include "gromacs/mdlib/nbnxn_simd.h"
-#include "gromacs/mdtypes/interaction_const.h"
-#include "gromacs/mdtypes/md_enums.h"
-
-#ifdef GMX_NBNXN_SIMD_2XNN
-
-/* Include the full-width SIMD macros */
-#include "gromacs/simd/vector_operations.h"
-
-#if !(GMX_SIMD_REAL_WIDTH == 8 || GMX_SIMD_REAL_WIDTH == 16)
-#error "unsupported SIMD width"
-#endif
-
-#define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
-
-#include "gromacs/mdlib/force_flags.h"
-#include "gromacs/mdlib/gmx_omp_nthreads.h"
-#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_common.h"
-#include "gromacs/simd/simd.h"
-#include "gromacs/utility/fatalerror.h"
-#include "gromacs/utility/real.h"
-
-/*! \brief Kinds of electrostatic treatments in SIMD Verlet kernels
- */
-enum {
-    coulktRF, coulktTAB, coulktTAB_TWIN, coulktEWALD, coulktEWALD_TWIN, coulktNR
-};
-
-/*! \brief Kinds of Van der Waals treatments in SIMD Verlet kernels
- */
-enum {
-    vdwktLJCUT_COMBGEOM, vdwktLJCUT_COMBLB, vdwktLJCUT_COMBNONE, vdwktLJFORCESWITCH, vdwktLJPOTSWITCH, vdwktLJEWALDCOMBGEOM, vdwktNR
-};
-
-/* Declare and define the kernel function pointer lookup tables.
- * The minor index of the array goes over both the LJ combination rules,
- * which is only supported by plain cut-off, and the LJ switch/PME functions.
- */
-static p_nbk_func_noener p_nbk_noener[coulktNR][vdwktNR] =
-{
-    {
-        nbnxn_kernel_ElecRF_VdwLJCombGeom_F_2xnn,
-        nbnxn_kernel_ElecRF_VdwLJCombLB_F_2xnn,
-        nbnxn_kernel_ElecRF_VdwLJ_F_2xnn,
-        nbnxn_kernel_ElecRF_VdwLJFSw_F_2xnn,
-        nbnxn_kernel_ElecRF_VdwLJPSw_F_2xnn,
-        nbnxn_kernel_ElecRF_VdwLJEwCombGeom_F_2xnn,
-    },
-    {
-        nbnxn_kernel_ElecQSTab_VdwLJCombGeom_F_2xnn,
-        nbnxn_kernel_ElecQSTab_VdwLJCombLB_F_2xnn,
-        nbnxn_kernel_ElecQSTab_VdwLJ_F_2xnn,
-        nbnxn_kernel_ElecQSTab_VdwLJFSw_F_2xnn,
-        nbnxn_kernel_ElecQSTab_VdwLJPSw_F_2xnn,
-        nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_F_2xnn,
-    },
-    {
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombGeom_F_2xnn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombLB_F_2xnn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_2xnn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJFSw_F_2xnn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJPSw_F_2xnn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_F_2xnn,
-    },
-    {
-        nbnxn_kernel_ElecEw_VdwLJCombGeom_F_2xnn,
-        nbnxn_kernel_ElecEw_VdwLJCombLB_F_2xnn,
-        nbnxn_kernel_ElecEw_VdwLJ_F_2xnn,
-        nbnxn_kernel_ElecEw_VdwLJFSw_F_2xnn,
-        nbnxn_kernel_ElecEw_VdwLJPSw_F_2xnn,
-        nbnxn_kernel_ElecEw_VdwLJEwCombGeom_F_2xnn,
-    },
-    {
-        nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_F_2xnn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_F_2xnn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJ_F_2xnn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_F_2xnn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_F_2xnn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_F_2xnn,
-    },
-};
-
-static p_nbk_func_ener p_nbk_ener[coulktNR][vdwktNR] =
-{
-    {
-        nbnxn_kernel_ElecRF_VdwLJCombGeom_VF_2xnn,
-        nbnxn_kernel_ElecRF_VdwLJCombLB_VF_2xnn,
-        nbnxn_kernel_ElecRF_VdwLJ_VF_2xnn,
-        nbnxn_kernel_ElecRF_VdwLJFSw_VF_2xnn,
-        nbnxn_kernel_ElecRF_VdwLJPSw_VF_2xnn,
-        nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VF_2xnn,
-    },
-    {
-        nbnxn_kernel_ElecQSTab_VdwLJCombGeom_VF_2xnn,
-        nbnxn_kernel_ElecQSTab_VdwLJCombLB_VF_2xnn,
-        nbnxn_kernel_ElecQSTab_VdwLJ_VF_2xnn,
-        nbnxn_kernel_ElecQSTab_VdwLJFSw_VF_2xnn,
-        nbnxn_kernel_ElecQSTab_VdwLJPSw_VF_2xnn,
-        nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VF_2xnn,
-    },
-    {
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombGeom_VF_2xnn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombLB_VF_2xnn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_2xnn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJFSw_VF_2xnn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJPSw_VF_2xnn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VF_2xnn,
-    },
-    {
-        nbnxn_kernel_ElecEw_VdwLJCombGeom_VF_2xnn,
-        nbnxn_kernel_ElecEw_VdwLJCombLB_VF_2xnn,
-        nbnxn_kernel_ElecEw_VdwLJ_VF_2xnn,
-        nbnxn_kernel_ElecEw_VdwLJFSw_VF_2xnn,
-        nbnxn_kernel_ElecEw_VdwLJPSw_VF_2xnn,
-        nbnxn_kernel_ElecEw_VdwLJEwCombGeom_VF_2xnn,
-    },
-    {
-        nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_VF_2xnn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_VF_2xnn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJ_VF_2xnn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_VF_2xnn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_VF_2xnn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_VF_2xnn,
-    },
-};
-
-static p_nbk_func_ener p_nbk_energrp[coulktNR][vdwktNR] =
-{
-    {
-        nbnxn_kernel_ElecRF_VdwLJCombGeom_VgrpF_2xnn,
-        nbnxn_kernel_ElecRF_VdwLJCombLB_VgrpF_2xnn,
-        nbnxn_kernel_ElecRF_VdwLJ_VgrpF_2xnn,
-        nbnxn_kernel_ElecRF_VdwLJFSw_VgrpF_2xnn,
-        nbnxn_kernel_ElecRF_VdwLJPSw_VgrpF_2xnn,
-        nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VgrpF_2xnn,
-    },
-    {
-        nbnxn_kernel_ElecQSTab_VdwLJCombGeom_VgrpF_2xnn,
-        nbnxn_kernel_ElecQSTab_VdwLJCombLB_VgrpF_2xnn,
-        nbnxn_kernel_ElecQSTab_VdwLJ_VgrpF_2xnn,
-        nbnxn_kernel_ElecQSTab_VdwLJFSw_VgrpF_2xnn,
-        nbnxn_kernel_ElecQSTab_VdwLJPSw_VgrpF_2xnn,
-        nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VgrpF_2xnn,
-    },
-    {
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombGeom_VgrpF_2xnn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombLB_VgrpF_2xnn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_2xnn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJFSw_VgrpF_2xnn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJPSw_VgrpF_2xnn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VgrpF_2xnn,
-    },
-    {
-        nbnxn_kernel_ElecEw_VdwLJCombGeom_VgrpF_2xnn,
-        nbnxn_kernel_ElecEw_VdwLJCombLB_VgrpF_2xnn,
-        nbnxn_kernel_ElecEw_VdwLJ_VgrpF_2xnn,
-        nbnxn_kernel_ElecEw_VdwLJFSw_VgrpF_2xnn,
-        nbnxn_kernel_ElecEw_VdwLJPSw_VgrpF_2xnn,
-        nbnxn_kernel_ElecEw_VdwLJEwCombGeom_VgrpF_2xnn,
-    },
-    {
-        nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_VgrpF_2xnn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_VgrpF_2xnn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJ_VgrpF_2xnn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_VgrpF_2xnn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_VgrpF_2xnn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_VgrpF_2xnn,
-    },
-};
-
-
-static void
-reduce_group_energies(int ng, int ng_2log,
-                      const real *VSvdw, const real *VSc,
-                      real *Vvdw, real *Vc)
-{
-    const int unrollj      = GMX_SIMD_REAL_WIDTH/GMX_SIMD_J_UNROLL_SIZE;
-    const int unrollj_half = unrollj/2;
-    int       ng_p2, i, j, j0, j1, c, s;
-
-    ng_p2 = (1<<ng_2log);
-
-    /* The size of the x86 SIMD energy group buffer array is:
-     * ng*ng*ng_p2*unrollj_half*simd_width
-     */
-    for (i = 0; i < ng; i++)
-    {
-        for (j = 0; j < ng; j++)
-        {
-            Vvdw[i*ng+j] = 0;
-            Vc[i*ng+j]   = 0;
-        }
-
-        for (j1 = 0; j1 < ng; j1++)
-        {
-            for (j0 = 0; j0 < ng; j0++)
-            {
-                c = ((i*ng + j1)*ng_p2 + j0)*unrollj_half*unrollj;
-                for (s = 0; s < unrollj_half; s++)
-                {
-                    Vvdw[i*ng+j0] += VSvdw[c+0];
-                    Vvdw[i*ng+j1] += VSvdw[c+1];
-                    Vc  [i*ng+j0] += VSc  [c+0];
-                    Vc  [i*ng+j1] += VSc  [c+1];
-                    c             += unrollj + 2;
-                }
-            }
-        }
-    }
-}
-
-#else /* GMX_NBNXN_SIMD_2XNN */
-
-#include "gromacs/utility/fatalerror.h"
-
-#endif /* GMX_NBNXN_SIMD_2XNN */
-
-void
-nbnxn_kernel_simd_2xnn(nbnxn_pairlist_set_t      gmx_unused *nbl_list,
-                       const nbnxn_atomdata_t    gmx_unused *nbat,
-                       const interaction_const_t gmx_unused *ic,
-                       int                       gmx_unused  ewald_excl,
-                       rvec                      gmx_unused *shift_vec,
-                       int                       gmx_unused  force_flags,
-                       int                       gmx_unused  clearF,
-                       real                      gmx_unused *fshift,
-                       real                      gmx_unused *Vc,
-                       real                      gmx_unused *Vvdw)
-#ifdef GMX_NBNXN_SIMD_2XNN
-{
-    int                nnbl;
-    nbnxn_pairlist_t **nbl;
-    int                coulkt, vdwkt = 0;
-    int                nb, nthreads gmx_unused;
-
-    nnbl = nbl_list->nnbl;
-    nbl  = nbl_list->nbl;
-
-    if (EEL_RF(ic->eeltype) || ic->eeltype == eelCUT)
-    {
-        coulkt = coulktRF;
-    }
-    else
-    {
-        if (ewald_excl == ewaldexclTable)
-        {
-            if (ic->rcoulomb == ic->rvdw)
-            {
-                coulkt = coulktTAB;
-            }
-            else
-            {
-                coulkt = coulktTAB_TWIN;
-            }
-        }
-        else
-        {
-            if (ic->rcoulomb == ic->rvdw)
-            {
-                coulkt = coulktEWALD;
-            }
-            else
-            {
-                coulkt = coulktEWALD_TWIN;
-            }
-        }
-    }
-
-    if (ic->vdwtype == evdwCUT)
-    {
-        switch (ic->vdw_modifier)
-        {
-            case eintmodNONE:
-            case eintmodPOTSHIFT:
-                switch (nbat->comb_rule)
-                {
-                    case ljcrGEOM: vdwkt = vdwktLJCUT_COMBGEOM; break;
-                    case ljcrLB:   vdwkt = vdwktLJCUT_COMBLB;   break;
-                    case ljcrNONE: vdwkt = vdwktLJCUT_COMBNONE; break;
-                    default:       gmx_incons("Unknown combination rule");
-                }
-                break;
-            case eintmodFORCESWITCH:
-                vdwkt = vdwktLJFORCESWITCH;
-                break;
-            case eintmodPOTSWITCH:
-                vdwkt = vdwktLJPOTSWITCH;
-                break;
-            default:
-                gmx_incons("Unsupported VdW interaction modifier");
-        }
-    }
-    else if (ic->vdwtype == evdwPME)
-    {
-        if (ic->ljpme_comb_rule == eljpmeLB)
-        {
-            gmx_incons("The nbnxn SIMD kernels don't support LJ-PME with LB");
-        }
-        vdwkt = vdwktLJEWALDCOMBGEOM;
-    }
-    else
-    {
-        gmx_incons("Unsupported VdW interaction type");
-    }
-    // cppcheck-suppress unreadVariable
-    nthreads = gmx_omp_nthreads_get(emntNonbonded);
-#pragma omp parallel for schedule(static) num_threads(nthreads)
-    for (nb = 0; nb < nnbl; nb++)
-    {
-        // Presently, the kernels do not call C++ code that can throw, so
-        // no need for a try/catch pair in this OpenMP region.
-        nbnxn_atomdata_output_t *out;
-        real                    *fshift_p;
-
-        out = &nbat->out[nb];
-
-        if (clearF == enbvClearFYes)
-        {
-            clear_f(nbat, nb, out->f);
-        }
-
-        if ((force_flags & GMX_FORCE_VIRIAL) && nnbl == 1)
-        {
-            fshift_p = fshift;
-        }
-        else
-        {
-            fshift_p = out->fshift;
-
-            if (clearF == enbvClearFYes)
-            {
-                clear_fshift(fshift_p);
-            }
-        }
-
-        if (!(force_flags & GMX_FORCE_ENERGY))
-        {
-            /* Don't calculate energies */
-            p_nbk_noener[coulkt][vdwkt](nbl[nb], nbat,
-                                        ic,
-                                        shift_vec,
-                                        out->f,
-                                        fshift_p);
-        }
-        else if (out->nV == 1)
-        {
-            /* No energy groups */
-            out->Vvdw[0] = 0;
-            out->Vc[0]   = 0;
-
-            p_nbk_ener[coulkt][vdwkt](nbl[nb], nbat,
-                                      ic,
-                                      shift_vec,
-                                      out->f,
-                                      fshift_p,
-                                      out->Vvdw,
-                                      out->Vc);
-        }
-        else
-        {
-            /* Calculate energy group contributions */
-            int i;
-
-            for (i = 0; i < out->nVS; i++)
-            {
-                out->VSvdw[i] = 0;
-            }
-            for (i = 0; i < out->nVS; i++)
-            {
-                out->VSc[i] = 0;
-            }
-
-            p_nbk_energrp[coulkt][vdwkt](nbl[nb], nbat,
-                                         ic,
-                                         shift_vec,
-                                         out->f,
-                                         fshift_p,
-                                         out->VSvdw,
-                                         out->VSc);
-
-            reduce_group_energies(nbat->nenergrp, nbat->neg_2log,
-                                  out->VSvdw, out->VSc,
-                                  out->Vvdw, out->Vc);
-        }
-    }
-
-    if (force_flags & GMX_FORCE_ENERGY)
-    {
-        reduce_energies_over_lists(nbat, nnbl, Vvdw, Vc);
-    }
-}
-#else
-{
-    gmx_incons("nbnxn_kernel_simd_2xnn called when such kernels "
-               " are not enabled.");
-}
-#endif
-#undef GMX_SIMD_J_UNROLL_SIZE
index 2052aef63e379222663c5fc918240bb5a2c9b31e..79a8d37de909c24c5b1787bb450e73c7ce1d33da 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,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.
  * kernel type 2xnn.
  */
 
-#include "gromacs/math/vectypes.h"
-#include "gromacs/mdlib/nbnxn_pairlist.h"
-#include "gromacs/mdtypes/interaction_const.h"
-#include "gromacs/utility/real.h"
 
-/*! \brief Run-time dispatcher for nbnxn kernel functions. */
-void
-nbnxn_kernel_simd_2xnn(nbnxn_pairlist_set_t       *nbl_list,
-                       const nbnxn_atomdata_t     *nbat,
-                       const interaction_const_t  *ic,
-                       int                         ewald_excl,
-                       rvec                       *shift_vec,
-                       int                         force_flags,
-                       int                         clearF,
-                       real                       *fshift,
-                       real                       *Vc,
-                       real                       *Vvdw);
-
-/* Need an #include guard so that sim_util.c can include all
- * such files. */
-#ifndef _nbnxn_kernel_simd_include_h
-#define _nbnxn_kernel_simd_include_h
-/*! \brief Typedefs for declaring kernel functions. */
-typedef void (nbk_func_ener)(const nbnxn_pairlist_t     *nbl,
-                             const nbnxn_atomdata_t     *nbat,
-                             const interaction_const_t  *ic,
-                             rvec                       *shift_vec,
-                             real                       *f,
-                             real                       *fshift,
-                             real                       *Vvdw,
-                             real                       *Vc);
-typedef nbk_func_ener *p_nbk_func_ener;
-
-typedef void (nbk_func_noener)(const nbnxn_pairlist_t     *nbl,
-                               const nbnxn_atomdata_t     *nbat,
-                               const interaction_const_t  *ic,
-                               rvec                       *shift_vec,
-                               real                       *f,
-                               real                       *fshift);
-typedef nbk_func_noener *p_nbk_func_noener;
-#endif
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_common.h"
 
+/* Declare all the different kernel functions.
+ */
 nbk_func_ener         nbnxn_kernel_ElecRF_VdwLJCombGeom_VgrpF_2xnn;
 nbk_func_ener         nbnxn_kernel_ElecRF_VdwLJCombLB_VgrpF_2xnn;
 nbk_func_ener         nbnxn_kernel_ElecRF_VdwLJ_VgrpF_2xnn;
@@ -171,3 +134,146 @@ nbk_func_noener       nbnxn_kernel_ElecEwTwinCut_VdwLJ_F_2xnn;
 nbk_func_noener       nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_F_2xnn;
 nbk_func_noener       nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_F_2xnn;
 nbk_func_noener       nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_F_2xnn;
+
+
+
+#ifdef INCLUDE_KERNELFUNCTION_TABLES
+
+/* Declare and define the kernel function pointer lookup tables.
+ * The minor index of the array goes over both the LJ combination rules,
+ * which is only supported by plain cut-off, and the LJ switch/PME functions.
+ */
+p_nbk_func_noener nbnxn_kernel_noener_simd_2xnn[coulktNR][vdwktNR] =
+{
+    {
+        nbnxn_kernel_ElecRF_VdwLJCombGeom_F_2xnn,
+        nbnxn_kernel_ElecRF_VdwLJCombLB_F_2xnn,
+        nbnxn_kernel_ElecRF_VdwLJ_F_2xnn,
+        nbnxn_kernel_ElecRF_VdwLJFSw_F_2xnn,
+        nbnxn_kernel_ElecRF_VdwLJPSw_F_2xnn,
+        nbnxn_kernel_ElecRF_VdwLJEwCombGeom_F_2xnn,
+    },
+    {
+        nbnxn_kernel_ElecQSTab_VdwLJCombGeom_F_2xnn,
+        nbnxn_kernel_ElecQSTab_VdwLJCombLB_F_2xnn,
+        nbnxn_kernel_ElecQSTab_VdwLJ_F_2xnn,
+        nbnxn_kernel_ElecQSTab_VdwLJFSw_F_2xnn,
+        nbnxn_kernel_ElecQSTab_VdwLJPSw_F_2xnn,
+        nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_F_2xnn,
+    },
+    {
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombGeom_F_2xnn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombLB_F_2xnn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_2xnn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJFSw_F_2xnn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJPSw_F_2xnn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_F_2xnn,
+    },
+    {
+        nbnxn_kernel_ElecEw_VdwLJCombGeom_F_2xnn,
+        nbnxn_kernel_ElecEw_VdwLJCombLB_F_2xnn,
+        nbnxn_kernel_ElecEw_VdwLJ_F_2xnn,
+        nbnxn_kernel_ElecEw_VdwLJFSw_F_2xnn,
+        nbnxn_kernel_ElecEw_VdwLJPSw_F_2xnn,
+        nbnxn_kernel_ElecEw_VdwLJEwCombGeom_F_2xnn,
+    },
+    {
+        nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_F_2xnn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_F_2xnn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJ_F_2xnn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_F_2xnn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_F_2xnn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_F_2xnn,
+    },
+};
+
+p_nbk_func_ener nbnxn_kernel_ener_simd_2xnn[coulktNR][vdwktNR] =
+{
+    {
+        nbnxn_kernel_ElecRF_VdwLJCombGeom_VF_2xnn,
+        nbnxn_kernel_ElecRF_VdwLJCombLB_VF_2xnn,
+        nbnxn_kernel_ElecRF_VdwLJ_VF_2xnn,
+        nbnxn_kernel_ElecRF_VdwLJFSw_VF_2xnn,
+        nbnxn_kernel_ElecRF_VdwLJPSw_VF_2xnn,
+        nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VF_2xnn,
+    },
+    {
+        nbnxn_kernel_ElecQSTab_VdwLJCombGeom_VF_2xnn,
+        nbnxn_kernel_ElecQSTab_VdwLJCombLB_VF_2xnn,
+        nbnxn_kernel_ElecQSTab_VdwLJ_VF_2xnn,
+        nbnxn_kernel_ElecQSTab_VdwLJFSw_VF_2xnn,
+        nbnxn_kernel_ElecQSTab_VdwLJPSw_VF_2xnn,
+        nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VF_2xnn,
+    },
+    {
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombGeom_VF_2xnn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombLB_VF_2xnn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_2xnn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJFSw_VF_2xnn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJPSw_VF_2xnn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VF_2xnn,
+    },
+    {
+        nbnxn_kernel_ElecEw_VdwLJCombGeom_VF_2xnn,
+        nbnxn_kernel_ElecEw_VdwLJCombLB_VF_2xnn,
+        nbnxn_kernel_ElecEw_VdwLJ_VF_2xnn,
+        nbnxn_kernel_ElecEw_VdwLJFSw_VF_2xnn,
+        nbnxn_kernel_ElecEw_VdwLJPSw_VF_2xnn,
+        nbnxn_kernel_ElecEw_VdwLJEwCombGeom_VF_2xnn,
+    },
+    {
+        nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_VF_2xnn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_VF_2xnn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJ_VF_2xnn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_VF_2xnn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_VF_2xnn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_VF_2xnn,
+    },
+};
+
+p_nbk_func_ener nbnxn_kernel_energrp_simd_2xnn[coulktNR][vdwktNR] =
+{
+    {
+        nbnxn_kernel_ElecRF_VdwLJCombGeom_VgrpF_2xnn,
+        nbnxn_kernel_ElecRF_VdwLJCombLB_VgrpF_2xnn,
+        nbnxn_kernel_ElecRF_VdwLJ_VgrpF_2xnn,
+        nbnxn_kernel_ElecRF_VdwLJFSw_VgrpF_2xnn,
+        nbnxn_kernel_ElecRF_VdwLJPSw_VgrpF_2xnn,
+        nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VgrpF_2xnn,
+    },
+    {
+        nbnxn_kernel_ElecQSTab_VdwLJCombGeom_VgrpF_2xnn,
+        nbnxn_kernel_ElecQSTab_VdwLJCombLB_VgrpF_2xnn,
+        nbnxn_kernel_ElecQSTab_VdwLJ_VgrpF_2xnn,
+        nbnxn_kernel_ElecQSTab_VdwLJFSw_VgrpF_2xnn,
+        nbnxn_kernel_ElecQSTab_VdwLJPSw_VgrpF_2xnn,
+        nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VgrpF_2xnn,
+    },
+    {
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombGeom_VgrpF_2xnn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombLB_VgrpF_2xnn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_2xnn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJFSw_VgrpF_2xnn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJPSw_VgrpF_2xnn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VgrpF_2xnn,
+    },
+    {
+        nbnxn_kernel_ElecEw_VdwLJCombGeom_VgrpF_2xnn,
+        nbnxn_kernel_ElecEw_VdwLJCombLB_VgrpF_2xnn,
+        nbnxn_kernel_ElecEw_VdwLJ_VgrpF_2xnn,
+        nbnxn_kernel_ElecEw_VdwLJFSw_VgrpF_2xnn,
+        nbnxn_kernel_ElecEw_VdwLJPSw_VgrpF_2xnn,
+        nbnxn_kernel_ElecEw_VdwLJEwCombGeom_VgrpF_2xnn,
+    },
+    {
+        nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_VgrpF_2xnn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_VgrpF_2xnn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJ_VgrpF_2xnn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_VgrpF_2xnn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_VgrpF_2xnn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_VgrpF_2xnn,
+    },
+};
+
+
+#endif /* INCLUDE_KERNELFUNCTION_TABLES */
index ac30b0b0ef516c909f1ca107cdaada3820154334..77d697a6530d739068d64063f6dfd98852499301 100644 (file)
 #ifndef HALF_LJ
         cr2_S2        = lje_c2_S * selectByMask(rsq_S2, wco_vdw_S2);
 #endif
-        expmcr2_S0    = exp( -cr2_S0);
+        // Unsafe version of our exp() should be fine, since these arguments should never
+        // be smaller than -127 for any reasonable choice of cutoff or ewald coefficients.
+        expmcr2_S0    = exp<MathOptimization::Unsafe>( -cr2_S0);
 #ifndef HALF_LJ
-        expmcr2_S2    = exp( -cr2_S2);
+        expmcr2_S2    = exp<MathOptimization::Unsafe>( -cr2_S2);
 #endif
 
         /* 1 + cr2 + 1/2*cr2^2 */
diff --git a/src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_prune.cpp b/src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_prune.cpp
new file mode 100644 (file)
index 0000000..29e22c5
--- /dev/null
@@ -0,0 +1,173 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+
+#include "gmxpre.h"
+
+#include "nbnxn_kernel_simd_2xnn_prune.h"
+
+#include "gromacs/mdlib/nbnxn_pairlist.h"
+#include "gromacs/mdlib/nbnxn_simd.h"
+#include "gromacs/utility/gmxassert.h"
+
+#ifdef GMX_NBNXN_SIMD_2XNN
+#define GMX_SIMD_J_UNROLL_SIZE 2
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
+#endif
+
+/* Prune a single nbnxn_pairtlist_t entry with distance rlistInner */
+void
+nbnxn_kernel_prune_2xnn(nbnxn_pairlist_t *         nbl,
+                        const nbnxn_atomdata_t *   nbat,
+                        const rvec * gmx_restrict  shift_vec,
+                        real                       rlistInner)
+{
+#ifdef GMX_NBNXN_SIMD_2XNN
+    const nbnxn_ci_t * gmx_restrict ciOuter  = nbl->ciOuter;
+    nbnxn_ci_t       * gmx_restrict ciInner  = nbl->ci;
+
+    const nbnxn_cj_t * gmx_restrict cjOuter  = nbl->cjOuter;
+    nbnxn_cj_t       * gmx_restrict cjInner  = nbl->cj;
+
+    const real       * gmx_restrict shiftvec = shift_vec[0];
+    const real       * gmx_restrict x        = nbat->x;
+
+    const SimdReal                  rlist2_S(rlistInner*rlistInner);
+
+    /* Initialize the new list as empty and add pairs that are in range */
+    int nciInner = 0;
+    int ncjInner = 0;
+    for (int i = 0; i < nbl->nciOuter; i++)
+    {
+        const nbnxn_ci_t * gmx_restrict ciEntry = &ciOuter[i];
+
+        /* Copy the original list entry to the pruned entry */
+        ciInner[nciInner].ci           = ciEntry->ci;
+        ciInner[nciInner].shift        = ciEntry->shift;
+        ciInner[nciInner].cj_ind_start = ncjInner;
+
+        /* Extract shift data */
+        int      ish     = (ciEntry->shift & NBNXN_CI_SHIFT);
+        int      ish3    = ish*3;
+        int      ci      = ciEntry->ci;
+
+        SimdReal shX_S   = SimdReal(shiftvec[ish3    ]);
+        SimdReal shY_S   = SimdReal(shiftvec[ish3 + 1]);
+        SimdReal shZ_S   = SimdReal(shiftvec[ish3 + 2]);
+
+#if UNROLLJ <= 4
+        int      sci     = ci*STRIDE;
+        int      scix    = sci*DIM;
+#else
+        int      sci     = (ci >> 1)*STRIDE;
+        int      scix    = sci*DIM + (ci & 1)*(STRIDE >> 1);
+        sci             += (ci & 1)*(STRIDE >> 1);
+#endif
+
+        /* Load i atom data */
+        int      sciy    = scix + STRIDE;
+        int      sciz    = sciy + STRIDE;
+        SimdReal ix_S0   = load1DualHsimd(x + scix    ) + shX_S;
+        SimdReal ix_S2   = load1DualHsimd(x + scix + 2) + shX_S;
+        SimdReal iy_S0   = load1DualHsimd(x + sciy    ) + shY_S;
+        SimdReal iy_S2   = load1DualHsimd(x + sciy + 2) + shY_S;
+        SimdReal iz_S0   = load1DualHsimd(x + sciz    ) + shZ_S;
+        SimdReal iz_S2   = load1DualHsimd(x + sciz + 2) + shZ_S;
+
+        for (int cjind = ciEntry->cj_ind_start; cjind < ciEntry->cj_ind_end; cjind++)
+        {
+            /* j-cluster index */
+            int cj      = cjOuter[cjind].cj;
+
+            /* Atom indices (of the first atom in the cluster) */
+            int aj      = cj*UNROLLJ;
+#if UNROLLJ == STRIDE
+            int ajx     = aj*DIM;
+#else
+            int ajx     = (cj >> 1)*DIM*STRIDE + (cj & 1)*UNROLLJ;
+#endif
+            int ajy     = ajx + STRIDE;
+            int ajz     = ajy + STRIDE;
+
+            /* load j atom coordinates */
+            SimdReal jx_S   = loadDuplicateHsimd(x + ajx);
+            SimdReal jy_S   = loadDuplicateHsimd(x + ajy);
+            SimdReal jz_S   = loadDuplicateHsimd(x + ajz);
+
+            /* Calculate distance */
+            SimdReal dx_S0  = ix_S0 - jx_S;
+            SimdReal dy_S0  = iy_S0 - jy_S;
+            SimdReal dz_S0  = iz_S0 - jz_S;
+            SimdReal dx_S2  = ix_S2 - jx_S;
+            SimdReal dy_S2  = iy_S2 - jy_S;
+            SimdReal dz_S2  = iz_S2 - jz_S;
+
+            /* rsq = dx*dx+dy*dy+dz*dz */
+            SimdReal rsq_S0 = norm2(dx_S0, dy_S0, dz_S0);
+            SimdReal rsq_S2 = norm2(dx_S2, dy_S2, dz_S2);
+
+            /* Do the cut-off check */
+            SimdBool wco_S0 = (rsq_S0 < rlist2_S);
+            SimdBool wco_S2 = (rsq_S2 < rlist2_S);
+
+            wco_S0          = wco_S0 || wco_S2;
+
+            /* Putting the assignment inside the conditional is slower */
+            cjInner[ncjInner] = cjOuter[cjind];
+            if (anyTrue(wco_S0))
+            {
+                ncjInner++;
+            }
+        }
+
+        if (ncjInner > ciInner[nciInner].cj_ind_start)
+        {
+            ciInner[nciInner].cj_ind_end = ncjInner;
+            nciInner++;
+        }
+    }
+
+    nbl->nci = nciInner;
+
+#else  /* GMX_NBNXN_SIMD_2XNN */
+
+    GMX_RELEASE_ASSERT(false, "2xNN kernel called without 2xNN support");
+
+    GMX_UNUSED_VALUE(nbl);
+    GMX_UNUSED_VALUE(nbat);
+    GMX_UNUSED_VALUE(shift_vec);
+    GMX_UNUSED_VALUE(rlistInner);
+
+#endif /* GMX_NBNXN_SIMD_2XNN */
+}
diff --git a/src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_prune.h b/src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_prune.h
new file mode 100644 (file)
index 0000000..e65c5b9
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+
+/*! \internal \file
+ *
+ * \brief
+ * Declares the SIMD 2xNN pruning only kernel.
+ *
+ * \author Berk Hess <hess@kth.se>
+ */
+
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
+
+struct nbnxn_atomdata_t;
+struct nbnxn_pairlist_t;
+
+/*! \brief Prune a single nbnxn_pairlist_t entry with distance \p rlistInner
+ *
+ * Reads a cluster pairlist \p nbl->ciOuter, \p nbl->cjOuter and writes
+ * all cluster pairs within \p rlistInner to \p nbl->ci, \p nbl->cj.
+ */
+void
+nbnxn_kernel_prune_2xnn(nbnxn_pairlist_t *         nbl,
+                        const nbnxn_atomdata_t *   nbat,
+                        const rvec * gmx_restrict  shift_vec,
+                        real                       rlistInner);
diff --git a/src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.cpp b/src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.cpp
deleted file mode 100644 (file)
index 8f062df..0000000
+++ /dev/null
@@ -1,443 +0,0 @@
-/*
- * 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
- * Mark Abraham, David van der Spoel, Berk Hess, and 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 Verlet kernel generator for
- * kernel type 4xn.
- */
-
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include "gromacs/math/vectypes.h"
-#include "gromacs/mdlib/nb_verlet.h"
-#include "gromacs/mdlib/nbnxn_simd.h"
-#include "gromacs/mdtypes/interaction_const.h"
-#include "gromacs/mdtypes/md_enums.h"
-
-#ifdef GMX_NBNXN_SIMD_4XN
-
-#include "gromacs/simd/vector_operations.h"
-
-#if !(GMX_SIMD_REAL_WIDTH == 2 || GMX_SIMD_REAL_WIDTH == 4 || GMX_SIMD_REAL_WIDTH == 8)
-#error "unsupported SIMD width"
-#endif
-
-#define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
-
-#include "gromacs/mdlib/force_flags.h"
-#include "gromacs/mdlib/gmx_omp_nthreads.h"
-#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_common.h"
-#include "gromacs/simd/simd.h"
-#include "gromacs/utility/fatalerror.h"
-#include "gromacs/utility/real.h"
-
-/*! \brief Kinds of electrostatic treatments in SIMD Verlet kernels
- */
-enum {
-    coulktRF, coulktTAB, coulktTAB_TWIN, coulktEWALD, coulktEWALD_TWIN, coulktNR
-};
-
-/*! \brief Kinds of Van der Waals treatments in SIMD Verlet kernels
- */
-enum {
-    vdwktLJCUT_COMBGEOM, vdwktLJCUT_COMBLB, vdwktLJCUT_COMBNONE, vdwktLJFORCESWITCH, vdwktLJPOTSWITCH, vdwktLJEWALDCOMBGEOM, vdwktNR
-};
-
-/* Declare and define the kernel function pointer lookup tables.
- * The minor index of the array goes over both the LJ combination rules,
- * which is only supported by plain cut-off, and the LJ switch/PME functions.
- */
-static p_nbk_func_noener p_nbk_noener[coulktNR][vdwktNR] =
-{
-    {
-        nbnxn_kernel_ElecRF_VdwLJCombGeom_F_4xn,
-        nbnxn_kernel_ElecRF_VdwLJCombLB_F_4xn,
-        nbnxn_kernel_ElecRF_VdwLJ_F_4xn,
-        nbnxn_kernel_ElecRF_VdwLJFSw_F_4xn,
-        nbnxn_kernel_ElecRF_VdwLJPSw_F_4xn,
-        nbnxn_kernel_ElecRF_VdwLJEwCombGeom_F_4xn,
-    },
-    {
-        nbnxn_kernel_ElecQSTab_VdwLJCombGeom_F_4xn,
-        nbnxn_kernel_ElecQSTab_VdwLJCombLB_F_4xn,
-        nbnxn_kernel_ElecQSTab_VdwLJ_F_4xn,
-        nbnxn_kernel_ElecQSTab_VdwLJFSw_F_4xn,
-        nbnxn_kernel_ElecQSTab_VdwLJPSw_F_4xn,
-        nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_F_4xn,
-    },
-    {
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombGeom_F_4xn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombLB_F_4xn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_4xn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJFSw_F_4xn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJPSw_F_4xn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_F_4xn,
-    },
-    {
-        nbnxn_kernel_ElecEw_VdwLJCombGeom_F_4xn,
-        nbnxn_kernel_ElecEw_VdwLJCombLB_F_4xn,
-        nbnxn_kernel_ElecEw_VdwLJ_F_4xn,
-        nbnxn_kernel_ElecEw_VdwLJFSw_F_4xn,
-        nbnxn_kernel_ElecEw_VdwLJPSw_F_4xn,
-        nbnxn_kernel_ElecEw_VdwLJEwCombGeom_F_4xn,
-    },
-    {
-        nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_F_4xn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_F_4xn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJ_F_4xn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_F_4xn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_F_4xn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_F_4xn,
-    },
-};
-
-static p_nbk_func_ener p_nbk_ener[coulktNR][vdwktNR] =
-{
-    {
-        nbnxn_kernel_ElecRF_VdwLJCombGeom_VF_4xn,
-        nbnxn_kernel_ElecRF_VdwLJCombLB_VF_4xn,
-        nbnxn_kernel_ElecRF_VdwLJ_VF_4xn,
-        nbnxn_kernel_ElecRF_VdwLJFSw_VF_4xn,
-        nbnxn_kernel_ElecRF_VdwLJPSw_VF_4xn,
-        nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VF_4xn,
-    },
-    {
-        nbnxn_kernel_ElecQSTab_VdwLJCombGeom_VF_4xn,
-        nbnxn_kernel_ElecQSTab_VdwLJCombLB_VF_4xn,
-        nbnxn_kernel_ElecQSTab_VdwLJ_VF_4xn,
-        nbnxn_kernel_ElecQSTab_VdwLJFSw_VF_4xn,
-        nbnxn_kernel_ElecQSTab_VdwLJPSw_VF_4xn,
-        nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VF_4xn,
-    },
-    {
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombGeom_VF_4xn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombLB_VF_4xn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_4xn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJFSw_VF_4xn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJPSw_VF_4xn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VF_4xn,
-    },
-    {
-        nbnxn_kernel_ElecEw_VdwLJCombGeom_VF_4xn,
-        nbnxn_kernel_ElecEw_VdwLJCombLB_VF_4xn,
-        nbnxn_kernel_ElecEw_VdwLJ_VF_4xn,
-        nbnxn_kernel_ElecEw_VdwLJFSw_VF_4xn,
-        nbnxn_kernel_ElecEw_VdwLJPSw_VF_4xn,
-        nbnxn_kernel_ElecEw_VdwLJEwCombGeom_VF_4xn,
-    },
-    {
-        nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_VF_4xn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_VF_4xn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJ_VF_4xn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_VF_4xn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_VF_4xn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_VF_4xn,
-    },
-};
-
-static p_nbk_func_ener p_nbk_energrp[coulktNR][vdwktNR] =
-{
-    {
-        nbnxn_kernel_ElecRF_VdwLJCombGeom_VgrpF_4xn,
-        nbnxn_kernel_ElecRF_VdwLJCombLB_VgrpF_4xn,
-        nbnxn_kernel_ElecRF_VdwLJ_VgrpF_4xn,
-        nbnxn_kernel_ElecRF_VdwLJFSw_VgrpF_4xn,
-        nbnxn_kernel_ElecRF_VdwLJPSw_VgrpF_4xn,
-        nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VgrpF_4xn,
-    },
-    {
-        nbnxn_kernel_ElecQSTab_VdwLJCombGeom_VgrpF_4xn,
-        nbnxn_kernel_ElecQSTab_VdwLJCombLB_VgrpF_4xn,
-        nbnxn_kernel_ElecQSTab_VdwLJ_VgrpF_4xn,
-        nbnxn_kernel_ElecQSTab_VdwLJFSw_VgrpF_4xn,
-        nbnxn_kernel_ElecQSTab_VdwLJPSw_VgrpF_4xn,
-        nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VgrpF_4xn,
-    },
-    {
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombGeom_VgrpF_4xn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombLB_VgrpF_4xn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_4xn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJFSw_VgrpF_4xn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJPSw_VgrpF_4xn,
-        nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VgrpF_4xn,
-    },
-    {
-        nbnxn_kernel_ElecEw_VdwLJCombGeom_VgrpF_4xn,
-        nbnxn_kernel_ElecEw_VdwLJCombLB_VgrpF_4xn,
-        nbnxn_kernel_ElecEw_VdwLJ_VgrpF_4xn,
-        nbnxn_kernel_ElecEw_VdwLJFSw_VgrpF_4xn,
-        nbnxn_kernel_ElecEw_VdwLJPSw_VgrpF_4xn,
-        nbnxn_kernel_ElecEw_VdwLJEwCombGeom_VgrpF_4xn,
-    },
-    {
-        nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_VgrpF_4xn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_VgrpF_4xn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJ_VgrpF_4xn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_VgrpF_4xn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_VgrpF_4xn,
-        nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_VgrpF_4xn,
-    },
-};
-
-
-static void
-reduce_group_energies(int ng, int ng_2log,
-                      const real *VSvdw, const real *VSc,
-                      real *Vvdw, real *Vc)
-{
-    const int unrollj      = GMX_SIMD_REAL_WIDTH/GMX_SIMD_J_UNROLL_SIZE;
-    const int unrollj_half = unrollj/2;
-    int       ng_p2, i, j, j0, j1, c, s;
-
-    ng_p2 = (1<<ng_2log);
-
-    /* The size of the x86 SIMD energy group buffer array is:
-     * ng*ng*ng_p2*unrollj_half*simd_width
-     */
-    for (i = 0; i < ng; i++)
-    {
-        for (j = 0; j < ng; j++)
-        {
-            Vvdw[i*ng+j] = 0;
-            Vc[i*ng+j]   = 0;
-        }
-
-        for (j1 = 0; j1 < ng; j1++)
-        {
-            for (j0 = 0; j0 < ng; j0++)
-            {
-                c = ((i*ng + j1)*ng_p2 + j0)*unrollj_half*unrollj;
-                for (s = 0; s < unrollj_half; s++)
-                {
-                    Vvdw[i*ng+j0] += VSvdw[c+0];
-                    Vvdw[i*ng+j1] += VSvdw[c+1];
-                    Vc  [i*ng+j0] += VSc  [c+0];
-                    Vc  [i*ng+j1] += VSc  [c+1];
-                    c             += unrollj + 2;
-                }
-            }
-        }
-    }
-}
-
-#else /* GMX_NBNXN_SIMD_4XN */
-
-#include "gromacs/utility/fatalerror.h"
-
-#endif /* GMX_NBNXN_SIMD_4XN */
-
-void
-nbnxn_kernel_simd_4xn(nbnxn_pairlist_set_t      gmx_unused *nbl_list,
-                      const nbnxn_atomdata_t    gmx_unused *nbat,
-                      const interaction_const_t gmx_unused *ic,
-                      int                       gmx_unused  ewald_excl,
-                      rvec                      gmx_unused *shift_vec,
-                      int                       gmx_unused  force_flags,
-                      int                       gmx_unused  clearF,
-                      real                      gmx_unused *fshift,
-                      real                      gmx_unused *Vc,
-                      real                      gmx_unused *Vvdw)
-#ifdef GMX_NBNXN_SIMD_4XN
-{
-    int                nnbl;
-    nbnxn_pairlist_t **nbl;
-    int                coulkt, vdwkt = 0;
-    int                nb, nthreads gmx_unused;
-
-    nnbl = nbl_list->nnbl;
-    nbl  = nbl_list->nbl;
-
-    if (EEL_RF(ic->eeltype) || ic->eeltype == eelCUT)
-    {
-        coulkt = coulktRF;
-    }
-    else
-    {
-        if (ewald_excl == ewaldexclTable)
-        {
-            if (ic->rcoulomb == ic->rvdw)
-            {
-                coulkt = coulktTAB;
-            }
-            else
-            {
-                coulkt = coulktTAB_TWIN;
-            }
-        }
-        else
-        {
-            if (ic->rcoulomb == ic->rvdw)
-            {
-                coulkt = coulktEWALD;
-            }
-            else
-            {
-                coulkt = coulktEWALD_TWIN;
-            }
-        }
-    }
-
-    if (ic->vdwtype == evdwCUT)
-    {
-        switch (ic->vdw_modifier)
-        {
-            case eintmodNONE:
-            case eintmodPOTSHIFT:
-                switch (nbat->comb_rule)
-                {
-                    case ljcrGEOM: vdwkt = vdwktLJCUT_COMBGEOM; break;
-                    case ljcrLB:   vdwkt = vdwktLJCUT_COMBLB;   break;
-                    case ljcrNONE: vdwkt = vdwktLJCUT_COMBNONE; break;
-                    default:       gmx_incons("Unknown combination rule");
-                }
-                break;
-            case eintmodFORCESWITCH:
-                vdwkt = vdwktLJFORCESWITCH;
-                break;
-            case eintmodPOTSWITCH:
-                vdwkt = vdwktLJPOTSWITCH;
-                break;
-            default:
-                gmx_incons("Unsupported VdW interaction modifier");
-        }
-    }
-    else if (ic->vdwtype == evdwPME)
-    {
-        if (ic->ljpme_comb_rule == eljpmeLB)
-        {
-            gmx_incons("The nbnxn SIMD kernels don't support LJ-PME with LB");
-        }
-        vdwkt = vdwktLJEWALDCOMBGEOM;
-    }
-    else
-    {
-        gmx_incons("Unsupported VdW interaction type");
-    }
-    // cppcheck-suppress unreadVariable
-    nthreads = gmx_omp_nthreads_get(emntNonbonded);
-#pragma omp parallel for schedule(static) num_threads(nthreads)
-    for (nb = 0; nb < nnbl; nb++)
-    {
-        // Presently, the kernels do not call C++ code that can throw, so
-        // no need for a try/catch pair in this OpenMP region.
-        nbnxn_atomdata_output_t *out;
-        real                    *fshift_p;
-
-        out = &nbat->out[nb];
-
-        if (clearF == enbvClearFYes)
-        {
-            clear_f(nbat, nb, out->f);
-        }
-
-        if ((force_flags & GMX_FORCE_VIRIAL) && nnbl == 1)
-        {
-            fshift_p = fshift;
-        }
-        else
-        {
-            fshift_p = out->fshift;
-
-            if (clearF == enbvClearFYes)
-            {
-                clear_fshift(fshift_p);
-            }
-        }
-
-        if (!(force_flags & GMX_FORCE_ENERGY))
-        {
-            /* Don't calculate energies */
-            p_nbk_noener[coulkt][vdwkt](nbl[nb], nbat,
-                                        ic,
-                                        shift_vec,
-                                        out->f,
-                                        fshift_p);
-        }
-        else if (out->nV == 1)
-        {
-            /* No energy groups */
-            out->Vvdw[0] = 0;
-            out->Vc[0]   = 0;
-
-            p_nbk_ener[coulkt][vdwkt](nbl[nb], nbat,
-                                      ic,
-                                      shift_vec,
-                                      out->f,
-                                      fshift_p,
-                                      out->Vvdw,
-                                      out->Vc);
-        }
-        else
-        {
-            /* Calculate energy group contributions */
-            int i;
-
-            for (i = 0; i < out->nVS; i++)
-            {
-                out->VSvdw[i] = 0;
-            }
-            for (i = 0; i < out->nVS; i++)
-            {
-                out->VSc[i] = 0;
-            }
-
-            p_nbk_energrp[coulkt][vdwkt](nbl[nb], nbat,
-                                         ic,
-                                         shift_vec,
-                                         out->f,
-                                         fshift_p,
-                                         out->VSvdw,
-                                         out->VSc);
-
-            reduce_group_energies(nbat->nenergrp, nbat->neg_2log,
-                                  out->VSvdw, out->VSc,
-                                  out->Vvdw, out->Vc);
-        }
-    }
-
-    if (force_flags & GMX_FORCE_ENERGY)
-    {
-        reduce_energies_over_lists(nbat, nnbl, Vvdw, Vc);
-    }
-}
-#else
-{
-    gmx_incons("nbnxn_kernel_simd_4xn called when such kernels "
-               " are not enabled.");
-}
-#endif
-#undef GMX_SIMD_J_UNROLL_SIZE
index 29f689e67e31f2e5eadbe5b262dd365f2374cbe0..38999fb88df9c52dcdca9eb05d83c74fe5a6dffa 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,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.
  * kernel type 4xn.
  */
 
-#include "gromacs/math/vectypes.h"
-#include "gromacs/mdlib/nbnxn_pairlist.h"
-#include "gromacs/mdtypes/interaction_const.h"
-#include "gromacs/utility/real.h"
 
-/*! \brief Run-time dispatcher for nbnxn kernel functions. */
-void
-nbnxn_kernel_simd_4xn(nbnxn_pairlist_set_t       *nbl_list,
-                      const nbnxn_atomdata_t     *nbat,
-                      const interaction_const_t  *ic,
-                      int                         ewald_excl,
-                      rvec                       *shift_vec,
-                      int                         force_flags,
-                      int                         clearF,
-                      real                       *fshift,
-                      real                       *Vc,
-                      real                       *Vvdw);
-
-/* Need an #include guard so that sim_util.c can include all
- * such files. */
-#ifndef _nbnxn_kernel_simd_include_h
-#define _nbnxn_kernel_simd_include_h
-/*! \brief Typedefs for declaring kernel functions. */
-typedef void (nbk_func_ener)(const nbnxn_pairlist_t     *nbl,
-                             const nbnxn_atomdata_t     *nbat,
-                             const interaction_const_t  *ic,
-                             rvec                       *shift_vec,
-                             real                       *f,
-                             real                       *fshift,
-                             real                       *Vvdw,
-                             real                       *Vc);
-typedef nbk_func_ener *p_nbk_func_ener;
-
-typedef void (nbk_func_noener)(const nbnxn_pairlist_t     *nbl,
-                               const nbnxn_atomdata_t     *nbat,
-                               const interaction_const_t  *ic,
-                               rvec                       *shift_vec,
-                               real                       *f,
-                               real                       *fshift);
-typedef nbk_func_noener *p_nbk_func_noener;
-#endif
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_common.h"
 
+/* Declare all the different kernel functions.
+ */
 nbk_func_ener         nbnxn_kernel_ElecRF_VdwLJCombGeom_VgrpF_4xn;
 nbk_func_ener         nbnxn_kernel_ElecRF_VdwLJCombLB_VgrpF_4xn;
 nbk_func_ener         nbnxn_kernel_ElecRF_VdwLJ_VgrpF_4xn;
@@ -171,3 +134,146 @@ nbk_func_noener       nbnxn_kernel_ElecEwTwinCut_VdwLJ_F_4xn;
 nbk_func_noener       nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_F_4xn;
 nbk_func_noener       nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_F_4xn;
 nbk_func_noener       nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_F_4xn;
+
+
+
+#ifdef INCLUDE_KERNELFUNCTION_TABLES
+
+/* Declare and define the kernel function pointer lookup tables.
+ * The minor index of the array goes over both the LJ combination rules,
+ * which is only supported by plain cut-off, and the LJ switch/PME functions.
+ */
+p_nbk_func_noener nbnxn_kernel_noener_simd_4xn[coulktNR][vdwktNR] =
+{
+    {
+        nbnxn_kernel_ElecRF_VdwLJCombGeom_F_4xn,
+        nbnxn_kernel_ElecRF_VdwLJCombLB_F_4xn,
+        nbnxn_kernel_ElecRF_VdwLJ_F_4xn,
+        nbnxn_kernel_ElecRF_VdwLJFSw_F_4xn,
+        nbnxn_kernel_ElecRF_VdwLJPSw_F_4xn,
+        nbnxn_kernel_ElecRF_VdwLJEwCombGeom_F_4xn,
+    },
+    {
+        nbnxn_kernel_ElecQSTab_VdwLJCombGeom_F_4xn,
+        nbnxn_kernel_ElecQSTab_VdwLJCombLB_F_4xn,
+        nbnxn_kernel_ElecQSTab_VdwLJ_F_4xn,
+        nbnxn_kernel_ElecQSTab_VdwLJFSw_F_4xn,
+        nbnxn_kernel_ElecQSTab_VdwLJPSw_F_4xn,
+        nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_F_4xn,
+    },
+    {
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombGeom_F_4xn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombLB_F_4xn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_4xn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJFSw_F_4xn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJPSw_F_4xn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_F_4xn,
+    },
+    {
+        nbnxn_kernel_ElecEw_VdwLJCombGeom_F_4xn,
+        nbnxn_kernel_ElecEw_VdwLJCombLB_F_4xn,
+        nbnxn_kernel_ElecEw_VdwLJ_F_4xn,
+        nbnxn_kernel_ElecEw_VdwLJFSw_F_4xn,
+        nbnxn_kernel_ElecEw_VdwLJPSw_F_4xn,
+        nbnxn_kernel_ElecEw_VdwLJEwCombGeom_F_4xn,
+    },
+    {
+        nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_F_4xn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_F_4xn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJ_F_4xn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_F_4xn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_F_4xn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_F_4xn,
+    },
+};
+
+p_nbk_func_ener nbnxn_kernel_ener_simd_4xn[coulktNR][vdwktNR] =
+{
+    {
+        nbnxn_kernel_ElecRF_VdwLJCombGeom_VF_4xn,
+        nbnxn_kernel_ElecRF_VdwLJCombLB_VF_4xn,
+        nbnxn_kernel_ElecRF_VdwLJ_VF_4xn,
+        nbnxn_kernel_ElecRF_VdwLJFSw_VF_4xn,
+        nbnxn_kernel_ElecRF_VdwLJPSw_VF_4xn,
+        nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VF_4xn,
+    },
+    {
+        nbnxn_kernel_ElecQSTab_VdwLJCombGeom_VF_4xn,
+        nbnxn_kernel_ElecQSTab_VdwLJCombLB_VF_4xn,
+        nbnxn_kernel_ElecQSTab_VdwLJ_VF_4xn,
+        nbnxn_kernel_ElecQSTab_VdwLJFSw_VF_4xn,
+        nbnxn_kernel_ElecQSTab_VdwLJPSw_VF_4xn,
+        nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VF_4xn,
+    },
+    {
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombGeom_VF_4xn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombLB_VF_4xn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_4xn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJFSw_VF_4xn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJPSw_VF_4xn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VF_4xn,
+    },
+    {
+        nbnxn_kernel_ElecEw_VdwLJCombGeom_VF_4xn,
+        nbnxn_kernel_ElecEw_VdwLJCombLB_VF_4xn,
+        nbnxn_kernel_ElecEw_VdwLJ_VF_4xn,
+        nbnxn_kernel_ElecEw_VdwLJFSw_VF_4xn,
+        nbnxn_kernel_ElecEw_VdwLJPSw_VF_4xn,
+        nbnxn_kernel_ElecEw_VdwLJEwCombGeom_VF_4xn,
+    },
+    {
+        nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_VF_4xn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_VF_4xn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJ_VF_4xn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_VF_4xn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_VF_4xn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_VF_4xn,
+    },
+};
+
+p_nbk_func_ener nbnxn_kernel_energrp_simd_4xn[coulktNR][vdwktNR] =
+{
+    {
+        nbnxn_kernel_ElecRF_VdwLJCombGeom_VgrpF_4xn,
+        nbnxn_kernel_ElecRF_VdwLJCombLB_VgrpF_4xn,
+        nbnxn_kernel_ElecRF_VdwLJ_VgrpF_4xn,
+        nbnxn_kernel_ElecRF_VdwLJFSw_VgrpF_4xn,
+        nbnxn_kernel_ElecRF_VdwLJPSw_VgrpF_4xn,
+        nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VgrpF_4xn,
+    },
+    {
+        nbnxn_kernel_ElecQSTab_VdwLJCombGeom_VgrpF_4xn,
+        nbnxn_kernel_ElecQSTab_VdwLJCombLB_VgrpF_4xn,
+        nbnxn_kernel_ElecQSTab_VdwLJ_VgrpF_4xn,
+        nbnxn_kernel_ElecQSTab_VdwLJFSw_VgrpF_4xn,
+        nbnxn_kernel_ElecQSTab_VdwLJPSw_VgrpF_4xn,
+        nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VgrpF_4xn,
+    },
+    {
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombGeom_VgrpF_4xn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombLB_VgrpF_4xn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_4xn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJFSw_VgrpF_4xn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJPSw_VgrpF_4xn,
+        nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VgrpF_4xn,
+    },
+    {
+        nbnxn_kernel_ElecEw_VdwLJCombGeom_VgrpF_4xn,
+        nbnxn_kernel_ElecEw_VdwLJCombLB_VgrpF_4xn,
+        nbnxn_kernel_ElecEw_VdwLJ_VgrpF_4xn,
+        nbnxn_kernel_ElecEw_VdwLJFSw_VgrpF_4xn,
+        nbnxn_kernel_ElecEw_VdwLJPSw_VgrpF_4xn,
+        nbnxn_kernel_ElecEw_VdwLJEwCombGeom_VgrpF_4xn,
+    },
+    {
+        nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_VgrpF_4xn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_VgrpF_4xn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJ_VgrpF_4xn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_VgrpF_4xn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_VgrpF_4xn,
+        nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_VgrpF_4xn,
+    },
+};
+
+
+#endif /* INCLUDE_KERNELFUNCTION_TABLES */
index 7d954abb841f4b671f8448977ec0841da979fbf9..bbd25513eefdccdd5a7a750fd408117fbdf785f0 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,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.
         cr2_S2        = lje_c2_S * selectByMask(rsq_S2, wco_vdw_S2);
         cr2_S3        = lje_c2_S * selectByMask(rsq_S3, wco_vdw_S3);
 #endif
-        expmcr2_S0    = exp( -cr2_S0 );
-        expmcr2_S1    = exp( -cr2_S1 );
+        // Unsafe version of our exp() should be fine, since these arguments should never
+        // be smaller than -127 for any reasonable choice of cutoff or ewald coefficients.
+        expmcr2_S0    = exp<MathOptimization::Unsafe>( -cr2_S0 );
+        expmcr2_S1    = exp<MathOptimization::Unsafe>( -cr2_S1 );
 #ifndef HALF_LJ
-        expmcr2_S2    = exp( -cr2_S2 );
-        expmcr2_S3    = exp( -cr2_S3 );
+        expmcr2_S2    = exp<MathOptimization::Unsafe>( -cr2_S2 );
+        expmcr2_S3    = exp<MathOptimization::Unsafe>( -cr2_S3 );
 #endif
 
         /* 1 + cr2 + 1/2*cr2^2 */
index 86bf7e8897f1f3f7b65e8908cf9776baacf74ecf..e7e5842086a0487e5e3efb6eaa49f4cfbe8afc41 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,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.
 #else
         const real *nbfp0     = nbfp_ptr + type[sci  ]*nbat->ntype*c_simdBestPairAlignment;
         const real *nbfp1     = nbfp_ptr + type[sci+1]*nbat->ntype*c_simdBestPairAlignment;
-        const real *nbfp2     = NULL, *nbfp3 = NULL;
+        const real *nbfp2     = nullptr, *nbfp3 = nullptr;
         if (!half_LJ)
         {
             nbfp2 = nbfp_ptr + type[sci+2]*nbat->ntype*c_simdBestPairAlignment;
diff --git a/src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_prune.cpp b/src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_prune.cpp
new file mode 100644 (file)
index 0000000..d6b4203
--- /dev/null
@@ -0,0 +1,191 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+
+#include "gmxpre.h"
+
+#include "nbnxn_kernel_simd_4xn_prune.h"
+
+#include "gromacs/mdlib/nbnxn_pairlist.h"
+#include "gromacs/mdlib/nbnxn_simd.h"
+#include "gromacs/utility/gmxassert.h"
+
+#ifdef GMX_NBNXN_SIMD_4XN
+#define GMX_SIMD_J_UNROLL_SIZE 1
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
+#endif
+
+/* Prune a single nbnxn_pairtlist_t entry with distance rlistInner */
+void
+nbnxn_kernel_prune_4xn(nbnxn_pairlist_t *         nbl,
+                       const nbnxn_atomdata_t *   nbat,
+                       const rvec * gmx_restrict  shift_vec,
+                       real                       rlistInner)
+{
+#ifdef GMX_NBNXN_SIMD_4XN
+    const nbnxn_ci_t * gmx_restrict ciOuter  = nbl->ciOuter;
+    nbnxn_ci_t       * gmx_restrict ciInner  = nbl->ci;
+
+    const nbnxn_cj_t * gmx_restrict cjOuter  = nbl->cjOuter;
+    nbnxn_cj_t       * gmx_restrict cjInner  = nbl->cj;
+
+    const real       * gmx_restrict shiftvec = shift_vec[0];
+    const real       * gmx_restrict x        = nbat->x;
+
+    const SimdReal                  rlist2_S(rlistInner*rlistInner);
+
+    /* Initialize the new list as empty and add pairs that are in range */
+    int nciInner = 0;
+    int ncjInner = 0;
+    for (int i = 0; i < nbl->nciOuter; i++)
+    {
+        const nbnxn_ci_t * gmx_restrict ciEntry = &ciOuter[i];
+
+        /* Copy the original list entry to the pruned entry */
+        ciInner[nciInner].ci           = ciEntry->ci;
+        ciInner[nciInner].shift        = ciEntry->shift;
+        ciInner[nciInner].cj_ind_start = ncjInner;
+
+        /* Extract shift data */
+        int      ish     = (ciEntry->shift & NBNXN_CI_SHIFT);
+        int      ish3    = ish*3;
+        int      ci      = ciEntry->ci;
+
+        SimdReal shX_S   = SimdReal(shiftvec[ish3    ]);
+        SimdReal shY_S   = SimdReal(shiftvec[ish3 + 1]);
+        SimdReal shZ_S   = SimdReal(shiftvec[ish3 + 2]);
+
+#if UNROLLJ <= 4
+        int      sci     = ci*STRIDE;
+        int      scix    = sci*DIM;
+#else
+        int      sci     = (ci >> 1)*STRIDE;
+        int      scix    = sci*DIM + (ci & 1)*(STRIDE >> 1);
+        sci             += (ci & 1)*(STRIDE >> 1);
+#endif
+
+        /* Load i atom data */
+        int      sciy    = scix + STRIDE;
+        int      sciz    = sciy + STRIDE;
+        SimdReal ix_S0   = SimdReal(x[scix    ]) + shX_S;
+        SimdReal ix_S1   = SimdReal(x[scix + 1]) + shX_S;
+        SimdReal ix_S2   = SimdReal(x[scix + 2]) + shX_S;
+        SimdReal ix_S3   = SimdReal(x[scix + 3]) + shX_S;
+        SimdReal iy_S0   = SimdReal(x[sciy    ]) + shY_S;
+        SimdReal iy_S1   = SimdReal(x[sciy + 1]) + shY_S;
+        SimdReal iy_S2   = SimdReal(x[sciy + 2]) + shY_S;
+        SimdReal iy_S3   = SimdReal(x[sciy + 3]) + shY_S;
+        SimdReal iz_S0   = SimdReal(x[sciz    ]) + shZ_S;
+        SimdReal iz_S1   = SimdReal(x[sciz + 1]) + shZ_S;
+        SimdReal iz_S2   = SimdReal(x[sciz + 2]) + shZ_S;
+        SimdReal iz_S3   = SimdReal(x[sciz + 3]) + shZ_S;
+
+        for (int cjind = ciEntry->cj_ind_start; cjind < ciEntry->cj_ind_end; cjind++)
+        {
+            /* j-cluster index */
+            int cj      = cjOuter[cjind].cj;
+
+            /* Atom indices (of the first atom in the cluster) */
+            int aj      = cj*UNROLLJ;
+#if UNROLLJ == STRIDE
+            int ajx     = aj*DIM;
+#else
+            int ajx     = (cj >> 1)*DIM*STRIDE + (cj & 1)*UNROLLJ;
+#endif
+            int ajy     = ajx + STRIDE;
+            int ajz     = ajy + STRIDE;
+
+            /* load j atom coordinates */
+            SimdReal jx_S   = load(x + ajx);
+            SimdReal jy_S   = load(x + ajy);
+            SimdReal jz_S   = load(x + ajz);
+
+            /* Calculate distance */
+            SimdReal dx_S0  = ix_S0 - jx_S;
+            SimdReal dy_S0  = iy_S0 - jy_S;
+            SimdReal dz_S0  = iz_S0 - jz_S;
+            SimdReal dx_S1  = ix_S1 - jx_S;
+            SimdReal dy_S1  = iy_S1 - jy_S;
+            SimdReal dz_S1  = iz_S1 - jz_S;
+            SimdReal dx_S2  = ix_S2 - jx_S;
+            SimdReal dy_S2  = iy_S2 - jy_S;
+            SimdReal dz_S2  = iz_S2 - jz_S;
+            SimdReal dx_S3  = ix_S3 - jx_S;
+            SimdReal dy_S3  = iy_S3 - jy_S;
+            SimdReal dz_S3  = iz_S3 - jz_S;
+
+            /* rsq = dx*dx+dy*dy+dz*dz */
+            SimdReal rsq_S0 = norm2(dx_S0, dy_S0, dz_S0);
+            SimdReal rsq_S1 = norm2(dx_S1, dy_S1, dz_S1);
+            SimdReal rsq_S2 = norm2(dx_S2, dy_S2, dz_S2);
+            SimdReal rsq_S3 = norm2(dx_S3, dy_S3, dz_S3);
+
+            /* Do the cut-off check */
+            SimdBool wco_S0 = (rsq_S0 < rlist2_S);
+            SimdBool wco_S1 = (rsq_S1 < rlist2_S);
+            SimdBool wco_S2 = (rsq_S2 < rlist2_S);
+            SimdBool wco_S3 = (rsq_S3 < rlist2_S);
+
+            wco_S0          = wco_S0 || wco_S1;
+            wco_S2          = wco_S2 || wco_S3;
+            wco_S0          = wco_S0 || wco_S2;
+
+            /* Putting the assignment inside the conditional is slower */
+            cjInner[ncjInner] = cjOuter[cjind];
+            if (anyTrue(wco_S0))
+            {
+                ncjInner++;
+            }
+        }
+
+        if (ncjInner > ciInner[nciInner].cj_ind_start)
+        {
+            ciInner[nciInner].cj_ind_end = ncjInner;
+            nciInner++;
+        }
+    }
+
+    nbl->nci = nciInner;
+
+#else  /* GMX_NBNXN_SIMD_4XN */
+
+    GMX_RELEASE_ASSERT(false, "4xN kernel called without 4xN support");
+
+    GMX_UNUSED_VALUE(nbl);
+    GMX_UNUSED_VALUE(nbat);
+    GMX_UNUSED_VALUE(shift_vec);
+    GMX_UNUSED_VALUE(rlistInner);
+
+#endif /* GMX_NBNXN_SIMD_4XN */
+}
diff --git a/src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_prune.h b/src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_prune.h
new file mode 100644 (file)
index 0000000..55b3ce7
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+
+/*! \internal \file
+ *
+ * \brief
+ * Declares the SIMD 4xN pruning only kernel.
+ *
+ * \author Berk Hess <hess@kth.se>
+ */
+
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
+
+struct nbnxn_atomdata_t;
+struct nbnxn_pairlist_t;
+
+/*! \brief Prune a single nbnxn_pairlist_t entry with distance \p rlistInner
+ *
+ * Reads a cluster pairlist \p nbl->ciOuter, \p nbl->cjOuter and writes
+ * all cluster pairs within \p rlistInner to \p nbl->ci, \p nbl->cj.
+ */
+void
+nbnxn_kernel_prune_4xn(nbnxn_pairlist_t *         nbl,
+                       const nbnxn_atomdata_t *   nbat,
+                       const rvec * gmx_restrict  shift_vec,
+                       real                       rlistInner);
index b0b33ce2964fd610d3e5d941683a3679c703c03b..4e4f618b4f25c2a4b70ebdda2215ad5a844369c4 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,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.
  *  \author Dimitrios Karkoulis <dimitris.karkoulis@gmail.com>
  *  \author Szilárd Páll <pall.szilard@gmail.com>
  *  \ingroup module_mdlib
+ *
+ *  TODO (psz):
+ *  - Add a static const cl_uint c_pruneKernelWorkDim / c_nbnxnKernelWorkDim = 3;
+ *  - Rework the copying of OCL data structures done before every invocation of both
+ *    nb and prune kernels (using fillin_ocl_structures); also consider at the same
+ *    time calling clSetKernelArg only on the updated parameters (if tracking changed
+ *    parameters is feasible);
+ *  - Consider using the event_wait_list argument to clEnqueueNDRangeKernel to mark
+ *    dependencies on the kernel launched: e.g. the non-local nb kernel's dependency
+ *    on the misc_ops_and_local_H2D_done event could be better expressed this way.
+ *
+ *  - Consider extracting common sections of the OpenCL and CUDA nbnxn logic, e.g:
+ *    - in nbnxn_gpu_launch_kernel_pruneonly() the pre- and post-kernel launch logic
+ *      is identical in the two implementations, so a 3-way split might allow sharing
+ *      code;
+ *    -
+ *
  */
 #include "gmxpre.h"
 
-#include "config.h"
-
 #include <assert.h>
 #include <stdlib.h>
 
 #include <limits>
 #endif
 
+#include "thread_mpi/atomic.h"
+
 #include "gromacs/gpu_utils/oclutils.h"
 #include "gromacs/hardware/hw_info.h"
 #include "gromacs/mdlib/force_flags.h"
 #include "gromacs/mdlib/nb_verlet.h"
 #include "gromacs/mdlib/nbnxn_consts.h"
-#include "gromacs/mdlib/nbnxn_pairlist.h"
-#include "gromacs/timing/gpu_timing.h"
-
-#ifdef TMPI_ATOMICS
-#include "thread_mpi/atomic.h"
-#endif
-
 #include "gromacs/mdlib/nbnxn_gpu.h"
 #include "gromacs/mdlib/nbnxn_gpu_data_mgmt.h"
+#include "gromacs/mdlib/nbnxn_pairlist.h"
 #include "gromacs/pbcutil/ishift.h"
+#include "gromacs/timing/gpu_timing.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxassert.h"
@@ -99,7 +111,7 @@ static bool always_prune = (getenv("GMX_GPU_ALWAYS_PRUNE") != NULL);
 
 /*! \brief Validates the input global work size parameter.
  */
-static inline void validate_global_work_size(size_t *global_work_size, int work_dim, gmx_device_info_t *dinfo)
+static inline void validate_global_work_size(size_t *global_work_size, int work_dim, const gmx_device_info_t *dinfo)
 {
     cl_uint device_size_t_size_bits;
     cl_uint host_size_t_size_bits;
@@ -191,6 +203,28 @@ static const char* nb_kfunc_ener_prune_ptr[eelOclNR][evdwOclNR] =
     { "nbnxn_kernel_ElecEwTwinCut_VdwLJ_VF_prune_opencl",      "nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_VF_prune_opencl",      "nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_VF_prune_opencl",      "nbnxn_kernel_ElecEwTwinCut_VdwLJFsw_VF_prune_opencl",      "nbnxn_kernel_ElecEwTwinCut_VdwLJPsw_VF_prune_opencl",      "nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_VF_prune_opencl",      "nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombLB_VF_prune_opencl"      }
 };
 
+/*! \brief Return a pointer to the prune kernel version to be executed at the current invocation.
+ *
+ * \param[in] kernel_pruneonly  array of prune kernel objects
+ * \param[in] firstPrunePass    true if the first pruning pass is being executed
+ */
+static inline cl_kernel selectPruneKernel(cl_kernel kernel_pruneonly[],
+                                          bool      firstPrunePass)
+{
+    cl_kernel  *kernelPtr;
+
+    if (firstPrunePass)
+    {
+        kernelPtr = &(kernel_pruneonly[epruneFirst]);
+    }
+    else
+    {
+        kernelPtr = &(kernel_pruneonly[epruneRolling]);
+    }
+    // TODO: consider creating the prune kernel object here to avoid a
+    // clCreateKernel for the rolling prune kernel if this is not needed.
+    return *kernelPtr;
+}
 
 /*! \brief Return a pointer to the kernel version to be executed at the current step.
  *  OpenCL kernel objects are cached in nb. If the requested kernel is not
@@ -246,10 +280,10 @@ static inline cl_kernel select_nbnxn_kernel(gmx_nbnxn_ocl_t   *nb,
     return *kernel_ptr;
 }
 
-/*! \brief Calculates the amount of shared memory required by the OpenCL kernel in use.
+/*! \brief Calculates the amount of shared memory required by the nonbonded kernel in use.
  */
-static inline int calc_shmem_required(int  vdwType,
-                                      bool bPrefetchLjParam)
+static inline int calc_shmem_required_nonbonded(int  vdwType,
+                                                bool bPrefetchLjParam)
 {
     int shmem;
 
@@ -284,6 +318,8 @@ static inline int calc_shmem_required(int  vdwType,
  *  The device can't use the same data structures as the host for two main reasons:
  *  - OpenCL restrictions (pointers are not accepted inside data structures)
  *  - some host side fields are not needed for the OpenCL kernels.
+ *
+ *  This function is called before the launch of both nbnxn and prune kernels.
  */
 static void fillin_ocl_structures(cl_nbparam_t        *nbp,
                                   cl_nbparam_params_t *nbparams_params)
@@ -298,8 +334,9 @@ static void fillin_ocl_structures(cl_nbparam_t        *nbp,
     nbparams_params->ewald_beta        = nbp->ewald_beta;
     nbparams_params->rcoulomb_sq       = nbp->rcoulomb_sq;
     nbparams_params->repulsion_shift   = nbp->repulsion_shift;
-    nbparams_params->rlist_sq          = nbp->rlist_sq;
+    nbparams_params->rlistOuter_sq     = nbp->rlistOuter_sq;
     nbparams_params->rvdw_sq           = nbp->rvdw_sq;
+    nbparams_params->rlistInner_sq     = nbp->rlistInner_sq;
     nbparams_params->rvdw_switch       = nbp->rvdw_switch;
     nbparams_params->sh_ewald          = nbp->sh_ewald;
     nbparams_params->sh_lj_ewald       = nbp->sh_lj_ewald;
@@ -308,30 +345,12 @@ static void fillin_ocl_structures(cl_nbparam_t        *nbp,
     nbparams_params->vdw_switch        = nbp->vdw_switch;
 }
 
-/*! \brief Waits for the commands associated with the input event to finish.
- * Then it releases the event and sets it to 0.
- * Don't use this function when more than one wait will be issued for the event.
- */
-void wait_ocl_event(cl_event *ocl_event)
-{
-    cl_int gmx_unused cl_error;
-
-    /* Blocking wait for the event */
-    cl_error = clWaitForEvents(1, ocl_event);
-    assert(CL_SUCCESS == cl_error);
-
-    /* Release event and reset it to 0 */
-    cl_error = clReleaseEvent(*ocl_event);
-    assert(CL_SUCCESS == cl_error);
-    *ocl_event = 0;
-}
-
 /*! \brief Enqueues a wait for event completion.
  *
  * Then it releases the event and sets it to 0.
  * Don't use this function when more than one wait will be issued for the event.
  * Equivalent to Cuda Stream Sync. */
-void sync_ocl_event(cl_command_queue stream, cl_event *ocl_event)
+static void sync_ocl_event(cl_command_queue stream, cl_event *ocl_event)
 {
     cl_int gmx_unused cl_error;
 
@@ -358,7 +377,7 @@ void sync_ocl_event(cl_command_queue stream, cl_event *ocl_event)
  * The function returns 0.0 if the input event, *ocl_event, is 0.
  * Don't use this function when more than one wait will be issued for the event.
  */
-double ocl_event_elapsed_ms(cl_event *ocl_event)
+static double ocl_event_elapsed_ms(cl_event *ocl_event)
 {
     cl_int gmx_unused cl_error;
     cl_ulong          start_ns, end_ns;
@@ -447,6 +466,8 @@ void nbnxn_gpu_launch_kernel(gmx_nbnxn_ocl_t               *nb,
        call is taken care of later in this function. */
     if (iloc == eintNonlocal && plist->nsci == 0)
     {
+        plist->haveFreshList = false;
+
         return;
     }
 
@@ -495,6 +516,15 @@ void nbnxn_gpu_launch_kernel(gmx_nbnxn_ocl_t               *nb,
         }
     }
 
+    if (nbp->useDynamicPruning && plist->haveFreshList)
+    {
+        /* Prunes for rlistOuter and rlistInner, sets plist->haveFreshList=false
+           (that's the way the timing accounting can distinguish between
+           separate prune kernel and combined force+prune).
+         */
+        nbnxn_gpu_launch_kernel_pruneonly(nb, iloc, 1);
+    }
+
     if (plist->nsci == 0)
     {
         /* Don't launch an empty local kernel (is not allowed with OpenCL).
@@ -510,7 +540,7 @@ void nbnxn_gpu_launch_kernel(gmx_nbnxn_ocl_t               *nb,
                                     nbp->eeltype,
                                     nbp->vdwtype,
                                     bCalcEner,
-                                    plist->bDoPrune || always_prune);
+                                    (plist->haveFreshList && !nb->timers->didPrune[iloc]) || always_prune);
 
     /* kernel launch config */
     local_work_size[0] = c_clSize;
@@ -523,7 +553,7 @@ void nbnxn_gpu_launch_kernel(gmx_nbnxn_ocl_t               *nb,
 
     validate_global_work_size(global_work_size, 3, nb->dev_info);
 
-    shmem     = calc_shmem_required(nbp->vdwtype, nb->bPrefetchLjParam);
+    shmem     = calc_shmem_required_nonbonded(nbp->vdwtype, nb->bPrefetchLjParam);
 
 #ifdef DEBUG_OCL
     {
@@ -549,7 +579,7 @@ void nbnxn_gpu_launch_kernel(gmx_nbnxn_ocl_t               *nb,
 #endif
     if (debug)
     {
-        fprintf(debug, "GPU launch configuration:\n\tLocal work size: %dx%dx%d\n\t"
+        fprintf(debug, "Non-bonded GPU launch configuration:\n\tLocal work size: %dx%dx%d\n\t"
                 "Global work size : %dx%d\n\t#Super-clusters/clusters: %d/%d (%d)\n",
                 (int)(local_work_size[0]), (int)(local_work_size[1]), (int)(local_work_size[2]),
                 (int)(global_work_size[0]), (int)(global_work_size[1]), plist->nsci*c_numClPerSupercl,
@@ -654,6 +684,158 @@ void nbnxn_gpu_launch_kernel(gmx_nbnxn_ocl_t               *nb,
     }
 #endif
 }
+
+
+/*! \brief Calculates the amount of shared memory required by the prune kernel.
+ *
+ *  Note that for the sake of simplicity we use the CUDA terminology "shared memory"
+ *  for OpenCL local memory.
+ *
+ * \param[in] num_threads_z cj4 concurrency equal to the number of threads/work items in the 3-rd dimension.
+ * \returns   the amount of local memory in bytes required by the pruning kernel
+ */
+static inline int calc_shmem_required_prune(const int num_threads_z)
+{
+    int shmem;
+
+    /* i-atom x in shared memory (for convenience we load all 4 components including q) */
+    shmem  = c_numClPerSupercl * c_clSize * sizeof(float)*4;
+    /* cj in shared memory, for each warp separately */
+    shmem += num_threads_z * c_nbnxnGpuClusterpairSplit * c_nbnxnGpuJgroupSize * sizeof(int);
+    /* Warp vote, requires one uint per warp/32 threads per block. */
+    shmem += sizeof(cl_uint) * 2*num_threads_z;
+
+    return shmem;
+}
+
+void nbnxn_gpu_launch_kernel_pruneonly(gmx_nbnxn_gpu_t       *nb,
+                                       int                    iloc,
+                                       int                    numParts)
+{
+    cl_int               cl_error;
+
+    cl_atomdata_t       *adat    = nb->atdat;
+    cl_nbparam_t        *nbp     = nb->nbparam;
+    cl_plist_t          *plist   = nb->plist[iloc];
+    cl_timers_t         *t       = nb->timers;
+    cl_command_queue     stream  = nb->stream[iloc];
+    bool                 bDoTime = nb->bDoTime;
+
+    if (plist->haveFreshList)
+    {
+        GMX_ASSERT(numParts == 1, "With first pruning we expect 1 part");
+
+        /* Set rollingPruningNumParts to signal that it is not set */
+        plist->rollingPruningNumParts = 0;
+        plist->rollingPruningPart     = 0;
+    }
+    else
+    {
+        if (plist->rollingPruningNumParts == 0)
+        {
+            plist->rollingPruningNumParts = numParts;
+        }
+        else
+        {
+            GMX_ASSERT(numParts == plist->rollingPruningNumParts, "It is not allowed to change numParts in between list generation steps");
+        }
+    }
+
+    /* Use a local variable for part and update in plist, so we can return here
+     * without duplicating the part increment code.
+     */
+    int part = plist->rollingPruningPart;
+
+    plist->rollingPruningPart++;
+    if (plist->rollingPruningPart >= plist->rollingPruningNumParts)
+    {
+        plist->rollingPruningPart = 0;
+    }
+
+    /* Compute the number of list entries to prune in this pass */
+    int numSciInPart = (plist->nsci - part)/numParts;
+
+    /* Don't launch the kernel if there is no work to do. */
+    if (numSciInPart <= 0)
+    {
+        plist->haveFreshList = false;
+
+        return;
+    }
+
+    /* Kernel launch config:
+     * - The thread block dimensions match the size of i-clusters, j-clusters,
+     *   and j-cluster concurrency, in x, y, and z, respectively.
+     * - The 1D block-grid contains as many blocks as super-clusters.
+     */
+    int       num_threads_z = getOclPruneKernelJ4Concurrency(nb->dev_info->vendor_e);
+    cl_kernel pruneKernel   = selectPruneKernel(nb->kernel_pruneonly, plist->haveFreshList);
+
+    /* kernel launch config */
+    size_t  local_work_size[3], global_work_size[3];
+    local_work_size[0] = c_clSize;
+    local_work_size[1] = c_clSize;
+    local_work_size[2] = num_threads_z;
+
+    global_work_size[0] = numSciInPart * local_work_size[0];
+    global_work_size[1] = 1 * local_work_size[1];
+    global_work_size[2] = 1 * local_work_size[2];
+
+    validate_global_work_size(global_work_size, 3, nb->dev_info);
+
+    int shmem = calc_shmem_required_prune(num_threads_z);
+
+    if (debug)
+    {
+        fprintf(debug, "Pruning GPU kernel launch configuration:\n\tLocal work size: %dx%dx%d\n\t"
+                "\tGlobal work size: %dx%d\n\t#Super-clusters/clusters: %d/%d (%d)\n"
+                "\tShMem: %d\n",
+                (int)(local_work_size[0]), (int)(local_work_size[1]), (int)(local_work_size[2]),
+                (int)(global_work_size[0]), (int)(global_work_size[1]), plist->nsci*c_numClPerSupercl,
+                c_numClPerSupercl, plist->na_c, shmem);
+    }
+
+    cl_nbparam_params_t  nbparams_params;
+    fillin_ocl_structures(nbp, &nbparams_params);
+
+    cl_uint  arg_no = 0;
+    cl_error = CL_SUCCESS;
+
+    cl_error |= clSetKernelArg(pruneKernel, arg_no++, sizeof(nbparams_params), &(nbparams_params));
+    cl_error |= clSetKernelArg(pruneKernel, arg_no++, sizeof(cl_mem), &(adat->xq));
+    cl_error |= clSetKernelArg(pruneKernel, arg_no++, sizeof(cl_mem), &(adat->shift_vec));
+    cl_error |= clSetKernelArg(pruneKernel, arg_no++, sizeof(cl_mem), &(plist->sci));
+    cl_error |= clSetKernelArg(pruneKernel, arg_no++, sizeof(cl_mem), &(plist->cj4));
+    cl_error |= clSetKernelArg(pruneKernel, arg_no++, sizeof(cl_mem), &(plist->imask));
+    cl_error |= clSetKernelArg(pruneKernel, arg_no++, sizeof(int), &(numParts));
+    cl_error |= clSetKernelArg(pruneKernel, arg_no++, sizeof(int), &(part));
+    cl_error |= clSetKernelArg(pruneKernel, arg_no++, shmem, nullptr);
+    assert(cl_error == CL_SUCCESS);
+
+    cl_event *pruneEventPtr = nullptr;
+    if (bDoTime)
+    {
+        pruneEventPtr = plist->haveFreshList ? &t->prune_k[iloc] : &t->rollingPrune_k[iloc];
+    }
+
+    cl_error = clEnqueueNDRangeKernel(stream, pruneKernel, 3,
+                                      nullptr, global_work_size, local_work_size,
+                                      0, nullptr, pruneEventPtr);
+    GMX_RELEASE_ASSERT(CL_SUCCESS == cl_error, ocl_get_error_string(cl_error).c_str());
+
+    if (plist->haveFreshList)
+    {
+        plist->haveFreshList         = false;
+        /* Mark that pruning has been done */
+        nb->timers->didPrune[iloc] = true;
+    }
+    else
+    {
+        /* Mark that rolling pruning has been done */
+        nb->timers->didRollingPrune[iloc] = true;
+    }
+}
+
 /*! \brief
  * Launch asynchronously the download of nonbonded forces from the GPU
  * (and energies/shift forces if required).
@@ -775,6 +957,42 @@ void nbnxn_gpu_launch_cpyback(gmx_nbnxn_ocl_t               *nb,
     }
 }
 
+/*! \brief Count pruning kernel time if either kernel has been triggered
+ *
+ *  We do the accounting for either of the two pruning kernel flavors:
+ *   - 1st pass prune: ran during the current step (prior to the force kernel);
+ *   - rolling prune:  ran at the end of the previous step (prior to the current step H2D xq);
+ *
+ * Note that the resetting of cu_timers_t::didPrune and cu_timers_t::didRollingPrune should happen
+ * after calling this function.
+ *
+ * \param[inout] timers   structs with OCL timer objects
+ * \param[inout] timings  GPU task timing data
+ * \param[in] iloc        interaction locality
+ */
+static void countPruneKernelTime(cl_timers_t         *timers,
+                                 gmx_wallclock_gpu_t *timings,
+                                 const int            iloc)
+{
+    // We might have not done any pruning (e.g. if we skipped with empty domains).
+    if (!timers->didPrune[iloc] && !timers->didRollingPrune[iloc])
+    {
+        return;
+    }
+
+    if (timers->didPrune[iloc])
+    {
+        timings->pruneTime.c++;
+        timings->pruneTime.t += ocl_event_elapsed_ms(&timers->prune_k[iloc]);
+    }
+
+    if (timers->didRollingPrune[iloc])
+    {
+        timings->dynamicPruneTime.c++;
+        timings->dynamicPruneTime.t += ocl_event_elapsed_ms(&timers->rollingPrune_k[iloc]);
+    }
+}
+
 /*! \brief
  * Wait for the asynchronously launched nonbonded calculations and data
  * transfers to finish.
@@ -785,7 +1003,7 @@ void nbnxn_gpu_wait_for_gpu(gmx_nbnxn_ocl_t *nb,
 {
     /* NOTE:  only implemented for single-precision at this time */
     cl_int gmx_unused      cl_error;
-    int                    i, iloc = -1;
+    int                    iloc = -1;
 
     /* determine interaction locality from atom locality */
     if (LOCAL_A(aloc))
@@ -815,85 +1033,95 @@ void nbnxn_gpu_wait_for_gpu(gmx_nbnxn_ocl_t *nb,
     /* turn energy calculation always on/off (for debugging/testing only) */
     bCalcEner = (bCalcEner || always_ener) && !never_ener;
 
-    /* Launch wait/update timers & counters, unless doing the non-local phase
-       when there is not actually work to do. This is consistent with
-       nbnxn_gpu_launch_kernel.
+    /* Launch wait/update timers & counters and do reduction into staging buffers
+       BUT skip it when during the non-local phase there was actually no work to do.
+       This is consistent with nbnxn_gpu_launch_kernel.
 
        NOTE: if timing with multiple GPUs (streams) becomes possible, the
        counters could end up being inconsistent due to not being incremented
        on some of the nodes! */
-    if (iloc == eintNonlocal && nb->plist[iloc]->nsci == 0)
+    if (!(iloc == eintNonlocal && nb->plist[iloc]->nsci == 0))
     {
-        return;
-    }
-
-    /* Actual sync point. Waits for everything to be finished in the command queue. TODO: Find out if a more fine grained solution is needed */
-    cl_error = clFinish(nb->stream[iloc]);
-    assert(CL_SUCCESS == cl_error);
+        /* Actual sync point. Waits for everything to be finished in the command queue. TODO: Find out if a more fine grained solution is needed */
+        cl_error = clFinish(nb->stream[iloc]);
+        assert(CL_SUCCESS == cl_error);
 
-    /* timing data accumulation */
-    if (nb->bDoTime)
-    {
-        /* only increase counter once (at local F wait) */
-        if (LOCAL_I(iloc))
+        /* timing data accumulation */
+        if (nb->bDoTime)
         {
-            timings->nb_c++;
-            timings->ktime[plist->bDoPrune ? 1 : 0][bCalcEner ? 1 : 0].c += 1;
-        }
+            /* only increase counter once (at local F wait) */
+            if (LOCAL_I(iloc))
+            {
+                timings->nb_c++;
+                timings->ktime[plist->haveFreshList ? 1 : 0][bCalcEner ? 1 : 0].c += 1;
+            }
 
-        /* kernel timings */
+            /* kernel timings */
 
-        timings->ktime[plist->bDoPrune ? 1 : 0][bCalcEner ? 1 : 0].t +=
-            ocl_event_elapsed_ms(timers->nb_k + iloc);
+            timings->ktime[plist->haveFreshList ? 1 : 0][bCalcEner ? 1 : 0].t +=
+                ocl_event_elapsed_ms(timers->nb_k + iloc);
 
-        /* X/q H2D and F D2H timings */
-        timings->nb_h2d_t += ocl_event_elapsed_ms(timers->nb_h2d        + iloc);
-        timings->nb_d2h_t += ocl_event_elapsed_ms(timers->nb_d2h_f      + iloc);
-        timings->nb_d2h_t += ocl_event_elapsed_ms(timers->nb_d2h_fshift + iloc);
-        timings->nb_d2h_t += ocl_event_elapsed_ms(timers->nb_d2h_e_el   + iloc);
-        timings->nb_d2h_t += ocl_event_elapsed_ms(timers->nb_d2h_e_lj   + iloc);
+            /* X/q H2D and F D2H timings */
+            timings->nb_h2d_t += ocl_event_elapsed_ms(timers->nb_h2d        + iloc);
+            timings->nb_d2h_t += ocl_event_elapsed_ms(timers->nb_d2h_f      + iloc);
+            timings->nb_d2h_t += ocl_event_elapsed_ms(timers->nb_d2h_fshift + iloc);
+            timings->nb_d2h_t += ocl_event_elapsed_ms(timers->nb_d2h_e_el   + iloc);
+            timings->nb_d2h_t += ocl_event_elapsed_ms(timers->nb_d2h_e_lj   + iloc);
 
-        /* only count atdat and pair-list H2D at pair-search step */
-        if (plist->bDoPrune)
-        {
-            /* atdat transfer timing (add only once, at local F wait) */
-            if (LOCAL_A(aloc))
+            /* Count the pruning kernel times for both cases:1st pass (at search step)
+               and rolling pruning (if called at the previous step).
+               We do the accounting here as this is the only sync point where we
+               know (without checking or additional sync-ing) that prune tasks in
+               in the current stream have completed (having just blocking-waited
+               for the force D2H). */
+            countPruneKernelTime(timers, timings, iloc);
+
+            /* only count atdat and pair-list H2D at pair-search step */
+            if (timers->didPairlistH2D[iloc])
             {
-                timings->pl_h2d_c++;
-                timings->pl_h2d_t += ocl_event_elapsed_ms(&(timers->atdat));
-            }
+                /* atdat transfer timing (add only once, at local F wait) */
+                if (LOCAL_A(aloc))
+                {
+                    timings->pl_h2d_c++;
+                    timings->pl_h2d_t += ocl_event_elapsed_ms(&(timers->atdat));
+                }
 
-            timings->pl_h2d_t +=
-                ocl_event_elapsed_ms(timers->pl_h2d_sci     + iloc) +
-                ocl_event_elapsed_ms(timers->pl_h2d_cj4     + iloc) +
-                ocl_event_elapsed_ms(timers->pl_h2d_excl    + iloc);
+                timings->pl_h2d_t +=
+                    ocl_event_elapsed_ms(timers->pl_h2d_sci     + iloc) +
+                    ocl_event_elapsed_ms(timers->pl_h2d_cj4     + iloc) +
+                    ocl_event_elapsed_ms(timers->pl_h2d_excl    + iloc);
 
+                /* Clear the timing flag for the next step */
+                timers->didPairlistH2D[iloc] = false;
+            }
         }
-    }
 
-    /* add up energies and shift forces (only once at local F wait) */
-    if (LOCAL_I(iloc))
-    {
-        if (bCalcEner)
+        /* add up energies and shift forces (only once at local F wait) */
+        if (LOCAL_I(iloc))
         {
-            *e_lj += *nbst.e_lj;
-            *e_el += *nbst.e_el;
-        }
+            if (bCalcEner)
+            {
+                *e_lj += *nbst.e_lj;
+                *e_el += *nbst.e_el;
+            }
 
-        if (bCalcFshift)
-        {
-            for (i = 0; i < SHIFTS; i++)
+            if (bCalcFshift)
             {
-                fshift[i][0] += (nbst.fshift)[i][0];
-                fshift[i][1] += (nbst.fshift)[i][1];
-                fshift[i][2] += (nbst.fshift)[i][2];
+                for (int i = 0; i < SHIFTS; i++)
+                {
+                    fshift[i][0] += (nbst.fshift)[i][0];
+                    fshift[i][1] += (nbst.fshift)[i][1];
+                    fshift[i][2] += (nbst.fshift)[i][2];
+                }
             }
         }
     }
 
-    /* turn off pruning (doesn't matter if this is pair-search step or not) */
-    plist->bDoPrune = false;
+    /* Always reset both pruning flags (doesn't hurt doing it even when timing is off). */
+    timers->didPrune[iloc] = timers->didRollingPrune[iloc] = false;
 
+    /* Turn off initial list pruning (doesn't hurt if this is not pair-search step). */
+    plist->haveFreshList = false;
 }
 
 /*! \brief Selects the Ewald kernel type, analytical or tabulated, single or twin cut-off. */
index bd7398cc0a14d294536ed0edf7e6241c81e42cb8..c765d694d10d14eff4f35f832aafd5bd87924cfb 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,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.
@@ -51,7 +51,6 @@
 
 #include "gromacs/gpu_utils/gpu_utils.h"
 #include "gromacs/gpu_utils/oclutils.h"
-#include "gromacs/hardware/detecthardware.h"
 #include "gromacs/hardware/gpu_hw_info.h"
 #include "gromacs/math/vectypes.h"
 #include "gromacs/mdlib/force_flags.h"
@@ -97,7 +96,7 @@ bool useLjCombRule(int vdwType)
  *
  * If the pointers to the size variables are NULL no resetting happens.
  */
-void ocl_free_buffered(cl_mem d_ptr, int *n, int *nalloc)
+static void ocl_free_buffered(cl_mem d_ptr, int *n, int *nalloc)
 {
     cl_int gmx_unused cl_error;
 
@@ -132,14 +131,14 @@ void ocl_free_buffered(cl_mem d_ptr, int *n, int *nalloc)
  *  for this operation or to query profiling information.
  *  OpenCL equivalent of cu_realloc_buffered.
  */
-void ocl_realloc_buffered(cl_mem *d_dest, void *h_src,
-                          size_t type_size,
-                          int *curr_size, int *curr_alloc_size,
-                          int req_size,
-                          cl_context context,
-                          cl_command_queue s,
-                          bool bAsync = true,
-                          cl_event *copy_event = NULL)
+static void ocl_realloc_buffered(cl_mem *d_dest, void *h_src,
+                                 size_t type_size,
+                                 int *curr_size, int *curr_alloc_size,
+                                 int req_size,
+                                 cl_context context,
+                                 cl_command_queue s,
+                                 bool bAsync = true,
+                                 cl_event *copy_event = NULL)
 {
     if (d_dest == NULL || req_size < 0)
     {
@@ -285,24 +284,27 @@ static void init_atomdata_first(cl_atomdata_t *ad, int ntypes, gmx_device_runtim
 /*! \brief Copies all parameters related to the cut-off from ic to nbp
  */
 static void set_cutoff_parameters(cl_nbparam_t              *nbp,
-                                  const interaction_const_t *ic)
+                                  const interaction_const_t *ic,
+                                  const NbnxnListParameters *listParams)
 {
-    nbp->ewald_beta       = ic->ewaldcoeff_q;
-    nbp->sh_ewald         = ic->sh_ewald;
-    nbp->epsfac           = ic->epsfac;
-    nbp->two_k_rf         = 2.0 * ic->k_rf;
-    nbp->c_rf             = ic->c_rf;
-    nbp->rvdw_sq          = ic->rvdw * ic->rvdw;
-    nbp->rcoulomb_sq      = ic->rcoulomb * ic->rcoulomb;
-    nbp->rlist_sq         = ic->rlist * ic->rlist;
-
-    nbp->sh_lj_ewald      = ic->sh_lj_ewald;
-    nbp->ewaldcoeff_lj    = ic->ewaldcoeff_lj;
-
-    nbp->rvdw_switch      = ic->rvdw_switch;
-    nbp->dispersion_shift = ic->dispersion_shift;
-    nbp->repulsion_shift  = ic->repulsion_shift;
-    nbp->vdw_switch       = ic->vdw_switch;
+    nbp->ewald_beta        = ic->ewaldcoeff_q;
+    nbp->sh_ewald          = ic->sh_ewald;
+    nbp->epsfac            = ic->epsfac;
+    nbp->two_k_rf          = 2.0 * ic->k_rf;
+    nbp->c_rf              = ic->c_rf;
+    nbp->rvdw_sq           = ic->rvdw * ic->rvdw;
+    nbp->rcoulomb_sq       = ic->rcoulomb * ic->rcoulomb;
+    nbp->rlistOuter_sq     = listParams->rlistOuter * listParams->rlistOuter;
+    nbp->rlistInner_sq     = listParams->rlistInner * listParams->rlistInner;
+    nbp->useDynamicPruning = listParams->useDynamicPruning;
+
+    nbp->sh_lj_ewald       = ic->sh_lj_ewald;
+    nbp->ewaldcoeff_lj     = ic->ewaldcoeff_lj;
+
+    nbp->rvdw_switch       = ic->rvdw_switch;
+    nbp->dispersion_shift  = ic->dispersion_shift;
+    nbp->repulsion_shift   = ic->repulsion_shift;
+    nbp->vdw_switch        = ic->vdw_switch;
 }
 
 /*! \brief Returns the kinds of electrostatics and Vdw OpenCL
@@ -389,6 +391,7 @@ map_interaction_types_to_gpu_kernel_flavors(const interaction_const_t *ic,
  */
 static void init_nbparam(cl_nbparam_t                    *nbp,
                          const interaction_const_t       *ic,
+                         const NbnxnListParameters       *listParams,
                          const nbnxn_atomdata_t          *nbat,
                          const gmx_device_runtime_data_t *runData)
 {
@@ -398,7 +401,7 @@ static void init_nbparam(cl_nbparam_t                    *nbp,
 
     ntypes = nbat->ntype;
 
-    set_cutoff_parameters(nbp, ic);
+    set_cutoff_parameters(nbp, ic, listParams);
 
     map_interaction_types_to_gpu_kernel_flavors(ic,
                                                 nbat->comb_rule,
@@ -495,7 +498,8 @@ static void init_nbparam(cl_nbparam_t                    *nbp,
 
 //! This function is documented in the header file
 void nbnxn_gpu_pme_loadbal_update_param(const nonbonded_verlet_t    *nbv,
-                                        const interaction_const_t   *ic)
+                                        const interaction_const_t   *ic,
+                                        const NbnxnListParameters   *listParams)
 {
     if (!nbv || nbv->grp[0].kernel_type != nbnxnk8x8x8_GPU)
     {
@@ -504,7 +508,7 @@ void nbnxn_gpu_pme_loadbal_update_param(const nonbonded_verlet_t    *nbv,
     gmx_nbnxn_ocl_t    *nb  = nbv->gpu_nbv;
     cl_nbparam_t       *nbp = nb->nbparam;
 
-    set_cutoff_parameters(nbp, ic);
+    set_cutoff_parameters(nbp, ic, listParams);
 
     nbp->eeltype = nbnxn_gpu_pick_ewald_kernel_type(ic->rcoulomb != ic->rvdw);
 
@@ -519,24 +523,33 @@ static void init_plist(cl_plist_t *pl)
        need reallocation in nbnxn_gpu_init_pairlist */
     pl->sci     = NULL;
     pl->cj4     = NULL;
+    pl->imask   = NULL;
     pl->excl    = NULL;
 
     /* size -1 indicates that the respective array hasn't been initialized yet */
-    pl->na_c        = -1;
-    pl->nsci        = -1;
-    pl->sci_nalloc  = -1;
-    pl->ncj4        = -1;
-    pl->cj4_nalloc  = -1;
-    pl->nexcl       = -1;
-    pl->excl_nalloc = -1;
-    pl->bDoPrune    = false;
+    pl->na_c           = -1;
+    pl->nsci           = -1;
+    pl->sci_nalloc     = -1;
+    pl->ncj4           = -1;
+    pl->cj4_nalloc     = -1;
+    pl->nimask         = -1;
+    pl->imask_nalloc   = -1;
+    pl->nexcl          = -1;
+    pl->excl_nalloc    = -1;
+    pl->haveFreshList  = false;
 }
 
 /*! \brief Initializes the timer data structure.
  */
-static void init_timers(cl_timers_t gmx_unused *t, bool gmx_unused bUseTwoStreams)
+static void init_timers(cl_timers_t *t,
+                        bool         bUseTwoStreams)
 {
-    /* Nothing to initialize for OpenCL */
+    for (int i = 0; i <= (bUseTwoStreams ? 1 : 0); i++)
+    {
+        t->didPairlistH2D[i]  = false;
+        t->didPrune[i]        = false;
+        t->didRollingPrune[i] = false;
+    }
 }
 
 /*! \brief Initializes the timings data structure.
@@ -558,6 +571,11 @@ static void init_timings(gmx_wallclock_gpu_t *t)
             t->ktime[i][j].c = 0;
         }
     }
+
+    t->pruneTime.c        = 0;
+    t->pruneTime.t        = 0.0;
+    t->dynamicPruneTime.c = 0;
+    t->dynamicPruneTime.t = 0.0;
 }
 
 /*! \brief Creates context for OpenCL GPU given by \p mygpu
@@ -660,11 +678,21 @@ static void nbnxn_gpu_init_kernels(gmx_nbnxn_ocl_t *nb)
 {
     /* Init to 0 main kernel arrays */
     /* They will be later on initialized in select_nbnxn_kernel */
+    // TODO: consider always creating all variants of the kernels here so that there is no
+    // need for late call to clCreateKernel -- if that gives any advantage?
     memset(nb->kernel_ener_noprune_ptr, 0, sizeof(nb->kernel_ener_noprune_ptr));
     memset(nb->kernel_ener_prune_ptr, 0, sizeof(nb->kernel_ener_prune_ptr));
     memset(nb->kernel_noener_noprune_ptr, 0, sizeof(nb->kernel_noener_noprune_ptr));
     memset(nb->kernel_noener_prune_ptr, 0, sizeof(nb->kernel_noener_prune_ptr));
 
+    /* Init pruning kernels
+     *
+     * TODO: we could avoid creating kernels if dynamic pruning is turned off,
+     * but ATM that depends on force flags not passed into the initialization.
+     */
+    nb->kernel_pruneonly[epruneFirst]   = nbnxn_gpu_create_kernel(nb, "nbnxn_kernel_prune_opencl");
+    nb->kernel_pruneonly[epruneRolling] = nbnxn_gpu_create_kernel(nb, "nbnxn_kernel_prune_rolling_opencl");
+
     /* Init auxiliary kernels */
     nb->kernel_memset_f      = nbnxn_gpu_create_kernel(nb, "memset_f");
     nb->kernel_memset_f2     = nbnxn_gpu_create_kernel(nb, "memset_f2");
@@ -679,20 +707,20 @@ static void nbnxn_gpu_init_kernels(gmx_nbnxn_ocl_t *nb)
  */
 static void nbnxn_ocl_init_const(gmx_nbnxn_ocl_t                *nb,
                                  const interaction_const_t      *ic,
+                                 const NbnxnListParameters      *listParams,
                                  const nonbonded_verlet_group_t *nbv_group)
 {
     init_atomdata_first(nb->atdat, nbv_group[0].nbat->ntype, nb->dev_rundata);
-    init_nbparam(nb->nbparam, ic, nbv_group[0].nbat, nb->dev_rundata);
+    init_nbparam(nb->nbparam, ic, listParams, nbv_group[0].nbat, nb->dev_rundata);
 }
 
 
 //! This function is documented in the header file
 void nbnxn_gpu_init(gmx_nbnxn_ocl_t          **p_nb,
-                    const gmx_gpu_info_t      *gpu_info,
-                    const gmx_gpu_opt_t       *gpu_opt,
+                    const gmx_device_info_t   *deviceInfo,
                     const interaction_const_t *ic,
+                    const NbnxnListParameters *listParams,
                     nonbonded_verlet_group_t  *nbv_grp,
-                    int                        my_gpu_index,
                     int                        rank,
                     gmx_bool                   bLocalAndNonlocal)
 {
@@ -700,8 +728,6 @@ void nbnxn_gpu_init(gmx_nbnxn_ocl_t          **p_nb,
     cl_int                      cl_error;
     cl_command_queue_properties queue_properties;
 
-    assert(gpu_info);
-    assert(gpu_opt);
     assert(ic);
 
     if (p_nb == NULL)
@@ -724,7 +750,7 @@ void nbnxn_gpu_init(gmx_nbnxn_ocl_t          **p_nb,
     snew(nb->timings, 1);
 
     /* set device info, just point it to the right GPU among the detected ones */
-    nb->dev_info = gpu_info->gpu_dev + gpu_opt->dev_use[my_gpu_index];
+    nb->dev_info = deviceInfo;
     snew(nb->dev_rundata, 1);
 
     /* init to NULL the debug buffer */
@@ -786,7 +812,7 @@ void nbnxn_gpu_init(gmx_nbnxn_ocl_t          **p_nb,
         init_timings(nb->timings);
     }
 
-    nbnxn_ocl_init_const(nb, ic, nbv_grp);
+    nbnxn_ocl_init_const(nb, ic, listParams, nbv_grp);
 
     /* Enable LJ param manual prefetch for AMD or if we request through env. var.
      * TODO: decide about NVIDIA
@@ -893,6 +919,11 @@ void nbnxn_gpu_init_pairlist(gmx_nbnxn_ocl_t        *nb,
         }
     }
 
+    if (nb->bDoTime)
+    {
+        nb->timers->didPairlistH2D[iloc] = true;
+    }
+
     ocl_realloc_buffered(&d_plist->sci, h_plist->sci, sizeof(nbnxn_sci_t),
                          &d_plist->nsci, &d_plist->sci_nalloc,
                          h_plist->nsci,
@@ -905,6 +936,13 @@ void nbnxn_gpu_init_pairlist(gmx_nbnxn_ocl_t        *nb,
                          nb->dev_rundata->context,
                          stream, true, &(nb->timers->pl_h2d_cj4[iloc]));
 
+    /* this call only allocates space on the device (no data is transferred) */
+    ocl_realloc_buffered(&d_plist->imask, NULL, sizeof(unsigned int),
+                         &d_plist->nimask, &d_plist->imask_nalloc,
+                         h_plist->ncj4*c_nbnxnGpuClusterpairSplit,
+                         nb->dev_rundata->context,
+                         stream, true, &(nb->timers->pl_h2d_imask[iloc]));
+
     ocl_realloc_buffered(&d_plist->excl, h_plist->excl, sizeof(nbnxn_excl_t),
                          &d_plist->nexcl, &d_plist->excl_nalloc,
                          h_plist->nexcl,
@@ -912,7 +950,7 @@ void nbnxn_gpu_init_pairlist(gmx_nbnxn_ocl_t        *nb,
                          stream, true, &(nb->timers->pl_h2d_excl[iloc]));
 
     /* need to prune the pair list during the next step */
-    d_plist->bDoPrune = true;
+    d_plist->haveFreshList = true;
 }
 
 //! This function is documented in the header file
@@ -1018,7 +1056,7 @@ void nbnxn_gpu_init_atomdata(gmx_nbnxn_ocl_t               *nb,
 }
 
 /*! \brief Releases an OpenCL kernel pointer */
-void free_kernel(cl_kernel *kernel_ptr)
+static void free_kernel(cl_kernel *kernel_ptr)
 {
     cl_int gmx_unused cl_error;
 
@@ -1034,7 +1072,7 @@ void free_kernel(cl_kernel *kernel_ptr)
 }
 
 /*! \brief Releases a list of OpenCL kernel pointers */
-void free_kernels(cl_kernel *kernels, int count)
+static void free_kernels(cl_kernel *kernels, int count)
 {
     int i;
 
@@ -1119,12 +1157,14 @@ void nbnxn_gpu_free(gmx_nbnxn_ocl_t *nb)
     /* 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]);
     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]);
     }
index c6a63e79c15621cff1feb708cd895fee87c1e8f6..6ce4891b1b5f7bb776326ec6f9e78ba0ce6cb7cd 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) 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.
@@ -196,19 +196,23 @@ nbnxn_gpu_compile_kernels(gmx_nbnxn_ocl_t *nb)
          * files outside the nbnxn_ocl as macros, to avoid including those files
          * in the JIT compilation that happens at runtime.
          */
+
         extraDefines += gmx::formatString(
-                    " -DCENTRAL=%d -DNBNXN_GPU_NCLUSTER_PER_SUPERCLUSTER=%d -DNBNXN_GPU_CLUSTER_SIZE=%d -DNBNXN_GPU_JGROUP_SIZE=%d -DNBNXN_MIN_RSQ=%s %s",
-                    CENTRAL,                                 /* Defined in ishift.h */
-                    c_nbnxnGpuNumClusterPerSupercluster,     /* Defined in nbnxn_pairlist.h */
-                    c_nbnxnGpuClusterSize,                   /* Defined in nbnxn_pairlist.h */
-                    c_nbnxnGpuJgroupSize,                    /* Defined in nbnxn_pairlist.h */
-                    STRINGIFY_MACRO(NBNXN_MIN_RSQ)           /* Defined in nbnxn_consts.h */
-                                                             /* NBNXN_MIN_RSQ passed as string to avoid
-                                                                floating point representation problems with sprintf */
+                    " -DCENTRAL=%d "
+                    "-DNBNXN_GPU_NCLUSTER_PER_SUPERCLUSTER=%d -DNBNXN_GPU_CLUSTER_SIZE=%d -DNBNXN_GPU_JGROUP_SIZE=%d "
+                    "-DGMX_NBNXN_PRUNE_KERNEL_J4_CONCURRENCY=%d "
+                    "-DNBNXN_MIN_RSQ=%s %s",
+                    CENTRAL,                                                /* Defined in ishift.h */
+                    c_nbnxnGpuNumClusterPerSupercluster,                    /* Defined in nbnxn_pairlist.h */
+                    c_nbnxnGpuClusterSize,                                  /* Defined in nbnxn_pairlist.h */
+                    c_nbnxnGpuJgroupSize,                                   /* Defined in nbnxn_pairlist.h */
+                    getOclPruneKernelJ4Concurrency(nb->dev_info->vendor_e), /* In nbnxn_ocl_types.h  */
+                    STRINGIFY_MACRO(NBNXN_MIN_RSQ)                          /* Defined in nbnxn_consts.h */
+                                                                            /* NBNXN_MIN_RSQ passed as string to avoid
+                                                                                floating point representation problems with sprintf */
                     , (nb->bPrefetchLjParam) ? "-DIATYPE_SHMEM" : ""
                     );
 
-
         try
         {
             /* TODO when we have a proper MPI-aware logging module,
index 6c83d98adf00b7c93225c8cf75f33fed33d9da25..36a32b9e274a7baa5e8c53eb5e2b6cff5b5b82f6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,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.
@@ -158,7 +158,7 @@ __global float *restrict fshift,            /* stores float3 values */     /* OU
     float beta3                 = nbparam->ewald_beta*nbparam->ewald_beta*nbparam->ewald_beta;
 #endif
 #ifdef PRUNE_NBL
-    float rlist_sq              = nbparam->rlist_sq;
+    float rlist_sq              = nbparam->rlistOuter_sq;
 #endif
 
 #ifdef CALC_ENERGIES
@@ -316,6 +316,10 @@ __global float *restrict fshift,            /* stores float3 values */     /* OU
 
 #endif                                  /* CALC_ENERGIES */
 
+#ifdef EXCLUSION_FORCES
+    const int nonSelfInteraction  = !(nb_sci.shift == CENTRAL & tidxj <= tidxi);
+#endif
+
     /* loop over the j clusters = seen by any of the atoms in the current super-cluster */
     for (j4 = cij4_start; j4 < cij4_end; j4++)
     {
@@ -328,7 +332,7 @@ __global float *restrict fshift,            /* stores float3 values */     /* OU
 #endif
         {
             /* Pre-load cj into shared memory on both warps separately */
-            if ((tidxj == 0 || tidxj == 4) && tidxi < NBNXN_GPU_JGROUP_SIZE)
+            if ((tidxj == 0 | tidxj == 4) & (tidxi < NBNXN_GPU_JGROUP_SIZE))
             {
                 cjs[tidxi + tidxj * NBNXN_GPU_JGROUP_SIZE / 4] = pl_cj4[j4].cj[tidxi];
             }
@@ -401,10 +405,9 @@ __global float *restrict fshift,            /* stores float3 values */     /* OU
 
                             /* cutoff & exclusion check */
 #ifdef EXCLUSION_FORCES
-                            if (r2 < rcoulomb_sq *
-                                (nb_sci.shift != CENTRAL || ci != cj || tidxj > tidxi))
+                            if ((r2 < rcoulomb_sq) * (nonSelfInteraction | (ci != cj)))
 #else
-                            if (r2 < rcoulomb_sq * int_bit)
+                            if ((r2 < rcoulomb_sq) * int_bit)
 #endif
                             {
                                 /* load the rest of the i-atom parameters */
@@ -500,9 +503,9 @@ __global float *restrict fshift,            /* stores float3 values */     /* OU
 
 #ifdef LJ_POT_SWITCH
 #ifdef CALC_ENERGIES
-                                calculate_potential_switch_F_E(nbparam, c6, c12, inv_r, r2, &F_invr, &E_lj_p);
+                                calculate_potential_switch_F_E(nbparam, inv_r, r2, &F_invr, &E_lj_p);
 #else
-                                calculate_potential_switch_F(nbparam, c6, c12, inv_r, r2, &F_invr, &E_lj_p);
+                                calculate_potential_switch_F(nbparam, inv_r, r2, &F_invr, &E_lj_p);
 #endif /* CALC_ENERGIES */
 #endif /* LJ_POT_SWITCH */
 
index 9325fc3a7fadfb53ae33bc0f55edec4283b1d50b..ba522a2b960c6c617cd5208c0b123377fa779520 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,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.
@@ -161,7 +161,7 @@ __global float *restrict fshift,            /* stores float3 values */     /* OU
     float beta3                 = nbparam->ewald_beta*nbparam->ewald_beta*nbparam->ewald_beta;
 #endif
 #ifdef PRUNE_NBL
-    float rlist_sq              = nbparam->rlist_sq;
+    float rlist_sq              = nbparam->rlistOuter_sq;
 #endif
 
 #ifdef CALC_ENERGIES
@@ -319,6 +319,10 @@ __global float *restrict fshift,            /* stores float3 values */     /* OU
 
 #endif                                  /* CALC_ENERGIES */
 
+#ifdef EXCLUSION_FORCES
+    const int nonSelfInteraction  = !(nb_sci.shift == CENTRAL & tidxj <= tidxi);
+#endif
+
     /* loop over the j clusters = seen by any of the atoms in the current super-cluster */
     for (j4 = cij4_start; j4 < cij4_end; j4++)
     {
@@ -331,7 +335,7 @@ __global float *restrict fshift,            /* stores float3 values */     /* OU
 #endif
         {
             /* Pre-load cj into shared memory on both warps separately */
-            if ((tidxj == 0 || tidxj == 4) && tidxi < NBNXN_GPU_JGROUP_SIZE)
+            if ((tidxj == 0 | tidxj == 4) & (tidxi < NBNXN_GPU_JGROUP_SIZE))
             {
                 cjs[tidxi + tidxj * NBNXN_GPU_JGROUP_SIZE / 4] = pl_cj4[j4].cj[tidxi];
             }
@@ -404,10 +408,9 @@ __global float *restrict fshift,            /* stores float3 values */     /* OU
 
                             /* cutoff & exclusion check */
 #ifdef EXCLUSION_FORCES
-                            if (r2 < rcoulomb_sq *
-                                (nb_sci.shift != CENTRAL || ci != cj || tidxj > tidxi))
+                            if ((r2 < rcoulomb_sq) * (nonSelfInteraction | (ci != cj)))
 #else
-                            if (r2 < rcoulomb_sq * int_bit)
+                            if ((r2 < rcoulomb_sq) * int_bit)
 #endif
                             {
                                 /* load the rest of the i-atom parameters */
@@ -503,9 +506,9 @@ __global float *restrict fshift,            /* stores float3 values */     /* OU
 
 #ifdef LJ_POT_SWITCH
 #ifdef CALC_ENERGIES
-                                calculate_potential_switch_F_E(nbparam, c6, c12, inv_r, r2, &F_invr, &E_lj_p);
+                                calculate_potential_switch_F_E(nbparam, inv_r, r2, &F_invr, &E_lj_p);
 #else
-                                calculate_potential_switch_F(nbparam, c6, c12, inv_r, r2, &F_invr, &E_lj_p);
+                                calculate_potential_switch_F(nbparam, inv_r, r2, &F_invr, &E_lj_p);
 #endif /* CALC_ENERGIES */
 #endif /* LJ_POT_SWITCH */
 
index 75929f36d85abd02e84ea989af67997291f7e4e4..a7366c879bfa5a8e63a1e54a1fc2b5c243fea99a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,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.
@@ -155,7 +155,7 @@ __global float *restrict fshift,            /* stores float3 values */     /* OU
     float beta3                 = nbparam->ewald_beta*nbparam->ewald_beta*nbparam->ewald_beta;
 #endif
 #ifdef PRUNE_NBL
-    float rlist_sq              = nbparam->rlist_sq;
+    float rlist_sq              = nbparam->rlistOuter_sq;
 #endif
 
 #ifdef CALC_ENERGIES
@@ -313,6 +313,10 @@ __global float *restrict fshift,            /* stores float3 values */     /* OU
 
 #endif                                  /* CALC_ENERGIES */
 
+#ifdef EXCLUSION_FORCES
+    const int nonSelfInteraction  = !(nb_sci.shift == CENTRAL & tidxj <= tidxi);
+#endif
+
     /* loop over the j clusters = seen by any of the atoms in the current super-cluster */
     for (j4 = cij4_start; j4 < cij4_end; j4++)
     {
@@ -325,7 +329,7 @@ __global float *restrict fshift,            /* stores float3 values */     /* OU
 #endif
         {
             /* Pre-load cj into shared memory on both warps separately */
-            if ((tidxj == 0 || tidxj == 4) && tidxi < NBNXN_GPU_JGROUP_SIZE)
+            if ((tidxj == 0 | tidxj == 4) & (tidxi < NBNXN_GPU_JGROUP_SIZE))
             {
                 cjs[tidxi + tidxj * NBNXN_GPU_JGROUP_SIZE / 4] = pl_cj4[j4].cj[tidxi];
             }
@@ -394,10 +398,9 @@ __global float *restrict fshift,            /* stores float3 values */     /* OU
 
                             /* cutoff & exclusion check */
 #ifdef EXCLUSION_FORCES
-                            if (r2 < rcoulomb_sq *
-                                (nb_sci.shift != CENTRAL || ci != cj || tidxj > tidxi))
+                            if ((r2 < rcoulomb_sq) * (nonSelfInteraction | (ci != cj)))
 #else
-                            if (r2 < rcoulomb_sq * int_bit)
+                            if ((r2 < rcoulomb_sq) * int_bit)
 #endif
                             {
                                 /* load the rest of the i-atom parameters */
@@ -493,9 +496,9 @@ __global float *restrict fshift,            /* stores float3 values */     /* OU
 
 #ifdef LJ_POT_SWITCH
 #ifdef CALC_ENERGIES
-                                calculate_potential_switch_F_E(nbparam, c6, c12, inv_r, r2, &F_invr, &E_lj_p);
+                                calculate_potential_switch_F_E(nbparam, inv_r, r2, &F_invr, &E_lj_p);
 #else
-                                calculate_potential_switch_F(nbparam, c6, c12, inv_r, r2, &F_invr, &E_lj_p);
+                                calculate_potential_switch_F(nbparam, inv_r, r2, &F_invr, &E_lj_p);
 #endif /* CALC_ENERGIES */
 #endif /* LJ_POT_SWITCH */
 
diff --git a/src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_kernel_pruneonly.clh b/src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_kernel_pruneonly.clh
new file mode 100644 (file)
index 0000000..f135de1
--- /dev/null
@@ -0,0 +1,258 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+
+/*! \internal \file
+ *  \brief OpenCL pruning kernel.
+ *
+ *  OpenCL 1.2 support is expected; tested on AMD GCN and NVIDIA CC >3.0.
+ *
+ *  \author Szilárd Páll <pall.szilard@gmail.com>
+ *  \ingroup module_mdlib
+ */
+
+#include "nbnxn_ocl_kernel_utils.clh"
+
+/* Note: the AMD compiler testing was done with (fglrx 15.12) performs best with wg
+ * size 256 (this is an artificial compiler limitation). The compiler is also
+ * sensitive to tidx/widx declaration and warp_any initialization.
+ * With the current tweaks the regular prune kenel achieves 90%, the rolling 100%
+ * occupancy with both Fiji and Hawaii.
+ * TODO: if the wg size limit is removed in an upcoming AMD compiler the NTHREAD_Z=4
+ * should be revisited.
+ *
+ */
+#define NTHREAD_Z GMX_NBNXN_PRUNE_KERNEL_J4_CONCURRENCY
+
+#if !defined _AMD_SOURCE_ && ! defined _NVIDIA_SOURCE_
+    #error "The pruning kernel has not been tested on arch with execution width <32."
+#endif
+
+__attribute__((reqd_work_group_size(CL_SIZE, CL_SIZE, NTHREAD_Z)))
+#ifdef HAVE_FRESH_LIST
+    __kernel void nbnxn_kernel_prune_opencl
+#else
+    __kernel void nbnxn_kernel_prune_rolling_opencl
+#endif
+(
+ cl_nbparam_params_t              nbparam_params,
+ const __global float4 *restrict  xq,
+ const __global float *restrict   shift_vec,
+ const __global nbnxn_sci_t      *pl_sci,
+ __global nbnxn_cj4_t            *pl_cj4,
+#if !defined HAVE_FRESH_LIST
+ const
+#endif
+ __global unsigned int *restrict  prePrunedImask,
+ int                              numParts,
+ int                              part,
+ __local  float4                 *xib
+)
+{
+    /* convenience variables */
+    cl_nbparam_params_t *nbparam = &nbparam_params;
+
+    float rlistOuter_sq = nbparam->rlistOuter_sq;
+    float rlistInner_sq = nbparam->rlistInner_sq;
+
+    /* thread/block/warp id-s */
+    unsigned int tidxi  = get_local_id(0);
+    unsigned int tidxj  = get_local_id(1);
+    unsigned int tidx   = get_local_id(1) * get_local_size(0) + get_local_id(0);
+#if NTHREAD_Z == 1
+    unsigned int tidxz  = 0;
+#else
+    unsigned int tidxz  = get_local_id(2);
+#endif
+    unsigned int bidx   = get_group_id(0);
+    unsigned int widx   = tidx / WARP_SIZE;
+
+#ifdef HAVE_FRESH_LIST
+    const bool haveFreshList = true;
+#else
+    const bool haveFreshList = false;
+#endif
+
+    // TODO move these consts to utils and unify their use with the nonbonded kernels
+    const int c_numClPerSupercl    = NCL_PER_SUPERCL;
+    const int c_clSize             = CL_SIZE;
+    const int c_nbnxnGpuJgroupSize = NBNXN_GPU_JGROUP_SIZE;
+
+    // TODO pass this value at compile-time as a macro
+    const int c_nbnxnGpuClusterpairSplit = 2;
+    const int c_splitClSize              = c_clSize/c_nbnxnGpuClusterpairSplit;
+
+    /*! i-cluster interaction mask for a super-cluster with all c_numClPerSupercl=8 bits set */
+    const unsigned superClInteractionMask = ((1U << c_numClPerSupercl) - 1U);
+
+    /* shmem buffer for i cj pre-loading */
+    #define LOCAL_OFFSET xib + c_numClPerSupercl * c_clSize
+    __local int *cjs       = (((__local int *)(LOCAL_OFFSET)) + tidxz * c_nbnxnGpuClusterpairSplit * c_nbnxnGpuJgroupSize);
+    #undef LOCAL_OFFSET
+    /* Offset calculated using xib because cjs depends on on tidxz! */
+    #define LOCAL_OFFSET (((__local int *)(xib + c_numClPerSupercl * c_clSize)) + (NTHREAD_Z * c_nbnxnGpuClusterpairSplit * c_nbnxnGpuJgroupSize))
+
+    /* Local buffer used to implement __any warp vote function from CUDA.
+       volatile is used to avoid compiler optimizations for AMD builds. */
+    volatile __local uint *warp_any = (__local uint*)(LOCAL_OFFSET);
+    #undef LOCAL_OFFSET
+
+    unsigned int warpVoteSlot = NTHREAD_Z*tidxz + widx;
+    /* Initialise warp vote.*/
+    if(tidx == 0 || tidx == 32)
+    {
+        warp_any[warpVoteSlot] = 0;
+    }
+
+    nbnxn_sci_t nb_sci      = pl_sci[bidx*numParts + part];  /* my i super-cluster's index = sciOffset + current bidx * numParts + part */
+    int         sci         = nb_sci.sci;           /* super-cluster */
+    int         cij4_start  = nb_sci.cj4_ind_start; /* first ...*/
+    int         cij4_end    = nb_sci.cj4_ind_end;   /* and last index of j clusters */
+
+    if (tidxz == 0)
+    {
+        /* Pre-load i-atom x and q into shared memory */
+        int ci = sci * c_numClPerSupercl + tidxj;
+        int ai = ci * c_clSize + tidxi;
+
+        /* We don't need q, but using float4 in shmem avoids bank conflicts */
+        float4 tmp = xq[ai];
+        float4 xi  = tmp + (float4)(shift_vec[3 * nb_sci.shift], shift_vec[3 * nb_sci.shift + 1], shift_vec[3 * nb_sci.shift + 2], 0.0f);
+        xib[tidxj * c_clSize + tidxi] = xi;
+    }
+    barrier(CLK_LOCAL_MEM_FENCE);
+
+
+    /* loop over the j clusters = seen by any of the atoms in the current super-cluster */
+    for (int j4 = cij4_start + tidxz; j4 < cij4_end; j4 += NTHREAD_Z)
+    {
+        unsigned int imaskFull, imaskCheck, imaskNew;
+
+        if (haveFreshList)
+        {
+            /* Read the mask from the list transferred from the CPU */
+            imaskFull  = pl_cj4[j4].imei[widx].imask;
+            /* We attempt to prune all pairs present in the original list */
+            imaskCheck = imaskFull;
+            imaskNew   = 0;
+        }
+        else
+        {
+            /* Read the mask from the "warp-pruned" by rlistOuter mask array */
+            imaskFull  = prePrunedImask[j4*c_nbnxnGpuClusterpairSplit + widx];
+            /* Read the old rolling pruned mask, use as a base for new */
+            imaskNew   = pl_cj4[j4].imei[widx].imask;
+            /* We only need to check pairs with different mask */
+            imaskCheck = (imaskNew ^ imaskFull);
+        }
+
+        if (imaskCheck)
+        {
+            /* Pre-load cj into shared memory on both warps separately */
+            if ((tidxj == 0 | tidxj == 4) & (tidxi < c_nbnxnGpuJgroupSize))
+            {
+                cjs[tidxi + tidxj * c_nbnxnGpuJgroupSize/c_splitClSize] = pl_cj4[j4].cj[tidxi];
+            }
+
+#pragma unroll 4
+            for (int jm = 0; jm < c_nbnxnGpuJgroupSize; jm++)
+            {
+                if (imaskCheck & (superClInteractionMask << (jm * c_numClPerSupercl)))
+                {
+                    unsigned int mask_ji = (1U << (jm * c_numClPerSupercl));
+
+                    int cj      = cjs[jm + (tidxj & 4) * c_nbnxnGpuJgroupSize/c_splitClSize];
+                    int aj      = cj * c_clSize + tidxj;
+
+                    /* load j atom data */
+                    float4 tmp  = xq[aj];
+                    float3 xj   = (float3)(tmp.xyz);
+
+#pragma unroll 8
+                    for (int i = 0; i < c_numClPerSupercl; i++)
+                    {
+                        if (imaskCheck & mask_ji)
+                        {
+                            /* load i-cluster coordinates from shmem */
+                            float4 xi = xib[i * c_clSize + tidxi];
+
+                            /* distance between i and j atoms */
+                            float3 rv = (float3)(xi.xyz) - xj;
+                            float  r2 = norm2(rv);
+
+                            if (haveFreshList)
+                            {
+                                /* If _none_ of the atoms pairs are in cutoff range,
+                                   the bit corresponding to the current
+                                   cluster-pair in imask gets set to 0. */
+                                if (r2 < rlistOuter_sq)
+                                {
+                                    warp_any[warpVoteSlot] = 1;
+                                }
+                                if (!warp_any[warpVoteSlot])
+                                {
+                                    imaskFull &= ~mask_ji;
+                                }
+                                warp_any[warpVoteSlot] = 0;
+                            }
+                            /* If any atom pair is within range, set the bit
+                               corresponding to the current cluster-pair. */
+                            if (r2 < rlistInner_sq)
+                            {
+                                warp_any[warpVoteSlot] = 1;
+                            }
+                            if (warp_any[warpVoteSlot])
+                            {
+                                imaskNew |= mask_ji;
+                            }
+                            warp_any[warpVoteSlot] = 0;
+                        }
+
+                        /* shift the mask bit by 1 */
+                        mask_ji += mask_ji;
+                    }
+                }
+            }
+
+#ifdef HAVE_FRESH_LIST
+            {
+                 /* copy the list pruned to rlistOuter to a separate buffer */
+                 prePrunedImask[j4*c_nbnxnGpuClusterpairSplit + widx] = imaskFull;
+            }
+#endif
+            /* update the imask with only the pairs up to rlistInner */
+            pl_cj4[j4].imei[widx].imask = imaskNew;
+        }
+    }
+}
index 573308a07b13f8eca4dfbf2a07d822cdd6d97c91..88e2536c3ec731c6eda6507b0a2ec1f1c7d50d33 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,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.
@@ -112,7 +112,8 @@ typedef struct cl_nbparam_params
 
     float           rvdw_sq;          /**< VdW cut-off squared                               */
     float           rvdw_switch;      /**< VdW switched cut-off                              */
-    float           rlist_sq;         /**< pair-list cut-off squared                         */
+    float           rlistOuter_sq;    /**< Full, outer pair-list cut-off squared             */
+    float           rlistInner_sq;    /**< Inner, dynamic pruned pair-list cut-off squared  XXX: this is only needed in the pruning kernels, but for now we also pass it to the nonbondeds */
 
     shift_consts_t  dispersion_shift; /**< VdW shift dispersion constants           */
     shift_consts_t  repulsion_shift;  /**< VdW shift repulsion constants            */
@@ -230,8 +231,6 @@ void calculate_force_switch_F_E(cl_nbparam_params_t *nbparam,
 /*! Apply potential switch, force-only version. */
 __INLINE__ __device__
 void calculate_potential_switch_F(cl_nbparam_params_t *nbparam,
-                                  float                c6,
-                                  float                c12,
                                   float                inv_r,
                                   float                r2,
                                   float               *F_invr,
@@ -264,8 +263,6 @@ void calculate_potential_switch_F(cl_nbparam_params_t *nbparam,
 /*! Apply potential switch, force + energy version. */
 __INLINE__ __device__
 void calculate_potential_switch_F_E(cl_nbparam_params_t *nbparam,
-                                    float                c6,
-                                    float                c12,
                                     float                inv_r,
                                     float                r2,
                                     float               *F_invr,
index 757a3f7727364003dfc2a39517fa36fb9be470ea..16f5c4525a008d91b5d64d2068afb0b8adc39df2 100644 (file)
@@ -1,3 +1,37 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
 #define __IN_OPENCL_KERNEL__
 
 /* Auxiliary kernels */
@@ -39,6 +73,12 @@ zero_e_fshift(__global float *fshift,__global float *e_lj,__global float *e_el,c
     }
 }
 
+/* Generate pruning kernels. */
+#define HAVE_FRESH_LIST 1
+#include "nbnxn_ocl_kernel_pruneonly.clh"
+#undef HAVE_FRESH_LIST
+#include "nbnxn_ocl_kernel_pruneonly.clh"
+
 #if defined GMX_OCL_FASTGEN
     #define FLAVOR_LEVEL_GENERATOR "nbnxn_ocl_kernels_fastgen.clh"
 #elif defined GMX_OCL_FASTGEN_ADD_TWINCUT
index 0fa212584e7641ac0200981124aa1782c19b061c..a0c7bd999242f1fb8ff7de937594b37d1f01a1bd 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,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.
@@ -38,6 +38,7 @@
  *  Data types used internally in the nbnxn_ocl module.
  *
  *  \author Anca Hamuraru <anca@streamcomputing.eu>
+ *  \author Szilárd Páll <pszilard@kth.se>
  *  \ingroup module_mdlib
  */
 
@@ -54,6 +55,7 @@
 #    include <CL/opencl.h>
 #endif
 
+#include "gromacs/gpu_utils/oclutils.h"
 #include "gromacs/mdlib/nbnxn_pairlist.h"
 #include "gromacs/mdtypes/interaction_const.h"
 #include "gromacs/utility/real.h"
 //! Define 1/sqrt(pi)
 #define M_FLOAT_1_SQRTPI 0.564189583547756f
 
+/*! \brief Macros defining platform-dependent defaults for the prune kernel's j4 processing concurrency.
+ *
+ *  The GMX_NBNXN_PRUNE_KERNEL_J4_CONCURRENCY macro allows compile-time override.
+ */
+/*! @{ */
+#ifndef GMX_NBNXN_PRUNE_KERNEL_J4_CONCURRENCY
+#define GMX_NBNXN_PRUNE_KERNEL_J4_CONCURRENCY_AMD       4
+#define GMX_NBNXN_PRUNE_KERNEL_J4_CONCURRENCY_NVIDIA    4
+#define GMX_NBNXN_PRUNE_KERNEL_J4_CONCURRENCY_DEFAULT   4
+#else
+#define GMX_NBNXN_PRUNE_KERNEL_J4_CONCURRENCY_AMD       GMX_NBNXN_PRUNE_KERNEL_J4_CONCURRENCY
+#define GMX_NBNXN_PRUNE_KERNEL_J4_CONCURRENCY_NVIDIA    GMX_NBNXN_PRUNE_KERNEL_J4_CONCURRENCY
+#define GMX_NBNXN_PRUNE_KERNEL_J4_CONCURRENCY_DEFAULT   GMX_NBNXN_PRUNE_KERNEL_J4_CONCURRENCY
+#endif
+/*! @} */
+/*! \brief Constants for platform-dependent defaults for the prune kernel's j4 processing concurrency.
+ *
+ *  Initialized using macros that can be overridden at compile-time (using #GMX_NBNXN_PRUNE_KERNEL_J4_CONCURRENCY).
+ */
+/*! @{ */
+const int c_oclPruneKernelJ4ConcurrencyAMD     = GMX_NBNXN_PRUNE_KERNEL_J4_CONCURRENCY_AMD;
+const int c_oclPruneKernelJ4ConcurrencyNVIDIA  = GMX_NBNXN_PRUNE_KERNEL_J4_CONCURRENCY_NVIDIA;
+const int c_oclPruneKernelJ4ConcurrencyDefault = GMX_NBNXN_PRUNE_KERNEL_J4_CONCURRENCY_DEFAULT;
+/*! @} */
+
+/*! \brief Returns the j4 processing concurrency parameter for the vendor \p vendorId
+ *  \param vendorId takes values from #ocl_vendor_id_t.
+ */
+static inline int getOclPruneKernelJ4Concurrency(int vendorId)
+{
+    assert(vendorId < OCL_VENDOR_UNKNOWN);
+    switch (vendorId)
+    {
+        case OCL_VENDOR_AMD:    return c_oclPruneKernelJ4ConcurrencyAMD;     break;
+        case OCL_VENDOR_NVIDIA: return c_oclPruneKernelJ4ConcurrencyNVIDIA;  break;
+        default:                return c_oclPruneKernelJ4ConcurrencyDefault; break;
+    }
+}
+
 
 #ifdef __cplusplus
 extern "C" {
@@ -100,6 +141,15 @@ enum evdwOcl {
     evdwOclCUT, evdwOclCUTCOMBGEOM, evdwOclCUTCOMBLB, evdwOclFSWITCH, evdwOclPSWITCH, evdwOclEWALDGEOM, evdwOclEWALDLB, evdwOclNR
 };
 
+/*! \brief Pruning kernel flavors.
+ *
+ * The values correspond to the first call of the pruning post-list generation
+ * and the rolling pruning, respectively.
+ */
+enum ePruneKind {
+    epruneFirst, epruneRolling, ePruneNR
+};
+
 /*! \internal
  * \brief Staging area for temporary data downloaded from the GPU.
  *
@@ -149,26 +199,28 @@ typedef struct cl_atomdata
 typedef struct cl_nbparam
 {
 
-    int             eeltype;          /**< type of electrostatics, takes values from #eelOcl */
-    int             vdwtype;          /**< type of VdW impl., takes values from #evdwOcl     */
+    int             eeltype;           /**< type of electrostatics, takes values from #eelOcl */
+    int             vdwtype;           /**< type of VdW impl., takes values from #evdwOcl     */
 
-    float           epsfac;           /**< charge multiplication factor                      */
-    float           c_rf;             /**< Reaction-field/plain cutoff electrostatics const. */
-    float           two_k_rf;         /**< Reaction-field electrostatics constant            */
-    float           ewald_beta;       /**< Ewald/PME parameter                               */
-    float           sh_ewald;         /**< Ewald/PME correction term substracted from the direct-space potential */
-    float           sh_lj_ewald;      /**< LJ-Ewald/PME correction term added to the correction potential        */
-    float           ewaldcoeff_lj;    /**< LJ-Ewald/PME coefficient                          */
+    float           epsfac;            /**< charge multiplication factor                      */
+    float           c_rf;              /**< Reaction-field/plain cutoff electrostatics const. */
+    float           two_k_rf;          /**< Reaction-field electrostatics constant            */
+    float           ewald_beta;        /**< Ewald/PME parameter                               */
+    float           sh_ewald;          /**< Ewald/PME correction term substracted from the direct-space potential */
+    float           sh_lj_ewald;       /**< LJ-Ewald/PME correction term added to the correction potential        */
+    float           ewaldcoeff_lj;     /**< LJ-Ewald/PME coefficient                          */
 
-    float           rcoulomb_sq;      /**< Coulomb cut-off squared                           */
+    float           rcoulomb_sq;       /**< Coulomb cut-off squared                           */
 
-    float           rvdw_sq;          /**< VdW cut-off squared                               */
-    float           rvdw_switch;      /**< VdW switched cut-off                              */
-    float           rlist_sq;         /**< pair-list cut-off squared                         */
+    float           rvdw_sq;           /**< VdW cut-off squared                               */
+    float           rvdw_switch;       /**< VdW switched cut-off                              */
+    float           rlistOuter_sq;     /**< Full, outer pair-list cut-off squared             */
+    float           rlistInner_sq;     /**< Inner, dynamic pruned pair-list cut-off squared   */
+    bool            useDynamicPruning; /**< True if we use dynamic pair-list pruning          */
 
-    shift_consts_t  dispersion_shift; /**< VdW shift dispersion constants           */
-    shift_consts_t  repulsion_shift;  /**< VdW shift repulsion constants            */
-    switch_consts_t vdw_switch;       /**< VdW switch constants                     */
+    shift_consts_t  dispersion_shift;  /**< VdW shift dispersion constants           */
+    shift_consts_t  repulsion_shift;   /**< VdW shift repulsion constants            */
+    switch_consts_t vdw_switch;        /**< VdW switch constants                     */
 
     /* LJ non-bonded parameters - accessed through texture memory */
     cl_mem                  nbfp_climg2d;      /**< nonbonded parameter table with C6/C12 pairs per atom type-pair, 2*ntype^2 elements */
@@ -203,7 +255,8 @@ typedef struct cl_nbparam_params
 
     float           rvdw_sq;          /**< VdW cut-off squared                               */
     float           rvdw_switch;      /**< VdW switched cut-off                              */
-    float           rlist_sq;         /**< pair-list cut-off squared                         */
+    float           rlistOuter_sq;    /**< Full, outer pair-list cut-off squared             */
+    float           rlistInner_sq;    /**< Inner, dynamic pruned pair-list cut-off squared   */
 
     shift_consts_t  dispersion_shift; /**< VdW shift dispersion constants           */
     shift_consts_t  repulsion_shift;  /**< VdW shift repulsion constants            */
@@ -220,25 +273,30 @@ typedef struct cl_nbparam_params
  */
 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     */
-    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                      */
-
-    cl_bool          bDoPrune;    /**< true if pair-list pruning needs to be
-                                       done during the  current step                */
+    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;
 
 
@@ -250,20 +308,27 @@ typedef struct cl_plist
  */
 typedef struct cl_timers
 {
-    cl_event atdat;             /**< event for atom data transfer (every PS step)                 */
+    cl_event atdat;              /**< event for atom data transfer (every PS step)                 */
+
+    cl_event nb_h2d[2];          /**< events for x/q H2D transfers (l/nl, every step)              */
 
-    cl_event nb_h2d[2];         /**< events for x/q H2D transfers (l/nl, every step)              */
+    cl_event nb_d2h_f[2];        /**< events for f D2H transfer (l/nl, every step)                 */
+    cl_event nb_d2h_fshift[2];   /**< events for fshift D2H transfer (l/nl, every step)            */
+    cl_event nb_d2h_e_el[2];     /**< events for e_el D2H transfer (l/nl, every step)              */
+    cl_event nb_d2h_e_lj[2];     /**< events for e_lj D2H transfer (l/nl, every step)              */
 
-    cl_event nb_d2h_f[2];       /**< events for f D2H transfer (l/nl, every step)                 */
-    cl_event nb_d2h_fshift[2];  /**< events for fshift D2H transfer (l/nl, every step)            */
-    cl_event nb_d2h_e_el[2];    /**< events for e_el D2H transfer (l/nl, every step)              */
-    cl_event nb_d2h_e_lj[2];    /**< events for e_lj D2H transfer (l/nl, every step)              */
+    cl_event pl_h2d_sci[2];      /**< events for pair-list sci H2D transfers (l/nl, every PS step) */
+    cl_event pl_h2d_cj4[2];      /**< events for pair-list cj4 H2D transfers (l/nl, every PS step) */
+    cl_event pl_h2d_excl[2];     /**< events for pair-list excl H2D transfers (l/nl, every PS step)*/
+    cl_event pl_h2d_imask[2];    /**< events for pair-list imask H2D transfers (l/nl, every PS step)*/
 
-    cl_event pl_h2d_sci[2];     /**< events for pair-list sci H2D transfers (l/nl, every PS step) */
-    cl_event pl_h2d_cj4[2];     /**< events for pair-list cj4 H2D transfers (l/nl, every PS step) */
-    cl_event pl_h2d_excl[2];    /**< events for pair-list excl H2D transfers (l/nl, every PS step)*/
+    cl_event nb_k[2];            /**< event for non-bonded kernels (l/nl, every step)              */
 
-    cl_event nb_k[2];           /**< event for non-bonded kernels (l/nl, every step)              */
+    bool     didPairlistH2D[2];  /**< tells if we timed a pair-list transfer */
+    cl_event prune_k[2];         /**< event for pruning kernel (every prune step) */
+    bool     didPrune[2];        /**< tells uf we timed pruning this (or previous step for rolling) and that the timings need to be accounted for */
+    cl_event rollingPrune_k[2];  /**< event for rolling pruning kernel (every prune step) */
+    bool     didRollingPrune[2]; /**< tells uf we timed pruning this (or previous step for rolling) and that the timings need to be accounted for */
 } cl_timers_t;
 
 /*! \internal
@@ -271,7 +336,7 @@ typedef struct cl_timers
  */
 struct gmx_nbnxn_ocl_t
 {
-    struct gmx_device_info_t         *dev_info;    /**< OpenCL device information                              */
+    const gmx_device_info_t          *dev_info;    /**< OpenCL device information                              */
     struct gmx_device_runtime_data_t *dev_rundata; /**< OpenCL runtime data (context, kernels)                 */
 
     /**< Pointers to non-bonded kernel functions
@@ -282,8 +347,9 @@ struct gmx_nbnxn_ocl_t
     cl_kernel           kernel_noener_prune_ptr[eelOclNR][evdwOclNR];
     cl_kernel           kernel_ener_prune_ptr[eelOclNR][evdwOclNR];
     ///@}
+    cl_kernel           kernel_pruneonly[ePruneNR]; /**< prune kernels, ePruneKind defined the kernel kinds */
 
-    bool bPrefetchLjParam; /**< true if prefetching fg i-atom LJ parameters should be used in the kernels */
+    bool                bPrefetchLjParam;           /**< true if prefetching fg i-atom LJ parameters should be used in the kernels */
 
     /**< auxiliary kernels implementing memset-like functions */
     ///@{
index 3e9ab02062ada88fc46546dca628808d0ee2a5da..8ccb2224cedd69185442f936577c55464cf05417 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,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.
 
 #include <cstddef>
 
-#include "thread_mpi/atomic.h"
-
 #include "gromacs/math/vectypes.h"
 #include "gromacs/mdtypes/nblist.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/bitmask.h"
 #include "gromacs/utility/real.h"
 
+struct tMPI_Atomic;
+
+/*! \cond INTERNAL */
+
+/*! \brief The setup for generating and pruning the nbnxn pair list.
+ *
+ * Without dynamic pruning rlistOuter=rlistInner.
+ */
+struct NbnxnListParameters
+{
+    /*! \brief Constructor producing a struct with dynamic pruning disabled
+     */
+    NbnxnListParameters(real rlist) :
+        useDynamicPruning(false),
+        nstlistPrune(-1),
+        rlistOuter(rlist),
+        rlistInner(rlist),
+        numRollingParts(1)
+    {
+    }
+
+    bool useDynamicPruning; //!< Are we using dynamic pair-list pruning
+    int  nstlistPrune;      //!< Pair-list dynamic pruning interval
+    real rlistOuter;        //!< Cut-off of the larger, outer pair-list
+    real rlistInner;        //!< Cut-off of the smaller, inner pair-list
+    int  numRollingParts;   //!< The number parts to divide the pair-list into for rolling pruning, a value of 1 gives no rolling pruning
+};
+
+/*! \endcond */
+
 /* With GPU kernels the i and j cluster size is 8 atoms */
 static const int c_nbnxnGpuClusterSize = 8;
 
@@ -159,15 +187,18 @@ typedef struct nbnxn_pairlist_t {
     int                     na_sc;       /* The number of atoms per super cluster    */
     real                    rlist;       /* The radius for constructing the list     */
     int                     nci;         /* The number of i-clusters in the list     */
+    int                     nciOuter;    /* The number of i-clusters in the outer, unpruned list, -1 when invalid */
     nbnxn_ci_t             *ci;          /* The i-cluster list, size nci             */
-    int                     ci_nalloc;   /* The allocation size of ci                */
+    nbnxn_ci_t             *ciOuter;     /* The outer, unpruned i-cluster list, size nciOuter(=-1 when invalid) */
+    int                     ci_nalloc;   /* The allocation size of ci/ciOuter        */
     int                     nsci;        /* The number of i-super-clusters in the list */
     nbnxn_sci_t            *sci;         /* The i-super-cluster list                 */
     int                     sci_nalloc;  /* The allocation size of sci               */
 
     int                     ncj;         /* The number of j-clusters in the list     */
     nbnxn_cj_t             *cj;          /* The j-cluster list, size ncj             */
-    int                     cj_nalloc;   /* The allocation size of cj                */
+    nbnxn_cj_t             *cjOuter;     /* The outer, unpruned j-cluster list, size ncj    */
+    int                     cj_nalloc;   /* The allocation size of cj/cj0            */
     int                     ncjInUse;    /* The number of j-clusters that are used by ci entries in this list, will be <= ncj */
 
     int                     ncj4;        /* The total number of 4*j clusters         */
@@ -184,16 +215,17 @@ typedef struct nbnxn_pairlist_t {
 } nbnxn_pairlist_t;
 
 typedef struct {
-    int                nnbl;        /* number of lists */
-    nbnxn_pairlist_t **nbl;         /* lists */
-    nbnxn_pairlist_t **nbl_work;    /* work space for rebalancing lists */
-    gmx_bool           bCombined;   /* TRUE if lists get combined into one (the 1st) */
-    gmx_bool           bSimple;     /* TRUE if the list of of type "simple"
-                                       (na_sc=na_s, no super-clusters used) */
-    int                natpair_ljq; /* Total number of atom pairs for LJ+Q kernel */
-    int                natpair_lj;  /* Total number of atom pairs for LJ kernel   */
-    int                natpair_q;   /* Total number of atom pairs for Q kernel    */
-    t_nblist         **nbl_fep;
+    int                nnbl;                  /* number of lists */
+    nbnxn_pairlist_t **nbl;                   /* lists */
+    nbnxn_pairlist_t **nbl_work;              /* work space for rebalancing lists */
+    gmx_bool           bCombined;             /* TRUE if lists get combined into one (the 1st) */
+    gmx_bool           bSimple;               /* TRUE if the list of of type "simple"
+                                                 (na_sc=na_s, no super-clusters used) */
+    int                natpair_ljq;           /* Total number of atom pairs for LJ+Q kernel */
+    int                natpair_lj;            /* Total number of atom pairs for LJ kernel   */
+    int                natpair_q;             /* Total number of atom pairs for Q kernel    */
+    t_nblist         **nbl_fep;               /* List of free-energy atom pair interactions */
+    gmx_int64_t        outerListCreationStep; /* Step at which the outer list was created */
 } nbnxn_pairlist_set_t;
 
 enum {
@@ -282,7 +314,7 @@ typedef struct nbnxn_atomdata_t {
     gmx_bool                 bUseBufferFlags;         /* Use the flags or operate on all atoms     */
     nbnxn_buffer_flags_t     buffer_flags;            /* Flags for buffer zeroing+reduc.  */
     gmx_bool                 bUseTreeReduce;          /* Use tree for force reduction */
-    tMPI_Atomic_t           *syncStep;                /* Synchronization step for tree reduce */
+    tMPI_Atomic             *syncStep;                /* Synchronization step for tree reduce */
 } nbnxn_atomdata_t;
 
 #endif
index 99a30929e3f8816cfae8d80b9b8251e696c0964c..bac95872db2c984906d20558c169882fca7374f2 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,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.
@@ -78,7 +78,7 @@ using namespace gmx; // TODO: Remove when this file is moved into gmx namespace
  * This leads to more conditionals than shifting forward.
  * We do this to get more balanced pair lists.
  */
-static const bool pbc_shift_backward = true;
+constexpr bool c_pbcShiftBackward = true;
 
 
 static void nbs_cycle_clear(nbnxn_cycle_t *cc)
@@ -121,7 +121,7 @@ static void nbs_cycle_print(FILE *fp, const nbnxn_search_t nbs)
     fprintf(fp, "\n");
 }
 
-static gmx_inline int ci_to_cj(int ci, int na_cj_2log)
+gmx_unused static gmx_inline int ci_to_cj(int ci, int na_cj_2log)
 {
     switch (na_cj_2log)
     {
@@ -275,12 +275,12 @@ static void nbnxn_init_pairlist_fep(t_nblist *nl)
     nl->maxnrj      = 0;
     nl->nri         = 0;
     nl->nrj         = 0;
-    nl->iinr        = NULL;
-    nl->gid         = NULL;
-    nl->shift       = NULL;
-    nl->jindex      = NULL;
-    nl->jjnr        = NULL;
-    nl->excl_fep    = NULL;
+    nl->iinr        = nullptr;
+    nl->gid         = nullptr;
+    nl->shift       = nullptr;
+    nl->jindex      = nullptr;
+    nl->jjnr        = nullptr;
+    nl->excl_fep    = nullptr;
 
 }
 
@@ -298,7 +298,7 @@ void nbnxn_init_search(nbnxn_search_t           * nbs_ptr,
 
     nbs->bFEP   = bFEP;
 
-    nbs->DomDec = (n_dd_cells != NULL);
+    nbs->DomDec = (n_dd_cells != nullptr);
 
     clear_ivec(nbs->dd_dim);
     ngrid = 1;
@@ -319,9 +319,9 @@ void nbnxn_init_search(nbnxn_search_t           * nbs_ptr,
 
     nbnxn_grids_init(nbs, ngrid);
 
-    nbs->cell        = NULL;
+    nbs->cell        = nullptr;
     nbs->cell_nalloc = 0;
-    nbs->a           = NULL;
+    nbs->a           = nullptr;
     nbs->a_nalloc    = 0;
 
     nbs->nthread_max = nthread_max;
@@ -330,9 +330,9 @@ void nbnxn_init_search(nbnxn_search_t           * nbs_ptr,
     snew(nbs->work, nbs->nthread_max);
     for (int t = 0; t < nbs->nthread_max; t++)
     {
-        nbs->work[t].cxy_na           = NULL;
+        nbs->work[t].cxy_na           = nullptr;
         nbs->work[t].cxy_na_nalloc    = 0;
-        nbs->work[t].sort_work        = NULL;
+        nbs->work[t].sort_work        = nullptr;
         nbs->work[t].sort_work_nalloc = 0;
 
         snew(nbs->work[t].nbl_fep, 1);
@@ -340,7 +340,7 @@ void nbnxn_init_search(nbnxn_search_t           * nbs_ptr,
     }
 
     /* Initialize detailed nbsearch cycle counting */
-    nbs->print_cycles = (getenv("GMX_NBNXN_CYCLE") != 0);
+    nbs->print_cycles = (getenv("GMX_NBNXN_CYCLE") != nullptr);
     nbs->search_count = 0;
     nbs_cycle_clear(nbs->cc);
     for (int t = 0; t < nbs->nthread_max; t++)
@@ -386,10 +386,11 @@ static void get_cell_range(real b0, real b1,
 }
 
 /* Reference code calculating the distance^2 between two bounding boxes */
-static float box_dist2(float bx0, float bx1, float by0,
+/*
+   static float box_dist2(float bx0, float bx1, float by0,
                        float by1, float bz0, float bz1,
                        const nbnxn_bb_t *bb)
-{
+   {
     float d2;
     float dl, dh, dm, dm0;
 
@@ -414,7 +415,8 @@ static float box_dist2(float bx0, float bx1, float by0,
     d2 += dm0*dm0;
 
     return d2;
-}
+   }
+ */
 
 /* Plain C code calculating the distance^2 between two bounding boxes */
 static float subc_bb_dist2(int si, const nbnxn_bb_t *bb_i_ci,
@@ -566,12 +568,12 @@ static void subc_bb_dist2_simd4_xxxx(const float *bb_j,
 #endif /* NBNXN_SEARCH_BB_SIMD4 */
 
 
-/* Returns if any atom pair from two clusters is within distance sqrt(rl2) */
+/* Returns if any atom pair from two clusters is within distance sqrt(rlist2) */
 static gmx_inline gmx_bool
 clusterpair_in_range(const nbnxn_list_work_t *work,
                      int si,
                      int csj, int stride, const real *x_j,
-                     real rl2)
+                     real rlist2)
 {
 #if !GMX_SIMD4_HAVE_REAL
 
@@ -590,7 +592,7 @@ clusterpair_in_range(const nbnxn_list_work_t *work,
 
             real d2 = gmx::square(x_i[i0  ] - x_j[j0  ]) + gmx::square(x_i[i0+1] - x_j[j0+1]) + gmx::square(x_i[i0+2] - x_j[j0+2]);
 
-            if (d2 < rl2)
+            if (d2 < rlist2)
             {
                 return TRUE;
             }
@@ -608,7 +610,7 @@ clusterpair_in_range(const nbnxn_list_work_t *work,
      */
     assert(c_nbnxnGpuClusterSize == 8);
 
-    Simd4Real   rc2_S      = Simd4Real(rl2);
+    Simd4Real   rc2_S      = Simd4Real(rlist2);
 
     const real *x_i        = work->x_ci_simd;
 
@@ -722,13 +724,13 @@ static void check_excl_space(nbnxn_pairlist_t *nbl, int extra)
     }
 }
 
-/* Ensures there is enough space for ncell extra j-cells in the list */
+/* Ensures there is enough space for maxNumExtraClusters extra j-clusters in the list */
 static void check_cell_list_space_simple(nbnxn_pairlist_t *nbl,
-                                         int               ncell)
+                                         int               maxNumExtraClusters)
 {
     int cj_max;
 
-    cj_max = nbl->ncj + ncell;
+    cj_max = nbl->ncj + maxNumExtraClusters;
 
     if (cj_max > nbl->cj_nalloc)
     {
@@ -737,6 +739,11 @@ static void check_cell_list_space_simple(nbnxn_pairlist_t *nbl,
                            nbl->ncj*sizeof(*nbl->cj),
                            nbl->cj_nalloc*sizeof(*nbl->cj),
                            nbl->alloc, nbl->free);
+
+        nbnxn_realloc_void((void **)&nbl->cjOuter,
+                           nbl->ncj*sizeof(*nbl->cjOuter),
+                           nbl->cj_nalloc*sizeof(*nbl->cjOuter),
+                           nbl->alloc, nbl->free);
     }
 }
 
@@ -793,7 +800,7 @@ static void nbnxn_init_pairlist(nbnxn_pairlist_t *nbl,
                                 nbnxn_alloc_t    *alloc,
                                 nbnxn_free_t     *free)
 {
-    if (alloc == NULL)
+    if (alloc == nullptr)
     {
         nbl->alloc = nbnxn_alloc_aligned;
     }
@@ -801,7 +808,7 @@ static void nbnxn_init_pairlist(nbnxn_pairlist_t *nbl,
     {
         nbl->alloc = alloc;
     }
-    if (free == NULL)
+    if (free == nullptr)
     {
         nbl->free = nbnxn_free_aligned;
     }
@@ -815,19 +822,19 @@ static void nbnxn_init_pairlist(nbnxn_pairlist_t *nbl,
     nbl->na_ci       = 0;
     nbl->na_cj       = 0;
     nbl->nci         = 0;
-    nbl->ci          = NULL;
+    nbl->ci          = nullptr;
     nbl->ci_nalloc   = 0;
     nbl->nsci        = 0;
-    nbl->sci         = NULL;
+    nbl->sci         = nullptr;
     nbl->sci_nalloc  = 0;
     nbl->ncj         = 0;
     nbl->ncjInUse    = 0;
-    nbl->cj          = NULL;
+    nbl->cj          = nullptr;
     nbl->cj_nalloc   = 0;
     nbl->ncj4        = 0;
     /* We need one element extra in sj, so alloc initially with 1 */
     nbl->cj4_nalloc  = 0;
-    nbl->cj4         = NULL;
+    nbl->cj4         = nullptr;
     nbl->nci_tot     = 0;
 
     if (!nbl->bSimple)
@@ -837,7 +844,7 @@ static void nbnxn_init_pairlist(nbnxn_pairlist_t *nbl,
         GMX_ASSERT(sizeof(nbl->cj4[0].imei[0].imask)*8 >= c_nbnxnGpuJgroupSize*c_gpuNumClusterPerCell, "The i super-cluster cluster interaction mask does not contain a sufficient number of bits");
         GMX_ASSERT(sizeof(nbl->excl[0])*8 >= c_nbnxnGpuJgroupSize*c_gpuNumClusterPerCell, "The GPU exclusion mask does not contain a sufficient number of bits");
 
-        nbl->excl        = NULL;
+        nbl->excl        = nullptr;
         nbl->excl_nalloc = 0;
         nbl->nexcl       = 0;
         check_excl_space(nbl, 1);
@@ -868,9 +875,9 @@ static void nbnxn_init_pairlist(nbnxn_pairlist_t *nbl,
 #endif
     snew_aligned(nbl->work->d2, c_gpuNumClusterPerCell, NBNXN_SEARCH_BB_MEM_ALIGN);
 
-    nbl->work->sort            = NULL;
+    nbl->work->sort            = nullptr;
     nbl->work->sort_nalloc     = 0;
-    nbl->work->sci_sort        = NULL;
+    nbl->work->sci_sort        = nullptr;
     nbl->work->sci_sort_nalloc = 0;
 }
 
@@ -915,11 +922,11 @@ void nbnxn_init_pairlist_set(nbnxn_pairlist_set_t *nbl_list,
             }
             else
             {
-                nbnxn_init_pairlist(nbl_list->nbl[i], nbl_list->bSimple, NULL, NULL);
+                nbnxn_init_pairlist(nbl_list->nbl[i], nbl_list->bSimple, nullptr, nullptr);
                 if (bSimple && nbl_list->nnbl > 1)
                 {
                     snew(nbl_list->nbl_work[i], 1);
-                    nbnxn_init_pairlist(nbl_list->nbl_work[i], nbl_list->bSimple, NULL, NULL);
+                    nbnxn_init_pairlist(nbl_list->nbl_work[i], nbl_list->bSimple, nullptr, nullptr);
                 }
             }
 
@@ -1129,7 +1136,7 @@ static unsigned int get_imask(gmx_bool rdiag, int ci, int cj)
 }
 
 /* Returns a diagonal or off-diagonal interaction mask for cj-size=2 */
-static unsigned int get_imask_simd_j2(gmx_bool rdiag, int ci, int cj)
+gmx_unused static unsigned int get_imask_simd_j2(gmx_bool rdiag, int ci, int cj)
 {
     return (rdiag && ci*2 == cj ? NBNXN_INTERACTION_MASK_DIAG_J2_0 :
             (rdiag && ci*2+1 == cj ? NBNXN_INTERACTION_MASK_DIAG_J2_1 :
@@ -1137,13 +1144,13 @@ static unsigned int get_imask_simd_j2(gmx_bool rdiag, int ci, int cj)
 }
 
 /* Returns a diagonal or off-diagonal interaction mask for cj-size=4 */
-static unsigned int get_imask_simd_j4(gmx_bool rdiag, int ci, int cj)
+gmx_unused static unsigned int get_imask_simd_j4(gmx_bool rdiag, int ci, int cj)
 {
     return (rdiag && ci == cj ? NBNXN_INTERACTION_MASK_DIAG : NBNXN_INTERACTION_MASK_ALL);
 }
 
 /* Returns a diagonal or off-diagonal interaction mask for cj-size=8 */
-static unsigned int get_imask_simd_j8(gmx_bool rdiag, int ci, int cj)
+gmx_unused static unsigned int get_imask_simd_j8(gmx_bool rdiag, int ci, int cj)
 {
     return (rdiag && ci == cj*2 ? NBNXN_INTERACTION_MASK_DIAG_J8_0 :
             (rdiag && ci == cj*2+1 ? NBNXN_INTERACTION_MASK_DIAG_J8_1 :
@@ -1166,32 +1173,41 @@ static unsigned int get_imask_simd_j8(gmx_bool rdiag, int ci, int cj)
 #endif
 #endif
 
-/* Plain C code for making a pair list of cell ci vs cell cjf-cjl.
- * Checks bounding box distances and possibly atom pair distances.
+/* Plain C code for checking and adding cluster-pairs to the list.
+ *
+ * \param[in]     gridj               The j-grid
+ * \param[in,out] nbl                 The pair-list to store the cluster pairs in
+ * \param[in]     icluster            The index of the i-cluster
+ * \param[in]     jclusterFirst       The first cluster in the j-range
+ * \param[in]     jclusterLast        The last cluster in the j-range
+ * \param[in]     excludeSubDiagonal  Exclude atom pairs with i-index > j-index
+ * \param[in]     x_j                 Coordinates for the j-atom, in xyz format
+ * \param[in]     rlist2              The squared list cut-off
+ * \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 void make_cluster_list_simple(const nbnxn_grid_t *gridj,
-                                     nbnxn_pairlist_t *nbl,
-                                     int ci, int cjf, int cjl,
-                                     gmx_bool remove_sub_diag,
-                                     const real *x_j,
-                                     real rl2, float rbb2,
-                                     int *ndistc)
+static void
+makeClusterListSimple(const nbnxn_grid_t *      gridj,
+                      nbnxn_pairlist_t *        nbl,
+                      int                       icluster,
+                      int                       jclusterFirst,
+                      int                       jclusterLast,
+                      bool                      excludeSubDiagonal,
+                      const real * gmx_restrict x_j,
+                      real                      rlist2,
+                      float                     rbb2,
+                      int * gmx_restrict        numDistanceChecks)
 {
-    const nbnxn_bb_t        *bb_ci;
-    const real              *x_ci;
+    const nbnxn_bb_t * gmx_restrict bb_ci = nbl->work->bb_ci;
+    const real * gmx_restrict       x_ci  = nbl->work->x_ci;
 
-    gmx_bool                 InRange;
-    real                     d2;
-    int                      cjf_gl, cjl_gl;
-
-    bb_ci = nbl->work->bb_ci;
-    x_ci  = nbl->work->x_ci;
+    gmx_bool                        InRange;
 
     InRange = FALSE;
-    while (!InRange && cjf <= cjl)
+    while (!InRange && jclusterFirst <= jclusterLast)
     {
-        d2       = subc_bb_dist2(0, bb_ci, cjf, gridj->bb);
-        *ndistc += 2;
+        real d2  = subc_bb_dist2(0, bb_ci, jclusterFirst, gridj->bb);
+        *numDistanceChecks += 2;
 
         /* Check if the distance is within the distance where
          * we use only the bounding box distance rbb,
@@ -1202,9 +1218,9 @@ static void make_cluster_list_simple(const nbnxn_grid_t *gridj,
         {
             InRange = TRUE;
         }
-        else if (d2 < rl2)
+        else if (d2 < rlist2)
         {
-            cjf_gl = gridj->cell0 + cjf;
+            int cjf_gl = gridj->cell0 + jclusterFirst;
             for (int i = 0; i < NBNXN_CPU_CLUSTER_I_SIZE && !InRange; i++)
             {
                 for (int j = 0; j < NBNXN_CPU_CLUSTER_I_SIZE; j++)
@@ -1212,14 +1228,14 @@ static void make_cluster_list_simple(const nbnxn_grid_t *gridj,
                     InRange = InRange ||
                         (gmx::square(x_ci[i*STRIDE_XYZ+XX] - x_j[(cjf_gl*NBNXN_CPU_CLUSTER_I_SIZE+j)*STRIDE_XYZ+XX]) +
                          gmx::square(x_ci[i*STRIDE_XYZ+YY] - x_j[(cjf_gl*NBNXN_CPU_CLUSTER_I_SIZE+j)*STRIDE_XYZ+YY]) +
-                         gmx::square(x_ci[i*STRIDE_XYZ+ZZ] - x_j[(cjf_gl*NBNXN_CPU_CLUSTER_I_SIZE+j)*STRIDE_XYZ+ZZ]) < rl2);
+                         gmx::square(x_ci[i*STRIDE_XYZ+ZZ] - x_j[(cjf_gl*NBNXN_CPU_CLUSTER_I_SIZE+j)*STRIDE_XYZ+ZZ]) < rlist2);
                 }
             }
-            *ndistc += NBNXN_CPU_CLUSTER_I_SIZE*NBNXN_CPU_CLUSTER_I_SIZE;
+            *numDistanceChecks += NBNXN_CPU_CLUSTER_I_SIZE*NBNXN_CPU_CLUSTER_I_SIZE;
         }
         if (!InRange)
         {
-            cjf++;
+            jclusterFirst++;
         }
     }
     if (!InRange)
@@ -1228,10 +1244,10 @@ static void make_cluster_list_simple(const nbnxn_grid_t *gridj,
     }
 
     InRange = FALSE;
-    while (!InRange && cjl > cjf)
+    while (!InRange && jclusterLast > jclusterFirst)
     {
-        d2       = subc_bb_dist2(0, bb_ci, cjl, gridj->bb);
-        *ndistc += 2;
+        real d2  = subc_bb_dist2(0, bb_ci, jclusterLast, gridj->bb);
+        *numDistanceChecks += 2;
 
         /* Check if the distance is within the distance where
          * we use only the bounding box distance rbb,
@@ -1242,9 +1258,9 @@ static void make_cluster_list_simple(const nbnxn_grid_t *gridj,
         {
             InRange = TRUE;
         }
-        else if (d2 < rl2)
+        else if (d2 < rlist2)
         {
-            cjl_gl = gridj->cell0 + cjl;
+            int cjl_gl = gridj->cell0 + jclusterLast;
             for (int i = 0; i < NBNXN_CPU_CLUSTER_I_SIZE && !InRange; i++)
             {
                 for (int j = 0; j < NBNXN_CPU_CLUSTER_I_SIZE; j++)
@@ -1252,24 +1268,24 @@ static void make_cluster_list_simple(const nbnxn_grid_t *gridj,
                     InRange = InRange ||
                         (gmx::square(x_ci[i*STRIDE_XYZ+XX] - x_j[(cjl_gl*NBNXN_CPU_CLUSTER_I_SIZE+j)*STRIDE_XYZ+XX]) +
                          gmx::square(x_ci[i*STRIDE_XYZ+YY] - x_j[(cjl_gl*NBNXN_CPU_CLUSTER_I_SIZE+j)*STRIDE_XYZ+YY]) +
-                         gmx::square(x_ci[i*STRIDE_XYZ+ZZ] - x_j[(cjl_gl*NBNXN_CPU_CLUSTER_I_SIZE+j)*STRIDE_XYZ+ZZ]) < rl2);
+                         gmx::square(x_ci[i*STRIDE_XYZ+ZZ] - x_j[(cjl_gl*NBNXN_CPU_CLUSTER_I_SIZE+j)*STRIDE_XYZ+ZZ]) < rlist2);
                 }
             }
-            *ndistc += NBNXN_CPU_CLUSTER_I_SIZE*NBNXN_CPU_CLUSTER_I_SIZE;
+            *numDistanceChecks += NBNXN_CPU_CLUSTER_I_SIZE*NBNXN_CPU_CLUSTER_I_SIZE;
         }
         if (!InRange)
         {
-            cjl--;
+            jclusterLast--;
         }
     }
 
-    if (cjf <= cjl)
+    if (jclusterFirst <= jclusterLast)
     {
-        for (int cj = cjf; cj <= cjl; cj++)
+        for (int jcluster = jclusterFirst; jcluster <= jclusterLast; jcluster++)
         {
             /* Store cj and the interaction mask */
-            nbl->cj[nbl->ncj].cj   = gridj->cell0 + cj;
-            nbl->cj[nbl->ncj].excl = get_imask(remove_sub_diag, ci, cj);
+            nbl->cj[nbl->ncj].cj   = gridj->cell0 + jcluster;
+            nbl->cj[nbl->ncj].excl = get_imask(excludeSubDiagonal, icluster, jcluster);
             nbl->ncj++;
         }
         /* Increase the closing index in i super-cell list */
@@ -1293,8 +1309,8 @@ static void make_cluster_list_supersub(const nbnxn_grid_t *gridi,
                                        int sci, int scj,
                                        gmx_bool sci_equals_scj,
                                        int stride, const real *x,
-                                       real rl2, float rbb2,
-                                       int *ndistc)
+                                       real rlist2, float rbb2,
+                                       int *numDistanceChecks)
 {
     nbnxn_list_work_t *work   = nbl->work;
 
@@ -1348,7 +1364,7 @@ static void make_cluster_list_supersub(const nbnxn_grid_t *gridi,
         /* Determine all ci1 bb distances in one call with SIMD4 */
         subc_bb_dist2_simd4_xxxx(gridj->pbb+(cj>>STRIDE_PBB_2LOG)*NNBSBB_XXXX+(cj & (STRIDE_PBB-1)),
                                  ci1, pbb_ci, d2l);
-        *ndistc += c_nbnxnGpuClusterSize*2;
+        *numDistanceChecks += c_nbnxnGpuClusterSize*2;
 #endif
 
         int          npair = 0;
@@ -1363,8 +1379,8 @@ static void make_cluster_list_supersub(const nbnxn_grid_t *gridi,
 
 #if !NBNXN_BBXXXX
             /* Determine the bb distance between ci and cj */
-            d2l[ci]  = subc_bb_dist2(ci, bb_ci, cj, gridj->bb);
-            *ndistc += 2;
+            d2l[ci]             = subc_bb_dist2(ci, bb_ci, cj, gridj->bb);
+            *numDistanceChecks += 2;
 #endif
             float d2 = d2l[ci];
 
@@ -1374,15 +1390,15 @@ static void make_cluster_list_supersub(const nbnxn_grid_t *gridi,
              * or within the cut-off and there is at least one atom pair
              * within the cut-off. This check is very costly.
              */
-            *ndistc += c_nbnxnGpuClusterSize*c_nbnxnGpuClusterSize;
+            *numDistanceChecks += c_nbnxnGpuClusterSize*c_nbnxnGpuClusterSize;
             if (d2 < rbb2 ||
-                (d2 < rl2 &&
-                 clusterpair_in_range(work, ci, cj_gl, stride, x, rl2)))
+                (d2 < rlist2 &&
+                 clusterpair_in_range(work, ci, cj_gl, stride, x, rlist2)))
 #else
             /* Check if the distance between the two bounding boxes
              * in within the pair-list cut-off.
              */
-            if (d2 < rl2)
+            if (d2 < rlist2)
 #endif
             {
                 /* Flag this i-subcell to be taken into account */
@@ -1401,7 +1417,7 @@ static void make_cluster_list_supersub(const nbnxn_grid_t *gridi,
          * within the cut-off, so we could get rid of it.
          */
         if (npair == 1 && d2l[ci_last] >= rbb2 &&
-            !clusterpair_in_range(work, ci_last, cj_gl, stride, x, rl2))
+            !clusterpair_in_range(work, ci_last, cj_gl, stride, x, rlist2))
         {
             imask &= ~(1U << (cj_offset*c_gpuNumClusterPerCell + ci_last));
             npair--;
@@ -2127,6 +2143,11 @@ static void nb_realloc_ci(nbnxn_pairlist_t *nbl, int n)
                        nbl->nci*sizeof(*nbl->ci),
                        nbl->ci_nalloc*sizeof(*nbl->ci),
                        nbl->alloc, nbl->free);
+
+    nbnxn_realloc_void((void **)&nbl->ciOuter,
+                       nbl->nci*sizeof(*nbl->ciOuter),
+                       nbl->ci_nalloc*sizeof(*nbl->ciOuter),
+                       nbl->alloc, nbl->free);
 }
 
 /* Reallocate the super-cell sci list for at least n entries */
@@ -2390,6 +2411,7 @@ static void clear_pairlist(nbnxn_pairlist_t *nbl)
     nbl->ncjInUse      = 0;
     nbl->ncj4          = 0;
     nbl->nci_tot       = 0;
+    nbl->nciOuter      = -1;
     nbl->nexcl         = 1;
 
     nbl->work->ncj_noq = 0;
@@ -2401,7 +2423,7 @@ static void clear_pairlist_fep(t_nblist *nl)
 {
     nl->nri = 0;
     nl->nrj = 0;
-    if (nl->jindex == NULL)
+    if (nl->jindex == nullptr)
     {
         snew(nl->jindex, 1);
     }
@@ -2444,9 +2466,9 @@ static void set_icell_bbxxxx_supersub(const float *bb, int ci,
 #endif
 
 /* Sets a super-cell and sub cell bounding boxes, including PBC shift */
-static void set_icell_bb_supersub(const nbnxn_bb_t *bb, int ci,
-                                  real shx, real shy, real shz,
-                                  nbnxn_bb_t *bb_ci)
+gmx_unused static void set_icell_bb_supersub(const nbnxn_bb_t *bb, int ci,
+                                             real shx, real shy, real shz,
+                                             nbnxn_bb_t *bb_ci)
 {
     for (int i = 0; i < c_gpuNumClusterPerCell; i++)
     {
@@ -3166,16 +3188,16 @@ static void nbnxn_make_pairlist_part(const nbnxn_search_t nbs,
 {
     int               na_cj_2log;
     matrix            box;
-    real              rl2, rl_fep2 = 0;
+    real              rlist2, rl_fep2 = 0;
     float             rbb2;
     int               ci_b, ci, ci_x, ci_y, ci_xy, cj;
     ivec              shp;
     int               shift;
     real              shx, shy, shz;
     int               conv_i, cell0_i;
-    const nbnxn_bb_t *bb_i = NULL;
+    const nbnxn_bb_t *bb_i = nullptr;
 #if NBNXN_BBXXXX
-    const float      *pbb_i = NULL;
+    const float      *pbb_i = nullptr;
 #endif
     const float      *bbcz_i, *bbcz_j;
     const int        *flags_i;
@@ -3183,11 +3205,9 @@ static void nbnxn_make_pairlist_part(const nbnxn_search_t nbs,
     real              bz1_frac;
     real              d2cx, d2z, d2z_cx, d2z_cy, d2zx, d2zxy, d2xy;
     int               cxf, cxl, cyf, cyf_x, cyl;
-    int               c0, c1, cs, cf, cl;
-    int               ndistc;
-    int               ncpcheck;
+    int               numDistanceChecks;
     int               gridi_flag_shift = 0, gridj_flag_shift = 0;
-    gmx_bitmask_t    *gridj_flag       = NULL;
+    gmx_bitmask_t    *gridj_flag       = nullptr;
     int               ncj_old_i, ncj_old_j;
 
     nbs_cycle_start(&work->cc[enbsCCsearch]);
@@ -3216,7 +3236,7 @@ static void nbnxn_make_pairlist_part(const nbnxn_search_t nbs,
 
     copy_mat(nbs->box, box);
 
-    rl2 = nbl->rlist*nbl->rlist;
+    rlist2 = nbl->rlist*nbl->rlist;
 
     if (nbs->bFEP && !nbl->bSimple)
     {
@@ -3255,7 +3275,7 @@ static void nbnxn_make_pairlist_part(const nbnxn_search_t nbs,
         else
         {
             if (d == XX &&
-                box[XX][XX] - fabs(box[YY][XX]) - fabs(box[ZZ][XX]) < std::sqrt(rl2))
+                box[XX][XX] - fabs(box[YY][XX]) - fabs(box[ZZ][XX]) < std::sqrt(rlist2))
             {
                 shp[d] = 2;
             }
@@ -3310,8 +3330,7 @@ static void nbnxn_make_pairlist_part(const nbnxn_search_t nbs,
                 gridi->nc, gridi->nc/(double)(gridi->ncx*gridi->ncy), ci_block);
     }
 
-    ndistc   = 0;
-    ncpcheck = 0;
+    numDistanceChecks = 0;
 
     /* Initially ci_b and ci to 1 before where we want them to start,
      * as they will both be incremented in next_ci.
@@ -3344,7 +3363,7 @@ static void nbnxn_make_pairlist_part(const nbnxn_search_t nbs,
             {
                 d2cx = gmx::square(gridj->c0[XX] - bx1);
 
-                if (d2cx >= rl2)
+                if (d2cx >= rlist2)
                 {
                     continue;
                 }
@@ -3376,7 +3395,7 @@ static void nbnxn_make_pairlist_part(const nbnxn_search_t nbs,
 
             d2z_cx = d2z + d2cx;
 
-            if (d2z_cx >= rl2)
+            if (d2z_cx >= rlist2)
             {
                 continue;
             }
@@ -3405,7 +3424,7 @@ static void nbnxn_make_pairlist_part(const nbnxn_search_t nbs,
 
                 get_cell_range(by0, by1,
                                gridj->ncy, gridj->c0[YY], gridj->sy, gridj->inv_sy,
-                               d2z_cx, rl2,
+                               d2z_cx, rlist2,
                                &cyf, &cyl);
 
                 if (cyf > cyl)
@@ -3427,7 +3446,7 @@ static void nbnxn_make_pairlist_part(const nbnxn_search_t nbs,
                 {
                     shift = XYZ2IS(tx, ty, tz);
 
-                    if (pbc_shift_backward && gridi == gridj && shift > CENTRAL)
+                    if (c_pbcShiftBackward && gridi == gridj && shift > CENTRAL)
                     {
                         continue;
                     }
@@ -3447,7 +3466,7 @@ static void nbnxn_make_pairlist_part(const nbnxn_search_t nbs,
 
                     get_cell_range(bx0, bx1,
                                    gridj->ncx, gridj->c0[XX], gridj->sx, gridj->inv_sx,
-                                   d2z_cy, rl2,
+                                   d2z_cy, rlist2,
                                    &cxf, &cxl);
 
                     if (cxf > cxl)
@@ -3464,7 +3483,7 @@ static void nbnxn_make_pairlist_part(const nbnxn_search_t nbs,
                         new_sci_entry(nbl, cell0_i+ci, shift);
                     }
 
-                    if ((!pbc_shift_backward || (shift == CENTRAL &&
+                    if ((!c_pbcShiftBackward || (shift == CENTRAL &&
                                                  gridi == gridj)) &&
                         cxf < ci_x)
                     {
@@ -3508,7 +3527,7 @@ static void nbnxn_make_pairlist_part(const nbnxn_search_t nbs,
 
                         if (gridi == gridj &&
                             cx == 0 &&
-                            (!pbc_shift_backward || shift == CENTRAL) &&
+                            (!c_pbcShiftBackward || shift == CENTRAL) &&
                             cyf < ci_y)
                         {
                             /* Leave the pairs with i > j.
@@ -3523,15 +3542,8 @@ static void nbnxn_make_pairlist_part(const nbnxn_search_t nbs,
 
                         for (int cy = cyf_x; cy <= cyl; cy++)
                         {
-                            c0 = gridj->cxy_ind[cx*gridj->ncy+cy];
-                            c1 = gridj->cxy_ind[cx*gridj->ncy+cy+1];
-
-                            if (pbc_shift_backward &&
-                                gridi == gridj &&
-                                shift == CENTRAL && c0 < ci)
-                            {
-                                c0 = ci;
-                            }
+                            const int columnStart = gridj->cxy_ind[cx*gridj->ncy + cy];
+                            const int columnEnd   = gridj->cxy_ind[cx*gridj->ncy + cy + 1];
 
                             d2zxy = d2zx;
                             if (gridj->c0[YY] + cy*gridj->sy > by1)
@@ -3542,56 +3554,78 @@ static void nbnxn_make_pairlist_part(const nbnxn_search_t nbs,
                             {
                                 d2zxy += gmx::square(gridj->c0[YY] + (cy+1)*gridj->sy - by0);
                             }
-                            if (c1 > c0 && d2zxy < rl2)
+                            if (columnStart < columnEnd && d2zxy < rlist2)
                             {
-                                cs = c0 + static_cast<int>(bz1_frac*(c1 - c0));
-                                if (cs >= c1)
+                                /* To improve efficiency in the common case
+                                 * of a homogeneous particle distribution,
+                                 * we estimate the index of the middle cell
+                                 * in range (midCell). We search down and up
+                                 * starting from this index.
+                                 *
+                                 * Note that the bbcz_j array contains bounds
+                                 * for i-clusters, thus for clusters of 4 atoms.
+                                 * For the common case where the j-cluster size
+                                 * is 8, we could step with a stride of 2,
+                                 * but we do not do this because it would
+                                 * complicate this code even more.
+                                 */
+                                int midCell = columnStart + static_cast<int>(bz1_frac*(columnEnd - columnStart));
+                                if (midCell >= columnEnd)
                                 {
-                                    cs = c1 - 1;
+                                    midCell = columnEnd - 1;
                                 }
 
                                 d2xy = d2zxy - d2z;
 
                                 /* Find the lowest cell that can possibly
                                  * be within range.
+                                 * Check if we hit the bottom of the grid,
+                                 * if the j-cell is below the i-cell and if so,
+                                 * if it is within range.
                                  */
-                                cf = cs;
-                                while (cf > c0 &&
-                                       (bbcz_j[cf*NNBSBB_D+1] >= bz0 ||
-                                        d2xy + gmx::square(bbcz_j[cf*NNBSBB_D+1] - bz0) < rl2))
+                                int downTestCell = midCell;
+                                while (downTestCell >= columnStart &&
+                                       (bbcz_j[downTestCell*NNBSBB_D + 1] >= bz0 ||
+                                        d2xy + gmx::square(bbcz_j[downTestCell*NNBSBB_D + 1] - bz0) < rlist2))
                                 {
-                                    cf--;
+                                    downTestCell--;
                                 }
+                                int firstCell = downTestCell + 1;
 
                                 /* Find the highest cell that can possibly
                                  * be within range.
+                                 * Check if we hit the top of the grid,
+                                 * if the j-cell is above the i-cell and if so,
+                                 * if it is within range.
                                  */
-                                cl = cs;
-                                while (cl < c1-1 &&
-                                       (bbcz_j[cl*NNBSBB_D] <= bz1 ||
-                                        d2xy + gmx::square(bbcz_j[cl*NNBSBB_D] - bz1) < rl2))
+                                int upTestCell = midCell + 1;
+                                while (upTestCell < columnEnd &&
+                                       (bbcz_j[upTestCell*NNBSBB_D] <= bz1 ||
+                                        d2xy + gmx::square(bbcz_j[upTestCell*NNBSBB_D] - bz1) < rlist2))
                                 {
-                                    cl++;
+                                    upTestCell++;
                                 }
+                                int lastCell = upTestCell - 1;
 
-#ifdef NBNXN_REFCODE
+#define NBNXN_REFCODE 0
+#if NBNXN_REFCODE
                                 {
                                     /* Simple reference code, for debugging,
                                      * overrides the more complex code above.
                                      */
-                                    cf = c1;
-                                    cl = -1;
-                                    for (int k = c0; k < c1; k++)
+                                    firstCell = columnEnd;
+                                    lastCell  = -1;
+                                    for (int k = columnStart; k < columnEnd; k++)
                                     {
-                                        if (box_dist2(bx0, bx1, by0, by1, bz0, bz1, bb+k) < rl2 &&
-                                            k < cf)
+                                        if (d2xy + gmx::square(bbcz_j[k*NNBSBB_D + 1] - bz0) < rlist2 &&
+                                            k < firstCell)
                                         {
-                                            cf = k;
+                                            firstCell = k;
                                         }
-                                        if (box_dist2(bx0, bx1, by0, by1, bz0, bz1, bb+k) < rl2 &&
-                                            k > cl)
+                                        if (d2xy + gmx::square(bbcz_j[k*NNBSBB_D] - bz1) < rlist2 &&
+                                            k > lastCell)
                                         {
-                                            cl = k;
+                                            lastCell = k;
                                         }
                                     }
                                 }
@@ -3602,66 +3636,74 @@ static void nbnxn_make_pairlist_part(const nbnxn_search_t nbs,
                                     /* We want each atom/cell pair only once,
                                      * only use cj >= ci.
                                      */
-                                    if (!pbc_shift_backward || shift == CENTRAL)
+                                    if (!c_pbcShiftBackward || shift == CENTRAL)
                                     {
-                                        cf = std::max(cf, ci);
+                                        firstCell = std::max(firstCell, ci);
                                     }
                                 }
 
-                                if (cf <= cl)
+                                if (firstCell <= lastCell)
                                 {
+                                    GMX_ASSERT(firstCell >= columnStart && lastCell < columnEnd, "The range should reside within the current grid column");
+
                                     /* For f buffer flags with simple lists */
                                     ncj_old_j = nbl->ncj;
 
+                                    if (nbl->bSimple)
+                                    {
+                                        /* We have a maximum of 2 j-clusters
+                                         * per i-cluster sized cell.
+                                         */
+                                        check_cell_list_space_simple(nbl, 2*(lastCell - firstCell + 1));
+                                    }
+                                    else
+                                    {
+                                        check_cell_list_space_supersub(nbl, lastCell - firstCell + 1);
+                                    }
+
                                     switch (nb_kernel_type)
                                     {
                                         case nbnxnk4x4_PlainC:
-                                            check_cell_list_space_simple(nbl, cl-cf+1);
-
-                                            make_cluster_list_simple(gridj,
-                                                                     nbl, ci, cf, cl,
-                                                                     (gridi == gridj && shift == CENTRAL),
-                                                                     nbat->x,
-                                                                     rl2, rbb2,
-                                                                     &ndistc);
+                                            makeClusterListSimple(gridj,
+                                                                  nbl, ci, firstCell, lastCell,
+                                                                  (gridi == gridj && shift == CENTRAL),
+                                                                  nbat->x,
+                                                                  rlist2, rbb2,
+                                                                  &numDistanceChecks);
                                             break;
 #ifdef GMX_NBNXN_SIMD_4XN
                                         case nbnxnk4xN_SIMD_4xN:
-                                            check_cell_list_space_simple(nbl, ci_to_cj_simd_4xn(cl - cf) + 2);
-                                            make_cluster_list_simd_4xn(gridj,
-                                                                       nbl, ci, cf, cl,
-                                                                       (gridi == gridj && shift == CENTRAL),
-                                                                       nbat->x,
-                                                                       rl2, rbb2,
-                                                                       &ndistc);
+                                            makeClusterListSimd4xn(gridj,
+                                                                   nbl, ci, firstCell, lastCell,
+                                                                   (gridi == gridj && shift == CENTRAL),
+                                                                   nbat->x,
+                                                                   rlist2, rbb2,
+                                                                   &numDistanceChecks);
                                             break;
 #endif
 #ifdef GMX_NBNXN_SIMD_2XNN
                                         case nbnxnk4xN_SIMD_2xNN:
-                                            check_cell_list_space_simple(nbl, ci_to_cj_simd_2xnn(cl - cf) + 2);
-                                            make_cluster_list_simd_2xnn(gridj,
-                                                                        nbl, ci, cf, cl,
-                                                                        (gridi == gridj && shift == CENTRAL),
-                                                                        nbat->x,
-                                                                        rl2, rbb2,
-                                                                        &ndistc);
+                                            makeClusterListSimd2xnn(gridj,
+                                                                    nbl, ci, firstCell, lastCell,
+                                                                    (gridi == gridj && shift == CENTRAL),
+                                                                    nbat->x,
+                                                                    rlist2, rbb2,
+                                                                    &numDistanceChecks);
                                             break;
 #endif
                                         case nbnxnk8x8x8_PlainC:
                                         case nbnxnk8x8x8_GPU:
-                                            check_cell_list_space_supersub(nbl, cl-cf+1);
-                                            for (cj = cf; cj <= cl; cj++)
+                                            for (cj = firstCell; cj <= lastCell; cj++)
                                             {
                                                 make_cluster_list_supersub(gridi, gridj,
                                                                            nbl, ci, cj,
                                                                            (gridi == gridj && shift == CENTRAL && ci == cj),
                                                                            nbat->xstride, nbat->x,
-                                                                           rl2, rbb2,
-                                                                           &ndistc);
+                                                                           rlist2, rbb2,
+                                                                           &numDistanceChecks);
                                             }
                                             break;
                                     }
-                                    ncpcheck += cl - cf + 1;
 
                                     if (bFBufferFlag && nbl->ncj > ncj_old_j)
                                     {
@@ -3740,7 +3782,7 @@ static void nbnxn_make_pairlist_part(const nbnxn_search_t nbs,
         }
     }
 
-    work->ndistc = ndistc;
+    work->ndistc = numDistanceChecks;
 
     nbs_cycle_stop(&work->cc[enbsCCsearch]);
 
@@ -3748,9 +3790,7 @@ static void nbnxn_make_pairlist_part(const nbnxn_search_t nbs,
 
     if (debug)
     {
-        fprintf(debug, "number of distance checks %d\n", ndistc);
-        fprintf(debug, "ncpcheck %s %d\n", gridi == gridj ? "local" : "non-local",
-                ncpcheck);
+        fprintf(debug, "number of distance checks %d\n", numDistanceChecks);
 
         if (nbl->bSimple)
         {
@@ -4332,6 +4372,11 @@ void nbnxn_make_pairlist(const nbnxn_search_t  nbs,
         balance_fep_lists(nbs, nbl_list);
     }
 
+    /* This is a fresh list, so not pruned, stored using ci and nci.
+     * ciOuter and nciOuter are invalid at this point.
+     */
+    GMX_ASSERT(nbl_list->nbl[0]->nciOuter == -1, "nciOuter should have been set to -1 to signal that it is invalid");
+
     /* Special performance logging stuff (env.var. GMX_NBNXN_CYCLE) */
     if (LOCAL_I(iloc))
     {
@@ -4385,3 +4430,32 @@ void nbnxn_make_pairlist(const nbnxn_search_t  nbs,
         }
     }
 }
+
+void nbnxnPrepareListForDynamicPruning(nbnxn_pairlist_set_t *listSet)
+{
+    /* TODO: Restructure the lists so we have actual outer and inner
+     *       list objects so we can set a single pointer instead of
+     *       swapping several pointers.
+     */
+
+    for (int i = 0; i < listSet->nnbl; i++)
+    {
+        /* The search produced a list in ci/cj.
+         * Swap the list pointers so we get the outer list is ciOuter,cjOuter
+         * and we can prune that to get an inner list in ci/cj.
+         */
+        nbnxn_pairlist_t *list = listSet->nbl[i];
+        list->nciOuter         = list->nci;
+
+        nbnxn_ci_t *ciTmp      = list->ciOuter;
+        list->ciOuter          = list->ci;
+        list->ci               = ciTmp;
+
+        nbnxn_cj_t *cjTmp      = list->cjOuter;
+        list->cjOuter          = list->cj;
+        list->cj               = cjTmp;
+
+        /* Signal that this inner list is currently invalid */
+        list->nci              = -1;
+    }
+}
index 8089e3f8268f15e8c21f31f5fc607024beef1ae5..f6ea8462067ac5975f79120191419f35249324f5 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,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.
@@ -83,4 +83,10 @@ void nbnxn_make_pairlist(const nbnxn_search_t  nbs,
                          int                   nb_kernel_type,
                          t_nrnb               *nrnb);
 
+/*! \brief Prepare the list-set produced by the search for dynamic pruning
+ *
+ * \param[in,out] listSet  The list-set to prepare for dynamic pruning.
+ */
+void nbnxnPrepareListForDynamicPruning(nbnxn_pairlist_set_t *listSet);
+
 #endif
index 44b7aa8702093644dee154ce9d65d1e1e7e17668..336185a9fd4f888e3a3177ec043df55a55f93b30 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,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.
@@ -61,22 +61,36 @@ icell_set_x_simd_2xnn(int ci,
     store(x_ci_simd + 5*GMX_SIMD_REAL_WIDTH, load1DualHsimd(x + ia + 2*STRIDE_S + 2) + SimdReal(shz) );
 }
 
-/* SIMD code for making a pair list of cell ci vs cell cjf-cjl
- * for coordinates in packed format.
+/* SIMD code for checking and adding cluster-pairs to the list using coordinates in packed format.
+ *
  * Checks bouding box distances and possibly atom pair distances.
  * This is an accelerated version of make_cluster_list_simple.
+ *
+ * \param[in]     gridj               The j-grid
+ * \param[in,out] nbl                 The pair-list to store the cluster pairs in
+ * \param[in]     icluster            The index of the i-cluster
+ * \param[in]     firstCell           The first cluster in the j-range, using i-cluster size indexing
+ * \param[in]     lastCell            The last cluster in the j-range, using i-cluster size indexing
+ * \param[in]     excludeSubDiagonal  Exclude atom pairs with i-index > j-index
+ * \param[in]     x_j                 Coordinates for the j-atom, in SIMD packed format
+ * \param[in]     rlist2              The squared list cut-off
+ * \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
-make_cluster_list_simd_2xnn(const nbnxn_grid_t *gridj,
-                            nbnxn_pairlist_t *nbl,
-                            int ci, int cjf, int cjl,
-                            gmx_bool remove_sub_diag,
-                            const real *x_j,
-                            real rl2, float rbb2,
-                            int *ndistc)
+makeClusterListSimd2xnn(const nbnxn_grid_t *      gridj,
+                        nbnxn_pairlist_t *        nbl,
+                        int                       icluster,
+                        int                       firstCell,
+                        int                       lastCell,
+                        bool                      excludeSubDiagonal,
+                        const real * gmx_restrict x_j,
+                        real                      rlist2,
+                        float                     rbb2,
+                        int * gmx_restrict        numDistanceChecks)
 {
-    const real                         *x_ci_simd;
-    const nbnxn_bb_t                   *bb_ci;
+    const real * gmx_restrict           x_ci_simd = nbl->work->x_ci_simd;
+    const nbnxn_bb_t * gmx_restrict     bb_ci     = nbl->work->bb_ci;
 
     SimdReal                            jx_S, jy_S, jz_S;
 
@@ -94,26 +108,23 @@ make_cluster_list_simd_2xnn(const nbnxn_grid_t *gridj,
 
     gmx_bool                            InRange;
     float                               d2;
-    int                                 xind_f, xind_l, cj;
-
-    cjf = ci_to_cj_simd_2xnn(cjf);
-    cjl = ci_to_cj_simd_2xnn(cjl + 1) - 1;
-
-    x_ci_simd = nbl->work->x_ci_simd;
+    int                                 xind_f, xind_l;
 
-    bb_ci = nbl->work->bb_ci;
+    int jclusterFirst = ci_to_cj_simd_2xnn(firstCell);
+    int jclusterLast  = ci_to_cj_simd_2xnn(lastCell);
+    GMX_ASSERT(jclusterLast >= jclusterFirst, "We should have a non-empty j-cluster range, since the calling code should have ensured a non-empty cell range");
 
-    rc2_S   = SimdReal(rl2);
+    rc2_S   = SimdReal(rlist2);
 
     InRange = FALSE;
-    while (!InRange && cjf <= cjl)
+    while (!InRange && jclusterFirst <= jclusterLast)
     {
 #ifdef NBNXN_SEARCH_BB_SIMD4
-        d2 = subc_bb_dist2_simd4(0, bb_ci, cjf, gridj->bbj);
+        d2 = subc_bb_dist2_simd4(0, bb_ci, jclusterFirst, gridj->bbj);
 #else
-        d2 = subc_bb_dist2(0, bb_ci, cjf, gridj->bbj);
+        d2 = subc_bb_dist2(0, bb_ci, jclusterFirst, gridj->bbj);
 #endif
-        *ndistc += 2;
+        *numDistanceChecks += 2;
 
         /* Check if the distance is within the distance where
          * we use only the bounding box distance rbb,
@@ -124,13 +135,13 @@ make_cluster_list_simd_2xnn(const nbnxn_grid_t *gridj,
         {
             InRange = TRUE;
         }
-        else if (d2 < rl2)
+        else if (d2 < rlist2)
         {
-            xind_f  = x_ind_cj_simd_2xnn(ci_to_cj_simd_2xnn(gridj->cell0) + cjf);
+            xind_f  = x_ind_cj_simd_2xnn(ci_to_cj_simd_2xnn(gridj->cell0) + jclusterFirst);
 
-            jx_S  = loadDuplicateHsimd(x_j+xind_f+0*STRIDE_S);
-            jy_S  = loadDuplicateHsimd(x_j+xind_f+1*STRIDE_S);
-            jz_S  = loadDuplicateHsimd(x_j+xind_f+2*STRIDE_S);
+            jx_S  = loadDuplicateHsimd(x_j + xind_f + 0*STRIDE_S);
+            jy_S  = loadDuplicateHsimd(x_j + xind_f + 1*STRIDE_S);
+            jz_S  = loadDuplicateHsimd(x_j + xind_f + 2*STRIDE_S);
 
             /* Calculate distance */
             dx_S0            = load(x_ci_simd + 0*GMX_SIMD_REAL_WIDTH) - jx_S;
@@ -151,11 +162,11 @@ make_cluster_list_simd_2xnn(const nbnxn_grid_t *gridj,
 
             InRange          = anyTrue(wco_any_S);
 
-            *ndistc += 2*GMX_SIMD_REAL_WIDTH;
+            *numDistanceChecks += 2*GMX_SIMD_REAL_WIDTH;
         }
         if (!InRange)
         {
-            cjf++;
+            jclusterFirst++;
         }
     }
     if (!InRange)
@@ -164,14 +175,14 @@ make_cluster_list_simd_2xnn(const nbnxn_grid_t *gridj,
     }
 
     InRange = FALSE;
-    while (!InRange && cjl > cjf)
+    while (!InRange && jclusterLast > jclusterFirst)
     {
 #ifdef NBNXN_SEARCH_BB_SIMD4
-        d2 = subc_bb_dist2_simd4(0, bb_ci, cjl, gridj->bbj);
+        d2 = subc_bb_dist2_simd4(0, bb_ci, jclusterLast, gridj->bbj);
 #else
-        d2 = subc_bb_dist2(0, bb_ci, cjl, gridj->bbj);
+        d2 = subc_bb_dist2(0, bb_ci, jclusterLast, gridj->bbj);
 #endif
-        *ndistc += 2;
+        *numDistanceChecks += 2;
 
         /* Check if the distance is within the distance where
          * we use only the bounding box distance rbb,
@@ -182,13 +193,13 @@ make_cluster_list_simd_2xnn(const nbnxn_grid_t *gridj,
         {
             InRange = TRUE;
         }
-        else if (d2 < rl2)
+        else if (d2 < rlist2)
         {
-            xind_l  = x_ind_cj_simd_2xnn(ci_to_cj_simd_2xnn(gridj->cell0) + cjl);
+            xind_l  = x_ind_cj_simd_2xnn(ci_to_cj_simd_2xnn(gridj->cell0) + jclusterLast);
 
-            jx_S  = loadDuplicateHsimd(x_j+xind_l+0*STRIDE_S);
-            jy_S  = loadDuplicateHsimd(x_j+xind_l+1*STRIDE_S);
-            jz_S  = loadDuplicateHsimd(x_j+xind_l+2*STRIDE_S);
+            jx_S  = loadDuplicateHsimd(x_j + xind_l + 0*STRIDE_S);
+            jy_S  = loadDuplicateHsimd(x_j + xind_l + 1*STRIDE_S);
+            jz_S  = loadDuplicateHsimd(x_j + xind_l + 2*STRIDE_S);
 
             /* Calculate distance */
             dx_S0            = load(x_ci_simd + 0*GMX_SIMD_REAL_WIDTH) - jx_S;
@@ -209,21 +220,21 @@ make_cluster_list_simd_2xnn(const nbnxn_grid_t *gridj,
 
             InRange          = anyTrue(wco_any_S);
 
-            *ndistc += 2*GMX_SIMD_REAL_WIDTH;
+            *numDistanceChecks += 2*GMX_SIMD_REAL_WIDTH;
         }
         if (!InRange)
         {
-            cjl--;
+            jclusterLast--;
         }
     }
 
-    if (cjf <= cjl)
+    if (jclusterFirst <= jclusterLast)
     {
-        for (cj = cjf; cj <= cjl; cj++)
+        for (int jcluster = jclusterFirst; jcluster <= jclusterLast; jcluster++)
         {
             /* Store cj and the interaction mask */
-            nbl->cj[nbl->ncj].cj   = ci_to_cj_simd_2xnn(gridj->cell0) + cj;
-            nbl->cj[nbl->ncj].excl = get_imask_simd_2xnn(remove_sub_diag, ci, cj);
+            nbl->cj[nbl->ncj].cj   = ci_to_cj_simd_2xnn(gridj->cell0) + jcluster;
+            nbl->cj[nbl->ncj].excl = get_imask_simd_2xnn(excludeSubDiagonal, icluster, jcluster);
             nbl->ncj++;
         }
         /* Increase the closing index in i super-cell list */
index 6add781f7b45b6e67b28c1fe4ba6c3ada026b024..8989bef85e93a3ec7a8807a0690a959348a8711e 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,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.
@@ -67,22 +67,36 @@ icell_set_x_simd_4xn(int ci,
     store(x_ci_simd + 11*GMX_SIMD_REAL_WIDTH, SimdReal(x[ia + 2*STRIDE_S + 3] + shz) );
 }
 
-/* SIMD code for making a pair list of cell ci vs cell cjf-cjl
- * for coordinates in packed format.
+/* SIMD code for checking and adding cluster-pairs to the list using coordinates in packed format.
+ *
  * Checks bouding box distances and possibly atom pair distances.
  * This is an accelerated version of make_cluster_list_simple.
+ *
+ * \param[in]     gridj               The j-grid
+ * \param[in,out] nbl                 The pair-list to store the cluster pairs in
+ * \param[in]     icluster            The index of the i-cluster
+ * \param[in]     firstCell           The first cluster in the j-range, using i-cluster size indexing
+ * \param[in]     lastCell            The last cluster in the j-range, using i-cluster size indexing
+ * \param[in]     excludeSubDiagonal  Exclude atom pairs with i-index > j-index
+ * \param[in]     x_j                 Coordinates for the j-atom, in SIMD packed format
+ * \param[in]     rlist2              The squared list cut-off
+ * \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
-make_cluster_list_simd_4xn(const nbnxn_grid_t *gridj,
-                           nbnxn_pairlist_t *nbl,
-                           int ci, int cjf, int cjl,
-                           gmx_bool remove_sub_diag,
-                           const real *x_j,
-                           real rl2, float rbb2,
-                           int *ndistc)
+makeClusterListSimd4xn(const nbnxn_grid_t *      gridj,
+                       nbnxn_pairlist_t *        nbl,
+                       int                       icluster,
+                       int                       firstCell,
+                       int                       lastCell,
+                       bool                      excludeSubDiagonal,
+                       const real * gmx_restrict x_j,
+                       real                      rlist2,
+                       float                     rbb2,
+                       int * gmx_restrict        numDistanceChecks)
 {
-    const real                        *x_ci_simd = nbl->work->x_ci_simd;
-    const nbnxn_bb_t                  *bb_ci;
+    const real * gmx_restrict          x_ci_simd = nbl->work->x_ci_simd;
+    const nbnxn_bb_t * gmx_restrict    bb_ci     = nbl->work->bb_ci;
 
     SimdReal                           jx_S, jy_S, jz_S;
 
@@ -106,25 +120,30 @@ make_cluster_list_simd_4xn(const nbnxn_grid_t *gridj,
 
     gmx_bool                           InRange;
     float                              d2;
-    int                                xind_f, xind_l, cj;
+    int                                xind_f, xind_l;
 
+    /* Convert the j-range from i-cluster size indexing to j-cluster indexing */
     /* cppcheck-suppress selfAssignment . selfAssignment for width 4.*/
-    cjf = ci_to_cj_simd_4xn(cjf);
-    cjl = ci_to_cj_simd_4xn(cjl + 1) - 1;
-
-    bb_ci = nbl->work->bb_ci;
+    int jclusterFirst = ci_to_cj_simd_4xn(firstCell);
+#if GMX_SIMD_REAL_WIDTH >= NBNXN_CPU_CLUSTER_I_SIZE
+    int jclusterLast  = ci_to_cj_simd_4xn(lastCell);
+#else
+    /* Set the correct last j-cluster with a j-cluster size of 2 */
+    int jclusterLast  = ci_to_cj_simd_4xn(lastCell + 1) - 1;
+#endif
+    GMX_ASSERT(jclusterLast >= jclusterFirst, "We should have a non-empty j-cluster range, since the calling code should have ensured a non-empty cell range");
 
-    rc2_S   = SimdReal(rl2);
+    rc2_S   = SimdReal(rlist2);
 
     InRange = FALSE;
-    while (!InRange && cjf <= cjl)
+    while (!InRange && jclusterFirst <= jclusterLast)
     {
 #ifdef NBNXN_SEARCH_BB_SIMD4
-        d2 = subc_bb_dist2_simd4(0, bb_ci, cjf, gridj->bbj);
+        d2 = subc_bb_dist2_simd4(0, bb_ci, jclusterFirst, gridj->bbj);
 #else
-        d2 = subc_bb_dist2(0, bb_ci, cjf, gridj->bbj);
+        d2 = subc_bb_dist2(0, bb_ci, jclusterFirst, gridj->bbj);
 #endif
-        *ndistc += 2;
+        *numDistanceChecks += 2;
 
         /* Check if the distance is within the distance where
          * we use only the bounding box distance rbb,
@@ -135,13 +154,13 @@ make_cluster_list_simd_4xn(const nbnxn_grid_t *gridj,
         {
             InRange = TRUE;
         }
-        else if (d2 < rl2)
+        else if (d2 < rlist2)
         {
-            xind_f  = x_ind_cj_simd_4xn(ci_to_cj_simd_4xn(gridj->cell0) + cjf);
+            xind_f  = x_ind_cj_simd_4xn(ci_to_cj_simd_4xn(gridj->cell0) + jclusterFirst);
 
-            jx_S  = load(x_j+xind_f+0*STRIDE_S);
-            jy_S  = load(x_j+xind_f+1*STRIDE_S);
-            jz_S  = load(x_j+xind_f+2*STRIDE_S);
+            jx_S  = load(x_j + xind_f + 0*STRIDE_S);
+            jy_S  = load(x_j + xind_f + 1*STRIDE_S);
+            jz_S  = load(x_j + xind_f + 2*STRIDE_S);
 
 
             /* Calculate distance */
@@ -175,11 +194,11 @@ make_cluster_list_simd_4xn(const nbnxn_grid_t *gridj,
 
             InRange          = anyTrue(wco_any_S);
 
-            *ndistc += 4*GMX_SIMD_REAL_WIDTH;
+            *numDistanceChecks += 4*GMX_SIMD_REAL_WIDTH;
         }
         if (!InRange)
         {
-            cjf++;
+            jclusterFirst++;
         }
     }
     if (!InRange)
@@ -188,14 +207,14 @@ make_cluster_list_simd_4xn(const nbnxn_grid_t *gridj,
     }
 
     InRange = FALSE;
-    while (!InRange && cjl > cjf)
+    while (!InRange && jclusterLast > jclusterFirst)
     {
 #ifdef NBNXN_SEARCH_BB_SIMD4
-        d2 = subc_bb_dist2_simd4(0, bb_ci, cjl, gridj->bbj);
+        d2 = subc_bb_dist2_simd4(0, bb_ci, jclusterLast, gridj->bbj);
 #else
-        d2 = subc_bb_dist2(0, bb_ci, cjl, gridj->bbj);
+        d2 = subc_bb_dist2(0, bb_ci, jclusterLast, gridj->bbj);
 #endif
-        *ndistc += 2;
+        *numDistanceChecks += 2;
 
         /* Check if the distance is within the distance where
          * we use only the bounding box distance rbb,
@@ -206,13 +225,13 @@ make_cluster_list_simd_4xn(const nbnxn_grid_t *gridj,
         {
             InRange = TRUE;
         }
-        else if (d2 < rl2)
+        else if (d2 < rlist2)
         {
-            xind_l  = x_ind_cj_simd_4xn(ci_to_cj_simd_4xn(gridj->cell0) + cjl);
+            xind_l  = x_ind_cj_simd_4xn(ci_to_cj_simd_4xn(gridj->cell0) + jclusterLast);
 
-            jx_S  = load(x_j+xind_l+0*STRIDE_S);
-            jy_S  = load(x_j+xind_l+1*STRIDE_S);
-            jz_S  = load(x_j+xind_l+2*STRIDE_S);
+            jx_S  = load(x_j +xind_l + 0*STRIDE_S);
+            jy_S  = load(x_j +xind_l + 1*STRIDE_S);
+            jz_S  = load(x_j +xind_l + 2*STRIDE_S);
 
             /* Calculate distance */
             dx_S0            = load(x_ci_simd +  0*GMX_SIMD_REAL_WIDTH) - jx_S;
@@ -245,21 +264,21 @@ make_cluster_list_simd_4xn(const nbnxn_grid_t *gridj,
 
             InRange          = anyTrue(wco_any_S);
 
-            *ndistc += 4*GMX_SIMD_REAL_WIDTH;
+            *numDistanceChecks += 4*GMX_SIMD_REAL_WIDTH;
         }
         if (!InRange)
         {
-            cjl--;
+            jclusterLast--;
         }
     }
 
-    if (cjf <= cjl)
+    if (jclusterFirst <= jclusterLast)
     {
-        for (cj = cjf; cj <= cjl; cj++)
+        for (int jcluster = jclusterFirst; jcluster <= jclusterLast; jcluster++)
         {
             /* Store cj and the interaction mask */
-            nbl->cj[nbl->ncj].cj   = ci_to_cj_simd_4xn(gridj->cell0) + cj;
-            nbl->cj[nbl->ncj].excl = get_imask_simd_4xn(remove_sub_diag, ci, cj);
+            nbl->cj[nbl->ncj].cj   = ci_to_cj_simd_4xn(gridj->cell0) + jcluster;
+            nbl->cj[nbl->ncj].excl = get_imask_simd_4xn(excludeSubDiagonal, icluster, jcluster);
             nbl->ncj++;
         }
         /* Increase the closing index in i super-cell list */
diff --git a/src/gromacs/mdlib/nbnxn_tuning.cpp b/src/gromacs/mdlib/nbnxn_tuning.cpp
new file mode 100644 (file)
index 0000000..4a4af2d
--- /dev/null
@@ -0,0 +1,515 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+
+/*! \internal \file
+ *
+ * \brief Implements functions for tuning adjustable parameters for the nbnxn non-bonded search and interaction kernels
+ *
+ * \author Berk Hess <hess@kth.se>
+ * \ingroup __module_nb_verlet
+ */
+
+#include "gmxpre.h"
+
+#include "nbnxn_tuning.h"
+
+#include <assert.h>
+#include <stdlib.h>
+
+#include <cmath>
+
+#include <algorithm>
+#include <string>
+
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/hardware/cpuinfo.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/mdlib/calc_verletbuf.h"
+#include "gromacs/mdlib/nb_verlet.h"
+#include "gromacs/mdlib/nbnxn_search.h"
+#include "gromacs/mdtypes/commrec.h"
+#include "gromacs/mdtypes/inputrec.h"
+#include "gromacs/mdtypes/interaction_const.h"
+#include "gromacs/mdtypes/state.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/topology.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/gmxassert.h"
+
+/*! \brief Returns if we can (heuristically) change nstlist and rlist
+ *
+ * \param [in] ir  The input parameter record
+ */
+static bool supportsDynamicPairlistGenerationInterval(const t_inputrec &ir)
+{
+    return
+        ir.cutoff_scheme == ecutsVERLET &&
+        EI_DYNAMICS(ir.eI) &&
+        !(EI_MD(ir.eI) && ir.etc == etcNO) &&
+        ir.verletbuf_tol > 0;
+}
+
+/*! \brief Cost of non-bonded kernels
+ *
+ * We determine the extra cost of the non-bonded kernels compared to
+ * a reference nstlist value of 10 (which is the default in grompp).
+ */
+static const int    nbnxnReferenceNstlist = 10;
+//! The values to try when switching
+const int           nstlist_try[] = { 20, 25, 40, 50, 80, 100 };
+//! Number of elements in the neighborsearch list trials.
+#define NNSTL  sizeof(nstlist_try)/sizeof(nstlist_try[0])
+/* Increase nstlist until the size of the pair-list increased by
+ * \p c_nbnxnListSizeFactor??? or more, but never more than
+ * \p c_nbnxnListSizeFactor??? + \p c_nbnxnListSizeFactorMargin.
+ * Since we have dynamic pair list pruning, the force kernel cost depends
+ * only very weakly on nstlist. It depends strongly on nstlistPrune.
+ * Increasing nstlist mainly affects the cost of the pair search (down due
+ * to lower frequency, up due to larger list) and the list pruning kernel.
+ * We increase nstlist conservatively with regard to kernel performance.
+ * In serial the search cost is not high and thus we don't gain much by
+ * increasing nstlist a lot. In parallel the MPI and CPU-GPU communication
+ * volume as well as the communication buffer preparation and reduction time
+ * increase quickly with rlist and thus nslist. Therefore we should avoid
+ * large nstlist, even if that also reduces the domain decomposition cost.
+ * With GPUs we perform the dynamic pruning in a rolling fashion and this
+ * overlaps with the update on the CPU, which allows even larger nstlist.
+ */
+// CPU: pair-search is a factor ~1.5 slower than the non-bonded kernel.
+//! Target pair-list size increase ratio for CPU
+static const float c_nbnxnListSizeFactorCpu           = 1.25;
+// Intel KNL: pair-search is a factor ~2-3 slower than the non-bonded kernel.
+//! Target pair-list size increase ratio for Intel KNL
+static const float c_nbnxnListSizeFactorIntelXeonPhi  = 1.4;
+// GPU: pair-search is a factor 1.5-3 slower than the non-bonded kernel.
+//! Target pair-list size increase ratio for hybrid CPU-GPU
+static const float c_nbnxnListSizeFactorGPU           = 1.4;
+//! Never increase the size of the pair-list more than the factor above plus this margin
+static const float c_nbnxnListSizeFactorMargin        = 0.1;
+
+void increaseNstlist(FILE *fp, t_commrec *cr,
+                     t_inputrec *ir, int nstlist_cmdline,
+                     const gmx_mtop_t *mtop,
+                     const matrix box,
+                     bool useOrEmulateGpuForNonbondeds,
+                     const gmx::CpuInfo &cpuinfo)
+{
+    float                  listfac_ok, listfac_max;
+    int                    nstlist_orig, nstlist_prev;
+    verletbuf_list_setup_t ls;
+    real                   rlistWithReferenceNstlist, rlist_inc, rlist_ok, rlist_max;
+    real                   rlist_new, rlist_prev;
+    size_t                 nstlist_ind = 0;
+    gmx_bool               bBox, bDD, bCont;
+    const char            *nstl_gpu = "\nFor optimal performance with a GPU nstlist (now %d) should be larger.\nThe optimum depends on your CPU and GPU resources.\nYou might want to try several nstlist values.\n";
+    const char            *nve_err  = "Can not increase nstlist because an NVE ensemble is used";
+    const char            *vbd_err  = "Can not increase nstlist because verlet-buffer-tolerance is not set or used";
+    const char            *box_err  = "Can not increase nstlist because the box is too small";
+    const char            *dd_err   = "Can not increase nstlist because of domain decomposition limitations";
+    char                   buf[STRLEN];
+
+    if (nstlist_cmdline <= 0)
+    {
+        if (ir->nstlist == 1)
+        {
+            /* The user probably set nstlist=1 for a reason,
+             * don't mess with the settings.
+             */
+            return;
+        }
+
+        if (fp != nullptr && useOrEmulateGpuForNonbondeds && ir->nstlist < nstlist_try[0])
+        {
+            fprintf(fp, nstl_gpu, ir->nstlist);
+        }
+        nstlist_ind = 0;
+        while (nstlist_ind < NNSTL && ir->nstlist >= nstlist_try[nstlist_ind])
+        {
+            nstlist_ind++;
+        }
+        if (nstlist_ind == NNSTL)
+        {
+            /* There are no larger nstlist value to try */
+            return;
+        }
+    }
+
+    if (EI_MD(ir->eI) && ir->etc == etcNO)
+    {
+        if (MASTER(cr))
+        {
+            fprintf(stderr, "%s\n", nve_err);
+        }
+        if (fp != nullptr)
+        {
+            fprintf(fp, "%s\n", nve_err);
+        }
+
+        return;
+    }
+
+    if (ir->verletbuf_tol == 0 && useOrEmulateGpuForNonbondeds)
+    {
+        gmx_fatal(FARGS, "You are using an old tpr file with a GPU, please generate a new tpr file with an up to date version of grompp");
+    }
+
+    if (ir->verletbuf_tol < 0)
+    {
+        if (MASTER(cr))
+        {
+            fprintf(stderr, "%s\n", vbd_err);
+        }
+        if (fp != nullptr)
+        {
+            fprintf(fp, "%s\n", vbd_err);
+        }
+
+        return;
+    }
+
+    if (useOrEmulateGpuForNonbondeds)
+    {
+        listfac_ok  = c_nbnxnListSizeFactorGPU;
+    }
+    else if (cpuinfo.brandString().find("Xeon Phi") != std::string::npos)
+    {
+        listfac_ok  = c_nbnxnListSizeFactorIntelXeonPhi;
+    }
+    else
+    {
+        listfac_ok  = c_nbnxnListSizeFactorCpu;
+    }
+    listfac_max     = listfac_ok + c_nbnxnListSizeFactorMargin;
+
+    nstlist_orig    = ir->nstlist;
+    if (nstlist_cmdline > 0)
+    {
+        if (fp)
+        {
+            sprintf(buf, "Getting nstlist=%d from command line option",
+                    nstlist_cmdline);
+        }
+        ir->nstlist = nstlist_cmdline;
+    }
+
+    verletbuf_get_list_setup(TRUE, useOrEmulateGpuForNonbondeds, &ls);
+
+    /* Allow rlist to make the list a given factor larger than the list
+     * would be with the reference value for nstlist (10).
+     */
+    nstlist_prev = ir->nstlist;
+    ir->nstlist  = nbnxnReferenceNstlist;
+    calc_verlet_buffer_size(mtop, det(box), ir, ir->nstlist, ir->nstlist - 1,
+                            -1, &ls, nullptr, &rlistWithReferenceNstlist);
+    ir->nstlist  = nstlist_prev;
+
+    /* Determine the pair list size increase due to zero interactions */
+    rlist_inc = nbnxn_get_rlist_effective_inc(ls.cluster_size_j,
+                                              mtop->natoms/det(box));
+    rlist_ok  = (rlistWithReferenceNstlist + rlist_inc)*std::cbrt(listfac_ok) - rlist_inc;
+    rlist_max = (rlistWithReferenceNstlist + rlist_inc)*std::cbrt(listfac_max) - rlist_inc;
+    if (debug)
+    {
+        fprintf(debug, "nstlist tuning: rlist_inc %.3f rlist_ok %.3f rlist_max %.3f\n",
+                rlist_inc, rlist_ok, rlist_max);
+    }
+
+    nstlist_prev = nstlist_orig;
+    rlist_prev   = ir->rlist;
+    do
+    {
+        if (nstlist_cmdline <= 0)
+        {
+            ir->nstlist = nstlist_try[nstlist_ind];
+        }
+
+        /* Set the pair-list buffer size in ir */
+        calc_verlet_buffer_size(mtop, det(box), ir, ir->nstlist, ir->nstlist - 1, -1, &ls, nullptr, &rlist_new);
+
+        /* Does rlist fit in the box? */
+        bBox = (gmx::square(rlist_new) < max_cutoff2(ir->ePBC, box));
+        bDD  = TRUE;
+        if (bBox && DOMAINDECOMP(cr))
+        {
+            /* Check if rlist fits in the domain decomposition */
+            if (inputrec2nboundeddim(ir) < DIM)
+            {
+                gmx_incons("Changing nstlist with domain decomposition and unbounded dimensions is not implemented yet");
+            }
+            t_state state_tmp;
+            copy_mat(box, state_tmp.box);
+            bDD = change_dd_cutoff(cr, &state_tmp, ir, rlist_new);
+        }
+
+        if (debug)
+        {
+            fprintf(debug, "nstlist %d rlist %.3f bBox %d bDD %d\n",
+                    ir->nstlist, rlist_new, bBox, bDD);
+        }
+
+        bCont = FALSE;
+
+        if (nstlist_cmdline <= 0)
+        {
+            if (bBox && bDD && rlist_new <= rlist_max)
+            {
+                /* Increase nstlist */
+                nstlist_prev = ir->nstlist;
+                rlist_prev   = rlist_new;
+                bCont        = (nstlist_ind+1 < NNSTL && rlist_new < rlist_ok);
+            }
+            else
+            {
+                /* Stick with the previous nstlist */
+                ir->nstlist = nstlist_prev;
+                rlist_new   = rlist_prev;
+                bBox        = TRUE;
+                bDD         = TRUE;
+            }
+        }
+
+        nstlist_ind++;
+    }
+    while (bCont);
+
+    if (!bBox || !bDD)
+    {
+        gmx_warning(!bBox ? box_err : dd_err);
+        if (fp != nullptr)
+        {
+            fprintf(fp, "\n%s\n", bBox ? box_err : dd_err);
+        }
+        ir->nstlist = nstlist_orig;
+    }
+    else if (ir->nstlist != nstlist_orig || rlist_new != ir->rlist)
+    {
+        sprintf(buf, "Changing nstlist from %d to %d, rlist from %g to %g",
+                nstlist_orig, ir->nstlist,
+                ir->rlist, rlist_new);
+        if (MASTER(cr))
+        {
+            fprintf(stderr, "%s\n\n", buf);
+        }
+        if (fp != nullptr)
+        {
+            fprintf(fp, "%s\n\n", buf);
+        }
+        ir->rlist     = rlist_new;
+    }
+}
+
+/*! \brief The interval in steps at which we perform dynamic, rolling pruning on a GPU.
+ *
+ * Ideally we should auto-tune this value.
+ * Not considering overheads, 1 would be the ideal value. But 2 seems
+ * a reasonable compromise that reduces GPU kernel launch overheads and
+ * also avoids inefficiency on large GPUs when pruning small lists.
+ * Because with domain decomposition we alternate local/non-local pruning
+ * at even/odd steps, which gives a period of 2, this value currenly needs
+ * to be 2, which is indirectly asserted when the GPU pruning is dispatched
+ * during the force evaluation.
+ */
+static const int c_nbnxnGpuRollingListPruningInterval = 2;
+
+/*! \brief The minimum nstlist for dynamic pair list pruning.
+ *
+ * In most cases going lower than 4 will lead to a too high pruning cost.
+ * This value should be a multiple of \p c_nbnxnGpuRollingListPruningInterval
+ */
+static const int c_nbnxnDynamicListPruningMinLifetime = 4;
+
+/*! \brief Set the dynamic pairlist pruning parameters in \p ic
+ *
+ * \param[in]     ir          The input parameter record
+ * \param[in]     mtop        The global topology
+ * \param[in]     box         The unit cell
+ * \param[in]     useGpu      Tells if we are using a GPU for non-bondeds
+ * \param[in]     listSetup   The nbnxn pair list setup
+ * \param[in]     userSetNstlistPrune  The user set ic->nstlistPrune (using an env.var.)
+ * \param[in] ic              The nonbonded interactions constants
+ * \param[in,out] listParams  The list setup parameters
+ */
+static void
+setDynamicPairlistPruningParameters(const t_inputrec             *ir,
+                                    const gmx_mtop_t             *mtop,
+                                    matrix                        box,
+                                    gmx_bool                      useGpu,
+                                    const verletbuf_list_setup_t &listSetup,
+                                    bool                          userSetNstlistPrune,
+                                    const interaction_const_t    *ic,
+                                    NbnxnListParameters          *listParams)
+{
+    /* When nstlistPrune was set by the user, we need to execute one loop
+     * iteration to determine rlistInner.
+     * Otherwise we compute rlistInner and increase nstlist as long as
+     * we have a pairlist buffer of length 0 (i.e. rlistInner == cutoff).
+     */
+    const real interactionCutoff = std::max(ic->rcoulomb, ic->rvdw);
+    int        tunedNstlistPrune = listParams->nstlistPrune;
+    do
+    {
+        /* Dynamic pruning on the GPU is performed on the list for
+         * the next step on the coordinates of the current step,
+         * so the list lifetime is nstlistPrune (not the usual nstlist-1).
+         */
+        int listLifetime         = tunedNstlistPrune - (useGpu ? 0 : 1);
+        listParams->nstlistPrune = tunedNstlistPrune;
+        calc_verlet_buffer_size(mtop, det(box), ir,
+                                tunedNstlistPrune, listLifetime,
+                                -1, &listSetup, NULL,
+                                &listParams->rlistInner);
+
+        /* On the GPU we apply the dynamic pruning in a rolling fashion
+         * every c_nbnxnGpuRollingListPruningInterval steps,
+         * so keep nstlistPrune a multiple of the interval.
+         */
+        tunedNstlistPrune += useGpu ? c_nbnxnGpuRollingListPruningInterval : 1;
+    }
+    while (!userSetNstlistPrune &&
+           tunedNstlistPrune < ir->nstlist &&
+           listParams->rlistInner == interactionCutoff);
+
+    if (userSetNstlistPrune)
+    {
+        listParams->useDynamicPruning = true;
+    }
+    else
+    {
+        /* Determine the pair list size increase due to zero interactions */
+        real rlistInc = nbnxn_get_rlist_effective_inc(listSetup.cluster_size_j,
+                                                      mtop->natoms/det(box));
+
+        /* Dynamic pruning is only useful when the inner list is smaller than
+         * the outer. The factor 0.99 ensures at least 3% list size reduction.
+         *
+         * With dynamic pruning on the CPU we prune after updating,
+         * so nstlistPrune=nstlist-1 would add useless extra work.
+         * With the GPU there will probably be more overhead than gain
+         * with nstlistPrune=nstlist-1, so we disable dynamic pruning.
+         * Note that in such cases the first sub-condition is likely also false.
+         */
+        listParams->useDynamicPruning =
+            (listParams->rlistInner + rlistInc < 0.99*(listParams->rlistOuter + rlistInc) &&
+             listParams->nstlistPrune < ir->nstlist - 1);
+    }
+
+    if (!listParams->useDynamicPruning)
+    {
+        /* These parameters should not be used, but set them to useful values */
+        listParams->nstlistPrune  = -1;
+        listParams->rlistInner    = listParams->rlistOuter;
+    }
+}
+
+void setupDynamicPairlistPruning(FILE                      *fplog,
+                                 const t_inputrec          *ir,
+                                 const gmx_mtop_t          *mtop,
+                                 matrix                     box,
+                                 bool                       useGpu,
+                                 const interaction_const_t *ic,
+                                 NbnxnListParameters       *listParams)
+{
+    GMX_RELEASE_ASSERT(listParams->rlistOuter > 0, "With the nbnxn setup rlist should be > 0");
+
+    /* Initialize the parameters to no dynamic list pruning */
+    listParams->useDynamicPruning = false;
+
+    if (supportsDynamicPairlistGenerationInterval(*ir) &&
+        getenv("GMX_DISABLE_DYNAMICPRUNING") == NULL)
+    {
+        verletbuf_list_setup_t ls;
+        verletbuf_get_list_setup(TRUE, TRUE, &ls);
+
+        /* Note that nstlistPrune can have any value independently of nstlist.
+         * Actually applying rolling pruning is only useful when
+         * nstlistPrune < nstlist -1
+         */
+        char *env                 = getenv("GMX_NSTLIST_DYNAMICPRUNING");
+        bool  userSetNstlistPrune = (env != NULL);
+
+        if (userSetNstlistPrune)
+        {
+            char *end;
+            listParams->nstlistPrune = strtol(env, &end, 10);
+            if (!end || (*end != 0) ||
+                !(listParams->nstlistPrune > 0 && listParams->nstlistPrune < ir->nstlist))
+            {
+                gmx_fatal(FARGS, "Invalid value passed in GMX_NSTLIST_DYNAMICPRUNING=%s, should be > 0 and < nstlist", env);
+            }
+        }
+        else
+        {
+            static_assert(c_nbnxnDynamicListPruningMinLifetime % c_nbnxnGpuRollingListPruningInterval == 0,
+                          "c_nbnxnDynamicListPruningMinLifetime sets the starting value for nstlistPrune, which should be divisible by the rolling pruning interval for efficiency reasons.");
+
+            // TODO: Use auto-tuning to determine nstlistPrune
+            listParams->nstlistPrune = c_nbnxnDynamicListPruningMinLifetime;
+        }
+
+        setDynamicPairlistPruningParameters(ir, mtop, box, useGpu, ls,
+                                            userSetNstlistPrune, ic,
+                                            listParams);
+
+        if (listParams->useDynamicPruning && useGpu)
+        {
+            /* Note that we can round down here. This makes the effective
+             * rolling pruning interval slightly shorter than nstlistTune,
+             * thus giving correct results, but a slightly lower efficiency.
+             */
+            GMX_RELEASE_ASSERT(listParams->nstlistPrune >= c_nbnxnGpuRollingListPruningInterval,
+                               ( "With dynamic list pruning on GPUs pruning frequency must be at least as large as the rolling pruning interval (" +
+                                 std::to_string(c_nbnxnGpuRollingListPruningInterval) +
+                                 ").").c_str() );
+            listParams->numRollingParts = listParams->nstlistPrune/c_nbnxnGpuRollingListPruningInterval;
+        }
+        else
+        {
+            listParams->numRollingParts = 1;
+        }
+
+        if (fplog && listParams->useDynamicPruning)
+        {
+            const real interactionCutoff = std::max(ic->rcoulomb, ic->rvdw);
+            fprintf(fplog,
+                    "Using a dual pair-list setup updated with dynamic%s pruning:\n"
+                    "  outer list: updated every %3d steps, buffer %.3f nm, rlist %.3f nm\n"
+                    "  inner list: updated every %3d steps, buffer %.3f nm, rlist %.3f nm\n",
+                    listParams->numRollingParts > 1 ? ", rolling" : "",
+                    ir->nstlist, listParams->rlistOuter - interactionCutoff, listParams->rlistOuter,
+                    listParams->nstlistPrune, listParams->rlistInner - interactionCutoff, listParams->rlistInner);
+        }
+    }
+}
diff --git a/src/gromacs/mdlib/nbnxn_tuning.h b/src/gromacs/mdlib/nbnxn_tuning.h
new file mode 100644 (file)
index 0000000..4f65131
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+
+/*! \libinternal \file
+ *
+ * \brief Declares functions for tuning adjustable parameters for the nbnxn non-bonded search and interaction kernels
+ *
+ * \author Berk Hess <hess@kth.se>
+ *
+ * \inlibraryapi
+ * \ingroup __module_nb_verlet
+ */
+
+#ifndef NBNXN_TUNING_H
+#define NBNXN_TUNING_H
+
+#include <stdio.h>
+
+#include "gromacs/math/vectypes.h"
+
+namespace gmx
+{
+class CpuInfo;
+}
+
+struct gmx_mtop_t;
+struct interaction_const_t;
+struct NbnxnListParameters;
+struct t_commrec;
+struct t_inputrec;
+
+/*! \brief Try to increase nstlist when using the Verlet cut-off scheme
+ *
+ * \param[in,out] fplog    Log file
+ * \param[in]     cr       The communication record
+ * \param[in]     ir       The input parameter record
+ * \param[in]     nstlistOnCmdline  The value of nstlist provided on the command line
+ * \param[in]     mtop     The global topology
+ * \param[in]     box      The unit cell
+ * \param[in]     useOrEmulateGpuForNonbondeds  Tells if we are using a GPU for non-bondeds
+ * \param[in]     cpuinfo  Information about the CPU(s)
+ */
+void increaseNstlist(FILE *fplog, t_commrec *cr,
+                     t_inputrec *ir, int nstlistOnCmdline,
+                     const gmx_mtop_t *mtop,
+                     const matrix box,
+                     bool useOrEmulateGpuForNonbondeds,
+                     const gmx::CpuInfo &cpuinfo);
+
+/*! \brief Set up the dynamic pairlist pruning
+ *
+ * \param[in,out] fplog       Log file
+ * \param[in]     ir          The input parameter record
+ * \param[in]     mtop        The global topology
+ * \param[in]     box         The unit cell
+ * \param[in]     useGpu      Tells if we are using a GPU for non-bondeds
+ * \param[in]     ic          The nonbonded interactions constants
+ * \param[in,out] listParams  The list setup parameters
+ */
+void setupDynamicPairlistPruning(FILE                      *fplog,
+                                 const t_inputrec          *ir,
+                                 const gmx_mtop_t          *mtop,
+                                 matrix                     box,
+                                 bool                       useGpu,
+                                 const interaction_const_t *ic,
+                                 NbnxnListParameters       *listParams);
+
+#endif /* NBNXN_TUNING_H */
index 9615331d465dd45669d4cd916db7904eb6c293f0..53f6e5c93ccdf84192e0e281149d562e732ffbee 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,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.
@@ -143,7 +143,7 @@ static void init_nblist(FILE *log, t_nblist *nl_sr,
         nl     = nl_sr;
         homenr = maxsr;
 
-        if (nl == NULL)
+        if (nl == nullptr)
         {
             return;
         }
@@ -177,12 +177,12 @@ static void init_nblist(FILE *log, t_nblist *nl_sr,
         nl->maxnrj      = 0;
         nl->nri         = -1;
         nl->nrj         = 0;
-        nl->iinr        = NULL;
-        nl->gid         = NULL;
-        nl->shift       = NULL;
-        nl->jindex      = NULL;
-        nl->jjnr        = NULL;
-        nl->excl_fep    = NULL;
+        nl->iinr        = nullptr;
+        nl->gid         = nullptr;
+        nl->shift       = nullptr;
+        nl->jindex      = nullptr;
+        nl->jjnr        = nullptr;
+        nl->excl_fep    = nullptr;
         reallocate_nblist(nl);
         nl->jindex[0] = 0;
 
@@ -225,7 +225,7 @@ void init_neighbor_list(FILE *log, t_forcerec *fr, int homenr)
     type                     = GMX_NBLIST_INTERACTION_STANDARD;
     bElecAndVdwSwitchDiffers = ( (fr->rcoulomb_switch != fr->rvdw_switch) || (fr->rcoulomb != fr->rvdw));
 
-    fr->ns->bCGlist = (getenv("GMX_NBLISTCG") != 0);
+    fr->ns->bCGlist = (getenv("GMX_NBLISTCG") != nullptr);
     if (!fr->ns->bCGlist)
     {
         igeometry_def = GMX_NBLIST_GEOMETRY_PARTICLE_PARTICLE;
@@ -233,7 +233,7 @@ void init_neighbor_list(FILE *log, t_forcerec *fr, int homenr)
     else
     {
         igeometry_def = GMX_NBLIST_GEOMETRY_CG_CG;
-        if (log != NULL)
+        if (log != nullptr)
         {
             fprintf(log, "\nUsing charge-group - charge-group neighbor lists and kernels\n\n");
         }
@@ -270,13 +270,13 @@ void init_neighbor_list(FILE *log, t_forcerec *fr, int homenr)
                     maxsr_wat, GMX_NBKERNEL_VDW_NONE, eintmodNONE, ielec, ielecmod, igeometry_ww, type, bElecAndVdwSwitchDiffers);
 
         /* Did we get the solvent loops so we can use optimized water kernels? */
-        if (nbl->nlist_sr[eNL_VDWQQ_WATER].kernelptr_vf == NULL
-            || nbl->nlist_sr[eNL_QQ_WATER].kernelptr_vf == NULL
-            || nbl->nlist_sr[eNL_VDWQQ_WATERWATER].kernelptr_vf == NULL
-            || nbl->nlist_sr[eNL_QQ_WATERWATER].kernelptr_vf == NULL)
+        if (nbl->nlist_sr[eNL_VDWQQ_WATER].kernelptr_vf == nullptr
+            || nbl->nlist_sr[eNL_QQ_WATER].kernelptr_vf == nullptr
+            || nbl->nlist_sr[eNL_VDWQQ_WATERWATER].kernelptr_vf == nullptr
+            || nbl->nlist_sr[eNL_QQ_WATERWATER].kernelptr_vf == nullptr)
         {
             fr->solvent_opt = esolNO;
-            if (log != NULL)
+            if (log != nullptr)
             {
                 fprintf(log, "Note: The available nonbonded kernels do not support water optimization - disabling.\n");
             }
@@ -295,7 +295,7 @@ void init_neighbor_list(FILE *log, t_forcerec *fr, int homenr)
     /* QMMM MM list */
     if (fr->bQMMM && fr->qr->QMMMscheme != eQMMMschemeoniom)
     {
-        if (NULL == fr->QMMMlist)
+        if (nullptr == fr->QMMMlist)
         {
             snew(fr->QMMMlist, 1);
         }
@@ -303,7 +303,7 @@ void init_neighbor_list(FILE *log, t_forcerec *fr, int homenr)
                     maxsr, 0, 0, ielec, ielecmod, GMX_NBLIST_GEOMETRY_PARTICLE_PARTICLE, GMX_NBLIST_INTERACTION_STANDARD, bElecAndVdwSwitchDiffers);
     }
 
-    if (log != NULL)
+    if (log != nullptr)
     {
         fprintf(log, "\n");
     }
@@ -564,11 +564,11 @@ put_in_list_at(gmx_bool              bHaveVdW[],
     t_nblist  *   vdwc;
     t_nblist  *   vdw;
     t_nblist  *   coul;
-    t_nblist  *   vdwc_free  = NULL;
-    t_nblist  *   vdw_free   = NULL;
-    t_nblist  *   coul_free  = NULL;
-    t_nblist  *   vdwc_ww    = NULL;
-    t_nblist  *   coul_ww    = NULL;
+    t_nblist  *   vdwc_free  = nullptr;
+    t_nblist  *   vdw_free   = nullptr;
+    t_nblist  *   coul_free  = nullptr;
+    t_nblist  *   vdwc_ww    = nullptr;
+    t_nblist  *   coul_ww    = nullptr;
 
     int           i, j, jcg, igid, gid, nbl_ind;
     int           jj, jj0, jj1, i_atom;
@@ -2029,7 +2029,7 @@ static int nsgrid_core(t_commrec *cr, t_forcerec *fr,
     return nns;
 }
 
-void ns_realloc_natoms(gmx_ns_t *ns, int natoms)
+static void ns_realloc_natoms(gmx_ns_t *ns, int natoms)
 {
     int i;
 
@@ -2132,7 +2132,7 @@ void init_ns(FILE *fplog, const t_commrec *cr,
     }
 
     ns->nra_alloc = 0;
-    ns->bexcl     = NULL;
+    ns->bexcl     = nullptr;
     if (!DOMAINDECOMP(cr))
     {
         ns_realloc_natoms(ns, mtop->natoms);
@@ -2145,7 +2145,7 @@ void init_ns(FILE *fplog, const t_commrec *cr,
         char *ptr = getenv("GMX_DUMP_NL");
         if (ptr)
         {
-            ns->dump_nl = strtol(ptr, NULL, 10);
+            ns->dump_nl = strtol(ptr, nullptr, 10);
             if (fplog)
             {
                 fprintf(fplog, "GMX_DUMP_NL = %d", ns->dump_nl);
@@ -2224,12 +2224,12 @@ int search_neighbours(FILE *log, t_forcerec *fr,
         }
         else
         {
-            dd_zones = NULL;
+            dd_zones = nullptr;
 
-            get_nsgrid_boundaries(grid->nboundeddim, box, NULL, NULL, NULL, NULL,
+            get_nsgrid_boundaries(grid->nboundeddim, box, nullptr, nullptr, nullptr, nullptr,
                                   cgs->nr, fr->cg_cm, grid_x0, grid_x1, &grid_dens);
 
-            grid_first(log, grid, NULL, NULL, box, grid_x0, grid_x1,
+            grid_first(log, grid, nullptr, nullptr, box, grid_x0, grid_x1,
                        fr->rlist, grid_dens);
         }
 
@@ -2245,7 +2245,7 @@ int search_neighbours(FILE *log, t_forcerec *fr,
         }
         else
         {
-            fill_grid(NULL, grid, cgs->nr, fr->cg0, fr->hcg, fr->cg_cm);
+            fill_grid(nullptr, grid, cgs->nr, fr->cg0, fr->hcg, fr->cg_cm);
             grid->icg0 = fr->cg0;
             grid->icg1 = fr->hcg;
         }
@@ -2265,7 +2265,7 @@ int search_neighbours(FILE *log, t_forcerec *fr,
         /* Set the grid cell index for the test particle only.
          * The cell to cg index is not corrected, but that does not matter.
          */
-        fill_grid(NULL, ns->grid, fr->hcg, fr->hcg-1, fr->hcg, fr->cg_cm);
+        fill_grid(nullptr, ns->grid, fr->hcg, fr->hcg-1, fr->hcg, fr->cg_cm);
     }
 
     if (!fr->ns->bCGlist)
index 94e43163d419e2f53e4b4aa5a46242d0fdea8fec..1252a1a66bb4148fce0b65c4b98beea6135c2f76 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,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.
@@ -96,9 +96,9 @@ static void calc_x_av_stddev(int n, rvec *x, rvec av, rvec stddev)
     }
 }
 
-void get_nsgrid_boundaries_vac(real av, real stddev,
-                               real *bound0, real *bound1,
-                               real *bdens0, real *bdens1)
+static void get_nsgrid_boundaries_vac(real av, real stddev,
+                                      real *bound0, real *bound1,
+                                      real *bdens0, real *bdens1)
 {
     /* Set the grid to 2 times the standard deviation of
      * the charge group centers in both directions.
@@ -148,13 +148,13 @@ void get_nsgrid_boundaries(int nboundeddim, matrix box,
     {
         if (d < nboundeddim)
         {
-            grid_x0[d] = (gr0 != NULL ? (*gr0)[d] : 0);
-            grid_x1[d] = (gr1 != NULL ? (*gr1)[d] : box[d][d]);
+            grid_x0[d] = (gr0 != nullptr ? (*gr0)[d] : 0);
+            grid_x1[d] = (gr1 != nullptr ? (*gr1)[d] : box[d][d]);
             vol       *= (grid_x1[d] - grid_x0[d]);
         }
         else
         {
-            if (ddbox == NULL)
+            if (ddbox == nullptr)
             {
                 get_nsgrid_boundaries_vac(av[d], stddev[d],
                                           &grid_x0[d], &grid_x1[d],
@@ -173,13 +173,13 @@ void get_nsgrid_boundaries(int nboundeddim, matrix box,
                 bdens1 = grid_x1[d];
             }
             /* Check for a DD cell not at a lower edge */
-            if (dd != NULL && gr0 != NULL && dd->ci[d] > 0)
+            if (dd != nullptr && gr0 != nullptr && dd->ci[d] > 0)
             {
                 grid_x0[d] = (*gr0)[d];
                 bdens0     = (*gr0)[d];
             }
             /* Check for a DD cell not at a higher edge */
-            if (dd != NULL && gr1 != NULL && dd->ci[d] < dd->nc[d]-1)
+            if (dd != nullptr && gr1 != nullptr && dd->ci[d] < dd->nc[d]-1)
             {
                 grid_x1[d] = (*gr1)[d];
                 bdens1     = (*gr1)[d];
@@ -683,7 +683,7 @@ void fill_grid(gmx_domdec_zones_t *dd_zones,
         fprintf(debug, "Filling grid from %d to %d\n", cg0, cg1);
     }
 
-    if (dd_zones == NULL)
+    if (dd_zones == nullptr)
     {
         for (cg = cg0; cg < cg1; cg++)
         {
index d6140720d6ea8197d2a3c2e8b4f0c5ecfde168c1..ea4549eaf2b01a61f1d18e14f195952eea28f93c 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) 2012,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,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.
@@ -267,11 +267,11 @@ void count_bonded_distances(const gmx_mtop_t *mtop, const t_inputrec *ir,
         fprintf(debug, "nr. of distance calculations in bondeds: C %.1f SIMD %.1f\n", ndtot_c, ndtot_simd);
     }
 
-    if (ndistance_c    != NULL)
+    if (ndistance_c    != nullptr)
     {
         *ndistance_c    = ndtot_c;
     }
-    if (ndistance_simd != NULL)
+    if (ndistance_simd != nullptr)
     {
         *ndistance_simd = ndtot_simd;
     }
index fb4bc9dd620e889ccf30c920404ef3ea983a5a19..517fb01eb75d16135119ab568804227ecb810f93 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, by the GROMACS development team, led by
+ * 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.
@@ -36,6 +36,8 @@
  */
 #include "gmxpre.h"
 
+#include "qm_orca.h"
+
 #include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -95,7 +97,7 @@ void init_orca(t_QMrec *qm)
 }
 
 
-void write_orca_input(t_forcerec *fr, t_QMrec *qm, t_MMrec *mm)
+static void write_orca_input(t_forcerec *fr, t_QMrec *qm, t_MMrec *mm)
 {
     int        i;
     t_QMMMrec *QMMMrec;
@@ -131,11 +133,11 @@ void write_orca_input(t_forcerec *fr, t_QMrec *qm, t_MMrec *mm)
 
     /* here we include the insertion of the additional orca-input */
     snew(buf, 200);
-    if (addInputFile != NULL)
+    if (addInputFile != nullptr)
     {
         while (!feof(addInputFile))
         {
-            if (fgets(buf, 200, addInputFile) != NULL)
+            if (fgets(buf, 200, addInputFile) != nullptr)
             {
                 fputs(buf, out);
             }
@@ -251,8 +253,8 @@ void write_orca_input(t_forcerec *fr, t_QMrec *qm, t_MMrec *mm)
     fclose(out);
 }  /* write_orca_input */
 
-real read_orca_output(rvec QMgrad[], rvec MMgrad[], t_forcerec *fr,
-                      t_QMrec *qm, t_MMrec *mm)
+static real read_orca_output(rvec QMgrad[], rvec MMgrad[], t_forcerec *fr,
+                             t_QMrec *qm, t_MMrec *mm)
 {
     int
         i, j, atnum;
@@ -278,17 +280,17 @@ real read_orca_output(rvec QMgrad[], rvec MMgrad[], t_forcerec *fr,
     {
         sprintf(orca_xyzFilename, "%s.xyz", qm->orca_basename);
         xyz = fopen(orca_xyzFilename, "r");
-        if (fgets(buf, 300, xyz) == NULL)
+        if (fgets(buf, 300, xyz) == nullptr)
         {
             gmx_fatal(FARGS, "Unexpected end of ORCA output");
         }
-        if (fgets(buf, 300, xyz) == NULL)
+        if (fgets(buf, 300, xyz) == nullptr)
         {
             gmx_fatal(FARGS, "Unexpected end of ORCA output");
         }
         for (i = 0; i < qm->nrQMatoms; i++)
         {
-            if (fgets(buf, 300, xyz) == NULL)
+            if (fgets(buf, 300, xyz) == nullptr)
             {
                 gmx_fatal(FARGS, "Unexpected end of ORCA output");
             }
@@ -320,14 +322,14 @@ real read_orca_output(rvec QMgrad[], rvec MMgrad[], t_forcerec *fr,
      */
     for (j = 0; j < 7; j++)
     {
-        if (fgets(buf, 300, engrad) == NULL)
+        if (fgets(buf, 300, engrad) == nullptr)
         {
             gmx_fatal(FARGS, "Unexpected end of ORCA output");
         }
     }
     /* now comes the energy
      */
-    if (fgets(buf, 300, engrad) == NULL)
+    if (fgets(buf, 300, engrad) == nullptr)
     {
         gmx_fatal(FARGS, "Unexpected end of ORCA output");
     }
@@ -340,7 +342,7 @@ real read_orca_output(rvec QMgrad[], rvec MMgrad[], t_forcerec *fr,
      */
     for (j = 0; j < 3; j++)
     {
-        if (fgets(buf, 300, engrad) == NULL)
+        if (fgets(buf, 300, engrad) == nullptr)
         {
             gmx_fatal(FARGS, "Unexpected end of ORCA output");
         }
@@ -353,7 +355,7 @@ real read_orca_output(rvec QMgrad[], rvec MMgrad[], t_forcerec *fr,
     for (i = 0; i < 3*qm->nrQMatoms; i++)
     {
         k = i/3;
-        if (fgets(buf, 300, engrad) == NULL)
+        if (fgets(buf, 300, engrad) == nullptr)
         {
             gmx_fatal(FARGS, "Unexpected end of ORCA output");
         }
@@ -397,13 +399,13 @@ real read_orca_output(rvec QMgrad[], rvec MMgrad[], t_forcerec *fr,
          */
         /* we can skip the first line
          */
-        if (fgets(buf, 300, pcgrad) == NULL)
+        if (fgets(buf, 300, pcgrad) == nullptr)
         {
             gmx_fatal(FARGS, "Unexpected end of ORCA output");
         }
         for (i = 0; i < mm->nrMMatoms; i++)
         {
-            if (fgets(buf, 300, pcgrad) == NULL)
+            if (fgets(buf, 300, pcgrad) == nullptr)
             {
                 gmx_fatal(FARGS, "Unexpected end of ORCA output");
             }
@@ -424,7 +426,7 @@ real read_orca_output(rvec QMgrad[], rvec MMgrad[], t_forcerec *fr,
     return(QMener);
 }
 
-void do_orca(char *orca_dir, char *basename)
+static void do_orca(char *orca_dir, char *basename)
 {
 
     /* make the call to the orca binary through system()
diff --git a/src/gromacs/mdlib/qm_orca.h b/src/gromacs/mdlib/qm_orca.h
new file mode 100644 (file)
index 0000000..7ab55e2
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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 "gromacs/mdlib/qmmm.h"
+
+#ifndef GMX_MDLIB_QM_ORCA_H
+#define GMX_MDLIB_QM_ORCA_H
+
+void
+init_orca(t_QMrec *qm);
+
+real
+call_orca(t_forcerec *fr, t_QMrec *qm,
+          t_MMrec *mm, rvec f[], rvec fshift[]);
+
+#endif
index 98b3a3324411081f70daec3b438a4815b2a95234..8dc23536821701e9905bb8080f4c70c6431bccbc 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,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.
@@ -65,6 +65,7 @@
 #include "gromacs/mdtypes/nblist.h"
 #include "gromacs/pbcutil/ishift.h"
 #include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/mtop_lookup.h"
 #include "gromacs/topology/mtop_util.h"
 #include "gromacs/topology/topology.h"
 #include "gromacs/utility/fatalerror.h"
@@ -108,15 +109,7 @@ real
 call_gaussian(t_forcerec *fr, t_QMrec *qm, t_MMrec *mm, rvec f[], rvec fshift[]);
 
 #elif GMX_QMMM_ORCA
-/* ORCA interface */
-
-void
-init_orca(t_QMrec *qm);
-
-real
-call_orca(t_forcerec *fr, t_QMrec *qm,
-          t_MMrec *mm, rvec f[], rvec fshift[]);
-
+#include "gromacs/mdlib/qm_orca.h"
 #endif
 
 
@@ -138,8 +131,8 @@ static int struct_comp(const void *a, const void *b)
 
 } /* struct_comp */
 
-real call_QMroutine(t_commrec gmx_unused *cr, t_forcerec gmx_unused *fr, t_QMrec gmx_unused *qm,
-                    t_MMrec gmx_unused *mm, rvec gmx_unused f[], rvec gmx_unused fshift[])
+static real call_QMroutine(t_commrec gmx_unused *cr, t_forcerec gmx_unused *fr, t_QMrec gmx_unused *qm,
+                           t_MMrec gmx_unused *mm, rvec gmx_unused f[], rvec gmx_unused fshift[])
 {
     /* makes a call to the requested QM routine (qm->QMmethod)
      * Note that f is actually the gradient, i.e. -f
@@ -191,7 +184,7 @@ real call_QMroutine(t_commrec gmx_unused *cr, t_forcerec gmx_unused *fr, t_QMrec
     return (QMener);
 }
 
-void init_QMroutine(t_commrec gmx_unused *cr, t_QMrec gmx_unused *qm, t_MMrec gmx_unused *mm)
+static void init_QMroutine(t_commrec gmx_unused *cr, t_QMrec gmx_unused *qm, t_MMrec gmx_unused *mm)
 {
     /* makes a call to the requested QM routine (qm->QMmethod)
      */
@@ -219,7 +212,7 @@ void init_QMroutine(t_commrec gmx_unused *cr, t_QMrec gmx_unused *qm, t_MMrec gm
     }
 } /* init_QMroutine */
 
-void update_QMMM_coord(rvec x[], t_forcerec *fr, t_QMrec *qm, t_MMrec *mm)
+static void update_QMMM_coord(rvec x[], t_forcerec *fr, t_QMrec *qm, t_MMrec *mm)
 {
     /* shifts the QM and MM particles into the central box and stores
      * these shifted coordinates in the coordinate arrays of the
@@ -249,9 +242,9 @@ static void punch_QMMM_excl(t_QMrec *qm, t_MMrec *mm, t_blocka *excls)
      * Only needed in case of QM/MM optimizations
      */
     FILE
-       *out = NULL;
+       *out = nullptr;
     int
-        i, j, k, nrexcl = 0, *excluded = NULL, max_excl = 0;
+        i, j, k, nrexcl = 0, *excluded = nullptr, max_excl = 0;
 
 
     out = fopen("QMMMexcl.dat", "w");
@@ -296,14 +289,14 @@ static void punch_QMMM_excl(t_QMrec *qm, t_MMrec *mm, t_blocka *excls)
 
 /* QMMM core routines */
 
-t_QMrec *mk_QMrec(void)
+static t_QMrec *mk_QMrec(void)
 {
     t_QMrec *qm;
     snew(qm, 1);
     return qm;
 } /* mk_QMrec */
 
-t_MMrec *mk_MMrec(void)
+static t_MMrec *mk_MMrec(void)
 {
     t_MMrec *mm;
     snew(mm, 1);
@@ -315,32 +308,25 @@ static void init_QMrec(int grpnr, t_QMrec *qm, int nr, int *atomarray,
 {
     /* fills the t_QMrec struct of QM group grpnr
      */
-    int                   i;
-    gmx_mtop_atomlookup_t alook;
-    t_atom               *atom;
-
 
     qm->nrQMatoms = nr;
     snew(qm->xQM, nr);
     snew(qm->indexQM, nr);
     snew(qm->shiftQM, nr); /* the shifts */
-    for (i = 0; i < nr; i++)
+    for (int i = 0; i < nr; i++)
     {
         qm->indexQM[i] = atomarray[i];
     }
 
-    alook = gmx_mtop_atomlookup_init(mtop);
-
     snew(qm->atomicnumberQM, nr);
-    for (i = 0; i < qm->nrQMatoms; i++)
+    int molb = 0;
+    for (int i = 0; i < qm->nrQMatoms; i++)
     {
-        gmx_mtop_atomnr_to_atom(alook, qm->indexQM[i], &atom);
-        qm->nelectrons       += mtop->atomtypes.atomnumber[atom->type];
-        qm->atomicnumberQM[i] = mtop->atomtypes.atomnumber[atom->type];
+        const t_atom &atom = mtopGetAtomParameters(mtop, qm->indexQM[i], &molb);
+        qm->nelectrons       += mtop->atomtypes.atomnumber[atom.type];
+        qm->atomicnumberQM[i] = mtop->atomtypes.atomnumber[atom.type];
     }
 
-    gmx_mtop_atomlookup_destroy(alook);
-
     qm->QMcharge       = ir->opts.QMcharge[grpnr];
     qm->multiplicity   = ir->opts.QMmult[grpnr];
     qm->nelectrons    -= ir->opts.QMcharge[grpnr];
@@ -376,7 +362,7 @@ static void init_QMrec(int grpnr, t_QMrec *qm, int nr, int *atomarray,
 
 } /* init_QMrec */
 
-t_QMrec *copy_QMrec(t_QMrec *qm)
+static t_QMrec *copy_QMrec(t_QMrec *qm)
 {
     /* copies the contents of qm into a new t_QMrec struct */
     t_QMrec
@@ -461,18 +447,16 @@ void init_QMMMrec(t_commrec  *cr,
      */
 
     gmx_groups_t            *groups;
-    int                     *qm_arr = NULL, vsite, ai, aj;
+    int                     *qm_arr = nullptr, vsite, ai, aj;
     int                      qm_max = 0, qm_nr = 0, i, j, jmax, k, l, nrvsite2 = 0;
     t_QMMMrec               *qr;
     t_MMrec                 *mm;
     t_iatom                 *iatoms;
     real                     c12au, c6au;
     gmx_mtop_atomloop_all_t  aloop;
-    t_atom                  *atom;
     gmx_mtop_ilistloop_all_t iloop;
     int                      a_offset;
     t_ilist                 *ilist_mol;
-    gmx_mtop_atomlookup_t    alook;
 
     if (ir->cutoff_scheme != ecutsGROUP)
     {
@@ -535,6 +519,7 @@ void init_QMMMrec(t_commrec  *cr,
     {
         /* new layer */
         aloop = gmx_mtop_atomloop_all_init(mtop);
+        const t_atom *atom;
         while (gmx_mtop_atomloop_all_next(aloop, &i, &atom))
         {
             if (qm_nr >= qm_max)
@@ -661,15 +646,17 @@ void init_QMMMrec(t_commrec  *cr,
 
         /* standard QMMM, all layers are merged together so there is one QM
          * subsystem and one MM subsystem.
-         * Also we set the charges to zero in the md->charge arrays to prevent
-         * the innerloops from doubly counting the electostatic QM MM interaction
+         * Also we set the charges to zero in mtop to prevent the innerloops
+         * from doubly counting the electostatic QM MM interaction
+         * TODO: Consider doing this in grompp instead.
          */
 
-        alook = gmx_mtop_atomlookup_init(mtop);
-
+        int molb = 0;
         for (k = 0; k < qm_nr; k++)
         {
-            gmx_mtop_atomnr_to_atom(alook, qm_arr[k], &atom);
+            int     indexInMolecule;
+            mtopGetMolblockIndex(mtop, qm_arr[k], &molb, nullptr, &indexInMolecule);
+            t_atom *atom = &mtop->moltype[mtop->molblock[molb].type].atoms.atom[indexInMolecule];
             atom->q  = 0.0;
             atom->qB = 0.0;
         }
@@ -681,10 +668,10 @@ void init_QMMMrec(t_commrec  *cr,
         {
             for (i = 0; i < qm_nr; i++)
             {
-                gmx_mtop_atomnr_to_atom(alook, qm_arr[i], &atom);
+                const t_atom &atom = mtopGetAtomParameters(mtop, qm_arr[i], &molb);
                 /* nbfp now includes the 6.0/12.0 derivative prefactors */
-                qr->qm[0]->c6[i]  =  C6(fr->nbfp, mtop->ffparams.atnr, atom->type, atom->type)/c6au/6.0;
-                qr->qm[0]->c12[i] = C12(fr->nbfp, mtop->ffparams.atnr, atom->type, atom->type)/c12au/12.0;
+                qr->qm[0]->c6[i]   =  C6(fr->nbfp, mtop->ffparams.atnr, atom.type, atom.type)/c6au/6.0;
+                qr->qm[0]->c12[i]  = C12(fr->nbfp, mtop->ffparams.atnr, atom.type, atom.type)/c12au/12.0;
             }
         }
 
@@ -692,9 +679,10 @@ void init_QMMMrec(t_commrec  *cr,
          */
         for (i = 0; i < qm_nr; i++)
         {
-            gmx_mtop_atomnr_to_ilist(alook, qm_arr[i], &ilist_mol, &a_offset);
-            nrvsite2 = ilist_mol[F_VSITE2].nr;
-            iatoms   = ilist_mol[F_VSITE2].iatoms;
+            mtopGetMolblockIndex(mtop, qm_arr[i], &molb, nullptr, &a_offset);
+            ilist_mol = mtop->moltype[mtop->molblock[molb].type].ilist;
+            nrvsite2  = ilist_mol[F_VSITE2].nr;
+            iatoms    = ilist_mol[F_VSITE2].iatoms;
 
             for (k = 0; k < nrvsite2; k += 4)
             {
@@ -722,8 +710,6 @@ void init_QMMMrec(t_commrec  *cr,
             }
         }
 
-        gmx_mtop_atomlookup_destroy(alook);
-
         /* MM rec creation */
         mm               = mk_MMrec();
         mm->scalefactor  = ir->scalefactor;
@@ -788,7 +774,7 @@ void update_QMMMrec(t_commrec      *cr,
     int
         mm_max = 0, mm_nr = 0, mm_nr_new, i, j, is, k, shift;
     t_j_particle
-       *mm_j_particles = NULL, *qm_i_particles = NULL;
+       *mm_j_particles = nullptr, *qm_i_particles = nullptr;
     t_QMMMrec
        *qr;
     t_nblist
@@ -802,7 +788,7 @@ void update_QMMMrec(t_commrec      *cr,
     t_pbc
         pbc;
     int
-       *parallelMMarray = NULL;
+       *parallelMMarray = nullptr;
     real
         c12au, c6au;
 
@@ -1093,10 +1079,10 @@ real calculate_QMMM(t_commrec *cr,
     t_QMrec
     *qm, *qm2;
     t_MMrec
-    *mm = NULL;
+    *mm = nullptr;
     rvec
-    *forces  = NULL, *fshift = NULL,
-    *forces2 = NULL, *fshift2 = NULL; /* needed for multilayer ONIOM */
+    *forces  = nullptr, *fshift = nullptr,
+    *forces2 = nullptr, *fshift2 = nullptr; /* needed for multilayer ONIOM */
     int
         i, j, k;
     /* make a local copy the QMMMrec pointer
index d5b320b821fcefc1ce8bcdb782d14e166106bd5a..31a690df4cc392537940ad9955a24484783e0e04 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,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.
@@ -66,10 +66,10 @@ gmx_shakedata_t shake_init()
     snew(d, 1);
 
     d->nalloc                      = 0;
-    d->rij                         = NULL;
-    d->half_of_reduced_mass        = NULL;
-    d->distance_squared_tolerance  = NULL;
-    d->constraint_distance_squared = NULL;
+    d->rij                         = nullptr;
+    d->half_of_reduced_mass        = nullptr;
+    d->distance_squared_tolerance  = nullptr;
+    d->constraint_distance_squared = nullptr;
 
     /* SOR initialization */
     d->delta = 0.1;
@@ -202,13 +202,13 @@ void cshake(const int iatom[], int ncon, int *nnit, int maxnit,
     *nerror = error;
 }
 
-int vec_shakef(FILE *fplog, gmx_shakedata_t shaked,
-               real invmass[], int ncon,
-               t_iparams ip[], t_iatom *iatom,
-               real tol, rvec x[], rvec prime[], real omega,
-               gmx_bool bFEP, real lambda, real scaled_lagrange_multiplier[],
-               real invdt, rvec *v,
-               gmx_bool bCalcVir, tensor vir_r_m_dr, int econq)
+static int vec_shakef(FILE *fplog, gmx_shakedata_t shaked,
+                      real invmass[], int ncon,
+                      t_iparams ip[], t_iatom *iatom,
+                      real tol, rvec x[], rvec prime[], real omega,
+                      gmx_bool bFEP, real lambda, real scaled_lagrange_multiplier[],
+                      real invdt, rvec *v,
+                      gmx_bool bCalcVir, tensor vir_r_m_dr, int econq)
 {
     rvec    *rij;
     real    *half_of_reduced_mass, *distance_squared_tolerance, *constraint_distance_squared;
@@ -301,7 +301,7 @@ int vec_shakef(FILE *fplog, gmx_shakedata_t shaked,
         i     = ia[1];
         j     = ia[2];
 
-        if ((econq == econqCoord) && v != NULL)
+        if ((econq == econqCoord) && v != nullptr)
         {
             /* Correct the velocities */
             mm = scaled_lagrange_multiplier[ll]*invmass[i]*invdt;
index c62ae769c199ccc731b53c417044eb923535625a..93ea4532d0a6598884beb2f8dbb0d30fc6888e7d 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
@@ -46,6 +46,7 @@
 #include <algorithm>
 #include <array>
 
+#include "gromacs/domdec/dlbtiming.h"
 #include "gromacs/domdec/domdec.h"
 #include "gromacs/domdec/domdec_struct.h"
 #include "gromacs/gmxlib/chargegroup.h"
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/mdtypes/state.h"
 #include "gromacs/pbcutil/mshift.h"
 #include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/mtop_lookup.h"
 #include "gromacs/topology/mtop_util.h"
 #include "gromacs/utility/arraysize.h"
 #include "gromacs/utility/cstringutil.h"
@@ -83,6 +86,7 @@ typedef struct {
 } t_shell;
 
 struct gmx_shellfc_t {
+    /* Shell counts, indices, parameters and working data */
     int          nshell_gl;              /* The number of shells in the system        */
     t_shell     *shell_gl;               /* All the shells (for DD only)              */
     int         *shell_index_gl;         /* Global shell index (for DD only)          */
@@ -93,9 +97,12 @@ struct gmx_shellfc_t {
     gmx_bool     bPredict;               /* Predict shell positions                   */
     gmx_bool     bRequireInit;           /* Require initialization of shell positions */
     int          nflexcon;               /* The number of flexible constraints        */
-    rvec        *x[2];                   /* Array for iterative minimization          */
-    rvec        *f[2];                   /* Array for iterative minimization          */
-    int          x_nalloc;               /* The allocation size of x and f            */
+
+    /* Temporary arrays, should be fixed size 2 when fully converted to C++ */
+    PaddedRVecVector *x;                 /* Array for iterative minimization          */
+    PaddedRVecVector *f;                 /* Array for iterative minimization          */
+
+    /* Flexible constraint working data */
     rvec        *acc_dir;                /* Acceleration direction for flexcon        */
     rvec        *x_old;                  /* Old coordinates for flexcon               */
     int          flex_nalloc;            /* The allocation size of acc_dir and x_old  */
@@ -146,13 +153,6 @@ static void predict_shells(FILE *fplog, rvec x[], rvec v[], real dt,
     int                   i, m, s1, n1, n2, n3;
     real                  dt_1, fudge, tm, m1, m2, m3;
     rvec                 *ptr;
-    gmx_mtop_atomlookup_t alook = NULL;
-    t_atom               *atom;
-
-    if (mass == NULL)
-    {
-        alook = gmx_mtop_atomlookup_init(mtop);
-    }
 
     /* We introduce a fudge factor for performance reasons: with this choice
      * the initial force on the shells is about a factor of two lower than
@@ -175,6 +175,7 @@ static void predict_shells(FILE *fplog, rvec x[], rvec v[], real dt,
         dt_1 = fudge*dt;
     }
 
+    int molb = 0;
     for (i = 0; (i < ns); i++)
     {
         s1 = s[i].shell;
@@ -202,10 +203,8 @@ static void predict_shells(FILE *fplog, rvec x[], rvec v[], real dt,
                 else
                 {
                     /* Not the correct masses with FE, but it is just a prediction... */
-                    gmx_mtop_atomnr_to_atom(alook, n1, &atom);
-                    m1 = atom->m;
-                    gmx_mtop_atomnr_to_atom(alook, n2, &atom);
-                    m2 = atom->m;
+                    m1 = mtopGetAtomMass(mtop, n1, &molb);
+                    m2 = mtopGetAtomMass(mtop, n2, &molb);
                 }
                 tm = dt_1/(m1+m2);
                 for (m = 0; (m < DIM); m++)
@@ -226,12 +225,9 @@ static void predict_shells(FILE *fplog, rvec x[], rvec v[], real dt,
                 else
                 {
                     /* Not the correct masses with FE, but it is just a prediction... */
-                    gmx_mtop_atomnr_to_atom(alook, n1, &atom);
-                    m1 = atom->m;
-                    gmx_mtop_atomnr_to_atom(alook, n2, &atom);
-                    m2 = atom->m;
-                    gmx_mtop_atomnr_to_atom(alook, n3, &atom);
-                    m3 = atom->m;
+                    m1 = mtopGetAtomMass(mtop, n1, &molb);
+                    m2 = mtopGetAtomMass(mtop, n2, &molb);
+                    m3 = mtopGetAtomMass(mtop, n3, &molb);
                 }
                 tm = dt_1/(m1+m2+m3);
                 for (m = 0; (m < DIM); m++)
@@ -243,11 +239,6 @@ static void predict_shells(FILE *fplog, rvec x[], rvec v[], real dt,
                 gmx_fatal(FARGS, "Shell %d has %d nuclei!", i, s[i].nnucl);
         }
     }
-
-    if (mass == NULL)
-    {
-        gmx_mtop_atomlookup_destroy(alook);
-    }
 }
 
 /*! \brief Count the different particle types in a system
@@ -270,7 +261,7 @@ static std::array<int, eptNR> countPtypes(FILE       *fplog,
 
     gmx_mtop_atomloop_block_t  aloopb = gmx_mtop_atomloop_block_init(mtop);
     int                        nmol;
-    t_atom                    *atom;
+    const t_atom              *atom;
     while (gmx_mtop_atomloop_block_next(aloopb, &atom, &nmol))
     {
         switch (atom->ptype)
@@ -308,8 +299,8 @@ gmx_shellfc_t *init_shell_flexcon(FILE *fplog,
 {
     gmx_shellfc_t            *shfc;
     t_shell                  *shell;
-    int                      *shell_index = NULL, *at2cg;
-    t_atom                   *atom;
+    int                      *shell_index = nullptr, *at2cg;
+    const t_atom             *atom;
 
     int                       ns, nshell, nsi;
     int                       i, j, type, mb, a_offset, cg, mol, ftype, nra;
@@ -330,10 +321,12 @@ gmx_shellfc_t *init_shell_flexcon(FILE *fplog,
     if (nshell == 0 && nflexcon == 0)
     {
         /* We're not doing shells or flexible constraints */
-        return NULL;
+        return nullptr;
     }
 
     snew(shfc, 1);
+    shfc->x        = new PaddedRVecVector[2] {};
+    shfc->f        = new PaddedRVecVector[2] {};
     shfc->nflexcon = nflexcon;
 
     if (nshell == 0)
@@ -559,7 +552,7 @@ gmx_shellfc_t *init_shell_flexcon(FILE *fplog,
     shfc->shell_gl       = shell;
     shfc->shell_index_gl = shell_index;
 
-    shfc->bPredict     = (getenv("GMX_NOPREDICT") == NULL);
+    shfc->bPredict     = (getenv("GMX_NOPREDICT") == nullptr);
     shfc->bRequireInit = FALSE;
     if (!shfc->bPredict)
     {
@@ -570,7 +563,7 @@ gmx_shellfc_t *init_shell_flexcon(FILE *fplog,
     }
     else
     {
-        shfc->bRequireInit = (getenv("GMX_REQUIRE_SHELL_INIT") != NULL);
+        shfc->bRequireInit = (getenv("GMX_REQUIRE_SHELL_INIT") != nullptr);
         if (shfc->bRequireInit && fplog)
         {
             fprintf(fplog, "\nWill always initiate shell positions\n");
@@ -603,7 +596,7 @@ void make_local_shells(t_commrec *cr, t_mdatoms *md,
 {
     t_shell      *shell;
     int           a0, a1, *ind, nshell, i;
-    gmx_domdec_t *dd = NULL;
+    gmx_domdec_t *dd = nullptr;
 
     if (DOMAINDECOMP(cr))
     {
@@ -666,7 +659,7 @@ void make_local_shells(t_commrec *cr, t_mdatoms *md,
     shfc->shell  = shell;
 }
 
-static void do_1pos(rvec xnew, rvec xold, rvec f, real step)
+static void do_1pos(rvec xnew, const rvec xold, const rvec f, real step)
 {
     real xo, yo, zo;
     real dx, dy, dz;
@@ -684,7 +677,7 @@ static void do_1pos(rvec xnew, rvec xold, rvec f, real step)
     xnew[ZZ] = zo+dz;
 }
 
-static void do_1pos3(rvec xnew, rvec xold, rvec f, rvec step)
+static void do_1pos3(rvec xnew, const rvec xold, const rvec f, const rvec step)
 {
     real xo, yo, zo;
     real dx, dy, dz;
@@ -702,18 +695,21 @@ static void do_1pos3(rvec xnew, rvec xold, rvec f, rvec step)
     xnew[ZZ] = zo+dz;
 }
 
-static void directional_sd(rvec xold[], rvec xnew[], rvec acc_dir[],
-                           int start, int homenr, real step)
+static void directional_sd(const PaddedRVecVector *xold, PaddedRVecVector *xnew, const rvec acc_dir[],
+                           int homenr, real step)
 {
-    int  i;
+    const rvec *xo = as_rvec_array(xold->data());
+    rvec       *xn = as_rvec_array(xnew->data());
 
-    for (i = start; i < homenr; i++)
+    for (int i = 0; i < homenr; i++)
     {
-        do_1pos(xnew[i], xold[i], acc_dir[i], step);
+        do_1pos(xn[i], xo[i], acc_dir[i], step);
     }
 }
 
-static void shell_pos_sd(rvec xcur[], rvec xnew[], rvec f[],
+static void shell_pos_sd(const PaddedRVecVector * gmx_restrict xcur,
+                         PaddedRVecVector * gmx_restrict xnew,
+                         const PaddedRVecVector *f,
                          int ns, t_shell s[], int count)
 {
     const real step_scale_min       = 0.8,
@@ -747,8 +743,8 @@ static void shell_pos_sd(rvec xcur[], rvec xnew[], rvec f[],
         {
             for (d = 0; d < DIM; d++)
             {
-                dx = xcur[shell][d] - s[i].xold[d];
-                df =    f[shell][d] - s[i].fold[d];
+                dx = (*xcur)[shell][d] - s[i].xold[d];
+                df =    (*f)[shell][d] - s[i].fold[d];
                 /* -dx/df gets used to generate an interpolated value, but would
                  * cause a NaN if df were binary-equal to zero. Values close to
                  * zero won't cause problems (because of the min() and max()), so
@@ -782,18 +778,18 @@ static void shell_pos_sd(rvec xcur[], rvec xnew[], rvec f[],
 #endif
             }
         }
-        copy_rvec(xcur[shell], s[i].xold);
-        copy_rvec(f[shell],   s[i].fold);
+        copy_rvec((*xcur)[shell], s[i].xold);
+        copy_rvec((*f)[shell],   s[i].fold);
 
-        do_1pos3(xnew[shell], xcur[shell], f[shell], s[i].step);
+        do_1pos3((*xnew)[shell], (*xcur)[shell], (*f)[shell], s[i].step);
 
         if (gmx_debug_at)
         {
             fprintf(debug, "shell[%d] = %d\n", i, shell);
-            pr_rvec(debug, 0, "fshell", f[shell], DIM, TRUE);
-            pr_rvec(debug, 0, "xold", xcur[shell], DIM, TRUE);
+            pr_rvec(debug, 0, "fshell", (*f)[shell], DIM, TRUE);
+            pr_rvec(debug, 0, "xold", (*xcur)[shell], DIM, TRUE);
             pr_rvec(debug, 0, "step", s[i].step, DIM, TRUE);
-            pr_rvec(debug, 0, "xnew", xnew[shell], DIM, TRUE);
+            pr_rvec(debug, 0, "xnew", (*xnew)[shell], DIM, TRUE);
         }
     }
 #ifdef PRINT_STEP
@@ -829,19 +825,19 @@ static void print_epot(FILE *fp, gmx_int64_t mdstep, int count, real epot, real
 }
 
 
-static real rms_force(t_commrec *cr, rvec f[], int ns, t_shell s[],
+static real rms_force(t_commrec *cr, const PaddedRVecVector *force, int ns, t_shell s[],
                       int ndir, real *sf_dir, real *Epot)
 {
-    int    i, shell, ntot;
-    double buf[4];
+    double      buf[4];
+    const rvec *f = as_rvec_array(force->data());
 
     buf[0] = *sf_dir;
-    for (i = 0; i < ns; i++)
+    for (int i = 0; i < ns; i++)
     {
-        shell    = s[i].shell;
-        buf[0]  += norm2(f[shell]);
+        int shell  = s[i].shell;
+        buf[0]    += norm2(f[shell]);
     }
-    ntot = ns;
+    int ntot = ns;
 
     if (PAR(cr))
     {
@@ -858,7 +854,7 @@ static real rms_force(t_commrec *cr, rvec f[], int ns, t_shell s[],
     return (ntot ? std::sqrt(buf[0]/ntot) : 0);
 }
 
-static void check_pbc(FILE *fp, rvec x[], int shell)
+static void check_pbc(FILE *fp, PaddedRVecVector x, int shell)
 {
     int m, now;
 
@@ -867,13 +863,13 @@ static void check_pbc(FILE *fp, rvec x[], int shell)
     {
         if (fabs(x[shell][m]-x[now][m]) > 0.3)
         {
-            pr_rvecs(fp, 0, "SHELL-X", x+now, 5);
+            pr_rvecs(fp, 0, "SHELL-X", as_rvec_array(x.data())+now, 5);
             break;
         }
     }
 }
 
-static void dump_shells(FILE *fp, rvec x[], rvec f[], real ftol, int ns, t_shell s[])
+static void dump_shells(FILE *fp, PaddedRVecVector x, PaddedRVecVector f, real ftol, int ns, t_shell s[])
 {
     int  i, shell;
     real ft2, ff2;
@@ -896,11 +892,12 @@ static void dump_shells(FILE *fp, rvec x[], rvec f[], real ftol, int ns, t_shell
 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,
-                      gmx_int64_t step, t_mdatoms *md, int start, int end,
+                      gmx_int64_t step, t_mdatoms *md, int end,
                       rvec *x_old, rvec *x_init, rvec *x,
                       rvec *f, rvec *acc_dir,
                       gmx_bool bMolPBC, matrix box,
-                      real *lambda, real *dvdlambda, t_nrnb *nrnb)
+                      gmx::ConstArrayRef<real> lambda, real *dvdlambda,
+                      t_nrnb *nrnb)
 {
     rvec           *xnold, *xnew;
     double          dt, w_dt;
@@ -913,7 +910,7 @@ static void init_adir(FILE *log, gmx_shellfc_t *shfc,
     }
     else
     {
-        n = end - start;
+        n = end;
     }
     if (n > shfc->adir_nalloc)
     {
@@ -929,7 +926,7 @@ static void init_adir(FILE *log, gmx_shellfc_t *shfc,
     dt = ir->delta_t;
 
     /* Does NOT work with freeze or acceleration groups (yet) */
-    for (n = start; n < end; n++)
+    for (n = 0; n < end; n++)
     {
         w_dt = md->invmass[n]*dt;
 
@@ -937,31 +934,31 @@ static void init_adir(FILE *log, gmx_shellfc_t *shfc,
         {
             if ((ptype[n] != eptVSite) && (ptype[n] != eptShell))
             {
-                xnold[n-start][d] = x[n][d] - (x_init[n][d] - x_old[n][d]);
-                xnew[n-start][d]  = 2*x[n][d] - x_old[n][d] + f[n][d]*w_dt*dt;
+                xnold[n][d] = x[n][d] - (x_init[n][d] - x_old[n][d]);
+                xnew[n][d]  = 2*x[n][d] - x_old[n][d] + f[n][d]*w_dt*dt;
             }
             else
             {
-                xnold[n-start][d] = x[n][d];
-                xnew[n-start][d]  = x[n][d];
+                xnold[n][d] = x[n][d];
+                xnew[n][d]  = x[n][d];
             }
         }
     }
     constrain(log, FALSE, FALSE, constr, idef, ir, cr, step, 0, 1.0, md,
-              x, xnold-start, NULL, bMolPBC, box,
+              x, xnold, nullptr, bMolPBC, box,
               lambda[efptBONDED], &(dvdlambda[efptBONDED]),
-              NULL, NULL, nrnb, econqCoord);
+              nullptr, nullptr, nrnb, econqCoord);
     constrain(log, FALSE, FALSE, constr, idef, ir, cr, step, 0, 1.0, md,
-              x, xnew-start, NULL, bMolPBC, box,
+              x, xnew, nullptr, bMolPBC, box,
               lambda[efptBONDED], &(dvdlambda[efptBONDED]),
-              NULL, NULL, nrnb, econqCoord);
+              nullptr, nullptr, nrnb, econqCoord);
 
-    for (n = start; n < end; n++)
+    for (n = 0; n < end; n++)
     {
         for (d = 0; d < DIM; d++)
         {
-            xnew[n-start][d] =
-                -(2*x[n][d]-xnold[n-start][d]-xnew[n-start][d])/gmx::square(dt)
+            xnew[n][d] =
+                -(2*x[n][d]-xnold[n][d]-xnew[n][d])/gmx::square(dt)
                 - f[n][d]*md->invmass[n];
         }
         clear_rvec(acc_dir[n]);
@@ -969,9 +966,9 @@ 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,
-              x_old, xnew-start, acc_dir, bMolPBC, box,
+              x_old, xnew, acc_dir, bMolPBC, box,
               lambda[efptBONDED], &(dvdlambda[efptBONDED]),
-              NULL, NULL, nrnb, econqDeriv_FlexCon);
+              nullptr, nullptr, nrnb, econqDeriv_FlexCon);
 }
 
 void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
@@ -980,7 +977,7 @@ void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
                          gmx_localtop_t *top,
                          gmx_constr_t constr,
                          gmx_enerdata_t *enerd, t_fcdata *fcd,
-                         t_state *state, rvec f[],
+                         t_state *state, PaddedRVecVector *f,
                          tensor force_vir,
                          t_mdatoms *md,
                          t_nrnb *nrnb, gmx_wallcycle_t wcycle,
@@ -991,19 +988,20 @@ void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
                          gmx_bool bBornRadii,
                          double t, rvec mu_tot,
                          gmx_vsite_t *vsite,
-                         FILE *fp_field)
+                         DdOpenBalanceRegionBeforeForceComputation ddOpenBalanceRegion,
+                         DdCloseBalanceRegionAfterForceComputation ddCloseBalanceRegion)
 {
     int        nshell;
     t_shell   *shell;
     t_idef    *idef;
-    rvec      *pos[2], *force[2], *acc_dir = NULL, *x_old = NULL;
+    rvec      *acc_dir = nullptr, *x_old = nullptr;
     real       Epot[2], df[2];
     real       sf_dir, invdt;
     real       ftol, dum = 0;
     char       sbuf[22];
     gmx_bool   bCont, bInit, bConverged;
     int        nat, dd_ac0, dd_ac1 = 0, i;
-    int        start = 0, homenr = md->homenr, end = start+homenr, cg0, cg1;
+    int        homenr = md->homenr, end = homenr, cg0, cg1;
     int        nflexcon, number_steps, d, Min = 0, count = 0;
 #define  Try (1-Min)             /* At start Try = 1 */
 
@@ -1031,20 +1029,19 @@ void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
         nat = state->natoms;
     }
 
-    if (nat > shfc->x_nalloc)
+    for (i = 0; (i < 2); i++)
     {
-        /* Allocate local arrays */
-        shfc->x_nalloc = over_alloc_dd(nat);
-        for (i = 0; (i < 2); i++)
-        {
-            srenew(shfc->x[i], shfc->x_nalloc);
-            srenew(shfc->f[i], shfc->x_nalloc);
-        }
+        shfc->x[i].resize(nat + 1);
+        shfc->f[i].resize(nat + 1);
     }
+
+    /* Create pointer that we can swap */
+    PaddedRVecVector *pos[2];
+    PaddedRVecVector *force[2];
     for (i = 0; (i < 2); i++)
     {
-        pos[i]   = shfc->x[i];
-        force[i] = shfc->f[i];
+        pos[i]   = &shfc->x[i];
+        force[i] = &shfc->f[i];
     }
 
     if (bDoNS && inputrec->ePBC != epbcNONE && !DOMAINDECOMP(cr))
@@ -1055,26 +1052,26 @@ void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
          */
         if (inputrec->cutoff_scheme == ecutsVERLET)
         {
-            put_atoms_in_box_omp(fr->ePBC, state->box, md->homenr, state->x);
+            put_atoms_in_box_omp(fr->ePBC, state->box, md->homenr, as_rvec_array(state->x.data()));
         }
         else
         {
             cg0 = 0;
             cg1 = top->cgs.nr;
             put_charge_groups_in_box(fplog, cg0, cg1, fr->ePBC, state->box,
-                                     &(top->cgs), state->x, fr->cg_cm);
+                                     &(top->cgs), as_rvec_array(state->x.data()), fr->cg_cm);
         }
 
         if (graph)
         {
-            mk_mshift(fplog, graph, fr->ePBC, state->box, state->x);
+            mk_mshift(fplog, graph, fr->ePBC, state->box, as_rvec_array(state->x.data()));
         }
     }
 
     /* After this all coordinate arrays will contain whole charge groups */
     if (graph)
     {
-        shift_self(graph, state->box, state->x);
+        shift_self(graph, state->box, as_rvec_array(state->x.data()));
     }
 
     if (nflexcon)
@@ -1092,54 +1089,57 @@ void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
             for (d = 0; d < DIM; d++)
             {
                 shfc->x_old[i][d] =
-                    state->x[start+i][d] - state->v[start+i][d]*inputrec->delta_t;
+                    state->x[i][d] - state->v[i][d]*inputrec->delta_t;
             }
         }
     }
 
-    /* Do a prediction of the shell positions */
-    if (shfc->bPredict && !bCont)
+    /* Do a prediction of the shell positions, when appropriate.
+     * Without velocities (EM, NM, BD) we only do initial prediction.
+     */
+    if (shfc->bPredict && !bCont && (EI_STATE_VELOCITY(inputrec->eI) || bInit))
     {
-        predict_shells(fplog, state->x, state->v, inputrec->delta_t, nshell, shell,
-                       md->massT, NULL, bInit);
+        predict_shells(fplog, as_rvec_array(state->x.data()), as_rvec_array(state->v.data()), inputrec->delta_t, nshell, shell,
+                       md->massT, nullptr, bInit);
     }
 
     /* do_force expected the charge groups to be in the box */
     if (graph)
     {
-        unshift_self(graph, state->box, state->x);
+        unshift_self(graph, state->box, as_rvec_array(state->x.data()));
     }
 
     /* Calculate the forces first time around */
     if (gmx_debug_at)
     {
-        pr_rvecs(debug, 0, "x b4 do_force", state->x + start, homenr);
+        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,
-             state->box, state->x, &state->hist,
+             state->box, &state->x, &state->hist,
              force[Min], force_vir, md, enerd, fcd,
              state->lambda, graph,
-             fr, vsite, mu_tot, t, fp_field, NULL, bBornRadii,
-             (bDoNS ? GMX_FORCE_NS : 0) | force_flags);
+             fr, vsite, mu_tot, t, nullptr, bBornRadii,
+             (bDoNS ? GMX_FORCE_NS : 0) | force_flags,
+             ddOpenBalanceRegion, ddCloseBalanceRegion);
 
     sf_dir = 0;
     if (nflexcon)
     {
         init_adir(fplog, shfc,
-                  constr, idef, inputrec, cr, dd_ac1, mdstep, md, start, end,
-                  shfc->x_old-start, state->x, state->x, force[Min],
-                  shfc->acc_dir-start,
+                  constr, idef, inputrec, cr, 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);
 
-        for (i = start; i < end; i++)
+        for (i = 0; i < end; i++)
         {
-            sf_dir += md->massT[i]*norm2(shfc->acc_dir[i-start]);
+            sf_dir += md->massT[i]*norm2(shfc->acc_dir[i]);
         }
     }
 
     Epot[Min] = enerd->term[F_EPOT];
 
-    df[Min] = rms_force(cr, shfc->f[Min], nshell, shell, nflexcon, &sf_dir, &Epot[Min]);
+    df[Min] = rms_force(cr, &shfc->f[Min], nshell, shell, nflexcon, &sf_dir, &Epot[Min]);
     df[Try] = 0;
     if (debug)
     {
@@ -1148,7 +1148,7 @@ void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
 
     if (gmx_debug_at)
     {
-        pr_rvecs(debug, 0, "force0", force[Min], md->nr);
+        pr_rvecs(debug, 0, "force0", as_rvec_array(force[Min]->data()), md->nr);
     }
 
     if (nshell+nflexcon > 0)
@@ -1157,8 +1157,8 @@ void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
          * shell positions are updated, therefore the other particles must
          * be set here.
          */
-        memcpy(pos[Min], state->x, nat*sizeof(state->x[0]));
-        memcpy(pos[Try], state->x, nat*sizeof(state->x[0]));
+        *pos[Min] = state->x;
+        *pos[Try] = state->x;
     }
 
     if (bVerbose && MASTER(cr))
@@ -1186,7 +1186,8 @@ void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
     {
         if (vsite)
         {
-            construct_vsites(vsite, pos[Min], inputrec->delta_t, state->v,
+            construct_vsites(vsite, as_rvec_array(pos[Min]->data()),
+                             inputrec->delta_t, as_rvec_array(state->v.data()),
                              idef->iparams, idef->il,
                              fr->ePBC, fr->bMolPBC, cr, state->box);
         }
@@ -1194,12 +1195,11 @@ 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, start, end,
-                      x_old-start, state->x, pos[Min], force[Min], acc_dir-start,
+                      constr, idef, inputrec, cr, 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);
 
-            directional_sd(pos[Min], pos[Try], acc_dir-start, start, end,
-                           fr->fc_stepsize);
+            directional_sd(pos[Min], pos[Try], acc_dir, end, fr->fc_stepsize);
         }
 
         /* New positions, Steepest descent */
@@ -1208,38 +1208,39 @@ void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
         /* do_force expected the charge groups to be in the box */
         if (graph)
         {
-            unshift_self(graph, state->box, pos[Try]);
+            unshift_self(graph, state->box, as_rvec_array(pos[Try]->data()));
         }
 
         if (gmx_debug_at)
         {
-            pr_rvecs(debug, 0, "RELAX: pos[Min]  ", pos[Min] + start, homenr);
-            pr_rvecs(debug, 0, "RELAX: pos[Try]  ", pos[Try] + start, homenr);
+            pr_rvecs(debug, 0, "RELAX: pos[Min]  ", as_rvec_array(pos[Min]->data()), homenr);
+            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,
                  top, groups, state->box, pos[Try], &state->hist,
                  force[Try], force_vir,
                  md, enerd, fcd, state->lambda, graph,
-                 fr, vsite, mu_tot, t, fp_field, NULL, bBornRadii,
-                 force_flags);
+                 fr, vsite, mu_tot, t, nullptr, bBornRadii,
+                 force_flags,
+                 ddOpenBalanceRegion, ddCloseBalanceRegion);
 
         if (gmx_debug_at)
         {
-            pr_rvecs(debug, 0, "RELAX: force[Min]", force[Min] + start, homenr);
-            pr_rvecs(debug, 0, "RELAX: force[Try]", force[Try] + start, homenr);
+            pr_rvecs(debug, 0, "RELAX: force[Min]", as_rvec_array(force[Min]->data()), homenr);
+            pr_rvecs(debug, 0, "RELAX: force[Try]", as_rvec_array(force[Try]->data()), homenr);
         }
         sf_dir = 0;
         if (nflexcon)
         {
             init_adir(fplog, shfc,
-                      constr, idef, inputrec, cr, dd_ac1, mdstep, md, start, end,
-                      x_old-start, state->x, pos[Try], force[Try], acc_dir-start,
+                      constr, idef, inputrec, cr, 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);
 
-            for (i = start; i < end; i++)
+            for (i = 0; i < end; i++)
             {
-                sf_dir += md->massT[i]*norm2(acc_dir[i-start]);
+                sf_dir += md->massT[i]*norm2(acc_dir[i]);
             }
         }
 
@@ -1256,12 +1257,12 @@ void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
         {
             if (gmx_debug_at)
             {
-                pr_rvecs(debug, 0, "F na do_force", force[Try] + start, homenr);
+                pr_rvecs(debug, 0, "F na do_force", as_rvec_array(force[Try]->data()), homenr);
             }
             if (gmx_debug_at)
             {
                 fprintf(debug, "SHELL ITER %d\n", count);
-                dump_shells(debug, pos[Try], force[Try], ftol, nshell, shell);
+                dump_shells(debug, *pos[Try], *force[Try], ftol, nshell, shell);
             }
         }
 
@@ -1282,7 +1283,7 @@ void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
             {
                 /* Correct the velocities for the flexible constraints */
                 invdt = 1/inputrec->delta_t;
-                for (i = start; i < end; i++)
+                for (i = 0; i < end; i++)
                 {
                     for (d = 0; d < DIM; d++)
                     {
@@ -1317,8 +1318,8 @@ void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
     }
 
     /* Copy back the coordinates and the forces */
-    memcpy(state->x, pos[Min], nat*sizeof(state->x[0]));
-    memcpy(f, force[Min], nat*sizeof(f[0]));
+    state->x = *pos[Min];
+    *f       = *force[Min];
 }
 
 void done_shellfc(FILE *fplog, gmx_shellfc_t *shfc, gmx_int64_t numSteps)
index 11581d0f9b2ec72ccf81aef30eefd003af17390d..c092a1f37a4b118db44da51a98423c8c92927689 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
@@ -39,6 +39,8 @@
 
 #include <cstdio>
 
+#include "gromacs/domdec/dlbtiming.h"
+#include "gromacs/math/paddedvector.h"
 #include "gromacs/mdlib/vsite.h"
 #include "gromacs/timing/wallcycle.h"
 
@@ -51,7 +53,7 @@ struct t_forcerec;
 struct t_fcdata;
 struct t_graph;
 struct t_inputrec;
-struct t_state;
+class t_state;
 
 /* Initialization function, also predicts the initial shell postions.
  */
@@ -71,7 +73,7 @@ void relax_shell_flexcon(FILE *log, t_commrec *cr, gmx_bool bVerbose,
                          gmx_localtop_t *top,
                          gmx_constr *constr,
                          gmx_enerdata_t *enerd, t_fcdata *fcd,
-                         t_state *state, rvec f[],
+                         t_state *state, PaddedRVecVector *f,
                          tensor force_vir,
                          t_mdatoms *md,
                          t_nrnb *nrnb, gmx_wallcycle_t wcycle,
@@ -82,7 +84,8 @@ void relax_shell_flexcon(FILE *log, t_commrec *cr, gmx_bool bVerbose,
                          gmx_bool bBornRadii,
                          double t, rvec mu_tot,
                          gmx_vsite_t *vsite,
-                         FILE *fp_field);
+                         DdOpenBalanceRegionBeforeForceComputation ddOpenBalanceRegion,
+                         DdCloseBalanceRegionAfterForceComputation ddCloseBalanceRegion);
 
 /* Print some final output */
 void done_shellfc(FILE *fplog, gmx_shellfc_t *shellfc, gmx_int64_t numSteps);
index ae5a06d66b4b8d48fe5d05db62c6b2e60df325b8..abf37009cc274329e112d35e528821087fcdef65 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,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.
@@ -117,7 +117,7 @@ static void gmx_signal(int signum)
     act.sa_handler = signal_handler;
     sigemptyset(&act.sa_mask);
     act.sa_flags = SA_RESTART;
-    sigaction(signum, &act, NULL);
+    sigaction(signum, &act, nullptr);
 #else
     signal(signum, signal_handler);
 #endif
@@ -125,7 +125,7 @@ static void gmx_signal(int signum)
 
 void signal_handler_install(void)
 {
-    if (getenv("GMX_NO_TERM") == NULL)
+    if (getenv("GMX_NO_TERM") == nullptr)
     {
         if (debug)
         {
@@ -133,7 +133,7 @@ void signal_handler_install(void)
         }
         gmx_signal(SIGTERM);
     }
-    if (getenv("GMX_NO_INT") == NULL)
+    if (getenv("GMX_NO_INT") == nullptr)
     {
         if (debug)
         {
@@ -142,7 +142,7 @@ void signal_handler_install(void)
         gmx_signal(SIGINT);
     }
 #if HAVE_SIGUSR1
-    if (getenv("GMX_NO_USR1") == NULL)
+    if (getenv("GMX_NO_USR1") == nullptr)
     {
         if (debug)
         {
index 4973896b2c3efd2d5eada84210a6b2b444b12a5a..ba75a097f2022790d315db7d53abf75e4d2625ea 100644 (file)
 #include <stdio.h>
 #include <string.h>
 
+#include <cstdint>
+
 #include <array>
 
+#include "gromacs/domdec/dlbtiming.h"
 #include "gromacs/domdec/domdec.h"
 #include "gromacs/domdec/domdec_struct.h"
 #include "gromacs/essentialdynamics/edsam.h"
 #include "gromacs/ewald/pme.h"
 #include "gromacs/gmxlib/chargegroup.h"
-#include "gromacs/gmxlib/md_logging.h"
 #include "gromacs/gmxlib/network.h"
 #include "gromacs/gmxlib/nrnb.h"
 #include "gromacs/gmxlib/nonbonded/nb_free_energy.h"
 #include "gromacs/mdlib/qmmm.h"
 #include "gromacs/mdlib/update.h"
 #include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_gpu_ref.h"
-#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref.h"
-#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
-#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 #include "gromacs/mdtypes/commrec.h"
+#include "gromacs/mdtypes/iforceprovider.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/mdtypes/state.h"
 #include "gromacs/pbcutil/ishift.h"
 #include "gromacs/pbcutil/mshift.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/timing/wallcyclereporting.h"
 #include "gromacs/timing/walltime_accounting.h"
+#include "gromacs/utility/arrayref.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/gmxmpi.h"
+#include "gromacs/utility/logger.h"
 #include "gromacs/utility/pleasecite.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/sysinfo.h"
 
 #include "nbnxn_gpu.h"
+#include "nbnxn_kernels/nbnxn_kernel_cpu.h"
+#include "nbnxn_kernels/nbnxn_kernel_prune.h"
 
 void print_time(FILE                     *out,
                 gmx_walltime_accounting_t walltime_accounting,
@@ -204,89 +209,18 @@ void print_start(FILE *fplog, t_commrec *cr,
                         walltime_accounting_get_start_time_stamp(walltime_accounting));
 }
 
-static void sum_forces(int start, int end, rvec f[], rvec flr[])
+static void sum_forces(rvec f[], const PaddedRVecVector *forceToAdd)
 {
-    int i;
+    /* TODO: remove this - 1 when padding is properly implemented */
+    int         end  = forceToAdd->size() - 1;
+    const rvec *fAdd = as_rvec_array(forceToAdd->data());
 
-    if (gmx_debug_at)
-    {
-        pr_rvecs(debug, 0, "fsr", f+start, end-start);
-        pr_rvecs(debug, 0, "flr", flr+start, end-start);
-    }
     // cppcheck-suppress unreadVariable
     int gmx_unused nt = gmx_omp_nthreads_get(emntDefault);
 #pragma omp parallel for num_threads(nt) schedule(static)
-    for (i = start; i < end; i++)
+    for (int i = 0; i < end; i++)
     {
-        rvec_inc(f[i], flr[i]);
-    }
-}
-
-/*
- * calc_f_el calculates forces due to an electric field.
- *
- * force is kJ mol^-1 nm^-1 = e * kJ mol^-1 nm^-1 / e
- *
- * Et[] contains the parameters for the time dependent
- * part of the field.
- * Ex[] contains the parameters for
- * the spatial dependent part of the field.
- * The function should return the energy due to the electric field
- * (if any) but for now returns 0.
- *
- * WARNING:
- * There can be problems with the virial.
- * Since the field is not self-consistent this is unavoidable.
- * For neutral molecules the virial is correct within this approximation.
- * For neutral systems with many charged molecules the error is small.
- * But for systems with a net charge or a few charged molecules
- * the error can be significant when the field is high.
- * Solution: implement a self-consistent electric field into PME.
- */
-static void calc_f_el(FILE *fp, int  start, int homenr,
-                      real charge[], rvec f[],
-                      t_cosines Ex[], t_cosines Et[], double t)
-{
-    rvec Ext;
-    real t0;
-    int  i, m;
-
-    for (m = 0; (m < DIM); m++)
-    {
-        if (Et[m].n > 0)
-        {
-            if (Et[m].n == 3)
-            {
-                t0     = Et[m].a[1];
-                Ext[m] = std::cos(Et[m].a[0]*(t-t0))*std::exp(-gmx::square(t-t0)/(2.0*gmx::square(Et[m].a[2])));
-            }
-            else
-            {
-                Ext[m] = std::cos(Et[m].a[0]*t);
-            }
-        }
-        else
-        {
-            Ext[m] = 1.0;
-        }
-        if (Ex[m].n > 0)
-        {
-            /* Convert the field strength from V/nm to MD-units */
-            Ext[m] *= Ex[m].a[0]*FIELDFAC;
-            for (i = start; (i < start+homenr); i++)
-            {
-                f[i][m] += charge[i]*Ext[m];
-            }
-        }
-        else
-        {
-            Ext[m] = 0;
-        }
-    }
-    if (fp != NULL)
-    {
-        fprintf(fp, "%10g  %10g  %10g  %10g #FIELD\n", t,
-                Ext[XX]/FIELDFAC, Ext[YY]/FIELDFAC, Ext[ZZ]/FIELDFAC);
+        rvec_inc(f[i], fAdd[i]);
     }
 }
 
@@ -371,7 +305,7 @@ static void pme_receive_force_ener(t_commrec      *cr,
     wallcycle_start(wcycle, ewcPP_PMEWAITRECVF);
     dvdl_q  = 0;
     dvdl_lj = 0;
-    gmx_pme_receive_f(cr, fr->f_novirsum, fr->vir_el_recip, &e_q,
+    gmx_pme_receive_f(cr, as_rvec_array(fr->f_novirsum->data()), fr->vir_el_recip, &e_q,
                       fr->vir_lj_recip, &e_lj, &dvdl_q, &dvdl_lj,
                       &cycles_seppme);
     enerd->term[F_COUL_RECIP] += e_q;
@@ -387,24 +321,34 @@ static void pme_receive_force_ener(t_commrec      *cr,
 }
 
 static void print_large_forces(FILE *fp, t_mdatoms *md, t_commrec *cr,
-                               gmx_int64_t step, real pforce, rvec *x, rvec *f)
+                               gmx_int64_t step, real forceTolerance,
+                               const rvec *x, const rvec *f)
 {
-    int  i;
-    real pf2, fn2;
-    char buf[STEPSTRSIZE];
-
-    pf2 = gmx::square(pforce);
-    for (i = 0; i < md->homenr; i++)
+    real           force2Tolerance = gmx::square(forceTolerance);
+    std::uintmax_t numNonFinite    = 0;
+    for (int i = 0; i < md->homenr; i++)
     {
-        fn2 = norm2(f[i]);
-        /* We also catch NAN, if the compiler does not optimize this away. */
-        if (fn2 >= pf2 || fn2 != fn2)
+        real force2    = norm2(f[i]);
+        bool nonFinite = !std::isfinite(force2);
+        if (force2 >= force2Tolerance || nonFinite)
+        {
+            fprintf(fp, "step %" GMX_PRId64 " atom %6d  x %8.3f %8.3f %8.3f  force %12.5e\n",
+                    step,
+                    ddglatnr(cr->dd, i), x[i][XX], x[i][YY], x[i][ZZ], std::sqrt(force2));
+        }
+        if (nonFinite)
         {
-            fprintf(fp, "step %s  atom %6d  x %8.3f %8.3f %8.3f  force %12.5e\n",
-                    gmx_step_str(step, buf),
-                    ddglatnr(cr->dd, i), x[i][XX], x[i][YY], x[i][ZZ], std::sqrt(fn2));
+            numNonFinite++;
         }
     }
+    if (numNonFinite > 0)
+    {
+        /* Note that with MPI this fatal call on one rank might interrupt
+         * the printing on other ranks. But we can only avoid that with
+         * an expensive MPI barrier that we would need at each step.
+         */
+        gmx_fatal(FARGS, "At step %" GMX_PRId64 " detected non-finite forces on %ju atoms", step, numNonFinite);
+    }
 }
 
 static void post_process_forces(t_commrec *cr,
@@ -428,7 +372,7 @@ static void post_process_forces(t_commrec *cr,
              * if the constructing atoms aren't local.
              */
             wallcycle_start(wcycle, ewcVSITESPREAD);
-            spread_vsite_f(vsite, x, fr->f_novirsum, NULL,
+            spread_vsite_f(vsite, x, as_rvec_array(fr->f_novirsum->data()), nullptr,
                            (flags & GMX_FORCE_VIRIAL), fr->vir_el_recip,
                            nrnb,
                            &top->idef, fr->ePBC, fr->bMolPBC, graph, box, cr);
@@ -437,15 +381,8 @@ static void post_process_forces(t_commrec *cr,
         if (flags & GMX_FORCE_VIRIAL)
         {
             /* Now add the forces, this is local */
-            if (fr->bDomDec)
-            {
-                sum_forces(0, fr->f_novirsum_n, f, fr->f_novirsum);
-            }
-            else
-            {
-                sum_forces(0, mdatoms->homenr,
-                           f, fr->f_novirsum);
-            }
+            sum_forces(f, fr->f_novirsum);
+
             if (EEL_FULL(fr->eeltype))
             {
                 /* Add the mesh contribution to the virial */
@@ -474,20 +411,18 @@ static void do_nb_verlet(t_forcerec *fr,
                          gmx_enerdata_t *enerd,
                          int flags, int ilocality,
                          int clearF,
+                         gmx_int64_t step,
                          t_nrnb *nrnb,
                          gmx_wallcycle_t wcycle)
 {
-    int                        enr_nbnxn_kernel_ljc, enr_nbnxn_kernel_lj;
-    nonbonded_verlet_group_t  *nbvg;
-    gmx_bool                   bUsingGpuKernels;
-
     if (!(flags & GMX_FORCE_NONBONDED))
     {
         /* skip non-bonded calculation */
         return;
     }
 
-    nbvg = &fr->nbv->grp[ilocality];
+    nonbonded_verlet_t       *nbv  = fr->nbv;
+    nonbonded_verlet_group_t *nbvg = &nbv->grp[ilocality];
 
     /* GPU kernel launch overhead is already timed separately */
     if (fr->cutoff_scheme != ecutsVERLET)
@@ -495,17 +430,34 @@ static void do_nb_verlet(t_forcerec *fr,
         gmx_incons("Invalid cut-off scheme passed!");
     }
 
-    bUsingGpuKernels = (nbvg->kernel_type == nbnxnk8x8x8_GPU);
+    bool bUsingGpuKernels = (nbvg->kernel_type == nbnxnk8x8x8_GPU);
 
     if (!bUsingGpuKernels)
     {
+        /* When dynamic pair-list  pruning is requested, we need to prune
+         * at nstlistPrune steps.
+         */
+        if (nbv->listParams->useDynamicPruning &&
+            (step - nbvg->nbl_lists.outerListCreationStep) % nbv->listParams->nstlistPrune == 0)
+        {
+            /* Prune the pair-list beyond fr->ic->rlistPrune using
+             * the current coordinates of the atoms.
+             */
+            wallcycle_sub_start(wcycle, ewcsNONBONDED_PRUNING);
+            nbnxn_kernel_cpu_prune(nbvg, fr->shift_vec, nbv->listParams->rlistInner);
+            wallcycle_sub_stop(wcycle, ewcsNONBONDED_PRUNING);
+        }
+
         wallcycle_sub_start(wcycle, ewcsNONBONDED);
     }
+
     switch (nbvg->kernel_type)
     {
         case nbnxnk4x4_PlainC:
-            nbnxn_kernel_ref(&nbvg->nbl_lists,
-                             nbvg->nbat, ic,
+        case nbnxnk4xN_SIMD_4xN:
+        case nbnxnk4xN_SIMD_2xNN:
+            nbnxn_kernel_cpu(nbvg,
+                             ic,
                              fr->shift_vec,
                              flags,
                              clearF,
@@ -516,35 +468,8 @@ static void do_nb_verlet(t_forcerec *fr,
                              enerd->grpp.ener[egLJSR]);
             break;
 
-        case nbnxnk4xN_SIMD_4xN:
-            nbnxn_kernel_simd_4xn(&nbvg->nbl_lists,
-                                  nbvg->nbat, ic,
-                                  nbvg->ewald_excl,
-                                  fr->shift_vec,
-                                  flags,
-                                  clearF,
-                                  fr->fshift[0],
-                                  enerd->grpp.ener[egCOULSR],
-                                  fr->bBHAM ?
-                                  enerd->grpp.ener[egBHAMSR] :
-                                  enerd->grpp.ener[egLJSR]);
-            break;
-        case nbnxnk4xN_SIMD_2xNN:
-            nbnxn_kernel_simd_2xnn(&nbvg->nbl_lists,
-                                   nbvg->nbat, ic,
-                                   nbvg->ewald_excl,
-                                   fr->shift_vec,
-                                   flags,
-                                   clearF,
-                                   fr->fshift[0],
-                                   enerd->grpp.ener[egCOULSR],
-                                   fr->bBHAM ?
-                                   enerd->grpp.ener[egBHAMSR] :
-                                   enerd->grpp.ener[egLJSR]);
-            break;
-
         case nbnxnk8x8x8_GPU:
-            nbnxn_gpu_launch_kernel(fr->nbv->gpu_nbv, nbvg->nbat, flags, ilocality);
+            nbnxn_gpu_launch_kernel(nbv->gpu_nbv, nbvg->nbat, flags, ilocality);
             break;
 
         case nbnxnk8x8x8_PlainC:
@@ -562,7 +487,7 @@ static void do_nb_verlet(t_forcerec *fr,
             break;
 
         default:
-            gmx_incons("Invalid nonbonded kernel type passed!");
+            GMX_RELEASE_ASSERT(false, "Invalid nonbonded kernel type passed!");
 
     }
     if (!bUsingGpuKernels)
@@ -570,12 +495,13 @@ static void do_nb_verlet(t_forcerec *fr,
         wallcycle_sub_stop(wcycle, ewcsNONBONDED);
     }
 
+    int enr_nbnxn_kernel_ljc, enr_nbnxn_kernel_lj;
     if (EEL_RF(ic->eeltype) || ic->eeltype == eelCUT)
     {
         enr_nbnxn_kernel_ljc = eNR_NBNXN_LJ_RF;
     }
     else if ((!bUsingGpuKernels && nbvg->ewald_excl == ewaldexclAnalytical) ||
-             (bUsingGpuKernels && nbnxn_gpu_is_kernel_ewald_analytical(fr->nbv->gpu_nbv)))
+             (bUsingGpuKernels && nbnxn_gpu_is_kernel_ewald_analytical(nbv->gpu_nbv)))
     {
         enr_nbnxn_kernel_ljc = eNR_NBNXN_LJ_EWALD;
     }
@@ -733,7 +659,7 @@ static void do_nb_verlet_fep(nbnxn_pairlist_set_t *nbl_lists,
 
 gmx_bool use_GPU(const nonbonded_verlet_t *nbv)
 {
-    return nbv != NULL && nbv->bUseGPU;
+    return nbv != nullptr && nbv->bUseGPU;
 }
 
 static gmx_inline void clear_rvecs_omp(int n, rvec v[])
@@ -781,43 +707,56 @@ static void checkPotentialEnergyValidity(const gmx_enerdata_t *enerd)
     }
 }
 
-void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
-                         t_inputrec *inputrec,
-                         gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle,
-                         gmx_localtop_t *top,
-                         gmx_groups_t gmx_unused *groups,
-                         matrix box, rvec x[], history_t *hist,
-                         rvec f[],
-                         tensor vir_force,
-                         t_mdatoms *mdatoms,
-                         gmx_enerdata_t *enerd, t_fcdata *fcd,
-                         real *lambda, t_graph *graph,
-                         t_forcerec *fr, interaction_const_t *ic,
-                         gmx_vsite_t *vsite, rvec mu_tot,
-                         double t, FILE *field, gmx_edsam_t ed,
-                         gmx_bool bBornRadii,
-                         int flags)
+static void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
+                                t_inputrec *inputrec,
+                                gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle,
+                                gmx_localtop_t *top,
+                                gmx_groups_t gmx_unused *groups,
+                                matrix box, rvec x[], history_t *hist,
+                                PaddedRVecVector *force,
+                                tensor vir_force,
+                                t_mdatoms *mdatoms,
+                                gmx_enerdata_t *enerd, t_fcdata *fcd,
+                                real *lambda, t_graph *graph,
+                                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)
 {
     int                 cg1, i, j;
-    int                 start, homenr;
     double              mu[2*DIM];
     gmx_bool            bStateChanged, bNS, bFillGrid, bCalcCGCM;
     gmx_bool            bDoForces, bUseGPU, bUseOrEmulGPU;
     gmx_bool            bDiffKernels = FALSE;
     rvec                vzero, box_diag;
-    float               cycles_pme, cycles_force, cycles_wait_gpu;
-    /* TODO To avoid loss of precision, float can't be used for a
-     * cycle count. Build an object that can do this right and perhaps
-     * also be used by gmx_wallcycle_t */
-    gmx_cycles_t        cycleCountBeforeLocalWorkCompletes = 0;
-    nonbonded_verlet_t *nbv;
-
-    cycles_force    = 0;
+    float               cycles_pme, cycles_wait_gpu;
+    nonbonded_verlet_t *nbv = fr->nbv;
+
+    bStateChanged = (flags & GMX_FORCE_STATECHANGED);
+    bNS           = (flags & GMX_FORCE_NS) && (fr->bAllvsAll == FALSE);
+    bFillGrid     = (bNS && bStateChanged);
+    bCalcCGCM     = (bFillGrid && !DOMAINDECOMP(cr));
+    bDoForces     = (flags & GMX_FORCE_FORCES);
+    bUseGPU       = fr->nbv->bUseGPU;
+    bUseOrEmulGPU = bUseGPU || (fr->nbv->emulateGpu == EmulateGpuNonbonded::Yes);
+
+    /* At a search step we need to start the first balancing region
+     * somewhere early inside the step after communication during domain
+     * decomposition (and not during the previous step as usual).
+     */
+    if (bNS &&
+        ddOpenBalanceRegion == DdOpenBalanceRegionBeforeForceComputation::yes)
+    {
+        ddOpenBalanceRegionCpu(cr->dd, DdAllowBalanceRegionReopen::yes);
+    }
+
     cycles_wait_gpu = 0;
-    nbv             = fr->nbv;
 
-    start  = 0;
-    homenr = mdatoms->homenr;
+    const int start  = 0;
+    const int homenr = mdatoms->homenr;
 
     clear_mat(vir_force);
 
@@ -834,14 +773,6 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
         cg1--;
     }
 
-    bStateChanged = (flags & GMX_FORCE_STATECHANGED);
-    bNS           = (flags & GMX_FORCE_NS) && (fr->bAllvsAll == FALSE);
-    bFillGrid     = (bNS && bStateChanged);
-    bCalcCGCM     = (bFillGrid && !DOMAINDECOMP(cr));
-    bDoForces     = (flags & GMX_FORCE_FORCES);
-    bUseGPU       = fr->nbv->bUseGPU;
-    bUseOrEmulGPU = bUseGPU || (nbv->grp[0].kernel_type == nbnxnk8x8x8_PlainC);
-
     if (bStateChanged)
     {
         update_forcerec(fr, box);
@@ -893,8 +824,6 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
          * we do not need to worry about shifting.
          */
 
-        int pme_flags = 0;
-
         wallcycle_start(wcycle, ewcPP_PMESENDX);
 
         bBS = (inputrec->nwall == 2);
@@ -904,20 +833,10 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
             svmul(inputrec->wall_ewald_zfac, boxs[ZZ], boxs[ZZ]);
         }
 
-        if (EEL_PME(fr->eeltype))
-        {
-            pme_flags |= GMX_PME_DO_COULOMB;
-        }
-
-        if (EVDW_PME(fr->vdwtype))
-        {
-            pme_flags |= GMX_PME_DO_LJ;
-        }
-
         gmx_pme_send_coordinates(cr, bBS ? boxs : box, x,
-                                 mdatoms->nChargePerturbed, mdatoms->nTypePerturbed, lambda[efptCOUL], lambda[efptVDW],
+                                 lambda[efptCOUL], lambda[efptVDW],
                                  (flags & (GMX_FORCE_VIRIAL | GMX_FORCE_ENERGY)),
-                                 pme_flags, step);
+                                 step);
 
         wallcycle_stop(wcycle, ewcPP_PMESENDX);
     }
@@ -944,7 +863,7 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
             nbnxn_put_on_grid(nbv->nbs, fr->ePBC, box,
                               0, vzero, box_diag,
                               0, mdatoms->homenr, -1, fr->cginfo, x,
-                              0, NULL,
+                              0, nullptr,
                               nbv->grp[eintLocal].kernel_type,
                               nbv->grp[eintLocal].nbat);
             wallcycle_sub_stop(wcycle, ewcsNBS_GRID_LOCAL);
@@ -997,12 +916,17 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
         wallcycle_sub_start(wcycle, ewcsNBS_SEARCH_LOCAL);
         nbnxn_make_pairlist(nbv->nbs, nbv->grp[eintLocal].nbat,
                             &top->excls,
-                            ic->rlist,
+                            nbv->listParams->rlistOuter,
                             nbv->min_ci_balanced,
                             &nbv->grp[eintLocal].nbl_lists,
                             eintLocal,
                             nbv->grp[eintLocal].kernel_type,
                             nrnb);
+        nbv->grp[eintLocal].nbl_lists.outerListCreationStep = step;
+        if (nbv->listParams->useDynamicPruning && !bUseGPU)
+        {
+            nbnxnPrepareListForDynamicPruning(&nbv->grp[eintLocal].nbl_lists);
+        }
         wallcycle_sub_stop(wcycle, ewcsNBS_SEARCH_LOCAL);
 
         if (bUseGPU)
@@ -1026,10 +950,15 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
 
     if (bUseGPU)
     {
+        if (DOMAINDECOMP(cr))
+        {
+            ddOpenBalanceRegionGpu(cr->dd);
+        }
+
         wallcycle_start(wcycle, ewcLAUNCH_GPU_NB);
         /* launch local nonbonded F on GPU */
         do_nb_verlet(fr, ic, enerd, flags, eintLocal, enbvClearFNo,
-                     nrnb, wcycle);
+                     step, nrnb, wcycle);
         wallcycle_stop(wcycle, ewcLAUNCH_GPU_NB);
     }
 
@@ -1067,13 +996,17 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
 
             nbnxn_make_pairlist(nbv->nbs, nbv->grp[eintNonlocal].nbat,
                                 &top->excls,
-                                ic->rlist,
+                                nbv->listParams->rlistOuter,
                                 nbv->min_ci_balanced,
                                 &nbv->grp[eintNonlocal].nbl_lists,
                                 eintNonlocal,
                                 nbv->grp[eintNonlocal].kernel_type,
                                 nrnb);
-
+            nbv->grp[eintNonlocal].nbl_lists.outerListCreationStep = step;
+            if (nbv->listParams->useDynamicPruning && !bUseGPU)
+            {
+                nbnxnPrepareListForDynamicPruning(&nbv->grp[eintNonlocal].nbl_lists);
+            }
             wallcycle_sub_stop(wcycle, ewcsNBS_SEARCH_NONLOCAL);
 
             if (nbv->grp[eintNonlocal].kernel_type == nbnxnk8x8x8_GPU)
@@ -1096,7 +1029,7 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
             nbnxn_atomdata_copy_x_to_nbat_x(nbv->nbs, eatNonlocal, FALSE, x,
                                             nbv->grp[eintNonlocal].nbat);
             wallcycle_sub_stop(wcycle, ewcsNB_X_BUF_OPS);
-            cycles_force += wallcycle_stop(wcycle, ewcNB_XF_BUF_OPS);
+            wallcycle_stop(wcycle, ewcNB_XF_BUF_OPS);
         }
 
         if (bUseGPU && !bDiffKernels)
@@ -1104,8 +1037,8 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
             wallcycle_start(wcycle, ewcLAUNCH_GPU_NB);
             /* launch non-local nonbonded F on GPU */
             do_nb_verlet(fr, ic, enerd, flags, eintNonlocal, enbvClearFNo,
-                         nrnb, wcycle);
-            cycles_force += wallcycle_stop(wcycle, ewcLAUNCH_GPU_NB);
+                         step, nrnb, wcycle);
+            wallcycle_stop(wcycle, ewcLAUNCH_GPU_NB);
         }
     }
 
@@ -1120,7 +1053,7 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
         }
         nbnxn_gpu_launch_cpyback(nbv->gpu_nbv, nbv->grp[eintLocal].nbat,
                                  flags, eatLocal);
-        cycles_force += wallcycle_stop(wcycle, ewcLAUNCH_GPU_NB);
+        wallcycle_stop(wcycle, ewcLAUNCH_GPU_NB);
     }
 
     if (bStateChanged && inputrecNeedMutot(inputrec))
@@ -1128,6 +1061,7 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
         if (PAR(cr))
         {
             gmx_sumd(2*DIM, mu, cr);
+            ddReopenBalanceRegionCpu(cr->dd);
         }
 
         for (i = 0; i < 2; i++)
@@ -1164,18 +1098,16 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
 
     if (inputrec->bRot)
     {
-        /* Enforced rotation has its own cycle counter that starts after the collective
-         * coordinates have been communicated. It is added to ddCyclF to allow
-         * for proper load-balancing */
         wallcycle_start(wcycle, ewcROT);
-        do_rotation(cr, inputrec, box, x, t, step, wcycle, bNS);
+        do_rotation(cr, inputrec, box, x, t, step, bNS);
         wallcycle_stop(wcycle, ewcROT);
     }
 
+    /* Temporary solution until all routines take PaddedRVecVector */
+    rvec *f = as_rvec_array(force->data());
+
     /* Start the force cycle counter.
-     * This counter is stopped after do_force_lowlevel.
-     * No parallel communication should occur while this counter is running,
-     * since that will interfere with the dynamic load balancing.
+     * Note that a different counter is used for dynamic load balancing.
      */
     wallcycle_start(wcycle, ewcFORCE);
     if (bDoForces)
@@ -1186,7 +1118,7 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
         {
             if (flags & GMX_FORCE_VIRIAL)
             {
-                fr->f_novirsum = fr->f_novirsum_alloc;
+                fr->f_novirsum = fr->forceBufferNoVirialSummation;
             }
             else
             {
@@ -1194,7 +1126,7 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
                  * a separate array for forces that do not contribute
                  * to the pressure.
                  */
-                fr->f_novirsum = f;
+                fr->f_novirsum = force;
             }
         }
 
@@ -1202,14 +1134,9 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
         {
             if (flags & GMX_FORCE_VIRIAL)
             {
-                if (fr->bDomDec)
-                {
-                    clear_rvecs_omp(fr->f_novirsum_n, fr->f_novirsum);
-                }
-                else
-                {
-                    clear_rvecs_omp(homenr, fr->f_novirsum+start);
-                }
+                /* TODO: remove this - 1 when padding is properly implemented */
+                clear_rvecs_omp(fr->f_novirsum->size() - 1,
+                                as_rvec_array(fr->f_novirsum->data()));
             }
         }
         /* Clear the short- and long-range forces */
@@ -1233,9 +1160,8 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
 
     if (!bUseOrEmulGPU)
     {
-        /* Maybe we should move this into do_force_lowlevel */
         do_nb_verlet(fr, ic, enerd, flags, eintLocal, enbvClearFYes,
-                     nrnb, wcycle);
+                     step, nrnb, wcycle);
     }
 
     if (fr->efep != efepNO)
@@ -1269,7 +1195,7 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
         {
             do_nb_verlet(fr, ic, enerd, flags, eintNonlocal,
                          bDiffKernels ? enbvClearFYes : enbvClearFNo,
-                         nrnb, wcycle);
+                         step, nrnb, wcycle);
         }
 
         if (!bUseOrEmulGPU)
@@ -1285,12 +1211,12 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
          * This can be split into a local and a non-local part when overlapping
          * communication with calculation with domain decomposition.
          */
-        cycles_force += wallcycle_stop(wcycle, ewcFORCE);
+        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->grp[aloc].nbat, f);
         wallcycle_sub_stop(wcycle, ewcsNB_F_BUF_OPS);
-        cycles_force += wallcycle_stop(wcycle, ewcNB_XF_BUF_OPS);
+        wallcycle_stop(wcycle, ewcNB_XF_BUF_OPS);
         wallcycle_start_nocount(wcycle, ewcFORCE);
 
         /* if there are multiple fshift output buffers reduce them */
@@ -1318,7 +1244,7 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
                       inputrec->fepvals, lambda, graph, &(top->excls), fr->mu_tot,
                       flags, &cycles_pme);
 
-    cycles_force += wallcycle_stop(wcycle, ewcFORCE);
+    wallcycle_stop(wcycle, ewcFORCE);
 
     if (ed)
     {
@@ -1332,23 +1258,19 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
         {
             if (bUseGPU)
             {
-                float cycles_tmp;
-
                 wallcycle_start(wcycle, ewcWAIT_GPU_NB_NL);
                 nbnxn_gpu_wait_for_gpu(nbv->gpu_nbv,
                                        flags, eatNonlocal,
                                        enerd->grpp.ener[egLJSR], enerd->grpp.ener[egCOULSR],
                                        fr->fshift);
-                cycles_tmp       = wallcycle_stop(wcycle, ewcWAIT_GPU_NB_NL);
-                cycles_wait_gpu += cycles_tmp;
-                cycles_force    += cycles_tmp;
+                cycles_wait_gpu += wallcycle_stop(wcycle, ewcWAIT_GPU_NB_NL);
             }
             else
             {
                 wallcycle_start_nocount(wcycle, ewcFORCE);
                 do_nb_verlet(fr, ic, enerd, flags, eintNonlocal, enbvClearFYes,
-                             nrnb, wcycle);
-                cycles_force += wallcycle_stop(wcycle, ewcFORCE);
+                             step, nrnb, wcycle);
+                wallcycle_stop(wcycle, ewcFORCE);
             }
             wallcycle_start(wcycle, ewcNB_XF_BUF_OPS);
             wallcycle_sub_start(wcycle, ewcsNB_F_BUF_OPS);
@@ -1359,26 +1281,27 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
                                                nbv->grp[eintNonlocal].nbat, f);
             }
             wallcycle_sub_stop(wcycle, ewcsNB_F_BUF_OPS);
-            cycles_force += wallcycle_stop(wcycle, ewcNB_XF_BUF_OPS);
+            wallcycle_stop(wcycle, ewcNB_XF_BUF_OPS);
         }
     }
 
-    if (bDoForces && DOMAINDECOMP(cr))
+    if (DOMAINDECOMP(cr))
     {
-        if (bUseGPU)
+        /* We are done with the CPU compute.
+         * We will now communicate the non-local forces.
+         * If we use a GPU this will overlap with GPU work, so in that case
+         * we do not close the DD force balancing region here.
+         */
+        if (ddCloseBalanceRegion == DdCloseBalanceRegionAfterForceComputation::yes)
         {
-            /* We are done with the CPU compute, but the GPU local non-bonded
-             * kernel can still be running while we communicate the forces.
-             * We start a counter here, so we can, hopefully, time the rest
-             * of the GPU kernel execution and data transfer.
-             */
-            cycleCountBeforeLocalWorkCompletes = gmx_cycles_read();
+            ddCloseBalanceRegionCpu(cr->dd);
+        }
+        if (bDoForces)
+        {
+            wallcycle_start(wcycle, ewcMOVEF);
+            dd_move_f(cr->dd, f, fr->fshift);
+            wallcycle_stop(wcycle, ewcMOVEF);
         }
-
-        /* Communicate the forces */
-        wallcycle_start(wcycle, ewcMOVEF);
-        dd_move_f(cr->dd, f, fr->fshift);
-        wallcycle_stop(wcycle, ewcMOVEF);
     }
 
     if (bUseOrEmulGPU)
@@ -1386,7 +1309,6 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
         /* wait for local forces (or calculate in emulation mode) */
         if (bUseGPU)
         {
-            float       cycles_tmp, cycles_wait_est;
             /* Measured overhead on CUDA and OpenCL with(out) GPU sharing
              * is between 0.5 and 1.5 Mcycles. So 2 MCycles is an overestimate,
              * but even with a step of 0.1 ms the difference is less than 1%
@@ -1399,39 +1321,50 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
                                    flags, eatLocal,
                                    enerd->grpp.ener[egLJSR], enerd->grpp.ener[egCOULSR],
                                    fr->fshift);
-            cycles_tmp      = wallcycle_stop(wcycle, ewcWAIT_GPU_NB_L);
+            float cycles_tmp = wallcycle_stop(wcycle, ewcWAIT_GPU_NB_L);
 
-            if (bDoForces && DOMAINDECOMP(cr))
+            if (ddCloseBalanceRegion == DdCloseBalanceRegionAfterForceComputation::yes)
             {
-                cycles_wait_est = gmx_cycles_read() - cycleCountBeforeLocalWorkCompletes;
-
-                if (cycles_tmp < gpuWaitApiOverheadMargin)
+                DdBalanceRegionWaitedForGpu waitedForGpu = DdBalanceRegionWaitedForGpu::yes;
+                if (bDoForces && cycles_tmp <= gpuWaitApiOverheadMargin)
                 {
                     /* We measured few cycles, it could be that the kernel
                      * and transfer finished earlier and there was no actual
                      * wait time, only API call overhead.
                      * Then the actual time could be anywhere between 0 and
-                     * cycles_wait_est. As a compromise, we use half the time.
+                     * cycles_wait_est. We will use half of cycles_wait_est.
                      */
-                    cycles_wait_est *= 0.5f;
+                    waitedForGpu = DdBalanceRegionWaitedForGpu::no;
                 }
+                ddCloseBalanceRegionGpu(cr->dd, cycles_wait_gpu, waitedForGpu);
             }
-            else
-            {
-                /* No force communication so we actually timed the wait */
-                cycles_wait_est = cycles_tmp;
-            }
-            /* Even though this is after dd_move_f, the actual task we are
-             * waiting for runs asynchronously with dd_move_f and we usually
-             * have nothing to balance it with, so we can and should add
-             * the time to the force time for load balancing.
-             */
-            cycles_force    += cycles_wait_est;
-            cycles_wait_gpu += cycles_wait_est;
 
             /* now clear the GPU outputs while we finish the step on the CPU */
             wallcycle_start_nocount(wcycle, ewcLAUNCH_GPU_NB);
             nbnxn_gpu_clear_outputs(nbv->gpu_nbv, flags);
+
+            /* Is dynamic pair-list pruning activated? */
+            if (nbv->listParams->useDynamicPruning)
+            {
+                /* We should not launch the rolling pruning kernel at a search
+                 * step or just before search steps, since that's useless.
+                 * Without domain decomposition we prune at even steps.
+                 * With domain decomposition we alternate local and non-local
+                 * pruning at even and odd steps.
+                 */
+                int  numRollingParts     = nbv->listParams->numRollingParts;
+                GMX_ASSERT(numRollingParts == nbv->listParams->nstlistPrune/2, "Since we alternate local/non-local at even/odd steps, we need numRollingParts<=nstlistPrune/2 for correctness and == for efficiency");
+                int  stepWithCurrentList = step - nbv->grp[eintLocal].nbl_lists.outerListCreationStep;
+                bool stepIsEven          = ((stepWithCurrentList & 1) == 0);
+                if (stepWithCurrentList > 0 &&
+                    stepWithCurrentList < inputrec->nstlist - 1 &&
+                    (stepIsEven || DOMAINDECOMP(cr)))
+                {
+                    nbnxn_gpu_launch_kernel_pruneonly(fr->nbv->gpu_nbv,
+                                                      stepIsEven ? eintLocal : eintNonlocal,
+                                                      numRollingParts);
+                }
+            }
             wallcycle_stop(wcycle, ewcLAUNCH_GPU_NB);
         }
         else
@@ -1439,7 +1372,7 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
             wallcycle_start_nocount(wcycle, ewcFORCE);
             do_nb_verlet(fr, ic, enerd, flags, eintLocal,
                          DOMAINDECOMP(cr) ? enbvClearFNo : enbvClearFYes,
-                         nrnb, wcycle);
+                         step, nrnb, wcycle);
             wallcycle_stop(wcycle, ewcFORCE);
         }
         wallcycle_start(wcycle, ewcNB_XF_BUF_OPS);
@@ -1453,25 +1386,17 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
     if (DOMAINDECOMP(cr))
     {
         dd_force_flop_stop(cr->dd, nrnb);
-        if (wcycle)
-        {
-            dd_cycles_add(cr->dd, cycles_force-cycles_pme, ddCyclF);
-            if (bUseGPU)
-            {
-                dd_cycles_add(cr->dd, cycles_wait_gpu, ddCyclWaitGPU);
-            }
-        }
     }
 
     if (bDoForces)
     {
-        if (inputrecElecField(inputrec))
+        /* Collect forces from modules */
+        gmx::ArrayRef<gmx::RVec> fNoVirSum;
+        if (fr->bF_NoVirSum)
         {
-            /* Compute forces due to electric field */
-            calc_f_el(MASTER(cr) ? field : NULL,
-                      start, homenr, mdatoms->chargeA, fr->f_novirsum,
-                      inputrec->ex, inputrec->et, t);
+            fNoVirSum = *fr->f_novirsum;
         }
+        fr->forceProviders->calculateForces(cr, mdatoms, box, t, x, *force, fNoVirSum);
 
         /* If we have NoVirSum forces, but we do not calculate the virial,
          * we sum fr->f_novirsum=f later.
@@ -1479,7 +1404,7 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
         if (vsite && !(fr->bF_NoVirSum && !(flags & GMX_FORCE_VIRIAL)))
         {
             wallcycle_start(wcycle, ewcVSITESPREAD);
-            spread_vsite_f(vsite, x, f, fr->fshift, FALSE, NULL, nrnb,
+            spread_vsite_f(vsite, x, f, fr->fshift, FALSE, nullptr, nrnb,
                            &top->idef, fr->ePBC, fr->bMolPBC, graph, box, cr);
             wallcycle_stop(wcycle, ewcVSITESPREAD);
         }
@@ -1540,31 +1465,32 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
     }
 }
 
-void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
-                        t_inputrec *inputrec,
-                        gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle,
-                        gmx_localtop_t *top,
-                        gmx_groups_t *groups,
-                        matrix box, rvec x[], history_t *hist,
-                        rvec f[],
-                        tensor vir_force,
-                        t_mdatoms *mdatoms,
-                        gmx_enerdata_t *enerd, t_fcdata *fcd,
-                        real *lambda, t_graph *graph,
-                        t_forcerec *fr, gmx_vsite_t *vsite, rvec mu_tot,
-                        double t, FILE *field, gmx_edsam_t ed,
-                        gmx_bool bBornRadii,
-                        int flags)
+static void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
+                               t_inputrec *inputrec,
+                               gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle,
+                               gmx_localtop_t *top,
+                               gmx_groups_t *groups,
+                               matrix box, rvec x[], history_t *hist,
+                               PaddedRVecVector *force,
+                               tensor vir_force,
+                               t_mdatoms *mdatoms,
+                               gmx_enerdata_t *enerd, t_fcdata *fcd,
+                               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)
 {
     int        cg0, cg1, i, j;
-    int        start, homenr;
     double     mu[2*DIM];
     gmx_bool   bStateChanged, bNS, bFillGrid, bCalcCGCM;
     gmx_bool   bDoForces;
-    float      cycles_pme, cycles_force;
+    float      cycles_pme;
 
-    start  = 0;
-    homenr = mdatoms->homenr;
+    const int  start  = 0;
+    const int  homenr = mdatoms->homenr;
 
     clear_mat(vir_force);
 
@@ -1649,8 +1575,6 @@ void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
          * we do not need to worry about shifting.
          */
 
-        int pme_flags = 0;
-
         wallcycle_start(wcycle, ewcPP_PMESENDX);
 
         bBS = (inputrec->nwall == 2);
@@ -1660,20 +1584,10 @@ void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
             svmul(inputrec->wall_ewald_zfac, boxs[ZZ], boxs[ZZ]);
         }
 
-        if (EEL_PME(fr->eeltype))
-        {
-            pme_flags |= GMX_PME_DO_COULOMB;
-        }
-
-        if (EVDW_PME(fr->vdwtype))
-        {
-            pme_flags |= GMX_PME_DO_LJ;
-        }
-
         gmx_pme_send_coordinates(cr, bBS ? boxs : box, x,
-                                 mdatoms->nChargePerturbed, mdatoms->nTypePerturbed, lambda[efptCOUL], lambda[efptVDW],
+                                 lambda[efptCOUL], lambda[efptVDW],
                                  (flags & (GMX_FORCE_VIRIAL | GMX_FORCE_ENERGY)),
-                                 pme_flags, step);
+                                 step);
 
         wallcycle_stop(wcycle, ewcPP_PMESENDX);
     }
@@ -1685,6 +1599,11 @@ void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
         wallcycle_start(wcycle, ewcMOVEX);
         dd_move_x(cr->dd, box, x);
         wallcycle_stop(wcycle, ewcMOVEX);
+        /* No GPU support, no move_x overlap, so reopen the balance region here */
+        if (ddOpenBalanceRegion == DdOpenBalanceRegionBeforeForceComputation::yes)
+        {
+            ddReopenBalanceRegionCpu(cr->dd);
+        }
     }
 
     if (inputrecNeedMutot(inputrec))
@@ -1694,6 +1613,7 @@ void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
             if (PAR(cr))
             {
                 gmx_sumd(2*DIM, mu, cr);
+                ddReopenBalanceRegionCpu(cr->dd);
             }
             for (i = 0; i < 2; i++)
             {
@@ -1753,18 +1673,16 @@ void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
 
     if (inputrec->bRot)
     {
-        /* Enforced rotation has its own cycle counter that starts after the collective
-         * coordinates have been communicated. It is added to ddCyclF to allow
-         * for proper load-balancing */
         wallcycle_start(wcycle, ewcROT);
-        do_rotation(cr, inputrec, box, x, t, step, wcycle, bNS);
+        do_rotation(cr, inputrec, box, x, t, step, bNS);
         wallcycle_stop(wcycle, ewcROT);
     }
 
+    /* Temporary solution until all routines take PaddedRVecVector */
+    rvec *f = as_rvec_array(force->data());
+
     /* Start the force cycle counter.
-     * This counter is stopped after do_force_lowlevel.
-     * No parallel communication should occur while this counter is running,
-     * since that will interfere with the dynamic load balancing.
+     * Note that a different counter is used for dynamic load balancing.
      */
     wallcycle_start(wcycle, ewcFORCE);
 
@@ -1776,15 +1694,10 @@ void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
         {
             if (flags & GMX_FORCE_VIRIAL)
             {
-                fr->f_novirsum = fr->f_novirsum_alloc;
-                if (fr->bDomDec)
-                {
-                    clear_rvecs(fr->f_novirsum_n, fr->f_novirsum);
-                }
-                else
-                {
-                    clear_rvecs(homenr, fr->f_novirsum+start);
-                }
+                fr->f_novirsum = fr->forceBufferNoVirialSummation;
+                /* TODO: remove this - 1 when padding is properly implemented */
+                clear_rvecs(fr->f_novirsum->size() - 1,
+                            as_rvec_array(fr->f_novirsum->data()));
             }
             else
             {
@@ -1792,7 +1705,7 @@ void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
                  * a separate array for forces that do not contribute
                  * to the pressure.
                  */
-                fr->f_novirsum = f;
+                fr->f_novirsum = force;
             }
         }
 
@@ -1822,31 +1735,32 @@ void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
                       flags,
                       &cycles_pme);
 
-    cycles_force = wallcycle_stop(wcycle, ewcFORCE);
-
-    if (ed)
-    {
-        do_flood(cr, inputrec, x, f, ed, box, step, bNS);
-    }
+    wallcycle_stop(wcycle, ewcFORCE);
 
     if (DOMAINDECOMP(cr))
     {
         dd_force_flop_stop(cr->dd, nrnb);
-        if (wcycle)
+
+        if (ddCloseBalanceRegion == DdCloseBalanceRegionAfterForceComputation::yes)
         {
-            dd_cycles_add(cr->dd, cycles_force-cycles_pme, ddCyclF);
+            ddCloseBalanceRegionCpu(cr->dd);
         }
     }
 
+    if (ed)
+    {
+        do_flood(cr, inputrec, x, f, ed, box, step, bNS);
+    }
+
     if (bDoForces)
     {
-        if (inputrecElecField(inputrec))
+        /* Collect forces from modules */
+        gmx::ArrayRef<gmx::RVec> fNoVirSum;
+        if (fr->bF_NoVirSum)
         {
-            /* Compute forces due to electric field */
-            calc_f_el(MASTER(cr) ? field : NULL,
-                      start, homenr, mdatoms->chargeA, fr->f_novirsum,
-                      inputrec->ex, inputrec->et, t);
+            fNoVirSum = *fr->f_novirsum;
         }
+        fr->forceProviders->calculateForces(cr, mdatoms, box, t, x, *force, fNoVirSum);
 
         /* Communicate the forces */
         if (DOMAINDECOMP(cr))
@@ -1863,7 +1777,7 @@ void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
             if (EEL_FULL(fr->eeltype) && cr->dd->n_intercg_excl &&
                 (flags & GMX_FORCE_VIRIAL))
             {
-                dd_move_f(cr->dd, fr->f_novirsum, NULL);
+                dd_move_f(cr->dd, as_rvec_array(fr->f_novirsum->data()), nullptr);
             }
             wallcycle_stop(wcycle, ewcMOVEF);
         }
@@ -1874,7 +1788,7 @@ void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
         if (vsite && !(fr->bF_NoVirSum && !(flags & GMX_FORCE_VIRIAL)))
         {
             wallcycle_start(wcycle, ewcVSITESPREAD);
-            spread_vsite_f(vsite, x, f, fr->fshift, FALSE, NULL, nrnb,
+            spread_vsite_f(vsite, x, f, fr->fshift, FALSE, nullptr, nrnb,
                            &top->idef, fr->ePBC, fr->bMolPBC, graph, box, cr);
             wallcycle_stop(wcycle, ewcVSITESPREAD);
         }
@@ -1938,17 +1852,19 @@ void do_force(FILE *fplog, t_commrec *cr,
               gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle,
               gmx_localtop_t *top,
               gmx_groups_t *groups,
-              matrix box, rvec x[], history_t *hist,
-              rvec f[],
+              matrix box, PaddedRVecVector *coordinates, history_t *hist,
+              PaddedRVecVector *force,
               tensor vir_force,
               t_mdatoms *mdatoms,
               gmx_enerdata_t *enerd, t_fcdata *fcd,
-              real *lambda, t_graph *graph,
+              gmx::ArrayRef<real> lambda, t_graph *graph,
               t_forcerec *fr,
               gmx_vsite_t *vsite, rvec mu_tot,
-              double t, FILE *field, gmx_edsam_t ed,
+              double t, gmx_edsam_t ed,
               gmx_bool bBornRadii,
-              int flags)
+              int flags,
+              DdOpenBalanceRegionBeforeForceComputation ddOpenBalanceRegion,
+              DdCloseBalanceRegionAfterForceComputation ddCloseBalanceRegion)
 {
     /* modify force flag if not doing nonbonded */
     if (!fr->bNonbonded)
@@ -1956,6 +1872,13 @@ void do_force(FILE *fplog, t_commrec *cr,
         flags &= ~GMX_FORCE_NONBONDED;
     }
 
+    GMX_ASSERT(coordinates->size() >= static_cast<unsigned int>(fr->natoms_force + 1) ||
+               fr->natoms_force == 0, "We might need 1 element extra for SIMD");
+    GMX_ASSERT(force->size() >= static_cast<unsigned int>(fr->natoms_force + 1) ||
+               fr->natoms_force == 0, "We might need 1 element extra for SIMD");
+
+    rvec *x = as_rvec_array(coordinates->data());
+
     switch (inputrec->cutoff_scheme)
     {
         case ecutsVERLET:
@@ -1964,15 +1887,17 @@ void do_force(FILE *fplog, t_commrec *cr,
                                 top,
                                 groups,
                                 box, x, hist,
-                                f, vir_force,
+                                force, vir_force,
                                 mdatoms,
                                 enerd, fcd,
-                                lambda, graph,
+                                lambda.data(), graph,
                                 fr, fr->ic,
                                 vsite, mu_tot,
-                                t, field, ed,
+                                t, ed,
                                 bBornRadii,
-                                flags);
+                                flags,
+                                ddOpenBalanceRegion,
+                                ddCloseBalanceRegion);
             break;
         case ecutsGROUP:
             do_force_cutsGROUP(fplog, cr, inputrec,
@@ -1980,18 +1905,31 @@ void do_force(FILE *fplog, t_commrec *cr,
                                top,
                                groups,
                                box, x, hist,
-                               f, vir_force,
+                               force, vir_force,
                                mdatoms,
                                enerd, fcd,
-                               lambda, graph,
+                               lambda.data(), graph,
                                fr, vsite, mu_tot,
-                               t, field, ed,
+                               t, ed,
                                bBornRadii,
-                               flags);
+                               flags,
+                               ddOpenBalanceRegion,
+                               ddCloseBalanceRegion);
             break;
         default:
             gmx_incons("Invalid cut-off scheme passed!");
     }
+
+    /* In case we don't have constraints and are using GPUs, the next balancing
+     * region starts here.
+     * Some "special" work at the end of do_force_cuts?, such as vsite spread,
+     * virial calculation and COM pulling, is not thus not included in
+     * the balance timing, which is ok as most tasks do communication.
+     */
+    if (ddOpenBalanceRegion == DdOpenBalanceRegionBeforeForceComputation::yes)
+    {
+        ddOpenBalanceRegionCpu(cr->dd, DdAllowBalanceRegionReopen::no);
+    }
 }
 
 
@@ -2030,22 +1968,22 @@ void do_constrain_first(FILE *fplog, gmx_constr_t constr,
     dvdl_dum = 0;
 
     /* constrain the current position */
-    constrain(NULL, TRUE, FALSE, constr, &(top->idef),
+    constrain(nullptr, TRUE, FALSE, constr, &(top->idef),
               ir, cr, step, 0, 1.0, md,
-              state->x, state->x, NULL,
+              as_rvec_array(state->x.data()), as_rvec_array(state->x.data()), nullptr,
               fr->bMolPBC, state->box,
               state->lambda[efptBONDED], &dvdl_dum,
-              NULL, NULL, nrnb, econqCoord);
+              nullptr, nullptr, nrnb, econqCoord);
     if (EI_VV(ir->eI))
     {
         /* constrain the inital velocity, and save it */
         /* also may be useful if we need the ekin from the halfstep for velocity verlet */
-        constrain(NULL, TRUE, FALSE, constr, &(top->idef),
+        constrain(nullptr, TRUE, FALSE, constr, &(top->idef),
                   ir, cr, step, 0, 1.0, md,
-                  state->x, state->v, state->v,
+                  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,
-                  NULL, NULL, nrnb, econqVeloc);
+                  nullptr, nullptr, nrnb, econqVeloc);
     }
     /* constrain the inital velocities at t-dt/2 */
     if (EI_STATE_VELOCITY(ir->eI) && ir->eI != eiVV)
@@ -2070,12 +2008,12 @@ void do_constrain_first(FILE *fplog, gmx_constr_t constr,
                     gmx_step_str(step, buf));
         }
         dvdl_dum = 0;
-        constrain(NULL, TRUE, FALSE, constr, &(top->idef),
+        constrain(nullptr, TRUE, FALSE, constr, &(top->idef),
                   ir, cr, step, -1, 1.0, md,
-                  state->x, savex, NULL,
+                  as_rvec_array(state->x.data()), savex, nullptr,
                   fr->bMolPBC, state->box,
                   state->lambda[efptBONDED], &dvdl_dum,
-                  state->v, NULL, nrnb, econqCoord);
+                  as_rvec_array(state->v.data()), nullptr, nrnb, econqCoord);
 
         for (i = start; i < end; i++)
         {
@@ -2446,39 +2384,6 @@ void calc_dispcorr(t_inputrec *ir, t_forcerec *fr,
     }
 }
 
-void do_pbc_first(FILE *fplog, matrix box, t_forcerec *fr,
-                  t_graph *graph, rvec x[])
-{
-    if (fplog)
-    {
-        fprintf(fplog, "Removing pbc first time\n");
-    }
-    calc_shifts(box, fr->shift_vec);
-    if (graph)
-    {
-        mk_mshift(fplog, graph, fr->ePBC, box, x);
-        if (gmx_debug_at)
-        {
-            p_graph(debug, "do_pbc_first 1", graph);
-        }
-        shift_self(graph, box, x);
-        /* By doing an extra mk_mshift the molecules that are broken
-         * because they were e.g. imported from another software
-         * will be made whole again. Such are the healing powers
-         * of GROMACS.
-         */
-        mk_mshift(fplog, graph, fr->ePBC, box, x);
-        if (gmx_debug_at)
-        {
-            p_graph(debug, "do_pbc_first 2", graph);
-        }
-    }
-    if (fplog)
-    {
-        fprintf(fplog, "Done rmpbc\n");
-    }
-}
-
 static void low_do_pbc_mtop(FILE *fplog, int ePBC, matrix box,
                             const gmx_mtop_t *mtop, rvec x[],
                             gmx_bool bFirst)
@@ -2506,7 +2411,7 @@ static void low_do_pbc_mtop(FILE *fplog, int ePBC, matrix box,
         else
         {
             /* Pass NULL iso fplog to avoid graph prints for each molecule type */
-            mk_graph_ilist(NULL, mtop->moltype[molb->type].ilist,
+            mk_graph_ilist(nullptr, mtop->moltype[molb->type].ilist,
                            0, molb->natoms_mol, FALSE, FALSE, graph);
 
             for (mol = 0; mol < molb->nmol; mol++)
@@ -2560,14 +2465,14 @@ void put_atoms_in_box_omp(int ePBC, const matrix box, int natoms, rvec x[])
 }
 
 // TODO This can be cleaned up a lot, and move back to runner.cpp
-void finish_run(FILE *fplog, t_commrec *cr,
-                t_inputrec *inputrec,
+void finish_run(FILE *fplog, const gmx::MDLogger &mdlog, t_commrec *cr,
+                const t_inputrec *inputrec,
                 t_nrnb nrnb[], gmx_wallcycle_t wcycle,
                 gmx_walltime_accounting_t walltime_accounting,
                 nonbonded_verlet_t *nbv,
                 gmx_bool bWriteStat)
 {
-    t_nrnb *nrnb_tot = NULL;
+    t_nrnb *nrnb_tot = nullptr;
     double  delta_t  = 0;
     double  nbfs     = 0, mflop = 0;
     double  elapsed_time,
@@ -2587,8 +2492,7 @@ void finish_run(FILE *fplog, t_commrec *cr,
 
     if (!walltime_accounting_get_valid_finish(walltime_accounting))
     {
-        md_print_warn(cr, fplog,
-                      "Simulation ended prematurely, no performance report will be written.");
+        GMX_LOG(mdlog.warning).asParagraph().appendText("Simulation ended prematurely, no performance report will be written.");
         printReport = false;
     }
 
@@ -2652,9 +2556,9 @@ void finish_run(FILE *fplog, t_commrec *cr,
 
     if (printReport)
     {
-        struct gmx_wallclock_gpu_t* gputimes = use_GPU(nbv) ? nbnxn_gpu_get_timings(nbv->gpu_nbv) : NULL;
+        struct gmx_wallclock_gpu_t* gputimes = use_GPU(nbv) ? nbnxn_gpu_get_timings(nbv->gpu_nbv) : nullptr;
 
-        wallcycle_print(fplog, cr->nnodes, cr->npmenodes, nthreads_pp, nthreads_pme,
+        wallcycle_print(fplog, mdlog, cr->nnodes, cr->npmenodes, nthreads_pp, nthreads_pme,
                         elapsed_time_over_all_ranks,
                         wcycle, cycle_sum, gputimes);
 
@@ -2680,71 +2584,60 @@ void finish_run(FILE *fplog, t_commrec *cr,
     }
 }
 
-extern void initialize_lambdas(FILE *fplog, t_inputrec *ir, int *fep_state, real *lambda, double *lam0)
+extern void initialize_lambdas(FILE *fplog, t_inputrec *ir, int *fep_state, gmx::ArrayRef<real> lambda, double *lam0)
 {
     /* this function works, but could probably use a logic rewrite to keep all the different
        types of efep straight. */
 
-    int       i;
+    if ((ir->efep == efepNO) && (ir->bSimTemp == FALSE))
+    {
+        return;
+    }
+
     t_lambda *fep = ir->fepvals;
+    *fep_state    = fep->init_fep_state; /* this might overwrite the checkpoint
+                                            if checkpoint is set -- a kludge is in for now
+                                            to prevent this.*/
 
-    if ((ir->efep == efepNO) && (ir->bSimTemp == FALSE))
+    for (int i = 0; i < efptNR; i++)
     {
-        for (i = 0; i < efptNR; i++)
+        /* overwrite lambda state with init_lambda for now for backwards compatibility */
+        if (fep->init_lambda >= 0) /* if it's -1, it was never initializd */
         {
-            lambda[i] = 0.0;
+            lambda[i] = fep->init_lambda;
             if (lam0)
             {
-                lam0[i] = 0.0;
+                lam0[i] = lambda[i];
             }
         }
-        return;
-    }
-    else
-    {
-        *fep_state = fep->init_fep_state; /* this might overwrite the checkpoint
-                                             if checkpoint is set -- a kludge is in for now
-                                             to prevent this.*/
-        for (i = 0; i < efptNR; i++)
+        else
         {
-            /* overwrite lambda state with init_lambda for now for backwards compatibility */
-            if (fep->init_lambda >= 0) /* if it's -1, it was never initializd */
-            {
-                lambda[i] = fep->init_lambda;
-                if (lam0)
-                {
-                    lam0[i] = lambda[i];
-                }
-            }
-            else
+            lambda[i] = fep->all_lambda[i][*fep_state];
+            if (lam0)
             {
-                lambda[i] = fep->all_lambda[i][*fep_state];
-                if (lam0)
-                {
-                    lam0[i] = lambda[i];
-                }
+                lam0[i] = lambda[i];
             }
         }
-        if (ir->bSimTemp)
+    }
+    if (ir->bSimTemp)
+    {
+        /* need to rescale control temperatures to match current state */
+        for (int i = 0; i < ir->opts.ngtc; i++)
         {
-            /* need to rescale control temperatures to match current state */
-            for (i = 0; i < ir->opts.ngtc; i++)
+            if (ir->opts.ref_t[i] > 0)
             {
-                if (ir->opts.ref_t[i] > 0)
-                {
-                    ir->opts.ref_t[i] = ir->simtempvals->temperatures[*fep_state];
-                }
+                ir->opts.ref_t[i] = ir->simtempvals->temperatures[*fep_state];
             }
         }
     }
 
     /* Send to the log the information on the current lambdas */
-    if (fplog != NULL)
+    if (fplog != nullptr)
     {
         fprintf(fplog, "Initial vector of lambda components:[ ");
-        for (i = 0; i < efptNR; i++)
+        for (const auto &l : lambda)
         {
-            fprintf(fplog, "%10.4f ", lambda[i]);
+            fprintf(fplog, "%10.4f ", l);
         }
         fprintf(fplog, "]\n");
     }
@@ -2753,15 +2646,17 @@ extern void initialize_lambdas(FILE *fplog, t_inputrec *ir, int *fep_state, real
 
 
 void init_md(FILE *fplog,
-             t_commrec *cr, t_inputrec *ir, const gmx_output_env_t *oenv,
+             t_commrec *cr, gmx::IMDOutputProvider *outputProvider,
+             t_inputrec *ir, const gmx_output_env_t *oenv,
+             const MdrunOptions &mdrunOptions,
              double *t, double *t0,
-             real *lambda, int *fep_state, double *lam0,
+             gmx::ArrayRef<real> lambda, int *fep_state, double *lam0,
              t_nrnb *nrnb, gmx_mtop_t *mtop,
              gmx_update_t **upd,
              int nfile, const t_filenm fnm[],
              gmx_mdoutf_t *outf, t_mdebin **mdebin,
              tensor force_vir, tensor shake_vir, rvec mu_tot,
-             gmx_bool *bSimAnn, t_vcm **vcm, unsigned long Flags,
+             gmx_bool *bSimAnn, t_vcm **vcm,
              gmx_wallcycle_t wcycle)
 {
     int  i;
@@ -2789,15 +2684,15 @@ void init_md(FILE *fplog,
     }
     if (*bSimAnn)
     {
-        update_annealing_target_temp(ir, ir->init_t, upd ? *upd : NULL);
+        update_annealing_target_temp(ir, ir->init_t, upd ? *upd : nullptr);
     }
 
-    if (vcm != NULL)
+    if (vcm != nullptr)
     {
         *vcm = init_vcm(fplog, &mtop->groups, ir);
     }
 
-    if (EI_DYNAMICS(ir->eI) && !(Flags & MD_APPENDFILES))
+    if (EI_DYNAMICS(ir->eI) && !mdrunOptions.continuationOptions.appendFiles)
     {
         if (ir->etc == etcBERENDSEN)
         {
@@ -2812,17 +2707,13 @@ void init_md(FILE *fplog,
             please_cite(fplog, "Goga2012");
         }
     }
-    if ((ir->et[XX].n > 0) || (ir->et[YY].n > 0) || (ir->et[ZZ].n > 0))
-    {
-        please_cite(fplog, "Caleman2008a");
-    }
     init_nrnb(nrnb);
 
     if (nfile != -1)
     {
-        *outf = init_mdoutf(fplog, nfile, fnm, Flags, cr, ir, mtop, oenv, wcycle);
+        *outf = init_mdoutf(fplog, nfile, fnm, mdrunOptions, cr, outputProvider, ir, mtop, oenv, wcycle);
 
-        *mdebin = init_mdebin((Flags & MD_APPENDFILES) ? NULL : mdoutf_get_fp_ene(*outf),
+        *mdebin = init_mdebin(mdrunOptions.continuationOptions.appendFiles ? nullptr : mdoutf_get_fp_ene(*outf),
                               mtop, ir, mdoutf_get_fp_dhdl(*outf));
     }
 
index 930bf2c692f16935a3266c472d8c4171d67283c2..c8ed785fcf10fbf1389a6a63e467eaa5105eadb2 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,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.
 #include "gromacs/mdlib/vcm.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/timing/walltime_accounting.h"
+#include "gromacs/utility/arrayref.h"
 
 struct gmx_constr;
 struct gmx_localtop_t;
 struct gmx_output_env_t;
 struct gmx_update_t;
+struct MdrunOptions;
 struct nonbonded_verlet_t;
-struct t_graph;
 struct t_mdatoms;
 struct t_nrnb;
 
-typedef struct gmx_global_stat *gmx_global_stat_t;
+namespace gmx
+{
+class IMDOutputProvider;
+class MDLogger;
+}
 
-void do_pbc_first(FILE *log, matrix box, t_forcerec *fr,
-                  t_graph *graph, rvec x[]);
+typedef struct gmx_global_stat *gmx_global_stat_t;
 
 void do_pbc_first_mtop(FILE *fplog, int ePBC, matrix box,
                        const gmx_mtop_t *mtop, rvec x[]);
@@ -117,8 +121,8 @@ void print_start(FILE *fplog, t_commrec *cr,
                  gmx_walltime_accounting_t walltime_accounting,
                  const char *name);
 
-void finish_run(FILE *log, t_commrec *cr,
-                t_inputrec *inputrec,
+void finish_run(FILE *log, const gmx::MDLogger &mdlog, t_commrec *cr,
+                const t_inputrec *inputrec,
                 t_nrnb nrnb[], gmx_wallcycle_t wcycle,
                 gmx_walltime_accounting_t walltime_accounting,
                 nonbonded_verlet_t *nbv,
@@ -130,7 +134,7 @@ void calc_dispcorr(t_inputrec *ir, t_forcerec *fr,
                    matrix box, real lambda, tensor pres, tensor virial,
                    real *prescorr, real *enercorr, real *dvdlcorr);
 
-void initialize_lambdas(FILE *fplog, t_inputrec *ir, int *fep_state, real *lambda, double *lam0);
+void initialize_lambdas(FILE *fplog, t_inputrec *ir, int *fep_state, gmx::ArrayRef<real> lambda, double *lam0);
 
 void do_constrain_first(FILE *log, gmx_constr *constr,
                         t_inputrec *inputrec, t_mdatoms *md,
@@ -138,16 +142,18 @@ void do_constrain_first(FILE *log, gmx_constr *constr,
                         t_forcerec *fr, gmx_localtop_t *top);
 
 void init_md(FILE *fplog,
-             t_commrec *cr, t_inputrec *ir, const gmx_output_env_t *oenv,
+             t_commrec *cr, gmx::IMDOutputProvider *outputProvider,
+             t_inputrec *ir, const gmx_output_env_t *oenv,
+             const MdrunOptions &mdrunOptions,
              double *t, double *t0,
-             real *lambda, int *fep_state, double *lam0,
+             gmx::ArrayRef<real> lambda, int *fep_state, double *lam0,
              t_nrnb *nrnb, gmx_mtop_t *mtop,
              gmx_update_t **upd,
              int nfile, const t_filenm fnm[],
              gmx_mdoutf_t *outf, t_mdebin **mdebin,
              tensor force_vir, tensor shake_vir,
              rvec mu_tot,
-             gmx_bool *bSimAnn, t_vcm **vcm, unsigned long Flags,
+             gmx_bool *bSimAnn, t_vcm **vcm,
              gmx_wallcycle_t wcycle);
 /* Routine in sim_util.c */
 
index abd5ee7bb9fd7b098f1541b91201f3cfbe0917d7..794908c98091e2bede8a6d6bd9e9d2b9610a9503 100644 (file)
@@ -78,9 +78,6 @@ class ArrayRef;
  * signals can be sent together with other data). This means that the
  * only meaningful values are positive, negative or zero.
  *
- * Note that xlc on BG/Q requires sig to be of size char (see unit tests
- * of ArrayRef for details).
- *
  * isLocal permits (for example) replica-exchange to require that any
  * checkpointing is synchronized across all simulations, by setting
  * isLocal to false, so that the trigger for action is set only when
index 1bbbd9ed097093364b27d4a5f93f03dad2dea898..c8d55bf8da3f56546f2309df0a83c8d1a5fa84f3 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,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.
@@ -135,9 +135,9 @@ static int first_colour(int fC, egCol Col, t_graph *g, egCol egc[])
 static int mk_sblocks(FILE *fp, t_graph *g, int maxsid, t_sid sid[])
 {
     int     ng, nnodes;
-    int     nW, nG, nB; /* Number of Grey, Black, White        */
-    int     fW, fG;     /* First of each category      */
-    egCol  *egc = NULL; /* The colour of each node     */
+    int     nW, nG, nB;    /* Number of Grey, Black, White     */
+    int     fW, fG;        /* First of each category   */
+    egCol  *egc = nullptr; /* The colour of each node  */
     int     g0, nblock;
 
     if (!g->nbound)
@@ -363,7 +363,7 @@ void gen_sblocks(FILE *fp, int at_start, int at_end,
     t_sid   *sid;
     int      nsid;
 
-    g = mk_graph(NULL, idef, at_start, at_end, TRUE, bSettle);
+    g = mk_graph(nullptr, idef, at_start, at_end, TRUE, bSettle);
     if (debug)
     {
         p_graph(debug, "Graaf Dracula", g);
index 7c6de83ec44ef1f4b8290d8e7a9c4f8ea2eee051..0db91f37e4645b6d98b402a4172a4745336391bd 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,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.
@@ -156,7 +156,7 @@ void global_stat(gmx_global_stat_t gs,
     int        inn[egNR];
     real       copyenerd[F_NRE];
     int        nener, j;
-    real      *rmsd_data = NULL;
+    real      *rmsd_data = nullptr;
     double     nb;
     gmx_bool   bVV, bTemp, bEner, bPres, bConstrVir, bEkinAveVel, bReadEkin;
     bool       checkNumberOfBondedInteractions = flags & CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS;
index 0ad14a2204caa430669dbecaf8c091b8e21d3adf..fbcf73f88f679f35afb7d4afe2a79de06f2e30ac 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2014,2016, by the GROMACS development team, led by
+# Copyright (c) 2014,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.
@@ -33,6 +33,7 @@
 # the research papers on the package. Check out http://www.gromacs.org.
 
 gmx_add_unit_test(MdlibUnitTest mdlib-test
+                  calc_verletbuf.cpp
                   settle.cpp
                   shake.cpp
                   simulationsignal.cpp)
diff --git a/src/gromacs/mdlib/tests/calc_verletbuf.cpp b/src/gromacs/mdlib/tests/calc_verletbuf.cpp
new file mode 100644 (file)
index 0000000..9fb809e
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief Tests for the Verlet buffer calculation algorithm.
+ *
+ * \author Berk Hess <hess@kth.se>
+ */
+#include "gmxpre.h"
+
+#include "gromacs/mdlib/calc_verletbuf.h"
+
+#include <algorithm>
+
+#include <gtest/gtest.h>
+
+#include "gromacs/math/functions.h"
+
+#include "testutils/testasserts.h"
+
+namespace gmx
+{
+
+namespace
+{
+
+class VerletBufferConstraintTest : public ::testing::Test
+{
+};
+
+/* This test covers the displacement correction for constrained atoms.
+ * This test does not check exact values, but rather checks that the MSD
+ * estimate for a constrained atom is smaller than that of a free atom
+ * and checks that the MSD is not smaller and also not much larger
+ * than the maximum of the exact value for rotational MSD beyond
+ * the location of the maximum. Furthermore, we check that the MSD estimate
+ * never decreases, as this is a requirement for the Verlet buffer size
+ * estimation. Together these criteria provide tight margins on
+ * the shape and values of the estimate.
+ *
+ * Additionally we check the 3D MSD for the COM of the two atoms.
+ */
+TEST_F(VerletBufferConstraintTest, EqualMasses)
+{
+    // The location and value of the MSD maximum for the exact displacement
+    // is described in the source file. We need to divide the maximum given
+    // there by 2, since sigma2 is per DOF for the 2 DOF constraint rotation.
+    const real sigma2RelMaxLocation  = 4.5119;
+    const real sigma2RelMaxValue     = 2.5695/2;
+
+    // Our max of our current estimate is 3% above the exact value.
+    const real sigma2RelMaxMargin    = 1.04;
+
+    // The exact parameter values here don't actually matter.
+    real mass = 10;
+    real arm  = 0.1;
+
+    atom_nonbonded_kinetic_prop_t prop;
+    prop.mass     = mass;
+    prop.type     = -1;
+    prop.q        = 0;
+    prop.bConstr  = TRUE;
+    prop.con_mass = mass;
+    prop.con_len  = 2*arm;
+
+    // We scan a range of rotation distributions by scanning over T.
+    int  numPointsBeforeMax = 0;
+    int  numPointsAfterMax  = 0;
+    real sigma2_2d_prev     = 0;
+    for (int i = 0; i <= 200; i++)
+    {
+        real ktFac = i*0.01;
+        // The rotational displacement is Gaussian with a sigma^2 of:
+        real sigma2_rot = ktFac/(2*mass);
+
+        // Get the estimate for the Cartesian displacement.
+        real sigma2_2d, sigma2_3d;
+        constrained_atom_sigma2(ktFac, &prop, &sigma2_2d, &sigma2_3d);
+
+        // Check we are not decreasing sigma2_2d
+        EXPECT_EQ(std::max(sigma2_2d_prev, sigma2_2d), sigma2_2d);
+        // Check that sigma2_2d is not larger than sigma2 for free motion.
+        EXPECT_EQ(std::min(sigma2_rot, sigma2_2d), sigma2_2d);
+
+        // Check that we don't underestimate sigma2_rot beyond the real maximum
+        // and that our overestimate is tight.
+        real sigma2Rel = sigma2_rot/gmx::square(arm);
+        if (sigma2Rel >= sigma2RelMaxLocation)
+        {
+            EXPECT_EQ(std::max(sigma2_2d, sigma2RelMaxValue*gmx::square(arm)), sigma2_2d);
+            EXPECT_EQ(std::min(sigma2_2d, sigma2RelMaxMargin*sigma2RelMaxValue*gmx::square(arm)), sigma2_2d);
+
+            numPointsAfterMax++;
+        }
+        else
+        {
+            numPointsBeforeMax++;
+        }
+
+        // Also check sigma2 for the COM of the two atoms
+        EXPECT_REAL_EQ_TOL(sigma2_rot, sigma2_3d, test::defaultRealTolerance());
+    }
+
+    GMX_RELEASE_ASSERT(numPointsBeforeMax >= 20 && numPointsAfterMax >= 20, "This test only provides full coverage when we test a sufficient number of points before and after the location of the maximum value for the exact formula.");
+}
+
+}      // namespace anonymous
+
+}      // namespace gmx
index 4fcb49b7194de52b2e0e96d3fae510b653260ef9..7872839e1571825ab8f48850030695b0ae512f96 100644 (file)
@@ -46,9 +46,9 @@
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/topology/idef.h"
 #include "gromacs/topology/topology.h"
-#include "gromacs/utility/scoped_cptr.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/unique_cptr.h"
 
 #include "testutils/testasserts.h"
 
@@ -196,18 +196,18 @@ TEST_P(SettleTest, SatisfiesConstraints)
 
     // Set up the topology. We still have to make some raw pointers,
     // but they are put into scope guards for automatic cleanup.
-    gmx_mtop_t             *mtop;
+    gmx_mtop_t                   *mtop;
     snew(mtop, 1);
-    scoped_cptr<gmx_mtop_t> mtopGuard(mtop);
+    const unique_cptr<gmx_mtop_t> mtopGuard(mtop);
     mtop->mols.nr  = 1;
     mtop->nmoltype = 1;
     snew(mtop->moltype, mtop->nmoltype);
-    scoped_cptr<gmx_moltype_t> moltypeGuard(mtop->moltype);
+    const unique_cptr<gmx_moltype_t> moltypeGuard(mtop->moltype);
     mtop->nmolblock = 1;
     snew(mtop->molblock, mtop->nmolblock);
-    scoped_cptr<gmx_molblock_t> molblockGuard(mtop->molblock);
+    const unique_cptr<gmx_molblock_t> molblockGuard(mtop->molblock);
     mtop->molblock[0].type = 0;
-    std::vector<int>            iatoms;
+    std::vector<int>                  iatoms;
     for (int i = 0; i < numSettles; ++i)
     {
         iatoms.push_back(settleType);
@@ -221,9 +221,9 @@ TEST_P(SettleTest, SatisfiesConstraints)
     // Set up the SETTLE parameters.
     mtop->ffparams.ntypes = 1;
     snew(mtop->ffparams.iparams, mtop->ffparams.ntypes);
-    scoped_cptr<t_iparams> iparamsGuard(mtop->ffparams.iparams);
-    const real             dOH = 0.09572;
-    const real             dHH = 0.15139;
+    const unique_cptr<t_iparams> iparamsGuard(mtop->ffparams.iparams);
+    const real                   dOH = 0.09572;
+    const real                   dHH = 0.15139;
     mtop->ffparams.iparams[settleType].settle.doh = dOH;
     mtop->ffparams.iparams[settleType].settle.dhh = dHH;
 
@@ -261,6 +261,7 @@ TEST_P(SettleTest, SatisfiesConstraints)
             startingPositions.data(), updatedPositions_.data(), reciprocalTimeStep,
             useVelocities ? velocities_.data() : nullptr,
             calcVirial, virial, &errorOccured);
+    settle_free(settled);
     EXPECT_FALSE(errorOccured) << testDescription;
 
     // The necessary tolerances for the test to pass were determined
@@ -309,39 +310,15 @@ TEST_P(SettleTest, SatisfiesConstraints)
     }
 }
 
-using ::testing::Bool;
 // Scan the full Cartesian product of numbers of SETTLE interactions
 // (4 and 17 are chosen to test cases that do and do not match
 // hardware SIMD widths), and whether or not we use PBC, velocities or
-// calculate the virial contribution. It would be nicer to generate
-// these combinations with ::testing::Combine, but gcc 4.6 can't cope
-// with the template meta-programming required to generate the tuples.
+// calculate the virial contribution.
 INSTANTIATE_TEST_CASE_P(WithParameters, SettleTest,
-                            ::testing::Values(SettleTestParameters(1,  true,  true,  true),
-                                              SettleTestParameters(4,  true,  true,  true),
-                                              SettleTestParameters(17, true,  true,  true),
-                                              SettleTestParameters(1,  false, true,  true),
-                                              SettleTestParameters(4,  false, true,  true),
-                                              SettleTestParameters(17, false, true,  true),
-                                              SettleTestParameters(1,  true,  false, true),
-                                              SettleTestParameters(4,  true,  false, true),
-                                              SettleTestParameters(17, true,  false, true),
-                                              SettleTestParameters(1,  false, false, true),
-                                              SettleTestParameters(4,  false, false, true),
-                                              SettleTestParameters(17, false, false, true),
-                                              SettleTestParameters(1,  true,  true,  false),
-                                              SettleTestParameters(4,  true,  true,  false),
-                                              SettleTestParameters(17, true,  true,  false),
-                                              SettleTestParameters(1,  false, true,  false),
-                                              SettleTestParameters(4,  false, true,  false),
-                                              SettleTestParameters(17, false, true,  false),
-                                              SettleTestParameters(1,  true,  false, false),
-                                              SettleTestParameters(4,  true,  false, false),
-                                              SettleTestParameters(17, true,  false, false),
-                                              SettleTestParameters(1,  false, false, false),
-                                              SettleTestParameters(4,  false, false, false),
-                                              SettleTestParameters(17, false, false, false)));
-
+                            ::testing::Combine(::testing::Values(1, 4, 7),
+                                                   ::testing::Bool(),
+                                                   ::testing::Bool(),
+                                                   ::testing::Bool()));
 
 } // namespace
 } // namespace
index 78ece843ca9321ea3707a4833b826577dbefeb37..0d7712be6dbee67f3a1eb6fcc7f201bdeb0d3b75 100644 (file)
@@ -74,7 +74,7 @@ static void init_grpstat(gmx_mtop_t *mtop, int ngacc, t_grp_acc gstat[])
     gmx_groups_t           *groups;
     gmx_mtop_atomloop_all_t aloop;
     int                     i, grp;
-    t_atom                 *atom;
+    const t_atom           *atom;
 
     if (ngacc > 0)
     {
index aa1210a59fdc9641dc89ea5424e16311e0162ebb..332286edc06ff3d6a5b088bace03eb6b5b39624e 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,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.
@@ -78,6 +78,7 @@
 #include "gromacs/mdtypes/group.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/mdtypes/state.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/random/threefry.h"
 #include "gromacs/random/uniformrealdistribution.h"
@@ -126,12 +127,12 @@ namespace gmx
 {
 
 /*! \brief Do test particle insertion.
-    \copydoc integrator_t (FILE *fplog, t_commrec *cr,
+    \copydoc integrator_t (FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
                            int nfile, const t_filenm fnm[],
-                           const gmx_output_env_t *oenv, gmx_bool bVerbose,
-                           int nstglobalcomm,
+                           const gmx_output_env_t *oenv,
+                           const MdrunOptions &mdrunOptions,
                            gmx_vsite_t *vsite, gmx_constr_t constr,
-                           int stepout,
+                           gmx::IMDOutputProvider *outputProvider,
                            t_inputrec *inputrec,
                            gmx_mtop_t *top_global, t_fcdata *fcd,
                            t_state *state_global,
@@ -139,61 +140,58 @@ namespace gmx
                            t_nrnb *nrnb, gmx_wallcycle_t wcycle,
                            gmx_edsam_t ed,
                            t_forcerec *fr,
-                           int repl_ex_nst, int repl_ex_nex, int repl_ex_seed,
-                           real cpt_period, real max_hours,
-                           int imdport,
-                           unsigned long Flags,
+                           const ReplicaExchangeParameters &replExParams,
+                           gmx_membed_t gmx_unused *membed,
                            gmx_walltime_accounting_t walltime_accounting)
  */
-double do_tpi(FILE *fplog, t_commrec *cr,
+double do_tpi(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
               int nfile, const t_filenm fnm[],
-              const gmx_output_env_t *oenv, gmx_bool bVerbose,
-              int gmx_unused nstglobalcomm,
+              const gmx_output_env_t *oenv,
+              const MdrunOptions &mdrunOptions,
               gmx_vsite_t gmx_unused *vsite, gmx_constr_t gmx_unused constr,
-              int gmx_unused stepout,
+              gmx::IMDOutputProvider *outputProvider,
               t_inputrec *inputrec,
               gmx_mtop_t *top_global, t_fcdata *fcd,
               t_state *state_global,
+              ObservablesHistory gmx_unused *observablesHistory,
               t_mdatoms *mdatoms,
               t_nrnb *nrnb, gmx_wallcycle_t wcycle,
-              gmx_edsam_t gmx_unused ed,
               t_forcerec *fr,
-              int gmx_unused repl_ex_nst, int gmx_unused repl_ex_nex, int gmx_unused repl_ex_seed,
+              const ReplicaExchangeParameters gmx_unused &replExParams,
               gmx_membed_t gmx_unused *membed,
-              real gmx_unused cpt_period, real gmx_unused max_hours,
-              int gmx_unused imdport,
-              unsigned long gmx_unused Flags,
               gmx_walltime_accounting_t walltime_accounting)
 {
-    gmx_localtop_t *top;
-    gmx_groups_t   *groups;
-    gmx_enerdata_t *enerd;
-    rvec           *f;
-    real            lambda, t, temp, beta, drmax, epot;
-    double          embU, sum_embU, *sum_UgembU, V, V_all, VembU_all;
-    t_trxstatus    *status;
-    t_trxframe      rerun_fr;
-    gmx_bool        bDispCorr, bCharge, bRFExcl, bNotLastFrame, bStateChanged, bNS;
-    tensor          force_vir, shake_vir, vir, pres;
-    int             cg_tp, a_tp0, a_tp1, ngid, gid_tp, nener, e;
-    rvec           *x_mol;
-    rvec            mu_tot, x_init, dx, x_tp;
-    int             nnodes, frame;
-    gmx_int64_t     frame_step_prev, frame_step;
-    gmx_int64_t     nsteps, stepblocksize = 0, step;
-    gmx_int64_t     seed;
-    int             i;
-    FILE           *fp_tpi = NULL;
-    char           *ptr, *dump_pdb, **leg, str[STRLEN], str2[STRLEN];
-    double          dbl, dump_ener;
-    gmx_bool        bCavity;
-    int             nat_cavity  = 0, d;
-    real           *mass_cavity = NULL, mass_tot;
-    int             nbin;
-    double          invbinw, *bin, refvolshift, logV, bUlogV;
-    real            prescorr, enercorr, dvdlcorr;
-    gmx_bool        bEnergyOutOfBounds;
-    const char     *tpid_leg[2] = {"direct", "reweighted"};
+    gmx_localtop_t  *top;
+    gmx_groups_t    *groups;
+    gmx_enerdata_t  *enerd;
+    PaddedRVecVector f {};
+    real             lambda, t, temp, beta, drmax, epot;
+    double           embU, sum_embU, *sum_UgembU, V, V_all, VembU_all;
+    t_trxstatus     *status;
+    t_trxframe       rerun_fr;
+    gmx_bool         bDispCorr, bCharge, bRFExcl, bNotLastFrame, bStateChanged, bNS;
+    tensor           force_vir, shake_vir, vir, pres;
+    int              cg_tp, a_tp0, a_tp1, ngid, gid_tp, nener, e;
+    rvec            *x_mol;
+    rvec             mu_tot, x_init, dx, x_tp;
+    int              nnodes, frame;
+    gmx_int64_t      frame_step_prev, frame_step;
+    gmx_int64_t      nsteps, stepblocksize = 0, step;
+    gmx_int64_t      seed;
+    int              i;
+    FILE            *fp_tpi = nullptr;
+    char            *ptr, *dump_pdb, **leg, str[STRLEN], str2[STRLEN];
+    double           dbl, dump_ener;
+    gmx_bool         bCavity;
+    int              nat_cavity  = 0, d;
+    real            *mass_cavity = nullptr, mass_tot;
+    int              nbin;
+    double           invbinw, *bin, refvolshift, logV, bUlogV;
+    real             prescorr, enercorr, dvdlcorr;
+    gmx_bool         bEnergyOutOfBounds;
+    const char      *tpid_leg[2] = {"direct", "reweighted"};
+
+    GMX_UNUSED_VALUE(outputProvider);
 
     /* Since there is no upper limit to the insertion energies,
      * we need to set an upper limit for the distribution output.
@@ -216,7 +214,7 @@ double do_tpi(FILE *fplog, t_commrec *cr,
     if (bCavity)
     {
         ptr = getenv("GMX_TPIC_MASSES");
-        if (ptr == NULL)
+        if (ptr == nullptr)
         {
             nat_cavity = 1;
         }
@@ -284,12 +282,15 @@ double do_tpi(FILE *fplog, t_commrec *cr,
         sscanf(dump_pdb, "%20lf", &dump_ener);
     }
 
-    atoms2md(top_global, inputrec, 0, NULL, top_global->natoms, mdatoms);
+    atoms2md(top_global, inputrec, -1, nullptr, top_global->natoms, mdatoms);
     update_mdatoms(mdatoms, inputrec->fepvals->init_lambda);
 
     snew(enerd, 1);
     init_enerdata(groups->grps[egcENER].nr, inputrec->fepvals->n_lambda, enerd);
-    snew(f, top_global->natoms);
+    /* We need to allocate one element extra, since we might use
+     * (unaligned) 4-wide SIMD loads to access rvec entries.
+     */
+    f.resize(top_global->natoms + 1);
 
     /* Print to log file  */
     walltime_accounting_start(walltime_accounting);
@@ -321,7 +322,7 @@ double do_tpi(FILE *fplog, t_commrec *cr,
     }
     bRFExcl = (bCharge && EEL_RF(fr->eeltype));
 
-    calc_cgcm(fplog, cg_tp, cg_tp+1, &(top->cgs), state_global->x, fr->cg_cm);
+    calc_cgcm(fplog, cg_tp, cg_tp+1, &(top->cgs), as_rvec_array(state_global->x.data()), fr->cg_cm);
     if (bCavity)
     {
         if (norm(fr->cg_cm[cg_tp]) > 0.5*inputrec->rlist && fplog)
@@ -629,7 +630,7 @@ double do_tpi(FILE *fplog, t_commrec *cr,
                     copy_rvec(x_mol[i-a_tp0], state_global->x[i]);
                 }
                 /* Rotate the molecule randomly */
-                rotate_conf(a_tp1-a_tp0, state_global->x+a_tp0, NULL,
+                rotate_conf(a_tp1-a_tp0, as_rvec_array(state_global->x.data())+a_tp0, nullptr,
                             2*M_PI*dist(rng),
                             2*M_PI*dist(rng),
                             2*M_PI*dist(rng));
@@ -659,13 +660,15 @@ double do_tpi(FILE *fplog, t_commrec *cr,
             cr->nnodes = 1;
             do_force(fplog, cr, 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->box, &state_global->x, &state_global->hist,
+                     &f, force_vir, mdatoms, enerd, fcd,
                      state_global->lambda,
-                     NULL, fr, NULL, mu_tot, t, NULL, NULL, FALSE,
+                     nullptr, fr, nullptr, mu_tot, t, nullptr, FALSE,
                      GMX_FORCE_NONBONDED | GMX_FORCE_ENERGY |
                      (bNS ? GMX_FORCE_DYNAMICBOX | GMX_FORCE_NS : 0) |
-                     (bStateChanged ? GMX_FORCE_STATECHANGED : 0));
+                     (bStateChanged ? GMX_FORCE_STATECHANGED : 0),
+                     DdOpenBalanceRegionBeforeForceComputation::no,
+                     DdCloseBalanceRegionAfterForceComputation::no);
             cr->nnodes    = nnodes;
             bStateChanged = FALSE;
             bNS           = FALSE;
@@ -782,7 +785,7 @@ double do_tpi(FILE *fplog, t_commrec *cr,
             {
                 sprintf(str, "t%g_step%d.pdb", t, (int)step);
                 sprintf(str2, "t: %f step %d ener: %f", t, (int)step, epot);
-                write_sto_conf_mtop(str, str2, top_global, state_global->x, state_global->v,
+                write_sto_conf_mtop(str, str2, top_global, as_rvec_array(state_global->x.data()), as_rvec_array(state_global->v.data()),
                                     inputrec->ePBC, state_global->box);
             }
 
@@ -807,7 +810,7 @@ double do_tpi(FILE *fplog, t_commrec *cr,
 
         if (fp_tpi)
         {
-            if (bVerbose || frame%10 == 0 || frame < 10)
+            if (mdrunOptions.verbose || frame%10 == 0 || frame < 10)
             {
                 fprintf(stderr, "mu %10.3e <mu> %10.3e\n",
                         -log(sum_embU/nsteps)/beta, -log(VembU_all/V_all)/beta);
@@ -830,14 +833,14 @@ double do_tpi(FILE *fplog, t_commrec *cr,
     }   /* End of the loop  */
     walltime_accounting_end(walltime_accounting);
 
-    close_trj(status);
+    close_trx(status);
 
-    if (fp_tpi != NULL)
+    if (fp_tpi != nullptr)
     {
         xvgrclose(fp_tpi);
     }
 
-    if (fplog != NULL)
+    if (fplog != nullptr)
     {
         fprintf(fplog, "\n");
         fprintf(fplog, "  <V>  = %12.5e nm^3\n", V_all/frame);
index d210d731c5f4e02c7bb2bc88bc9bbb8e6b5573a1..1be40ba2b1e242b6abd9783e2c23e2873590653d 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,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.
 #include "gromacs/mdlib/sim_util.h"
 #include "gromacs/mdlib/update.h"
 #include "gromacs/mdtypes/commrec.h"
-#include "gromacs/mdtypes/energyhistory.h"
 #include "gromacs/mdtypes/inputrec.h"
+#include "gromacs/mdtypes/observableshistory.h"
+#include "gromacs/mdtypes/state.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/topology/topology.h"
 #include "gromacs/utility/smalloc.h"
 
 void
-do_md_trajectory_writing(FILE           *fplog,
-                         t_commrec      *cr,
-                         int             nfile,
-                         const t_filenm  fnm[],
-                         gmx_int64_t     step,
-                         gmx_int64_t     step_rel,
-                         double          t,
-                         t_inputrec     *ir,
-                         t_state        *state,
-                         t_state        *state_global,
-                         gmx_mtop_t     *top_global,
-                         t_forcerec     *fr,
-                         gmx_mdoutf_t    outf,
-                         t_mdebin       *mdebin,
-                         gmx_ekindata_t *ekind,
-                         rvec           *f,
-                         int            *nchkpt,
-                         gmx_bool        bCPT,
-                         gmx_bool        bRerunMD,
-                         gmx_bool        bLastStep,
-                         gmx_bool        bDoConfOut,
-                         gmx_bool        bSumEkinhOld
+do_md_trajectory_writing(FILE               *fplog,
+                         t_commrec          *cr,
+                         int                 nfile,
+                         const t_filenm      fnm[],
+                         gmx_int64_t         step,
+                         gmx_int64_t         step_rel,
+                         double              t,
+                         t_inputrec         *ir,
+                         t_state            *state,
+                         t_state            *state_global,
+                         ObservablesHistory *observablesHistory,
+                         gmx_mtop_t         *top_global,
+                         t_forcerec         *fr,
+                         gmx_mdoutf_t        outf,
+                         t_mdebin           *mdebin,
+                         gmx_ekindata_t     *ekind,
+                         PaddedRVecVector   *f,
+                         int                *nchkpt,
+                         gmx_bool            bCPT,
+                         gmx_bool            bRerunMD,
+                         gmx_bool            bLastStep,
+                         gmx_bool            bDoConfOut,
+                         gmx_bool            bSumEkinhOld
                          )
 {
     int   mdof_flags;
-    rvec *x_for_confout = NULL;
+    rvec *x_for_confout = nullptr;
 
     mdof_flags = 0;
     if (do_per_step(step, ir->nstxout))
@@ -139,11 +141,12 @@ do_md_trajectory_writing(FILE           *fplog,
                     update_ekinstate(&state_global->ekinstate, ekind);
                     state_global->ekinstate.bUpToDate = TRUE;
                 }
-                update_energyhistory(state_global->enerhist, mdebin);
+
+                update_energyhistory(observablesHistory->energyHistory.get(), mdebin);
             }
         }
         mdoutf_write_to_trajectory_files(fplog, cr, outf, mdof_flags, top_global,
-                                         step, t, state, state_global, f);
+                                         step, t, state, state_global, observablesHistory, f);
         if (bCPT)
         {
             (*nchkpt)++;
@@ -152,7 +155,7 @@ do_md_trajectory_writing(FILE           *fplog,
             bDoConfOut && MASTER(cr) &&
             !bRerunMD)
         {
-            if (fr->bMolPBC && state->x == state_global->x)
+            if (fr->bMolPBC && state == state_global)
             {
                 /* This (single-rank) run needs to allocate a
                    temporary array of size natoms so that any
@@ -162,13 +165,13 @@ do_md_trajectory_writing(FILE           *fplog,
                    identical, and makes .edr restarts binary
                    identical. */
                 snew(x_for_confout, state_global->natoms);
-                copy_rvecn(state_global->x, x_for_confout, 0, state_global->natoms);
+                copy_rvecn(as_rvec_array(state_global->x.data()), x_for_confout, 0, state_global->natoms);
             }
             else
             {
                 /* With DD, or no bMolPBC, it doesn't matter if
-                   we change state_global->x */
-                x_for_confout = state_global->x;
+                   we change as_rvec_array(state_global->x.data()) */
+                x_for_confout = as_rvec_array(state_global->x.data());
             }
 
             /* x and v have been collected in mdoutf_write_to_trajectory_files,
@@ -183,9 +186,9 @@ do_md_trajectory_writing(FILE           *fplog,
             }
             write_sto_conf_mtop(ftp2fn(efSTO, nfile, fnm),
                                 *top_global->name, top_global,
-                                x_for_confout, state_global->v,
+                                x_for_confout, as_rvec_array(state_global->v.data()),
                                 ir->ePBC, state->box);
-            if (fr->bMolPBC && state->x == state_global->x)
+            if (fr->bMolPBC && state == state_global)
             {
                 sfree(x_for_confout);
             }
index f9edb57e83020c896e52518f9c77a154eafa8fdb..b2063334b4afed05c7e13031b0b803f58b845066 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,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.
@@ -45,6 +45,7 @@
 
 struct gmx_ekindata_t;
 struct gmx_mtop_t;
+struct ObservablesHistory;
 struct t_commrec;
 struct t_filenm;
 
@@ -67,12 +68,13 @@ do_md_trajectory_writing(FILE                     *fplog,
                          t_inputrec               *ir,
                          t_state                  *state,
                          t_state                  *state_global,
+                         ObservablesHistory       *observablesHistory,
                          struct gmx_mtop_t        *top_global,
                          t_forcerec               *fr,
                          gmx_mdoutf_t              outf,
                          t_mdebin                 *mdebin,
                          struct gmx_ekindata_t    *ekind,
-                         rvec                     *f,
+                         PaddedRVecVector         *f,
                          int                      *nchkpt,
                          gmx_bool                  bCPT,
                          gmx_bool                  bRerunMD,
index cc01f266c007e30ea5691bdc99942026f6c9950c..63603a343f2160e528416253824437af91307d2c 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,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.
@@ -64,6 +64,7 @@
 #include "gromacs/mdtypes/group.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/mdtypes/state.h"
 #include "gromacs/pbcutil/boxutilities.h"
 #include "gromacs/pbcutil/mshift.h"
 #include "gromacs/pbcutil/pbc.h"
@@ -102,177 +103,403 @@ typedef struct {
 
 struct gmx_update_t
 {
-    gmx_stochd_t *sd;
+    gmx_stochd_t     *sd;
     /* xprime for constraint algorithms */
-    rvec         *xp;
-    int           xp_nalloc;
+    PaddedRVecVector  xp;
 
     /* Variables for the deform algorithm */
-    gmx_int64_t     deformref_step;
-    matrix          deformref_box;
+    gmx_int64_t       deformref_step;
+    matrix            deformref_box;
 };
 
+static bool isTemperatureCouplingStep(gmx_int64_t step, const t_inputrec *ir)
+{
+    /* We should only couple after a step where energies were determined (for leapfrog versions)
+       or the step energies are determined, for velocity verlet versions */
+    int offset;
+    if (EI_VV(ir->eI))
+    {
+        offset = 0;
+    }
+    else
+    {
+        offset = 1;
+    }
+    return ir->etc != etcNO &&
+           (ir->nsttcouple == 1 ||
+            do_per_step(step + ir->nsttcouple - offset, ir->nsttcouple));
+}
 
-static void do_update_md(int start, int nrend,
-                         double dt, int nstpcouple,
-                         t_grp_tcstat *tcstat,
-                         double nh_vxi[],
-                         gmx_bool bNEMD, t_grp_acc *gstat, rvec accel[],
-                         ivec nFreeze[],
-                         real invmass[],
-                         unsigned short ptype[], unsigned short cFREEZE[],
-                         unsigned short cACC[], unsigned short cTC[],
-                         rvec x[], rvec xprime[], rvec v[],
-                         rvec f[], matrix M,
-                         gmx_bool bNH, gmx_bool bPR)
+static bool isPressureCouplingStep(gmx_int64_t step, const t_inputrec *ir)
 {
-    double imass, w_dt;
-    int    gf = 0, ga = 0, gt = 0;
-    rvec   vrel;
-    real   vn, vv, va, vb, vnrel;
-    real   lg, vxi = 0, u;
-    int    n, d;
+    GMX_ASSERT(ir->epc != epcMTTK, "MTTK pressure coupling is not handled here");
 
-    if (bNH || bPR)
+    int offset;
+    if (ir->epc == epcBERENDSEN)
     {
-        /* Update with coupling to extended ensembles, used for
-         * Nose-Hoover and Parrinello-Rahman coupling
-         * Nose-Hoover uses the reversible leap-frog integrator from
-         * Holian et al. Phys Rev E 52(3) : 2338, 1995
-         */
-        for (n = start; n < nrend; n++)
+        offset = 0;
+    }
+    else
+    {
+        offset = 1;
+    }
+    /* We should only couple after a step where pressures were determined */
+    return ir->epc != etcNO &&
+           (ir->nstpcouple == 1 ||
+            do_per_step(step + ir->nstpcouple - offset, ir->nstpcouple));
+}
+
+/*! \brief Sets the number of different temperature coupling values */
+enum class NumTempScaleValues
+{
+    single,   //!< Single T-scaling value (either one group or all values =1)
+    multiple  //!< Multiple T-scaling values, need to use T-group indices
+};
+
+/*! \brief Sets if to apply no or diagonal Parrinello-Rahman pressure scaling
+ *
+ * Note that this enum is only used in updateMdLeapfrogSimple(), which does
+ * not handle fully anistropic Parrinello-Rahman scaling, so we only have
+ * options \p no and \p diagonal here and no anistropic option.
+ */
+enum class ApplyParrinelloRahmanVScaling
+{
+    no,       //!< Do not apply velocity scaling (not a PR-coupling run or step)
+    diagonal  //!< Apply velocity scaling using a diagonal matrix
+};
+
+/*! \brief Integrate using leap-frog with T-scaling and optionally diagonal Parrinello-Rahman p-coupling
+ *
+ * \tparam       numTempScaleValues     The number of different T-couple values
+ * \tparam       applyPRVScaling        Apply Parrinello-Rahman velocity scaling
+ * \param[in]    start                  Index of first atom to update
+ * \param[in]    nrend                  Last atom to update: \p nrend - 1
+ * \param[in]    dt                     The time step
+ * \param[in]    dtPressureCouple       Time step for pressure coupling
+ * \param[in]    invMassPerDim          1/mass per atom and dimension
+ * \param[in]    tcstat                 Temperature coupling information
+ * \param[in]    cTC                    T-coupling group index per atom
+ * \param[in]    pRVScaleMatrixDiagonal Parrinello-Rahman v-scale matrix diagonal
+ * \param[in]    x                      Input coordinates
+ * \param[out]   xprime                 Updated coordinates
+ * \param[inout] v                      Velocities
+ * \param[in]    f                      Forces
+ *
+ * We expect this template to get good SIMD acceleration by most compilers,
+ * unlike the more complex general template.
+ * Note that we might get even better SIMD acceleration when we introduce
+ * aligned (and padded) memory, possibly with some hints for the compilers.
+ */
+template<NumTempScaleValues            numTempScaleValues,
+         ApplyParrinelloRahmanVScaling applyPRVScaling>
+static void
+updateMdLeapfrogSimple(int                       start,
+                       int                       nrend,
+                       real                      dt,
+                       real                      dtPressureCouple,
+                       const rvec * gmx_restrict invMassPerDim,
+                       const t_grp_tcstat      * tcstat,
+                       const unsigned short    * cTC,
+                       const rvec                pRVScaleMatrixDiagonal,
+                       const rvec * gmx_restrict x,
+                       rvec       * gmx_restrict xprime,
+                       rvec       * gmx_restrict v,
+                       const rvec * gmx_restrict f)
+{
+    real lambdaGroup;
+
+    if (numTempScaleValues == NumTempScaleValues::single)
+    {
+        lambdaGroup = tcstat[0].lambda;
+    }
+
+    for (int a = start; a < nrend; a++)
+    {
+        if (numTempScaleValues == NumTempScaleValues::multiple)
         {
-            imass = invmass[n];
-            if (cFREEZE)
-            {
-                gf   = cFREEZE[n];
-            }
-            if (cACC)
-            {
-                ga   = cACC[n];
-            }
-            if (cTC)
-            {
-                gt   = cTC[n];
-            }
-            lg   = tcstat[gt].lambda;
-            if (bNH)
+            lambdaGroup = tcstat[cTC[a]].lambda;
+        }
+
+        for (int d = 0; d < DIM; d++)
+        {
+            /* Note that using rvec invMassPerDim results in more efficient
+             * SIMD code, but this increases the cache pressure.
+             * For large systems with PME on the CPU this slows down the
+             * (then already slow) update by 20%. If all data remains in cache,
+             * using rvec is much faster.
+             */
+            real vNew = lambdaGroup*v[a][d] + f[a][d]*invMassPerDim[a][d]*dt;
+
+            if (applyPRVScaling == ApplyParrinelloRahmanVScaling::diagonal)
             {
-                vxi   = nh_vxi[gt];
+                vNew -= dtPressureCouple*pRVScaleMatrixDiagonal[d]*v[a][d];
             }
-            rvec_sub(v[n], gstat[ga].u, vrel);
+            v[a][d]      = vNew;
+            xprime[a][d] = x[a][d] + vNew*dt;
+        }
+    }
+}
 
-            for (d = 0; d < DIM; d++)
-            {
-                if ((ptype[n] != eptVSite) && (ptype[n] != eptShell) && !nFreeze[gf][d])
-                {
-                    vnrel = (lg*vrel[d] + dt*(imass*f[n][d] - 0.5*vxi*vrel[d]
-                                              - nstpcouple*iprod(M[d], vrel)))/(1 + 0.5*vxi*dt);
-                    /* do not scale the mean velocities u */
-                    vn             = gstat[ga].u[d] + accel[ga][d]*dt + vnrel;
-                    v[n][d]        = vn;
-                    xprime[n][d]   = x[n][d]+vn*dt;
-                }
-                else
+/*! \brief Sets the NEMD acceleration type */
+enum class AccelerationType
+{
+    none, group, cosine
+};
+
+/*! \brief Integrate using leap-frog with support for everything
+ *
+ * \tparam       accelerationType       Type of NEMD acceleration
+ * \param[in]    start                  Index of first atom to update
+ * \param[in]    nrend                  Last atom to update: \p nrend - 1
+ * \param[in]    doNoseHoover           If to apply Nose-Hoover T-coupling
+ * \param[in]    dt                     The time step
+ * \param[in]    dtPressureCouple       Time step for pressure coupling, is 0 when no pressure coupling should be applied at this step
+ * \param[in]    ir                     The input parameter record
+ * \param[in]    md                     Atom properties
+ * \param[in]    ekind                  Kinetic energy data
+ * \param[in]    box                    The box dimensions
+ * \param[in]    x                      Input coordinates
+ * \param[out]   xprime                 Updated coordinates
+ * \param[inout] v                      Velocities
+ * \param[in]    f                      Forces
+ * \param[in]    nh_vxi                 Nose-Hoover velocity scaling factors
+ * \param[in]    M                      Parrinello-Rahman scaling matrix
+ */
+template<AccelerationType accelerationType>
+static void
+updateMdLeapfrogGeneral(int                         start,
+                        int                         nrend,
+                        bool                        doNoseHoover,
+                        real                        dt,
+                        real                        dtPressureCouple,
+                        const t_inputrec          * ir,
+                        const t_mdatoms           * md,
+                        const gmx_ekindata_t      * ekind,
+                        const matrix                box,
+                        const rvec   * gmx_restrict x,
+                        rvec         * gmx_restrict xprime,
+                        rvec         * gmx_restrict v,
+                        const rvec   * gmx_restrict f,
+                        const double * gmx_restrict nh_vxi,
+                        const matrix                M)
+{
+    /* This is a version of the leap-frog integrator that supports
+     * all combinations of T-coupling, P-coupling and NEMD.
+     * Nose-Hoover uses the reversible leap-frog integrator from
+     * Holian et al. Phys Rev E 52(3) : 2338, 1995
+     */
+
+    const unsigned short    * cTC           = md->cTC;
+    const t_grp_tcstat      * tcstat        = ekind->tcstat;
+
+    const unsigned short    * cACC          = md->cACC;
+    const rvec              * accel         = ir->opts.acc;
+    const t_grp_acc         * grpstat       = ekind->grpstat;
+
+    const rvec * gmx_restrict invMassPerDim = md->invMassPerDim;
+
+    /* Initialize group values, changed later when multiple groups are used */
+    int  ga       = 0;
+    int  gt       = 0;
+    real factorNH = 0;
+
+    for (int n = start; n < nrend; n++)
+    {
+        if (cTC)
+        {
+            gt  = cTC[n];
+        }
+        real lg = tcstat[gt].lambda;
+
+        rvec vRel;
+        real cosineZ, vCosine;
+#ifdef __INTEL_COMPILER
+#pragma warning( disable : 280 )
+#endif
+        switch (accelerationType)
+        {
+            case AccelerationType::none:
+                copy_rvec(v[n], vRel);
+                break;
+            case AccelerationType::group:
+                if (cACC)
                 {
-                    v[n][d]        = 0.0;
-                    xprime[n][d]   = x[n][d];
+                    ga = cACC[n];
                 }
+                /* Avoid scaling the group velocity */
+                rvec_sub(v[n], grpstat[ga].u, vRel);
+                break;
+            case AccelerationType::cosine:
+                cosineZ = std::cos(x[n][ZZ]*static_cast<real>(M_PI)/box[ZZ][ZZ]);
+                vCosine = cosineZ*ekind->cosacc.vcos;
+                /* Avoid scaling the cosine profile velocity */
+                copy_rvec(v[n], vRel);
+                vRel[XX] -= vCosine;
+                break;
+        }
+
+        if (doNoseHoover)
+        {
+            /* Here we account for multiple time stepping, by increasing
+             * the Nose-Hoover correction by nsttcouple
+             */
+            factorNH = 0.5*ir->nsttcouple*dt*nh_vxi[gt];
+        }
+
+        for (int d = 0; d < DIM; d++)
+        {
+            real vNew =
+                (lg*vRel[d] + (f[n][d]*invMassPerDim[n][d]*dt - factorNH*vRel[d]
+                               - dtPressureCouple*iprod(M[d], vRel)))/(1 + factorNH);
+            switch (accelerationType)
+            {
+                case AccelerationType::none:
+                    break;
+                case AccelerationType::group:
+                    /* Add back the mean velocity and apply acceleration */
+                    vNew += grpstat[ga].u[d] + accel[ga][d]*dt;
+                    break;
+                case AccelerationType::cosine:
+                    if (d == XX)
+                    {
+                        /* Add back the mean velocity and apply acceleration */
+                        vNew += vCosine + cosineZ*ekind->cosacc.cos_accel*dt;
+                    }
+                    break;
             }
+            v[n][d]       = vNew;
+            xprime[n][d]  = x[n][d] + vNew*dt;
+        }
+    }
+}
+
+/*! \brief Handles the Leap-frog MD x and v integration */
+static void do_update_md(int                         start,
+                         int                         nrend,
+                         gmx_int64_t                 step,
+                         real                        dt,
+                         const t_inputrec          * ir,
+                         const t_mdatoms           * md,
+                         const gmx_ekindata_t      * ekind,
+                         const matrix                box,
+                         const rvec   * gmx_restrict x,
+                         rvec         * gmx_restrict xprime,
+                         rvec         * gmx_restrict v,
+                         const rvec   * gmx_restrict f,
+                         const double * gmx_restrict nh_vxi,
+                         const matrix                M)
+{
+    GMX_ASSERT(nrend == start || xprime != x, "For SIMD optimization certain compilers need to have xprime != x");
+
+    /* Note: Berendsen pressure scaling is handled after do_update_md() */
+    bool doTempCouple       = isTemperatureCouplingStep(step, ir);
+    bool doNoseHoover       = (ir->etc == etcNOSEHOOVER && doTempCouple);
+    bool doParrinelloRahman = (ir->epc == epcPARRINELLORAHMAN && isPressureCouplingStep(step, ir));
+    bool doPROffDiagonal    = (doParrinelloRahman && (M[YY][XX] != 0 || M[ZZ][XX] != 0 || M[ZZ][YY] != 0));
+
+    real dtPressureCouple   = (doParrinelloRahman ? ir->nstpcouple*dt : 0);
+
+    /* NEMD (also cosine) acceleration is applied in updateMdLeapFrogGeneral */
+    bool doAcceleration     = (ekind->bNEMD || ekind->cosacc.cos_accel != 0);
+
+    if (doNoseHoover || doPROffDiagonal || doAcceleration)
+    {
+        if (!doAcceleration)
+        {
+            updateMdLeapfrogGeneral<AccelerationType::none>
+                (start, nrend, doNoseHoover, dt, dtPressureCouple,
+                ir, md, ekind, box, x, xprime, v, f, nh_vxi, M);
+        }
+        else if (ekind->bNEMD)
+        {
+            updateMdLeapfrogGeneral<AccelerationType::group>
+                (start, nrend, doNoseHoover, dt, dtPressureCouple,
+                ir, md, ekind, box, x, xprime, v, f, nh_vxi, M);
+        }
+        else
+        {
+            updateMdLeapfrogGeneral<AccelerationType::cosine>
+                (start, nrend, doNoseHoover, dt, dtPressureCouple,
+                ir, md, ekind, box, x, xprime, v, f, nh_vxi, M);
         }
     }
-    else if (cFREEZE != NULL ||
-             nFreeze[0][XX] || nFreeze[0][YY] || nFreeze[0][ZZ] ||
-             bNEMD)
+    else
     {
-        /* Update with Berendsen/v-rescale coupling and freeze or NEMD */
-        for (n = start; n < nrend; n++)
+        /* We determine if we have a single T-coupling lambda value for all
+         * atoms. That allows for better SIMD acceleration in the template.
+         * If we do not do temperature coupling (in the run or this step),
+         * all scaling values are 1, so we effectively have a single value.
+         */
+        bool haveSingleTempScaleValue = (!doTempCouple || ekind->ngtc == 1);
+
+        /* Extract some pointers needed by all cases */
+        const unsigned short *cTC           = md->cTC;
+        const t_grp_tcstat   *tcstat        = ekind->tcstat;
+        const rvec           *invMassPerDim = md->invMassPerDim;
+
+        if (doParrinelloRahman)
         {
-            w_dt = invmass[n]*dt;
-            if (cFREEZE)
-            {
-                gf   = cFREEZE[n];
-            }
-            if (cACC)
+            GMX_ASSERT(!doPROffDiagonal, "updateMdLeapfrogSimple only support diagonal Parrinello-Rahman scaling matrices");
+
+            rvec diagM;
+            for (int d = 0; d < DIM; d++)
             {
-                ga   = cACC[n];
+                diagM[d] = M[d][d];
             }
-            if (cTC)
+
+            if (haveSingleTempScaleValue)
             {
-                gt   = cTC[n];
+                updateMdLeapfrogSimple
+                <NumTempScaleValues::single,
+                 ApplyParrinelloRahmanVScaling::diagonal>
+                    (start, nrend, dt, dtPressureCouple,
+                    invMassPerDim, tcstat, cTC, diagM, x, xprime, v, f);
             }
-            lg   = tcstat[gt].lambda;
-
-            for (d = 0; d < DIM; d++)
+            else
             {
-                vn             = v[n][d];
-                if ((ptype[n] != eptVSite) && (ptype[n] != eptShell) && !nFreeze[gf][d])
-                {
-                    vv             = lg*vn + f[n][d]*w_dt;
-
-                    /* do not scale the mean velocities u */
-                    u              = gstat[ga].u[d];
-                    va             = vv + accel[ga][d]*dt;
-                    vb             = va + (1.0-lg)*u;
-                    v[n][d]        = vb;
-                    xprime[n][d]   = x[n][d]+vb*dt;
-                }
-                else
-                {
-                    v[n][d]        = 0.0;
-                    xprime[n][d]   = x[n][d];
-                }
+                updateMdLeapfrogSimple
+                <NumTempScaleValues::multiple,
+                 ApplyParrinelloRahmanVScaling::diagonal>
+                    (start, nrend, dt, dtPressureCouple,
+                    invMassPerDim, tcstat, cTC, diagM, x, xprime, v, f);
             }
         }
-    }
-    else
-    {
-        /* Plain update with Berendsen/v-rescale coupling */
-        for (n = start; n < nrend; n++)
+        else
         {
-            if ((ptype[n] != eptVSite) && (ptype[n] != eptShell))
+            if (haveSingleTempScaleValue)
             {
-                w_dt = invmass[n]*dt;
-                if (cTC)
-                {
-                    gt = cTC[n];
-                }
-                lg = tcstat[gt].lambda;
-
-                for (d = 0; d < DIM; d++)
-                {
-                    vn           = lg*v[n][d] + f[n][d]*w_dt;
-                    v[n][d]      = vn;
-                    xprime[n][d] = x[n][d] + vn*dt;
-                }
+                updateMdLeapfrogSimple
+                <NumTempScaleValues::single,
+                 ApplyParrinelloRahmanVScaling::no>
+                    (start, nrend, dt, dtPressureCouple,
+                    invMassPerDim, tcstat, cTC, nullptr, x, xprime, v, f);
             }
             else
             {
-                for (d = 0; d < DIM; d++)
-                {
-                    v[n][d]        = 0.0;
-                    xprime[n][d]   = x[n][d];
-                }
+                updateMdLeapfrogSimple
+                <NumTempScaleValues::multiple,
+                 ApplyParrinelloRahmanVScaling::no>
+                    (start, nrend, dt, dtPressureCouple,
+                    invMassPerDim, tcstat, cTC, nullptr, x, xprime, v, f);
             }
         }
     }
 }
 
-static void do_update_vv_vel(int start, int nrend, double dt,
+static void do_update_vv_vel(int start, int nrend, real dt,
                              rvec accel[], ivec nFreeze[], real invmass[],
                              unsigned short ptype[], unsigned short cFREEZE[],
-                             unsigned short cACC[], rvec v[], rvec f[],
+                             unsigned short cACC[], rvec v[], const rvec f[],
                              gmx_bool bExtended, real veta, real alpha)
 {
-    double w_dt;
     int    gf = 0, ga = 0;
     int    n, d;
-    double g, mv1, mv2;
+    real   g, mv1, mv2;
 
     if (bExtended)
     {
         g        = 0.25*dt*veta*alpha;
-        mv1      = exp(-g);
+        mv1      = std::exp(-g);
         mv2      = gmx::series_sinhx(g);
     }
     else
@@ -282,7 +509,7 @@ static void do_update_vv_vel(int start, int nrend, double dt,
     }
     for (n = start; n < nrend; n++)
     {
-        w_dt = invmass[n]*dt;
+        real w_dt = invmass[n]*dt;
         if (cFREEZE)
         {
             gf   = cFREEZE[n];
@@ -306,21 +533,21 @@ static void do_update_vv_vel(int start, int nrend, double dt,
     }
 } /* do_update_vv_vel */
 
-static void do_update_vv_pos(int start, int nrend, double dt,
+static void do_update_vv_pos(int start, int nrend, real dt,
                              ivec nFreeze[],
                              unsigned short ptype[], unsigned short cFREEZE[],
-                             rvec x[], rvec xprime[], rvec v[],
+                             const rvec x[], rvec xprime[], rvec v[],
                              gmx_bool bExtended, real veta)
 {
     int    gf = 0;
     int    n, d;
-    double g, mr1, mr2;
+    real   g, mr1, mr2;
 
     /* Would it make more sense if Parrinello-Rahman was put here? */
     if (bExtended)
     {
         g        = 0.5*dt*veta;
-        mr1      = exp(g);
+        mr1      = std::exp(g);
         mr2      = gmx::series_sinhx(g);
     }
     else
@@ -351,114 +578,6 @@ static void do_update_vv_pos(int start, int nrend, double dt,
     }
 } /* do_update_vv_pos */
 
-static void do_update_visc(int start, int nrend,
-                           double dt, int nstpcouple,
-                           t_grp_tcstat *tcstat,
-                           double nh_vxi[],
-                           real invmass[],
-                           unsigned short ptype[], unsigned short cTC[],
-                           rvec x[], rvec xprime[], rvec v[],
-                           rvec f[], matrix M, matrix box, real
-                           cos_accel, real vcos,
-                           gmx_bool bNH, gmx_bool bPR)
-{
-    double imass, w_dt;
-    int    gt = 0;
-    real   vn, vc;
-    real   lg, vxi = 0, vv;
-    real   fac, cosz;
-    rvec   vrel;
-    int    n, d;
-
-    fac = 2*M_PI/(box[ZZ][ZZ]);
-
-    if (bNH || bPR)
-    {
-        /* Update with coupling to extended ensembles, used for
-         * Nose-Hoover and Parrinello-Rahman coupling
-         */
-        for (n = start; n < nrend; n++)
-        {
-            imass = invmass[n];
-            if (cTC)
-            {
-                gt   = cTC[n];
-            }
-            lg   = tcstat[gt].lambda;
-            cosz = cos(fac*x[n][ZZ]);
-
-            copy_rvec(v[n], vrel);
-
-            vc            = cosz*vcos;
-            vrel[XX]     -= vc;
-            if (bNH)
-            {
-                vxi        = nh_vxi[gt];
-            }
-            for (d = 0; d < DIM; d++)
-            {
-                if ((ptype[n] != eptVSite) && (ptype[n] != eptShell))
-                {
-                    vn  = (lg*vrel[d] + dt*(imass*f[n][d] - 0.5*vxi*vrel[d]
-                                            - nstpcouple*iprod(M[d], vrel)))/(1 + 0.5*vxi*dt);
-                    if (d == XX)
-                    {
-                        vn += vc + dt*cosz*cos_accel;
-                    }
-                    v[n][d]        = vn;
-                    xprime[n][d]   = x[n][d]+vn*dt;
-                }
-                else
-                {
-                    xprime[n][d]   = x[n][d];
-                }
-            }
-        }
-    }
-    else
-    {
-        /* Classic version of update, used with berendsen coupling */
-        for (n = start; n < nrend; n++)
-        {
-            w_dt = invmass[n]*dt;
-            if (cTC)
-            {
-                gt   = cTC[n];
-            }
-            lg   = tcstat[gt].lambda;
-            cosz = cos(fac*x[n][ZZ]);
-
-            for (d = 0; d < DIM; d++)
-            {
-                vn             = v[n][d];
-
-                if ((ptype[n] != eptVSite) && (ptype[n] != eptShell))
-                {
-                    if (d == XX)
-                    {
-                        vc           = cosz*vcos;
-                        /* Do not scale the cosine velocity profile */
-                        vv           = vc + lg*(vn - vc + f[n][d]*w_dt);
-                        /* Add the cosine accelaration profile */
-                        vv          += dt*cosz*cos_accel;
-                    }
-                    else
-                    {
-                        vv           = lg*(vn + f[n][d]*w_dt);
-                    }
-                    v[n][d]        = vv;
-                    xprime[n][d]   = x[n][d]+vv*dt;
-                }
-                else
-                {
-                    v[n][d]        = 0.0;
-                    xprime[n][d]   = x[n][d];
-                }
-            }
-        }
-    }
-}
-
 static gmx_stochd_t *init_stochd(const t_inputrec *ir)
 {
     gmx_stochd_t   *sd;
@@ -483,7 +602,7 @@ static gmx_stochd_t *init_stochd(const t_inputrec *ir)
         {
             if (opts->tau_t[gt] > 0)
             {
-                sdc[gt].em  = exp(-ir->delta_t/opts->tau_t[gt]);
+                sdc[gt].em  = std::exp(-ir->delta_t/opts->tau_t[gt]);
             }
             else
             {
@@ -550,9 +669,7 @@ void update_temperature_constants(gmx_update_t *upd, const t_inputrec *ir)
 
 gmx_update_t *init_update(const t_inputrec *ir)
 {
-    gmx_update_t *upd;
-
-    snew(upd, 1);
+    gmx_update_t *upd = new(gmx_update_t);
 
     if (ir->eI == eiBD || EI_SD(ir->eI) || ir->etc == etcVRESCALE || ETC_ANDERSEN(ir->etc))
     {
@@ -561,31 +678,27 @@ gmx_update_t *init_update(const t_inputrec *ir)
 
     update_temperature_constants(upd, ir);
 
-    upd->xp        = NULL;
-    upd->xp_nalloc = 0;
+    upd->xp.resize(0);
 
     return upd;
 }
 
-void update_realloc(gmx_update_t *upd, int state_nalloc)
+void update_realloc(gmx_update_t *upd, int natoms)
 {
     GMX_ASSERT(upd, "upd must be allocated before its fields can be reallocated");
-    if (state_nalloc > upd->xp_nalloc)
-    {
-        upd->xp_nalloc = state_nalloc;
-        /* We need to allocate one element extra, since we might use
-         * (unaligned) 4-wide SIMD loads to access rvec entries. */
-        srenew(upd->xp, upd->xp_nalloc + 1);
-    }
+
+    /* We need to allocate one element extra, since we might use
+     * (unaligned) 4-wide SIMD loads to access rvec entries. */
+    upd->xp.resize(natoms + 1);
 }
 
 static void do_update_sd1(gmx_stochd_t *sd,
-                          int start, int nrend, double dt,
+                          int start, int nrend, real dt,
                           rvec accel[], ivec nFreeze[],
                           real invmass[], unsigned short ptype[],
                           unsigned short cFREEZE[], unsigned short cACC[],
                           unsigned short cTC[],
-                          rvec x[], rvec xprime[], rvec v[], rvec f[],
+                          const rvec x[], rvec xprime[], rvec v[], const rvec f[],
                           gmx_bool bDoConstr,
                           gmx_bool bFirstHalfConstr,
                           gmx_int64_t step, int seed, int* gatindex)
@@ -724,12 +837,12 @@ static void do_update_sd1(gmx_stochd_t *sd,
     }
 }
 
-static void do_update_bd(int start, int nrend, double dt,
+static void do_update_bd(int start, int nrend, real dt,
                          ivec nFreeze[],
                          real invmass[], unsigned short ptype[],
                          unsigned short cFREEZE[], unsigned short cTC[],
-                         rvec x[], rvec xprime[], rvec v[],
-                         rvec f[], real friction_coefficient,
+                         const rvec x[], rvec xprime[], rvec v[],
+                         const rvec f[], real friction_coefficient,
                          real *rf, gmx_int64_t step, int seed,
                          int* gatindex)
 {
@@ -791,17 +904,23 @@ static void do_update_bd(int start, int nrend, double dt,
 }
 
 static void dump_it_all(FILE gmx_unused *fp, const char gmx_unused *title,
-                        int gmx_unused natoms, rvec gmx_unused x[], rvec gmx_unused xp[],
-                        rvec gmx_unused v[], rvec gmx_unused f[])
+                        int gmx_unused natoms,
+                        const gmx_unused PaddedRVecVector *x,
+                        const gmx_unused PaddedRVecVector *xp,
+                        const gmx_unused PaddedRVecVector *v,
+                        const gmx_unused PaddedRVecVector *f)
 {
 #ifdef DEBUG
     if (fp)
     {
         fprintf(fp, "%s\n", title);
-        pr_rvecs(fp, 0, "x", x, natoms);
-        pr_rvecs(fp, 0, "xp", xp, natoms);
-        pr_rvecs(fp, 0, "v", v, natoms);
-        pr_rvecs(fp, 0, "f", f, natoms);
+        pr_rvecs(fp, 0, "x", as_rvec_array(x->data()), natoms);
+        pr_rvecs(fp, 0, "xp", as_rvec_array(xp->data()), natoms);
+        pr_rvecs(fp, 0, "v", as_rvec_array(v->data()), natoms);
+        if (f != NULL)
+        {
+            pr_rvecs(fp, 0, "f", as_rvec_array(f->data()), natoms);
+        }
     }
 #endif
 }
@@ -1000,11 +1119,11 @@ void calc_ke_part(t_state *state, t_grpopts *opts, t_mdatoms *md,
 {
     if (ekind->cosacc.cos_accel == 0)
     {
-        calc_ke_part_normal(state->v, opts, md, ekind, nrnb, bEkinAveVel);
+        calc_ke_part_normal(as_rvec_array(state->v.data()), opts, md, ekind, nrnb, bEkinAveVel);
     }
     else
     {
-        calc_ke_part_visc(state->box, state->x, state->v, opts, md, ekind, nrnb, bEkinAveVel);
+        calc_ke_part_visc(state->box, as_rvec_array(state->x.data()), as_rvec_array(state->v.data()), opts, md, ekind, nrnb, bEkinAveVel);
     }
 }
 
@@ -1014,9 +1133,9 @@ extern void init_ekinstate(ekinstate_t *ekinstate, const t_inputrec *ir)
     snew(ekinstate->ekinh, ekinstate->ekin_n);
     snew(ekinstate->ekinf, ekinstate->ekin_n);
     snew(ekinstate->ekinh_old, ekinstate->ekin_n);
-    snew(ekinstate->ekinscalef_nhc, ekinstate->ekin_n);
-    snew(ekinstate->ekinscaleh_nhc, ekinstate->ekin_n);
-    snew(ekinstate->vscale_nhc, ekinstate->ekin_n);
+    ekinstate->ekinscalef_nhc.resize(ekinstate->ekin_n);
+    ekinstate->ekinscaleh_nhc.resize(ekinstate->ekin_n);
+    ekinstate->vscale_nhc.resize(ekinstate->ekin_n);
     ekinstate->dekindl = 0;
     ekinstate->mvcos   = 0;
 }
@@ -1157,122 +1276,70 @@ void update_tcouple(gmx_int64_t       step,
                     t_mdatoms        *md)
 
 {
-    gmx_bool   bTCouple = FALSE;
-    real       dttc;
-    int        i, offset;
+    bool doTemperatureCoupling = false;
 
     /* if using vv with trotter decomposition methods, we do this elsewhere in the code */
-    if (inputrec->etc != etcNO &&
-        !(inputrecNvtTrotter(inputrec) || inputrecNptTrotter(inputrec) || inputrecNphTrotter(inputrec)))
+    if (!(EI_VV(inputrec->eI) &&
+          (inputrecNvtTrotter(inputrec) || inputrecNptTrotter(inputrec) || inputrecNphTrotter(inputrec))))
     {
-        /* We should only couple after a step where energies were determined (for leapfrog versions)
-           or the step energies are determined, for velocity verlet versions */
-
-        if (EI_VV(inputrec->eI))
-        {
-            offset = 0;
-        }
-        else
-        {
-            offset = 1;
-        }
-        bTCouple = (inputrec->nsttcouple == 1 ||
-                    do_per_step(step+inputrec->nsttcouple-offset,
-                                inputrec->nsttcouple));
+        doTemperatureCoupling = isTemperatureCouplingStep(step, inputrec);
     }
 
-    if (bTCouple)
+    if (doTemperatureCoupling)
     {
-        dttc = inputrec->nsttcouple*inputrec->delta_t;
+        real dttc = inputrec->nsttcouple*inputrec->delta_t;
 
         switch (inputrec->etc)
         {
             case etcNO:
                 break;
             case etcBERENDSEN:
-                berendsen_tcoupl(inputrec, ekind, dttc);
+                berendsen_tcoupl(inputrec, ekind, dttc, state->therm_integral);
                 break;
             case etcNOSEHOOVER:
                 nosehoover_tcoupl(&(inputrec->opts), ekind, dttc,
-                                  state->nosehoover_xi, state->nosehoover_vxi, MassQ);
+                                  state->nosehoover_xi.data(), state->nosehoover_vxi.data(), MassQ);
                 break;
             case etcVRESCALE:
                 vrescale_tcoupl(inputrec, step, ekind, dttc,
-                                state->therm_integral);
+                                state->therm_integral.data());
                 break;
         }
         /* rescale in place here */
         if (EI_VV(inputrec->eI))
         {
-            rescale_velocities(ekind, md, 0, md->homenr, state->v);
+            rescale_velocities(ekind, md, 0, md->homenr, as_rvec_array(state->v.data()));
         }
     }
     else
     {
         /* Set the T scaling lambda to 1 to have no scaling */
-        for (i = 0; (i < inputrec->opts.ngtc); i++)
+        for (int i = 0; (i < inputrec->opts.ngtc); i++)
         {
             ekind->tcstat[i].lambda = 1.0;
         }
     }
 }
 
-void update_pcouple(FILE             *fplog,
-                    gmx_int64_t       step,
-                    t_inputrec       *inputrec,
-                    t_state          *state,
-                    matrix            pcoupl_mu,
-                    matrix            M,
-                    gmx_bool          bInitStep)
+void update_pcouple_before_coordinates(FILE             *fplog,
+                                       gmx_int64_t       step,
+                                       const t_inputrec *inputrec,
+                                       t_state          *state,
+                                       matrix            parrinellorahmanMu,
+                                       matrix            M,
+                                       gmx_bool          bInitStep)
 {
-    gmx_bool   bPCouple = FALSE;
-    real       dtpc     = 0;
-    int        i;
-
-    /* if using Trotter pressure, we do this in coupling.c, so we leave it false. */
-    if (inputrec->epc != epcNO && (!(inputrecNptTrotter(inputrec) || inputrecNphTrotter(inputrec))))
-    {
-        /* We should only couple after a step where energies were determined */
-        bPCouple = (inputrec->nstpcouple == 1 ||
-                    do_per_step(step+inputrec->nstpcouple-1,
-                                inputrec->nstpcouple));
-    }
-
-    clear_mat(pcoupl_mu);
-    for (i = 0; i < DIM; i++)
-    {
-        pcoupl_mu[i][i] = 1.0;
-    }
-
-    clear_mat(M);
-
-    if (bPCouple)
+    /* Berendsen P-coupling is completely handled after the coordinate update.
+     * Trotter P-coupling is handled by separate calls to trotter_update().
+     */
+    if (inputrec->epc == epcPARRINELLORAHMAN &&
+        isPressureCouplingStep(step, inputrec))
     {
-        dtpc = inputrec->nstpcouple*inputrec->delta_t;
+        real dtpc = inputrec->nstpcouple*inputrec->delta_t;
 
-        switch (inputrec->epc)
-        {
-            /* We can always pcoupl, even if we did not sum the energies
-             * the previous step, since state->pres_prev is only updated
-             * when the energies have been summed.
-             */
-            case (epcNO):
-                break;
-            case (epcBERENDSEN):
-                if (!bInitStep)
-                {
-                    berendsen_pcoupl(fplog, step, inputrec, dtpc, state->pres_prev, state->box,
-                                     pcoupl_mu);
-                }
-                break;
-            case (epcPARRINELLORAHMAN):
-                parrinellorahman_pcoupl(fplog, step, inputrec, dtpc, state->pres_prev,
-                                        state->box, state->box_rel, state->boxv,
-                                        M, pcoupl_mu, bInitStep);
-                break;
-            default:
-                break;
-        }
+        parrinellorahman_pcoupl(fplog, step, inputrec, dtpc, state->pres_prev,
+                                state->box, state->box_rel, state->boxv,
+                                M, parrinellorahmanMu, bInitStep);
     }
 }
 
@@ -1284,7 +1351,7 @@ void update_constraints(FILE             *fplog,
                         t_state          *state,
                         gmx_bool          bMolPBC,
                         t_graph          *graph,
-                        rvec              force[],   /* forces on home particles */
+                        PaddedRVecVector *force,     /* forces on home particles */
                         t_idef           *idef,
                         tensor            vir_part,
                         t_commrec        *cr,
@@ -1296,8 +1363,6 @@ void update_constraints(FILE             *fplog,
                         gmx_bool          bCalcVir)
 {
     gmx_bool             bLastStep, bLog = FALSE, bEner = FALSE, bDoConstr = FALSE;
-    double               dt;
-    int                  start, homenr, nrend, i;
     tensor               vir_con;
     int                  nth, th;
 
@@ -1313,11 +1378,18 @@ void update_constraints(FILE             *fplog,
     /* for now, SD update is here -- though it really seems like it
        should be reformulated as a velocity verlet method, since it has two parts */
 
-    start  = 0;
-    homenr = md->homenr;
-    nrend  = start+homenr;
+    int  start  = 0;
+    int  homenr = md->homenr;
+    int  nrend  = start+homenr;
 
-    dt   = inputrec->delta_t;
+    /* Cast delta_t from double to real to make the integrators faster.
+     * The only reason for having delta_t double is to get accurate values
+     * for t=delta_t*step when step is larger than float precision.
+     * For integration dt the accuracy of real suffices, since with
+     * integral += dt*integrand the increment is nearly always (much) smaller
+     * than the integral (and the integrand has real precision).
+     */
+    real dt     = inputrec->delta_t;
 
     /*
      *  Steps (7C, 8C)
@@ -1342,28 +1414,28 @@ void update_constraints(FILE             *fplog,
         wallcycle_start(wcycle, ewcCONSTR);
         if (EI_VV(inputrec->eI) && bFirstHalf)
         {
-            constrain(NULL, bLog, bEner, constr, idef,
+            constrain(nullptr, bLog, bEner, constr, idef,
                       inputrec, cr, step, 1, 1.0, md,
-                      state->x, state->v, state->v,
+                      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,
-                      NULL, bCalcVir ? &vir_con : NULL, nrnb, econqVeloc);
+                      nullptr, bCalcVir ? &vir_con : nullptr, nrnb, econqVeloc);
         }
         else
         {
-            constrain(NULL, bLog, bEner, constr, idef,
+            constrain(nullptr, bLog, bEner, constr, idef,
                       inputrec, cr, step, 1, 1.0, md,
-                      state->x, upd->xp, NULL,
+                      as_rvec_array(state->x.data()), as_rvec_array(upd->xp.data()), nullptr,
                       bMolPBC, state->box,
                       state->lambda[efptBONDED], dvdlambda,
-                      state->v, bCalcVir ? &vir_con : NULL, nrnb, econqCoord);
+                      as_rvec_array(state->v.data()), bCalcVir ? &vir_con : nullptr, nrnb, econqCoord);
         }
         wallcycle_stop(wcycle, ewcCONSTR);
 
         where();
 
         dump_it_all(fplog, "After Shake",
-                    state->natoms, state->x, upd->xp, state->v, force);
+                    state->natoms, &state->x, &upd->xp, &state->v, force);
 
         if (bCalcVir)
         {
@@ -1399,10 +1471,10 @@ void update_constraints(FILE             *fplog,
                               inputrec->opts.acc, inputrec->opts.nFreeze,
                               md->invmass, md->ptype,
                               md->cFREEZE, md->cACC, md->cTC,
-                              state->x, upd->xp, state->v, force,
+                              as_rvec_array(state->x.data()), as_rvec_array(upd->xp.data()), as_rvec_array(state->v.data()), as_rvec_array(force->data()),
                               bDoConstr, FALSE,
                               step, inputrec->ld_seed,
-                              DOMAINDECOMP(cr) ? cr->dd->gatindex : NULL);
+                              DOMAINDECOMP(cr) ? cr->dd->gatindex : nullptr);
             }
             GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
         }
@@ -1414,12 +1486,12 @@ void update_constraints(FILE             *fplog,
             /* Constrain the coordinates upd->xp for half a time step */
             wallcycle_start(wcycle, ewcCONSTR);
 
-            constrain(NULL, bLog, bEner, constr, idef,
+            constrain(nullptr, bLog, bEner, constr, idef,
                       inputrec, cr, step, 1, 0.5, md,
-                      state->x, upd->xp, NULL,
+                      as_rvec_array(state->x.data()), as_rvec_array(upd->xp.data()), nullptr,
                       bMolPBC, state->box,
                       state->lambda[efptBONDED], dvdlambda,
-                      state->v, NULL, nrnb, econqCoord);
+                      as_rvec_array(state->v.data()), nullptr, nrnb, econqCoord);
 
             wallcycle_stop(wcycle, ewcCONSTR);
         }
@@ -1437,7 +1509,7 @@ void update_constraints(FILE             *fplog,
          */
         wallcycle_start_nocount(wcycle, ewcUPDATE);
 
-        if (md->cFREEZE != NULL && constr != NULL)
+        if (md->cFREEZE != nullptr && constr != nullptr)
         {
             /* If we have atoms that are frozen along some, but not all
              * dimensions, the constraints will have moved them also along
@@ -1475,7 +1547,7 @@ void update_constraints(FILE             *fplog,
 
         if (graph && (graph->nnodes > 0))
         {
-            unshift_x(graph, state->box, state->x, upd->xp);
+            unshift_x(graph, state->box, as_rvec_array(state->x.data()), as_rvec_array(upd->xp.data()));
             if (TRICLINIC(state->box))
             {
                 inc_nrnb(nrnb, eNR_SHIFTX, 2*graph->nnodes);
@@ -1487,42 +1559,44 @@ void update_constraints(FILE             *fplog,
         }
         else
         {
+            /* The copy is performance sensitive, so use a bare pointer */
+            rvec *xp = as_rvec_array(upd->xp.data());
 #ifndef __clang_analyzer__
             // cppcheck-suppress unreadVariable
             nth = gmx_omp_nthreads_get(emntUpdate);
 #endif
 #pragma omp parallel for num_threads(nth) schedule(static)
-            for (i = start; i < nrend; i++)
+            for (int i = start; i < nrend; i++)
             {
                 // Trivial statement, does not throw
-                copy_rvec(upd->xp[i], state->x[i]);
+                copy_rvec(xp[i], state->x[i]);
             }
         }
         wallcycle_stop(wcycle, ewcUPDATE);
 
         dump_it_all(fplog, "After unshift",
-                    state->natoms, state->x, upd->xp, state->v, force);
+                    state->natoms, &state->x, &upd->xp, &state->v, force);
     }
 /* ############# END the update of velocities and positions ######### */
 }
 
-void update_box(FILE             *fplog,
-                gmx_int64_t       step,
-                t_inputrec       *inputrec,  /* input record and box stuff     */
-                t_mdatoms        *md,
-                t_state          *state,
-                rvec              force[],   /* forces on home particles */
-                matrix            pcoupl_mu,
-                t_nrnb           *nrnb,
-                gmx_update_t     *upd)
+void update_pcouple_after_coordinates(FILE             *fplog,
+                                      gmx_int64_t       step,
+                                      const t_inputrec *inputrec,
+                                      const t_mdatoms  *md,
+                                      const matrix      pressure,
+                                      const matrix      forceVirial,
+                                      const matrix      constraintVirial,
+                                      const matrix      parrinellorahmanMu,
+                                      t_state          *state,
+                                      t_nrnb           *nrnb,
+                                      gmx_update_t     *upd)
 {
-    double               dt;
-    int                  start, homenr, i, n, m;
+    int  start  = 0;
+    int  homenr = md->homenr;
 
-    start  = 0;
-    homenr = md->homenr;
-
-    dt = inputrec->delta_t;
+    /* Cast to real for faster code, no loss in precision (see comment above) */
+    real dt     = inputrec->delta_t;
 
     where();
 
@@ -1532,35 +1606,41 @@ void update_box(FILE             *fplog,
         case (epcNO):
             break;
         case (epcBERENDSEN):
-            /* We should only scale after a step where the pressure (kinetic
-             * energy and virial) was calculated. This happens after the
-             * coordinate update, whereas the current routine is called before
-             * that, so we scale when step % nstpcouple = 1 instead of 0.
-             */
-            if (inputrec->nstpcouple == 1 || (step % inputrec->nstpcouple == 1))
+            if (isPressureCouplingStep(step, inputrec))
             {
-                berendsen_pscale(inputrec, pcoupl_mu, state->box, state->box_rel,
-                                 start, homenr, state->x, md->cFREEZE, nrnb);
+                real   dtpc = inputrec->nstpcouple*dt;
+                matrix mu;
+                berendsen_pcoupl(fplog, step, inputrec, dtpc,
+                                 pressure, state->box,
+                                 forceVirial, constraintVirial,
+                                 mu, &state->baros_integral);
+                berendsen_pscale(inputrec, mu, state->box, state->box_rel,
+                                 start, homenr, as_rvec_array(state->x.data()),
+                                 md->cFREEZE, nrnb);
             }
             break;
         case (epcPARRINELLORAHMAN):
-            /* The box velocities were updated in do_pr_pcoupl in the update
-             * iteration, but we dont change the box vectors until we get here
-             * since we need to be able to shift/unshift above.
-             */
-            for (i = 0; i < DIM; i++)
+            if (isPressureCouplingStep(step, inputrec))
             {
-                for (m = 0; m <= i; m++)
+                /* The box velocities were updated in do_pr_pcoupl,
+                 * but we dont change the box vectors until we get here
+                 * since we need to be able to shift/unshift above.
+                 */
+                real dtpc = inputrec->nstpcouple*dt;
+                for (int i = 0; i < DIM; i++)
                 {
-                    state->box[i][m] += dt*state->boxv[i][m];
+                    for (int m = 0; m <= i; m++)
+                    {
+                        state->box[i][m] += dtpc*state->boxv[i][m];
+                    }
                 }
-            }
-            preserve_box_shape(inputrec, state->box_rel, state->box);
+                preserve_box_shape(inputrec, state->box_rel, state->box);
 
-            /* Scale the coordinates */
-            for (n = start; (n < start+homenr); n++)
-            {
-                tmvmul_ur0(pcoupl_mu, state->x[n], state->x[n]);
+                /* Scale the coordinates */
+                for (int n = start; n < start + homenr; n++)
+                {
+                    tmvmul_ur0(parrinellorahmanMu, state->x[n], state->x[n]);
+                }
             }
             break;
         case (epcMTTK):
@@ -1571,7 +1651,7 @@ void update_box(FILE             *fplog,
                        ln V_new = ln V_old + 3*dt*veta => V_new = V_old*exp(3*dt*veta) =>
                        Side length scales as exp(veta*dt) */
 
-                    msmul(state->box, exp(state->veta*dt), state->box);
+                    msmul(state->box, std::exp(state->veta*dt), state->box);
 
                     /* Relate veta to boxv.  veta = d(eta)/dT = (1/DIM)*1/V dV/dT.
                        o               If we assume isotropic scaling, and box length scaling
@@ -1594,11 +1674,11 @@ void update_box(FILE             *fplog,
 
     if (inputrecDeform(inputrec))
     {
-        deform(upd, start, homenr, state->x, state->box, inputrec, step);
+        deform(upd, start, homenr, as_rvec_array(state->x.data()), state->box, inputrec, step);
     }
     where();
     dump_it_all(fplog, "After update",
-                state->natoms, state->x, upd->xp, state->v, force);
+                state->natoms, &state->x, &upd->xp, &state->v, nullptr);
 }
 
 void update_coords(FILE             *fplog,
@@ -1606,7 +1686,7 @@ void update_coords(FILE             *fplog,
                    t_inputrec       *inputrec,  /* input record and box stuff  */
                    t_mdatoms        *md,
                    t_state          *state,
-                   rvec             *f,    /* forces on home particles */
+                   PaddedRVecVector *f,    /* forces on home particles */
                    t_fcdata         *fcd,
                    gmx_ekindata_t   *ekind,
                    matrix            M,
@@ -1615,12 +1695,7 @@ void update_coords(FILE             *fplog,
                    t_commrec        *cr, /* these shouldn't be here -- need to think about it */
                    gmx_constr_t      constr)
 {
-    gmx_bool          bNH, bPR, bDoConstr = FALSE;
-    double            dt, alpha;
-    int               start, homenr, nrend;
-    int               nth, th;
-
-    bDoConstr = (NULL != constr);
+    gmx_bool bDoConstr = (nullptr != constr);
 
     /* Running the velocity half does nothing except for velocity verlet */
     if ((UpdatePart == etrtVELOCITY1 || UpdatePart == etrtVELOCITY2) &&
@@ -1629,11 +1704,12 @@ void update_coords(FILE             *fplog,
         gmx_incons("update_coords called for velocity without VV integrator");
     }
 
-    start  = 0;
-    homenr = md->homenr;
-    nrend  = start+homenr;
+    int  start  = 0;
+    int  homenr = md->homenr;
+    int  nrend  = start+homenr;
 
-    dt   = inputrec->delta_t;
+    /* Cast to real for faster code, no loss in precision (see comment above) */
+    real dt     = inputrec->delta_t;
 
     /* We need to update the NMR restraint history when time averaging is used */
     if (state->flags & (1<<estDISRE_RM3TAV))
@@ -1645,19 +1721,15 @@ void update_coords(FILE             *fplog,
         update_orires_history(fcd, &state->hist);
     }
 
-
-    bNH = inputrec->etc == etcNOSEHOOVER;
-    bPR = ((inputrec->epc == epcPARRINELLORAHMAN) || (inputrec->epc == epcMTTK));
-
     /* ############# START The update of velocities and positions ######### */
     where();
     dump_it_all(fplog, "Before update",
-                state->natoms, state->x, upd->xp, state->v, f);
+                state->natoms, &state->x, &upd->xp, &state->v, f);
 
-    nth = gmx_omp_nthreads_get(emntUpdate);
+    int nth = gmx_omp_nthreads_get(emntUpdate);
 
-#pragma omp parallel for num_threads(nth) schedule(static) private(alpha)
-    for (th = 0; th < nth; th++)
+#pragma omp parallel for num_threads(nth) schedule(static)
+    for (int th = 0; th < nth; th++)
     {
         try
         {
@@ -1666,33 +1738,18 @@ void update_coords(FILE             *fplog,
             start_th = start + ((nrend-start)* th   )/nth;
             end_th   = start + ((nrend-start)*(th+1))/nth;
 
+            const rvec *x_rvec  = as_rvec_array(state->x.data());
+            rvec       *xp_rvec = as_rvec_array(upd->xp.data());
+            rvec       *v_rvec  = as_rvec_array(state->v.data());
+            const rvec *f_rvec  = as_rvec_array(f->data());
+
             switch (inputrec->eI)
             {
                 case (eiMD):
-                    if (ekind->cosacc.cos_accel == 0)
-                    {
-                        do_update_md(start_th, end_th,
-                                     dt, inputrec->nstpcouple,
-                                     ekind->tcstat, state->nosehoover_vxi,
-                                     ekind->bNEMD, ekind->grpstat, inputrec->opts.acc,
-                                     inputrec->opts.nFreeze,
-                                     md->invmass, md->ptype,
-                                     md->cFREEZE, md->cACC, md->cTC,
-                                     state->x, upd->xp, state->v, f, M,
-                                     bNH, bPR);
-                    }
-                    else
-                    {
-                        do_update_visc(start_th, end_th,
-                                       dt, inputrec->nstpcouple,
-                                       ekind->tcstat, state->nosehoover_vxi,
-                                       md->invmass, md->ptype,
-                                       md->cTC, state->x, upd->xp, state->v, f, M,
-                                       state->box,
-                                       ekind->cosacc.cos_accel,
-                                       ekind->cosacc.vcos,
-                                       bNH, bPR);
-                    }
+                    do_update_md(start_th, end_th, step, dt,
+                                 inputrec, md, ekind, state->box,
+                                 x_rvec, xp_rvec, v_rvec, f_rvec,
+                                 state->nosehoover_vxi.data(), M);
                     break;
                 case (eiSD1):
                     /* With constraints, the SD1 update is done in 2 parts */
@@ -1701,22 +1758,28 @@ void update_coords(FILE             *fplog,
                                   inputrec->opts.acc, inputrec->opts.nFreeze,
                                   md->invmass, md->ptype,
                                   md->cFREEZE, md->cACC, md->cTC,
-                                  state->x, upd->xp, state->v, f,
+                                  x_rvec, xp_rvec, v_rvec, f_rvec,
                                   bDoConstr, TRUE,
-                                  step, inputrec->ld_seed, DOMAINDECOMP(cr) ? cr->dd->gatindex : NULL);
+                                  step, inputrec->ld_seed, DOMAINDECOMP(cr) ? cr->dd->gatindex : nullptr);
                     break;
                 case (eiBD):
                     do_update_bd(start_th, end_th, dt,
                                  inputrec->opts.nFreeze, md->invmass, md->ptype,
                                  md->cFREEZE, md->cTC,
-                                 state->x, upd->xp, state->v, f,
+                                 x_rvec, xp_rvec, v_rvec, f_rvec,
                                  inputrec->bd_fric,
                                  upd->sd->bd_rf,
-                                 step, inputrec->ld_seed, DOMAINDECOMP(cr) ? cr->dd->gatindex : NULL);
+                                 step, inputrec->ld_seed, DOMAINDECOMP(cr) ? cr->dd->gatindex : nullptr);
                     break;
                 case (eiVV):
                 case (eiVVAK):
-                    alpha = 1.0 + DIM/((double)inputrec->opts.nrdf[0]); /* assuming barostat coupled to group 0. */
+                {
+                    gmx_bool bExtended = (inputrec->etc == etcNOSEHOOVER ||
+                                          inputrec->epc == epcPARRINELLORAHMAN ||
+                                          inputrec->epc == epcMTTK);
+
+                    /* assuming barostat coupled to group 0 */
+                    real alpha = 1.0 + DIM/static_cast<real>(inputrec->opts.nrdf[0]);
                     switch (UpdatePart)
                     {
                         case etrtVELOCITY1:
@@ -1725,18 +1788,19 @@ void update_coords(FILE             *fplog,
                                              inputrec->opts.acc, inputrec->opts.nFreeze,
                                              md->invmass, md->ptype,
                                              md->cFREEZE, md->cACC,
-                                             state->v, f,
-                                             (bNH || bPR), state->veta, alpha);
+                                             v_rvec, f_rvec,
+                                             bExtended, state->veta, alpha);
                             break;
                         case etrtPOSITION:
                             do_update_vv_pos(start_th, end_th, dt,
                                              inputrec->opts.nFreeze,
                                              md->ptype, md->cFREEZE,
-                                             state->x, upd->xp, state->v,
-                                             (bNH || bPR), state->veta);
+                                             x_rvec, xp_rvec, v_rvec,
+                                             bExtended, state->veta);
                             break;
                     }
                     break;
+                }
                 default:
                     gmx_fatal(FARGS, "Don't know how to update coordinates");
                     break;
@@ -1808,7 +1872,7 @@ extern gmx_bool update_randomize_velocities(t_inputrec *ir, gmx_int64_t step, co
 
     real rate = (ir->delta_t)/ir->opts.tau_t[0];
 
-    if (ir->etc == etcANDERSEN && constr != NULL)
+    if (ir->etc == etcANDERSEN && constr != nullptr)
     {
         /* Currently, Andersen thermostat does not support constrained
            systems. Functionality exists in the andersen_tcoupl
index 7abef4add28c53695464a4da855c511daf685b26..670502b437a4ee1508866e4268882f4c0187d069 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,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.
 #ifndef GMX_MDLIB_UPDATE_H
 #define GMX_MDLIB_UPDATE_H
 
+#include "gromacs/math/paddedvector.h"
 #include "gromacs/math/vectypes.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/real.h"
 
-struct ekinstate_t;
+class ekinstate_t;
 struct gmx_constr;
 struct gmx_ekindata_t;
 struct gmx_enerdata_t;
@@ -54,7 +55,7 @@ struct t_idef;
 struct t_inputrec;
 struct t_mdatoms;
 struct t_nrnb;
-struct t_state;
+class t_state;
 
 /* Abstract type for update */
 struct gmx_update_t;
@@ -70,7 +71,7 @@ void update_temperature_constants(gmx_update_t *upd, const t_inputrec *ir);
 
 /* Update the size of per-atom arrays (e.g. after DD re-partitioning,
    which might increase the number of home atoms). */
-void update_realloc(gmx_update_t *upd, int state_nalloc);
+void update_realloc(gmx_update_t *upd, int natoms);
 
 /* Store the box at step step
  * as a reference state for simulations with box deformation.
@@ -86,20 +87,38 @@ void update_tcouple(gmx_int64_t       step,
                     t_mdatoms        *md
                     );
 
-void update_pcouple(FILE             *fplog,
-                    gmx_int64_t       step,
-                    t_inputrec       *inputrec,
-                    t_state          *state,
-                    matrix            pcoupl_mu,
-                    matrix            M,
-                    gmx_bool          bInitStep);
+/* Update Parrinello-Rahman, to be called before the coordinate update */
+void update_pcouple_before_coordinates(FILE             *fplog,
+                                       gmx_int64_t       step,
+                                       const t_inputrec *inputrec,
+                                       t_state          *state,
+                                       matrix            parrinellorahmanMu,
+                                       matrix            M,
+                                       gmx_bool          bInitStep);
+
+/* Update the box, to be called after the coordinate update.
+ * For Berendsen P-coupling, also calculates the scaling factor
+ * and scales the coordinates.
+ * When the deform option is used, scales coordinates and box here.
+ */
+void update_pcouple_after_coordinates(FILE             *fplog,
+                                      gmx_int64_t       step,
+                                      const t_inputrec *inputrec,
+                                      const t_mdatoms  *md,
+                                      const matrix      pressure,
+                                      const matrix      forceVirial,
+                                      const matrix      constraintVirial,
+                                      const matrix      parrinellorahmanMu,
+                                      t_state          *state,
+                                      t_nrnb           *nrnb,
+                                      gmx_update_t     *upd);
 
 void update_coords(FILE              *fplog,
                    gmx_int64_t        step,
                    t_inputrec        *inputrec, /* input record and box stuff  */
                    t_mdatoms         *md,
                    t_state           *state,
-                   rvec              *f, /* forces on home particles */
+                   PaddedRVecVector  *f, /* forces on home particles */
                    t_fcdata          *fcd,
                    gmx_ekindata_t    *ekind,
                    matrix             M,
@@ -120,7 +139,7 @@ void update_constraints(FILE              *fplog,
                         t_state           *state,
                         gmx_bool           bMolPBC,
                         t_graph           *graph,
-                        rvec               force[], /* forces on home particles */
+                        PaddedRVecVector  *force, /* forces on home particles */
                         t_idef            *idef,
                         tensor             vir_part,
                         t_commrec         *cr,
@@ -133,17 +152,6 @@ void update_constraints(FILE              *fplog,
 
 /* Return TRUE if OK, FALSE in case of Shake Error */
 
-void update_box(FILE             *fplog,
-                gmx_int64_t       step,
-                t_inputrec       *inputrec, /* input record and box stuff      */
-                t_mdatoms        *md,
-                t_state          *state,
-                rvec              force[], /* forces on home particles */
-                matrix            pcoupl_mu,
-                t_nrnb           *nrnb,
-                gmx_update_t     *upd);
-/* Return TRUE if OK, FALSE in case of Shake Error */
-
 void calc_ke_part(t_state *state, t_grpopts *opts, t_mdatoms *md,
                   gmx_ekindata_t *ekind, t_nrnb *nrnb, gmx_bool bEkinAveVel);
 /*
@@ -175,7 +183,8 @@ void
 restore_ekinstate_from_state(t_commrec *cr,
                              gmx_ekindata_t *ekind, const ekinstate_t *ekinstate);
 
-void berendsen_tcoupl(t_inputrec *ir, gmx_ekindata_t *ekind, real dt);
+void berendsen_tcoupl(const t_inputrec *ir, const gmx_ekindata_t *ekind, real dt,
+                      std::vector<double> &therm_integral);
 
 void andersen_tcoupl(t_inputrec *ir, gmx_int64_t step,
                      const t_commrec *cr, const t_mdatoms *md, t_state *state, real rate, const gmx_bool *randomize, const real *boltzfac);
@@ -183,17 +192,13 @@ void andersen_tcoupl(t_inputrec *ir, gmx_int64_t step,
 void nosehoover_tcoupl(t_grpopts *opts, gmx_ekindata_t *ekind, real dt,
                        double xi[], double vxi[], t_extmass *MassQ);
 
-t_state *init_bufstate(const t_state *template_state);
-
-void destroy_bufstate(t_state *state);
-
 void trotter_update(t_inputrec *ir, gmx_int64_t step, gmx_ekindata_t *ekind,
                     gmx_enerdata_t *enerd, t_state *state, tensor vir, t_mdatoms *md,
                     t_extmass *MassQ, int **trotter_seqlist, int trotter_seqno);
 
 int **init_npt_vars(t_inputrec *ir, t_state *state, t_extmass *Mass, gmx_bool bTrotter);
 
-real NPT_energy(t_inputrec *ir, t_state *state, t_extmass *MassQ);
+real NPT_energy(const t_inputrec *ir, const t_state *state, const t_extmass *MassQ);
 /* computes all the pressure/tempertature control energy terms to get a conserved energy */
 
 void NBaroT_trotter(t_grpopts *opts, real dt,
@@ -204,9 +209,6 @@ void vrescale_tcoupl(t_inputrec *ir, gmx_int64_t step,
                      double therm_integral[]);
 /* Compute temperature scaling. For V-rescale it is done in update. */
 
-real vrescale_energy(t_grpopts *opts, double therm_integral[]);
-/* Returns the V-rescale contribution to the conserved energy */
-
 void rescale_velocities(gmx_ekindata_t *ekind, t_mdatoms *mdatoms,
                         int start, int end, rvec v[]);
 /* Rescale the velocities with the scaling factor in ekind */
@@ -224,20 +226,21 @@ real calc_pres(int ePBC, int nwall, matrix box, tensor ekin, tensor vir,
  */
 
 void parrinellorahman_pcoupl(FILE *fplog, gmx_int64_t step,
-                             t_inputrec *ir, real dt, tensor pres,
+                             const t_inputrec *ir, real dt, const tensor pres,
                              tensor box, tensor box_rel, tensor boxv,
                              tensor M, matrix mu,
                              gmx_bool bFirstStep);
 
 void berendsen_pcoupl(FILE *fplog, gmx_int64_t step,
-                      t_inputrec *ir, real dt, tensor pres, matrix box,
-                      matrix mu);
-
+                      const t_inputrec *ir, real dt,
+                      const tensor pres, const matrix box,
+                      const matrix force_vir, const matrix constraint_vir,
+                      matrix mu, double *baros_integral);
 
-void berendsen_pscale(t_inputrec *ir, matrix mu,
+void berendsen_pscale(const t_inputrec *ir, const matrix mu,
                       matrix box, matrix box_rel,
                       int start, int nr_atoms,
-                      rvec x[], unsigned short cFREEZE[],
+                      rvec x[], const unsigned short cFREEZE[],
                       t_nrnb *nrnb);
 
 void correct_ekin(FILE *log, int start, int end, rvec v[],
index c776d3011d0e2c78ebf31d8f6ec340ec949c464f..4a86d085c5a24341d42a9c7510eb004a34cb067d 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,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.
@@ -54,6 +54,7 @@
 #include "gromacs/pbcutil/ishift.h"
 #include "gromacs/pbcutil/mshift.h"
 #include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/ifunc.h"
 #include "gromacs/topology/mtop_util.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
@@ -90,7 +91,7 @@ static void init_ilist(t_ilist *ilist)
     {
         ilist[i].nr     = 0;
         ilist[i].nalloc = 0;
-        ilist[i].iatoms = NULL;
+        ilist[i].iatoms = nullptr;
     }
 }
 
@@ -166,7 +167,7 @@ static const int c_ftypeVsiteEnd   = F_VSITEN + 1;
 
 
 /* Returns the sum of the vsite ilist sizes over all vsite types */
-static int vsiteIlistNrCount(const t_ilist *ilist)
+gmx_unused static int vsiteIlistNrCount(const t_ilist *ilist)
 {
     int nr = 0;
     for (int ftype = c_ftypeVsiteStart; ftype < c_ftypeVsiteEnd; ftype++)
@@ -432,7 +433,7 @@ static void construct_vsites_thread(const gmx_vsite_t *vsite,
     const t_pbc *pbc_null2;
     int         *vsite_pbc;
 
-    if (v != NULL)
+    if (v != nullptr)
     {
         inv_dt = 1.0/dt;
     }
@@ -441,10 +442,10 @@ static void construct_vsites_thread(const gmx_vsite_t *vsite,
         inv_dt = 1.0;
     }
 
-    bPBCAll = (pbc_null != NULL && !vsite->bHaveChargeGroups);
+    bPBCAll = (pbc_null != nullptr && !vsite->bHaveChargeGroups);
 
-    pbc_null2 = NULL;
-    vsite_pbc = NULL;
+    pbc_null2 = nullptr;
+    vsite_pbc = nullptr;
     for (int ftype = c_ftypeVsiteStart; ftype < c_ftypeVsiteEnd; ftype++)
     {
         if (ilist[ftype].nr == 0)
@@ -463,7 +464,7 @@ static void construct_vsites_thread(const gmx_vsite_t *vsite,
             {
                 pbc_null2 = pbc_null;
             }
-            else if (pbc_null != NULL)
+            else if (pbc_null != nullptr)
             {
                 vsite_pbc = vsite->vsite_pbc_loc[ftype - c_ftypeVsiteStart];
             }
@@ -485,7 +486,7 @@ static void construct_vsites_thread(const gmx_vsite_t *vsite,
                     pbc_atom = avsite;
                     copy_rvec(x[avsite], xpbc);
                 }
-                else if (vsite_pbc != NULL)
+                else if (vsite_pbc != nullptr)
                 {
                     pbc_atom = vsite_pbc[i/(1 + nra)];
                     if (pbc_atom > -2)
@@ -502,7 +503,7 @@ static void construct_vsites_thread(const gmx_vsite_t *vsite,
                     }
                     else
                     {
-                        pbc_null2 = NULL;
+                        pbc_null2 = nullptr;
                     }
                 }
                 else
@@ -583,7 +584,7 @@ static void construct_vsites_thread(const gmx_vsite_t *vsite,
                         rvec_add(xpbc, dx, x[avsite]);
                     }
                 }
-                if (v != NULL)
+                if (v != nullptr)
                 {
                     /* Calculate velocity of vsite... */
                     rvec vv;
@@ -624,7 +625,7 @@ void construct_vsites(const gmx_vsite_t *vsite,
     }
     else
     {
-        pbc_null = NULL;
+        pbc_null = nullptr;
     }
 
     if (bDomDec)
@@ -732,9 +733,9 @@ void construct_vsites_mtop(gmx_vsite_t *vsite,
         const gmx_moltype_t  *molt = &mtop->moltype[molb->type];
         for (int mol = 0; mol < molb->nmol; mol++)
         {
-            construct_vsites(vsite, x+as, 0.0, NULL,
+            construct_vsites(vsite, x+as, 0.0, nullptr,
                              mtop->ffparams.iparams, molt->ilist,
-                             epbcNONE, TRUE, NULL, NULL);
+                             epbcNONE, TRUE, nullptr, nullptr);
             as += molt->atoms.nr;
         }
     }
@@ -1452,12 +1453,12 @@ static void spread_vsite_f_thread(const gmx_vsite_t *vsite,
     const t_pbc *pbc_null2;
     const int   *vsite_pbc;
 
-    bPBCAll = (pbc_null != NULL && !vsite->bHaveChargeGroups);
+    bPBCAll = (pbc_null != nullptr && !vsite->bHaveChargeGroups);
 
     /* this loop goes backwards to be able to build *
      * higher type vsites from lower types         */
-    pbc_null2 = NULL;
-    vsite_pbc = NULL;
+    pbc_null2 = nullptr;
+    vsite_pbc = nullptr;
     for (int ftype = c_ftypeVsiteEnd - 1; ftype >= c_ftypeVsiteStart; ftype--)
     {
         if (ilist[ftype].nr == 0)
@@ -1476,14 +1477,14 @@ static void spread_vsite_f_thread(const gmx_vsite_t *vsite,
             {
                 pbc_null2 = pbc_null;
             }
-            else if (pbc_null != NULL)
+            else if (pbc_null != nullptr)
             {
                 vsite_pbc = vsite->vsite_pbc_loc[ftype - c_ftypeVsiteStart];
             }
 
             for (int i = 0; i < nr; )
             {
-                if (vsite_pbc != NULL)
+                if (vsite_pbc != nullptr)
                 {
                     if (vsite_pbc[i/(1 + nra)] > -2)
                     {
@@ -1491,7 +1492,7 @@ static void spread_vsite_f_thread(const gmx_vsite_t *vsite,
                     }
                     else
                     {
-                        pbc_null2 = NULL;
+                        pbc_null2 = nullptr;
                     }
                 }
 
@@ -1582,11 +1583,11 @@ void spread_vsite_f(const gmx_vsite_t *vsite,
         /* This is wasting some CPU time as we now do this multiple times
          * per MD step.
          */
-        pbc_null = set_pbc_dd(&pbc, ePBC, cr->dd ? cr->dd->nc : NULL, FALSE, box);
+        pbc_null = set_pbc_dd(&pbc, ePBC, cr->dd ? cr->dd->nc : nullptr, FALSE, box);
     }
     else
     {
-        pbc_null = NULL;
+        pbc_null = nullptr;
     }
 
     if (DOMAINDECOMP(cr))
@@ -1628,7 +1629,7 @@ void spread_vsite_f(const gmx_vsite_t *vsite,
                 VsiteThread *tData  = vsite->tData[thread];
 
                 rvec        *fshift_t;
-                if (thread == 0 || fshift == NULL)
+                if (thread == 0 || fshift == nullptr)
                 {
                     fshift_t = fshift;
                 }
@@ -1717,7 +1718,7 @@ void spread_vsite_f(const gmx_vsite_t *vsite,
             GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
         }
 
-        if (fshift != NULL)
+        if (fshift != nullptr)
         {
             for (int th = 1; th < vsite->nthreads; th++)
             {
@@ -1974,7 +1975,7 @@ gmx_vsite_t *init_vsite(const gmx_mtop_t *mtop, t_commrec *cr,
 
     if (nvsite == 0)
     {
-        return NULL;
+        return nullptr;
     }
 
     snew(vsite, 1);
@@ -1997,7 +1998,7 @@ gmx_vsite_t *init_vsite(const gmx_mtop_t *mtop, t_commrec *cr,
             int *a2cg = atom2cg(&molt->cgs);
             vsite->vsite_pbc_molt[mt] = get_vsite_pbc(mtop->ffparams.iparams,
                                                       molt->ilist,
-                                                      molt->atoms.atom, NULL,
+                                                      molt->atoms.atom, nullptr,
                                                       &molt->cgs, a2cg);
             sfree(a2cg);
         }
@@ -2037,7 +2038,7 @@ gmx_vsite_t *init_vsite(const gmx_mtop_t *mtop, t_commrec *cr,
         }
     }
 
-    vsite->taskIndex       = NULL;
+    vsite->taskIndex       = nullptr;
     vsite->taskIndexNalloc = 0;
 
     return vsite;
@@ -2539,7 +2540,7 @@ void set_vsite_top(gmx_vsite_t *vsite, gmx_localtop_t *top, t_mdatoms *md,
             /* Make an atom to charge group index */
             int *a2cg = atom2cg(&top->cgs);
             vsite->vsite_pbc_loc = get_vsite_pbc(top->idef.iparams,
-                                                 top->idef.il, NULL, md,
+                                                 top->idef.il, nullptr, md,
                                                  &top->cgs, a2cg);
             sfree(a2cg);
         }
index 8f00f22207fcbc5d620b9c3d4e8c7e8557c46f06..a6ecc782efceb9aa93f4673e2c915b23ef4e6629 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2015, by the GROMACS development team, led by
+# Copyright (c) 2015,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.
 # To help us fund GROMACS development, we humbly ask that you cite
 # the research papers on the package. Check out http://www.gromacs.org.
 
-file(GLOB MDRUNUTILITY_SOURCES *.cpp)
-set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${MDRUNUTILITY_SOURCES} PARENT_SCOPE)
+gmx_add_libgromacs_sources(
+    handlerestart.cpp
+    mdmodules.cpp
+    threadaffinity.cpp
+    )
 
 if (BUILD_TESTING)
-#    add_subdirectory(tests)
+    add_subdirectory(tests)
 endif()
index 529b47be37d4b99e9e3546272d9f0ffa2cb83df0..0721298a563a9cbae3a736ad65245c97b900fd5b 100644 (file)
@@ -105,7 +105,7 @@ read_checkpoint_data(const char *filename, int *simulation_part,
                      int nfile, const t_filenm fnm[],
                      const char *part_suffix,
                      gmx_bool *bAddPart,
-                     gmx_bool *bDoAppendFiles)
+                     bool *bDoAppendFiles)
 {
     t_fileio            *fp;
     int                  nfiles;
@@ -207,8 +207,8 @@ read_checkpoint_data(const char *filename, int *simulation_part,
                  */
                 strcpy(suf_up, part_suffix);
                 upstring(suf_up);
-                *bAddPart = (strstr(fn, part_suffix) != NULL ||
-                             strstr(fn, suf_up) != NULL);
+                *bAddPart = (strstr(fn, part_suffix) != nullptr ||
+                             strstr(fn, suf_up) != nullptr);
             }
 
             sfree(outputfiles);
@@ -233,8 +233,8 @@ handleRestart(t_commrec *cr,
               gmx_bool   bTryToAppendFiles,
               const int  NFILE,
               t_filenm   fnm[],
-              gmx_bool  *bDoAppendFiles,
-              gmx_bool  *bStartFromCpt)
+              bool      *bDoAppendFiles,
+              bool      *bStartFromCpt)
 {
     gmx_bool        bAddPart;
     int             sim_part, sim_part_fn;
@@ -272,7 +272,7 @@ handleRestart(t_commrec *cr,
             }
             else
             {
-                fpmulti = NULL;
+                fpmulti = nullptr;
             }
             check_multi_int(fpmulti, cr->ms, sim_part, "simulation part", TRUE);
         }
index e66a013e9522c92598a20dd3156ce3e2f117bc59..350f78d248bb4a0042ece19434e34e220d2b9638 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,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.
@@ -94,7 +94,7 @@ void handleRestart(t_commrec *cr,
                    gmx_bool   bTryToAppendFiles,
                    const int  NFILE,
                    t_filenm   fnm[],
-                   gmx_bool  *bDoAppendFiles,
-                   gmx_bool  *bStartFromCpt);
+                   bool      *bDoAppendFiles,
+                   bool      *bStartFromCpt);
 
 #endif
diff --git a/src/gromacs/mdrunutility/mdmodules.cpp b/src/gromacs/mdrunutility/mdmodules.cpp
new file mode 100644 (file)
index 0000000..2ee50c8
--- /dev/null
@@ -0,0 +1,147 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+#include "gmxpre.h"
+
+#include "mdmodules.h"
+
+#include <memory>
+
+#include "gromacs/applied-forces/electricfield.h"
+#include "gromacs/mdtypes/iforceprovider.h"
+#include "gromacs/mdtypes/imdmodule.h"
+#include "gromacs/mdtypes/imdoutputprovider.h"
+#include "gromacs/mdtypes/imdpoptionprovider.h"
+#include "gromacs/mdtypes/inputrec.h"
+#include "gromacs/options/options.h"
+#include "gromacs/options/optionsection.h"
+#include "gromacs/options/treesupport.h"
+#include "gromacs/utility/keyvaluetree.h"
+#include "gromacs/utility/keyvaluetreebuilder.h"
+#include "gromacs/utility/keyvaluetreetransform.h"
+#include "gromacs/utility/smalloc.h"
+
+namespace gmx
+{
+
+class MDModules::Impl : public IMDOutputProvider
+{
+    public:
+
+        Impl()
+            : field_(createElectricFieldModule())
+        {
+        }
+
+        void makeModuleOptions(Options *options)
+        {
+            // Create a section for applied-forces modules
+            auto appliedForcesOptions = options->addSection(OptionSection("applied-forces"));
+            field_->mdpOptionProvider()->initMdpOptions(&appliedForcesOptions);
+            // In future, other sections would also go here.
+        }
+
+        // From IMDOutputProvider
+        virtual void initOutput(FILE *fplog, int nfile, const t_filenm fnm[],
+                                bool bAppendFiles, const gmx_output_env_t *oenv)
+        {
+            field_->outputProvider()->initOutput(fplog, nfile, fnm, bAppendFiles, oenv);
+        }
+        virtual void finishOutput()
+        {
+            field_->outputProvider()->finishOutput();
+        }
+
+        std::unique_ptr<IMDModule>      field_;
+        std::unique_ptr<ForceProviders> forceProviders_;
+};
+
+MDModules::MDModules() : impl_(new Impl)
+{
+}
+
+MDModules::~MDModules()
+{
+}
+
+void MDModules::initMdpTransform(IKeyValueTreeTransformRules *rules)
+{
+    auto appliedForcesScope = rules->scopedTransform("/applied-forces");
+    impl_->field_->mdpOptionProvider()->initMdpTransform(appliedForcesScope.rules());
+}
+
+void MDModules::buildMdpOutput(KeyValueTreeObjectBuilder *builder)
+{
+    impl_->field_->mdpOptionProvider()->buildMdpOutput(builder);
+}
+
+void MDModules::assignOptionsToModules(const KeyValueTreeObject  &params,
+                                       IKeyValueTreeErrorHandler *errorHandler)
+{
+    Options moduleOptions;
+    impl_->makeModuleOptions(&moduleOptions);
+    // The actual output is in the data fields of the modules that
+    // were set up in the module options.
+    assignOptionsFromKeyValueTree(&moduleOptions, params, errorHandler);
+}
+
+void MDModules::adjustInputrecBasedOnModules(t_inputrec *ir)
+{
+    Options moduleOptions;
+    impl_->makeModuleOptions(&moduleOptions);
+
+    checkForUnknownOptionsInKeyValueTree(*ir->params, moduleOptions);
+
+    std::unique_ptr<KeyValueTreeObject> params(
+            new KeyValueTreeObject(
+                    adjustKeyValueTreeFromOptions(*ir->params, moduleOptions)));
+    delete ir->params;
+    ir->params = params.release();
+}
+
+IMDOutputProvider *MDModules::outputProvider()
+{
+    return impl_.get();
+}
+
+ForceProviders *MDModules::initForceProviders()
+{
+    GMX_RELEASE_ASSERT(impl_->forceProviders_ == nullptr,
+                       "Force providers initialized multiple times");
+    impl_->forceProviders_.reset(new ForceProviders);
+    impl_->field_->initForceProviders(impl_->forceProviders_.get());
+    return impl_->forceProviders_.get();
+}
+
+} // namespace gmx
diff --git a/src/gromacs/mdrunutility/mdmodules.h b/src/gromacs/mdrunutility/mdmodules.h
new file mode 100644 (file)
index 0000000..fe0b75f
--- /dev/null
@@ -0,0 +1,155 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares gmx::MDModules.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_mdrunutility
+ */
+#ifndef GMX_MDRUNUTILITY_MDMODULES_H
+#define GMX_MDRUNUTILITY_MDMODULES_H
+
+#include "gromacs/utility/classhelpers.h"
+
+struct ForceProviders;
+
+struct t_inputrec;
+
+namespace gmx
+{
+
+class KeyValueTreeObjectBuilder;
+class KeyValueTreeObject;
+class IKeyValueTreeErrorHandler;
+class IKeyValueTreeTransformRules;
+class IMDOutputProvider;
+class KeyValueTreeObject;
+
+/*! \libinternal \brief
+ * Manages the collection of all modules used for mdrun.
+ *
+ * This class acts as a central place for constructing modules for mdrun
+ * and wiring up dependencies between them.  This class should be the only
+ * place that contains the full list of modules, although in the future, some
+ * code (e.g., in tools) may benefit from the ability to only create one or a
+ * few modules and use them.
+ *
+ * The general idea is that each module takes care of its own data rather than
+ * mdrun having to know about all the details of each type of force calculation.
+ * Initially this is applied for simple things like electric field calculations
+ * but later more complex forces will be supported too.
+ *
+ * Currently, where the set of modules needs to be accessed, either a pointer
+ * to MDModules is passed around, or an instance of IMDOutputProvider or
+ * ForceProviders returned from MDModules.  These objects returned from
+ * MDModules call the corresponding methods in the relevant modules.
+ * In the future, some additional logic may need to be introduced at
+ * the call sites that can also influence the signature of the methods,
+ * similar to what ForceProviders already does for force computation.
+ *
+ * The assignOptionsToModules() and adjustInputrecBasedOnModules() methods of
+ * this class also take responsibility for wiring up the options (and their
+ * defaults) for each module.
+ *
+ * \inlibraryapi
+ * \ingroup module_mdrunutility
+ */
+class MDModules
+{
+    public:
+        MDModules();
+        ~MDModules();
+
+        /*! \brief
+         * Initializes a transform from mdp values to sectioned options.
+         *
+         * \see IMdpOptionProvider::initMdpTransform()
+         *
+         * Initializes the combined transform from all modules.
+         */
+        void initMdpTransform(IKeyValueTreeTransformRules *rules);
+
+        /*! \brief Initializes a builder of flat mdp-style key-value pairs
+         * suitable for output.
+         *
+         * If used as input to initMdpTransform(), the key-value pairs
+         * resulting from this function would leave the module
+         * settings unchanged.
+         *
+         * Once the transition from mdp to key-value input is
+         * complete, this method will probably not exist.
+         */
+        void buildMdpOutput(KeyValueTreeObjectBuilder *builder);
+
+        /*! \brief
+         * Sets input parameters from `params` for each module.
+         *
+         * \param[in]  params  Contains keys and values from user
+         *     input (and defaults) to configure modules that have
+         *     registered options with those keys.
+         * \param[out] errorHandler  Called to report errors.
+         */
+        void assignOptionsToModules(const KeyValueTreeObject  &params,
+                                    IKeyValueTreeErrorHandler *errorHandler);
+
+        /*! \brief
+         * Normalizes inputrec parameters to match current code version.
+         *
+         * This orders the parameters in `ir->param` to match the current code
+         * and adds any missing defaults.  It also throws an error if the
+         * inputrec contains parameters that are not recognized by any module.
+         */
+        void adjustInputrecBasedOnModules(t_inputrec *ir);
+
+        /*! \brief
+         * Returns an interface for initializing and finalizing output for modules.
+         */
+        IMDOutputProvider *outputProvider();
+        /*! \brief
+         * Returns an object for computing forces from the modules.
+         */
+        ForceProviders *initForceProviders();
+
+    private:
+        class Impl;
+
+        PrivateImplPointer<Impl> impl_;
+};
+
+} // namespace gmx
+
+#endif
diff --git a/src/gromacs/mdrunutility/tests/CMakeLists.txt b/src/gromacs/mdrunutility/tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..b765917
--- /dev/null
@@ -0,0 +1,44 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 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.
+
+gmx_add_unit_test_object_library(mdrunutility-test-shared
+                                 threadaffinitytest.cpp)
+
+gmx_add_unit_test(MdrunUtilityUnitTests mdrunutility-test
+                  threadaffinity.cpp
+                  $<TARGET_OBJECTS:mdrunutility-test-shared>)
+
+gmx_add_mpi_unit_test(MdrunUtilityMpiUnitTests mdrunutility-mpi-test 4
+                      threadaffinity-mpi.cpp
+                      $<TARGET_OBJECTS:mdrunutility-test-shared>)
diff --git a/src/gromacs/mdrunutility/tests/threadaffinity-mpi.cpp b/src/gromacs/mdrunutility/tests/threadaffinity-mpi.cpp
new file mode 100644 (file)
index 0000000..35e83d2
--- /dev/null
@@ -0,0 +1,251 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+#include "gmxpre.h"
+
+#include <array>
+
+#include <gtest/gtest.h>
+
+#include "gromacs/utility/basenetwork.h"
+
+#include "testutils/mpitest.h"
+
+#include "threadaffinitytest.h"
+
+namespace
+{
+
+using gmx::test::ThreadAffinityTestHelper;
+
+TEST(ThreadAffinityMultiRankTest, PinsWholeNode)
+{
+    GMX_MPI_TEST(4);
+    ThreadAffinityTestHelper helper;
+    helper.setLogicalProcessorCount(4);
+    helper.expectPinningMessage(false, 1);
+    helper.expectAffinitySet(gmx_node_rank());
+    helper.setAffinity(1);
+}
+
+TEST(ThreadAffinityMultiRankTest, PinsWithOffsetAndStride)
+{
+    GMX_MPI_TEST(4);
+    ThreadAffinityTestHelper helper;
+    helper.setAffinityOption(threadaffON);
+    helper.setOffsetAndStride(1, 2);
+    helper.setLogicalProcessorCount(8);
+    helper.expectWarningMatchingRegex("Applying core pinning offset 1");
+    helper.expectPinningMessage(true, 2);
+    helper.expectAffinitySet(1 + 2*gmx_node_rank());
+    helper.setAffinity(1);
+}
+
+TEST(ThreadAffinityMultiRankTest, PinsTwoNodes)
+{
+    GMX_MPI_TEST(4);
+    ThreadAffinityTestHelper helper;
+    helper.setPhysicalNodeId(gmx_node_rank()/2);
+    helper.setLogicalProcessorCount(2);
+    helper.expectPinningMessage(false, 1);
+    helper.expectAffinitySet(gmx_node_rank()%2);
+    helper.setAffinity(1);
+}
+
+TEST(ThreadAffinityMultiRankTest, DoesNothingWhenDisabled)
+{
+    GMX_MPI_TEST(4);
+    ThreadAffinityTestHelper helper;
+    helper.setAffinityOption(threadaffOFF);
+    helper.setLogicalProcessorCount(4);
+    helper.setAffinity(1);
+}
+
+TEST(ThreadAffinityMultiRankTest, HandlesTooManyThreadsWithAuto)
+{
+    GMX_MPI_TEST(4);
+    ThreadAffinityTestHelper helper;
+    helper.setLogicalProcessorCount(6);
+    helper.expectWarningMatchingRegex("Oversubscribing the CPU");
+    helper.expectGenericFailureMessage();
+    helper.setAffinity(2);
+}
+
+TEST(ThreadAffinityMultiRankTest, HandlesTooManyThreadsWithForce)
+{
+    GMX_MPI_TEST(4);
+    ThreadAffinityTestHelper helper;
+    helper.setAffinityOption(threadaffON);
+    helper.setLogicalProcessorCount(6);
+    helper.expectWarningMatchingRegex("Oversubscribing the CPU");
+    helper.expectGenericFailureMessage();
+    helper.setAffinity(2);
+}
+
+class ThreadAffinityHeterogeneousNodesTest : public ::testing::Test
+{
+    public:
+        int currentNode() const { return gmx_node_rank() / 2; }
+        int indexInNode() const { return gmx_node_rank() % 2; }
+        bool isMaster() const { return gmx_node_rank() == 0; }
+
+        void setupNodes(ThreadAffinityTestHelper *helper, std::array<int, 2> cores)
+        {
+            const int node = currentNode();
+            helper->setPhysicalNodeId(node);
+            helper->setLogicalProcessorCount(cores[node]);
+        }
+        void expectNodeAffinitySet(ThreadAffinityTestHelper *helper, int node, int core)
+        {
+            if (currentNode() == node)
+            {
+                helper->expectAffinitySet(core);
+            }
+        }
+};
+
+TEST_F(ThreadAffinityHeterogeneousNodesTest, PinsOnMasterOnly)
+{
+    GMX_MPI_TEST(4);
+    ThreadAffinityTestHelper helper;
+    helper.setAffinityOption(threadaffON);
+    setupNodes(&helper, {{2, 1}});
+    helper.expectWarningMatchingRegexIf("Oversubscribing the CPU", isMaster() || currentNode() == 1);
+    helper.expectGenericFailureMessageIf(isMaster() || currentNode() == 1);
+    if (currentNode() == 0)
+    {
+        helper.expectPinningMessage(false, 1);
+    }
+    expectNodeAffinitySet(&helper, 0, indexInNode());
+    helper.setAffinity(1);
+}
+
+TEST_F(ThreadAffinityHeterogeneousNodesTest, PinsOnNonMasterOnly)
+{
+    GMX_MPI_TEST(4);
+    ThreadAffinityTestHelper helper;
+    helper.setAffinityOption(threadaffON);
+    setupNodes(&helper, {{1, 2}});
+    helper.expectWarningMatchingRegexIf("Oversubscribing the CPU", currentNode() == 0);
+    helper.expectGenericFailureMessageIf(currentNode() == 0);
+    if (currentNode() == 1)
+    {
+        helper.expectPinningMessage(false, 1);
+    }
+    expectNodeAffinitySet(&helper, 1, indexInNode());
+    helper.setAffinity(1);
+}
+
+TEST_F(ThreadAffinityHeterogeneousNodesTest, HandlesUnknownHardwareOnNonMaster)
+{
+    GMX_MPI_TEST(4);
+    ThreadAffinityTestHelper helper;
+    helper.setAffinityOption(threadaffON);
+    setupNodes(&helper, {{2, 0}});
+    helper.expectWarningMatchingRegexIf("No information on available cores", isMaster() || currentNode() == 1);
+    helper.expectGenericFailureMessageIf(isMaster() || currentNode() == 1);
+    if (currentNode() == 0)
+    {
+        helper.expectPinningMessage(false, 1);
+    }
+    expectNodeAffinitySet(&helper, 0, indexInNode());
+    helper.setAffinity(1);
+}
+
+TEST_F(ThreadAffinityHeterogeneousNodesTest, PinsAutomaticallyOnMasterOnly)
+{
+    GMX_MPI_TEST(4);
+    ThreadAffinityTestHelper helper;
+    setupNodes(&helper, {{2, 1}});
+    helper.expectWarningMatchingRegexIf("Oversubscribing the CPU", isMaster() || currentNode() == 1);
+    helper.expectGenericFailureMessageIf(isMaster() || currentNode() == 1);
+    if (currentNode() == 0)
+    {
+        helper.expectPinningMessage(false, 1);
+    }
+    expectNodeAffinitySet(&helper, 0, indexInNode());
+    helper.setAffinity(1);
+}
+
+TEST_F(ThreadAffinityHeterogeneousNodesTest, PinsAutomaticallyOnNonMasterOnly)
+{
+    GMX_MPI_TEST(4);
+    ThreadAffinityTestHelper helper;
+    setupNodes(&helper, {{1, 2}});
+    helper.expectWarningMatchingRegexIf("Oversubscribing the CPU", currentNode() == 0);
+    helper.expectGenericFailureMessageIf(currentNode() == 0);
+    if (currentNode() == 1)
+    {
+        helper.expectPinningMessage(false, 1);
+    }
+    expectNodeAffinitySet(&helper, 1, indexInNode());
+    helper.setAffinity(1);
+}
+
+TEST_F(ThreadAffinityHeterogeneousNodesTest, HandlesInvalidOffsetOnNonMasterOnly)
+{
+    GMX_MPI_TEST(4);
+    ThreadAffinityTestHelper helper;
+    helper.setAffinityOption(threadaffON);
+    helper.setOffsetAndStride(2, 0);
+    setupNodes(&helper, {{4, 2}});
+    helper.expectWarningMatchingRegex("Applying core pinning offset 2");
+    helper.expectWarningMatchingRegexIf("Requested offset too large", isMaster() || currentNode() == 1);
+    helper.expectGenericFailureMessageIf(isMaster() || currentNode() == 1);
+    if (currentNode() == 0)
+    {
+        helper.expectPinningMessage(false, 1);
+    }
+    expectNodeAffinitySet(&helper, 0, indexInNode()+2);
+    helper.setAffinity(1);
+}
+
+TEST_F(ThreadAffinityHeterogeneousNodesTest, HandlesInvalidStrideOnNonMasterOnly)
+{
+    GMX_MPI_TEST(4);
+    ThreadAffinityTestHelper helper;
+    helper.setAffinityOption(threadaffON);
+    helper.setOffsetAndStride(0, 2);
+    setupNodes(&helper, {{4, 2}});
+    helper.expectWarningMatchingRegexIf("Requested stride too large", isMaster() || currentNode() == 1);
+    helper.expectGenericFailureMessageIf(isMaster() || currentNode() == 1);
+    if (currentNode() == 0)
+    {
+        helper.expectPinningMessage(true, 2);
+    }
+    expectNodeAffinitySet(&helper, 0, 2*indexInNode());
+    helper.setAffinity(1);
+}
+
+} // namespace
diff --git a/src/gromacs/mdrunutility/tests/threadaffinity.cpp b/src/gromacs/mdrunutility/tests/threadaffinity.cpp
new file mode 100644 (file)
index 0000000..9d1ccf1
--- /dev/null
@@ -0,0 +1,192 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+#include "gmxpre.h"
+
+#include "gromacs/mdrunutility/threadaffinity.h"
+
+#include "config.h"
+
+#include <gtest/gtest.h>
+
+#include "threadaffinitytest.h"
+
+namespace
+{
+
+class ThreadAffinityTest : public ::testing::Test
+{
+    public:
+
+        gmx::test::ThreadAffinityTestHelper helper_;
+};
+
+TEST_F(ThreadAffinityTest, DoesNothingWhenDisabled)
+{
+    helper_.setAffinityOption(threadaffOFF);
+    helper_.setAffinity(1);
+}
+
+TEST_F(ThreadAffinityTest, DoesNothingWhenNotSupported)
+{
+    helper_.setAffinitySupported(false);
+    helper_.setAffinity(1);
+}
+
+TEST_F(ThreadAffinityTest, DoesNothingWithAutoAndTooFewThreads)
+{
+    helper_.setLogicalProcessorCount(4);
+    helper_.expectWarningMatchingRegex("The number of threads is not equal to the number of");
+    helper_.expectGenericFailureMessage();
+    helper_.setAffinity(2);
+}
+
+TEST_F(ThreadAffinityTest, DoesNothingWithAutoAndTooManyThreads)
+{
+    helper_.setLogicalProcessorCount(4);
+    helper_.expectWarningMatchingRegex("Oversubscribing the CPU");
+    helper_.expectGenericFailureMessage();
+    helper_.setAffinity(8);
+}
+
+TEST_F(ThreadAffinityTest, DoesNothingWithUnknownHardware)
+{
+    helper_.setAffinityOption(threadaffON);
+    helper_.setLogicalProcessorCount(0);
+    helper_.expectWarningMatchingRegex("No information on available cores");
+    helper_.expectGenericFailureMessage();
+    helper_.setAffinity(2);
+}
+
+TEST_F(ThreadAffinityTest, DoesNothingWithTooManyThreads)
+{
+    helper_.setAffinityOption(threadaffON);
+    helper_.setLogicalProcessorCount(4);
+    helper_.expectWarningMatchingRegex("Oversubscribing the CPU");
+    helper_.expectGenericFailureMessage();
+    helper_.setAffinity(8);
+}
+
+TEST_F(ThreadAffinityTest, DoesNothingWithTooLargeOffset)
+{
+    helper_.setAffinityOption(threadaffON);
+    helper_.setOffsetAndStride(2, 0);
+    helper_.setLogicalProcessorCount(4);
+    helper_.expectWarningMatchingRegex("Applying core pinning offset 2");
+    helper_.expectWarningMatchingRegex("Requested offset too large");
+    helper_.expectGenericFailureMessage();
+    helper_.setAffinity(3);
+}
+
+TEST_F(ThreadAffinityTest, DoesNothingWithTooLargeStride)
+{
+    helper_.setAffinityOption(threadaffON);
+    helper_.setOffsetAndStride(0, 2);
+    helper_.setLogicalProcessorCount(4);
+    helper_.expectWarningMatchingRegex("Requested stride too large");
+    helper_.expectGenericFailureMessage();
+    helper_.setAffinity(3);
+}
+
+TEST_F(ThreadAffinityTest, PinsSingleThreadWithAuto)
+{
+    helper_.setLogicalProcessorCount(1);
+    helper_.expectAffinitySet(0);
+    helper_.expectPinningMessage(false, 1);
+    helper_.setAffinity(1);
+}
+
+TEST_F(ThreadAffinityTest, PinsSingleThreadWhenForced)
+{
+    helper_.setAffinityOption(threadaffON);
+    helper_.setLogicalProcessorCount(2);
+    helper_.expectPinningMessage(false, 2);
+    helper_.expectAffinitySet(0);
+    helper_.setAffinity(1);
+}
+
+TEST_F(ThreadAffinityTest, PinsSingleThreadWithOffsetWhenForced)
+{
+    helper_.setAffinityOption(threadaffON);
+    helper_.setOffsetAndStride(2, 0);
+    helper_.setLogicalProcessorCount(4);
+    helper_.expectWarningMatchingRegex("Applying core pinning offset 2");
+    helper_.expectPinningMessage(false, 2);
+    helper_.expectAffinitySet(2);
+    helper_.setAffinity(1);
+}
+
+TEST_F(ThreadAffinityTest, HandlesPinningFailureWithSingleThread)
+{
+    helper_.setLogicalProcessorCount(1);
+    helper_.expectPinningMessage(false, 1);
+    helper_.expectGenericFailureMessage();
+    helper_.expectAffinitySetThatFails(0);
+    helper_.setAffinity(1);
+}
+
+// TODO: If it wouldn't result in a multitude of #if's, it would be nice
+// to somehow indicate in a no-OpenMP build that some tests are missing.
+#if GMX_OPENMP
+TEST_F(ThreadAffinityTest, PinsMultipleThreadsWithAuto)
+{
+    helper_.setLogicalProcessorCount(2);
+    helper_.expectPinningMessage(false, 1);
+    helper_.expectAffinitySet({0, 1});
+    helper_.setAffinity(2);
+}
+
+TEST_F(ThreadAffinityTest, PinsMultipleThreadsWithStrideWhenForced)
+{
+    helper_.setAffinityOption(threadaffON);
+    helper_.setOffsetAndStride(0, 2);
+    helper_.setLogicalProcessorCount(4);
+    helper_.expectPinningMessage(true, 2);
+    helper_.expectAffinitySet({0, 2});
+    helper_.setAffinity(2);
+}
+
+TEST_F(ThreadAffinityTest, HandlesPinningFailureWithOneThreadFailing)
+{
+    helper_.setAffinityOption(threadaffON);
+    helper_.setLogicalProcessorCount(2);
+    helper_.expectPinningMessage(false, 1);
+    helper_.expectGenericFailureMessage();
+    helper_.expectAffinitySet(0);
+    helper_.expectAffinitySetThatFails(1);
+    helper_.setAffinity(2);
+}
+#endif
+
+} // namespace
diff --git a/src/gromacs/mdrunutility/tests/threadaffinitytest.cpp b/src/gromacs/mdrunutility/tests/threadaffinitytest.cpp
new file mode 100644 (file)
index 0000000..e9ee864
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+#include "gmxpre.h"
+
+#include "threadaffinitytest.h"
+
+#include "config.h"
+
+#include <gmock/gmock.h>
+
+#include "gromacs/hardware/hardwaretopology.h"
+#include "gromacs/mdtypes/commrec.h"
+#include "gromacs/utility/basenetwork.h"
+#include "gromacs/utility/gmxmpi.h"
+#include "gromacs/utility/smalloc.h"
+
+namespace gmx
+{
+namespace test
+{
+
+MockThreadAffinityAccess::MockThreadAffinityAccess()
+    : supported_(true), physicalNodeId_(0)
+{
+    using ::testing::_;
+    using ::testing::Return;
+    ON_CALL(*this, setCurrentThreadAffinityToCore(_))
+        .WillByDefault(Return(true));
+}
+
+MockThreadAffinityAccess::~MockThreadAffinityAccess()
+{
+}
+
+
+ThreadAffinityTestHelper::ThreadAffinityTestHelper()
+{
+    snew(cr_, 1);
+    cr_->nnodes         = gmx_node_num();
+    cr_->nodeid         = gmx_node_rank();
+    cr_->rank_intranode = cr_->nodeid;
+    cr_->duty           = DUTY_PP;
+#if GMX_MPI
+    cr_->mpi_comm_mysim = MPI_COMM_WORLD;
+#endif
+    hwOpt_.thread_affinity = threadaffAUTO;
+}
+
+ThreadAffinityTestHelper::~ThreadAffinityTestHelper()
+{
+    sfree(cr_);
+}
+
+void ThreadAffinityTestHelper::setLogicalProcessorCount(int logicalProcessorCount)
+{
+    hwTop_.reset(new HardwareTopology(logicalProcessorCount));
+}
+
+} // namespace test
+} // namespace gmx
diff --git a/src/gromacs/mdrunutility/tests/threadaffinitytest.h b/src/gromacs/mdrunutility/tests/threadaffinitytest.h
new file mode 100644 (file)
index 0000000..8a2da24
--- /dev/null
@@ -0,0 +1,184 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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_MDRUNUTILITY_TESTS_THREADAFFINITYTEST_H
+#define GMX_MDRUNUTILITY_TESTS_THREADAFFINITYTEST_H
+
+#include <initializer_list>
+#include <memory>
+
+#include <gmock/gmock.h>
+
+#include "gromacs/hardware/hw_info.h"
+#include "gromacs/mdrunutility/threadaffinity.h"
+#include "gromacs/utility/logger.h"
+#include "gromacs/utility/stringutil.h"
+
+#include "testutils/loggertest.h"
+
+struct t_commrec;
+
+namespace gmx
+{
+
+class HardwareTopology;
+
+namespace test
+{
+
+class MockThreadAffinityAccess : public IThreadAffinityAccess
+{
+    public:
+        MockThreadAffinityAccess();
+        ~MockThreadAffinityAccess();
+
+        void setSupported(bool supported) { supported_ = supported; }
+        void setPhysicalNodeId(int nodeId) { physicalNodeId_ = nodeId; }
+
+        virtual bool isThreadAffinitySupported() const { return supported_; }
+        virtual int physicalNodeId() const { return physicalNodeId_; }
+        MOCK_METHOD1(setCurrentThreadAffinityToCore, bool(int core));
+
+    private:
+        bool supported_;
+        int  physicalNodeId_;
+};
+
+class ThreadAffinityTestHelper
+{
+    public:
+        ThreadAffinityTestHelper();
+        ~ThreadAffinityTestHelper();
+
+        void setAffinitySupported(bool supported)
+        {
+            affinityAccess_.setSupported(supported);
+        }
+        void setAffinityOption(int affinityOption)
+        {
+            hwOpt_.thread_affinity = affinityOption;
+        }
+        void setOffsetAndStride(int offset, int stride)
+        {
+            hwOpt_.core_pinning_offset = offset;
+            hwOpt_.core_pinning_stride = stride;
+        }
+
+        void setPhysicalNodeId(int nodeId)
+        {
+            affinityAccess_.setPhysicalNodeId(nodeId);
+        }
+
+        void setLogicalProcessorCount(int logicalProcessorCount);
+
+        void expectAffinitySet(int core)
+        {
+            EXPECT_CALL(affinityAccess_, setCurrentThreadAffinityToCore(core));
+        }
+        void expectAffinitySet(std::initializer_list<int> cores)
+        {
+            for (int core : cores)
+            {
+                expectAffinitySet(core);
+            }
+        }
+        void expectAffinitySetThatFails(int core)
+        {
+            using ::testing::Return;
+            EXPECT_CALL(affinityAccess_, setCurrentThreadAffinityToCore(core))
+                .WillOnce(Return(false));
+        }
+
+        void expectWarningMatchingRegex(const char *re)
+        {
+            expectWarningMatchingRegexIf(re, true);
+        }
+        void expectWarningMatchingRegexIf(const char *re, bool condition)
+        {
+            expectLogMessageMatchingRegexIf(MDLogger::LogLevel::Warning, re, condition);
+        }
+        void expectInfoMatchingRegex(const char *re)
+        {
+            expectInfoMatchingRegexIf(re, true);
+        }
+        void expectInfoMatchingRegexIf(const char *re, bool condition)
+        {
+            expectLogMessageMatchingRegexIf(MDLogger::LogLevel::Info, re, condition);
+        }
+        void expectGenericFailureMessage()
+        {
+            expectGenericFailureMessageIf(true);
+        }
+        void expectGenericFailureMessageIf(bool condition)
+        {
+            expectWarningMatchingRegexIf("NOTE: Thread affinity setting failed.", condition);
+        }
+        void expectPinningMessage(bool userSpecifiedStride, int stride)
+        {
+            std::string pattern = formatString("Pinning threads .* %s.* stride of %d",
+                                               userSpecifiedStride ? "user" : "auto",
+                                               stride);
+            expectInfoMatchingRegex(pattern.c_str());
+        }
+        void expectLogMessageMatchingRegexIf(MDLogger::LogLevel level,
+                                             const char *re, bool condition)
+        {
+            if (condition)
+            {
+                logHelper_.expectEntryMatchingRegex(level, re);
+            }
+        }
+
+        void setAffinity(int nthread_local)
+        {
+            if (hwTop_ == nullptr)
+            {
+                setLogicalProcessorCount(1);
+            }
+            gmx_set_thread_affinity(logHelper_.logger(), cr_, &hwOpt_, *hwTop_,
+                                    nthread_local, &affinityAccess_);
+        }
+
+    private:
+        t_commrec                         *cr_;
+        gmx_hw_opt_t                       hwOpt_;
+        std::unique_ptr<HardwareTopology>  hwTop_;
+        MockThreadAffinityAccess           affinityAccess_;
+        LoggerTestHelper                   logHelper_;
+};
+
+} // namespace test
+} // namespace gmx
+
+#endif
index a9387e6b3543d32c95d5f063e03fdaeef404fc13..a4370e9450063b546ac8c56626cccc82d6c0cf74 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,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.
 
 #include "thread_mpi/threads.h"
 
-#include "gromacs/gmxlib/md_logging.h"
 #include "gromacs/hardware/hardwaretopology.h"
 #include "gromacs/hardware/hw_info.h"
-#include "gromacs/mdlib/gmx_omp_nthreads.h"
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/utility/basenetwork.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/gmxomp.h"
+#include "gromacs/utility/logger.h"
 #include "gromacs/utility/programcontext.h"
-#include "gromacs/utility/scoped_cptr.h"
 #include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/unique_cptr.h"
 
+namespace
+{
+
+class DefaultThreadAffinityAccess : public gmx::IThreadAffinityAccess
+{
+    public:
+        virtual bool isThreadAffinitySupported() const
+        {
+            return tMPI_Thread_setaffinity_support() == TMPI_SETAFFINITY_SUPPORT_YES;
+        }
+        virtual int physicalNodeId() const
+        {
+            return gmx_physicalnode_id_hash();
+        }
+        virtual bool setCurrentThreadAffinityToCore(int core)
+        {
+            const int ret = tMPI_Thread_setaffinity_single(tMPI_Thread_self(), core);
+            return ret == 0;
+        }
+};
+
+//! Global instance of DefaultThreadAffinityAccess
+DefaultThreadAffinityAccess g_defaultAffinityAccess;
+
+} // namespace
+
+gmx::IThreadAffinityAccess::~IThreadAffinityAccess()
+{
+}
 
 static bool invalidWithinSimulation(const t_commrec *cr, bool invalidLocally)
 {
@@ -83,9 +111,9 @@ static bool invalidWithinSimulation(const t_commrec *cr, bool invalidLocally)
 }
 
 static bool
-get_thread_affinity_layout(FILE *fplog,
+get_thread_affinity_layout(const gmx::MDLogger &mdlog,
                            const t_commrec *cr,
-                           const gmx_hw_info_t * hwinfo,
+                           const gmx::HardwareTopology &hwTop,
                            int   threads,
                            bool  automatic,
                            int pin_offset, int * pin_stride,
@@ -97,8 +125,6 @@ get_thread_affinity_layout(FILE *fplog,
     bool                         haveTopology;
     bool                         invalidValue;
 
-    const gmx::HardwareTopology &hwTop = *hwinfo->hardwareTopology;
-
     haveTopology = (hwTop.supportLevel() >= gmx::HardwareTopology::SupportLevel::Basic);
 
     if (pin_offset < 0)
@@ -131,8 +157,8 @@ get_thread_affinity_layout(FILE *fplog,
     else
     {
         /* topology information not available or invalid, ignore it */
-        hwThreads       = hwinfo->nthreads_hw_avail;
-        *localityOrder  = NULL;
+        hwThreads       = hwTop.machine().logicalProcessorCount;
+        *localityOrder  = nullptr;
     }
     // Only warn about the first problem per node.  Otherwise, the first test
     // failing would essentially always cause also the other problems get
@@ -144,8 +170,8 @@ get_thread_affinity_layout(FILE *fplog,
     if (invalidWithinSimulation(cr, invalidValue))
     {
         /* We don't know anything about the hardware, don't pin */
-        md_print_warn(cr, fplog,
-                      "NOTE: No information on available cores, thread pinning disabled.\n");
+        GMX_LOG(mdlog.warning).asParagraph().appendText(
+                "NOTE: No information on available cores, thread pinning disabled.");
         alreadyWarned = true;
     }
     bool validLayout = !invalidValue;
@@ -156,11 +182,11 @@ get_thread_affinity_layout(FILE *fplog,
         bool warn = (invalidValue && threads > 1 && threads < hwThreads);
         if (invalidWithinSimulation(cr, warn) && !alreadyWarned)
         {
-            md_print_warn(cr, fplog,
-                          "NOTE: The number of threads is not equal to the number of (logical) cores\n"
-                          "      and the -pin option is set to auto: will not pin thread to cores.\n"
-                          "      This can lead to significant performance degradation.\n"
-                          "      Consider using -pin on (and -pinoffset in case you run multiple jobs).\n");
+            GMX_LOG(mdlog.warning).asParagraph().appendText(
+                    "NOTE: The number of threads is not equal to the number of (logical) cores\n"
+                    "      and the -pin option is set to auto: will not pin thread to cores.\n"
+                    "      This can lead to significant performance degradation.\n"
+                    "      Consider using -pin on (and -pinoffset in case you run multiple jobs).");
             alreadyWarned = true;
         }
         validLayout = validLayout && !invalidValue;
@@ -169,8 +195,8 @@ get_thread_affinity_layout(FILE *fplog,
     invalidValue = (threads > hwThreads);
     if (invalidWithinSimulation(cr, invalidValue) && !alreadyWarned)
     {
-        md_print_warn(cr, fplog,
-                      "NOTE: Oversubscribing a CPU, will not pin threads.\n");
+        GMX_LOG(mdlog.warning).asParagraph().appendText(
+                "NOTE: Oversubscribing the CPU, will not pin threads");
         alreadyWarned = true;
     }
     validLayout = validLayout && !invalidValue;
@@ -178,8 +204,8 @@ get_thread_affinity_layout(FILE *fplog,
     invalidValue = (pin_offset + threads > hwThreads);
     if (invalidWithinSimulation(cr, invalidValue) && !alreadyWarned)
     {
-        md_print_warn(cr, fplog,
-                      "WARNING: Requested offset too large for available cores, thread pinning disabled.\n");
+        GMX_LOG(mdlog.warning).asParagraph().appendText(
+                "WARNING: Requested offset too large for available cores, thread pinning disabled.");
         alreadyWarned = true;
 
     }
@@ -219,14 +245,15 @@ get_thread_affinity_layout(FILE *fplog,
     if (invalidWithinSimulation(cr, invalidValue) && !alreadyWarned)
     {
         /* We are oversubscribing, don't pin */
-        md_print_warn(cr, fplog,
-                      "WARNING: Requested stride too large for available cores, thread pinning disabled.\n");
+        GMX_LOG(mdlog.warning).asParagraph().appendText(
+                "WARNING: Requested stride too large for available cores, thread pinning disabled.");
     }
     validLayout = validLayout && !invalidValue;
 
-    if (validLayout && fplog != NULL)
+    if (validLayout)
     {
-        fprintf(fplog, "Pinning threads with a%s logical core stride of %d\n",
+        GMX_LOG(mdlog.info).appendTextFormatted(
+                "Pinning threads with a%s logical core stride of %d",
                 bPickPinStride ? "n auto-selected" : " user-specified",
                 *pin_stride);
     }
@@ -235,7 +262,8 @@ get_thread_affinity_layout(FILE *fplog,
 }
 
 static bool set_affinity(const t_commrec *cr, int nthread_local, int thread0_id_node,
-                         int offset, int core_pinning_stride, int *localityOrder)
+                         int offset, int core_pinning_stride, int *localityOrder,
+                         gmx::IThreadAffinityAccess *affinityAccess)
 {
     // Set the per-thread affinity. In order to be able to check the success
     // of affinity settings, we will set nth_affinity_set to 1 on threads
@@ -253,7 +281,6 @@ static bool set_affinity(const t_commrec *cr, int nthread_local, int thread0_id_
         {
             int      thread_id, thread_id_node;
             int      index, core;
-            gmx_bool setaffinity_ret;
 
             thread_id      = gmx_omp_get_thread_num();
             thread_id_node = thread0_id_node + thread_id;
@@ -267,15 +294,15 @@ static bool set_affinity(const t_commrec *cr, int nthread_local, int thread0_id_
                 core = index;
             }
 
-            setaffinity_ret = tMPI_Thread_setaffinity_single(tMPI_Thread_self(), core);
+            const bool ret = affinityAccess->setCurrentThreadAffinityToCore(core);
 
             /* store the per-thread success-values of the setaffinity */
-            nth_affinity_set += (setaffinity_ret == 0);
+            nth_affinity_set += (ret ? 1 : 0);
 
             if (debug)
             {
                 fprintf(debug, "On rank %2d, thread %2d, index %2d, core %2d the affinity setting returned %d\n",
-                        cr->nodeid, gmx_omp_get_thread_num(), index, core, setaffinity_ret);
+                        cr->nodeid, gmx_omp_get_thread_num(), index, core, ret ? 1 : 0);
             }
         }
         GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
@@ -317,6 +344,7 @@ static bool set_affinity(const t_commrec *cr, int nthread_local, int thread0_id_
                     nthread_local > 1 ? "s" : "");
         }
 
+        // TODO: This output should also go through mdlog.
         fprintf(stderr, "NOTE: %sAffinity setting %sfailed.\n", sbuf1, sbuf2);
     }
     return allAffinitiesSet;
@@ -332,13 +360,14 @@ static bool set_affinity(const t_commrec *cr, int nthread_local, int thread0_id_
    if only PME is using threads.
  */
 void
-gmx_set_thread_affinity(FILE                *fplog,
-                        const t_commrec     *cr,
-                        const gmx_hw_opt_t  *hw_opt,
-                        const gmx_hw_info_t *hwinfo)
+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,
+                        gmx::IThreadAffinityAccess  *affinityAccess)
 {
-    int        thread0_id_node,
-               nthread_local, nthread_node;
+    int        thread0_id_node, nthread_node;
     int *      localityOrder = nullptr;
 
     if (hw_opt->thread_affinity == threadaffOFF)
@@ -347,31 +376,26 @@ gmx_set_thread_affinity(FILE                *fplog,
         return;
     }
 
+    if (affinityAccess == nullptr)
+    {
+        affinityAccess = &g_defaultAffinityAccess;
+    }
+
     /* If the tMPI thread affinity setting is not supported encourage the user
      * to report it as it's either a bug or an exotic platform which we might
      * want to support. */
-    if (tMPI_Thread_setaffinity_support() != TMPI_SETAFFINITY_SUPPORT_YES)
+    if (!affinityAccess->isThreadAffinitySupported())
     {
         /* we know Mac OS & BlueGene do 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__)
-        md_print_warn(cr, fplog,
-                      "NOTE: Cannot set thread affinities on the current platform.\n");
+        GMX_LOG(mdlog.warning).asParagraph().appendText(
+                "NOTE: Cannot set thread affinities on the current platform.");
 #endif  /* __APPLE__ */
         return;
     }
 
-    /* threads on this MPI process or TMPI thread */
-    if (cr->duty & DUTY_PP)
-    {
-        nthread_local = gmx_omp_nthreads_get(emntNonbonded);
-    }
-    else
-    {
-        nthread_local = gmx_omp_nthreads_get(emntPME);
-    }
-
     /* map the current process to cores */
     thread0_id_node = 0;
     nthread_node    = nthread_local;
@@ -384,7 +408,7 @@ gmx_set_thread_affinity(FILE                *fplog,
         MPI_Comm comm_intra;
 
         MPI_Comm_split(MPI_COMM_WORLD,
-                       gmx_physicalnode_id_hash(), cr->rank_intranode,
+                       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 */
@@ -399,20 +423,21 @@ gmx_set_thread_affinity(FILE                *fplog,
     int  core_pinning_stride = hw_opt->core_pinning_stride;
     if (offset != 0)
     {
-        md_print_info(cr, fplog, "Applying core pinning offset %d\n", offset);
+        GMX_LOG(mdlog.warning).appendTextFormatted("Applying core pinning offset %d", offset);
     }
 
     bool automatic = (hw_opt->thread_affinity == threadaffAUTO);
     bool validLayout
-        = get_thread_affinity_layout(fplog, cr, hwinfo, nthread_node, automatic,
+        = get_thread_affinity_layout(mdlog, cr, hwTop, nthread_node, automatic,
                                      offset, &core_pinning_stride, &localityOrder);
-    gmx::scoped_guard_sfree localityOrderGuard(localityOrder);
+    const gmx::sfree_guard  localityOrderGuard(localityOrder);
 
     bool                    allAffinitiesSet;
     if (validLayout)
     {
         allAffinitiesSet = set_affinity(cr, nthread_local, thread0_id_node,
-                                        offset, core_pinning_stride, localityOrder);
+                                        offset, core_pinning_stride, localityOrder,
+                                        affinityAccess);
     }
     else
     {
@@ -421,9 +446,9 @@ gmx_set_thread_affinity(FILE                *fplog,
     }
     if (invalidWithinSimulation(cr, !allAffinitiesSet))
     {
-        md_print_warn(cr, fplog,
-                      "NOTE: Thread affinity setting failed. This can cause performance degradation.\n"
-                      "      If you think your settings are correct, ask on the gmx-users list.\n");
+        GMX_LOG(mdlog.warning).asParagraph().appendText(
+                "NOTE: Thread affinity setting failed. This can cause performance degradation.\n"
+                "      If you think your settings are correct, ask on the gmx-users list.");
     }
 }
 
@@ -432,11 +457,11 @@ gmx_set_thread_affinity(FILE                *fplog,
  * Note that this will only work on Linux as we use a GNU feature.
  */
 void
-gmx_check_thread_affinity_set(FILE            *fplog,
-                              const t_commrec *cr,
-                              gmx_hw_opt_t    *hw_opt,
-                              int  gmx_unused  nthreads_hw_avail,
-                              gmx_bool         bAfterOpenmpInit)
+gmx_check_thread_affinity_set(const gmx::MDLogger &mdlog,
+                              const t_commrec     *cr,
+                              gmx_hw_opt_t        *hw_opt,
+                              int  gmx_unused      nthreads_hw_avail,
+                              gmx_bool             bAfterOpenmpInit)
 {
     GMX_RELEASE_ASSERT(hw_opt, "hw_opt must be a non-NULL pointer");
 
@@ -453,7 +478,7 @@ gmx_check_thread_affinity_set(FILE            *fplog,
             if (!gmx_omp_check_thread_affinity(&message))
             {
                 /* TODO: with -pin auto we should only warn when using all cores */
-                md_print_warn(cr, fplog, "%s", message);
+                GMX_LOG(mdlog.warning).asParagraph().appendText(message);
                 sfree(message);
                 hw_opt->thread_affinity = threadaffOFF;
             }
@@ -537,14 +562,14 @@ gmx_check_thread_affinity_set(FILE            *fplog,
         {
             if (!bAfterOpenmpInit)
             {
-                md_print_warn(cr, fplog,
-                              "Non-default thread affinity set, disabling internal thread affinity");
+                GMX_LOG(mdlog.warning).asParagraph().appendText(
+                        "Non-default thread affinity set, disabling internal thread affinity");
             }
             else
             {
-                md_print_warn(cr, fplog,
-                              "Non-default thread affinity set probably by the OpenMP library,\n"
-                              "disabling internal thread affinity");
+                GMX_LOG(mdlog.warning).asParagraph().appendText(
+                        "Non-default thread affinity set probably by the OpenMP library,\n"
+                        "disabling internal thread affinity");
             }
             hw_opt->thread_affinity = threadaffOFF;
         }
@@ -553,9 +578,9 @@ gmx_check_thread_affinity_set(FILE            *fplog,
             /* Only warn once, at the last check (bAfterOpenmpInit==TRUE) */
             if (bAfterOpenmpInit)
             {
-                md_print_warn(cr, fplog,
-                              "Overriding thread affinity set outside %s\n",
-                              gmx::getProgramContext().displayName());
+                GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
+                        "Overriding thread affinity set outside %s",
+                        gmx::getProgramContext().displayName());
             }
         }
 
index 8ca8854bf2d35f08c4b5e939a3cc2e98d0394c7b..5511c82e0d2f3a35d82c33707ab6be1829adc949 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,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.
 
 #include <cstdio>
 
-#include "gromacs/hardware/hw_info.h"
 #include "gromacs/utility/basedefinitions.h"
 
+struct gmx_hw_opt_t;
 struct t_commrec;
 
+namespace gmx
+{
+
+class HardwareTopology;
+class MDLogger;
+
+class IThreadAffinityAccess
+{
+    public:
+        virtual bool isThreadAffinitySupported() const        = 0;
+        virtual int physicalNodeId() const                    = 0;
+        virtual bool setCurrentThreadAffinityToCore(int core) = 0;
+
+    protected:
+        virtual ~IThreadAffinityAccess();
+};
+
+} // namespace gmx
+
 /*! \brief
  * Sets the thread affinity using the requested setting stored in hw_opt.
- *
- * The hardware topology is requested from hwinfo, when present.
  */
 void
-gmx_set_thread_affinity(FILE                *fplog,
-                        const t_commrec     *cr,
-                        const gmx_hw_opt_t  *hw_opt,
-                        const gmx_hw_info_t *hwinfo);
+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,
+                        gmx::IThreadAffinityAccess  *affinityAccess);
 
 /*! \brief
  * Checks the process affinity mask and if it is found to be non-zero,
@@ -75,7 +94,7 @@ gmx_set_thread_affinity(FILE                *fplog,
  * variables for setting the affinity are set.
  */
 void
-gmx_check_thread_affinity_set(FILE *fplog, const t_commrec *cr,
+gmx_check_thread_affinity_set(const gmx::MDLogger &mdlog, const t_commrec *cr,
                               gmx_hw_opt_t *hw_opt, int ncpus,
                               gmx_bool bAfterOpenmpInit);
 
index bbe97073c75761511ebd1696cff71a54daa5b03a..37cab123b418ddb1e488e11fb261f0b7422f5b57 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,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.
@@ -97,11 +97,14 @@ struct t_commrec {
     MPI_Comm mpi_comm_mysim;
     MPI_Comm mpi_comm_mygroup;
 
-    /* MPI ranks within a physical node for hardware access */
-    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 */
+    /* MPI ranks and a communicator within a physical node for hardware access */
+    MPI_Comm       mpi_comm_physicalnode; /* communicator for all ranks of the physical node
+                                           * NOTE: this communicator should only be used during initialization and finalization, as it can contain ranks from PP, PME and multiple simulations with multisim
+                                           */
+    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;
 
diff --git a/src/gromacs/mdtypes/edsamhistory.h b/src/gromacs/mdtypes/edsamhistory.h
new file mode 100644 (file)
index 0000000..bd418be
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+
+/*
+ * This file contains data types containing essential dynamics and
+ * flooding data to be stored in the checkpoint file.
+ */
+
+#ifndef GMX_MDLIB_EDSAMHISTORY_H
+#define GMX_MDLIB_EDSAMHISTORY_H
+
+/* Helper structure to be able to make essential dynamics / flooding group(s) whole
+ *
+ * If one uses essential dynamics or flooding on a group of atoms from
+ * more than one molecule, we cannot make this group whole with
+ * do_pbc_first_mtop(). We assume that the ED group has the correct PBC
+ * representation at the beginning of the simulation and keep track
+ * of the shifts to always get it into that representation.
+ * For proper restarts from a checkpoint we store the positions of the
+ * reference group at the time of checkpoint writing.
+ */
+typedef struct edsamhistory_t
+{
+    gmx_bool      bFromCpt;     // Did we start from a checkpoint file?
+    int           nED;          // No. of ED/Flooding data sets, if <1 no ED
+    int          *nref;         // No. of atoms in i'th reference structure
+    int          *nav;          // Same for average structure
+    rvec        **old_sref;     // Positions of the reference atoms at the last time step (with correct PBC representation)
+    rvec        **old_sref_p;   // Pointer to these positions
+    rvec        **old_sav;      // Same for the average positions
+    rvec        **old_sav_p;    // Pointer to these positions
+}
+edsamhistory_t;
+
+#endif
index cbdb1a9fe43e685fe4dbf49840183f3c56cfdd65..910ea36e8d21bc3183cb00857d581c036a51e1ad 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 2015,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
+
+/*! \libinternal \file
+ *
+ *
+ * \brief
+ * This file contains datatypes for energy statistics history.
+ *
+ * \author Berk Hess
+ *
+ * \inlibraryapi
+ * \ingroup module_mdtypes
+ */
+
 #ifndef GMX_MDLIB_ENERGYHISTORY_H
 #define GMX_MDLIB_ENERGYHISTORY_H
 
+#include <memory>
+#include <vector>
+
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/real.h"
 
-/* energy history for delta_h histograms */
-typedef struct delta_h_history_t
-{
-    int      nndh;             /* the number of energy difference lists */
-    int     *ndh;              /* the number in each energy difference list */
-    real   **dh;               /* the energy difference lists */
+//! \cond INTERNAL
 
-    double   start_time;       /* the start time of these energy diff blocks */
-    double   start_lambda;     /* lambda at start time */
+//! \brief Energy history for delta_h histograms in between energy file frames
+class delta_h_history_t
+{
+    public:
+        //! Vector (size number of intermediate data points) of vector of Hamiltonian differences for each foreign lambda
+        std::vector<std::vector<real> > dh;
+        //! The start time of these energy diff blocks
+        double                          start_time;
+        //! Lambda at start time
+        double                          start_lambda;
+        //! Whether the lambda value is set. Here for backward-compatibility.
+        gmx_bool                        start_lambda_set;
 
-    gmx_bool start_lambda_set; /* whether the lambda value is set. Here
-                                  For backward-compatibility. */
-} delta_h_history_t;
+        //! Constructor
+        delta_h_history_t() : dh(),
+                              start_time(0),
+                              start_lambda(0),
+                              start_lambda_set(false)
+        {
+        }
+};
 
 
-typedef struct energyhistory_t
+//! \brief Energy statistics history, only used for output and reporting
+class energyhistory_t
 {
-    gmx_int64_t        nsteps;       /* The number of steps in the history            */
-    gmx_int64_t        nsum;         /* The nr. of steps in the ener_ave and ener_sum */
-    double         *   ener_ave;     /* Energy term history sum to get fluctuations   */
-    double         *   ener_sum;     /* Energy term history sum to get fluctuations   */
-    int                nener;        /* Number of energy terms in two previous arrays */
-    gmx_int64_t        nsteps_sim;   /* The number of steps in ener_sum_sim      */
-    gmx_int64_t        nsum_sim;     /* The number of frames in ener_sum_sim     */
-    double         *   ener_sum_sim; /* Energy term history sum of the whole sim      */
+    public:
+        gmx_int64_t         nsteps;       //! The number of steps in the history
+        gmx_int64_t         nsum;         //! Nr. of steps in the ener_ave and ener_sum
+        std::vector<double> ener_ave;     //! Energy terms difference^2 sum to get fluctuations
+        std::vector<double> ener_sum;     //! Energy terms sum
+        gmx_int64_t         nsteps_sim;   //! The number of steps in ener_sum_sim
+        gmx_int64_t         nsum_sim;     //! The number of frames in ener_sum_sim
+        std::vector<double> ener_sum_sim; //! Energy term history sum of the whole sim
 
-    delta_h_history_t *dht;          /* The BAR energy differences */
-}
-energyhistory_t;
+        //! History for energy difference for foreign lambdas (useful for BAR)
+        std::unique_ptr<delta_h_history_t> deltaHForeignLambdas;
 
-/* \brief Initialize an energy history structure
- */
-void init_energyhistory(energyhistory_t * enerhist);
+        //! Constructor
+        energyhistory_t() : nsteps(0),
+                            nsum(0),
+                            ener_ave(),
+                            ener_sum(),
+                            nsteps_sim(0),
+                            nsum_sim(0),
+                            ener_sum_sim(0)
+        {
+        }
+};
 
-/* \brief Destroy an energy history structure
- */
-void done_energyhistory(energyhistory_t * enerhist);
+//! \endcond
 
 #endif
index ecb800a818bbccee9948d370c82fcd4ef1b4e079..1243c99211be48a0818a874eb6d4088384e5fae6 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,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.
@@ -75,31 +75,37 @@ typedef struct t_disresdata {
     const t_iatom *forceatomsStart; /* Pointer to the start of the disre forceatoms */
 } t_disresdata;
 
+/* All coefficients for the matrix equation for the orientation tensor */
+struct OriresMatEq
+{
+    real rhs[5];    /* The right hand side of the matrix equation */
+    real mat[5][5]; /* The matrix                                 */
+};
 
 /* Orientation restraining stuff */
 typedef struct t_oriresdata {
-    real      fc;            /* Force constant for the restraints                  */
-    real      edt;           /* Multiplication factor for time averaging           */
-    real      edt_1;         /* 1 - edt                                            */
-    real      exp_min_t_tau; /* Factor for slowly switching on the force         */
-    int       nr;            /* The number of orientation restraints               */
-    int       nex;           /* The number of experiments                          */
-    int       nref;          /* The number of atoms for the fit                    */
-    real     *mref;          /* The masses of the reference atoms                  */
-    rvec     *xref;          /* The reference coordinates for the fit (nref)       */
-    rvec     *xtmp;          /* Temporary array for fitting (nref)                 */
-    matrix    R;             /* Rotation matrix to rotate to the reference coor.   */
-    tensor   *S;             /* Array of order tensors for each experiment (nexp)  */
-    rvec5    *Dinsl;         /* The order matrix D for all restraints (nr x 5)     */
-    rvec5    *Dins;          /* The ensemble averaged D (nr x 5)                   */
-    rvec5    *Dtav;          /* The time and ensemble averaged D (nr x 5)          */
-    real     *oinsl;         /* The calculated instantaneous orientations          */
-    real     *oins;          /* The calculated emsemble averaged orientations      */
-    real     *otav;          /* The calculated time and ensemble averaged orient.  */
-    real      rmsdev;        /* The weighted (using kfac) RMS deviation            */
-    rvec5    *tmp;           /* An array of temporary 5-vectors (nex);             */
-    real   ***TMP;           /* An array of temporary 5x5 matrices (nex);          */
-    real     *eig;           /* Eigenvalues/vectors, for output only (nex x 12)    */
+    real         fc;            /* Force constant for the restraints                  */
+    real         edt;           /* Multiplication factor for time averaging           */
+    real         edt_1;         /* 1 - edt                                            */
+    real         exp_min_t_tau; /* Factor for slowly switching on the force         */
+    int          nr;            /* The number of orientation restraints               */
+    int          nex;           /* The number of experiments                          */
+    int          typeMin;       /* The minimum iparam type index for restraints       */
+    int          nref;          /* The number of atoms for the fit                    */
+    real        *mref;          /* The masses of the reference atoms                  */
+    rvec        *xref;          /* The reference coordinates for the fit (nref)       */
+    rvec        *xtmp;          /* Temporary array for fitting (nref)                 */
+    matrix       R;             /* Rotation matrix to rotate to the reference coor.   */
+    tensor      *S;             /* Array of order tensors for each experiment (nexp)  */
+    rvec5       *Dinsl;         /* The order matrix D for all restraints (nr x 5)     */
+    rvec5       *Dins;          /* The ensemble averaged D (nr x 5)                   */
+    rvec5       *Dtav;          /* The time and ensemble averaged D (nr x 5)          */
+    real        *oinsl;         /* The calculated instantaneous orientations          */
+    real        *oins;          /* The calculated emsemble averaged orientations      */
+    real        *otav;          /* The calculated time and ensemble averaged orient.  */
+    real         rmsdev;        /* The weighted (using kfac) RMS deviation            */
+    OriresMatEq *tmpEq;         /* An temporary array of matrix + rhs                 */
+    real        *eig;           /* Eigenvalues/vectors, for output only (nex x 12)    */
 
     /* variables for diagonalization with diagonalize_orires_tensors()*/
     double **M;
index 1ba04de5238db7940e6865baa5d6a92a2e1851d4..62f5030711ef961d34d5014ed27ea4c696dc2ee3 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,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.
 #define GMX_MDTYPES_TYPES_FORCEREC_H
 
 #include "gromacs/math/vectypes.h"
+#ifdef __cplusplus
+#include "gromacs/math/paddedvector.h"
+#endif
 #include "gromacs/mdtypes/interaction_const.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/topology/idef.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/real.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-} /* fixes auto-indentation problems */
-#endif
+struct ForceProviders;
 
 /* Abstract type for PME that is defined only in the routine that use them. */
 struct gmx_genborn_t;
@@ -61,8 +59,10 @@ struct t_forcetable;
 struct t_nblist;
 struct t_nblists;
 struct t_QMMMrec;
-struct gmx_hw_info_t;
-struct gmx_gpu_opt_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /* macros for the cginfo data in forcerec
  *
@@ -121,43 +121,46 @@ enum {
 };
 extern const char *egrp_nm[egNR+1];
 
-typedef struct gmx_grppairener_t {
+struct gmx_grppairener_t
+{
     int   nener;      /* The number of energy group pairs     */
     real *ener[egNR]; /* Energy terms for each pair of groups */
-} gmx_grppairener_t;
-
-typedef struct gmx_enerdata_t {
-    real              term[F_NRE];         /* The energies for all different interaction types */
-    gmx_grppairener_t grpp;
-    double            dvdl_lin[efptNR];    /* Contributions to dvdl with linear lam-dependence */
-    double            dvdl_nonlin[efptNR]; /* Idem, but non-linear dependence                  */
-    int               n_lambda;
-    int               fep_state;           /*current fep state -- just for printing */
-    double           *enerpart_lambda;     /* Partial energy for lambda and flambda[] */
-    real              foreign_term[F_NRE]; /* alternate array for storing foreign lambda energies */
-    gmx_grppairener_t foreign_grpp;        /* alternate array for storing foreign lambda energies */
-} gmx_enerdata_t;
+};
+
+struct gmx_enerdata_t
+{
+    real                     term[F_NRE];         /* The energies for all different interaction types */
+    struct gmx_grppairener_t grpp;
+    double                   dvdl_lin[efptNR];    /* Contributions to dvdl with linear lam-dependence */
+    double                   dvdl_nonlin[efptNR]; /* Idem, but non-linear dependence                  */
+    int                      n_lambda;
+    int                      fep_state;           /*current fep state -- just for printing */
+    double                  *enerpart_lambda;     /* Partial energy for lambda and flambda[] */
+    real                     foreign_term[F_NRE]; /* alternate array for storing foreign lambda energies */
+    struct gmx_grppairener_t foreign_grpp;        /* alternate array for storing foreign lambda energies */
+};
 /* The idea is that dvdl terms with linear lambda dependence will be added
  * automatically to enerpart_lambda. Terms with non-linear lambda dependence
  * should explicitly determine the energies at foreign lambda points
  * when n_lambda > 0.
  */
 
-typedef struct {
+struct cginfo_mb_t
+{
     int  cg_start;
     int  cg_end;
     int  cg_mod;
     int *cginfo;
-} cginfo_mb_t;
+};
 
 
 /* Forward declaration of type for managing Ewald tables */
 struct gmx_ewald_tab_t;
 
-typedef struct ewald_corr_thread_t ewald_corr_thread_t;
+struct ewald_corr_thread_t;
 
-typedef struct t_forcerec {
-    interaction_const_t *ic;
+struct t_forcerec {
+    struct interaction_const_t *ic;
 
     /* Domain Decomposition */
     gmx_bool bDomDec;
@@ -169,8 +172,6 @@ typedef struct t_forcerec {
     rvec                        posres_com;
     rvec                        posres_comB;
 
-    const struct gmx_hw_info_t *hwinfo;
-    const struct gmx_gpu_opt_t *gpu_opt;
     gmx_bool                    use_simd_kernels;
 
     /* Interaction for calculated in kernels. In many cases this is similar to
@@ -269,15 +270,15 @@ typedef struct t_forcerec {
     /* solvent_opt contains the enum for the most common solvent
      * in the system, which will be optimized.
      * It can be set to esolNO to disable all water optimization */
-    int          solvent_opt;
-    int          nWatMol;
-    gmx_bool     bGrid;
-    gmx_bool     bExcl_IntraCGAll_InterCGNone;
-    cginfo_mb_t *cginfo_mb;
-    int         *cginfo;
-    rvec        *cg_cm;
-    int          cg_nalloc;
-    rvec        *shift_vec;
+    int                 solvent_opt;
+    int                 nWatMol;
+    gmx_bool            bGrid;
+    gmx_bool            bExcl_IntraCGAll_InterCGNone;
+    struct cginfo_mb_t *cginfo_mb;
+    int                *cginfo;
+    rvec               *cg_cm;
+    int                 cg_nalloc;
+    rvec               *shift_vec;
 
     /* The neighborlists including tables */
     int                        nnblists;
@@ -303,15 +304,24 @@ typedef struct t_forcerec {
 
     /* Forces that should not enter into the virial summation:
      * PPPM/PME/Ewald/posres
+     * If such forces are present in the system, bF_NoVirSum=TRUE.
      */
-    gmx_bool bF_NoVirSum;
-    int      f_novirsum_n;
-    int      f_novirsum_nalloc;
-    rvec    *f_novirsum_alloc;
-    /* Pointer that points to f_novirsum_alloc when pressure is calcaluted,
-     * points to the normal force vectors wen pressure is not requested.
+    gmx_bool          bF_NoVirSum;
+#ifdef __cplusplus
+    /* TODO: Replace the pointer by an object once we got rid of C */
+    PaddedRVecVector *forceBufferNoVirialSummation;
+#else
+    void             *forceBufferNoVirialSummation_dummy;
+#endif
+    /* Pointer that points to forceNoVirialSummation when virial is calcaluted,
+     * points to the normal force vector when the virial is not requested
+     * or when bF_NoVirSum == FALSE.
      */
-    rvec *f_novirsum;
+#ifdef __cplusplus
+    PaddedRVecVector *f_novirsum;
+#else
+    void             *f_novirsum_xdummy;
+#endif
 
     /* Long-range forces and virial for PPPM/PME/Ewald */
     struct gmx_pme_t *pmedata;
@@ -421,9 +431,11 @@ typedef struct t_forcerec {
     struct bonded_threading_t *bonded_threading;
 
     /* Ewald correction thread local virial and energy data */
-    int                  nthread_ewc;
-    ewald_corr_thread_t *ewc_t;
-} t_forcerec;
+    int                         nthread_ewc;
+    struct ewald_corr_thread_t *ewc_t;
+
+    struct ForceProviders      *forceProviders;
+};
 
 /* Important: Starting with Gromacs-4.6, the values of c6 and c12 in the nbfp array have
  * been scaled by 6.0 or 12.0 to save flops in the kernels. We have corrected this everywhere
@@ -438,4 +450,5 @@ typedef struct t_forcerec {
 #ifdef __cplusplus
 }
 #endif
+
 #endif
diff --git a/src/gromacs/mdtypes/iforceprovider.cpp b/src/gromacs/mdtypes/iforceprovider.cpp
new file mode 100644 (file)
index 0000000..c6f9c77
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Implements classes from iforceprovider.h.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_mdtypes
+ */
+#include "gmxpre.h"
+
+#include "iforceprovider.h"
+
+#include <vector>
+
+#include "gromacs/utility/arrayref.h"
+
+using namespace gmx;
+
+class ForceProviders::Impl
+{
+    public:
+        std::vector<IForceProvider *> withVirialContribution_;
+        std::vector<IForceProvider *> withoutVirialContribution_;
+};
+
+ForceProviders::ForceProviders()
+    : impl_(new Impl)
+{
+}
+
+ForceProviders::~ForceProviders()
+{
+}
+
+void ForceProviders::addForceProvider(gmx::IForceProvider *provider)
+{
+    impl_->withVirialContribution_.push_back(provider);
+}
+
+void ForceProviders::addForceProviderWithoutVirialContribution(gmx::IForceProvider *provider)
+{
+    impl_->withoutVirialContribution_.push_back(provider);
+}
+
+bool ForceProviders::hasForcesWithoutVirialContribution() const
+{
+    return !impl_->withoutVirialContribution_.empty();
+}
+
+void ForceProviders::calculateForces(const t_commrec          *cr,
+                                     const t_mdatoms          *mdatoms,
+                                     const matrix              box,
+                                     double                    t,
+                                     const rvec               *x,
+                                     gmx::ArrayRef<gmx::RVec>  force,
+                                     gmx::ArrayRef<gmx::RVec>  f_novirsum) const
+{
+    for (auto provider : impl_->withVirialContribution_)
+    {
+        provider->calculateForces(cr, mdatoms, box, t, x, force);
+    }
+    for (auto provider : impl_->withoutVirialContribution_)
+    {
+        provider->calculateForces(cr, mdatoms, box, t, x, f_novirsum);
+    }
+}
diff --git a/src/gromacs/mdtypes/iforceprovider.h b/src/gromacs/mdtypes/iforceprovider.h
new file mode 100644 (file)
index 0000000..cccc276
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares gmx::IForceProvider and ForceProviders.
+ *
+ * See \ref page_mdmodules for an overview of this and associated interfaces.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_mdtypes
+ */
+#ifndef GMX_MDTYPES_IFORCEPROVIDER_H
+#define GMX_MDTYPES_IFORCEPROVIDER_H
+
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/classhelpers.h"
+
+struct t_commrec;
+struct t_forcerec;
+struct t_mdatoms;
+
+namespace gmx
+{
+
+template <typename T>
+class ArrayRef;
+
+/*! \libinternal \brief
+ * Interface for a component that provides forces during MD.
+ *
+ * Modules implementing IMDModule generally implement this internally, and use
+ * IMDModule::initForceProviders() to register their implementation in
+ * ForceProviders.
+ *
+ * The interface most likely requires additional generalization for use in
+ * other modules than the current electric field implementation.
+ *
+ * \inlibraryapi
+ * \ingroup module_mdtypes
+ */
+class IForceProvider
+{
+    public:
+        /*! \brief
+         * Computes forces.
+         *
+         * \param[in]    cr      Communication record for parallel operations
+         * \param[in]    mdatoms Atom information
+         * \param[in]    box     The box
+         * \param[in]    t       The actual time in the simulation (ps)
+         * \param[in]    x       The coordinates
+         * \param[inout] force   The forces
+         */
+        virtual void calculateForces(const t_commrec          *cr,
+                                     const t_mdatoms          *mdatoms,
+                                     const matrix              box,
+                                     double                    t,
+                                     const rvec               *x,
+                                     gmx::ArrayRef<gmx::RVec>  force) = 0;
+
+    protected:
+        ~IForceProvider() {}
+};
+
+} // namespace gmx
+
+/*! \libinternal \brief
+ * Evaluates forces from a collection of gmx::IForceProvider.
+ *
+ * This class is a `struct` outside the `gmx` namespace to make it possible to
+ * forward-declare it in forcerec.h, which still needs to compile when included
+ * from the C group kernels.
+ *
+ * \inlibraryapi
+ * \ingroup module_mdtypes
+ */
+struct ForceProviders
+{
+    public:
+        ForceProviders();
+        ~ForceProviders();
+
+        /*! \brief
+         * Adds a provider.
+         */
+        void addForceProvider(gmx::IForceProvider *provider);
+        /*! \brief
+         * Adds a provider whose forces should not contribute to the virial.
+         */
+        void addForceProviderWithoutVirialContribution(gmx::IForceProvider *provider);
+
+        //! Whether there are modules that do not contribute to the virial.
+        bool hasForcesWithoutVirialContribution() const;
+
+        //! Computes forces.
+        void calculateForces(const t_commrec          *cr,
+                             const t_mdatoms          *mdatoms,
+                             const matrix              box,
+                             double                    t,
+                             const rvec               *x,
+                             gmx::ArrayRef<gmx::RVec>  force,
+                             gmx::ArrayRef<gmx::RVec>  f_novirsum) const;
+
+    private:
+        class Impl;
+
+        gmx::PrivateImplPointer<Impl> impl_;
+};
+
+#endif
diff --git a/src/gromacs/mdtypes/imdmodule.h b/src/gromacs/mdtypes/imdmodule.h
new file mode 100644 (file)
index 0000000..94cba24
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares gmx::IMDModule.
+ *
+ * See \ref page_mdmodules for an overview of this and associated interfaces.
+ *
+ * \inlibraryapi
+ * \ingroup module_mdtypes
+ */
+#ifndef GMX_MDTYPES_IMDMODULE_H
+#define GMX_MDTYPES_IMDMODULE_H
+
+struct ForceProviders;
+
+namespace gmx
+{
+
+class IMDOutputProvider;
+class IMdpOptionProvider;
+
+/*! \libinternal \brief
+ * Extension module for \Gromacs simulations.
+ *
+ * The methods that return other interfaces can in the future return null for
+ * those interfaces that the module does not need to implement, but currently
+ * the callers are not prepared to generically handle various cases.
+ *
+ * \inlibraryapi
+ * \ingroup module_mdtypes
+ */
+class IMDModule
+{
+    public:
+        virtual ~IMDModule() {}
+
+        //! Returns an interface for handling mdp input (and tpr I/O).
+        virtual IMdpOptionProvider *mdpOptionProvider() = 0;
+        //! Returns an interface for handling output files during simulation.
+        virtual IMDOutputProvider *outputProvider()     = 0;
+        //! Initializes force providers from this module.
+        virtual void initForceProviders(ForceProviders *forceProviders) = 0;
+};
+
+} // namespace gmx
+
+#endif
diff --git a/src/gromacs/mdtypes/imdoutputprovider.h b/src/gromacs/mdtypes/imdoutputprovider.h
new file mode 100644 (file)
index 0000000..b02f97f
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares gmx::IMDOutputProvider.
+ *
+ * See \ref page_mdmodules for an overview of this and associated interfaces.
+ *
+ * \inlibraryapi
+ * \ingroup module_mdtypes
+ */
+#ifndef GMX_MDTYPES_IMDOUTPUTPROVIDER_H
+#define GMX_MDTYPES_IMDOUTPUTPROVIDER_H
+
+#include <cstdio>
+
+struct gmx_output_env_t;
+struct t_filenm;
+
+namespace gmx
+{
+
+/*! \libinternal \brief
+ * Interface for handling additional output files during a simulation.
+ *
+ * This interface provides a mechanism for additional modules to initialize
+ * and finalize output files during the simulation.  Writing values to the
+ * output files is currently handled elsewhere (e.g., when the module has
+ * computed its forces).
+ *
+ * The interface is not very generic, as it has been written purely based on
+ * extraction of existing functions related to electric field handling.
+ * Also, the command-line parameters to specify the output files cannot be
+ * specified by the module, but are hard-coded in mdrun.
+ * This needs to be generalized when more modules are moved to use the
+ * interface.
+ *
+ * \inlibraryapi
+ * \ingroup module_mdtypes
+ */
+class IMDOutputProvider
+{
+    public:
+        /*! \brief
+         * Initializes file output from a simulation run.
+         *
+         * \param[in] fplog File pointer for log messages
+         * \param[in] nfile Number of files
+         * \param[in] fnm   Array of filenames and properties
+         * \param[in] bAppendFiles Whether or not we should append to files
+         * \param[in] oenv  The output environment for xvg files
+         */
+        virtual void initOutput(FILE *fplog, int nfile, const t_filenm fnm[],
+                                bool bAppendFiles, const gmx_output_env_t *oenv) = 0;
+
+        //! Finalizes output from a simulation run.
+        virtual void finishOutput() = 0;
+
+    protected:
+        ~IMDOutputProvider() {}
+};
+
+} // namespace gmx
+
+#endif
diff --git a/src/gromacs/mdtypes/imdpoptionprovider.h b/src/gromacs/mdtypes/imdpoptionprovider.h
new file mode 100644 (file)
index 0000000..d619166
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares gmx::IMdpOptionProvider.
+ *
+ * See \ref page_mdmodules for an overview of this and associated interfaces.
+ *
+ * \inlibraryapi
+ * \ingroup module_mdtypes
+ */
+#ifndef GMX_MDTYPES_IMDPOPTIONPROVIDER_H
+#define GMX_MDTYPES_IMDPOPTIONPROVIDER_H
+
+namespace gmx
+{
+
+class IKeyValueTreeTransformRules;
+class IOptionsContainerWithSections;
+class KeyValueTreeObjectBuilder;
+
+/*! \libinternal \brief
+ * Interface for handling mdp/tpr input to a mdrun module.
+ *
+ * This interface provides a mechanism for modules to contribute data that
+ * traditionally has been kept in t_inputrec.  This is essentially parameters
+ * read from an mdp file and subsequently stored in a tpr file.
+ *
+ * The main method to implement is initMdpOptions().  This declares a set of
+ * options in nested sections.  When declaring options, the module defines its
+ * own internal variables where the values will be stored (see \ref
+ * module_options for an overview).  The section structure for the options also
+ * defines an internal data representation in the form of a generic key-value
+ * tree.  This is used to store the values in the tpr file, and also for
+ * broadcasting, gmx dump, and gmx check.
+ *
+ * Implementation of initMdpTransform() is required for populating the options
+ * from the current flat mdp format.  It specifies how the mdp parameters map
+ * into the options structure/internal key-value tree specified in
+ * initMdpOptions().
+ *
+ * See \ref page_mdmodules for more details on how mdp parsing and related
+ * functionality works with this interface.
+ *
+ * \inlibraryapi
+ * \ingroup module_mdtypes
+ */
+class IMdpOptionProvider
+{
+    public:
+        /*! \brief
+         * Initializes a transform from mdp values to sectioned options.
+         *
+         * The transform is specified from a flat KeyValueTreeObject that
+         * contains each mdp value as a property, to a structured
+         * key-value tree that should match the options defined in
+         * initMdpOptions().
+         *
+         * This method may be removed once the flat mdp file is replaced with a
+         * more structure input file (that can be directly read into the
+         * internal key-value tree), and there is no longer any need for
+         * backward compatibility with old files.
+         */
+        virtual void initMdpTransform(IKeyValueTreeTransformRules *transform) = 0;
+        /*! \brief
+         * Initializes options that declare input (mdp) parameters for this
+         * module.
+         */
+        virtual void initMdpOptions(IOptionsContainerWithSections *options) = 0;
+        //! Prepares to write a flat key-value tree like an mdp file.
+        virtual void buildMdpOutput(KeyValueTreeObjectBuilder *builder) const = 0;
+
+    protected:
+        ~IMdpOptionProvider() {}
+};
+
+} // namespace gmx
+
+#endif
index 5e6159b633b24317912a89e2e8633473bf7a7586..6391a8a663e473931040473e0f0fe844f61cb2c6 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, by the GROMACS development team, led by
+ * Copyright (c) 2012,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.
 #include "inputrec.h"
 
 #include <cstdio>
+#include <cstdlib>
 #include <cstring>
 
 #include <algorithm>
 
+#include "gromacs/math/veccompare.h"
 #include "gromacs/math/vecdump.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/mdtypes/pull-params.h"
 #include "gromacs/pbcutil/pbc.h"
+#include "gromacs/utility/compare.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/keyvaluetree.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/snprintf.h"
-#include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/strconvert.h"
+#include "gromacs/utility/textwriter.h"
 #include "gromacs/utility/txtdump.h"
 
 //! Macro to select a bool name
@@ -64,6 +69,19 @@ const int nstmin_berendsen_tcouple =  5;
 const int nstmin_berendsen_pcouple = 10;
 const int nstmin_harmonic          = 20;
 
+t_inputrec::t_inputrec()
+{
+    std::memset(this, 0, sizeof(*this));
+    snew(fepvals, 1);
+    snew(expandedvals, 1);
+    snew(simtempvals, 1);
+}
+
+t_inputrec::~t_inputrec()
+{
+    done_inputrec(this);
+}
+
 static int nst_wanted(const t_inputrec *ir)
 {
     if (ir->nstlist > 0)
@@ -251,14 +269,6 @@ gmx_bool ir_vdw_might_be_zero_at_cutoff(const t_inputrec *ir)
     return (ir_vdw_is_zero_at_cutoff(ir) || ir->vdwtype == evdwUSER);
 }
 
-void init_inputrec(t_inputrec *ir)
-{
-    std::memset(ir, 0, sizeof(*ir));
-    snew(ir->fepvals, 1);
-    snew(ir->expandedvals, 1);
-    snew(ir->simtempvals, 1);
-}
-
 static void done_pull_group(t_pull_group *pgrp)
 {
     if (pgrp->nat > 0)
@@ -281,30 +291,20 @@ static void done_pull_params(pull_params_t *pull)
     sfree(pull->coord);
 }
 
-void done_inputrec(t_inputrec *ir)
+static void done_lambdas(t_lambda *fep)
 {
-    int m;
-
-    for (m = 0; (m < DIM); m++)
+    if (fep->n_lambda > 0)
     {
-        if (ir->ex[m].a)
-        {
-            sfree(ir->ex[m].a);
-        }
-        if (ir->ex[m].phi)
-        {
-            sfree(ir->ex[m].phi);
-        }
-        if (ir->et[m].a)
-        {
-            sfree(ir->et[m].a);
-        }
-        if (ir->et[m].phi)
+        for (int i = 0; i < efptNR; i++)
         {
-            sfree(ir->et[m].phi);
+            sfree(fep->all_lambda[i]);
         }
     }
+    sfree(fep->all_lambda);
+}
 
+void done_inputrec(t_inputrec *ir)
+{
     sfree(ir->opts.nrdf);
     sfree(ir->opts.ref_t);
     sfree(ir->opts.annealing);
@@ -326,12 +326,18 @@ void done_inputrec(t_inputrec *ir)
     sfree(ir->opts.SAsteps);
     sfree(ir->opts.bOPT);
     sfree(ir->opts.bTS);
+    sfree(ir->opts.egp_flags);
+    done_lambdas(ir->fepvals);
+    sfree(ir->fepvals);
+    sfree(ir->expandedvals);
+    sfree(ir->simtempvals);
 
     if (ir->pull)
     {
         done_pull_params(ir->pull);
         sfree(ir->pull);
     }
+    delete ir->params;
 }
 
 static void pr_qm_opts(FILE *fp, int indent, const char *title, const t_grpopts *opts)
@@ -475,40 +481,6 @@ static void pr_matrix(FILE *fp, int indent, const char *title, const rvec *m,
     }
 }
 
-static void pr_cosine(FILE *fp, int indent, const char *title, const t_cosines *cos,
-                      gmx_bool bMDPformat)
-{
-    int j;
-
-    if (bMDPformat)
-    {
-        fprintf(fp, "%s = %d\n", title, cos->n);
-    }
-    else
-    {
-        indent = pr_title(fp, indent, title);
-        pr_indent(fp, indent);
-        fprintf(fp, "n = %d\n", cos->n);
-        if (cos->n > 0)
-        {
-            pr_indent(fp, indent+2);
-            fprintf(fp, "a =");
-            for (j = 0; (j < cos->n); j++)
-            {
-                fprintf(fp, " %e", cos->a[j]);
-            }
-            fprintf(fp, "\n");
-            pr_indent(fp, indent+2);
-            fprintf(fp, "phi =");
-            for (j = 0; (j < cos->n); j++)
-            {
-                fprintf(fp, " %e", cos->phi[j]);
-            }
-            fprintf(fp, "\n");
-        }
-    }
-}
-
 #define PS(t, s) pr_str(fp, indent, t, s)
 #define PI(t, s) pr_int(fp, indent, t, s)
 #define PSTEP(t, s) pr_int64(fp, indent, t, s)
@@ -1008,14 +980,6 @@ void pr_inputrec(FILE *fp, int indent, const char *title, const t_inputrec *ir,
             pr_simtempvals(fp, indent, ir->simtempvals, ir->fepvals->n_lambda);
         }
 
-        /* ELECTRIC FIELDS */
-        pr_cosine(fp, indent, "E-x", &(ir->ex[XX]), bMDPformat);
-        pr_cosine(fp, indent, "E-xt", &(ir->et[XX]), bMDPformat);
-        pr_cosine(fp, indent, "E-y", &(ir->ex[YY]), bMDPformat);
-        pr_cosine(fp, indent, "E-yt", &(ir->et[YY]), bMDPformat);
-        pr_cosine(fp, indent, "E-z", &(ir->ex[ZZ]), bMDPformat);
-        pr_cosine(fp, indent, "E-zt", &(ir->et[ZZ]), bMDPformat);
-
         /* ION/WATER SWAPPING FOR COMPUTATIONAL ELECTROPHYSIOLOGY */
         PS("swapcoords", ESWAPTYPE(ir->eSwapCoords));
         if (ir->eSwapCoords != eswapNO)
@@ -1033,6 +997,13 @@ void pr_inputrec(FILE *fp, int indent, const char *title, const t_inputrec *ir,
         PR("userreal3", ir->userreal3);
         PR("userreal4", ir->userreal4);
 
+        if (!bMDPformat)
+        {
+            gmx::TextWriter writer(fp);
+            writer.wrapperSettings().setIndent(indent);
+            gmx::dumpKeyValueTree(&writer, *ir->params);
+        }
+
         pr_grp_opts(fp, indent, "grpopts", &(ir->opts), bMDPformat);
     }
 }
@@ -1040,6 +1011,299 @@ void pr_inputrec(FILE *fp, int indent, const char *title, const t_inputrec *ir,
 #undef PR
 #undef PI
 
+static void cmp_grpopts(FILE *fp, const t_grpopts *opt1, const t_grpopts *opt2, real ftol, real abstol)
+{
+    int  i, j;
+    char buf1[256], buf2[256];
+
+    cmp_int(fp, "inputrec->grpopts.ngtc", -1,  opt1->ngtc, opt2->ngtc);
+    cmp_int(fp, "inputrec->grpopts.ngacc", -1, opt1->ngacc, opt2->ngacc);
+    cmp_int(fp, "inputrec->grpopts.ngfrz", -1, opt1->ngfrz, opt2->ngfrz);
+    cmp_int(fp, "inputrec->grpopts.ngener", -1, opt1->ngener, opt2->ngener);
+    for (i = 0; (i < std::min(opt1->ngtc, opt2->ngtc)); i++)
+    {
+        cmp_real(fp, "inputrec->grpopts.nrdf", i, opt1->nrdf[i], opt2->nrdf[i], ftol, abstol);
+        cmp_real(fp, "inputrec->grpopts.ref_t", i, opt1->ref_t[i], opt2->ref_t[i], ftol, abstol);
+        cmp_real(fp, "inputrec->grpopts.tau_t", i, opt1->tau_t[i], opt2->tau_t[i], ftol, abstol);
+        cmp_int(fp, "inputrec->grpopts.annealing", i, opt1->annealing[i], opt2->annealing[i]);
+        cmp_int(fp, "inputrec->grpopts.anneal_npoints", i,
+                opt1->anneal_npoints[i], opt2->anneal_npoints[i]);
+        if (opt1->anneal_npoints[i] == opt2->anneal_npoints[i])
+        {
+            sprintf(buf1, "inputrec->grpopts.anneal_time[%d]", i);
+            sprintf(buf2, "inputrec->grpopts.anneal_temp[%d]", i);
+            for (j = 0; j < opt1->anneal_npoints[i]; j++)
+            {
+                cmp_real(fp, buf1, j, opt1->anneal_time[i][j], opt2->anneal_time[i][j], ftol, abstol);
+                cmp_real(fp, buf2, j, opt1->anneal_temp[i][j], opt2->anneal_temp[i][j], ftol, abstol);
+            }
+        }
+    }
+    if (opt1->ngener == opt2->ngener)
+    {
+        for (i = 0; i < opt1->ngener; i++)
+        {
+            for (j = i; j < opt1->ngener; j++)
+            {
+                sprintf(buf1, "inputrec->grpopts.egp_flags[%d]", i);
+                cmp_int(fp, buf1, j,
+                        opt1->egp_flags[opt1->ngener*i+j],
+                        opt2->egp_flags[opt1->ngener*i+j]);
+            }
+        }
+    }
+    for (i = 0; (i < std::min(opt1->ngacc, opt2->ngacc)); i++)
+    {
+        cmp_rvec(fp, "inputrec->grpopts.acc", i, opt1->acc[i], opt2->acc[i], ftol, abstol);
+    }
+    for (i = 0; (i < std::min(opt1->ngfrz, opt2->ngfrz)); i++)
+    {
+        cmp_ivec(fp, "inputrec->grpopts.nFreeze", i, opt1->nFreeze[i], opt2->nFreeze[i]);
+    }
+}
+
+static void cmp_pull(FILE *fp)
+{
+    fprintf(fp, "WARNING: Both files use COM pulling, but comparing of the pull struct is not implemented (yet). The pull parameters could be the same or different.\n");
+}
+
+static void cmp_simtempvals(FILE *fp, const t_simtemp *simtemp1, const t_simtemp *simtemp2, int n_lambda, real ftol, real abstol)
+{
+    int i;
+    cmp_int(fp, "inputrec->simtempvals->eSimTempScale", -1, simtemp1->eSimTempScale, simtemp2->eSimTempScale);
+    cmp_real(fp, "inputrec->simtempvals->simtemp_high", -1, simtemp1->simtemp_high, simtemp2->simtemp_high, ftol, abstol);
+    cmp_real(fp, "inputrec->simtempvals->simtemp_low", -1, simtemp1->simtemp_low, simtemp2->simtemp_low, ftol, abstol);
+    for (i = 0; i < n_lambda; i++)
+    {
+        cmp_real(fp, "inputrec->simtempvals->temperatures", -1, simtemp1->temperatures[i], simtemp2->temperatures[i], ftol, abstol);
+    }
+}
+
+static void cmp_expandedvals(FILE *fp, const t_expanded *expand1, const t_expanded *expand2, int n_lambda, real ftol, real abstol)
+{
+    int i;
+
+    cmp_bool(fp, "inputrec->fepvals->bInit_weights", -1, expand1->bInit_weights, expand2->bInit_weights);
+    cmp_bool(fp, "inputrec->fepvals->bWLoneovert", -1, expand1->bWLoneovert, expand2->bWLoneovert);
+
+    for (i = 0; i < n_lambda; i++)
+    {
+        cmp_real(fp, "inputrec->expandedvals->init_lambda_weights", -1,
+                 expand1->init_lambda_weights[i], expand2->init_lambda_weights[i], ftol, abstol);
+    }
+
+    cmp_int(fp, "inputrec->expandedvals->lambda-stats", -1, expand1->elamstats, expand2->elamstats);
+    cmp_int(fp, "inputrec->expandedvals->lambda-mc-move", -1, expand1->elmcmove, expand2->elmcmove);
+    cmp_int(fp, "inputrec->expandedvals->lmc-repeats", -1, expand1->lmc_repeats, expand2->lmc_repeats);
+    cmp_int(fp, "inputrec->expandedvals->lmc-gibbsdelta", -1, expand1->gibbsdeltalam, expand2->gibbsdeltalam);
+    cmp_int(fp, "inputrec->expandedvals->lmc-forced-nstart", -1, expand1->lmc_forced_nstart, expand2->lmc_forced_nstart);
+    cmp_int(fp, "inputrec->expandedvals->lambda-weights-equil", -1, expand1->elmceq, expand2->elmceq);
+    cmp_int(fp, "inputrec->expandedvals->,weight-equil-number-all-lambda", -1, expand1->equil_n_at_lam, expand2->equil_n_at_lam);
+    cmp_int(fp, "inputrec->expandedvals->weight-equil-number-samples", -1, expand1->equil_samples, expand2->equil_samples);
+    cmp_int(fp, "inputrec->expandedvals->weight-equil-number-steps", -1, expand1->equil_steps, expand2->equil_steps);
+    cmp_real(fp, "inputrec->expandedvals->weight-equil-wl-delta", -1, expand1->equil_wl_delta, expand2->equil_wl_delta, ftol, abstol);
+    cmp_real(fp, "inputrec->expandedvals->weight-equil-count-ratio", -1, expand1->equil_ratio, expand2->equil_ratio, ftol, abstol);
+    cmp_bool(fp, "inputrec->expandedvals->symmetrized-transition-matrix", -1, expand1->bSymmetrizedTMatrix, expand2->bSymmetrizedTMatrix);
+    cmp_int(fp, "inputrec->expandedvals->nstTij", -1, expand1->nstTij, expand2->nstTij);
+    cmp_int(fp, "inputrec->expandedvals->mininum-var-min", -1, expand1->minvarmin, expand2->minvarmin); /*default is reasonable */
+    cmp_int(fp, "inputrec->expandedvals->weight-c-range", -1, expand1->c_range, expand2->c_range);      /* default is just C=0 */
+    cmp_real(fp, "inputrec->expandedvals->wl-scale", -1, expand1->wl_scale, expand2->wl_scale, ftol, abstol);
+    cmp_real(fp, "inputrec->expandedvals->init-wl-delta", -1, expand1->init_wl_delta, expand2->init_wl_delta, ftol, abstol);
+    cmp_real(fp, "inputrec->expandedvals->wl-ratio", -1, expand1->wl_ratio, expand2->wl_ratio, ftol, abstol);
+    cmp_int(fp, "inputrec->expandedvals->nstexpanded", -1, expand1->nstexpanded, expand2->nstexpanded);
+    cmp_int(fp, "inputrec->expandedvals->lmc-seed", -1, expand1->lmc_seed, expand2->lmc_seed);
+    cmp_real(fp, "inputrec->expandedvals->mc-temperature", -1, expand1->mc_temp, expand2->mc_temp, ftol, abstol);
+}
+
+static void cmp_fepvals(FILE *fp, const t_lambda *fep1, const t_lambda *fep2, real ftol, real abstol)
+{
+    int i, j;
+    cmp_int(fp, "inputrec->nstdhdl", -1, fep1->nstdhdl, fep2->nstdhdl);
+    cmp_double(fp, "inputrec->fepvals->init_fep_state", -1, fep1->init_fep_state, fep2->init_fep_state, ftol, abstol);
+    cmp_double(fp, "inputrec->fepvals->delta_lambda", -1, fep1->delta_lambda, fep2->delta_lambda, ftol, abstol);
+    cmp_int(fp, "inputrec->fepvals->n_lambda", -1, fep1->n_lambda, fep2->n_lambda);
+    for (i = 0; i < efptNR; i++)
+    {
+        for (j = 0; j < std::min(fep1->n_lambda, fep2->n_lambda); j++)
+        {
+            cmp_double(fp, "inputrec->fepvals->all_lambda", -1, fep1->all_lambda[i][j], fep2->all_lambda[i][j], ftol, abstol);
+        }
+    }
+    cmp_int(fp, "inputrec->fepvals->lambda_neighbors", 1, fep1->lambda_neighbors,
+            fep2->lambda_neighbors);
+    cmp_real(fp, "inputrec->fepvals->sc_alpha", -1, fep1->sc_alpha, fep2->sc_alpha, ftol, abstol);
+    cmp_int(fp, "inputrec->fepvals->sc_power", -1, fep1->sc_power, fep2->sc_power);
+    cmp_real(fp, "inputrec->fepvals->sc_r_power", -1, fep1->sc_r_power, fep2->sc_r_power, ftol, abstol);
+    cmp_real(fp, "inputrec->fepvals->sc_sigma", -1, fep1->sc_sigma, fep2->sc_sigma, ftol, abstol);
+    cmp_int(fp, "inputrec->fepvals->edHdLPrintEnergy", -1, fep1->edHdLPrintEnergy, fep1->edHdLPrintEnergy);
+    cmp_bool(fp, "inputrec->fepvals->bScCoul", -1, fep1->bScCoul, fep1->bScCoul);
+    cmp_int(fp, "inputrec->separate_dhdl_file", -1, fep1->separate_dhdl_file, fep2->separate_dhdl_file);
+    cmp_int(fp, "inputrec->dhdl_derivatives", -1, fep1->dhdl_derivatives, fep2->dhdl_derivatives);
+    cmp_int(fp, "inputrec->dh_hist_size", -1, fep1->dh_hist_size, fep2->dh_hist_size);
+    cmp_double(fp, "inputrec->dh_hist_spacing", -1, fep1->dh_hist_spacing, fep2->dh_hist_spacing, ftol, abstol);
+}
+
+void cmp_inputrec(FILE *fp, const t_inputrec *ir1, const t_inputrec *ir2, real ftol, real abstol)
+{
+    fprintf(fp, "comparing inputrec\n");
+
+    /* gcc 2.96 doesnt like these defines at all, but issues a huge list
+     * of warnings. Maybe it will change in future versions, but for the
+     * moment I've spelled them out instead. /EL 000820
+     * #define CIB(s) cmp_int(fp,"inputrec->"#s,0,ir1->##s,ir2->##s)
+     * #define CII(s) cmp_int(fp,"inputrec->"#s,0,ir1->##s,ir2->##s)
+     * #define CIR(s) cmp_real(fp,"inputrec->"#s,0,ir1->##s,ir2->##s,ftol)
+     */
+    cmp_int(fp, "inputrec->eI", -1, ir1->eI, ir2->eI);
+    cmp_int64(fp, "inputrec->nsteps", ir1->nsteps, ir2->nsteps);
+    cmp_int64(fp, "inputrec->init_step", ir1->init_step, ir2->init_step);
+    cmp_int(fp, "inputrec->simulation_part", -1, ir1->simulation_part, ir2->simulation_part);
+    cmp_int(fp, "inputrec->ePBC", -1, ir1->ePBC, ir2->ePBC);
+    cmp_int(fp, "inputrec->bPeriodicMols", -1, ir1->bPeriodicMols, ir2->bPeriodicMols);
+    cmp_int(fp, "inputrec->cutoff_scheme", -1, ir1->cutoff_scheme, ir2->cutoff_scheme);
+    cmp_int(fp, "inputrec->ns_type", -1, ir1->ns_type, ir2->ns_type);
+    cmp_int(fp, "inputrec->nstlist", -1, ir1->nstlist, ir2->nstlist);
+    cmp_int(fp, "inputrec->nstcomm", -1, ir1->nstcomm, ir2->nstcomm);
+    cmp_int(fp, "inputrec->comm_mode", -1, ir1->comm_mode, ir2->comm_mode);
+    cmp_int(fp, "inputrec->nstlog", -1, ir1->nstlog, ir2->nstlog);
+    cmp_int(fp, "inputrec->nstxout", -1, ir1->nstxout, ir2->nstxout);
+    cmp_int(fp, "inputrec->nstvout", -1, ir1->nstvout, ir2->nstvout);
+    cmp_int(fp, "inputrec->nstfout", -1, ir1->nstfout, ir2->nstfout);
+    cmp_int(fp, "inputrec->nstcalcenergy", -1, ir1->nstcalcenergy, ir2->nstcalcenergy);
+    cmp_int(fp, "inputrec->nstenergy", -1, ir1->nstenergy, ir2->nstenergy);
+    cmp_int(fp, "inputrec->nstxout_compressed", -1, ir1->nstxout_compressed, ir2->nstxout_compressed);
+    cmp_double(fp, "inputrec->init_t", -1, ir1->init_t, ir2->init_t, ftol, abstol);
+    cmp_double(fp, "inputrec->delta_t", -1, ir1->delta_t, ir2->delta_t, ftol, abstol);
+    cmp_real(fp, "inputrec->x_compression_precision", -1, ir1->x_compression_precision, ir2->x_compression_precision, ftol, abstol);
+    cmp_real(fp, "inputrec->fourierspacing", -1, ir1->fourier_spacing, ir2->fourier_spacing, ftol, abstol);
+    cmp_int(fp, "inputrec->nkx", -1, ir1->nkx, ir2->nkx);
+    cmp_int(fp, "inputrec->nky", -1, ir1->nky, ir2->nky);
+    cmp_int(fp, "inputrec->nkz", -1, ir1->nkz, ir2->nkz);
+    cmp_int(fp, "inputrec->pme_order", -1, ir1->pme_order, ir2->pme_order);
+    cmp_real(fp, "inputrec->ewald_rtol", -1, ir1->ewald_rtol, ir2->ewald_rtol, ftol, abstol);
+    cmp_int(fp, "inputrec->ewald_geometry", -1, ir1->ewald_geometry, ir2->ewald_geometry);
+    cmp_real(fp, "inputrec->epsilon_surface", -1, ir1->epsilon_surface, ir2->epsilon_surface, ftol, abstol);
+    cmp_int(fp, "inputrec->bContinuation", -1, ir1->bContinuation, ir2->bContinuation);
+    cmp_int(fp, "inputrec->bShakeSOR", -1, ir1->bShakeSOR, ir2->bShakeSOR);
+    cmp_int(fp, "inputrec->etc", -1, ir1->etc, ir2->etc);
+    cmp_int(fp, "inputrec->bPrintNHChains", -1, ir1->bPrintNHChains, ir2->bPrintNHChains);
+    cmp_int(fp, "inputrec->epc", -1, ir1->epc, ir2->epc);
+    cmp_int(fp, "inputrec->epct", -1, ir1->epct, ir2->epct);
+    cmp_real(fp, "inputrec->tau_p", -1, ir1->tau_p, ir2->tau_p, ftol, abstol);
+    cmp_rvec(fp, "inputrec->ref_p(x)", -1, ir1->ref_p[XX], ir2->ref_p[XX], ftol, abstol);
+    cmp_rvec(fp, "inputrec->ref_p(y)", -1, ir1->ref_p[YY], ir2->ref_p[YY], ftol, abstol);
+    cmp_rvec(fp, "inputrec->ref_p(z)", -1, ir1->ref_p[ZZ], ir2->ref_p[ZZ], ftol, abstol);
+    cmp_rvec(fp, "inputrec->compress(x)", -1, ir1->compress[XX], ir2->compress[XX], ftol, abstol);
+    cmp_rvec(fp, "inputrec->compress(y)", -1, ir1->compress[YY], ir2->compress[YY], ftol, abstol);
+    cmp_rvec(fp, "inputrec->compress(z)", -1, ir1->compress[ZZ], ir2->compress[ZZ], ftol, abstol);
+    cmp_int(fp, "refcoord_scaling", -1, ir1->refcoord_scaling, ir2->refcoord_scaling);
+    cmp_rvec(fp, "inputrec->posres_com", -1, ir1->posres_com, ir2->posres_com, ftol, abstol);
+    cmp_rvec(fp, "inputrec->posres_comB", -1, ir1->posres_comB, ir2->posres_comB, ftol, abstol);
+    cmp_real(fp, "inputrec->verletbuf_tol", -1, ir1->verletbuf_tol, ir2->verletbuf_tol, ftol, abstol);
+    cmp_real(fp, "inputrec->rlist", -1, ir1->rlist, ir2->rlist, ftol, abstol);
+    cmp_real(fp, "inputrec->rtpi", -1, ir1->rtpi, ir2->rtpi, ftol, abstol);
+    cmp_int(fp, "inputrec->coulombtype", -1, ir1->coulombtype, ir2->coulombtype);
+    cmp_int(fp, "inputrec->coulomb_modifier", -1, ir1->coulomb_modifier, ir2->coulomb_modifier);
+    cmp_real(fp, "inputrec->rcoulomb_switch", -1, ir1->rcoulomb_switch, ir2->rcoulomb_switch, ftol, abstol);
+    cmp_real(fp, "inputrec->rcoulomb", -1, ir1->rcoulomb, ir2->rcoulomb, ftol, abstol);
+    cmp_int(fp, "inputrec->vdwtype", -1, ir1->vdwtype, ir2->vdwtype);
+    cmp_int(fp, "inputrec->vdw_modifier", -1, ir1->vdw_modifier, ir2->vdw_modifier);  cmp_real(fp, "inputrec->rvdw_switch", -1, ir1->rvdw_switch, ir2->rvdw_switch, ftol, abstol);
+    cmp_real(fp, "inputrec->rvdw", -1, ir1->rvdw, ir2->rvdw, ftol, abstol);
+    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);
+    cmp_int(fp, "inputrec->efep", -1, ir1->efep, ir2->efep);
+    cmp_fepvals(fp, ir1->fepvals, ir2->fepvals, ftol, abstol);
+    cmp_int(fp, "inputrec->bSimTemp", -1, ir1->bSimTemp, ir2->bSimTemp);
+    if ((ir1->bSimTemp == ir2->bSimTemp) && (ir1->bSimTemp))
+    {
+        cmp_simtempvals(fp, ir1->simtempvals, ir2->simtempvals, std::min(ir1->fepvals->n_lambda, ir2->fepvals->n_lambda), ftol, abstol);
+    }
+    cmp_int(fp, "inputrec->bExpanded", -1, ir1->bExpanded, ir2->bExpanded);
+    if ((ir1->bExpanded == ir2->bExpanded) && (ir1->bExpanded))
+    {
+        cmp_expandedvals(fp, ir1->expandedvals, ir2->expandedvals, std::min(ir1->fepvals->n_lambda, ir2->fepvals->n_lambda), ftol, abstol);
+    }
+    cmp_int(fp, "inputrec->nwall", -1, ir1->nwall, ir2->nwall);
+    cmp_int(fp, "inputrec->wall_type", -1, ir1->wall_type, ir2->wall_type);
+    cmp_int(fp, "inputrec->wall_atomtype[0]", -1, ir1->wall_atomtype[0], ir2->wall_atomtype[0]);
+    cmp_int(fp, "inputrec->wall_atomtype[1]", -1, ir1->wall_atomtype[1], ir2->wall_atomtype[1]);
+    cmp_real(fp, "inputrec->wall_density[0]", -1, ir1->wall_density[0], ir2->wall_density[0], ftol, abstol);
+    cmp_real(fp, "inputrec->wall_density[1]", -1, ir1->wall_density[1], ir2->wall_density[1], ftol, abstol);
+    cmp_real(fp, "inputrec->wall_ewald_zfac", -1, ir1->wall_ewald_zfac, ir2->wall_ewald_zfac, ftol, abstol);
+
+    cmp_bool(fp, "inputrec->bPull", -1, ir1->bPull, ir2->bPull);
+    if (ir1->bPull && ir2->bPull)
+    {
+        cmp_pull(fp);
+    }
+
+    cmp_int(fp, "inputrec->eDisre", -1, ir1->eDisre, ir2->eDisre);
+    cmp_real(fp, "inputrec->dr_fc", -1, ir1->dr_fc, ir2->dr_fc, ftol, abstol);
+    cmp_int(fp, "inputrec->eDisreWeighting", -1, ir1->eDisreWeighting, ir2->eDisreWeighting);
+    cmp_int(fp, "inputrec->bDisreMixed", -1, ir1->bDisreMixed, ir2->bDisreMixed);
+    cmp_int(fp, "inputrec->nstdisreout", -1, ir1->nstdisreout, ir2->nstdisreout);
+    cmp_real(fp, "inputrec->dr_tau", -1, ir1->dr_tau, ir2->dr_tau, ftol, abstol);
+    cmp_real(fp, "inputrec->orires_fc", -1, ir1->orires_fc, ir2->orires_fc, ftol, abstol);
+    cmp_real(fp, "inputrec->orires_tau", -1, ir1->orires_tau, ir2->orires_tau, ftol, abstol);
+    cmp_int(fp, "inputrec->nstorireout", -1, ir1->nstorireout, ir2->nstorireout);
+    cmp_real(fp, "inputrec->em_stepsize", -1, ir1->em_stepsize, ir2->em_stepsize, ftol, abstol);
+    cmp_real(fp, "inputrec->em_tol", -1, ir1->em_tol, ir2->em_tol, ftol, abstol);
+    cmp_int(fp, "inputrec->niter", -1, ir1->niter, ir2->niter);
+    cmp_real(fp, "inputrec->fc_stepsize", -1, ir1->fc_stepsize, ir2->fc_stepsize, ftol, abstol);
+    cmp_int(fp, "inputrec->nstcgsteep", -1, ir1->nstcgsteep, ir2->nstcgsteep);
+    cmp_int(fp, "inputrec->nbfgscorr", 0, ir1->nbfgscorr, ir2->nbfgscorr);
+    cmp_int(fp, "inputrec->eConstrAlg", -1, ir1->eConstrAlg, ir2->eConstrAlg);
+    cmp_int(fp, "inputrec->nProjOrder", -1, ir1->nProjOrder, ir2->nProjOrder);
+    cmp_real(fp, "inputrec->LincsWarnAngle", -1, ir1->LincsWarnAngle, ir2->LincsWarnAngle, ftol, abstol);
+    cmp_int(fp, "inputrec->nLincsIter", -1, ir1->nLincsIter, ir2->nLincsIter);
+    cmp_real(fp, "inputrec->bd_fric", -1, ir1->bd_fric, ir2->bd_fric, ftol, abstol);
+    cmp_int64(fp, "inputrec->ld_seed", ir1->ld_seed, ir2->ld_seed);
+    cmp_real(fp, "inputrec->cos_accel", -1, ir1->cos_accel, ir2->cos_accel, ftol, abstol);
+    cmp_rvec(fp, "inputrec->deform(a)", -1, ir1->deform[XX], ir2->deform[XX], ftol, abstol);
+    cmp_rvec(fp, "inputrec->deform(b)", -1, ir1->deform[YY], ir2->deform[YY], ftol, abstol);
+    cmp_rvec(fp, "inputrec->deform(c)", -1, ir1->deform[ZZ], ir2->deform[ZZ], ftol, abstol);
+
+
+    cmp_int(fp, "inputrec->userint1", -1, ir1->userint1, ir2->userint1);
+    cmp_int(fp, "inputrec->userint2", -1, ir1->userint2, ir2->userint2);
+    cmp_int(fp, "inputrec->userint3", -1, ir1->userint3, ir2->userint3);
+    cmp_int(fp, "inputrec->userint4", -1, ir1->userint4, ir2->userint4);
+    cmp_real(fp, "inputrec->userreal1", -1, ir1->userreal1, ir2->userreal1, ftol, abstol);
+    cmp_real(fp, "inputrec->userreal2", -1, ir1->userreal2, ir2->userreal2, ftol, abstol);
+    cmp_real(fp, "inputrec->userreal3", -1, ir1->userreal3, ir2->userreal3, ftol, abstol);
+    cmp_real(fp, "inputrec->userreal4", -1, ir1->userreal4, ir2->userreal4, ftol, abstol);
+    cmp_grpopts(fp, &(ir1->opts), &(ir2->opts), ftol, abstol);
+    gmx::TextWriter writer(fp);
+    gmx::compareKeyValueTrees(&writer, *ir1->params, *ir2->params, ftol, abstol);
+}
+
+void comp_pull_AB(FILE *fp, pull_params_t *pull, real ftol, real abstol)
+{
+    int i;
+
+    for (i = 0; i < pull->ncoord; i++)
+    {
+        fprintf(fp, "comparing pull coord %d\n", i);
+        cmp_real(fp, "pull-coord->k", -1, pull->coord[i].k, pull->coord[i].kB, ftol, abstol);
+    }
+}
+
 gmx_bool inputrecDeform(const t_inputrec *ir)
 {
     return (ir->deform[XX][XX] != 0 || ir->deform[YY][YY] != 0 || ir->deform[ZZ][ZZ] != 0 ||
@@ -1063,11 +1327,6 @@ gmx_bool inputrecNeedMutot(const t_inputrec *ir)
             (ir->ewald_geometry == eewg3DC || ir->epsilon_surface != 0));
 }
 
-gmx_bool inputrecElecField(const t_inputrec *ir)
-{
-    return (ir->ex[XX].n > 0 || ir->ex[YY].n > 0 || ir->ex[ZZ].n > 0);
-}
-
 gmx_bool inputrecExclForces(const t_inputrec *ir)
 {
     return (EEL_FULL(ir->coulombtype) || (EEL_RF(ir->coulombtype)) ||
@@ -1091,3 +1350,61 @@ gmx_bool inputrecNphTrotter(const t_inputrec *ir)
     return ( ( (ir->eI == eiVV) || (ir->eI == eiVVAK) ) &&
              (ir->epc == epcMTTK) && (ir->etc != etcNOSEHOOVER) );
 }
+
+bool integratorHasConservedEnergyQuantity(const t_inputrec *ir)
+{
+    if (!EI_MD(ir->eI))
+    {
+        // Energy minimization or stochastic integrator: no conservation
+        return false;
+    }
+    else if (ir->etc == etcNO && ir->epc == epcNO)
+    {
+        // The total energy is conserved, no additional conserved quanitity
+        return false;
+    }
+    else
+    {
+        // Shear stress with Parrinello-Rahman is not supported (tedious)
+        bool shearWithPR =
+            ((ir->epc == epcPARRINELLORAHMAN || ir->epc == epcMTTK) &&
+             (ir->ref_p[YY][XX] != 0 || ir->ref_p[ZZ][XX] != 0 || ir->ref_p[ZZ][YY] != 0));
+
+        return !ETC_ANDERSEN(ir->etc) && !shearWithPR;
+    }
+}
+
+int inputrec2nboundeddim(const t_inputrec *ir)
+{
+    if (ir->nwall == 2 && ir->ePBC == epbcXY)
+    {
+        return 3;
+    }
+    else
+    {
+        return ePBC2npbcdim(ir->ePBC);
+    }
+}
+
+int ndof_com(const t_inputrec *ir)
+{
+    int n = 0;
+
+    switch (ir->ePBC)
+    {
+        case epbcXYZ:
+        case epbcNONE:
+            n = 3;
+            break;
+        case epbcXY:
+            n = (ir->nwall == 0 ? 3 : 2);
+            break;
+        case epbcSCREW:
+            n = 1;
+            break;
+        default:
+            gmx_incons("Unknown pbc in calc_nrdf");
+    }
+
+    return n;
+}
index 2f898195b257665cc6f7f086481f7734d70d1842..546056bcaccd95420734d400cf314f1188f53d03 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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-/*! \brief
- * Declares inputrec data structure and utilities.
- *
- * \inpublicapi
- * \ingroup module_mdtypes
- */
 #ifndef GMX_MDTYPES_INPUTREC_H
 #define GMX_MDTYPES_INPUTREC_H
 
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/real.h"
 
-typedef struct {
-    //! Number of terms
-    int   n;
-    //! Coeffients (V / nm)
-    real *a;
-    //! Phase angles
-    real *phi;
-} t_cosines;
-
-typedef struct {
-    real E0;            /* Field strength (V/nm)                        */
-    real omega;         /* Frequency (1/ps)                             */
-    real t0;            /* Centre of the Gaussian pulse (ps)            */
-    real sigma;         /* Width of the Gaussian pulse (FWHM) (ps)      */
-} t_efield;
-
 #define EGP_EXCL  (1<<0)
 #define EGP_TABLE (1<<1)
 
+struct pull_params_t;
+
+namespace gmx
+{
+class KeyValueTreeObject;
+}
+
 typedef struct t_grpopts {
     int       ngtc;           /* # T-Coupl groups                        */
     int       nhchainlength;  /* # of nose-hoover chains per group       */
@@ -247,7 +232,13 @@ typedef struct t_swapcoords {
                                             * swapcoords.cpp                               */
 } t_swapcoords;
 
-typedef struct t_inputrec {
+struct t_inputrec
+{
+    t_inputrec();
+    explicit t_inputrec(const t_inputrec &) = delete;
+    t_inputrec &operator=(const t_inputrec &) = delete;
+    ~t_inputrec();
+
     int             eI;                      /* Integration method                 */
     gmx_int64_t     nsteps;                  /* number of steps to be taken                    */
     int             simulation_part;         /* Used in checkpointing to separate chunks */
@@ -368,37 +359,37 @@ typedef struct t_inputrec {
     struct pull_t        *pull_work;         /* The COM pull force calculation data structure; TODO this pointer should live somewhere else */
 
     /* Enforced rotation data */
-    gmx_bool        bRot;                    /* Calculate enforced rotation potential(s)?    */
-    t_rot          *rot;                     /* The data for enforced rotation potentials    */
-
-    int             eSwapCoords;             /* Do ion/water position exchanges (CompEL)?    */
-    t_swapcoords   *swap;
-
-    gmx_bool        bIMD;                    /* Allow interactive MD sessions for this .tpr? */
-    t_IMD          *imd;                     /* Interactive molecular dynamics               */
-
-    real            cos_accel;               /* Acceleration for viscosity calculation       */
-    tensor          deform;                  /* Triclinic deformation velocities (nm/ps)     */
-    int             userint1;                /* User determined parameters                   */
-    int             userint2;
-    int             userint3;
-    int             userint4;
-    real            userreal1;
-    real            userreal2;
-    real            userreal3;
-    real            userreal4;
-    t_grpopts       opts;          /* Group options                            */
-    t_cosines       ex[DIM];       /* Electric field stuff     (spatial part)          */
-    t_cosines       et[DIM];       /* Electric field stuff     (time part)             */
-    gmx_bool        bQMMM;         /* QM/MM calculation                            */
-    int             QMconstraints; /* constraints on QM bonds                      */
-    int             QMMMscheme;    /* Scheme: ONIOM or normal                      */
-    real            scalefactor;   /* factor for scaling the MM charges in QM calc.*/
+    gmx_bool                 bRot;           /* Calculate enforced rotation potential(s)?    */
+    t_rot                   *rot;            /* The data for enforced rotation potentials    */
+
+    int                      eSwapCoords;    /* Do ion/water position exchanges (CompEL)?    */
+    t_swapcoords            *swap;
+
+    gmx_bool                 bIMD;           /* Allow interactive MD sessions for this .tpr? */
+    t_IMD                   *imd;            /* Interactive molecular dynamics               */
+
+    real                     cos_accel;      /* Acceleration for viscosity calculation       */
+    tensor                   deform;         /* Triclinic deformation velocities (nm/ps)     */
+    int                      userint1;       /* User determined parameters                   */
+    int                      userint2;
+    int                      userint3;
+    int                      userint4;
+    real                     userreal1;
+    real                     userreal2;
+    real                     userreal3;
+    real                     userreal4;
+    t_grpopts                opts;          /* Group options                           */
+    gmx_bool                 bQMMM;         /* QM/MM calculation                            */
+    int                      QMconstraints; /* constraints on QM bonds                      */
+    int                      QMMMscheme;    /* Scheme: ONIOM or normal                      */
+    real                     scalefactor;   /* factor for scaling the MM charges in QM calc.*/
 
     /* Fields for removed features go here (better caching) */
-    gmx_bool        bAdress;       // Whether AdResS is enabled - always false if a valid .tpr was read
-    gmx_bool        useTwinRange;  // Whether twin-range scheme is active - always false if a valid .tpr was read
-} t_inputrec;
+    gmx_bool                 bAdress;      // Whether AdResS is enabled - always false if a valid .tpr was read
+    gmx_bool                 useTwinRange; // Whether twin-range scheme is active - always false if a valid .tpr was read
+
+    gmx::KeyValueTreeObject *params;
+};
 
 int ir_optimal_nstcalcenergy(const t_inputrec *ir);
 
@@ -436,14 +427,6 @@ gmx_bool ir_vdw_is_zero_at_cutoff(const t_inputrec *ir);
  */
 gmx_bool ir_vdw_might_be_zero_at_cutoff(const t_inputrec *ir);
 
-/*! \brief Initiate input record structure
- *
- * Initialiazes all the arrays and pointers to NULL.
- *
- * \param[in] ir Inputrec must be pre-allocated
- */
-void init_inputrec(t_inputrec *ir);
-
 /*! \brief Free memory from input record.
  *
  * All arrays and pointers will be freed.
@@ -455,6 +438,11 @@ void done_inputrec(t_inputrec *ir);
 void pr_inputrec(FILE *fp, int indent, const char *title, const t_inputrec *ir,
                  gmx_bool bMDPformat);
 
+void cmp_inputrec(FILE *fp, const t_inputrec *ir1, const t_inputrec *ir2, real ftol, real abstol);
+
+void comp_pull_AB(FILE *fp, pull_params_t *pull, real ftol, real abstol);
+
+
 gmx_bool inputrecDeform(const t_inputrec *ir);
 
 gmx_bool inputrecDynamicBox(const t_inputrec *ir);
@@ -465,8 +453,6 @@ gmx_bool inputrecNeedMutot(const t_inputrec *ir);
 
 gmx_bool inputrecTwinRange(const t_inputrec *ir);
 
-gmx_bool inputrecElecField(const t_inputrec *ir);
-
 gmx_bool inputrecExclForces(const t_inputrec *ir);
 
 gmx_bool inputrecNptTrotter(const t_inputrec *ir);
@@ -475,4 +461,24 @@ gmx_bool inputrecNvtTrotter(const t_inputrec *ir);
 
 gmx_bool inputrecNphTrotter(const t_inputrec *ir);
 
+/* Returns true for MD integator with T and/or P-coupling that supports
+ * calculating the conserved energy quantity.
+ */
+bool integratorHasConservedEnergyQuantity(const t_inputrec *ir);
+
+/*! \brief Return the number of bounded dimensions
+ *
+ * \param[in] ir The input record with MD parameters
+ * \return the number of dimensions in which
+ * the coordinates of the particles are bounded, starting at X.
+ */
+int inputrec2nboundeddim(const t_inputrec *ir);
+
+/*! \brief Returns the number of degrees of freedom in center of mass motion
+ *
+ * \param[in] ir the inputrec structure
+ * \return the number of degrees of freedom of the center of mass
+ */
+int ndof_com(const t_inputrec *ir);
+
 #endif /* GMX_MDTYPES_INPUTREC_H */
index c25eff06f43fca6166838338e242d238f7beec07..16b0d32e89b8645d2d1f4fb71b4bd20aadf432aa 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,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.
@@ -47,11 +47,12 @@ extern "C" {
  * potential = r^-p + c2/3*rsw^3 + c3/4*rsw^4 + cpot
  * With a constant potential shift c2 and c3 are both 0.
  */
-typedef struct {
+struct shift_consts_t
+{
     real c2;
     real c3;
     real cpot;
-} shift_consts_t;
+};
 
 /* Used with potential switching:
  * rsw        = max(r - r_switch, 0)
@@ -60,23 +61,25 @@ typedef struct {
  * force      = force*dsw - potential*sw
  * potential *= sw
  */
-typedef struct {
+struct switch_consts_t
+{
     real c3;
     real c4;
     real c5;
-} switch_consts_t;
+};
 
-typedef struct {
+struct interaction_const_t
+{
     int             cutoff_scheme;
 
     /* VdW */
-    int             vdwtype;
-    int             vdw_modifier;
-    real            rvdw;
-    real            rvdw_switch;
-    shift_consts_t  dispersion_shift;
-    shift_consts_t  repulsion_shift;
-    switch_consts_t vdw_switch;
+    int                    vdwtype;
+    int                    vdw_modifier;
+    real                   rvdw;
+    real                   rvdw_switch;
+    struct shift_consts_t  dispersion_shift;
+    struct shift_consts_t  repulsion_shift;
+    struct switch_consts_t vdw_switch;
     /* TODO: remove this variable, used for not modyfing the group kernels,
      * it is equal to -dispersion_shift->cpot
      */
@@ -89,9 +92,6 @@ typedef struct {
     /* Coulomb */
     real rcoulomb;
 
-    /* Cut-off */
-    real rlist;
-
     /* PME/Ewald */
     real ewaldcoeff_q;
     real ewaldcoeff_lj;
@@ -128,8 +128,7 @@ typedef struct {
        quadruplets are: F[i], F[i+1]-F[i], V[i], 0, this is used with
        single precision x86 SIMD for aligned loads */
     real *tabq_vdw_FDV0;
-
-} interaction_const_t;
+};
 
 #ifdef __cplusplus
 }
index b3d27edbbf127151459708cd6d478ffe071ef55d..2b6eb86c62a5d44aa4e4eee479e75a63e6de8dc3 100644 (file)
@@ -247,10 +247,6 @@ const char *eQMMMscheme_names[eQMMMschemeNR+1] = {
     "normal", "ONIOM", nullptr
 };
 
-const char *eMultentOpt_names[eMultentOptNR+1] = {
-    "multiple_entries", "no", "use_last", nullptr
-};
-
 const char *gmx_nblist_geometry_names[GMX_NBLIST_GEOMETRY_NR+1] = {
     "Particle-Particle", "Water3-Particle", "Water3-Water3", "Water4-Particle", "Water4-Water4", "CG-CG", nullptr
 };
index c0c3baa78de703739a4b34b5dd4cf2e8edea026c..e2a016e48dd021f8045d67cd80fa4720cb052f83 100644 (file)
@@ -606,13 +606,6 @@ extern const char *eQMMMscheme_names[eQMMMschemeNR+1];
 //! Macro to pick QMMMM scheme name
 #define EQMMMSCHEME(e) enum_name(e, eQMMMschemeNR, eQMMMscheme_names)
 
-//! Internal stuff for multiple value options in mdp files
-enum {
-    eMultentOptName, eMultentOptNo, eMultentOptLast, eMultentOptNR
-};
-//! Multiple value option names
-extern const char *eMultentOpt_names[eMultentOptNR+1];
-
 /*! \brief Neighborlist geometry type.
  *
  * Kernels will compute interactions between two particles,
index 69519ececfea9260c8038fc2b1e999ebeabd007e..064fe6ea6dd929a8622a55f11a0baedb5e3e2ac6 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,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,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.
@@ -43,6 +43,7 @@
 #ifndef GMX_MDTYPES_MDATOM_H
 #define GMX_MDTYPES_MDATOM_H
 
+#include "gromacs/math/vectypes.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/real.h"
 
@@ -77,8 +78,10 @@ typedef struct t_mdatoms {
     real                  *massB;
     //! Atomic mass in present state
     real                  *massT;
-    //! Inverse atomic mass
+    //! Inverse atomic mass per atom, 0 for vsites and shells
     real                  *invmass;
+    //! Inverse atomic mass per atom and dimension, 0 for vsites, shells and frozen dimensions
+    rvec                  *invMassPerDim;
     //! Atomic charge in A state
     real                  *chargeA;
     //! Atomic charge in B state
diff --git a/src/gromacs/mdtypes/observableshistory.h b/src/gromacs/mdtypes/observableshistory.h
new file mode 100644 (file)
index 0000000..d4dfd9f
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+
+/*! \libinternal \file
+ *
+ * \brief
+ * This file contains the definition of a container for history data
+ * for simulation observables.
+ *
+ * The container is used for storing the simulation state data that needs
+ * to be written to / read from checkpoint file. This struct should only
+ * contain pure observable data. Microstate data should be in t_state.
+ * The state of the mdrun machinery is also stored elsewhere.
+ *
+ * \author Berk Hess
+ *
+ * \inlibraryapi
+ * \ingroup module_mdtypes
+ */
+
+#ifndef GMX_MDLIB_OBSERVABLESHISTORY_H
+#define GMX_MDLIB_OBSERVABLESHISTORY_H
+
+#include <memory>
+
+class energyhistory_t;
+struct edsamhistory_t;
+struct swaphistory_t;
+
+/*! \libinternal \brief Observables history, for writing/reading to/from checkpoint file
+ */
+struct ObservablesHistory
+{
+    //! History for energy observables, used for output only
+    std::unique_ptr<energyhistory_t> energyHistory;
+
+    //! Essential dynamics and flooding history
+    std::unique_ptr<edsamhistory_t> edsamHistory;
+
+    //! Ion/water position swapping history
+    std::unique_ptr<swaphistory_t> swapHistory;
+};
+
+#endif
index 3bcf9a8987984528d83ac6097be997458624ae8b..a5d0711173086eb062a507002040b4c16847218a 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,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.
 #include <algorithm>
 
 #include "gromacs/math/vec.h"
+#include "gromacs/math/veccompare.h"
 #include "gromacs/mdtypes/df_history.h"
-#include "gromacs/mdtypes/energyhistory.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/mdtypes/swaphistory.h"
+#include "gromacs/pbcutil/boxutilities.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/utility/compare.h"
+#include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
 
 /* The source code in this file should be thread-safe.
       Please keep it that way. */
 
-static void zero_history(history_t *hist)
+history_t::history_t() : disre_initf(0),
+                         ndisrepairs(0),
+                         disre_rm3tav(nullptr),
+                         orire_initf(0),
+                         norire_Dtav(0),
+                         orire_Dtav(nullptr)
 {
-    hist->disre_initf  = 0;
-    hist->ndisrepairs  = 0;
-    hist->disre_rm3tav = NULL;
-    hist->orire_initf  = 0;
-    hist->norire_Dtav  = 0;
-    hist->orire_Dtav   = NULL;
-}
-
-static void zero_ekinstate(ekinstate_t *eks)
-{
-    eks->ekin_n         = 0;
-    eks->ekinh          = NULL;
-    eks->ekinf          = NULL;
-    eks->ekinh_old      = NULL;
-    eks->ekinscalef_nhc = NULL;
-    eks->ekinscaleh_nhc = NULL;
-    eks->vscale_nhc     = NULL;
-    eks->dekindl        = 0;
-    eks->mvcos          = 0;
-}
+};
 
-static void init_swapstate(swapstate_t *swapstate)
+ekinstate_t::ekinstate_t() : bUpToDate(FALSE),
+                             ekin_n(0),
+                             ekinh(nullptr),
+                             ekinf(nullptr),
+                             ekinh_old(nullptr),
+                             ekin_total(),
+                             ekinscalef_nhc(),
+                             ekinscaleh_nhc(),
+                             vscale_nhc(),
+                             dekindl(0),
+                             mvcos(0)
 {
-    /* Ion/water position swapping */
-    swapstate->eSwapCoords            = 0;
-    swapstate->nIonTypes              = 0;
-    swapstate->nAverage               = 0;
-    swapstate->fluxleak               = 0;
-    swapstate->fluxleak_p             = NULL;
-    swapstate->bFromCpt               = 0;
-    swapstate->nat[eChan0]            = 0;
-    swapstate->nat[eChan1]            = 0;
-    swapstate->xc_old_whole[eChan0]   = NULL;
-    swapstate->xc_old_whole[eChan1]   = NULL;
-    swapstate->xc_old_whole_p[eChan0] = NULL;
-    swapstate->xc_old_whole_p[eChan1] = NULL;
-    swapstate->ionType                = NULL;
-}
+    clear_mat(ekin_total);
+};
 
 void init_gtc_state(t_state *state, int ngtc, int nnhpres, int nhchainlength)
 {
-    int i, j;
-
     state->ngtc          = ngtc;
     state->nnhpres       = nnhpres;
     state->nhchainlength = nhchainlength;
-    if (state->ngtc > 0)
+    state->nosehoover_xi.resize(state->nhchainlength*state->ngtc, 0);
+    state->nosehoover_vxi.resize(state->nhchainlength*state->ngtc, 0);
+    state->therm_integral.resize(state->ngtc, 0);
+    state->baros_integral = 0.0;
+    state->nhpres_xi.resize(state->nhchainlength*nnhpres, 0);
+    state->nhpres_vxi.resize(state->nhchainlength*nnhpres, 0);
+}
+
+
+/* Checkpoint code relies on this function having no effect if
+   state->natoms is > 0 and passed as natoms. */
+void state_change_natoms(t_state *state, int natoms)
+{
+    state->natoms = natoms;
+    if (state->natoms > 0)
     {
-        snew(state->nosehoover_xi, state->nhchainlength*state->ngtc);
-        snew(state->nosehoover_vxi, state->nhchainlength*state->ngtc);
-        snew(state->therm_integral, state->ngtc);
-        for (i = 0; i < state->ngtc; i++)
+        /* We need to allocate one element extra, since we might use
+         * (unaligned) 4-wide SIMD loads to access rvec entries.
+         */
+        if (state->flags & (1 << estX))
         {
-            for (j = 0; j < state->nhchainlength; j++)
-            {
-                state->nosehoover_xi[i*state->nhchainlength + j]   = 0.0;
-                state->nosehoover_vxi[i*state->nhchainlength + j]  = 0.0;
-            }
+            state->x.resize(state->natoms + 1);
         }
-        for (i = 0; i < state->ngtc; i++)
+        if (state->flags & (1 << estV))
         {
-            state->therm_integral[i]  = 0.0;
+            state->v.resize(state->natoms + 1);
         }
-    }
-    else
-    {
-        state->nosehoover_xi  = NULL;
-        state->nosehoover_vxi = NULL;
-        state->therm_integral = NULL;
-    }
-
-    if (state->nnhpres > 0)
-    {
-        snew(state->nhpres_xi, state->nhchainlength*nnhpres);
-        snew(state->nhpres_vxi, state->nhchainlength*nnhpres);
-        for (i = 0; i < nnhpres; i++)
+        if (state->flags & (1 << estCGP))
         {
-            for (j = 0; j < state->nhchainlength; j++)
-            {
-                state->nhpres_xi[i*nhchainlength + j]   = 0.0;
-                state->nhpres_vxi[i*nhchainlength + j]  = 0.0;
-            }
+            state->cg_p.resize(state->natoms + 1);
         }
     }
     else
     {
-        state->nhpres_xi  = NULL;
-        state->nhpres_vxi = NULL;
+        state->x.resize(0);
+        state->v.resize(0);
+        state->cg_p.resize(0);
     }
 }
 
-
-void init_state(t_state *state, int natoms, int ngtc, int nnhpres, int nhchainlength, int nlambda)
+void init_dfhist_state(t_state *state, int dfhistNumLambda)
 {
-    int i;
-
-    state->natoms    = natoms;
-    state->flags     = 0;
-    state->fep_state = 0;
-    state->lambda    = 0;
-    snew(state->lambda, efptNR);
-    for (i = 0; i < efptNR; i++)
+    if (dfhistNumLambda > 0)
     {
-        state->lambda[i] = 0;
-    }
-    state->veta   = 0;
-    clear_mat(state->box);
-    clear_mat(state->box_rel);
-    clear_mat(state->boxv);
-    clear_mat(state->pres_prev);
-    clear_mat(state->svir_prev);
-    clear_mat(state->fvir_prev);
-    init_gtc_state(state, ngtc, nnhpres, nhchainlength);
-    state->nalloc = state->natoms;
-    if (state->nalloc > 0)
-    {
-        /* We need to allocate one element extra, since we might use
-         * (unaligned) 4-wide SIMD loads to access rvec entries.
-         */
-        snew(state->x, state->nalloc + 1);
-        snew(state->v, state->nalloc + 1);
+        snew(state->dfhist, 1);
+        init_df_history(state->dfhist, dfhistNumLambda);
     }
     else
     {
-        state->x = NULL;
-        state->v = NULL;
+        state->dfhist = nullptr;
     }
-    state->cg_p = NULL;
-    zero_history(&state->hist);
-    zero_ekinstate(&state->ekinstate);
-    snew(state->enerhist, 1);
-    init_energyhistory(state->enerhist);
-    init_df_history(&state->dfhist, nlambda);
-    init_swapstate(&state->swapstate);
-    state->ddp_count       = 0;
-    state->ddp_count_cg_gl = 0;
-    state->cg_gl           = NULL;
-    state->cg_gl_nalloc    = 0;
 }
 
-void done_state(t_state *state)
+void comp_state(const t_state *st1, const t_state *st2,
+                gmx_bool bRMSD, real ftol, real abstol)
 {
-    if (state->x)
+    int i, j, nc;
+
+    fprintf(stdout, "comparing flags\n");
+    cmp_int(stdout, "flags", -1, st1->flags, st2->flags);
+    fprintf(stdout, "comparing box\n");
+    cmp_rvecs(stdout, "box", DIM, st1->box, st2->box, FALSE, ftol, abstol);
+    fprintf(stdout, "comparing box_rel\n");
+    cmp_rvecs(stdout, "box_rel", DIM, st1->box_rel, st2->box_rel, FALSE, ftol, abstol);
+    fprintf(stdout, "comparing boxv\n");
+    cmp_rvecs(stdout, "boxv", DIM, st1->boxv, st2->boxv, FALSE, ftol, abstol);
+    if (st1->flags & (1<<estSVIR_PREV))
     {
-        sfree(state->x);
+        fprintf(stdout, "comparing shake vir_prev\n");
+        cmp_rvecs(stdout, "svir_prev", DIM, st1->svir_prev, st2->svir_prev, FALSE, ftol, abstol);
     }
-    if (state->v)
+    if (st1->flags & (1<<estFVIR_PREV))
     {
-        sfree(state->v);
+        fprintf(stdout, "comparing force vir_prev\n");
+        cmp_rvecs(stdout, "fvir_prev", DIM, st1->fvir_prev, st2->fvir_prev, FALSE, ftol, abstol);
     }
-    if (state->cg_p)
+    if (st1->flags & (1<<estPRES_PREV))
     {
-        sfree(state->cg_p);
+        fprintf(stdout, "comparing prev_pres\n");
+        cmp_rvecs(stdout, "pres_prev", DIM, st1->pres_prev, st2->pres_prev, FALSE, ftol, abstol);
     }
-    state->nalloc = 0;
-    if (state->cg_gl)
+    cmp_int(stdout, "ngtc", -1, st1->ngtc, st2->ngtc);
+    cmp_int(stdout, "nhchainlength", -1, st1->nhchainlength, st2->nhchainlength);
+    if (st1->ngtc == st2->ngtc && st1->nhchainlength == st2->nhchainlength)
     {
-        sfree(state->cg_gl);
+        for (i = 0; i < st1->ngtc; i++)
+        {
+            nc = i*st1->nhchainlength;
+            for (j = 0; j < nc; j++)
+            {
+                cmp_real(stdout, "nosehoover_xi",
+                         i, st1->nosehoover_xi[nc+j], st2->nosehoover_xi[nc+j], ftol, abstol);
+            }
+        }
     }
-    state->cg_gl_nalloc = 0;
-    if (state->lambda)
+    cmp_int(stdout, "nnhpres", -1, st1->nnhpres, st2->nnhpres);
+    if (st1->nnhpres == st2->nnhpres && st1->nhchainlength == st2->nhchainlength)
     {
-        sfree(state->lambda);
+        for (i = 0; i < st1->nnhpres; i++)
+        {
+            nc = i*st1->nhchainlength;
+            for (j = 0; j < nc; j++)
+            {
+                cmp_real(stdout, "nosehoover_xi",
+                         i, st1->nhpres_xi[nc+j], st2->nhpres_xi[nc+j], ftol, abstol);
+            }
+        }
+    }
+
+    cmp_int(stdout, "natoms", -1, st1->natoms, st2->natoms);
+    if (st1->natoms == st2->natoms)
+    {
+        if ((st1->flags & (1<<estX)) && (st2->flags & (1<<estX)))
+        {
+            fprintf(stdout, "comparing x\n");
+            cmp_rvecs(stdout, "x", st1->natoms, as_rvec_array(st1->x.data()), as_rvec_array(st2->x.data()), bRMSD, ftol, abstol);
+        }
+        if ((st1->flags & (1<<estV)) && (st2->flags & (1<<estV)))
+        {
+            fprintf(stdout, "comparing v\n");
+            cmp_rvecs(stdout, "v", st1->natoms, as_rvec_array(st1->v.data()), as_rvec_array(st2->v.data()), bRMSD, ftol, abstol);
+        }
     }
-    if (state->ngtc > 0)
+}
+
+rvec *getRvecArrayFromPaddedRVecVector(const PaddedRVecVector *v,
+                                       unsigned int            n)
+{
+    GMX_ASSERT(v->size() >= n, "We can't copy more elements than the vector size");
+
+    rvec *dest;
+
+    snew(dest, n);
+
+    const rvec *vPtr = as_rvec_array(v->data());
+    for (unsigned int i = 0; i < n; i++)
     {
-        sfree(state->nosehoover_xi);
-        sfree(state->nosehoover_vxi);
-        sfree(state->therm_integral);
+        copy_rvec(vPtr[i], dest[i]);
     }
+
+    return dest;
 }
 
-t_state *serial_init_local_state(t_state *state_global)
+t_state::t_state() : natoms(0),
+                     ngtc(0),
+                     nnhpres(0),
+                     nhchainlength(0),
+                     flags(0),
+                     fep_state(0),
+                     lambda(),
+                     nosehoover_xi(),
+                     nosehoover_vxi(),
+                     nhpres_xi(),
+                     nhpres_vxi(),
+                     therm_integral(),
+                     baros_integral(0),
+                     veta(0),
+                     vol0(0),
+                     x(),
+                     v(),
+                     cg_p(),
+                     ekinstate(),
+                     hist(),
+                     dfhist(nullptr),
+                     ddp_count(0),
+                     ddp_count_cg_gl(0),
+                     cg_gl()
 {
-    int      i;
-    t_state *state_local;
+    // It would be nicer to initialize these with {} or {{0}} in the
+    // above initialization list, but uncrustify doesn't understand
+    // that.
+    // TODO Fix this if we switch to clang-format some time.
+    // cppcheck-suppress useInitializationList
+    lambda = {{ 0 }};
+    clear_mat(box);
+    clear_mat(box_rel);
+    clear_mat(boxv);
+    clear_mat(pres_prev);
+    clear_mat(svir_prev);
+    clear_mat(fvir_prev);
+}
 
-    snew(state_local, 1);
+void set_box_rel(const t_inputrec *ir, t_state *state)
+{
+    /* Make sure the box obeys the restrictions before we fix the ratios */
+    correct_box(nullptr, 0, state->box, nullptr);
+
+    clear_mat(state->box_rel);
 
-    /* Copy all the contents */
-    *state_local = *state_global;
-    snew(state_local->lambda, efptNR);
-    /* local storage for lambda */
-    for (i = 0; i < efptNR; i++)
+    if (inputrecPreserveShape(ir))
     {
-        state_local->lambda[i] = state_global->lambda[i];
+        const int ndim = ir->epct == epctSEMIISOTROPIC ? 2 : 3;
+        do_box_rel(ndim, ir->deform, state->box_rel, state->box, true);
     }
+}
 
-    return state_local;
+void preserve_box_shape(const t_inputrec *ir, matrix box_rel, matrix box)
+{
+    if (inputrecPreserveShape(ir))
+    {
+        const int ndim = ir->epct == epctSEMIISOTROPIC ? 2 : 3;
+        do_box_rel(ndim, ir->deform, box_rel, box, false);
+    }
 }
index 5d7b199640cdaca6b668655edd0efce10cd07dba..9cab97a2b05d567146cb707ee891bb0a5ad6335b 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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
+
+/*! \file
+ *
+ * \brief
+ * This file contains the definition of the microstate of the simulated system
+ *
+ * History of observables that needs to be checkpointed should be stored
+ * in ObservablesHistory.
+ * The state of the mdrun machinery that needs to be checkpointed is also
+ * stored elsewhere.
+ *
+ * \author Berk Hess
+ *
+ * \inlibraryapi
+ * \ingroup module_mdtypes
+ */
+
 #ifndef GMX_MDTYPES_STATE_H
 #define GMX_MDTYPES_STATE_H
 
+#include <array>
+#include <vector>
+
+#include "gromacs/math/paddedvector.h"
 #include "gromacs/math/vectypes.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/real.h"
 
-struct energyhistory_t;
+struct t_inputrec;
 
 /*
  * The t_state struct should contain all the (possibly) non-static
@@ -50,189 +71,158 @@ struct energyhistory_t;
  * Currently the random seeds for SD and BD are missing.
  */
 
-/* These enums are used in flags as (1<<est...).
+/* \brief Enum for all entries in \p t_state
+ *
+ * These enums are used in flags as (1<<est...).
  * The order of these enums should not be changed,
  * since that affects the checkpoint (.cpt) file format.
  */
 enum {
     estLAMBDA,
-    estBOX, estBOX_REL, estBOXV, estPRES_PREV, estNH_XI,  estTC_INT,
-    estX,   estV,       est_SDX_NOTSUPPORTED,  estCGP,
-    estLD_RNG, estLD_RNGI,
+    estBOX, estBOX_REL, estBOXV, estPRES_PREV, estNH_XI,  estTHERM_INT,
+    estX,   estV,       estSDX_NOTSUPPORTED,  estCGP,
+    estLD_RNG_NOTSUPPORTED, estLD_RNGI_NOTSUPPORTED,
     estDISRE_INITF, estDISRE_RM3TAV,
     estORIRE_INITF, estORIRE_DTAV,
     estSVIR_PREV, estNH_VXI, estVETA, estVOL0, estNHPRES_XI, estNHPRES_VXI, estFVIR_PREV,
-    estFEPSTATE, estMC_RNG, estMC_RNGI,
+    estFEPSTATE, estMC_RNG_NOTSUPPORTED, estMC_RNGI_NOTSUPPORTED,
+    estBAROS_INT,
     estNR
 };
 
-#define EST_DISTR(e) (!(((e) >= estLAMBDA && (e) <= estTC_INT) || ((e) >= estSVIR_PREV && (e) <= estMC_RNGI)))
-
-/* The names of the state entries, defined in src/gmxlib/checkpoint.c */
+//! \brief The names of the state entries, defined in src/gmxlib/checkpoint.c
 extern const char *est_names[estNR];
 
-typedef struct history_t
+/*! \libinternal \brief History information for NMR distance and orientation restraints
+ *
+ * Often this is only used for reporting observables, and thus should not
+ * actually be part of the microstate. But with time-dependent restraining
+ * they are actually part of the (non-Markovian) microstate.
+ * \todo Rename this with a more descriptive name.
+ */
+class history_t
 {
-    real  disre_initf;  /* The scaling factor for initializing the time av. */
-    int   ndisrepairs;  /* The number of distance restraints                */
-    real *disre_rm3tav; /* The r^-3 time averaged pair distances            */
-    real  orire_initf;  /* The scaling factor for initializing the time av. */
-    int   norire_Dtav;  /* The number of matrix element in dtav (npair*5)   */
-    real *orire_Dtav;   /* The time averaged orientation tensors            */
-} history_t;
-
-/* Struct used for checkpointing only.
+    public:
+        //! Constructor
+        history_t();
+
+        real  disre_initf;  //!< The scaling factor for initializing the time av.
+        int   ndisrepairs;  //!< The number of distance restraints
+        real *disre_rm3tav; //!< The r^-3 time averaged pair distances
+        real  orire_initf;  //!< The scaling factor for initializing the time av.
+        int   norire_Dtav;  //!< The number of matrix element in dtav (npair*5)
+        real *orire_Dtav;   //!< The time averaged orientation tensors
+};
+
+/*! \libinternal \brief Struct used for checkpointing only
+ *
  * This struct would not be required with unlimited precision.
  * But because of limited precision, the COM motion removal implementation
  * can cause the kinetic energy in the MD loop to differ by a few bits from
  * the kinetic energy one would determine from state.v.
  */
-typedef struct ekinstate_t
+class ekinstate_t
 {
-    gmx_bool     bUpToDate;
-    int          ekin_n;
-    tensor      *ekinh;
-    tensor      *ekinf;
-    tensor      *ekinh_old;
-    tensor       ekin_total;
-    double      *ekinscalef_nhc;
-    double      *ekinscaleh_nhc;
-    double      *vscale_nhc;
-    real         dekindl;
-    real         mvcos;
-} ekinstate_t;
+    public:
+        ekinstate_t();
 
+        gmx_bool             bUpToDate;      //!< Test if all data is up to date
+        int                  ekin_n;         //!< The number of tensors
+        tensor              *ekinh;          //!< Half step Ekin, size \p ekin_n
+        tensor              *ekinf;          //!< Full step Ekin, size \p ekin_n
+        tensor              *ekinh_old;      //!< Half step Ekin of the previous step, size \p ekin_n
+        tensor               ekin_total;     //!< Total kinetic energy
+        std::vector<double>  ekinscalef_nhc; //!< Nose-Hoover Ekin scaling factors for full step Ekin
+        std::vector<double>  ekinscaleh_nhc; //!< Nose-Hoover Ekin scaling factors for half step Ekin
+        std::vector<double>  vscale_nhc;     //!< Nose-Hoover velocity scaling factors
+        real                 dekindl;        //!< dEkin/dlambda, with free-energy
+        real                 mvcos;          //!< Cosine(z) component of the momentum, for viscosity calculations
+};
+
+/*! \brief Free-energy sampling history struct
+ *
+ * \todo Split out into microstate and observables history.
+ */
 typedef struct df_history_t
 {
-    int      nlambda;        /* total number of lambda states - for history*/
+    int      nlambda;        //!< total number of lambda states - for history
 
-    gmx_bool bEquil;         /* Have we reached equilibration */
-    int     *n_at_lam;       /* number of points observed at each lambda */
-    real    *wl_histo;       /* histogram for WL flatness determination */
-    real     wl_delta;       /* current wang-landau delta */
+    gmx_bool bEquil;         //!< Have we reached equilibration
+    int     *n_at_lam;       //!< number of points observed at each lambda
+    real    *wl_histo;       //!< histogram for WL flatness determination
+    real     wl_delta;       //!< current wang-landau delta
 
-    real    *sum_weights;    /* weights of the states */
-    real    *sum_dg;         /* free energies of the states -- not actually used for weighting, but informational */
-    real    *sum_minvar;     /* corrections to weights for minimum variance */
-    real    *sum_variance;   /* variances of the states */
+    real    *sum_weights;    //!< weights of the states
+    real    *sum_dg;         //!< free energies of the states -- not actually used for weighting, but informational
+    real    *sum_minvar;     //!< corrections to weights for minimum variance
+    real    *sum_variance;   //!< variances of the states
 
-    real   **accum_p;        /* accumulated bennett weights for n+1 */
-    real   **accum_m;        /* accumulated bennett weights for n-1 */
-    real   **accum_p2;       /* accumulated squared bennett weights for n+1 */
-    real   **accum_m2;       /* accumulated squared bennett weights for n-1 */
+    real   **accum_p;        //!< accumulated bennett weights for n+1
+    real   **accum_m;        //!< accumulated bennett weights for n-1
+    real   **accum_p2;       //!< accumulated squared bennett weights for n+1
+    real   **accum_m2;       //!< accumulated squared bennett weights for n-1
 
-    real   **Tij;            /* transition matrix */
-    real   **Tij_empirical;  /* Empirical transition matrix */
+    real   **Tij;            //!< transition matrix
+    real   **Tij_empirical;  //!< Empirical transition matrix
 
 } df_history_t;
 
-typedef struct edsamstate_t
-{
-    /* If one uses essential dynamics or flooding on a group of atoms from
-     * more than one molecule, we cannot make this group whole with
-     * do_pbc_first_mtop(). We assume that the ED group has the correct PBC
-     * representation at the beginning of the simulation and keep track
-     * of the shifts to always get it into that representation.
-     * For proper restarts from a checkpoint we store the positions of the
-     * reference group at the time of checkpoint writing */
-    gmx_bool      bFromCpt;     /* Did we start from a checkpoint file?       */
-    int           nED;          /* No. of ED/Flooding data sets, if <1 no ED  */
-    int          *nref;         /* No. of atoms in i'th reference structure   */
-    int          *nav;          /* Same for average structure                 */
-    rvec        **old_sref;     /* Positions of the reference atoms
-                                   at the last time step (with correct PBC
-                                   representation)                            */
-    rvec        **old_sref_p;   /* Pointer to these positions                 */
-    rvec        **old_sav;      /* Same for the average positions             */
-    rvec        **old_sav_p;
-}
-edsamstate_t;
-
-typedef struct swapstateIons_t
-{
-    int  nMolReq[eCompNR];                  /* Requested # of molecules per compartment      */
-    int *nMolReq_p[eCompNR];                /* Pointer to this data (for .cpt writing)       */
-    int  inflow_net[eCompNR];               /* Flux determined from the # of swaps           */
-    int *inflow_net_p[eCompNR];             /* Pointer to this data                          */
-    int *nMolPast[eCompNR];                 /* Array with nAverage entries for history       */
-    int *nMolPast_p[eCompNR];               /* Pointer points to the first entry only        */
-    /*                                                                                       */
-    /* Channel flux detection, this is counting only and has no influence on whether swaps   */
-    /* are performed or not:                                                                 */
-    int            fluxfromAtoB[eCompNR];   /* Flux determined from the split cylinders      */
-    int           *fluxfromAtoB_p[eCompNR]; /* Pointer to this data                          */
-    int            nMol;                    /* # of molecules, size of the following arrays  */
-    unsigned char *comp_from;               /* Ion came from which compartment?              */
-    unsigned char *channel_label;           /* Through which channel did this ion pass?      */
-} swapstateIons_t;
-
-typedef struct swapstate_t
-{
-    int  eSwapCoords;                       /* Swapping along x, y, or z-direction?          */
-    int  nIonTypes;                         /* Number of ion types, this is the size of      */
-                                            /* the following arrays                          */
-    int  nAverage;                          /* Use average over this many swap attempt       */
-                                            /* steps when determining the ion counts         */
-    int  fluxleak;                          /* Ions not going through any channel (bad!)     */
-    int *fluxleak_p;                        /* Pointer to this data                          */
-    /*                                                                                       */
-    /* To also make multimeric channel proteins whole, we save the last whole configuration  */
-    /* of the channels in the checkpoint file. If we have no checkpoint file, we assume      */
-    /* that the starting configuration has the correct PBC representation after making the   */
-    /* individual molecules whole                                                            */
-    gmx_bool         bFromCpt;                 /* Did we start from a checkpoint file?       */
-    int              nat[eChanNR];             /* Size of xc_old_whole, i.e. the number of   */
-                                               /* atoms in each channel                      */
-    rvec            *xc_old_whole[eChanNR];    /* Last known whole positions of the two      */
-                                               /* channels (important for multimeric ch.!)   */
-    rvec           **xc_old_whole_p[eChanNR];  /* Pointer to these positions                 */
-    swapstateIons_t *ionType;
-}
-swapstate_t;
-
-
-typedef struct t_state
+
+/*! \brief The microstate of the system
+ *
+ * The global state will contain complete data for all used entries.
+ * The local state with domain decomposition will have partial entries
+ * for which \p stateEntryIsAtomProperty() is true. Some entries that
+ * are used in the global state might not be present in the local state.
+ * \todo Move pure observables history to ObservablesHistory.
+ */
+class t_state
 {
-    int                     natoms;
-    int                     ngtc;
-    int                     nnhpres;
-    int                     nhchainlength;   /* number of nose-hoover chains               */
-    int                     flags;           /* Flags telling which entries are present      */
-    int                     fep_state;       /* indicates which of the alchemical states we are in                 */
-    real                   *lambda;          /* lambda vector                               */
-    matrix                  box;             /* box vector coordinates                         */
-    matrix                  box_rel;         /* Relitaive box vectors to preserve shape        */
-    matrix                  boxv;            /* box velocitites for Parrinello-Rahman pcoupl */
-    matrix                  pres_prev;       /* Pressure of the previous step for pcoupl  */
-    matrix                  svir_prev;       /* Shake virial for previous step for pcoupl */
-    matrix                  fvir_prev;       /* Force virial of the previous step for pcoupl  */
-    double                 *nosehoover_xi;   /* for Nose-Hoover tcoupl (ngtc)       */
-    double                 *nosehoover_vxi;  /* for N-H tcoupl (ngtc)               */
-    double                 *nhpres_xi;       /* for Nose-Hoover pcoupl for barostat     */
-    double                 *nhpres_vxi;      /* for Nose-Hoover pcoupl for barostat     */
-    double                 *therm_integral;  /* for N-H/V-rescale tcoupl (ngtc)     */
-    real                    veta;            /* trotter based isotropic P-coupling             */
-    real                    vol0;            /* initial volume,required for computing NPT conserverd quantity */
-    int                     nalloc;          /* Allocation size for x and v when !=NULL*/
-    rvec                   *x;               /* the coordinates (natoms)                     */
-    rvec                   *v;               /* the velocities (natoms)                      */
-    rvec                   *cg_p;            /* p vector for conjugate gradient minimization */
-
-    history_t               hist;            /* Time history for restraints                  */
-
-    ekinstate_t             ekinstate;       /* The state of the kinetic energy data      */
-
-    struct energyhistory_t *enerhist;        /* Energy history for statistics           */
-    swapstate_t             swapstate;       /* Position swapping                       */
-    df_history_t            dfhist;          /*Free energy history for free energy analysis  */
-    edsamstate_t            edsamstate;      /* Essential dynamics / flooding history */
-
-    int                     ddp_count;       /* The DD partitioning count for this state  */
-    int                     ddp_count_cg_gl; /* The DD part. count for index_gl     */
-    int                     ncg_gl;          /* The number of local charge groups            */
-    int                    *cg_gl;           /* The global cg number of the local cgs        */
-    int                     cg_gl_nalloc;    /* Allocation size of cg_gl;              */
-} t_state;
+    public:
+        //! Constructor
+        t_state();
+
+        // All things public
+        int                      natoms;          //!< Number of atoms, local + non-local; this is the size of \p x, \p v and \p cg_p, when used
+        int                      ngtc;            //!< The number of temperature coupling groups
+        int                      nnhpres;         //!< The NH-chain length for the MTTK barostat
+        int                      nhchainlength;   //!< The NH-chain length for temperature coupling
+        int                      flags;           //!< Set of bit-flags telling which entries are present, see enum at the top of the file
+        int                      fep_state;       //!< indicates which of the alchemical states we are in
+        std::array<real, efptNR> lambda;          //!< Free-energy lambda vector
+        matrix                   box;             //!< Matrix of box vectors
+        matrix                   box_rel;         //!< Relative box vectors to preserve box shape
+        matrix                   boxv;            //!< Box velocities for Parrinello-Rahman P-coupling
+        matrix                   pres_prev;       //!< Pressure of the previous step for pcoupl
+        matrix                   svir_prev;       //!< Shake virial for previous step for pcoupl
+        matrix                   fvir_prev;       //!< Force virial of the previous step for pcoupl
+        std::vector<double>      nosehoover_xi;   //!< Nose-Hoover coordinates (ngtc)
+        std::vector<double>      nosehoover_vxi;  //!< Nose-Hoover velocities (ngtc)
+        std::vector<double>      nhpres_xi;       //!< Pressure Nose-Hoover coordinates
+        std::vector<double>      nhpres_vxi;      //!< Pressure Nose-Hoover velocities
+        std::vector<double>      therm_integral;  //!< Work exterted N-H/V-rescale T-coupling (ngtc)
+        double                   baros_integral;  //!< For Berendsen P-coupling conserved quantity
+        real                     veta;            //!< Trotter based isotropic P-coupling
+        real                     vol0;            //!< Initial volume,required for computing MTTK conserved quantity
+        PaddedRVecVector         x;               //!< The coordinates (natoms)
+        PaddedRVecVector         v;               //!< The velocities (natoms)
+        PaddedRVecVector         cg_p;            //!< p vector for conjugate gradient minimization
+
+        ekinstate_t              ekinstate;       //!< The state of the kinetic energy
+
+        /* History for special algorithms, should be moved to a history struct */
+        history_t                hist;            //!< Time history for restraints
+        df_history_t            *dfhist;          //!< Free-energy history for free energy analysis
+
+        int                      ddp_count;       //!< The DD partitioning count for this state
+        int                      ddp_count_cg_gl; //!< The DD partitioning count for index_gl
+        std::vector<int>         cg_gl;           //!< The global cg number of the local cgs
+};
+
+#ifndef DOXYGEN
+/* We don't document the structs below, as they don't belong here.
+ * TODO: Move the next two structs out of state.h.
+ */
 
 typedef struct t_extmass
 {
@@ -253,12 +243,42 @@ typedef struct
     double *vscale_nhc;
 } t_vetavars;
 
+#endif // DOXYGEN
+
+//! Resizes the T- and P-coupling state variables
 void init_gtc_state(t_state *state, int ngtc, int nnhpres, int nhchainlength);
 
-void init_state(t_state *state, int natoms, int ngtc, int nnhpres, int nhchainlength, int nlambda);
+//! Change the number of atoms represented by this state, allocating memory as needed.
+void state_change_natoms(t_state *state, int natoms);
+
+//! Allocates memory for free-energy history
+void init_dfhist_state(t_state *state, int dfhistNumLambda);
+
+/*! \brief Compares two states, write the differences to stdout */
+void comp_state(const t_state *st1, const t_state *st2, gmx_bool bRMSD, real ftol, real abstol);
+
+/*! \brief Allocates an rvec pointer and copy the contents of v to it */
+rvec *getRvecArrayFromPaddedRVecVector(const PaddedRVecVector *v,
+                                       unsigned int            n);
 
-t_state *serial_init_local_state(t_state *state_global);
+/*! \brief Determine the relative box components
+ *
+ * Set box_rel e.g. used in mdrun state, used to preserve the box shape
+ * \param[in]    ir      Input record
+ * \param[inout] state   State
+ */
+void set_box_rel(const t_inputrec *ir, t_state *state);
 
-void done_state(t_state *state);
+/*! \brief Make sure the relative box shape remains the same
+ *
+ * This function ensures that the relative box dimensions are
+ * preserved, which otherwise might diffuse away due to rounding
+ * errors in pressure coupling or the deform option.
+ *
+ * \param[in]    ir      Input record
+ * \param[in]    box_rel Relative box dimensions
+ * \param[inout] box     The corrected actual box dimensions
+ */
+void preserve_box_shape(const t_inputrec *ir, matrix box_rel, matrix box);
 
 #endif
diff --git a/src/gromacs/mdtypes/swaphistory.h b/src/gromacs/mdtypes/swaphistory.h
new file mode 100644 (file)
index 0000000..080a8c0
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+
+/*
+ * This file contains data types containing ioin/water position exchange
+ * data to be stored in the checkpoint file.
+ */
+
+#ifndef GMX_MDLIB_SWAPHISTORY_H
+#define GMX_MDLIB_SWAPHISTORY_H
+
+/* History of an ion type used in position swapping
+ */
+typedef struct swapstateIons_t
+{
+    int  nMolReq[eCompNR];                    // Requested # of molecules per compartment
+    int *nMolReq_p[eCompNR];                  // Pointer to this data (for checkpoint writing)
+    int  inflow_net[eCompNR];                 // Flux determined from the # of swaps
+    int *inflow_net_p[eCompNR];               // Pointer to this data
+    int *nMolPast[eCompNR];                   // Array with nAverage entries for history
+    int *nMolPast_p[eCompNR];                 // Pointer points to the first entry only
+
+    // Channel flux detection, this is counting only and has no influence on whether swaps are performed or not:                                                                 */
+    int            fluxfromAtoB[eCompNR];     // Flux determined from the split cylinders
+    int           *fluxfromAtoB_p[eCompNR];   // Pointer to this data
+    int            nMol;                      // Number of molecules, size of the following arrays
+    unsigned char *comp_from;                 // Ion came from which compartment?
+    unsigned char *channel_label;             // Through which channel did this ion pass?
+} swapstateIons_t;
+
+/* Position swapping state
+ *
+ * To also make multimeric channel proteins whole, we save the last whole configuration
+ * of the channels in the checkpoint file. If we have no checkpoint file, we assume
+ * that the starting configuration has the correct PBC representation after making the
+ * individual molecules whole
+ *
+ * \todo move out of this file to ObservablesHistory
+ *
+ */
+typedef struct swaphistory_t
+{
+    int              eSwapCoords;             // Swapping along x, y, or z-direction?
+    int              nIonTypes;               // Number of ion types, this is the size of the following arrays
+    int              nAverage;                // Use average over this many swap attempt steps when determining the ion counts
+    int              fluxleak;                // Ions not going through any channel (bad!)
+    int             *fluxleak_p;              // Pointer to this data
+    gmx_bool         bFromCpt;                // Did we start from a checkpoint file?
+    int              nat[eChanNR];            // Size of xc_old_whole, i.e. the number of atoms in each channel
+    rvec            *xc_old_whole[eChanNR];   // Last known whole positions of the two channels (important for multimeric ch.!)
+    rvec           **xc_old_whole_p[eChanNR]; // Pointer to these positions
+    swapstateIons_t *ionType;                 // History information for one ion type
+}
+swaphistory_t;
+
+#endif
index e5f7212393d66871c6804010df9e76efa066ef30..777ad247dd83b6160a3370f4d1425f3756192d87 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,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.
@@ -75,7 +75,7 @@ class TextTableFormatter::Impl
         {
             //! Initializes a text table column with given values.
             ColumnData(const char *title, int width, bool bWrap)
-                : title_(title != NULL ? title : ""),
+                : title_(title != nullptr ? title : ""),
                   width_(width), bWrap_(bWrap), firstLine_(0),
                   nextLineIndex_(0), nextLineOffset_(0)
             {
@@ -225,11 +225,11 @@ TextTableFormatter::~TextTableFormatter()
 
 void TextTableFormatter::addColumn(const char *title, int width, bool bWrap)
 {
-    if (title != NULL && title[0] != '\0')
+    if (title != nullptr && title[0] != '\0')
     {
         impl_->bPrintHeader_ = true;
     }
-    impl_->columns_.push_back(Impl::ColumnData(title, width, bWrap));
+    impl_->columns_.emplace_back(title, width, bWrap);
 }
 
 void TextTableFormatter::setFirstColumnIndent(int indent)
@@ -341,7 +341,7 @@ std::string TextTableFormatter::formatRow()
                 {
                     if (overflow > columnWidth && column->bWrap_)
                     {
-                        columnLines.push_back(std::string());
+                        columnLines.emplace_back();
                         continue;
                     }
                     columnWidth -= overflow;
index 60a8b7f48ed1cbeb63bb45226d58678706ac9d58..cc4c9d75f48af846ce519d39d7f8cef757e5c9bb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * 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.
@@ -136,7 +136,7 @@ void HelpManager::enterTopic(const char *name)
                                        impl_->currentTopicAsString().c_str())));
     }
     const IHelpTopic *newTopic = topic.findSubTopic(name);
-    if (newTopic == NULL)
+    if (newTopic == nullptr)
     {
         if (impl_->isAtRootTopic())
         {
@@ -163,7 +163,7 @@ void HelpManager::writeCurrentTopic() const
     const IHelpTopic         &topic = impl_->currentTopic();
     const char               *title = topic.title();
     HelpWriterContext         context(impl_->rootContext_);
-    context.enterSubSection(title != NULL ? title : "");
+    context.enterSubSection(title != nullptr ? title : "");
     topic.writeHelp(context);
 }
 
index 167e8214fa2c2c43e98503d5c298562130c169bc..6126171739dfb7c7fdef4f7c01ec004fbf7c0ee1 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,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.
@@ -68,7 +68,7 @@ bool AbstractSimpleHelpTopic::hasSubTopics() const
 const IHelpTopic *
 AbstractSimpleHelpTopic::findSubTopic(const char * /* name */) const
 {
-    return NULL;
+    return nullptr;
 }
 
 void AbstractSimpleHelpTopic::writeHelp(const HelpWriterContext &context) const
@@ -131,7 +131,7 @@ AbstractCompositeHelpTopic::findSubTopic(const char *name) const
     Impl::SubTopicMap::const_iterator topic = impl_->subTopicMap_.find(name);
     if (topic == impl_->subTopicMap_.end())
     {
-        return NULL;
+        return nullptr;
     }
     return topic->second;
 }
@@ -182,8 +182,8 @@ AbstractCompositeHelpTopic::writeSubTopicList(const HelpWriterContext &context,
     }
     TextWriter        &file = context.outputFile();
     TextTableFormatter formatter;
-    formatter.addColumn(NULL, maxNameLength + 1, false);
-    formatter.addColumn(NULL, 72 - maxNameLength, true);
+    formatter.addColumn(nullptr, maxNameLength + 1, false);
+    formatter.addColumn(nullptr, 72 - maxNameLength, true);
     formatter.setFirstColumnIndent(4);
     file.writeLine(title);
     for (topic = impl_->subTopicMap_.begin(); topic != impl_->subTopicMap_.end(); ++topic)
index 2e5a578cb4ed2c8ea7729d6dabc07d6ad15984f2..dcc655e3d23ba025f660ed2630443ded26e13170 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,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.
@@ -409,7 +409,7 @@ void HelpLinks::addLink(const std::string &linkName,
         default:
             GMX_RELEASE_ASSERT(false, "Output format not implemented for links");
     }
-    impl_->links_.push_back(Impl::LinkItem(linkName, replacement));
+    impl_->links_.emplace_back(linkName, replacement);
 }
 
 /********************************************************************
@@ -457,10 +457,10 @@ class HelpWriterContext::Impl
                     {
                         consoleOptionsFormatter_.reset(new TextTableFormatter());
                         consoleOptionsFormatter_->setFirstColumnIndent(1);
-                        consoleOptionsFormatter_->addColumn(NULL, 7, false);
-                        consoleOptionsFormatter_->addColumn(NULL, 18, false);
-                        consoleOptionsFormatter_->addColumn(NULL, 16, false);
-                        consoleOptionsFormatter_->addColumn(NULL, 28, false);
+                        consoleOptionsFormatter_->addColumn(nullptr, 7, false);
+                        consoleOptionsFormatter_->addColumn(nullptr, 18, false);
+                        consoleOptionsFormatter_->addColumn(nullptr, 16, false);
+                        consoleOptionsFormatter_->addColumn(nullptr, 28, false);
                     }
                     return *consoleOptionsFormatter_;
                 }
@@ -508,7 +508,7 @@ class HelpWriterContext::Impl
         void addReplacement(const std::string &search,
                             const std::string &replace)
         {
-            replacements_.push_back(ReplaceItem(search, replace));
+            replacements_.emplace_back(search, replace);
         }
 
         //! Replaces links in a given string.
@@ -540,7 +540,7 @@ class HelpWriterContext::Impl
 std::string HelpWriterContext::Impl::replaceLinks(const std::string &input) const
 {
     std::string result(input);
-    if (state_->links_ != NULL)
+    if (state_->links_ != nullptr)
     {
         HelpLinks::Impl::LinkList::const_iterator link;
         for (link  = state_->links_->impl_->links_.begin();
@@ -603,7 +603,7 @@ void HelpWriterContext::Impl::processMarkup(const std::string &text,
  */
 
 HelpWriterContext::HelpWriterContext(TextWriter *writer, HelpOutputFormat format)
-    : impl_(new Impl(Impl::StatePointer(new Impl::SharedState(writer, format, NULL)), 0))
+    : impl_(new Impl(Impl::StatePointer(new Impl::SharedState(writer, format, nullptr)), 0))
 {
 }
 
@@ -611,7 +611,7 @@ HelpWriterContext::HelpWriterContext(TextWriter *writer, HelpOutputFormat format
                                      const HelpLinks *links)
     : impl_(new Impl(Impl::StatePointer(new Impl::SharedState(writer, format, links)), 0))
 {
-    if (links != NULL)
+    if (links != nullptr)
     {
         GMX_RELEASE_ASSERT(links->impl_->format_ == format,
                            "Links must have the same output format as the context");
index 0d7a3842f8700d6929a57b6e0589991395ec1e0b..1fb607a319ef12dbc849fa2a6b71a1a95844d14d 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+# Copyright (c) 2012,2014,2015,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.
 gmx_add_unit_test_object_library(onlinehelp-test-shared
                                  mock_helptopic.cpp)
 
-if (CMAKE_CXX_COMPILER_ID MATCHES "XL")
-    # This suppression stops a very verbose cascade of messages about the
-    # mocks, which is probably a compiler issue.
-    #   1540-2924 (W) Cannot pass an argument of non-POD class type "const gmx::HelpWriterContext" through ellipsis.
-    set_property(SOURCE mock_helptopic.cpp PROPERTY COMPILE_FLAGS "-qsuppress=1540-2924")
-endif()
-
 gmx_add_unit_test(OnlineHelpUnitTests onlinehelp-test
                   helpformat.cpp
                   helpmanager.cpp
index 797593e6b899116ce3be98d93d914d508c279996..f48ffbebbf08f5b3c7d7813a255e7b4b789eb71d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,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.
@@ -88,9 +88,9 @@ TEST_F(TextTableFormatterTest, HandlesBasicCase)
 
 TEST_F(TextTableFormatterTest, HandlesEmptyColumnTitles)
 {
-    formatter_.addColumn(NULL, 4, false);
+    formatter_.addColumn(nullptr, 4, false);
     formatter_.addColumn("", 4, false);
-    formatter_.addColumn(NULL, 14, true);
+    formatter_.addColumn(nullptr, 14, true);
     formatter_.addColumn("", 14, true);
 
     formatter_.clear();
index c9f171f9e6b5e3b93e72c00e07cbd64fc1374c96..19a19fce27b648da0dedcb99c42967f21e1c7a8d 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,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.
@@ -76,7 +76,7 @@ class HelpTestBase : public gmx::test::StringTestBase
 };
 
 HelpTestBase::HelpTestBase()
-    : rootTopic_("", NULL, "Root topic text"),
+    : rootTopic_("", nullptr, "Root topic text"),
       writer_(&helpFile_),
       context_(&writer_, gmx::eHelpOutputFormat_Console),
       manager_(rootTopic_, context_)
@@ -100,10 +100,10 @@ TEST_F(HelpManagerTest, HandlesRootTopic)
 TEST_F(HelpManagerTest, HandlesSubTopics)
 {
     MockHelpTopic &first =
-        rootTopic_.addSubTopic("first", "First topic", NULL);
+        rootTopic_.addSubTopic("first", "First topic", nullptr);
     MockHelpTopic &firstSub =
-        first.addSubTopic("firstsub", "First subtopic", NULL);
-    rootTopic_.addSubTopic("second", "Second topic", NULL);
+        first.addSubTopic("firstsub", "First subtopic", nullptr);
+    rootTopic_.addSubTopic("second", "Second topic", nullptr);
 
     using ::testing::_;
     EXPECT_CALL(firstSub, writeHelp(_));
@@ -115,9 +115,9 @@ TEST_F(HelpManagerTest, HandlesSubTopics)
 TEST_F(HelpManagerTest, HandlesInvalidTopics)
 {
     MockHelpTopic &first =
-        rootTopic_.addSubTopic("first", "First topic", NULL);
-    first.addSubTopic("firstsub", "First subtopic", NULL);
-    rootTopic_.addSubTopic("second", "Second topic", NULL);
+        rootTopic_.addSubTopic("first", "First topic", nullptr);
+    first.addSubTopic("firstsub", "First subtopic", nullptr);
+    rootTopic_.addSubTopic("second", "Second topic", nullptr);
 
     ASSERT_THROW_GMX(manager_.enterTopic("unknown"), gmx::InvalidInputError);
     ASSERT_NO_THROW_GMX(manager_.enterTopic("first"));
index d41ca87f6b2a9317e3682e81a53970b71ae7aa82..205906f435e2f2542b0cbfa1974d4bc870d4645f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 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.
@@ -67,10 +67,10 @@ class HelpWriterContextTest : public gmx::test::StringTestBase
                             gmx::HelpOutputFormat  format,
                             const char            *id)
         {
-            gmx::HelpWriterContext context(NULL, format);
+            gmx::HelpWriterContext context(nullptr, format);
             std::string            result
                 = context.substituteMarkupAndWrapToString(settings_, text);
-            if (id == NULL)
+            if (id == nullptr)
             {
                 switch (format)
                 {
@@ -89,8 +89,8 @@ class HelpWriterContextTest : public gmx::test::StringTestBase
         void testFormatting(const gmx::ConstArrayRef<const char *> &text)
         {
             std::string testText = gmx::joinStrings(text, "\n");
-            testFormatting(testText, gmx::eHelpOutputFormat_Console, NULL);
-            testFormatting(testText, gmx::eHelpOutputFormat_Rst, NULL);
+            testFormatting(testText, gmx::eHelpOutputFormat_Console, nullptr);
+            testFormatting(testText, gmx::eHelpOutputFormat_Rst, nullptr);
         }
 
         gmx::TextLineWrapperSettings settings_;
index 3579fc7d829f11eb2aca10145651cc02abaa4856..49decf9b1ad1bd50e56cf218e7f71d59c3d09896 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * 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.
@@ -69,7 +69,7 @@ MockHelpTopic::addSubTopic(gmx::AbstractCompositeHelpTopic *parent,
 }
 
 MockHelpTopic::MockHelpTopic(const char *name, const char *title, const char *text)
-    : name_(name), title_(title), text_(text != NULL ? text : "")
+    : name_(name), title_(title), text_(text != nullptr ? text : "")
 {
     if (!isNullOrEmpty(text))
     {
index 62d006445c347feef7dba88995e2ca6ceabe13e2..172f357b55feabd68e28109c1e5a487fd3431a9d 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2010,2012,2013,2014,2015, by the GROMACS development team, led by
+# Copyright (c) 2010,2012,2013,2014,2015,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.
 # To help us fund GROMACS development, we humbly ask that you cite
 # the research papers on the package. Check out http://www.gromacs.org.
 
-file(GLOB OPTIONS_SOURCES *.cpp)
-set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${OPTIONS_SOURCES} PARENT_SCOPE)
+gmx_add_libgromacs_sources(
+    abstractoption.cpp
+    abstractsection.cpp
+    basicoptions.cpp
+    behaviorcollection.cpp
+    filenameoption.cpp
+    filenameoptionmanager.cpp
+    options.cpp
+    optionsassigner.cpp
+    optionsection.cpp
+    optionsvisitor.cpp
+    timeunitmanager.cpp
+    treesupport.cpp
+    )
 
 gmx_install_headers(
     abstractoption.h
+    abstractsection.h
     basicoptions.h
     filenameoption.h
     filenameoptionmanager.h
     ioptionsbehavior.h
     ioptionscontainer.h
+    ioptionscontainerwithsections.h
+    isectionstorage.h
+    ivaluestore.h
     optionfiletype.h
     optionflags.h
     options.h
+    optionsection.h
+    repeatingsection.h
     timeunitmanager.h
+    valuestore.h
     )
 
 if (BUILD_TESTING)
index 25d4ecab83908f7edc85c28bb40820dfcd61fe3f..6b8c75bfec264ee6b73c54c114b8c321746531f3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -47,6 +47,7 @@
 #include "gromacs/options/optionflags.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/variant.h"
 
 #include "basicoptionstorage.h"
 
@@ -71,15 +72,15 @@ AbstractOptionStorage::AbstractOptionStorage(const AbstractOption &settings,
         GMX_THROW(APIError("Inconsistent value counts for vector values"));
     }
 
-    if (settings.name_ != NULL)
+    if (settings.name_ != nullptr)
     {
         name_  = settings.name_;
     }
-    if (settings.descr_ != NULL)
+    if (settings.descr_ != nullptr)
     {
         descr_ = settings.descr_;
     }
-    if (storeIsSet_ != NULL)
+    if (storeIsSet_ != nullptr)
     {
         *storeIsSet_ = false;
     }
@@ -92,7 +93,7 @@ AbstractOptionStorage::~AbstractOptionStorage()
 
 bool AbstractOptionStorage::isBoolean() const
 {
-    return dynamic_cast<const BooleanOptionStorage *>(this) != NULL;
+    return dynamic_cast<const BooleanOptionStorage *>(this) != nullptr;
 }
 
 void AbstractOptionStorage::startSource()
@@ -116,14 +117,14 @@ void AbstractOptionStorage::startSet()
     bSetValuesHadErrors_ = false;
 }
 
-void AbstractOptionStorage::appendValue(const std::string &value)
+void AbstractOptionStorage::appendValue(const Variant &value)
 {
     GMX_RELEASE_ASSERT(bInSet_, "startSet() not called");
     try
     {
         convertValue(value);
     }
-    catch (...)
+    catch (const std::exception &)
     {
         bSetValuesHadErrors_ = true;
         throw;
@@ -133,7 +134,7 @@ void AbstractOptionStorage::appendValue(const std::string &value)
 void AbstractOptionStorage::markAsSet()
 {
     setFlag(efOption_Set);
-    if (storeIsSet_ != NULL)
+    if (storeIsSet_ != nullptr)
     {
         *storeIsSet_ = true;
     }
@@ -260,19 +261,19 @@ std::string OptionInfo::formatDescription() const
     return description;
 }
 
-std::string OptionInfo::formatDefaultValueIfSet() const
+std::vector<Variant> OptionInfo::defaultValues() const
 {
-    return option().formatDefaultValueIfSet();
+    return option().defaultValues();
 }
 
-int OptionInfo::valueCount() const
+std::vector<std::string> OptionInfo::defaultValuesAsStrings() const
 {
-    return option().valueCount();
+    return option().defaultValuesAsStrings();
 }
 
-std::string OptionInfo::formatValue(int i) const
+std::vector<Variant> OptionInfo::normalizeValues(const std::vector<Variant> &values) const
 {
-    return option().formatValue(i);
+    return option().normalizeValues(values);
 }
 
 } // namespace gmx
index ff8a2596865374f82d1ba577d3ca34e934f16c09..575cd6efaddffba760057f6e1ef5f8fff885bfb4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -66,10 +66,11 @@ namespace gmx
 class AbstractOptionStorage;
 template <typename T> class OptionStorageTemplate;
 class OptionManagerContainer;
+class Variant;
 
 namespace internal
 {
-class OptionsImpl;
+class OptionSectionImpl;
 }
 
 /*! \brief
@@ -101,7 +102,7 @@ class AbstractOption
         //! Initializes the name and default values for an option.
         explicit AbstractOption(const char *name)
             : minValueCount_(1), maxValueCount_(1),
-              name_(name), descr_(NULL), storeIsSet_(NULL)
+              name_(name), descr_(nullptr), storeIsSet_(nullptr)
         { }
 
         /*! \brief
@@ -198,7 +199,7 @@ class AbstractOption
          */
         friend class AbstractOptionStorage;
         //! Needed to be able to call createStorage().
-        friend class internal::OptionsImpl;
+        friend class internal::OptionSectionImpl;
 };
 
 /*! \brief
@@ -359,8 +360,8 @@ class OptionTemplate : public AbstractOption
         //! Initializes the name and default values for an option.
         explicit OptionTemplate(const char *name)
             : AbstractOption(name),
-              defaultValue_(NULL), defaultValueIfSet_(NULL), store_(NULL),
-              countptr_(NULL), storeVector_(NULL)
+              defaultValue_(nullptr), defaultValueIfSet_(nullptr), store_(nullptr),
+              countptr_(nullptr), storeVector_(nullptr)
         { }
 
         /*! \brief
@@ -447,7 +448,7 @@ class OptionInfo
         template <class InfoType>
         bool isType() const
         {
-            return toType<InfoType>() != NULL;
+            return toType<InfoType>() != nullptr;
         }
         /*! \brief
          * Convert the info object to a particular type if the type is correct.
@@ -485,17 +486,38 @@ class OptionInfo
         std::string type() const;
         //! Returns the description of the option.
         std::string formatDescription() const;
+
         /*! \brief
-         * Returns the default value if set for the option as a string.
+         * Returns the default value(s) of the option.
+         *
+         * The returned values should all be of the same type, but returning
+         * each as a separate variant is currently simpler.
          *
-         * \see OptionTemplate::defaultValueIfSet()
+         * Currently, this can only be called before option values have been
+         * assigned.
          */
-        std::string formatDefaultValueIfSet() const;
-
-        //! Returns the number of values given for the option.
-        int valueCount() const;
-        //! Returns the i'th value of the option as a string.
-        std::string formatValue(int i) const;
+        std::vector<Variant> defaultValues() const;
+        /*! \brief
+         * Returns the default value(s) of the option as strings.
+         *
+         * If there is no default value, but defaultValueIfSet() is set, that
+         * is returned instead.
+         *
+         * Currently, this can only be called before option values have been
+         * assigned.
+         */
+        std::vector<std::string> defaultValuesAsStrings() const;
+        /*! \brief
+         * Converts given values to native representation for this option.
+         *
+         * For example, strings are parsed to the type that is actually used to
+         * store the options.
+         *
+         * The return value only depends on the option type, not on the current
+         * value of the option, and the current value in the option is not
+         * changed.
+         */
+        std::vector<Variant> normalizeValues(const std::vector<Variant> &values) const;
 
     protected:
         /*! \cond libapi */
index 55ea22fd261cb7219fe70c8f2b948bf05dace184..dd4e2eae764d2a4413f70d05794026bd2ec8724f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2014,2015,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.
@@ -44,6 +44,7 @@
 #define GMX_OPTIONS_ABSTRACTOPTIONSTORAGE_H
 
 #include <string>
+#include <vector>
 
 #include "gromacs/options/optionflags.h"
 #include "gromacs/utility/classhelpers.h"
@@ -54,6 +55,7 @@ namespace gmx
 class AbstractOption;
 class OptionInfo;
 class Options;
+class Variant;
 
 /*! \libinternal \brief
  * Abstract base class for converting, validating, and storing option values.
@@ -137,16 +139,12 @@ class AbstractOptionStorage
          * Returns the number of option values added so far.
          */
         virtual int valueCount() const = 0;
-        /*! \brief
-         * Returns the i'th value formatted as a string.
-         *
-         * If \p i is DefaultValueIfSetIndex, should format the default value
-         * if set (see OptionTemplate::defaultValueIfSet()).
-         */
-        virtual std::string formatValue(int i) const = 0;
-        //! \copydoc OptionInfo::formatDefaultValueIfSet()
-        std::string formatDefaultValueIfSet() const
-        { return formatValue(DefaultValueIfSetIndex); }
+        //! \copydoc OptionInfo::defaultValues()
+        virtual std::vector<Variant> defaultValues() const = 0;
+        //! \copydoc OptionInfo::defaultValuesAsStrings()
+        virtual std::vector<std::string> defaultValuesAsStrings() const = 0;
+        //! \copydoc OptionInfo::normalizeValues()
+        virtual std::vector<Variant> normalizeValues(const std::vector<Variant> &values) const = 0;
 
         /*! \brief
          * Starts adding values from a new source for the option.
@@ -171,16 +169,16 @@ class AbstractOptionStorage
          */
         void startSet();
         /*! \brief
-         * Adds a new value for the option, converting it from a string.
+         * Adds a new value for the option.
          *
-         * \param[in] value  String value to convert.
+         * \param[in] value  Value to convert.
          * \throws  InvalidInputError if value cannot be converted, or
          *      if there are too many values.
          *
          * This method should only be called between startSet() and
          * finishSet().
          */
-        void appendValue(const std::string &value);
+        void appendValue(const Variant &value);
         /*! \brief
          * Performs validation and/or actions once a set of values has been
          * added.
@@ -205,9 +203,6 @@ class AbstractOptionStorage
         void finish();
 
     protected:
-        //! Index used with formatValue() for formatting default value if set.
-        static const int DefaultValueIfSetIndex = -1;
-
         /*! \brief
          * Initializes the storage object from the settings object.
          *
@@ -270,9 +265,9 @@ class AbstractOptionStorage
          */
         virtual void clearSet() = 0;
         /*! \brief
-         * Adds a new value, converting it from a string.
+         * Adds a new value.
          *
-         * \param[in] value  String value to convert.
+         * \param[in] value  Value to convert.
          * \throws  InvalidInputError if \p value is not valid for this option
          *      or if there have been too many values in the set.
          *
@@ -281,7 +276,7 @@ class AbstractOptionStorage
          *
          * \see OptionStorageTemplate::convertValue()
          */
-        virtual void convertValue(const std::string &value) = 0;
+        virtual void convertValue(const Variant &value) = 0;
         /*! \brief
          * Performs validation and/or actions once a set of values has been
          * added.
diff --git a/src/gromacs/options/abstractsection.cpp b/src/gromacs/options/abstractsection.cpp
new file mode 100644 (file)
index 0000000..bb056cf
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Implements classes from abstractsection.h.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_options
+ */
+#include "gmxpre.h"
+
+#include "abstractsection.h"
+
+#include "options-impl.h"
+
+namespace gmx
+{
+
+/********************************************************************
+ * AbstractOptionSectionHandle
+ */
+
+// static
+IOptionSectionStorage *
+AbstractOptionSectionHandle::getStorage(internal::OptionSectionImpl *section)
+{
+    return section->storage_.get();
+}
+
+IOptionsContainer &AbstractOptionSectionHandle::addGroup()
+{
+    return section_->addGroup();
+}
+
+internal::OptionSectionImpl *
+AbstractOptionSectionHandle::addSectionImpl(const AbstractOptionSection &section)
+{
+    return section_->addSectionImpl(section);
+}
+
+OptionInfo *AbstractOptionSectionHandle::addOptionImpl(const AbstractOption &settings)
+{
+    return section_->addOptionImpl(settings);
+}
+
+/********************************************************************
+ * AbstractOptionSectionInfo
+ */
+
+const std::string &AbstractOptionSectionInfo::name() const
+{
+    return section_.name_;
+}
+
+} // namespace gmx
diff --git a/src/gromacs/options/abstractsection.h b/src/gromacs/options/abstractsection.h
new file mode 100644 (file)
index 0000000..ba54295
--- /dev/null
@@ -0,0 +1,174 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \file
+ * \brief
+ * Declares base classes for declaring option sections.
+ *
+ * This header defines base classes for option section settings that are used
+ * with IOptionsContainerWithSections::addSection().  These classes implement
+ * the "named parameter" idiom for specifying section properties.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_options
+ */
+#ifndef GMX_OPTIONS_ABSTRACTSECTION_H
+#define GMX_OPTIONS_ABSTRACTSECTION_H
+
+#include "gromacs/options/ioptionscontainerwithsections.h"
+#include "gromacs/options/isectionstorage.h"
+#include "gromacs/utility/classhelpers.h"
+#include "gromacs/utility/gmxassert.h"
+
+namespace gmx
+{
+
+class IOptionSectionStorage;
+
+namespace internal
+{
+class OptionSectionImpl;
+}
+
+/*! \brief
+ * Base class for specifying option section properties.
+ *
+ * \ingroup module_options
+ */
+class AbstractOptionSection
+{
+    protected:
+        //! \cond libapi
+        //! Initializes option properties with the given name.
+        explicit AbstractOptionSection(const char *name) : name_(name) {}
+
+        /*! \brief
+         * Creates a storage object corresponding to this section.
+         *
+         * Similar to AbstractOption::createStorage().
+         */
+        virtual IOptionSectionStorage *createStorage() const = 0;
+        //! \endcond
+
+    private:
+        const char *name_;
+
+        friend class internal::OptionSectionImpl;
+};
+
+/*! \brief
+ * Base class for handles to option sections.
+ *
+ * This class implements the common functionality for adding options and
+ * subsections to option sections.
+ *
+ * \ingroup module_options
+ */
+class AbstractOptionSectionHandle : public IOptionsContainerWithSections
+{
+    public:
+        // From IOptionsContainer
+        //! \copydoc IOptionsContainer::addGroup()
+        virtual IOptionsContainer &addGroup();
+
+    protected:
+        //! \cond libapi
+        /*! \brief
+         * Returns the storage for a particular type of section.
+         *
+         * This is intended for use in derived class constructors, where the
+         * handle needs access to the actual storage.  The handle should know
+         * the type of storage created for the section type it deals with, so
+         * the cast should always be successful.
+         */
+        template <typename StorageType>
+        static StorageType *getStorage(internal::OptionSectionImpl *section)
+        {
+            IOptionSectionStorage *storage = getStorage(section);
+            StorageType           *typedStorage
+                = dynamic_cast<StorageType *>(storage);
+            GMX_ASSERT(typedStorage != nullptr, "Mismatching section storage type");
+            return typedStorage;
+        }
+
+        //! Wraps a given section storage object.
+        explicit AbstractOptionSectionHandle(internal::OptionSectionImpl *section)
+            : section_(section)
+        {
+        }
+        //! \endcond
+
+    private:
+        // From IOptionsContainerWithSections
+        virtual internal::OptionSectionImpl *
+        addSectionImpl(const AbstractOptionSection &section);
+        // From IOptionsContainer
+        virtual OptionInfo *addOptionImpl(const AbstractOption &settings);
+
+        /*! \brief
+         * Implementation helper for the template method.
+         *
+         * This allows encapsulating the implementation within the source file.
+         */
+        static IOptionSectionStorage *getStorage(internal::OptionSectionImpl *section);
+
+        internal::OptionSectionImpl *section_;
+};
+
+class AbstractOptionSectionInfo
+{
+    public:
+        //! Wraps a given section storage object.
+        explicit AbstractOptionSectionInfo(internal::OptionSectionImpl *section)
+            : section_(*section)
+        {
+        }
+
+        //! Returns the name of the section.
+        const std::string &name() const;
+
+        //! Returns the wrapped section storage object.
+        internal::OptionSectionImpl       &section() { return section_; }
+        //! Returns the wrapped section storage object.
+        const internal::OptionSectionImpl &section() const { return section_; }
+
+    private:
+        internal::OptionSectionImpl &section_;
+
+        GMX_DISALLOW_COPY_AND_ASSIGN(AbstractOptionSectionInfo);
+};
+
+} // namespace gmx
+
+#endif
index 1a09d40569fbd53474e2d370ef55982a5956613f..57e691f74f0dfb08aebb7eed27a937d5d569c241 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -54,6 +54,7 @@
 
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/strconvert.h"
 #include "gromacs/utility/stringutil.h"
 
 #include "basicoptionstorage.h"
@@ -140,20 +141,9 @@ std::string BooleanOptionStorage::formatSingleValue(const bool &value) const
     return value ? "yes" : "no";
 }
 
-void BooleanOptionStorage::convertValue(const std::string &value)
+void BooleanOptionStorage::initConverter(ConverterType *converter)
 {
-    // TODO: Case-independence
-    if (value == "1" || value == "yes" || value == "true")
-    {
-        addValue(true);
-        return;
-    }
-    else if (value == "0" || value == "no" || value == "false")
-    {
-        addValue(false);
-        return;
-    }
-    GMX_THROW(InvalidInputError("Invalid value: '" + value + "'; supported values are: 1, 0, yes, no, true, false"));
+    converter->addConverter<std::string>(&fromStdString<bool>);
 }
 
 /********************************************************************
@@ -192,28 +182,12 @@ BooleanOption::createStorage(const OptionManagerContainer & /*managers*/) const
 
 std::string IntegerOptionStorage::formatSingleValue(const int &value) const
 {
-    return formatString("%d", value);
+    return toString(value);
 }
 
-void IntegerOptionStorage::convertValue(const std::string &value)
+void IntegerOptionStorage::initConverter(ConverterType *converter)
 {
-    const char *ptr = value.c_str();
-    char       *endptr;
-    errno = 0;
-    long int    ival = std::strtol(ptr, &endptr, 10);
-    if (errno == ERANGE
-        || ival < std::numeric_limits<int>::min()
-        || ival > std::numeric_limits<int>::max())
-    {
-        GMX_THROW(InvalidInputError("Invalid value: '" + value
-                                    + "'; it causes an integer overflow"));
-    }
-    if (*ptr == '\0' || *endptr != '\0')
-    {
-        GMX_THROW(InvalidInputError("Invalid value: '" + value
-                                    + "'; expected an integer"));
-    }
-    addValue(ival);
+    converter->addConverter<std::string>(&fromStdString<int>);
 }
 
 void IntegerOptionStorage::processSetValues(ValueList *values)
@@ -250,26 +224,12 @@ IntegerOption::createStorage(const OptionManagerContainer & /*managers*/) const
 
 std::string Int64OptionStorage::formatSingleValue(const gmx_int64_t &value) const
 {
-    return formatString("%" GMX_PRId64, value);
+    return toString(value);
 }
 
-void Int64OptionStorage::convertValue(const std::string &value)
+void Int64OptionStorage::initConverter(ConverterType *converter)
 {
-    const char       *ptr = value.c_str();
-    char             *endptr;
-    errno = 0;
-    const gmx_int64_t ival = str_to_int64_t(ptr, &endptr);
-    if (errno == ERANGE)
-    {
-        GMX_THROW(InvalidInputError("Invalid value: '" + value
-                                    + "'; it causes an integer overflow"));
-    }
-    if (*ptr == '\0' || *endptr != '\0')
-    {
-        GMX_THROW(InvalidInputError("Invalid value: '" + value
-                                    + "'; expected an integer"));
-    }
-    addValue(ival);
+    converter->addConverter<std::string>(&fromStdString<gmx_int64_t>);
 }
 
 /********************************************************************
@@ -308,26 +268,19 @@ std::string DoubleOptionStorage::typeString() const
 
 std::string DoubleOptionStorage::formatSingleValue(const double &value) const
 {
-    return formatString("%g", value / factor_);
+    return toString(value / factor_);
 }
 
-void DoubleOptionStorage::convertValue(const std::string &value)
+void DoubleOptionStorage::initConverter(ConverterType *converter)
 {
-    const char *ptr = value.c_str();
-    char       *endptr;
-    errno = 0;
-    double      dval = std::strtod(ptr, &endptr);
-    if (errno == ERANGE)
-    {
-        GMX_THROW(InvalidInputError("Invalid value: '" + value
-                                    + "'; it causes an overflow/underflow"));
-    }
-    if (*ptr == '\0' || *endptr != '\0')
-    {
-        GMX_THROW(InvalidInputError("Invalid value: '" + value
-                                    + "'; expected a number"));
-    }
-    addValue(dval * factor_);
+    converter->addConverter<std::string>(&fromStdString<double>);
+    converter->addCastConversion<float>();
+}
+
+double DoubleOptionStorage::processValue(const double &value) const
+{
+    // TODO: Consider testing for overflow when scaling with factor_.
+    return value * factor_;
 }
 
 void DoubleOptionStorage::processSetValues(ValueList *values)
@@ -343,13 +296,11 @@ void DoubleOptionStorage::setScaleFactor(double factor)
     GMX_RELEASE_ASSERT(factor > 0.0, "Invalid scaling factor");
     if (!hasFlag(efOption_HasDefaultValue))
     {
-        double              scale = factor / factor_;
-        ValueList::iterator i;
-        for (i = values().begin(); i != values().end(); ++i)
+        double scale = factor / factor_;
+        for (double &value : values())
         {
-            (*i) *= scale;
+            value *= scale;
         }
-        refreshValues();
     }
     factor_ = factor;
 }
@@ -410,28 +361,19 @@ std::string FloatOptionStorage::typeString() const
 
 std::string FloatOptionStorage::formatSingleValue(const float &value) const
 {
-    return formatString("%g", value / factor_);
+    return toString(value / factor_);
 }
 
-void FloatOptionStorage::convertValue(const std::string &value)
+void FloatOptionStorage::initConverter(ConverterType *converter)
 {
-    const char *ptr = value.c_str();
-    char       *endptr;
-    errno = 0;
-    double      dval = std::strtod(ptr, &endptr);
-    if (errno == ERANGE
-        || dval * factor_ < -std::numeric_limits<float>::max()
-        || dval * factor_ >  std::numeric_limits<float>::max())
-    {
-        GMX_THROW(InvalidInputError("Invalid value: '" + value
-                                    + "'; it causes an overflow/underflow"));
-    }
-    if (*ptr == '\0' || *endptr != '\0')
-    {
-        GMX_THROW(InvalidInputError("Invalid value: '" + value
-                                    + "'; expected a number"));
-    }
-    addValue(dval * factor_);
+    converter->addConverter<std::string>(&fromStdString<float>);
+    converter->addCastConversion<double>();
+}
+
+float FloatOptionStorage::processValue(const float &value) const
+{
+    // TODO: Consider testing for overflow when scaling with factor_.
+    return value * factor_;
 }
 
 void FloatOptionStorage::processSetValues(ValueList *values)
@@ -447,13 +389,11 @@ void FloatOptionStorage::setScaleFactor(double factor)
     GMX_RELEASE_ASSERT(factor > 0.0, "Invalid scaling factor");
     if (!hasFlag(efOption_HasDefaultValue))
     {
-        double              scale = factor / factor_;
-        ValueList::iterator i;
-        for (i = values().begin(); i != values().end(); ++i)
+        float scale = factor / factor_;
+        for (float &value : values())
         {
-            (*i) *= scale;
+            value *= scale;
         }
-        refreshValues();
     }
     factor_ = factor;
 }
@@ -505,28 +445,28 @@ FloatOption::createStorage(const OptionManagerContainer & /*managers*/) const
 StringOptionStorage::StringOptionStorage(const StringOption &settings)
     : MyBase(settings), info_(this)
 {
-    if (settings.defaultEnumIndex_ >= 0 && settings.enumValues_ == NULL)
+    if (settings.defaultEnumIndex_ >= 0 && settings.enumValues_ == nullptr)
     {
         GMX_THROW(APIError("Cannot set default enum index without enum values"));
     }
-    if (settings.enumValues_ != NULL)
+    if (settings.enumValues_ != nullptr)
     {
         int count = settings.enumValuesCount_;
         if (count < 0)
         {
             count = 0;
-            while (settings.enumValues_[count] != NULL)
+            while (settings.enumValues_[count] != nullptr)
             {
                 ++count;
             }
         }
         for (int i = 0; i < count; ++i)
         {
-            if (settings.enumValues_[i] == NULL)
+            if (settings.enumValues_[i] == nullptr)
             {
                 GMX_THROW(APIError("Enumeration value cannot be NULL"));
             }
-            allowed_.push_back(settings.enumValues_[i]);
+            allowed_.emplace_back(settings.enumValues_[i]);
         }
         if (settings.defaultEnumIndex_ >= 0)
         {
@@ -535,13 +475,11 @@ StringOptionStorage::StringOptionStorage(const StringOption &settings)
                 GMX_THROW(APIError("Default enumeration index is out of range"));
             }
             const std::string *defaultValue = settings.defaultValue();
-            if (defaultValue != NULL && *defaultValue != allowed_[settings.defaultEnumIndex_])
+            if (defaultValue != nullptr && *defaultValue != allowed_[settings.defaultEnumIndex_])
             {
                 GMX_THROW(APIError("Conflicting default values"));
             }
-            clear();
-            addValue(allowed_[settings.defaultEnumIndex_]);
-            commitValues();
+            setDefaultValue(allowed_[settings.defaultEnumIndex_]);
         }
     }
 }
@@ -562,17 +500,17 @@ std::string StringOptionStorage::formatSingleValue(const std::string &value) con
     return value;
 }
 
-void StringOptionStorage::convertValue(const std::string &value)
+void StringOptionStorage::initConverter(ConverterType * /*converter*/)
 {
-    if (allowed_.size() == 0)
-    {
-        addValue(value);
-    }
-    else
+}
+
+std::string StringOptionStorage::processValue(const std::string &value) const
+{
+    if (allowed_.size() > 0)
     {
-        ValueList::const_iterator match = findEnumValue(allowed_, value);
-        addValue(*match);
+        return *findEnumValue(this->allowed_, value);
     }
+    return value;
 }
 
 /********************************************************************
@@ -617,10 +555,10 @@ StringOption::createStorage(const OptionManagerContainer & /*managers*/) const
 EnumOptionStorage::EnumOptionStorage(const AbstractOption &settings,
                                      const char *const *enumValues, int count,
                                      int defaultValue, int defaultValueIfSet,
-                                     EnumIndexStorePointer store)
-    : MyBase(settings), info_(this), store_(move(store))
+                                     StorePointer store)
+    : MyBase(settings, std::move(store)), info_(this)
 {
-    if (enumValues == NULL)
+    if (enumValues == nullptr)
     {
         GMX_THROW(APIError("Allowed values must be provided to EnumOption"));
     }
@@ -628,18 +566,18 @@ EnumOptionStorage::EnumOptionStorage(const AbstractOption &settings,
     if (count < 0)
     {
         count = 0;
-        while (enumValues[count] != NULL)
+        while (enumValues[count] != nullptr)
         {
             ++count;
         }
     }
     for (int i = 0; i < count; ++i)
     {
-        if (enumValues[i] == NULL)
+        if (enumValues[i] == nullptr)
         {
             GMX_THROW(APIError("Enumeration value cannot be NULL"));
         }
-        allowed_.push_back(enumValues[i]);
+        allowed_.emplace_back(enumValues[i]);
     }
 
     GMX_ASSERT(defaultValue < count, "Default enumeration value is out of range");
@@ -653,12 +591,6 @@ EnumOptionStorage::EnumOptionStorage(const AbstractOption &settings,
     {
         setDefaultValueIfSet(defaultValueIfSet);
     }
-
-    if (values().empty())
-    {
-        values() = store_->initialValues();
-    }
-    refreshEnumIndexStore();
 }
 
 std::string EnumOptionStorage::formatExtraDescription() const
@@ -678,28 +610,18 @@ std::string EnumOptionStorage::formatSingleValue(const int &value) const
     return allowed_[value];
 }
 
-void EnumOptionStorage::convertValue(const std::string &value)
-{
-    std::vector<std::string>::const_iterator match = findEnumValue(allowed_, value);
-    addValue(match - allowed_.begin());
-}
-
-void EnumOptionStorage::processSetValues(ValueList *values)
+Variant EnumOptionStorage::normalizeValue(const int &value) const
 {
-    const size_t newSize = (hasFlag(efOption_ClearOnNextSet) ? 0 : valueCount())
-        + std::max<size_t>(values->size(), 1);
-    store_->reserveSpace(newSize);
+    return Variant::create<std::string>(formatSingleValue(value));
 }
 
-void EnumOptionStorage::refreshValues()
+void EnumOptionStorage::initConverter(ConverterType *converter)
 {
-    MyBase::refreshValues();
-    refreshEnumIndexStore();
-}
-
-void EnumOptionStorage::refreshEnumIndexStore()
-{
-    store_->refreshValues(values());
+    converter->addConverter<std::string>(
+            [this] (const std::string &value)
+            {
+                return findEnumValue(this->allowed_, value) - this->allowed_.begin();
+            });
 }
 
 /********************************************************************
@@ -728,18 +650,14 @@ const std::vector<std::string> &EnumOptionInfo::allowedValues() const
 namespace internal
 {
 
-EnumIndexStoreInterface::~EnumIndexStoreInterface()
-{
-}
-
 //! \cond internal
 AbstractOptionStorage *
 createEnumOptionStorage(const AbstractOption &option,
                         const char *const *enumValues, int count,
                         int defaultValue, int defaultValueIfSet,
-                        EnumIndexStoreInterface *store)
+                        IOptionValueStore<int> *store)
 {
-    EnumOptionStorage::EnumIndexStorePointer storePtr(store);
+    std::unique_ptr<IOptionValueStore<int> > storePtr(store);
     return new EnumOptionStorage(option, enumValues, count, defaultValue,
                                  defaultValueIfSet, move(storePtr));
 }
index 257cf5100eb14f55ecbaa36c6fa888826001378c..9b96025ad3835d995fcac913d303f883fc599ab2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -50,6 +50,8 @@
 #include <vector>
 
 #include "gromacs/options/abstractoption.h"
+#include "gromacs/options/ivaluestore.h"
+#include "gromacs/utility/arrayref.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/gmxassert.h"
 
@@ -296,7 +298,7 @@ class StringOption : public OptionTemplate<std::string, StringOption>
 
         //! Initializes an option with the given name.
         explicit StringOption(const char *name)
-            : MyBase(name), enumValues_(NULL), enumValuesCount_(0),
+            : MyBase(name), enumValues_(nullptr), enumValuesCount_(0),
               defaultEnumIndex_(-1)
         {
         }
@@ -376,97 +378,72 @@ namespace internal
 
 /*! \internal
  * \brief
- * Interface for handling storage of the enum indexes.
- *
- * This interface acts as a proxy between the EnumOptionStorage class (that
- * operates on `int` values), and the actual enum variable that receives the
- * values.  The implementation of this interface takes care of conversion of
- * the values and writing them out into the actual enum variables.
- *
- * \ingroup module_options
- */
-class EnumIndexStoreInterface
-{
-    public:
-        virtual ~EnumIndexStoreInterface();
-
-        //! Returns initial values from the actual enum variables.
-        virtual std::vector<int> initialValues() const = 0;
-        //! Reserves space for storage in the actual enum variables.
-        virtual void reserveSpace(size_t count) = 0;
-        //! Updates values in the actual enum variables based on option values.
-        virtual void refreshValues(const std::vector<int> &values) = 0;
-};
-
-/*! \internal
- * \brief
- * Type-specific implementation for EnumIndexStoreInterface.
+ * Type-specific implementation for IOptionValueStore for an enum option.
  *
  * This class is instantiated for each enum type for which EnumOption is used,
- * and takes care of managing the `int`-to-`enum` conversions as described in
- * EnumIndexStoreInterface.  Having this as a template in the header allows the
- * actual storage implementation to not be in the header, which would require
- * exposing all the internals through this one header...
+ * and takes care of managing `int`-to-`enum` conversions.  Having this part in
+ * the header allows the actual storage implementation to not be in the header,
+ * which would require exposing all the internals through this one header...
  *
  * \ingroup module_options
  */
 template <typename EnumType>
-class EnumIndexStore : public EnumIndexStoreInterface
+class EnumIndexStore : public IOptionValueStore<int>
 {
     public:
         //! Initializes the storage for the given actual enum variables.
         EnumIndexStore(EnumType *store, std::vector<EnumType> *storeVector)
             : store_(store), storeVector_(storeVector)
         {
-        }
-
-        virtual std::vector<int> initialValues() const
-        {
-            std::vector<int> result;
-            if (storeVector_ != NULL)
+            if (storeVector_ != nullptr)
             {
-                typename std::vector<EnumType>::const_iterator i;
-                for (i = storeVector_->begin(); i != storeVector_->end(); ++i)
+                for (EnumType value : *storeVector_)
                 {
-                    result.push_back(*i);
+                    intStore_.push_back(static_cast<int>(value));
                 }
             }
-            else if (store_ != NULL)
+            else if (store_ != nullptr)
             {
                 // TODO: Copy more than one value if that would make sense.
-                result.push_back(store_[0]);
+                intStore_.push_back(static_cast<int>(store_[0]));
             }
-            return result;
         }
-        virtual void reserveSpace(size_t count)
+
+        virtual int valueCount() { return static_cast<int>(intStore_.size()); }
+        virtual ArrayRef<int> values() { return intStore_; }
+        virtual void clear()
         {
-            if (storeVector_ != NULL)
+            intStore_.clear();
+            if (storeVector_ != nullptr)
             {
-                storeVector_->reserve(count);
+                storeVector_->clear();
             }
         }
-        virtual void refreshValues(const std::vector<int> &values)
+        virtual void reserve(size_t count)
         {
-            if (store_ != NULL)
+            intStore_.reserve(intStore_.size() + count);
+            if (storeVector_ != nullptr)
             {
-                for (size_t i = 0; i < values.size(); ++i)
-                {
-                    store_[i] = static_cast<EnumType>(values[i]);
-                }
+                storeVector_->reserve(storeVector_->size() + count);
             }
-            if (storeVector_ != NULL)
+        }
+        virtual void append(const int &value)
+        {
+            const size_t count = intStore_.size();
+            intStore_.push_back(value);
+            if (store_ != nullptr)
             {
-                GMX_ASSERT(storeVector_->capacity() >= values.size(),
-                           "reserveSpace() should have been called earlier");
-                storeVector_->resize(values.size());
-                for (size_t i = 0; i < values.size(); ++i)
-                {
-                    (*storeVector_)[i] = static_cast<EnumType>(values[i]);
-                }
+                store_[count] = static_cast<EnumType>(value);
+            }
+            if (storeVector_ != nullptr)
+            {
+                storeVector_->push_back(static_cast<EnumType>(value));
             }
         }
 
     private:
+        //! Stores the integer values for values().
+        std::vector<int>       intStore_;
         EnumType              *store_;
         std::vector<EnumType> *storeVector_;
 };
@@ -486,7 +463,7 @@ AbstractOptionStorage *
 createEnumOptionStorage(const AbstractOption &option,
                         const char *const *enumValues, int count,
                         int defaultValue, int defaultValueIfSet,
-                        EnumIndexStoreInterface *store);
+                        IOptionValueStore<int> *store);
 //! \endcond
 
 }   // namespace internal
@@ -538,7 +515,7 @@ class EnumOption : public OptionTemplate<EnumType, EnumOption<EnumType> >
 
         //! Initializes an option with the given name.
         explicit EnumOption(const char *name)
-            : MyBase(name), enumValues_(NULL), enumValuesCount_(0)
+            : MyBase(name), enumValues_(nullptr), enumValuesCount_(0)
         {
         }
 
@@ -587,7 +564,7 @@ class EnumOption : public OptionTemplate<EnumType, EnumOption<EnumType> >
         //! Helper function to convert default values for storate initialization.
         static int convertToInt(const EnumType *defaultValue)
         {
-            return defaultValue != NULL ? static_cast<int>(*defaultValue) : -1;
+            return defaultValue != nullptr ? static_cast<int>(*defaultValue) : -1;
         }
 
         //! Creates a EnumOptionStorage object.
index a4aa6ead9f3c448bf6e9ac86f786dd171d4b5f21..f3e4be1fac4e236fa70e922801e41dafe95fad07 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -59,7 +59,7 @@ namespace gmx
 /*! \internal \brief
  * Converts, validates, and stores boolean values.
  */
-class BooleanOptionStorage : public OptionStorageTemplate<bool>
+class BooleanOptionStorage : public OptionStorageTemplateSimple<bool>
 {
     public:
         /*! \brief
@@ -80,7 +80,7 @@ class BooleanOptionStorage : public OptionStorageTemplate<bool>
         bool defaultValue() const { return valueCount() > 0 && values()[0]; }
 
     private:
-        virtual void convertValue(const std::string &value);
+        virtual void initConverter(ConverterType *converter);
 
         BooleanOptionInfo       info_;
 };
@@ -88,7 +88,7 @@ class BooleanOptionStorage : public OptionStorageTemplate<bool>
 /*! \internal \brief
  * Converts, validates, and stores integer values.
  */
-class IntegerOptionStorage : public OptionStorageTemplate<int>
+class IntegerOptionStorage : public OptionStorageTemplateSimple<int>
 {
     public:
         //! \copydoc BooleanOptionStorage::BooleanOptionStorage()
@@ -103,7 +103,7 @@ class IntegerOptionStorage : public OptionStorageTemplate<int>
         virtual std::string formatSingleValue(const int &value) const;
 
     private:
-        virtual void convertValue(const std::string &value);
+        virtual void initConverter(ConverterType *converter);
         virtual void processSetValues(ValueList *values);
 
         IntegerOptionInfo       info_;
@@ -112,7 +112,7 @@ class IntegerOptionStorage : public OptionStorageTemplate<int>
 /*! \internal \brief
  * Converts, validates, and stores integer values.
  */
-class Int64OptionStorage : public OptionStorageTemplate<gmx_int64_t>
+class Int64OptionStorage : public OptionStorageTemplateSimple<gmx_int64_t>
 {
     public:
         //! \copydoc BooleanOptionStorage::BooleanOptionStorage()
@@ -126,7 +126,7 @@ class Int64OptionStorage : public OptionStorageTemplate<gmx_int64_t>
         virtual std::string formatSingleValue(const gmx_int64_t &value) const;
 
     private:
-        virtual void convertValue(const std::string &value);
+        virtual void initConverter(ConverterType *converter);
 
         Int64OptionInfo       info_;
 };
@@ -134,7 +134,7 @@ class Int64OptionStorage : public OptionStorageTemplate<gmx_int64_t>
 /*! \internal \brief
  * Converts, validates, and stores floating-point (double) values.
  */
-class DoubleOptionStorage : public OptionStorageTemplate<double>
+class DoubleOptionStorage : public OptionStorageTemplateSimple<double>
 {
     public:
         //! \copydoc IntegerOptionStorage::IntegerOptionStorage()
@@ -150,7 +150,8 @@ class DoubleOptionStorage : public OptionStorageTemplate<double>
         void setScaleFactor(double factor);
 
     private:
-        virtual void convertValue(const std::string &value);
+        virtual void initConverter(ConverterType *converter);
+        virtual double processValue(const double &value) const;
         virtual void processSetValues(ValueList *values);
 
         DoubleOptionInfo        info_;
@@ -161,7 +162,7 @@ class DoubleOptionStorage : public OptionStorageTemplate<double>
 /*! \internal \brief
  * Converts, validates, and stores floating-point (float) values.
  */
-class FloatOptionStorage : public OptionStorageTemplate<float>
+class FloatOptionStorage : public OptionStorageTemplateSimple<float>
 {
     public:
         //! \copydoc IntegerOptionStorage::IntegerOptionStorage()
@@ -177,7 +178,8 @@ class FloatOptionStorage : public OptionStorageTemplate<float>
         void setScaleFactor(double factor);
 
     private:
-        virtual void convertValue(const std::string &value);
+        virtual void initConverter(ConverterType *converter);
+        virtual float processValue(const float &value) const;
         virtual void processSetValues(ValueList *values);
 
         FloatOptionInfo         info_;
@@ -188,7 +190,7 @@ class FloatOptionStorage : public OptionStorageTemplate<float>
 /*! \internal \brief
  * Converts, validates, and stores string values.
  */
-class StringOptionStorage : public OptionStorageTemplate<std::string>
+class StringOptionStorage : public OptionStorageTemplateSimple<std::string>
 {
     public:
         //! \copydoc DoubleOptionStorage::DoubleOptionStorage()
@@ -204,7 +206,8 @@ class StringOptionStorage : public OptionStorageTemplate<std::string>
         const ValueList &allowedValues() const { return allowed_; }
 
     private:
-        virtual void convertValue(const std::string &value);
+        virtual void initConverter(ConverterType *converter);
+        virtual std::string processValue(const std::string &value) const;
 
         StringOptionInfo        info_;
         ValueList               allowed_;
@@ -213,13 +216,9 @@ class StringOptionStorage : public OptionStorageTemplate<std::string>
 /*! \internal \brief
  * Converts, validates, and stores enum values.
  */
-class EnumOptionStorage : public OptionStorageTemplate<int>
+class EnumOptionStorage : public OptionStorageTemplateSimple<int>
 {
     public:
-        //! Shorthand for the enum index storage interface.
-        typedef std::unique_ptr<internal::EnumIndexStoreInterface>
-            EnumIndexStorePointer;
-
         /*! \brief
          * Initializes the storage from option settings.
          *
@@ -239,26 +238,22 @@ class EnumOptionStorage : public OptionStorageTemplate<int>
         EnumOptionStorage(const AbstractOption &settings,
                           const char *const *enumValues, int count,
                           int defaultValue, int defaultValueIfSet,
-                          EnumIndexStorePointer store);
+                          StorePointer store);
 
         virtual OptionInfo &optionInfo() { return info_; }
         virtual std::string typeString() const { return "enum"; }
         virtual std::string formatExtraDescription() const;
         virtual std::string formatSingleValue(const int &value) const;
+        virtual Variant normalizeValue(const int &value) const;
 
         //! \copydoc EnumOptionInfo::allowedValues()
         const std::vector<std::string> &allowedValues() const { return allowed_; }
 
     private:
-        virtual void convertValue(const std::string &value);
-        virtual void processSetValues(ValueList *values);
-        virtual void refreshValues();
-
-        void refreshEnumIndexStore();
+        virtual void initConverter(ConverterType *converter);
 
         EnumOptionInfo            info_;
         std::vector<std::string>  allowed_;
-        EnumIndexStorePointer     store_;
 };
 
 /*!\}*/
index b793a934b50dc862e7556c0a360efa34b5dd6d05..e1e431a88cf57e1349568184786af738dcb63d32 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,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.
@@ -141,7 +141,7 @@ class FileTypeHandler
 };
 
 FileTypeHandler::FileTypeHandler(int fileType)
-    : fileType_(fileType), extensionCount_(0), genericTypes_(NULL)
+    : fileType_(fileType), extensionCount_(0), genericTypes_(nullptr)
 {
     if (fileType_ >= 0)
     {
@@ -166,7 +166,7 @@ int FileTypeHandler::extensionCount() const
 const char *FileTypeHandler::extension(int i) const
 {
     GMX_ASSERT(i >= 0 && i < extensionCount_, "Invalid extension index");
-    if (genericTypes_ != NULL)
+    if (genericTypes_ != nullptr)
     {
         return ftp2ext_with_dot(genericTypes_[i]);
     }
@@ -176,7 +176,7 @@ const char *FileTypeHandler::extension(int i) const
 bool
 FileTypeHandler::isValidType(int fileType) const
 {
-    if (genericTypes_ != NULL)
+    if (genericTypes_ != nullptr)
     {
         for (int i = 0; i < extensionCount(); ++i)
         {
@@ -240,7 +240,7 @@ FileNameOptionStorage::FileNameOptionStorage(const FileNameOption  &settings,
     {
         defaultExtension_ = typeHandler.extension(0);
     }
-    if (settings.defaultBasename_ != NULL)
+    if (settings.defaultBasename_ != nullptr)
     {
         std::string defaultValue(settings.defaultBasename_);
         int         type = fn2ftp(settings.defaultBasename_);
@@ -313,9 +313,13 @@ std::string FileNameOptionStorage::formatSingleValue(const std::string &value) c
     return value;
 }
 
-void FileNameOptionStorage::convertValue(const std::string &value)
+void FileNameOptionStorage::initConverter(ConverterType * /*converter*/)
 {
-    if (manager_ != NULL)
+}
+
+std::string FileNameOptionStorage::processValue(const std::string &value) const
+{
+    if (manager_ != nullptr)
     {
         std::string processedValue = manager_->completeFileName(value, info_);
         if (!processedValue.empty())
@@ -340,8 +344,7 @@ void FileNameOptionStorage::convertValue(const std::string &value)
                                "Manager returned an invalid file name");
                 }
             }
-            addValue(processedValue);
-            return;
+            return processedValue;
         }
     }
     // Currently, directory options are simple, and don't need any
@@ -349,8 +352,7 @@ void FileNameOptionStorage::convertValue(const std::string &value)
     // TODO: Consider splitting them into a separate DirectoryOption.
     if (isDirectoryOption())
     {
-        addValue(value);
-        return;
+        return value;
     }
     const int fileType = fn2ftp(value.c_str());
     if (fileType == efNR)
@@ -370,14 +372,14 @@ void FileNameOptionStorage::convertValue(const std::string &value)
                            value.c_str(), joinStrings(extensions(), ", ").c_str());
         GMX_THROW(InvalidInputError(message));
     }
-    addValue(value);
+    return value;
 }
 
 void FileNameOptionStorage::processAll()
 {
-    if (manager_ != NULL && hasFlag(efOption_HasDefaultValue))
+    if (manager_ != nullptr && hasFlag(efOption_HasDefaultValue))
     {
-        ValueList &valueList = values();
+        ArrayRef<std::string> valueList = values();
         GMX_RELEASE_ASSERT(valueList.size() == 1,
                            "There should be only one default value");
         if (!valueList[0].empty())
@@ -394,7 +396,6 @@ void FileNameOptionStorage::processAll()
                 GMX_ASSERT(isValidType(fn2ftp(newValue.c_str())),
                            "Manager returned an invalid default value");
                 valueList[0] = newValue;
-                refreshValues();
             }
         }
     }
index 478147ef97a9b11a4d1c5f9581b627efe6662e7a..b0a60ae54768f78e9f6dbd8e46a0b6fe01b3814a 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,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.
@@ -74,7 +74,7 @@ class FileNameOption : public OptionTemplate<std::string, FileNameOption>
         //! Initializes an option with the given name.
         explicit FileNameOption(const char *name)
             : MyBase(name), optionType_(eftUnknown), legacyType_(-1),
-              defaultBasename_(NULL), defaultType_(-1),
+              defaultBasename_(nullptr), defaultType_(-1),
               bLegacyOptionalBehavior_(false),
               bRead_(false), bWrite_(false), bLibrary_(false),
               bAllowMissing_(false)
index 8e799687dd4e2de2157a5032fa8af7c7f96c6016..97fda90324b99ce8d9adb8780d0acf496fa3cba9 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,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.
@@ -58,7 +58,7 @@ class FileNameOptionManager;
 /*! \internal \brief
  * Converts, validates, and stores file names.
  */
-class FileNameOptionStorage : public OptionStorageTemplate<std::string>
+class FileNameOptionStorage : public OptionStorageTemplateSimple<std::string>
 {
     public:
         /*! \brief
@@ -100,7 +100,8 @@ class FileNameOptionStorage : public OptionStorageTemplate<std::string>
         ConstArrayRef<int> fileTypes() const;
 
     private:
-        virtual void convertValue(const std::string &value);
+        virtual void initConverter(ConverterType *converter);
+        virtual std::string processValue(const std::string &value) const;
         virtual void processAll();
 
         FileNameOptionInfo      info_;
index 0cc29291c91d5ce5c99ce881e535272e2d6d8400..3cdaafc0210a4253255816dcf63301ff4401be8a 100644 (file)
@@ -92,18 +92,6 @@ class IOptionsContainer
          * output.
          */
         virtual IOptionsContainer &addGroup() = 0;
-        /*! \brief
-         * Adds a recognized option.
-         *
-         * \param[in] settings Option description.
-         * \returns   OptionInfo object for the created option (never NULL).
-         * \throws    APIError if invalid option settings are provided.
-         *
-         * This method provides the internal implementation, but in most cases
-         * the templated method is called from user code.
-         * See the templated method for more details.
-         */
-        virtual OptionInfo *addOption(const AbstractOption &settings) = 0;
         /*! \brief
          * Adds a recognized option.
          *
@@ -130,7 +118,7 @@ class IOptionsContainer
         typename OptionType::InfoType *addOption(const OptionType &settings)
         {
             OptionInfo *info
-                = addOption(static_cast<const AbstractOption &>(settings));
+                = addOptionImpl(static_cast<const AbstractOption &>(settings));
             GMX_ASSERT(info->isType<typename OptionType::InfoType>(),
                        "Mismatching option info type declaration and implementation");
             return info->toType<typename OptionType::InfoType>();
@@ -141,6 +129,19 @@ class IOptionsContainer
         // (no need for the virtual, but some compilers warn otherwise)
         virtual ~IOptionsContainer();
 
+        /*! \brief
+         * Adds a recognized option.
+         *
+         * \param[in] settings Option description.
+         * \returns   OptionInfo object for the created option (never NULL).
+         * \throws    APIError if invalid option settings are provided.
+         *
+         * This method provides the internal implementation, but the templated
+         * method is called from user code.  See the templated method for more
+         * details.
+         */
+        virtual OptionInfo *addOptionImpl(const AbstractOption &settings) = 0;
+
         GMX_DEFAULT_CONSTRUCTORS(IOptionsContainer);
 };
 
diff --git a/src/gromacs/options/ioptionscontainerwithsections.h b/src/gromacs/options/ioptionscontainerwithsections.h
new file mode 100644 (file)
index 0000000..198e0ca
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \file
+ * \brief
+ * Declares gmx::IOptionsContainerWithSections.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inpublicapi
+ * \ingroup module_options
+ */
+#ifndef GMX_OPTIONS_IOPTIONSCONTAINERWITHSECTIONS_H
+#define GMX_OPTIONS_IOPTIONSCONTAINERWITHSECTIONS_H
+
+#include "gromacs/options/ioptionscontainer.h"
+
+namespace gmx
+{
+
+class AbstractOptionSection;
+class AbstractOptionSectionHandle;
+
+namespace internal
+{
+class OptionSectionImpl;
+}
+
+/*! \brief
+ * Interface for adding input options with sections.
+ *
+ * This interface extends IOptionsContainer with an additional addSection()
+ * method that supports creating a hierarchy of sections for the options.
+ *
+ * Header optionsection.h provides OptionSection.
+ *
+ * \inpublicapi
+ * \ingroup module_options
+ */
+class IOptionsContainerWithSections : public IOptionsContainer
+{
+    public:
+        /*! \brief
+         * Adds a section to this collection.
+         *
+         * \tparam    SectionType Type of the section description object.
+         * \param[in] section     Section description.
+         * \returns   AbstractOptionSectionHandle object for the created option.
+         * \throws    APIError if invalid option settings are provided.
+         *
+         * Options can be added to the section through the returned handle.
+         *
+         * \internal
+         * \p SectionType::HandleType must specify a type that derives from
+         * AbstractinOptionSectionHandle and has a suitable constructor.
+         */
+        template <class SectionType>
+        typename SectionType::HandleType addSection(const SectionType &section)
+        {
+            internal::OptionSectionImpl *storage
+                = addSectionImpl(static_cast<const AbstractOptionSection &>(section));
+            return typename SectionType::HandleType(storage);
+        }
+
+    protected:
+        // Disallow deletion through the interface.
+        // (no need for the virtual, but some compilers warn otherwise)
+        virtual ~IOptionsContainerWithSections();
+
+        /*! \brief
+         * Adds a section to this container.
+         *
+         * \param[in] section     Section description.
+         * \returns   Pointer to the internal section representation object.
+         */
+        virtual internal::OptionSectionImpl *
+        addSectionImpl(const AbstractOptionSection &section) = 0;
+
+        GMX_DEFAULT_CONSTRUCTORS(IOptionsContainerWithSections);
+};
+
+} // namespace
+
+#endif
diff --git a/src/gromacs/options/isectionstorage.h b/src/gromacs/options/isectionstorage.h
new file mode 100644 (file)
index 0000000..f2a8073
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \file
+ * \brief
+ * Declares gmx::IOptionSectionStorage.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_options
+ */
+#ifndef GMX_OPTIONS_ISECTIONSTORAGE_H
+#define GMX_OPTIONS_ISECTIONSTORAGE_H
+
+namespace gmx
+{
+
+/*! \internal
+ * \brief
+ * Provides behavior specific to a certain option section type.
+ *
+ * \ingroup module_options
+ */
+class IOptionSectionStorage
+{
+    public:
+        virtual ~IOptionSectionStorage();
+
+        /*! \brief
+         * Called once before the first call to startSection().
+         *
+         * This is called once all options have been added to the section.
+         * The current implementation does not call this if startSection() is
+         * never called.
+         */
+        virtual void initStorage() = 0;
+        /*! \brief
+         * Called when option assignment enters this section.
+         */
+        virtual void startSection()  = 0;
+        /*! \brief
+         * Called when option assignment leaves this section.
+         */
+        virtual void finishSection() = 0;
+};
+
+} // namespace gmx
+
+#endif
diff --git a/src/gromacs/options/ivaluestore.h b/src/gromacs/options/ivaluestore.h
new file mode 100644 (file)
index 0000000..3476529
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \file
+ * \brief
+ * Declares gmx::IOptionValueStore.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_options
+ */
+#ifndef GMX_OPTIONS_IVALUESTORE_H
+#define GMX_OPTIONS_IVALUESTORE_H
+
+namespace gmx
+{
+
+template <typename T> class ArrayRef;
+
+/*! \internal
+ * \brief
+ * Represents the final storage location of option values.
+ *
+ * \todo
+ * Try to make this more like a write-only interface, getting rid of the need
+ * to access the stored values through this interface.  That would simplify
+ * things.
+ *
+ * \ingroup module_options
+ */
+template <typename T>
+class IOptionValueStore
+{
+    public:
+        virtual ~IOptionValueStore() {}
+
+        //! Returns the number of values stored so far.
+        virtual int valueCount() = 0;
+        //! Returns a reference to the actual values.
+        virtual ArrayRef<T> values() = 0;
+        //! Removes all stored values.
+        virtual void clear() = 0;
+        //! Reserves memory for additional `count` entries.
+        virtual void reserve(size_t count) = 0;
+        //! Appends a value to the store.
+        virtual void append(const T &value) = 0;
+};
+
+} // namespace gmx
+
+#endif
index cfecedaa58ab36e4b271e68e3001cf75617b90eb..b700f481f11f3e56db7c1a987430e7b7e58910c0 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,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.
@@ -96,13 +96,13 @@ class OptionManagerContainer
         template <class ManagerType>
         ManagerType *get() const
         {
-            ManagerType *result = NULL;
+            ManagerType *result = nullptr;
             for (ListType::const_iterator i = list_.begin(); i != list_.end(); ++i)
             {
                 ManagerType *curr = dynamic_cast<ManagerType *>(*i);
-                if (curr != NULL)
+                if (curr != nullptr)
                 {
-                    GMX_RELEASE_ASSERT(result == NULL,
+                    GMX_RELEASE_ASSERT(result == nullptr,
                                        "More than one applicable option manager is set");
                     result = curr;
                 }
index e17a77617a77ddc015e2d07e7d54a8e6ca8287c6..d06ffb48d30a29c84e942f863a9a96f640cf7595 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,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.
 #include <vector>
 
 #include "gromacs/options/abstractoption.h"
+#include "gromacs/options/abstractoptionstorage.h"
+#include "gromacs/options/ioptionscontainer.h"
+#include "gromacs/options/ioptionscontainerwithsections.h"
+#include "gromacs/options/isectionstorage.h"
 #include "gromacs/options/optionmanagercontainer.h"
 #include "gromacs/options/options.h"
+#include "gromacs/options/optionsection.h"
 
 namespace gmx
 {
 
-class AbstractOptionStorage;
-
 namespace internal
 {
 
 /*! \internal
  * \brief
- * Private implementation class for Options.
+ * Internal implementation class for storing an option section.
  *
- * Note that in addition to Options, the OptionsAssigner and OptionsIterator
- * classes also directly access this class.
+ * All options are stored within a section: the top-level contents of an
+ * Options object are handled within an unnamed, "root" section.
+ * This class handles the common functionality for all sections, related to
+ * storing the options and subsections.  Functionality specific to a section
+ * type is provided by IOptionSectionStorage.
  *
  * \ingroup module_options
  */
-class OptionsImpl
+class OptionSectionImpl : public IOptionsContainerWithSections
 {
     public:
         /*! \internal \brief
@@ -86,35 +92,55 @@ class OptionsImpl
                 typedef std::list<Group> SubgroupList;
 
                 //! Creates a group within the given Options.
-                explicit Group(OptionsImpl *parent) : parent_(parent) {}
+                explicit Group(OptionSectionImpl *parent) : parent_(parent) {}
 
                 // From IOptionsContainer
                 virtual IOptionsContainer &addGroup();
-                virtual OptionInfo *addOption(const AbstractOption &settings);
+                virtual OptionInfo *addOptionImpl(const AbstractOption &settings);
 
                 //! Containing options object.
-                OptionsImpl  *parent_;
+                OptionSectionImpl  *parent_;
                 /*! \brief
                  * List of options, in insertion order.
                  *
                  * Pointers in this container point to the objects managed by
                  * Impl::optionsMap_.
                  */
-                OptionList    options_;
+                OptionList          options_;
                 //! List of groups, in insertion order.
-                SubgroupList  subgroups_;
+                SubgroupList        subgroups_;
         };
 
         //! Smart pointer for managing an AbstractOptionStorage object.
         typedef std::unique_ptr<AbstractOptionStorage>
             AbstractOptionStoragePointer;
-        //! Convenience type for list of sections.
-        typedef std::vector<Options *> SubSectionList;
         //! Convenience typedef for a map that contains all the options.
         typedef std::map<std::string, AbstractOptionStoragePointer> OptionMap;
+        //! Smart pointer for managing subsections.
+        typedef std::unique_ptr<OptionSectionImpl> SectionPointer;
+        //! Convenience typedef for a container for subsections.
+        typedef std::vector<SectionPointer> SectionList;
+
+        //! Creates storage for a new section.
+        OptionSectionImpl(const OptionManagerContainer          &managers,
+                          std::unique_ptr<IOptionSectionStorage> storage,
+                          const char                            *name)
+            : managers_(managers), storage_(std::move(storage)), info_(this),
+              name_(name), rootGroup_(this), storageInitialized_(false)
+        {
+        }
 
-        //! Sets the name and title.
-        OptionsImpl(const char *name, const char *title);
+        // From IOptionsContainerWithSections
+        virtual OptionSectionImpl *addSectionImpl(const AbstractOptionSection &section);
+
+        // From IOptionsContainer
+        virtual IOptionsContainer &addGroup();
+        virtual OptionInfo *addOptionImpl(const AbstractOption &settings);
+
+        //! Returns section info object for this section.
+        OptionSectionInfo       &info() { return info_; }
+        //! Returns section info object for this section.
+        const OptionSectionInfo &info() const { return info_; }
 
         /*! \brief
          * Finds a subsection by name.
@@ -124,7 +150,7 @@ class OptionsImpl
          *
          * Does not throw.
          */
-        Options *findSubSection(const char *name) const;
+        OptionSectionImpl *findSection(const char *name) const;
         /*! \brief
          * Finds an option by name.
          *
@@ -136,38 +162,58 @@ class OptionsImpl
         AbstractOptionStorage *findOption(const char *name) const;
 
         /*! \brief
-         * Calls AbstractOptionStorage::startSource() for all options,
-         * including subsections.
+         * Called when entering the section.
          *
-         * Does not throw.
+         * Calls AbstractOptionStorage::startSource() for all options.
          */
-        void startSource();
-
-        //! Name for the Options object.
-        std::string             name_;
+        void start();
         /*! \brief
-         * Option managers set for this collection.
-         *
-         * This is non-empty only for the top-level Options object.
+         * Calls AbstractOptionStorage::finish() for all options.
          */
-        OptionManagerContainer  managers_;
+        void finish();
+
+        //! Reference to the option managers in the parent Options object.
+        const OptionManagerContainer           &managers_;
+        //! Type-specific storage object for this section.
+        std::unique_ptr<IOptionSectionStorage>  storage_;
+        //! Info object for this section.
+        OptionSectionInfo                       info_;
+        //! Name of this section (empty and unused for the root section).
+        std::string                             name_;
         /*! \brief
          * Group that contains all options (and subgroups).
          *
          * This is used to store the insertion order of options.
          */
-        Group                   rootGroup_;
+        Group                          rootGroup_;
         //! Map from option names to options; owns the option storage objects.
-        OptionMap               optionMap_;
-        /*! \brief
-         * List of subsections, in insertion order.
-         *
-         * This container contains only references to external objects; memory
-         * management is performed elsewhere.
-         */
-        SubSectionList          subSections_;
-        //! Options object that contains this object as a subsection, or NULL.
-        Options                *parent_;
+        OptionMap                      optionMap_;
+        //! List of subsections, in insertion order.
+        SectionList                    subsections_;
+        //! Whether initStorage() has been called for `storage_`.
+        bool                           storageInitialized_;
+
+        GMX_DISALLOW_COPY_AND_ASSIGN(OptionSectionImpl);
+};
+
+/*! \internal
+ * \brief
+ * Private implementation class for Options.
+ *
+ * Note that in addition to Options, the OptionsAssigner class also directly
+ * accesses this class.
+ *
+ * \ingroup module_options
+ */
+class OptionsImpl
+{
+    public:
+        OptionsImpl();
+
+        //! Option managers set for this collection.
+        OptionManagerContainer  managers_;
+        //! Root section for this collection.
+        OptionSectionImpl       rootSection_;
 };
 
 } // namespace internal
index 2a6e5f2ba5e0bcacb7cb6e16cddd5adf4031821d..f063820c227809a126af59588c3aa738c2580bd3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,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.
@@ -47,6 +47,7 @@
 
 #include "gromacs/options/abstractoption.h"
 #include "gromacs/options/abstractoptionstorage.h"
+#include "gromacs/options/optionsection.h"
 #include "gromacs/utility/arrayref.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
@@ -73,6 +74,22 @@ IOptionsContainer::~IOptionsContainer()
 {
 }
 
+/********************************************************************
+ * IOptionsContainerWithSections
+ */
+
+IOptionsContainerWithSections::~IOptionsContainerWithSections()
+{
+}
+
+/********************************************************************
+ * IOptionSectionStorage
+ */
+
+IOptionSectionStorage::~IOptionSectionStorage()
+{
+}
+
 /********************************************************************
  * OptionsImpl
  */
@@ -80,76 +97,125 @@ IOptionsContainer::~IOptionsContainer()
 namespace internal
 {
 
-OptionsImpl::OptionsImpl(const char *name, const char * /*title*/)
-    : name_(name != NULL ? name : ""), rootGroup_(this),
-      parent_(NULL)
+OptionsImpl::OptionsImpl()
+    : rootSection_(managers_, nullptr, "")
+{
+}
+
+/********************************************************************
+ * OptionSectionImpl
+ */
+
+OptionSectionImpl *
+OptionSectionImpl::addSectionImpl(const AbstractOptionSection &section)
+{
+    const char *name = section.name_;
+    // Make sure that there are no duplicate sections.
+    GMX_RELEASE_ASSERT(findSection(name) == nullptr, "Duplicate subsection name");
+    std::unique_ptr<IOptionSectionStorage> storage(section.createStorage());
+    subsections_.push_back(SectionPointer(new OptionSectionImpl(managers_, std::move(storage), name)));
+    return subsections_.back().get();
+}
+
+IOptionsContainer &OptionSectionImpl::addGroup()
 {
+    return rootGroup_.addGroup();
 }
 
-Options *OptionsImpl::findSubSection(const char *name) const
+OptionInfo *OptionSectionImpl::addOptionImpl(const AbstractOption &settings)
 {
-    SubSectionList::const_iterator i;
-    for (i = subSections_.begin(); i != subSections_.end(); ++i)
+    return rootGroup_.addOptionImpl(settings);
+}
+
+OptionSectionImpl *OptionSectionImpl::findSection(const char *name) const
+{
+    for (const auto &section : subsections_)
     {
-        if ((*i)->name() == name)
+        if (section->name_ == name)
         {
-            return *i;
+            return section.get();
         }
     }
-    return NULL;
+    return nullptr;
 }
 
-AbstractOptionStorage *OptionsImpl::findOption(const char *name) const
+AbstractOptionStorage *OptionSectionImpl::findOption(const char *name) const
 {
     OptionMap::const_iterator i = optionMap_.find(name);
     if (i == optionMap_.end())
     {
-        return NULL;
+        return nullptr;
     }
     return i->second.get();
 }
 
-void OptionsImpl::startSource()
+void OptionSectionImpl::start()
 {
-    OptionMap::const_iterator i;
-    for (i = optionMap_.begin(); i != optionMap_.end(); ++i)
+    for (const auto &entry : optionMap_)
+    {
+        entry.second->startSource();
+    }
+    if (storage_ != nullptr)
+    {
+        if (!storageInitialized_)
+        {
+            storage_->initStorage();
+            storageInitialized_ = true;
+        }
+        storage_->startSection();
+    }
+}
+
+void OptionSectionImpl::finish()
+{
+    // TODO: Consider how to customize these error messages based on context.
+    ExceptionInitializer  errors("Invalid input values");
+    for (const auto &entry : optionMap_)
+    {
+        AbstractOptionStorage &option = *entry.second;
+        try
+        {
+            option.finish();
+        }
+        catch (UserInputError &ex)
+        {
+            ex.prependContext("In option " + option.name());
+            errors.addCurrentExceptionAsNested();
+        }
+    }
+    if (errors.hasNestedExceptions())
     {
-        AbstractOptionStorage &option = *i->second;
-        option.startSource();
+        // TODO: This exception type may not always be appropriate.
+        GMX_THROW(InvalidInputError(errors));
     }
-    SubSectionList::const_iterator j;
-    for (j = subSections_.begin(); j != subSections_.end(); ++j)
+    if (storage_ != nullptr)
     {
-        Options &section = **j;
-        section.impl_->startSource();
+        storage_->finishSection();
     }
 }
 
 /********************************************************************
- * OptionsImpl::Group
+ * OptionSectionImpl::Group
  */
 
-IOptionsContainer &OptionsImpl::Group::addGroup()
+IOptionsContainer &OptionSectionImpl::Group::addGroup()
 {
-    subgroups_.push_back(Group(parent_));
+    subgroups_.emplace_back(parent_);
     return subgroups_.back();
 }
 
-OptionInfo *OptionsImpl::Group::addOption(const AbstractOption &settings)
+OptionInfo *OptionSectionImpl::Group::addOptionImpl(const AbstractOption &settings)
 {
-    OptionsImpl *root = parent_;
-    while (root->parent_ != NULL)
-    {
-        root = root->parent_->impl_.get();
-    }
-    AbstractOptionStoragePointer         option(settings.createStorage(root->managers_));
+    OptionSectionImpl::AbstractOptionStoragePointer
+         option(settings.createStorage(parent_->managers_));
     options_.reserve(options_.size() + 1);
-    std::pair<OptionMap::iterator, bool> insertionResult =
+    auto insertionResult =
         parent_->optionMap_.insert(std::make_pair(option->name(),
                                                   std::move(option)));
     if (!insertionResult.second)
     {
-        GMX_THROW(APIError("Duplicate option: " + option->name()));
+        const std::string &name = insertionResult.first->second->name();
+        GMX_THROW(APIError("Duplicate option: " + name));
     }
     AbstractOptionStorage &insertedOption = *insertionResult.first->second;
     options_.push_back(&insertedOption);
@@ -164,8 +230,8 @@ using internal::OptionsImpl;
  * Options
  */
 
-Options::Options(const char *name, const char *title)
-    : impl_(new OptionsImpl(name, title))
+Options::Options()
+    : impl_(new OptionsImpl)
 {
 }
 
@@ -173,90 +239,47 @@ Options::~Options()
 {
 }
 
-const std::string &Options::name() const
-{
-    return impl_->name_;
-}
-
 
 void Options::addManager(IOptionManager *manager)
 {
-    GMX_RELEASE_ASSERT(impl_->parent_ == NULL,
-                       "Can only add a manager in a top-level Options object");
     // This ensures that all options see the same set of managers.
-    GMX_RELEASE_ASSERT(impl_->optionMap_.empty(),
+    GMX_RELEASE_ASSERT(impl_->rootSection_.optionMap_.empty(),
                        "Can only add a manager before options");
     // This check could be relaxed if we instead checked that the subsections
     // do not have options.
-    GMX_RELEASE_ASSERT(impl_->subSections_.empty(),
+    GMX_RELEASE_ASSERT(impl_->rootSection_.subsections_.empty(),
                        "Can only add a manager before subsections");
     impl_->managers_.add(manager);
 }
 
-void Options::addSubSection(Options *section)
+internal::OptionSectionImpl *Options::addSectionImpl(const AbstractOptionSection &section)
 {
-    // This is required, because managers are used from the root Options
-    // object, so they are only seen after the subsection has been added.
-    GMX_RELEASE_ASSERT(section->impl_->optionMap_.empty(),
-                       "Can only add a subsection before it has any options");
-    GMX_RELEASE_ASSERT(section->impl_->managers_.empty(),
-                       "Can only have managers in a top-level Options object");
-    // Make sure that section is not already inserted somewhere.
-    GMX_RELEASE_ASSERT(section->impl_->parent_ == NULL,
-                       "Cannot add as subsection twice");
-    // Make sure that there are no duplicate sections.
-    GMX_RELEASE_ASSERT(impl_->findSubSection(section->name().c_str()) == NULL,
-                       "Duplicate subsection name");
-    impl_->subSections_.push_back(section);
-    section->impl_->parent_ = this;
+    return impl_->rootSection_.addSectionImpl(section);
 }
 
 IOptionsContainer &Options::addGroup()
 {
-    return impl_->rootGroup_.addGroup();
+    return impl_->rootSection_.addGroup();
+}
+
+OptionInfo *Options::addOptionImpl(const AbstractOption &settings)
+{
+    return impl_->rootSection_.addOptionImpl(settings);
 }
 
-OptionInfo *Options::addOption(const AbstractOption &settings)
+OptionSectionInfo &Options::rootSection()
 {
-    return impl_->rootGroup_.addOption(settings);
+    return impl_->rootSection_.info();
+}
+
+const OptionSectionInfo &Options::rootSection() const
+{
+    return impl_->rootSection_.info();
 }
 
 void Options::finish()
 {
-    // TODO: Consider how to customize these error messages based on context.
-    ExceptionInitializer                    errors("Invalid input values");
-    OptionsImpl::OptionMap::const_iterator  i;
-    for (i = impl_->optionMap_.begin(); i != impl_->optionMap_.end(); ++i)
-    {
-        AbstractOptionStorage &option = *i->second;
-        try
-        {
-            option.finish();
-        }
-        catch (UserInputError &ex)
-        {
-            ex.prependContext("In option " + option.name());
-            errors.addCurrentExceptionAsNested();
-        }
-    }
-    OptionsImpl::SubSectionList::const_iterator j;
-    for (j = impl_->subSections_.begin(); j != impl_->subSections_.end(); ++j)
-    {
-        Options &section = **j;
-        try
-        {
-            section.finish();
-        }
-        catch (const UserInputError &)
-        {
-            errors.addCurrentExceptionAsNested();
-        }
-    }
-    if (errors.hasNestedExceptions())
-    {
-        // TODO: This exception type may not always be appropriate.
-        GMX_THROW(InvalidInputError(errors));
-    }
+    impl_->rootSection_.finish();
 }
 
 } // namespace gmx
index 944606db1ba7ab1bfd451b0b1d5c511ed5b8c307..a4ba843633ac1889012a00e235958f30b8167844 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2014,2015,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.
 
 #include <string>
 
-#include "gromacs/options/ioptionscontainer.h"
+#include "gromacs/options/ioptionscontainerwithsections.h"
 #include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
 
 class AbstractOption;
+class OptionSection;
+class OptionSectionInfo;
 class OptionsAssigner;
-class OptionsIterator;
 
 namespace internal
 {
@@ -88,7 +89,7 @@ class IOptionManager
  * Collection of options.
  *
  * See \ref module_options for an overview of how the options work.
- * The IOptionsContainer interface documents how to add options.
+ * The IOptionsContainerWithSections interface documents how to add options.
  *
  * In order to keep the public interface of this class simple, functionality
  * to assign values to options is provided by a separate OptionsAssigner class.
@@ -98,23 +99,13 @@ class IOptionManager
  * \inpublicapi
  * \ingroup module_options
  */
-class Options : public IOptionsContainer
+class Options : public IOptionsContainerWithSections
 {
     public:
-        /*! \brief
-         * Initializes the name and title of an option collection.
-         *
-         * \param[in] name  Single-word name.
-         * \param[in] title Descriptive title.
-         *
-         * Copies the input strings.
-         */
-        Options(const char *name, const char *title);
+        //! Initializes an empty options root container.
+        Options();
         ~Options();
 
-        //! Returns the short name of the option collection.
-        const std::string &name() const;
-
         /*! \brief
          * Adds an option manager.
          *
@@ -133,35 +124,17 @@ class Options : public IOptionsContainer
          * The Options object (and its contained options) only stores a
          * reference to the object.
          *
-         * This method cannot be called after adding options or subsections.
+         * This method cannot be called after adding options or sections.
          */
         void addManager(IOptionManager *manager);
 
-        /*! \brief
-         * Adds an option collection as a subsection of this collection.
-         *
-         * \param[in] section Subsection to add.
-         *
-         * The name() field of \p section is used as the name of the
-         * subsection.  If an attempt is made to add two different subsections
-         * with the same name, this function asserts.
-         *
-         * \p section should not have any options added at the point this
-         * method is called.
-         *
-         * Only a pointer to the provided object is stored.  The caller is
-         * responsible that the object exists for the lifetime of the
-         * collection.
-         * It is not possible to add the same Options object as a subsection to
-         * several different Options.
-         * If an attempt is made, the function asserts.
-         */
-        void addSubSection(Options *section);
-
         // From IOptionsContainer
         virtual IOptionsContainer &addGroup();
-        virtual OptionInfo *addOption(const AbstractOption &settings);
-        using IOptionsContainer::addOption;
+
+        //! Returns a handle to the root section.
+        OptionSectionInfo       &rootSection();
+        //! Returns a handle to the root section.
+        const OptionSectionInfo &rootSection() const;
 
         /*! \brief
          * Notifies the collection that all option values are assigned.
@@ -180,16 +153,16 @@ class Options : public IOptionsContainer
         void finish();
 
     private:
+        // From IOptionsContainerWithSections
+        virtual internal::OptionSectionImpl *
+        addSectionImpl(const AbstractOptionSection &section);
+        // From IOptionsContainer
+        virtual OptionInfo *addOptionImpl(const AbstractOption &settings);
+
         PrivateImplPointer<internal::OptionsImpl> impl_;
 
-        //! Needed for the implementation to access subsections.
-        friend class internal::OptionsImpl;
         //! Needed to be able to extend the interface of this object.
         friend class OptionsAssigner;
-        //! Needed to be able to extend the interface of this object.
-        friend class OptionsIterator;
-        //! Needed to be able to extend the interface of this object.
-        friend class OptionsModifyingIterator;
 };
 
 } // namespace gmx
index 2842655c54f438b38559d32d2989383ec69d1b39..45cd89a55596a72cb46921893c3053a1f648233d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -49,6 +49,7 @@
 #include "gromacs/options/options.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/variant.h"
 
 #include "options-impl.h"
 
@@ -67,13 +68,16 @@ namespace gmx
 class OptionsAssigner::Impl
 {
     public:
+        //! Shorthand for the internal type used to represent a section.
+        typedef internal::OptionSectionImpl Section;
+
         //! Sets the option object to assign to.
         explicit Impl(Options *options);
 
         //! Returns true if a subsection has been set.
-        bool inSubSection() const { return sectionStack_.size() > 1; }
+        bool inSection() const { return sectionStack_.size() > 1; }
         //! Returns the Options object for the current section.
-        Options &currentSection() const { return *sectionStack_.back(); }
+        Section &currentSection() const { return *sectionStack_.back(); }
         /*! \brief
          * Finds an option by the given name.
          *
@@ -95,7 +99,7 @@ class OptionsAssigner::Impl
          *
          * The first element always points to \a options_.
          */
-        std::vector<Options *>  sectionStack_;
+        std::vector<Section *>  sectionStack_;
         //! Current option being assigned to, or NULL if none.
         AbstractOptionStorage  *currentOption_;
         /*! \brief
@@ -111,30 +115,30 @@ class OptionsAssigner::Impl
 
 OptionsAssigner::Impl::Impl(Options *options)
     : options_(*options), bAcceptBooleanNoPrefix_(false),
-      currentOption_(NULL), currentValueCount_(0), reverseBoolean_(false)
+      currentOption_(nullptr), currentValueCount_(0), reverseBoolean_(false)
 {
-    sectionStack_.push_back(&options_);
+    sectionStack_.push_back(&options_.impl_->rootSection_);
 }
 
 AbstractOptionStorage *
 OptionsAssigner::Impl::findOption(const char *name)
 {
-    GMX_RELEASE_ASSERT(currentOption_ == NULL,
+    GMX_RELEASE_ASSERT(currentOption_ == nullptr,
                        "Cannot search for another option while processing one");
-    const Options         &section = currentSection();
-    AbstractOptionStorage *option  = section.impl_->findOption(name);
-    if (option == NULL && bAcceptBooleanNoPrefix_)
+    const Section         &section = currentSection();
+    AbstractOptionStorage *option  = section.findOption(name);
+    if (option == nullptr && bAcceptBooleanNoPrefix_)
     {
         if (name[0] == 'n' && name[1] == 'o')
         {
-            option = section.impl_->findOption(name + 2);
-            if (option != NULL && option->isBoolean())
+            option = section.findOption(name + 2);
+            if (option != nullptr && option->isBoolean())
             {
                 reverseBoolean_ = true;
             }
             else
             {
-                option = NULL;
+                option = nullptr;
             }
         }
     }
@@ -161,17 +165,18 @@ void OptionsAssigner::setAcceptBooleanNoPrefix(bool bEnabled)
 
 void OptionsAssigner::start()
 {
-    impl_->options_.impl_->startSource();
+    impl_->options_.impl_->rootSection_.start();
 }
 
-void OptionsAssigner::startSubSection(const char *name)
+void OptionsAssigner::startSection(const char *name)
 {
-    Options *section = impl_->currentSection().impl_->findSubSection(name);
-    if (section == NULL)
+    Impl::Section *section = impl_->currentSection().findSection(name);
+    if (section == nullptr)
     {
         GMX_THROW(InvalidInputError("Unknown subsection"));
     }
     impl_->sectionStack_.push_back(section);
+    section->start();
 }
 
 void OptionsAssigner::startOption(const char *name)
@@ -184,9 +189,9 @@ void OptionsAssigner::startOption(const char *name)
 
 bool OptionsAssigner::tryStartOption(const char *name)
 {
-    GMX_RELEASE_ASSERT(impl_->currentOption_ == NULL, "finishOption() not called");
+    GMX_RELEASE_ASSERT(impl_->currentOption_ == nullptr, "finishOption() not called");
     AbstractOptionStorage *option = impl_->findOption(name);
-    if (option == NULL)
+    if (option == nullptr)
     {
         return false;
     }
@@ -197,9 +202,14 @@ bool OptionsAssigner::tryStartOption(const char *name)
 }
 
 void OptionsAssigner::appendValue(const std::string &value)
+{
+    appendValue(Variant(value));
+}
+
+void OptionsAssigner::appendValue(const Variant &value)
 {
     AbstractOptionStorage *option = impl_->currentOption_;
-    GMX_RELEASE_ASSERT(option != NULL, "startOption() not called");
+    GMX_RELEASE_ASSERT(option != nullptr, "startOption() not called");
     ++impl_->currentValueCount_;
     option->appendValue(value);
 }
@@ -207,22 +217,21 @@ void OptionsAssigner::appendValue(const std::string &value)
 void OptionsAssigner::finishOption()
 {
     AbstractOptionStorage *option = impl_->currentOption_;
-    GMX_RELEASE_ASSERT(option != NULL, "startOption() not called");
+    GMX_RELEASE_ASSERT(option != nullptr, "startOption() not called");
     bool                   bBoolReverseValue = false;
     if (option->isBoolean())
     {
         if (impl_->currentValueCount_ == 0)
         {
             // Should not throw, otherwise something is wrong.
-            // TODO: Get rid of the hard-coded values.
-            option->appendValue(impl_->reverseBoolean_ ? "0" : "1");
+            option->appendValue(Variant::create<bool>(!impl_->reverseBoolean_));
         }
         else if (impl_->reverseBoolean_)
         {
             bBoolReverseValue = true;
         }
     }
-    impl_->currentOption_  = NULL;
+    impl_->currentOption_  = nullptr;
     impl_->reverseBoolean_ = false;
     option->finishSet();
     if (bBoolReverseValue)
@@ -231,17 +240,19 @@ void OptionsAssigner::finishOption()
     }
 }
 
-void OptionsAssigner::finishSubSection()
+void OptionsAssigner::finishSection()
 {
     // Should only be called if we are in a subsection.
-    GMX_RELEASE_ASSERT(impl_->inSubSection(), "startSubSection() not called");
+    GMX_RELEASE_ASSERT(impl_->inSection(), "startSection() not called");
+    Impl::Section *section = impl_->sectionStack_.back();
+    section->finish();
     impl_->sectionStack_.pop_back();
 }
 
 void OptionsAssigner::finish()
 {
-    GMX_RELEASE_ASSERT(impl_->currentOption_ == NULL, "finishOption() not called");
-    GMX_RELEASE_ASSERT(!impl_->inSubSection(), "finishSubSection() not called");
+    GMX_RELEASE_ASSERT(impl_->currentOption_ == nullptr, "finishOption() not called");
+    GMX_RELEASE_ASSERT(!impl_->inSection(), "finishSection() not called");
 }
 
 } // namespace gmx
index 35bb70dce9225e3e5b71146ef832a3df43086011..cdefa7258276df7cb263d018d996e6535bbfbaad 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,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.
@@ -53,6 +53,7 @@ namespace gmx
 {
 
 class Options;
+class Variant;
 
 /*! \libinternal \brief
  * Decorator class for assigning values to Options.
@@ -70,11 +71,11 @@ class Options;
    assigner.startOption("opt1");
    assigner.appendValue("3");
    assigner.finishOption();
-   assigner.startSubSection("section");
+   assigner.startSection("section");
    assigner.startOption("opt2"); // Now in the subsection
    assigner.appendValue("yes");
    assigner.finishOption();
-   assigner.finishSubSection()
+   assigner.finishSection()
    assigner.startOption("opt3"); // Again in the main options
    assigner.appendValue("2");
    assigner.finishOption();
@@ -124,7 +125,7 @@ class OptionsAssigner
          *
          * Strong exception safety guarantee.
          */
-        void startSubSection(const char *name);
+        void startSection(const char *name);
         /*! \brief
          * Starts assigning values for an option.
          *
@@ -145,7 +146,7 @@ class OptionsAssigner
         /*! \brief
          * Appends a value to the value list of the current option.
          *
-         * \param[in] value  String representation of the value to assign.
+         * \param[in] value  Value to assign.
          * \throws InvalidInputError if the value cannot be converted or if
          *      there are too many values for an option.
          *
@@ -166,6 +167,14 @@ class OptionsAssigner
          * OptionStorageTemplate::convertValue() method of the storage class
          * implementing the option where the value is assigned to.
          */
+        void appendValue(const Variant &value);
+        /*! \brief
+         * Appends a value to the value list of the current option.
+         *
+         * \param[in] value  Value to assign.
+         *
+         * See appendValue(const Variant &) for more details.
+         */
         void appendValue(const std::string &value);
         /*! \brief
          * Finish assigning values for the current option.
@@ -186,7 +195,7 @@ class OptionsAssigner
          *
          * Does not throw.
          */
-        void finishSubSection();
+        void finishSection();
         /*! \brief
          * Finish assigning options through the object.
          *
diff --git a/src/gromacs/options/optionsection.cpp b/src/gromacs/options/optionsection.cpp
new file mode 100644 (file)
index 0000000..5578d36
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+#include "gmxpre.h"
+
+#include "optionsection.h"
+
+#include "gromacs/options/isectionstorage.h"
+
+namespace gmx
+{
+
+namespace
+{
+
+class OptionSectionStorage : public IOptionSectionStorage
+{
+    public:
+        virtual void initStorage() {}
+        virtual void startSection() {}
+        virtual void finishSection() {}
+};
+
+}   // namespace
+
+IOptionSectionStorage *OptionSection::createStorage() const
+{
+    return new OptionSectionStorage();
+}
+
+} // namespace gmx
diff --git a/src/gromacs/options/optionsection.h b/src/gromacs/options/optionsection.h
new file mode 100644 (file)
index 0000000..b5f5479
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \file
+ * \brief
+ * Declares gmx::OptionSection and gmx::OptionSectionInfo.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inpublicapi
+ * \ingroup module_options
+ */
+#ifndef GMX_OPTIONS_OPTIONSECTION_H
+#define GMX_OPTIONS_OPTIONSECTION_H
+
+#include "gromacs/options/abstractsection.h"
+#include "gromacs/utility/classhelpers.h"
+
+namespace gmx
+{
+
+class OptionSectionHandle;
+
+/*! \brief
+ * Declares a simple option section.
+ *
+ * This class declares a simple section that only provides structure for
+ * grouping the options, but does not otherwise influence the behavior of the
+ * contained options.
+ *
+ * \inpublicapi
+ * \ingroup module_options
+ */
+class OptionSection : public AbstractOptionSection
+{
+    public:
+        //! AbstractOptionSectionHandle corresponding to this option type.
+        typedef OptionSectionHandle HandleType;
+
+        //! Creates a section with the given name.
+        explicit OptionSection(const char *name) : AbstractOptionSection(name) {}
+
+    private:
+        virtual IOptionSectionStorage *createStorage() const;
+};
+
+/*! \brief
+ * Allows adding options to an OptionSection.
+ *
+ * An instance of this class is returned from
+ * IOptionsContainerWithSections::addSection(), and supports adding options and
+ * subsections to a section created with OptionSection.
+ *
+ * \inpublicapi
+ * \ingroup module_options
+ */
+class OptionSectionHandle : public AbstractOptionSectionHandle
+{
+    public:
+        //! Wraps a given section storage object.
+        explicit OptionSectionHandle(internal::OptionSectionImpl *section)
+            : AbstractOptionSectionHandle(section)
+        {
+        }
+};
+
+class OptionSectionInfo : public AbstractOptionSectionInfo
+{
+    public:
+        //! Wraps a given section storage object.
+        explicit OptionSectionInfo(internal::OptionSectionImpl *section)
+            : AbstractOptionSectionInfo(section)
+        {
+        }
+};
+
+} // namespace gmx
+
+#endif
index 108841e9cfa9d81904331d6c51d68ae190b2a5b1..d2d9dac15ffbd2b143770456a15d2b81e47e3906 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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
 
 #include "gromacs/options/abstractoption.h"
 #include "gromacs/options/abstractoptionstorage.h"
+#include "gromacs/options/valuestore.h"
+#include "gromacs/utility/arrayref.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/variant.h"
+
+#include "valueconverter.h"
 
 namespace gmx
 {
@@ -63,15 +68,13 @@ class Options;
  *
  * \tparam T Assignable type that stores a single option value.
  *
- * Provides an implementation of the clearSet(), valueCount(), and processSet()
- * methods of AbstractOptionStorage, as well as a basic no-action
- * implementation of processAll().  Two new virtual methods are added:
- * processSetValues() and refreshValues().  The default implementation of
- * processSetValues() does nothing, and refreshValues() is used to update
- * secondary storage after values have been added/changed.
- * This leaves typeString(), formatValue(), and convertValue() to be
- * implemented in derived classes.  processSetValues() and processAll() can
- * also be implemented if necessary.
+ * Provides an implementation of the clearSet(), valueCount(), processSet(),
+ * and defaultValuesAsStrings() methods of AbstractOptionStorage, as well as a
+ * basic no-action implementation of processAll().  Two new virtual methods are
+ * added: processSetValues() and formatSingleValue().
+ * This leaves typeString(), convertValue() and formatStringValue() to be
+ * implemented in derived classes.
+ * processSetValues() and processAll() can also be implemented if necessary.
  *
  * Implements transaction support for adding values within a set: all calls to
  * addValue() add the value to a temporary storage, processSetValues() operates
@@ -91,25 +94,28 @@ class OptionStorageTemplate : public AbstractOptionStorage
         //! Type of the container that contains the current values.
         typedef std::vector<T> ValueList;
 
-        virtual ~OptionStorageTemplate();
-
         // No implementation in this class for the pure virtual methods, but
         // the declarations are still included for clarity.
         // The various copydoc calls are needed with Doxygen 1.8.10, although
         // things work without with 1.8.5...
         virtual std::string typeString() const = 0;
         //! \copydoc gmx::AbstractOptionStorage::valueCount()
-        virtual int valueCount() const { return static_cast<int>(values_->size()); }
-        /*! \copydoc gmx::AbstractOptionStorage::formatValue()
+        virtual int valueCount() const { return store_->valueCount(); }
+        //! \copydoc gmx::AbstractOptionStorage::defaultValues()
+        virtual std::vector<Variant> defaultValues() const;
+        /*! \copydoc gmx::AbstractOptionStorage::defaultValuesAsStrings()
          *
-         * OptionStorageTemplate implements handling of DefaultValueIfSetIndex
-         * in this method, as well as checking that \p i is a valid index.
+         * OptionStorageTemplate implements handling of defaultValueIfSet()
+         * cases and composing the vector.
          * Derived classes must implement formatSingleValue() to provide the
          * actual formatting for a value of type \p T.
          */
-        virtual std::string formatValue(int i) const;
+        virtual std::vector<std::string> defaultValuesAsStrings() const;
 
     protected:
+        //! Smart pointer for managing the final storage interface.
+        typedef std::unique_ptr<IOptionValueStore<T> > StorePointer;
+
         /*! \brief
          * Initializes the storage from option settings.
          *
@@ -125,12 +131,14 @@ class OptionStorageTemplate : public AbstractOptionStorage
          * Initializes the storage from base option settings.
          *
          * \param[in] settings  Option settings.
+         * \param[in] store     Final storage location.
          * \throws  APIError if invalid settings have been provided.
          *
          * This constructor works for cases where there is no matching
          * OptionTemplate (e.g., EnumOption).
          */
-        explicit OptionStorageTemplate(const AbstractOption &settings);
+        OptionStorageTemplate(const AbstractOption &settings,
+                              StorePointer          store);
 
         //! \copydoc gmx::AbstractOptionStorage::clearSet()
         virtual void clearSet();
@@ -143,7 +151,7 @@ class OptionStorageTemplate : public AbstractOptionStorage
          * should be considered whether the implementation can be made strongly
          * exception safe.
          */
-        virtual void convertValue(const std::string &value) = 0;
+        virtual void convertValue(const Variant &value) = 0;
         /*! \brief
          * Processes values for a set after all have been converted.
          *
@@ -184,16 +192,11 @@ class OptionStorageTemplate : public AbstractOptionStorage
          * \returns   \p value formatted as a string.
          *
          * The derived class must provide this method to format values a
-         * strings.  Called by formatValue() to do the actual formatting.
+         * strings.  Called by defaultValuesAsStrings() to do the actual
+         * formatting.
          */
         virtual std::string formatSingleValue(const T &value) const = 0;
 
-        /*! \brief
-         * Removes all values from the storage.
-         *
-         * Does not throw.
-         */
-        void clear() { values_->clear(); }
         /*! \brief
          * Adds a value to a temporary storage.
          *
@@ -226,24 +229,9 @@ class OptionStorageTemplate : public AbstractOptionStorage
          * See addValue() for cases where this method should be used in derived
          * classes.
          *
-         * Calls refreshValues() and clearSet() if it is successful.
+         * Calls clearSet() if it is successful.
          */
         void commitValues();
-        /*! \brief
-         * Updates alternative store locations.
-         *
-         * Derived classes should override this method if they implement
-         * alternative store locations, and copy/translate values from the
-         * values() vector to these alternative storages.  They should also
-         * call the base class implementation as part of their implementation.
-         *
-         * Should be called in derived classes if values are modified directly
-         * through the values() method, e.g., in processAll().  Does not need
-         * to be called if commitValues() is used.
-         *
-         * Does not throw, and derived classes should not change that.
-         */
-        virtual void refreshValues();
 
         /*! \brief
          * Sets the default value for the option.
@@ -270,89 +258,167 @@ class OptionStorageTemplate : public AbstractOptionStorage
          * Provides derived classes access to the current list of values.
          *
          * The non-const variant should only be used from processAll() in
-         * derived classes if necessary, and refreshValues() should be called
-         * if any changes are made.
+         * derived classes if necessary.
          */
-        ValueList       &values() { return *values_; }
+        ArrayRef<T>      values() { return store_->values(); }
         //! Provides derived classes access to the current list of values.
-        const ValueList &values() const { return *values_; }
+        ConstArrayRef<T> values() const { return store_->values(); }
 
     private:
+        //! Creates the internal storage object for final values..
+        StorePointer createStore(ValueList *storeVector,
+                                 T *store, int *storeCount,
+                                 int initialCount);
+
         /*! \brief
          * Vector for temporary storage of values before commitSet() is called.
          */
         ValueList               setValues_;
+        //! Final storage for option values.
+        const StorePointer      store_;
+        // This never releases ownership.
+        std::unique_ptr<T>      defaultValueIfSet_;
+
+        // Copy and assign disallowed by base.
+};
+
+
+/*! \libinternal \brief
+ * Simplified option storage template for options that have one-to-one value
+ * conversion.
+ *
+ * \tparam T Assignable type that stores a single option value.
+ *
+ * To implement an option that always map a single input value to a single
+ * output value, derive from this class instead of OptionStorageTemplate.
+ * This class implements convertValue() in terms of two new virtual methods:
+ * initConverter() and processValue().
+ *
+ * To specify how different types of values need to be converted, implement
+ * initConverter().
+ * To do common post-processing of the values after conversion, but before they
+ * are added to the underlying storage, override processValue().
+ *
+ * \inlibraryapi
+ * \ingroup module_options
+ */
+template <typename T>
+class OptionStorageTemplateSimple : public OptionStorageTemplate<T>
+{
+    public:
+        //! Alias for the template class for use in base classes.
+        typedef OptionStorageTemplateSimple<T> MyBase;
+
+    protected:
+        //! Alias for the converter parameter type for initConverter().
+        typedef OptionValueConverterSimple<T> ConverterType;
+
+        //! Initializes the storage.
+        template <class U>
+        explicit OptionStorageTemplateSimple(const OptionTemplate<T, U> &settings,
+                                             OptionFlags staticFlags = OptionFlags())
+            : OptionStorageTemplate<T>(settings, staticFlags), initialized_(false)
+        {
+        }
+        //! Initializes the storage.
+        OptionStorageTemplateSimple(const AbstractOption                            &settings,
+                                    typename OptionStorageTemplate<T>::StorePointer  store)
+            : OptionStorageTemplate<T>(settings, std::move(store)), initialized_(false)
+        {
+        }
+
+        virtual std::vector<Variant>
+        normalizeValues(const std::vector<Variant> &values) const
+        {
+            const_cast<MyBase *>(this)->ensureConverterInitialized();
+            std::vector<Variant> result;
+            for (const auto &value : values)
+            {
+                result.push_back(normalizeValue(converter_.convert(value)));
+            }
+            return result;
+        }
+
+        /*! \brief
+         * Specifies how different types are converted.
+         *
+         * See OptionValueConverterSimple for more details.
+         */
+        virtual void initConverter(ConverterType *converter) = 0;
+        /*! \brief
+         * Post-processes a value after conversion to the output type.
+         *
+         * \param[in] value  Value after conversion.
+         * \returns   Value to store for the option.
+         *
+         * The default implementation only provides an identity mapping.
+         */
+        virtual T processValue(const T &value) const
+        {
+            return value;
+        }
         /*! \brief
-         * Vector for primary storage of option values.
+         * Converts a single value to normalized type.
          *
-         * Is never NULL; points either to externally provided vector, or an
-         * internally allocated one.  The allocation is performed by the
-         * constructor.
+         * \param[in] value  Value after conversion.
+         * \returns   Value to store for the option.
          *
-         * Primarily, modifications to values are done only to this storage,
-         * and other storage locations are updated only when refreshValues() is
-         * called.
+         * This can be overridden to serialize a different type than `T`
+         * when using the option with KeyValueTreeObject.
          */
-        ValueList                   *values_;
-        T                           *store_;
-        int                         *countptr_;
-        // These never release ownership.
-        std::unique_ptr<ValueList>   ownedValues_;
-        std::unique_ptr<T>           defaultValueIfSet_;
+        virtual Variant normalizeValue(const T &value) const
+        {
+            return Variant::create<T>(processValue(value));
+        }
 
-        // Copy and assign disallowed by base.
+    private:
+        virtual void convertValue(const Variant &variant)
+        {
+            ensureConverterInitialized();
+            this->addValue(processValue(converter_.convert(variant)));
+        }
+        void ensureConverterInitialized()
+        {
+            if (!initialized_)
+            {
+                initConverter(&converter_);
+                initialized_ = true;
+            }
+        }
+
+        ConverterType  converter_;
+        bool           initialized_;
 };
 
 
+/********************************************************************
+ * OptionStorageTemplate implementation
+ */
+
 template <typename T>
 template <class U>
 OptionStorageTemplate<T>::OptionStorageTemplate(const OptionTemplate<T, U> &settings,
                                                 OptionFlags staticFlags)
     : AbstractOptionStorage(settings, staticFlags),
-      values_(settings.storeVector_),
-      store_(settings.store_),
-      countptr_(settings.countptr_)
+      store_(createStore(settings.storeVector_,
+                         settings.store_, settings.countptr_,
+                         (settings.isVector() ?
+                          settings.maxValueCount_ : settings.minValueCount_)))
 {
-    // If the maximum number of values is not known, storage to
-    // caller-allocated memory is unsafe.
-    if (store_ != NULL && (maxValueCount() < 0 || hasFlag(efOption_MultipleTimes)))
-    {
-        GMX_THROW(APIError("Cannot set user-allocated storage for arbitrary number of values"));
-    }
-    if (values_ == NULL)
-    {
-        ownedValues_.reset(new std::vector<T>);
-        values_ = ownedValues_.get();
-    }
     if (hasFlag(efOption_NoDefaultValue)
-        && (settings.defaultValue_ != NULL
-            || settings.defaultValueIfSet_ != NULL))
+        && (settings.defaultValue_ != nullptr
+            || settings.defaultValueIfSet_ != nullptr))
     {
         GMX_THROW(APIError("Option does not support default value, but one is set"));
     }
-    if (store_ != NULL && countptr_ == NULL && !isVector()
-        && minValueCount() != maxValueCount())
-    {
-        GMX_THROW(APIError("Count storage is not set, although the number of produced values is not known"));
-    }
     if (!hasFlag(efOption_NoDefaultValue))
     {
         setFlag(efOption_HasDefaultValue);
-        if (settings.defaultValue_ != NULL)
+        if (settings.defaultValue_ != nullptr)
         {
             setDefaultValue(*settings.defaultValue_);
         }
-        else if (ownedValues_.get() != NULL && store_ != NULL)
-        {
-            values_->clear();
-            int count = (settings.isVector() ?
-                         settings.maxValueCount_ : settings.minValueCount_);
-            for (int i = 0; i < count; ++i)
-            {
-                values_->push_back(store_[i]);
-            }
-        }
-        if (settings.defaultValueIfSet_ != NULL)
+        if (settings.defaultValueIfSet_ != nullptr)
         {
             setDefaultValueIfSet(*settings.defaultValueIfSet_);
         }
@@ -361,36 +427,88 @@ OptionStorageTemplate<T>::OptionStorageTemplate(const OptionTemplate<T, U> &sett
 
 
 template <typename T>
-// cppcheck-suppress uninitMemberVar
-OptionStorageTemplate<T>::OptionStorageTemplate(const AbstractOption &settings)
-    : AbstractOptionStorage(settings, OptionFlags()),
-      store_(NULL), countptr_(NULL),
-      ownedValues_(new std::vector<T>())
+OptionStorageTemplate<T>::OptionStorageTemplate(const AbstractOption &settings,
+                                                StorePointer          store)
+    : AbstractOptionStorage(settings, OptionFlags()), store_(std::move(store))
+{
+}
+
+
+template <typename T>
+std::unique_ptr<IOptionValueStore<T> > OptionStorageTemplate<T>::createStore(
+        ValueList *storeVector, T *store, int *storeCount, int initialCount)
 {
-    values_ = ownedValues_.get();
+    if (storeVector != nullptr)
+    {
+        GMX_RELEASE_ASSERT(store == nullptr && storeCount == nullptr,
+                           "Cannot specify more than one storage location");
+        return StorePointer(new OptionValueStoreVector<T>(storeVector));
+    }
+    else if (store != nullptr)
+    {
+        // If the maximum number of values is not known, storage to
+        // caller-allocated memory is unsafe.
+        if (maxValueCount() < 0 || hasFlag(efOption_MultipleTimes))
+        {
+            GMX_THROW(APIError("Cannot set user-allocated storage for arbitrary number of values"));
+        }
+        if (storeCount == nullptr && !isVector() && minValueCount() != maxValueCount())
+        {
+            GMX_THROW(APIError("Count storage is not set, although the number of produced values is not known"));
+        }
+        if (hasFlag(efOption_NoDefaultValue))
+        {
+            initialCount = 0;
+        }
+        return StorePointer(new OptionValueStorePlain<T>(store, storeCount, initialCount));
+    }
+    GMX_RELEASE_ASSERT(storeCount == nullptr,
+                       "Cannot specify count storage without value storage");
+    return StorePointer(new OptionValueStoreNull<T>());
 }
 
 
 template <typename T>
-OptionStorageTemplate<T>::~OptionStorageTemplate()
+std::vector<Variant> OptionStorageTemplate<T>::defaultValues() const
 {
+    std::vector<Variant> result;
+    if (hasFlag(efOption_NoDefaultValue))
+    {
+        return result;
+    }
+    GMX_RELEASE_ASSERT(hasFlag(efOption_HasDefaultValue),
+                       "Current option implementation can only provide default values before assignment");
+    for (const auto &value : values())
+    {
+        result.push_back(Variant::create<T>(value));
+    }
+    return normalizeValues(result);
 }
 
 
 template <typename T>
-std::string OptionStorageTemplate<T>::formatValue(int i) const
+std::vector<std::string> OptionStorageTemplate<T>::defaultValuesAsStrings() const
 {
-    GMX_RELEASE_ASSERT(i == DefaultValueIfSetIndex || (i >= 0 && i < valueCount()),
-                       "Invalid value index");
-    if (i == DefaultValueIfSetIndex)
+    std::vector<std::string> result;
+    if (hasFlag(efOption_NoDefaultValue))
+    {
+        return result;
+    }
+    GMX_RELEASE_ASSERT(hasFlag(efOption_HasDefaultValue),
+                       "Current option implementation can only provide default values before assignment");
+    for (const auto &value : values())
     {
-        if (defaultValueIfSet_.get() != NULL)
+        result.push_back(formatSingleValue(value));
+    }
+    if (result.empty() || (result.size() == 1 && result[0].empty()))
+    {
+        result.clear();
+        if (defaultValueIfSet_.get() != nullptr)
         {
-            return formatSingleValue(*defaultValueIfSet_);
+            result.push_back(formatSingleValue(*defaultValueIfSet_));
         }
-        return std::string();
     }
-    return formatSingleValue(values()[i]);
+    return result;
 }
 
 
@@ -405,7 +523,7 @@ template <typename T>
 void OptionStorageTemplate<T>::processSet()
 {
     processSetValues(&setValues_);
-    if (setValues_.empty() && defaultValueIfSet_.get() != NULL)
+    if (setValues_.empty() && defaultValueIfSet_.get() != nullptr)
     {
         addValue(*defaultValueIfSet_);
         setFlag(efOption_HasDefaultValue);
@@ -440,32 +558,14 @@ void OptionStorageTemplate<T>::commitValues()
 {
     if (hasFlag(efOption_ClearOnNextSet))
     {
-        values_->swap(setValues_);
+        store_->clear();
     }
-    else
+    store_->reserve(setValues_.size());
+    for (T value : setValues_)
     {
-        values_->reserve(values_->size() + setValues_.size());
-        values_->insert(values_->end(), setValues_.begin(), setValues_.end());
+        store_->append(value);
     }
     clearSet();
-    refreshValues();
-}
-
-
-template <typename T>
-void OptionStorageTemplate<T>::refreshValues()
-{
-    if (countptr_ != NULL)
-    {
-        *countptr_ = static_cast<int>(values_->size());
-    }
-    if (store_ != NULL)
-    {
-        for (size_t i = 0; i < values_->size(); ++i)
-        {
-            store_[i] = (*values_)[i];
-        }
-    }
 }
 
 
@@ -479,12 +579,8 @@ void OptionStorageTemplate<T>::setDefaultValue(const T &value)
     if (hasFlag(efOption_HasDefaultValue))
     {
         setFlag(efOption_ExplicitDefaultValue);
-        clear();
-        clearSet();
-        addValue(value);
-        // TODO: As this is called from the constructor, it should not call
-        // virtual functions.
-        commitValues();
+        store_->clear();
+        store_->append(value);
     }
 }
 
index c9584dee9eceb29528793f81022848cd94cd2e2c..07397c888638019dde71300a9ae36326c9706dbb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2012,2014,2015,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.
@@ -45,6 +45,7 @@
 
 #include "gromacs/options/abstractoptionstorage.h"
 #include "gromacs/options/options.h"
+#include "gromacs/options/optionsection.h"
 
 #include "options-impl.h"
 
@@ -69,17 +70,15 @@ void visitOption(OptionsModifyingVisitor *visitor, OptionInfo &optionInfo)
 
 //! Helper function to recursively visit all options in a group.
 template <class VisitorType>
-void acceptOptionsGroup(const OptionsImpl::Group &group, VisitorType *visitor)
+void acceptOptionsGroup(const internal::OptionSectionImpl::Group &group, VisitorType *visitor)
 {
-    OptionsImpl::Group::OptionList::const_iterator option;
-    for (option = group.options_.begin(); option != group.options_.end(); ++option)
+    for (const auto &option : group.options_)
     {
-        visitOption(visitor, (*option)->optionInfo());
+        visitOption(visitor, option->optionInfo());
     }
-    OptionsImpl::Group::SubgroupList::const_iterator subgroup;
-    for (subgroup = group.subgroups_.begin(); subgroup != group.subgroups_.end(); ++subgroup)
+    for (const auto &subgroup : group.subgroups_)
     {
-        acceptOptionsGroup(*subgroup, visitor);
+        acceptOptionsGroup(subgroup, visitor);
     }
 }
 
@@ -90,24 +89,26 @@ void acceptOptionsGroup(const OptionsImpl::Group &group, VisitorType *visitor)
  */
 
 OptionsIterator::OptionsIterator(const Options &options)
-    : options_(options)
+    : section_(options.rootSection().section())
 {
 }
 
-void OptionsIterator::acceptSubSections(OptionsVisitor *visitor) const
+OptionsIterator::OptionsIterator(const OptionSectionInfo &section)
+    : section_(section.section())
 {
-    const OptionsImpl::SubSectionList          &subSectionList =
-        options_.impl_->subSections_;
-    OptionsImpl::SubSectionList::const_iterator i;
-    for (i = subSectionList.begin(); i != subSectionList.end(); ++i)
+}
+
+void OptionsIterator::acceptSections(OptionsVisitor *visitor) const
+{
+    for (const auto &section : section_.subsections_)
     {
-        visitor->visitSubSection(*(*i));
+        visitor->visitSection(section->info());
     }
 }
 
 void OptionsIterator::acceptOptions(OptionsVisitor *visitor) const
 {
-    acceptOptionsGroup(options_.impl_->rootGroup_, visitor);
+    acceptOptionsGroup(section_.rootGroup_, visitor);
 }
 
 /********************************************************************
@@ -115,24 +116,26 @@ void OptionsIterator::acceptOptions(OptionsVisitor *visitor) const
  */
 
 OptionsModifyingIterator::OptionsModifyingIterator(Options *options)
-    : options_(*options)
+    : section_(options->rootSection().section())
+{
+}
+
+OptionsModifyingIterator::OptionsModifyingIterator(OptionSectionInfo *section)
+    : section_(section->section())
 {
 }
 
-void OptionsModifyingIterator::acceptSubSections(OptionsModifyingVisitor *visitor) const
+void OptionsModifyingIterator::acceptSections(OptionsModifyingVisitor *visitor) const
 {
-    const OptionsImpl::SubSectionList          &subSectionList =
-        options_.impl_->subSections_;
-    OptionsImpl::SubSectionList::const_iterator i;
-    for (i = subSectionList.begin(); i != subSectionList.end(); ++i)
+    for (auto &section : section_.subsections_)
     {
-        visitor->visitSubSection(*i);
+        visitor->visitSection(&section->info());
     }
 }
 
 void OptionsModifyingIterator::acceptOptions(OptionsModifyingVisitor *visitor) const
 {
-    acceptOptionsGroup(options_.impl_->rootGroup_, visitor);
+    acceptOptionsGroup(section_.rootGroup_, visitor);
 }
 
 } // namespace gmx
index 44e265a2f78dd4e3ffd1127d5306085a248e9fdf..0f1adf33dfc1e1bca2247b0fdfd5c7366ab1abb1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2014,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.
@@ -54,6 +54,12 @@ namespace gmx
 {
 
 class Options;
+class OptionSectionInfo;
+
+namespace internal
+{
+class OptionSectionImpl;
+}
 
 /*! \libinternal \brief
  * Pure interface for visiting options in a Options object.
@@ -68,13 +74,9 @@ class OptionsVisitor
     public:
         virtual ~OptionsVisitor() {}
 
-        /*! \brief
-         * Called for each subsection in Options.
-         */
-        virtual void visitSubSection(const Options &section) = 0;
-        /*! \brief
-         * Called for each option in Options.
-         */
+        //! Called for each section.
+        virtual void visitSection(const OptionSectionInfo &section) = 0;
+        //! Called for each option.
         virtual void visitOption(const OptionInfo &option) = 0;
 };
 
@@ -93,7 +95,7 @@ class OptionsTypeVisitor : public OptionsVisitor
     public:
         virtual ~OptionsTypeVisitor() {}
 
-        virtual void visitSubSection(const Options &section) = 0;
+        virtual void visitSection(const OptionSectionInfo &section) = 0;
         /*! \brief
          * Called for each option of type \p InfoType.
          */
@@ -113,7 +115,7 @@ class OptionsTypeVisitor : public OptionsVisitor
 /*! \libinternal \brief
  * Decorator class for visiting options in a Options object.
  *
- * This class provides an interface for looping through subsections and
+ * This class provides an interface for looping through sections and
  * options in a Options object.
  *
  * Typical use (loop over all options, iteratively descending into
@@ -122,20 +124,20 @@ class OptionsTypeVisitor : public OptionsVisitor
    class Visitor : public gmx::OptionsVisitor
    {
        public:
-           void visitSubSection(const Options &section)
+           virtual void visitSection(const OptionSectionInfo &section)
            {
                OptionsIterator iterator(section);
-               iterator.acceptSubSections(this);
+               iterator.acceptSections(this);
                iterator.acceptOptions(this);
            }
 
-           void visitOption(const OptionInfo &option)
+           virtual void visitOption(const OptionInfo &option)
            {
                // Do something.
            }
    }
 
-   Visitor().visitSubSection(options);
+   Visitor().visitSection(options.rootSection());
  * \endcode
  *
  * \inlibraryapi
@@ -146,21 +148,22 @@ class OptionsIterator
     public:
         /*! \brief
          * Creates an object for visiting options in a Options object.
+         *
+         * The created iterator iterates over the "root" section in the Options
+         * object.
          */
         explicit OptionsIterator(const Options &options);
+        //! Creates an object for visiting options in an options section.
+        explicit OptionsIterator(const OptionSectionInfo &section);
 
-        /*! \brief
-         * Visits each subsection in the wrapped Options object.
-         */
-        void acceptSubSections(OptionsVisitor *visitor) const;
-        /*! \brief
-         * Visits each option in the wrapped Options object.
-         */
+        //! Visits each section in the wrapped section.
+        void acceptSections(OptionsVisitor *visitor) const;
+        //! Visits each option in the wrapped section.
         void acceptOptions(OptionsVisitor *visitor) const;
 
     private:
-        //! The wrapped Options object.
-        const Options          &options_;
+        //! The wrapped section object.
+        const internal::OptionSectionImpl &section_;
 
         GMX_DISALLOW_COPY_AND_ASSIGN(OptionsIterator);
 };
@@ -179,13 +182,9 @@ class OptionsModifyingVisitor
     public:
         virtual ~OptionsModifyingVisitor() {}
 
-        /*! \brief
-         * Called for each subsection in Options.
-         */
-        virtual void visitSubSection(Options *section) = 0;
-        /*! \brief
-         * Called for each option in Options.
-         */
+        //! Called for each section.
+        virtual void visitSection(OptionSectionInfo *section) = 0;
+        //! Called for each option.
         virtual void visitOption(OptionInfo *option) = 0;
 };
 
@@ -205,7 +204,7 @@ class OptionsModifyingTypeVisitor : public OptionsModifyingVisitor
     public:
         virtual ~OptionsModifyingTypeVisitor() {}
 
-        virtual void visitSubSection(Options *section) = 0;
+        virtual void visitSection(OptionSectionInfo *section) = 0;
         /*! \brief
          * Called for each option of type \p InfoType.
          */
@@ -215,7 +214,7 @@ class OptionsModifyingTypeVisitor : public OptionsModifyingVisitor
         virtual void visitOption(OptionInfo *option)
         {
             InfoType *subtype = option->toType<InfoType>();
-            if (subtype != NULL)
+            if (subtype != nullptr)
             {
                 visitOptionType(subtype);
             }
@@ -238,21 +237,22 @@ class OptionsModifyingIterator
     public:
         /*! \brief
          * Creates an object for visiting options in a Options object.
+         *
+         * The created iterator iterates over the "root" section in the Options
+         * object.
          */
         explicit OptionsModifyingIterator(Options *options);
+        //! Creates an object for visiting options in an options section.
+        explicit OptionsModifyingIterator(OptionSectionInfo *section);
 
-        /*! \brief
-         * Visits each subsection in the wrapped Options object.
-         */
-        void acceptSubSections(OptionsModifyingVisitor *visitor) const;
-        /*! \brief
-         * Visits each option in the wrapped Options object.
-         */
+        //! Visits each section in the wrapped section.
+        void acceptSections(OptionsModifyingVisitor *visitor) const;
+        //! Visits each option in the wrapped section.
         void acceptOptions(OptionsModifyingVisitor *visitor) const;
 
     private:
-        //! The wrapped Options object.
-        Options                &options_;
+        //! The wrapped section object.
+        internal::OptionSectionImpl &section_;
 
         GMX_DISALLOW_COPY_AND_ASSIGN(OptionsModifyingIterator);
 };
diff --git a/src/gromacs/options/repeatingsection.h b/src/gromacs/options/repeatingsection.h
new file mode 100644 (file)
index 0000000..683a41a
--- /dev/null
@@ -0,0 +1,208 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \file
+ * \brief
+ * Declares gmx::RepeatingOptionSection and related classes.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inpublicapi
+ * \ingroup module_options
+ */
+#ifndef GMX_OPTIONS_REPEATINGSECTION_H
+#define GMX_OPTIONS_REPEATINGSECTION_H
+
+#include <memory>
+#include <vector>
+
+#include "gromacs/options/abstractsection.h"
+#include "gromacs/options/ioptionscontainerwithsections.h"
+#include "gromacs/options/isectionstorage.h"
+#include "gromacs/options/valuestore.h"
+
+namespace gmx
+{
+
+template <class T> class RepeatingOptionSectionHandle;
+template <class T> class RepeatingOptionSectionStorage;
+
+/*! \brief
+ * Declares an option section that creates a structure for each instance.
+ *
+ * \tparam  T  Structure that stores the values for an instance of the section.
+ *
+ * This class declares a section that can be specified multiple times, and
+ * creates an instance of `T` for each instance.  Options within the section
+ * can store their values in the created structure.
+ *
+ * \inpublicapi
+ * \ingroup module_options
+ */
+template <class T>
+class RepeatingOptionSection : public AbstractOptionSection
+{
+    public:
+        //! AbstractOptionSectionHandle corresponding to this option type.
+        typedef RepeatingOptionSectionHandle<T> HandleType;
+
+        //! Creates a section with the given name.
+        explicit RepeatingOptionSection(const char *name)
+            : AbstractOptionSection(name), values_(nullptr)
+        {
+        }
+
+        //! Specifies a vector to receive the section structures.
+        RepeatingOptionSection &storeVector(std::vector<T> *values)
+        {
+            values_ = values;
+            return *this;
+        }
+
+    private:
+        virtual IOptionSectionStorage *createStorage() const;
+
+        std::vector<T> *values_;
+
+        //! Allows accessing the properties when initializing the storage.
+        friend class RepeatingOptionSectionStorage<T>;
+};
+
+/*! \internal
+ * \brief
+ * Implements handling of the structures that stores per-section values.
+ *
+ * \ingroup module_options
+ */
+template <class T>
+class RepeatingOptionSectionStorage : public IOptionSectionStorage
+{
+    public:
+        //! Initializes the storage for given section properties.
+        explicit RepeatingOptionSectionStorage(const RepeatingOptionSection<T> &section)
+            : store_(new OptionValueStoreVector<T>(section.values_)), currentData_()
+        {
+        }
+
+        virtual void initStorage()
+        {
+            defaultValues_ = currentData_;
+        }
+        virtual void startSection()
+        {
+            resetSection();
+        }
+        virtual void finishSection()
+        {
+            store_->append(currentData_);
+            resetSection();
+        }
+
+    private:
+        void resetSection()
+        {
+            currentData_ = defaultValues_;
+        }
+
+        //! Final storage location for the section structures.
+        const std::unique_ptr<IOptionValueStore<T> > store_;
+        T                                            defaultValues_;
+        /*! \brief
+         * Stores the values for the current in-process section.
+         *
+         * Options within the section store their values to this structure, and
+         * they are then copied to the final storage when the section finishes.
+         */
+        T                                            currentData_;
+
+        //! Allows binding option storage to the current section data structure.
+        friend class RepeatingOptionSectionHandle<T>;
+};
+
+template <class T>
+IOptionSectionStorage *RepeatingOptionSection<T>::createStorage() const
+{
+    return new RepeatingOptionSectionStorage<T>(*this);
+}
+
+/*! \brief
+ * Allows adding options to an RepeatingOptionSection.
+ *
+ * An instance of this class is returned from
+ * IOptionsContainerWithSections::addSection(), and supports adding options and
+ * subsections to a section created with OptionSection.
+ *
+ * Example:
+ * \code
+   struct SectionData { int value; }
+   // as class attribute
+   std::vector<SectionData> values;
+
+   void MyClass::initOptions(gmx::IOptionsContainerWithSections *options)
+   {
+       auto sec = options->addSection(gmx::RepeatingOptionSection<SectionData>("sec").storeVector(&values));
+       sec->addOption(gmx::IntegerOption("arg").store(&sec.bind().value));
+   }
+   \endcode
+ *
+ * \inpublicapi
+ * \ingroup module_options
+ */
+template <class T>
+class RepeatingOptionSectionHandle : public AbstractOptionSectionHandle
+{
+    public:
+        //! Wraps a given section storage object.
+        explicit RepeatingOptionSectionHandle(internal::OptionSectionImpl *section)
+            : AbstractOptionSectionHandle(section),
+              storage_(getStorage<RepeatingOptionSectionStorage<T> >(section))
+        {
+        }
+
+        /*! \brief
+         * Supports storing option values within the per-section data structure.
+         *
+         * See class documentation for an example.
+         */
+        T &bind()
+        {
+            return storage_->currentData_;
+        }
+
+    private:
+        RepeatingOptionSectionStorage<T> *storage_;
+};
+
+} // namespace gmx
+
+#endif
index 21806d0aed9d027c61fbd37d476f7336763d8f89..e99c2a97750dff81e3e373d85cc5b80eeda24715 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2010,2011,2012,2014, by the GROMACS development team, led by
+# Copyright (c) 2010,2011,2012,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.
@@ -38,4 +38,7 @@ gmx_add_unit_test(OptionsUnitTests options-test
                   filenameoptionmanager.cpp
                   option.cpp
                   optionsassigner.cpp
-                  timeunitmanager.cpp)
+                  repeatingsection.cpp
+                  timeunitmanager.cpp
+                  treesupport.cpp
+                  )
index 1682129575a0eec6f53c8cd1fd2ef746797d64d5..1cfab3a8a6eb4de64dad1519d15bc823744da804 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -90,7 +90,7 @@ class MockOptionStorage : public gmx::OptionStorageTemplate<std::string>
          *
          * \param[in] settings   Storage settings.
          */
-        MockOptionStorage(const MockOption &settings);
+        explicit MockOptionStorage(const MockOption &settings);
 
         /*! \brief
          * Calls addValue("dummy") in the base class.
@@ -99,25 +99,9 @@ class MockOptionStorage : public gmx::OptionStorageTemplate<std::string>
         {
             addValue("dummy");
         }
-        // using MyBase::markAsSet;
-        // using MyBase::addValue;
-        // using MyBase::commitValues;
-        // "using" is correct but MSVC gives error C2248. Workaround:
-        //! \copydoc gmx::OptionStorageTemplate::markAsSet()
-        void markAsSet()
-        {
-            MyBase::markAsSet();
-        }
-        //! \copydoc gmx::OptionStorageTemplate::addValue()
-        void addValue(const std::string &value)
-        {
-            MyBase::addValue(value);
-        }
-        //! \copydoc gmx::OptionStorageTemplate::commitValues()
-        void commitValues()
-        {
-            MyBase::commitValues();
-        }
+        using MyBase::markAsSet;
+        using MyBase::addValue;
+        using MyBase::commitValues;
 
         virtual gmx::OptionInfo &optionInfo() { return info_; }
         // These are not used.
@@ -126,6 +110,16 @@ class MockOptionStorage : public gmx::OptionStorageTemplate<std::string>
         {
             return "";
         }
+        virtual std::vector<gmx::Variant>
+        normalizeValues(const std::vector<gmx::Variant> &values) const
+        {
+            return values;
+        }
+
+        virtual void convertValue(const gmx::Variant &value)
+        {
+            convertValue(value.cast<std::string>());
+        }
 
         MOCK_METHOD1(convertValue, void(const std::string &value));
         MOCK_METHOD1(processSetValues, void(ValueList *values));
@@ -186,7 +180,7 @@ MockOptionStorage &MockOptionInfo::option()
  */
 TEST(AbstractOptionStorageTest, HandlesSetInFinish)
 {
-    gmx::Options                options(NULL, NULL);
+    gmx::Options                options;
     std::vector<std::string>    values;
     MockOptionInfo             *info = options.addOption(
                 MockOption("name").required().storeVector(&values));
@@ -216,7 +210,7 @@ TEST(AbstractOptionStorageTest, HandlesSetInFinish)
  */
 TEST(AbstractOptionStorageTest, HandlesValueRemoval)
 {
-    gmx::Options                options(NULL, NULL);
+    gmx::Options                options;
     std::vector<std::string>    values;
     MockOptionInfo             *info = options.addOption(
                 MockOption("name").storeVector(&values).multiValue());
@@ -255,7 +249,7 @@ TEST(AbstractOptionStorageTest, HandlesValueRemoval)
  */
 TEST(AbstractOptionStorageTest, HandlesValueAddition)
 {
-    gmx::Options                options(NULL, NULL);
+    gmx::Options                options;
     std::vector<std::string>    values;
     MockOptionInfo             *info = options.addOption(
                 MockOption("name").storeVector(&values).multiValue());
@@ -295,7 +289,7 @@ TEST(AbstractOptionStorageTest, HandlesValueAddition)
  */
 TEST(AbstractOptionStorageTest, HandlesTooManyValueAddition)
 {
-    gmx::Options                options(NULL, NULL);
+    gmx::Options                options;
     std::vector<std::string>    values;
     MockOptionInfo             *info = options.addOption(
                 MockOption("name").storeVector(&values).valueCount(2));
@@ -331,7 +325,7 @@ TEST(AbstractOptionStorageTest, HandlesTooManyValueAddition)
  */
 TEST(AbstractOptionStorageTest, AllowsEmptyValues)
 {
-    gmx::Options                options(NULL, NULL);
+    gmx::Options                options;
     std::vector<std::string>    values;
     MockOptionInfo             *info = options.addOption(
                 MockOption("name").storeVector(&values).valueCount(0));
index 5ae358f3cbb3044d3d1a702599ffa5bb3ab3a37b..2d3cde55f528c945ba9e2f3041192148e04eaa13 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,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.
@@ -59,7 +59,7 @@ using gmx::FileNameOption;
 
 TEST(FileNameOptionTest, HandlesRequiredDefaultValueWithoutExtension)
 {
-    gmx::Options           options(NULL, NULL);
+    gmx::Options           options;
     std::string            value;
     ASSERT_NO_THROW_GMX(options.addOption(
                                 FileNameOption("f").store(&value).required()
@@ -77,7 +77,7 @@ TEST(FileNameOptionTest, HandlesRequiredDefaultValueWithoutExtension)
 
 TEST(FileNameOptionTest, HandlesRequiredOptionWithoutValue)
 {
-    gmx::Options           options(NULL, NULL);
+    gmx::Options           options;
     std::string            value;
     ASSERT_NO_THROW_GMX(options.addOption(
                                 FileNameOption("f").store(&value).required()
@@ -97,7 +97,7 @@ TEST(FileNameOptionTest, HandlesRequiredOptionWithoutValue)
 
 TEST(FileNameOptionTest, HandlesOptionalUnsetOption)
 {
-    gmx::Options           options(NULL, NULL);
+    gmx::Options           options;
     std::string            value;
     ASSERT_NO_THROW_GMX(options.addOption(
                                 FileNameOption("f").store(&value)
@@ -115,7 +115,7 @@ TEST(FileNameOptionTest, HandlesOptionalUnsetOption)
 
 TEST(FileNameOptionTest, HandlesOptionalDefaultValueWithoutExtension)
 {
-    gmx::Options           options(NULL, NULL);
+    gmx::Options           options;
     std::string            value;
     ASSERT_NO_THROW_GMX(options.addOption(
                                 FileNameOption("f").store(&value)
@@ -135,7 +135,7 @@ TEST(FileNameOptionTest, HandlesOptionalDefaultValueWithoutExtension)
 
 TEST(FileNameOptionTest, HandlesRequiredCustomDefaultExtension)
 {
-    gmx::Options           options(NULL, NULL);
+    gmx::Options           options;
     std::string            value;
     ASSERT_NO_THROW_GMX(options.addOption(
                                 FileNameOption("f").store(&value).required()
@@ -154,7 +154,7 @@ TEST(FileNameOptionTest, HandlesRequiredCustomDefaultExtension)
 
 TEST(FileNameOptionTest, HandlesOptionalCustomDefaultExtension)
 {
-    gmx::Options           options(NULL, NULL);
+    gmx::Options           options;
     std::string            value;
     ASSERT_NO_THROW_GMX(options.addOption(
                                 FileNameOption("f").store(&value)
@@ -175,7 +175,7 @@ TEST(FileNameOptionTest, HandlesOptionalCustomDefaultExtension)
 
 TEST(FileNameOptionTest, GivesErrorOnUnknownFileSuffix)
 {
-    gmx::Options           options(NULL, NULL);
+    gmx::Options           options;
     std::string            value;
     ASSERT_NO_THROW_GMX(options.addOption(
                                 FileNameOption("f").store(&value)
@@ -195,7 +195,7 @@ TEST(FileNameOptionTest, GivesErrorOnUnknownFileSuffix)
 
 TEST(FileNameOptionTest, GivesErrorOnInvalidFileSuffix)
 {
-    gmx::Options           options(NULL, NULL);
+    gmx::Options           options;
     std::string            value;
     ASSERT_NO_THROW_GMX(options.addOption(
                                 FileNameOption("f").store(&value)
index 6992689febcd245d5730cb8b3ad2e0cc31e6fa15..9a67461c05ebf87065b4c9fbd8bec1fe28ac50b4 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,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.
@@ -63,7 +63,6 @@ class FileNameOptionManagerTest : public ::testing::Test
 {
     public:
         FileNameOptionManagerTest()
-            : options_(NULL, NULL)
         {
             manager_.setInputRedirector(&redirector_);
             options_.addManager(&manager_);
index 5d6cf976b66e85be1c1eb2cbc8969b402a1b4a76..c9d85b2b9bb223d5c7a9c60117e5c0119559bfa4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,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.
@@ -60,7 +60,7 @@ namespace
 
 TEST(OptionsTest, FailsOnNonsafeStorage)
 {
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     int          value = -1;
     using gmx::IntegerOption;
     ASSERT_THROW_GMX(options.addOption(IntegerOption("name").store(&value)
index b9dd8eb5f8f77a7581388e1ad97bb74d29fd0c33..e8de95d92fe9ec807e3e76ad0cabec773c512d82 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
 
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/options.h"
+#include "gromacs/options/optionsection.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/variant.h"
 
 #include "testutils/testasserts.h"
 
@@ -70,7 +72,7 @@ namespace
 
 TEST(OptionsAssignerTest, HandlesMissingRequiredParameter)
 {
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     int          value = 0;
     using gmx::IntegerOption;
     ASSERT_NO_THROW(options.addOption(
@@ -81,7 +83,7 @@ TEST(OptionsAssignerTest, HandlesMissingRequiredParameter)
 
 TEST(OptionsAssignerTest, HandlesRequiredParameterWithDefaultValue)
 {
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     int          value = 0;
     using gmx::IntegerOption;
     ASSERT_NO_THROW(options.addOption(
@@ -94,7 +96,7 @@ TEST(OptionsAssignerTest, HandlesRequiredParameterWithDefaultValue)
 
 TEST(OptionsAssignerTest, HandlesInvalidMultipleParameter)
 {
-    gmx::Options     options(NULL, NULL);
+    gmx::Options     options;
     std::vector<int> values;
     bool             bIsSet = false;
     using gmx::IntegerOption;
@@ -119,7 +121,7 @@ TEST(OptionsAssignerTest, HandlesInvalidMultipleParameter)
 
 TEST(OptionsAssignerTest, HandlesMultipleParameter)
 {
-    gmx::Options     options(NULL, NULL);
+    gmx::Options     options;
     std::vector<int> values;
     bool             bIsSet = false;
     using gmx::IntegerOption;
@@ -147,7 +149,7 @@ TEST(OptionsAssignerTest, HandlesMultipleParameter)
 
 TEST(OptionsAssignerTest, HandlesMissingValue)
 {
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     int          value1 = 0, value2 = 0;
     using gmx::IntegerOption;
     ASSERT_NO_THROW(options.addOption(IntegerOption("p").store(&value1)));
@@ -168,7 +170,7 @@ TEST(OptionsAssignerTest, HandlesMissingValue)
 
 TEST(OptionsAssignerTest, HandlesExtraValue)
 {
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     int          value1 = 0;
     using gmx::IntegerOption;
     ASSERT_NO_THROW(options.addOption(IntegerOption("p").store(&value1)));
@@ -187,7 +189,7 @@ TEST(OptionsAssignerTest, HandlesExtraValue)
 
 TEST(OptionsAssignerTest, HandlesGroups)
 {
-    gmx::Options            options(NULL, NULL);
+    gmx::Options            options;
     gmx::IOptionsContainer &group1 = options.addGroup();
     gmx::IOptionsContainer &group2 = options.addGroup();
     int                     value  = 3;
@@ -217,36 +219,35 @@ TEST(OptionsAssignerTest, HandlesGroups)
     EXPECT_EQ(6, value2);
 }
 
-TEST(OptionsAssignerTest, HandlesSubSections)
+TEST(OptionsAssignerTest, HandlesSections)
 {
-    gmx::Options options(NULL, NULL);
-    gmx::Options sub1("section1", NULL);
-    gmx::Options sub2("section2", NULL);
+    using gmx::OptionSection;
+    gmx::Options options;
+    auto         sub1   = options.addSection(OptionSection("section1"));
+    auto         sub2   = options.addSection(OptionSection("section2"));
     int          value  = 3;
     int          value1 = 1;
     int          value2 = 2;
     using gmx::IntegerOption;
-    ASSERT_NO_THROW(options.addSubSection(&sub1));
-    ASSERT_NO_THROW(options.addSubSection(&sub2));
-    ASSERT_NO_THROW(options.addOption(IntegerOption("p").store(&value)));
-    ASSERT_NO_THROW(sub1.addOption(IntegerOption("p").store(&value1)));
-    ASSERT_NO_THROW(sub2.addOption(IntegerOption("p").store(&value2)));
+    ASSERT_NO_THROW_GMX(options.addOption(IntegerOption("p").store(&value)));
+    ASSERT_NO_THROW_GMX(sub1.addOption(IntegerOption("p").store(&value1)));
+    ASSERT_NO_THROW_GMX(sub2.addOption(IntegerOption("p").store(&value2)));
 
     gmx::OptionsAssigner assigner(&options);
     EXPECT_NO_THROW(assigner.start());
-    ASSERT_NO_THROW(assigner.startSubSection("section1"));
+    ASSERT_NO_THROW(assigner.startSection("section1"));
     ASSERT_NO_THROW(assigner.startOption("p"));
     EXPECT_NO_THROW(assigner.appendValue("5"));
     EXPECT_NO_THROW(assigner.finishOption());
-    EXPECT_NO_THROW(assigner.finishSubSection());
+    EXPECT_NO_THROW(assigner.finishSection());
     ASSERT_NO_THROW(assigner.startOption("p"));
     EXPECT_NO_THROW(assigner.appendValue("4"));
     EXPECT_NO_THROW(assigner.finishOption());
-    ASSERT_NO_THROW(assigner.startSubSection("section2"));
+    ASSERT_NO_THROW(assigner.startSection("section2"));
     ASSERT_NO_THROW(assigner.startOption("p"));
     EXPECT_NO_THROW(assigner.appendValue("6"));
     EXPECT_NO_THROW(assigner.finishOption());
-    EXPECT_NO_THROW(assigner.finishSubSection());
+    EXPECT_NO_THROW(assigner.finishSection());
     EXPECT_NO_THROW(assigner.finish());
     EXPECT_NO_THROW(options.finish());
 
@@ -257,7 +258,7 @@ TEST(OptionsAssignerTest, HandlesSubSections)
 
 TEST(OptionsAssignerTest, HandlesMultipleSources)
 {
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     int          value = -1;
     using gmx::IntegerOption;
     ASSERT_NO_THROW(options.addOption(IntegerOption("p").store(&value)));
@@ -290,7 +291,7 @@ TEST(OptionsAssignerTest, HandlesMultipleSources)
 
 TEST(OptionsAssignerBooleanTest, StoresYesValue)
 {
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     bool         value = false;
     using gmx::BooleanOption;
     ASSERT_NO_THROW(options.addOption(BooleanOption("p").store(&value)));
@@ -308,7 +309,7 @@ TEST(OptionsAssignerBooleanTest, StoresYesValue)
 
 TEST(OptionsAssignerBooleanTest, SetsBooleanWithoutExplicitValue)
 {
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     bool         value = false;
     using gmx::BooleanOption;
     ASSERT_NO_THROW(options.addOption(BooleanOption("p").store(&value)));
@@ -325,7 +326,7 @@ TEST(OptionsAssignerBooleanTest, SetsBooleanWithoutExplicitValue)
 
 TEST(OptionsAssignerBooleanTest, ClearsBooleanWithPrefixNo)
 {
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     bool         value = true;
     using gmx::BooleanOption;
     ASSERT_NO_THROW(options.addOption(BooleanOption("p").store(&value)));
@@ -343,7 +344,7 @@ TEST(OptionsAssignerBooleanTest, ClearsBooleanWithPrefixNo)
 
 TEST(OptionsAssignerBooleanTest, HandlesBooleanWithPrefixAndValue)
 {
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     bool         value = false;
     using gmx::BooleanOption;
     ASSERT_NO_THROW(options.addOption(BooleanOption("p").store(&value)));
@@ -374,7 +375,7 @@ TEST(OptionsAssignerBooleanTest, HandlesBooleanWithPrefixAndValue)
 
 TEST(OptionsAssignerIntegerTest, StoresSingleValue)
 {
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     int          value = 1;
     using gmx::IntegerOption;
     ASSERT_NO_THROW(options.addOption(IntegerOption("p").store(&value)));
@@ -392,7 +393,7 @@ TEST(OptionsAssignerIntegerTest, StoresSingleValue)
 
 TEST(OptionsAssignerIntegerTest, HandlesEmptyValue)
 {
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     int          value = 1;
     using gmx::IntegerOption;
     ASSERT_NO_THROW(options.addOption(IntegerOption("p").store(&value)));
@@ -410,7 +411,7 @@ TEST(OptionsAssignerIntegerTest, HandlesEmptyValue)
 
 TEST(OptionsAssignerIntegerTest, HandlesInvalidValue)
 {
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     int          value = 1;
     using gmx::IntegerOption;
     ASSERT_NO_THROW(options.addOption(IntegerOption("p").store(&value)));
@@ -428,7 +429,7 @@ TEST(OptionsAssignerIntegerTest, HandlesInvalidValue)
 
 TEST(OptionsAssignerIntegerTest, HandlesOverflow)
 {
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     int          value = 1;
     using gmx::IntegerOption;
     ASSERT_NO_THROW(options.addOption(IntegerOption("p").store(&value)));
@@ -448,7 +449,7 @@ TEST(OptionsAssignerIntegerTest, HandlesOverflow)
 
 TEST(OptionsAssignerIntegerTest, StoresDefaultValue)
 {
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     int          value = -1;
     using gmx::IntegerOption;
     ASSERT_NO_THROW(options.addOption(
@@ -465,7 +466,7 @@ TEST(OptionsAssignerIntegerTest, StoresDefaultValue)
 
 TEST(OptionsAssignerIntegerTest, StoresDefaultValueIfSet)
 {
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     int          value = -1;
     using gmx::IntegerOption;
     ASSERT_NO_THROW(options.addOption(
@@ -484,7 +485,7 @@ TEST(OptionsAssignerIntegerTest, StoresDefaultValueIfSet)
 
 TEST(OptionsAssignerIntegerTest, HandlesDefaultValueIfSetWhenNotSet)
 {
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     int          value = -1;
     using gmx::IntegerOption;
     ASSERT_NO_THROW(options.addOption(
@@ -501,7 +502,7 @@ TEST(OptionsAssignerIntegerTest, HandlesDefaultValueIfSetWhenNotSet)
 
 TEST(OptionsAssignerIntegerTest, HandlesBothDefaultValues)
 {
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     int          value = -1;
     using gmx::IntegerOption;
     ASSERT_NO_THROW(options.addOption(
@@ -521,7 +522,7 @@ TEST(OptionsAssignerIntegerTest, HandlesBothDefaultValues)
 
 TEST(OptionsAssignerIntegerTest, StoresToVector)
 {
-    gmx::Options          options(NULL, NULL);
+    gmx::Options          options;
     std::vector<int>      values;
     using gmx::IntegerOption;
     ASSERT_NO_THROW(options.addOption(
@@ -545,7 +546,7 @@ TEST(OptionsAssignerIntegerTest, StoresToVector)
 
 TEST(OptionsAssignerIntegerTest, HandlesVectors)
 {
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     int          vec[3] = {0, 0, 0};
     using gmx::IntegerOption;
     ASSERT_NO_THROW(options.addOption(IntegerOption("p").store(vec).vector()));
@@ -567,7 +568,7 @@ TEST(OptionsAssignerIntegerTest, HandlesVectors)
 
 TEST(OptionsAssignerIntegerTest, HandlesVectorFromSingleValue)
 {
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     int          vec[3] = {0, 0, 0};
     using gmx::IntegerOption;
     ASSERT_NO_THROW(options.addOption(IntegerOption("p").store(vec).vector()));
@@ -587,7 +588,7 @@ TEST(OptionsAssignerIntegerTest, HandlesVectorFromSingleValue)
 
 TEST(OptionsAssignerIntegerTest, HandlesVectorsWithDefaultValue)
 {
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     int          vec[3] = {3, 2, 1};
     using gmx::IntegerOption;
     ASSERT_NO_THROW(options.addOption(IntegerOption("p").store(vec).vector()));
@@ -601,12 +602,10 @@ TEST(OptionsAssignerIntegerTest, HandlesVectorsWithDefaultValue)
 
 TEST(OptionsAssignerIntegerTest, HandlesVectorsWithDefaultValueWithInvalidAssignment)
 {
-    gmx::Options     options(NULL, NULL);
+    gmx::Options     options;
     int              vec[3] = {3, 2, 1};
-    std::vector<int> vec2(vec, vec+3);
     using gmx::IntegerOption;
-    ASSERT_NO_THROW(options.addOption(IntegerOption("p").store(vec)
-                                          .storeVector(&vec2).vector()));
+    ASSERT_NO_THROW(options.addOption(IntegerOption("p").store(vec).vector()));
 
     gmx::OptionsAssigner assigner(&options);
     EXPECT_NO_THROW(assigner.start());
@@ -620,10 +619,6 @@ TEST(OptionsAssignerIntegerTest, HandlesVectorsWithDefaultValueWithInvalidAssign
     EXPECT_EQ(3, vec[0]);
     EXPECT_EQ(2, vec[1]);
     EXPECT_EQ(1, vec[2]);
-    ASSERT_EQ(3U, vec2.size());
-    EXPECT_EQ(3, vec2[0]);
-    EXPECT_EQ(2, vec2[1]);
-    EXPECT_EQ(1, vec2[2]);
 }
 
 
@@ -633,7 +628,7 @@ TEST(OptionsAssignerIntegerTest, HandlesVectorsWithDefaultValueWithInvalidAssign
 
 TEST(OptionsAssignerDoubleTest, StoresSingleValue)
 {
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     double       value = 0.0;
     using gmx::DoubleOption;
     ASSERT_NO_THROW(options.addOption(DoubleOption("p").store(&value)));
@@ -649,9 +644,27 @@ TEST(OptionsAssignerDoubleTest, StoresSingleValue)
     EXPECT_DOUBLE_EQ(2.7, value);
 }
 
+TEST(OptionsAssignerDoubleTest, StoresValueFromFloat)
+{
+    gmx::Options options;
+    double       value = 0.0;
+    using gmx::DoubleOption;
+    ASSERT_NO_THROW(options.addOption(DoubleOption("p").store(&value)));
+
+    gmx::OptionsAssigner assigner(&options);
+    EXPECT_NO_THROW(assigner.start());
+    ASSERT_NO_THROW(assigner.startOption("p"));
+    ASSERT_NO_THROW(assigner.appendValue(gmx::Variant::create<float>(2.7)));
+    EXPECT_NO_THROW(assigner.finishOption());
+    EXPECT_NO_THROW(assigner.finish());
+    EXPECT_NO_THROW(options.finish());
+
+    EXPECT_FLOAT_EQ(2.7, value);
+}
+
 TEST(OptionsAssignerDoubleTest, HandlesEmptyValue)
 {
-    gmx::Options options(NULL, NULL);
+    gmx::Options options;
     double       value = 1.0;
     using gmx::DoubleOption;
     ASSERT_NO_THROW(options.addOption(DoubleOption("p").store(&value)));
@@ -667,6 +680,44 @@ TEST(OptionsAssignerDoubleTest, HandlesEmptyValue)
     EXPECT_DOUBLE_EQ(1.0, value);
 }
 
+TEST(OptionsAssignerDoubleTest, HandlesPreSetScaleValue)
+{
+    gmx::Options           options;
+    double                 value = 1.0;
+    using gmx::DoubleOption;
+    gmx::DoubleOptionInfo *info = options.addOption(DoubleOption("p").store(&value));
+    EXPECT_NO_THROW(info->setScaleFactor(10));
+
+    gmx::OptionsAssigner assigner(&options);
+    EXPECT_NO_THROW(assigner.start());
+    ASSERT_NO_THROW(assigner.startOption("p"));
+    ASSERT_NO_THROW(assigner.appendValue("2.7"));
+    EXPECT_NO_THROW(assigner.finishOption());
+    EXPECT_NO_THROW(assigner.finish());
+    EXPECT_NO_THROW(options.finish());
+
+    EXPECT_DOUBLE_EQ(27, value);
+}
+
+TEST(OptionsAssignerDoubleTest, HandlesPostSetScaleValue)
+{
+    gmx::Options           options;
+    double                 value = 1.0;
+    using gmx::DoubleOption;
+    gmx::DoubleOptionInfo *info = options.addOption(DoubleOption("p").store(&value));
+
+    gmx::OptionsAssigner   assigner(&options);
+    EXPECT_NO_THROW(assigner.start());
+    ASSERT_NO_THROW(assigner.startOption("p"));
+    ASSERT_NO_THROW(assigner.appendValue("2.7"));
+    EXPECT_NO_THROW(assigner.finishOption());
+    EXPECT_NO_THROW(assigner.finish());
+    EXPECT_NO_THROW(info->setScaleFactor(10));
+    EXPECT_NO_THROW(options.finish());
+
+    EXPECT_DOUBLE_EQ(27, value);
+}
+
 
 /********************************************************************
  * Tests for string assignment
@@ -677,7 +728,7 @@ const char *const c_allowed[] = { "none", "test", "value" };
 
 TEST(OptionsAssignerStringTest, StoresSingleValue)
 {
-    gmx::Options           options(NULL, NULL);
+    gmx::Options           options;
     std::string            value;
     using gmx::StringOption;
     ASSERT_NO_THROW(options.addOption(StringOption("p").store(&value)));
@@ -695,7 +746,7 @@ TEST(OptionsAssignerStringTest, StoresSingleValue)
 
 TEST(OptionsAssignerStringTest, HandlesEnumValue)
 {
-    gmx::Options           options(NULL, NULL);
+    gmx::Options           options;
     std::string            value;
     using gmx::StringOption;
     ASSERT_NO_THROW(options.addOption(
@@ -715,9 +766,9 @@ TEST(OptionsAssignerStringTest, HandlesEnumValue)
 
 TEST(OptionsAssignerStringTest, HandlesEnumValueFromNullTerminatedArray)
 {
-    gmx::Options           options(NULL, NULL);
+    gmx::Options           options;
     std::string            value;
-    const char * const     allowed[] = { "none", "test", "value", NULL };
+    const char * const     allowed[] = { "none", "test", "value", nullptr };
     using gmx::StringOption;
     ASSERT_NO_THROW(options.addOption(
                             StringOption("p").store(&value)
@@ -736,7 +787,7 @@ TEST(OptionsAssignerStringTest, HandlesEnumValueFromNullTerminatedArray)
 
 TEST(OptionsAssignerStringTest, HandlesIncorrectEnumValue)
 {
-    gmx::Options           options(NULL, NULL);
+    gmx::Options           options;
     std::string            value;
     using gmx::StringOption;
     ASSERT_NO_THROW(options.addOption(
@@ -751,7 +802,7 @@ TEST(OptionsAssignerStringTest, HandlesIncorrectEnumValue)
 
 TEST(OptionsAssignerStringTest, CompletesEnumValue)
 {
-    gmx::Options           options(NULL, NULL);
+    gmx::Options           options;
     std::string            value;
     using gmx::StringOption;
     ASSERT_NO_THROW(options.addOption(
@@ -771,7 +822,7 @@ TEST(OptionsAssignerStringTest, CompletesEnumValue)
 
 TEST(OptionsAssignerStringTest, HandlesEnumWithNoValue)
 {
-    gmx::Options           options(NULL, NULL);
+    gmx::Options           options;
     std::string            value;
     using gmx::StringOption;
     ASSERT_NO_THROW(options.addOption(
@@ -786,7 +837,7 @@ TEST(OptionsAssignerStringTest, HandlesEnumWithNoValue)
 
 TEST(OptionsAssignerStringTest, HandlesEnumDefaultValue)
 {
-    gmx::Options           options(NULL, NULL);
+    gmx::Options           options;
     std::string            value;
     using gmx::StringOption;
     ASSERT_NO_THROW(options.addOption(
@@ -804,7 +855,7 @@ TEST(OptionsAssignerStringTest, HandlesEnumDefaultValue)
 
 TEST(OptionsAssignerStringTest, HandlesEnumDefaultValueFromVariable)
 {
-    gmx::Options           options(NULL, NULL);
+    gmx::Options           options;
     std::string            value("test");
     using gmx::StringOption;
     ASSERT_NO_THROW(options.addOption(
@@ -822,10 +873,10 @@ TEST(OptionsAssignerStringTest, HandlesEnumDefaultValueFromVariable)
 
 TEST(OptionsAssignerStringTest, HandlesEnumDefaultValueFromVector)
 {
-    gmx::Options             options(NULL, NULL);
+    gmx::Options             options;
     std::vector<std::string> value;
-    value.push_back("test");
-    value.push_back("value");
+    value.emplace_back("test");
+    value.emplace_back("value");
     using gmx::StringOption;
     ASSERT_NO_THROW(options.addOption(
                             StringOption("p").storeVector(&value).valueCount(2)
@@ -860,7 +911,7 @@ enum TestEnum
 
 TEST(OptionsAssignerEnumTest, StoresSingleValue)
 {
-    gmx::Options           options(NULL, NULL);
+    gmx::Options           options;
     TestEnum               value     = etestNone;
     using gmx::EnumOption;
     ASSERT_NO_THROW(options.addOption(
@@ -881,7 +932,7 @@ TEST(OptionsAssignerEnumTest, StoresSingleValue)
 
 TEST(OptionsAssignerEnumTest, StoresVectorValues)
 {
-    gmx::Options           options(NULL, NULL);
+    gmx::Options           options;
     std::vector<TestEnum>  values;
     using gmx::EnumOption;
     ASSERT_NO_THROW(options.addOption(
@@ -905,7 +956,7 @@ TEST(OptionsAssignerEnumTest, StoresVectorValues)
 
 TEST(OptionsAssignerEnumTest, HandlesInitialValueOutOfRange)
 {
-    gmx::Options           options(NULL, NULL);
+    gmx::Options           options;
     TestEnum               value     = etestNR;
     using gmx::EnumOption;
     ASSERT_NO_THROW(options.addOption(
@@ -923,7 +974,7 @@ TEST(OptionsAssignerEnumTest, HandlesInitialValueOutOfRange)
 
 TEST(OptionsAssignerEnumTest, HandlesEnumDefaultValue)
 {
-    gmx::Options           options(NULL, NULL);
+    gmx::Options           options;
     TestEnum               value     = etestNone;
     using gmx::EnumOption;
     ASSERT_NO_THROW(options.addOption(
@@ -941,7 +992,7 @@ TEST(OptionsAssignerEnumTest, HandlesEnumDefaultValue)
 
 TEST(OptionsAssignerEnumTest, HandlesEnumDefaultValueFromVariable)
 {
-    gmx::Options           options(NULL, NULL);
+    gmx::Options           options;
     TestEnum               value     = etestTest;
     using gmx::EnumOption;
     ASSERT_NO_THROW(options.addOption(
@@ -959,7 +1010,7 @@ TEST(OptionsAssignerEnumTest, HandlesEnumDefaultValueFromVariable)
 
 TEST(OptionsAssignerEnumTest, HandlesEnumDefaultValueFromVector)
 {
-    gmx::Options             options(NULL, NULL);
+    gmx::Options             options;
     std::vector<TestEnum>    value;
     value.push_back(etestNone);
     value.push_back(etestTest);
diff --git a/src/gromacs/options/tests/refdata/TreeValueSupportAdjustTest_FillsDefaultObjectValues.xml b/src/gromacs/options/tests/refdata/TreeValueSupportAdjustTest_FillsDefaultObjectValues.xml
new file mode 100644 (file)
index 0000000..4799fb4
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Object Name="Input"></Object>
+  <Object Name="Output">
+    <Int Name="a">3</Int>
+    <Object Name="s">
+      <Int Name="a">1</Int>
+    </Object>
+    <Object Name="r">
+      <Int Name="a">2</Int>
+    </Object>
+  </Object>
+</ReferenceData>
diff --git a/src/gromacs/options/tests/refdata/TreeValueSupportAdjustTest_FillsDefaultValues.xml b/src/gromacs/options/tests/refdata/TreeValueSupportAdjustTest_FillsDefaultValues.xml
new file mode 100644 (file)
index 0000000..62f1caf
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Object Name="Input"></Object>
+  <Object Name="Output">
+    <Int Name="a">2</Int>
+  </Object>
+</ReferenceData>
diff --git a/src/gromacs/options/tests/refdata/TreeValueSupportAdjustTest_FillsDefaultVectorValues.xml b/src/gromacs/options/tests/refdata/TreeValueSupportAdjustTest_FillsDefaultVectorValues.xml
new file mode 100644 (file)
index 0000000..4f6ee6a
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Object Name="Input"></Object>
+  <Object Name="Output">
+    <Sequence Name="a">
+      <Int Name="Length">3</Int>
+      <Int>1</Int>
+      <Int>2</Int>
+      <Int>3</Int>
+    </Sequence>
+  </Object>
+</ReferenceData>
diff --git a/src/gromacs/options/tests/refdata/TreeValueSupportAdjustTest_MergesDefaultValues.xml b/src/gromacs/options/tests/refdata/TreeValueSupportAdjustTest_MergesDefaultValues.xml
new file mode 100644 (file)
index 0000000..0640b73
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Object Name="Input">
+    <Int Name="b">1</Int>
+  </Object>
+  <Object Name="Output">
+    <Int Name="a">2</Int>
+    <Int Name="b">1</Int>
+  </Object>
+</ReferenceData>
diff --git a/src/gromacs/options/tests/refdata/TreeValueSupportAdjustTest_NormalizesValues.xml b/src/gromacs/options/tests/refdata/TreeValueSupportAdjustTest_NormalizesValues.xml
new file mode 100644 (file)
index 0000000..b7f224f
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Object Name="Input">
+    <String Name="a">2</String>
+  </Object>
+  <Object Name="Output">
+    <Int Name="a">2</Int>
+  </Object>
+</ReferenceData>
diff --git a/src/gromacs/options/tests/refdata/TreeValueSupportAdjustTest_OrdersValues.xml b/src/gromacs/options/tests/refdata/TreeValueSupportAdjustTest_OrdersValues.xml
new file mode 100644 (file)
index 0000000..df43113
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Object Name="Input">
+    <Int Name="a">1</Int>
+    <Int Name="c">1</Int>
+    <Int Name="b">1</Int>
+  </Object>
+  <Object Name="Output">
+    <Int Name="b">1</Int>
+    <Int Name="a">1</Int>
+    <Int Name="c">1</Int>
+  </Object>
+</ReferenceData>
diff --git a/src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsBooleanOption.xml b/src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsBooleanOption.xml
new file mode 100644 (file)
index 0000000..7e3ba5a
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Object Name="Input"></Object>
+  <Object Name="Adjusted">
+    <Bool Name="a">true</Bool>
+  </Object>
+  <String Name="Dumped"><![CDATA[
+a                                 = true
+]]></String>
+  <String Name="Compared"><![CDATA[
+]]></String>
+  <String Name="ComparedAgainstEmpty"><![CDATA[
+/a (true - missing)
+]]></String>
+</ReferenceData>
diff --git a/src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsDoubleOption.xml b/src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsDoubleOption.xml
new file mode 100644 (file)
index 0000000..bd81738
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Object Name="Input"></Object>
+  <Object Name="Adjusted">
+    <Real Name="a">1.5</Real>
+  </Object>
+  <String Name="Dumped"><![CDATA[
+a                                 = 1.5
+]]></String>
+  <String Name="Compared"><![CDATA[
+]]></String>
+  <String Name="ComparedAgainstEmpty"><![CDATA[
+/a (1.5 - missing)
+]]></String>
+</ReferenceData>
diff --git a/src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsEnumIntOption.xml b/src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsEnumIntOption.xml
new file mode 100644 (file)
index 0000000..c81c4a0
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Object Name="Input"></Object>
+  <Object Name="Adjusted">
+    <String Name="a">foo</String>
+  </Object>
+  <String Name="Dumped"><![CDATA[
+a                                 = foo
+]]></String>
+  <String Name="Compared"><![CDATA[
+]]></String>
+  <String Name="ComparedAgainstEmpty"><![CDATA[
+/a (foo - missing)
+]]></String>
+</ReferenceData>
diff --git a/src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsEnumOption.xml b/src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsEnumOption.xml
new file mode 100644 (file)
index 0000000..c81c4a0
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Object Name="Input"></Object>
+  <Object Name="Adjusted">
+    <String Name="a">foo</String>
+  </Object>
+  <String Name="Dumped"><![CDATA[
+a                                 = foo
+]]></String>
+  <String Name="Compared"><![CDATA[
+]]></String>
+  <String Name="ComparedAgainstEmpty"><![CDATA[
+/a (foo - missing)
+]]></String>
+</ReferenceData>
diff --git a/src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsFloatOption.xml b/src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsFloatOption.xml
new file mode 100644 (file)
index 0000000..bd81738
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Object Name="Input"></Object>
+  <Object Name="Adjusted">
+    <Real Name="a">1.5</Real>
+  </Object>
+  <String Name="Dumped"><![CDATA[
+a                                 = 1.5
+]]></String>
+  <String Name="Compared"><![CDATA[
+]]></String>
+  <String Name="ComparedAgainstEmpty"><![CDATA[
+/a (1.5 - missing)
+]]></String>
+</ReferenceData>
diff --git a/src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsInt64Option.xml b/src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsInt64Option.xml
new file mode 100644 (file)
index 0000000..4891b7e
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Object Name="Input"></Object>
+  <Object Name="Adjusted">
+    <Int64 Name="a">2</Int64>
+  </Object>
+  <String Name="Dumped"><![CDATA[
+a                                 = 2
+]]></String>
+  <String Name="Compared"><![CDATA[
+]]></String>
+  <String Name="ComparedAgainstEmpty"><![CDATA[
+/a (2 - missing)
+]]></String>
+</ReferenceData>
diff --git a/src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsIntegerOption.xml b/src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsIntegerOption.xml
new file mode 100644 (file)
index 0000000..e6d4ce3
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Object Name="Input"></Object>
+  <Object Name="Adjusted">
+    <Int Name="a">2</Int>
+  </Object>
+  <String Name="Dumped"><![CDATA[
+a                                 = 2
+]]></String>
+  <String Name="Compared"><![CDATA[
+]]></String>
+  <String Name="ComparedAgainstEmpty"><![CDATA[
+/a (2 - missing)
+]]></String>
+</ReferenceData>
diff --git a/src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsStringOption.xml b/src/gromacs/options/tests/refdata/TreeValueSupportTest_SupportsStringOption.xml
new file mode 100644 (file)
index 0000000..fd1b4a7
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Object Name="Input"></Object>
+  <Object Name="Adjusted">
+    <String Name="a">s</String>
+  </Object>
+  <String Name="Dumped"><![CDATA[
+a                                 = s
+]]></String>
+  <String Name="Compared"><![CDATA[
+]]></String>
+  <String Name="ComparedAgainstEmpty"><![CDATA[
+/a (s - missing)
+]]></String>
+</ReferenceData>
diff --git a/src/gromacs/options/tests/repeatingsection.cpp b/src/gromacs/options/tests/repeatingsection.cpp
new file mode 100644 (file)
index 0000000..faf16c2
--- /dev/null
@@ -0,0 +1,275 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Tests functionality related to repeating sections.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_options
+ */
+#include "gmxpre.h"
+
+#include "gromacs/options/repeatingsection.h"
+
+#include <vector>
+
+#include <gtest/gtest.h>
+
+#include "gromacs/options/basicoptions.h"
+#include "gromacs/options/options.h"
+#include "gromacs/options/optionsassigner.h"
+
+#include "testutils/testasserts.h"
+
+namespace
+{
+
+using gmx::RepeatingOptionSection;
+
+struct SectionData
+{
+    int value;
+};
+
+TEST(RepeatingOptionSectionTest, HandlesNoInstance)
+{
+    std::vector<SectionData> values;
+    gmx::Options             options;
+    auto                     sec = options.addSection(
+                RepeatingOptionSection<SectionData>("section")
+                    .storeVector(&values));
+    using gmx::IntegerOption;
+    ASSERT_NO_THROW_GMX(sec.addOption(IntegerOption("p").store(&sec.bind().value)));
+
+    gmx::OptionsAssigner assigner(&options);
+    EXPECT_NO_THROW_GMX(assigner.start());
+    EXPECT_NO_THROW_GMX(assigner.finish());
+    EXPECT_NO_THROW_GMX(options.finish());
+
+    EXPECT_EQ(0U, values.size());
+}
+
+TEST(RepeatingOptionSectionTest, HandlesNoInstanceWithRequiredOption)
+{
+    std::vector<SectionData> values;
+    gmx::Options             options;
+    auto                     sec = options.addSection(
+                RepeatingOptionSection<SectionData>("section")
+                    .storeVector(&values));
+    using gmx::IntegerOption;
+    ASSERT_NO_THROW_GMX(sec.addOption(IntegerOption("p").store(&sec.bind().value)
+                                          .required()));
+
+    gmx::OptionsAssigner assigner(&options);
+    EXPECT_NO_THROW_GMX(assigner.start());
+    EXPECT_NO_THROW_GMX(assigner.finish());
+    EXPECT_NO_THROW_GMX(options.finish());
+
+    EXPECT_EQ(0U, values.size());
+}
+
+TEST(RepeatingOptionSectionTest, HandlesSingleInstance)
+{
+    std::vector<SectionData> values;
+    gmx::Options             options;
+    auto                     sec = options.addSection(
+                RepeatingOptionSection<SectionData>("section")
+                    .storeVector(&values));
+    using gmx::IntegerOption;
+    ASSERT_NO_THROW_GMX(sec.addOption(IntegerOption("p").store(&sec.bind().value)));
+
+    gmx::OptionsAssigner assigner(&options);
+    EXPECT_NO_THROW_GMX(assigner.start());
+    ASSERT_NO_THROW_GMX(assigner.startSection("section"));
+    ASSERT_NO_THROW_GMX(assigner.startOption("p"));
+    EXPECT_NO_THROW_GMX(assigner.appendValue("4"));
+    EXPECT_NO_THROW_GMX(assigner.finishOption());
+    EXPECT_NO_THROW_GMX(assigner.finishSection());
+    EXPECT_NO_THROW_GMX(assigner.finish());
+    EXPECT_NO_THROW_GMX(options.finish());
+
+    ASSERT_EQ(1U, values.size());
+    EXPECT_EQ(4, values[0].value);
+}
+
+TEST(RepeatingOptionSectionTest, HandlesDefaultValue)
+{
+    std::vector<SectionData> values;
+    gmx::Options             options;
+    auto                     sec = options.addSection(
+                RepeatingOptionSection<SectionData>("section")
+                    .storeVector(&values));
+    using gmx::IntegerOption;
+    ASSERT_NO_THROW_GMX(sec.addOption(IntegerOption("p").store(&sec.bind().value)
+                                          .defaultValue(3)));
+
+    gmx::OptionsAssigner assigner(&options);
+    EXPECT_NO_THROW_GMX(assigner.start());
+    ASSERT_NO_THROW_GMX(assigner.startSection("section"));
+    EXPECT_NO_THROW_GMX(assigner.finishSection());
+    EXPECT_NO_THROW_GMX(assigner.finish());
+    EXPECT_NO_THROW_GMX(options.finish());
+
+    ASSERT_EQ(1U, values.size());
+    EXPECT_EQ(3, values[0].value);
+}
+
+TEST(RepeatingOptionSectionTest, HandlesTwoInstances)
+{
+    std::vector<SectionData> values;
+    gmx::Options             options;
+    auto                     sec = options.addSection(
+                RepeatingOptionSection<SectionData>("section")
+                    .storeVector(&values));
+    using gmx::IntegerOption;
+    ASSERT_NO_THROW_GMX(sec.addOption(IntegerOption("p").store(&sec.bind().value)));
+
+    gmx::OptionsAssigner assigner(&options);
+    EXPECT_NO_THROW_GMX(assigner.start());
+    ASSERT_NO_THROW_GMX(assigner.startSection("section"));
+    ASSERT_NO_THROW_GMX(assigner.startOption("p"));
+    EXPECT_NO_THROW_GMX(assigner.appendValue("4"));
+    EXPECT_NO_THROW_GMX(assigner.finishOption());
+    EXPECT_NO_THROW_GMX(assigner.finishSection());
+    ASSERT_NO_THROW_GMX(assigner.startSection("section"));
+    ASSERT_NO_THROW_GMX(assigner.startOption("p"));
+    EXPECT_NO_THROW_GMX(assigner.appendValue("5"));
+    EXPECT_NO_THROW_GMX(assigner.finishOption());
+    EXPECT_NO_THROW_GMX(assigner.finishSection());
+    EXPECT_NO_THROW_GMX(assigner.finish());
+    EXPECT_NO_THROW_GMX(options.finish());
+
+    ASSERT_EQ(2U, values.size());
+    EXPECT_EQ(4, values[0].value);
+    EXPECT_EQ(5, values[1].value);
+}
+
+TEST(RepeatingOptionSectionTest, HandlesUnsetOptionWithImplicitDefault)
+{
+    std::vector<SectionData> values;
+    gmx::Options             options;
+    auto                     sec = options.addSection(
+                RepeatingOptionSection<SectionData>("section")
+                    .storeVector(&values));
+    using gmx::IntegerOption;
+    ASSERT_NO_THROW_GMX(sec.addOption(IntegerOption("p").store(&sec.bind().value)));
+
+    gmx::OptionsAssigner assigner(&options);
+    EXPECT_NO_THROW_GMX(assigner.start());
+    ASSERT_NO_THROW_GMX(assigner.startSection("section"));
+    ASSERT_NO_THROW_GMX(assigner.startOption("p"));
+    EXPECT_NO_THROW_GMX(assigner.appendValue("4"));
+    EXPECT_NO_THROW_GMX(assigner.finishOption());
+    EXPECT_NO_THROW_GMX(assigner.finishSection());
+    ASSERT_NO_THROW_GMX(assigner.startSection("section"));
+    EXPECT_NO_THROW_GMX(assigner.finishSection());
+    EXPECT_NO_THROW_GMX(assigner.finish());
+    EXPECT_NO_THROW_GMX(options.finish());
+
+    ASSERT_EQ(2U, values.size());
+    EXPECT_EQ(4, values[0].value);
+    EXPECT_EQ(0, values[1].value);
+}
+
+TEST(RepeatingOptionSectionTest, HandlesUnsetOptionWithExplicitDefault)
+{
+    std::vector<SectionData> values;
+    gmx::Options             options;
+    auto                     sec = options.addSection(
+                RepeatingOptionSection<SectionData>("section")
+                    .storeVector(&values));
+    using gmx::IntegerOption;
+    ASSERT_NO_THROW_GMX(sec.addOption(IntegerOption("p").store(&sec.bind().value)
+                                          .defaultValue(1)));
+
+    gmx::OptionsAssigner assigner(&options);
+    EXPECT_NO_THROW_GMX(assigner.start());
+    ASSERT_NO_THROW_GMX(assigner.startSection("section"));
+    ASSERT_NO_THROW_GMX(assigner.startOption("p"));
+    EXPECT_NO_THROW_GMX(assigner.appendValue("4"));
+    EXPECT_NO_THROW_GMX(assigner.finishOption());
+    EXPECT_NO_THROW_GMX(assigner.finishSection());
+    ASSERT_NO_THROW_GMX(assigner.startSection("section"));
+    EXPECT_NO_THROW_GMX(assigner.finishSection());
+    EXPECT_NO_THROW_GMX(assigner.finish());
+    EXPECT_NO_THROW_GMX(options.finish());
+
+    ASSERT_EQ(2U, values.size());
+    EXPECT_EQ(4, values[0].value);
+    EXPECT_EQ(1, values[1].value);
+}
+
+struct NestedSectionData
+{
+    int                      value;
+    std::vector<SectionData> subsec;
+};
+
+TEST(RepeatingOptionSectionTest, HandlesNestedSections)
+{
+    std::vector<NestedSectionData> values;
+    gmx::Options                   options;
+    auto                           sec = options.addSection(
+                RepeatingOptionSection<NestedSectionData>("section")
+                    .storeVector(&values));
+    auto                           subsec = sec.addSection(
+                RepeatingOptionSection<SectionData>("subsec")
+                    .storeVector(&sec.bind().subsec));
+    using gmx::IntegerOption;
+    ASSERT_NO_THROW_GMX(sec.addOption(IntegerOption("p").store(&sec.bind().value)));
+    ASSERT_NO_THROW_GMX(subsec.addOption(IntegerOption("p").store(&subsec.bind().value)));
+
+    gmx::OptionsAssigner assigner(&options);
+    EXPECT_NO_THROW_GMX(assigner.start());
+    ASSERT_NO_THROW_GMX(assigner.startSection("section"));
+    ASSERT_NO_THROW_GMX(assigner.startOption("p"));
+    EXPECT_NO_THROW_GMX(assigner.appendValue("4"));
+    EXPECT_NO_THROW_GMX(assigner.finishOption());
+    ASSERT_NO_THROW_GMX(assigner.startSection("subsec"));
+    ASSERT_NO_THROW_GMX(assigner.startOption("p"));
+    EXPECT_NO_THROW_GMX(assigner.appendValue("5"));
+    EXPECT_NO_THROW_GMX(assigner.finishOption());
+    EXPECT_NO_THROW_GMX(assigner.finishSection());
+    EXPECT_NO_THROW_GMX(assigner.finishSection());
+    EXPECT_NO_THROW_GMX(assigner.finish());
+    EXPECT_NO_THROW_GMX(options.finish());
+
+    ASSERT_EQ(1U, values.size());
+    EXPECT_EQ(4, values[0].value);
+    ASSERT_EQ(1U, values[0].subsec.size());
+    EXPECT_EQ(5, values[0].subsec[0].value);
+}
+
+} // namespace
index a66206b2e7e11b47566cadac06e327be5fe3fbb1..044f81ee7fc80f33aed12ce937f1f747cafb01f9 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,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.
@@ -72,7 +72,7 @@ TEST(TimeUnitBehaviorTest, ScalesAssignedOptionValue)
 {
     gmx::TimeUnitBehavior  behavior;
 
-    gmx::Options           options(NULL, NULL);
+    gmx::Options           options;
     double                 value = 0.0;
     using gmx::DoubleOption;
     ASSERT_NO_THROW_GMX(options.addOption(DoubleOption("p").store(&value).timeValue()));
@@ -108,7 +108,7 @@ TEST(TimeUnitBehaviorTest, DoesNotScaleDefaultValues)
 {
     gmx::TimeUnitBehavior behavior;
 
-    gmx::Options          options(NULL, NULL);
+    gmx::Options          options;
     double                value = 1.5, value2 = 0.0;
     using gmx::DoubleOption;
     ASSERT_NO_THROW_GMX(options.addOption(DoubleOption("p").store(&value).timeValue()));
@@ -133,7 +133,7 @@ TEST(TimeUnitBehaviorTest, ScalesUserInputWithMultipleSources)
 {
     gmx::TimeUnitBehavior behavior;
 
-    gmx::Options          options(NULL, NULL);
+    gmx::Options          options;
     double                value = 0.0;
     using gmx::DoubleOption;
     ASSERT_NO_THROW_GMX(options.addOption(DoubleOption("p").store(&value).timeValue()));
@@ -159,7 +159,7 @@ TEST(TimeUnitBehaviorTest, TimeUnitOptionWorks)
 {
     gmx::TimeUnitBehavior behavior;
 
-    gmx::Options          options(NULL, NULL);
+    gmx::Options          options;
     double                value = 0.0;
     using gmx::DoubleOption;
     ASSERT_NO_THROW_GMX(options.addOption(DoubleOption("p").store(&value).timeValue()));
diff --git a/src/gromacs/options/tests/treesupport.cpp b/src/gromacs/options/tests/treesupport.cpp
new file mode 100644 (file)
index 0000000..b827643
--- /dev/null
@@ -0,0 +1,423 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Tests option support for operations on KeyValueTree.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_options
+ */
+#include "gmxpre.h"
+
+#include "gromacs/options/treesupport.h"
+
+#include <string>
+#include <vector>
+
+#include <gtest/gtest.h>
+
+#include "gromacs/options/basicoptions.h"
+#include "gromacs/options/options.h"
+#include "gromacs/options/optionsection.h"
+#include "gromacs/options/repeatingsection.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/inmemoryserializer.h"
+#include "gromacs/utility/keyvaluetree.h"
+#include "gromacs/utility/keyvaluetreebuilder.h"
+#include "gromacs/utility/keyvaluetreeserializer.h"
+#include "gromacs/utility/stringstream.h"
+#include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/textwriter.h"
+
+#include "testutils/refdata.h"
+#include "testutils/testasserts.h"
+
+namespace
+{
+
+/********************************************************************
+ * Tests for assignOptionsFromKeyValueTree()
+ */
+
+TEST(TreeValueSupportAssignTest, AssignsFromTree)
+{
+    int                      a0 = 0, a1 = 0;
+    std::string              b1;
+
+    gmx::Options             options;
+    options.addOption(gmx::IntegerOption("a").store(&a0));
+    auto                     sec = options.addSection(gmx::OptionSection("s"));
+    sec.addOption(gmx::IntegerOption("a").store(&a1));
+    sec.addOption(gmx::StringOption("b").store(&b1));
+
+    gmx::KeyValueTreeBuilder builder;
+    builder.rootObject().addValue<int>("a", 2);
+    auto                     obj = builder.rootObject().addObject("s");
+    obj.addValue<int>("a", 1);
+    obj.addValue<std::string>("b", "foo");
+    gmx::KeyValueTreeObject  tree = builder.build();
+
+    ASSERT_NO_THROW_GMX(gmx::assignOptionsFromKeyValueTree(&options, tree, nullptr));
+    EXPECT_NO_THROW_GMX(options.finish());
+
+    EXPECT_EQ(2, a0);
+    EXPECT_EQ(1, a1);
+    EXPECT_EQ("foo", b1);
+}
+
+struct SectionData
+{
+    int a;
+};
+
+TEST(TreeValueSupportAssignTest, AssignsFromTreeWithArrays)
+{
+    std::vector<int>         a0;
+    std::vector<SectionData> s;
+
+    gmx::Options             options;
+    options.addOption(gmx::IntegerOption("a").storeVector(&a0).multiValue());
+    auto                     sec = options.addSection(gmx::RepeatingOptionSection<SectionData>("s").storeVector(&s));
+    sec.addOption(gmx::IntegerOption("a").store(&sec.bind().a));
+
+    gmx::KeyValueTreeBuilder builder;
+    auto                     array = builder.rootObject().addUniformArray<int>("a");
+    array.addValue(1);
+    array.addValue(2);
+    auto                     objArray = builder.rootObject().addObjectArray("s");
+    auto                     obj1     = objArray.addObject();
+    obj1.addValue<int>("a", 3);
+    auto                     obj2 = objArray.addObject();
+    obj2.addValue<int>("a", 4);
+    gmx::KeyValueTreeObject  tree = builder.build();
+
+    ASSERT_NO_THROW_GMX(gmx::assignOptionsFromKeyValueTree(&options, tree, nullptr));
+    EXPECT_NO_THROW_GMX(options.finish());
+
+    ASSERT_EQ(2U, a0.size());
+    EXPECT_EQ(1, a0[0]);
+    EXPECT_EQ(2, a0[1]);
+    ASSERT_EQ(2U, s.size());
+    EXPECT_EQ(3, s[0].a);
+    EXPECT_EQ(4, s[1].a);
+}
+
+TEST(TreeValueSupportAssignErrorTest, HandlesInvalidValue)
+{
+    int                      a1 = 0;
+
+    gmx::Options             options;
+    auto                     sec = options.addSection(gmx::OptionSection("s"));
+    sec.addOption(gmx::IntegerOption("a").store(&a1));
+
+    gmx::KeyValueTreeBuilder builder;
+    auto                     obj = builder.rootObject().addObject("s");
+    obj.addValue<std::string>("a", "foo");
+    gmx::KeyValueTreeObject  tree = builder.build();
+
+    EXPECT_THROW_GMX(gmx::assignOptionsFromKeyValueTree(&options, tree, nullptr),
+                     gmx::InvalidInputError);
+}
+
+/********************************************************************
+ * Tests for checkForUnknownOptionsInKeyValueTree()
+ */
+
+class TreeValueSupportCheckTest : public ::testing::Test
+{
+    public:
+        TreeValueSupportCheckTest()
+        {
+            auto sec1 = options_.addSection(gmx::OptionSection("s"));
+            auto sec2 = options_.addSection(gmx::OptionSection("r"));
+            options_.addOption(gmx::IntegerOption("a"));
+            sec1.addOption(gmx::IntegerOption("a"));
+            sec1.addOption(gmx::IntegerOption("b"));
+            sec2.addOption(gmx::IntegerOption("b"));
+        }
+
+        gmx::Options              options_;
+        gmx::KeyValueTreeBuilder  builder_;
+};
+
+TEST_F(TreeValueSupportCheckTest, HandlesEmpty)
+{
+    EXPECT_NO_THROW_GMX(gmx::checkForUnknownOptionsInKeyValueTree(builder_.build(), options_));
+}
+
+TEST_F(TreeValueSupportCheckTest, HandlesMatchingTree)
+{
+    auto                     root = builder_.rootObject();
+    root.addValue<int>("a", 1);
+    auto                     obj1 = root.addObject("s");
+    obj1.addValue<int>("a", 1);
+    obj1.addValue<int>("b", 2);
+    auto                     obj2 = root.addObject("r");
+    obj2.addValue<int>("b", 3);
+
+    EXPECT_NO_THROW_GMX(gmx::checkForUnknownOptionsInKeyValueTree(builder_.build(), options_));
+}
+
+TEST_F(TreeValueSupportCheckTest, HandlesSmallerTree1)
+{
+    auto                     root = builder_.rootObject();
+    root.addValue<int>("a", 1);
+    auto                     obj1 = root.addObject("s");
+    obj1.addValue<int>("b", 2);
+
+    EXPECT_NO_THROW_GMX(gmx::checkForUnknownOptionsInKeyValueTree(builder_.build(), options_));
+}
+
+TEST_F(TreeValueSupportCheckTest, HandlesSmallerTree2)
+{
+    auto                     root = builder_.rootObject();
+    auto                     obj1 = root.addObject("s");
+    obj1.addValue<int>("a", 1);
+    obj1.addValue<int>("b", 2);
+
+    EXPECT_NO_THROW_GMX(gmx::checkForUnknownOptionsInKeyValueTree(builder_.build(), options_));
+}
+
+TEST_F(TreeValueSupportCheckTest, DetectsExtraValue)
+{
+    auto                     root = builder_.rootObject();
+    auto                     obj2 = root.addObject("r");
+    obj2.addValue<int>("a", 1);
+    obj2.addValue<int>("b", 3);
+
+    EXPECT_THROW_GMX(gmx::checkForUnknownOptionsInKeyValueTree(builder_.build(), options_),
+                     gmx::InvalidInputError);
+}
+
+/********************************************************************
+ * Tests for adjustKeyValueTreeFromOptions()
+ */
+
+class TreeValueSupportAdjustTest : public ::testing::Test
+{
+    public:
+        void runTest()
+        {
+            gmx::test::TestReferenceData    refdata;
+            gmx::test::TestReferenceChecker checker(refdata.rootChecker());
+            gmx::KeyValueTreeObject         tree(builder_.build());
+            checker.checkKeyValueTreeObject(tree, "Input");
+            ASSERT_NO_THROW_GMX(tree = gmx::adjustKeyValueTreeFromOptions(tree, options_));
+            checker.checkKeyValueTreeObject(tree, "Output");
+        }
+
+        gmx::Options              options_;
+        gmx::KeyValueTreeBuilder  builder_;
+};
+
+TEST_F(TreeValueSupportAdjustTest, FillsDefaultValues)
+{
+    options_.addOption(gmx::IntegerOption("a").defaultValue(2));
+    runTest();
+}
+
+TEST_F(TreeValueSupportAdjustTest, FillsDefaultVectorValues)
+{
+    int v[3] = {1, 2, 3};
+    options_.addOption(gmx::IntegerOption("a").store(v).vector());
+    runTest();
+}
+
+TEST_F(TreeValueSupportAdjustTest, FillsDefaultObjectValues)
+{
+    auto sec1 = options_.addSection(gmx::OptionSection("s"));
+    sec1.addOption(gmx::IntegerOption("a").defaultValue(1));
+    auto sec2 = options_.addSection(gmx::OptionSection("r"));
+    sec2.addOption(gmx::IntegerOption("a").defaultValue(2));
+    options_.addOption(gmx::IntegerOption("a").defaultValue(3));
+    runTest();
+}
+
+TEST_F(TreeValueSupportAdjustTest, NormalizesValues)
+{
+    options_.addOption(gmx::IntegerOption("a"));
+    builder_.rootObject().addValue<std::string>("a", "2");
+    runTest();
+}
+
+TEST_F(TreeValueSupportAdjustTest, MergesDefaultValues)
+{
+    builder_.rootObject().addValue<int>("b", 1);
+    options_.addOption(gmx::IntegerOption("a").defaultValue(2));
+    options_.addOption(gmx::IntegerOption("b").defaultValue(3));
+    runTest();
+}
+
+TEST_F(TreeValueSupportAdjustTest, OrdersValues)
+{
+    builder_.rootObject().addValue<int>("a", 1);
+    builder_.rootObject().addValue<int>("c", 1);
+    builder_.rootObject().addValue<int>("b", 1);
+    options_.addOption(gmx::IntegerOption("b").defaultValue(2));
+    options_.addOption(gmx::IntegerOption("a").defaultValue(1));
+    options_.addOption(gmx::IntegerOption("c").defaultValue(3));
+    // TODO: This does not actually test the correct ordering, since the
+    // reference data is not currently order-sensitive, but the order can be
+    // checked manually from the reference data.
+    runTest();
+}
+
+/********************************************************************
+ * Support for different option types
+ */
+
+class TreeValueSupportTest : public ::testing::Test
+{
+    public:
+        void runTest()
+        {
+            gmx::test::TestReferenceData    refdata;
+            gmx::test::TestReferenceChecker checker(refdata.rootChecker());
+            gmx::KeyValueTreeObject         tree(builder_.build());
+            checker.checkKeyValueTreeObject(tree, "Input");
+            // Check that adjustment works.
+            ASSERT_NO_THROW_GMX(tree = gmx::adjustKeyValueTreeFromOptions(tree, options_));
+            checker.checkKeyValueTreeObject(tree, "Adjusted");
+            // Check that assignment works.
+            ASSERT_NO_THROW_GMX(gmx::assignOptionsFromKeyValueTree(&options_, tree, nullptr));
+            // Check that serialization works.
+            {
+                std::vector<char>             buffer = serializeTree(tree);
+                gmx::InMemoryDeserializer     deserializer(buffer);
+                gmx::KeyValueTreeObject       output
+                    = gmx::deserializeKeyValueTree(&deserializer);
+                SCOPED_TRACE("After serialization/deserialization\n  Buffer: "
+                             + formatBuffer(buffer));
+                checker.checkKeyValueTreeObject(output, "Adjusted");
+            }
+            // Check that dumping works.
+            {
+                gmx::StringOutputStream stream;
+                gmx::TextWriter         writer(&stream);
+                ASSERT_NO_THROW_GMX(gmx::dumpKeyValueTree(&writer, tree));
+                checker.checkTextBlock(stream.toString(), "Dumped");
+            }
+            // Check that comparison works.
+            {
+                gmx::StringOutputStream stream;
+                gmx::TextWriter         writer(&stream);
+                ASSERT_NO_THROW_GMX(gmx::compareKeyValueTrees(&writer, tree, tree, 0.0, 0.0));
+                checker.checkTextBlock(stream.toString(), "Compared");
+            }
+            // Check that comparison works against an empty tree.
+            {
+                gmx::StringOutputStream stream;
+                gmx::TextWriter         writer(&stream);
+                gmx::KeyValueTreeObject empty;
+                ASSERT_NO_THROW_GMX(gmx::compareKeyValueTrees(&writer, tree, empty, 0.0, 0.0));
+                checker.checkTextBlock(stream.toString(), "ComparedAgainstEmpty");
+            }
+        }
+
+        gmx::Options              options_;
+        gmx::KeyValueTreeBuilder  builder_;
+
+    private:
+        std::vector<char> serializeTree(const gmx::KeyValueTreeObject &tree)
+        {
+            gmx::InMemorySerializer serializer;
+            gmx::serializeKeyValueTree(tree, &serializer);
+            return serializer.finishAndGetBuffer();
+        }
+
+        std::string formatBuffer(const std::vector<char> &buffer)
+        {
+            return gmx::formatAndJoin(buffer, " ", [](char c) { return gmx::formatString("%02x", (unsigned char)c); });
+        }
+};
+
+TEST_F(TreeValueSupportTest, SupportsBooleanOption)
+{
+    options_.addOption(gmx::BooleanOption("a").defaultValue(true));
+    runTest();
+}
+
+TEST_F(TreeValueSupportTest, SupportsIntegerOption)
+{
+    options_.addOption(gmx::IntegerOption("a").defaultValue(2));
+    runTest();
+}
+
+TEST_F(TreeValueSupportTest, SupportsInt64Option)
+{
+    options_.addOption(gmx::Int64Option("a").defaultValue(2));
+    runTest();
+}
+
+TEST_F(TreeValueSupportTest, SupportsStringOption)
+{
+    options_.addOption(gmx::StringOption("a").defaultValue("s"));
+    runTest();
+}
+
+TEST_F(TreeValueSupportTest, SupportsFloatOption)
+{
+    options_.addOption(gmx::FloatOption("a").defaultValue(1.5));
+    runTest();
+}
+
+TEST_F(TreeValueSupportTest, SupportsDoubleOption)
+{
+    options_.addOption(gmx::DoubleOption("a").defaultValue(1.5));
+    runTest();
+}
+
+TEST_F(TreeValueSupportTest, SupportsEnumIntOption)
+{
+    const char *const values[] = {"foo", "bar"};
+    options_.addOption(gmx::EnumIntOption("a").enumValue(values).defaultValue(0));
+    runTest();
+}
+
+//! Enum for testing EnumOption.
+enum class TestEnum
+{
+    Foo, Bar
+};
+
+TEST_F(TreeValueSupportTest, SupportsEnumOption)
+{
+    const char *const values[] = {"foo", "bar"};
+    options_.addOption(gmx::EnumOption<TestEnum>("a").enumValue(values)
+                           .defaultValue(TestEnum::Foo));
+    runTest();
+}
+
+} // namespace
index 73f8fc329b081311b76b770a174fb6dbee5ce157..4a4e9af6f5036278783d978ef4202c0884b9ae57 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,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.
@@ -123,7 +123,7 @@ double TimeUnitManager::inverseTimeScaleFactor() const
  */
 
 TimeUnitBehavior::TimeUnitBehavior()
-    : timeUnit_(TimeUnit_Default), timeUnitStore_(NULL)
+    : timeUnit_(TimeUnit_Default), timeUnitStore_(nullptr)
 {
 }
 
@@ -132,7 +132,7 @@ void TimeUnitBehavior::setTimeUnit(TimeUnit timeUnit)
     GMX_RELEASE_ASSERT(timeUnit >= 0 && timeUnit <= TimeUnit_s,
                        "Invalid time unit");
     timeUnit_ = timeUnit;
-    if (timeUnitStore_ != NULL)
+    if (timeUnitStore_ != nullptr)
     {
         *timeUnitStore_ = timeUnit;
     }
@@ -147,7 +147,7 @@ void TimeUnitBehavior::setTimeUnitStore(TimeUnit *store)
 void TimeUnitBehavior::setTimeUnitFromEnvironment()
 {
     const char *const value = std::getenv("GMXTIMEUNIT");
-    if (value != NULL)
+    if (value != nullptr)
     {
         ConstArrayRef<const char *>                 timeUnits(g_timeUnits);
         ConstArrayRef<const char *>::const_iterator i =
@@ -190,10 +190,10 @@ class TimeOptionScaler : public OptionsModifyingTypeVisitor<FloatingPointOptionI
         //! Initializes a scaler with the given factor.
         explicit TimeOptionScaler(double factor) : factor_(factor) {}
 
-        void visitSubSection(Options *section)
+        void visitSection(OptionSectionInfo *section)
         {
             OptionsModifyingIterator iterator(section);
-            iterator.acceptSubSections(this);
+            iterator.acceptSections(this);
             iterator.acceptOptions(this);
         }
 
@@ -214,9 +214,9 @@ class TimeOptionScaler : public OptionsModifyingTypeVisitor<FloatingPointOptionI
 void TimeUnitBehavior::optionsFinishing(Options *options)
 {
     double factor = TimeUnitManager(timeUnit()).timeScaleFactor();
-    TimeOptionScaler<DoubleOptionInfo>(factor).visitSubSection(options);
-    TimeOptionScaler<FloatOptionInfo>(factor).visitSubSection(options);
-    if (timeUnitStore_ != NULL)
+    TimeOptionScaler<DoubleOptionInfo>(factor).visitSection(&options->rootSection());
+    TimeOptionScaler<FloatOptionInfo>(factor).visitSection(&options->rootSection());
+    if (timeUnitStore_ != nullptr)
     {
         *timeUnitStore_ = static_cast<TimeUnit>(timeUnit_);
     }
diff --git a/src/gromacs/options/treesupport.cpp b/src/gromacs/options/treesupport.cpp
new file mode 100644 (file)
index 0000000..9edaaa8
--- /dev/null
@@ -0,0 +1,346 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Implements functions from treesupport.h.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_options
+ */
+#include "gmxpre.h"
+
+#include "treesupport.h"
+
+#include <set>
+#include <string>
+#include <vector>
+
+#include "gromacs/options/options.h"
+#include "gromacs/options/optionsassigner.h"
+#include "gromacs/options/optionsection.h"
+#include "gromacs/options/optionsvisitor.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/ikeyvaluetreeerror.h"
+#include "gromacs/utility/keyvaluetree.h"
+#include "gromacs/utility/keyvaluetreebuilder.h"
+#include "gromacs/utility/stringutil.h"
+
+namespace gmx
+{
+
+namespace
+{
+
+class TreeAssignHelper
+{
+    public:
+        TreeAssignHelper(Options *options, IKeyValueTreeErrorHandler *errorHandler)
+            : assigner_(options), errorHandler_(errorHandler)
+        {
+            if (errorHandler_ == nullptr)
+            {
+                errorHandler_ = defaultKeyValueTreeErrorHandler();
+            }
+        }
+
+        void assignAll(const KeyValueTreeObject &root)
+        {
+            assigner_.start();
+            assignSubTree(root);
+            assigner_.finish();
+        }
+
+    private:
+        void assignSubTree(const KeyValueTreeObject &tree)
+        {
+            // TODO: Use the error handler also in other case.
+            for (const KeyValueTreeProperty &prop : tree.properties())
+            {
+                context_.append(prop.key());
+                if (prop.value().isArray())
+                {
+                    assignArray(prop.key(), prop.value().asArray());
+                }
+                else if (prop.value().isObject())
+                {
+                    assigner_.startSection(prop.key().c_str());
+                    assignSubTree(prop.value().asObject());
+                    assigner_.finishSection();
+                }
+                else
+                {
+                    assigner_.startOption(prop.key().c_str());
+                    try
+                    {
+                        assigner_.appendValue(prop.value().asVariant());
+                    }
+                    catch (UserInputError &ex)
+                    {
+                        if (!errorHandler_->onError(&ex, context_))
+                        {
+                            throw;
+                        }
+                    }
+                    assigner_.finishOption();
+                }
+                context_.pop_back();
+            }
+        }
+
+        void assignArray(const std::string       &key,
+                         const KeyValueTreeArray &array)
+        {
+            if (array.isObjectArray())
+            {
+                for (const KeyValueTreeValue &value : array.values())
+                {
+                    assigner_.startSection(key.c_str());
+                    assignSubTree(value.asObject());
+                    assigner_.finishSection();
+                }
+            }
+            else
+            {
+                assigner_.startOption(key.c_str());
+                for (const KeyValueTreeValue &value : array.values())
+                {
+                    assigner_.appendValue(value.asVariant());
+                }
+                assigner_.finishOption();
+            }
+        }
+
+        OptionsAssigner            assigner_;
+        IKeyValueTreeErrorHandler *errorHandler_;
+        KeyValueTreePath           context_;
+};
+
+class TreeCheckHelper : private OptionsVisitor
+{
+    public:
+        TreeCheckHelper(const KeyValueTreeObject &root)
+            : currentObject_(&root), currentKnownNames_(nullptr)
+        {
+        }
+
+        bool hasUnknownPaths() const { return !unknownPaths_.empty(); }
+        const std::vector<KeyValueTreePath> &unknownPaths() const
+        {
+            return unknownPaths_;
+        }
+
+        void processOptionSection(const OptionSectionInfo &section)
+        {
+            OptionsIterator       iterator(section);
+            std::set<std::string> knownNames;
+            currentKnownNames_ = &knownNames;
+            iterator.acceptOptions(this);
+            iterator.acceptSections(this);
+            currentKnownNames_ = nullptr;
+            for (const auto &prop : currentObject_->properties())
+            {
+                if (knownNames.count(prop.key()) == 0)
+                {
+                    unknownPaths_.push_back(currentPath_ + prop.key());
+                }
+            }
+        }
+
+    private:
+        virtual void visitSection(const OptionSectionInfo &section)
+        {
+            const std::string &name = section.name();
+            if (currentObject_->keyExists(name))
+            {
+                currentKnownNames_->insert(name);
+                auto parentObject     = currentObject_;
+                auto parentKnownNames = currentKnownNames_;
+                // TODO: Consider what to do with mismatching types.
+                currentObject_ = &(*currentObject_)[name].asObject();
+                currentPath_.append(name);
+                processOptionSection(section);
+                currentPath_.pop_back();
+                currentObject_     = parentObject;
+                currentKnownNames_ = parentKnownNames;
+            }
+        }
+        virtual void visitOption(const OptionInfo &option)
+        {
+            const std::string &name = option.name();
+            if (currentObject_->keyExists(name))
+            {
+                currentKnownNames_->insert(name);
+                // TODO: Consider what to do with mismatching types.
+            }
+        }
+
+        KeyValueTreePath               currentPath_;
+        const KeyValueTreeObject      *currentObject_;
+        std::set<std::string>         *currentKnownNames_;
+        std::vector<KeyValueTreePath>  unknownPaths_;
+
+};
+
+class TreeAdjustHelper : private OptionsVisitor
+{
+    public:
+        TreeAdjustHelper(const KeyValueTreeObject &root,
+                         KeyValueTreeBuilder      *builder)
+            : currentSourceObject_(&root),
+              currentObjectBuilder_(builder->rootObject())
+        {
+        }
+
+        void processOptionSection(const OptionSectionInfo &section)
+        {
+            OptionsIterator iterator(section);
+            iterator.acceptOptions(this);
+            iterator.acceptSections(this);
+        }
+
+    private:
+        virtual void visitSection(const OptionSectionInfo &section)
+        {
+            const std::string &name          = section.name();
+            auto               parentBuilder = currentObjectBuilder_;
+            auto               parentObject  = currentSourceObject_;
+            currentObjectBuilder_ = currentObjectBuilder_.addObject(name);
+            currentSourceObject_  =
+                (currentSourceObject_ != nullptr && currentSourceObject_->keyExists(name)
+                 ? &(*currentSourceObject_)[name].asObject()
+                 : nullptr);
+            processOptionSection(section);
+            currentSourceObject_  = parentObject;
+            currentObjectBuilder_ = parentBuilder;
+        }
+        virtual void visitOption(const OptionInfo &option)
+        {
+            const std::string &name = option.name();
+            if (currentSourceObject_ == nullptr || !currentSourceObject_->keyExists(name))
+            {
+                std::vector<Variant> values = option.defaultValues();
+                if (values.size() == 1)
+                {
+                    currentObjectBuilder_.addRawValue(name, std::move(values[0]));
+                }
+                else if (values.size() > 1)
+                {
+                    auto arrayBuilder = currentObjectBuilder_.addArray(name);
+                    for (Variant &value : values)
+                    {
+                        arrayBuilder.addRawValue(std::move(value));
+                    }
+                }
+            }
+            else
+            {
+                const KeyValueTreeValue &value = (*currentSourceObject_)[name];
+                GMX_RELEASE_ASSERT(!value.isObject(), "Value objects not supported in this context");
+                std::vector<Variant>     values;
+                if (value.isArray())
+                {
+                    for (const auto &arrayValue : value.asArray().values())
+                    {
+                        GMX_RELEASE_ASSERT(!value.isObject() && !value.isArray(),
+                                           "Complex values not supported in this context");
+                        values.push_back(arrayValue.asVariant());
+                    }
+                }
+                else
+                {
+                    values.push_back(value.asVariant());
+                }
+                values = option.normalizeValues(values);
+                if (values.empty())
+                {
+                }
+                else if (values.size() == 1)
+                {
+                    currentObjectBuilder_.addRawValue(name, std::move(values[0]));
+                }
+                else
+                {
+                    auto array = currentObjectBuilder_.addArray(name);
+                    for (auto &arrayValue : values)
+                    {
+                        array.addRawValue(std::move(arrayValue));
+                    }
+                }
+            }
+        }
+
+        const KeyValueTreeObject  *currentSourceObject_;
+        KeyValueTreeObjectBuilder  currentObjectBuilder_;
+};
+
+}   // namespace
+
+//! \cond libapi
+
+void assignOptionsFromKeyValueTree(Options                   *options,
+                                   const KeyValueTreeObject  &tree,
+                                   IKeyValueTreeErrorHandler *errorHandler)
+{
+    TreeAssignHelper helper(options, errorHandler);
+    helper.assignAll(tree);
+}
+
+void checkForUnknownOptionsInKeyValueTree(const KeyValueTreeObject &tree,
+                                          const Options            &options)
+{
+    TreeCheckHelper helper(tree);
+    helper.processOptionSection(options.rootSection());
+    if (helper.hasUnknownPaths())
+    {
+        std::string paths(formatAndJoin(helper.unknownPaths(), "\n  ",
+                                        [](const KeyValueTreePath &path) { return path.toString(); }));
+        std::string message("Unknown input values:\n  " + paths);
+        GMX_THROW(InvalidInputError(message));
+    }
+}
+
+KeyValueTreeObject
+adjustKeyValueTreeFromOptions(const KeyValueTreeObject &tree,
+                              const Options            &options)
+{
+    KeyValueTreeBuilder builder;
+    TreeAdjustHelper    helper(tree, &builder);
+    helper.processOptionSection(options.rootSection());
+    return builder.build();
+}
+
+//! \endcond
+
+} // namespace gmx
diff --git a/src/gromacs/options/treesupport.h b/src/gromacs/options/treesupport.h
new file mode 100644 (file)
index 0000000..479e1f5
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares functions for using keyvaluetree.h with Options.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_options
+ */
+#ifndef GMX_OPTIONS_TREESUPPORT_H
+#define GMX_OPTIONS_TREESUPPORT_H
+
+namespace gmx
+{
+
+class IKeyValueTreeErrorHandler;
+class KeyValueTreeObject;
+class Options;
+
+//! \cond libapi
+
+/*! \libinternal \brief
+ * Assigns option values from a given KeyValueTreeObject.
+ *
+ * Each property with a simple value (or an array of simple values) is assigned
+ * to an option with the same name.  Objects and arrays of objects are assigned
+ * to sections with the same name.
+ *
+ * \ingroup module_options
+ */
+void assignOptionsFromKeyValueTree(Options                   *options,
+                                   const KeyValueTreeObject  &tree,
+                                   IKeyValueTreeErrorHandler *errorHandler);
+/*! \libinternal \brief
+ * Checks that a given KeyValueTreeObject can be assigned to given Options.
+ *
+ * Throws an exception if `tree` contains any values that are not recognized by
+ * `options`.  Does not verify the type of the values, only that an option with
+ * the correct names exists.
+ *
+ * \ingroup module_options
+ */
+void checkForUnknownOptionsInKeyValueTree(const KeyValueTreeObject &tree,
+                                          const Options            &options);
+/*! \libinternal \brief
+ * Adjusts a KeyValueTreeObject to the structure of given Options.
+ *
+ * Assumes that all values in the input KeyValueTreeObject are valid values for
+ * the options.  The output has all the values in the input, but in the order
+ * they are in the options.  Values are also converted to the native type for
+ * the underlying option (e.g., strings are parsed to integers if the option
+ * accepts those).  For any option that does not have a corresponding value in
+ * the input, the output has it with a default value (if one exists for the
+ * option).
+ *
+ * Any values in `tree` that do not have matching options are not present in
+ * the output.  If this is not desirable, call
+ * checkForUnknownOptionsInKeyValueTree() before calling this function to
+ * ensure that no such values are present.
+ *
+ * Does not currently work for option sections in an array.
+ *
+ * \ingroup module_options
+ */
+KeyValueTreeObject
+adjustKeyValueTreeFromOptions(const KeyValueTreeObject &tree,
+                              const Options            &options);
+
+//! \endcond
+
+} // namespace gmx
+
+#endif
diff --git a/src/gromacs/options/valueconverter.h b/src/gromacs/options/valueconverter.h
new file mode 100644 (file)
index 0000000..0374890
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Provides gmx::OptionValueConverterSimple.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_options
+ */
+#ifndef GMX_OPTIONS_VALUECONVERTER_H
+#define GMX_OPTIONS_VALUECONVERTER_H
+
+#include <functional>
+#include <map>
+#include <typeindex>
+
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/variant.h"
+
+namespace gmx
+{
+
+/*! \libinternal \brief
+ * Helper for converting from Variant to a given type.
+ *
+ * \tparam OutType  Type this converter converts to.
+ *
+ * Default-constructed converter only supports identity mapping from the a
+ * Variant holding `OutType`.  To add support for additional input types,
+ * provide conversion functions with addConverter().  To use a non-identity
+ * mapping for an `OutType` -> `OutType` conversion, provide an alternative
+ * conversion from `OutType` with addConverter().
+ *
+ * \inlibraryapi
+ * \ingroup module_options
+ */
+template <typename OutType>
+class OptionValueConverterSimple
+{
+    public:
+        /*! \brief
+         * Converts a Variant value to the output type.
+         *
+         * \returns  Converted value.
+         * \throws InvalidInputError If the input Variant has a type that is
+         *     not recognized by any conversion.
+         */
+        OutType convert(const Variant &value) const
+        {
+            std::type_index type(value.type());
+            auto            iter = converters_.find(type);
+            if (iter == converters_.end())
+            {
+                if (value.isType<OutType>())
+                {
+                    return value.cast<OutType>();
+                }
+                GMX_THROW(InvalidInputError("Invalid type of value"));
+            }
+            return iter->second(value);
+        }
+
+        /*! \brief
+         * Adds a supported conversion.
+         *
+         * \tparam InType  Type to convert from.
+         * \param  func    Function to convert from `InType` to `OutType`.
+         */
+        template <typename InType>
+        void addConverter(std::function<OutType(const InType &)> func)
+        {
+            converters_[std::type_index(typeid(InType))] =
+                [func] (const Variant &value)
+                {
+                    return func(value.cast<InType>());
+                };
+        }
+        /*! \brief
+         * Adds a supported conversion from a type that can be directly cast.
+         *
+         * \tparam InType  Type to convert from with a simple cast.
+         */
+        template <typename InType>
+        void addCastConversion()
+        {
+            converters_[std::type_index(typeid(InType))] =
+                [] (const Variant &value)
+                {
+                    return static_cast<OutType>(value.cast<InType>());
+                };
+        }
+
+    private:
+        typedef std::function<OutType(const Variant &value)> ConversionFunction;
+
+        std::map<std::type_index, ConversionFunction> converters_;
+};
+
+} // namespace gmx
+
+#endif
diff --git a/src/gromacs/options/valuestore.h b/src/gromacs/options/valuestore.h
new file mode 100644 (file)
index 0000000..d19652a
--- /dev/null
@@ -0,0 +1,184 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \file
+ * \brief
+ * Declares implementations for IOptionValueStore.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_options
+ */
+#ifndef GMX_OPTIONS_VALUESTORE_H
+#define GMX_OPTIONS_VALUESTORE_H
+
+#include <vector>
+
+#include "gromacs/options/ivaluestore.h"
+#include "gromacs/utility/arrayref.h"
+
+namespace gmx
+{
+
+template <typename T>
+class OptionValueStorePlain : public IOptionValueStore<T>
+{
+    public:
+        OptionValueStorePlain(T *store, int *storeCount, int initialCount)
+            : count_(initialCount), store_(store), storeCount_(storeCount)
+        {
+        }
+
+        virtual int valueCount() { return count_; }
+        virtual ArrayRef<T> values() { return ArrayRef<T>::fromArray(store_, count_); }
+        virtual void clear()
+        {
+            count_ = 0;
+            if (storeCount_ != nullptr)
+            {
+                *storeCount_ = count_;
+            }
+        }
+        virtual void reserve(size_t /*count*/)
+        {
+        }
+        virtual void append(const T &value)
+        {
+            store_[count_] = value;
+            ++count_;
+            if (storeCount_ != nullptr)
+            {
+                *storeCount_ = count_;
+            }
+        }
+
+    private:
+        int                          count_;
+        T                           *store_;
+        int                         *storeCount_;
+};
+
+template <typename T>
+class OptionValueStoreVector : public IOptionValueStore<T>
+{
+    public:
+        // cppcheck-suppress uninitMemberVar
+        explicit OptionValueStoreVector(std::vector<T> *store) : store_(store) {}
+
+        virtual int valueCount() { return static_cast<int>(store_->size()); }
+        virtual ArrayRef<T> values() { return *store_; }
+        virtual void clear() { store_->clear(); }
+        virtual void reserve(size_t count)
+        {
+            store_->reserve(store_->size() + count);
+        }
+        virtual void append(const T &value)
+        {
+            store_->push_back(value);
+        }
+
+    private:
+        std::vector<T> *store_;
+};
+
+// Specialization that works around std::vector<bool> specialities.
+template <>
+// cppcheck-suppress noConstructor
+class OptionValueStoreVector<bool> : public IOptionValueStore<bool>
+{
+    public:
+        explicit OptionValueStoreVector(std::vector<bool> *store) : store_(store)
+        {
+        }
+
+        virtual int valueCount() { return static_cast<int>(store_->size()); }
+        virtual ArrayRef<bool> values()
+        {
+            return ArrayRef<bool>::fromArray(reinterpret_cast<bool *>(boolStore_.data()),
+                                             boolStore_.size());
+        }
+        virtual void clear()
+        {
+            boolStore_.clear();
+            store_->clear();
+        }
+        virtual void reserve(size_t count)
+        {
+            boolStore_.reserve(boolStore_.size() + count);
+            store_->reserve(store_->size() + count);
+        }
+        virtual void append(const bool &value)
+        {
+            boolStore_.push_back({value});
+            store_->push_back(value);
+        }
+
+    private:
+        struct Bool
+        {
+            bool value;
+        };
+
+        std::vector<Bool>  boolStore_;
+        std::vector<bool> *store_;
+};
+
+/*! \internal
+ * \brief
+ * Value storage that does not store anywhere.
+ *
+ * This is needed because even though the values are not stored anywhere, the
+ * code still expects to access them later through valueCount() and values().
+ *
+ * \ingroup module_options
+ */
+template <typename T>
+class OptionValueStoreNull : public IOptionValueStore<T>
+{
+    public:
+        OptionValueStoreNull() : store_(&vector_) {}
+
+        virtual int valueCount() { return store_.valueCount(); }
+        virtual ArrayRef<T> values() { return store_.values(); }
+        virtual void clear() { store_.clear(); }
+        virtual void reserve(size_t count) { store_.reserve(count); }
+        virtual void append(const T &value) { store_.append(value); }
+
+    private:
+        std::vector<T>            vector_;
+        OptionValueStoreVector<T> store_;
+};
+
+} // namespace gmx
+
+#endif
index 7662589f6bcd548627afd61b1ca83e2f38610737..b2eab493f96196fa0932c8952ab78182fc1288ff 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 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.
 
 #include "boxutilities.h"
 
-#include <cmath>
-
 #include <algorithm>
 
+#include "gromacs/math/utilities.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/math/vectypes.h"
-#include "gromacs/mdtypes/inputrec.h"
-#include "gromacs/mdtypes/md_enums.h"
-#include "gromacs/mdtypes/state.h"
-#include "gromacs/pbcutil/pbc.h"
-#include "gromacs/utility/basedefinitions.h"
-#include "gromacs/utility/real.h"
 
-/*! \brief Change box components to preserve the relative box shape
- *
- * Change box components to box[XX][XX]*box_rel to preserve the relative box shape
- */
-static void do_box_rel(t_inputrec *ir, matrix box_rel, matrix b, gmx_bool bInit)
+void do_box_rel(int ndim, const matrix deform, matrix box_rel,
+                matrix b, bool bInit)
 {
-    int d, d2;
-
-    for (d = YY; d <= ZZ; d++)
+    for (int d = YY; d <= ZZ; ++d)
     {
-        for (d2 = XX; d2 <= (ir->epct == epctSEMIISOTROPIC ? YY : ZZ); d2++)
+        for (int d2 = XX; d2 < ndim; ++d2)
         {
             /* We need to check if this box component is deformed
              * or if deformation of another component might cause
              * changes in this component due to box corrections.
              */
-            if (ir->deform[d][d2] == 0 &&
-                !(d == ZZ && d2 == XX && ir->deform[d][YY] != 0 &&
-                  (b[YY][d2] != 0 || ir->deform[YY][d2] != 0)))
+            if (deform[d][d2] == 0 &&
+                !(d == ZZ && d2 == XX && deform[d][YY] != 0 &&
+                  (b[YY][d2] != 0 || deform[YY][d2] != 0)))
             {
                 if (bInit)
                 {
@@ -88,23 +76,32 @@ static void do_box_rel(t_inputrec *ir, matrix box_rel, matrix b, gmx_bool bInit)
     }
 }
 
-void preserve_box_shape(t_inputrec *ir, matrix box_rel, matrix b)
+namespace gmx
 {
-    if (inputrecPreserveShape(ir))
-    {
-        do_box_rel(ir, box_rel, b, FALSE);
-    }
-}
 
-void set_box_rel(t_inputrec *ir, t_state *state)
+namespace
 {
-    /* Make sure the box obeys the restrictions before we fix the ratios */
-    correct_box(NULL, 0, state->box, NULL);
 
-    clear_mat(state->box_rel);
+//! Whether two box elements are equal (with a tolerance).
+bool boxElementEqual(real element1, real element2)
+{
+    // Compare with a relative tolerance (for big boxes) and with
+    // an absolute tolerance (small boxes are generally not specified with very
+    // high number of decimals).
+    return gmx_within_tol(element1, element2, 10*GMX_REAL_EPS)
+           || std::fabs(element1 - element2) < 1e-3;
+}
 
-    if (inputrecPreserveShape(ir))
-    {
-        do_box_rel(ir, state->box_rel, state->box, TRUE);
-    }
+}   // namespace
+
+bool boxesAreEqual(const matrix box1, const matrix box2)
+{
+    return boxElementEqual(box1[XX][XX], box2[XX][XX])
+           && boxElementEqual(box1[YY][XX], box2[YY][XX])
+           && boxElementEqual(box1[YY][YY], box2[YY][YY])
+           && boxElementEqual(box1[ZZ][XX], box2[ZZ][XX])
+           && boxElementEqual(box1[ZZ][YY], box2[ZZ][YY])
+           && boxElementEqual(box1[ZZ][ZZ], box2[ZZ][ZZ]);
 }
+
+} // namespace gmx
index 6d677debf3c0a82f2d24e8a7acad85449078815b..1261129a0c30115ddb9fdbd86e99908915f23833 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 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.
 #include <stdio.h>
 
 #include "gromacs/math/vectypes.h"
-#include "gromacs/utility/basedefinitions.h"
-#include "gromacs/utility/real.h"
 
-struct t_inputrec;
-struct t_state;
-
-/*! \brief Make sure the relative box shape remains the same
- *
- * This function ensures that the relative box dimensions are
- * preserved, which otherwise might diffuse away due to rounding
- * errors in pressure coupling or the deform option.
+/*! \brief Change box components to preserve the relative box shape
  *
- * \param[in] ir      Input record
- * \param[in] box_rel Relative box
- * \param[out] b      The corrected box
+ * Change box components to box[XX][XX]*box_rel to preserve the relative box shape
  */
-void preserve_box_shape(t_inputrec *ir, matrix box_rel, matrix b);
+void do_box_rel(int ndim, const matrix deform, matrix box_rel,
+                matrix b, bool bInit);
 
-/*! \brief Determine the relative box components
- *
- * Set state->box_rel used in mdrun to preserve the box shape
- * \param[in] ir       Input record
- * \param[inout] state Structure containing the box
+namespace gmx
+{
+
+/*! \brief
+ * Returns whether two boxes are of equal size and shape (within reasonable
+ * tolerance).
  */
-void set_box_rel(struct t_inputrec *ir, t_state *state);
+bool boxesAreEqual(const matrix box1, const matrix box2);
+
+} // namespace gmx
 
 #endif
index d551166a29752e9d00700e4b03f639c1eab2d559..236848fcdc3523976f855406a3b23cd67eebf9a1 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,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.
@@ -120,7 +120,7 @@ static void mk_igraph(t_graph *g, int ftype, const t_ilist *il,
                 add_gbond(g, ia[1], ia[2]);
                 add_gbond(g, ia[1], ia[3]);
             }
-            else if (part == NULL)
+            else if (part == nullptr)
             {
                 /* Simply add this bond */
                 for (j = 1; j < np; j++)
@@ -412,7 +412,7 @@ void mk_graph_ilist(FILE *fplog,
             {
                 if (interaction_function[i].flags & IF_CHEMBOND)
                 {
-                    mk_igraph(g, i, &(ilist[i]), at_start, at_end, NULL);
+                    mk_igraph(g, i, &(ilist[i]), at_start, at_end, nullptr);
                 }
             }
 
@@ -442,10 +442,10 @@ void mk_graph_ilist(FILE *fplog,
         else
         {
             /* This is a special thing used in splitter.c to generate shake-blocks */
-            mk_igraph(g, F_CONSTR, &(ilist[F_CONSTR]), at_start, at_end, NULL);
+            mk_igraph(g, F_CONSTR, &(ilist[F_CONSTR]), at_start, at_end, nullptr);
             if (bSettle)
             {
-                mk_igraph(g, F_SETTLE, &(ilist[F_SETTLE]), at_start, at_end, NULL);
+                mk_igraph(g, F_SETTLE, &(ilist[F_SETTLE]), at_start, at_end, nullptr);
             }
         }
         g->nbound = 0;
@@ -459,7 +459,7 @@ void mk_graph_ilist(FILE *fplog,
     }
 
     g->negc = 0;
-    g->egc  = NULL;
+    g->egc  = nullptr;
 
     sfree(nbond);
 
index c56fa0f8c848067a892f53392aa198566f1dea0b..fb9addd5655fadf2d2a79946bda98833a3ebfc34 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,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.
@@ -54,7 +54,7 @@ void set_pbc_simd(const t_pbc gmx_unused *pbc,
                   real gmx_unused        *pbc_simd)
 {
 #if GMX_SIMD_HAVE_REAL
-    if (pbc != NULL && pbc->ePBC != epbcNONE)
+    if (pbc != nullptr && pbc->ePBC != epbcNONE)
     {
         rvec inv_box_diag = {0, 0, 0};
 
index e5078b821859e740a4d701a18b9030fb6a55a631..46cdc76b76d52077bd875134f40ec1994528c92b 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,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.
@@ -54,7 +54,6 @@
 #include "gromacs/math/utilities.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/math/vecdump.h"
-#include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/pbcutil/ishift.h"
 #include "gromacs/pbcutil/mshift.h"
 #include "gromacs/utility/exceptions.h"
@@ -64,7 +63,7 @@
 
 const char *epbc_names[epbcNR+1] =
 {
-    "xyz", "no", "xy", "screw", NULL
+    "xyz", "no", "xy", "screw", nullptr
 };
 
 /* Skip 0 so we have more chance of detecting if we forgot to call set_pbc. */
@@ -97,18 +96,6 @@ int ePBC2npbcdim(int ePBC)
     return npbcdim;
 }
 
-int inputrec2nboundeddim(const t_inputrec *ir)
-{
-    if (ir->nwall == 2 && ir->ePBC == epbcXY)
-    {
-        return 3;
-    }
-    else
-    {
-        return ePBC2npbcdim(ir->ePBC);
-    }
-}
-
 void dump_pbc(FILE *fp, t_pbc *pbc)
 {
     rvec sum_box;
@@ -140,7 +127,7 @@ const char *check_box(int ePBC, const matrix box)
 
     if (ePBC == epbcNONE)
     {
-        return NULL;
+        return nullptr;
     }
 
     if ((box[XX][YY] != 0) || (box[XX][ZZ] != 0) || (box[YY][ZZ] != 0))
@@ -160,7 +147,7 @@ const char *check_box(int ePBC, const matrix box)
     }
     else
     {
-        ptr = NULL;
+        ptr = nullptr;
     }
 
     return ptr;
@@ -327,29 +314,6 @@ gmx_bool correct_box(FILE *fplog, int step, tensor box, t_graph *graph)
     return bCorrected;
 }
 
-int ndof_com(t_inputrec *ir)
-{
-    int n = 0;
-
-    switch (ir->ePBC)
-    {
-        case epbcXYZ:
-        case epbcNONE:
-            n = 3;
-            break;
-        case epbcXY:
-            n = (ir->nwall == 0 ? 3 : 2);
-            break;
-        case epbcSCREW:
-            n = 1;
-            break;
-        default:
-            gmx_incons("Unknown pbc in calc_nrdf");
-    }
-
-    return n;
-}
-
 //! Do the real arithmetic for filling the pbc struct
 static void low_set_pbc(t_pbc *pbc, int ePBC,
                         const ivec dd_pbc, const matrix box)
@@ -390,7 +354,7 @@ static void low_set_pbc(t_pbc *pbc, int ePBC,
     }
     else
     {
-        if (ePBC == epbcSCREW && NULL != dd_pbc)
+        if (ePBC == epbcSCREW && nullptr != dd_pbc)
         {
             /* This combinated should never appear here */
             gmx_incons("low_set_pbc called with screw pbc and dd_nc != NULL");
@@ -612,7 +576,7 @@ void set_pbc(t_pbc *pbc, int ePBC, const matrix box)
         ePBC = guess_ePBC(box);
     }
 
-    low_set_pbc(pbc, ePBC, NULL, box);
+    low_set_pbc(pbc, ePBC, nullptr, box);
 }
 
 t_pbc *set_pbc_dd(t_pbc *pbc, int ePBC,
@@ -623,12 +587,12 @@ t_pbc *set_pbc_dd(t_pbc *pbc, int ePBC,
     {
         pbc->ePBC = ePBC;
 
-        return NULL;
+        return nullptr;
     }
 
     if (nullptr == domdecCells)
     {
-        low_set_pbc(pbc, ePBC, NULL, box);
+        low_set_pbc(pbc, ePBC, nullptr, box);
     }
     else
     {
@@ -661,7 +625,7 @@ t_pbc *set_pbc_dd(t_pbc *pbc, int ePBC,
         }
     }
 
-    return (pbc->ePBC != epbcNONE ? pbc : NULL);
+    return (pbc->ePBC != epbcNONE ? pbc : nullptr);
 }
 
 void pbc_dx(const t_pbc *pbc, const rvec x1, const rvec x2, rvec dx)
@@ -1234,92 +1198,6 @@ void pbc_dx_d(const t_pbc *pbc, const dvec x1, const dvec x2, dvec dx)
     }
 }
 
-//! Compute the box image corresponding to input vectors
-gmx_bool image_rect(ivec xi, ivec xj, ivec box_size, real rlong2, int *shift, real *r2)
-{
-    int     m, t;
-    int     dx, b, b_2;
-    real    dxr, rij2;
-
-    rij2 = 0.0;
-    t    = 0;
-    for (m = 0; (m < DIM); m++)
-    {
-        dx  = xi[m]-xj[m];
-        t  *= DIM;
-        b   = box_size[m];
-        b_2 = b/2;
-        if (dx < -b_2)
-        {
-            t  += 2;
-            dx += b;
-        }
-        else if (dx > b_2)
-        {
-            dx -= b;
-        }
-        else
-        {
-            t += 1;
-        }
-        dxr   = dx;
-        rij2 += dxr*dxr;
-        if (rij2 >= rlong2)
-        {
-            return FALSE;
-        }
-    }
-
-    *shift = t;
-    *r2    = rij2;
-    return TRUE;
-}
-
-gmx_bool image_cylindric(ivec xi, ivec xj, ivec box_size, real rlong2,
-                         int *shift, real *r2)
-{
-    int     m, t;
-    int     dx, b, b_2;
-    real    dxr, rij2;
-
-    rij2 = 0.0;
-    t    = 0;
-    for (m = 0; (m < DIM); m++)
-    {
-        dx  = xi[m]-xj[m];
-        t  *= DIM;
-        b   = box_size[m];
-        b_2 = b/2;
-        if (dx < -b_2)
-        {
-            t  += 2;
-            dx += b;
-        }
-        else if (dx > b_2)
-        {
-            dx -= b;
-        }
-        else
-        {
-            t += 1;
-        }
-
-        dxr   = dx;
-        rij2 += dxr*dxr;
-        if (m < ZZ)
-        {
-            if (rij2 >= rlong2)
-            {
-                return FALSE;
-            }
-        }
-    }
-
-    *shift = t;
-    *r2    = rij2;
-    return TRUE;
-}
-
 void calc_shifts(const matrix box, rvec shift_vec[])
 {
     int k, l, m, d, n, test;
index ea0148da22b331e4befe07e56197066ffd2c2c2e..23dab9ac1f49b60f7fa5fe729727d8f3e731be2d 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, by the GROMACS development team, led by
+ * Copyright (c) 2012,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.
@@ -44,7 +44,6 @@
 #include "gromacs/utility/real.h"
 
 struct gmx_domdec_t;
-struct t_inputrec;
 
 #ifdef __cplusplus
 extern "C" {
@@ -131,14 +130,6 @@ struct t_graph;
  */
 int ePBC2npbcdim(int ePBC);
 
-/*! \brief Return the number of bounded directories
- *
- * \param[in] ir The input record with MD parameters
- * \return the number of dimensions in which
- * the coordinates of the particles are bounded, starting at X.
- */
-int inputrec2nboundeddim(const t_inputrec *ir);
-
 /*! \brief Dump the contents of the pbc structure to the file
  *
  * \param[in] fp  The file pointer to write to
@@ -190,13 +181,6 @@ int guess_ePBC(const matrix box);
  */
 gmx_bool correct_box(FILE *fplog, int step, tensor box, struct t_graph *graph);
 
-/*! \brief Returns the number of degrees of freedom in center of mass motion
- *
- * \param[in] ir the inputrec structure
- * \return the number of degrees of freedom of the center of mass
- */
-int ndof_com(t_inputrec *ir);
-
 /*! \brief Initiate the periodic boundary condition algorithms.
  *
  * pbc_dx will not use pbc and return the normal difference vector
@@ -271,50 +255,6 @@ int pbc_dx_aiuc(const t_pbc *pbc, const rvec x1, const rvec x2, rvec dx);
  */
 void pbc_dx_d(const t_pbc *pbc, const dvec x1, const dvec x2, dvec dx);
 
-/*! \brief Calculate the distance between xi and xj for a rectangular box.
- *
- * It is assumed that rlong2 is scaled the same way as the ivecs xi and xj.
- * \param[in]  xi     Box index
- * \param[in]  xj     Box index
- * \param[in]  box    The box of grid cells
- * \param[in]  rlong2 Cutoff squared
- * \param[out] shift  The shift code
- * \param[out] r2     The distance (squared???)
- * \return TRUE when the distance is SMALLER than rlong2
- */
-gmx_bool image_rect(ivec xi, ivec xj, imatrix box,
-                    real rlong2, int *shift, real *r2);
-
-/*! \brief Calculate the distance between xi and xj for a triclinic box.
- *
- * It is assumed that rlong2 is scaled the same way as the ivecs xi and xj.
- * \param[in]  xi     Box index
- * \param[in]  xj     Box index
- * \param[in]  box    Matrix of box grid cells
- * \param[in]  rlong2 Cutoff squared
- * \param[out] shift  The shift code
- * \param[out] r2     The distance (squared???)
- * \return TRUE when the distance is SMALLER than rlong2
- */
-gmx_bool image_tri(const ivec xi, const ivec xj, const imatrix box,
-                   real rlong2, int *shift, real *r2);
-
-/*! \brief Compute distance vector when using cylindrical cutoff
- *
- * Calculate the distance between xi and xj for a rectangular box
- * using a cylindric cutoff for long-range only.
- * It is assumed that rlong2 is scaled the same way as the ivecs xi and xj.
- * \param[in]  xi       Box index
- * \param[in]  xj       Box index
- * \param[in]  box_size Number of box grid cells
- * \param[in]  rlong2   Cutoff squared
- * \param[out] shift    The shift code
- * \param[out] r2       The distance (squared???)
- * \return TRUE when the distance is SMALLER than rlong2 (in X and Y dir)
- */
-gmx_bool image_cylindric(const ivec xi, const ivec xj, const ivec box_size,
-                         real rlong2, int *shift, real *r2);
-
 /*! \brief Computes shift vectors
  *
  * This routine calculates ths shift vectors necessary to use the
index 0a8df5247c2bdd83cb4350fe85b92ad4c73a54e0..baa8c0e197232efe151a98770229ec3498944ed4 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,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.
@@ -73,14 +73,14 @@ static t_graph *gmx_rmpbc_get_graph(gmx_rmpbc_t gpbc, int ePBC, int natoms)
     rmpbc_graph_t *gr;
 
     if (ePBC == epbcNONE
-        || NULL == gpbc
-        || NULL == gpbc->idef
+        || nullptr == gpbc
+        || nullptr == gpbc->idef
         || gpbc->idef->ntypes <= 0)
     {
-        return NULL;
+        return nullptr;
     }
 
-    gr = NULL;
+    gr = nullptr;
     for (i = 0; i < gpbc->ngraph; i++)
     {
         if (natoms == gpbc->graph[i].natoms)
@@ -88,7 +88,7 @@ static t_graph *gmx_rmpbc_get_graph(gmx_rmpbc_t gpbc, int ePBC, int natoms)
             gr = &gpbc->graph[i];
         }
     }
-    if (gr == NULL)
+    if (gr == nullptr)
     {
         /* We'd like to check with the number of atoms in the topology,
          * but we don't have that available.
@@ -103,7 +103,7 @@ static t_graph *gmx_rmpbc_get_graph(gmx_rmpbc_t gpbc, int ePBC, int natoms)
         srenew(gpbc->graph, gpbc->ngraph);
         gr         = &gpbc->graph[gpbc->ngraph-1];
         gr->natoms = natoms;
-        gr->gr     = mk_graph(NULL, gpbc->idef, 0, natoms, FALSE, FALSE);
+        gr->gr     = mk_graph(nullptr, gpbc->idef, 0, natoms, FALSE, FALSE);
     }
 
     return gr->gr;
@@ -140,14 +140,14 @@ void gmx_rmpbc_done(gmx_rmpbc_t gpbc)
 {
     int i;
 
-    if (NULL != gpbc)
+    if (nullptr != gpbc)
     {
         for (i = 0; i < gpbc->ngraph; i++)
         {
             done_graph(gpbc->graph[i].gr);
             sfree(gpbc->graph[i].gr);
         }
-        if (gpbc->graph != NULL)
+        if (gpbc->graph != nullptr)
         {
             sfree(gpbc->graph);
         }
@@ -157,7 +157,7 @@ void gmx_rmpbc_done(gmx_rmpbc_t gpbc)
 
 static int gmx_rmpbc_ePBC(gmx_rmpbc_t gpbc, const matrix box)
 {
-    if (NULL != gpbc && gpbc->ePBC >= 0)
+    if (nullptr != gpbc && gpbc->ePBC >= 0)
     {
         return gpbc->ePBC;
     }
@@ -174,7 +174,7 @@ void gmx_rmpbc(gmx_rmpbc_t gpbc, int natoms, const matrix box, rvec x[])
 
     ePBC = gmx_rmpbc_ePBC(gpbc, box);
     gr   = gmx_rmpbc_get_graph(gpbc, ePBC, natoms);
-    if (gr != NULL)
+    if (gr != nullptr)
     {
         mk_mshift(stdout, gr, ePBC, box, x);
         shift_self(gr, box, x);
@@ -189,7 +189,7 @@ void gmx_rmpbc_copy(gmx_rmpbc_t gpbc, int natoms, const matrix box, rvec x[], rv
 
     ePBC = gmx_rmpbc_ePBC(gpbc, box);
     gr   = gmx_rmpbc_get_graph(gpbc, ePBC, natoms);
-    if (gr != NULL)
+    if (gr != nullptr)
     {
         mk_mshift(stdout, gr, ePBC, box, x);
         shift_x(gr, box, x, x_s);
@@ -212,7 +212,7 @@ void gmx_rmpbc_trxfr(gmx_rmpbc_t gpbc, t_trxframe *fr)
     {
         ePBC = gmx_rmpbc_ePBC(gpbc, fr->box);
         gr   = gmx_rmpbc_get_graph(gpbc, ePBC, fr->natoms);
-        if (gr != NULL)
+        if (gr != nullptr)
         {
             mk_mshift(stdout, gr, ePBC, fr->box, fr->x);
             shift_self(gr, fr->box, fr->x);
index b77a7fcacf8d2357d3b7d1fd132f4408a7644692..47a82c8a77d56c97ca435ccf1db14bcb5a64a128 100644 (file)
 #include "gromacs/mdtypes/mdatom.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/pulling/pull_internal.h"
-#include "gromacs/topology/mtop_util.h"
+#include "gromacs/topology/mtop_lookup.h"
 #include "gromacs/topology/topology.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/mutex.h"
 #include "gromacs/utility/pleasecite.h"
 #include "gromacs/utility/real.h"
 #include "gromacs/utility/smalloc.h"
@@ -286,13 +287,14 @@ static void set_legend_for_coord_components(const pull_coord_work_t *pcrd, int c
 
 static FILE *open_pull_out(const char *fn, struct pull_t *pull,
                            const gmx_output_env_t *oenv,
-                           gmx_bool bCoord, unsigned long Flags)
+                           gmx_bool bCoord,
+                           const ContinuationOptions &continuationOptions)
 {
     FILE  *fp;
     int    nsets, c, m;
     char **setname, buf[50];
 
-    if (Flags & MD_APPENDFILES)
+    if (continuationOptions.appendFiles)
     {
         fp = gmx_fio_fopen(fn, "a+");
     }
@@ -1328,7 +1330,7 @@ static void do_constraint(struct pull_t *pull, t_pbc *pbc,
         /* Accumulate the forces, in case we have multiple constraint steps */
         pcrd->f_scal += dr_tot[c]/((pull->group[pcrd->params.group[0]].invtm + pull->group[pcrd->params.group[1]].invtm)*dt*dt);
 
-        if (vir != NULL && pcrd->params.eGeom != epullgDIRPBC && bMaster)
+        if (vir != nullptr && pcrd->params.eGeom != epullgDIRPBC && bMaster)
         {
             double f_invr;
 
@@ -1366,7 +1368,7 @@ static void add_virial_coord_dr(tensor vir, const dvec dr, const dvec f)
 /* Adds the pull contribution to the virial */
 static void add_virial_coord(tensor vir, const pull_coord_work_t *pcrd)
 {
-    if (vir != NULL && pcrd->params.eGeom != epullgDIRPBC)
+    if (vir != nullptr && pcrd->params.eGeom != epullgDIRPBC)
     {
         /* Add the pull contribution for each distance vector to the virial. */
         add_virial_coord_dr(vir, pcrd->dr01, pcrd->f01);
@@ -1561,12 +1563,21 @@ static void calc_pull_coord_vector_force(pull_coord_work_t *pcrd)
 }
 
 
+/* We use a global mutex for locking access to the pull data structure
+ * during registration of external pull potential providers.
+ * We could use a different, local mutex for each pull object, but the overhead
+ * is extremely small here and registration is only done during initialization.
+ */
+static gmx::Mutex registrationMutex;
+
+using Lock = gmx::lock_guard<gmx::Mutex>;
+
 void register_external_pull_potential(struct pull_t *pull,
                                       int            coord_index,
                                       const char    *provider)
 {
-    GMX_RELEASE_ASSERT(pull != NULL, "register_external_pull_potential called before init_pull");
-    GMX_RELEASE_ASSERT(provider != NULL, "register_external_pull_potential called with NULL as provider name");
+    GMX_RELEASE_ASSERT(pull != nullptr, "register_external_pull_potential called before init_pull");
+    GMX_RELEASE_ASSERT(provider != nullptr, "register_external_pull_potential called with NULL as provider name");
 
     if (coord_index < 0 || coord_index > pull->ncoord - 1)
     {
@@ -1582,7 +1593,7 @@ void register_external_pull_potential(struct pull_t *pull,
                   provider, coord_index + 1, epull_names[pcrd->params.eType], epull_names[epullEXTERNAL]);
     }
 
-    GMX_RELEASE_ASSERT(pcrd->params.externalPotentialProvider != NULL, "The external potential provider string for a pull coordinate is NULL");
+    GMX_RELEASE_ASSERT(pcrd->params.externalPotentialProvider != nullptr, "The external potential provider string for a pull coordinate is NULL");
 
     if (gmx_strcasecmp(provider, pcrd->params.externalPotentialProvider) != 0)
     {
@@ -1590,16 +1601,22 @@ void register_external_pull_potential(struct pull_t *pull,
                   provider, coord_index + 1, pcrd->params.externalPotentialProvider);
     }
 
+    /* Lock to avoid (extremely unlikely) simultaneous reading and writing of
+     * pcrd->bExternalPotentialProviderHasBeenRegistered and
+     * pull->numUnregisteredExternalPotentials.
+     */
+    Lock registrationLock(registrationMutex);
+
     if (pcrd->bExternalPotentialProviderHasBeenRegistered)
     {
-        gmx_fatal(FARGS, "Module '%s' attempted to register an external potential for pull coordinate %d multiple times",
+        gmx_fatal(FARGS, "Module '%s' attempted to register an external potential for pull coordinate %d more than once",
                   provider, coord_index + 1);
     }
 
     pcrd->bExternalPotentialProviderHasBeenRegistered = true;
     pull->numUnregisteredExternalPotentials--;
 
-    GMX_RELEASE_ASSERT(pull->numUnregisteredExternalPotentials >= 0, "Negative unregisterd potentials, the pull code in inconsistent");
+    GMX_RELEASE_ASSERT(pull->numUnregisteredExternalPotentials >= 0, "Negative unregistered potentials, the pull code is inconsistent");
 }
 
 
@@ -1703,7 +1720,7 @@ real pull_potential(struct pull_t *pull, t_mdatoms *md, t_pbc *pbc,
     {
         real dVdl = 0;
 
-        pull_calc_coms(cr, pull, md, pbc, t, x, NULL);
+        pull_calc_coms(cr, pull, md, pbc, t, x, nullptr);
 
         for (int c = 0; c < pull->ncoord; c++)
         {
@@ -1715,7 +1732,7 @@ real pull_potential(struct pull_t *pull, t_mdatoms *md, t_pbc *pbc,
             }
 
             do_pull_pot_coord(pull, c, pbc, t, lambda,
-                              &V, MASTER(cr) ? vir : NULL, &dVdl);
+                              &V, MASTER(cr) ? vir : nullptr, &dVdl);
 
             /* Distribute the force over the atoms in the pulled groups */
             apply_forces_coord(pull, c, md, f);
@@ -1772,13 +1789,13 @@ static void make_local_pull_group(gmx_ga2la_t *ga2la,
             {
                 pg->nalloc_loc = over_alloc_dd(pg->nat_loc+1);
                 srenew(pg->ind_loc, pg->nalloc_loc);
-                if (pg->epgrppbc == epgrppbcCOS || pg->params.weight != NULL)
+                if (pg->epgrppbc == epgrppbcCOS || pg->params.weight != nullptr)
                 {
                     srenew(pg->weight_loc, pg->nalloc_loc);
                 }
             }
             pg->ind_loc[pg->nat_loc] = ii;
-            if (pg->params.weight != NULL)
+            if (pg->params.weight != nullptr)
             {
                 pg->weight_loc[pg->nat_loc] = pg->params.weight[i];
             }
@@ -1805,13 +1822,13 @@ void dd_make_local_pull_groups(t_commrec *cr, struct pull_t *pull, t_mdatoms *md
     }
     else
     {
-        ga2la = NULL;
+        ga2la = nullptr;
     }
 
     /* We always make the master node participate, such that it can do i/o
      * and to simplify MC type extensions people might have.
      */
-    bMustParticipate = (comm->bParticipateAll || dd == NULL || DDMASTER(dd));
+    bMustParticipate = (comm->bParticipateAll || dd == nullptr || DDMASTER(dd));
 
     for (g = 0; g < pull->ngroup; g++)
     {
@@ -1853,7 +1870,7 @@ void dd_make_local_pull_groups(t_commrec *cr, struct pull_t *pull, t_mdatoms *md
             (comm->bParticipate &&
              comm->must_count >= comm->setup_count - history_count);
 
-        if (debug && dd != NULL)
+        if (debug && dd != nullptr)
         {
             fprintf(debug, "Our DD rank (%3d) pull #atoms>0 or master: %d, will be part %d\n",
                     dd->rank, bMustParticipate, bWillParticipate);
@@ -1917,13 +1934,6 @@ static void init_pull_group_index(FILE *fplog, t_commrec *cr,
                                   const gmx_mtop_t *mtop,
                                   const t_inputrec *ir, real lambda)
 {
-    int                   i, ii, d, nfrozen, ndim;
-    real                  m, w, mbd;
-    double                tmass, wmass, wwmass;
-    const gmx_groups_t   *groups;
-    gmx_mtop_atomlookup_t alook;
-    t_atom               *atom;
-
     if (EI_ENERGY_MINIMIZATION(ir->eI) || ir->eI == eiBD)
     {
         /* There are no masses in the integrator.
@@ -1941,8 +1951,8 @@ static void init_pull_group_index(FILE *fplog, t_commrec *cr,
     {
         pg->nat_loc    = 0;
         pg->nalloc_loc = 0;
-        pg->ind_loc    = NULL;
-        pg->weight_loc = NULL;
+        pg->ind_loc    = nullptr;
+        pg->weight_loc = nullptr;
     }
     else
     {
@@ -1958,21 +1968,20 @@ static void init_pull_group_index(FILE *fplog, t_commrec *cr,
         }
     }
 
-    groups = &mtop->groups;
+    const gmx_groups_t *groups = &mtop->groups;
 
-    alook = gmx_mtop_atomlookup_init(mtop);
-
-    nfrozen = 0;
-    tmass   = 0;
-    wmass   = 0;
-    wwmass  = 0;
-    for (i = 0; i < pg->params.nat; i++)
+    /* Count frozen dimensions and (weighted) mass */
+    int    nfrozen = 0;
+    double tmass   = 0;
+    double wmass   = 0;
+    double wwmass  = 0;
+    int    molb    = 0;
+    for (int i = 0; i < pg->params.nat; i++)
     {
-        ii = pg->params.ind[i];
-        gmx_mtop_atomnr_to_atom(alook, ii, &atom);
+        int ii = pg->params.ind[i];
         if (bConstraint && ir->opts.nFreeze)
         {
-            for (d = 0; d < DIM; d++)
+            for (int d = 0; d < DIM; d++)
             {
                 if (pulldim_con[d] == 1 &&
                     ir->opts.nFreeze[ggrpnr(groups, egcFREEZE, ii)][d])
@@ -1981,14 +1990,17 @@ static void init_pull_group_index(FILE *fplog, t_commrec *cr,
                 }
             }
         }
+        const t_atom &atom = mtopGetAtomParameters(mtop, ii, &molb);
+        real          m;
         if (ir->efep == efepNO)
         {
-            m = atom->m;
+            m = atom.m;
         }
         else
         {
-            m = (1 - lambda)*atom->m + lambda*atom->mB;
+            m = (1 - lambda)*atom.m + lambda*atom.mB;
         }
+        real w;
         if (pg->params.nweight > 0)
         {
             w = pg->params.weight[i];
@@ -2006,13 +2018,14 @@ static void init_pull_group_index(FILE *fplog, t_commrec *cr,
         }
         else if (ir->eI == eiBD)
         {
+            real mbd;
             if (ir->bd_fric)
             {
                 mbd = ir->bd_fric*ir->delta_t;
             }
             else
             {
-                if (groups->grpnr[egcTC] == NULL)
+                if (groups->grpnr[egcTC] == nullptr)
                 {
                     mbd = ir->delta_t/ir->opts.tau_t[0];
                 }
@@ -2030,8 +2043,6 @@ static void init_pull_group_index(FILE *fplog, t_commrec *cr,
         wwmass += m*w*w;
     }
 
-    gmx_mtop_atomlookup_destroy(alook);
-
     if (wmass == 0)
     {
         /* We can have single atom groups with zero mass with potential pulling
@@ -2072,8 +2083,8 @@ static void init_pull_group_index(FILE *fplog, t_commrec *cr,
     }
     else
     {
-        ndim = 0;
-        for (d = 0; d < DIM; d++)
+        int ndim = 0;
+        for (int d = 0; d < DIM; d++)
         {
             ndim += pulldim_con[d]*pg->params.nat;
         }
@@ -2095,7 +2106,8 @@ init_pull(FILE *fplog, const pull_params_t *pull_params, const t_inputrec *ir,
           int nfile, const t_filenm fnm[],
           const gmx_mtop_t *mtop, t_commrec *cr,
           const gmx_output_env_t *oenv, real lambda,
-          gmx_bool bOutFile, unsigned long Flags)
+          gmx_bool bOutFile,
+          const ContinuationOptions &continuationOptions)
 {
     struct pull_t *pull;
     pull_comm_t   *comm;
@@ -2106,8 +2118,8 @@ init_pull(FILE *fplog, const pull_params_t *pull_params, const t_inputrec *ir,
     /* Copy the pull parameters */
     pull->params       = *pull_params;
     /* Avoid pointer copies */
-    pull->params.group = NULL;
-    pull->params.coord = NULL;
+    pull->params.group = nullptr;
+    pull->params.coord = nullptr;
 
     pull->ncoord       = pull_params->ncoord;
     pull->ngroup       = pull_params->ngroup;
@@ -2396,7 +2408,7 @@ init_pull(FILE *fplog, const pull_params_t *pull_params, const t_inputrec *ir,
                     }
                     else
                     {
-                        if (pgrp->params.weight != NULL)
+                        if (pgrp->params.weight != nullptr)
                         {
                             gmx_fatal(FARGS, "Pull groups can not have relative weights and cosine weighting at same time");
                         }
@@ -2453,9 +2465,9 @@ init_pull(FILE *fplog, const pull_params_t *pull_params, const t_inputrec *ir,
 
 #if GMX_MPI
     /* Use a sub-communicator when we have more than 32 ranks */
-    comm->bParticipateAll = (cr == NULL || !DOMAINDECOMP(cr) ||
+    comm->bParticipateAll = (cr == nullptr || !DOMAINDECOMP(cr) ||
                              cr->dd->nnodes <= 32 ||
-                             getenv("GMX_PULL_PARTICIPATE_ALL") != NULL);
+                             getenv("GMX_PULL_PARTICIPATE_ALL") != nullptr);
     /* This sub-commicator is not used with comm->bParticipateAll,
      * so we can always initialize it to NULL.
      */
@@ -2469,21 +2481,21 @@ init_pull(FILE *fplog, const pull_params_t *pull_params, const t_inputrec *ir,
     comm->setup_count     = 0;
     comm->must_count      = 0;
 
-    if (!comm->bParticipateAll && fplog != NULL)
+    if (!comm->bParticipateAll && fplog != nullptr)
     {
         fprintf(fplog, "Will use a sub-communicator for pull communication\n");
     }
 
-    comm->rbuf     = NULL;
-    comm->dbuf     = NULL;
-    comm->dbuf_cyl = NULL;
+    comm->rbuf     = nullptr;
+    comm->dbuf     = nullptr;
+    comm->dbuf_cyl = nullptr;
 
     /* We still need to initialize the PBC reference coordinates */
     pull->bSetPBCatoms = TRUE;
 
     /* Only do I/O when we are doing dynamics and if we are the MASTER */
-    pull->out_x = NULL;
-    pull->out_f = NULL;
+    pull->out_x = nullptr;
+    pull->out_f = nullptr;
     if (bOutFile)
     {
         /* Check for px and pf filename collision, if we are writing
@@ -2512,9 +2524,9 @@ init_pull(FILE *fplog, const pull_params_t *pull_params, const t_inputrec *ir,
                 }
                 GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
                 pull->out_x   = open_pull_out(px_appended.c_str(), pull, oenv,
-                                              TRUE, Flags);
+                                              TRUE, continuationOptions);
                 pull->out_f = open_pull_out(pf_appended.c_str(), pull, oenv,
-                                            FALSE, Flags);
+                                            FALSE, continuationOptions);
                 return pull;
             }
             else
@@ -2527,12 +2539,12 @@ init_pull(FILE *fplog, const pull_params_t *pull_params, const t_inputrec *ir,
         if (pull->params.nstxout != 0)
         {
             pull->out_x = open_pull_out(opt2fn("-px", nfile, fnm), pull, oenv,
-                                        TRUE, Flags);
+                                        TRUE, continuationOptions);
         }
         if (pull->params.nstfout != 0)
         {
             pull->out_f = open_pull_out(opt2fn("-pf", nfile, fnm), pull, oenv,
-                                        FALSE, Flags);
+                                        FALSE, continuationOptions);
         }
     }
 
index d0c4f934e868f9ccdf32ec1ddf325595f5c57e08..f5002ded235a4720c89de43e9dadc2415738ab8f 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,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.
@@ -62,6 +62,7 @@
 extern "C" {
 #endif
 
+struct ContinuationOptions;
 struct gmx_mtop_t;
 struct gmx_output_env_t;
 struct pull_params_t;
@@ -122,6 +123,8 @@ void get_pull_coord_value(struct pull_t      *pull,
  * will exit with a (release) assertion failure when used incorrely or
  * with a fatal error when the user (mdp) input in inconsistent.
  *
+ * Thread-safe for simultaneous registration from multiple threads.
+ *
  * \param[in,out] pull         The pull struct.
  * \param[in]     coord_index  The pull coordinate index to register the external potential for.
  * \param[in]     provider     Provider string, should match the potential-provider pull coordinate mdp option.
@@ -225,20 +228,19 @@ void dd_make_local_pull_groups(t_commrec *cr,
  * \param oenv        Output options.
  * \param lambda      FEP lambda.
  * \param bOutFile    Open output files?
- * \param Flags       Flags passed over from main, used to determine
- *                    whether or not we are appending.
+ * \param continuationOptions  Options for continuing from checkpoint file
  */
-struct pull_t *init_pull(FILE                   *fplog,
-                         const pull_params_t    *pull_params,
-                         const t_inputrec       *ir,
-                         int                     nfile,
-                         const t_filenm          fnm[],
-                         const gmx_mtop_t       *mtop,
-                         t_commrec             * cr,
-                         const gmx_output_env_t *oenv,
-                         real                    lambda,
-                         gmx_bool                bOutFile,
-                         unsigned long           Flags);
+struct pull_t *init_pull(FILE                      *fplog,
+                         const pull_params_t       *pull_params,
+                         const t_inputrec          *ir,
+                         int                        nfile,
+                         const t_filenm             fnm[],
+                         const gmx_mtop_t          *mtop,
+                         t_commrec                * cr,
+                         const gmx_output_env_t    *oenv,
+                         real                       lambda,
+                         gmx_bool                   bOutFile,
+                         const ContinuationOptions &continuationOptions);
 
 
 /*! \brief Close the pull output files.
index a9e1bac40dedaa320789d02187251c08f1621a34..0f5b83e77ceedcae4482d3a83a2aa4b4e4d0a88f 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
@@ -47,7 +47,7 @@
 #include <algorithm>
 
 #include "gromacs/commandline/filenm.h"
-#include "gromacs/domdec/domdec.h"
+#include "gromacs/domdec/dlbtiming.h"
 #include "gromacs/domdec/domdec_struct.h"
 #include "gromacs/domdec/ga2la.h"
 #include "gromacs/fileio/gmxfio.h"
@@ -65,6 +65,7 @@
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/timing/cyclecounter.h"
 #include "gromacs/timing/wallcycle.h"
+#include "gromacs/topology/mtop_lookup.h"
 #include "gromacs/topology/mtop_util.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/pleasecite.h"
@@ -124,7 +125,7 @@ typedef struct gmx_enfrot
     real             *mpi_inbuf;   /* MPI buffer                                     */
     real             *mpi_outbuf;  /* MPI buffer                                     */
     int               mpi_bufsize; /* Allocation size of in & outbuf                 */
-    unsigned long     Flags;       /* mdrun flags                                    */
+    gmx_bool          appendFiles; /* If true, append output files                   */
     gmx_bool          bOut;        /* Used to skip first output when appending to
                                     * avoid duplicate entries in rotation outfiles   */
 } t_gmx_enfrot;
@@ -266,7 +267,7 @@ static gmx_bool HavePotFitGroups(t_rot *rot)
 static double** allocate_square_matrix(int dim)
 {
     int      i;
-    double** mat = NULL;
+    double** mat = nullptr;
 
 
     snew(mat, dim);
@@ -665,7 +666,7 @@ static void get_slab_centers(
     } /* END of loop over slabs */
 
     /* Output on the master */
-    if ( (NULL != out_slabs) && bOutStep)
+    if ( (nullptr != out_slabs) && bOutStep)
     {
         fprintf(out_slabs, "%12.3e%6d", time, g);
         for (j = erg->slab_first; j <= erg->slab_last; j++)
@@ -789,7 +790,7 @@ static FILE *open_slab_out(const char *fn, t_rot *rot)
     t_rotgrp  *rotg;
 
 
-    if (rot->enfrot->Flags & MD_APPENDFILES)
+    if (rot->enfrot->appendFiles)
     {
         fp = gmx_fio_fopen(fn, "a");
     }
@@ -861,10 +862,10 @@ static FILE *open_rot_out(const char *fn, t_rot *rot, const gmx_output_env_t *oe
     char            buf[50], buf2[75];
     gmx_enfrotgrp_t erg;       /* Pointer to enforced rotation group data */
     gmx_bool        bFlex;
-    char           *LegendStr = NULL;
+    char           *LegendStr = nullptr;
 
 
-    if (rot->enfrot->Flags & MD_APPENDFILES)
+    if (rot->enfrot->appendFiles)
     {
         fp = gmx_fio_fopen(fn, "a");
     }
@@ -1005,7 +1006,7 @@ static FILE *open_angles_out(const char *fn, t_rot *rot)
     char            buf[100];
 
 
-    if (rot->enfrot->Flags & MD_APPENDFILES)
+    if (rot->enfrot->appendFiles)
     {
         fp = gmx_fio_fopen(fn, "a");
     }
@@ -1089,7 +1090,7 @@ static FILE *open_torque_out(const char *fn, t_rot *rot)
     t_rotgrp  *rotg;
 
 
-    if (rot->enfrot->Flags & MD_APPENDFILES)
+    if (rot->enfrot->appendFiles)
     {
         fp = gmx_fio_fopen(fn, "a");
     }
@@ -1188,7 +1189,7 @@ static void align_with_z(
     int     i, j, k;
     rvec    zet         = {0.0, 0.0, 1.0};
     rvec    rot_axis    = {0.0, 0.0, 0.0};
-    rvec   *rotated_str = NULL;
+    rvec   *rotated_str = nullptr;
     real    ooanorm;
     real    angle;
     matrix  rotmat;
@@ -1287,8 +1288,8 @@ static real opt_angle_analytic(
         rvec  axis)
 {
     int      i, j, k;
-    rvec    *ref_s_1 = NULL;
-    rvec    *act_s_1 = NULL;
+    rvec    *ref_s_1 = nullptr;
+    rvec    *act_s_1 = nullptr;
     rvec     shift;
     double **Rmat, **RtR, **eigvec;
     double   eigval[3];
@@ -1331,7 +1332,7 @@ static real opt_angle_analytic(
     }
 
     /* Weight positions with sqrt(weight) */
-    if (NULL != weight)
+    if (nullptr != weight)
     {
         weigh_coords(ref_s_1, weight, natoms);
         weigh_coords(act_s_1, weight, natoms);
@@ -1454,7 +1455,7 @@ static real opt_angle_analytic(
 static real flex_fit_angle(t_rotgrp *rotg)
 {
     int             i;
-    rvec           *fitcoords = NULL;
+    rvec           *fitcoords = nullptr;
     rvec            center;     /* Center of positions passed to the fit routine */
     real            fitangle;   /* Angle of the rotation group derived by fitting */
     rvec            coord;
@@ -3283,7 +3284,7 @@ static void allocate_slabs(
     /* Remember how many we allocated */
     erg->nslabs_alloc = nslabs;
 
-    if ( (NULL != fplog) && bVerbose)
+    if ( (nullptr != fplog) && bVerbose)
     {
         fprintf(fplog, "%s allocating memory to store data for %d slabs (rotation group %d).\n",
                 RotStr, nslabs, g);
@@ -3390,10 +3391,8 @@ static void init_rot_group(FILE *fplog, t_commrec *cr, int g, t_rotgrp *rotg,
     int                   i, ii;
     rvec                  coord, xref, *xdum;
     gmx_bool              bFlex, bColl;
-    t_atom               *atom;
     gmx_enfrotgrp_t       erg; /* Pointer to enforced rotation group data */
     int                   ref_firstindex, ref_lastindex;
-    gmx_mtop_atomlookup_t alook = NULL;
     real                  mass, totalmass;
     real                  start = 0.0;
     double                t_start;
@@ -3447,7 +3446,7 @@ static void init_rot_group(FILE *fplog, t_commrec *cr, int g, t_rotgrp *rotg,
     }
     else
     {
-        erg->PotAngleFit = NULL;
+        erg->PotAngleFit = nullptr;
     }
 
     /* xc_ref_ind needs to be set to identity in the serial case */
@@ -3461,10 +3460,6 @@ static void init_rot_group(FILE *fplog, t_commrec *cr, int g, t_rotgrp *rotg,
 
     /* Copy the masses so that the center can be determined. For all types of
      * enforced rotation, we store the masses in the erg->mc array. */
-    if (rotg->bMassW)
-    {
-        alook = gmx_mtop_atomlookup_init(mtop);
-    }
     snew(erg->mc, rotg->nat);
     if (bFlex)
     {
@@ -3475,12 +3470,12 @@ static void init_rot_group(FILE *fplog, t_commrec *cr, int g, t_rotgrp *rotg,
         snew(erg->m_loc, rotg->nat);
     }
     totalmass = 0.0;
+    int molb  = 0;
     for (i = 0; i < rotg->nat; i++)
     {
         if (rotg->bMassW)
         {
-            gmx_mtop_atomnr_to_atom(alook, rotg->ind[i], &atom);
-            mass = atom->m;
+            mass = mtopGetAtomMass(mtop, rotg->ind[i], &molb);
         }
         else
         {
@@ -3491,11 +3486,6 @@ static void init_rot_group(FILE *fplog, t_commrec *cr, int g, t_rotgrp *rotg,
     }
     erg->invmass = 1.0/totalmass;
 
-    if (rotg->bMassW)
-    {
-        gmx_mtop_atomlookup_destroy(alook);
-    }
-
     /* Set xc_ref_center for any rotation potential */
     if ((rotg->eType == erotgISO) || (rotg->eType == erotgPM) || (rotg->eType == erotgRM) || (rotg->eType == erotgRM2))
     {
@@ -3668,29 +3658,29 @@ static int calc_mpi_bufsize(t_rot *rot)
 
 extern void init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[],
                      t_commrec *cr, rvec *x, matrix box, gmx_mtop_t *mtop, const gmx_output_env_t *oenv,
-                     gmx_bool bVerbose, unsigned long Flags)
+                     const MdrunOptions &mdrunOptions)
 {
     t_rot          *rot;
     t_rotgrp       *rotg;
     int             g;
-    int             nat_max = 0;  /* Size of biggest rotation group */
-    gmx_enfrot_t    er;           /* Pointer to the enforced rotation buffer variables */
-    gmx_enfrotgrp_t erg;          /* Pointer to enforced rotation group data */
-    rvec           *x_pbc = NULL; /* Space for the pbc-correct atom positions */
+    int             nat_max = 0;     /* Size of biggest rotation group */
+    gmx_enfrot_t    er;              /* Pointer to the enforced rotation buffer variables */
+    gmx_enfrotgrp_t erg;             /* Pointer to enforced rotation group data */
+    rvec           *x_pbc = nullptr; /* Space for the pbc-correct atom positions */
 
 
-    if (MASTER(cr) && bVerbose)
+    if (MASTER(cr) && mdrunOptions.verbose)
     {
         fprintf(stdout, "%s Initializing ...\n", RotStr);
     }
 
     rot = ir->rot;
     snew(rot->enfrot, 1);
-    er        = rot->enfrot;
-    er->Flags = Flags;
+    er              = rot->enfrot;
+    er->appendFiles = mdrunOptions.continuationOptions.appendFiles;
 
     /* When appending, skip first output to avoid duplicate entries in the data files */
-    if (er->Flags & MD_APPENDFILES)
+    if (er->appendFiles)
     {
         er->bOut = FALSE;
     }
@@ -3705,9 +3695,9 @@ extern void init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[
     }
 
     /* Output every step for reruns */
-    if (er->Flags & MD_RERUN)
+    if (mdrunOptions.rerun)
     {
-        if (NULL != fplog)
+        if (nullptr != fplog)
         {
             fprintf(fplog, "%s rerun - will write rotation output every available step.\n", RotStr);
         }
@@ -3715,7 +3705,7 @@ extern void init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[
         rot->nstsout = 1;
     }
 
-    er->out_slabs = NULL;
+    er->out_slabs = nullptr;
     if (MASTER(cr) && HaveFlexibleGroups(rot) )
     {
         er->out_slabs = open_slab_out(opt2fn("-rs", nfile, fnm), rot);
@@ -3727,7 +3717,7 @@ extern void init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[
          * When ir->bContinuation=TRUE this has already been done, but ok. */
         snew(x_pbc, mtop->natoms);
         copy_rvecn(x, x_pbc, 0, mtop->natoms);
-        do_pbc_first_mtop(NULL, ir->ePBC, box, mtop, x_pbc);
+        do_pbc_first_mtop(nullptr, ir->ePBC, box, mtop, x_pbc);
         /* All molecules will be whole now, but not necessarily in the home box.
          * Additionally, if a rotation group consists of more than one molecule
          * (e.g. two strands of DNA), each one of them can end up in a different
@@ -3738,7 +3728,7 @@ extern void init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[
     {
         rotg = &rot->grp[g];
 
-        if (NULL != fplog)
+        if (nullptr != fplog)
         {
             fprintf(fplog, "%s group %d type '%s'\n", RotStr, g, erotg_names[rotg->eType]);
         }
@@ -3755,16 +3745,16 @@ extern void init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[
             {
                 erg->nat_loc    = 0;
                 erg->nalloc_loc = 0;
-                erg->ind_loc    = NULL;
+                erg->ind_loc    = nullptr;
             }
             else
             {
                 erg->nat_loc = rotg->nat;
                 erg->ind_loc = rotg->ind;
             }
-            init_rot_group(fplog, cr, g, rotg, x_pbc, mtop, bVerbose, er->out_slabs, box, ir,
-                           !(er->Flags & MD_APPENDFILES) ); /* Do not output the reference centers
-                                                             * again if we are appending */
+            init_rot_group(fplog, cr, g, rotg, x_pbc, mtop, mdrunOptions.verbose, er->out_slabs, box, ir,
+                           !er->appendFiles); /* Do not output the reference centers
+                                               * again if we are appending */
         }
     }
 
@@ -3784,14 +3774,14 @@ extern void init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[
     else
     {
         er->mpi_bufsize = 0;
-        er->mpi_inbuf   = NULL;
-        er->mpi_outbuf  = NULL;
+        er->mpi_inbuf   = nullptr;
+        er->mpi_outbuf  = nullptr;
     }
 
     /* Only do I/O on the MASTER */
-    er->out_angles  = NULL;
-    er->out_rot     = NULL;
-    er->out_torque  = NULL;
+    er->out_angles  = nullptr;
+    er->out_rot     = nullptr;
+    er->out_torque  = nullptr;
     if (MASTER(cr))
     {
         er->out_rot = open_rot_out(opt2fn("-ro", nfile, fnm), rot, oenv);
@@ -3899,7 +3889,6 @@ extern void do_rotation(
         rvec            x[],
         real            t,
         gmx_int64_t     step,
-        gmx_wallcycle_t wcycle,
         gmx_bool        bNS)
 {
     int             g, i, ii;
@@ -3907,16 +3896,11 @@ extern void do_rotation(
     t_rotgrp       *rotg;
     gmx_bool        outstep_slab, outstep_rot;
     gmx_bool        bColl;
-    gmx_enfrot_t    er;         /* Pointer to the enforced rotation buffer variables */
-    gmx_enfrotgrp_t erg;        /* Pointer to enforced rotation group data           */
+    gmx_enfrot_t    er;            /* Pointer to the enforced rotation buffer variables */
+    gmx_enfrotgrp_t erg;           /* Pointer to enforced rotation group data           */
     rvec            transvec;
-    t_gmx_potfit   *fit = NULL; /* For fit type 'potential' determine the fit
-                                   angle via the potential minimum            */
-
-    /* Enforced rotation cycle counting: */
-    gmx_cycles_t cycles_comp;   /* Cycles for the enf. rotation computation
-                                   only, does not count communication. This
-                                   counter is used for load-balancing         */
+    t_gmx_potfit   *fit = nullptr; /* For fit type 'potential' determine the fit
+                                      angle via the potential minimum            */
 
 #ifdef TAKETIME
     double t0;
@@ -3990,8 +3974,10 @@ extern void do_rotation(
 
     /**************************************************************************/
     /* Done communicating, we can start to count cycles for the load balancing now ... */
-    cycles_comp = gmx_cycles_read();
-
+    if (DOMAINDECOMP(cr))
+    {
+        ddReopenBalanceRegionCpu(cr->dd);
+    }
 
 #ifdef TAKETIME
     t0 = MPI_Wtime();
@@ -4072,13 +4058,4 @@ extern void do_rotation(
         fprintf(stderr, "%s calculation (step %d) took %g seconds.\n", RotStr, step, MPI_Wtime()-t0);
     }
 #endif
-
-    /* Stop the enforced rotation cycle counter and add the computation-only
-     * cycles to the force cycles for load balancing */
-    cycles_comp  = gmx_cycles_read() - cycles_comp;
-
-    if (DOMAINDECOMP(cr) && wcycle)
-    {
-        dd_cycles_add(cr->dd, cycles_comp, ddCyclF);
-    }
 }
index 742d154c7d97f6b361768ff1d1718a81b56a764e..8a282e768895bbe027217379fb755f4446d8fcf7 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
 #ifndef GMX_PULLING_PULL_ROTATION_H
 #define GMX_PULLING_PULL_ROTATION_H
 
+#include <stdio.h>
+
 #include "gromacs/math/vectypes.h"
-#include "gromacs/timing/wallcycle.h"
+#include "gromacs/utility/basedefinitions.h"
 
 struct gmx_domdec_t;
 struct gmx_mtop_t;
 struct gmx_output_env_t;
+struct MdrunOptions;
 struct t_commrec;
 struct t_filenm;
 struct t_inputrec;
@@ -80,13 +83,11 @@ extern "C" {
  * \param box      The simulation box.
  * \param mtop     Molecular topology.
  * \param oenv     Needed to open the rotation output xvgr file.
- * \param bVerbose Whether to print extra status information.
- * \param Flags    Flags passed over from main, used to determine
- *                 whether or not we are doing a rerun.
+ * \param mdrunOptions  Options for mdrun.
  */
 extern void init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[],
                      struct t_commrec *cr, rvec *x, matrix box, gmx_mtop_t *mtop, const gmx_output_env_t *oenv,
-                     gmx_bool bVerbose, unsigned long Flags);
+                     const MdrunOptions &mdrunOptions);
 
 
 /*! \brief Make a selection of the home atoms for all enforced rotation groups.
@@ -112,13 +113,11 @@ extern void dd_make_local_rotation_groups(struct gmx_domdec_t *dd, t_rot *rot);
  * \param x       The positions of all the local particles.
  * \param t       Time.
  * \param step    The time step.
- * \param wcycle  During the potential calculation the wallcycles are
- *                counted. Later they enter the dynamic load balancing.
  * \param bNS     After domain decomposition / neighbor searching several
  *                local arrays have to be updated (masses, shifts)
  */
 extern void do_rotation(struct t_commrec *cr, t_inputrec *ir, matrix box, rvec x[], real t,
-                        gmx_int64_t step, gmx_wallcycle_t wcycle, gmx_bool bNS);
+                        gmx_int64_t step, gmx_bool bNS);
 
 
 /*! \brief Add the enforced rotation forces to the official force array.
index 661b5a4d8841ad8d0686869171717abb9640b7ac..0c62ff647fede330a2c2457742972a1557395f49 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,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.
@@ -65,7 +65,7 @@ static void pull_reduce_real(t_commrec   *cr,
                              int          n,
                              real        *data)
 {
-    if (cr != NULL && PAR(cr))
+    if (cr != nullptr && PAR(cr))
     {
         if (comm->bParticipateAll)
         {
@@ -105,7 +105,7 @@ static void pull_reduce_double(t_commrec   *cr,
                                int          n,
                                double      *data)
 {
-    if (cr != NULL && PAR(cr))
+    if (cr != nullptr && PAR(cr))
     {
         if (comm->bParticipateAll)
         {
@@ -146,7 +146,7 @@ static void pull_set_pbcatom(t_commrec *cr, pull_group_work_t *pgrp,
 {
     int a;
 
-    if (cr != NULL && DOMAINDECOMP(cr))
+    if (cr != nullptr && DOMAINDECOMP(cr))
     {
         if (ga2la_get_home(cr->dd->ga2la, pgrp->params.pbcatom, &a))
         {
@@ -202,11 +202,11 @@ static void make_cyl_refgrps(t_commrec *cr, struct pull_t *pull, t_mdatoms *md,
     rvec            g_x, dx, dir;
     double          inv_cyl_r2;
     pull_comm_t    *comm;
-    gmx_ga2la_t    *ga2la = NULL;
+    gmx_ga2la_t    *ga2la = nullptr;
 
     comm = &pull->comm;
 
-    if (comm->dbuf_cyl == NULL)
+    if (comm->dbuf_cyl == nullptr)
     {
         snew(comm->dbuf_cyl, pull->ncoord*stride);
     }
@@ -346,7 +346,7 @@ static void make_cyl_refgrps(t_commrec *cr, struct pull_t *pull, t_mdatoms *md,
         comm->dbuf_cyl[c*stride+8] = radf_fac1[ZZ];
     }
 
-    if (cr != NULL && PAR(cr))
+    if (cr != nullptr && PAR(cr))
     {
         /* Sum the contributions over the ranks */
         pull_reduce_double(cr, comm, pull->ncoord*stride, comm->dbuf_cyl);
@@ -439,7 +439,7 @@ static void sum_com_part(const pull_group_work_t *pgrp,
     {
         int  ii = pgrp->ind_loc[i];
         real wm;
-        if (pgrp->weight_loc == NULL)
+        if (pgrp->weight_loc == nullptr)
         {
             wm      = mass[ii];
             sum_wm += wm;
@@ -530,7 +530,7 @@ static void sum_com_part_cosweight(const pull_group_work_t *pgrp,
         sum_csm += static_cast<double>(cw*sw*m);
         sum_ssm += static_cast<double>(sw*sw*m);
 
-        if (xp != NULL)
+        if (xp != nullptr)
         {
             real cw  = std::cos(xp[ii][cosdim]*twopi_box);
             real sw  = std::sin(xp[ii][cosdim]*twopi_box);
@@ -559,11 +559,11 @@ void pull_calc_coms(t_commrec *cr,
 
     comm = &pull->comm;
 
-    if (comm->rbuf == NULL)
+    if (comm->rbuf == nullptr)
     {
         snew(comm->rbuf, pull->ngroup);
     }
-    if (comm->dbuf == NULL)
+    if (comm->dbuf == nullptr)
     {
         snew(comm->dbuf, 3*pull->ngroup);
     }
@@ -572,7 +572,7 @@ void pull_calc_coms(t_commrec *cr,
     {
         pull_set_pbcatoms(cr, pull, x, comm->rbuf);
 
-        if (cr != NULL && DOMAINDECOMP(cr))
+        if (cr != nullptr && DOMAINDECOMP(cr))
         {
             /* We can keep these PBC reference coordinates fixed for nstlist
              * steps, since atoms won't jump over PBC.
@@ -672,7 +672,7 @@ void pull_calc_coms(t_commrec *cr,
                     }
                 }
 
-                if (pgrp->weight_loc == NULL)
+                if (pgrp->weight_loc == nullptr)
                 {
                     sum_com->sum_wwm = sum_com->sum_wm;
                 }
index bb05dd0b28291eb3ddc620459d56b295490382ba..ac850cfeb87603918218b2c91ad968dc71ab08aa 100644 (file)
@@ -96,8 +96,9 @@ namespace gmx
  *  produce errors. Even for newer compilers, libstdc++ and libc++ appear to
  *  use different algorithms to generate it, which means their values differ
  *  in contrast to the uniform and normal distributions where they are
- *  identical. To avoid both the gcc-4.6 bug and make it easier to use GROMACS
- *   unit tests that depend on random numbers we have our own implementation.
+ *  identical. To avoid both compiler bugs and make it easier to use
+ *  GROMACS unit tests that depend on random numbers, we have our
+ *  own implementation.
  *
  *  Be warned that the gamma distribution works like the standard
  *  normal distribution and keeps drawing values from the random engine
index f5d0b643a5b54745d0f824ca4ba95495d5cb177c..c290f4641ab6b1e257e2410926d0a6a5a215d8a9 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,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.
@@ -426,11 +426,16 @@ class ThreeFry2x64General
 
     public:
         //! \brief Smallest value that can be returned from random engine.
-        static gmx_constexpr
+#if !defined(_MSC_VER)
+        static constexpr
+#else
+        // Avoid constexpr bug in MSVC 2015, note that max() below does work
+        static
+#endif
         result_type min() { return std::numeric_limits<result_type>::min(); }
 
         //! \brief Largest value that can be returned from random engine.
-        static gmx_constexpr
+        static constexpr
         result_type max() { return std::numeric_limits<result_type>::max(); }
 
         /*! \brief Construct random engine with 2x64 key values
index 7be8c4ed4c2f681aa65ed49b6b38d58d9b445b43..0639890a0db148b09f437eda7c01997ed4340c81 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,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.
 #include "gromacs/math/vec.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/topology/block.h"
+#include "gromacs/topology/mtop_lookup.h"
 #include "gromacs/topology/topology.h"
 #include "gromacs/utility/gmxassert.h"
 
 void
-gmx_calc_cog(const t_topology * /* top */, rvec x[], int nrefat, const int index[], rvec xout)
+gmx_calc_cog(const gmx_mtop_t * /* top */, rvec x[], int nrefat, const int index[], rvec xout)
 {
     int                 m, ai;
 
@@ -74,20 +75,18 @@ gmx_calc_cog(const t_topology * /* top */, rvec x[], int nrefat, const int index
  * mass are calculated, and hence a topology with masses is required.
  */
 void
-gmx_calc_com(const t_topology *top, rvec x[], int nrefat, const int index[], rvec xout)
+gmx_calc_com(const gmx_mtop_t *top, rvec x[], int nrefat, const int index[], rvec xout)
 {
-    int                 m, j, ai;
-    real                mass, mtot;
-
-    GMX_RELEASE_ASSERT(top != nullptr,
+    GMX_RELEASE_ASSERT(gmx_mtop_has_masses(top),
                        "No masses available while mass weighting was requested");
     clear_rvec(xout);
-    mtot = 0;
-    for (m = 0; m < nrefat; ++m)
+    real mtot = 0;
+    int  molb = 0;
+    for (int m = 0; m < nrefat; ++m)
     {
-        ai   = index[m];
-        mass = top->atoms.atom[ai].m;
-        for (j = 0; j < DIM; ++j)
+        const int  ai   = index[m];
+        const real mass = mtopGetAtomMass(top, ai, &molb);
+        for (int j = 0; j < DIM; ++j)
         {
             xout[j] += mass * x[ai][j];
         }
@@ -104,20 +103,18 @@ gmx_calc_com(const t_topology *top, rvec x[], int nrefat, const int index[], rve
  * \param[out] fout   Force on the COG position for the indexed atoms.
  */
 void
-gmx_calc_cog_f(const t_topology *top, rvec f[], int nrefat, const int index[], rvec fout)
+gmx_calc_cog_f(const gmx_mtop_t *top, rvec f[], int nrefat, const int index[], rvec fout)
 {
-    int                 m, j, ai;
-    real                mass, mtot;
-
-    GMX_RELEASE_ASSERT(top != nullptr,
+    GMX_RELEASE_ASSERT(gmx_mtop_has_masses(top),
                        "No masses available while mass weighting was requested");
     clear_rvec(fout);
-    mtot = 0;
-    for (m = 0; m < nrefat; ++m)
+    real mtot = 0;
+    int  molb = 0;
+    for (int m = 0; m < nrefat; ++m)
     {
-        ai   = index[m];
-        mass = top->atoms.atom[ai].m;
-        for (j = 0; j < DIM; ++j)
+        const int  ai   = index[m];
+        const real mass = mtopGetAtomMass(top, ai, &molb);
+        for (int j = 0; j < DIM; ++j)
         {
             fout[j] += f[ai][j] / mass;
         }
@@ -127,7 +124,7 @@ gmx_calc_cog_f(const t_topology *top, rvec f[], int nrefat, const int index[], r
 }
 
 void
-gmx_calc_com_f(const t_topology * /* top */, rvec f[], int nrefat, const int index[], rvec fout)
+gmx_calc_com_f(const gmx_mtop_t * /* top */, rvec f[], int nrefat, const int index[], rvec fout)
 {
     clear_rvec(fout);
     for (int m = 0; m < nrefat; ++m)
@@ -151,7 +148,7 @@ gmx_calc_com_f(const t_topology * /* top */, rvec f[], int nrefat, const int ind
  * Other parameters are passed unmodified to these functions.
  */
 void
-gmx_calc_comg(const t_topology *top, rvec x[], int nrefat, const int index[],
+gmx_calc_comg(const gmx_mtop_t *top, rvec x[], int nrefat, const int index[],
               bool bMass, rvec xout)
 {
     if (bMass)
@@ -178,7 +175,7 @@ gmx_calc_comg(const t_topology *top, rvec x[], int nrefat, const int index[],
  * Other parameters are passed unmodified to these functions.
  */
 void
-gmx_calc_comg_f(const t_topology *top, rvec f[], int nrefat, const int index[],
+gmx_calc_comg_f(const gmx_mtop_t *top, rvec f[], int nrefat, const int index[],
                 bool bMass, rvec fout)
 {
     if (bMass)
@@ -203,7 +200,7 @@ gmx_calc_comg_f(const t_topology *top, rvec f[], int nrefat, const int index[],
  * Works exactly as gmx_calc_com_pbc(), but calculates the center of geometry.
  */
 void
-gmx_calc_cog_pbc(const t_topology *top, rvec x[], t_pbc *pbc,
+gmx_calc_cog_pbc(const gmx_mtop_t *top, rvec x[], const t_pbc *pbc,
                  int nrefat, const int index[], rvec xout)
 {
     const real          tol = 1e-4;
@@ -258,25 +255,20 @@ gmx_calc_cog_pbc(const t_topology *top, rvec x[], t_pbc *pbc,
  * Modified from src/tools/gmx_sorient.c in Gromacs distribution.
  */
 void
-gmx_calc_com_pbc(const t_topology *top, rvec x[], t_pbc *pbc,
+gmx_calc_com_pbc(const gmx_mtop_t *top, rvec x[], const t_pbc *pbc,
                  int nrefat, const int index[], rvec xout)
 {
-    const real          tol = 1e-4;
-    bool                bChanged;
-    int                 m, j, ai, iter;
-    real                mass, mtot;
-    rvec                dx, xtest;
-
-    GMX_RELEASE_ASSERT(top != nullptr,
+    GMX_RELEASE_ASSERT(gmx_mtop_has_masses(top),
                        "No masses available while mass weighting was requested");
     /* First simple calculation */
     clear_rvec(xout);
-    mtot = 0;
-    for (m = 0; m < nrefat; ++m)
+    real mtot = 0;
+    int  molb = 0;
+    for (int m = 0; m < nrefat; ++m)
     {
-        ai   = index[m];
-        mass = top->atoms.atom[ai].m;
-        for (j = 0; j < DIM; ++j)
+        const int  ai   = index[m];
+        const real mass = mtopGetAtomMass(top, ai, &molb);
+        for (int j = 0; j < DIM; ++j)
         {
             xout[j] += mass * x[ai][j];
         }
@@ -286,17 +278,20 @@ gmx_calc_com_pbc(const t_topology *top, rvec x[], t_pbc *pbc,
     /* Now check if any atom is more than half the box from the COM */
     if (pbc)
     {
-        iter = 0;
+        const real tol  = 1e-4;
+        bool       bChanged;
         do
         {
             bChanged = false;
-            for (m = 0; m < nrefat; ++m)
+            molb     = 0;
+            for (int m = 0; m < nrefat; ++m)
             {
-                ai   = index[m];
-                mass = top->atoms.atom[ai].m / mtot;
+                rvec       dx, xtest;
+                const int  ai   = index[m];
+                const real mass = mtopGetAtomMass(top, ai, &molb) / mtot;
                 pbc_dx(pbc, x[ai], xout, dx);
                 rvec_add(xout, dx, xtest);
-                for (j = 0; j < DIM; ++j)
+                for (int j = 0; j < DIM; ++j)
                 {
                     if (fabs(xtest[j] - x[ai][j]) > tol)
                     {
@@ -307,7 +302,6 @@ gmx_calc_com_pbc(const t_topology *top, rvec x[], t_pbc *pbc,
                     }
                 }
             }
-            iter++;
         }
         while (bChanged);
     }
@@ -328,7 +322,7 @@ gmx_calc_com_pbc(const t_topology *top, rvec x[], t_pbc *pbc,
  * Other parameters are passed unmodified to these functions.
  */
 void
-gmx_calc_comg_pbc(const t_topology *top, rvec x[], t_pbc *pbc,
+gmx_calc_comg_pbc(const gmx_mtop_t *top, rvec x[], const t_pbc *pbc,
                   int nrefat, const int index[], bool bMass, rvec xout)
 {
     if (bMass)
@@ -343,7 +337,7 @@ gmx_calc_comg_pbc(const t_topology *top, rvec x[], t_pbc *pbc,
 
 
 void
-gmx_calc_cog_block(const t_topology * /* top */, rvec x[], const t_block *block, const int index[],
+gmx_calc_cog_block(const gmx_mtop_t * /* top */, rvec x[], const t_block *block, const int index[],
                    rvec xout[])
 {
     int                 b, i, ai;
@@ -372,24 +366,22 @@ gmx_calc_cog_block(const t_topology * /* top */, rvec x[], const t_block *block,
  * mass are calculated, and hence a topology with masses is required.
  */
 void
-gmx_calc_com_block(const t_topology *top, rvec x[], const t_block *block, const int index[],
+gmx_calc_com_block(const gmx_mtop_t *top, rvec x[], const t_block *block, const int index[],
                    rvec xout[])
 {
-    int                 b, i, ai, d;
-    rvec                xb;
-    real                mass, mtot;
-
-    GMX_RELEASE_ASSERT(top != nullptr,
+    GMX_RELEASE_ASSERT(gmx_mtop_has_masses(top),
                        "No masses available while mass weighting was requested");
-    for (b = 0; b < block->nr; ++b)
+    int molb = 0;
+    for (int b = 0; b < block->nr; ++b)
     {
+        rvec xb;
         clear_rvec(xb);
-        mtot = 0;
-        for (i = block->index[b]; i < block->index[b+1]; ++i)
+        real mtot = 0;
+        for (int i = block->index[b]; i < block->index[b+1]; ++i)
         {
-            ai   = index[i];
-            mass = top->atoms.atom[ai].m;
-            for (d = 0; d < DIM; ++d)
+            const int  ai   = index[i];
+            const real mass = mtopGetAtomMass(top, ai, &molb);
+            for (int d = 0; d < DIM; ++d)
             {
                 xb[d] += mass * x[ai][d];
             }
@@ -407,24 +399,22 @@ gmx_calc_com_block(const t_topology *top, rvec x[], const t_block *block, const
  * \param[out] fout  \p block->nr Forces on COG positions.
  */
 void
-gmx_calc_cog_f_block(const t_topology *top, rvec f[], const t_block *block, const int index[],
+gmx_calc_cog_f_block(const gmx_mtop_t *top, rvec f[], const t_block *block, const int index[],
                      rvec fout[])
 {
-    int                 b, i, ai, d;
-    rvec                fb;
-    real                mass, mtot;
-
-    GMX_RELEASE_ASSERT(top != nullptr,
+    GMX_RELEASE_ASSERT(gmx_mtop_has_masses(top),
                        "No masses available while mass weighting was requested");
-    for (b = 0; b < block->nr; ++b)
+    int molb = 0;
+    for (int b = 0; b < block->nr; ++b)
     {
+        rvec fb;
         clear_rvec(fb);
-        mtot = 0;
-        for (i = block->index[b]; i < block->index[b+1]; ++i)
+        real mtot = 0;
+        for (int i = block->index[b]; i < block->index[b+1]; ++i)
         {
-            ai   = index[i];
-            mass = top->atoms.atom[ai].m;
-            for (d = 0; d < DIM; ++d)
+            const int  ai   = index[i];
+            const real mass = mtopGetAtomMass(top, ai, &molb);
+            for (int d = 0; d < DIM; ++d)
             {
                 fb[d] += f[ai][d] / mass;
             }
@@ -435,7 +425,7 @@ gmx_calc_cog_f_block(const t_topology *top, rvec f[], const t_block *block, cons
 }
 
 void
-gmx_calc_com_f_block(const t_topology * /* top */, rvec f[], const t_block *block, const int index[],
+gmx_calc_com_f_block(const gmx_mtop_t * /* top */, rvec f[], const t_block *block, const int index[],
                      rvec fout[])
 {
     for (int b = 0; b < block->nr; ++b)
@@ -465,7 +455,7 @@ gmx_calc_com_f_block(const t_topology * /* top */, rvec f[], const t_block *bloc
  * Other parameters are passed unmodified to these functions.
  */
 void
-gmx_calc_comg_block(const t_topology *top, rvec x[], const t_block *block, const int index[],
+gmx_calc_comg_block(const gmx_mtop_t *top, rvec x[], const t_block *block, const int index[],
                     bool bMass, rvec xout[])
 {
     if (bMass)
@@ -492,7 +482,7 @@ gmx_calc_comg_block(const t_topology *top, rvec x[], const t_block *block, const
  * Other parameters are passed unmodified to these functions.
  */
 void
-gmx_calc_comg_f_block(const t_topology *top, rvec f[], const t_block *block, const int index[],
+gmx_calc_comg_f_block(const gmx_mtop_t *top, rvec f[], const t_block *block, const int index[],
                       bool bMass, rvec fout[])
 {
     if (bMass)
@@ -524,11 +514,11 @@ gmx_calc_comg_f_block(const t_topology *top, rvec f[], const t_block *block, con
  * crashes.
  */
 void
-gmx_calc_comg_blocka(const t_topology *top, rvec x[], const t_blocka *block,
+gmx_calc_comg_blocka(const gmx_mtop_t *top, rvec x[], const t_blocka *block,
                      bool bMass, rvec xout[])
 {
     /* TODO: It would probably be better to do this without the type cast */
-    gmx_calc_comg_block(top, x, (t_block *)block, block->a, bMass, xout);
+    gmx_calc_comg_block(top, x, reinterpret_cast<const t_block *>(block), block->a, bMass, xout);
 }
 
 /*!
@@ -550,9 +540,9 @@ gmx_calc_comg_blocka(const t_topology *top, rvec x[], const t_blocka *block,
  * crashes.
  */
 void
-gmx_calc_comg_f_blocka(const t_topology *top, rvec f[], const t_blocka *block,
+gmx_calc_comg_f_blocka(const gmx_mtop_t *top, rvec f[], const t_blocka *block,
                        bool bMass, rvec fout[])
 {
     /* TODO: It would probably be better to do this without the type cast */
-    gmx_calc_comg_f_block(top, f, (t_block *)block, block->a, bMass, fout);
+    gmx_calc_comg_f_block(top, f, reinterpret_cast<const t_block *>(block), block->a, bMass, fout);
 }
index 21058cf7910765b1bb73db3618e04226178d3ae2..12b92b4b92ba6d2efed9308af0b30e99111b2a57 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2013,2014,2015,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.
 
 #include "gromacs/math/vectypes.h"
 
+struct gmx_mtop_t;
 struct t_block;
 struct t_blocka;
 struct t_pbc;
-struct t_topology;
 
 /*! \brief
  * Calculate a single center of geometry.
@@ -91,13 +91,13 @@ struct t_topology;
  * \param[out] xout   COG position for the indexed atoms.
  */
 void
-gmx_calc_cog(const t_topology *top, rvec x[], int nrefat, const int index[], rvec xout);
+gmx_calc_cog(const gmx_mtop_t *top, rvec x[], int nrefat, const int index[], rvec xout);
 /** Calculate a single center of mass. */
 void
-gmx_calc_com(const t_topology *top, rvec x[], int nrefat, const int index[], rvec xout);
+gmx_calc_com(const gmx_mtop_t *top, rvec x[], int nrefat, const int index[], rvec xout);
 /** Calculate force on a single center of geometry. */
 void
-gmx_calc_cog_f(const t_topology *top, rvec f[], int nrefat, const int index[], rvec fout);
+gmx_calc_cog_f(const gmx_mtop_t *top, rvec f[], int nrefat, const int index[], rvec fout);
 /*! \brief
  * Calculate force on a single center of mass.
  *
@@ -108,27 +108,27 @@ gmx_calc_cog_f(const t_topology *top, rvec f[], int nrefat, const int index[], r
  * \param[out] fout   Force on the COM position for the indexed atoms.
  */
 void
-gmx_calc_com_f(const t_topology *top, rvec f[], int nrefat, const int index[], rvec fout);
+gmx_calc_com_f(const gmx_mtop_t *top, rvec f[], int nrefat, const int index[], rvec fout);
 /** Calculate a single center of mass/geometry. */
 void
-gmx_calc_comg(const t_topology *top, rvec x[], int nrefat, const int index[],
+gmx_calc_comg(const gmx_mtop_t *top, rvec x[], int nrefat, const int index[],
               bool bMass, rvec xout);
 /** Calculate force on a single center of mass/geometry. */
 void
-gmx_calc_comg_f(const t_topology *top, rvec f[], int nrefat, const int index[],
+gmx_calc_comg_f(const gmx_mtop_t *top, rvec f[], int nrefat, const int index[],
                 bool bMass, rvec fout);
 
 /** Calculate a single center of geometry iteratively, taking PBC into account. */
 void
-gmx_calc_cog_pbc(const t_topology *top, rvec x[], t_pbc *pbc,
+gmx_calc_cog_pbc(const gmx_mtop_t *top, rvec x[], const t_pbc *pbc,
                  int nrefat, const int index[], rvec xout);
 /** Calculate a single center of mass iteratively, taking PBC into account. */
 void
-gmx_calc_com_pbc(const t_topology *top, rvec x[], t_pbc *pbc,
+gmx_calc_com_pbc(const gmx_mtop_t *top, rvec x[], const t_pbc *pbc,
                  int nrefat, const int index[], rvec xout);
 /** Calculate a single center of mass/geometry iteratively with PBC. */
 void
-gmx_calc_comg_pbc(const t_topology *top, rvec x[], t_pbc *pbc,
+gmx_calc_comg_pbc(const gmx_mtop_t *top, rvec x[], const t_pbc *pbc,
                   int nrefat, const int index[], bool bMass, rvec xout);
 
 /*! \brief
@@ -141,15 +141,15 @@ gmx_calc_comg_pbc(const t_topology *top, rvec x[], t_pbc *pbc,
  * \param[out] xout  \p block->nr COG positions.
  */
 void
-gmx_calc_cog_block(const t_topology *top, rvec x[], const t_block *block,
+gmx_calc_cog_block(const gmx_mtop_t *top, rvec x[], const t_block *block,
                    const int index[], rvec xout[]);
 /** Calculate centers of mass for a blocked index. */
 void
-gmx_calc_com_block(const t_topology *top, rvec x[], const t_block *block,
+gmx_calc_com_block(const gmx_mtop_t *top, rvec x[], const t_block *block,
                    const int index[], rvec xout[]);
 /** Calculate forces on centers of geometry for a blocked index. */
 void
-gmx_calc_cog_f_block(const t_topology *top, rvec f[], const t_block *block,
+gmx_calc_cog_f_block(const gmx_mtop_t *top, rvec f[], const t_block *block,
                      const int index[], rvec fout[]);
 /*! \brief
  * Calculate forces on centers of mass for a blocked index.
@@ -161,23 +161,23 @@ gmx_calc_cog_f_block(const t_topology *top, rvec f[], const t_block *block,
  * \param[out] fout  \p block->nr Forces on COM positions.
  */
 void
-gmx_calc_com_f_block(const t_topology *top, rvec f[], const t_block *block,
+gmx_calc_com_f_block(const gmx_mtop_t *top, rvec f[], const t_block *block,
                      const int index[], rvec fout[]);
 /** Calculate centers of mass/geometry for a blocked index. */
 void
-gmx_calc_comg_block(const t_topology *top, rvec x[], const t_block *block,
+gmx_calc_comg_block(const gmx_mtop_t *top, rvec x[], const t_block *block,
                     const int index[], bool bMass, rvec xout[]);
 /** Calculate forces on centers of mass/geometry for a blocked index. */
 void
-gmx_calc_comg_f_block(const t_topology *top, rvec f[], const t_block *block,
+gmx_calc_comg_f_block(const gmx_mtop_t *top, rvec f[], const t_block *block,
                       const int index[], bool bMass, rvec fout[]);
 /** Calculate centers of mass/geometry for a set of blocks; */
 void
-gmx_calc_comg_blocka(const t_topology *top, rvec x[], const t_blocka *block,
+gmx_calc_comg_blocka(const gmx_mtop_t *top, rvec x[], const t_blocka *block,
                      bool bMass, rvec xout[]);
 /** Calculate forces on centers of mass/geometry for a set of blocks; */
 void
-gmx_calc_comg_f_blocka(const t_topology *top, rvec x[], const t_blocka *block,
+gmx_calc_comg_f_blocka(const gmx_mtop_t *top, rvec x[], const t_blocka *block,
                        bool bMass, rvec xout[]);
 
 #endif
index a5f9239677051c28425d2705f7cc301287a68311..0d7833bcbbe827edd1763a11585615186e7babec 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
@@ -466,7 +466,7 @@ void SelectionTreeElement::freeCompilerData()
         }
         sfree(cdata);
     }
-    cdata = NULL;
+    cdata = nullptr;
 }
 
 } // namespace gmx
@@ -628,7 +628,7 @@ init_pos_keyword_defaults(SelectionTreeElement *root,
      * reference positions use the whole residue/molecule. */
     if (root->type == SEL_EXPRESSION)
     {
-        bool bSelection = (sel != NULL);
+        bool bSelection = (sel != nullptr);
         int  flags      = bSelection ? POS_COMPLMAX : POS_COMPLWHOLE;
         if (bSelection)
         {
@@ -652,7 +652,7 @@ init_pos_keyword_defaults(SelectionTreeElement *root,
     if (root->type != SEL_ROOT && root->type != SEL_MODIFIER
         && root->type != SEL_SUBEXPRREF && root->type != SEL_SUBEXPR)
     {
-        sel = NULL;
+        sel = nullptr;
     }
     /* Recurse into children */
     SelectionTreeElementPointer child = root->child;
@@ -1247,7 +1247,7 @@ init_item_evaloutput(const SelectionTreeElementPointer &sel)
     {
         sel->evaluate        = &_gmx_sel_evaluate_subexpr_staticeval;
         sel->cdata->evaluate = sel->evaluate;
-        sel->child->mempool  = NULL;
+        sel->child->mempool  = nullptr;
         sel->flags          &= ~(SEL_ALLOCVAL | SEL_ALLOCDATA);
         if (sel->v.type == GROUP_VALUE || sel->v.type == POS_VALUE)
         {
@@ -1620,7 +1620,7 @@ initialize_evalgrps(gmx_ana_selcollection_t *sc)
         if (root->child->type != SEL_SUBEXPR
             || (root->child->v.type != GROUP_VALUE && !(root->flags & SEL_ATOMVAL)))
         {
-            gmx_ana_index_set(&root->u.cgrp, -1, 0, 0);
+            gmx_ana_index_set(&root->u.cgrp, -1, nullptr, 0);
         }
         else if (root->child->cdata->flags & SEL_CDATA_FULLEVAL)
         {
@@ -1746,8 +1746,8 @@ make_static(const SelectionTreeElementPointer &sel)
     sel->freeExpressionData();
     /* Make the item static */
     sel->type            = SEL_CONST;
-    sel->evaluate        = NULL;
-    sel->cdata->evaluate = NULL;
+    sel->evaluate        = nullptr;
+    sel->cdata->evaluate = nullptr;
     /* Set the group value.
      * freeExpressionData() frees the cgrp group, so we can just override it.
      * */
@@ -1829,7 +1829,7 @@ store_param_val(const SelectionTreeElementPointer &sel)
  * is prevented by using \ref SEL_METHODINIT and \ref SEL_OUTINIT flags.
  */
 static void
-init_method(const SelectionTreeElementPointer &sel, t_topology *top, int isize)
+init_method(const SelectionTreeElementPointer &sel, const gmx_mtop_t *top, int isize)
 {
     /* Find out whether there are any atom-valued parameters */
     bool bAtomVal                     = false;
@@ -1885,7 +1885,7 @@ init_method(const SelectionTreeElementPointer &sel, t_topology *top, int isize)
                 sel->flags |= SEL_ALLOCDATA;
                 for (i = 0; i < isize; ++i)
                 {
-                    if (sel->v.u.s[i] == NULL)
+                    if (sel->v.u.s[i] == nullptr)
                     {
                         snew(sel->v.u.s[i], 2);
                     }
@@ -1932,7 +1932,7 @@ evaluate_boolean_static_part(gmx_sel_evaluate_t                *data,
         child.reset(new SelectionTreeElement(SEL_CONST, SelectionLocation::createEmpty()));
         child->flags      = SEL_FLAGSSET | SEL_SINGLEVAL | SEL_ALLOCVAL | SEL_ALLOCDATA;
         _gmx_selelem_set_vtype(child, GROUP_VALUE);
-        child->evaluate   = NULL;
+        child->evaluate   = nullptr;
         _gmx_selvalue_reserve(&child->v, 1);
         gmx_ana_index_copy(child->v.u.g, sel->v.u.g, true);
         init_item_compilerdata(child);
@@ -1954,12 +1954,12 @@ evaluate_boolean_static_part(gmx_sel_evaluate_t                *data,
      * If we reach here with a NOT expression, the NOT expression
      * is also static, and will be made a constant later, so don't waste
      * time copying the group. */
-    child->evaluate = NULL;
+    child->evaluate = nullptr;
     if (sel->u.boolt == BOOL_NOT
         || ((sel->cdata->flags & SEL_CDATA_STATICEVAL)
             && sel->u.boolt == BOOL_OR))
     {
-        child->cdata->evaluate = NULL;
+        child->cdata->evaluate = nullptr;
     }
     else
     {
@@ -2381,10 +2381,10 @@ init_root_item(const SelectionTreeElementPointer &root,
             || ((root->child->cdata->flags & SEL_CDATA_SIMPLESUBEXPR)
                 && !(root->child->cdata->flags & SEL_CDATA_FULLEVAL))))
     {
-        root->evaluate = NULL;
+        root->evaluate = nullptr;
         if (root->cdata)
         {
-            root->cdata->evaluate = NULL;
+            root->cdata->evaluate = nullptr;
         }
     }
 
@@ -2396,7 +2396,7 @@ init_root_item(const SelectionTreeElementPointer &root,
         if ((expr->flags & SEL_VARNUMVAL)
             || ((expr->flags & SEL_SINGLEVAL) && expr->v.type != GROUP_VALUE))
         {
-            gmx_ana_index_set(&root->u.cgrp, -1, NULL, 0);
+            gmx_ana_index_set(&root->u.cgrp, -1, nullptr, 0);
         }
         else if (expr->cdata->gmax->isize == gall->isize)
         {
@@ -2410,7 +2410,7 @@ init_root_item(const SelectionTreeElementPointer &root,
         /* For selections, store the maximum group for
          * gmx_ana_selcollection_evaluate_fin() as the value of the root
          * element (unused otherwise). */
-        if (expr->type != SEL_SUBEXPR && expr->v.u.p->m.mapb.a != NULL)
+        if (expr->type != SEL_SUBEXPR && expr->v.u.p->m.mapb.a != nullptr)
         {
             SelectionTreeElementPointer child = expr;
 
@@ -2539,7 +2539,7 @@ postprocess_item_subexpressions(const SelectionTreeElementPointer &sel)
         sel->cdata->evaluate = sel->evaluate;
 
         sel->child->freeValues();
-        sel->child->mempool = NULL;
+        sel->child->mempool = nullptr;
         _gmx_selvalue_setstore(&sel->child->v, sel->v.u.ptr);
         sel->child->flags &= ~(SEL_ALLOCVAL | SEL_ALLOCDATA);
     }
@@ -2579,8 +2579,8 @@ postprocess_item_subexpressions(const SelectionTreeElementPointer &sel)
         && (sel->cdata->flags & SEL_CDATA_SIMPLESUBEXPR)
         && (sel->cdata->flags & SEL_CDATA_STATICMULTIEVALSUBEXPR))
     {
-        sel->evaluate        = NULL;
-        sel->cdata->evaluate = NULL;
+        sel->evaluate        = nullptr;
+        sel->cdata->evaluate = nullptr;
     }
 }
 
@@ -2721,7 +2721,7 @@ SelectionCompiler::compile(SelectionCollection *coll)
 
     sc->mempool = _gmx_sel_mempool_create();
     _gmx_sel_evaluate_init(&evaldata, sc->mempool, &sc->gall,
-                           sc->top, NULL, NULL);
+                           sc->top, nullptr, nullptr);
 
     /* Clear the symbol table because it is not possible to parse anything
      * after compilation, and variable references in the symbol table can
@@ -2818,7 +2818,7 @@ SelectionCompiler::compile(SelectionCollection *coll)
             mark_subexpr_dynamic(item->child, true);
         }
         set_evaluation_function(item, &analyze_static);
-        item->evaluate(&evaldata, item, NULL);
+        item->evaluate(&evaldata, item, nullptr);
         item = item->next;
     }
 
index e1f4df2f90be4d300eb740e54ab66ede04508446..05a5d3853758ecd80cb6d804cf0d58098e7b2e7a 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
@@ -152,13 +152,13 @@ class MempoolGroupReserver
          * \param    mp  Memory pool from which to reserve memory.
          */
         explicit MempoolGroupReserver(gmx_sel_mempool_t *mp)
-            : mp_(mp), g_(NULL)
+            : mp_(mp), g_(nullptr)
         {
         }
         //! Frees any memory allocated using this reserver.
         ~MempoolGroupReserver()
         {
-            if (g_ != NULL)
+            if (g_ != nullptr)
             {
                 _gmx_sel_mempool_free_group(mp_, g_);
             }
@@ -175,7 +175,7 @@ class MempoolGroupReserver
          */
         void reserve(gmx_ana_index_t *g, int count)
         {
-            GMX_RELEASE_ASSERT(g_ == NULL, "Can only reserve one element with one instance");
+            GMX_RELEASE_ASSERT(g_ == nullptr, "Can only reserve one element with one instance");
             _gmx_sel_mempool_alloc_group(mp_, g, count);
             g_ = g;
         }
@@ -198,7 +198,7 @@ class SelelemTemporaryValueAssigner
     public:
         //! Constructs an assigner without an initial assignment.
         SelelemTemporaryValueAssigner()
-            : old_ptr_(NULL), old_nalloc_(0)
+            : old_ptr_(nullptr), old_nalloc_(0)
         {
         }
         /*! \brief
@@ -369,7 +369,7 @@ _gmx_sel_print_evalfunc_name(FILE *fp, gmx::sel_evalfunc evalfunc)
 void
 _gmx_sel_evaluate_init(gmx_sel_evaluate_t *data,
                        gmx_sel_mempool_t *mp, gmx_ana_index_t *gall,
-                       t_topology *top, t_trxframe *fr, t_pbc *pbc)
+                       const gmx_mtop_t *top, t_trxframe *fr, t_pbc *pbc)
 {
     data->mp   = mp;
     data->gall = gall;
@@ -445,7 +445,7 @@ SelectionEvaluator::evaluate(SelectionCollection *coll,
     {
         /* Clear the evaluation group of subexpressions */
         if (sel->child && sel->child->type == SEL_SUBEXPR
-            && sel->child->evaluate != NULL)
+            && sel->child->evaluate != nullptr)
         {
             sel->child->u.cgrp.isize = 0;
             /* Not strictly necessary, because the value will be overwritten
@@ -461,7 +461,7 @@ SelectionEvaluator::evaluate(SelectionCollection *coll,
         }
         if (sel->evaluate)
         {
-            sel->evaluate(&data, sel, NULL);
+            sel->evaluate(&data, sel, nullptr);
         }
         sel = sel->next;
     }
@@ -530,7 +530,7 @@ _gmx_sel_evaluate_root(gmx_sel_evaluate_t                     *data,
     }
 
     sel->child->evaluate(data, sel->child,
-                         sel->u.cgrp.isize < 0 ? NULL : &sel->u.cgrp);
+                         sel->u.cgrp.isize < 0 ? nullptr : &sel->u.cgrp);
 }
 
 void
@@ -796,7 +796,7 @@ _gmx_sel_evaluate_subexprref(gmx_sel_evaluate_t                     *data,
 {
     int        i, j;
 
-    if (g != NULL && sel->child->evaluate != NULL)
+    if (g != nullptr && sel->child->evaluate != nullptr)
     {
         sel->child->evaluate(data, sel->child, g);
     }
@@ -931,7 +931,7 @@ _gmx_sel_evaluate_method_params(gmx_sel_evaluate_t                     *data,
             else
             {
                 child->flags |= SEL_EVALFRAME;
-                child->evaluate(data, child, NULL);
+                child->evaluate(data, child, nullptr);
             }
         }
         child = child->next;
@@ -961,18 +961,17 @@ _gmx_sel_evaluate_method(gmx_sel_evaluate_t                     *data,
                          gmx_ana_index_t                        *g)
 {
     _gmx_sel_evaluate_method_params(data, sel, g);
+    gmx::SelMethodEvalContext context(data->top, data->fr, data->pbc);
     if (sel->flags & SEL_INITFRAME)
     {
         sel->flags &= ~SEL_INITFRAME;
-        sel->u.expr.method->init_frame(data->top, data->fr, data->pbc,
-                                       sel->u.expr.mdata);
+        sel->u.expr.method->init_frame(context, sel->u.expr.mdata);
     }
     if (sel->u.expr.pc)
     {
         gmx_ana_poscalc_update(sel->u.expr.pc, sel->u.expr.pos, g,
                                data->fr, data->pbc);
-        sel->u.expr.method->pupdate(data->top, data->fr, data->pbc,
-                                    sel->u.expr.pos, &sel->v,
+        sel->u.expr.method->pupdate(context, sel->u.expr.pos, &sel->v,
                                     sel->u.expr.mdata);
         if ((sel->flags & SEL_ATOMVAL) && sel->v.nr < g->isize)
         {
@@ -989,8 +988,7 @@ _gmx_sel_evaluate_method(gmx_sel_evaluate_t                     *data,
     }
     else
     {
-        sel->u.expr.method->update(data->top, data->fr, data->pbc, g,
-                                   &sel->v, sel->u.expr.mdata);
+        sel->u.expr.method->update(context, g, &sel->v, sel->u.expr.mdata);
     }
 }
 
@@ -1015,18 +1013,17 @@ _gmx_sel_evaluate_modifier(gmx_sel_evaluate_t                     *data,
                            gmx_ana_index_t                        *g)
 {
     _gmx_sel_evaluate_method_params(data, sel, g);
+    gmx::SelMethodEvalContext context(data->top, data->fr, data->pbc);
     if (sel->flags & SEL_INITFRAME)
     {
         sel->flags &= ~SEL_INITFRAME;
-        sel->u.expr.method->init_frame(data->top, data->fr, data->pbc,
-                                       sel->u.expr.mdata);
+        sel->u.expr.method->init_frame(context, sel->u.expr.mdata);
     }
     if (sel->child && sel->child->v.type != POS_VALUE)
     {
         GMX_THROW(gmx::NotImplementedError("Non-position valued modifiers not implemented"));
     }
-    sel->u.expr.method->pupdate(data->top, data->fr, data->pbc,
-                                NULL, &sel->v, sel->u.expr.mdata);
+    sel->u.expr.method->pupdate(context, nullptr, &sel->v, sel->u.expr.mdata);
 }
 
 
index 337e9be336f59b3cbcfdff32d8319d34a29376d0..e2135e2ca2715c038bfc07422da145dadf9ec573 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
@@ -52,9 +52,9 @@
 #include "selelem.h"
 
 struct gmx_ana_index_t;
+struct gmx_mtop_t;
 struct gmx_sel_mempool_t;
 struct t_pbc;
-struct t_topology;
 struct t_trxframe;
 
 /*! \internal \brief
@@ -67,7 +67,7 @@ struct gmx_sel_evaluate_t
     /** Index group that contains all the atoms. */
     gmx_ana_index_t          *gall;
     /** Topology information. */
-    t_topology               *top;
+    const gmx_mtop_t         *top;
     /** Current frame. */
     t_trxframe               *fr;
     /** PBC data. */
@@ -81,7 +81,7 @@ struct gmx_sel_evaluate_t
 void
 _gmx_sel_evaluate_init(gmx_sel_evaluate_t *data,
                        gmx_sel_mempool_t *mp, gmx_ana_index_t *gall,
-                       t_topology *top, t_trxframe *fr, t_pbc *pbc);
+                       const gmx_mtop_t *top, t_trxframe *fr, t_pbc *pbc);
 /** Evaluates the children of a general selection element. */
 void
 _gmx_sel_evaluate_children(gmx_sel_evaluate_t                     *data,
index beb5fd8481e4d7c74151f3c9e13fb815ecb7650d..d264b47bb67c89b5e0deced261d6cb7eb7bd9630 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
@@ -52,6 +52,8 @@
 
 #include "gromacs/topology/block.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/topology/mtop_lookup.h"
+#include "gromacs/topology/mtop_util.h"
 #include "gromacs/topology/topology.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
@@ -69,7 +71,7 @@
 struct gmx_ana_indexgrps_t
 {
     //! Initializes an empty set of groups.
-    explicit gmx_ana_indexgrps_t(int nr) : nr(nr), g(NULL)
+    explicit gmx_ana_indexgrps_t(int nr) : nr(nr), g(nullptr)
     {
         names.reserve(nr);
         snew(g, nr);
@@ -105,11 +107,11 @@ struct gmx_ana_indexgrps_t
  * If both are null, the index group structure is initialized empty.
  */
 void
-gmx_ana_indexgrps_init(gmx_ana_indexgrps_t **g, t_topology *top,
+gmx_ana_indexgrps_init(gmx_ana_indexgrps_t **g, gmx_mtop_t *top,
                        const char *fnm)
 {
-    t_blocka *block = NULL;
-    char    **names = NULL;
+    t_blocka *block = nullptr;
+    char    **names = nullptr;
 
     if (fnm)
     {
@@ -118,7 +120,10 @@ gmx_ana_indexgrps_init(gmx_ana_indexgrps_t **g, t_topology *top,
     else if (top)
     {
         block = new_blocka();
-        analyse(&top->atoms, block, &names, FALSE, FALSE);
+        // TODO: Propagate mtop further.
+        t_atoms atoms = gmx_mtop_global_atoms(top);
+        analyse(&atoms, block, &names, FALSE, FALSE);
+        done_atom(&atoms);
     }
     else
     {
@@ -140,7 +145,7 @@ gmx_ana_indexgrps_init(gmx_ana_indexgrps_t **g, t_topology *top,
                 grp->index[j] = block->a[block->index[i]+j];
             }
             grp->nalloc_index = grp->isize;
-            (*g)->names.push_back(names[i]);
+            (*g)->names.emplace_back(names[i]);
         }
     }
     catch (...)
@@ -196,7 +201,7 @@ gmx_ana_indexgrps_get_grp(gmx_ana_indexgrps_t *g, int n)
 {
     if (n < 0 || n >= g->nr)
     {
-        return NULL;
+        return nullptr;
     }
     return &g->g[n];
 }
@@ -219,7 +224,7 @@ gmx_ana_indexgrps_extract(gmx_ana_index_t *dest, std::string *destName,
         return false;
     }
 
-    if (destName != NULL)
+    if (destName != nullptr)
     {
         *destName = src->names[n];
     }
@@ -319,7 +324,7 @@ void
 gmx_ana_index_clear(gmx_ana_index_t *g)
 {
     g->isize        = 0;
-    g->index        = NULL;
+    g->index        = nullptr;
     g->nalloc_index = 0;
 }
 
@@ -791,7 +796,7 @@ gmx_ana_index_merge(gmx_ana_index_t *dest,
  * \ingroup module_selection
  */
 static bool
-next_group_index(int atomIndex, t_topology *top, e_index_t type, int *id)
+next_group_index(int atomIndex, const gmx_mtop_t *top, e_index_t type, int *id)
 {
     int prev = *id;
     switch (type)
@@ -800,8 +805,12 @@ next_group_index(int atomIndex, t_topology *top, e_index_t type, int *id)
             *id = atomIndex;
             break;
         case INDEX_RES:
-            *id = top->atoms.atom[atomIndex].resind;
+        {
+            int resind, molb = 0;
+            mtopGetAtomAndResidueName(top, atomIndex, &molb, nullptr, nullptr, nullptr, &resind);
+            *id = resind;
             break;
+        }
         case INDEX_MOL:
             if (*id >= 0 && top->mols.index[*id] > atomIndex)
             {
@@ -838,7 +847,7 @@ next_group_index(int atomIndex, t_topology *top, e_index_t type, int *id)
  * \p g should be sorted.
  */
 void
-gmx_ana_index_make_block(t_blocka *t, t_topology *top, gmx_ana_index_t *g,
+gmx_ana_index_make_block(t_blocka *t, const gmx_mtop_t *top, gmx_ana_index_t *g,
                          e_index_t type, bool bComplete)
 {
     if (type == INDEX_UNKNOWN)
@@ -850,14 +859,14 @@ gmx_ana_index_make_block(t_blocka *t, t_topology *top, gmx_ana_index_t *g,
         t->index[0]     = 0;
         t->index[1]     = 0;
         t->nra          = 0;
-        t->a            = NULL;
+        t->a            = nullptr;
         t->nalloc_a     = 0;
         return;
     }
 
     // TODO: Check callers and either check these there as well, or turn these
     // into exceptions.
-    GMX_RELEASE_ASSERT(top != NULL || (type != INDEX_RES && type != INDEX_MOL),
+    GMX_RELEASE_ASSERT(top != nullptr || (type != INDEX_RES && type != INDEX_MOL),
                        "Topology must be provided for residue or molecule blocks");
     GMX_RELEASE_ASSERT(!(type == INDEX_MOL && top->mols.nr == 0),
                        "Molecule information must be present for molecule blocks");
@@ -875,10 +884,10 @@ gmx_ana_index_make_block(t_blocka *t, t_topology *top, gmx_ana_index_t *g,
         t->nra = 0;
         /* We may allocate some extra memory here because we don't know in
          * advance how much will be needed. */
-        if (t->nalloc_a < top->atoms.nr)
+        if (t->nalloc_a < top->natoms)
         {
-            srenew(t->a, top->atoms.nr);
-            t->nalloc_a = top->atoms.nr;
+            srenew(t->a, top->natoms);
+            t->nalloc_a = top->natoms;
         }
     }
     else
@@ -902,13 +911,14 @@ gmx_ana_index_make_block(t_blocka *t, t_topology *top, gmx_ana_index_t *g,
     }
     /* Clear counters */
     t->nr  = 0;
-    int j  = 0; /* j is used by residue completion for the first atom not stored */
-    int id = -1;
+    int id   = -1;
+    int molb = 0;
     for (int i = 0; i < g->isize; ++i)
     {
+        const int ai = g->index[i];
         /* Find the ID number of the atom/residue/molecule corresponding to
          * the atom. */
-        if (next_group_index(g->index[i], top, type, &id))
+        if (next_group_index(ai, top, type, &id))
         {
             /* If this is the first atom in a new block, initialize the block. */
             if (bComplete)
@@ -919,19 +929,34 @@ gmx_ana_index_make_block(t_blocka *t, t_topology *top, gmx_ana_index_t *g,
                 switch (type)
                 {
                     case INDEX_RES:
-                        while (top->atoms.atom[j].resind != id)
+                    {
+                        int            molnr, atnr_mol;
+                        mtopGetMolblockIndex(top, ai, &molb, &molnr, &atnr_mol);
+                        const t_atoms &mol_atoms = top->moltype[top->molblock[molb].type].atoms;
+                        int            last_atom = atnr_mol + 1;
+                        while (last_atom < mol_atoms.nr
+                               && mol_atoms.atom[last_atom].resind == id)
+                        {
+                            ++last_atom;
+                        }
+                        int first_atom = atnr_mol - 1;
+                        while (first_atom >= 0
+                               && mol_atoms.atom[first_atom].resind == id)
                         {
-                            ++j;
+                            --first_atom;
                         }
-                        while (j < top->atoms.nr && top->atoms.atom[j].resind == id)
+                        int first_mol_atom = top->molblock[molb].globalAtomStart;
+                        first_mol_atom += molnr*top->molblock[molb].natoms_mol;
+                        first_atom      = first_mol_atom + first_atom + 1;
+                        last_atom       = first_mol_atom + last_atom - 1;
+                        for (int j = first_atom; j <= last_atom; ++j)
                         {
                             t->a[t->nra++] = j;
-                            ++j;
                         }
                         break;
-
+                    }
                     case INDEX_MOL:
-                        for (j = top->mols.index[id]; j < top->mols.index[id+1]; ++j)
+                        for (int j = top->mols.index[id]; j < top->mols.index[id+1]; ++j)
                         {
                             t->a[t->nra++] = j;
                         }
@@ -970,7 +995,7 @@ gmx_ana_index_make_block(t_blocka *t, t_topology *top, gmx_ana_index_t *g,
  * The atoms in \p g are assumed to be sorted.
  */
 bool
-gmx_ana_index_has_full_blocks(gmx_ana_index_t *g, t_block *b)
+gmx_ana_index_has_full_blocks(const gmx_ana_index_t *g, const t_block *b)
 {
     int  i, j, bi;
 
@@ -1043,6 +1068,29 @@ gmx_ana_index_has_full_ablocks(gmx_ana_index_t *g, t_blocka *b)
     return true;
 }
 
+/*!
+ * \brief Returns if an atom is at a residue boundary.
+ *
+ * \param[in]     top   Topology data.
+ * \param[in]     a     Atom index to check, should be -1 <= \p a < top->natoms.
+ * \param[in,out] molb  The molecule block of atom a
+ * \returns       true if atoms \p a and \p a + 1 are in different residues, false otherwise.
+ */
+static bool is_at_residue_boundary(const gmx_mtop_t *top, int a, int *molb)
+{
+    if (a == -1 || a + 1 == top->natoms)
+    {
+        return true;
+    }
+    int resindA;
+    mtopGetAtomAndResidueName(top, a, molb,
+                              nullptr, nullptr, nullptr, &resindA);
+    int resindAPlusOne;
+    mtopGetAtomAndResidueName(top, a + 1, molb,
+                              nullptr, nullptr, nullptr, &resindAPlusOne);
+    return resindAPlusOne != resindA;
+}
+
 /*!
  * \param[in] g     Index group to check.
  * \param[in] type  Block data to check against.
@@ -1058,8 +1106,13 @@ gmx_ana_index_has_full_ablocks(gmx_ana_index_t *g, t_blocka *b)
  */
 bool
 gmx_ana_index_has_complete_elems(gmx_ana_index_t *g, e_index_t type,
-                                 t_topology *top)
+                                 const gmx_mtop_t *top)
 {
+    if (g->isize == 0)
+    {
+        return true;
+    }
+
     // TODO: Consider whether unsorted groups need to be supported better.
     switch (type)
     {
@@ -1072,30 +1125,28 @@ gmx_ana_index_has_complete_elems(gmx_ana_index_t *g, e_index_t type,
 
         case INDEX_RES:
         {
-            int      i, ai;
-            int      id, prev;
-
-            prev = -1;
-            for (i = 0; i < g->isize; ++i)
+            int molb  = 0;
+            int aPrev = -1;
+            for (int i = 0; i < g->isize; ++i)
             {
-                ai = g->index[i];
-                id = top->atoms.atom[ai].resind;
-                if (id != prev)
+                const int a = g->index[i];
+                // Check if a is consecutive or on a residue boundary
+                if (a != aPrev + 1)
                 {
-                    if (ai > 0 && top->atoms.atom[ai-1].resind == id)
+                    if (!is_at_residue_boundary(top, aPrev, &molb))
                     {
                         return false;
                     }
-                    if (i > 0 && g->index[i-1] < top->atoms.nr - 1
-                        && top->atoms.atom[g->index[i-1]+1].resind == prev)
+                    if (!is_at_residue_boundary(top, a - 1, &molb))
                     {
                         return false;
                     }
                 }
-                prev = id;
+                aPrev = a;
             }
-            if (g->index[i-1] < top->atoms.nr - 1
-                && top->atoms.atom[g->index[i-1]+1].resind == prev)
+            GMX_ASSERT(g->isize > 0, "We return above when isize=0");
+            const int a = g->index[g->isize - 1];
+            if (!is_at_residue_boundary(top, a, &molb))
             {
                 return false;
             }
@@ -1117,19 +1168,19 @@ void
 gmx_ana_indexmap_clear(gmx_ana_indexmap_t *m)
 {
     m->type              = INDEX_UNKNOWN;
-    m->refid             = NULL;
-    m->mapid             = NULL;
+    m->refid             = nullptr;
+    m->mapid             = nullptr;
     m->mapb.nr           = 0;
-    m->mapb.index        = NULL;
+    m->mapb.index        = nullptr;
     m->mapb.nalloc_index = 0;
     m->mapb.nra          = 0;
-    m->mapb.a            = NULL;
+    m->mapb.a            = nullptr;
     m->mapb.nalloc_a     = 0;
-    m->orgid             = NULL;
+    m->orgid             = nullptr;
     m->b.nr              = 0;
-    m->b.index           = NULL;
+    m->b.index           = nullptr;
     m->b.nra             = 0;
-    m->b.a               = NULL;
+    m->b.a               = nullptr;
     m->b.nalloc_index    = 0;
     m->b.nalloc_a        = 0;
     m->bStatic           = true;
@@ -1176,7 +1227,7 @@ gmx_ana_indexmap_reserve(gmx_ana_indexmap_t *m, int nr, int isize)
  */
 void
 gmx_ana_indexmap_init(gmx_ana_indexmap_t *m, gmx_ana_index_t *g,
-                      t_topology *top, e_index_t type)
+                      const gmx_mtop_t *top, e_index_t type)
 {
     m->type   = type;
     gmx_ana_index_make_block(&m->b, top, g, type, false);
@@ -1198,13 +1249,13 @@ gmx_ana_indexmap_init(gmx_ana_indexmap_t *m, gmx_ana_index_t *g,
 }
 
 int
-gmx_ana_indexmap_init_orgid_group(gmx_ana_indexmap_t *m, t_topology *top,
+gmx_ana_indexmap_init_orgid_group(gmx_ana_indexmap_t *m, const gmx_mtop_t *top,
                                   e_index_t type)
 {
     GMX_RELEASE_ASSERT(m->bStatic,
                        "Changing original IDs is not supported after starting "
                        "to use the mapping");
-    GMX_RELEASE_ASSERT(top != NULL || (type != INDEX_RES && type != INDEX_MOL),
+    GMX_RELEASE_ASSERT(top != nullptr || (type != INDEX_RES && type != INDEX_MOL),
                        "Topology must be provided for residue or molecule blocks");
     GMX_RELEASE_ASSERT(!(type == INDEX_MOL && top->mols.nr == 0),
                        "Molecule information must be present for molecule blocks");
index 0203515ffcf9bc564efd66806d2d96f7f7f70db8..83de646fef75fc555b8e83c5ea72a81816100367 100644 (file)
@@ -72,7 +72,7 @@ namespace gmx
 class TextWriter;
 }
 
-struct t_topology;
+struct gmx_mtop_t;
 
 /** Stores a set of index groups. */
 struct gmx_ana_indexgrps_t;
@@ -186,7 +186,7 @@ struct gmx_ana_indexmap_t
 /*@{*/
 /** Reads index groups from a file or constructs them from topology. */
 void
-gmx_ana_indexgrps_init(gmx_ana_indexgrps_t **g, t_topology *top,
+gmx_ana_indexgrps_init(gmx_ana_indexgrps_t **g, gmx_mtop_t *top,
                        const char *fnm);
 /** Frees memory allocated for index groups. */
 void
@@ -327,17 +327,18 @@ gmx_ana_index_partition(gmx_ana_index_t *dest1, gmx_ana_index_t *dest2,
 /*@{*/
 /** Partition a group based on topology information. */
 void
-gmx_ana_index_make_block(t_blocka *t, t_topology *top, gmx_ana_index_t *g,
+gmx_ana_index_make_block(t_blocka *t, const gmx_mtop_t *top, gmx_ana_index_t *g,
                          e_index_t type, bool bComplete);
 /** Checks whether a group consists of full blocks. */
 bool
-gmx_ana_index_has_full_blocks(gmx_ana_index_t *g, t_block *b);
+gmx_ana_index_has_full_blocks(const gmx_ana_index_t *g, const t_block *b);
 /** Checks whether a group consists of full blocks. */
 bool
 gmx_ana_index_has_full_ablocks(gmx_ana_index_t *g, t_blocka *b);
 /** Checks whether a group consists of full residues/molecules. */
 bool
-gmx_ana_index_has_complete_elems(gmx_ana_index_t *g, e_index_t type, t_topology *top);
+gmx_ana_index_has_complete_elems(gmx_ana_index_t *g, e_index_t type,
+                                 const gmx_mtop_t *top);
 
 /** Initializes an empty index group mapping. */
 void
@@ -348,7 +349,7 @@ gmx_ana_indexmap_reserve(gmx_ana_indexmap_t *m, int nr, int isize);
 /** Initializes an index group mapping. */
 void
 gmx_ana_indexmap_init(gmx_ana_indexmap_t *m, gmx_ana_index_t *g,
-                      t_topology *top, e_index_t type);
+                      const gmx_mtop_t *top, e_index_t type);
 /*! \brief
  * Initializes `orgid` entries based on topology grouping.
  *
@@ -374,7 +375,7 @@ gmx_ana_indexmap_init(gmx_ana_indexmap_t *m, gmx_ana_index_t *g,
  * Strong exception safety guarantee.
  */
 int
-gmx_ana_indexmap_init_orgid_group(gmx_ana_indexmap_t *m, t_topology *top,
+gmx_ana_indexmap_init_orgid_group(gmx_ana_indexmap_t *m, const gmx_mtop_t *top,
                                   e_index_t type);
 /** Sets an index group mapping to be static. */
 void
index 675932440febc6ce87158d6791ae37dd609570c9..20134991fbabc69235c14757557ebd8b9f1e9a8d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2014,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.
@@ -100,10 +100,10 @@ _gmx_sel_mempool_create()
     snew(mp, 1);
     mp->currsize          = 0;
     mp->freesize          = 0;
-    mp->buffer            = NULL;
-    mp->freeptr           = NULL;
+    mp->buffer            = nullptr;
+    mp->freeptr           = nullptr;
     mp->nblocks           = 0;
-    mp->blockstack        = NULL;
+    mp->blockstack        = nullptr;
     mp->blockstack_nalloc = 0;
     mp->maxsize           = 0;
     return mp;
@@ -129,7 +129,7 @@ _gmx_sel_mempool_destroy(gmx_sel_mempool_t *mp)
 void *
 _gmx_sel_mempool_alloc(gmx_sel_mempool_t *mp, size_t size)
 {
-    void   *ptr = NULL;
+    void   *ptr = nullptr;
     size_t  size_walign;
 
     size_walign = ((size + ALIGN_STEP - 1) / ALIGN_STEP) * ALIGN_STEP;
@@ -175,7 +175,7 @@ _gmx_sel_mempool_free(gmx_sel_mempool_t *mp, void *ptr)
 {
     int size;
 
-    if (ptr == NULL)
+    if (ptr == nullptr)
     {
         return;
     }
@@ -226,5 +226,5 @@ void
 _gmx_sel_mempool_free_group(gmx_sel_mempool_t *mp, gmx_ana_index_t *g)
 {
     _gmx_sel_mempool_free(mp, g->index);
-    g->index = NULL;
+    g->index = nullptr;
 }
index ac0b921e44b9ae4b6cf1480903fb7bc188f7d39f..55a5010ce4071c1e0f783a1f89e1e27a67c707e2 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
  *
  * \todo
  * The grid implementation could still be optimized in several different ways:
- *   - Pruning grid cells from the search list if they are completely outside
- *     the sphere that is being considered.
- *   - A better heuristic could be added for falling back to simple loops for a
- *     small number of reference particles.
- *   - A better heuristic for selecting the grid size.
+ *   - A better heuristic for selecting the grid size or falling back to a
+ *     simple all-pairs search.
  *   - A multi-level grid implementation could be used to be able to use small
  *     grids for short cutoffs with very inhomogeneous particle distributions
  *     without a memory cost.
@@ -149,13 +146,6 @@ class AnalysisNeighborhoodSearchImpl
         bool usesGridSearch() const { return bGrid_; }
 
     private:
-        /*! \brief
-         * Checks the efficiency and possibility of doing grid-based searching.
-         *
-         * \param[in] bForce  If `true`, grid search will be forced if possible.
-         * \returns   `false` if grid search is not suitable.
-         */
-        bool checkGridSearchEfficiency(bool bForce);
         /*! \brief
          * Determines a suitable grid size and sets up the cells.
          *
@@ -198,6 +188,13 @@ class AnalysisNeighborhoodSearchImpl
          * \returns    Linear index of \p cell.
          */
         int getGridCellIndex(const ivec cell) const;
+        /*! \brief
+         * Calculates linear index of a grid cell from fractional coordinates.
+         *
+         * \param[in]  cell Cell indices (must be within the grid).
+         * \returns    Linear index of \p cell.
+         */
+        int getGridCellIndex(const rvec cell) const;
         /*! \brief
          * Adds an index into a grid cell.
          *
@@ -233,6 +230,21 @@ class AnalysisNeighborhoodSearchImpl
          */
         void initCellRange(const rvec centerCell, ivec cell,
                            ivec upperBound, int dim) const;
+        /*! \brief
+         * Computes the extent of the cutoff sphere on a particular cell edge.
+         *
+         * \param[in]     centerCell Fractional cell coordiates of the particle
+         *     for which pairs are being searched.
+         * \param[in]     cell       Current cell (for dimensions `>dim`).
+         * \param[in]     dim        Dimension to compute in this call.
+         * \returns       Fractional extent of the cutoff sphere when looping
+         *    over cells in dimension `dim`, for `cell[d]` (`d > dim`).
+         *
+         * Input parameters are as for initCellRange(), except that if `cell`
+         * is over a periodic boundary from `centerCell`, triclinic shifts
+         * should have been applied to `centerCell` X/Y components.
+         */
+        real computeCutoffExtent(const RVec centerCell, const ivec cell, int dim) const;
         /*! \brief
          * Advances cell pair loop to the next cell.
          *
@@ -322,12 +334,13 @@ class AnalysisNeighborhoodPairSearchImpl
         explicit AnalysisNeighborhoodPairSearchImpl(const AnalysisNeighborhoodSearchImpl &search)
             : search_(search)
         {
+            selfSearchMode_   = false;
             testPosCount_     = 0;
-            testPositions_    = NULL;
-            testExclusionIds_ = NULL;
-            testIndices_      = NULL;
+            testPositions_    = nullptr;
+            testExclusionIds_ = nullptr;
+            testIndices_      = nullptr;
             nexcl_            = 0;
-            excl_             = NULL;
+            excl_             = nullptr;
             clear_rvec(xtest_);
             clear_rvec(testcell_);
             clear_ivec(currCell_);
@@ -337,6 +350,8 @@ class AnalysisNeighborhoodPairSearchImpl
 
         //! Initializes a search to find reference positions neighboring \p x.
         void startSearch(const AnalysisNeighborhoodPositions &positions);
+        //! Initializes a search to find reference position pairs.
+        void startSelfSearch();
         //! Searches for the next neighbor.
         template <class Action>
         bool searchNext(Action action);
@@ -353,6 +368,8 @@ class AnalysisNeighborhoodPairSearchImpl
 
         //! Parent search object.
         const AnalysisNeighborhoodSearchImpl   &search_;
+        //! Whether we are searching for ref-ref pairs.
+        bool                                    selfSearchMode_;
         //! Number of test positions.
         int                                     testPosCount_;
         //! Reference to the test positions.
@@ -371,14 +388,16 @@ class AnalysisNeighborhoodPairSearchImpl
         rvec                                    xtest_;
         //! Stores the previous returned position during a pair loop.
         int                                     previ_;
-        //! Stores the pair distance corresponding to previ_;
+        //! Stores the pair distance corresponding to previ_.
         real                                    prevr2_;
-        //! Stores the shortest distance vector corresponding to previ_;
+        //! Stores the shortest distance vector corresponding to previ_.
         rvec                                    prevdx_;
         //! Stores the current exclusion index during loops.
         int                                     exclind_;
         //! Stores the fractional test particle cell location during loops.
         rvec                                    testcell_;
+        //! Stores the cell index corresponding to testcell_.
+        int                                     testCellIndex_;
         //! Stores the current cell during pair loops.
         ivec                                    currCell_;
         //! Stores the current loop upper bounds for each dimension during pair loops.
@@ -408,9 +427,9 @@ AnalysisNeighborhoodSearchImpl::AnalysisNeighborhoodSearchImpl(real cutoff)
     }
     bXY_             = false;
     nref_            = 0;
-    xref_            = NULL;
-    refExclusionIds_ = NULL;
-    refIndices_      = NULL;
+    xref_            = nullptr;
+    refExclusionIds_ = nullptr;
+    refIndices_      = nullptr;
     std::memset(&pbc_, 0, sizeof(pbc_));
 
     bGrid_          = false;
@@ -454,65 +473,6 @@ AnalysisNeighborhoodSearchImpl::getPairSearch()
     return pairSearch;
 }
 
-bool AnalysisNeighborhoodSearchImpl::checkGridSearchEfficiency(bool bForce)
-{
-    // Find the extent of the sphere in cells.
-    ivec  range;
-    for (int dd = 0; dd < DIM; ++dd)
-    {
-        range[dd] = static_cast<int>(ceil(cutoff_ * invCellSize_[dd]));
-    }
-
-    // Calculate the fraction of cell pairs that need to be searched,
-    // and check that the cutoff is not too large for periodic dimensions.
-    real coveredCells = 1.0;
-    for (int dd = 0; dd < DIM; ++dd)
-    {
-        const int cellCount    = ncelldim_[dd];
-        const int coveredCount = 2 * range[dd] + 1;
-        if (bGridPBC_[dd])
-        {
-            if (coveredCount > cellCount)
-            {
-                // Cutoff is too close to half the box size for grid searching
-                // (it is not possible to find a single shift for every pair of
-                // grid cells).
-                return false;
-            }
-            coveredCells *= coveredCount;
-        }
-        else
-        {
-            if (range[dd] >= cellCount - 1)
-            {
-                range[dd]     = cellCount - 1;
-                coveredCells *= cellCount;
-            }
-            else if (coveredCount > cellCount)
-            {
-                // The sum of range+1, range+2, ..., range+N/2, ... range+1.
-                coveredCells *= range[dd] +
-                    static_cast<real>((cellCount + 1)/2 * (cellCount/2 + 1)) / cellCount;
-            }
-            else
-            {
-                // The sum of range+1, ..., 2*range+1, ..., 2*range+1, ... range+1.
-                coveredCells *= coveredCount -
-                    static_cast<real>(range[dd] * (range[dd] + 1)) / cellCount;
-            }
-        }
-    }
-    // Magic constant that would need tuning for optimal performance:
-    // Don't do grid searching if nearly all cell pairs would anyways need to
-    // be looped through.
-    const int totalCellCount = ncelldim_[XX] * ncelldim_[YY] * ncelldim_[ZZ];
-    if (!bForce && coveredCells >= 0.5 * totalCellCount)
-    {
-        return false;
-    }
-    return true;
-}
-
 bool AnalysisNeighborhoodSearchImpl::initGridCells(
         const matrix box, bool bSingleCell[DIM], int posCount)
 {
@@ -537,6 +497,7 @@ bool AnalysisNeighborhoodSearchImpl::initGridCells(
                 bSingleCell[dd] = true;
                 if (bGridPBC_[dd])
                 {
+                    // TODO: Consider if a fallback would be possible/better.
                     return false;
                 }
             }
@@ -568,9 +529,8 @@ bool AnalysisNeighborhoodSearchImpl::initGridCells(
         else
         {
             cellCount = std::max(1, static_cast<int>(box[dd][dd] / targetsize));
-            // TODO: If the cell count is one or two, it would be better to
-            // just fall back to bSingleCell[dd] = true, and leave the rest to
-            // the efficiency check later.
+            // TODO: If the cell count is one or two, it could be better to
+            // just fall back to bSingleCell[dd] = true.
             if (bGridPBC_[dd] && cellCount < 3)
             {
                 return false;
@@ -605,6 +565,10 @@ bool AnalysisNeighborhoodSearchImpl::initGrid(
         return false;
     }
 
+    // TODO: Use this again (can be useful when tuning initGridCells()),
+    // or remove throughout.
+    GMX_UNUSED_VALUE(bForce);
+
     switch (pbc.ePBC)
     {
         case epbcNONE:
@@ -671,6 +635,16 @@ bool AnalysisNeighborhoodSearchImpl::initGrid(
         else
         {
             invCellSize_[dd] = 1.0 / cellSize_[dd];
+            // TODO: It could be better to avoid this when determining the cell
+            // size, but this can still remain here as a fallback to avoid
+            // incorrect results.
+            if (std::ceil(2*cutoff_*invCellSize_[dd]) >= ncelldim_[dd])
+            {
+                // Cutoff is too close to half the box size for grid searching
+                // (it is not possible to find a single shift for every pair of
+                // grid cells).
+                return false;
+            }
         }
     }
     if (bTric_)
@@ -679,7 +653,7 @@ bool AnalysisNeighborhoodSearchImpl::initGrid(
         cellShiftZX_ = box[ZZ][XX] * invCellSize_[XX];
         cellShiftYX_ = box[YY][XX] * invCellSize_[XX];
     }
-    return checkGridSearchEfficiency(bForce);
+    return true;
 }
 
 void AnalysisNeighborhoodSearchImpl::mapPointToGridCell(const rvec x,
@@ -725,7 +699,7 @@ int AnalysisNeighborhoodSearchImpl::getGridCellIndex(const ivec cell) const
            + cell[ZZ] * ncelldim_[XX] * ncelldim_[YY];
 }
 
-void AnalysisNeighborhoodSearchImpl::addToGridCell(const rvec cell, int i)
+int AnalysisNeighborhoodSearchImpl::getGridCellIndex(const rvec cell) const
 {
     ivec icell;
     for (int dd = 0; dd < DIM; ++dd)
@@ -745,59 +719,57 @@ void AnalysisNeighborhoodSearchImpl::addToGridCell(const rvec cell, int i)
         }
         icell[dd] = cellIndex;
     }
-    const int ci = getGridCellIndex(icell);
+    return getGridCellIndex(icell);
+}
+
+void AnalysisNeighborhoodSearchImpl::addToGridCell(const rvec cell, int i)
+{
+    const int ci = getGridCellIndex(cell);
     cells_[ci].push_back(i);
 }
 
 void AnalysisNeighborhoodSearchImpl::initCellRange(
         const rvec centerCell, ivec currCell, ivec upperBound, int dim) const
 {
-    // TODO: Prune off cells that are completely outside the cutoff.
-    const real range       = cutoff_ * invCellSize_[dim];
-    real       startOffset = centerCell[dim] - range;
-    real       endOffset   = centerCell[dim] + range;
+    RVec       shiftedCenter(centerCell);
+    // Shift the center to the cell coordinates of currCell, so that
+    // computeCutoffExtent() can assume simple rectangular grid.
     if (bTric_)
     {
-        switch (dim)
+        if (dim == XX)
         {
-            case ZZ:
-                break;
-            case YY:
-                if (currCell[ZZ] < 0)
-                {
-                    startOffset += cellShiftZY_;
-                    endOffset   += cellShiftZY_;
-                }
-                else if (currCell[ZZ] >= ncelldim_[ZZ])
-                {
-                    startOffset -= cellShiftZY_;
-                    endOffset   -= cellShiftZY_;
-                }
-                break;
-            case XX:
-                if (currCell[ZZ] < 0)
-                {
-                    startOffset += cellShiftZX_;
-                    endOffset   += cellShiftZX_;
-                }
-                else if (currCell[ZZ] >= ncelldim_[ZZ])
-                {
-                    startOffset -= cellShiftZX_;
-                    endOffset   -= cellShiftZX_;
-                }
-                if (currCell[YY] < 0)
-                {
-                    startOffset += cellShiftYX_;
-                    endOffset   += cellShiftYX_;
-                }
-                else if (currCell[YY] >= ncelldim_[YY])
-                {
-                    startOffset -= cellShiftYX_;
-                    endOffset   -= cellShiftYX_;
-                }
-                break;
+            if (currCell[ZZ] < 0)
+            {
+                shiftedCenter[XX] += cellShiftZX_;
+            }
+            else if (currCell[ZZ] >= ncelldim_[ZZ])
+            {
+                shiftedCenter[XX] -= cellShiftZX_;
+            }
+            if (currCell[YY] < 0)
+            {
+                shiftedCenter[XX] += cellShiftYX_;
+            }
+            else if (currCell[YY] >= ncelldim_[YY])
+            {
+                shiftedCenter[XX] -= cellShiftYX_;
+            }
+        }
+        if (dim == XX || dim == YY)
+        {
+            if (currCell[ZZ] < 0)
+            {
+                shiftedCenter[YY] += cellShiftZY_;
+            }
+            else if (currCell[ZZ] >= ncelldim_[ZZ])
+            {
+                shiftedCenter[YY] -= cellShiftZY_;
+            }
         }
     }
+    const real range       = computeCutoffExtent(shiftedCenter, currCell, dim) * invCellSize_[dim];
+    real       startOffset = shiftedCenter[dim] - range;
+    real       endOffset   = shiftedCenter[dim] + range;
     // For non-periodic dimensions, clamp to the actual grid edges.
     if (!bGridPBC_[dim])
     {
@@ -817,6 +789,35 @@ void AnalysisNeighborhoodSearchImpl::initCellRange(
     upperBound[dim] = static_cast<int>(floor(endOffset));
 }
 
+real AnalysisNeighborhoodSearchImpl::computeCutoffExtent(
+        const RVec centerCell, const ivec cell, int dim) const
+{
+    if (dim == ZZ)
+    {
+        return cutoff_;
+    }
+
+    real dist2 = 0;
+    for (int d = dim + 1; d < DIM; ++d)
+    {
+        real dimDist = cell[d] - centerCell[d];
+        if (dimDist < -1)
+        {
+            dimDist += 1;
+        }
+        else if (dimDist <= 0)
+        {
+            continue;
+        }
+        dist2 += dimDist*dimDist*cellSize_[d]*cellSize_[d];
+    }
+    if (dist2 >= cutoff2_)
+    {
+        return 0;
+    }
+    return std::sqrt(cutoff2_ - dist2);
+}
+
 bool AnalysisNeighborhoodSearchImpl::nextCell(
         const rvec centerCell, ivec cell, ivec upperBound) const
 {
@@ -884,7 +885,7 @@ void AnalysisNeighborhoodSearchImpl::init(
     GMX_RELEASE_ASSERT(positions.index_ == -1,
                        "Individual indexed positions not supported as reference");
     bXY_ = bXY;
-    if (bXY_ && pbc != NULL && pbc->ePBC != epbcNONE)
+    if (bXY_ && pbc != nullptr && pbc->ePBC != epbcNONE)
     {
         if (pbc->ePBC != epbcXY && pbc->ePBC != epbcXYZ)
         {
@@ -905,7 +906,7 @@ void AnalysisNeighborhoodSearchImpl::init(
         clear_rvec(box[ZZ]);
         set_pbc(&pbc_, epbcXY, box);
     }
-    else if (pbc != NULL)
+    else if (pbc != nullptr)
     {
         pbc_ = *pbc;
     }
@@ -932,13 +933,13 @@ void AnalysisNeighborhoodSearchImpl::init(
 
         for (int i = 0; i < nref_; ++i)
         {
-            const int ii = (refIndices_ != NULL) ? refIndices_[i] : i;
+            const int ii = (refIndices_ != nullptr) ? refIndices_[i] : i;
             rvec      refcell;
             mapPointToGridCell(positions.x_[ii], refcell, xrefAlloc_[i]);
             addToGridCell(refcell, i);
         }
     }
-    else if (refIndices_ != NULL)
+    else if (refIndices_ != nullptr)
     {
         xrefAlloc_.resize(nref_);
         xref_ = as_rvec_array(xrefAlloc_.data());
@@ -952,12 +953,12 @@ void AnalysisNeighborhoodSearchImpl::init(
         xref_ = positions.x_;
     }
     excls_           = excls;
-    refExclusionIds_ = NULL;
-    if (excls != NULL)
+    refExclusionIds_ = nullptr;
+    if (excls != nullptr)
     {
         // TODO: Check that the IDs are ascending, or remove the limitation.
         refExclusionIds_ = positions.exclusionIds_;
-        GMX_RELEASE_ASSERT(refExclusionIds_ != NULL,
+        GMX_RELEASE_ASSERT(refExclusionIds_ != nullptr,
                            "Exclusion IDs must be set for reference positions "
                            "when exclusions are enabled");
     }
@@ -969,23 +970,37 @@ void AnalysisNeighborhoodSearchImpl::init(
 
 void AnalysisNeighborhoodPairSearchImpl::reset(int testIndex)
 {
-    testIndex_ = testIndex;
+    testIndex_     = testIndex;
+    testCellIndex_ = -1;
+    previ_         = -1;
+    prevr2_        = 0.0;
+    clear_rvec(prevdx_);
+    exclind_       = 0;
+    prevcai_       = -1;
     if (testIndex_ >= 0 && testIndex_ < testPosCount_)
     {
         const int index =
-            (testIndices_ != NULL ? testIndices_[testIndex] : testIndex);
+            (testIndices_ != nullptr ? testIndices_[testIndex] : testIndex);
         if (search_.bGrid_)
         {
             search_.mapPointToGridCell(testPositions_[index], testcell_, xtest_);
             search_.initCellRange(testcell_, currCell_, cellBound_, ZZ);
             search_.initCellRange(testcell_, currCell_, cellBound_, YY);
             search_.initCellRange(testcell_, currCell_, cellBound_, XX);
+            if (selfSearchMode_)
+            {
+                testCellIndex_ = search_.getGridCellIndex(testcell_);
+            }
         }
         else
         {
             copy_rvec(testPositions_[index], xtest_);
+            if (selfSearchMode_)
+            {
+                previ_ = testIndex_;
+            }
         }
-        if (search_.excls_ != NULL)
+        if (search_.excls_ != nullptr)
         {
             const int exclIndex  = testExclusionIds_[index];
             if (exclIndex < search_.excls_->nr)
@@ -997,15 +1012,10 @@ void AnalysisNeighborhoodPairSearchImpl::reset(int testIndex)
             else
             {
                 nexcl_ = 0;
-                excl_  = NULL;
+                excl_  = nullptr;
             }
         }
     }
-    previ_     = -1;
-    prevr2_    = 0.0;
-    clear_rvec(prevdx_);
-    exclind_   = 0;
-    prevcai_   = -1;
 }
 
 void AnalysisNeighborhoodPairSearchImpl::nextTestPosition()
@@ -1022,7 +1032,7 @@ bool AnalysisNeighborhoodPairSearchImpl::isExcluded(int j)
     if (exclind_ < nexcl_)
     {
         const int index =
-            (search_.refIndices_ != NULL ? search_.refIndices_[j] : j);
+            (search_.refIndices_ != nullptr ? search_.refIndices_[j] : j);
         const int refId = search_.refExclusionIds_[index];
         while (exclind_ < nexcl_ && excl_[exclind_] < refId)
         {
@@ -1040,11 +1050,12 @@ bool AnalysisNeighborhoodPairSearchImpl::isExcluded(int j)
 void AnalysisNeighborhoodPairSearchImpl::startSearch(
         const AnalysisNeighborhoodPositions &positions)
 {
+    selfSearchMode_   = false;
     testPosCount_     = positions.count_;
     testPositions_    = positions.x_;
     testExclusionIds_ = positions.exclusionIds_;
     testIndices_      = positions.indices_;
-    GMX_RELEASE_ASSERT(search_.excls_ == NULL || testExclusionIds_ != NULL,
+    GMX_RELEASE_ASSERT(search_.excls_ == nullptr || testExclusionIds_ != nullptr,
                        "Exclusion IDs must be set when exclusions are enabled");
     if (positions.index_ < 0)
     {
@@ -1059,6 +1070,18 @@ void AnalysisNeighborhoodPairSearchImpl::startSearch(
     }
 }
 
+void AnalysisNeighborhoodPairSearchImpl::startSelfSearch()
+{
+    selfSearchMode_   = true;
+    testPosCount_     = search_.nref_;
+    testPositions_    = search_.xref_;
+    testExclusionIds_ = search_.refExclusionIds_;
+    testIndices_      = search_.refIndices_;
+    GMX_RELEASE_ASSERT(search_.excls_ == nullptr || testIndices_ == nullptr,
+                       "Exclusion IDs not implemented with indexed ref positions");
+    reset(0);
+}
+
 template <class Action>
 bool AnalysisNeighborhoodPairSearchImpl::searchNext(Action action)
 {
@@ -1072,10 +1095,18 @@ bool AnalysisNeighborhoodPairSearchImpl::searchNext(Action action)
             {
                 rvec      shift;
                 const int ci       = search_.shiftCell(currCell_, shift);
+                if (selfSearchMode_ && ci > testCellIndex_)
+                {
+                    continue;
+                }
                 const int cellSize = static_cast<int>(search_.cells_[ci].size());
                 for (; cai < cellSize; ++cai)
                 {
                     const int i = search_.cells_[ci][cai];
+                    if (selfSearchMode_ && ci == testCellIndex_ && i >= testIndex_)
+                    {
+                        continue;
+                    }
                     if (isExcluded(i))
                     {
                         continue;
@@ -1238,7 +1269,7 @@ class AnalysisNeighborhood::Impl
         typedef std::vector<SearchImplPointer> SearchList;
 
         Impl()
-            : cutoff_(0), excls_(NULL), mode_(eSearchMode_Automatic), bXY_(false)
+            : cutoff_(0), excls_(nullptr), mode_(eSearchMode_Automatic), bXY_(false)
         {
         }
         ~Impl()
@@ -1396,6 +1427,15 @@ AnalysisNeighborhoodSearch::nearestPoint(
     return AnalysisNeighborhoodPair(closestPoint, 0, minDist2, dx);
 }
 
+AnalysisNeighborhoodPairSearch
+AnalysisNeighborhoodSearch::startSelfPairSearch() const
+{
+    GMX_RELEASE_ASSERT(impl_, "Accessing an invalid search object");
+    Impl::PairSearchImplPointer pairSearch(impl_->getPairSearch());
+    pairSearch->startSelfSearch();
+    return AnalysisNeighborhoodPairSearch(pairSearch);
+}
+
 AnalysisNeighborhoodPairSearch
 AnalysisNeighborhoodSearch::startPairSearch(
         const AnalysisNeighborhoodPositions &positions) const
index cbd3fdc268bd14fb0a6c6fbce909ddf8fa5597f5..0561822a68c0a7fb38ac5337c414c2697a68a132 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,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.
@@ -109,14 +109,14 @@ class AnalysisNeighborhoodPositions
          * to methods that accept positions.
          */
         AnalysisNeighborhoodPositions(const rvec &x)
-            : count_(1), index_(-1), x_(&x), exclusionIds_(NULL), indices_(NULL)
+            : count_(1), index_(-1), x_(&x), exclusionIds_(nullptr), indices_(nullptr)
         {
         }
         /*! \brief
          * Initializes positions from an array of position vectors.
          */
         AnalysisNeighborhoodPositions(const rvec x[], int count)
-            : count_(count), index_(-1), x_(x), exclusionIds_(NULL), indices_(NULL)
+            : count_(count), index_(-1), x_(x), exclusionIds_(nullptr), indices_(nullptr)
         {
         }
         /*! \brief
@@ -124,7 +124,7 @@ class AnalysisNeighborhoodPositions
          */
         AnalysisNeighborhoodPositions(const std::vector<RVec> &x)
             : count_(x.size()), index_(-1), x_(as_rvec_array(x.data())),
-              exclusionIds_(NULL), indices_(NULL)
+              exclusionIds_(nullptr), indices_(nullptr)
         {
         }
 
@@ -415,8 +415,8 @@ class AnalysisNeighborhoodPair
  * variable (see sm_distance.cpp).
  *
  * \todo
- * Consider merging nearestPoint() and minimumDistance() by adding the distance
- * to AnalysisNeighborhoodPair.
+ * Consider removing minimumDistance(), as nearestPoint() already returns the
+ * distance.
  *
  * \inpublicapi
  * \ingroup module_selection
@@ -470,7 +470,7 @@ class AnalysisNeighborhoodSearch
         AnalysisNeighborhood::SearchMode mode() const;
 
         /*! \brief
-         * Check whether a point is within a neighborhood.
+         * Checks whether a point is within a neighborhood.
          *
          * \param[in] positions  Set of test positions to use.
          * \returns   true if any of the test positions is within the cutoff of
@@ -500,12 +500,33 @@ class AnalysisNeighborhoodSearch
         nearestPoint(const AnalysisNeighborhoodPositions &positions) const;
 
         /*! \brief
-         * Start a search to find reference positions within a cutoff.
+         * Starts a search to find all reference position pairs within a cutoff.
+         *
+         * \returns   Initialized search object to loop through all reference
+         *     position pairs within the configured cutoff.
+         * \throws    std::bad_alloc if out of memory.
+         *
+         * This works as if the reference positions were passed to
+         * startPairSearch(), except that it only returns each pair once,
+         * instead of returning both i-j and j-i pairs, as startPairSearch()
+         * does.  i-i pairs are not returned.  Note that the order of ref/test
+         * indices in the returned pairs is not predictable.  That is, one of
+         * i-j or j-i is always returned, but there is no control which one.
+         */
+        AnalysisNeighborhoodPairSearch
+        startSelfPairSearch() const;
+
+        /*! \brief
+         * Starts a search to find reference positions within a cutoff.
          *
          * \param[in] positions  Set of test positions to use.
          * \returns   Initialized search object to loop through all reference
          *     positions within the configured cutoff.
          * \throws    std::bad_alloc if out of memory.
+         *
+         * If you want to pass the same positions here as you used for the
+         * reference positions, consider using startSelfPairSearch().
+         * It can be up to 50% faster.
          */
         AnalysisNeighborhoodPairSearch
         startPairSearch(const AnalysisNeighborhoodPositions &positions) const;
index 1884a63821bb7e5b96091cc23a39946727c787f6..4e69009cbe1d752031c44e2231af8f14ebe7385b 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
@@ -50,9 +50,9 @@
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
-#include "gromacs/utility/scoped_cptr.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/unique_cptr.h"
 
 #include "parsetree.h"
 #include "scanner.h"
@@ -78,18 +78,18 @@ gmx_ana_selparam_find(const char *name, int nparam, gmx_ana_selparam_t *param)
 
     if (nparam == 0)
     {
-        return NULL;
+        return nullptr;
     }
     /* Find the first non-null parameter */
     i = 0;
-    while (i < nparam && param[i].name == NULL)
+    while (i < nparam && param[i].name == nullptr)
     {
         ++i;
     }
     /* Process the special case of a NULL parameter */
-    if (name == NULL)
+    if (name == nullptr)
     {
-        return (i == 0) ? NULL : &param[i-1];
+        return (i == 0) ? nullptr : &param[i-1];
     }
     for (; i < nparam; ++i)
     {
@@ -105,7 +105,7 @@ gmx_ana_selparam_find(const char *name, int nparam, gmx_ana_selparam_t *param)
             return &param[i];
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 /*! \brief
@@ -133,7 +133,7 @@ convert_value(SelectionParserValue *value, e_selvalue_t type,
             try
             {
                 SelectionTreeElementPointer expr =
-                    _gmx_sel_init_position(value->expr, NULL, scanner);
+                    _gmx_sel_init_position(value->expr, nullptr, scanner);
                 *value = SelectionParserValue::createExpr(expr);
             }
             catch (UserInputError &ex)
@@ -309,9 +309,9 @@ parse_values_range(const SelectionParserValueList &values,
     param->flags &= ~SPAR_DYNAMIC;
     GMX_RELEASE_ASSERT(param->val.type == INT_VALUE || param->val.type == REAL_VALUE,
                        "Invalid range parameter type");
-    int                *idata = NULL;
-    real               *rdata = NULL;
-    scoped_guard_sfree  dataGuard;
+    int                *idata = nullptr;
+    real               *rdata = nullptr;
+    sfree_guard         dataGuard;
     if (param->val.type == INT_VALUE)
     {
         snew(idata, values.size()*2);
@@ -451,7 +451,7 @@ parse_values_range(const SelectionParserValueList &values,
     {
         *param->nvalptr = param->val.nr;
     }
-    param->nvalptr = NULL;
+    param->nvalptr = nullptr;
 }
 
 /*! \brief
@@ -499,7 +499,7 @@ parse_values_varnum(const SelectionParserValueList    &values,
     if (param->val.type == POS_VALUE)
     {
         gmx_ana_pos_reserve(param->val.u.p, valueCount, 0);
-        gmx_ana_indexmap_init(&param->val.u.p->m, NULL, NULL, INDEX_UNKNOWN);
+        gmx_ana_indexmap_init(&param->val.u.p->m, nullptr, nullptr, INDEX_UNKNOWN);
         gmx_ana_pos_set_nr(param->val.u.p, valueCount);
     }
     else
@@ -586,7 +586,7 @@ parse_values_varnum(const SelectionParserValueList    &values,
     {
         *param->nvalptr = param->val.nr;
     }
-    param->nvalptr = NULL;
+    param->nvalptr = nullptr;
 }
 
 /*! \brief
@@ -685,7 +685,7 @@ parse_values_varnum_expr(const SelectionParserValueList    &values,
         {
             *param->nvalptr = param->val.nr;
         }
-        param->nvalptr = NULL;
+        param->nvalptr = nullptr;
         return;
     }
 
@@ -795,7 +795,7 @@ parse_values_std(const SelectionParserValueList &values,
             {
                 *param->nvalptr = 1;
             }
-            param->nvalptr = NULL;
+            param->nvalptr = nullptr;
             if (param->val.type == INT_VALUE || param->val.type == REAL_VALUE
                 || param->val.type == STR_VALUE)
             {
@@ -914,7 +914,7 @@ parse_values_std(const SelectionParserValueList &values,
     {
         *param->nvalptr = param->val.nr;
     }
-    param->nvalptr = NULL;
+    param->nvalptr = nullptr;
 }
 
 /*! \brief
@@ -998,7 +998,7 @@ parse_values_enum(const SelectionParserValueList &values,
     const std::string &svalue = value.stringValue();
     int                i      = 1;
     int                match  = 0;
-    while (param->val.u.s[i] != NULL)
+    while (param->val.u.s[i] != nullptr)
     {
         if (startsWith(param->val.u.s[i], svalue))
         {
@@ -1088,19 +1088,19 @@ _gmx_sel_parse_params(const gmx::SelectionParserParameterList &pparams,
         if (params[i].val.type != POS_VALUE
             && (params[i].flags & (SPAR_VARNUM | SPAR_ATOMVAL)))
         {
-            GMX_RELEASE_ASSERT(params[i].val.u.ptr == NULL,
+            GMX_RELEASE_ASSERT(params[i].val.u.ptr == nullptr,
                                "value pointer is not NULL "
                                "although it should be for SPAR_VARNUM "
                                "and SPAR_ATOMVAL parameters");
             GMX_RELEASE_ASSERT(!((params[i].flags & SPAR_VARNUM)
                                  && (params[i].flags & SPAR_DYNAMIC))
-                               || params[i].nvalptr != NULL,
+                               || params[i].nvalptr != nullptr,
                                "nvalptr is NULL but both "
                                "SPAR_VARNUM and SPAR_DYNAMIC are specified");
         }
         else
         {
-            GMX_RELEASE_ASSERT(params[i].val.u.ptr != NULL,
+            GMX_RELEASE_ASSERT(params[i].val.u.ptr != nullptr,
                                "value pointer is NULL");
         }
     }
@@ -1112,19 +1112,19 @@ _gmx_sel_parse_params(const gmx::SelectionParserParameterList &pparams,
         try
         {
             // Always assigned afterwards, but cppcheck does not see that.
-            gmx_ana_selparam_t *oparam = NULL;
+            gmx_ana_selparam_t *oparam = nullptr;
             /* Find the parameter and make some checks */
             if (!pparam->name().empty())
             {
                 nullParamIndex = -1;
                 oparam
                     = gmx_ana_selparam_find(pparam->name().c_str(), nparam, params);
-                GMX_RELEASE_ASSERT(oparam != NULL, "Inconsistent selection parameter");
+                GMX_RELEASE_ASSERT(oparam != nullptr, "Inconsistent selection parameter");
             }
             else if (nullParamIndex >= 0)
             {
                 oparam = &params[nullParamIndex];
-                if (oparam->name != NULL)
+                if (oparam->name != nullptr)
                 {
                     std::string text(_gmx_sel_lexer_get_text(scanner, pparam->location()));
                     std::string message
@@ -1210,7 +1210,7 @@ _gmx_sel_parse_params(const gmx::SelectionParserParameterList &pparams,
         if (!(params[i].flags & SPAR_OPTIONAL) && !(params[i].flags & SPAR_SET))
         {
             std::string message;
-            if (params[i].name == NULL)
+            if (params[i].name == nullptr)
             {
                 message = formatString("'%s' should be followed by a value/expression",
                                        root->name().c_str());
index b65af7c791c0066dc00007c3f9c8ac639984d1b5..27bb03189a933c86600adecf19c81ed464e36994 100644 (file)
@@ -1,19 +1,19 @@
-/* A Bison parser, made by GNU Bison 2.7.12-4996.  */
+/* A Bison parser, made by GNU Bison 3.0.4.  */
 
 /* Bison implementation for Yacc-like parsers in C
-   
-      Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
-   
+
+   Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
+
    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 3 of the License, or
    (at your option) any later version.
-   
+
    This program 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 General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
@@ -26,7 +26,7 @@
    special exception, which will cause the skeleton and the resulting
    Bison output files to be licensed under the GNU General Public
    License without this special exception.
-   
+
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
@@ -44,7 +44,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "2.7.12-4996"
+#define YYBISON_VERSION "3.0.4"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -59,8 +59,7 @@
 #define YYPULL 0
 
 /* "%code top" blocks.  */
-/* Line 349 of yacc.c  */
-#line 43 "parser.y"
+#line 43 "parser.y" /* yacc.c:316  */
 
 /*! \internal \file parser.cpp
  * \brief Generated (from parser.y by Bison) parser for the selection language.
@@ -74,9 +73,7 @@
  */
 #include "gmxpre.h"
 
-
-/* Line 349 of yacc.c  */
-#line 80 "parser.cpp"
+#line 77 "parser.cpp" /* yacc.c:316  */
 
 /* Substitute the variable and function names.  */
 #define yypush_parse    _gmx_sel_yypush_parse
 #define yypstate        _gmx_sel_yypstate
 #define yylex           _gmx_sel_yylex
 #define yyerror         _gmx_sel_yyerror
-#define yylval          _gmx_sel_yylval
-#define yychar          _gmx_sel_yychar
 #define yydebug         _gmx_sel_yydebug
 #define yynerrs         _gmx_sel_yynerrs
-#define yylloc          _gmx_sel_yylloc
+
 
 /* Copy the first part of user declarations.  */
-/* Line 371 of yacc.c  */
-#line 56 "parser.y"
+#line 56 "parser.y" /* yacc.c:339  */
 
-#include "gromacs/utility/scoped_cptr.h"
+#include "gromacs/utility/unique_cptr.h"
 
 #include "parser_internal.h"
 
-using gmx::scoped_guard_sfree;
+using gmx::sfree_guard;
 using gmx::SelectionParserValue;
 using gmx::SelectionParserValueList;
 using gmx::SelectionParserValueListPointer;
@@ -113,14 +107,13 @@ using gmx::SelectionTreeElementPointer;
 #pragma warning(disable: 4065)
 #endif
 
-/* Line 371 of yacc.c  */
-#line 118 "parser.cpp"
+#line 111 "parser.cpp" /* yacc.c:339  */
 
-# ifndef YY_NULL
+# ifndef YY_NULLPTR
 #  if defined __cplusplus && 201103L <= __cplusplus
-#   define YY_NULL nullptr
+#   define YY_NULLPTR nullptr
 #  else
-#   define YY_NULL 0
+#   define YY_NULLPTR 0
 #  endif
 # endif
 
@@ -136,7 +129,7 @@ using gmx::SelectionTreeElementPointer;
    by #include "parser.h".  */
 #ifndef YY__GMX_SEL_YY_PARSER_H_INCLUDED
 # define YY__GMX_SEL_YY_PARSER_H_INCLUDED
-/* Enabling traces.  */
+/* Debug traces.  */
 #ifndef YYDEBUG
 # define YYDEBUG 1
 #endif
@@ -144,13 +137,12 @@ using gmx::SelectionTreeElementPointer;
 extern int _gmx_sel_yydebug;
 #endif
 /* "%code requires" blocks.  */
-/* Line 387 of yacc.c  */
-#line 1 "parser.y"
+#line 1 "parser.y" /* yacc.c:355  */
 
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,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.
@@ -181,65 +173,60 @@ extern int _gmx_sel_yydebug;
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-
-/* Line 387 of yacc.c  */
-#line 76 "parser.y"
+#line 76 "parser.y" /* yacc.c:355  */
 
 #include "parsetree.h"
 #include "selelem.h"
 
 #define YYLTYPE ::gmx::SelectionLocation
 
+#line 184 "parser.cpp" /* yacc.c:355  */
 
-/* Line 387 of yacc.c  */
-#line 196 "parser.cpp"
-
-/* Tokens.  */
+/* Token type.  */
 #ifndef YYTOKENTYPE
 # define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     INVALID = 258,
-     TOK_INT = 259,
-     TOK_REAL = 260,
-     STR = 261,
-     IDENTIFIER = 262,
-     CMD_SEP = 263,
-     GROUP = 264,
-     TO = 265,
-     VARIABLE_NUMERIC = 266,
-     VARIABLE_GROUP = 267,
-     VARIABLE_POS = 268,
-     KEYWORD_NUMERIC = 269,
-     KEYWORD_STR = 270,
-     KEYWORD_POS = 271,
-     KEYWORD_GROUP = 272,
-     METHOD_NUMERIC = 273,
-     METHOD_GROUP = 274,
-     METHOD_POS = 275,
-     MODIFIER = 276,
-     EMPTY_POSMOD = 277,
-     PARAM = 278,
-     END_OF_METHOD = 279,
-     OF = 280,
-     CMP_OP = 281,
-     PARAM_REDUCT = 282,
-     XOR = 283,
-     OR = 284,
-     AND = 285,
-     NOT = 286,
-     UNARY_NEG = 287,
-     NUM_REDUCT = 288
-   };
+  enum yytokentype
+  {
+    INVALID = 258,
+    TOK_INT = 259,
+    TOK_REAL = 260,
+    STR = 261,
+    IDENTIFIER = 262,
+    CMD_SEP = 263,
+    GROUP = 264,
+    TO = 265,
+    VARIABLE_NUMERIC = 266,
+    VARIABLE_GROUP = 267,
+    VARIABLE_POS = 268,
+    KEYWORD_NUMERIC = 269,
+    KEYWORD_STR = 270,
+    KEYWORD_POS = 271,
+    KEYWORD_GROUP = 272,
+    METHOD_NUMERIC = 273,
+    METHOD_GROUP = 274,
+    METHOD_POS = 275,
+    MODIFIER = 276,
+    EMPTY_POSMOD = 277,
+    PARAM = 278,
+    END_OF_METHOD = 279,
+    OF = 280,
+    CMP_OP = 281,
+    PARAM_REDUCT = 282,
+    OR = 283,
+    XOR = 284,
+    AND = 285,
+    NOT = 286,
+    UNARY_NEG = 287,
+    NUM_REDUCT = 288
+  };
 #endif
 
-
+/* Value type.  */
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
+
+union YYSTYPE
 {
-/* Line 387 of yacc.c  */
-#line 83 "parser.y"
+#line 83 "parser.y" /* yacc.c:355  */
 
     int                         i;
     real                        r;
@@ -254,29 +241,30 @@ typedef union YYSTYPE
     gmx::SelectionParserParameter               *param;
     gmx::SelectionParserParameterListPointer    *plist;
 
+#line 245 "parser.cpp" /* yacc.c:355  */
+};
 
-/* Line 387 of yacc.c  */
-#line 260 "parser.cpp"
-} YYSTYPE;
+typedef union YYSTYPE YYSTYPE;
 # define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
 #endif
 
+/* Location type.  */
 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
-typedef struct YYLTYPE
+typedef struct YYLTYPE YYLTYPE;
+struct YYLTYPE
 {
   int first_line;
   int first_column;
   int last_line;
   int last_column;
-} YYLTYPE;
-# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
+};
 # define YYLTYPE_IS_DECLARED 1
 # define YYLTYPE_IS_TRIVIAL 1
 #endif
 
 
+
 #ifndef YYPUSH_MORE_DEFINED
 # define YYPUSH_MORE_DEFINED
 enum { YYPUSH_MORE = 4 };
@@ -284,29 +272,16 @@ enum { YYPUSH_MORE = 4 };
 
 typedef struct _gmx_sel_yypstate _gmx_sel_yypstate;
 
-#if defined __STDC__ || defined __cplusplus
 int _gmx_sel_yypush_parse (_gmx_sel_yypstate *ps, int pushed_char, YYSTYPE const *pushed_val, YYLTYPE *pushed_loc, void *scanner);
-#else
-int _gmx_sel_yypush_parse ();
-#endif
 
-#if defined __STDC__ || defined __cplusplus
 _gmx_sel_yypstate * _gmx_sel_yypstate_new (void);
-#else
-_gmx_sel_yypstate * _gmx_sel_yypstate_new ();
-#endif
-#if defined __STDC__ || defined __cplusplus
 void _gmx_sel_yypstate_delete (_gmx_sel_yypstate *ps);
-#else
-void _gmx_sel_yypstate_delete ();
-#endif
 
 #endif /* !YY__GMX_SEL_YY_PARSER_H_INCLUDED  */
 
 /* Copy the second part of user declarations.  */
 
-/* Line 390 of yacc.c  */
-#line 310 "parser.cpp"
+#line 285 "parser.cpp" /* yacc.c:358  */
 
 #ifdef short
 # undef short
@@ -320,11 +295,8 @@ typedef unsigned char yytype_uint8;
 
 #ifdef YYTYPE_INT8
 typedef YYTYPE_INT8 yytype_int8;
-#elif (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-typedef signed char yytype_int8;
 #else
-typedef short int yytype_int8;
+typedef signed char yytype_int8;
 #endif
 
 #ifdef YYTYPE_UINT16
@@ -344,8 +316,7 @@ typedef short int yytype_int16;
 #  define YYSIZE_T __SIZE_TYPE__
 # elif defined size_t
 #  define YYSIZE_T size_t
-# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
+# elif ! defined YYSIZE_T
 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
 #  define YYSIZE_T size_t
 # else
@@ -367,11 +338,30 @@ typedef short int yytype_int16;
 # endif
 #endif
 
-#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later.  */
-# if (! defined __GNUC__ || __GNUC__ < 2 \
-      || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
-#  define __attribute__(Spec) /* empty */
+#ifndef YY_ATTRIBUTE
+# if (defined __GNUC__                                               \
+      && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
+     || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
+#  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
+# else
+#  define YY_ATTRIBUTE(Spec) /* empty */
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE_PURE
+# define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
+#endif
+
+#ifndef YY_ATTRIBUTE_UNUSED
+# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
+#endif
+
+#if !defined _Noreturn \
+     && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
+# if defined _MSC_VER && 1200 <= _MSC_VER
+#  define _Noreturn __declspec (noreturn)
+# else
+#  define _Noreturn YY_ATTRIBUTE ((__noreturn__))
 # endif
 #endif
 
@@ -382,32 +372,33 @@ typedef short int yytype_int16;
 # define YYUSE(E) /* empty */
 #endif
 
-
-/* Identity function, used to suppress warnings about constant conditions.  */
-#ifndef lint
-# define YYID(N) (N)
-#else
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static int
-YYID (int yyi)
+#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
+/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+    _Pragma ("GCC diagnostic push") \
+    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
+    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+    _Pragma ("GCC diagnostic pop")
 #else
-static int
-YYID (yyi)
-    int yyi;
+# define YY_INITIAL_VALUE(Value) Value
 #endif
-{
-  return yyi;
-}
+#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END
 #endif
+#ifndef YY_INITIAL_VALUE
+# define YY_INITIAL_VALUE(Value) /* Nothing. */
+#endif
+
 
 #if ! defined yyoverflow || YYERROR_VERBOSE
 
 /* The parser invokes alloca or malloc; define the necessary symbols.  */
 
 # ifdef YYSTACK_ALLOC
-   /* Pacify GCC's `empty if-body' warning.  */
-#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
+   /* Pacify GCC's 'empty if-body' warning.  */
+#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
 #  ifndef YYSTACK_ALLOC_MAXIMUM
     /* The OS might guarantee only one guard page at the bottom of the stack,
        and a page size can be as small as 4096 bytes.  So we cannot safely
@@ -423,7 +414,7 @@ YYID (yyi)
 #  endif
 #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
        && ! ((defined YYMALLOC || defined malloc) \
-            && (defined YYFREE || defined free)))
+             && (defined YYFREE || defined free)))
 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
 #   ifndef EXIT_SUCCESS
 #    define EXIT_SUCCESS 0
@@ -431,15 +422,13 @@ YYID (yyi)
 #  endif
 #  ifndef YYMALLOC
 #   define YYMALLOC malloc
-#   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
+#   if ! defined malloc && ! defined EXIT_SUCCESS
 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
 #   endif
 #  endif
 #  ifndef YYFREE
 #   define YYFREE free
-#   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
+#   if ! defined free && ! defined EXIT_SUCCESS
 void free (void *); /* INFRINGES ON USER NAME SPACE */
 #   endif
 #  endif
@@ -449,8 +438,8 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
 
 #if (! defined yyoverflow \
      && (! defined __cplusplus || defined GMX_YYFORCE_C_STACK_EXTENSION \
-        || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
-            && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+         || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
+             && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
 
 /* A type that is properly aligned for any stack member.  */
 union yyalloc
@@ -476,16 +465,16 @@ union yyalloc
    elements in the stack, and YYPTR gives the new location of the
    stack.  Advance YYPTR to a properly aligned location for the next
    stack.  */
-# define YYSTACK_RELOCATE(Stack_alloc, Stack)                          \
-    do                                                                 \
-      {                                                                        \
-       YYSIZE_T yynewbytes;                                            \
-       YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
-       Stack = &yyptr->Stack_alloc;                                    \
-       yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
-       yyptr += yynewbytes / sizeof (*yyptr);                          \
-      }                                                                        \
-    while (YYID (0))
+# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
+    do                                                                  \
+      {                                                                 \
+        YYSIZE_T yynewbytes;                                            \
+        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
+        Stack = &yyptr->Stack_alloc;                                    \
+        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+        yyptr += yynewbytes / sizeof (*yyptr);                          \
+      }                                                                 \
+    while (0)
 
 #endif
 
@@ -504,7 +493,7 @@ union yyalloc
           for (yyi = 0; yyi < (Count); yyi++)   \
             (Dst)[yyi] = (Src)[yyi];            \
         }                                       \
-      while (YYID (0))
+      while (0)
 #  endif
 # endif
 #endif /* !YYCOPY_NEEDED */
@@ -520,17 +509,19 @@ union yyalloc
 #define YYNNTS  25
 /* YYNRULES -- Number of rules.  */
 #define YYNRULES  90
-/* YYNRULES -- Number of states.  */
+/* YYNSTATES -- Number of states.  */
 #define YYNSTATES  154
 
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
+   by yylex, with out-of-bounds checking.  */
 #define YYUNDEFTOK  2
 #define YYMAXUTOK   288
 
-#define YYTRANSLATE(YYX)                                               \
+#define YYTRANSLATE(YYX)                                                \
   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
+/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
+   as returned by yylex, without out-of-bounds checking.  */
 static const yytype_uint8 yytranslate[] =
 {
        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
@@ -565,67 +556,19 @@ static const yytype_uint8 yytranslate[] =
 };
 
 #if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
-   YYRHS.  */
-static const yytype_uint16 yyprhs[] =
-{
-       0,     0,     3,     4,     7,    10,    13,    14,    16,    18,
-      20,    23,    27,    31,    35,    37,    39,    43,    47,    49,
-      52,    54,    57,    59,    61,    63,    65,    68,    72,    76,
-      80,    84,    87,    90,    92,    94,    96,    98,   100,   103,
-     107,   112,   116,   120,   122,   124,   127,   132,   136,   140,
-     144,   148,   152,   155,   159,   163,   165,   168,   176,   180,
-     183,   187,   189,   191,   193,   195,   198,   199,   202,   205,
-     207,   211,   212,   215,   219,   221,   225,   227,   230,   234,
-     236,   238,   240,   242,   244,   246,   248,   250,   252,   256,
-     260
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
-static const yytype_int8 yyrhs[] =
-{
-      50,     0,    -1,    -1,    50,    51,    -1,    52,     8,    -1,
-       1,     8,    -1,    -1,     4,    -1,    57,    -1,    53,    -1,
-       6,    53,    -1,     7,    39,    58,    -1,     7,    39,    61,
-      -1,     7,    39,    63,    -1,    63,    -1,    58,    -1,    40,
-      53,    41,    -1,    53,    21,    64,    -1,     4,    -1,    33,
-       4,    -1,     5,    -1,    33,     5,    -1,    54,    -1,    55,
-      -1,     6,    -1,     7,    -1,    31,    58,    -1,    58,    30,
-      58,    -1,    58,    29,    58,    -1,    40,    58,    41,    -1,
-      61,    26,    61,    -1,     9,    57,    -1,     9,     4,    -1,
-      22,    -1,    16,    -1,    42,    -1,    43,    -1,    39,    -1,
-      59,    17,    -1,    59,    15,    69,    -1,    59,    15,    60,
-      69,    -1,    59,    14,    69,    -1,    59,    19,    64,    -1,
-       4,    -1,     5,    -1,    59,    14,    -1,    59,    14,    25,
-      63,    -1,    59,    18,    64,    -1,    61,    32,    61,    -1,
-      61,    33,    61,    -1,    61,    34,    61,    -1,    61,    35,
-      61,    -1,    33,    61,    -1,    61,    37,    61,    -1,    40,
-      61,    41,    -1,    57,    -1,    59,    15,    -1,    44,    56,
-      45,    56,    45,    56,    46,    -1,    40,    63,    41,    -1,
-      20,    64,    -1,    16,    25,    58,    -1,    12,    -1,    11,
-      -1,    13,    -1,    65,    -1,    65,    24,    -1,    -1,    65,
-      66,    -1,    23,    67,    -1,    68,    -1,    47,    68,    48,
-      -1,    -1,    68,    71,    -1,    68,    45,    71,    -1,    70,
-      -1,    47,    70,    48,    -1,    72,    -1,    70,    72,    -1,
-      70,    45,    72,    -1,    58,    -1,    63,    -1,    61,    -1,
-      62,    -1,    73,    -1,    54,    -1,    55,    -1,    57,    -1,
-      73,    -1,    54,    10,    54,    -1,    54,    10,    55,    -1,
-      55,    10,    56,    -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
 static const yytype_uint16 yyrline[] =
 {
-       0,   199,   199,   204,   215,   216,   236,   241,   252,   264,
-     270,   277,   284,   291,   301,   302,   309,   310,   324,   325,
-     329,   330,   333,   334,   337,   338,   346,   357,   368,   379,
-     383,   394,   401,   410,   411,   416,   417,   418,   422,   430,
-     438,   446,   457,   472,   483,   497,   505,   513,   524,   530,
-     536,   542,   548,   554,   560,   567,   578,   593,   602,   606,
-     616,   630,   638,   646,   659,   661,   667,   672,   683,   692,
-     693,   698,   703,   711,   722,   723,   727,   733,   741,   751,
-     757,   763,   769,   775,   779,   785,   791,   798,   802,   808,
-     814
+       0,   199,   199,   204,   217,   218,   238,   243,   254,   266,
+     272,   279,   286,   293,   303,   304,   311,   312,   326,   327,
+     331,   332,   335,   336,   339,   340,   348,   359,   370,   381,
+     385,   396,   403,   412,   413,   418,   419,   420,   424,   432,
+     440,   448,   459,   474,   485,   499,   507,   515,   526,   532,
+     538,   544,   550,   556,   562,   569,   580,   595,   604,   608,
+     618,   632,   640,   648,   661,   663,   669,   674,   685,   694,
+     695,   700,   705,   713,   724,   725,   729,   735,   743,   753,
+     759,   765,   771,   777,   781,   787,   793,   800,   804,   810,
+     816
 };
 #endif
 
@@ -639,7 +582,7 @@ static const char *const yytname[] =
   "VARIABLE_GROUP", "VARIABLE_POS", "KEYWORD_NUMERIC", "KEYWORD_STR",
   "KEYWORD_POS", "KEYWORD_GROUP", "METHOD_NUMERIC", "METHOD_GROUP",
   "METHOD_POS", "MODIFIER", "EMPTY_POSMOD", "PARAM", "END_OF_METHOD", "OF",
-  "CMP_OP", "PARAM_REDUCT", "XOR", "OR", "AND", "NOT", "'+'", "'-'", "'*'",
+  "CMP_OP", "PARAM_REDUCT", "OR", "XOR", "AND", "NOT", "'+'", "'-'", "'*'",
   "'/'", "UNARY_NEG", "'^'", "NUM_REDUCT", "'='", "'('", "')'", "'~'",
   "'?'", "'['", "','", "']'", "'{'", "'}'", "$accept", "commands",
   "command", "cmd_plain", "selection", "integer_number", "real_number",
@@ -647,13 +590,13 @@ static const char *const yytname[] =
   "str_expr", "pos_expr", "method_params", "method_param_list",
   "method_param", "value_list", "value_list_contents", "basic_value_list",
   "basic_value_list_contents", "value_item", "basic_value_item",
-  "value_item_range", YY_NULL
+  "value_item_range", YY_NULLPTR
 };
 #endif
 
 # ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
-   token YYLEX-NUM.  */
+/* YYTOKNUM[NUM] -- (External) token number corresponding to the
+   (internal) symbol number NUM (which must be that of a token).  */
 static const yytype_uint16 yytoknum[] =
 {
        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
@@ -664,39 +607,41 @@ static const yytype_uint16 yytoknum[] =
 };
 # endif
 
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
-static const yytype_uint8 yyr1[] =
-{
-       0,    49,    50,    50,    51,    51,    52,    52,    52,    52,
-      52,    52,    52,    52,    53,    53,    53,    53,    54,    54,
-      55,    55,    56,    56,    57,    57,    58,    58,    58,    58,
-      58,    58,    58,    59,    59,    60,    60,    60,    58,    58,
-      58,    58,    58,    61,    61,    61,    61,    61,    61,    61,
-      61,    61,    61,    61,    61,    62,    62,    63,    63,    63,
-      63,    58,    61,    63,    64,    64,    65,    65,    66,    67,
-      67,    68,    68,    68,    69,    69,    70,    70,    70,    71,
-      71,    71,    71,    71,    72,    72,    72,    72,    73,    73,
-      73
-};
+#define YYPACT_NINF -85
 
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
-static const yytype_uint8 yyr2[] =
+#define yypact_value_is_default(Yystate) \
+  (!!((Yystate) == (-85)))
+
+#define YYTABLE_NINF -22
+
+#define yytable_value_is_error(Yytable_value) \
+  0
+
+  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+     STATE-NUM.  */
+static const yytype_int16 yypact[] =
 {
-       0,     2,     0,     2,     2,     2,     0,     1,     1,     1,
-       2,     3,     3,     3,     1,     1,     3,     3,     1,     2,
-       1,     2,     1,     1,     1,     1,     2,     3,     3,     3,
-       3,     2,     2,     1,     1,     1,     1,     1,     2,     3,
-       4,     3,     3,     1,     1,     2,     4,     3,     3,     3,
-       3,     3,     2,     3,     3,     1,     2,     7,     3,     2,
-       3,     1,     1,     1,     1,     2,     0,     2,     2,     1,
-       3,     0,     2,     3,     1,     3,     1,     2,     3,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     3,     3,
-       3
+     -85,    10,   -85,    -2,    26,   -85,   273,     0,    55,   -85,
+     -85,   -85,    40,   -85,   -85,   310,   204,   273,    69,   -85,
+      62,    82,   -85,    -3,   139,   312,   -85,   -85,   -85,    82,
+     296,   -85,   -85,   -85,   -85,   310,   -85,    96,   -85,   310,
+     -85,   204,    -6,    73,    15,    71,   220,    67,   -85,   -85,
+     135,   -85,   -85,    83,   -85,   -85,   310,   310,    41,   185,
+     -85,   -85,   -85,   204,   204,   204,   204,   204,   204,   296,
+      -3,   312,   -85,    -3,    97,   -85,   -85,    71,   319,    91,
+     -85,   -85,   -85,   -85,   -85,   -85,    69,   -85,   113,   -85,
+      24,   206,   137,   140,   -85,   -85,    90,   -85,   -85,   -85,
+     -85,   -85,    85,   -85,   -85,   -85,   330,   167,   167,    73,
+      73,    73,    67,   -85,   -85,   229,   107,    40,    24,   -85,
+     174,    69,    69,   206,   -85,   -85,   155,   153,   159,   326,
+     259,   137,   140,   -85,    -3,   179,   330,   -85,   -85,   -85,
+     -85,    69,   -85,   -85,   -85,   -85,   -85,   -85,   160,   164,
+     -85,   185,   119,   -85
 };
 
-/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
-   Performed when YYTABLE doesn't specify something else to do.  Zero
-   means the default is an error.  */
+  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
+     Performed when YYTABLE does not specify something else to do.  Zero
+     means the default is an error.  */
 static const yytype_uint8 yydefact[] =
 {
        2,     0,     1,     0,    43,    44,    24,    25,     0,    62,
@@ -717,7 +662,15 @@ static const yytype_uint8 yydefact[] =
       73,    56,     0,    57
 };
 
-/* YYDEFGOTO[NTERM-NUM].  */
+  /* YYPGOTO[NTERM-NUM].  */
+static const yytype_int8 yypgoto[] =
+{
+     -85,   -85,   -85,   -85,     7,   -17,   -15,   -84,    -1,   116,
+      19,   -85,    12,   -85,     3,    75,   -85,   -85,   -85,    63,
+     -53,    92,    52,   -65,   -63
+};
+
+  /* YYDEFGOTO[NTERM-NUM].  */
 static const yytype_int16 yydefgoto[] =
 {
       -1,     1,    19,    20,    21,    92,    93,    53,    94,   134,
@@ -725,69 +678,37 @@ static const yytype_int16 yydefgoto[] =
      103,    96,   139,    97,    98
 };
 
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
-   STATE-NUM.  */
-#define YYPACT_NINF -85
-static const yytype_int16 yypact[] =
-{
-     -85,    10,   -85,    -2,    17,   -85,   273,   -12,    55,   -85,
-     -85,   -85,     9,   -85,   -85,   310,   204,   273,    69,   -85,
-      31,    44,   -85,   110,   179,   312,   -85,   -85,   -85,    44,
-     296,   -85,   -85,   -85,   -85,   310,   -85,    96,   -85,   310,
-     -85,   204,    -6,    33,    15,   124,   220,    58,   -85,   -85,
-     139,   -85,   -85,    56,   -85,   -85,   310,   310,    41,   185,
-     -85,   -85,   -85,   204,   204,   204,   204,   204,   204,   296,
-     110,   312,   -85,   110,    61,   -85,   -85,   124,   319,    78,
-     -85,   -85,   -85,   -85,   -85,   -85,    69,   -85,    80,   -85,
-      24,   206,   102,   106,   -85,   -85,    90,   -85,   -85,   -85,
-     -85,   -85,    85,   -85,   -85,   -85,   330,   213,   213,    33,
-      33,    33,    58,   -85,   -85,   229,    83,     9,    24,   -85,
-     174,    69,    69,   206,   -85,   -85,   155,   137,   140,   326,
-     259,   102,   106,   -85,   110,   187,   330,   -85,   -85,   -85,
-     -85,    69,   -85,   -85,   -85,   -85,   -85,   -85,   142,   146,
-     -85,   185,   111,   -85
-};
-
-/* YYPGOTO[NTERM-NUM].  */
-static const yytype_int8 yypgoto[] =
-{
-     -85,   -85,   -85,   -85,     7,   -17,   -15,   -84,    -1,   116,
-      19,   -85,    12,   -85,     3,    75,   -85,   -85,   -85,    45,
-     -53,    72,    39,   -65,   -63
-};
-
-/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
-   positive, shift that token.  If negative, reduce the rule which
-   number is the opposite.  If YYTABLE_NINF, syntax error.  */
-#define YYTABLE_NINF -22
+  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
+     positive, shift that token.  If negative, reduce the rule whose
+     number is the opposite.  If YYTABLE_NINF, syntax error.  */
 static const yytype_int16 yytable[] =
 {
       22,    51,   116,    52,    26,    95,    27,    34,    79,    26,
        2,     3,    61,    29,     4,     5,     6,     7,    -6,     8,
-      47,     9,    10,    11,    44,    -7,    12,    30,    43,    46,
-      13,   124,    14,    72,    35,    42,    55,    11,   145,    54,
+      47,     9,    10,    11,    44,    56,    12,    57,    43,    46,
+      13,   124,    14,    72,    -7,    42,    55,    11,   145,    30,
      117,    15,    71,    16,    13,    48,    49,    32,    33,   125,
       17,    46,   140,    78,    18,   124,    80,   152,   146,    31,
-      42,    32,    33,   140,   118,    55,    90,   140,    18,    51,
-      68,    52,   112,    48,    49,   106,   107,   108,   109,   110,
+      42,    32,    33,   140,   118,    35,    90,   140,    18,    51,
+      54,    52,   112,    48,    49,   106,   107,   108,   109,   110,
      111,    46,    42,    42,    42,    42,    42,    42,    91,    48,
-      49,    32,    33,   119,    48,    49,    32,    33,   131,    83,
-     132,    86,    50,    90,   143,    51,   144,    52,   113,   131,
-      57,   132,   121,   131,   133,   132,   122,    23,    50,    74,
-      75,   112,    23,    50,    51,   133,    52,   136,   141,   133,
-      87,    40,    91,    45,   135,   123,   104,   105,   136,    56,
-      57,    43,   136,    84,    85,   135,    70,   -18,    42,   135,
-     -20,    73,   -19,    56,    57,    77,   -21,   153,   126,   127,
-     128,    32,    33,   120,     8,    81,     9,    10,    11,   150,
-       0,    12,    88,    89,     0,    13,     0,    14,    48,    49,
-      32,    33,     0,     0,     0,    77,    15,     0,   129,    48,
-      49,    32,    33,    58,    59,    69,    60,    61,    62,    18,
-     130,    58,   151,   147,    60,    61,    62,    50,    28,     5,
+      49,    32,    33,   119,    48,    49,    32,    33,   131,    56,
+     132,    57,    50,    55,   143,    51,   144,    52,    83,   131,
+      68,   132,    81,   131,   133,   132,    90,    23,    50,    74,
+      75,   112,    23,    50,    51,   133,    52,   136,    86,   133,
+      87,    40,    91,    45,   135,   123,   104,   105,   136,    84,
+      85,    43,   136,    57,   113,   135,    70,   121,    42,   135,
+     122,    73,   141,    58,    59,    77,    60,    61,    62,   127,
+     128,    32,    33,   -18,     8,   153,     9,    10,    11,   -20,
+     -19,    12,    88,    89,   -21,    13,   126,    14,    48,    49,
+      32,    33,   150,   120,     0,    77,    15,     0,   129,    48,
+      49,    32,    33,    58,   151,    69,    60,    61,    62,    18,
+     130,    66,    67,   147,    68,     0,     0,    50,    28,     5,
       48,    49,    32,    33,     0,     9,     0,     0,    50,   123,
       38,     0,   142,     0,    99,     0,    14,   100,   101,     0,
        0,     0,    91,   127,   128,    32,    33,    16,     8,    50,
-       9,    10,    11,     0,    41,    12,    63,    66,    67,    13,
-      68,    14,    64,    65,    66,    67,     0,    68,     0,     0,
+       9,    10,    11,     0,    41,    12,    63,     0,     0,    13,
+       0,    14,    64,    65,    66,    67,     0,    68,     0,     0,
       15,    82,   129,   127,   128,    32,    33,     0,     8,    69,
        9,    10,    11,    18,   130,    12,     0,    28,     5,    13,
        0,    14,     8,     0,     9,    10,    11,     0,     0,    12,
@@ -801,40 +722,34 @@ static const yytype_int16 yytable[] =
       82,     0,    64,    65,    66,    67,    41,    68
 };
 
-#define yypact_value_is_default(Yystate) \
-  (!!((Yystate) == (-85)))
-
-#define yytable_value_is_error(Yytable_value) \
-  YYID (0)
-
 static const yytype_int16 yycheck[] =
 {
        1,    18,    86,    18,     1,    58,     8,     8,    14,     6,
        0,     1,    18,     6,     4,     5,     6,     7,     8,     9,
-      17,    11,    12,    13,    17,     8,    16,    39,    16,    17,
-      20,    96,    22,    30,    25,    16,    21,    13,   122,     8,
+      17,    11,    12,    13,    17,    28,    16,    30,    16,    17,
+      20,    96,    22,    30,     8,    16,    21,    13,   122,    39,
       16,    31,    30,    33,    20,     4,     5,     6,     7,   102,
       40,    39,   115,    41,    44,   120,    41,   141,   123,     4,
-      41,     6,     7,   126,    40,    21,    25,   130,    44,    86,
-      37,    86,    69,     4,     5,    63,    64,    65,    66,    67,
+      41,     6,     7,   126,    40,    25,    25,   130,    44,    86,
+       8,    86,    69,     4,     5,    63,    64,    65,    66,    67,
       68,    69,    63,    64,    65,    66,    67,    68,    47,     4,
-       5,     6,     7,    90,     4,     5,     6,     7,   115,    41,
-     115,    45,    33,    25,   121,   122,   121,   122,    47,   126,
-      30,   126,    10,   130,   115,   130,    10,     1,    33,    23,
+       5,     6,     7,    90,     4,     5,     6,     7,   115,    28,
+     115,    30,    33,    21,   121,   122,   121,   122,    41,   126,
+      37,   126,    41,   130,   115,   130,    25,     1,    33,    23,
       24,   118,     6,    33,   141,   126,   141,   115,    45,   130,
-      55,    15,    47,    17,   115,    45,    61,    62,   126,    29,
-      30,   129,   130,     4,     5,   126,    30,    10,   129,   130,
-      10,    35,    10,    29,    30,    39,    10,    46,   113,     4,
-       5,     6,     7,    91,     9,    41,    11,    12,    13,   130,
-      -1,    16,    56,    57,    -1,    20,    -1,    22,     4,     5,
-       6,     7,    -1,    -1,    -1,    69,    31,    -1,    33,     4,
+      55,    15,    47,    17,   115,    45,    61,    62,   126,     4,
+       5,   129,   130,    30,    47,   126,    30,    10,   129,   130,
+      10,    35,    45,    14,    15,    39,    17,    18,    19,     4,
+       5,     6,     7,    10,     9,    46,    11,    12,    13,    10,
+      10,    16,    56,    57,    10,    20,   113,    22,     4,     5,
+       6,     7,   130,    91,    -1,    69,    31,    -1,    33,     4,
        5,     6,     7,    14,    15,    40,    17,    18,    19,    44,
-      45,    14,    15,    48,    17,    18,    19,    33,     4,     5,
+      45,    34,    35,    48,    37,    -1,    -1,    33,     4,     5,
        4,     5,     6,     7,    -1,    11,    -1,    -1,    33,    45,
       16,    -1,    48,    -1,    39,    -1,    22,    42,    43,    -1,
       -1,    -1,    47,     4,     5,     6,     7,    33,     9,    33,
-      11,    12,    13,    -1,    40,    16,    26,    34,    35,    20,
-      37,    22,    32,    33,    34,    35,    -1,    37,    -1,    -1,
+      11,    12,    13,    -1,    40,    16,    26,    -1,    -1,    20,
+      -1,    22,    32,    33,    34,    35,    -1,    37,    -1,    -1,
       31,    41,    33,     4,     5,     6,     7,    -1,     9,    40,
       11,    12,    13,    44,    45,    16,    -1,     4,     5,    20,
       -1,    22,     9,    -1,    11,    12,    13,    -1,    -1,    16,
@@ -848,8 +763,8 @@ static const yytype_int16 yycheck[] =
       41,    -1,    32,    33,    34,    35,    40,    37
 };
 
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
-   symbol of state STATE-NUM.  */
+  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+     symbol of state STATE-NUM.  */
 static const yytype_uint8 yystos[] =
 {
        0,    50,     0,     1,     4,     5,     6,     7,     9,    11,
@@ -857,7 +772,7 @@ static const yytype_uint8 yystos[] =
       52,    53,    57,    58,    59,    61,    63,     8,     4,    53,
       39,     4,     6,     7,    57,    25,    64,    65,    16,    40,
       58,    40,    59,    61,    53,    58,    61,    63,     4,     5,
-      33,    54,    55,    56,     8,    21,    29,    30,    14,    15,
+      33,    54,    55,    56,     8,    21,    28,    30,    14,    15,
       17,    18,    19,    26,    32,    33,    34,    35,    37,    40,
       58,    61,    63,    58,    23,    24,    66,    58,    61,    14,
       41,    41,    41,    41,     4,     5,    45,    64,    58,    58,
@@ -870,30 +785,46 @@ static const yytype_uint8 yystos[] =
       71,    15,    56,    46
 };
 
-#define yyerrok                (yyerrstatus = 0)
-#define yyclearin      (yychar = YYEMPTY)
-#define YYEMPTY                (-2)
-#define YYEOF          0
-
-#define YYACCEPT       goto yyacceptlab
-#define YYABORT                goto yyabortlab
-#define YYERROR                goto yyerrorlab
-
-
-/* Like YYERROR except do call yyerror.  This remains here temporarily
-   to ease the transition to the new meaning of YYERROR, for GCC.
-   Once GCC version 2 has supplanted version 1, this can go.  However,
-   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
-   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
-   discussed.  */
-
-#define YYFAIL         goto yyerrlab
-#if defined YYFAIL
-  /* This is here to suppress warnings from the GCC cpp's
-     -Wunused-macros.  Normally we don't worry about that warning, but
-     some users do, and we want to make it easy for users to remove
-     YYFAIL uses, which will produce warnings from Bison 2.5.  */
-#endif
+  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+static const yytype_uint8 yyr1[] =
+{
+       0,    49,    50,    50,    51,    51,    52,    52,    52,    52,
+      52,    52,    52,    52,    53,    53,    53,    53,    54,    54,
+      55,    55,    56,    56,    57,    57,    58,    58,    58,    58,
+      58,    58,    58,    59,    59,    60,    60,    60,    58,    58,
+      58,    58,    58,    61,    61,    61,    61,    61,    61,    61,
+      61,    61,    61,    61,    61,    62,    62,    63,    63,    63,
+      63,    58,    61,    63,    64,    64,    65,    65,    66,    67,
+      67,    68,    68,    68,    69,    69,    70,    70,    70,    71,
+      71,    71,    71,    71,    72,    72,    72,    72,    73,    73,
+      73
+};
+
+  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
+static const yytype_uint8 yyr2[] =
+{
+       0,     2,     0,     2,     2,     2,     0,     1,     1,     1,
+       2,     3,     3,     3,     1,     1,     3,     3,     1,     2,
+       1,     2,     1,     1,     1,     1,     2,     3,     3,     3,
+       3,     2,     2,     1,     1,     1,     1,     1,     2,     3,
+       4,     3,     3,     1,     1,     2,     4,     3,     3,     3,
+       3,     3,     2,     3,     3,     1,     2,     7,     3,     2,
+       3,     1,     1,     1,     1,     2,     0,     2,     2,     1,
+       3,     0,     2,     3,     1,     3,     1,     2,     3,     1,
+       1,     1,     1,     1,     1,     1,     1,     1,     3,     3,
+       3
+};
+
+
+#define yyerrok         (yyerrstatus = 0)
+#define yyclearin       (yychar = YYEMPTY)
+#define YYEMPTY         (-2)
+#define YYEOF           0
+
+#define YYACCEPT        goto yyacceptlab
+#define YYABORT         goto yyabortlab
+#define YYERROR         goto yyerrorlab
+
 
 #define YYRECOVERING()  (!!yyerrstatus)
 
@@ -910,13 +841,13 @@ do                                                              \
   else                                                          \
     {                                                           \
       yyerror (&yylloc, scanner, YY_("syntax error: cannot back up")); \
-      YYERROR;                                                 \
-    }                                                          \
-while (YYID (0))
+      YYERROR;                                                  \
+    }                                                           \
+while (0)
 
 /* Error token number */
-#define YYTERROR       1
-#define YYERRCODE      256
+#define YYTERROR        1
+#define YYERRCODE       256
 
 
 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
@@ -926,7 +857,7 @@ while (YYID (0))
 #ifndef YYLLOC_DEFAULT
 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
     do                                                                  \
-      if (YYID (N))                                                     \
+      if (N)                                                            \
         {                                                               \
           (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
           (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
@@ -940,12 +871,27 @@ while (YYID (0))
           (Current).first_column = (Current).last_column =              \
             YYRHSLOC (Rhs, 0).last_column;                              \
         }                                                               \
-    while (YYID (0))
+    while (0)
 #endif
 
 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
 
 
+/* Enable debugging if requested.  */
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args)                        \
+do {                                            \
+  if (yydebug)                                  \
+    YYFPRINTF Args;                             \
+} while (0)
+
+
 /* YY_LOCATION_PRINT -- Print the location on the stream.
    This macro was not mandated originally: define only if we know
    we won't break user code: when these are the locations we know.  */
@@ -955,36 +901,28 @@ while (YYID (0))
 
 /* Print *YYLOCP on YYO.  Private, do not rely on its existence. */
 
-__attribute__((__unused__))
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
+YY_ATTRIBUTE_UNUSED
 static unsigned
 yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
-#else
-static unsigned
-yy_location_print_ (yyo, yylocp)
-    FILE *yyo;
-    YYLTYPE const * const yylocp;
-#endif
 {
   unsigned res = 0;
   int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
   if (0 <= yylocp->first_line)
     {
-      res += fprintf (yyo, "%d", yylocp->first_line);
+      res += YYFPRINTF (yyo, "%d", yylocp->first_line);
       if (0 <= yylocp->first_column)
-        res += fprintf (yyo, ".%d", yylocp->first_column);
+        res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
     }
   if (0 <= yylocp->last_line)
     {
       if (yylocp->first_line < yylocp->last_line)
         {
-          res += fprintf (yyo, "-%d", yylocp->last_line);
+          res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
           if (0 <= end_col)
-            res += fprintf (yyo, ".%d", end_col);
+            res += YYFPRINTF (yyo, ".%d", end_col);
         }
       else if (0 <= end_col && yylocp->first_column < end_col)
-        res += fprintf (yyo, "-%d", end_col);
+        res += YYFPRINTF (yyo, "-%d", end_col);
     }
   return res;
  }
@@ -998,69 +936,34 @@ yy_location_print_ (yyo, yylocp)
 #endif
 
 
-/* YYLEX -- calling `yylex' with the right arguments.  */
-#ifdef YYLEX_PARAM
-# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
-#else
-# define YYLEX yylex (&yylval, &yylloc)
-#endif
-
-/* Enable debugging if requested.  */
-#if YYDEBUG
-
-# ifndef YYFPRINTF
-#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-#  define YYFPRINTF fprintf
-# endif
-
-# define YYDPRINTF(Args)                       \
-do {                                           \
-  if (yydebug)                                 \
-    YYFPRINTF Args;                            \
-} while (YYID (0))
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
+do {                                                                      \
+  if (yydebug)                                                            \
+    {                                                                     \
+      YYFPRINTF (stderr, "%s ", Title);                                   \
+      yy_symbol_print (stderr,                                            \
+                  Type, Value, Location, scanner); \
+      YYFPRINTF (stderr, "\n");                                           \
+    }                                                                     \
+} while (0)
 
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                   \
-do {                                                                     \
-  if (yydebug)                                                           \
-    {                                                                    \
-      YYFPRINTF (stderr, "%s ", Title);                                          \
-      yy_symbol_print (stderr,                                           \
-                 Type, Value, Location, scanner); \
-      YYFPRINTF (stderr, "\n");                                                  \
-    }                                                                    \
-} while (YYID (0))
 
+/*----------------------------------------.
+| Print this symbol's value on YYOUTPUT.  |
+`----------------------------------------*/
 
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
-
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static void
 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner)
-#else
-static void
-yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, scanner)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE const * const yyvaluep;
-    YYLTYPE const * const yylocationp;
-    void *scanner;
-#endif
 {
   FILE *yyo gmx_unused = yyoutput;
   YYUSE (yyo);
-  if (!yyvaluep)
-    return;
   YYUSE (yylocationp);
   YYUSE (scanner);
+  if (!yyvaluep)
+    return;
 # ifdef YYPRINT
   if (yytype < YYNTOKENS)
     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# else
-  YYUSE (yyoutput);
 # endif
   YYUSE (yytype);
 }
@@ -1070,24 +973,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, scanner)
 | Print this symbol on YYOUTPUT.  |
 `--------------------------------*/
 
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static void
 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner)
-#else
-static void
-yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, scanner)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE const * const yyvaluep;
-    YYLTYPE const * const yylocationp;
-    void *scanner;
-#endif
 {
-  if (yytype < YYNTOKENS)
-    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
-  else
-    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+  YYFPRINTF (yyoutput, "%s %s (",
+             yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
 
   YY_LOCATION_PRINT (yyoutput, *yylocationp);
   YYFPRINTF (yyoutput, ": ");
@@ -1100,16 +990,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, scanner)
 | TOP (included).                                                   |
 `------------------------------------------------------------------*/
 
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static void
 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
-#else
-static void
-yy_stack_print (yybottom, yytop)
-    yytype_int16 *yybottom;
-    yytype_int16 *yytop;
-#endif
 {
   YYFPRINTF (stderr, "Stack now");
   for (; yybottom <= yytop; yybottom++)
@@ -1120,51 +1002,42 @@ yy_stack_print (yybottom, yytop)
   YYFPRINTF (stderr, "\n");
 }
 
-# define YY_STACK_PRINT(Bottom, Top)                           \
-do {                                                           \
-  if (yydebug)                                                 \
-    yy_stack_print ((Bottom), (Top));                          \
-} while (YYID (0))
+# define YY_STACK_PRINT(Bottom, Top)                            \
+do {                                                            \
+  if (yydebug)                                                  \
+    yy_stack_print ((Bottom), (Top));                           \
+} while (0)
 
 
 /*------------------------------------------------.
 | Report that the YYRULE is going to be reduced.  |
 `------------------------------------------------*/
 
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static void
-yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, void *scanner)
-#else
 static void
-yy_reduce_print (yyvsp, yylsp, yyrule, scanner)
-    YYSTYPE *yyvsp;
-    YYLTYPE *yylsp;
-    int yyrule;
-    void *scanner;
-#endif
+yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, void *scanner)
 {
+  unsigned long int yylno = yyrline[yyrule];
   int yynrhs = yyr2[yyrule];
   int yyi;
-  unsigned long int yylno = yyrline[yyrule];
   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
-            yyrule - 1, yylno);
+             yyrule - 1, yylno);
   /* The symbols being reduced.  */
   for (yyi = 0; yyi < yynrhs; yyi++)
     {
       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
-      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
-                      &(yyvsp[(yyi + 1) - (yynrhs)])
-                      , &(yylsp[(yyi + 1) - (yynrhs)])                , scanner);
+      yy_symbol_print (stderr,
+                       yystos[yyssp[yyi + 1 - yynrhs]],
+                       &(yyvsp[(yyi + 1) - (yynrhs)])
+                       , &(yylsp[(yyi + 1) - (yynrhs)])                       , scanner);
       YYFPRINTF (stderr, "\n");
     }
 }
 
-# define YY_REDUCE_PRINT(Rule)         \
-do {                                   \
-  if (yydebug)                         \
-    yy_reduce_print (yyvsp, yylsp, Rule, scanner); \
-} while (YYID (0))
+# define YY_REDUCE_PRINT(Rule)          \
+do {                                    \
+  if (yydebug)                          \
+    yy_reduce_print (yyssp, yyvsp, yylsp, Rule, scanner); \
+} while (0)
 
 /* Nonzero means print parse trace.  It is left uninitialized so that
    multiple parsers can coexist.  */
@@ -1178,7 +1051,7 @@ int yydebug;
 
 
 /* YYINITDEPTH -- initial size of the parser's stacks.  */
-#ifndef        YYINITDEPTH
+#ifndef YYINITDEPTH
 # define YYINITDEPTH 200
 #endif
 
@@ -1201,15 +1074,8 @@ int yydebug;
 #   define yystrlen strlen
 #  else
 /* Return the length of YYSTR.  */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static YYSIZE_T
 yystrlen (const char *yystr)
-#else
-static YYSIZE_T
-yystrlen (yystr)
-    const char *yystr;
-#endif
 {
   YYSIZE_T yylen;
   for (yylen = 0; yystr[yylen]; yylen++)
@@ -1225,16 +1091,8 @@ yystrlen (yystr)
 #  else
 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
    YYDEST.  */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static char *
 yystpcpy (char *yydest, const char *yysrc)
-#else
-static char *
-yystpcpy (yydest, yysrc)
-    char *yydest;
-    const char *yysrc;
-#endif
 {
   char *yyd = yydest;
   const char *yys = yysrc;
@@ -1264,27 +1122,27 @@ yytnamerr (char *yyres, const char *yystr)
       char const *yyp = yystr;
 
       for (;;)
-       switch (*++yyp)
-         {
-         case '\'':
-         case ',':
-           goto do_not_strip_quotes;
-
-         case '\\':
-           if (*++yyp != '\\')
-             goto do_not_strip_quotes;
-           /* Fall through.  */
-         default:
-           if (yyres)
-             yyres[yyn] = *yyp;
-           yyn++;
-           break;
-
-         case '"':
-           if (yyres)
-             yyres[yyn] = '\0';
-           return yyn;
-         }
+        switch (*++yyp)
+          {
+          case '\'':
+          case ',':
+            goto do_not_strip_quotes;
+
+          case '\\':
+            if (*++yyp != '\\')
+              goto do_not_strip_quotes;
+            /* Fall through.  */
+          default:
+            if (yyres)
+              yyres[yyn] = *yyp;
+            yyn++;
+            break;
+
+          case '"':
+            if (yyres)
+              yyres[yyn] = '\0';
+            return yyn;
+          }
     do_not_strip_quotes: ;
     }
 
@@ -1307,11 +1165,11 @@ static int
 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
                 yytype_int16 *yyssp, int yytoken)
 {
-  YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
+  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
   YYSIZE_T yysize = yysize0;
   enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
   /* Internationalized format string. */
-  const char *yyformat = YY_NULL;
+  const char *yyformat = YY_NULLPTR;
   /* Arguments of yyformat. */
   char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
   /* Number of reported tokens (one for the "unexpected", one per
@@ -1319,10 +1177,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
   int yycount = 0;
 
   /* There are many possibilities here to consider:
-     - Assume YYFAIL is not used.  It's too flawed to consider.  See
-       <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
-       for details.  YYERROR is fine as it does not invoke this
-       function.
      - If this state is a consistent state with a default action, then
        the only way this function was invoked is if the default action
        is an error action.  In that case, don't check for expected
@@ -1372,7 +1226,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
                   }
                 yyarg[yycount++] = yytname[yyx];
                 {
-                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
+                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
                   if (! (yysize <= yysize1
                          && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
                     return 2;
@@ -1439,210 +1293,174 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
 | Release the memory associated to this symbol.  |
 `-----------------------------------------------*/
 
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static void
 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, void *scanner)
-#else
-static void
-yydestruct (yymsg, yytype, yyvaluep, yylocationp, scanner)
-    const char *yymsg;
-    int yytype;
-    YYSTYPE *yyvaluep;
-    YYLTYPE *yylocationp;
-    void *scanner;
-#endif
 {
   YYUSE (yyvaluep);
   YYUSE (yylocationp);
   YYUSE (scanner);
-
   if (!yymsg)
     yymsg = "Deleting";
   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
 
+  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
   switch (yytype)
     {
-      case 6: /* STR */
-/* Line 1393 of yacc.c  */
-#line 178 "parser.y"
-        { free(((*yyvaluep).str));        };
-/* Line 1393 of yacc.c  */
-#line 1473 "parser.cpp"
+          case 6: /* STR  */
+#line 178 "parser.y" /* yacc.c:1257  */
+      { free(((*yyvaluep).str));        }
+#line 1313 "parser.cpp" /* yacc.c:1257  */
         break;
-      case 7: /* IDENTIFIER */
-/* Line 1393 of yacc.c  */
-#line 178 "parser.y"
-        { free(((*yyvaluep).str));        };
-/* Line 1393 of yacc.c  */
-#line 1480 "parser.cpp"
+
+    case 7: /* IDENTIFIER  */
+#line 178 "parser.y" /* yacc.c:1257  */
+      { free(((*yyvaluep).str));        }
+#line 1319 "parser.cpp" /* yacc.c:1257  */
         break;
-      case 16: /* KEYWORD_POS */
-/* Line 1393 of yacc.c  */
-#line 178 "parser.y"
-        { free(((*yyvaluep).str));        };
-/* Line 1393 of yacc.c  */
-#line 1487 "parser.cpp"
+
+    case 16: /* KEYWORD_POS  */
+#line 178 "parser.y" /* yacc.c:1257  */
+      { free(((*yyvaluep).str));        }
+#line 1325 "parser.cpp" /* yacc.c:1257  */
         break;
-      case 23: /* PARAM */
-/* Line 1393 of yacc.c  */
-#line 179 "parser.y"
-        { if(((*yyvaluep).str)) free(((*yyvaluep).str)); };
-/* Line 1393 of yacc.c  */
-#line 1494 "parser.cpp"
+
+    case 23: /* PARAM  */
+#line 179 "parser.y" /* yacc.c:1257  */
+      { if(((*yyvaluep).str)) free(((*yyvaluep).str)); }
+#line 1331 "parser.cpp" /* yacc.c:1257  */
         break;
-      case 26: /* CMP_OP */
-/* Line 1393 of yacc.c  */
-#line 178 "parser.y"
-        { free(((*yyvaluep).str));        };
-/* Line 1393 of yacc.c  */
-#line 1501 "parser.cpp"
+
+    case 26: /* CMP_OP  */
+#line 178 "parser.y" /* yacc.c:1257  */
+      { free(((*yyvaluep).str));        }
+#line 1337 "parser.cpp" /* yacc.c:1257  */
         break;
-      case 50: /* commands */
-/* Line 1393 of yacc.c  */
-#line 180 "parser.y"
-        { delete ((*yyvaluep).sel);       };
-/* Line 1393 of yacc.c  */
-#line 1508 "parser.cpp"
+
+    case 50: /* commands  */
+#line 180 "parser.y" /* yacc.c:1257  */
+      { delete ((*yyvaluep).sel);       }
+#line 1343 "parser.cpp" /* yacc.c:1257  */
         break;
-      case 51: /* command */
-/* Line 1393 of yacc.c  */
-#line 180 "parser.y"
-        { delete ((*yyvaluep).sel);       };
-/* Line 1393 of yacc.c  */
-#line 1515 "parser.cpp"
+
+    case 51: /* command  */
+#line 180 "parser.y" /* yacc.c:1257  */
+      { delete ((*yyvaluep).sel);       }
+#line 1349 "parser.cpp" /* yacc.c:1257  */
         break;
-      case 52: /* cmd_plain */
-/* Line 1393 of yacc.c  */
-#line 180 "parser.y"
-        { delete ((*yyvaluep).sel);       };
-/* Line 1393 of yacc.c  */
-#line 1522 "parser.cpp"
+
+    case 52: /* cmd_plain  */
+#line 180 "parser.y" /* yacc.c:1257  */
+      { delete ((*yyvaluep).sel);       }
+#line 1355 "parser.cpp" /* yacc.c:1257  */
         break;
-      case 53: /* selection */
-/* Line 1393 of yacc.c  */
-#line 180 "parser.y"
-        { delete ((*yyvaluep).sel);       };
-/* Line 1393 of yacc.c  */
-#line 1529 "parser.cpp"
+
+    case 53: /* selection  */
+#line 180 "parser.y" /* yacc.c:1257  */
+      { delete ((*yyvaluep).sel);       }
+#line 1361 "parser.cpp" /* yacc.c:1257  */
         break;
-      case 57: /* string */
-/* Line 1393 of yacc.c  */
-#line 178 "parser.y"
-        { free(((*yyvaluep).str));        };
-/* Line 1393 of yacc.c  */
-#line 1536 "parser.cpp"
+
+    case 57: /* string  */
+#line 178 "parser.y" /* yacc.c:1257  */
+      { free(((*yyvaluep).str));        }
+#line 1367 "parser.cpp" /* yacc.c:1257  */
         break;
-      case 58: /* sel_expr */
-/* Line 1393 of yacc.c  */
-#line 181 "parser.y"
-        { delete ((*yyvaluep).sel);       };
-/* Line 1393 of yacc.c  */
-#line 1543 "parser.cpp"
+
+    case 58: /* sel_expr  */
+#line 181 "parser.y" /* yacc.c:1257  */
+      { delete ((*yyvaluep).sel);       }
+#line 1373 "parser.cpp" /* yacc.c:1257  */
         break;
-      case 59: /* pos_mod */
-/* Line 1393 of yacc.c  */
-#line 179 "parser.y"
-        { if(((*yyvaluep).str)) free(((*yyvaluep).str)); };
-/* Line 1393 of yacc.c  */
-#line 1550 "parser.cpp"
+
+    case 59: /* pos_mod  */
+#line 179 "parser.y" /* yacc.c:1257  */
+      { if(((*yyvaluep).str)) free(((*yyvaluep).str)); }
+#line 1379 "parser.cpp" /* yacc.c:1257  */
         break;
-      case 61: /* num_expr */
-/* Line 1393 of yacc.c  */
-#line 181 "parser.y"
-        { delete ((*yyvaluep).sel);       };
-/* Line 1393 of yacc.c  */
-#line 1557 "parser.cpp"
+
+    case 61: /* num_expr  */
+#line 181 "parser.y" /* yacc.c:1257  */
+      { delete ((*yyvaluep).sel);       }
+#line 1385 "parser.cpp" /* yacc.c:1257  */
         break;
-      case 62: /* str_expr */
-/* Line 1393 of yacc.c  */
-#line 181 "parser.y"
-        { delete ((*yyvaluep).sel);       };
-/* Line 1393 of yacc.c  */
-#line 1564 "parser.cpp"
+
+    case 62: /* str_expr  */
+#line 181 "parser.y" /* yacc.c:1257  */
+      { delete ((*yyvaluep).sel);       }
+#line 1391 "parser.cpp" /* yacc.c:1257  */
         break;
-      case 63: /* pos_expr */
-/* Line 1393 of yacc.c  */
-#line 181 "parser.y"
-        { delete ((*yyvaluep).sel);       };
-/* Line 1393 of yacc.c  */
-#line 1571 "parser.cpp"
+
+    case 63: /* pos_expr  */
+#line 181 "parser.y" /* yacc.c:1257  */
+      { delete ((*yyvaluep).sel);       }
+#line 1397 "parser.cpp" /* yacc.c:1257  */
         break;
-      case 64: /* method_params */
-/* Line 1393 of yacc.c  */
-#line 182 "parser.y"
-        { delete ((*yyvaluep).plist);       };
-/* Line 1393 of yacc.c  */
-#line 1578 "parser.cpp"
+
+    case 64: /* method_params  */
+#line 182 "parser.y" /* yacc.c:1257  */
+      { delete ((*yyvaluep).plist);       }
+#line 1403 "parser.cpp" /* yacc.c:1257  */
         break;
-      case 65: /* method_param_list */
-/* Line 1393 of yacc.c  */
-#line 182 "parser.y"
-        { delete ((*yyvaluep).plist);       };
-/* Line 1393 of yacc.c  */
-#line 1585 "parser.cpp"
+
+    case 65: /* method_param_list  */
+#line 182 "parser.y" /* yacc.c:1257  */
+      { delete ((*yyvaluep).plist);       }
+#line 1409 "parser.cpp" /* yacc.c:1257  */
         break;
-      case 66: /* method_param */
-/* Line 1393 of yacc.c  */
-#line 182 "parser.y"
-        { delete ((*yyvaluep).param);       };
-/* Line 1393 of yacc.c  */
-#line 1592 "parser.cpp"
+
+    case 66: /* method_param  */
+#line 182 "parser.y" /* yacc.c:1257  */
+      { delete ((*yyvaluep).param);       }
+#line 1415 "parser.cpp" /* yacc.c:1257  */
         break;
-      case 67: /* value_list */
-/* Line 1393 of yacc.c  */
-#line 183 "parser.y"
-        { delete ((*yyvaluep).vlist);       };
-/* Line 1393 of yacc.c  */
-#line 1599 "parser.cpp"
+
+    case 67: /* value_list  */
+#line 183 "parser.y" /* yacc.c:1257  */
+      { delete ((*yyvaluep).vlist);       }
+#line 1421 "parser.cpp" /* yacc.c:1257  */
         break;
-      case 68: /* value_list_contents */
-/* Line 1393 of yacc.c  */
-#line 183 "parser.y"
-        { delete ((*yyvaluep).vlist);       };
-/* Line 1393 of yacc.c  */
-#line 1606 "parser.cpp"
+
+    case 68: /* value_list_contents  */
+#line 183 "parser.y" /* yacc.c:1257  */
+      { delete ((*yyvaluep).vlist);       }
+#line 1427 "parser.cpp" /* yacc.c:1257  */
         break;
-      case 69: /* basic_value_list */
-/* Line 1393 of yacc.c  */
-#line 183 "parser.y"
-        { delete ((*yyvaluep).vlist);       };
-/* Line 1393 of yacc.c  */
-#line 1613 "parser.cpp"
+
+    case 69: /* basic_value_list  */
+#line 183 "parser.y" /* yacc.c:1257  */
+      { delete ((*yyvaluep).vlist);       }
+#line 1433 "parser.cpp" /* yacc.c:1257  */
         break;
-      case 70: /* basic_value_list_contents */
-/* Line 1393 of yacc.c  */
-#line 183 "parser.y"
-        { delete ((*yyvaluep).vlist);       };
-/* Line 1393 of yacc.c  */
-#line 1620 "parser.cpp"
+
+    case 70: /* basic_value_list_contents  */
+#line 183 "parser.y" /* yacc.c:1257  */
+      { delete ((*yyvaluep).vlist);       }
+#line 1439 "parser.cpp" /* yacc.c:1257  */
         break;
-      case 71: /* value_item */
-/* Line 1393 of yacc.c  */
-#line 184 "parser.y"
-        { delete ((*yyvaluep).val);       };
-/* Line 1393 of yacc.c  */
-#line 1627 "parser.cpp"
+
+    case 71: /* value_item  */
+#line 184 "parser.y" /* yacc.c:1257  */
+      { delete ((*yyvaluep).val);       }
+#line 1445 "parser.cpp" /* yacc.c:1257  */
         break;
-      case 72: /* basic_value_item */
-/* Line 1393 of yacc.c  */
-#line 184 "parser.y"
-        { delete ((*yyvaluep).val);       };
-/* Line 1393 of yacc.c  */
-#line 1634 "parser.cpp"
+
+    case 72: /* basic_value_item  */
+#line 184 "parser.y" /* yacc.c:1257  */
+      { delete ((*yyvaluep).val);       }
+#line 1451 "parser.cpp" /* yacc.c:1257  */
         break;
-      case 73: /* value_item_range */
-/* Line 1393 of yacc.c  */
-#line 184 "parser.y"
-        { delete ((*yyvaluep).val);       };
-/* Line 1393 of yacc.c  */
-#line 1641 "parser.cpp"
+
+    case 73: /* value_item_range  */
+#line 184 "parser.y" /* yacc.c:1257  */
+      { delete ((*yyvaluep).val);       }
+#line 1457 "parser.cpp" /* yacc.c:1257  */
         break;
 
+
       default:
         break;
     }
+  YY_IGNORE_MAYBE_UNINITIALIZED_END
 }
 
 
@@ -1657,9 +1475,9 @@ struct yypstate
     int yyerrstatus;
 
     /* The stacks and their tools:
-       `yyss': related to states.
-       `yyvs': related to semantic values.
-       `yyls': related to locations.
+       'yyss': related to states.
+       'yyvs': related to semantic values.
+       'yyls': related to locations.
 
        Refer to the stacks through separate pointers, to allow yyoverflow
        to reallocate them elsewhere.  */
@@ -1689,33 +1507,19 @@ struct yypstate
   };
 
 /* Initialize the parser data structure.  */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 yypstate *
 yypstate_new (void)
-#else
-yypstate *
-yypstate_new ()
-
-#endif
 {
   yypstate *yyps;
   yyps = (yypstate *) malloc (sizeof *yyps);
   if (!yyps)
-    return YY_NULL;
+    return YY_NULLPTR;
   yyps->yynew = 1;
   return yyps;
 }
 
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 void
 yypstate_delete (yypstate *yyps)
-#else
-void
-yypstate_delete (yyps)
-    yypstate *yyps;
-#endif
 {
 #ifndef yyoverflow
   /* If the stack was reallocated but the parse did not complete, then the
@@ -1746,58 +1550,27 @@ yypstate_delete (yyps)
 | yypush_parse.  |
 `---------------*/
 
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 int
 yypush_parse (yypstate *yyps, int yypushed_char, YYSTYPE const *yypushed_val, YYLTYPE *yypushed_loc, void *scanner)
-#else
-int
-yypush_parse (yyps, yypushed_char, yypushed_val, yypushed_loc, scanner)
-    yypstate *yyps;
-    int yypushed_char;
-    YYSTYPE const *yypushed_val;
-    YYLTYPE *yypushed_loc;
-    void *scanner;
-#endif
 {
 /* The lookahead symbol.  */
 int yychar;
 
 
-#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
-/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
-    _Pragma ("GCC diagnostic push") \
-    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
-    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
-    _Pragma ("GCC diagnostic pop")
-#else
+/* The semantic value of the lookahead symbol.  */
 /* Default value used for initialization, for pacifying older GCCs
    or non-GCC compilers.  */
-static YYSTYPE yyval_default;
-# define YY_INITIAL_VALUE(Value) = Value
-#endif
+YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
+YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
+
+/* Location data for the lookahead symbol.  */
 static YYLTYPE yyloc_default
 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
   = { 1, 1, 1, 1 }
 # endif
 ;
-#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END
-#endif
-#ifndef YY_INITIAL_VALUE
-# define YY_INITIAL_VALUE(Value) /* Nothing. */
-#endif
-
-/* The semantic value of the lookahead symbol.  */
-YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
-
-/* Location data for the lookahead symbol.  */
 YYLTYPE yylloc = yyloc_default;
 
-
   int yyn;
   int yyresult;
   /* Lookahead token as an internal (translated) token number.  */
@@ -1858,26 +1631,26 @@ YYLTYPE yylloc = yyloc_default;
 
 #ifdef yyoverflow
       {
-       /* Give user a chance to reallocate the stack.  Use copies of
-          these so that the &'s don't force the real ones into
-          memory.  */
-       YYSTYPE *yyvs1 = yyvs;
-       yytype_int16 *yyss1 = yyss;
-       YYLTYPE *yyls1 = yyls;
-
-       /* Each stack pointer address is followed by the size of the
-          data in use in that stack, in bytes.  This used to be a
-          conditional around just the two extra args, but that might
-          be undefined if yyoverflow is a macro.  */
-       yyoverflow (YY_("memory exhausted"),
-                   &yyss1, yysize * sizeof (*yyssp),
-                   &yyvs1, yysize * sizeof (*yyvsp),
-                   &yyls1, yysize * sizeof (*yylsp),
-                   &yystacksize);
-
-       yyls = yyls1;
-       yyss = yyss1;
-       yyvs = yyvs1;
+        /* Give user a chance to reallocate the stack.  Use copies of
+           these so that the &'s don't force the real ones into
+           memory.  */
+        YYSTYPE *yyvs1 = yyvs;
+        yytype_int16 *yyss1 = yyss;
+        YYLTYPE *yyls1 = yyls;
+
+        /* Each stack pointer address is followed by the size of the
+           data in use in that stack, in bytes.  This used to be a
+           conditional around just the two extra args, but that might
+           be undefined if yyoverflow is a macro.  */
+        yyoverflow (YY_("memory exhausted"),
+                    &yyss1, yysize * sizeof (*yyssp),
+                    &yyvs1, yysize * sizeof (*yyvsp),
+                    &yyls1, yysize * sizeof (*yylsp),
+                    &yystacksize);
+
+        yyls = yyls1;
+        yyss = yyss1;
+        yyvs = yyvs1;
       }
 #else /* no yyoverflow */
 # ifndef YYSTACK_RELOCATE
@@ -1885,23 +1658,23 @@ YYLTYPE yylloc = yyloc_default;
 # else
       /* Extend the stack our own way.  */
       if (YYMAXDEPTH <= yystacksize)
-       goto yyexhaustedlab;
+        goto yyexhaustedlab;
       yystacksize *= 2;
       if (YYMAXDEPTH < yystacksize)
-       yystacksize = YYMAXDEPTH;
+        yystacksize = YYMAXDEPTH;
 
       {
-       yytype_int16 *yyss1 = yyss;
-       union yyalloc *yyptr =
-         (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
-       if (! yyptr)
-         goto yyexhaustedlab;
-       YYSTACK_RELOCATE (yyss_alloc, yyss);
-       YYSTACK_RELOCATE (yyvs_alloc, yyvs);
-       YYSTACK_RELOCATE (yyls_alloc, yyls);
+        yytype_int16 *yyss1 = yyss;
+        union yyalloc *yyptr =
+          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+        if (! yyptr)
+          goto yyexhaustedlab;
+        YYSTACK_RELOCATE (yyss_alloc, yyss);
+        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
+        YYSTACK_RELOCATE (yyls_alloc, yyls);
 #  undef YYSTACK_RELOCATE
-       if (yyss1 != yyssa)
-         YYSTACK_FREE (yyss1);
+        if (yyss1 != yyssa)
+          YYSTACK_FREE (yyss1);
       }
 # endif
 #endif /* no yyoverflow */
@@ -1911,10 +1684,10 @@ YYLTYPE yylloc = yyloc_default;
       yylsp = yyls + yysize - 1;
 
       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
-                 (unsigned long int) yystacksize));
+                  (unsigned long int) yystacksize));
 
       if (yyss + yystacksize - 1 <= yyssp)
-       YYABORT;
+        YYABORT;
     }
 
   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
@@ -2020,7 +1793,7 @@ yyreduce:
   yylen = yyr2[yyn];
 
   /* If YYLEN is nonzero, implement the default value of the action:
-     `$$ = $1'.
+     '$$ = $1'.
 
      Otherwise, the following line sets YYVAL to garbage.
      This behavior is undocumented and Bison
@@ -2035,36 +1808,37 @@ yyreduce:
   switch (yyn)
     {
         case 2:
-/* Line 1787 of yacc.c  */
-#line 199 "parser.y"
+#line 199 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
                  set_empty((yyval.sel));
                  END_ACTION_TOPLEVEL;
              }
+#line 1818 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 3:
-/* Line 1787 of yacc.c  */
-#line 205 "parser.y"
+#line 205 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.sel), _gmx_sel_append_selection(get((yyvsp[(2) - (2)].sel)), get((yyvsp[(1) - (2)].sel)), scanner));
-                 if (_gmx_sel_parser_should_finish(scanner))
+                 set((yyval.sel), _gmx_sel_append_selection(get((yyvsp[0].sel)), get((yyvsp[-1].sel)), scanner));
+                 if (_gmx_sel_parser_should_finish(scanner)) {
+                     delete (yyval.sel);
                      YYACCEPT;
+                 }
                  END_ACTION_TOPLEVEL;
              }
+#line 1832 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 4:
-/* Line 1787 of yacc.c  */
-#line 215 "parser.y"
-    { (yyval.sel) = (yyvsp[(1) - (2)].sel); }
+#line 217 "parser.y" /* yacc.c:1646  */
+    { (yyval.sel) = (yyvsp[-1].sel); }
+#line 1838 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 5:
-/* Line 1787 of yacc.c  */
-#line 217 "parser.y"
+#line 219 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
                  _gmx_sel_lexer_clear_method_stack(scanner);
@@ -2080,191 +1854,191 @@ yyreduce:
                  set_empty((yyval.sel));
                  END_ACTION_TOPLEVEL;
              }
+#line 1858 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 6:
-/* Line 1787 of yacc.c  */
-#line 236 "parser.y"
+#line 238 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
                  set_empty((yyval.sel));
                  END_ACTION;
              }
+#line 1868 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 7:
-/* Line 1787 of yacc.c  */
-#line 242 "parser.y"
+#line 244 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
                  SelectionTreeElementPointer s
-                        = _gmx_sel_init_group_by_id((yyvsp[(1) - (1)].i), scanner);
+                        = _gmx_sel_init_group_by_id((yyvsp[0].i), scanner);
                  SelectionTreeElementPointer p
                         = _gmx_sel_init_position(s, NULL, scanner);
                  if (!p) YYERROR;
                  set((yyval.sel), _gmx_sel_init_selection(NULL, p, scanner));
                  END_ACTION;
              }
+#line 1883 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 8:
-/* Line 1787 of yacc.c  */
-#line 253 "parser.y"
+#line 255 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 scoped_guard_sfree nameGuard((yyvsp[(1) - (1)].str));
+                 const sfree_guard nameGuard((yyvsp[0].str));
                  SelectionTreeElementPointer s
-                        = _gmx_sel_init_group_by_name((yyvsp[(1) - (1)].str), scanner);
+                        = _gmx_sel_init_group_by_name((yyvsp[0].str), scanner);
                  SelectionTreeElementPointer p
                         = _gmx_sel_init_position(s, NULL, scanner);
                  if (!p) YYERROR;
                  set((yyval.sel), _gmx_sel_init_selection(NULL, p, scanner));
                  END_ACTION;
              }
+#line 1899 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 9:
-/* Line 1787 of yacc.c  */
-#line 265 "parser.y"
+#line 267 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.sel), _gmx_sel_init_selection(NULL, get((yyvsp[(1) - (1)].sel)), scanner));
+                 set((yyval.sel), _gmx_sel_init_selection(NULL, get((yyvsp[0].sel)), scanner));
                  END_ACTION;
              }
+#line 1909 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 10:
-/* Line 1787 of yacc.c  */
-#line 271 "parser.y"
+#line 273 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 scoped_guard_sfree nameGuard((yyvsp[(1) - (2)].str));
-                 set((yyval.sel), _gmx_sel_init_selection((yyvsp[(1) - (2)].str), get((yyvsp[(2) - (2)].sel)), scanner));
+                 const sfree_guard nameGuard((yyvsp[-1].str));
+                 set((yyval.sel), _gmx_sel_init_selection((yyvsp[-1].str), get((yyvsp[0].sel)), scanner));
                  END_ACTION;
              }
+#line 1920 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 11:
-/* Line 1787 of yacc.c  */
-#line 278 "parser.y"
+#line 280 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 scoped_guard_sfree nameGuard((yyvsp[(1) - (3)].str));
-                 set((yyval.sel), _gmx_sel_assign_variable((yyvsp[(1) - (3)].str), get((yyvsp[(3) - (3)].sel)), scanner));
+                 const sfree_guard nameGuard((yyvsp[-2].str));
+                 set((yyval.sel), _gmx_sel_assign_variable((yyvsp[-2].str), get((yyvsp[0].sel)), scanner));
                  END_ACTION;
              }
+#line 1931 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 12:
-/* Line 1787 of yacc.c  */
-#line 285 "parser.y"
+#line 287 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 scoped_guard_sfree nameGuard((yyvsp[(1) - (3)].str));
-                 set((yyval.sel), _gmx_sel_assign_variable((yyvsp[(1) - (3)].str), get((yyvsp[(3) - (3)].sel)), scanner));
+                 const sfree_guard nameGuard((yyvsp[-2].str));
+                 set((yyval.sel), _gmx_sel_assign_variable((yyvsp[-2].str), get((yyvsp[0].sel)), scanner));
                  END_ACTION;
              }
+#line 1942 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 13:
-/* Line 1787 of yacc.c  */
-#line 292 "parser.y"
+#line 294 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 scoped_guard_sfree nameGuard((yyvsp[(1) - (3)].str));
-                 set((yyval.sel), _gmx_sel_assign_variable((yyvsp[(1) - (3)].str), get((yyvsp[(3) - (3)].sel)), scanner));
+                 const sfree_guard nameGuard((yyvsp[-2].str));
+                 set((yyval.sel), _gmx_sel_assign_variable((yyvsp[-2].str), get((yyvsp[0].sel)), scanner));
                  END_ACTION;
              }
+#line 1953 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 14:
-/* Line 1787 of yacc.c  */
-#line 301 "parser.y"
-    { (yyval.sel) = (yyvsp[(1) - (1)].sel); }
+#line 303 "parser.y" /* yacc.c:1646  */
+    { (yyval.sel) = (yyvsp[0].sel); }
+#line 1959 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 15:
-/* Line 1787 of yacc.c  */
-#line 303 "parser.y"
+#line 305 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.sel), _gmx_sel_init_position(get((yyvsp[(1) - (1)].sel)), NULL, scanner));
+                 set((yyval.sel), _gmx_sel_init_position(get((yyvsp[0].sel)), NULL, scanner));
                  CHECK_SEL((yyval.sel));
                  END_ACTION;
              }
+#line 1970 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 16:
-/* Line 1787 of yacc.c  */
-#line 309 "parser.y"
-    { (yyval.sel) = (yyvsp[(2) - (3)].sel); }
+#line 311 "parser.y" /* yacc.c:1646  */
+    { (yyval.sel) = (yyvsp[-1].sel); }
+#line 1976 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 17:
-/* Line 1787 of yacc.c  */
-#line 311 "parser.y"
+#line 313 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.sel), _gmx_sel_init_modifier((yyvsp[(2) - (3)].meth), get((yyvsp[(3) - (3)].plist)), get((yyvsp[(1) - (3)].sel)), scanner));
+                 set((yyval.sel), _gmx_sel_init_modifier((yyvsp[-1].meth), get((yyvsp[0].plist)), get((yyvsp[-2].sel)), scanner));
                  CHECK_SEL((yyval.sel));
                  END_ACTION;
              }
+#line 1987 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 18:
-/* Line 1787 of yacc.c  */
-#line 324 "parser.y"
-    { (yyval.i) = (yyvsp[(1) - (1)].i); }
+#line 326 "parser.y" /* yacc.c:1646  */
+    { (yyval.i) = (yyvsp[0].i); }
+#line 1993 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 19:
-/* Line 1787 of yacc.c  */
-#line 325 "parser.y"
-    { (yyval.i) = -(yyvsp[(2) - (2)].i); }
+#line 327 "parser.y" /* yacc.c:1646  */
+    { (yyval.i) = -(yyvsp[0].i); }
+#line 1999 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 20:
-/* Line 1787 of yacc.c  */
-#line 329 "parser.y"
-    { (yyval.r) = (yyvsp[(1) - (1)].r); }
+#line 331 "parser.y" /* yacc.c:1646  */
+    { (yyval.r) = (yyvsp[0].r); }
+#line 2005 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 21:
-/* Line 1787 of yacc.c  */
-#line 330 "parser.y"
-    { (yyval.r) = -(yyvsp[(2) - (2)].r); }
+#line 332 "parser.y" /* yacc.c:1646  */
+    { (yyval.r) = -(yyvsp[0].r); }
+#line 2011 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 22:
-/* Line 1787 of yacc.c  */
-#line 333 "parser.y"
-    { (yyval.r) = (yyvsp[(1) - (1)].i); }
+#line 335 "parser.y" /* yacc.c:1646  */
+    { (yyval.r) = (yyvsp[0].i); }
+#line 2017 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 23:
-/* Line 1787 of yacc.c  */
-#line 334 "parser.y"
-    { (yyval.r) = (yyvsp[(1) - (1)].r); }
+#line 336 "parser.y" /* yacc.c:1646  */
+    { (yyval.r) = (yyvsp[0].r); }
+#line 2023 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 24:
-/* Line 1787 of yacc.c  */
-#line 337 "parser.y"
-    { (yyval.str) = (yyvsp[(1) - (1)].str); }
+#line 339 "parser.y" /* yacc.c:1646  */
+    { (yyval.str) = (yyvsp[0].str); }
+#line 2029 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 25:
-/* Line 1787 of yacc.c  */
-#line 338 "parser.y"
-    { (yyval.str) = (yyvsp[(1) - (1)].str); }
+#line 340 "parser.y" /* yacc.c:1646  */
+    { (yyval.str) = (yyvsp[0].str); }
+#line 2035 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 26:
-/* Line 1787 of yacc.c  */
-#line 347 "parser.y"
+#line 349 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 SelectionTreeElementPointer arg(get((yyvsp[(2) - (2)].sel)));
+                 SelectionTreeElementPointer arg(get((yyvsp[0].sel)));
                  SelectionTreeElementPointer sel(
                         new SelectionTreeElement(SEL_BOOLEAN, (yyloc)));
                  sel->u.boolt = BOOL_NOT;
@@ -2272,14 +2046,14 @@ yyreduce:
                  set((yyval.sel), sel);
                  END_ACTION;
              }
+#line 2050 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 27:
-/* Line 1787 of yacc.c  */
-#line 358 "parser.y"
+#line 360 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 SelectionTreeElementPointer arg1(get((yyvsp[(1) - (3)].sel))), arg2(get((yyvsp[(3) - (3)].sel)));
+                 SelectionTreeElementPointer arg1(get((yyvsp[-2].sel))), arg2(get((yyvsp[0].sel)));
                  SelectionTreeElementPointer sel(
                         new SelectionTreeElement(SEL_BOOLEAN, (yyloc)));
                  sel->u.boolt = BOOL_AND;
@@ -2287,14 +2061,14 @@ yyreduce:
                  set((yyval.sel), sel);
                  END_ACTION;
              }
+#line 2065 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 28:
-/* Line 1787 of yacc.c  */
-#line 369 "parser.y"
+#line 371 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 SelectionTreeElementPointer arg1(get((yyvsp[(1) - (3)].sel))), arg2(get((yyvsp[(3) - (3)].sel)));
+                 SelectionTreeElementPointer arg1(get((yyvsp[-2].sel))), arg2(get((yyvsp[0].sel)));
                  SelectionTreeElementPointer sel(
                         new SelectionTreeElement(SEL_BOOLEAN, (yyloc)));
                  sel->u.boolt = BOOL_OR;
@@ -2302,618 +2076,618 @@ yyreduce:
                  set((yyval.sel), sel);
                  END_ACTION;
              }
+#line 2080 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 29:
-/* Line 1787 of yacc.c  */
-#line 379 "parser.y"
-    { (yyval.sel) = (yyvsp[(2) - (3)].sel); }
+#line 381 "parser.y" /* yacc.c:1646  */
+    { (yyval.sel) = (yyvsp[-1].sel); }
+#line 2086 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 30:
-/* Line 1787 of yacc.c  */
-#line 384 "parser.y"
+#line 386 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 scoped_guard_sfree opGuard((yyvsp[(2) - (3)].str));
-                 set((yyval.sel), _gmx_sel_init_comparison(get((yyvsp[(1) - (3)].sel)), get((yyvsp[(3) - (3)].sel)), (yyvsp[(2) - (3)].str), scanner));
+                 const sfree_guard opGuard((yyvsp[-1].str));
+                 set((yyval.sel), _gmx_sel_init_comparison(get((yyvsp[-2].sel)), get((yyvsp[0].sel)), (yyvsp[-1].str), scanner));
                  CHECK_SEL((yyval.sel));
                  END_ACTION;
              }
+#line 2098 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 31:
-/* Line 1787 of yacc.c  */
-#line 395 "parser.y"
+#line 397 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 scoped_guard_sfree nameGuard((yyvsp[(2) - (2)].str));
-                 set((yyval.sel), _gmx_sel_init_group_by_name((yyvsp[(2) - (2)].str), scanner));
+                 const sfree_guard nameGuard((yyvsp[0].str));
+                 set((yyval.sel), _gmx_sel_init_group_by_name((yyvsp[0].str), scanner));
                  END_ACTION;
              }
+#line 2109 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 32:
-/* Line 1787 of yacc.c  */
-#line 402 "parser.y"
+#line 404 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.sel), _gmx_sel_init_group_by_id((yyvsp[(2) - (2)].i), scanner));
+                 set((yyval.sel), _gmx_sel_init_group_by_id((yyvsp[0].i), scanner));
                  END_ACTION;
              }
+#line 2119 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 33:
-/* Line 1787 of yacc.c  */
-#line 410 "parser.y"
+#line 412 "parser.y" /* yacc.c:1646  */
     { (yyval.str) = NULL; }
+#line 2125 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 34:
-/* Line 1787 of yacc.c  */
-#line 411 "parser.y"
-    { (yyval.str) = (yyvsp[(1) - (1)].str);   }
+#line 413 "parser.y" /* yacc.c:1646  */
+    { (yyval.str) = (yyvsp[0].str);   }
+#line 2131 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 35:
-/* Line 1787 of yacc.c  */
-#line 416 "parser.y"
+#line 418 "parser.y" /* yacc.c:1646  */
     { (yyval.smt) = gmx::eStringMatchType_RegularExpression; }
+#line 2137 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 36:
-/* Line 1787 of yacc.c  */
-#line 417 "parser.y"
+#line 419 "parser.y" /* yacc.c:1646  */
     { (yyval.smt) = gmx::eStringMatchType_Wildcard; }
+#line 2143 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 37:
-/* Line 1787 of yacc.c  */
-#line 418 "parser.y"
+#line 420 "parser.y" /* yacc.c:1646  */
     { (yyval.smt) = gmx::eStringMatchType_Exact; }
+#line 2149 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 38:
-/* Line 1787 of yacc.c  */
-#line 423 "parser.y"
+#line 425 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard((yyvsp[(1) - (2)].str));
-                 set((yyval.sel), _gmx_sel_init_keyword((yyvsp[(2) - (2)].meth), SelectionParserValueListPointer(), (yyvsp[(1) - (2)].str), scanner));
+                 const sfree_guard posmodGuard((yyvsp[-1].str));
+                 set((yyval.sel), _gmx_sel_init_keyword((yyvsp[0].meth), SelectionParserValueListPointer(), (yyvsp[-1].str), scanner));
                  CHECK_SEL((yyval.sel));
                  END_ACTION;
              }
+#line 2161 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 39:
-/* Line 1787 of yacc.c  */
-#line 431 "parser.y"
+#line 433 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard((yyvsp[(1) - (3)].str));
-                 set((yyval.sel), _gmx_sel_init_keyword_strmatch((yyvsp[(2) - (3)].meth), gmx::eStringMatchType_Auto, get((yyvsp[(3) - (3)].vlist)), (yyvsp[(1) - (3)].str), scanner));
+                 const sfree_guard posmodGuard((yyvsp[-2].str));
+                 set((yyval.sel), _gmx_sel_init_keyword_strmatch((yyvsp[-1].meth), gmx::eStringMatchType_Auto, get((yyvsp[0].vlist)), (yyvsp[-2].str), scanner));
                  CHECK_SEL((yyval.sel));
                  END_ACTION;
              }
+#line 2173 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 40:
-/* Line 1787 of yacc.c  */
-#line 439 "parser.y"
+#line 441 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard((yyvsp[(1) - (4)].str));
-                 set((yyval.sel), _gmx_sel_init_keyword_strmatch((yyvsp[(2) - (4)].meth), (yyvsp[(3) - (4)].smt), get((yyvsp[(4) - (4)].vlist)), (yyvsp[(1) - (4)].str), scanner));
+                 const sfree_guard posmodGuard((yyvsp[-3].str));
+                 set((yyval.sel), _gmx_sel_init_keyword_strmatch((yyvsp[-2].meth), (yyvsp[-1].smt), get((yyvsp[0].vlist)), (yyvsp[-3].str), scanner));
                  CHECK_SEL((yyval.sel));
                  END_ACTION;
              }
+#line 2185 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 41:
-/* Line 1787 of yacc.c  */
-#line 447 "parser.y"
+#line 449 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard((yyvsp[(1) - (3)].str));
-                 set((yyval.sel), _gmx_sel_init_keyword((yyvsp[(2) - (3)].meth), get((yyvsp[(3) - (3)].vlist)), (yyvsp[(1) - (3)].str), scanner));
+                 const sfree_guard posmodGuard((yyvsp[-2].str));
+                 set((yyval.sel), _gmx_sel_init_keyword((yyvsp[-1].meth), get((yyvsp[0].vlist)), (yyvsp[-2].str), scanner));
                  CHECK_SEL((yyval.sel));
                  END_ACTION;
              }
+#line 2197 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 42:
-/* Line 1787 of yacc.c  */
-#line 458 "parser.y"
+#line 460 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard((yyvsp[(1) - (3)].str));
-                 set((yyval.sel), _gmx_sel_init_method((yyvsp[(2) - (3)].meth), get((yyvsp[(3) - (3)].plist)), (yyvsp[(1) - (3)].str), scanner));
+                 const sfree_guard posmodGuard((yyvsp[-2].str));
+                 set((yyval.sel), _gmx_sel_init_method((yyvsp[-1].meth), get((yyvsp[0].plist)), (yyvsp[-2].str), scanner));
                  CHECK_SEL((yyval.sel));
                  END_ACTION;
              }
+#line 2209 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 43:
-/* Line 1787 of yacc.c  */
-#line 473 "parser.y"
+#line 475 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
                  SelectionTreeElementPointer sel(
                         new SelectionTreeElement(SEL_CONST, (yyloc)));
                  _gmx_selelem_set_vtype(sel, INT_VALUE);
                  _gmx_selvalue_reserve(&sel->v, 1);
-                 sel->v.u.i[0] = (yyvsp[(1) - (1)].i);
+                 sel->v.u.i[0] = (yyvsp[0].i);
                  set((yyval.sel), sel);
                  END_ACTION;
              }
+#line 2224 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 44:
-/* Line 1787 of yacc.c  */
-#line 484 "parser.y"
+#line 486 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
                  SelectionTreeElementPointer sel(
                         new SelectionTreeElement(SEL_CONST, (yyloc)));
                  _gmx_selelem_set_vtype(sel, REAL_VALUE);
                  _gmx_selvalue_reserve(&sel->v, 1);
-                 sel->v.u.r[0] = (yyvsp[(1) - (1)].r);
+                 sel->v.u.r[0] = (yyvsp[0].r);
                  set((yyval.sel), sel);
                  END_ACTION;
              }
+#line 2239 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 45:
-/* Line 1787 of yacc.c  */
-#line 498 "parser.y"
+#line 500 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard((yyvsp[(1) - (2)].str));
-                 set((yyval.sel), _gmx_sel_init_keyword((yyvsp[(2) - (2)].meth), SelectionParserValueListPointer(), (yyvsp[(1) - (2)].str), scanner));
+                 const sfree_guard posmodGuard((yyvsp[-1].str));
+                 set((yyval.sel), _gmx_sel_init_keyword((yyvsp[0].meth), SelectionParserValueListPointer(), (yyvsp[-1].str), scanner));
                  CHECK_SEL((yyval.sel));
                  END_ACTION;
              }
+#line 2251 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 46:
-/* Line 1787 of yacc.c  */
-#line 506 "parser.y"
+#line 508 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard((yyvsp[(1) - (4)].str));
-                 set((yyval.sel), _gmx_sel_init_keyword_of((yyvsp[(2) - (4)].meth), get((yyvsp[(4) - (4)].sel)), (yyvsp[(1) - (4)].str), scanner));
+                 const sfree_guard posmodGuard((yyvsp[-3].str));
+                 set((yyval.sel), _gmx_sel_init_keyword_of((yyvsp[-2].meth), get((yyvsp[0].sel)), (yyvsp[-3].str), scanner));
                  CHECK_SEL((yyval.sel));
                  END_ACTION;
              }
+#line 2263 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 47:
-/* Line 1787 of yacc.c  */
-#line 514 "parser.y"
+#line 516 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard((yyvsp[(1) - (3)].str));
-                 set((yyval.sel), _gmx_sel_init_method((yyvsp[(2) - (3)].meth), get((yyvsp[(3) - (3)].plist)), (yyvsp[(1) - (3)].str), scanner));
+                 const sfree_guard posmodGuard((yyvsp[-2].str));
+                 set((yyval.sel), _gmx_sel_init_method((yyvsp[-1].meth), get((yyvsp[0].plist)), (yyvsp[-2].str), scanner));
                  CHECK_SEL((yyval.sel));
                  END_ACTION;
              }
+#line 2275 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 48:
-/* Line 1787 of yacc.c  */
-#line 525 "parser.y"
+#line 527 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[(1) - (3)].sel)), get((yyvsp[(3) - (3)].sel)), '+', scanner));
+                 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[-2].sel)), get((yyvsp[0].sel)), '+', scanner));
                  END_ACTION;
              }
+#line 2285 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 49:
-/* Line 1787 of yacc.c  */
-#line 531 "parser.y"
+#line 533 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[(1) - (3)].sel)), get((yyvsp[(3) - (3)].sel)), '-', scanner));
+                 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[-2].sel)), get((yyvsp[0].sel)), '-', scanner));
                  END_ACTION;
              }
+#line 2295 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 50:
-/* Line 1787 of yacc.c  */
-#line 537 "parser.y"
+#line 539 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[(1) - (3)].sel)), get((yyvsp[(3) - (3)].sel)), '*', scanner));
+                 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[-2].sel)), get((yyvsp[0].sel)), '*', scanner));
                  END_ACTION;
              }
+#line 2305 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 51:
-/* Line 1787 of yacc.c  */
-#line 543 "parser.y"
+#line 545 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[(1) - (3)].sel)), get((yyvsp[(3) - (3)].sel)), '/', scanner));
+                 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[-2].sel)), get((yyvsp[0].sel)), '/', scanner));
                  END_ACTION;
              }
+#line 2315 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 52:
-/* Line 1787 of yacc.c  */
-#line 549 "parser.y"
+#line 551 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[(2) - (2)].sel)), SelectionTreeElementPointer(), '-', scanner));
+                 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[0].sel)), SelectionTreeElementPointer(), '-', scanner));
                  END_ACTION;
              }
+#line 2325 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 53:
-/* Line 1787 of yacc.c  */
-#line 555 "parser.y"
+#line 557 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[(1) - (3)].sel)), get((yyvsp[(3) - (3)].sel)), '^', scanner));
+                 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[-2].sel)), get((yyvsp[0].sel)), '^', scanner));
                  END_ACTION;
              }
+#line 2335 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 54:
-/* Line 1787 of yacc.c  */
-#line 560 "parser.y"
-    { (yyval.sel) = (yyvsp[(2) - (3)].sel); }
+#line 562 "parser.y" /* yacc.c:1646  */
+    { (yyval.sel) = (yyvsp[-1].sel); }
+#line 2341 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 55:
-/* Line 1787 of yacc.c  */
-#line 568 "parser.y"
+#line 570 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
                  SelectionTreeElementPointer sel(
                         new SelectionTreeElement(SEL_CONST, (yyloc)));
                  _gmx_selelem_set_vtype(sel, STR_VALUE);
                  _gmx_selvalue_reserve(&sel->v, 1);
-                 sel->v.u.s[0] = (yyvsp[(1) - (1)].str);
+                 sel->v.u.s[0] = (yyvsp[0].str);
                  set((yyval.sel), sel);
                  END_ACTION;
              }
+#line 2356 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 56:
-/* Line 1787 of yacc.c  */
-#line 579 "parser.y"
+#line 581 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard((yyvsp[(1) - (2)].str));
-                 set((yyval.sel), _gmx_sel_init_keyword((yyvsp[(2) - (2)].meth), SelectionParserValueListPointer(), (yyvsp[(1) - (2)].str), scanner));
+                 const sfree_guard posmodGuard((yyvsp[-1].str));
+                 set((yyval.sel), _gmx_sel_init_keyword((yyvsp[0].meth), SelectionParserValueListPointer(), (yyvsp[-1].str), scanner));
                  CHECK_SEL((yyval.sel));
                  END_ACTION;
              }
+#line 2368 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 57:
-/* Line 1787 of yacc.c  */
-#line 594 "parser.y"
+#line 596 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.sel), _gmx_sel_init_const_position((yyvsp[(2) - (7)].r), (yyvsp[(4) - (7)].r), (yyvsp[(6) - (7)].r), scanner));
+                 set((yyval.sel), _gmx_sel_init_const_position((yyvsp[-5].r), (yyvsp[-3].r), (yyvsp[-1].r), scanner));
                  END_ACTION;
              }
+#line 2378 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 58:
-/* Line 1787 of yacc.c  */
-#line 602 "parser.y"
-    { (yyval.sel) = (yyvsp[(2) - (3)].sel); }
+#line 604 "parser.y" /* yacc.c:1646  */
+    { (yyval.sel) = (yyvsp[-1].sel); }
+#line 2384 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 59:
-/* Line 1787 of yacc.c  */
-#line 607 "parser.y"
+#line 609 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.sel), _gmx_sel_init_method((yyvsp[(1) - (2)].meth), get((yyvsp[(2) - (2)].plist)), NULL, scanner));
+                 set((yyval.sel), _gmx_sel_init_method((yyvsp[-1].meth), get((yyvsp[0].plist)), NULL, scanner));
                  CHECK_SEL((yyval.sel));
                  END_ACTION;
              }
+#line 2395 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 60:
-/* Line 1787 of yacc.c  */
-#line 617 "parser.y"
+#line 619 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 scoped_guard_sfree keywordGuard((yyvsp[(1) - (3)].str));
-                 set((yyval.sel), _gmx_sel_init_position(get((yyvsp[(3) - (3)].sel)), (yyvsp[(1) - (3)].str), scanner));
+                 const sfree_guard keywordGuard((yyvsp[-2].str));
+                 set((yyval.sel), _gmx_sel_init_position(get((yyvsp[0].sel)), (yyvsp[-2].str), scanner));
                  CHECK_SEL((yyval.sel));
                  END_ACTION;
              }
+#line 2407 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 61:
-/* Line 1787 of yacc.c  */
-#line 631 "parser.y"
+#line 633 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.sel), _gmx_sel_init_variable_ref(get((yyvsp[(1) - (1)].sel)), scanner));
+                 set((yyval.sel), _gmx_sel_init_variable_ref(get((yyvsp[0].sel)), scanner));
                  END_ACTION;
              }
+#line 2417 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 62:
-/* Line 1787 of yacc.c  */
-#line 639 "parser.y"
+#line 641 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.sel), _gmx_sel_init_variable_ref(get((yyvsp[(1) - (1)].sel)), scanner));
+                 set((yyval.sel), _gmx_sel_init_variable_ref(get((yyvsp[0].sel)), scanner));
                  END_ACTION;
              }
+#line 2427 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 63:
-/* Line 1787 of yacc.c  */
-#line 647 "parser.y"
+#line 649 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.sel), _gmx_sel_init_variable_ref(get((yyvsp[(1) - (1)].sel)), scanner));
+                 set((yyval.sel), _gmx_sel_init_variable_ref(get((yyvsp[0].sel)), scanner));
                  END_ACTION;
              }
+#line 2437 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 64:
-/* Line 1787 of yacc.c  */
-#line 660 "parser.y"
-    { (yyval.plist) = (yyvsp[(1) - (1)].plist); }
+#line 662 "parser.y" /* yacc.c:1646  */
+    { (yyval.plist) = (yyvsp[0].plist); }
+#line 2443 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 65:
-/* Line 1787 of yacc.c  */
-#line 662 "parser.y"
-    { (yyval.plist) = (yyvsp[(1) - (2)].plist); }
+#line 664 "parser.y" /* yacc.c:1646  */
+    { (yyval.plist) = (yyvsp[-1].plist); }
+#line 2449 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 66:
-/* Line 1787 of yacc.c  */
-#line 667 "parser.y"
+#line 669 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
                  set((yyval.plist), SelectionParserParameter::createList());
                  END_ACTION;
              }
+#line 2459 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 67:
-/* Line 1787 of yacc.c  */
-#line 673 "parser.y"
+#line 675 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 SelectionParserParameterListPointer list(get((yyvsp[(1) - (2)].plist)));
-                 list->push_back(get((yyvsp[(2) - (2)].param)));
+                 SelectionParserParameterListPointer list(get((yyvsp[-1].plist)));
+                 list->push_back(get((yyvsp[0].param)));
                  set((yyval.plist), std::move(list));
                  END_ACTION;
              }
+#line 2471 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 68:
-/* Line 1787 of yacc.c  */
-#line 684 "parser.y"
+#line 686 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 scoped_guard_sfree nameGuard((yyvsp[(1) - (2)].str));
-                 set((yyval.param), SelectionParserParameter::create((yyvsp[(1) - (2)].str), get((yyvsp[(2) - (2)].vlist)), (yyloc)));
+                 const sfree_guard nameGuard((yyvsp[-1].str));
+                 set((yyval.param), SelectionParserParameter::create((yyvsp[-1].str), get((yyvsp[0].vlist)), (yyloc)));
                  END_ACTION;
              }
+#line 2482 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 69:
-/* Line 1787 of yacc.c  */
-#line 692 "parser.y"
-    { (yyval.vlist) = (yyvsp[(1) - (1)].vlist);   }
+#line 694 "parser.y" /* yacc.c:1646  */
+    { (yyval.vlist) = (yyvsp[0].vlist);   }
+#line 2488 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 70:
-/* Line 1787 of yacc.c  */
-#line 693 "parser.y"
-    { (yyval.vlist) = (yyvsp[(2) - (3)].vlist);   }
+#line 695 "parser.y" /* yacc.c:1646  */
+    { (yyval.vlist) = (yyvsp[-1].vlist);   }
+#line 2494 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 71:
-/* Line 1787 of yacc.c  */
-#line 698 "parser.y"
+#line 700 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
                  set((yyval.vlist), SelectionParserValue::createList());
                  END_ACTION;
              }
+#line 2504 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 72:
-/* Line 1787 of yacc.c  */
-#line 704 "parser.y"
+#line 706 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 SelectionParserValueListPointer list(get((yyvsp[(1) - (2)].vlist)));
-                 list->push_back(get((yyvsp[(2) - (2)].val)));
+                 SelectionParserValueListPointer list(get((yyvsp[-1].vlist)));
+                 list->push_back(get((yyvsp[0].val)));
                  set((yyval.vlist), std::move(list));
                  END_ACTION;
              }
+#line 2516 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 73:
-/* Line 1787 of yacc.c  */
-#line 712 "parser.y"
+#line 714 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 SelectionParserValueListPointer list(get((yyvsp[(1) - (3)].vlist)));
-                 list->push_back(get((yyvsp[(3) - (3)].val)));
+                 SelectionParserValueListPointer list(get((yyvsp[-2].vlist)));
+                 list->push_back(get((yyvsp[0].val)));
                  set((yyval.vlist), std::move(list));
                  END_ACTION;
              }
+#line 2528 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 74:
-/* Line 1787 of yacc.c  */
-#line 722 "parser.y"
-    { (yyval.vlist) = (yyvsp[(1) - (1)].vlist); }
+#line 724 "parser.y" /* yacc.c:1646  */
+    { (yyval.vlist) = (yyvsp[0].vlist); }
+#line 2534 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 75:
-/* Line 1787 of yacc.c  */
-#line 723 "parser.y"
-    { (yyval.vlist) = (yyvsp[(2) - (3)].vlist); }
+#line 725 "parser.y" /* yacc.c:1646  */
+    { (yyval.vlist) = (yyvsp[-1].vlist); }
+#line 2540 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 76:
-/* Line 1787 of yacc.c  */
-#line 728 "parser.y"
+#line 730 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.vlist), SelectionParserValue::createList(get((yyvsp[(1) - (1)].val))));
+                 set((yyval.vlist), SelectionParserValue::createList(get((yyvsp[0].val))));
                  END_ACTION;
              }
+#line 2550 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 77:
-/* Line 1787 of yacc.c  */
-#line 734 "parser.y"
+#line 736 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 SelectionParserValueListPointer list(get((yyvsp[(1) - (2)].vlist)));
-                 list->push_back(get((yyvsp[(2) - (2)].val)));
+                 SelectionParserValueListPointer list(get((yyvsp[-1].vlist)));
+                 list->push_back(get((yyvsp[0].val)));
                  set((yyval.vlist), std::move(list));
                  END_ACTION;
              }
+#line 2562 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 78:
-/* Line 1787 of yacc.c  */
-#line 742 "parser.y"
+#line 744 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 SelectionParserValueListPointer list(get((yyvsp[(1) - (3)].vlist)));
-                 list->push_back(get((yyvsp[(3) - (3)].val)));
+                 SelectionParserValueListPointer list(get((yyvsp[-2].vlist)));
+                 list->push_back(get((yyvsp[0].val)));
                  set((yyval.vlist), std::move(list));
                  END_ACTION;
              }
+#line 2574 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 79:
-/* Line 1787 of yacc.c  */
-#line 752 "parser.y"
+#line 754 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[(1) - (1)].sel))));
+                 set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[0].sel))));
                  END_ACTION;
              }
+#line 2584 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 80:
-/* Line 1787 of yacc.c  */
-#line 758 "parser.y"
+#line 760 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[(1) - (1)].sel))));
+                 set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[0].sel))));
                  END_ACTION;
              }
+#line 2594 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 81:
-/* Line 1787 of yacc.c  */
-#line 764 "parser.y"
+#line 766 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[(1) - (1)].sel))));
+                 set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[0].sel))));
                  END_ACTION;
              }
+#line 2604 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 82:
-/* Line 1787 of yacc.c  */
-#line 770 "parser.y"
+#line 772 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[(1) - (1)].sel))));
+                 set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[0].sel))));
                  END_ACTION;
              }
+#line 2614 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 83:
-/* Line 1787 of yacc.c  */
-#line 775 "parser.y"
-    { (yyval.val) = (yyvsp[(1) - (1)].val); }
+#line 777 "parser.y" /* yacc.c:1646  */
+    { (yyval.val) = (yyvsp[0].val); }
+#line 2620 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 84:
-/* Line 1787 of yacc.c  */
-#line 780 "parser.y"
+#line 782 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.val), SelectionParserValue::createInteger((yyvsp[(1) - (1)].i), (yyloc)));
+                 set((yyval.val), SelectionParserValue::createInteger((yyvsp[0].i), (yyloc)));
                  END_ACTION;
              }
+#line 2630 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 85:
-/* Line 1787 of yacc.c  */
-#line 786 "parser.y"
+#line 788 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.val), SelectionParserValue::createReal((yyvsp[(1) - (1)].r), (yyloc)));
+                 set((yyval.val), SelectionParserValue::createReal((yyvsp[0].r), (yyloc)));
                  END_ACTION;
              }
+#line 2640 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 86:
-/* Line 1787 of yacc.c  */
-#line 792 "parser.y"
+#line 794 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 scoped_guard_sfree stringGuard((yyvsp[(1) - (1)].str));
-                 set((yyval.val), SelectionParserValue::createString((yyvsp[(1) - (1)].str), (yyloc)));
+                 const sfree_guard stringGuard((yyvsp[0].str));
+                 set((yyval.val), SelectionParserValue::createString((yyvsp[0].str), (yyloc)));
                  END_ACTION;
              }
+#line 2651 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 87:
-/* Line 1787 of yacc.c  */
-#line 798 "parser.y"
-    { (yyval.val) = (yyvsp[(1) - (1)].val); }
+#line 800 "parser.y" /* yacc.c:1646  */
+    { (yyval.val) = (yyvsp[0].val); }
+#line 2657 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 88:
-/* Line 1787 of yacc.c  */
-#line 803 "parser.y"
+#line 805 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.val), SelectionParserValue::createIntegerRange((yyvsp[(1) - (3)].i), (yyvsp[(3) - (3)].i), (yyloc)));
+                 set((yyval.val), SelectionParserValue::createIntegerRange((yyvsp[-2].i), (yyvsp[0].i), (yyloc)));
                  END_ACTION;
              }
+#line 2667 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 89:
-/* Line 1787 of yacc.c  */
-#line 809 "parser.y"
+#line 811 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.val), SelectionParserValue::createRealRange((yyvsp[(1) - (3)].i), (yyvsp[(3) - (3)].r), (yyloc)));
+                 set((yyval.val), SelectionParserValue::createRealRange((yyvsp[-2].i), (yyvsp[0].r), (yyloc)));
                  END_ACTION;
              }
+#line 2677 "parser.cpp" /* yacc.c:1646  */
     break;
 
   case 90:
-/* Line 1787 of yacc.c  */
-#line 815 "parser.y"
+#line 817 "parser.y" /* yacc.c:1646  */
     {
                  BEGIN_ACTION;
-                 set((yyval.val), SelectionParserValue::createRealRange((yyvsp[(1) - (3)].r), (yyvsp[(3) - (3)].r), (yyloc)));
+                 set((yyval.val), SelectionParserValue::createRealRange((yyvsp[-2].r), (yyvsp[0].r), (yyloc)));
                  END_ACTION;
              }
+#line 2687 "parser.cpp" /* yacc.c:1646  */
     break;
 
 
-/* Line 1787 of yacc.c  */
-#line 2917 "parser.cpp"
+#line 2691 "parser.cpp" /* yacc.c:1646  */
       default: break;
     }
   /* User semantic actions sometimes alter yychar, and that requires
@@ -2936,7 +2710,7 @@ yyreduce:
   *++yyvsp = yyval;
   *++yylsp = yyloc;
 
-  /* Now `shift' the result of the reduction.  Determine what state
+  /* Now 'shift' the result of the reduction.  Determine what state
      that goes to, based on the state we popped back to and the rule
      number reduced by.  */
 
@@ -2951,9 +2725,9 @@ yyreduce:
   goto yynewstate;
 
 
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
+/*--------------------------------------.
+| yyerrlab -- here on detecting error |
+`--------------------------------------*/
 yyerrlab:
   /* Make sure we have latest lookahead translation.  See comments at
      user semantic actions for why this is necessary.  */
@@ -3004,20 +2778,20 @@ yyerrlab:
   if (yyerrstatus == 3)
     {
       /* If just tried and failed to reuse lookahead token after an
-        error, discard it.  */
+         error, discard it.  */
 
       if (yychar <= YYEOF)
-       {
-         /* Return failure if at end of input.  */
-         if (yychar == YYEOF)
-           YYABORT;
-       }
+        {
+          /* Return failure if at end of input.  */
+          if (yychar == YYEOF)
+            YYABORT;
+        }
       else
-       {
-         yydestruct ("Error: discarding",
-                     yytoken, &yylval, &yylloc, scanner);
-         yychar = YYEMPTY;
-       }
+        {
+          yydestruct ("Error: discarding",
+                      yytoken, &yylval, &yylloc, scanner);
+          yychar = YYEMPTY;
+        }
     }
 
   /* Else will try to reuse lookahead token after shifting the error
@@ -3037,7 +2811,7 @@ yyerrorlab:
      goto yyerrorlab;
 
   yyerror_range[1] = yylsp[1-yylen];
-  /* Do not reclaim the symbols of the rule which action triggered
+  /* Do not reclaim the symbols of the rule whose action triggered
      this YYERROR.  */
   YYPOPSTACK (yylen);
   yylen = 0;
@@ -3050,29 +2824,29 @@ yyerrorlab:
 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
 `-------------------------------------------------------------*/
 yyerrlab1:
-  yyerrstatus = 3;     /* Each real token shifted decrements this.  */
+  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
 
   for (;;)
     {
       yyn = yypact[yystate];
       if (!yypact_value_is_default (yyn))
-       {
-         yyn += YYTERROR;
-         if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
-           {
-             yyn = yytable[yyn];
-             if (0 < yyn)
-               break;
-           }
-       }
+        {
+          yyn += YYTERROR;
+          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+            {
+              yyn = yytable[yyn];
+              if (0 < yyn)
+                break;
+            }
+        }
 
       /* Pop the current state because it cannot handle the error token.  */
       if (yyssp == yyss)
-       YYABORT;
+        YYABORT;
 
       yyerror_range[1] = *yylsp;
       yydestruct ("Error: popping",
-                 yystos[yystate], yyvsp, yylsp, scanner);
+                  yystos[yystate], yyvsp, yylsp, scanner);
       YYPOPSTACK (1);
       yystate = *yyssp;
       YY_STACK_PRINT (yyss, yyssp);
@@ -3128,14 +2902,14 @@ yyreturn:
       yydestruct ("Cleanup: discarding lookahead",
                   yytoken, &yylval, &yylloc, scanner);
     }
-  /* Do not reclaim the symbols of the rule which action triggered
+  /* Do not reclaim the symbols of the rule whose action triggered
      this YYABORT or YYACCEPT.  */
   YYPOPSTACK (yylen);
   YY_STACK_PRINT (yyss, yyssp);
   while (yyssp != yyss)
     {
       yydestruct ("Cleanup: popping",
-                 yystos[*yyssp], yyvsp, yylsp, scanner);
+                  yystos[*yyssp], yyvsp, yylsp, scanner);
       YYPOPSTACK (1);
     }
 #ifndef yyoverflow
@@ -3149,8 +2923,5 @@ yypushreturn:
   if (yymsg != yymsgbuf)
     YYSTACK_FREE (yymsg);
 #endif
-  /* Make sure YYID is used.  */
-  return YYID (yyresult);
+  return yyresult;
 }
-
-
index 2e9a7611ee168993a43bbdfe37a5103cba1c700a..a0263cee49ccd82604ea1b7e7ea1fb3ef104ff16 100644 (file)
@@ -1,19 +1,19 @@
-/* A Bison parser, made by GNU Bison 2.7.12-4996.  */
+/* A Bison parser, made by GNU Bison 3.0.4.  */
 
 /* Bison interface for Yacc-like parsers in C
-   
-      Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
-   
+
+   Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
+
    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 3 of the License, or
    (at your option) any later version.
-   
+
    This program 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 General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
    special exception, which will cause the skeleton and the resulting
    Bison output files to be licensed under the GNU General Public
    License without this special exception.
-   
+
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
 #ifndef YY__GMX_SEL_YY_PARSER_H_INCLUDED
 # define YY__GMX_SEL_YY_PARSER_H_INCLUDED
-/* Enabling traces.  */
+/* Debug traces.  */
 #ifndef YYDEBUG
 # define YYDEBUG 1
 #endif
 extern int _gmx_sel_yydebug;
 #endif
 /* "%code requires" blocks.  */
-/* Line 2053 of yacc.c  */
-#line 1 "parser.y"
+#line 1 "parser.y" /* yacc.c:1909  */
 
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,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.
@@ -77,65 +76,60 @@ extern int _gmx_sel_yydebug;
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-
-/* Line 2053 of yacc.c  */
-#line 76 "parser.y"
+#line 76 "parser.y" /* yacc.c:1909  */
 
 #include "parsetree.h"
 #include "selelem.h"
 
 #define YYLTYPE ::gmx::SelectionLocation
 
+#line 87 "parser.h" /* yacc.c:1909  */
 
-/* Line 2053 of yacc.c  */
-#line 92 "parser.h"
-
-/* Tokens.  */
+/* Token type.  */
 #ifndef YYTOKENTYPE
 # define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     INVALID = 258,
-     TOK_INT = 259,
-     TOK_REAL = 260,
-     STR = 261,
-     IDENTIFIER = 262,
-     CMD_SEP = 263,
-     GROUP = 264,
-     TO = 265,
-     VARIABLE_NUMERIC = 266,
-     VARIABLE_GROUP = 267,
-     VARIABLE_POS = 268,
-     KEYWORD_NUMERIC = 269,
-     KEYWORD_STR = 270,
-     KEYWORD_POS = 271,
-     KEYWORD_GROUP = 272,
-     METHOD_NUMERIC = 273,
-     METHOD_GROUP = 274,
-     METHOD_POS = 275,
-     MODIFIER = 276,
-     EMPTY_POSMOD = 277,
-     PARAM = 278,
-     END_OF_METHOD = 279,
-     OF = 280,
-     CMP_OP = 281,
-     PARAM_REDUCT = 282,
-     XOR = 283,
-     OR = 284,
-     AND = 285,
-     NOT = 286,
-     UNARY_NEG = 287,
-     NUM_REDUCT = 288
-   };
+  enum yytokentype
+  {
+    INVALID = 258,
+    TOK_INT = 259,
+    TOK_REAL = 260,
+    STR = 261,
+    IDENTIFIER = 262,
+    CMD_SEP = 263,
+    GROUP = 264,
+    TO = 265,
+    VARIABLE_NUMERIC = 266,
+    VARIABLE_GROUP = 267,
+    VARIABLE_POS = 268,
+    KEYWORD_NUMERIC = 269,
+    KEYWORD_STR = 270,
+    KEYWORD_POS = 271,
+    KEYWORD_GROUP = 272,
+    METHOD_NUMERIC = 273,
+    METHOD_GROUP = 274,
+    METHOD_POS = 275,
+    MODIFIER = 276,
+    EMPTY_POSMOD = 277,
+    PARAM = 278,
+    END_OF_METHOD = 279,
+    OF = 280,
+    CMP_OP = 281,
+    PARAM_REDUCT = 282,
+    OR = 283,
+    XOR = 284,
+    AND = 285,
+    NOT = 286,
+    UNARY_NEG = 287,
+    NUM_REDUCT = 288
+  };
 #endif
 
-
+/* Value type.  */
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
+
+union YYSTYPE
 {
-/* Line 2053 of yacc.c  */
-#line 83 "parser.y"
+#line 83 "parser.y" /* yacc.c:1909  */
 
     int                         i;
     real                        r;
@@ -150,29 +144,30 @@ typedef union YYSTYPE
     gmx::SelectionParserParameter               *param;
     gmx::SelectionParserParameterListPointer    *plist;
 
+#line 148 "parser.h" /* yacc.c:1909  */
+};
 
-/* Line 2053 of yacc.c  */
-#line 156 "parser.h"
-} YYSTYPE;
+typedef union YYSTYPE YYSTYPE;
 # define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
 #endif
 
+/* Location type.  */
 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
-typedef struct YYLTYPE
+typedef struct YYLTYPE YYLTYPE;
+struct YYLTYPE
 {
   int first_line;
   int first_column;
   int last_line;
   int last_column;
-} YYLTYPE;
-# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
+};
 # define YYLTYPE_IS_DECLARED 1
 # define YYLTYPE_IS_TRIVIAL 1
 #endif
 
 
+
 #ifndef YYPUSH_MORE_DEFINED
 # define YYPUSH_MORE_DEFINED
 enum { YYPUSH_MORE = 4 };
@@ -180,21 +175,9 @@ enum { YYPUSH_MORE = 4 };
 
 typedef struct _gmx_sel_yypstate _gmx_sel_yypstate;
 
-#if defined __STDC__ || defined __cplusplus
 int _gmx_sel_yypush_parse (_gmx_sel_yypstate *ps, int pushed_char, YYSTYPE const *pushed_val, YYLTYPE *pushed_loc, void *scanner);
-#else
-int _gmx_sel_yypush_parse ();
-#endif
 
-#if defined __STDC__ || defined __cplusplus
 _gmx_sel_yypstate * _gmx_sel_yypstate_new (void);
-#else
-_gmx_sel_yypstate * _gmx_sel_yypstate_new ();
-#endif
-#if defined __STDC__ || defined __cplusplus
 void _gmx_sel_yypstate_delete (_gmx_sel_yypstate *ps);
-#else
-void _gmx_sel_yypstate_delete ();
-#endif
 
 #endif /* !YY__GMX_SEL_YY_PARSER_H_INCLUDED  */
index de16101d2ba39ccbf28d0b1fb6db1ace6bf69c18..aa57eb089df2a6a4dd9188a6ae1f0a40f182ee60 100644 (file)
@@ -1,20 +1,20 @@
 --- parser.cpp 2014-11-03 06:56:28.000000000 +0200
 +++ parser.cpp 2014-11-03 06:57:35.000000000 +0200
-@@ -470,7 +470,7 @@
+@@ -437,7 +437,7 @@
  
  
  #if (! defined yyoverflow \
 -     && (! defined __cplusplus \
 +     && (! defined __cplusplus || defined GMX_YYFORCE_C_STACK_EXTENSION \
-        || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
-            && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+          || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
+              && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
  
-@@ -1076,7 +1076,7 @@
-     void *scanner;
- #endif
+@@ -955,7 +955,7 @@
+ static void
+ yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner)
  {
 -  FILE *yyo = yyoutput;
 +  FILE *yyo gmx_unused = yyoutput;
    YYUSE (yyo);
-   if (!yyvaluep)
-     return;
+   YYUSE (yylocationp);
+   YYUSE (scanner);
index 3cae4446e4b871ea13e06845dd0b4a70418d85eb..5f8197db4741d9d3dff591e471f518618331f1b7 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,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.
 #include "gmxpre.h"
 }
 %{
-#include "gromacs/utility/scoped_cptr.h"
+#include "gromacs/utility/unique_cptr.h"
 
 #include "parser_internal.h"
 
-using gmx::scoped_guard_sfree;
+using gmx::sfree_guard;
 using gmx::SelectionParserValue;
 using gmx::SelectionParserValueList;
 using gmx::SelectionParserValueListPointer;
@@ -189,7 +189,7 @@ using gmx::SelectionTreeElementPointer;
 %define api.push-pull push
 %locations
 
-%name-prefix="_gmx_sel_yy"
+%name-prefix "_gmx_sel_yy"
 %parse-param { void *scanner }
 
 %%
@@ -205,8 +205,10 @@ commands:    /* empty */
              {
                  BEGIN_ACTION;
                  set($$, _gmx_sel_append_selection(get($2), get($1), scanner));
-                 if (_gmx_sel_parser_should_finish(scanner))
+                 if (_gmx_sel_parser_should_finish(scanner)) {
+                     delete $$;
                      YYACCEPT;
+                 }
                  END_ACTION_TOPLEVEL;
              }
 ;
@@ -252,7 +254,7 @@ cmd_plain:   /* empty */
            | string
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree nameGuard($1);
+                 const sfree_guard nameGuard($1);
                  SelectionTreeElementPointer s
                         = _gmx_sel_init_group_by_name($1, scanner);
                  SelectionTreeElementPointer p
@@ -270,28 +272,28 @@ cmd_plain:   /* empty */
            | STR selection
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree nameGuard($1);
+                 const sfree_guard nameGuard($1);
                  set($$, _gmx_sel_init_selection($1, get($2), scanner));
                  END_ACTION;
              }
            | IDENTIFIER '=' sel_expr
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree nameGuard($1);
+                 const sfree_guard nameGuard($1);
                  set($$, _gmx_sel_assign_variable($1, get($3), scanner));
                  END_ACTION;
              }
            | IDENTIFIER '=' num_expr
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree nameGuard($1);
+                 const sfree_guard nameGuard($1);
                  set($$, _gmx_sel_assign_variable($1, get($3), scanner));
                  END_ACTION;
              }
            | IDENTIFIER '=' pos_expr
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree nameGuard($1);
+                 const sfree_guard nameGuard($1);
                  set($$, _gmx_sel_assign_variable($1, get($3), scanner));
                  END_ACTION;
              }
@@ -383,7 +385,7 @@ sel_expr:    NOT sel_expr
 sel_expr:    num_expr CMP_OP num_expr
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree opGuard($2);
+                 const sfree_guard opGuard($2);
                  set($$, _gmx_sel_init_comparison(get($1), get($3), $2, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -394,7 +396,7 @@ sel_expr:    num_expr CMP_OP num_expr
 sel_expr:    GROUP string
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree nameGuard($2);
+                 const sfree_guard nameGuard($2);
                  set($$, _gmx_sel_init_group_by_name($2, scanner));
                  END_ACTION;
              }
@@ -422,7 +424,7 @@ str_match_type:
 sel_expr:    pos_mod KEYWORD_GROUP
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard($1);
+                 const sfree_guard posmodGuard($1);
                  set($$, _gmx_sel_init_keyword($2, SelectionParserValueListPointer(), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -430,7 +432,7 @@ sel_expr:    pos_mod KEYWORD_GROUP
            | pos_mod KEYWORD_STR basic_value_list
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard($1);
+                 const sfree_guard posmodGuard($1);
                  set($$, _gmx_sel_init_keyword_strmatch($2, gmx::eStringMatchType_Auto, get($3), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -438,7 +440,7 @@ sel_expr:    pos_mod KEYWORD_GROUP
            | pos_mod KEYWORD_STR str_match_type basic_value_list
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard($1);
+                 const sfree_guard posmodGuard($1);
                  set($$, _gmx_sel_init_keyword_strmatch($2, $3, get($4), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -446,7 +448,7 @@ sel_expr:    pos_mod KEYWORD_GROUP
            | pos_mod KEYWORD_NUMERIC basic_value_list
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard($1);
+                 const sfree_guard posmodGuard($1);
                  set($$, _gmx_sel_init_keyword($2, get($3), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -457,7 +459,7 @@ sel_expr:    pos_mod KEYWORD_GROUP
 sel_expr:    pos_mod METHOD_GROUP method_params
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard($1);
+                 const sfree_guard posmodGuard($1);
                  set($$, _gmx_sel_init_method($2, get($3), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -497,7 +499,7 @@ num_expr:    TOK_INT
 num_expr:    pos_mod KEYWORD_NUMERIC    %prec NUM_REDUCT
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard($1);
+                 const sfree_guard posmodGuard($1);
                  set($$, _gmx_sel_init_keyword($2, SelectionParserValueListPointer(), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -505,7 +507,7 @@ num_expr:    pos_mod KEYWORD_NUMERIC    %prec NUM_REDUCT
            | pos_mod KEYWORD_NUMERIC OF pos_expr
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard($1);
+                 const sfree_guard posmodGuard($1);
                  set($$, _gmx_sel_init_keyword_of($2, get($4), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -513,7 +515,7 @@ num_expr:    pos_mod KEYWORD_NUMERIC    %prec NUM_REDUCT
            | pos_mod METHOD_NUMERIC method_params
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard($1);
+                 const sfree_guard posmodGuard($1);
                  set($$, _gmx_sel_init_method($2, get($3), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -578,7 +580,7 @@ str_expr:    string
            | pos_mod KEYWORD_STR
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree posmodGuard($1);
+                 const sfree_guard posmodGuard($1);
                  set($$, _gmx_sel_init_keyword($2, SelectionParserValueListPointer(), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -616,7 +618,7 @@ pos_expr:    METHOD_POS method_params
 pos_expr:    KEYWORD_POS OF sel_expr    %prec PARAM_REDUCT
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree keywordGuard($1);
+                 const sfree_guard keywordGuard($1);
                  set($$, _gmx_sel_init_position(get($3), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -683,7 +685,7 @@ method_param:
              PARAM value_list
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree nameGuard($1);
+                 const sfree_guard nameGuard($1);
                  set($$, SelectionParserParameter::create($1, get($2), @$));
                  END_ACTION;
              }
@@ -791,7 +793,7 @@ basic_value_item:
            | string              %prec PARAM_REDUCT
              {
                  BEGIN_ACTION;
-                 scoped_guard_sfree stringGuard($1);
+                 const sfree_guard stringGuard($1);
                  set($$, SelectionParserValue::createString($1, @$));
                  END_ACTION;
              }
index f351d787636060512b5c19cdeba6c51f5edd2da3..ee2fc570295eaf4f74e7bbd255f1e7b6d5f93cc9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * 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.
@@ -167,7 +167,7 @@ yyerror(YYLTYPE *location, yyscan_t scanner, char const *s)
 template <typename ValueType> static
 ValueType get(ValueType *src)
 {
-    GMX_RELEASE_ASSERT(src != NULL, "Semantic value pointers should be non-NULL");
+    GMX_RELEASE_ASSERT(src != nullptr, "Semantic value pointers should be non-NULL");
     const std::unique_ptr<ValueType> srcGuard(src);
     return ValueType(std::move(*src));
 }
index 4ca2010fe7d4380206c8bd237843e6a8fcc62b0b..2db9ae10357534a85ee32776ff65e88824d4a23f 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
@@ -282,10 +282,10 @@ _gmx_selparser_handle_exception(yyscan_t scanner, std::exception *ex)
         bool                   canContinue = false;
         gmx::GromacsException *gromacsException
             = dynamic_cast<gmx::GromacsException *>(ex);
-        if (gromacsException != NULL)
+        if (gromacsException != nullptr)
         {
             gromacsException->prependContext(formatCurrentErrorContext(scanner));
-            canContinue = (dynamic_cast<gmx::UserInputError *>(ex) != NULL);
+            canContinue = (dynamic_cast<gmx::UserInputError *>(ex) != nullptr);
         }
         _gmx_sel_lexer_set_exception(scanner, std::current_exception());
         return canContinue;
@@ -312,7 +312,7 @@ _gmx_selparser_handle_error(yyscan_t scanner)
         ex.prependContext(context);
         gmx::TextWriter *statusWriter
             = _gmx_sel_lexer_get_status_writer(scanner);
-        if (statusWriter != NULL)
+        if (statusWriter != nullptr)
         {
             gmx::formatExceptionMessageToWriter(statusWriter, ex);
             return true;
@@ -357,7 +357,7 @@ SelectionParserParameter::SelectionParserParameter(
         const char                      *name,
         SelectionParserValueListPointer  values,
         const SelectionLocation         &location)
-    : name_(name != NULL ? name : ""), location_(location),
+    : name_(name != nullptr ? name : ""), location_(location),
       values_(values ? std::move(values)
               : SelectionParserValueListPointer(new SelectionParserValueList))
 {
@@ -515,19 +515,19 @@ _gmx_selelem_init_method_params(const gmx::SelectionTreeElementPointer &sel,
     for (i = 0; i < nparams; ++i)
     {
         param[i].flags &= ~SPAR_SET;
-        _gmx_selvalue_setstore(&param[i].val, NULL);
+        _gmx_selvalue_setstore(&param[i].val, nullptr);
         if (param[i].flags & SPAR_VARNUM)
         {
             param[i].val.nr = -1;
         }
         /* Duplicate the enum value array if it is given statically */
-        if ((param[i].flags & SPAR_ENUMVAL) && orgparam[i].val.u.ptr != NULL)
+        if ((param[i].flags & SPAR_ENUMVAL) && orgparam[i].val.u.ptr != nullptr)
         {
             int n;
 
             /* Count the values */
             n = 1;
-            while (orgparam[i].val.u.s[n] != NULL)
+            while (orgparam[i].val.u.s[n] != nullptr)
             {
                 ++n;
             }
@@ -536,7 +536,7 @@ _gmx_selelem_init_method_params(const gmx::SelectionTreeElementPointer &sel,
                    (n+1)*sizeof(param[i].val.u.s[0]));
         }
     }
-    mdata = NULL;
+    mdata = nullptr;
     if (sel->u.expr.method->init_data)
     {
         mdata = sel->u.expr.method->init_data(nparams, param);
@@ -731,9 +731,9 @@ init_keyword_internal(gmx_ana_selmethod_t *method,
         }
         SelectionParserParameterList params;
         params.push_back(
-                SelectionParserParameter::createFromExpression(NULL, child));
+                SelectionParserParameter::createFromExpression(nullptr, child));
         params.push_back(
-                SelectionParserParameter::create(NULL, std::move(args), location));
+                SelectionParserParameter::create(nullptr, std::move(args), location));
         _gmx_sel_parse_params(params, root->u.expr.method->nparams,
                               root->u.expr.method->param, root, scanner);
     }
@@ -877,7 +877,7 @@ _gmx_sel_init_modifier(gmx_ana_selmethod_t                      *method,
     else
     {
         params->push_front(
-                SelectionParserParameter::createFromExpression(NULL, sel));
+                SelectionParserParameter::createFromExpression(nullptr, sel));
         root = modifier;
     }
     /* Process the parameters */
@@ -907,7 +907,7 @@ _gmx_sel_init_position(const gmx::SelectionTreeElementPointer &expr,
     _gmx_selelem_set_kwpos_type(root.get(), type);
     /* Create the parameters for the parameter parser. */
     SelectionParserParameterList params;
-    params.push_back(SelectionParserParameter::createFromExpression(NULL, expr));
+    params.push_back(SelectionParserParameter::createFromExpression(nullptr, expr));
     /* Parse the parameters. */
     _gmx_sel_parse_params(params, root->u.expr.method->nparams,
                           root->u.expr.method->param, root, scanner);
@@ -979,7 +979,7 @@ _gmx_sel_init_group_by_id(int id, yyscan_t scanner)
                     SEL_GROUPREF, _gmx_sel_lexer_get_current_location(scanner)));
     _gmx_selelem_set_vtype(sel, GROUP_VALUE);
     sel->setName(gmx::formatString("group %d", id));
-    sel->u.gref.name = NULL;
+    sel->u.gref.name = nullptr;
     sel->u.gref.id   = id;
 
     if (_gmx_sel_lexer_has_groups_set(scanner))
@@ -1064,7 +1064,7 @@ _gmx_sel_init_selection(const char                             *name,
 
     /* Print out some information if the parser is interactive */
     gmx::TextWriter *statusWriter = _gmx_sel_lexer_get_status_writer(scanner);
-    if (statusWriter != NULL)
+    if (statusWriter != nullptr)
     {
         const std::string message
             = gmx::formatString("Selection '%s' parsed",
@@ -1134,7 +1134,7 @@ _gmx_sel_assign_variable(const char                             *name,
     sc->varstrs[sc->nvars] = gmx_strdup(pselstr);
     ++sc->nvars;
     gmx::TextWriter *statusWriter = _gmx_sel_lexer_get_status_writer(scanner);
-    if (statusWriter != NULL)
+    if (statusWriter != nullptr)
     {
         const std::string message
             = gmx::formatString("Variable '%s' parsed", pselstr);
index dbc1229b900a9712973e60f9a6f3227b09e4257d..6617cd7859a32ab08f38536eb3f2d4ac2f9c3c53 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
@@ -151,7 +151,7 @@ class PositionCalculationCollection::Impl
          * Can be NULL if none of the calculations require topology data or if
          * setTopology() has not been called.
          */
-        t_topology               *top_;
+        const gmx_mtop_t         *top_;
         //! Pointer to the first data structure.
         gmx_ana_poscalc_t        *first_;
         //! Pointer to the last data structure.
@@ -244,7 +244,7 @@ const char * const gmx::PositionCalculationCollection::typeEnumValues[] = {
     "part_mol_com",  "part_mol_cog",
     "dyn_res_com",   "dyn_res_cog",
     "dyn_mol_com",   "dyn_mol_cog",
-    NULL,
+    nullptr,
 };
 
 /*! \brief
@@ -270,6 +270,29 @@ index_type_for_poscalc(e_poscalc_t type)
 namespace gmx
 {
 
+namespace
+{
+
+//! Helper function for determining required topology information.
+PositionCalculationCollection::RequiredTopologyInfo
+requiredTopologyInfo(e_poscalc_t type, int flags)
+{
+    if (type != POS_ATOM)
+    {
+        if ((flags & POS_MASS) || (flags & POS_FORCES))
+        {
+            return PositionCalculationCollection::RequiredTopologyInfo::TopologyAndMasses;
+        }
+        if (type == POS_RES || type == POS_MOL)
+        {
+            return PositionCalculationCollection::RequiredTopologyInfo::Topology;
+        }
+    }
+    return PositionCalculationCollection::RequiredTopologyInfo::None;
+}
+
+}   // namespace
+
 // static
 void
 PositionCalculationCollection::typeFromEnum(const char *post,
@@ -332,12 +355,23 @@ PositionCalculationCollection::typeFromEnum(const char *post,
     }
 }
 
+// static
+PositionCalculationCollection::RequiredTopologyInfo
+PositionCalculationCollection::requiredTopologyInfoForType(const char *post,
+                                                           bool        forces)
+{
+    e_poscalc_t  type;
+    int          flags = (forces ? POS_FORCES : 0);
+    PositionCalculationCollection::typeFromEnum(post, &type, &flags);
+    return requiredTopologyInfo(type, flags);
+}
+
 /********************************************************************
  * PositionCalculationCollection::Impl
  */
 
 PositionCalculationCollection::Impl::Impl()
-    : top_(NULL), first_(NULL), last_(NULL), bInit_(false)
+    : top_(nullptr), first_(nullptr), last_(nullptr), bInit_(false)
 {
 }
 
@@ -345,7 +379,7 @@ PositionCalculationCollection::Impl::~Impl()
 {
     // Loop backwards, because there can be internal references in that are
     // correctly handled by this direction.
-    while (last_ != NULL)
+    while (last_ != nullptr)
     {
         GMX_ASSERT(last_->refcount == 1,
                    "Dangling references to position calculations");
@@ -358,11 +392,11 @@ PositionCalculationCollection::Impl::insertCalculation(gmx_ana_poscalc_t *pc,
                                                        gmx_ana_poscalc_t *before)
 {
     GMX_RELEASE_ASSERT(pc->coll == this, "Inconsistent collections");
-    if (before == NULL)
+    if (before == nullptr)
     {
-        pc->next = NULL;
+        pc->next = nullptr;
         pc->prev = last_;
-        if (last_ != NULL)
+        if (last_ != nullptr)
         {
             last_->next = pc;
         }
@@ -378,7 +412,7 @@ PositionCalculationCollection::Impl::insertCalculation(gmx_ana_poscalc_t *pc,
         }
         before->prev = pc;
     }
-    if (pc->prev == NULL)
+    if (pc->prev == nullptr)
     {
         first_ = pc;
     }
@@ -388,7 +422,7 @@ void
 PositionCalculationCollection::Impl::removeCalculation(gmx_ana_poscalc_t *pc)
 {
     GMX_RELEASE_ASSERT(pc->coll == this, "Inconsistent collections");
-    if (pc->prev != NULL)
+    if (pc->prev != nullptr)
     {
         pc->prev->next = pc->next;
     }
@@ -396,7 +430,7 @@ PositionCalculationCollection::Impl::removeCalculation(gmx_ana_poscalc_t *pc)
     {
         first_ = pc->next;
     }
-    if (pc->next != NULL)
+    if (pc->next != nullptr)
     {
         pc->next->prev = pc->prev;
     }
@@ -404,7 +438,7 @@ PositionCalculationCollection::Impl::removeCalculation(gmx_ana_poscalc_t *pc)
     {
         last_ = pc->prev;
     }
-    pc->prev = pc->next = NULL;
+    pc->prev = pc->next = nullptr;
 }
 
 gmx_ana_poscalc_t *
@@ -418,7 +452,7 @@ PositionCalculationCollection::Impl::createCalculation(e_poscalc_t type, int fla
     gmx_ana_poscalc_set_flags(pc, flags);
     pc->refcount = 1;
     pc->coll     = this;
-    insertCalculation(pc, NULL);
+    insertCalculation(pc, nullptr);
     return pc;
 }
 
@@ -437,7 +471,7 @@ PositionCalculationCollection::~PositionCalculationCollection()
 }
 
 void
-PositionCalculationCollection::setTopology(t_topology *top)
+PositionCalculationCollection::setTopology(const gmx_mtop_t *top)
 {
     impl_->top_ = top;
 }
@@ -702,7 +736,7 @@ void PositionCalculationCollection::initFrame(const t_trxframe *fr)
 static void
 set_poscalc_maxindex(gmx_ana_poscalc_t *pc, gmx_ana_index_t *g, bool bBase)
 {
-    t_topology *top = pc->coll->top_;
+    const gmx_mtop_t *top = pc->coll->top_;
     gmx_ana_index_make_block(&pc->b, top, g, pc->itype, pc->flags & POS_COMPLWHOLE);
     /* Set the type to POS_ATOM if the calculation in fact is such. */
     if (pc->b.nr == pc->b.nra)
@@ -1161,20 +1195,10 @@ gmx_ana_poscalc_free(gmx_ana_poscalc_t *pc)
     sfree(pc);
 }
 
-/*!
- * \param[in] pc  Position calculation data to query.
- * \returns   true if \p pc requires topology for initialization and/or
- *   evaluation, false otherwise.
- */
-bool
-gmx_ana_poscalc_requires_top(gmx_ana_poscalc_t *pc)
+gmx::PositionCalculationCollection::RequiredTopologyInfo
+gmx_ana_poscalc_required_topology_info(gmx_ana_poscalc_t *pc)
 {
-    if ((pc->flags & POS_MASS) || pc->type == POS_RES || pc->type == POS_MOL
-        || ((pc->flags & POS_FORCES) && pc->type != POS_ATOM))
-    {
-        return true;
-    }
-    return false;
+    return gmx::requiredTopologyInfo(pc->type, pc->flags);
 }
 
 /*!
@@ -1190,7 +1214,7 @@ gmx_ana_poscalc_requires_top(gmx_ana_poscalc_t *pc)
  */
 void
 gmx_ana_poscalc_update(gmx_ana_poscalc_t *pc, gmx_ana_pos_t *p,
-                       gmx_ana_index_t *g, t_trxframe *fr, t_pbc *pbc)
+                       gmx_ana_index_t *g, t_trxframe *fr, const t_pbc *pbc)
 {
     int  i, bi, bj;
 
@@ -1200,7 +1224,7 @@ gmx_ana_poscalc_update(gmx_ana_poscalc_t *pc, gmx_ana_pos_t *p,
     }
     if (pc->sbase)
     {
-        gmx_ana_poscalc_update(pc->sbase, NULL, NULL, fr, pbc);
+        gmx_ana_poscalc_update(pc->sbase, nullptr, nullptr, fr, pbc);
     }
     if (!p)
     {
@@ -1307,7 +1331,7 @@ gmx_ana_poscalc_update(gmx_ana_poscalc_t *pc, gmx_ana_pos_t *p,
             }
         }
         gmx::ConstArrayRef<int> index = pc->coll->getFrameIndices(pc->b.nra, pc->b.a);
-        const t_topology       *top   = pc->coll->top_;
+        const gmx_mtop_t       *top   = pc->coll->top_;
         const bool              bMass = pc->flags & POS_MASS;
         switch (pc->type)
         {
index eef4f00211e8a81320c48d190ae59d986181b164..e37628dea0fb28efeedde4accbb33cc37152853d 100644 (file)
@@ -131,8 +131,8 @@ struct gmx_ana_poscalc_t;
 
 struct gmx_ana_index_t;
 struct gmx_ana_pos_t;
+struct gmx_mtop_t;
 struct t_pbc;
-struct t_topology;
 struct t_trxframe;
 
 namespace gmx
@@ -178,6 +178,14 @@ namespace gmx
 class PositionCalculationCollection
 {
     public:
+        //! Describes what topology information is needed for position calculation.
+        enum class RequiredTopologyInfo
+        {
+            None,              //!< No topology is needed.
+            Topology,          //!< Topology is needed (residue/molecule info).
+            TopologyAndMasses  //!< Masses are needed.
+        };
+
         /*! \brief
          * Array of strings acceptable for position calculation type enum.
          *
@@ -210,6 +218,15 @@ class PositionCalculationCollection
          * \see typeEnumValues
          */
         static void typeFromEnum(const char *post, e_poscalc_t *type, int *flags);
+        /*! \brief
+         * Returns what information is needed for position evaluation.
+         *
+         * \param[in] post   Position type (see typeFromEnum()).
+         * \param[in] forces Whether forces are needed.
+         * \returns   What topology information is required for initializing
+         *     and/or evaluating the positions.
+         */
+        static RequiredTopologyInfo requiredTopologyInfoForType(const char *post, bool forces);
 
         /*! \brief
          * Creates a new position calculation collection object.
@@ -236,7 +253,7 @@ class PositionCalculationCollection
          *
          * Does not throw.
          */
-        void setTopology(t_topology *top);
+        void setTopology(const gmx_mtop_t *top);
         /*! \brief
          * Prints information about calculations.
          *
@@ -344,14 +361,20 @@ gmx_ana_poscalc_init_pos(gmx_ana_poscalc_t *pc, gmx_ana_pos_t *p);
 /** Frees the memory allocated for position calculation. */
 void
 gmx_ana_poscalc_free(gmx_ana_poscalc_t *pc);
-/** Returns true if the position calculation requires topology information. */
-bool
-gmx_ana_poscalc_requires_top(gmx_ana_poscalc_t *pc);
+/*! \brief
+ * Returns true if the position calculation requires topology information.
+ *
+ * \param[in] pc  Position calculation data to query.
+ * \returns   Which topology information \p pc requires for initialization
+ *     and/or evaluation.
+ */
+gmx::PositionCalculationCollection::RequiredTopologyInfo
+gmx_ana_poscalc_required_topology_info(gmx_ana_poscalc_t *pc);
 
 /** Updates a single COM/COG structure for a frame. */
 void
 gmx_ana_poscalc_update(gmx_ana_poscalc_t *pc,
                        gmx_ana_pos_t *p, gmx_ana_index_t *g,
-                       t_trxframe *fr, t_pbc *pbc);
+                       t_trxframe *fr, const t_pbc *pbc);
 
 #endif
index 1315d94aaea8450357fb3bf72a78707990e0b814..0e0499c98d0b79d0a7e4f8e41ffd7b8a202527e7 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,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.
@@ -52,9 +52,9 @@
 
 gmx_ana_pos_t::gmx_ana_pos_t()
 {
-    x = NULL;
-    v = NULL;
-    f = NULL;
+    x = nullptr;
+    v = nullptr;
+    f = nullptr;
     gmx_ana_indexmap_clear(&m);
     nalloc_x = 0;
 }
@@ -183,7 +183,7 @@ gmx_ana_pos_init_const(gmx_ana_pos_t *pos, const rvec x)
     copy_rvec(x, pos->x[0]);
     clear_rvec(pos->v[0]);
     clear_rvec(pos->f[0]);
-    gmx_ana_indexmap_init(&pos->m, NULL, NULL, INDEX_UNKNOWN);
+    gmx_ana_indexmap_init(&pos->m, nullptr, nullptr, INDEX_UNKNOWN);
 }
 
 /*!
index c16a479a6793abca29797c07e961632832fd5963..0f506f14d4a6481e960c3bdafded2c54fc9fb077 100644 (file)
@@ -569,11 +569,16 @@ static yyconst flex_int16_t yy_chk[151] =
 // when we have return statements followed by break. Instead, we add breaks
 // manually.
 #define YY_BREAK
+
+#ifdef __INTEL_COMPILER
+// Ignore unused variables in generated code.
+#pragma warning(disable:593)
+#endif
 #define YY_NO_UNISTD_H 1
 
 
 
-#line 577 "scanner.cpp"
+#line 582 "scanner.cpp"
 
 #define INITIAL 0
 #define matchof 1
@@ -837,7 +842,7 @@ YY_DECL
                }
 
        {
-#line 99 "scanner.l"
+#line 104 "scanner.l"
 
 
 
@@ -871,7 +876,7 @@ YY_DECL
     }
 
 
-#line 875 "scanner.cpp"
+#line 880 "scanner.cpp"
 
        while ( /*CONSTCOND*/1 )                /* loops until end-of-file is reached */
                {
@@ -926,34 +931,34 @@ do_action:        /* This label is used only to access EOF actions. */
 
 case 1:
 YY_RULE_SETUP
-#line 132 "scanner.l"
+#line 137 "scanner.l"
 break;
        YY_BREAK
 case 2:
 YY_RULE_SETUP
-#line 133 "scanner.l"
+#line 138 "scanner.l"
 { yylval->i   = strtol(yytext, NULL, 10);    ADD_TOKEN; return TOK_INT; }
        YY_BREAK
 case 3:
 YY_RULE_SETUP
-#line 134 "scanner.l"
+#line 139 "scanner.l"
 { yylval->r   = strtod(yytext, NULL);        ADD_TOKEN; return TOK_REAL; }
        YY_BREAK
 case 4:
 YY_RULE_SETUP
-#line 135 "scanner.l"
+#line 140 "scanner.l"
 { yylval->str = gmx_strndup(yytext+1, yyleng-2); ADD_TOKEN; return STR;  }
        YY_BREAK
 case 5:
 /* rule 5 can match eol */
 YY_RULE_SETUP
-#line 137 "scanner.l"
+#line 142 "scanner.l"
 { _gmx_sel_lexer_add_token(yylloc, " ", 1, state); break; }
        YY_BREAK
 case 6:
 /* rule 6 can match eol */
 YY_RULE_SETUP
-#line 138 "scanner.l"
+#line 143 "scanner.l"
 {
                     if (yytext[0] == ';' || state->statusWriter != NULL)
                     {
@@ -969,94 +974,94 @@ YY_RULE_SETUP
                 }
        YY_BREAK
 case YY_STATE_EOF(cmdstart):
-#line 152 "scanner.l"
+#line 157 "scanner.l"
 { state->bCmdStart = true; yyterminate(); }
        YY_BREAK
 case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(matchof):
 case YY_STATE_EOF(matchbool):
-#line 153 "scanner.l"
+#line 158 "scanner.l"
 { state->bCmdStart = true; return CMD_SEP; }
        YY_BREAK
 
 case 7:
 YY_RULE_SETUP
-#line 156 "scanner.l"
+#line 161 "scanner.l"
 { ADD_TOKEN; yylval->i = 1; return TOK_INT; }
        YY_BREAK
 case 8:
 YY_RULE_SETUP
-#line 157 "scanner.l"
+#line 162 "scanner.l"
 { ADD_TOKEN; yylval->i = 0; return TOK_INT; }
        YY_BREAK
 
 case 9:
 YY_RULE_SETUP
-#line 159 "scanner.l"
+#line 164 "scanner.l"
 { ADD_TOKEN; return GROUP; }
        YY_BREAK
 case 10:
 YY_RULE_SETUP
-#line 160 "scanner.l"
+#line 165 "scanner.l"
 { ADD_TOKEN; return TO; }
        YY_BREAK
 case 11:
 YY_RULE_SETUP
-#line 161 "scanner.l"
+#line 166 "scanner.l"
 { ADD_TOKEN; BEGIN(0); return OF; }
        YY_BREAK
 case 12:
 YY_RULE_SETUP
-#line 162 "scanner.l"
+#line 167 "scanner.l"
 { ADD_TOKEN; return AND; }
        YY_BREAK
 case 13:
 YY_RULE_SETUP
-#line 163 "scanner.l"
+#line 168 "scanner.l"
 { ADD_TOKEN; return OR; }
        YY_BREAK
 case 14:
 YY_RULE_SETUP
-#line 164 "scanner.l"
+#line 169 "scanner.l"
 { ADD_TOKEN; return XOR; }
        YY_BREAK
 case 15:
 YY_RULE_SETUP
-#line 165 "scanner.l"
+#line 170 "scanner.l"
 { ADD_TOKEN; return NOT; }
        YY_BREAK
 case 16:
 YY_RULE_SETUP
-#line 166 "scanner.l"
+#line 171 "scanner.l"
 { yylval->str = gmx_strndup(yytext, yyleng); ADD_TOKEN; return CMP_OP; }
        YY_BREAK
 case 17:
 YY_RULE_SETUP
-#line 168 "scanner.l"
+#line 173 "scanner.l"
 { return _gmx_sel_lexer_process_identifier(yylval, yylloc, yytext, yyleng, state); }
        YY_BREAK
 case 18:
 /* rule 18 can match eol */
 YY_RULE_SETUP
-#line 170 "scanner.l"
+#line 175 "scanner.l"
 { _gmx_sel_lexer_add_token(yylloc, " ", 1, state); break; }
        YY_BREAK
 case 19:
 YY_RULE_SETUP
-#line 171 "scanner.l"
+#line 176 "scanner.l"
 { yylval->str = gmx_strndup(yytext, yyleng); ADD_TOKEN; return STR; }
        YY_BREAK
 case 20:
 YY_RULE_SETUP
-#line 172 "scanner.l"
+#line 177 "scanner.l"
 { ADD_TOKEN; return yytext[0]; }
        YY_BREAK
 case 21:
 YY_RULE_SETUP
-#line 173 "scanner.l"
+#line 178 "scanner.l"
 YY_FATAL_ERROR( "flex scanner jammed" );
        YY_BREAK
-#line 1060 "scanner.cpp"
+#line 1065 "scanner.cpp"
 
        case YY_END_OF_BUFFER:
                {
@@ -2224,4 +2229,4 @@ void _gmx_sel_yyfree (void * ptr , yyscan_t yyscanner)
 
 #define YYTABLES_NAME "yytables"
 
-#line 173 "scanner.l"
+#line 178 "scanner.l"
index 2c03a33e4278e4bbb7956e6d5524ffabd047f823..105250f2d4711ca117109cb66f6894baff99c0db 100644 (file)
 // when we have return statements followed by break. Instead, we add breaks
 // manually.
 #define YY_BREAK
+
+#ifdef __INTEL_COMPILER
+// Ignore unused variables in generated code.
+#pragma warning(disable:593)
+#endif
 %}
 
 INTEGER    [[:digit:]]+
index 0e23931895812e50d6d941e92514385b5f4a781b..14d3030508e30446a5df94834a9bda7f9531da50 100644 (file)
@@ -357,7 +357,7 @@ extern int _gmx_sel_yylex (yyscan_t yyscanner);
 #undef YY_DECL
 #endif
 
-#line 173 "scanner.l"
+#line 178 "scanner.l"
 
 #line 363 "scanner_flex.h"
 #undef _gmx_sel_yyIN_HEADER
index da23df0453793912170321553d18f15f6a85221a..5ff51acdf41dbeab4e08c7455c37571f71646553 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,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.
@@ -89,7 +89,7 @@ init_param_token(YYSTYPE *yylval, gmx_ana_selparam_t *param, bool bBoolNo)
 {
     if (bBoolNo)
     {
-        GMX_RELEASE_ASSERT(param->name != NULL,
+        GMX_RELEASE_ASSERT(param->name != nullptr,
                            "bBoolNo should only be set for a parameters with a name");
         snew(yylval->str, strlen(param->name) + 3);
         yylval->str[0] = 'n';
@@ -98,7 +98,7 @@ init_param_token(YYSTYPE *yylval, gmx_ana_selparam_t *param, bool bBoolNo)
     }
     else
     {
-        yylval->str = param->name ? gmx_strdup(param->name) : NULL;
+        yylval->str = param->name ? gmx_strdup(param->name) : nullptr;
     }
     return PARAM;
 }
@@ -117,7 +117,7 @@ init_method_token(YYSTYPE *yylval, YYLTYPE *yylloc,
     if (!bPosMod && method->type != POS_VALUE)
     {
         state->nextMethodSymbol = symbol;
-        _gmx_sel_lexer_add_token(yylloc, NULL, 0, state);
+        _gmx_sel_lexer_add_token(yylloc, nullptr, 0, state);
         return EMPTY_POSMOD;
     }
     _gmx_sel_lexer_add_token(yylloc, symbol->name().c_str(), -1, state);
@@ -144,14 +144,14 @@ init_method_token(YYSTYPE *yylval, YYLTYPE *yylloc,
         {
             /* Remove all methods from the stack */
             state->msp = -1;
-            if (method->param[1].name == NULL)
+            if (method->param[1].name == nullptr)
             {
                 state->nextparam = &method->param[1];
             }
         }
         else
         {
-            if (method->param[0].name == NULL)
+            if (method->param[0].name == nullptr)
             {
                 state->nextparam = &method->param[0];
             }
@@ -193,10 +193,10 @@ _gmx_sel_lexer_process_pending(YYSTYPE *yylval, YYLTYPE *yylloc,
         if (state->neom > 0)
         {
             --state->neom;
-            _gmx_sel_lexer_add_token(yylloc, NULL, 0, state);
+            _gmx_sel_lexer_add_token(yylloc, nullptr, 0, state);
             return END_OF_METHOD;
         }
-        state->nextparam = NULL;
+        state->nextparam = nullptr;
         state->bBoolNo   = false;
         _gmx_sel_lexer_add_token(yylloc, param->name, -1, state);
         return init_param_token(yylval, param, bBoolNo);
@@ -208,7 +208,7 @@ _gmx_sel_lexer_process_pending(YYSTYPE *yylval, YYLTYPE *yylloc,
     if (state->nextMethodSymbol)
     {
         const gmx::SelectionParserSymbol *symbol = state->nextMethodSymbol;
-        state->nextMethodSymbol = NULL;
+        state->nextMethodSymbol = nullptr;
         return init_method_token(yylval, yylloc, symbol, true, state);
     }
     return 0;
@@ -222,7 +222,7 @@ _gmx_sel_lexer_process_identifier(YYSTYPE *yylval, YYLTYPE *yylloc,
     /* Check if the identifier matches with a parameter name */
     if (state->msp >= 0)
     {
-        gmx_ana_selparam_t *param   = NULL;
+        gmx_ana_selparam_t *param   = nullptr;
         bool                bBoolNo = false;
         int                 sp      = state->msp;
         while (!param && sp >= 0)
@@ -231,7 +231,7 @@ _gmx_sel_lexer_process_identifier(YYSTYPE *yylval, YYLTYPE *yylloc,
             for (i = 0; i < state->mstack[sp]->nparams; ++i)
             {
                 /* Skip NULL parameters and too long parameters */
-                if (state->mstack[sp]->param[i].name == NULL
+                if (state->mstack[sp]->param[i].name == nullptr
                     || strlen(state->mstack[sp]->param[i].name) > yyleng)
                 {
                     continue;
@@ -400,8 +400,8 @@ _gmx_sel_init_lexer(yyscan_t *scannerp, struct gmx_ana_selcollection_t *sc,
     state->mstack_alloc     = 20;
     state->msp              = -1;
     state->neom             = 0;
-    state->nextparam        = NULL;
-    state->nextMethodSymbol = NULL;
+    state->nextparam        = nullptr;
+    state->nextMethodSymbol = nullptr;
     state->prev_pos_kw      = 0;
     state->bBoolNo          = false;
     state->bMatchOf         = false;
index 0b642b5ba9c66d2d0651d6c500966bb486a2f321..3032cf58aea60edcb8567b5c68e483e088f6078b 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
@@ -47,6 +47,7 @@
 
 #include "gromacs/selection/nbsearch.h"
 #include "gromacs/selection/position.h"
+#include "gromacs/topology/mtop_lookup.h"
 #include "gromacs/topology/topology.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
@@ -160,22 +161,24 @@ namespace
  *
  * Does not throw if enough space has been reserved for the output vectors.
  */
-void computeMassesAndCharges(const t_topology *top, const gmx_ana_pos_t &pos,
+void computeMassesAndCharges(const gmx_mtop_t *top, const gmx_ana_pos_t &pos,
                              std::vector<real> *masses,
                              std::vector<real> *charges)
 {
     GMX_ASSERT(top != NULL, "Should not have been called with NULL topology");
     masses->clear();
     charges->clear();
+    int molb = 0;
     for (int b = 0; b < pos.count(); ++b)
     {
         real mass   = 0.0;
         real charge = 0.0;
         for (int i = pos.m.mapb.index[b]; i < pos.m.mapb.index[b+1]; ++i)
         {
-            const int index = pos.m.mapb.a[i];
-            mass   += top->atoms.atom[index].m;
-            charge += top->atoms.atom[index].q;
+            const int     index  = pos.m.mapb.a[i];
+            const t_atom &atom   = mtopGetAtomParameters(top, index, &molb);
+            mass                += atom.m;
+            charge              += atom.q;
         }
         masses->push_back(mass);
         charges->push_back(charge);
@@ -200,13 +203,13 @@ SelectionData::refreshName()
 }
 
 void
-SelectionData::initializeMassesAndCharges(const t_topology *top)
+SelectionData::initializeMassesAndCharges(const gmx_mtop_t *top)
 {
     GMX_ASSERT(posMass_.empty() && posCharge_.empty(),
                "Should not be called more than once");
     posMass_.reserve(posCount());
     posCharge_.reserve(posCount());
-    if (top == NULL)
+    if (top == nullptr)
     {
         posMass_.resize(posCount(), 1.0);
         posCharge_.resize(posCount(), 0.0);
@@ -219,9 +222,9 @@ SelectionData::initializeMassesAndCharges(const t_topology *top)
 
 
 void
-SelectionData::refreshMassesAndCharges(const t_topology *top)
+SelectionData::refreshMassesAndCharges(const gmx_mtop_t *top)
 {
-    if (top != NULL && isDynamic() && !hasFlag(efSelection_DynamicMask))
+    if (top != nullptr && isDynamic() && !hasFlag(efSelection_DynamicMask))
     {
         computeMassesAndCharges(top, rawPositions_, &posMass_, &posCharge_);
     }
@@ -251,7 +254,7 @@ SelectionData::computeAverageCoveredFraction(int nframes)
 
 
 void
-SelectionData::restoreOriginalPositions(const t_topology *top)
+SelectionData::restoreOriginalPositions(const gmx_mtop_t *top)
 {
     if (isDynamic())
     {
@@ -289,7 +292,7 @@ Selection::setOriginalId(int i, int id)
 
 
 int
-Selection::initOriginalIdsToGroup(t_topology *top, e_index_t type)
+Selection::initOriginalIdsToGroup(const gmx_mtop_t *top, e_index_t type)
 {
     try
     {
index 47d8a40e45abdbe952ab982690c64653fa78b1a9..3ff3dadeff0cd1eac98c20475ae44c6feff2c162 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
@@ -52,7 +52,7 @@
 #include "gromacs/utility/classhelpers.h"
 #include "gromacs/utility/gmxassert.h"
 
-struct t_topology;
+struct gmx_mtop_t;
 
 namespace gmx
 {
@@ -150,7 +150,7 @@ class SelectionData
          *
          * Strong exception safety guarantee.
          */
-        void initializeMassesAndCharges(const t_topology *top);
+        void initializeMassesAndCharges(const gmx_mtop_t *top);
         /*! \brief
          * Updates masses and charges after dynamic selection has been
          * evaluated.
@@ -159,7 +159,7 @@ class SelectionData
          *
          * Called by SelectionEvaluator.
          */
-        void refreshMassesAndCharges(const t_topology *top);
+        void refreshMassesAndCharges(const gmx_mtop_t *top);
         /*! \brief
          * Updates the covered fraction after a selection has been evaluated.
          *
@@ -185,7 +185,7 @@ class SelectionData
          * \a rootElement_ object.
          * Called by SelectionEvaluator::evaluateFinal().
          */
-        void restoreOriginalPositions(const t_topology *top);
+        void restoreOriginalPositions(const gmx_mtop_t *top);
 
     private:
         //! Name of the selection.
@@ -294,7 +294,7 @@ class Selection
          * assigned results in undefined behavior.
          * isValid() returns `false` for the selection until it is initialized.
          */
-        Selection() : sel_(NULL) {}
+        Selection() : sel_(nullptr) {}
         /*! \brief
          * Creates a new selection object.
          *
@@ -305,7 +305,7 @@ class Selection
         explicit Selection(internal::SelectionData *sel) : sel_(sel) {}
 
         //! Returns whether the selection object is initialized.
-        bool isValid() const { return sel_ != NULL; }
+        bool isValid() const { return sel_ != nullptr; }
 
         //! Returns whether two selection objects wrap the same selection.
         bool operator==(const Selection &other) const
@@ -352,7 +352,7 @@ class Selection
             return constArrayRefFromArray(data().rawPositions_.x, posCount());
         }
         //! Returns whether velocities are available for this selection.
-        bool hasVelocities() const { return data().rawPositions_.v != NULL; }
+        bool hasVelocities() const { return data().rawPositions_.v != nullptr; }
         /*! \brief
          * Returns velocities for this selection as a continuous array.
          *
@@ -364,7 +364,7 @@ class Selection
             return constArrayRefFromArray(data().rawPositions_.v, posCount());
         }
         //! Returns whether forces are available for this selection.
-        bool hasForces() const { return sel_->rawPositions_.f != NULL; }
+        bool hasForces() const { return sel_->rawPositions_.f != nullptr; }
         /*! \brief
          * Returns forces for this selection as a continuous array.
          *
@@ -532,7 +532,7 @@ class Selection
          * \see setOriginalId()
          * \see SelectionPosition::mappedId()
          */
-        int initOriginalIdsToGroup(t_topology *top, e_index_t type);
+        int initOriginalIdsToGroup(const gmx_mtop_t *top, e_index_t type);
 
         /*! \brief
          * Prints out one-line description of the selection.
@@ -691,7 +691,7 @@ class SelectionPosition
         ConstArrayRef<int> atomIndices() const
         {
             const int *atoms = sel_->rawPositions_.m.mapb.a;
-            if (atoms == NULL)
+            if (atoms == nullptr)
             {
                 return ConstArrayRef<int>();
             }
index b3280bfedc09a4f16066cc08fc9075c452b8c7c0..56d62fc327ca7e8be7112e6b14194bac8582df9a 100644 (file)
@@ -57,9 +57,9 @@
 #include "poscalc.h"
 #include "selelem.h"
 
+struct gmx_mtop_t;
 struct gmx_sel_mempool_t;
 struct t_pbc;
-struct t_topology;
 struct t_trxframe;
 
 namespace gmx
@@ -71,6 +71,7 @@ typedef std::unique_ptr<internal::SelectionData> SelectionDataPointer;
 typedef std::vector<SelectionDataPointer> SelectionDataList;
 
 class SelectionParserSymbolTable;
+struct SelectionTopologyProperties;
 
 } // namespace gmx
 
@@ -99,7 +100,7 @@ struct gmx_ana_selcollection_t
     char                         **varstrs;
 
     /** Topology for the collection. */
-    t_topology                                        *top;
+    const gmx_mtop_t                                  *top;
     /** Index group that contains all the atoms. */
     gmx_ana_index_t                                    gall;
     /** Memory pool used for selection evaluation. */
@@ -154,6 +155,15 @@ class SelectionCollection::Impl
         void resolveExternalGroups(const gmx::SelectionTreeElementPointer &root,
                                    ExceptionInitializer                   *errors);
 
+        //! Whether forces have been requested for some selection.
+        bool areForcesRequested() const;
+        /*! \brief
+         * Returns topology properties needed for a certain position type.
+         */
+        SelectionTopologyProperties
+        requiredTopologyPropertiesForPositionType(const std::string &post,
+                                                  bool               forces) const;
+
         //! Internal data, used for interfacing with old C code.
         gmx_ana_selcollection_t sc_;
         //! Default reference position type for selections.
index 23fb458901e7c4db871a8d9ab67d5dde92a943c2..7b9b17073d9a99caad2e6f42c57d1343842f72d0 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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -56,6 +56,7 @@
 #include "gromacs/options/ioptionscontainer.h"
 #include "gromacs/selection/selection.h"
 #include "gromacs/selection/selhelp.h"
+#include "gromacs/topology/mtop_util.h"
 #include "gromacs/topology/topology.h"
 #include "gromacs/trajectory/trajectoryframe.h"
 #include "gromacs/utility/exceptions.h"
@@ -83,13 +84,13 @@ namespace gmx
  */
 
 SelectionCollection::Impl::Impl()
-    : debugLevel_(0), bExternalGroupsSet_(false), grps_(NULL)
+    : debugLevel_(0), bExternalGroupsSet_(false), grps_(nullptr)
 {
     sc_.nvars     = 0;
-    sc_.varstrs   = NULL;
-    sc_.top       = NULL;
+    sc_.varstrs   = nullptr;
+    sc_.top       = nullptr;
     gmx_ana_index_clear(&sc_.gall);
-    sc_.mempool   = NULL;
+    sc_.mempool   = nullptr;
     sc_.symtab.reset(new SelectionParserSymbolTable);
     gmx_ana_index_clear(&requiredAtoms_);
     gmx_ana_selmethod_register_defaults(sc_.symtab.get());
@@ -140,7 +141,7 @@ namespace
 bool promptLine(TextInputStream *inputStream, TextWriter *statusWriter,
                 std::string *line)
 {
-    if (statusWriter != NULL)
+    if (statusWriter != nullptr)
     {
         statusWriter->writeString("> ");
     }
@@ -151,7 +152,7 @@ bool promptLine(TextInputStream *inputStream, TextWriter *statusWriter,
     while (endsWith(*line, "\\\n"))
     {
         line->resize(line->length() - 2);
-        if (statusWriter != NULL)
+        if (statusWriter != nullptr)
         {
             statusWriter->writeString("... ");
         }
@@ -165,7 +166,7 @@ bool promptLine(TextInputStream *inputStream, TextWriter *statusWriter,
     {
         line->resize(line->length() - 1);
     }
-    else if (statusWriter != NULL)
+    else if (statusWriter != nullptr)
     {
         statusWriter->writeLine();
     }
@@ -222,7 +223,7 @@ void printCurrentStatus(TextWriter *writer, gmx_ana_selcollection_t *sc,
                         gmx_ana_indexgrps_t *grps, size_t firstSelection,
                         int maxCount, const std::string &context, bool bFirst)
 {
-    if (grps != NULL)
+    if (grps != nullptr)
     {
         writer->writeLine("Available static index groups:");
         gmx_ana_indexgrps_print(writer, grps, 0);
@@ -283,7 +284,7 @@ void printCurrentStatus(TextWriter *writer, gmx_ana_selcollection_t *sc,
 void printHelp(TextWriter *writer, gmx_ana_selcollection_t *sc,
                const std::string &line)
 {
-    if (sc->rootHelp.get() == NULL)
+    if (sc->rootHelp.get() == nullptr)
     {
         sc->rootHelp = createSelectionHelpTopic();
     }
@@ -340,7 +341,7 @@ SelectionList runParser(yyscan_t scanner, TextInputStream *inputStream,
         if (bInteractive)
         {
             TextWriter *statusWriter = _gmx_sel_lexer_get_status_writer(scanner);
-            if (statusWriter != NULL)
+            if (statusWriter != nullptr)
             {
                 printCurrentStatus(statusWriter, sc, grps, oldCount, maxnr, context, true);
             }
@@ -348,7 +349,7 @@ SelectionList runParser(yyscan_t scanner, TextInputStream *inputStream,
             int         status;
             while (promptLine(inputStream, statusWriter, &line))
             {
-                if (statusWriter != NULL)
+                if (statusWriter != nullptr)
                 {
                     line = stripString(line);
                     if (line.empty())
@@ -375,7 +376,7 @@ SelectionList runParser(yyscan_t scanner, TextInputStream *inputStream,
             }
             {
                 YYLTYPE location;
-                status = _gmx_sel_yypush_parse(parserState.get(), 0, NULL,
+                status = _gmx_sel_yypush_parse(parserState.get(), 0, nullptr,
                                                &location, scanner);
             }
             // TODO: Remove added selections from the collection if parsing failed?
@@ -406,7 +407,7 @@ early_termination:
     result.reserve(nr);
     for (i = sc->sel.begin() + oldCount; i != sc->sel.end(); ++i)
     {
-        result.push_back(Selection(i->get()));
+        result.emplace_back(i->get());
     }
     return result;
 }
@@ -449,6 +450,24 @@ void checkExternalGroups(const SelectionTreeElementPointer &root,
     }
 }
 
+//! Checks whether the given topology properties are available.
+void checkTopologyProperties(const gmx_mtop_t                  *top,
+                             const SelectionTopologyProperties &props)
+{
+    if (top == nullptr)
+    {
+        if (props.hasAny())
+        {
+            GMX_THROW(InconsistentInputError("Selection requires topology information, but none provided"));
+        }
+        return;
+    }
+    if (props.needsMasses && !gmx_mtop_has_masses(top))
+    {
+        GMX_THROW(InconsistentInputError("Selection requires mass information, but it is not available in the topology"));
+    }
+}
+
 }   // namespace
 
 
@@ -479,6 +498,42 @@ void SelectionCollection::Impl::resolveExternalGroups(
 }
 
 
+bool SelectionCollection::Impl::areForcesRequested() const
+{
+    for (const auto &sel : sc_.sel)
+    {
+        if (sel->hasFlag(gmx::efSelection_EvaluateForces))
+        {
+            return true;
+        }
+    }
+    return false;
+}
+
+
+SelectionTopologyProperties
+SelectionCollection::Impl::requiredTopologyPropertiesForPositionType(
+        const std::string &post, bool forces) const
+{
+    SelectionTopologyProperties props;
+    if (!post.empty())
+    {
+        switch (PositionCalculationCollection::requiredTopologyInfoForType(post.c_str(), forces))
+        {
+            case PositionCalculationCollection::RequiredTopologyInfo::None:
+                break;
+            case PositionCalculationCollection::RequiredTopologyInfo::Topology:
+                props.merge(SelectionTopologyProperties::topology());
+                break;
+            case PositionCalculationCollection::RequiredTopologyInfo::TopologyAndMasses:
+                props.merge(SelectionTopologyProperties::masses());
+                break;
+        }
+    }
+    return props;
+}
+
+
 /********************************************************************
  * SelectionCollection
  */
@@ -528,7 +583,7 @@ SelectionCollection::initOptions(IOptionsContainer   *options,
 void
 SelectionCollection::setReferencePosType(const char *type)
 {
-    GMX_RELEASE_ASSERT(type != NULL, "Cannot assign NULL position type");
+    GMX_RELEASE_ASSERT(type != nullptr, "Cannot assign NULL position type");
     // Check that the type is valid, throw if it is not.
     e_poscalc_t  dummytype;
     int          dummyflags;
@@ -540,7 +595,7 @@ SelectionCollection::setReferencePosType(const char *type)
 void
 SelectionCollection::setOutputPosType(const char *type)
 {
-    GMX_RELEASE_ASSERT(type != NULL, "Cannot assign NULL position type");
+    GMX_RELEASE_ASSERT(type != nullptr, "Cannot assign NULL position type");
     // Check that the type is valid, throw if it is not.
     e_poscalc_t  dummytype;
     int          dummyflags;
@@ -557,14 +612,15 @@ SelectionCollection::setDebugLevel(int debugLevel)
 
 
 void
-SelectionCollection::setTopology(t_topology *top, int natoms)
+SelectionCollection::setTopology(gmx_mtop_t *top, int natoms)
 {
-    GMX_RELEASE_ASSERT(natoms > 0 || top != NULL,
+    GMX_RELEASE_ASSERT(natoms > 0 || top != nullptr,
                        "The number of atoms must be given if there is no topology");
+    checkTopologyProperties(top, requiredTopologyProperties());
     // Get the number of atoms from the topology if it is not given.
     if (natoms <= 0)
     {
-        natoms = top->atoms.nr;
+        natoms = top->natoms;
     }
     if (impl_->bExternalGroupsSet_)
     {
@@ -583,15 +639,15 @@ SelectionCollection::setTopology(t_topology *top, int natoms)
     gmx_ana_selcollection_t *sc = &impl_->sc_;
     // Do this first, as it allocates memory, while the others don't throw.
     gmx_ana_index_init_simple(&sc->gall, natoms);
-    sc->pcc.setTopology(top);
     sc->top = top;
+    sc->pcc.setTopology(top);
 }
 
 
 void
 SelectionCollection::setIndexGroups(gmx_ana_indexgrps_t *grps)
 {
-    GMX_RELEASE_ASSERT(grps == NULL || !impl_->bExternalGroupsSet_,
+    GMX_RELEASE_ASSERT(grps == nullptr || !impl_->bExternalGroupsSet_,
                        "Can only set external groups once or clear them afterwards");
     impl_->grps_               = grps;
     impl_->bExternalGroupsSet_ = true;
@@ -614,46 +670,24 @@ SelectionCollection::setIndexGroups(gmx_ana_indexgrps_t *grps)
     }
 }
 
-
-bool
-SelectionCollection::requiresTopology() const
+SelectionTopologyProperties
+SelectionCollection::requiredTopologyProperties() const
 {
-    e_poscalc_t  type;
-    int          flags;
+    SelectionTopologyProperties props;
 
-    if (!impl_->rpost_.empty())
-    {
-        flags = 0;
-        // Should not throw, because has been checked earlier.
-        PositionCalculationCollection::typeFromEnum(impl_->rpost_.c_str(),
-                                                    &type, &flags);
-        if (type != POS_ATOM)
-        {
-            return true;
-        }
-    }
-    if (!impl_->spost_.empty())
-    {
-        flags = 0;
-        // Should not throw, because has been checked earlier.
-        PositionCalculationCollection::typeFromEnum(impl_->spost_.c_str(),
-                                                    &type, &flags);
-        if (type != POS_ATOM)
-        {
-            return true;
-        }
-    }
+    // These should not throw, because has been checked earlier.
+    props.merge(impl_->requiredTopologyPropertiesForPositionType(impl_->rpost_, false));
+    const bool forcesRequested = impl_->areForcesRequested();
+    props.merge(impl_->requiredTopologyPropertiesForPositionType(impl_->spost_,
+                                                                 forcesRequested));
 
     SelectionTreeElementPointer sel = impl_->sc_.root;
-    while (sel)
+    while (sel && !props.hasAll())
     {
-        if (_gmx_selelem_requires_top(*sel))
-        {
-            return true;
-        }
+        props.merge(sel->requiredTopologyProperties());
         sel = sel->next;
     }
-    return false;
+    return props;
 }
 
 
@@ -678,7 +712,7 @@ SelectionCollection::parseFromStdin(int count, bool bInteractive,
                                     const std::string &context)
 {
     return parseInteractive(count, &StandardInputStream::instance(),
-                            bInteractive ? &TextOutputFile::standardError() : NULL,
+                            bInteractive ? &TextOutputFile::standardError() : nullptr,
                             context);
 }
 
@@ -689,7 +723,7 @@ namespace
 std::unique_ptr<TextWriter> initStatusWriter(TextOutputStream *statusStream)
 {
     std::unique_ptr<TextWriter> statusWriter;
-    if (statusStream != NULL)
+    if (statusStream != nullptr)
     {
         statusWriter.reset(new TextWriter(statusStream));
         statusWriter->wrapperSettings().setLineLength(78);
@@ -724,11 +758,11 @@ SelectionCollection::parseFromFile(const std::string &filename)
         yyscan_t      scanner;
         TextInputFile file(filename);
         // TODO: Exception-safe way of using the lexer.
-        _gmx_sel_init_lexer(&scanner, &impl_->sc_, NULL, -1,
+        _gmx_sel_init_lexer(&scanner, &impl_->sc_, nullptr, -1,
                             impl_->bExternalGroupsSet_,
                             impl_->grps_);
         _gmx_sel_set_lex_input_file(scanner, file.handle());
-        return runParser(scanner, NULL, false, -1, std::string());
+        return runParser(scanner, nullptr, false, -1, std::string());
     }
     catch (GromacsException &ex)
     {
@@ -745,24 +779,21 @@ SelectionCollection::parseFromString(const std::string &str)
 {
     yyscan_t scanner;
 
-    _gmx_sel_init_lexer(&scanner, &impl_->sc_, NULL, -1,
+    _gmx_sel_init_lexer(&scanner, &impl_->sc_, nullptr, -1,
                         impl_->bExternalGroupsSet_,
                         impl_->grps_);
     _gmx_sel_set_lex_input_str(scanner, str.c_str());
-    return runParser(scanner, NULL, false, -1, std::string());
+    return runParser(scanner, nullptr, false, -1, std::string());
 }
 
 
 void
 SelectionCollection::compile()
 {
-    if (impl_->sc_.top == NULL && requiresTopology())
-    {
-        GMX_THROW(InconsistentInputError("Selection requires topology information, but none provided"));
-    }
+    checkTopologyProperties(impl_->sc_.top, requiredTopologyProperties());
     if (!impl_->bExternalGroupsSet_)
     {
-        setIndexGroups(NULL);
+        setIndexGroups(nullptr);
     }
     if (impl_->debugLevel_ >= 1)
     {
@@ -827,12 +858,15 @@ SelectionCollection::compile()
             }
         }
     }
+    impl_->rpost_.clear();
+    impl_->spost_.clear();
 }
 
 
 void
 SelectionCollection::evaluate(t_trxframe *fr, t_pbc *pbc)
 {
+    checkTopologyProperties(impl_->sc_.top, requiredTopologyProperties());
     if (fr->bIndex)
     {
         gmx_ana_index_t g;
index 57ffcb83759417cadc5323efe32a8c1b61801d55..44bb7e7727cf9da7389044208b5a7b6a672b4e30 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,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.
@@ -52,8 +52,8 @@
 #include "gromacs/utility/classhelpers.h"
 
 struct gmx_ana_indexgrps_t;
+struct gmx_mtop_t;
 struct t_pbc;
-struct t_topology;
 struct t_trxframe;
 
 namespace gmx
@@ -64,6 +64,7 @@ class SelectionCompiler;
 class SelectionEvaluator;
 class TextInputStream;
 class TextOutputStream;
+struct SelectionTopologyProperties;
 
 /*! \brief
  * Collection of selections.
@@ -202,20 +203,22 @@ class SelectionCollection
         void setDebugLevel(int debugLevel);
 
         /*! \brief
-         * Returns true if the collection requires topology information for
-         * evaluation.
+         * Returns what topology information is required for evaluation.
          *
-         * \returns true if any selection in the collection requires topology
-         *      information.
+         * \returns What topology information is required for compiling and/or
+         *     evaluating the selections in the collection.
          *
          * Before the parser functions have been called, the return value is
          * based just on the position types set.
          * After parser functions have been called, the return value also takes
          * into account the selection keywords used.
+         * After the compiler has been called, the return value is final and
+         * also considers possible force evaluation requested for the
+         * selections.
          *
          * Does not throw.
          */
-        bool requiresTopology() const;
+        SelectionTopologyProperties requiredTopologyProperties() const;
         /*! \brief
          * Returns true if the collection requires external index groups.
          *
@@ -242,7 +245,7 @@ class SelectionCollection
          * Does not throw currently, but this is subject to change when more
          * underlying code is converted to C++.
          */
-        void setTopology(t_topology *top, int natoms);
+        void setTopology(gmx_mtop_t *top, int natoms);
         /*! \brief
          * Sets the external index groups to use for the selections.
          *
index 0cb7a665e9ca2bfe8212994b945a6f5e42d0b9f3..1492715dfec93cd8f5a67448eb28b03a7db26910 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2012,2013,2014,2015,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.
@@ -84,6 +84,55 @@ enum SelectionFlag
 typedef FlagsTemplate<SelectionFlag> SelectionFlags;
 //! \endcond
 
+/*! \brief
+ * Describes topology properties required for selection evaluation.
+ *
+ * See SelectionCollection::requiredTopologyProperties().
+ *
+ * \inpublicapi
+ * \ingroup module_selection
+ */
+struct SelectionTopologyProperties
+{
+    //! Returns a property object that requires generic topology info.
+    static SelectionTopologyProperties topology()
+    {
+        return SelectionTopologyProperties(true, false);
+    }
+    //! Returns a property object that requires atom masses.
+    static SelectionTopologyProperties masses()
+    {
+        return SelectionTopologyProperties(true, true);
+    }
+
+    //! Initializes properties that does not require anything.
+    SelectionTopologyProperties()
+        : needsTopology(false), needsMasses(false)
+    {
+    }
+    //! Initializes properties with the given flags.
+    SelectionTopologyProperties(bool needsTopology, bool needsMasses)
+        : needsTopology(needsTopology), needsMasses(needsMasses)
+    {
+    }
+
+    //! Combines flags from another properties object to this.
+    void merge(const SelectionTopologyProperties &other)
+    {
+        needsTopology = needsTopology || other.needsTopology;
+        needsMasses   = needsMasses || other.needsMasses;
+    }
+    //! Whether all flags are `true` (for short-ciruiting logic).
+    bool hasAll() const { return needsTopology && needsMasses; }
+    //! Whether any flag is `true`.
+    bool hasAny() const { return needsTopology || needsMasses; }
+
+    //! Whether topology information is needed for selection evaluation.
+    bool needsTopology;
+    //! Whether atom masses are needed for selection evaluation.
+    bool needsMasses;
+};
+
 }
 
 #endif
index 9d877945982e7116c878598a8f8e12467059afaf..2d45bf55f1da3a1c1993ea68b29672128df33c15 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,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.
@@ -71,11 +71,14 @@ class SelectionFileOptionStorage : public AbstractOptionStorage
         virtual OptionInfo &optionInfo() { return info_; }
         virtual std::string typeString() const { return "file"; }
         virtual int valueCount() const { return 0; }
-        virtual std::string formatValue(int /*i*/) const { return ""; }
+        virtual std::vector<Variant> defaultValues() const { return {}; }
+        virtual std::vector<std::string> defaultValuesAsStrings() const { return {}; }
+        virtual std::vector<Variant>
+        normalizeValues(const std::vector<Variant> &values) const { return values; }
 
     private:
         virtual void clearSet();
-        virtual void convertValue(const std::string &value);
+        virtual void convertValue(const Variant &value);
         virtual void processSet();
         virtual void processAll() {}
 
index 019f8965b5e27b05807f99a00ba447d3030a149c..b9ccda569b58326bbe9e62b8ae018a99a0a8c9b0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -70,7 +70,7 @@ SelectionOptionStorage::SelectionOptionStorage(const SelectionOption  &settings,
       info_(this), manager_(*manager), defaultText_(settings.defaultText_),
       selectionFlags_(settings.selectionFlags_)
 {
-    GMX_RELEASE_ASSERT(manager != NULL,
+    GMX_RELEASE_ASSERT(manager != nullptr,
                        "SelectionOptionManager must be added before SelectionOption");
     GMX_RELEASE_ASSERT(!hasFlag(efOption_MultipleTimes),
                        "allowMultiple() is not supported for selection options");
@@ -84,6 +84,13 @@ std::string SelectionOptionStorage::formatSingleValue(const Selection &value) co
 }
 
 
+std::vector<Variant>
+SelectionOptionStorage::normalizeValues(const std::vector<Variant> & /*values*/) const
+{
+    GMX_THROW(NotImplementedError("Selection options not supported in this context"));
+}
+
+
 void SelectionOptionStorage::addSelections(
         const SelectionList &selections,
         bool                 bFullValue)
@@ -118,9 +125,9 @@ void SelectionOptionStorage::addSelections(
 }
 
 
-void SelectionOptionStorage::convertValue(const std::string &value)
+void SelectionOptionStorage::convertValue(const Variant &value)
 {
-    manager_.convertOptionValue(this, value, false);
+    manager_.convertOptionValue(this, value.cast<std::string>(), false);
 }
 
 void SelectionOptionStorage::processSetValues(ValueList *values)
@@ -180,10 +187,9 @@ void SelectionOptionStorage::setAllowedValueCount(int count)
 
 void SelectionOptionStorage::setSelectionFlag(SelectionFlag flag, bool bSet)
 {
-    ValueList::iterator i;
-    for (i = values().begin(); i != values().end(); ++i)
+    for (const Selection &value : values())
     {
-        if (flag == efSelection_OnlyStatic && bSet && i->isDynamic())
+        if (flag == efSelection_OnlyStatic && bSet && value.isDynamic())
         {
             MessageStringCollector errors;
             errors.startContext("In option '" + name() + "'");
@@ -193,9 +199,9 @@ void SelectionOptionStorage::setSelectionFlag(SelectionFlag flag, bool bSet)
         }
     }
     selectionFlags_.set(flag, bSet);
-    for (i = values().begin(); i != values().end(); ++i)
+    for (Selection &value : values())
     {
-        i->data().setFlags(selectionFlags_);
+        value.data().setFlags(selectionFlags_);
     }
 }
 
@@ -272,7 +278,7 @@ SelectionFileOptionStorage::SelectionFileOptionStorage(
                             | efOption_DontCheckMinimumCount),
       info_(this), manager_(*manager), bValueParsed_(false)
 {
-    GMX_RELEASE_ASSERT(manager != NULL,
+    GMX_RELEASE_ASSERT(manager != nullptr,
                        "SelectionOptionManager must be added before SelectionFileOption");
 }
 
@@ -281,7 +287,7 @@ void SelectionFileOptionStorage::clearSet()
     bValueParsed_ = false;
 }
 
-void SelectionFileOptionStorage::convertValue(const std::string &value)
+void SelectionFileOptionStorage::convertValue(const Variant &value)
 {
     if (bValueParsed_)
     {
@@ -289,7 +295,7 @@ void SelectionFileOptionStorage::convertValue(const std::string &value)
     }
     bValueParsed_ = true;
     // TODO: Should we throw an InvalidInputError if the file does not exist?
-    manager_.parseRequestedFromFile(value);
+    manager_.parseRequestedFromFile(value.cast<std::string>());
 }
 
 void SelectionFileOptionStorage::processSet()
index 32c80a2506ae49c609c17c410f3065c13bdfc82d..f1886386468099ce6ad0800b78f285a2af4b8840 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 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.
@@ -54,6 +54,9 @@
 #include "gromacs/selection/selectioncollection.h"
 #include "gromacs/selection/selectionfileoption.h"
 #include "gromacs/selection/selectionoptionmanager.h"
+#include "gromacs/topology/atoms.h"
+#include "gromacs/topology/topology.h"
+#include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/filestream.h"
 
 namespace gmx
@@ -77,12 +80,12 @@ class SelectionOptionBehavior::Impl
         Impl(SelectionCollection *selections,
              ITopologyProvider   *topologyProvider)
             : selections_(*selections), topologyProvider_(*topologyProvider),
-              manager_(selections), grps_(NULL)
+              manager_(selections), grps_(nullptr)
         {
         }
         ~Impl()
         {
-            if (grps_ != NULL)
+            if (grps_ != nullptr)
             {
                 gmx_ana_indexgrps_free(grps_);
             }
@@ -106,40 +109,69 @@ class SelectionOptionBehavior::Impl
                                  "  %s\n(with -n), but it was not used by any selection.\n",
                                  ndxfile_.c_str());
                 }
-                selections_.setIndexGroups(NULL);
+                selections_.setIndexGroups(nullptr);
                 return;
             }
             if (ndxfile_.empty())
             {
-                t_topology *top = topologyProvider_.getTopology(false);
-                gmx_ana_indexgrps_init(&grps_, top, NULL);
+                gmx_mtop_t *top = topologyProvider_.getTopology(false);
+                gmx_ana_indexgrps_init(&grps_, top, nullptr);
             }
             else
             {
-                gmx_ana_indexgrps_init(&grps_, NULL, ndxfile_.c_str());
+                gmx_ana_indexgrps_init(&grps_, nullptr, ndxfile_.c_str());
             }
             selections_.setIndexGroups(grps_);
         }
         void doneIndexGroups()
         {
-            if (grps_ != NULL)
+            if (grps_ != nullptr)
             {
-                selections_.setIndexGroups(NULL);
+                selections_.setIndexGroups(nullptr);
                 gmx_ana_indexgrps_free(grps_);
-                grps_ = NULL;
+                grps_ = nullptr;
             }
         }
 
         void compileSelections()
         {
-            t_topology *top    = topologyProvider_.getTopology(selections_.requiresTopology());
-            int         natoms = -1;
-            if (top == NULL)
+            const bool  topRequired = selections_.requiredTopologyProperties().needsTopology;
+            gmx_mtop_t *top         = topologyProvider_.getTopology(topRequired);
+            int         natoms      = -1;
+            if (top == nullptr)
             {
                 natoms = topologyProvider_.getAtomCount();
             }
+            getMassesIfRequired(top);
             selections_.setTopology(top, natoms);
             selections_.compile();
+            // Situation may have changed after compilation.
+            getMassesIfRequired(top);
+        }
+
+        void getMassesIfRequired(gmx_mtop_t *top)
+        {
+            const bool massRequired = selections_.requiredTopologyProperties().needsMasses;
+            if (!massRequired)
+            {
+                return;
+            }
+            // TODO: There can be some corner cases that still hit this assert
+            // when the user has not provided the topology.
+            GMX_RELEASE_ASSERT(top != nullptr,
+                               "Masses are required, but no topology is loaded");
+            for (int i = 0; i < top->nmoltype; ++i)
+            {
+                gmx_moltype_t &moltype = top->moltype[i];
+                if (!moltype.atoms.haveMass)
+                {
+                    atomsSetMassesBasedOnNames(&moltype.atoms, TRUE);
+                    if (!moltype.atoms.haveMass)
+                    {
+                        GMX_THROW(InconsistentInputError("Selections require mass information for evaluation, but it is not available in the input and could not be determined for all atoms based on atom names."));
+                    }
+                }
+            }
         }
 
         SelectionCollection    &selections_;
index 4bcc45e1ddb475c388f959f624b9019044e9c21f..1768a01b46e964dad1c4ca01de75b50cc93353c6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 2015,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.
@@ -48,7 +48,7 @@
 #include "gromacs/options/ioptionsbehavior.h"
 #include "gromacs/utility/classhelpers.h"
 
-struct t_topology;
+struct gmx_mtop_t;
 
 namespace gmx
 {
@@ -93,7 +93,7 @@ class ITopologyProvider
          * different values of \p required.  Subsequent calls should just
          * return the same topology that was loaded in the first call.
          */
-        virtual t_topology *getTopology(bool required) = 0;
+        virtual gmx_mtop_t *getTopology(bool required) = 0;
         /*! \brief
          * Returns the number of atoms.
          *
index a31859b59baec6dc1aefddd4cfcf6951e2ffd403..54d43a4cc554a940e022809bba3ba4cf8a32bb9a 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,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.
@@ -246,7 +246,7 @@ void SelectionOptionManager::Impl::requestUnsetRequiredOptions()
         SelectionOptionStorage &storage = **i;
         if (storage.isRequired() && !storage.isSet())
         {
-            requests_.push_back(SelectionRequest(&storage));
+            requests_.emplace_back(&storage);
         }
     }
 }
@@ -285,7 +285,7 @@ void
 SelectionOptionManager::requestOptionDelayedParsing(
         SelectionOptionStorage *storage)
 {
-    impl_->requests_.push_back(Impl::SelectionRequest(storage));
+    impl_->requests_.emplace_back(storage);
 }
 
 bool
index 0ef88da0a6411f22300bf8d79a2c30c333aa5fb7..795bdffa4c90cc53ecd627ab2ebcd2d2122b1e9b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,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.
@@ -77,6 +77,8 @@ class SelectionOptionStorage : public OptionStorageTemplate<Selection>
         virtual OptionInfo &optionInfo() { return info_; }
         virtual std::string typeString() const { return "selection"; }
         virtual std::string formatSingleValue(const Selection &value) const;
+        virtual std::vector<Variant>
+        normalizeValues(const std::vector<Variant> &values) const;
 
         /*! \brief
          * Adds selections to the storage.
@@ -126,7 +128,7 @@ class SelectionOptionStorage : public OptionStorageTemplate<Selection>
         void setSelectionFlag(SelectionFlag flag, bool bSet);
 
     private:
-        virtual void convertValue(const std::string &value);
+        virtual void convertValue(const Variant &value);
         virtual void processSetValues(ValueList *values);
         virtual void processAll();
 
index f514c79daa6cdb07558f44ada499fc375c6d945a..43553d4bc9653e09aae8eb22c17f0844b8e8883e 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
@@ -47,6 +47,7 @@
 
 #include "gromacs/selection/indexutil.h"
 #include "gromacs/selection/position.h"
+#include "gromacs/selection/selectionenums.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
@@ -68,7 +69,7 @@
 const char *
 _gmx_selelem_type_str(const gmx::SelectionTreeElement &sel)
 {
-    const char *p = NULL;
+    const char *p = nullptr;
     switch (sel.type)
     {
         case SEL_CONST:      p = "CONST";    break;
@@ -96,7 +97,7 @@ _gmx_selelem_type_str(const gmx::SelectionTreeElement &sel)
 const char *
 _gmx_sel_value_type_str(const gmx_ana_selvalue_t *val)
 {
-    const char *p = NULL;
+    const char *p = nullptr;
     switch (val->type)
     {
         case NO_VALUE:       p = "NONE";  break;
@@ -115,7 +116,7 @@ _gmx_sel_value_type_str(const gmx_ana_selvalue_t *val)
 const char *
 _gmx_selelem_boolean_type_str(const gmx::SelectionTreeElement &sel)
 {
-    const char *p = NULL;
+    const char *p = nullptr;
     switch (sel.u.boolt)
     {
         case BOOL_NOT:  p = "NOT"; break;
@@ -136,6 +137,7 @@ SelectionTreeElement::SelectionTreeElement(e_selelem_t              type,
                                            const SelectionLocation &location)
     : location_(location)
 {
+    // cppcheck-suppress useInitializationList
     this->type       = type;
     this->flags      = (type != SEL_ROOT) ? SEL_ALLOCVAL : 0;
     if (type == SEL_BOOLEAN)
@@ -149,9 +151,9 @@ SelectionTreeElement::SelectionTreeElement(e_selelem_t              type,
     }
     _gmx_selvalue_clear(&this->v);
     std::memset(&this->u, 0, sizeof(this->u));
-    this->evaluate   = NULL;
-    this->mempool    = NULL;
-    this->cdata      = NULL;
+    this->evaluate   = nullptr;
+    this->mempool    = nullptr;
+    this->cdata      = nullptr;
 }
 
 SelectionTreeElement::~SelectionTreeElement()
@@ -198,7 +200,7 @@ void SelectionTreeElement::freeValues()
         }
     }
     _gmx_selvalue_free(&v);
-    if (type == SEL_SUBEXPRREF && u.param != NULL)
+    if (type == SEL_SUBEXPRREF && u.param != nullptr)
     {
         // TODO: This is now called from two different locations.
         // It is likely that one of them is unnecessary, but that requires
@@ -213,22 +215,22 @@ SelectionTreeElement::freeExpressionData()
     if (type == SEL_EXPRESSION || type == SEL_MODIFIER)
     {
         _gmx_selelem_free_method(u.expr.method, u.expr.mdata);
-        u.expr.mdata  = NULL;
-        u.expr.method = NULL;
+        u.expr.mdata  = nullptr;
+        u.expr.method = nullptr;
         /* Free position data */
         delete u.expr.pos;
-        u.expr.pos = NULL;
+        u.expr.pos = nullptr;
         /* Free position calculation data */
         if (u.expr.pc)
         {
             gmx_ana_poscalc_free(u.expr.pc);
-            u.expr.pc = NULL;
+            u.expr.pc = nullptr;
         }
     }
     if (type == SEL_ARITHMETIC)
     {
         sfree(u.arith.opstr);
-        u.arith.opstr = NULL;
+        u.arith.opstr = nullptr;
     }
     if (type == SEL_SUBEXPR || type == SEL_ROOT
         || (type == SEL_CONST && v.type == GROUP_VALUE))
@@ -279,7 +281,7 @@ void SelectionTreeElement::mempoolRelease()
         case INT_VALUE:
         case REAL_VALUE:
             _gmx_sel_mempool_free(mempool, v.u.ptr);
-            _gmx_selvalue_setstore(&v, NULL);
+            _gmx_selvalue_setstore(&v, nullptr);
             break;
 
         case GROUP_VALUE:
@@ -324,6 +326,45 @@ void SelectionTreeElement::fillNameIfMissing(const char *selectionText)
     }
 }
 
+SelectionTopologyProperties
+SelectionTreeElement::requiredTopologyProperties() const
+{
+    SelectionTopologyProperties props;
+    if (type == SEL_EXPRESSION || type == SEL_MODIFIER)
+    {
+        bool needsTop    = false;
+        bool needsMasses = false;
+        if (u.expr.method != nullptr)
+        {
+            needsTop    = (u.expr.method->flags & SMETH_REQTOP);
+            needsMasses = (u.expr.method->flags & SMETH_REQMASS);
+        }
+        if (u.expr.pc != nullptr)
+        {
+            auto requiredTopologyInfo = gmx_ana_poscalc_required_topology_info(u.expr.pc);
+            needsTop    = needsTop
+                || (requiredTopologyInfo != PositionCalculationCollection::RequiredTopologyInfo::None);
+            needsMasses = needsMasses
+                || (requiredTopologyInfo == PositionCalculationCollection::RequiredTopologyInfo::TopologyAndMasses);
+        }
+        if (needsTop)
+        {
+            props.merge(SelectionTopologyProperties::topology());
+        }
+        if (needsMasses)
+        {
+            props.merge(SelectionTopologyProperties::masses());
+        }
+    }
+    SelectionTreeElementPointer child = this->child;
+    while (child && !props.hasAll())
+    {
+        props.merge(child->requiredTopologyProperties());
+        child = child->next;
+    }
+    return props;
+}
+
 void SelectionTreeElement::checkUnsortedAtoms(
         bool bUnsortedAllowed, ExceptionInitializer *errors) const
 {
@@ -384,7 +425,7 @@ void SelectionTreeElement::resolveIndexGroupReference(
 {
     GMX_RELEASE_ASSERT(type == SEL_GROUPREF,
                        "Should only be called for index group reference elements");
-    if (grps == NULL)
+    if (grps == nullptr)
     {
         std::string message = formatString(
                     "Cannot match '%s', because index groups are not available.",
@@ -394,7 +435,7 @@ void SelectionTreeElement::resolveIndexGroupReference(
 
     gmx_ana_index_t foundGroup;
     std::string     foundName;
-    if (u.gref.name != NULL)
+    if (u.gref.name != nullptr)
     {
         if (!gmx_ana_indexgrps_find(&foundGroup, &foundName, grps, u.gref.name))
         {
@@ -477,7 +518,7 @@ _gmx_selelem_set_vtype(const gmx::SelectionTreeElementPointer &sel,
 void
 _gmx_selelem_free_param(gmx_ana_selparam_t *param)
 {
-    if (param->val.u.ptr != NULL)
+    if (param->val.u.ptr != nullptr)
     {
         if (param->val.type == GROUP_VALUE)
         {
@@ -493,7 +534,7 @@ _gmx_selelem_free_param(gmx_ana_selparam_t *param)
 void
 _gmx_selelem_free_method(gmx_ana_selmethod_t *method, void *mdata)
 {
-    sel_freefunc free_func = NULL;
+    sel_freefunc free_func = nullptr;
 
     /* Save the pointer to the free function. */
     if (method && method->free)
@@ -629,7 +670,7 @@ _gmx_selelem_print_tree(FILE *fp, const gmx::SelectionTreeElement &sel,
     if ((sel.type == SEL_CONST && sel.v.type == GROUP_VALUE) || sel.type == SEL_ROOT)
     {
         const gmx_ana_index_t *g = sel.v.u.g;
-        if (!g || g->isize == 0 || sel.evaluate != NULL)
+        if (!g || g->isize == 0 || sel.evaluate != nullptr)
         {
             g = &sel.u.cgrp;
         }
@@ -662,10 +703,10 @@ _gmx_selelem_print_tree(FILE *fp, const gmx::SelectionTreeElement &sel,
             fprintf(fp, "\n");
         }
     }
-    else if (sel.type == SEL_SUBEXPRREF && sel.u.param != NULL)
+    else if (sel.type == SEL_SUBEXPRREF && sel.u.param != nullptr)
     {
         fprintf(fp, "%*c param", level*2+1, ' ');
-        if (sel.u.param->name != NULL)
+        if (sel.u.param->name != nullptr)
         {
             fprintf(fp, " \"%s\"", sel.u.param->name);
         }
@@ -737,34 +778,3 @@ _gmx_selelem_print_tree(FILE *fp, const gmx::SelectionTreeElement &sel,
         child = child->next;
     }
 }
-
-/*!
- * \param[in] root Root of the subtree to query.
- * \returns true if \p root or any any of its elements require topology
- *   information, false otherwise.
- */
-bool
-_gmx_selelem_requires_top(const gmx::SelectionTreeElement &root)
-{
-    if (root.type == SEL_EXPRESSION || root.type == SEL_MODIFIER)
-    {
-        if (root.u.expr.method && (root.u.expr.method->flags & SMETH_REQTOP))
-        {
-            return true;
-        }
-        if (root.u.expr.pc && gmx_ana_poscalc_requires_top(root.u.expr.pc))
-        {
-            return true;
-        }
-    }
-    gmx::SelectionTreeElementPointer child = root.child;
-    while (child)
-    {
-        if (_gmx_selelem_requires_top(*child))
-        {
-            return true;
-        }
-        child = child->next;
-    }
-    return false;
-}
index 62838a5d09b95d242ed004d68c9c87da50b8855f..f2f218744cee82ad9455b0fb3b6001b7f411c6cb 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
@@ -70,6 +70,7 @@ struct t_compiler_data;
 namespace gmx
 {
 class SelectionTreeElement;
+struct SelectionTopologyProperties;
 
 //! Smart pointer type for selection tree element pointers.
 typedef std::shared_ptr<SelectionTreeElement> SelectionTreeElementPointer;
@@ -340,7 +341,7 @@ class SelectionTreeElement
          * \param[in] name  Name to set (can be NULL).
          * \throws    std::bad_alloc if out of memory.
          */
-        void setName(const char *name) { name_ = (name != NULL ? name : ""); }
+        void setName(const char *name) { name_ = (name != nullptr ? name : ""); }
         //! \copydoc setName(const char *)
         void setName(const std::string &name) { name_ = name; }
         /*! \brief
@@ -356,6 +357,13 @@ class SelectionTreeElement
          */
         void fillNameIfMissing(const char *selectionText);
 
+        /*! \brief
+         * Returns which topology properties the selection element subtree requires
+         * for evaluation.
+         *
+         * \returns   List of topology properties required for evaluation.
+         */
+        SelectionTopologyProperties requiredTopologyProperties() const;
         /*! \brief
          * Checks that this element and its children do not contain unsupported
          * elements with unsorted atoms.
@@ -536,10 +544,6 @@ void
 _gmx_selelem_print_compiler_info(FILE *fp, const gmx::SelectionTreeElement &sel,
                                  int level);
 
-/** Returns true if the selection element subtree requires topology information for evaluation. */
-bool
-_gmx_selelem_requires_top(const gmx::SelectionTreeElement &root);
-
 /* In sm_insolidangle.c */
 /** Returns true if the covered fraction of the selection can be calculated. */
 bool
index 14220e28c291cb9f7315516628a9656b6ce78397..d807f042f4c7048eeed5d86b1b55b157eda3b07b 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
@@ -647,7 +647,7 @@ KeywordsHelpTopic::KeywordsHelpTopic()
         const std::string         &symname = symbol->name();
         const gmx_ana_selmethod_t *method  = symbol->methodValue();
         methods_.push_back(std::make_pair(std::string(symname), method));
-        if (method->help.nlhelp > 0 && method->help.help != NULL)
+        if (method->help.nlhelp > 0 && method->help.help != nullptr)
         {
             addSubTopic(HelpTopicPointer(
                                 new KeywordDetailsHelpTopic(symname, *method)));
@@ -675,7 +675,7 @@ void KeywordsHelpTopic::writeHelp(const HelpWriterContext &context) const
 
     writeKeywordListStart(context, "Additional keywords that directly select atoms:");
     printKeywordList(context, GROUP_VALUE, false);
-    writeKeywordListEnd(context, NULL);
+    writeKeywordListEnd(context, nullptr);
 
     writeKeywordListStart(context, "Keywords that directly evaluate to positions:");
     printKeywordList(context, POS_VALUE, false);
@@ -684,7 +684,7 @@ void KeywordsHelpTopic::writeHelp(const HelpWriterContext &context) const
     writeKeywordListStart(context, "Additional keywords:");
     printKeywordList(context, POS_VALUE, true);
     printKeywordList(context, NO_VALUE, true);
-    writeKeywordListEnd(context, NULL);
+    writeKeywordListEnd(context, nullptr);
 
     writeKeywordSubTopics(context);
 }
@@ -732,11 +732,11 @@ void KeywordsHelpTopic::printKeywordList(const HelpWriterContext &context,
             = (method.flags & SMETH_MODIFIER) != 0;
         if (method.type == type && bModifiers == bIsModifier)
         {
-            const bool bHasHelp = (method.help.nlhelp > 0 && method.help.help != NULL);
+            const bool bHasHelp = (method.help.nlhelp > 0 && method.help.help != nullptr);
             const bool bPrintHelpMark
                 = bHasHelp && context.outputFormat() == eHelpOutputFormat_Console;
             file.writeString(formatString("   %c ", bPrintHelpMark ? '+' : ' '));
-            if (method.help.syntax != NULL)
+            if (method.help.syntax != nullptr)
             {
                 file.writeLine(method.help.syntax);
             }
@@ -765,14 +765,14 @@ void KeywordsHelpTopic::writeKeywordSubTopics(const HelpWriterContext &context)
     {
         const gmx_ana_selmethod_t &method = *iter->second;
         const bool                 bHasHelp
-            = (method.help.nlhelp > 0 && method.help.help != NULL);
+            = (method.help.nlhelp > 0 && method.help.help != nullptr);
         if (!bHasHelp || usedSymbols.count(iter->first) > 0)
         {
             continue;
         }
 
         std::string                title;
-        if (method.help.helpTitle != NULL)
+        if (method.help.helpTitle != nullptr)
         {
             title = method.help.helpTitle;
             title.append(" - ");
@@ -790,7 +790,7 @@ void KeywordsHelpTopic::writeKeywordSubTopics(const HelpWriterContext &context)
         }
 
         const IHelpTopic         *subTopic = findSubTopic(iter->first.c_str());
-        GMX_RELEASE_ASSERT(subTopic != NULL, "Keyword subtopic no longer exists");
+        GMX_RELEASE_ASSERT(subTopic != nullptr, "Keyword subtopic no longer exists");
         HelpWriterContext         subContext(context);
         subContext.enterSubSection(title);
         subTopic->writeHelp(subContext);
index e494b8b298e5bdbd47ebf1d1bc64cdc061644b12..3df5be8d726b04d212928d34e332f311b166f294 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,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.
@@ -127,49 +127,49 @@ typedef struct {
 
 /** Array of selection methods defined in the library. */
 static const t_register_method smtable_def[] = {
-    {NULL,         &sm_cog},
-    {NULL,         &sm_com},
+    {nullptr,         &sm_cog},
+    {nullptr,         &sm_com},
 
-    {NULL,         &sm_all},
-    {NULL,         &sm_none},
-    {NULL,         &sm_atomnr},
-    {NULL,         &sm_resnr},
+    {nullptr,         &sm_all},
+    {nullptr,         &sm_none},
+    {nullptr,         &sm_atomnr},
+    {nullptr,         &sm_resnr},
     {"resid",      &sm_resnr},
-    {NULL,         &sm_resindex},
+    {nullptr,         &sm_resindex},
     {"residue",    &sm_resindex},
-    {NULL,         &sm_molindex},
+    {nullptr,         &sm_molindex},
     {"mol",        &sm_molindex},
     {"molecule",   &sm_molindex},
-    {NULL,         &sm_atomname},
+    {nullptr,         &sm_atomname},
     {"name",       &sm_atomname},
-    {NULL,         &sm_pdbatomname},
+    {nullptr,         &sm_pdbatomname},
     {"pdbname",    &sm_pdbatomname},
-    {NULL,         &sm_atomtype},
+    {nullptr,         &sm_atomtype},
     {"type",       &sm_atomtype},
-    {NULL,         &sm_resname},
-    {NULL,         &sm_insertcode},
-    {NULL,         &sm_chain},
-    {NULL,         &sm_mass},
-    {NULL,         &sm_charge},
-    {NULL,         &sm_altloc},
-    {NULL,         &sm_occupancy},
-    {NULL,         &sm_betafactor},
+    {nullptr,         &sm_resname},
+    {nullptr,         &sm_insertcode},
+    {nullptr,         &sm_chain},
+    {nullptr,         &sm_mass},
+    {nullptr,         &sm_charge},
+    {nullptr,         &sm_altloc},
+    {nullptr,         &sm_occupancy},
+    {nullptr,         &sm_betafactor},
     {"beta",       &sm_betafactor},
-    {NULL,         &sm_x},
-    {NULL,         &sm_y},
-    {NULL,         &sm_z},
+    {nullptr,         &sm_x},
+    {nullptr,         &sm_y},
+    {nullptr,         &sm_z},
 
-    {NULL,         &sm_distance},
+    {nullptr,         &sm_distance},
     {"dist",       &sm_distance},
-    {NULL,         &sm_mindistance},
+    {nullptr,         &sm_mindistance},
     {"mindist",    &sm_mindistance},
-    {NULL,         &sm_within},
-    {NULL,         &sm_insolidangle},
-    {NULL,         &sm_same},
+    {nullptr,         &sm_within},
+    {nullptr,         &sm_insolidangle},
+    {nullptr,         &sm_same},
 
-    {NULL,         &sm_merge},
-    {NULL,         &sm_plus},
-    {NULL,         &sm_permute},
+    {nullptr,         &sm_merge},
+    {nullptr,         &sm_plus},
+    {nullptr,         &sm_permute},
 };
 
 /*! \brief
@@ -248,7 +248,7 @@ check_params(FILE *fp, const char *name, int nparams, gmx_ana_selparam_t param[]
     for (i = 0; i < nparams; ++i)
     {
         /* Check that there is at most one NULL name, in the beginning */
-        if (param[i].name == NULL && i > 0)
+        if (param[i].name == nullptr && i > 0)
         {
             report_error(fp, name, "error: NULL parameter should be the first one");
             bOk = false;
@@ -257,7 +257,7 @@ check_params(FILE *fp, const char *name, int nparams, gmx_ana_selparam_t param[]
         /* Check for duplicates */
         for (j = 0; j < i; ++j)
         {
-            if (param[j].name == NULL)
+            if (param[j].name == nullptr)
             {
                 continue;
             }
@@ -356,16 +356,16 @@ check_params(FILE *fp, const char *name, int nparams, gmx_ana_selparam_t param[]
             }
         }
         /* Check that the value pointer is NULL */
-        if (param[i].nvalptr != NULL)
+        if (param[i].nvalptr != nullptr)
         {
             report_param_error(fp, name, param[i].name, "warning: nvalptr is set");
         }
-        if (param[i].val.u.ptr != NULL && !(param[i].flags & SPAR_ENUMVAL))
+        if (param[i].val.u.ptr != nullptr && !(param[i].flags & SPAR_ENUMVAL))
         {
             report_param_error(fp, name, param[i].name, "warning: value pointer is set");
         }
         /* Check that the name contains only valid characters */
-        if (param[i].name == NULL)
+        if (param[i].name == nullptr)
         {
             continue;
         }
@@ -461,7 +461,7 @@ check_callbacks(FILE *fp, gmx_ana_selmethod_t *method)
         if (method->pupdate && !(method->flags & SMETH_DYNAMIC))
         {
             report_error(fp, method->name, "warning: pupdate not used because the method is static");
-            method->pupdate = NULL;
+            method->pupdate = nullptr;
         }
     }
     /* Check that there is an evaluation function */
@@ -687,7 +687,7 @@ gmx_ana_selmethod_register_defaults(gmx::SelectionParserSymbolTable *symtab)
     {
         gmx_ana_selmethod_t *method = smtable_def[i].method;
 
-        if (smtable_def[i].name == NULL)
+        if (smtable_def[i].name == nullptr)
         {
             rc = gmx_ana_selmethod_register(symtab, method->name, method);
         }
index d5142d6aae2f6747820c33b71fe3103ec4ccc4e7..4b5515308980e53a24565e8bce4014b363f8594f 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,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.
  *    and the \p top pointer passed to the callbacks is guaranteed to be
  *    non-NULL. Should be set if the method requires topology information
  *    for evaluation.
+ *  - \ref SMETH_REQMASS : If set, masses of atoms is always loaded
+ *    and the \p top pointer passed to the callbacks is guaranteed to be
+ *    non-NULL and have meaningful masses.  Should be set if the method requires
+ *    atom masses for evaluation.  Implies \ref SMETH_REQTOP.
  *  - \ref SMETH_DYNAMIC : If set, the method can only be evaluated dynamically,
  *    i.e., it requires data from the trajectory frame.
  *  - \ref SMETH_MODIFIER : If set, the method is a selection modifier and
 #include "selparam.h"
 #include "selvalue.h"
 
-namespace gmx
-{
-class PositionCalculationCollection;
-class SelectionParserSymbolTable;
-} // namespace gmx
-
 struct gmx_ana_index_t;
 struct gmx_ana_pos_t;
 struct gmx_ana_selcollection_t;
+struct gmx_mtop_t;
 struct t_pbc;
-struct t_topology;
 struct t_trxframe;
 
+namespace gmx
+{
+class PositionCalculationCollection;
+class SelectionParserSymbolTable;
+
+/*! \internal
+ * \brief
+ * Evaluation context for selection methods.
+ *
+ * This structure encapsulates common parameters passed to selection method
+ * evaluation functions.  The contained values describe the evaluation context,
+ * i.e., the topology and the current trajectory frame.
+ *
+ * \ingroup module_selection
+ */
+struct SelMethodEvalContext
+{
+    //! Initializes the context with given values.
+    SelMethodEvalContext(const gmx_mtop_t *top, t_trxframe *fr, const t_pbc *pbc)
+        : top(top), fr(fr), pbc(pbc)
+    {
+    }
+
+    /*! \brief
+     * Topology.
+     *
+     * Can be NULL if \ref SMETH_REQTOP or \ref SMETH_REQMASS is not set for
+     * the method.
+     */
+    const gmx_mtop_t *top;
+    /*! \brief
+     * Trajectory frame.
+     *
+     * For static methods that are evaluated based on topology information
+     * alone, this is `NULL`.
+     */
+    t_trxframe       *fr;
+    /*! \brief
+     * Periodic boundary condition information.
+     *
+     * Can be `NULL`, in which case PBC should not be used.
+     */
+    const t_pbc      *pbc;
+};
+
+} // namespace gmx
+
 /*! \name Selection method flags
  * \anchor selmethod_flags
  */
 /*@{*/
-/*! \brief
- * If set, the method requires topology information.
- */
+//! If set, the method requires topology information.
 #define SMETH_REQTOP     1
-/*! \brief
- * If set, the method can only be evaluated dynamically.
- */
-#define SMETH_DYNAMIC    2
+//! If set, the method requires atom masses.
+#define SMETH_REQMASS    2
+//! If set, the method can only be evaluated dynamically.
+#define SMETH_DYNAMIC    4
 /*! \brief
  * If set, the method evaluates to a single value.
  *
  * The default is that the method evaluates to a value for each input atom.
  * Cannot be combined with \ref SMETH_VARNUMVAL.
  */
-#define SMETH_SINGLEVAL  4
+#define SMETH_SINGLEVAL  8
 /*! \brief
  * If set, the method evaluates to an arbitrary number of values.
  *
  * The default is that the method evaluates to a value for each input atom.
  * Cannot be combined with \ref SMETH_SINGLEVAL or with \ref GROUP_VALUE.
  */
-#define SMETH_VARNUMVAL  8
+#define SMETH_VARNUMVAL  16
 /*! \brief
  * If set, the method evaluates to single-character strings.
  *
@@ -418,7 +461,7 @@ typedef void  (*sel_posfunc)(gmx::PositionCalculationCollection *pcc, void *data
  * Does initialization based on topology and/or parameter values.
  *
  * \param[in]  top   Topology structure
- *   (can be NULL if \ref SMETH_REQTOP is not set).
+ *   (can be NULL if \ref SMETH_REQTOP or \ref SMETH_REQMASS is not set).
  * \param[in]  npar  Number of parameters in \p param.
  * \param[in]  param Pointer to (an initialized copy of) the method's
  *   \c gmx_ana_selmethod_t::param.
@@ -458,13 +501,13 @@ typedef void  (*sel_posfunc)(gmx::PositionCalculationCollection *pcc, void *data
  * This function may be called multiple times for the same method if the
  * method takes parameters with \ref SPAR_ATOMVAL set.
  */
-typedef void  (*sel_initfunc)(t_topology *top, int npar,
+typedef void  (*sel_initfunc)(const gmx_mtop_t *top, int npar,
                               gmx_ana_selparam_t *param, void *data);
 /*! \brief
  * Initializes output data structure.
  *
  * \param[in]     top   Topology structure
- *   (can be NULL if \ref SMETH_REQTOP is not set).
+ *   (can be NULL if \ref SMETH_REQTOP or \ref SMETH_REQMASS is not set).
  * \param[in,out] out   Output data structure.
  * \param[in]     data  Internal data structure from sel_datafunc().
  * \returns       0 on success, an error code on error.
@@ -487,7 +530,7 @@ typedef void  (*sel_initfunc)(t_topology *top, int npar,
  * This function may be called multiple times for the same method if the
  * method takes parameters with \ref SPAR_ATOMVAL set.
  */
-typedef void  (*sel_outinitfunc)(t_topology *top, gmx_ana_selvalue_t *out,
+typedef void  (*sel_outinitfunc)(const gmx_mtop_t *top, gmx_ana_selvalue_t *out,
                                  void *data);
 /*! \brief
  * Frees the internal data.
@@ -511,11 +554,7 @@ typedef void  (*sel_freefunc)(void *data);
 /*! \brief
  * Initializes the evaluation for a new frame.
  *
- * \param[in]  top  Topology structure
- *   (can be NULL if \ref SMETH_REQTOP is not set).
- * \param[in]  fr   Current frame.
- * \param[in]  pbc  Initialized periodic boundary condition structure,
- *   or NULL if PBC should not be used.
+ * \param[in]  context  Evaluation context.
  * \param      data Internal data structure from sel_datafunc().
  * \returns    0 on success, a non-zero error code on failure.
  *
@@ -530,16 +569,12 @@ typedef void  (*sel_freefunc)(void *data);
  * For static methods, it is called once, with \p fr and \p pbc set to
  * NULL.
  */
-typedef void  (*sel_framefunc)(t_topology *top, t_trxframe *fr, t_pbc *pbc,
-                               void *data);
+typedef void  (*sel_framefunc)(const gmx::SelMethodEvalContext &context,
+                               void                            *data);
 /*! \brief
  * Evaluates a selection method.
  *
- * \param[in]  top  Topology structure
- *   (can be NULL if \ref SMETH_REQTOP is not set).
- * \param[in]  fr   Current frame.
- * \param[in]  pbc  Initialized periodic boundary condition structure,
- *   or NULL if PBC should not be used.
+ * \param[in]  context  Evaluation context.
  * \param[in]  g    Index group for which the method should be evaluated.
  * \param[out] out  Output data structure.
  * \param      data Internal data structure from sel_datafunc().
@@ -562,17 +597,13 @@ typedef void  (*sel_framefunc)(t_topology *top, t_trxframe *fr, t_pbc *pbc,
  * contains such an atom in case the \p fr has been loaded from a trajectory
  * that only contains a subset of the system.
  */
-typedef void  (*sel_updatefunc)(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+typedef void  (*sel_updatefunc)(const gmx::SelMethodEvalContext &context,
                                 gmx_ana_index_t *g, gmx_ana_selvalue_t *out,
                                 void *data);
 /*! \brief
  * Evaluates a selection method using positions.
  *
- * \param[in]  top  Topology structure
- *   (can be NULL if \ref SMETH_REQTOP is not set).
- * \param[in]  fr   Current frame.
- * \param[in]  pbc  Initialized periodic boundary condition structure,
- *   or NULL if PBC should not be used.
+ * \param[in]  context  Evaluation context.
  * \param[in]  pos  Positions for which the method should be evaluated.
  * \param[out] out  Output data structure.
  * \param      data Internal data structure from sel_datafunc().
@@ -596,7 +627,7 @@ typedef void  (*sel_updatefunc)(t_topology *top, t_trxframe *fr, t_pbc *pbc,
  * contains such an atom in case the \p fr has been loaded from a trajectory
  * that only contains a subset of the system.
  */
-typedef void  (*sel_updatefunc_pos)(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+typedef void  (*sel_updatefunc_pos)(const gmx::SelMethodEvalContext &context,
                                     gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out,
                                     void *data);
 
index 80e1cfea57b57615367f5e93d218ee69c2ed5594..9bd049969f93d35225d9b0041eb5fe2fa03b9dc9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2012,2013,2014,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.
@@ -52,7 +52,7 @@ void
 _gmx_selvalue_clear(gmx_ana_selvalue_t *val)
 {
     val->nr     = 0;
-    val->u.ptr  = NULL;
+    val->u.ptr  = nullptr;
     val->nalloc = 0;
 }
 
@@ -71,7 +71,7 @@ _gmx_selvalue_free(gmx_ana_selvalue_t *val)
         }
     }
     // TODO: It causes a memory leak somewhere if val->nr is assigned zero here...
-    val->u.ptr  = NULL;
+    val->u.ptr  = nullptr;
     val->nalloc = 0;
 }
 
@@ -95,11 +95,11 @@ _gmx_selvalue_reserve(gmx_ana_selvalue_t *val, int n)
                 srenew(val->u.s, n);
                 for (i = val->nalloc; i < n; ++i)
                 {
-                    val->u.s[i] = NULL;
+                    val->u.s[i] = nullptr;
                 }
                 break;
             case POS_VALUE:
-                GMX_RELEASE_ASSERT(val->u.ptr == NULL,
+                GMX_RELEASE_ASSERT(val->u.ptr == nullptr,
                                    "Reallocation of position values not supported");
                 val->u.p = new gmx_ana_pos_t[n];
                 break;
@@ -121,7 +121,7 @@ _gmx_selvalue_getstore_and_release(gmx_ana_selvalue_t *val, void **ptr, int *nal
 {
     *ptr        = val->u.ptr;
     *nalloc     = val->nalloc;
-    val->u.ptr  = NULL;
+    val->u.ptr  = nullptr;
     val->nalloc = 0;
 }
 
index 05cb8c72b4655061c336112233b501f070acb123..94704d32d647f4ebf2bf48a7eb5af5cc61f44f45 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
@@ -49,6 +49,7 @@
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/smalloc.h"
 
+#include "keywords.h"
 #include "selmethod.h"
 
 /** Defines the comparison operator for comparison expressions. */
@@ -124,25 +125,32 @@ init_data_compare(int npar, gmx_ana_selparam_t *param);
  * \returns   0 if the input data is valid, -1 on error.
  */
 static void
-init_compare(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data);
+init_compare(const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data);
 /** Frees the memory allocated for comparison expression evaluation. */
 static void
 free_data_compare(void *data);
-/** Evaluates comparison expressions. */
+/*! \brief
+ * Evaluates comparison expressions.
+ *
+ * \param[in]  context  Not used.
+ * \param[in]  g        Evaluation index group.
+ * \param[out] out      Output data structure (\p out->u.g is used).
+ * \param[in]  data     Should point to a \c t_methoddata_compare.
+ */
 static void
-evaluate_compare(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_compare(const gmx::SelMethodEvalContext &context,
                  gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
 
 /** Parameters for comparison expression evaluation. */
 static gmx_ana_selparam_t smparams_compare[] = {
-    {"int1",  {INT_VALUE,  -1, {NULL}}, NULL,
+    {"int1",  {INT_VALUE,  -1, {nullptr}}, nullptr,
      SPAR_OPTIONAL | SPAR_DYNAMIC | SPAR_ATOMVAL},
-    {"real1", {REAL_VALUE, -1, {NULL}}, NULL,
+    {"real1", {REAL_VALUE, -1, {nullptr}}, nullptr,
      SPAR_OPTIONAL | SPAR_DYNAMIC | SPAR_ATOMVAL},
-    {"op",    {STR_VALUE,   1, {NULL}}, NULL, 0},
-    {"int2",  {INT_VALUE,  -1, {NULL}}, NULL,
+    {"op",    {STR_VALUE,   1, {nullptr}}, nullptr, 0},
+    {"int2",  {INT_VALUE,  -1, {nullptr}}, nullptr,
      SPAR_OPTIONAL | SPAR_DYNAMIC | SPAR_ATOMVAL},
-    {"real2", {REAL_VALUE, -1, {NULL}}, NULL,
+    {"real2", {REAL_VALUE, -1, {nullptr}}, nullptr,
      SPAR_OPTIONAL | SPAR_DYNAMIC | SPAR_ATOMVAL},
 };
 
@@ -151,14 +159,14 @@ gmx_ana_selmethod_t sm_compare = {
     "cmp", GROUP_VALUE, SMETH_SINGLEVAL,
     asize(smparams_compare), smparams_compare,
     &init_data_compare,
-    NULL,
+    nullptr,
     &init_compare,
-    NULL,
+    nullptr,
     &free_data_compare,
-    NULL,
+    nullptr,
     &evaluate_compare,
-    NULL,
-    {NULL, NULL, 0, NULL},
+    nullptr,
+    {nullptr, nullptr, 0, nullptr},
 };
 
 /*! \brief
@@ -199,7 +207,7 @@ comparison_type(char *str)
 static const char *
 comparison_type_str(e_comparison_t cmpt)
 {
-    const char *p = NULL;
+    const char *p = nullptr;
     switch (cmpt)
     {
         case CMP_INVALID: p = "INVALID"; break;
@@ -323,8 +331,8 @@ init_comparison_value(t_compare_value *val, gmx_ana_selparam_t param[2])
     else
     {
         n           = 0;
-        val->i      = NULL;
-        val->r      = NULL;
+        val->i      = nullptr;
+        val->r      = nullptr;
     }
     return n;
 }
@@ -409,7 +417,7 @@ convert_real_int(int n, t_compare_value *val, e_comparison_t cmpt, bool bRight)
 }
 
 static void
-init_compare(t_topology * /* top */, int /* npar */, gmx_ana_selparam_t *param, void *data)
+init_compare(const gmx_mtop_t * /* top */, int /* npar */, gmx_ana_selparam_t *param, void *data)
 {
     t_methoddata_compare *d = (t_methoddata_compare *)data;
     int                   n1, n2;
@@ -451,9 +459,9 @@ init_compare(t_topology * /* top */, int /* npar */, gmx_ana_selparam_t *param,
             /* Reverse the sides to place the integer on the right */
             int    flags;
             d->left.r      = d->right.r;
-            d->right.r     = NULL;
+            d->right.r     = nullptr;
             d->right.i     = d->left.i;
-            d->left.i      = NULL;
+            d->left.i      = nullptr;
             flags          = d->left.flags;
             d->left.flags  = d->right.flags;
             d->right.flags = flags;
@@ -503,25 +511,18 @@ free_data_compare(void *data)
 /*! \brief
  * Implementation for evaluate_compare() for integer values.
  *
- * \param[in]  top   Not used.
- * \param[in]  fr    Not used.
- * \param[in]  pbc   Not used.
  * \param[in]  g     Evaluation index group.
  * \param[out] out   Output data structure (\p out->u.g is used).
  * \param[in]  data  Should point to a \c t_methoddata_compare.
  */
 static void
-evaluate_compare_int(t_topology *top, t_trxframe *fr, t_pbc *pbc,
-                     gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data)
+evaluate_compare_int(gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data)
 {
     t_methoddata_compare *d = (t_methoddata_compare *)data;
     int                   i, i1, i2, ig;
     int                   a, b;
     bool                  bAccept;
 
-    GMX_UNUSED_VALUE(top);
-    GMX_UNUSED_VALUE(fr);
-    GMX_UNUSED_VALUE(pbc);
     for (i = i1 = i2 = ig = 0; i < g->isize; ++i)
     {
         a       = d->left.i[i1];
@@ -556,9 +557,6 @@ evaluate_compare_int(t_topology *top, t_trxframe *fr, t_pbc *pbc,
 /*! \brief
  * Implementation for evaluate_compare() if either value is non-integer.
  *
- * \param[in]  top   Not used.
- * \param[in]  fr    Not used.
- * \param[in]  pbc   Not used.
  * \param[in]  g     Evaluation index group.
  * \param[out] out   Output data structure (\p out->u.g is used).
  * \param[in]  data  Should point to a \c t_methoddata_compare.
@@ -567,17 +565,13 @@ evaluate_compare_int(t_topology *top, t_trxframe *fr, t_pbc *pbc,
  * This is ensured by the initialization method.
  */
 static void
-evaluate_compare_real(t_topology *top, t_trxframe *fr, t_pbc *pbc,
-                      gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data)
+evaluate_compare_real(gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data)
 {
     t_methoddata_compare *d = (t_methoddata_compare *)data;
     int                   i, i1, i2, ig;
     real                  a, b;
     bool                  bAccept;
 
-    GMX_UNUSED_VALUE(top);
-    GMX_UNUSED_VALUE(fr);
-    GMX_UNUSED_VALUE(pbc);
     for (i = i1 = i2 = ig = 0; i < g->isize; ++i)
     {
         a       = d->left.r[i1];
@@ -609,26 +603,18 @@ evaluate_compare_real(t_topology *top, t_trxframe *fr, t_pbc *pbc,
     out->u.g->isize = ig;
 }
 
-/*!
- * \param[in]  top   Not used.
- * \param[in]  fr    Not used.
- * \param[in]  pbc   Not used.
- * \param[in]  g     Evaluation index group.
- * \param[out] out   Output data structure (\p out->u.g is used).
- * \param[in]  data  Should point to a \c t_methoddata_compare.
- */
 static void
-evaluate_compare(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_compare(const gmx::SelMethodEvalContext & /*context*/,
                  gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data)
 {
     t_methoddata_compare *d = (t_methoddata_compare *)data;
 
     if (!((d->left.flags | d->right.flags) & CMP_REALVAL))
     {
-        evaluate_compare_int(top, fr, pbc, g, out, data);
+        evaluate_compare_int(g, out, data);
     }
     else
     {
-        evaluate_compare_real(top, fr, pbc, g, out, data);
+        evaluate_compare_real(g, out, data);
     }
 }
index e98d85c8ae0d299b676db116e53d7b53d956b896..5cf559d6ae52ff817dad671a07eacde44836d2f5 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
@@ -108,7 +108,7 @@ init_data_common(int npar, gmx_ana_selparam_t *param);
  * Also checks that the cutoff is valid.
  */
 static void
-init_common(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data);
+init_common(const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data);
 /** Frees the data allocated for a distance-based selection method. */
 static void
 free_data_common(void *data);
@@ -116,41 +116,39 @@ free_data_common(void *data);
  * Initializes the evaluation of a distance-based within selection method for a
  * frame.
  *
- * \param[in]  top  Not used.
- * \param[in]  fr   Current frame.
- * \param[in]  pbc  PBC structure.
- * \param      data Should point to a \c t_methoddata_distance.
+ * \param[in]  context Evaluation context.
+ * \param      data    Should point to a \c t_methoddata_distance.
  * \returns    0 on success, a non-zero error code on error.
  *
  * Initializes the neighborhood search for the current frame.
  */
 static void
-init_frame_common(t_topology *top, t_trxframe * fr, t_pbc *pbc, void *data);
+init_frame_common(const gmx::SelMethodEvalContext &context, void *data);
 /** Evaluates the \p distance selection method. */
 static void
-evaluate_distance(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_distance(const gmx::SelMethodEvalContext & /*context*/,
                   gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out, void *data);
 /** Evaluates the \p within selection method. */
 static void
-evaluate_within(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_within(const gmx::SelMethodEvalContext & /*context*/,
                 gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out, void *data);
 
 /** Parameters for the \p distance selection method. */
 static gmx_ana_selparam_t smparams_distance[] = {
-    {"cutoff", {REAL_VALUE, 1, {NULL}}, NULL, SPAR_OPTIONAL},
-    {"from",   {POS_VALUE,  1, {NULL}}, NULL, SPAR_DYNAMIC},
+    {"cutoff", {REAL_VALUE, 1, {nullptr}}, nullptr, SPAR_OPTIONAL},
+    {"from",   {POS_VALUE,  1, {nullptr}}, nullptr, SPAR_DYNAMIC},
 };
 
 /** Parameters for the \p mindistance selection method. */
 static gmx_ana_selparam_t smparams_mindistance[] = {
-    {"cutoff", {REAL_VALUE, 1, {NULL}}, NULL, SPAR_OPTIONAL},
-    {"from",   {POS_VALUE, -1, {NULL}}, NULL, SPAR_DYNAMIC | SPAR_VARNUM},
+    {"cutoff", {REAL_VALUE, 1, {nullptr}}, nullptr, SPAR_OPTIONAL},
+    {"from",   {POS_VALUE, -1, {nullptr}}, nullptr, SPAR_DYNAMIC | SPAR_VARNUM},
 };
 
 /** Parameters for the \p within selection method. */
 static gmx_ana_selparam_t smparams_within[] = {
-    {NULL, {REAL_VALUE,  1, {NULL}}, NULL, 0},
-    {"of", {POS_VALUE,  -1, {NULL}}, NULL, SPAR_DYNAMIC | SPAR_VARNUM},
+    {nullptr, {REAL_VALUE,  1, {nullptr}}, nullptr, 0},
+    {"of", {POS_VALUE,  -1, {nullptr}}, nullptr, SPAR_DYNAMIC | SPAR_VARNUM},
 };
 
 //! Help title for distance selection methods.
@@ -181,12 +179,12 @@ gmx_ana_selmethod_t sm_distance = {
     "distance", REAL_VALUE, SMETH_DYNAMIC,
     asize(smparams_distance), smparams_distance,
     &init_data_common,
-    NULL,
+    nullptr,
     &init_common,
-    NULL,
+    nullptr,
     &free_data_common,
     &init_frame_common,
-    NULL,
+    nullptr,
     &evaluate_distance,
     {"distance from POS [cutoff REAL]",
      helptitle_distance, asize(help_distance), help_distance},
@@ -197,12 +195,12 @@ gmx_ana_selmethod_t sm_mindistance = {
     "mindistance", REAL_VALUE, SMETH_DYNAMIC,
     asize(smparams_mindistance), smparams_mindistance,
     &init_data_common,
-    NULL,
+    nullptr,
     &init_common,
-    NULL,
+    nullptr,
     &free_data_common,
     &init_frame_common,
-    NULL,
+    nullptr,
     &evaluate_distance,
     {"mindistance from POS_EXPR [cutoff REAL]",
      helptitle_distance, asize(help_distance), help_distance},
@@ -213,12 +211,12 @@ gmx_ana_selmethod_t sm_within = {
     "within", GROUP_VALUE, SMETH_DYNAMIC,
     asize(smparams_within), smparams_within,
     &init_data_common,
-    NULL,
+    nullptr,
     &init_common,
-    NULL,
+    nullptr,
     &free_data_common,
     &init_frame_common,
-    NULL,
+    nullptr,
     &evaluate_within,
     {"within REAL of POS_EXPR",
      helptitle_distance, asize(help_distance), help_distance},
@@ -234,7 +232,7 @@ init_data_common(int /* npar */, gmx_ana_selparam_t *param)
 }
 
 static void
-init_common(t_topology * /* top */, int /* npar */, gmx_ana_selparam_t *param, void *data)
+init_common(const gmx_mtop_t * /* top */, int /* npar */, gmx_ana_selparam_t *param, void *data)
 {
     t_methoddata_distance *d = static_cast<t_methoddata_distance *>(data);
 
@@ -258,13 +256,13 @@ free_data_common(void *data)
 }
 
 static void
-init_frame_common(t_topology * /* top */, t_trxframe * /* fr */, t_pbc *pbc, void *data)
+init_frame_common(const gmx::SelMethodEvalContext &context, void *data)
 {
     t_methoddata_distance *d = static_cast<t_methoddata_distance *>(data);
 
     d->nbsearch.reset();
     gmx::AnalysisNeighborhoodPositions pos(d->p.x, d->p.count());
-    d->nbsearch = d->nb.initSearch(pbc, pos);
+    d->nbsearch = d->nb.initSearch(context.pbc, pos);
 }
 
 /*!
@@ -275,7 +273,7 @@ init_frame_common(t_topology * /* top */, t_trxframe * /* fr */, t_pbc *pbc, voi
  * and puts them in \p out->u.r.
  */
 static void
-evaluate_distance(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_distance(const gmx::SelMethodEvalContext & /*context*/,
                   gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out, void *data)
 {
     t_methoddata_distance *d = static_cast<t_methoddata_distance *>(data);
@@ -295,7 +293,7 @@ evaluate_distance(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc
  * \c t_methoddata_distance::xref and puts them in \p out.g.
  */
 static void
-evaluate_within(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_within(const gmx::SelMethodEvalContext & /*context*/,
                 gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out, void *data)
 {
     t_methoddata_distance *d = static_cast<t_methoddata_distance *>(data);
index 196a6575eb84a89ead8134c2c7cb90f64c1487dc..d9c23c5dab305f9559eb2fda8e7a8aefcd998e3e 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
@@ -257,29 +257,27 @@ init_data_insolidangle(int npar, gmx_ana_selparam_t *param);
  * and allocates memory for the bins used during the evaluation.
  */
 static void
-init_insolidangle(t_topology * top, int npar, gmx_ana_selparam_t * param, void *data);
+init_insolidangle(const gmx_mtop_t *top, int npar, gmx_ana_selparam_t * param, void *data);
 /** Frees the data allocated for the \p insolidangle selection method. */
 static void
 free_data_insolidangle(void *data);
 /*! \brief
  * Initializes the evaluation of the \p insolidangle selection method for a frame.
  *
- * \param[in]  top  Not used.
- * \param[in]  fr   Not used.
- * \param[in]  pbc  PBC structure.
- * \param      data Should point to a \ref t_methoddata_insolidangle.
+ * \param[in]  context Evaluation context.
+ * \param      data    Should point to a \ref t_methoddata_insolidangle.
  *
  * Creates a lookup structure that enables fast queries of whether a point
  * is within the solid angle or not.
  */
 static void
-init_frame_insolidangle(t_topology * top, t_trxframe * fr, t_pbc *pbc, void *data);
+init_frame_insolidangle(const gmx::SelMethodEvalContext &context, void *data);
 /** Internal helper function for evaluate_insolidangle(). */
 static bool
-accept_insolidangle(rvec x, t_pbc *pbc, void *data);
+accept_insolidangle(rvec x, const t_pbc *pbc, void *data);
 /** Evaluates the \p insolidangle selection method. */
 static void
-evaluate_insolidangle(t_topology * /* top */, t_trxframe * /* fr */, t_pbc *pbc,
+evaluate_insolidangle(const gmx::SelMethodEvalContext &context,
                       gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out, void *data);
 
 /** Calculates the distance between unit vectors. */
@@ -329,9 +327,9 @@ is_surface_covered(t_methoddata_insolidangle *surf, rvec x);
 
 /** Parameters for the \p insolidangle selection method. */
 static gmx_ana_selparam_t smparams_insolidangle[] = {
-    {"center", {POS_VALUE,   1, {NULL}}, NULL, SPAR_DYNAMIC},
-    {"span",   {POS_VALUE,  -1, {NULL}}, NULL, SPAR_DYNAMIC | SPAR_VARNUM},
-    {"cutoff", {REAL_VALUE,  1, {NULL}}, NULL, SPAR_OPTIONAL},
+    {"center", {POS_VALUE,   1, {nullptr}}, nullptr, SPAR_DYNAMIC},
+    {"span",   {POS_VALUE,  -1, {nullptr}}, nullptr, SPAR_DYNAMIC | SPAR_VARNUM},
+    {"cutoff", {REAL_VALUE,  1, {nullptr}}, nullptr, SPAR_OPTIONAL},
 };
 
 /** Help text for the \p insolidangle selection method. */
@@ -358,12 +356,12 @@ gmx_ana_selmethod_t sm_insolidangle = {
     "insolidangle", GROUP_VALUE, SMETH_DYNAMIC,
     asize(smparams_insolidangle), smparams_insolidangle,
     &init_data_insolidangle,
-    NULL,
+    nullptr,
     &init_insolidangle,
-    NULL,
+    nullptr,
     &free_data_insolidangle,
     &init_frame_insolidangle,
-    NULL,
+    nullptr,
     &evaluate_insolidangle,
     {"insolidangle center POS span POS_EXPR [cutoff REAL]",
      "Selecting atoms in a solid angle",
@@ -389,13 +387,13 @@ init_data_insolidangle(int /* npar */, gmx_ana_selparam_t *param)
     // cppcheck-suppress uninitdata
     data->tbinsize      = 0.0;
     // cppcheck-suppress uninitdata
-    data->tbin          = NULL;
+    data->tbin          = nullptr;
     // cppcheck-suppress uninitdata
     data->maxbins       = 0;
     // cppcheck-suppress uninitdata
     data->nbins         = 0;
     // cppcheck-suppress uninitdata
-    data->bin           = NULL;
+    data->bin           = nullptr;
 
     param[0].val.u.p = &data->center;
     param[1].val.u.p = &data->span;
@@ -404,7 +402,7 @@ init_data_insolidangle(int /* npar */, gmx_ana_selparam_t *param)
 }
 
 static void
-init_insolidangle(t_topology * /* top */, int /* npar */, gmx_ana_selparam_t * /* param */, void *data)
+init_insolidangle(const gmx_mtop_t * /* top */, int /* npar */, gmx_ana_selparam_t * /* param */, void *data)
 {
     t_methoddata_insolidangle *surf = (t_methoddata_insolidangle *)data;
     int                        i, c;
@@ -462,7 +460,7 @@ free_data_insolidangle(void *data)
 }
 
 static void
-init_frame_insolidangle(t_topology * /* top */, t_trxframe * /* fr */, t_pbc *pbc, void *data)
+init_frame_insolidangle(const gmx::SelMethodEvalContext &context, void *data)
 {
     t_methoddata_insolidangle *d = (t_methoddata_insolidangle *)data;
     rvec                       dx;
@@ -472,9 +470,9 @@ init_frame_insolidangle(t_topology * /* top */, t_trxframe * /* fr */, t_pbc *pb
     clear_surface_points(d);
     for (i = 0; i < d->span.count(); ++i)
     {
-        if (pbc)
+        if (context.pbc)
         {
-            pbc_dx(pbc, d->span.x[i], d->center.x[0], dx);
+            pbc_dx(context.pbc, d->span.x[i], d->center.x[0], dx);
         }
         else
         {
@@ -494,7 +492,7 @@ init_frame_insolidangle(t_topology * /* top */, t_trxframe * /* fr */, t_pbc *pb
  * \returns   true if \p x is within the solid angle, false otherwise.
  */
 static bool
-accept_insolidangle(rvec x, t_pbc *pbc, void *data)
+accept_insolidangle(rvec x, const t_pbc *pbc, void *data)
 {
     t_methoddata_insolidangle *d = (t_methoddata_insolidangle *)data;
     rvec                       dx;
@@ -520,13 +518,13 @@ accept_insolidangle(rvec x, t_pbc *pbc, void *data)
  * \c t_methoddata_insolidangle::center, and stores the result in \p out->u.g.
  */
 static void
-evaluate_insolidangle(t_topology * /* top */, t_trxframe * /* fr */, t_pbc *pbc,
+evaluate_insolidangle(const gmx::SelMethodEvalContext &context,
                       gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out, void *data)
 {
     out->u.g->isize = 0;
     for (int b = 0; b < pos->count(); ++b)
     {
-        if (accept_insolidangle(pos->x[b], pbc, data))
+        if (accept_insolidangle(pos->x[b], context.pbc, data))
         {
             gmx_ana_pos_add_to_group(out->u.g, pos, b);
         }
@@ -748,7 +746,7 @@ free_surface_points(t_methoddata_insolidangle *surf)
             sfree(surf->bin[i].x);
         }
         surf->bin[i].n_alloc = 0;
-        surf->bin[i].x       = NULL;
+        surf->bin[i].x       = nullptr;
     }
 }
 
index 5dbfc1833bcba4bd1d3783e5dc658bbace292345..3e020fb4bc7440b2f07caa5a29aeabfed47e57ef 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
@@ -104,7 +104,7 @@ init_data_kwstr(int npar, gmx_ana_selparam_t * param);
  * \param[in] data  Should point to \ref t_methoddata_kwint.
  */
 static void
-init_kwint(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data);
+init_kwint(const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data);
 /*! \brief
  * Initializes data for real keyword evaluation.
  *
@@ -115,7 +115,7 @@ init_kwint(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data);
  * \returns   0 (the initialization always succeeds).
  */
 static void
-init_kwreal(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data);
+init_kwreal(const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data);
 /*! \brief
  * Initializes data for string keyword evaluation.
  *
@@ -125,21 +125,21 @@ init_kwreal(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data);
  * \param[in] data  Should point to t_methoddata_kwstr.
  */
 static void
-init_kwstr(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data);
+init_kwstr(const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data);
 /** Frees the memory allocated for string keyword evaluation. */
 static void
 free_data_kwstr(void *data);
 /** Evaluates integer selection keywords. */
 static void
-evaluate_keyword_int(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_keyword_int(const gmx::SelMethodEvalContext &context,
                      gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
 /** Evaluates real selection keywords. */
 static void
-evaluate_keyword_real(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_keyword_real(const gmx::SelMethodEvalContext &context,
                       gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
 /** Evaluates string selection keywords. */
 static void
-evaluate_keyword_str(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_keyword_str(const gmx::SelMethodEvalContext &context,
                      gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
 
 /*! \internal \brief
@@ -274,20 +274,20 @@ struct t_methoddata_kwstr
 
 /** Parameters for integer keyword evaluation. */
 static gmx_ana_selparam_t smparams_keyword_int[] = {
-    {NULL, {INT_VALUE, -1, {NULL}}, NULL, SPAR_ATOMVAL},
-    {NULL, {INT_VALUE, -1, {NULL}}, NULL, SPAR_RANGES | SPAR_VARNUM},
+    {nullptr, {INT_VALUE, -1, {nullptr}}, nullptr, SPAR_ATOMVAL},
+    {nullptr, {INT_VALUE, -1, {nullptr}}, nullptr, SPAR_RANGES | SPAR_VARNUM},
 };
 
 /** Parameters for real keyword evaluation. */
 static gmx_ana_selparam_t smparams_keyword_real[] = {
-    {NULL, {REAL_VALUE, -1, {NULL}}, NULL, SPAR_ATOMVAL | SPAR_DYNAMIC},
-    {NULL, {REAL_VALUE, -1, {NULL}}, NULL, SPAR_RANGES | SPAR_VARNUM},
+    {nullptr, {REAL_VALUE, -1, {nullptr}}, nullptr, SPAR_ATOMVAL | SPAR_DYNAMIC},
+    {nullptr, {REAL_VALUE, -1, {nullptr}}, nullptr, SPAR_RANGES | SPAR_VARNUM},
 };
 
 /** Parameters for string keyword evaluation. */
 static gmx_ana_selparam_t smparams_keyword_str[] = {
-    {NULL, {STR_VALUE, -1, {NULL}}, NULL, SPAR_ATOMVAL},
-    {NULL, {STR_VALUE, -1, {NULL}}, NULL, SPAR_VARNUM},
+    {nullptr, {STR_VALUE, -1, {nullptr}}, nullptr, SPAR_ATOMVAL},
+    {nullptr, {STR_VALUE, -1, {nullptr}}, nullptr, SPAR_VARNUM},
 };
 
 /** Selection method data for integer keyword evaluation. */
@@ -295,14 +295,14 @@ gmx_ana_selmethod_t sm_keyword_int = {
     "kw_int", GROUP_VALUE, SMETH_SINGLEVAL,
     asize(smparams_keyword_int), smparams_keyword_int,
     &init_data_kwint,
-    NULL,
+    nullptr,
     &init_kwint,
-    NULL,
-    NULL,
-    NULL,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_keyword_int,
-    NULL,
-    {NULL, NULL, 0, NULL},
+    nullptr,
+    {nullptr, nullptr, 0, nullptr},
 };
 
 /** Selection method data for real keyword evaluation. */
@@ -310,14 +310,14 @@ gmx_ana_selmethod_t sm_keyword_real = {
     "kw_real", GROUP_VALUE, SMETH_SINGLEVAL,
     asize(smparams_keyword_real), smparams_keyword_real,
     &init_data_kwreal,
-    NULL,
+    nullptr,
     &init_kwreal,
-    NULL,
-    NULL,
-    NULL,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_keyword_real,
-    NULL,
-    {NULL, NULL, 0, NULL},
+    nullptr,
+    {nullptr, nullptr, 0, nullptr},
 };
 
 /** Selection method data for string keyword evaluation. */
@@ -325,14 +325,14 @@ gmx_ana_selmethod_t sm_keyword_str = {
     "kw_str", GROUP_VALUE, SMETH_SINGLEVAL,
     asize(smparams_keyword_str), smparams_keyword_str,
     &init_data_kwstr,
-    NULL,
+    nullptr,
     &init_kwstr,
-    NULL,
+    nullptr,
     &free_data_kwstr,
-    NULL,
+    nullptr,
     &evaluate_keyword_str,
-    NULL,
-    {NULL, NULL, 0, NULL},
+    nullptr,
+    {nullptr, nullptr, 0, nullptr},
 };
 
 /*! \brief
@@ -347,7 +347,7 @@ gmx_ana_selmethod_t sm_keyword_str = {
  * Calls the initialization method of the wrapped keyword.
  */
 static void
-init_kweval(t_topology *top, int npar, gmx_ana_selparam_t * param, void *data);
+init_kweval(const gmx_mtop_t *top, int npar, gmx_ana_selparam_t * param, void *data);
 /*! \brief
  * Initializes output for keyword evaluation in an arbitrary group.
  *
@@ -357,13 +357,13 @@ init_kweval(t_topology *top, int npar, gmx_ana_selparam_t * param, void *data);
  * \returns       0 for success.
  */
 static void
-init_output_kweval(t_topology *top, gmx_ana_selvalue_t *out, void *data);
+init_output_kweval(const gmx_mtop_t *top, gmx_ana_selvalue_t *out, void *data);
 /** Frees the data allocated for keyword evaluation in an arbitrary group. */
 static void
 free_data_kweval(void *data);
 /** Initializes frame evaluation for keyword evaluation in an arbitrary group. */
 static void
-init_frame_kweval(t_topology *top, t_trxframe *fr, t_pbc *pbc, void *data);
+init_frame_kweval(const gmx::SelMethodEvalContext &context, void *data);
 /*! \brief
  * Evaluates keywords in an arbitrary group.
  *
@@ -375,7 +375,7 @@ init_frame_kweval(t_topology *top, t_trxframe *fr, t_pbc *pbc, void *data);
  * evaluation group.
  */
 static void
-evaluate_kweval(t_topology *top, t_trxframe *fr, t_pbc *pbc, gmx_ana_index_t *g,
+evaluate_kweval(const gmx::SelMethodEvalContext &context, gmx_ana_index_t *g,
                 gmx_ana_selvalue_t *out, void *data);
 /*! \brief
  * Evaluates keywords in an arbitrary set of positions.
@@ -388,7 +388,7 @@ evaluate_kweval(t_topology *top, t_trxframe *fr, t_pbc *pbc, gmx_ana_index_t *g,
  * evaluation positions.
  */
 static void
-evaluate_kweval_pos(t_topology *top, t_trxframe *fr, t_pbc *pbc, gmx_ana_index_t *g,
+evaluate_kweval_pos(const gmx::SelMethodEvalContext &context, gmx_ana_index_t *g,
                     gmx_ana_selvalue_t *out, void *data);
 
 /*! \internal \brief
@@ -419,11 +419,11 @@ struct t_methoddata_kweval
 
 /** Parameters for keyword evaluation in an arbitrary group. */
 static gmx_ana_selparam_t smparams_kweval_group[] = {
-    {NULL,   {GROUP_VALUE, 1, {NULL}}, NULL, SPAR_DYNAMIC},
+    {nullptr,   {GROUP_VALUE, 1, {nullptr}}, nullptr, SPAR_DYNAMIC},
 };
 /** Parameters for keyword evaluation from positions. */
 static gmx_ana_selparam_t smparams_kweval_pos[] = {
-    {NULL,   {POS_VALUE, 1, {NULL}}, NULL, SPAR_DYNAMIC},
+    {nullptr,   {POS_VALUE, 1, {nullptr}}, nullptr, SPAR_DYNAMIC},
 };
 
 
@@ -441,7 +441,7 @@ init_data_kwint(int  /* npar */, gmx_ana_selparam_t * /* param */)
 }
 
 static void
-init_kwint(t_topology * /* top */, int /* npar */, gmx_ana_selparam_t *param, void *data)
+init_kwint(const gmx_mtop_t * /* top */, int /* npar */, gmx_ana_selparam_t *param, void *data)
 {
     t_methoddata_kwint *d = (t_methoddata_kwint *)data;
 
@@ -459,7 +459,7 @@ init_kwint(t_topology * /* top */, int /* npar */, gmx_ana_selparam_t *param, vo
  * Matching atoms are stored in \p out->u.g.
  */
 static void
-evaluate_keyword_int(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_keyword_int(const gmx::SelMethodEvalContext & /*context*/,
                      gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data)
 {
     t_methoddata_kwint *d = (t_methoddata_kwint *)data;
@@ -516,7 +516,7 @@ init_data_kwreal(int /* npar */, gmx_ana_selparam_t * /* param */)
 }
 
 static void
-init_kwreal(t_topology * /* top */, int /* npar */, gmx_ana_selparam_t *param, void *data)
+init_kwreal(const gmx_mtop_t * /* top */, int /* npar */, gmx_ana_selparam_t *param, void *data)
 {
     t_methoddata_kwreal *d = (t_methoddata_kwreal *)data;
 
@@ -534,7 +534,7 @@ init_kwreal(t_topology * /* top */, int /* npar */, gmx_ana_selparam_t *param, v
  * Matching atoms are stored in \p out->u.g.
  */
 static void
-evaluate_keyword_real(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_keyword_real(const gmx::SelMethodEvalContext & /*context*/,
                       gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data)
 {
     t_methoddata_kwreal *d = (t_methoddata_kwreal *)data;
@@ -610,7 +610,7 @@ _gmx_selelem_set_kwstr_match_type(const gmx::SelectionTreeElementPointer &sel,
 }
 
 static void
-init_kwstr(t_topology * /* top */, int /* npar */, gmx_ana_selparam_t *param, void *data)
+init_kwstr(const gmx_mtop_t * /* top */, int /* npar */, gmx_ana_selparam_t *param, void *data)
 {
     t_methoddata_kwstr *d = static_cast<t_methoddata_kwstr *>(data);
 
@@ -625,7 +625,7 @@ init_kwstr(t_topology * /* top */, int /* npar */, gmx_ana_selparam_t *param, vo
     for (int i = 0; i < n; ++i)
     {
         const char *s = param[1].val.u.s[i];
-        d->matches.push_back(StringKeywordMatchItem(d->matchType, s));
+        d->matches.emplace_back(d->matchType, s);
     }
 }
 
@@ -649,7 +649,7 @@ free_data_kwstr(void *data)
  * Matching atoms are stored in \p out->u.g.
  */
 static void
-evaluate_keyword_str(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_keyword_str(const gmx::SelMethodEvalContext & /*context*/,
                      gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data)
 {
     t_methoddata_kwstr *d = static_cast<t_methoddata_kwstr *>(data);
@@ -674,15 +674,15 @@ evaluate_keyword_str(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* p
  ********************************************************************/
 
 static void
-init_kweval(t_topology *top, int /* npar */, gmx_ana_selparam_t * /* param */, void *data)
+init_kweval(const gmx_mtop_t *top, int /* npar */, gmx_ana_selparam_t * /* param */, void *data)
 {
     t_methoddata_kweval *d = static_cast<t_methoddata_kweval *>(data);
 
-    d->kwmethod->init(top, 0, NULL, d->kwmdata);
+    d->kwmethod->init(top, 0, nullptr, d->kwmdata);
 }
 
 static void
-init_output_kweval(t_topology * /* top */, gmx_ana_selvalue_t *out, void *data)
+init_output_kweval(const gmx_mtop_t * /* top */, gmx_ana_selvalue_t *out, void *data)
 {
     t_methoddata_kweval *d = static_cast<t_methoddata_kweval *>(data);
 
@@ -704,39 +704,33 @@ free_data_kweval(void *data)
 }
 
 /*!
- * \param[in]  top  Topology.
- * \param[in]  fr   Current frame.
- * \param[in]  pbc  PBC structure.
+ * \param[in]  context  Evaluation context.
  * \param      data Should point to a \ref t_methoddata_kweval.
- * \returns    0 on success, a non-zero error code on error.
- *
- * Creates a lookup structure that enables fast queries of whether a point
- * is within the solid angle or not.
  */
 static void
-init_frame_kweval(t_topology *top, t_trxframe *fr, t_pbc *pbc, void *data)
+init_frame_kweval(const gmx::SelMethodEvalContext &context, void *data)
 {
     t_methoddata_kweval *d = static_cast<t_methoddata_kweval *>(data);
 
-    d->kwmethod->init_frame(top, fr, pbc, d->kwmdata);
+    d->kwmethod->init_frame(context, d->kwmdata);
 }
 
 static void
-evaluate_kweval(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_kweval(const gmx::SelMethodEvalContext &context,
                 gmx_ana_index_t * /* g */, gmx_ana_selvalue_t *out, void *data)
 {
     t_methoddata_kweval *d = static_cast<t_methoddata_kweval *>(data);
 
-    d->kwmethod->update(top, fr, pbc, &d->g, out, d->kwmdata);
+    d->kwmethod->update(context, &d->g, out, d->kwmdata);
 }
 
 static void
-evaluate_kweval_pos(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_kweval_pos(const gmx::SelMethodEvalContext &context,
                     gmx_ana_index_t * /* g */, gmx_ana_selvalue_t *out, void *data)
 {
     t_methoddata_kweval *d = static_cast<t_methoddata_kweval *>(data);
 
-    d->kwmethod->pupdate(top, fr, pbc, &d->p, out, d->kwmdata);
+    d->kwmethod->pupdate(context, &d->p, out, d->kwmdata);
 }
 
 /*! \brief
@@ -777,14 +771,14 @@ init_evaluator_group(gmx_ana_selmethod_t                     *method,
     sel->u.expr.method->name         = data->kwmethod->name;
     sel->u.expr.method->type         = data->kwmethod->type;
     sel->u.expr.method->flags        = data->kwmethod->flags | SMETH_VARNUMVAL;
-    sel->u.expr.method->init_data    = NULL;
-    sel->u.expr.method->set_poscoll  = NULL;
-    sel->u.expr.method->init         = method->init ? &init_kweval : NULL;
+    sel->u.expr.method->init_data    = nullptr;
+    sel->u.expr.method->set_poscoll  = nullptr;
+    sel->u.expr.method->init         = method->init ? &init_kweval : nullptr;
     sel->u.expr.method->outinit      = &init_output_kweval;
     sel->u.expr.method->free         = &free_data_kweval;
-    sel->u.expr.method->init_frame   = method->init_frame ? &init_frame_kweval : NULL;
+    sel->u.expr.method->init_frame   = method->init_frame ? &init_frame_kweval : nullptr;
     sel->u.expr.method->update       = &evaluate_kweval;
-    sel->u.expr.method->pupdate      = NULL;
+    sel->u.expr.method->pupdate      = nullptr;
     sel->u.expr.method->nparams      = asize(smparams_kweval_group);
     sel->u.expr.method->param        = smparams_kweval_group;
     _gmx_selelem_init_method_params(sel, scanner);
@@ -814,7 +808,7 @@ init_evaluator_pos(gmx_ana_selmethod_t                     *method,
                    void                                    *scanner)
 {
     if ((method->flags & (SMETH_SINGLEVAL | SMETH_VARNUMVAL))
-        || method->outinit || method->pupdate == NULL)
+        || method->outinit || method->pupdate == nullptr)
     {
         std::string message
             = gmx::formatString("Keyword '%s' cannot be evaluated in this context",
@@ -834,14 +828,14 @@ init_evaluator_pos(gmx_ana_selmethod_t                     *method,
     sel->u.expr.method->name         = data->kwmethod->name;
     sel->u.expr.method->type         = data->kwmethod->type;
     sel->u.expr.method->flags        = data->kwmethod->flags | SMETH_SINGLEVAL;
-    sel->u.expr.method->init_data    = NULL;
-    sel->u.expr.method->set_poscoll  = NULL;
-    sel->u.expr.method->init         = method->init ? &init_kweval : NULL;
-    sel->u.expr.method->outinit      = NULL;
+    sel->u.expr.method->init_data    = nullptr;
+    sel->u.expr.method->set_poscoll  = nullptr;
+    sel->u.expr.method->init         = method->init ? &init_kweval : nullptr;
+    sel->u.expr.method->outinit      = nullptr;
     sel->u.expr.method->free         = &free_data_kweval;
-    sel->u.expr.method->init_frame   = method->init_frame ? &init_frame_kweval : NULL;
+    sel->u.expr.method->init_frame   = method->init_frame ? &init_frame_kweval : nullptr;
     sel->u.expr.method->update       = &evaluate_kweval_pos;
-    sel->u.expr.method->pupdate      = NULL;
+    sel->u.expr.method->pupdate      = nullptr;
     sel->u.expr.method->nparams      = asize(smparams_kweval_pos);
     sel->u.expr.method->param        = smparams_kweval_pos;
     _gmx_selelem_init_method_params(sel, scanner);
@@ -861,7 +855,7 @@ _gmx_sel_init_keyword_evaluator(gmx_ana_selmethod_t                    *method,
 {
     gmx::SelectionParserParameterList    params;
     params.push_back(
-            gmx::SelectionParserParameter::createFromExpression(NULL, child));
+            gmx::SelectionParserParameter::createFromExpression(nullptr, child));
     if (child->v.type == GROUP_VALUE)
     {
         return init_evaluator_group(method, params, scanner);
index 5be901d7aea51eb70dc629a516fa2e58d206d729..db4505375281cbafeec7ec1b7fcf6c47801edcff 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
@@ -76,48 +76,44 @@ init_data_merge(int npar, gmx_ana_selparam_t *param);
  * \returns   0 if everything is successful, -1 on error.
  */
 static void
-init_merge(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data);
+init_merge(const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data);
 /** Initializes output for the \p merge selection modifier. */
 static void
-init_output_merge(t_topology *top, gmx_ana_selvalue_t *out, void *data);
+init_output_merge(const gmx_mtop_t *top, gmx_ana_selvalue_t *out, void *data);
 /** Initializes output for the \p plus selection modifier. */
 static void
-init_output_plus(t_topology *top, gmx_ana_selvalue_t *out, void *data);
+init_output_plus(const gmx_mtop_t *top, gmx_ana_selvalue_t *out, void *data);
 /** Frees the memory allocated for the merging selection modifiers. */
 static void
 free_data_merge(void *data);
 /*! \brief
  * Evaluates the \p merge selection modifier.
  *
- * \param[in]  top   Not used.
- * \param[in]  fr    Not used.
- * \param[in]  pbc   Not used.
+ * \param[in]  context Not used.
  * \param[in]  p     Positions to merge (should point to \p data->p1).
  * \param[out] out   Output data structure (\p out->u.p is used).
  * \param[in]  data  Should point to a \p t_methoddata_merge.
  */
 static void
-evaluate_merge(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_merge(const gmx::SelMethodEvalContext &context,
                gmx_ana_pos_t * p, gmx_ana_selvalue_t *out, void *data);
 /*! \brief
  * Evaluates the \p plus selection modifier.
  *
- * \param[in]  top   Not used.
- * \param[in]  fr    Not used.
- * \param[in]  pbc   Not used.
+ * \param[in]  context Not used.
  * \param[in]  p     Positions to merge (should point to \p data->p1).
  * \param[out] out   Output data structure (\p out->u.p is used).
  * \param[in]  data  Should point to a \p t_methoddata_merge.
  */
 static void
-evaluate_plus(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_plus(const gmx::SelMethodEvalContext &context,
               gmx_ana_pos_t * p, gmx_ana_selvalue_t *out, void *data);
 
 /** Parameters for the merging selection modifiers. */
 static gmx_ana_selparam_t smparams_merge[] = {
-    {NULL,       {POS_VALUE, -1, {NULL}}, NULL, SPAR_DYNAMIC | SPAR_VARNUM},
-    {NULL,       {POS_VALUE, -1, {NULL}}, NULL, SPAR_DYNAMIC | SPAR_VARNUM},
-    {"stride",   {INT_VALUE,  1, {NULL}}, NULL, SPAR_OPTIONAL},
+    {nullptr,       {POS_VALUE, -1, {nullptr}}, nullptr, SPAR_DYNAMIC | SPAR_VARNUM},
+    {nullptr,       {POS_VALUE, -1, {nullptr}}, nullptr, SPAR_DYNAMIC | SPAR_VARNUM},
+    {"stride",   {INT_VALUE,  1, {nullptr}}, nullptr, SPAR_OPTIONAL},
 };
 
 //! Help title for the merging selection modifiers.
@@ -153,12 +149,12 @@ gmx_ana_selmethod_t sm_merge = {
     "merge", POS_VALUE, SMETH_MODIFIER,
     asize(smparams_merge), smparams_merge,
     &init_data_merge,
-    NULL,
+    nullptr,
     &init_merge,
     &init_output_merge,
     &free_data_merge,
-    NULL,
-    NULL,
+    nullptr,
+    nullptr,
     &evaluate_merge,
     {"merge POSEXPR", helptitle_merge, asize(help_merge), help_merge},
 };
@@ -168,12 +164,12 @@ gmx_ana_selmethod_t sm_plus = {
     "plus", POS_VALUE, SMETH_MODIFIER,
     asize(smparams_merge)-1, smparams_merge,
     &init_data_merge,
-    NULL,
+    nullptr,
     &init_merge,
     &init_output_plus,
     &free_data_merge,
-    NULL,
-    NULL,
+    nullptr,
+    nullptr,
     &evaluate_plus,
     {"plus POSEXPR", helptitle_merge, asize(help_merge), help_merge},
 };
@@ -201,7 +197,7 @@ init_data_merge(int npar, gmx_ana_selparam_t *param)
 }
 
 static void
-init_merge(t_topology * /* top */, int /* npar */, gmx_ana_selparam_t * /* param */, void *data)
+init_merge(const gmx_mtop_t * /* top */, int /* npar */, gmx_ana_selparam_t * /* param */, void *data)
 {
     t_methoddata_merge *d = (t_methoddata_merge *)data;
 
@@ -228,7 +224,7 @@ init_merge(t_topology * /* top */, int /* npar */, gmx_ana_selparam_t * /* param
  * \param[in,out] data  Should point to \c t_methoddata_merge.
  */
 static void
-init_output_common(t_topology *top, gmx_ana_selvalue_t *out, void *data)
+init_output_common(const gmx_mtop_t *top, gmx_ana_selvalue_t *out, void *data)
 {
     t_methoddata_merge *d = (t_methoddata_merge *)data;
 
@@ -244,7 +240,7 @@ init_output_common(t_topology *top, gmx_ana_selvalue_t *out, void *data)
     }
     gmx_ana_pos_reserve_for_append(out->u.p, d->p1.count() + d->p2.count(),
                                    d->p1.m.b.nra + d->p2.m.b.nra,
-                                   d->p1.v != NULL, d->p1.f != NULL);
+                                   d->p1.v != nullptr, d->p1.f != nullptr);
     gmx_ana_pos_empty_init(out->u.p);
 }
 
@@ -254,7 +250,7 @@ init_output_common(t_topology *top, gmx_ana_selvalue_t *out, void *data)
  * \param[in,out] data  Should point to \c t_methoddata_merge.
  */
 static void
-init_output_merge(t_topology *top, gmx_ana_selvalue_t *out, void *data)
+init_output_merge(const gmx_mtop_t *top, gmx_ana_selvalue_t *out, void *data)
 {
     t_methoddata_merge *d = (t_methoddata_merge *)data;
     int                 i, j;
@@ -276,7 +272,7 @@ init_output_merge(t_topology *top, gmx_ana_selvalue_t *out, void *data)
  * \param[in,out] data  Should point to \c t_methoddata_merge.
  */
 static void
-init_output_plus(t_topology *top, gmx_ana_selvalue_t *out, void *data)
+init_output_plus(const gmx_mtop_t *top, gmx_ana_selvalue_t *out, void *data)
 {
     t_methoddata_merge *d = (t_methoddata_merge *)data;
     int                 i;
@@ -305,7 +301,7 @@ free_data_merge(void *data)
 }
 
 static void
-evaluate_merge(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_merge(const gmx::SelMethodEvalContext & /*context*/,
                gmx_ana_pos_t * /* p */, gmx_ana_selvalue_t *out, void *data)
 {
     t_methoddata_merge *d = (t_methoddata_merge *)data;
@@ -335,7 +331,7 @@ evaluate_merge(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
 }
 
 static void
-evaluate_plus(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_plus(const gmx::SelMethodEvalContext & /*context*/,
               gmx_ana_pos_t * /* p */, gmx_ana_selvalue_t *out, void *data)
 {
     t_methoddata_merge *d = (t_methoddata_merge *)data;
index 5ca87fc698b4cfa1461236451567ec486111a687..9328c7b96f22e55699232466280b811e71aa97e6 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
@@ -87,7 +87,7 @@ init_data_permute(int npar, gmx_ana_selparam_t *param);
  * \returns   0 if the input permutation is valid, -1 on error.
  */
 static void
-init_permute(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data);
+init_permute(const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data);
 /*! \brief
  * Initializes output for the \p permute selection modifier.
  *
@@ -96,32 +96,29 @@ init_permute(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data);
  * \param[in,out] data  Should point to \c t_methoddata_permute.
  */
 static void
-init_output_permute(t_topology *top, gmx_ana_selvalue_t *out, void *data);
+init_output_permute(const gmx_mtop_t *top, gmx_ana_selvalue_t *out, void *data);
 /** Frees the memory allocated for the \p permute selection modifier. */
 static void
 free_data_permute(void *data);
-static void
 /*! \brief
  * Evaluates the \p permute selection modifier.
  *
- * \param[in]  top   Not used.
- * \param[in]  fr    Not used.
- * \param[in]  pbc   Not used.
+ * \param[in]  context Not used.
  * \param[in]  p     Positions to permute (should point to \p data->p).
  * \param[out] out   Output data structure (\p out->u.p is used).
  * \param[in]  data  Should point to a \p t_methoddata_permute.
- * \returns    0 if \p p could be permuted, -1 on error.
  *
- * Returns -1 if the size of \p p is not divisible by the number of
+ * Throws if the size of \p p is not divisible by the number of
  * elements in the permutation.
  */
-evaluate_permute(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+static void
+evaluate_permute(const gmx::SelMethodEvalContext &context,
                  gmx_ana_pos_t *p, gmx_ana_selvalue_t *out, void *data);
 
 /** Parameters for the \p permute selection modifier. */
 static gmx_ana_selparam_t smparams_permute[] = {
-    {NULL,       {POS_VALUE, -1, {NULL}}, NULL, SPAR_DYNAMIC | SPAR_VARNUM},
-    {NULL,       {INT_VALUE, -1, {NULL}}, NULL, SPAR_VARNUM},
+    {nullptr,       {POS_VALUE, -1, {nullptr}}, nullptr, SPAR_DYNAMIC | SPAR_VARNUM},
+    {nullptr,       {INT_VALUE, -1, {nullptr}}, nullptr, SPAR_VARNUM},
 };
 
 /** Help text for the \p permute selection modifier. */
@@ -148,12 +145,12 @@ gmx_ana_selmethod_t sm_permute = {
     "permute", POS_VALUE, SMETH_MODIFIER,
     asize(smparams_permute), smparams_permute,
     &init_data_permute,
-    NULL,
+    nullptr,
     &init_permute,
     &init_output_permute,
     &free_data_permute,
-    NULL,
-    NULL,
+    nullptr,
+    nullptr,
     &evaluate_permute,
     {"POSEXPR permute P1 ... PN",
      "Permuting selections", asize(help_permute), help_permute},
@@ -164,14 +161,14 @@ init_data_permute(int /* npar */, gmx_ana_selparam_t *param)
 {
     t_methoddata_permute *data = new t_methoddata_permute();
     data->n          = 0;
-    data->perm       = NULL;
-    data->rperm      = NULL;
+    data->perm       = nullptr;
+    data->rperm      = nullptr;
     param[0].val.u.p = &data->p;
     return data;
 }
 
 static void
-init_permute(t_topology * /* top */, int /* npar */, gmx_ana_selparam_t *param, void *data)
+init_permute(const gmx_mtop_t * /* top */, int /* npar */, gmx_ana_selparam_t *param, void *data)
 {
     t_methoddata_permute *d = (t_methoddata_permute *)data;
     int                   i;
@@ -204,14 +201,14 @@ init_permute(t_topology * /* top */, int /* npar */, gmx_ana_selparam_t *param,
 }
 
 static void
-init_output_permute(t_topology * /* top */, gmx_ana_selvalue_t *out, void *data)
+init_output_permute(const gmx_mtop_t * /* top */, gmx_ana_selvalue_t *out, void *data)
 {
     t_methoddata_permute *d = (t_methoddata_permute *)data;
     int                   i, j, b;
 
     out->u.p->m.type = d->p.m.type;
     gmx_ana_pos_reserve_for_append(out->u.p, d->p.count(), d->p.m.b.nra,
-                                   d->p.v != NULL, d->p.f != NULL);
+                                   d->p.v != nullptr, d->p.f != nullptr);
     gmx_ana_pos_empty_init(out->u.p);
     for (i = 0; i < d->p.count(); i += d->n)
     {
@@ -238,7 +235,7 @@ free_data_permute(void *data)
 }
 
 static void
-evaluate_permute(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_permute(const gmx::SelMethodEvalContext & /*context*/,
                  gmx_ana_pos_t * /*p*/, gmx_ana_selvalue_t *out, void *data)
 {
     t_methoddata_permute *d = (t_methoddata_permute *)data;
index 2db9245eef3e5e89787be87fc2f379466358dbab..d1b1f457b16b41058ab67121eb2c0279f7d35dba 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
@@ -90,7 +90,7 @@ set_poscoll_pos(gmx::PositionCalculationCollection *pcc, void *data);
  * externally using _gmx_selelem_set_kwpos_type().
  */
 static void
-init_kwpos(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data);
+init_kwpos(const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data);
 /*! \brief
  * Initializes the \p cog selection method.
  *
@@ -101,7 +101,7 @@ init_kwpos(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data);
  * \returns       0 on success, a non-zero error code on error.
  */
 static void
-init_cog(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data);
+init_cog(const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data);
 /*! \brief
  * Initializes the \p cog selection method.
  *
@@ -112,7 +112,7 @@ init_cog(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data);
  * \returns       0 on success, a non-zero error code on error.
  */
 static void
-init_com(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data);
+init_com(const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data);
 /*! \brief
  * Initializes output for position evaluation selection methods.
  *
@@ -122,23 +122,24 @@ init_com(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data);
  * \returns       0 for success.
  */
 static void
-init_output_pos(t_topology *top, gmx_ana_selvalue_t *out, void *data);
+init_output_pos(const gmx_mtop_t *top, gmx_ana_selvalue_t *out, void *data);
 /** Frees the data allocated for position evaluation selection methods. */
 static void
 free_data_pos(void *data);
 /** Evaluates position evaluation selection methods. */
 static void
-evaluate_pos(t_topology * /* top */, t_trxframe *fr, t_pbc *pbc, gmx_ana_index_t * /* g */, gmx_ana_selvalue_t *out, void *data);
+evaluate_pos(const gmx::SelMethodEvalContext &context,
+             gmx_ana_index_t * /* g */, gmx_ana_selvalue_t *out, void *data);
 
 /** Parameters for position keyword evaluation. */
 static gmx_ana_selparam_t smparams_keyword_pos[] = {
-    {NULL,   {GROUP_VALUE, 1, {NULL}}, NULL, SPAR_DYNAMIC},
+    {nullptr,   {GROUP_VALUE, 1, {nullptr}}, nullptr, SPAR_DYNAMIC},
 };
 
 /** Parameters for the \p cog and \p com selection methods. */
 static gmx_ana_selparam_t smparams_com[] = {
-    {"of",   {GROUP_VALUE, 1, {NULL}}, NULL, SPAR_DYNAMIC},
-    {"pbc",  {NO_VALUE,    0, {NULL}}, NULL, 0},
+    {"of",   {GROUP_VALUE, 1, {nullptr}}, nullptr, SPAR_DYNAMIC},
+    {"pbc",  {NO_VALUE,    0, {nullptr}}, nullptr, 0},
 };
 
 /** Selection method data for position keyword evaluation. */
@@ -150,10 +151,10 @@ gmx_ana_selmethod_t sm_keyword_pos = {
     &init_kwpos,
     &init_output_pos,
     &free_data_pos,
-    NULL,
+    nullptr,
     &evaluate_pos,
-    NULL,
-    {NULL, NULL, 0, NULL},
+    nullptr,
+    {nullptr, nullptr, 0, nullptr},
 };
 
 /** Selection method data for the \p cog method. */
@@ -165,25 +166,25 @@ gmx_ana_selmethod_t sm_cog = {
     &init_cog,
     &init_output_pos,
     &free_data_pos,
-    NULL,
+    nullptr,
     &evaluate_pos,
-    NULL,
-    {"cog of ATOM_EXPR [pbc]", NULL, 0, NULL},
+    nullptr,
+    {"cog of ATOM_EXPR [pbc]", nullptr, 0, nullptr},
 };
 
 /** Selection method data for the \p com method. */
 gmx_ana_selmethod_t sm_com = {
-    "com", POS_VALUE, SMETH_REQTOP | SMETH_DYNAMIC | SMETH_SINGLEVAL,
+    "com", POS_VALUE, SMETH_REQMASS | SMETH_DYNAMIC | SMETH_SINGLEVAL,
     asize(smparams_com), smparams_com,
     &init_data_pos,
     &set_poscoll_pos,
     &init_com,
     &init_output_pos,
     &free_data_pos,
-    NULL,
+    nullptr,
     &evaluate_pos,
-    NULL,
-    {"com of ATOM_EXPR [pbc]", NULL, 0, NULL},
+    nullptr,
+    {"com of ATOM_EXPR [pbc]", nullptr, 0, nullptr},
 };
 
 /*!
@@ -208,9 +209,9 @@ init_data_pos(int npar, gmx_ana_selparam_t *param)
     {
         param[1].val.u.b = &data->bPBC;
     }
-    data->pc       = NULL;
+    data->pc       = nullptr;
     data->bPBC     = false;
-    data->type     = NULL;
+    data->type     = nullptr;
     data->flags    = -1;
     return data;
 }
@@ -235,7 +236,30 @@ _gmx_selelem_is_default_kwpos(const gmx::SelectionTreeElement &sel)
     }
 
     t_methoddata_pos *d = static_cast<t_methoddata_pos *>(sel.u.expr.mdata);
-    return d->type == NULL;
+    return d->type == nullptr;
+}
+
+/*! \brief
+ * Updates selection method flags about required topology information.
+ *
+ * Sets the flags to require topology and/or masses if the position calculation
+ * requires them.
+ */
+static void set_pos_method_flags(gmx_ana_selmethod_t *method,
+                                 t_methoddata_pos    *d)
+{
+    const bool forces = (d->flags != -1 && (d->flags & POS_FORCES));
+    switch (gmx::PositionCalculationCollection::requiredTopologyInfoForType(d->type, forces))
+    {
+        case gmx::PositionCalculationCollection::RequiredTopologyInfo::TopologyAndMasses:
+            method->flags |= SMETH_REQMASS;
+        // fallthrough
+        case gmx::PositionCalculationCollection::RequiredTopologyInfo::Topology:
+            method->flags |= SMETH_REQTOP;
+            break;
+        case gmx::PositionCalculationCollection::RequiredTopologyInfo::None:
+            break;
+    }
 }
 
 /*!
@@ -259,12 +283,8 @@ _gmx_selelem_set_kwpos_type(gmx::SelectionTreeElement *sel, const char *type)
     }
     if (!d->type && type)
     {
-        d->type  = gmx_strdup(type);
-        /* FIXME: It would be better not to have the string here hardcoded. */
-        if (type[0] != 'a')
-        {
-            sel->u.expr.method->flags |= SMETH_REQTOP;
-        }
+        d->type = gmx_strdup(type);
+        set_pos_method_flags(sel->u.expr.method, d);
     }
 }
 
@@ -289,12 +309,15 @@ _gmx_selelem_set_kwpos_flags(gmx::SelectionTreeElement *sel, int flags)
     }
     if (d->flags == -1)
     {
+        GMX_RELEASE_ASSERT(d->type != nullptr,
+                           "Position type should be set before flags");
         d->flags = flags;
+        set_pos_method_flags(sel->u.expr.method, d);
     }
 }
 
 static void
-init_kwpos(t_topology * /* top */, int /* npar */, gmx_ana_selparam_t *param, void *data)
+init_kwpos(const gmx_mtop_t * /* top */, int /* npar */, gmx_ana_selparam_t *param, void *data)
 {
     t_methoddata_pos *d = (t_methoddata_pos *)data;
 
@@ -311,7 +334,7 @@ init_kwpos(t_topology * /* top */, int /* npar */, gmx_ana_selparam_t *param, vo
 }
 
 static void
-init_cog(t_topology * /* top */, int /* npar */, gmx_ana_selparam_t *param, void *data)
+init_cog(const gmx_mtop_t * /* top */, int /* npar */, gmx_ana_selparam_t *param, void *data)
 {
     t_methoddata_pos *d = (t_methoddata_pos *)data;
 
@@ -321,7 +344,7 @@ init_cog(t_topology * /* top */, int /* npar */, gmx_ana_selparam_t *param, void
 }
 
 static void
-init_com(t_topology * /* top */, int /* npar */, gmx_ana_selparam_t *param, void *data)
+init_com(const gmx_mtop_t * /* top */, int /* npar */, gmx_ana_selparam_t *param, void *data)
 {
     t_methoddata_pos *d = (t_methoddata_pos *)data;
 
@@ -332,7 +355,7 @@ init_com(t_topology * /* top */, int /* npar */, gmx_ana_selparam_t *param, void
 }
 
 static void
-init_output_pos(t_topology * /* top */, gmx_ana_selvalue_t *out, void *data)
+init_output_pos(const gmx_mtop_t * /* top */, gmx_ana_selvalue_t *out, void *data)
 {
     t_methoddata_pos *d = (t_methoddata_pos *)data;
 
@@ -363,10 +386,10 @@ free_data_pos(void *data)
  * in \c t_methoddata_pos::g and stores the results in \p out->u.p.
  */
 static void
-evaluate_pos(t_topology * /* top */, t_trxframe *fr, t_pbc *pbc,
+evaluate_pos(const gmx::SelMethodEvalContext &context,
              gmx_ana_index_t * /* g */, gmx_ana_selvalue_t *out, void *data)
 {
     t_methoddata_pos *d = (t_methoddata_pos *)data;
 
-    gmx_ana_poscalc_update(d->pc, out->u.p, &d->g, fr, pbc);
+    gmx_ana_poscalc_update(d->pc, out->u.p, &d->g, context.fr, context.pbc);
 }
index 7c3c9c2c1594022bcbd6d4b35564fa4621c6a152..9f8e2c8d724b53aebf43bb218690d55157ddd018 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
@@ -119,55 +119,51 @@ init_data_same(int npar, gmx_ana_selparam_t *param);
  * \returns 0 on success, -1 on failure.
  */
 static void
-init_same(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data);
+init_same(const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data);
 /** Frees the data allocated for the \p same selection method. */
 static void
 free_data_same(void *data);
 /*! \brief
  * Initializes the evaluation of the \p same selection method for a frame.
  *
- * \param[in]  top  Not used.
- * \param[in]  fr   Current frame.
- * \param[in]  pbc  PBC structure.
+ * \param[in]  context  Not used.
  * \param      data Should point to a \ref t_methoddata_same.
  *
  * Sorts the \c data->as.i array and removes identical values for faster and
  * simpler lookup.
  */
 static void
-init_frame_same_int(t_topology *top, t_trxframe *fr, t_pbc *pbc, void *data);
+init_frame_same_int(const gmx::SelMethodEvalContext &context, void *data);
 /** Evaluates the \p same selection method. */
 static void
-evaluate_same_int(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_same_int(const gmx::SelMethodEvalContext &context,
                   gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
 /*! \brief
  * Initializes the evaluation of the \p same selection method for a frame.
  *
- * \param[in]  top  Not used.
- * \param[in]  fr   Current frame.
- * \param[in]  pbc  PBC structure.
+ * \param[in]  context  Not used.
  * \param      data Should point to a \ref t_methoddata_same.
  *
  * Sorts the \c data->as.s array and removes identical values for faster and
  * simpler lookup.
  */
 static void
-init_frame_same_str(t_topology *top, t_trxframe *fr, t_pbc *pbc, void *data);
+init_frame_same_str(const gmx::SelMethodEvalContext &context, void *data);
 /** Evaluates the \p same selection method. */
 static void
-evaluate_same_str(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_same_str(const gmx::SelMethodEvalContext &context,
                   gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
 
 /** Parameters for the \p same selection method. */
 static gmx_ana_selparam_t smparams_same_int[] = {
-    {NULL, {INT_VALUE, -1, {NULL}}, NULL, SPAR_DYNAMIC | SPAR_ATOMVAL},
-    {"as", {INT_VALUE, -1, {NULL}}, NULL, SPAR_DYNAMIC | SPAR_VARNUM},
+    {nullptr, {INT_VALUE, -1, {nullptr}}, nullptr, SPAR_DYNAMIC | SPAR_ATOMVAL},
+    {"as", {INT_VALUE, -1, {nullptr}}, nullptr, SPAR_DYNAMIC | SPAR_VARNUM},
 };
 
 /** Parameters for the \p same selection method. */
 static gmx_ana_selparam_t smparams_same_str[] = {
-    {NULL, {STR_VALUE, -1, {NULL}}, NULL, SPAR_DYNAMIC | SPAR_ATOMVAL},
-    {"as", {STR_VALUE, -1, {NULL}}, NULL, SPAR_DYNAMIC | SPAR_VARNUM},
+    {nullptr, {STR_VALUE, -1, {nullptr}}, nullptr, SPAR_DYNAMIC | SPAR_ATOMVAL},
+    {"as", {STR_VALUE, -1, {nullptr}}, nullptr, SPAR_DYNAMIC | SPAR_VARNUM},
 };
 
 /** Help text for the \p same selection method. */
@@ -187,13 +183,13 @@ gmx_ana_selmethod_t sm_same = {
     "same", GROUP_VALUE, 0,
     asize(smparams_same_int), smparams_same_int,
     &init_data_same,
-    NULL,
+    nullptr,
     &init_same,
-    NULL,
+    nullptr,
     &free_data_same,
     &init_frame_same_int,
     &evaluate_same_int,
-    NULL,
+    nullptr,
     {"same KEYWORD as ATOM_EXPR",
      "Extending selections", asize(help_same), help_same},
 };
@@ -209,14 +205,14 @@ static gmx_ana_selmethod_t sm_same_str = {
     "same", GROUP_VALUE, SMETH_SINGLEVAL,
     asize(smparams_same_str), smparams_same_str,
     &init_data_same,
-    NULL,
+    nullptr,
     &init_same,
-    NULL,
+    nullptr,
     &free_data_same,
     &init_frame_same_str,
     &evaluate_same_str,
-    NULL,
-    {NULL, NULL, 0, NULL},
+    nullptr,
+    {nullptr, nullptr, 0, nullptr},
 };
 
 static void *
@@ -225,7 +221,7 @@ init_data_same(int /* npar */, gmx_ana_selparam_t *param)
     t_methoddata_same *data;
 
     snew(data, 1);
-    data->as_s_sorted = NULL;
+    data->as_s_sorted = nullptr;
     param[1].nvalptr  = &data->nas;
     return data;
 }
@@ -285,7 +281,7 @@ _gmx_selelem_custom_init_same(gmx_ana_selmethod_t                           **me
 }
 
 static void
-init_same(t_topology * /* top */, int /* npar */, gmx_ana_selparam_t *param, void *data)
+init_same(const gmx_mtop_t * /* top */, int /* npar */, gmx_ana_selparam_t *param, void *data)
 {
     t_methoddata_same *d = (t_methoddata_same *)data;
 
@@ -333,7 +329,7 @@ cmp_int(const void *a, const void *b)
 }
 
 static void
-init_frame_same_int(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */, void *data)
+init_frame_same_int(const gmx::SelMethodEvalContext & /*context*/, void *data)
 {
     t_methoddata_same *d = (t_methoddata_same *)data;
     int                i, j;
@@ -385,7 +381,7 @@ init_frame_same_int(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pb
  * \c data->val.
  */
 static void
-evaluate_same_int(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_same_int(const gmx::SelMethodEvalContext & /*context*/,
                   gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data)
 {
     t_methoddata_same     *d = (t_methoddata_same *)data;
@@ -461,7 +457,7 @@ cmp_str(const void *a, const void *b)
 }
 
 static void
-init_frame_same_str(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */, void *data)
+init_frame_same_str(const gmx::SelMethodEvalContext & /*context*/, void *data)
 {
     t_methoddata_same *d = (t_methoddata_same *)data;
     int                i, j;
@@ -508,7 +504,7 @@ init_frame_same_str(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pb
  * \c data->val.
  */
 static void
-evaluate_same_str(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_same_str(const gmx::SelMethodEvalContext & /*context*/,
                   gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data)
 {
     t_methoddata_same     *d = (t_methoddata_same *)data;
@@ -523,7 +519,7 @@ evaluate_same_str(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc
         ptr = bsearch(&d->val.s[j], d->as_s_sorted, d->nas,
                       sizeof(d->as_s_sorted[0]), &cmp_str);
         /* Check whether the value was found in the as list. */
-        if (ptr == NULL)
+        if (ptr == nullptr)
         {
             /* If not, skip all atoms with the same value. */
             const char *tmpval = d->val.s[j];
index ca384efd8144d882ea083bb9dadc4c7f08bf3733..259e395fe6e795544babd6662f642b2174b16de9 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
 #include <cctype>
 
 #include "gromacs/selection/position.h"
+#include "gromacs/topology/mtop_lookup.h"
 #include "gromacs/topology/topology.h"
 #include "gromacs/utility/arraysize.h"
 #include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/gmxassert.h"
 
 #include "selmethod.h"
 
 /** Evaluates the \p all selection keyword. */
 static void
-evaluate_all(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_all(const gmx::SelMethodEvalContext &context,
              gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
 /** Evaluates the \p none selection keyword. */
 static void
-evaluate_none(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_none(const gmx::SelMethodEvalContext &context,
               gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
 /** Evaluates the \p atomnr selection keyword. */
 static void
-evaluate_atomnr(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_atomnr(const gmx::SelMethodEvalContext &context,
                 gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
 /** Evaluates the \p resnr selection keyword. */
 static void
-evaluate_resnr(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_resnr(const gmx::SelMethodEvalContext &context,
                gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
 /** Evaluates the \p resindex selection keyword. */
 static void
-evaluate_resindex(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_resindex(const gmx::SelMethodEvalContext &context,
                   gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
 /*! \brief
  * Checks whether molecule information is present in the topology.
@@ -82,18 +84,18 @@ evaluate_resindex(t_topology *top, t_trxframe *fr, t_pbc *pbc,
  * If molecule information is not found, also prints an error message.
  */
 static void
-check_molecules(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data);
+check_molecules(const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data);
 /** Evaluates the \p molindex selection keyword. */
 static void
-evaluate_molindex(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_molindex(const gmx::SelMethodEvalContext &context,
                   gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
 /** Evaluates the \p atomname selection keyword. */
 static void
-evaluate_atomname(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_atomname(const gmx::SelMethodEvalContext &context,
                   gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
 /** Evaluates the \p pdbatomname selection keyword. */
 static void
-evaluate_pdbatomname(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_pdbatomname(const gmx::SelMethodEvalContext &context,
                      gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
 /*! \brief
  * Checks whether atom types are present in the topology.
@@ -102,31 +104,38 @@ evaluate_pdbatomname(t_topology *top, t_trxframe *fr, t_pbc *pbc,
  * \param     npar Not used.
  * \param     param Not used.
  * \param     data Not used.
- * \returns   0 if atom types are present in the topology, -1 otherwise.
- *
- * If the atom types are not found, also prints an error message.
  */
 static void
-check_atomtype(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data);
+check_atomtype(const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data);
 /** Evaluates the \p atomtype selection keyword. */
 static void
-evaluate_atomtype(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_atomtype(const gmx::SelMethodEvalContext &context,
                   gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
 /** Evaluates the \p insertcode selection keyword. */
 static void
-evaluate_insertcode(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_insertcode(const gmx::SelMethodEvalContext &context,
                     gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
 /** Evaluates the \p chain selection keyword. */
 static void
-evaluate_chain(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_chain(const gmx::SelMethodEvalContext &context,
                gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
 /** Evaluates the \p mass selection keyword. */
 static void
-evaluate_mass(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_mass(const gmx::SelMethodEvalContext &context,
               gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
+/*! \brief
+ * Checks whether charges are present in the topology.
+ *
+ * \param[in] top  Topology structure.
+ * \param     npar Not used.
+ * \param     param Not used.
+ * \param     data Not used.
+ */
+static void
+check_charge(const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data);
 /** Evaluates the \p charge selection keyword. */
 static void
-evaluate_charge(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_charge(const gmx::SelMethodEvalContext &context,
                 gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
 /*! \brief
  * Checks whether PDB info is present in the topology.
@@ -140,35 +149,35 @@ evaluate_charge(t_topology *top, t_trxframe *fr, t_pbc *pbc,
  * If PDB info is not found, also prints an error message.
  */
 static void
-check_pdbinfo(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data);
+check_pdbinfo(const gmx_mtop_t *top, int npar, gmx_ana_selparam_t *param, void *data);
 /** Evaluates the \p altloc selection keyword. */
 static void
-evaluate_altloc(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_altloc(const gmx::SelMethodEvalContext &context,
                 gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
 /** Evaluates the \p occupancy selection keyword. */
 static void
-evaluate_occupancy(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_occupancy(const gmx::SelMethodEvalContext &context,
                    gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
 /** Evaluates the \p betafactor selection keyword. */
 static void
-evaluate_betafactor(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_betafactor(const gmx::SelMethodEvalContext &context,
                     gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
 /** Evaluates the \p resname selection keyword. */
 static void
-evaluate_resname(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_resname(const gmx::SelMethodEvalContext &context,
                  gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
 
 /** Evaluates the \p x selection keyword. */
 static void
-evaluate_x(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_x(const gmx::SelMethodEvalContext &context,
            gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out, void *data);
 /** Evaluates the \p y selection keyword. */
 static void
-evaluate_y(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_y(const gmx::SelMethodEvalContext &context,
            gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out, void *data);
 /** Evaluates the \p z selection keyword. */
 static void
-evaluate_z(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_z(const gmx::SelMethodEvalContext &context,
            gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out, void *data);
 
 //! Help title for atom name selection keywords.
@@ -221,284 +230,284 @@ static const char *const help_resindex[] = {
 /** Selection method data for \p all selection keyword. */
 gmx_ana_selmethod_t sm_all = {
     "all", GROUP_VALUE, 0,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_all,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p none selection keyword. */
 gmx_ana_selmethod_t sm_none = {
     "none", GROUP_VALUE, 0,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_none,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p atomnr selection keyword. */
 gmx_ana_selmethod_t sm_atomnr = {
     "atomnr", INT_VALUE, 0,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_atomnr,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p resnr selection keyword. */
 gmx_ana_selmethod_t sm_resnr = {
     "resnr", INT_VALUE, SMETH_REQTOP,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_resnr,
-    NULL,
-    {NULL, helptitle_resindex, asize(help_resindex), help_resindex}
+    nullptr,
+    {nullptr, helptitle_resindex, asize(help_resindex), help_resindex}
 };
 
 /** Selection method data for \p resindex selection keyword. */
 gmx_ana_selmethod_t sm_resindex = {
     "resindex", INT_VALUE, SMETH_REQTOP,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_resindex,
-    NULL,
-    {NULL, helptitle_resindex, asize(help_resindex), help_resindex}
+    nullptr,
+    {nullptr, helptitle_resindex, asize(help_resindex), help_resindex}
 };
 
 /** Selection method data for \p molindex selection keyword. */
 gmx_ana_selmethod_t sm_molindex = {
     "molindex", INT_VALUE, SMETH_REQTOP,
-    0, NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
     &check_molecules,
-    NULL,
-    NULL,
-    NULL,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_molindex,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p atomname selection keyword. */
 gmx_ana_selmethod_t sm_atomname = {
     "atomname", STR_VALUE, SMETH_REQTOP,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_atomname,
-    NULL,
-    {NULL, helptitle_atomname, asize(help_atomname), help_atomname}
+    nullptr,
+    {nullptr, helptitle_atomname, asize(help_atomname), help_atomname}
 };
 
 /** Selection method data for \p pdbatomname selection keyword. */
 gmx_ana_selmethod_t sm_pdbatomname = {
     "pdbatomname", STR_VALUE, SMETH_REQTOP,
-    0, NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
     &check_pdbinfo,
-    NULL,
-    NULL,
-    NULL,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_pdbatomname,
-    NULL,
-    {NULL, helptitle_atomname, asize(help_atomname), help_atomname}
+    nullptr,
+    {nullptr, helptitle_atomname, asize(help_atomname), help_atomname}
 };
 
 /** Selection method data for \p atomtype selection keyword. */
 gmx_ana_selmethod_t sm_atomtype = {
     "atomtype", STR_VALUE, SMETH_REQTOP,
-    0, NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
     &check_atomtype,
-    NULL,
-    NULL,
-    NULL,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_atomtype,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p resname selection keyword. */
 gmx_ana_selmethod_t sm_resname = {
     "resname", STR_VALUE, SMETH_REQTOP,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_resname,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p chain selection keyword. */
 gmx_ana_selmethod_t sm_insertcode = {
     "insertcode", STR_VALUE, SMETH_REQTOP | SMETH_CHARVAL,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_insertcode,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p chain selection keyword. */
 gmx_ana_selmethod_t sm_chain = {
     "chain", STR_VALUE, SMETH_REQTOP | SMETH_CHARVAL,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_chain,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p mass selection keyword. */
 gmx_ana_selmethod_t sm_mass = {
-    "mass", REAL_VALUE, SMETH_REQTOP,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    "mass", REAL_VALUE, SMETH_REQMASS,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_mass,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p charge selection keyword. */
 gmx_ana_selmethod_t sm_charge = {
     "charge", REAL_VALUE, SMETH_REQTOP,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    &check_charge,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_charge,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p chain selection keyword. */
 gmx_ana_selmethod_t sm_altloc = {
     "altloc", STR_VALUE, SMETH_REQTOP | SMETH_CHARVAL,
-    0, NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
     &check_pdbinfo,
-    NULL,
-    NULL,
-    NULL,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_altloc,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p occupancy selection keyword. */
 gmx_ana_selmethod_t sm_occupancy = {
     "occupancy", REAL_VALUE, SMETH_REQTOP,
-    0, NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
     &check_pdbinfo,
-    NULL,
-    NULL,
-    NULL,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_occupancy,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p betafactor selection keyword. */
 gmx_ana_selmethod_t sm_betafactor = {
     "betafactor", REAL_VALUE, SMETH_REQTOP,
-    0, NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
     &check_pdbinfo,
-    NULL,
-    NULL,
-    NULL,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_betafactor,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p x selection keyword. */
 gmx_ana_selmethod_t sm_x = {
     "x", REAL_VALUE, SMETH_DYNAMIC,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_x,
 };
 
 /** Selection method data for \p y selection keyword. */
 gmx_ana_selmethod_t sm_y = {
     "y", REAL_VALUE, SMETH_DYNAMIC,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_y,
 };
 
 /** Selection method data for \p z selection keyword. */
 gmx_ana_selmethod_t sm_z = {
     "z", REAL_VALUE, SMETH_DYNAMIC,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_z,
 };
 
@@ -509,7 +518,7 @@ gmx_ana_selmethod_t sm_z = {
  * Copies \p g to \p out->u.g.
  */
 static void
-evaluate_all(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_all(const gmx::SelMethodEvalContext & /*context*/,
              gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void * /* data */)
 {
     gmx_ana_index_copy(out->u.g, g, false);
@@ -522,7 +531,7 @@ evaluate_all(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
  * Returns an empty \p out->u.g.
  */
 static void
-evaluate_none(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_none(const gmx::SelMethodEvalContext & /*context*/,
               gmx_ana_index_t * /* g */, gmx_ana_selvalue_t *out, void * /* data */)
 {
     out->u.g->isize = 0;
@@ -535,7 +544,7 @@ evaluate_none(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
  * Returns the indices for each atom in \p out->u.i.
  */
 static void
-evaluate_atomnr(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_atomnr(const gmx::SelMethodEvalContext & /*context*/,
                 gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void * /* data */)
 {
     int  i;
@@ -554,17 +563,15 @@ evaluate_atomnr(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */
  * Returns the residue numbers for each atom in \p out->u.i.
  */
 static void
-evaluate_resnr(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_resnr(const gmx::SelMethodEvalContext &context,
                gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void * /* data */)
 {
-    int  i;
-    int  resind;
-
-    out->nr = g->isize;
-    for (i = 0; i < g->isize; ++i)
+    out->nr  = g->isize;
+    int molb = 0;
+    for (int i = 0; i < g->isize; ++i)
     {
-        resind      = top->atoms.atom[g->index[i]].resind;
-        out->u.i[i] = top->atoms.resinfo[resind].nr;
+        mtopGetAtomAndResidueName(context.top, g->index[i], &molb,
+                                  nullptr, &out->u.i[i], nullptr, nullptr);
     }
 }
 
@@ -575,24 +582,26 @@ evaluate_resnr(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
  * Returns the residue indices for each atom in \p out->u.i.
  */
 static void
-evaluate_resindex(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_resindex(const gmx::SelMethodEvalContext &context,
                   gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void * /* data */)
 {
-    int  i;
-
-    out->nr = g->isize;
-    for (i = 0; i < g->isize; ++i)
+    out->nr  = g->isize;
+    int molb = 0;
+    for (int i = 0; i < g->isize; ++i)
     {
-        out->u.i[i] = top->atoms.atom[g->index[i]].resind + 1;
+        int resind;
+        mtopGetAtomAndResidueName(context.top, g->index[i], &molb,
+                                  nullptr, nullptr, nullptr, &resind);
+        out->u.i[i] = resind + 1;
     }
 }
 
 static void
-check_molecules(t_topology *top, int /* npar */, gmx_ana_selparam_t * /* param */, void * /* data */)
+check_molecules(const gmx_mtop_t *top, int /* npar */, gmx_ana_selparam_t * /* param */, void * /* data */)
 {
     bool bOk;
 
-    bOk = (top != NULL && top->mols.nr > 0);
+    bOk = (top != nullptr && top->mols.nr > 0);
     if (!bOk)
     {
         GMX_THROW(gmx::InconsistentInputError("Molecule information not available in topology"));
@@ -606,7 +615,7 @@ check_molecules(t_topology *top, int /* npar */, gmx_ana_selparam_t * /* param *
  * Returns the molecule indices for each atom in \p out->u.i.
  */
 static void
-evaluate_molindex(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_molindex(const gmx::SelMethodEvalContext &context,
                   gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void * /* data */)
 {
     int  i, j;
@@ -614,7 +623,7 @@ evaluate_molindex(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
     out->nr = g->isize;
     for (i = j = 0; i < g->isize; ++i)
     {
-        while (top->mols.index[j + 1] <= g->index[i])
+        while (context.top->mols.index[j + 1] <= g->index[i])
         {
             ++j;
         }
@@ -629,15 +638,17 @@ evaluate_molindex(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
  * Returns the atom name for each atom in \p out->u.s.
  */
 static void
-evaluate_atomname(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_atomname(const gmx::SelMethodEvalContext &context,
                   gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void * /* data */)
 {
-    int  i;
-
     out->nr = g->isize;
-    for (i = 0; i < g->isize; ++i)
+    int molb = 0;
+    for (int i = 0; i < g->isize; ++i)
     {
-        out->u.s[i] = *top->atoms.atomname[g->index[i]];
+        const char *atom_name;
+        mtopGetAtomAndResidueName(context.top, g->index[i], &molb,
+                                  &atom_name, nullptr, nullptr, nullptr);
+        out->u.s[i] = const_cast<char *>(atom_name);
     }
 }
 
@@ -648,30 +659,26 @@ evaluate_atomname(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
  * Returns the PDB atom name for each atom in \p out->u.s.
  */
 static void
-evaluate_pdbatomname(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_pdbatomname(const gmx::SelMethodEvalContext &context,
                      gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void * /* data */)
 {
-    int  i;
-
     out->nr = g->isize;
-    for (i = 0; i < g->isize; ++i)
+    int molb = 0;
+    for (int i = 0; i < g->isize; ++i)
     {
-        char *s = top->atoms.pdbinfo[g->index[i]].atomnm;
+        const char *s = mtopGetAtomPdbInfo(context.top, g->index[i], &molb).atomnm;
         while (std::isspace(*s))
         {
             ++s;
         }
-        out->u.s[i] = s;
+        out->u.s[i] = const_cast<char *>(s);
     }
 }
 
 static void
-check_atomtype(t_topology *top, int /* npar */, gmx_ana_selparam_t * /* param */, void * /* data */)
+check_atomtype(const gmx_mtop_t *top, int /* npar */, gmx_ana_selparam_t * /* param */, void * /* data */)
 {
-    bool bOk;
-
-    bOk = (top != NULL && top->atoms.atomtype != NULL);
-    if (!bOk)
+    if (!gmx_mtop_has_atomtypes(top))
     {
         GMX_THROW(gmx::InconsistentInputError("Atom types not available in topology"));
     }
@@ -685,15 +692,18 @@ check_atomtype(t_topology *top, int /* npar */, gmx_ana_selparam_t * /* param */
  * Segfaults if atom types are not found in the topology.
  */
 static void
-evaluate_atomtype(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_atomtype(const gmx::SelMethodEvalContext &context,
                   gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void * /* data */)
 {
-    int  i;
-
     out->nr = g->isize;
-    for (i = 0; i < g->isize; ++i)
+    int molb = 0;
+    for (int i = 0; i < g->isize; ++i)
     {
-        out->u.s[i] = *top->atoms.atomtype[g->index[i]];
+        int atomIndexInMolecule;
+        mtopGetMolblockIndex(context.top, g->index[i], &molb,
+                             nullptr, &atomIndexInMolecule);
+        const gmx_moltype_t &moltype = context.top->moltype[context.top->molblock[molb].type];
+        out->u.s[i] = *moltype.atoms.atomtype[atomIndexInMolecule];
     }
 }
 
@@ -704,17 +714,14 @@ evaluate_atomtype(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
  * Returns the residue name for each atom in \p out->u.s.
  */
 static void
-evaluate_resname(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_resname(const gmx::SelMethodEvalContext &context,
                  gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void * /* data */)
 {
-    int  i;
-    int  resind;
-
     out->nr = g->isize;
-    for (i = 0; i < g->isize; ++i)
+    int molb = 0;
+    for (int i = 0; i < g->isize; ++i)
     {
-        resind      = top->atoms.atom[g->index[i]].resind;
-        out->u.s[i] = *top->atoms.resinfo[resind].name;
+        out->u.s[i] = *mtopGetResidueInfo(context.top, g->index[i], &molb).name;
     }
 }
 
@@ -725,17 +732,14 @@ evaluate_resname(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
  * Returns the insertion code for each atom in \p out->u.s.
  */
 static void
-evaluate_insertcode(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_insertcode(const gmx::SelMethodEvalContext &context,
                     gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void * /* data */)
 {
-    int  i;
-    int  resind;
-
     out->nr = g->isize;
-    for (i = 0; i < g->isize; ++i)
+    int molb = 0;
+    for (int i = 0; i < g->isize; ++i)
     {
-        resind         = top->atoms.atom[g->index[i]].resind;
-        out->u.s[i][0] = top->atoms.resinfo[resind].ic;
+        out->u.s[i][0] = mtopGetResidueInfo(context.top, g->index[i], &molb).ic;
     }
 }
 
@@ -746,17 +750,14 @@ evaluate_insertcode(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
  * Returns the chain for each atom in \p out->u.s.
  */
 static void
-evaluate_chain(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_chain(const gmx::SelMethodEvalContext &context,
                gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void * /* data */)
 {
-    int  i;
-    int  resind;
-
     out->nr = g->isize;
-    for (i = 0; i < g->isize; ++i)
+    int molb = 0;
+    for (int i = 0; i < g->isize; ++i)
     {
-        resind         = top->atoms.atom[g->index[i]].resind;
-        out->u.s[i][0] = top->atoms.resinfo[resind].chainid;
+        out->u.s[i][0] = mtopGetResidueInfo(context.top, g->index[i], &molb).chainid;
     }
 }
 
@@ -767,15 +768,26 @@ evaluate_chain(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
  * Returns the mass for each atom in \p out->u.r.
  */
 static void
-evaluate_mass(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_mass(const gmx::SelMethodEvalContext &context,
               gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void * /* data */)
 {
-    int  i;
-
+    GMX_RELEASE_ASSERT(gmx_mtop_has_masses(context.top),
+                       "Masses not available for evaluation");
     out->nr = g->isize;
-    for (i = 0; i < g->isize; ++i)
+    int molb = 0;
+    for (int i = 0; i < g->isize; ++i)
+    {
+        out->u.r[i] = mtopGetAtomMass(context.top, g->index[i], &molb);
+    }
+}
+
+
+static void
+check_charge(const gmx_mtop_t *top, int /* npar */, gmx_ana_selparam_t * /* param */, void * /* data */)
+{
+    if (!gmx_mtop_has_charges(top))
     {
-        out->u.r[i] = top->atoms.atom[g->index[i]].m;
+        GMX_THROW(gmx::InconsistentInputError("Charges not available in topology"));
     }
 }
 
@@ -786,25 +798,21 @@ evaluate_mass(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
  * Returns the charge for each atom in \p out->u.r.
  */
 static void
-evaluate_charge(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_charge(const gmx::SelMethodEvalContext &context,
                 gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void * /* data */)
 {
-    int  i;
-
     out->nr = g->isize;
-    for (i = 0; i < g->isize; ++i)
+    int molb = 0;
+    for (int i = 0; i < g->isize; ++i)
     {
-        out->u.r[i] = top->atoms.atom[g->index[i]].q;
+        out->u.r[i] = mtopGetAtomParameters(context.top, g->index[i], &molb).q;
     }
 }
 
 static void
-check_pdbinfo(t_topology *top, int /* npar */, gmx_ana_selparam_t * /* param */, void * /* data */)
+check_pdbinfo(const gmx_mtop_t *top, int /* npar */, gmx_ana_selparam_t * /* param */, void * /* data */)
 {
-    bool bOk;
-
-    bOk = (top != NULL && top->atoms.pdbinfo != NULL);
-    if (!bOk)
+    if (!gmx_mtop_has_pdbinfo(top))
     {
         GMX_THROW(gmx::InconsistentInputError("PDB info not available in topology"));
     }
@@ -817,15 +825,14 @@ check_pdbinfo(t_topology *top, int /* npar */, gmx_ana_selparam_t * /* param */,
  * Returns the alternate location identifier for each atom in \p out->u.s.
  */
 static void
-evaluate_altloc(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_altloc(const gmx::SelMethodEvalContext &context,
                 gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void * /* data */)
 {
-    int  i;
-
     out->nr = g->isize;
-    for (i = 0; i < g->isize; ++i)
+    int molb = 0;
+    for (int i = 0; i < g->isize; ++i)
     {
-        out->u.s[i][0] = top->atoms.pdbinfo[g->index[i]].altloc;
+        out->u.s[i][0] = mtopGetAtomPdbInfo(context.top, g->index[i], &molb).altloc;
     }
 }
 
@@ -837,15 +844,14 @@ evaluate_altloc(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
  * Segfaults if PDB info is not found in the topology.
  */
 static void
-evaluate_occupancy(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_occupancy(const gmx::SelMethodEvalContext &context,
                    gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void * /* data */)
 {
-    int  i;
-
     out->nr = g->isize;
-    for (i = 0; i < g->isize; ++i)
+    int molb = 0;
+    for (int i = 0; i < g->isize; ++i)
     {
-        out->u.r[i] = top->atoms.pdbinfo[g->index[i]].occup;
+        out->u.r[i] = mtopGetAtomPdbInfo(context.top, g->index[i], &molb).occup;
     }
 }
 
@@ -857,15 +863,14 @@ evaluate_occupancy(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
  * Segfaults if PDB info is not found in the topology.
  */
 static void
-evaluate_betafactor(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
+evaluate_betafactor(const gmx::SelMethodEvalContext &context,
                     gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void * /* data */)
 {
-    int  i;
-
     out->nr = g->isize;
-    for (i = 0; i < g->isize; ++i)
+    int molb = 0;
+    for (int i = 0; i < g->isize; ++i)
     {
-        out->u.r[i] = top->atoms.pdbinfo[g->index[i]].bfac;
+        out->u.r[i] = mtopGetAtomPdbInfo(context.top, g->index[i], &molb).bfac;
     }
 }
 
@@ -898,7 +903,7 @@ evaluate_coord(real out[], gmx_ana_pos_t *pos, int d)
  * Returns the \p x coordinate for each position in \p out->u.r.
  */
 static void
-evaluate_x(t_topology * /*top*/, t_trxframe * /*fr*/, t_pbc * /*pbc*/,
+evaluate_x(const gmx::SelMethodEvalContext & /*context*/,
            gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out, void * /*data*/)
 {
     out->nr = pos->count();
@@ -912,7 +917,7 @@ evaluate_x(t_topology * /*top*/, t_trxframe * /*fr*/, t_pbc * /*pbc*/,
  * Returns the \p y coordinate for each position in \p out->u.r.
  */
 static void
-evaluate_y(t_topology * /*top*/, t_trxframe * /*fr*/, t_pbc * /*pbc*/,
+evaluate_y(const gmx::SelMethodEvalContext & /*context*/,
            gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out, void * /*data*/)
 {
     out->nr = pos->count();
@@ -926,7 +931,7 @@ evaluate_y(t_topology * /*top*/, t_trxframe * /*fr*/, t_pbc * /*pbc*/,
  * Returns the \p z coordinate for each position in \p out->u.r.
  */
 static void
-evaluate_z(t_topology * /*top*/, t_trxframe * /*fr*/, t_pbc * /*pbc*/,
+evaluate_z(const gmx::SelMethodEvalContext & /*context*/,
            gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out, void * /*data*/)
 {
     out->nr = pos->count();
index 34f63ae9b1cf791283c3a014055ebfb1f24701bc..1cbc5df4794de7171d0f4f8f3452782735c5ecdc 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,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.
@@ -81,7 +81,7 @@ class SelectionParserSymbol::Impl
          * \a var_ members as appropriate.
          */
         Impl(SymbolType type, const char *name)
-            : name_(name), type_(type), meth_(NULL)
+            : name_(name), type_(type), meth_(nullptr)
         {
         }
 
@@ -204,7 +204,7 @@ SelectionParserSymbolTable::Impl::addPositionSymbols()
 {
     const char *const *postypes
         = gmx::PositionCalculationCollection::typeEnumValues;
-    for (int i = 0; postypes[i] != NULL; ++i)
+    for (int i = 0; postypes[i] != nullptr; ++i)
     {
         SymbolPointer sym(new SelectionParserSymbol(
                                   new SelectionParserSymbol::Impl(
@@ -320,13 +320,13 @@ SelectionParserSymbolTable::findSymbol(const std::string &name) const
     Impl::SymbolMap::const_iterator sym = impl_->symbols_.lower_bound(name);
     if (sym == impl_->symbols_.end())
     {
-        return NULL;
+        return nullptr;
     }
     if (sym->second->name() == name)
     {
         return sym->second.get();
     }
-    return NULL;
+    return nullptr;
 }
 
 SelectionParserSymbolIterator
index ffd884fe591837cbd5bdaa4c1b4bbe302dabfff2..a2d43aca86fab128376db9368716cfbe05d4184b 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,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.
@@ -103,10 +103,10 @@ class IndexBlockTest : public ::testing::Test
 IndexBlockTest::IndexBlockTest()
 {
     blocka_.nr           = 0;
-    blocka_.index        = NULL;
+    blocka_.index        = nullptr;
     blocka_.nalloc_index = 0;
     blocka_.nra          = 0;
-    blocka_.a            = NULL;
+    blocka_.a            = nullptr;
     blocka_.nalloc_a     = 0;
     gmx_ana_index_clear(&g_);
 }
@@ -131,7 +131,7 @@ void IndexBlockTest::checkBlocka()
     for (int i = 0; i < blocka_.nr; ++i)
     {
         gmx::test::TestReferenceChecker blockCompound(
-                compound.checkCompound("Block", NULL));
+                compound.checkCompound("Block", nullptr));
         blockCompound.checkSequence(&blocka_.a[blocka_.index[i]],
                                     &blocka_.a[blocka_.index[i+1]],
                                     "Atoms");
@@ -144,10 +144,10 @@ void IndexBlockTest::checkBlocka()
 
 TEST_F(IndexBlockTest, CreatesUnknownBlock)
 {
-    gmx_ana_index_make_block(&blocka_, NULL, NULL, INDEX_UNKNOWN, false);
+    gmx_ana_index_make_block(&blocka_, nullptr, nullptr, INDEX_UNKNOWN, false);
     checkBlocka();
     done_blocka(&blocka_);
-    gmx_ana_index_make_block(&blocka_, NULL, NULL, INDEX_UNKNOWN, false);
+    gmx_ana_index_make_block(&blocka_, nullptr, nullptr, INDEX_UNKNOWN, false);
     checkBlocka();
 }
 
@@ -155,10 +155,10 @@ TEST_F(IndexBlockTest, CreatesAtomBlock)
 {
     const int group[] = { 0, 1, 3, 4, 6 };
     setGroup(group);
-    gmx_ana_index_make_block(&blocka_, NULL, &g_, INDEX_ATOM, false);
+    gmx_ana_index_make_block(&blocka_, nullptr, &g_, INDEX_ATOM, false);
     checkBlocka();
     done_blocka(&blocka_);
-    gmx_ana_index_make_block(&blocka_, NULL, &g_, INDEX_ATOM, true);
+    gmx_ana_index_make_block(&blocka_, nullptr, &g_, INDEX_ATOM, true);
     checkBlocka();
 }
 
@@ -210,10 +210,10 @@ TEST_F(IndexBlockTest, CreatesSingleBlock)
 {
     const int group[] = { 0, 1, 3, 4, 6 };
     setGroup(group);
-    gmx_ana_index_make_block(&blocka_, NULL, &g_, INDEX_ALL, false);
+    gmx_ana_index_make_block(&blocka_, nullptr, &g_, INDEX_ALL, false);
     checkBlocka();
     done_blocka(&blocka_);
-    gmx_ana_index_make_block(&blocka_, NULL, &g_, INDEX_ALL, true);
+    gmx_ana_index_make_block(&blocka_, nullptr, &g_, INDEX_ALL, true);
     checkBlocka();
 }
 
@@ -284,9 +284,9 @@ TEST_F(IndexBlockTest, ChecksGroupForCompleteElementsTrivial)
 {
     const int group[] = { 0, 1, 2 };
     setGroup(group);
-    EXPECT_TRUE(gmx_ana_index_has_complete_elems(&g_, INDEX_ATOM, NULL));
-    EXPECT_FALSE(gmx_ana_index_has_complete_elems(&g_, INDEX_ALL, NULL));
-    EXPECT_FALSE(gmx_ana_index_has_complete_elems(&g_, INDEX_UNKNOWN, NULL));
+    EXPECT_TRUE(gmx_ana_index_has_complete_elems(&g_, INDEX_ATOM, nullptr));
+    EXPECT_FALSE(gmx_ana_index_has_complete_elems(&g_, INDEX_ALL, nullptr));
+    EXPECT_FALSE(gmx_ana_index_has_complete_elems(&g_, INDEX_UNKNOWN, nullptr));
 }
 
 TEST_F(IndexBlockTest, ChecksGroupForCompleteResiduesPositive)
@@ -296,7 +296,7 @@ TEST_F(IndexBlockTest, ChecksGroupForCompleteResiduesPositive)
 
     topManager_.initAtoms(15);
     topManager_.initUniformResidues(3);
-    t_topology *top = topManager_.topology();
+    gmx_mtop_t *top = topManager_.topology();
 
     setGroup(group1);
     EXPECT_TRUE(gmx_ana_index_has_complete_elems(&g_, INDEX_RES, top));
@@ -310,10 +310,11 @@ TEST_F(IndexBlockTest, ChecksGroupForCompleteResiduesNegative)
     const int group1[] = { 3, 4, 5, 6, 7, 8, 12, 13 };
     const int group2[] = { 3, 4, 5, 6, 7, 12, 13, 14 };
     const int group3[] = { 4, 5, 6, 7, 8, 12, 13, 14 };
+    const int group4[] = { 3, 4, 5, 6, 8, 12, 13, 14 };
 
     topManager_.initAtoms(18);
     topManager_.initUniformResidues(3);
-    t_topology *top = topManager_.topology();
+    gmx_mtop_t *top = topManager_.topology();
 
     setGroup(group1);
     EXPECT_FALSE(gmx_ana_index_has_complete_elems(&g_, INDEX_RES, top));
@@ -323,6 +324,9 @@ TEST_F(IndexBlockTest, ChecksGroupForCompleteResiduesNegative)
 
     setGroup(group3);
     EXPECT_FALSE(gmx_ana_index_has_complete_elems(&g_, INDEX_RES, top));
+
+    setGroup(group4);
+    EXPECT_FALSE(gmx_ana_index_has_complete_elems(&g_, INDEX_RES, top));
 }
 
 TEST_F(IndexBlockTest, ChecksGroupForCompleteMoleculesPositive)
@@ -331,7 +335,7 @@ TEST_F(IndexBlockTest, ChecksGroupForCompleteMoleculesPositive)
 
     topManager_.initAtoms(15);
     topManager_.initUniformMolecules(3);
-    t_topology *top = topManager_.topology();
+    gmx_mtop_t *top = topManager_.topology();
 
     setGroup(group);
     EXPECT_TRUE(gmx_ana_index_has_complete_elems(&g_, INDEX_MOL, top));
@@ -345,7 +349,7 @@ TEST_F(IndexBlockTest, ChecksGroupForCompleteMoleculesNegative)
 
     topManager_.initAtoms(18);
     topManager_.initUniformMolecules(3);
-    t_topology *top = topManager_.topology();
+    gmx_mtop_t *top = topManager_.topology();
 
     setGroup(group1);
     EXPECT_FALSE(gmx_ana_index_has_complete_elems(&g_, INDEX_MOL, top));
@@ -422,7 +426,7 @@ void IndexMapTest::testUpdate(int atomCount, const int atoms[], bool bMaskOnly,
     g.isize = atomCount;
     g.index = const_cast<int *>(atoms);
     gmx_ana_indexmap_update(&map_, &g, bMaskOnly);
-    if (name == NULL)
+    if (name == nullptr)
     {
         name = "Updated";
     }
@@ -460,7 +464,7 @@ void IndexMapTest::checkMapping(int atomCount, const int atoms[],
     for (int i = 0; i < map_.mapb.nr; ++i)
     {
         gmx::test::TestReferenceChecker blockCompound(
-                compound.checkCompound("Block", NULL));
+                compound.checkCompound("Block", nullptr));
         blockCompound.checkSequence(&atoms[map_.mapb.index[i]],
                                     &atoms[map_.mapb.index[i+1]],
                                     "Atoms");
@@ -536,7 +540,7 @@ TEST_F(IndexMapTest, MapsSingleBlock)
     const int maxGroup[]  = { 0, 1, 2, 3 };
     const int evalGroup[] = { 0, 2 };
     testInit(maxGroup, INDEX_ALL);
-    testUpdate(evalGroup, false, NULL);
+    testUpdate(evalGroup, false, nullptr);
 }
 
 TEST_F(IndexMapTest, MapsResidueBlocks)
@@ -548,7 +552,7 @@ TEST_F(IndexMapTest, MapsResidueBlocks)
     topManager_.initAtoms(18);
     topManager_.initUniformResidues(3);
     testInit(maxGroup, INDEX_RES);
-    testUpdate(evalGroup, false, NULL);
+    testUpdate(evalGroup, false, nullptr);
 }
 
 TEST_F(IndexMapTest, MapsResidueBlocksWithMask)
@@ -560,7 +564,7 @@ TEST_F(IndexMapTest, MapsResidueBlocksWithMask)
     topManager_.initAtoms(18);
     topManager_.initUniformResidues(3);
     testInit(maxGroup, INDEX_RES);
-    testUpdate(evalGroup, true, NULL);
+    testUpdate(evalGroup, true, nullptr);
 }
 
 TEST_F(IndexMapTest, HandlesMultipleRequests)
index 9cc30ecb704428cff573d13c3934d071ed269631..dae59c0ba09616af01d61b8b65d3c638ec0c3c65 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,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.
@@ -52,6 +52,7 @@
 
 #include <algorithm>
 #include <limits>
+#include <map>
 #include <numeric>
 #include <vector>
 
@@ -132,7 +133,7 @@ class NeighborhoodSearchTestData
                 testPos_.reserve(testPositions_.size());
                 for (size_t i = 0; i < testPositions_.size(); ++i)
                 {
-                    testPos_.push_back(testPositions_[i].x);
+                    testPos_.emplace_back(testPositions_[i].x);
                 }
             }
             return gmx::AnalysisNeighborhoodPositions(testPos_);
@@ -146,12 +147,13 @@ class NeighborhoodSearchTestData
         {
             GMX_RELEASE_ASSERT(testPos_.empty(),
                                "Cannot add positions after testPositions() call");
-            testPositions_.push_back(TestPosition(x));
+            testPositions_.emplace_back(x);
         }
         gmx::RVec generateRandomPosition();
         std::vector<int> generateIndex(int count, gmx_uint64_t seed) const;
         void generateRandomRefPositions(int count);
         void generateRandomTestPositions(int count);
+        void useRefPositionsAsTestPositions();
         void computeReferences(t_pbc *pbc)
         {
             computeReferencesInternal(pbc, false);
@@ -258,6 +260,15 @@ void NeighborhoodSearchTestData::generateRandomTestPositions(int count)
     }
 }
 
+void NeighborhoodSearchTestData::useRefPositionsAsTestPositions()
+{
+    testPositions_.reserve(refPosCount_);
+    for (const auto &refPos : refPos_)
+    {
+        addTestPosition(refPos);
+    }
+}
+
 void NeighborhoodSearchTestData::computeReferencesInternal(t_pbc *pbc, bool bXY)
 {
     real cutoff = cutoff_;
@@ -265,39 +276,38 @@ void NeighborhoodSearchTestData::computeReferencesInternal(t_pbc *pbc, bool bXY)
     {
         cutoff = std::numeric_limits<real>::max();
     }
-    TestPositionList::iterator i;
-    for (i = testPositions_.begin(); i != testPositions_.end(); ++i)
+    for (TestPosition &testPos : testPositions_)
     {
-        i->refMinDist      = cutoff;
-        i->refNearestPoint = -1;
-        i->refPairs.clear();
+        testPos.refMinDist      = cutoff;
+        testPos.refNearestPoint = -1;
+        testPos.refPairs.clear();
         for (int j = 0; j < refPosCount_; ++j)
         {
             rvec dx;
-            if (pbc != NULL)
+            if (pbc != nullptr)
             {
-                pbc_dx(pbc, i->x, refPos_[j], dx);
+                pbc_dx(pbc, testPos.x, refPos_[j], dx);
             }
             else
             {
-                rvec_sub(i->x, refPos_[j], dx);
+                rvec_sub(testPos.x, refPos_[j], dx);
             }
             // TODO: This may not work intuitively for 2D with the third box
             // vector not parallel to the Z axis, but neither does the actual
             // neighborhood search.
             const real dist =
                 !bXY ? norm(dx) : std::hypot(dx[XX], dx[YY]);
-            if (dist < i->refMinDist)
+            if (dist < testPos.refMinDist)
             {
-                i->refMinDist      = dist;
-                i->refNearestPoint = j;
+                testPos.refMinDist      = dist;
+                testPos.refNearestPoint = j;
             }
-            if (dist <= cutoff)
+            if (dist > 0 && dist <= cutoff)
             {
                 RefPair pair(j, dist);
-                GMX_RELEASE_ASSERT(i->refPairs.empty() || i->refPairs.back() < pair,
+                GMX_RELEASE_ASSERT(testPos.refPairs.empty() || testPos.refPairs.back() < pair,
                                    "Reference pairs should be generated in sorted order");
-                i->refPairs.push_back(pair);
+                testPos.refPairs.push_back(pair);
             }
         }
     }
@@ -372,9 +382,9 @@ ExclusionsHelper::ExclusionsHelper(int refPosCount, int testPosCount)
                      exclusionIds_.begin());
 
     excls_.nr           = 0;
-    excls_.index        = NULL;
+    excls_.index        = nullptr;
     excls_.nra          = 0;
-    excls_.a            = NULL;
+    excls_.a            = nullptr;
     excls_.nalloc_index = 0;
     excls_.nalloc_a     = 0;
 }
@@ -425,7 +435,8 @@ class NeighborhoodSearchTest : public ::testing::Test
                                 const gmx::AnalysisNeighborhoodPositions &pos,
                                 const t_blocka                           *excls,
                                 const gmx::ConstArrayRef<int>            &refIndices,
-                                const gmx::ConstArrayRef<int>            &testIndices);
+                                const gmx::ConstArrayRef<int>            &testIndices,
+                                bool                                      selfPairs);
 
         gmx::AnalysisNeighborhood        nb_;
 };
@@ -518,8 +529,8 @@ void NeighborhoodSearchTest::testPairSearch(
         gmx::AnalysisNeighborhoodSearch  *search,
         const NeighborhoodSearchTestData &data)
 {
-    testPairSearchFull(search, data, data.testPositions(), NULL,
-                       gmx::EmptyArrayRef(), gmx::EmptyArrayRef());
+    testPairSearchFull(search, data, data.testPositions(), nullptr,
+                       gmx::EmptyArrayRef(), gmx::EmptyArrayRef(), false);
 }
 
 void NeighborhoodSearchTest::testPairSearchIndexed(
@@ -532,8 +543,8 @@ void NeighborhoodSearchTest::testPairSearchIndexed(
     gmx::AnalysisNeighborhoodSearch search =
         nb->initSearch(&data.pbc_,
                        data.refPositions().indexed(refIndices));
-    testPairSearchFull(&search, data, data.testPositions(), NULL,
-                       refIndices, testIndices);
+    testPairSearchFull(&search, data, data.testPositions(), nullptr,
+                       refIndices, testIndices, false);
 }
 
 void NeighborhoodSearchTest::testPairSearchFull(
@@ -542,91 +553,93 @@ void NeighborhoodSearchTest::testPairSearchFull(
         const gmx::AnalysisNeighborhoodPositions &pos,
         const t_blocka                           *excls,
         const gmx::ConstArrayRef<int>            &refIndices,
-        const gmx::ConstArrayRef<int>            &testIndices)
+        const gmx::ConstArrayRef<int>            &testIndices,
+        bool                                      selfPairs)
 {
+    std::map<int, RefPairList> refPairs;
     // TODO: Some parts of this code do not work properly if pos does not
     // initially contain all the test positions.
-    std::set<int> remainingTestPositions;
-    gmx::AnalysisNeighborhoodPositions  posCopy(pos);
     if (testIndices.empty())
     {
         for (size_t i = 0; i < data.testPositions_.size(); ++i)
         {
-            remainingTestPositions.insert(i);
+            refPairs[i] = data.testPositions_[i].refPairs;
         }
     }
     else
     {
-        remainingTestPositions.insert(testIndices.begin(), testIndices.end());
-        posCopy.indexed(testIndices);
+        for (int index : testIndices)
+        {
+            refPairs[index] = data.testPositions_[index].refPairs;
+        }
     }
-
-    gmx::AnalysisNeighborhoodPairSearch pairSearch
-        = search->startPairSearch(posCopy);
-    gmx::AnalysisNeighborhoodPair       pair;
-    // There is an ordering assumption here that all pairs for a test position
-    // are returned consencutively; with the current optimizations in the
-    // search code, this is reasoable, as the set of grid cell pairs searched
-    // depends on the test position.
-    RefPairList refPairs;
-    int         prevTestPos = -1;
-    while (pairSearch.findNextPair(&pair))
+    if (excls != nullptr)
     {
-        const int testIndex =
-            (testIndices.empty() ? pair.testIndex() : testIndices[pair.testIndex()]);
-        const int refIndex =
-            (refIndices.empty() ? pair.refIndex() : refIndices[pair.refIndex()]);
-        if (testIndex != prevTestPos)
+        GMX_RELEASE_ASSERT(!selfPairs, "Self-pairs testing not implemented with exclusions");
+        for (auto &entry : refPairs)
         {
-            if (prevTestPos != -1)
-            {
-                checkAllPairsFound(refPairs, data.refPos_, prevTestPos,
-                                   data.testPositions_[prevTestPos].x);
-            }
-            if (remainingTestPositions.count(testIndex) == 0)
-            {
-                ADD_FAILURE()
-                << "Pairs for test position " << testIndex
-                << " are returned more than once.";
-            }
-            remainingTestPositions.erase(testIndex);
-            refPairs = data.testPositions_[testIndex].refPairs;
-            if (excls != NULL)
+            const int testIndex = entry.first;
+            ExclusionsHelper::markExcludedPairs(&entry.second, testIndex, excls);
+        }
+    }
+    if (!refIndices.empty())
+    {
+        GMX_RELEASE_ASSERT(!selfPairs, "Self-pairs testing not implemented with indexing");
+        for (auto &entry : refPairs)
+        {
+            for (auto &refPair : entry.second)
             {
-                ExclusionsHelper::markExcludedPairs(&refPairs, testIndex, excls);
+                refPair.bIndexed = false;
             }
-            if (!refIndices.empty())
+            for (int index : refIndices)
             {
-                RefPairList::iterator refPair;
-                for (refPair = refPairs.begin(); refPair != refPairs.end(); ++refPair)
-                {
-                    refPair->bIndexed = false;
-                }
-                for (size_t i = 0; i < refIndices.size(); ++i)
+                NeighborhoodSearchTestData::RefPair searchPair(index, 0.0);
+                auto refPair = std::lower_bound(entry.second.begin(), entry.second.end(), searchPair);
+                if (refPair != entry.second.end() && refPair->refIndex == index)
                 {
-                    NeighborhoodSearchTestData::RefPair searchPair(refIndices[i], 0.0);
-                    refPair = std::lower_bound(refPairs.begin(), refPairs.end(), searchPair);
-                    if (refPair != refPairs.end() && refPair->refIndex == refIndices[i])
-                    {
-                        refPair->bIndexed = true;
-                    }
+                    refPair->bIndexed = true;
                 }
-                for (refPair = refPairs.begin(); refPair != refPairs.end(); ++refPair)
+            }
+            for (auto &refPair : entry.second)
+            {
+                if (!refPair.bIndexed)
                 {
-                    if (!refPair->bIndexed)
-                    {
-                        refPair->bFound = true;
-                    }
+                    refPair.bFound = true;
                 }
             }
-            prevTestPos = testIndex;
         }
+    }
 
+    gmx::AnalysisNeighborhoodPositions  posCopy(pos);
+    if (!testIndices.empty())
+    {
+        posCopy.indexed(testIndices);
+    }
+    gmx::AnalysisNeighborhoodPairSearch pairSearch
+        = selfPairs
+            ? search->startSelfPairSearch()
+            : search->startPairSearch(posCopy);
+    gmx::AnalysisNeighborhoodPair       pair;
+    while (pairSearch.findNextPair(&pair))
+    {
+        const int testIndex =
+            (testIndices.empty() ? pair.testIndex() : testIndices[pair.testIndex()]);
+        const int refIndex =
+            (refIndices.empty() ? pair.refIndex() : refIndices[pair.refIndex()]);
+
+        if (refPairs.count(testIndex) == 0)
+        {
+            ADD_FAILURE()
+            << "Expected: No pairs are returned for test position " << testIndex << ".\n"
+            << "  Actual: Pair with ref " << refIndex << " is returned.";
+            continue;
+        }
         NeighborhoodSearchTestData::RefPair searchPair(refIndex,
                                                        std::sqrt(pair.distance2()));
-        RefPairList::iterator               foundRefPair
-            = std::lower_bound(refPairs.begin(), refPairs.end(), searchPair);
-        if (foundRefPair == refPairs.end() || foundRefPair->refIndex != refIndex)
+        const auto foundRefPair
+            = std::lower_bound(refPairs[testIndex].begin(), refPairs[testIndex].end(),
+                               searchPair);
+        if (foundRefPair == refPairs[testIndex].end() || foundRefPair->refIndex != refIndex)
         {
             ADD_FAILURE()
             << "Expected: Pair (ref: " << refIndex << ", test: " << testIndex
@@ -661,41 +674,24 @@ void NeighborhoodSearchTest::testPairSearchFull(
 
             EXPECT_REAL_EQ_TOL(foundRefPair->distance, searchPair.distance, data.relativeTolerance())
             << "Distance computed by the neighborhood search does not match.";
+            if (selfPairs)
+            {
+                searchPair = NeighborhoodSearchTestData::RefPair(testIndex, 0.0);
+                const auto otherRefPair
+                    = std::lower_bound(refPairs[refIndex].begin(), refPairs[refIndex].end(),
+                                       searchPair);
+                GMX_RELEASE_ASSERT(otherRefPair != refPairs[refIndex].end(),
+                                   "Precomputed reference data is not symmetric");
+                otherRefPair->bFound = true;
+            }
         }
     }
 
-    checkAllPairsFound(refPairs, data.refPos_, prevTestPos,
-                       data.testPositions_[prevTestPos].x);
-
-    std::set<int> refPositions(refIndices.begin(), refIndices.end());
-
-    for (std::set<int>::const_iterator i = remainingTestPositions.begin();
-         i != remainingTestPositions.end(); ++i)
+    for (auto &entry : refPairs)
     {
-        // Account for the case where the i particle is listed in the testIndex,
-        // but none of its ref neighbours were listed in the refIndex.
-        if (!refIndices.empty())
-        {
-            RefPairList::const_iterator refPair;
-            bool foundAnyRefInIndex = false;
-
-            for (refPair = data.testPositions_[*i].refPairs.begin();
-                 refPair != data.testPositions_[*i].refPairs.end() && !foundAnyRefInIndex; ++refPair)
-            {
-                foundAnyRefInIndex = (refPositions.count(refPair->refIndex) > 0);
-            }
-            if (!foundAnyRefInIndex)
-            {
-                continue;
-            }
-        }
-        if (!data.testPositions_[*i].refPairs.empty())
-        {
-            ADD_FAILURE()
-            << "Expected: Pairs would be returned for test position " << *i << ".\n"
-            << "  Actual: None were returned.";
-            break;
-        }
+        const int testIndex = entry.first;
+        checkAllPairsFound(entry.second, data.refPos_, testIndex,
+                           data.testPositions_[testIndex].x);
     }
 }
 
@@ -729,6 +725,30 @@ class TrivialTestData
         NeighborhoodSearchTestData data_;
 };
 
+class TrivialSelfPairsTestData
+{
+    public:
+        static const NeighborhoodSearchTestData &get()
+        {
+            static TrivialSelfPairsTestData singleton;
+            return singleton.data_;
+        }
+
+        TrivialSelfPairsTestData() : data_(12345, 1.0)
+        {
+            data_.box_[XX][XX] = 3.0;
+            data_.box_[YY][YY] = 3.0;
+            data_.box_[ZZ][ZZ] = 3.0;
+            data_.generateRandomRefPositions(20);
+            data_.useRefPositionsAsTestPositions();
+            set_pbc(&data_.pbc_, epbcXYZ, data_.box_);
+            data_.computeReferences(&data_.pbc_);
+        }
+
+    private:
+        NeighborhoodSearchTestData data_;
+};
+
 class TrivialNoPBCTestData
 {
     public:
@@ -742,7 +762,7 @@ class TrivialNoPBCTestData
         {
             data_.generateRandomRefPositions(10);
             data_.generateRandomTestPositions(5);
-            data_.computeReferences(NULL);
+            data_.computeReferences(nullptr);
         }
 
     private:
@@ -775,6 +795,30 @@ class RandomBoxFullPBCData
         NeighborhoodSearchTestData data_;
 };
 
+class RandomBoxSelfPairsData
+{
+    public:
+        static const NeighborhoodSearchTestData &get()
+        {
+            static RandomBoxSelfPairsData singleton;
+            return singleton.data_;
+        }
+
+        RandomBoxSelfPairsData() : data_(12345, 1.0)
+        {
+            data_.box_[XX][XX] = 10.0;
+            data_.box_[YY][YY] = 5.0;
+            data_.box_[ZZ][ZZ] = 7.0;
+            data_.generateRandomRefPositions(1000);
+            data_.useRefPositionsAsTestPositions();
+            set_pbc(&data_.pbc_, epbcXYZ, data_.box_);
+            data_.computeReferences(&data_.pbc_);
+        }
+
+    private:
+        NeighborhoodSearchTestData data_;
+};
+
 class RandomBoxXYFullPBCData
 {
     public:
@@ -875,7 +919,7 @@ class RandomBoxNoPBCData
             data_.generateRandomRefPositions(1000);
             data_.generateRandomTestPositions(100);
             set_pbc(&data_.pbc_, epbcNONE, data_.box_);
-            data_.computeReferences(NULL);
+            data_.computeReferences(nullptr);
         }
 
     private:
@@ -1000,6 +1044,34 @@ TEST_F(NeighborhoodSearchTest, GridSearchXYBox)
     testPairSearch(&search, data);
 }
 
+TEST_F(NeighborhoodSearchTest, SimpleSelfPairsSearch)
+{
+    const NeighborhoodSearchTestData &data = TrivialSelfPairsTestData::get();
+
+    nb_.setCutoff(data.cutoff_);
+    nb_.setMode(gmx::AnalysisNeighborhood::eSearchMode_Simple);
+    gmx::AnalysisNeighborhoodSearch search =
+        nb_.initSearch(&data.pbc_, data.refPositions());
+    ASSERT_EQ(gmx::AnalysisNeighborhood::eSearchMode_Simple, search.mode());
+
+    testPairSearchFull(&search, data, data.testPositions(), nullptr,
+                       gmx::EmptyArrayRef(), gmx::EmptyArrayRef(), true);
+}
+
+TEST_F(NeighborhoodSearchTest, GridSelfPairsSearch)
+{
+    const NeighborhoodSearchTestData &data = RandomBoxSelfPairsData::get();
+
+    nb_.setCutoff(data.cutoff_);
+    nb_.setMode(gmx::AnalysisNeighborhood::eSearchMode_Grid);
+    gmx::AnalysisNeighborhoodSearch search =
+        nb_.initSearch(&data.pbc_, data.refPositions());
+    ASSERT_EQ(gmx::AnalysisNeighborhood::eSearchMode_Grid, search.mode());
+
+    testPairSearchFull(&search, data, data.testPositions(), nullptr,
+                       gmx::EmptyArrayRef(), gmx::EmptyArrayRef(), true);
+}
+
 TEST_F(NeighborhoodSearchTest, HandlesConcurrentSearches)
 {
     const NeighborhoodSearchTestData &data = TrivialTestData::get();
@@ -1059,7 +1131,7 @@ TEST_F(NeighborhoodSearchTest, HandlesNullPBC)
 
     nb_.setCutoff(data.cutoff_);
     gmx::AnalysisNeighborhoodSearch search =
-        nb_.initSearch(NULL, data.refPositions());
+        nb_.initSearch(nullptr, data.refPositions());
     ASSERT_EQ(gmx::AnalysisNeighborhood::eSearchMode_Simple, search.mode());
 
     testIsWithin(&search, data);
@@ -1114,7 +1186,8 @@ TEST_F(NeighborhoodSearchTest, SimpleSearchExclusions)
 
     testPairSearchFull(&search, data,
                        data.testPositions().exclusionIds(helper.testPosIds()),
-                       helper.exclusions(), gmx::EmptyArrayRef(), gmx::EmptyArrayRef());
+                       helper.exclusions(), gmx::EmptyArrayRef(),
+                       gmx::EmptyArrayRef(), false);
 }
 
 TEST_F(NeighborhoodSearchTest, GridSearchExclusions)
@@ -1134,7 +1207,8 @@ TEST_F(NeighborhoodSearchTest, GridSearchExclusions)
 
     testPairSearchFull(&search, data,
                        data.testPositions().exclusionIds(helper.testPosIds()),
-                       helper.exclusions(), gmx::EmptyArrayRef(), gmx::EmptyArrayRef());
+                       helper.exclusions(), gmx::EmptyArrayRef(),
+                       gmx::EmptyArrayRef(), false);
 }
 
 } // namespace
index c9ed4c7f9418fbdc09019c7a5111649bb4789cb7..00e22a5acc6615202b1c9fd11e2d0dae5cf87099 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,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.
@@ -157,12 +157,12 @@ PositionCalculationTest::~PositionCalculationTest()
 
 void PositionCalculationTest::generateCoordinates()
 {
-    t_topology *top   = topManager_.topology();
+    t_atoms    &atoms = topManager_.atoms();
     t_trxframe *frame = topManager_.frame();
-    for (int i = 0; i < top->atoms.nr; ++i)
+    for (int i = 0; i < atoms.nr; ++i)
     {
         frame->x[i][XX] = i;
-        frame->x[i][YY] = top->atoms.atom[i].resind;
+        frame->x[i][YY] = atoms.atom[i].resind;
         frame->x[i][ZZ] = 0.0;
         if (frame->bV)
         {
@@ -201,7 +201,7 @@ PositionCalculationTest::initPositions(gmx_ana_poscalc_t *pc, const char *name)
     posList_.reserve(posList_.size() + 1);
     PositionPointer p(new gmx_ana_pos_t());
     gmx_ana_pos_t  *result = p.get();
-    posList_.push_back(PositionTest(std::move(p), pc, name));
+    posList_.emplace_back(std::move(p), pc, name);
     gmx_ana_poscalc_init_pos(pc, result);
     return result;
 }
@@ -209,7 +209,7 @@ PositionCalculationTest::initPositions(gmx_ana_poscalc_t *pc, const char *name)
 void PositionCalculationTest::checkInitialized()
 {
     gmx::test::TestReferenceChecker  compound(
-            checker_.checkCompound("InitializedPositions", NULL));
+            checker_.checkCompound("InitializedPositions", nullptr));
     PositionTestList::const_iterator pi;
     for (pi = posList_.begin(); pi != posList_.end(); ++pi)
     {
@@ -224,7 +224,7 @@ void PositionCalculationTest::updateAndCheck(
     gmx_ana_index_t g;
     g.isize = atoms.size();
     g.index = const_cast<int *>(atoms.data());
-    gmx_ana_poscalc_update(pc, p, &g, topManager_.frame(), NULL);
+    gmx_ana_poscalc_update(pc, p, &g, topManager_.frame(), nullptr);
     checkPositions(checker, name, p, true);
 }
 
@@ -243,9 +243,12 @@ void PositionCalculationTest::testSingleStatic(
         flags |= POS_FORCES;
     }
     gmx_ana_poscalc_t *pc = createCalculation(type, flags);
-    EXPECT_EQ(bExpectTop, gmx_ana_poscalc_requires_top(pc));
+    const bool         requiresTopology
+        = gmx_ana_poscalc_required_topology_info(pc)
+            != gmx::PositionCalculationCollection::RequiredTopologyInfo::None;
+    EXPECT_EQ(bExpectTop, requiresTopology);
     setMaximumGroup(pc, atoms);
-    gmx_ana_pos_t *p = initPositions(pc, NULL);
+    gmx_ana_pos_t *p = initPositions(pc, nullptr);
     checkInitialized();
     {
         generateCoordinates();
@@ -257,7 +260,7 @@ void PositionCalculationTest::testSingleStatic(
         pcc_.initFrame(frame);
         gmx::test::TestReferenceChecker frameCompound(
                 checker_.checkCompound("EvaluatedPositions", "Frame0"));
-        updateAndCheck(pc, p, atoms, &frameCompound, NULL);
+        updateAndCheck(pc, p, atoms, &frameCompound, nullptr);
     }
 }
 
@@ -268,9 +271,12 @@ void PositionCalculationTest::testSingleDynamic(
         const gmx::ConstArrayRef<int> &index)
 {
     gmx_ana_poscalc_t *pc = createCalculation(type, flags | POS_DYNAMIC);
-    EXPECT_EQ(bExpectTop, gmx_ana_poscalc_requires_top(pc));
+    const bool         requiresTopology
+        = gmx_ana_poscalc_required_topology_info(pc)
+            != gmx::PositionCalculationCollection::RequiredTopologyInfo::None;
+    EXPECT_EQ(bExpectTop, requiresTopology);
     setMaximumGroup(pc, initAtoms);
-    gmx_ana_pos_t *p = initPositions(pc, NULL);
+    gmx_ana_pos_t *p = initPositions(pc, nullptr);
     checkInitialized();
     {
         generateCoordinates();
@@ -282,7 +288,7 @@ void PositionCalculationTest::testSingleDynamic(
         pcc_.initFrame(topManager_.frame());
         gmx::test::TestReferenceChecker frameCompound(
                 checker_.checkCompound("EvaluatedPositions", "Frame0"));
-        updateAndCheck(pc, p, evalAtoms, &frameCompound, NULL);
+        updateAndCheck(pc, p, evalAtoms, &frameCompound, nullptr);
     }
 }
 
@@ -295,7 +301,10 @@ void PositionCalculationTest::setTopologyIfRequired()
     std::vector<gmx_ana_poscalc_t *>::const_iterator pci;
     for (pci = pcList_.begin(); pci != pcList_.end(); ++pci)
     {
-        if (gmx_ana_poscalc_requires_top(*pci))
+        const bool         requiresTopology
+            = gmx_ana_poscalc_required_topology_info(*pci)
+                != gmx::PositionCalculationCollection::RequiredTopologyInfo::None;
+        if (requiresTopology)
         {
             bTopSet_ = true;
             pcc_.setTopology(topManager_.topology());
@@ -325,7 +334,7 @@ void PositionCalculationTest::checkPositions(
     for (int i = 0; i < p->count(); ++i)
     {
         gmx::test::TestReferenceChecker posCompound(
-                compound.checkCompound("Position", NULL));
+                compound.checkCompound("Position", nullptr));
         posCompound.checkSequence(&p->m.mapb.a[p->m.mapb.index[i]],
                                   &p->m.mapb.a[p->m.mapb.index[i+1]],
                                   "Atoms");
@@ -334,11 +343,11 @@ void PositionCalculationTest::checkPositions(
         {
             posCompound.checkVector(p->x[i], "Coordinates");
         }
-        if (bCoordinates && p->v != NULL)
+        if (bCoordinates && p->v != nullptr)
         {
             posCompound.checkVector(p->v[i], "Velocity");
         }
-        if (bCoordinates && p->f != NULL)
+        if (bCoordinates && p->f != nullptr)
         {
             posCompound.checkVector(p->f[i], "Force");
         }
index 34f59aabcdd32885d0c449e4861232fde402de6d..356f2e7beb626e9ef88fd54fb3212670b6449d79 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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -82,7 +82,7 @@ class SelectionCollectionTest : public ::testing::Test
 
         void setAtomCount(int natoms)
         {
-            ASSERT_NO_THROW_GMX(sc_.setTopology(NULL, natoms));
+            ASSERT_NO_THROW_GMX(sc_.setTopology(nullptr, natoms));
         }
         void loadTopology(const char *filename);
         void setTopology();
@@ -91,7 +91,6 @@ class SelectionCollectionTest : public ::testing::Test
         gmx::test::TopologyManager  topManager_;
         gmx::SelectionCollection    sc_;
         gmx::SelectionList          sel_;
-        t_topology                 *top_;
         gmx_ana_indexgrps_t        *grps_;
 };
 
@@ -108,7 +107,7 @@ GMX_TEST_OPTIONS(SelectionCollectionTestOptions, options)
 #endif
 
 SelectionCollectionTest::SelectionCollectionTest()
-    : top_(NULL), grps_(NULL)
+    : grps_(nullptr)
 {
     topManager_.requestFrame();
     sc_.setDebugLevel(s_debugLevel);
@@ -118,7 +117,7 @@ SelectionCollectionTest::SelectionCollectionTest()
 
 SelectionCollectionTest::~SelectionCollectionTest()
 {
-    if (grps_ != NULL)
+    if (grps_ != nullptr)
     {
         gmx_ana_indexgrps_free(grps_);
     }
@@ -134,19 +133,17 @@ SelectionCollectionTest::loadTopology(const char *filename)
 void
 SelectionCollectionTest::setTopology()
 {
-    top_   = topManager_.topology();
-
-    ASSERT_NO_THROW_GMX(sc_.setTopology(top_, -1));
+    ASSERT_NO_THROW_GMX(sc_.setTopology(topManager_.topology(), -1));
 }
 
 void
 SelectionCollectionTest::loadIndexGroups(const char *filename)
 {
-    GMX_RELEASE_ASSERT(grps_ == NULL,
+    GMX_RELEASE_ASSERT(grps_ == nullptr,
                        "External groups can only be loaded once");
     std::string fullpath =
         gmx::test::TestFileManager::getInputFilePath(filename);
-    gmx_ana_indexgrps_init(&grps_, NULL, fullpath.c_str());
+    gmx_ana_indexgrps_init(&grps_, nullptr, fullpath.c_str());
     sc_.setIndexGroups(grps_);
 }
 
@@ -178,7 +175,7 @@ void SelectionCollectionInteractiveTest::runTest(
     // TODO: Check something about the returned selections as well.
     ASSERT_NO_THROW_GMX(sc_.parseInteractive(
                                 count, &helper_.inputStream(),
-                                bInteractive ? &helper_.outputStream() : NULL,
+                                bInteractive ? &helper_.outputStream() : nullptr,
                                 "for test context"));
     helper_.checkSession();
 }
@@ -256,7 +253,7 @@ SelectionCollectionDataTest::checkSelection(
                 checker->checkSequenceCompound("Positions", sel.posCount()));
         for (int i = 0; i < sel.posCount(); ++i)
         {
-            TestReferenceChecker          poscompound(compound.checkCompound("Position", NULL));
+            TestReferenceChecker          poscompound(compound.checkCompound("Position", nullptr));
             const gmx::SelectionPosition &p = sel.position(i);
             if (flags.test(efTestPositionAtoms))
             {
@@ -368,7 +365,7 @@ SelectionCollectionDataTest::runEvaluate()
     using gmx::test::TestReferenceChecker;
 
     ++framenr_;
-    ASSERT_NO_THROW_GMX(sc_.evaluate(topManager_.frame(), NULL));
+    ASSERT_NO_THROW_GMX(sc_.evaluate(topManager_.frame(), nullptr));
     std::string          frame = gmx::formatString("Frame%d", framenr_);
     TestReferenceChecker compound(
             checker_.checkCompound("EvaluatedSelections", frame.c_str()));
@@ -423,26 +420,58 @@ SelectionCollectionDataTest::runTest(
 
 TEST_F(SelectionCollectionTest, HandlesNoSelections)
 {
-    EXPECT_FALSE(sc_.requiresTopology());
+    EXPECT_FALSE(sc_.requiredTopologyProperties().hasAny());
     EXPECT_NO_THROW_GMX(sc_.compile());
+    EXPECT_FALSE(sc_.requiredTopologyProperties().hasAny());
+}
+
+TEST_F(SelectionCollectionTest, HandlesNoSelectionsWithDefaultPositionType)
+{
+    EXPECT_NO_THROW_GMX(sc_.setOutputPosType("res_com"));
+    EXPECT_TRUE(sc_.requiredTopologyProperties().needsTopology);
+    EXPECT_TRUE(sc_.requiredTopologyProperties().needsMasses);
+    EXPECT_NO_THROW_GMX(sc_.setOutputPosType("res_cog"));
+    EXPECT_TRUE(sc_.requiredTopologyProperties().needsTopology);
+    EXPECT_FALSE(sc_.requiredTopologyProperties().needsMasses);
+    ASSERT_NO_THROW_GMX(sc_.parseFromString("atom of atomnr 1 to 10"));
+    ASSERT_NO_FATAL_FAILURE(loadTopology("simple.gro"));
+    ASSERT_NO_THROW_GMX(sc_.compile());
+    EXPECT_FALSE(sc_.requiredTopologyProperties().hasAny());
 }
 
 TEST_F(SelectionCollectionTest, HandlesVelocityAndForceRequests)
 {
     ASSERT_NO_THROW_GMX(sel_ = sc_.parseFromString("atomnr 1 to 10; none"));
+    EXPECT_FALSE(sc_.requiredTopologyProperties().hasAny());
     ASSERT_NO_FATAL_FAILURE(setAtomCount(10));
     ASSERT_EQ(2U, sel_.size());
     ASSERT_NO_THROW_GMX(sel_[0].setEvaluateVelocities(true));
     ASSERT_NO_THROW_GMX(sel_[1].setEvaluateVelocities(true));
     ASSERT_NO_THROW_GMX(sel_[0].setEvaluateForces(true));
     ASSERT_NO_THROW_GMX(sel_[1].setEvaluateForces(true));
+    EXPECT_FALSE(sc_.requiredTopologyProperties().hasAny());
     ASSERT_NO_THROW_GMX(sc_.compile());
+    EXPECT_FALSE(sc_.requiredTopologyProperties().hasAny());
     EXPECT_TRUE(sel_[0].hasVelocities());
     EXPECT_TRUE(sel_[1].hasVelocities());
     EXPECT_TRUE(sel_[0].hasForces());
     EXPECT_TRUE(sel_[1].hasForces());
 }
 
+TEST_F(SelectionCollectionTest, HandlesForceRequestForCenterOfGeometry)
+{
+    ASSERT_NO_THROW_GMX(sel_ = sc_.parseFromString("res_cog of atomnr 1 to 10"));
+    EXPECT_TRUE(sc_.requiredTopologyProperties().needsTopology);
+    ASSERT_NO_FATAL_FAILURE(loadTopology("simple.gro"));
+    ASSERT_EQ(1U, sel_.size());
+    ASSERT_NO_THROW_GMX(sel_[0].setEvaluateForces(true));
+    // In principle, the code could know here that the masses are required, but
+    // currently it only knows this after compilation.
+    ASSERT_NO_THROW_GMX(sc_.compile());
+    EXPECT_TRUE(sc_.requiredTopologyProperties().needsMasses);
+    EXPECT_TRUE(sel_[0].hasForces());
+}
+
 TEST_F(SelectionCollectionTest, ParsesSelectionsFromFile)
 {
     ASSERT_NO_THROW_GMX(sel_ = sc_.parseFromFile(
@@ -505,7 +534,7 @@ TEST_F(SelectionCollectionTest, HandlesMissingMethodParamValue3)
 
 TEST_F(SelectionCollectionTest, HandlesUnknownGroupReferenceParser1)
 {
-    ASSERT_NO_THROW_GMX(sc_.setIndexGroups(NULL));
+    ASSERT_NO_THROW_GMX(sc_.setIndexGroups(nullptr));
     EXPECT_THROW_GMX(sc_.parseFromString("group \"foo\""), gmx::InconsistentInputError);
     EXPECT_THROW_GMX(sc_.parseFromString("4"), gmx::InconsistentInputError);
 }
@@ -521,7 +550,7 @@ TEST_F(SelectionCollectionTest, HandlesUnknownGroupReferenceDelayed1)
 {
     ASSERT_NO_THROW_GMX(sc_.parseFromString("group \"foo\""));
     ASSERT_NO_FATAL_FAILURE(setAtomCount(10));
-    EXPECT_THROW_GMX(sc_.setIndexGroups(NULL), gmx::InconsistentInputError);
+    EXPECT_THROW_GMX(sc_.setIndexGroups(nullptr), gmx::InconsistentInputError);
     EXPECT_THROW_GMX(sc_.compile(), gmx::APIError);
 }
 
@@ -557,7 +586,7 @@ TEST_F(SelectionCollectionTest, HandlesUnsortedGroupReferenceDelayed)
 
 TEST_F(SelectionCollectionTest, HandlesOutOfRangeAtomIndexInGroup)
 {
-    ASSERT_NO_THROW_GMX(sc_.setTopology(NULL, 5));
+    ASSERT_NO_THROW_GMX(sc_.setTopology(nullptr, 5));
     ASSERT_NO_THROW_GMX(loadIndexGroups("simple.ndx"));
     EXPECT_THROW_GMX(sc_.parseFromString("group \"GrpB\""), gmx::InconsistentInputError);
 }
@@ -566,12 +595,12 @@ TEST_F(SelectionCollectionTest, HandlesOutOfRangeAtomIndexInGroupDelayed)
 {
     ASSERT_NO_THROW_GMX(loadIndexGroups("simple.ndx"));
     ASSERT_NO_THROW_GMX(sc_.parseFromString("group \"GrpB\""));
-    EXPECT_THROW_GMX(sc_.setTopology(NULL, 5), gmx::InconsistentInputError);
+    EXPECT_THROW_GMX(sc_.setTopology(nullptr, 5), gmx::InconsistentInputError);
 }
 
 TEST_F(SelectionCollectionTest, HandlesOutOfRangeAtomIndexInGroupDelayed2)
 {
-    ASSERT_NO_THROW_GMX(sc_.setTopology(NULL, 5));
+    ASSERT_NO_THROW_GMX(sc_.setTopology(nullptr, 5));
     ASSERT_NO_THROW_GMX(sc_.parseFromString("group \"GrpB\""));
     EXPECT_THROW_GMX(loadIndexGroups("simple.ndx"), gmx::InconsistentInputError);
 }
@@ -616,7 +645,7 @@ TEST_F(SelectionCollectionTest, RecoversFromInvalidPermutation3)
     ASSERT_NO_THROW_GMX(sc_.parseFromString("x < 1.5 permute 3 2 1"));
     ASSERT_NO_FATAL_FAILURE(loadTopology("simple.gro"));
     ASSERT_NO_THROW_GMX(sc_.compile());
-    EXPECT_THROW_GMX(sc_.evaluate(topManager_.frame(), NULL), gmx::InconsistentInputError);
+    EXPECT_THROW_GMX(sc_.evaluate(topManager_.frame(), nullptr), gmx::InconsistentInputError);
 }
 
 TEST_F(SelectionCollectionTest, HandlesFramesWithTooSmallAtomSubsets)
@@ -625,7 +654,7 @@ TEST_F(SelectionCollectionTest, HandlesFramesWithTooSmallAtomSubsets)
     ASSERT_NO_FATAL_FAILURE(loadTopology("simple.gro"));
     ASSERT_NO_THROW_GMX(sc_.compile());
     topManager_.frame()->natoms = 8;
-    EXPECT_THROW_GMX(sc_.evaluate(topManager_.frame(), NULL), gmx::InconsistentInputError);
+    EXPECT_THROW_GMX(sc_.evaluate(topManager_.frame(), nullptr), gmx::InconsistentInputError);
 }
 
 TEST_F(SelectionCollectionTest, HandlesFramesWithTooSmallAtomSubsets2)
@@ -635,18 +664,18 @@ TEST_F(SelectionCollectionTest, HandlesFramesWithTooSmallAtomSubsets2)
     ASSERT_NO_FATAL_FAILURE(loadTopology("simple.gro"));
     ASSERT_NO_THROW_GMX(sc_.compile());
     topManager_.initFrameIndices(index);
-    EXPECT_THROW_GMX(sc_.evaluate(topManager_.frame(), NULL), gmx::InconsistentInputError);
+    EXPECT_THROW_GMX(sc_.evaluate(topManager_.frame(), nullptr), gmx::InconsistentInputError);
 }
 
 TEST_F(SelectionCollectionTest, HandlesFramesWithTooSmallAtomSubsets3)
 {
     const int index[] = { 0, 1, 2, 3, 4, 5, 6, 9, 10, 11 };
     // Evaluating the positions will require atoms 1-3, 7-12.
-    ASSERT_NO_THROW_GMX(sc_.parseFromString("whole_res_com of atomnr 2 7 11"));
+    ASSERT_NO_THROW_GMX(sc_.parseFromString("whole_res_cog of atomnr 2 7 11"));
     ASSERT_NO_FATAL_FAILURE(loadTopology("simple.gro"));
     ASSERT_NO_THROW_GMX(sc_.compile());
     topManager_.initFrameIndices(index);
-    EXPECT_THROW_GMX(sc_.evaluate(topManager_.frame(), NULL), gmx::InconsistentInputError);
+    EXPECT_THROW_GMX(sc_.evaluate(topManager_.frame(), nullptr), gmx::InconsistentInputError);
 }
 
 TEST_F(SelectionCollectionTest, HandlesFramesWithTooSmallAtomSubsets4)
@@ -655,7 +684,7 @@ TEST_F(SelectionCollectionTest, HandlesFramesWithTooSmallAtomSubsets4)
     ASSERT_NO_FATAL_FAILURE(loadTopology("simple.gro"));
     ASSERT_NO_THROW_GMX(sc_.compile());
     topManager_.frame()->natoms = 10;
-    EXPECT_THROW_GMX(sc_.evaluate(topManager_.frame(), NULL), gmx::InconsistentInputError);
+    EXPECT_THROW_GMX(sc_.evaluate(topManager_.frame(), nullptr), gmx::InconsistentInputError);
 }
 
 // TODO: Tests for more evaluation errors
@@ -853,8 +882,9 @@ TEST_F(SelectionCollectionDataTest, HandlesMolIndex)
         "molecule 2 3 5"
     };
     ASSERT_NO_FATAL_FAILURE(runParser(selections));
-    ASSERT_NO_FATAL_FAILURE(loadTopology("simple.gro"));
+    ASSERT_NO_FATAL_FAILURE(topManager_.loadTopology("simple.gro"));
     topManager_.initUniformMolecules(3);
+    ASSERT_NO_FATAL_FAILURE(setTopology());
     ASSERT_NO_FATAL_FAILURE(runCompiler());
 }
 
@@ -885,9 +915,10 @@ TEST_F(SelectionCollectionDataTest, HandlesAtomtype)
         "atomtype CA"
     };
     ASSERT_NO_FATAL_FAILURE(runParser(selections));
-    ASSERT_NO_FATAL_FAILURE(loadTopology("simple.gro"));
+    ASSERT_NO_FATAL_FAILURE(topManager_.loadTopology("simple.gro"));
     const char *const types[] = { "CA", "SA", "SB" };
     topManager_.initAtomTypes(types);
+    ASSERT_NO_FATAL_FAILURE(setTopology());
     ASSERT_NO_FATAL_FAILURE(runCompiler());
 }
 
@@ -906,11 +937,15 @@ TEST_F(SelectionCollectionDataTest, HandlesMass)
         "mass > 5"
     };
     ASSERT_NO_FATAL_FAILURE(runParser(selections));
-    ASSERT_NO_FATAL_FAILURE(loadTopology("simple.gro"));
-    for (int i = 0; i < top_->atoms.nr; ++i)
+    EXPECT_TRUE(sc_.requiredTopologyProperties().needsMasses);
+    ASSERT_NO_FATAL_FAILURE(topManager_.loadTopology("simple.gro"));
+    t_atoms &atoms = topManager_.atoms();
+    for (int i = 0; i < atoms.nr; ++i)
     {
-        top_->atoms.atom[i].m = 1.0 + i;
+        atoms.atom[i].m = 1.0 + i;
     }
+    atoms.haveMass = TRUE;
+    ASSERT_NO_FATAL_FAILURE(setTopology());
     ASSERT_NO_FATAL_FAILURE(runCompiler());
 }
 
@@ -920,13 +955,17 @@ TEST_F(SelectionCollectionDataTest, HandlesCharge)
         "charge < 0.5"
     };
     ASSERT_NO_FATAL_FAILURE(runParser(selections));
-    ASSERT_NO_FATAL_FAILURE(loadTopology("simple.gro"));
-    for (int i = 0; i < top_->atoms.nr; ++i)
+    ASSERT_NO_FATAL_FAILURE(topManager_.loadTopology("simple.gro"));
+    t_atoms &atoms = topManager_.atoms();
+    for (int i = 0; i < atoms.nr; ++i)
     {
-        top_->atoms.atom[i].q = i / 10.0;
+        atoms.atom[i].q = i / 10.0;
     }
-    //ensure exact representation of 0.5 is used, so the test is always reproducible
-    top_->atoms.atom[5].q = 0.5;
+    // Ensure exact representation of 0.5 is used, so that the test is
+    // reproducible.
+    atoms.atom[5].q  = 0.5;
+    atoms.haveCharge = TRUE;
+    ASSERT_NO_FATAL_FAILURE(setTopology());
     ASSERT_NO_FATAL_FAILURE(runCompiler());
 }
 
@@ -1115,12 +1154,16 @@ TEST_F(SelectionCollectionDataTest, ComputesMassesAndCharges)
     setFlags(TestFlags() | efTestEvaluation | efTestPositionAtoms
              | efTestPositionMasses | efTestPositionCharges);
     ASSERT_NO_FATAL_FAILURE(runParser(selections));
-    ASSERT_NO_FATAL_FAILURE(loadTopology("simple.gro"));
-    for (int i = 0; i < top_->atoms.nr; ++i)
+    ASSERT_NO_FATAL_FAILURE(topManager_.loadTopology("simple.gro"));
+    t_atoms &atoms = topManager_.atoms();
+    for (int i = 0; i < atoms.nr; ++i)
     {
-        top_->atoms.atom[i].m =   1.0 + i / 100.0;
-        top_->atoms.atom[i].q = -(1.0 + i / 100.0);
+        atoms.atom[i].m =   1.0 + i / 100.0;
+        atoms.atom[i].q = -(1.0 + i / 100.0);
     }
+    atoms.haveMass   = TRUE;
+    atoms.haveCharge = TRUE;
+    ASSERT_NO_FATAL_FAILURE(setTopology());
     ASSERT_NO_FATAL_FAILURE(runCompiler());
     ASSERT_NO_FATAL_FAILURE(runEvaluate());
     ASSERT_NO_FATAL_FAILURE(runEvaluateFinal());
@@ -1289,11 +1332,14 @@ TEST_F(SelectionCollectionDataTest, HandlesOverlappingRealRanges)
         "charge {0.05 to -0.3 -0.05 to 0.55}"
     };
     ASSERT_NO_FATAL_FAILURE(runParser(selections));
-    ASSERT_NO_FATAL_FAILURE(loadTopology("simple.gro"));
-    for (int i = 0; i < top_->atoms.nr; ++i)
+    ASSERT_NO_FATAL_FAILURE(topManager_.loadTopology("simple.gro"));
+    t_atoms &atoms = topManager_.atoms();
+    for (int i = 0; i < atoms.nr; ++i)
     {
-        top_->atoms.atom[i].q = i / 10.0 - 0.5;
+        atoms.atom[i].q = i / 10.0 - 0.5;
     }
+    atoms.haveCharge = TRUE;
+    ASSERT_NO_FATAL_FAILURE(setTopology());
     ASSERT_NO_FATAL_FAILURE(runCompiler());
 }
 
index 8cd96fab1315ffa10d73d01ebe0fdb7cf82133fb..f230af5a696dfd5992fd8335cc565fdff193537a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -83,7 +83,7 @@ class SelectionOptionTestBase : public ::testing::Test
 };
 
 SelectionOptionTestBase::SelectionOptionTestBase()
-    : manager_(&sc_), options_(NULL, NULL)
+    : manager_(&sc_)
 {
     options_.addManager(&manager_);
     sc_.setReferencePosType("atom");
@@ -263,7 +263,7 @@ TEST_F(SelectionOptionTest, HandlesDefaultSelectionText)
 
     ASSERT_TRUE(sel.isValid());
 
-    EXPECT_NO_THROW_GMX(sc_.setTopology(NULL, 10));
+    EXPECT_NO_THROW_GMX(sc_.setTopology(nullptr, 10));
     EXPECT_NO_THROW_GMX(sc_.compile());
 
     EXPECT_STREQ("all", sel.selectionText());
index 04796a2118fb9040ba2c66b139138dc11122fd58..975ce6e331a1d4463157d2ab8caa9a63f0e2c175 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,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.
@@ -51,6 +51,7 @@
 #include "gromacs/fileio/trxio.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/topology/atoms.h"
+#include "gromacs/topology/mtop_util.h"
 #include "gromacs/topology/topology.h"
 #include "gromacs/trajectory/trajectoryframe.h"
 #include "gromacs/utility/arrayref.h"
@@ -66,19 +67,19 @@ namespace test
 {
 
 TopologyManager::TopologyManager()
-    : top_(NULL), frame_(NULL)
+    : mtop_(nullptr), frame_(nullptr)
 {
 }
 
 TopologyManager::~TopologyManager()
 {
-    if (top_ != NULL)
+    if (mtop_ != nullptr)
     {
-        done_top(top_);
-        sfree(top_);
+        done_mtop(mtop_);
+        sfree(mtop_);
     }
 
-    if (frame_ != NULL)
+    if (frame_ != nullptr)
     {
         sfree(frame_->x);
         sfree(frame_->v);
@@ -86,13 +87,18 @@ TopologyManager::~TopologyManager()
         sfree(frame_->index);
         sfree(frame_);
     }
+
+    for (char *atomtype : atomtypes_)
+    {
+        sfree(atomtype);
+    }
 }
 
 void TopologyManager::requestFrame()
 {
-    GMX_RELEASE_ASSERT(top_ == NULL,
+    GMX_RELEASE_ASSERT(mtop_ == nullptr,
                        "Frame must be requested before initializing topology");
-    if (frame_ == NULL)
+    if (frame_ == nullptr)
     {
         snew(frame_, 1);
     }
@@ -100,7 +106,7 @@ void TopologyManager::requestFrame()
 
 void TopologyManager::requestVelocities()
 {
-    GMX_RELEASE_ASSERT(frame_ != NULL,
+    GMX_RELEASE_ASSERT(frame_ != nullptr,
                        "Velocities requested before requesting a frame");
     frame_->bV = TRUE;
     if (frame_->natoms > 0)
@@ -111,7 +117,7 @@ void TopologyManager::requestVelocities()
 
 void TopologyManager::requestForces()
 {
-    GMX_RELEASE_ASSERT(frame_ != NULL,
+    GMX_RELEASE_ASSERT(frame_ != nullptr,
                        "Forces requested before requesting a frame");
     frame_->bF = TRUE;
     if (frame_->natoms > 0)
@@ -122,19 +128,21 @@ void TopologyManager::requestForces()
 
 void TopologyManager::loadTopology(const char *filename)
 {
+    bool    fullTopology;
     int     ePBC;
-    rvec   *xtop = NULL;
+    rvec   *xtop = nullptr;
     matrix  box;
 
-    GMX_RELEASE_ASSERT(top_ == NULL, "Topology initialized more than once");
-    snew(top_, 1);
-    read_tps_conf(gmx::test::TestFileManager::getInputFilePath(filename).c_str(),
-                  top_, &ePBC, frame_ != NULL ? &xtop : NULL,
-                  NULL, box, FALSE);
+    GMX_RELEASE_ASSERT(mtop_ == nullptr, "Topology initialized more than once");
+    snew(mtop_, 1);
+    readConfAndTopology(
+            gmx::test::TestFileManager::getInputFilePath(filename).c_str(),
+            &fullTopology, mtop_, &ePBC, frame_ != nullptr ? &xtop : nullptr,
+            nullptr, box);
 
-    if (frame_ != NULL)
+    if (frame_ != nullptr)
     {
-        frame_->natoms = top_->atoms.nr;
+        frame_->natoms = mtop_->natoms;
         frame_->bX     = TRUE;
         snew(frame_->x, frame_->natoms);
         std::memcpy(frame_->x, xtop, sizeof(*frame_->x) * frame_->natoms);
@@ -147,14 +155,27 @@ void TopologyManager::loadTopology(const char *filename)
 
 void TopologyManager::initAtoms(int count)
 {
-    GMX_RELEASE_ASSERT(top_ == NULL, "Topology initialized more than once");
-    snew(top_, 1);
-    init_t_atoms(&top_->atoms, count, FALSE);
+    GMX_RELEASE_ASSERT(mtop_ == nullptr, "Topology initialized more than once");
+    snew(mtop_, 1);
+    mtop_->nmoltype = 1;
+    snew(mtop_->moltype, 1);
+    init_t_atoms(&mtop_->moltype[0].atoms, count, FALSE);
+    mtop_->nmolblock = 1;
+    snew(mtop_->molblock, 1);
+    mtop_->molblock[0].type            = 0;
+    mtop_->molblock[0].nmol            = 1;
+    mtop_->molblock[0].natoms_mol      = count;
+    mtop_->natoms                      = count;
+    mtop_->maxres_renum                = 0;
+    gmx_mtop_finalize(mtop_);
+    GMX_RELEASE_ASSERT(mtop_->maxres_renum == 0, "maxres_renum in mtop can be modified by an env.var., that is not supported in this test");
+    t_atoms &atoms = this->atoms();
     for (int i = 0; i < count; ++i)
     {
-        top_->atoms.atom[i].m = (i % 3 == 0 ? 2.0 : 1.0);
+        atoms.atom[i].m = (i % 3 == 0 ? 2.0 : 1.0);
     }
-    if (frame_ != NULL)
+    atoms.haveMass = TRUE;
+    if (frame_ != nullptr)
     {
         frame_->natoms = count;
         frame_->bX     = TRUE;
@@ -172,52 +193,55 @@ void TopologyManager::initAtoms(int count)
 
 void TopologyManager::initAtomTypes(const ConstArrayRef<const char *> &types)
 {
-    GMX_RELEASE_ASSERT(top_ != NULL, "Topology not initialized");
+    GMX_RELEASE_ASSERT(mtop_ != nullptr, "Topology not initialized");
     atomtypes_.reserve(types.size());
     for (const char *type : types)
     {
         atomtypes_.push_back(gmx_strdup(type));
     }
-    snew(top_->atoms.atomtype, top_->atoms.nr);
-    size_t j = 0;
-    for (int i = 0; i < top_->atoms.nr; ++i, ++j)
+    t_atoms &atoms = this->atoms();
+    snew(atoms.atomtype, atoms.nr);
+    size_t   j = 0;
+    for (int i = 0; i < atoms.nr; ++i, ++j)
     {
         if (j == types.size())
         {
             j = 0;
         }
-        top_->atoms.atomtype[i] = &atomtypes_[j];
+        atoms.atomtype[i] = &atomtypes_[j];
     }
+    atoms.haveType = TRUE;
 }
 
 void TopologyManager::initUniformResidues(int residueSize)
 {
-    GMX_RELEASE_ASSERT(top_ != NULL, "Topology not initialized");
-    int residueIndex = -1;
-    for (int i = 0; i < top_->atoms.nr; ++i)
+    GMX_RELEASE_ASSERT(mtop_ != nullptr, "Topology not initialized");
+    t_atoms &atoms        = this->atoms();
+    int      residueIndex = -1;
+    for (int i = 0; i < atoms.nr; ++i)
     {
         if (i % residueSize == 0)
         {
             ++residueIndex;
         }
-        top_->atoms.atom[i].resind = residueIndex;
+        atoms.atom[i].resind = residueIndex;
     }
 }
 
 void TopologyManager::initUniformMolecules(int moleculeSize)
 {
-    GMX_RELEASE_ASSERT(top_ != NULL, "Topology not initialized");
+    GMX_RELEASE_ASSERT(mtop_ != nullptr, "Topology not initialized");
     int index = 0;
-    top_->mols.nalloc_index = (top_->atoms.nr + moleculeSize - 1) / moleculeSize + 1;
-    snew(top_->mols.index, top_->mols.nalloc_index);
-    top_->mols.nr = 0;
-    while (index < top_->atoms.nr)
+    mtop_->mols.nalloc_index = (mtop_->natoms + moleculeSize - 1) / moleculeSize + 1;
+    srenew(mtop_->mols.index, mtop_->mols.nalloc_index);
+    mtop_->mols.nr = 0;
+    while (index < mtop_->natoms)
     {
-        top_->mols.index[top_->mols.nr] = index;
-        ++top_->mols.nr;
+        mtop_->mols.index[mtop_->mols.nr] = index;
+        ++mtop_->mols.nr;
         index += moleculeSize;
     }
-    top_->mols.index[top_->mols.nr] = top_->atoms.nr;
+    mtop_->mols.index[mtop_->mols.nr] = mtop_->natoms;
 }
 
 void TopologyManager::initFrameIndices(const ConstArrayRef<int> &index)
@@ -232,5 +256,13 @@ void TopologyManager::initFrameIndices(const ConstArrayRef<int> &index)
     frame_->natoms = index.size();
 }
 
+t_atoms &TopologyManager::atoms()
+{
+    GMX_RELEASE_ASSERT(mtop_ != nullptr, "Topology not initialized");
+    GMX_RELEASE_ASSERT(mtop_->natoms == mtop_->moltype[0].atoms.nr,
+                       "Test setup assumes all atoms in a single molecule type");
+    return mtop_->moltype[0].atoms;
+}
+
 } // namespace test
 } // namespace gmx
index 9adc4a30575406df33d4d3f8f91bf7217a3340ce..4b5b9dd3bcaf872da8a2e087c58694c8c16ef68a 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,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.
@@ -44,7 +44,8 @@
 
 #include <vector>
 
-struct t_topology;
+struct gmx_mtop_t;
+struct t_atoms;
 struct t_trxframe;
 
 namespace gmx
@@ -74,11 +75,12 @@ class TopologyManager
 
         void initFrameIndices(const ConstArrayRef<int> &index);
 
-        t_topology *topology() { return top_; }
+        gmx_mtop_t *topology() { return mtop_; }
+        t_atoms &atoms();
         t_trxframe *frame() { return frame_; }
 
     private:
-        t_topology             *top_;
+        gmx_mtop_t             *mtop_;
         t_trxframe             *frame_;
         std::vector<char *>     atomtypes_;
 };
index 0787d52af08f687c9283788ecdca7cc1fe2443b2..77cf7559a8e99c896d725d0d70fbf171d2679d35 100644 (file)
@@ -345,7 +345,7 @@ maskzRsqrt(SimdDouble x, SimdDBool m)
     // The result will always be correct since we mask the result with m, but
     // for debug builds we also want to make sure not to generate FP exceptions
 #ifndef NDEBUG
-    x.simdInternal_ = vbslq_f64(m.simdInternal_, x.simdInternal_, vdupq_n_f64(1.0f));
+    x.simdInternal_ = vbslq_f64(m.simdInternal_, x.simdInternal_, vdupq_n_f64(1.0));
 #endif
     return {
                float64x2_t(vandq_u64(uint64x2_t(vrsqrteq_f64(x.simdInternal_)), m.simdInternal_))
@@ -358,7 +358,7 @@ maskzRcp(SimdDouble x, SimdDBool m)
     // The result will always be correct since we mask the result with m, but
     // for debug builds we also want to make sure not to generate FP exceptions
 #ifndef NDEBUG
-    x.simdInternal_ = vbslq_f64(m.simdInternal_, x.simdInternal_, vdupq_n_f64(1.0f));
+    x.simdInternal_ = vbslq_f64(m.simdInternal_, x.simdInternal_, vdupq_n_f64(1.0));
 #endif
     return {
                float64x2_t(vandq_u64(uint64x2_t(vrecpeq_f64(x.simdInternal_)), m.simdInternal_))
@@ -511,7 +511,7 @@ static inline SimdDouble gmx_simdcall
 selectByMask(SimdDouble a, SimdDBool m)
 {
     return {
-        float64x2_t(vandq_u64(uint64x2_t(a.simdInternal_), m.simdInternal_))
+               float64x2_t(vandq_u64(uint64x2_t(a.simdInternal_), m.simdInternal_))
     };
 }
 
@@ -519,7 +519,7 @@ static inline SimdDouble gmx_simdcall
 selectByNotMask(SimdDouble a, SimdDBool m)
 {
     return {
-        float64x2_t(vbicq_u64(uint64x2_t(a.simdInternal_), m.simdInternal_))
+               float64x2_t(vbicq_u64(uint64x2_t(a.simdInternal_), m.simdInternal_))
     };
 }
 
@@ -527,7 +527,7 @@ static inline SimdDouble gmx_simdcall
 blend(SimdDouble a, SimdDouble b, SimdDBool sel)
 {
     return {
-        vbslq_f64(sel.simdInternal_, b.simdInternal_, a.simdInternal_)
+               vbslq_f64(sel.simdInternal_, b.simdInternal_, a.simdInternal_)
     };
 }
 
@@ -535,7 +535,7 @@ static inline SimdDInt32 gmx_simdcall
 operator<<(SimdDInt32 a, int n)
 {
     return {
-        vshl_s32(a.simdInternal_, vdup_n_s32(n >= 32 ? 32 : n))
+               vshl_s32(a.simdInternal_, vdup_n_s32(n >= 32 ? 32 : n))
     };
 }
 
@@ -543,7 +543,7 @@ static inline SimdDInt32 gmx_simdcall
 operator>>(SimdDInt32 a, int n)
 {
     return {
-        vshl_s32(a.simdInternal_, vdup_n_s32(n >= 32 ? -32 : -n))
+               vshl_s32(a.simdInternal_, vdup_n_s32(n >= 32 ? -32 : -n))
     };
 }
 
@@ -551,7 +551,7 @@ static inline SimdDInt32 gmx_simdcall
 operator&(SimdDInt32 a, SimdDInt32 b)
 {
     return {
-        vand_s32(a.simdInternal_, b.simdInternal_)
+               vand_s32(a.simdInternal_, b.simdInternal_)
     };
 }
 
@@ -559,7 +559,7 @@ static inline SimdDInt32 gmx_simdcall
 andNot(SimdDInt32 a, SimdDInt32 b)
 {
     return {
-        vbic_s32(b.simdInternal_, a.simdInternal_)
+               vbic_s32(b.simdInternal_, a.simdInternal_)
     };
 }
 
@@ -567,7 +567,7 @@ static inline SimdDInt32 gmx_simdcall
 operator|(SimdDInt32 a, SimdDInt32 b)
 {
     return {
-        vorr_s32(a.simdInternal_, b.simdInternal_)
+               vorr_s32(a.simdInternal_, b.simdInternal_)
     };
 }
 
@@ -575,7 +575,7 @@ static inline SimdDInt32 gmx_simdcall
 operator^(SimdDInt32 a, SimdDInt32 b)
 {
     return {
-        veor_s32(a.simdInternal_, b.simdInternal_)
+               veor_s32(a.simdInternal_, b.simdInternal_)
     };
 }
 
@@ -583,7 +583,7 @@ static inline SimdDInt32 gmx_simdcall
 operator+(SimdDInt32 a, SimdDInt32 b)
 {
     return {
-        vadd_s32(a.simdInternal_, b.simdInternal_)
+               vadd_s32(a.simdInternal_, b.simdInternal_)
     };
 }
 
@@ -591,7 +591,7 @@ static inline SimdDInt32 gmx_simdcall
 operator-(SimdDInt32 a, SimdDInt32 b)
 {
     return {
-        vsub_s32(a.simdInternal_, b.simdInternal_)
+               vsub_s32(a.simdInternal_, b.simdInternal_)
     };
 }
 
@@ -599,7 +599,7 @@ static inline SimdDInt32 gmx_simdcall
 operator*(SimdDInt32 a, SimdDInt32 b)
 {
     return {
-        vmul_s32(a.simdInternal_, b.simdInternal_)
+               vmul_s32(a.simdInternal_, b.simdInternal_)
     };
 }
 
@@ -607,7 +607,7 @@ static inline SimdDIBool gmx_simdcall
 operator==(SimdDInt32 a, SimdDInt32 b)
 {
     return {
-        vceq_s32(a.simdInternal_, b.simdInternal_)
+               vceq_s32(a.simdInternal_, b.simdInternal_)
     };
 }
 
@@ -615,7 +615,7 @@ static inline SimdDIBool gmx_simdcall
 testBits(SimdDInt32 a)
 {
     return {
-        vtst_s32( a.simdInternal_, a.simdInternal_)
+               vtst_s32( a.simdInternal_, a.simdInternal_)
     };
 }
 
@@ -623,7 +623,7 @@ static inline SimdDIBool gmx_simdcall
 operator<(SimdDInt32 a, SimdDInt32 b)
 {
     return {
-        vclt_s32(a.simdInternal_, b.simdInternal_)
+               vclt_s32(a.simdInternal_, b.simdInternal_)
     };
 }
 
@@ -631,7 +631,7 @@ static inline SimdDIBool gmx_simdcall
 operator&&(SimdDIBool a, SimdDIBool b)
 {
     return {
-        vand_u32(a.simdInternal_, b.simdInternal_)
+               vand_u32(a.simdInternal_, b.simdInternal_)
     };
 }
 
@@ -639,7 +639,7 @@ static inline SimdDIBool gmx_simdcall
 operator||(SimdDIBool a, SimdDIBool b)
 {
     return {
-        vorr_u32(a.simdInternal_, b.simdInternal_)
+               vorr_u32(a.simdInternal_, b.simdInternal_)
     };
 }
 
@@ -653,7 +653,7 @@ static inline SimdDInt32 gmx_simdcall
 selectByMask(SimdDInt32 a, SimdDIBool m)
 {
     return {
-        vand_s32(a.simdInternal_, vreinterpret_s32_u32(m.simdInternal_))
+               vand_s32(a.simdInternal_, vreinterpret_s32_u32(m.simdInternal_))
     };
 }
 
@@ -661,7 +661,7 @@ static inline SimdDInt32 gmx_simdcall
 selectByNotMask(SimdDInt32 a, SimdDIBool m)
 {
     return {
-        vbic_s32(a.simdInternal_, vreinterpret_s32_u32(m.simdInternal_))
+               vbic_s32(a.simdInternal_, vreinterpret_s32_u32(m.simdInternal_))
     };
 }
 
@@ -669,7 +669,7 @@ static inline SimdDInt32 gmx_simdcall
 blend(SimdDInt32 a, SimdDInt32 b, SimdDIBool sel)
 {
     return {
-        vbsl_s32(sel.simdInternal_, b.simdInternal_, a.simdInternal_)
+               vbsl_s32(sel.simdInternal_, b.simdInternal_, a.simdInternal_)
     };
 }
 
@@ -677,7 +677,7 @@ static inline SimdDInt32 gmx_simdcall
 cvtR2I(SimdDouble a)
 {
     return {
-        vmovn_s64(vcvtnq_s64_f64(a.simdInternal_))
+               vmovn_s64(vcvtnq_s64_f64(a.simdInternal_))
     };
 }
 
@@ -685,7 +685,7 @@ static inline SimdDInt32 gmx_simdcall
 cvttR2I(SimdDouble a)
 {
     return {
-        vmovn_s64(vcvtq_s64_f64(a.simdInternal_))
+               vmovn_s64(vcvtq_s64_f64(a.simdInternal_))
     };
 }
 
@@ -693,7 +693,7 @@ static inline SimdDouble gmx_simdcall
 cvtI2R(SimdDInt32 a)
 {
     return {
-        vcvtq_f64_s64(vmovl_s32(a.simdInternal_))
+               vcvtq_f64_s64(vmovl_s32(a.simdInternal_))
     };
 }
 
@@ -701,7 +701,7 @@ static inline SimdDIBool gmx_simdcall
 cvtB2IB(SimdDBool a)
 {
     return {
-        vqmovn_u64(a.simdInternal_)
+               vqmovn_u64(a.simdInternal_)
     };
 }
 
@@ -709,7 +709,7 @@ static inline SimdDBool gmx_simdcall
 cvtIB2B(SimdDIBool a)
 {
     return {
-        vorrq_u64(vmovl_u32(a.simdInternal_), vshlq_n_u64(vmovl_u32(a.simdInternal_), 32))
+               vorrq_u64(vmovl_u32(a.simdInternal_), vshlq_n_u64(vmovl_u32(a.simdInternal_), 32))
     };
 }
 
@@ -724,7 +724,7 @@ static inline SimdFloat gmx_simdcall
 cvtDD2F(SimdDouble d0, SimdDouble d1)
 {
     return {
-        vcvt_high_f32_f64(vcvt_f32_f64(d0.simdInternal_), d1.simdInternal_)
+               vcvt_high_f32_f64(vcvt_f32_f64(d0.simdInternal_), d1.simdInternal_)
     };
 }
 
index ab9e2290756eb6abbe1cfda5013688f8bc973a51..d2c318a923585f0fd79246e3c86a5395f57cabf9 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,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.
@@ -42,9 +42,7 @@ namespace gmx
 static inline void
 simdPrefetch(const void * m)
 {
-#if defined(__ibmxl__) || defined(__xlC__)
-    __dcbt(m);
-#elif defined __GNUC__
+#if defined __GNUC__
     __builtin_prefetch(m);
 #endif
 }
index 9223492f29b385a9f3abb2600c0c49d60408e20b..e3e146bfb00a68d951474f2bdeed7909d25b4187 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,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.
@@ -41,6 +41,7 @@
 #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__
index 3b786729f4f4d95adb4c8511849ee0f5e54451b6..6cd0af1cf826e116836a80f4b0090d018772f4f1 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,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.
@@ -67,7 +67,7 @@ namespace gmx
  *        but if the pointer is not aligned the prefetch might start at the
  *        lower cache line boundary (meaning fewer bytes are prefetched).
  */
-static void
+static inline void
 simdPrefetch(void gmx_unused * m)
 {
     // Do nothing for reference implementation
diff --git a/src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128.h b/src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128.h
new file mode 100644 (file)
index 0000000..2ee27a3
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * 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_IMPL_X86_AVX2_128_H
+#define GMX_SIMD_IMPL_X86_AVX2_128_H
+
+#include "impl_x86_avx2_128_definitions.h"
+#include "impl_x86_avx2_128_general.h"
+#include "impl_x86_avx2_128_simd4_double.h"
+#include "impl_x86_avx2_128_simd4_float.h"
+#include "impl_x86_avx2_128_simd_double.h"
+#include "impl_x86_avx2_128_simd_float.h"
+#include "impl_x86_avx2_128_util_double.h"
+#include "impl_x86_avx2_128_util_float.h"
+
+#endif // GMX_SIMD_IMPL_X86_AVX2_128_H
diff --git a/src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_definitions.h b/src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_definitions.h
new file mode 100644 (file)
index 0000000..49182e2
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * 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_IMPL_X86_AVX2_128_DEFINITIONS_H
+#define GMX_SIMD_IMPL_X86_AVX2_128_DEFINITIONS_H
+
+// Capability definitions for (mostly) 128-bit AVX2
+#define GMX_SIMD                                1
+#define GMX_SIMD_HAVE_FLOAT                     1
+#define GMX_SIMD_HAVE_DOUBLE                    1
+#define GMX_SIMD_HAVE_LOADU                     1
+#define GMX_SIMD_HAVE_STOREU                    1
+#define GMX_SIMD_HAVE_LOGICAL                   1
+#define GMX_SIMD_HAVE_FMA                       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_EXTRACT            1
+#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_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_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   1
+#define GMX_SIMD_HAVE_GATHER_LOADU_BYSIMDINT_TRANSPOSE_DOUBLE  1
+#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 2
+
+#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                   2
+#define GMX_SIMD_FINT32_WIDTH                   4
+#define GMX_SIMD_DINT32_WIDTH                   2
+#define GMX_SIMD4_WIDTH                         4
+#define GMX_SIMD_RSQRT_BITS                    11
+#define GMX_SIMD_RCP_BITS                      11
+
+#endif // GMX_SIMD_IMPL_X86_AVX2_128_DEFINITIONS_H
diff --git a/src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_general.h b/src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_general.h
new file mode 100644 (file)
index 0000000..788fe87
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * 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_IMPL_X86_AVX2_128_GENERAL_H
+#define GMX_SIMD_IMPL_X86_AVX2_128_GENERAL_H
+
+#include "gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_general.h"
+
+#endif // GMX_SIMD_IMPL_X86_AVX2_128_GENERAL_H
diff --git a/src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_simd4_double.h b/src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_simd4_double.h
new file mode 100644 (file)
index 0000000..dbf743b
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * 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_IMPL_X86_AVX2_128_SIMD4_DOUBLE_H
+#define GMX_SIMD_IMPL_X86_AVX2_128_SIMD4_DOUBLE_H
+
+#include "gromacs/simd/impl_x86_avx2_256/impl_x86_avx2_256_simd4_double.h"
+
+#endif // GMX_SIMD_IMPL_X86_AVX2_128_SIMD4_DOUBLE_H
diff --git a/src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_simd4_float.h b/src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_simd4_float.h
new file mode 100644 (file)
index 0000000..69a6f66
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * 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_IMPL_X86_AVX2_128_SIMD4_FLOAT_H
+#define GMX_SIMD_IMPL_X86_AVX2_128_SIMD4_FLOAT_H
+
+#include "gromacs/simd/impl_x86_avx2_256/impl_x86_avx2_256_simd4_float.h"
+
+#endif // GMX_SIMD_IMPL_X86_AVX2_128_SIMD4_FLOAT_H
diff --git a/src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_simd_double.h b/src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_simd_double.h
new file mode 100644 (file)
index 0000000..8fb554c
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * 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_IMPL_X86_AVX2_128_SIMD_DOUBLE_H
+#define GMX_SIMD_IMPL_X86_AVX2_128_SIMD_DOUBLE_H
+
+#include "config.h"
+
+#include <immintrin.h>
+
+#include "gromacs/simd/impl_x86_sse4_1/impl_x86_sse4_1_simd_double.h"
+
+namespace gmx
+{
+
+static inline double gmx_simdcall
+reduce(SimdDouble a)
+{
+    __m128d b = _mm_add_sd(a.simdInternal_, _mm_permute_pd(a.simdInternal_, _MM_SHUFFLE2(1, 1)));
+    return *reinterpret_cast<double *>(&b);
+}
+
+static inline SimdDouble gmx_simdcall
+fma(SimdDouble a, SimdDouble b, SimdDouble c)
+{
+    return {
+               _mm_fmadd_pd(a.simdInternal_, b.simdInternal_, c.simdInternal_)
+    };
+}
+
+static inline SimdDouble gmx_simdcall
+fms(SimdDouble a, SimdDouble b, SimdDouble c)
+{
+    return {
+               _mm_fmsub_pd(a.simdInternal_, b.simdInternal_, c.simdInternal_)
+    };
+}
+
+static inline SimdDouble gmx_simdcall
+fnma(SimdDouble a, SimdDouble b, SimdDouble c)
+{
+    return {
+               _mm_fnmadd_pd(a.simdInternal_, b.simdInternal_, c.simdInternal_)
+    };
+}
+
+static inline SimdDouble gmx_simdcall
+fnms(SimdDouble a, SimdDouble b, SimdDouble c)
+{
+    return {
+               _mm_fnmsub_pd(a.simdInternal_, b.simdInternal_, c.simdInternal_)
+    };
+}
+
+}      // namespace gmx
+
+#endif // GMX_SIMD_IMPL_X86_AVX2_128_SIMD_DOUBLE_H
diff --git a/src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_simd_float.h b/src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_simd_float.h
new file mode 100644 (file)
index 0000000..eda4881
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * 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_IMPL_X86_AVX2_128_SIMD_FLOAT_H
+#define GMX_SIMD_IMPL_X86_AVX2_128_SIMD_FLOAT_H
+
+#include "config.h"
+
+#include <immintrin.h>
+
+#include "gromacs/simd/impl_x86_sse4_1/impl_x86_sse4_1_simd_float.h"
+
+namespace gmx
+{
+
+static inline float gmx_simdcall
+reduce(SimdFloat a)
+{
+    a.simdInternal_ = _mm_add_ps(a.simdInternal_, _mm_permute_ps(a.simdInternal_, _MM_SHUFFLE(1, 0, 3, 2)));
+    a.simdInternal_ = _mm_add_ss(a.simdInternal_, _mm_permute_ps(a.simdInternal_, _MM_SHUFFLE(0, 3, 2, 1)));
+    return *reinterpret_cast<float *>(&a);
+}
+
+static inline SimdFloat gmx_simdcall
+fma(SimdFloat a, SimdFloat b, SimdFloat c)
+{
+    return {
+               _mm_fmadd_ps(a.simdInternal_, b.simdInternal_, c.simdInternal_)
+    };
+}
+
+static inline SimdFloat gmx_simdcall
+fms(SimdFloat a, SimdFloat b, SimdFloat c)
+{
+    return {
+               _mm_fmsub_ps(a.simdInternal_, b.simdInternal_, c.simdInternal_)
+    };
+}
+
+static inline SimdFloat gmx_simdcall
+fnma(SimdFloat a, SimdFloat b, SimdFloat c)
+{
+    return {
+               _mm_fnmadd_ps(a.simdInternal_, b.simdInternal_, c.simdInternal_)
+    };
+}
+
+static inline SimdFloat gmx_simdcall
+fnms(SimdFloat a, SimdFloat b, SimdFloat c)
+{
+    return {
+               _mm_fnmsub_ps(a.simdInternal_, b.simdInternal_, c.simdInternal_)
+    };
+}
+
+}      // namespace gmx
+
+#endif // GMX_SIMD_IMPL_X86_AVX2_128_SIMD_FLOAT_H
diff --git a/src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_util_double.h b/src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_util_double.h
new file mode 100644 (file)
index 0000000..01bfa6c
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * 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_IMPL_X86_AVX2_128_UTIL_DOUBLE_H
+#define GMX_SIMD_IMPL_X86_AVX2_128_UTIL_DOUBLE_H
+
+#include "config.h"
+
+#include <immintrin.h>
+
+#include "gromacs/simd/impl_x86_sse4_1/impl_x86_sse4_1_util_double.h"
+
+namespace gmx
+{
+
+static inline void gmx_simdcall
+expandScalarsToTriplets(SimdDouble    scalar,
+                        SimdDouble *  triplets0,
+                        SimdDouble *  triplets1,
+                        SimdDouble *  triplets2)
+{
+    triplets0->simdInternal_ = _mm_permute_pd(scalar.simdInternal_, _MM_SHUFFLE2(0, 0));
+    triplets1->simdInternal_ = _mm_permute_pd(scalar.simdInternal_, _MM_SHUFFLE2(1, 0));
+    triplets2->simdInternal_ = _mm_permute_pd(scalar.simdInternal_, _MM_SHUFFLE2(1, 1));
+}
+
+static inline double
+reduceIncr4ReturnSum(double *    m,
+                     SimdDouble  v0,
+                     SimdDouble  v1,
+                     SimdDouble  v2,
+                     SimdDouble  v3)
+{
+    __m128d t1, t2, t3, t4;
+
+    t1 = _mm_unpacklo_pd(v0.simdInternal_, v1.simdInternal_);
+    t2 = _mm_unpackhi_pd(v0.simdInternal_, v1.simdInternal_);
+    t3 = _mm_unpacklo_pd(v2.simdInternal_, v3.simdInternal_);
+    t4 = _mm_unpackhi_pd(v2.simdInternal_, v3.simdInternal_);
+
+    t1 = _mm_add_pd(t1, t2);
+    t3 = _mm_add_pd(t3, t4);
+
+    assert(std::size_t(m) % 16 == 0);
+
+    t2 = _mm_add_pd(t1, _mm_load_pd(m));
+    t4 = _mm_add_pd(t3, _mm_load_pd(m + 2));
+    _mm_store_pd(m, t2);
+    _mm_store_pd(m + 2, t4);
+
+    t1 = _mm_add_pd(t1, t3);
+
+    t2 = _mm_add_sd(t1, _mm_permute_pd(t1, _MM_SHUFFLE2(1, 1)));
+    return *reinterpret_cast<double *>(&t2);
+}
+
+}      // namespace gmx
+
+#endif // GMX_SIMD_IMPL_X86_AVX2_128_UTIL_DOUBLE_H
diff --git a/src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_util_float.h b/src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_util_float.h
new file mode 100644 (file)
index 0000000..f22be07
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * 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_IMPL_X86_AVX2_128_UTIL_FLOAT_H
+#define GMX_SIMD_IMPL_X86_AVX2_128_UTIL_FLOAT_H
+
+#include "config.h"
+
+#include <immintrin.h>
+
+#include "gromacs/simd/impl_x86_sse4_1/impl_x86_sse4_1_util_float.h"
+
+namespace gmx
+{
+
+static inline void gmx_simdcall
+expandScalarsToTriplets(SimdFloat    scalar,
+                        SimdFloat *  triplets0,
+                        SimdFloat *  triplets1,
+                        SimdFloat *  triplets2)
+{
+    triplets0->simdInternal_ = _mm_permute_ps(scalar.simdInternal_, _MM_SHUFFLE(1, 0, 0, 0));
+    triplets1->simdInternal_ = _mm_permute_ps(scalar.simdInternal_, _MM_SHUFFLE(2, 2, 1, 1));
+    triplets2->simdInternal_ = _mm_permute_ps(scalar.simdInternal_, _MM_SHUFFLE(3, 3, 3, 2));
+}
+
+static inline float gmx_simdcall
+reduceIncr4ReturnSum(float *    m,
+                     SimdFloat  v0,
+                     SimdFloat  v1,
+                     SimdFloat  v2,
+                     SimdFloat  v3)
+{
+    _MM_TRANSPOSE4_PS(v0.simdInternal_, v1.simdInternal_, v2.simdInternal_, v3.simdInternal_);
+    v0.simdInternal_ = _mm_add_ps(v0.simdInternal_, v1.simdInternal_);
+    v2.simdInternal_ = _mm_add_ps(v2.simdInternal_, v3.simdInternal_);
+    v0.simdInternal_ = _mm_add_ps(v0.simdInternal_, v2.simdInternal_);
+
+    assert(std::size_t(m) % 16 == 0);
+
+    v2.simdInternal_ = _mm_add_ps(v0.simdInternal_, _mm_load_ps(m));
+    _mm_store_ps(m, v2.simdInternal_);
+
+    __m128 b = _mm_add_ps(v0.simdInternal_, _mm_permute_ps(v0.simdInternal_, _MM_SHUFFLE(1, 0, 3, 2)));
+    b = _mm_add_ss(b, _mm_permute_ps(b, _MM_SHUFFLE(0, 3, 2, 1)));
+    return *reinterpret_cast<float *>(&b);
+}
+
+}      // namespace gmx
+
+#endif // GMX_SIMD_IMPL_X86_AVX2_128_UTIL_FLOAT_H
index bf81c8b3b356189dda06b96c37f8729835102ecb..f2b5a20d926d932e34e34071acc9c493f11fdbc2 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,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.
@@ -36,8 +36,6 @@
 #ifndef GMX_SIMD_IMPL_X86_AVX_128_FMA_DEFINITIONS_H
 #define GMX_SIMD_IMPL_X86_AVX_128_FMA_DEFINITIONS_H
 
-#include "config.h"
-
 // Capability definitions for AVX-128-FMA
 #define GMX_SIMD                                1
 #define GMX_SIMD_HAVE_FLOAT                     1
 #define GMX_SIMD_RSQRT_BITS                    11
 #define GMX_SIMD_RCP_BITS                      11
 
-// Work around gcc bug with wrong type for mask formal parameter to maskload/maskstore
-#if GMX_SIMD_X86_AVX_GCC_MASKLOAD_BUG
-#    define gmx_mm_maskload_ps(mem, mask)       _mm_maskload_ps((mem), _mm_castsi128_ps(mask))
-#    define gmx_mm_maskstore_ps(mem, mask, x)   _mm_maskstore_ps((mem), _mm_castsi128_ps(mask), (x))
-#else
-#    define gmx_mm_maskload_ps(mem, mask)       _mm_maskload_ps((mem), (mask))
-#    define gmx_mm_maskstore_ps(mem, mask, x)   _mm_maskstore_ps((mem), (mask), (x))
-#endif
+#define gmx_mm_maskload_ps(mem, mask)       _mm_maskload_ps((mem), (mask))
+#define gmx_mm_maskstore_ps(mem, mask, x)   _mm_maskstore_ps((mem), (mask), (x))
 
 #endif  // GMX_SIMD_IMPL_X86_AVX_128_FMA_DEFINITIONS_H
index 6056fc07870e90fb3f053a1f3ae3db09d654fc58..d7106a1ce09bde041cc4a20e9ea8eed2249530db 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) 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.
@@ -43,6 +43,8 @@
 
 #include <immintrin.h>
 
+#include "gromacs/utility/real.h"
+
 #include "impl_x86_avx_512_general.h"
 
 namespace gmx
index df12265797f530b9b3d5c72a451e9849f3320a5e..9468bd26ce304606e8a70869214b4172ddba17fa 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) 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.
 namespace gmx
 {
 
-// On MIC it is better to use scatter operations, so we define the load routines
-// that use a SIMD offset variable first.
+static const int c_simdBestPairAlignmentDouble = 2;
 
-template <int align>
-static inline void gmx_simdcall
-gatherLoadBySimdIntTranspose(const double *  base,
-                             SimdDInt32      simdoffset,
-                             SimdDouble *    v0,
-                             SimdDouble *    v1,
-                             SimdDouble *    v2,
-                             SimdDouble *    v3)
+namespace
 {
-    assert(std::size_t(base) % 32 == 0);
-    assert(align % 4 == 0);
-
-    // All instructions might be latency ~4 on MIC, so we use shifts where we
-    // only need a single instruction (since the shift parameter is an immediate),
-    // but multiplication otherwise.
-    if (align == 4)
-    {
-        simdoffset = simdoffset << 2;
-    }
-    else if (align == 8)
-    {
-        simdoffset = simdoffset << 3;
-    }
-    else
-    {
-        simdoffset = simdoffset * SimdDInt32(align);
-    }
-
-    // The 8 corresponds to sizeof(double), but debug builds with gcc require
-    // an immediate since sizeof() is taken as a function.
-    v0->simdInternal_ = _mm512_i32gather_pd(simdoffset.simdInternal_, base,   8);
-    v1->simdInternal_ = _mm512_i32gather_pd(simdoffset.simdInternal_, base+1, 8);
-    v2->simdInternal_ = _mm512_i32gather_pd(simdoffset.simdInternal_, base+2, 8);
-    v3->simdInternal_ = _mm512_i32gather_pd(simdoffset.simdInternal_, base+3, 8);
-}
-
-template <int align>
-static inline void gmx_simdcall
-gatherLoadUBySimdIntTranspose(const double *  base,
-                              SimdDInt32      simdoffset,
-                              SimdDouble *    v0,
-                              SimdDouble *    v1)
+// Multiply function optimized for powers of 2, for which it is done by
+// shifting. Currently up to 8 is accelerated. Could be accelerated for any
+// number with a constexpr log2 function.
+template<int n>
+SimdDInt32 fastMultiply(SimdDInt32 x)
 {
-    // All instructions might be latency ~4 on MIC, so we use shifts where we
-    // only need a single instruction (since the shift parameter is an immediate),
-    // but multiplication otherwise.
-    if (align == 2)
+    if (n == 2)
     {
-        simdoffset = simdoffset << 1;
+        return x << 1;
     }
-    else if (align == 4)
+    else if (n == 4)
     {
-        simdoffset = simdoffset << 2;
+        return x << 2;
     }
-    else if (align == 8)
+    else if (n == 8)
     {
-        simdoffset = simdoffset << 3;
+        return x << 3;
     }
     else
     {
-        simdoffset = simdoffset * SimdDInt32(align);
+        return x * n;
     }
-
-    v0->simdInternal_ = _mm512_i32gather_pd(simdoffset.simdInternal_, base,   8);
-    v1->simdInternal_ = _mm512_i32gather_pd(simdoffset.simdInternal_, base+1, 8);
 }
 
-template <int align>
+template<int align>
 static inline void gmx_simdcall
-gatherLoadBySimdIntTranspose(const double *    base,
-                             SimdDInt32        simdoffset,
-                             SimdDouble *      v0,
-                             SimdDouble *      v1)
+gatherLoadBySimdIntTranspose(const double *, SimdDInt32)
 {
-    assert(std::size_t(base) % 16 == 0);
-    assert(align % 2 == 0);
-    gatherLoadUBySimdIntTranspose<align>(base, simdoffset, v0, v1);
+    //Nothing to do. Termination of recursion.
+}
 }
 
 
-
-
-template <int align>
+template <int align, typename ... Targs>
 static inline void gmx_simdcall
-gatherLoadTranspose(const double *        base,
-                    const std::int32_t    offset[],
-                    SimdDouble *          v0,
-                    SimdDouble *          v1,
-                    SimdDouble *          v2,
-                    SimdDouble *          v3)
+gatherLoadBySimdIntTranspose(const double * base, SimdDInt32 offset, SimdDouble *v, Targs... Fargs)
 {
-    assert(std::size_t(offset) % 64 == 0);
-    gatherLoadBySimdIntTranspose<align>(base, simdLoadDI(offset), v0, v1, v2, v3);
+    if (align > 1)
+    {
+        offset = fastMultiply<align>(offset);
+    }
+    v->simdInternal_ = _mm512_i32gather_pd(offset.simdInternal_, base, sizeof(double));
+    gatherLoadBySimdIntTranspose<1>(base+1, offset, Fargs ...);
 }
 
-template <int align>
+template <int align, typename ... Targs>
 static inline void gmx_simdcall
-gatherLoadTranspose(const double *        base,
-                    const std::int32_t    offset[],
-                    SimdDouble *          v0,
-                    SimdDouble *          v1)
+gatherLoadUBySimdIntTranspose(const double *base, SimdDInt32 offset, Targs... Fargs)
 {
-    assert(std::size_t(offset) % 64 == 0);
-    gatherLoadBySimdIntTranspose<align>(base, simdLoadDI(offset), v0, v1);
+    gatherLoadBySimdIntTranspose<align>(base, offset, Fargs ...);
 }
 
-static const int c_simdBestPairAlignmentDouble = 2;
-
-template <int align>
+template <int align, typename ... Targs>
 static inline void gmx_simdcall
-gatherLoadUTranspose(const double *        base,
-                     const std::int32_t    offset[],
-                     SimdDouble *          v0,
-                     SimdDouble *          v1,
-                     SimdDouble *          v2)
+gatherLoadTranspose(const double *base, const std::int32_t offset[], Targs... Fargs)
 {
-    SimdDInt32 simdoffset;
-
-    assert(std::size_t(offset) % 32 == 0);
-
-    simdoffset = simdLoadDI(offset);
-
-    // All instructions might be latency ~4 on MIC, so we use shifts where we
-    // only need a single instruction (since the shift parameter is an immediate),
-    // but multiplication otherwise.
-    if (align == 4)
-    {
-        simdoffset = simdoffset << 2;
-    }
-    else if (align == 8)
-    {
-        simdoffset = simdoffset << 3;
-    }
-    else
-    {
-        simdoffset = simdoffset * SimdDInt32(align);
-    }
+    gatherLoadBySimdIntTranspose<align>(base, simdLoadDI(offset), Fargs ...);
+}
 
-    v0->simdInternal_ = _mm512_i32gather_pd(simdoffset.simdInternal_, base,   8);
-    v1->simdInternal_ = _mm512_i32gather_pd(simdoffset.simdInternal_, base+1, 8);
-    v2->simdInternal_ = _mm512_i32gather_pd(simdoffset.simdInternal_, base+2, 8);
+template <int align, typename ... Targs>
+static inline void gmx_simdcall
+gatherLoadUTranspose(const double *base, const std::int32_t offset[], Targs... Fargs)
+{
+    gatherLoadTranspose<align>(base, offset, Fargs ...);
 }
 
 template <int align>
 static inline void gmx_simdcall
-transposeScatterStoreU(double *            base,
-                       const std::int32_t  offset[],
-                       SimdDouble          v0,
-                       SimdDouble          v1,
-                       SimdDouble          v2)
+transposeScatterStoreU(double *             base,
+                       const std::int32_t   offset[],
+                       SimdDouble           v0,
+                       SimdDouble           v1,
+                       SimdDouble           v2)
 {
-    SimdDInt32 simdoffset;
-
-    assert(std::size_t(offset) % 32 == 0);
-
-    simdoffset = simdLoadDI(offset);
-
-    // All instructions might be latency ~4 on MIC, so we use shifts where we
-    // only need a single instruction (since the shift parameter is an immediate),
-    // but multiplication otherwise.
-    if (align == 4)
-    {
-        simdoffset = simdoffset << 2;
-    }
-    else if (align == 8)
-    {
-        simdoffset = simdoffset << 3;
-    }
-    else
+    SimdDInt32 simdoffset = simdLoadDI(offset);
+    if (align > 1)
     {
-        simdoffset = simdoffset * SimdDInt32(align);
+        simdoffset = fastMultiply<align>(simdoffset);;
     }
-
-    _mm512_i32scatter_pd(base,   simdoffset.simdInternal_, v0.simdInternal_, 8);
-    _mm512_i32scatter_pd(base+1, simdoffset.simdInternal_, v1.simdInternal_, 8);
-    _mm512_i32scatter_pd(base+2, simdoffset.simdInternal_, v2.simdInternal_, 8);
+    _mm512_i32scatter_pd(base,   simdoffset.simdInternal_, v0.simdInternal_, sizeof(double));
+    _mm512_i32scatter_pd(base+1, simdoffset.simdInternal_, v1.simdInternal_, sizeof(double));
+    _mm512_i32scatter_pd(base+2, simdoffset.simdInternal_, v2.simdInternal_, sizeof(double));
 }
 
 template <int align>
@@ -242,6 +149,7 @@ transposeScatterIncrU(double *            base,
 {
     __m512d t[4], t5, t6, t7, t8;
     GMX_ALIGNED(std::int64_t, 8)    o[8];
+    //TODO: should use fastMultiply
     _mm512_store_epi64(o, _mm512_cvtepi32_epi64(_mm256_mullo_epi32(_mm256_load_si256((const __m256i*)(offset  )), _mm256_set1_epi32(align))));
     t5   = _mm512_unpacklo_pd(v0.simdInternal_, v1.simdInternal_);
     t6   = _mm512_unpackhi_pd(v0.simdInternal_, v1.simdInternal_);
@@ -296,6 +204,7 @@ transposeScatterDecrU(double *            base,
 {
     __m512d t[4], t5, t6, t7, t8;
     GMX_ALIGNED(std::int64_t, 8)    o[8];
+    //TODO: should use fastMultiply
     _mm512_store_epi64(o, _mm512_cvtepi32_epi64(_mm256_mullo_epi32(_mm256_load_si256((const __m256i*)(offset  )), _mm256_set1_epi32(align))));
     t5   = _mm512_unpacklo_pd(v0.simdInternal_, v1.simdInternal_);
     t6   = _mm512_unpackhi_pd(v0.simdInternal_, v1.simdInternal_);
@@ -414,8 +323,8 @@ static inline SimdDouble gmx_simdcall
 load1DualHsimd(const double * m)
 {
     return {
-               _mm512_insertf64x4(_mm512_broadcastsd_pd(_mm_loadu_pd(m)),      //note: this does not load 128bit each
-                                  _mm256_broadcastsd_pd(_mm_loadu_pd(m+1)), 1) //because both intriniscs get combined
+               _mm512_insertf64x4(_mm512_broadcastsd_pd(_mm_load_sd(m)),
+                                  _mm256_broadcastsd_pd(_mm_load_sd(m+1)), 1)
     };
 }
 
@@ -483,17 +392,18 @@ gatherLoadTransposeHsimd(const double *       base0,
     assert(std::size_t(offset) % 16 == 0);
     assert(std::size_t(base0) % 16 == 0);
     assert(std::size_t(base1) % 16 == 0);
-    assert(std::size_t(align) % 2  == 0);
 
     idx0 = _mm_load_si128(reinterpret_cast<const __m128i*>(offset));
 
-    idx0 = _mm_mullo_epi32(idx0, _mm_set1_epi32(align));
+    static_assert(align == 2 || align == 4, "If more are needed use fastMultiply");
+    idx0 = _mm_slli_epi32(idx0, align == 2 ? 1 : 2);
+
     idx1 = _mm_add_epi32(idx0, _mm_set1_epi32(1));
 
     idx = _mm256_inserti128_si256(_mm256_castsi128_si256(idx0), idx1, 1);
 
-    tmp1 = _mm512_i32gather_pd(idx, base0, 8);
-    tmp2 = _mm512_i32gather_pd(idx, base1, 8);
+    tmp1 = _mm512_i32gather_pd(idx, base0, sizeof(double)); //TODO: Might be faster to use invidual loads
+    tmp2 = _mm512_i32gather_pd(idx, base1, sizeof(double));
 
     v0->simdInternal_ = _mm512_shuffle_f64x2(tmp1, tmp2, 0x44 );
     v1->simdInternal_ = _mm512_shuffle_f64x2(tmp1, tmp2, 0xEE );
index e3acc0f37f235717eaa17e881843e9dc337ac4ed..3e01146c0343e8af9c16b59937bead3b95bafae9 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) 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.
 namespace gmx
 {
 
-// On MIC it is better to use scatter operations, so we define the load routines
-// that use a SIMD offset variable first.
+static const int c_simdBestPairAlignmentFloat = 2;
 
-template <int align>
-static inline void gmx_simdcall
-gatherLoadBySimdIntTranspose(const float *  base,
-                             SimdFInt32     simdoffset,
-                             SimdFloat *    v0,
-                             SimdFloat *    v1,
-                             SimdFloat *    v2,
-                             SimdFloat *    v3)
+namespace
 {
-    assert(std::size_t(base) % 16 == 0);
-    assert(align % 4 == 0);
-
-    // All instructions might be latency ~4 on MIC, so we use shifts where we
-    // only need a single instruction (since the shift parameter is an immediate),
-    // but multiplication otherwise.
-    if (align == 4)
+// Multiply function optimized for powers of 2, for which it is done by
+// shifting. Currently up to 8 is accelerated. Could be accelerated for any
+// number with a constexpr log2 function.
+template<int n>
+SimdFInt32 fastMultiply(SimdFInt32 x)
+{
+    if (n == 2)
+    {
+        return x << 1;
+    }
+    else if (n == 4)
     {
-        simdoffset = simdoffset << 2;
+        return x << 2;
     }
-    else if (align == 8)
+    else if (n == 8)
     {
-        simdoffset = simdoffset << 3;
+        return x << 3;
     }
     else
     {
-        simdoffset = simdoffset * SimdFInt32(align);
+        return x * n;
     }
-
-    // The 4 corresponds to sizeof(float), but it must be an immediate, and with debug builds
-    // gcc will not evaluate the sizeof() function at compile time.
-    v0->simdInternal_ = _mm512_i32gather_ps(simdoffset.simdInternal_, base,   4);
-    v1->simdInternal_ = _mm512_i32gather_ps(simdoffset.simdInternal_, base+1, 4);
-    v2->simdInternal_ = _mm512_i32gather_ps(simdoffset.simdInternal_, base+2, 4);
-    v3->simdInternal_ = _mm512_i32gather_ps(simdoffset.simdInternal_, base+3, 4);
 }
 
-template <int align>
+template<int align>
 static inline void gmx_simdcall
-gatherLoadUBySimdIntTranspose(const float *  base,
-                              SimdFInt32     simdoffset,
-                              SimdFloat *    v0,
-                              SimdFloat *    v1)
+gatherLoadBySimdIntTranspose(const float *, SimdFInt32)
 {
-    // All instructions might be latency ~4 on MIC, so we use shifts where we
-    // only need a single instruction (since the shift parameter is an immediate),
-    // but multiplication otherwise.
-    // For align == 2 we can merge the constant into the scale parameter,
-    // which can take constants up to 8 in total.
-    if (align == 2)
-    {
-        v0->simdInternal_ = _mm512_i32gather_ps(simdoffset.simdInternal_, base,   align * 4);
-        v1->simdInternal_ = _mm512_i32gather_ps(simdoffset.simdInternal_, base+1, align * 4);
-    }
-    else
-    {
-        if (align == 4)
-        {
-            simdoffset = simdoffset << 2;
-        }
-        else if (align == 8)
-        {
-            simdoffset = simdoffset << 3;
-        }
-        else
-        {
-            simdoffset = simdoffset * SimdFInt32(align);
-        }
-        v0->simdInternal_ = _mm512_i32gather_ps(simdoffset.simdInternal_, base,   4);
-        v1->simdInternal_ = _mm512_i32gather_ps(simdoffset.simdInternal_, base+1, 4);
-    }
+    //Nothing to do. Termination of recursion.
+}
 }
 
-template <int align>
+template <int align, typename ... Targs>
 static inline void gmx_simdcall
-gatherLoadBySimdIntTranspose(const float *   base,
-                             SimdFInt32      simdoffset,
-                             SimdFloat *     v0,
-                             SimdFloat *     v1)
+gatherLoadBySimdIntTranspose(const float *base, SimdFInt32 offset, SimdFloat *v, Targs... Fargs)
 {
-    assert(std::size_t(base) % 8 == 0);
-    assert(align % 2 == 0);
-    gatherLoadUBySimdIntTranspose<align>(base, simdoffset.simdInternal_, v0, v1);
+    // For align 1 or 2: No multiplication of offset is needed
+    if (align > 2)
+    {
+        offset = fastMultiply<align>(offset);
+    }
+    // For align 2: Scale of 2*sizeof(float) is used (maximum supported scale)
+    constexpr int align_ = (align > 2) ? 1 : align;
+    v->simdInternal_ = _mm512_i32gather_ps(offset.simdInternal_, base, sizeof(float)*align_);
+    // Gather remaining elements. Avoid extra multiplication (new align is 1 or 2).
+    gatherLoadBySimdIntTranspose<align_>(base+1, offset, Fargs ...);
 }
 
-template <int align>
+template <int align, typename ... Targs>
 static inline void gmx_simdcall
-gatherLoadTranspose(const float *        base,
-                    const std::int32_t   offset[],
-                    SimdFloat *          v0,
-                    SimdFloat *          v1,
-                    SimdFloat *          v2,
-                    SimdFloat *          v3)
+gatherLoadUBySimdIntTranspose(const float *base, SimdFInt32 offset, Targs... Fargs)
 {
-    gatherLoadBySimdIntTranspose<align>(base, simdLoadFI(offset), v0, v1, v2, v3);
+    gatherLoadBySimdIntTranspose<align>(base, offset, Fargs ...);
 }
 
-template <int align>
+template <int align, typename ... Targs>
 static inline void gmx_simdcall
-gatherLoadTranspose(const float *        base,
-                    const std::int32_t   offset[],
-                    SimdFloat *          v0,
-                    SimdFloat *          v1)
+gatherLoadTranspose(const float *base, const std::int32_t offset[], Targs... Fargs)
 {
-    gatherLoadBySimdIntTranspose<align>(base, simdLoadFI(offset), v0, v1);
+    gatherLoadBySimdIntTranspose<align>(base, simdLoadFI(offset), Fargs ...);
 }
 
-static const int c_simdBestPairAlignmentFloat = 2;
-
-template <int align>
+template <int align, typename ... Targs>
 static inline void gmx_simdcall
-gatherLoadUTranspose(const float *        base,
-                     const std::int32_t   offset[],
-                     SimdFloat *          v0,
-                     SimdFloat *          v1,
-                     SimdFloat *          v2)
+gatherLoadUTranspose(const float *base, const std::int32_t offset[], Targs... Fargs)
 {
-    SimdFInt32 simdoffset;
-
-    assert(std::size_t(offset) % 64 == 0);
-
-    simdoffset = simdLoadFI(offset);
-
-    // All instructions might be latency ~4 on MIC, so we use shifts where we
-    // only need a single instruction (since the shift parameter is an immediate),
-    // but multiplication otherwise.
-    if (align == 4)
-    {
-        simdoffset = simdoffset << 2;
-    }
-    else if (align == 8)
-    {
-        simdoffset = simdoffset << 3;
-    }
-    else
-    {
-        simdoffset = simdoffset * SimdFInt32(align);
-    }
-
-    v0->simdInternal_ = _mm512_i32gather_ps(simdoffset.simdInternal_, base,   4);
-    v1->simdInternal_ = _mm512_i32gather_ps(simdoffset.simdInternal_, base+1, 4);
-    v2->simdInternal_ = _mm512_i32gather_ps(simdoffset.simdInternal_, base+2, 4);
+    gatherLoadTranspose<align>(base, offset, Fargs ...);
 }
 
-
 template <int align>
 static inline void gmx_simdcall
 transposeScatterStoreU(float *              base,
@@ -206,31 +132,15 @@ transposeScatterStoreU(float *              base,
                        SimdFloat            v1,
                        SimdFloat            v2)
 {
-    SimdFInt32 simdoffset;
-
-    assert(std::size_t(offset) % 64 == 0);
-
-    simdoffset = simdLoadFI(offset);
-
-    // All instructions might be latency ~4 on MIC, so we use shifts where we
-    // only need a single instruction (since the shift parameter is an immediate),
-    // but multiplication otherwise.
-    if (align == 4)
-    {
-        simdoffset = simdoffset << 2;
-    }
-    else if (align == 8)
+    SimdFInt32 simdoffset = simdLoadFI(offset);
+    if (align > 2)
     {
-        simdoffset = simdoffset << 3;
+        simdoffset = fastMultiply<align>(simdoffset);
     }
-    else
-    {
-        simdoffset = simdoffset * SimdFInt32(align);
-    }
-
-    _mm512_i32scatter_ps(base,   simdoffset.simdInternal_, v0.simdInternal_, 4);
-    _mm512_i32scatter_ps(base+1, simdoffset.simdInternal_, v1.simdInternal_, 4);
-    _mm512_i32scatter_ps(base+2, simdoffset.simdInternal_, v2.simdInternal_, 4);
+    constexpr int align_ = (align > 2) ? 1 : align;
+    _mm512_i32scatter_ps(base,   simdoffset.simdInternal_, v0.simdInternal_, sizeof(float)*align_);
+    _mm512_i32scatter_ps(base+1, simdoffset.simdInternal_, v1.simdInternal_, sizeof(float)*align_);
+    _mm512_i32scatter_ps(base+2, simdoffset.simdInternal_, v2.simdInternal_, sizeof(float)*align_);
 }
 
 
@@ -244,8 +154,8 @@ transposeScatterIncrU(float *              base,
 {
     __m512 t[4], t5, t6, t7, t8;
     int    i;
-    GMX_ALIGNED(std::int32_t, 8)    o[16];
-    _mm512_store_epi32(o, _mm512_mullo_epi32(_mm512_load_epi32(offset), _mm512_set1_epi32(align)));
+    GMX_ALIGNED(std::int32_t, 16)    o[16];
+    store(o, fastMultiply<align>(simdLoadFI(offset)));
     if (align < 4)
     {
         t5   = _mm512_unpacklo_ps(v0.simdInternal_, v1.simdInternal_);
@@ -316,8 +226,8 @@ transposeScatterDecrU(float *              base,
 {
     __m512 t[4], t5, t6, t7, t8;
     int    i;
-    GMX_ALIGNED(std::int32_t, 8)    o[16];
-    _mm512_store_epi32(o, _mm512_mullo_epi32(_mm512_load_epi32(offset), _mm512_set1_epi32(align)));
+    GMX_ALIGNED(std::int32_t, 16)    o[16];
+    store(o, fastMultiply<align>(simdLoadFI(offset)));
     if (align < 4)
     {
         t5   = _mm512_unpacklo_ps(v0.simdInternal_, v1.simdInternal_);
@@ -384,12 +294,12 @@ expandScalarsToTriplets(SimdFloat    scalar,
                         SimdFloat *  triplets1,
                         SimdFloat *  triplets2)
 {
-    triplets0->simdInternal_ = _mm512_castsi512_ps(_mm512_permutexvar_epi32(_mm512_set_epi32(5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 1, 1, 1, 0, 0, 0),
-                                                                            _mm512_castps_si512(scalar.simdInternal_)));
-    triplets1->simdInternal_ = _mm512_castsi512_ps(_mm512_permutexvar_epi32(_mm512_set_epi32(10, 10, 9, 9, 9, 8, 8, 8, 7, 7, 7, 6, 6, 6, 5, 5),
-                                                                            _mm512_castps_si512(scalar.simdInternal_)));
-    triplets2->simdInternal_ = _mm512_castsi512_ps(_mm512_permutexvar_epi32(_mm512_set_epi32(15, 15, 15, 14, 14, 14, 13, 13, 13, 12, 12, 12, 11, 11, 11, 10),
-                                                                            _mm512_castps_si512(scalar.simdInternal_)));
+    triplets0->simdInternal_ = _mm512_permutexvar_ps(_mm512_set_epi32(5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 1, 1, 1, 0, 0, 0),
+                                                     scalar.simdInternal_);
+    triplets1->simdInternal_ = _mm512_permutexvar_ps(_mm512_set_epi32(10, 10, 9, 9, 9, 8, 8, 8, 7, 7, 7, 6, 6, 6, 5, 5),
+                                                     scalar.simdInternal_);
+    triplets2->simdInternal_ = _mm512_permutexvar_ps(_mm512_set_epi32(15, 15, 15, 14, 14, 14, 13, 13, 13, 12, 12, 12, 11, 11, 11, 10),
+                                                     scalar.simdInternal_);
 }
 
 
@@ -453,8 +363,8 @@ static inline SimdFloat gmx_simdcall
 load1DualHsimd(const float * m)
 {
     return {
-               _mm512_shuffle_f32x4(_mm512_broadcastss_ps(_mm_loadu_ps(m)),
-                                    _mm512_broadcastss_ps(_mm_loadu_ps(m+1)), 0x44)
+               _mm512_shuffle_f32x4(_mm512_broadcastss_ps(_mm_load_ss(m)),
+                                    _mm512_broadcastss_ps(_mm_load_ss(m+1)), 0x44)
     };
 }
 
@@ -515,27 +425,29 @@ gatherLoadTransposeHsimd(const float *        base0,
                          SimdFloat *          v0,
                          SimdFloat *          v1)
 {
-    __m256i idx0, idx1;
-    __m512i idx;
+    __m256i idx;
     __m512  tmp1, tmp2;
 
     assert(std::size_t(offset) % 32 == 0);
     assert(std::size_t(base0) % 8 == 0);
     assert(std::size_t(base1) % 8 == 0);
-    assert(std::size_t(align) % 2 == 0);
 
-    idx0 = _mm256_load_si256(reinterpret_cast<const __m256i*>(offset));
+    idx = _mm256_load_si256(reinterpret_cast<const __m256i*>(offset));
 
-    idx0 = _mm256_mullo_epi32(idx0, _mm256_set1_epi32(align));
-    idx1 = _mm256_add_epi32(idx0, _mm256_set1_epi32(1));
+    static_assert(align == 2 || align == 4, "If more are needed use fastMultiply");
+    if (align == 4)
+    {
+        idx = _mm256_slli_epi32(idx, 1);
+    }
 
-    idx = _mm512_inserti64x4(_mm512_castsi256_si512(idx0), idx1, 1);
+    tmp1 = _mm512_castpd_ps(_mm512_i32gather_pd(idx, reinterpret_cast<const double *>(base0), sizeof(double)));
+    tmp2 = _mm512_castpd_ps(_mm512_i32gather_pd(idx, reinterpret_cast<const double *>(base1), sizeof(double)));
 
-    tmp1 = _mm512_i32gather_ps(idx, base0, 4);
-    tmp2 = _mm512_i32gather_ps(idx, base1, 4);
+    v0->simdInternal_ = _mm512_mask_moveldup_ps(tmp1, 0xAAAA, tmp2);
+    v1->simdInternal_ = _mm512_mask_movehdup_ps(tmp2, 0x5555, tmp1);
 
-    v0->simdInternal_ = _mm512_shuffle_f32x4(tmp1, tmp2, 0x44 );
-    v1->simdInternal_ = _mm512_shuffle_f32x4(tmp1, tmp2, 0xEE );
+    v0->simdInternal_ = _mm512_permutexvar_ps(_mm512_set_epi32(15, 13, 11, 9, 7, 5, 3, 1, 14, 12, 10, 8, 6, 4, 2, 0), v0->simdInternal_);
+    v1->simdInternal_ = _mm512_permutexvar_ps(_mm512_set_epi32(15, 13, 11, 9, 7, 5, 3, 1, 14, 12, 10, 8, 6, 4, 2, 0), v1->simdInternal_);
 }
 
 static inline float gmx_simdcall
index 57c0486499b491a21faef60bf4490f8b04bc441e..a33206c67de620300712185e392a28587b73d7ed 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) 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.
@@ -40,6 +40,7 @@
 
 #include <immintrin.h>
 
+#include "gromacs/math/utilities.h"
 #include "gromacs/simd/impl_x86_avx_512/impl_x86_avx_512_simd_float.h"
 
 namespace gmx
@@ -77,6 +78,7 @@ maskzRcp(SimdFloat x, SimdFBool m)
     };
 }
 
+template <MathOptimization opt = MathOptimization::Safe>
 static inline SimdFloat gmx_simdcall
 exp2(SimdFloat x)
 {
@@ -85,14 +87,24 @@ exp2(SimdFloat x)
     };
 }
 
+template <MathOptimization opt = MathOptimization::Safe>
 static inline SimdFloat gmx_simdcall
 exp(SimdFloat x)
 {
     const __m512     argscale    = _mm512_set1_ps(1.44269504088896341f);
     const __m512     invargscale = _mm512_set1_ps(-0.69314718055994528623f);
 
-    __m512           xscaled     = _mm512_mul_ps(x.simdInternal_, argscale);
-    __m512           r           = _mm512_exp2a23_ps(xscaled);
+    if (opt == MathOptimization::Safe)
+    {
+        // Set the limit to gurantee flush to zero
+        const SimdFloat smallArgLimit(-88.f);
+        // Since we multiply the argument by 1.44, for the safe version we need to make
+        // sure this doesn't result in overflow
+        x = max(x, smallArgLimit);
+    }
+
+    __m512 xscaled = _mm512_mul_ps(x.simdInternal_, argscale);
+    __m512 r       = _mm512_exp2a23_ps(xscaled);
 
     // exp2a23_ps provides 23 bits of accuracy, but we ruin some of that with our argument
     // scaling. To correct this, we find the difference between the scaled argument and
index 16d765a63a07847ec231b628ecd23c4108eee0f0..a58b73d7b352e81a50840f4c2c072cfdaf1e4c7c 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) 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.
@@ -43,6 +43,8 @@
 
 #include <immintrin.h>
 
+#include "gromacs/math/utilities.h"
+
 namespace gmx
 {
 
@@ -685,6 +687,8 @@ cvtIB2B(SimdFIBool a)
     };
 }
 
+
+template <MathOptimization opt = MathOptimization::Safe>
 static inline SimdFloat gmx_simdcall
 exp2(SimdFloat x)
 {
@@ -693,14 +697,24 @@ exp2(SimdFloat x)
     };
 }
 
+template <MathOptimization opt = MathOptimization::Safe>
 static inline SimdFloat gmx_simdcall
 exp(SimdFloat x)
 {
     const __m512     argscale    = _mm512_set1_ps(1.44269504088896341f);
     const __m512     invargscale = _mm512_set1_ps(-0.69314718055994528623f);
 
-    __m512           xscaled     = _mm512_mul_ps(x.simdInternal_, argscale);
-    __m512           r           = _mm512_exp223_ps(_mm512_cvtfxpnt_round_adjustps_epi32(xscaled, _MM_ROUND_MODE_NEAREST, _MM_EXPADJ_24));
+    if (opt == MathOptimization::Safe)
+    {
+        // Set the limit to gurantee flush to zero
+        const SimdFloat smallArgLimit(-88.f);
+        // Since we multiply the argument by 1.44, for the safe version we need to make
+        // sure this doesn't result in overflow
+        x = max(x, smallArgLimit);
+    }
+
+    __m512  xscaled = _mm512_mul_ps(x.simdInternal_, argscale);
+    __m512  r       = _mm512_exp223_ps(_mm512_cvtfxpnt_round_adjustps_epi32(xscaled, _MM_ROUND_MODE_NEAREST, _MM_EXPADJ_24));
 
     // exp2a23_ps provides 23 bits of accuracy, but we ruin some of that with our argument
     // scaling. To correct this, we find the difference between the scaled argument and
index bfd2280ced1af001e057ada011f710ea67b4553c..8091871f36c174e1ea0718aa50732c2b4ae13b76 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) 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.
@@ -205,7 +205,7 @@ transposeScatterStoreU(float *              base,
 {
     SimdFInt32 simdoffset;
 
-    assert(sdt::size_t(offset) % 64 == 0);
+    assert(std::size_t(offset) % 64 == 0);
 
     simdoffset = simdLoadFI(offset);
 
index 16818f49d51459a72af4608e10f2d84f1a324922..66550477f0bbb50ec85a7fef46afa5757a2b7778 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,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.
@@ -629,7 +629,7 @@ gatherLoadBySimdIntTranspose(const double *      base,
  *       write templated SIMD/non-SIMD code. For clarity it should not be used
  *       outside such code.
  */
-static inline float
+static inline double
 reduceIncr4ReturnSum(double *           m,
                      double             v0,
                      double             v1,
index 7d1694137c1c978ae734fba31ab32615dfe90c3b..f22022dd4db77ff9f0627cd6c1b2de2297ffe844 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,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.
@@ -75,6 +75,8 @@
 #include <cstddef>
 #include <cstdint>
 
+#include <array>
+
 #include "gromacs/utility/classhelpers.h"
 #include "gromacs/utility/real.h"
 
 #    include "impl_x86_avx_256/impl_x86_avx_256.h"
 #elif GMX_SIMD_X86_AVX2_256
 #    include "impl_x86_avx2_256/impl_x86_avx2_256.h"
+#elif GMX_SIMD_X86_AVX2_128
+#    include "impl_x86_avx2_128/impl_x86_avx2_128.h"
 #elif GMX_SIMD_X86_MIC
 #    include "impl_x86_mic/impl_x86_mic.h"
 #elif GMX_SIMD_X86_AVX_512
 namespace gmx
 {
 
+template<class T, size_t N>
+struct AlignedArray;
+
+#if GMX_SIMD_HAVE_FLOAT
+/*! \libinternal \brief Identical to std::array with GMX_SIMD_FLOAT_WIDTH alignment.
+ *  Should not be deleted through base pointer (destructor is non-virtual).
+ */
+template<size_t N>
+struct alignas(GMX_SIMD_FLOAT_WIDTH*sizeof(float))AlignedArray<float, N> : public std::array<float, N>
+{
+};
+#endif
+
+#if GMX_SIMD_HAVE_DOUBLE
+/*! \libinternal \brief  Identical to std::array with GMX_SIMD_DOUBLE_WIDTH alignment.
+ *  Should not be deleted through base pointer (destructor is non-virtual).
+ */
+template<size_t N>
+struct alignas(GMX_SIMD_DOUBLE_WIDTH*sizeof(double))AlignedArray<double, N> : public std::array<double, N>
+{
+};
+#endif
+
 #if GMX_SIMD_HAVE_REAL
 
 /*! \name SIMD data types
@@ -369,6 +396,10 @@ class SimdLoadFProxyInternal;
 static inline const SimdLoadFProxyInternal gmx_simdcall
 load(const float *m);
 
+template <size_t N>
+static inline const SimdLoadFProxyInternal gmx_simdcall
+load(const AlignedArray<float, N> &m);
+
 /*! \libinternal \brief Proxy object to enable load() for SIMD and float types
  *
  * This object is returned by the load() function that takes a single pointer
@@ -397,6 +428,9 @@ class SimdLoadFProxyInternal
 
         friend const SimdLoadFProxyInternal gmx_simdcall
         load(const float *m);
+        template <size_t N>
+        friend const SimdLoadFProxyInternal gmx_simdcall
+        load(const AlignedArray<float, N> &m);
 
         const float * const m_; //!< The pointer used to load memory
 
@@ -417,6 +451,14 @@ load(const float *m)
     };
 }
 
+template <size_t N>
+static inline const SimdLoadFProxyInternal gmx_simdcall
+load(const AlignedArray<float, N> &m)
+{
+    return {
+               m.data()
+    };
+}
 
 class SimdLoadUFProxyInternal;
 
@@ -477,6 +519,10 @@ class SimdLoadDProxyInternal;
 static inline const SimdLoadDProxyInternal gmx_simdcall
 load(const double *m);
 
+template <size_t N>
+static inline const SimdLoadDProxyInternal gmx_simdcall
+load(const AlignedArray<double, N> &m);
+
 /*! \libinternal \brief Proxy object to enable load() for SIMD and double types
  *
  * This object is returned by the load() function that takes a single pointer
@@ -505,7 +551,9 @@ class SimdLoadDProxyInternal
 
         friend const SimdLoadDProxyInternal gmx_simdcall
         load(const double *m);
-
+        template <size_t N>
+        friend const SimdLoadDProxyInternal gmx_simdcall
+        load(const AlignedArray<double, N> &m);
         const double * const m_; //!< The pointer used to load memory
 
         GMX_DISALLOW_COPY_AND_ASSIGN(SimdLoadDProxyInternal);
@@ -525,6 +573,15 @@ load(const double *m)
     };
 }
 
+template <size_t N>
+static inline const SimdLoadDProxyInternal gmx_simdcall
+load(const AlignedArray<double, N> &m)
+{
+    return {
+               m.data()
+    };
+}
+
 class SimdLoadUDProxyInternal;
 
 static inline const SimdLoadUDProxyInternal gmx_simdcall
index b11e0edc9bfa1604061db11e254afecd207ee1e9..e3f1db68258b361d1753d6ceedca8686b32a53b7 100644 (file)
@@ -131,7 +131,15 @@ rsqrtIter(SimdFloat lu, SimdFloat x)
 
 /*! \brief Calculate 1/sqrt(x) for SIMD float.
  *
- *  \param x Argument that must be >0. This routine does not check arguments.
+ *  \param x Argument that must be larger than GMX_FLOAT_MIN and smaller than
+ *           GMX_FLOAT_MAX, i.e. within the range of single precision.
+ *           For the single precision implementation this is obviously always
+ *           true for positive values, but for double precision it adds an
+ *           extra restriction since the first lookup step might have to be
+ *           performed in single precision on some architectures. Note that the
+ *           responsibility for checking falls on you - this routine does not
+ *           check arguments.
+ *
  *  \return 1/sqrt(x). Result is undefined if your argument was invalid.
  */
 static inline SimdFloat gmx_simdcall
@@ -152,13 +160,22 @@ invsqrt(SimdFloat x)
 
 /*! \brief Calculate 1/sqrt(x) for two SIMD floats.
  *
- * \param x0  First set of arguments, x0 must be positive - no argument checking.
- * \param x1  Second set of arguments, x1 must be positive - no argument checking.
+ * \param x0  First set of arguments, x0 must be in single range (see below).
+ * \param x1  Second set of arguments, x1 must be in single range (see below).
  * \param[out] out0  Result 1/sqrt(x0)
  * \param[out] out1  Result 1/sqrt(x1)
  *
  *  In particular for double precision we can sometimes calculate square root
  *  pairs slightly faster by using single precision until the very last step.
+ *
+ * \note Both arguments must be larger than GMX_FLOAT_MIN and smaller than
+ *       GMX_FLOAT_MAX, i.e. within the range of single precision.
+ *       For the single precision implementation this is obviously always
+ *       true for positive values, but for double precision it adds an
+ *       extra restriction since the first lookup step might have to be
+ *       performed in single precision on some architectures. Note that the
+ *       responsibility for checking falls on you - this routine does not
+ *       check arguments.
  */
 static inline void gmx_simdcall
 invsqrtPair(SimdFloat x0,    SimdFloat x1,
@@ -187,7 +204,15 @@ rcpIter(SimdFloat lu, SimdFloat x)
 
 /*! \brief Calculate 1/x for SIMD float.
  *
- *  \param x Argument that must be nonzero. This routine does not check arguments.
+ *  \param x Argument with magnitude larger than GMX_FLOAT_MIN and smaller than
+ *           GMX_FLOAT_MAX, i.e. within the range of single precision.
+ *           For the single precision implementation this is obviously always
+ *           true for positive values, but for double precision it adds an
+ *           extra restriction since the first lookup step might have to be
+ *           performed in single precision on some architectures. Note that the
+ *           responsibility for checking falls on you - this routine does not
+ *           check arguments.
+ *
  *  \return 1/x. Result is undefined if your argument was invalid.
  */
 static inline SimdFloat gmx_simdcall
@@ -209,7 +234,12 @@ inv(SimdFloat x)
 /*! \brief Division for SIMD floats
  *
  * \param nom    Nominator
- * \param denom  Denominator
+ * \param denom  Denominator, with magnitude in range (GMX_FLOAT_MIN,GMX_FLOAT_MAX).
+ *               For single precision this is equivalent to a nonzero argument,
+ *               but in double precision it adds an extra restriction since
+ *               the first lookup step might have to be performed in single
+ *               precision on some architectures. Note that the responsibility
+ *               for checking falls on you - this routine does not check arguments.
  *
  * \return nom/denom
  *
@@ -228,7 +258,9 @@ operator/(SimdFloat nom, SimdFloat denom)
  *  Illegal values in the masked-out elements will not lead to
  *  floating-point exceptions.
  *
- *  \param x Argument that must be >0 for masked-in entries
+ *  \param x Argument that must be larger than GMX_FLOAT_MIN and smaller than
+ *           GMX_FLOAT_MAX for masked-in entries.
+ *           See \ref invsqrt for the discussion about argument restrictions.
  *  \param m Mask
  *  \return 1/sqrt(x). Result is undefined if your argument was invalid or
  *          entry was not masked, and 0.0 for masked-out entries.
@@ -251,7 +283,9 @@ maskzInvsqrt(SimdFloat x, SimdFBool m)
 
 /*! \brief Calculate 1/x for SIMD float, masked version.
  *
- *  \param x Argument that must be nonzero for non-masked entries.
+ *  \param x Argument with magnitude larger than GMX_FLOAT_MIN and smaller than
+ *           GMX_FLOAT_MAX for masked-in entries.
+ *           See \ref invsqrt for the discussion about argument restrictions.
  *  \param m Mask
  *  \return 1/x for elements where m is true, or 0.0 for masked-out entries.
  */
@@ -271,17 +305,37 @@ maskzInv(SimdFloat x, SimdFBool m)
     return lu;
 }
 
-/*! \brief Calculate sqrt(x) correctly for SIMD floats, including argument 0.0.
+/*! \brief Calculate sqrt(x) for SIMD floats
+ *
+ *  \tparam opt By default, this function checks if the input value is 0.0
+ *              and masks this to return the correct result. If you are certain
+ *              your argument will never be zero, and you know you need to save
+ *              every single cycle you can, you can alternatively call the
+ *              function as sqrt<MathOptimization::Unsafe>(x).
+ *
+ *  \param  x   Argument that must be in range 0 <=x <= GMX_FLOAT_MAX, since the
+ *              lookup step often has to be implemented in single precision.
+ *              Arguments smaller than GMX_FLOAT_MIN will always lead to a zero
+ *              result, even in double precision. If you are using the unsafe
+ *              math optimization parameter, the argument must be in the range
+ *              GMX_FLOAT_MIN <= x <= GMX_FLOAT_MAX.
  *
- *  \param x Argument that must be >=0.
- *  \return sqrt(x). If x=0, the result will correctly be set to 0.
- *          The result is undefined if the input value is negative.
+ *  \return sqrt(x). The result is undefined if the input value does not fall
+ *          in the allowed range specified for the argument.
  */
+template <MathOptimization opt = MathOptimization::Safe>
 static inline SimdFloat gmx_simdcall
 sqrt(SimdFloat x)
 {
-    SimdFloat  res = maskzInvsqrt(x, setZero() < x);
-    return res*x;
+    if (opt == MathOptimization::Safe)
+    {
+        SimdFloat  res = maskzInvsqrt(x, setZero() < x);
+        return res*x;
+    }
+    else
+    {
+        return x * invsqrt(x);
+    }
 }
 
 #if !GMX_SIMD_HAVE_NATIVE_LOG_FLOAT
@@ -328,16 +382,44 @@ log(SimdFloat x)
 #endif
 
 #if !GMX_SIMD_HAVE_NATIVE_EXP2_FLOAT
-/*! \brief SIMD float 2^x.
- *
- * \param x Argument.
- * \result 2^x. Undefined if input argument caused overflow.
+/*! \brief SIMD float 2^x
+ *
+ * \tparam opt If this is changed from the default (safe) into the unsafe
+ *             option, input values that would otherwise lead to zero-clamped
+ *             results are not allowed and will lead to undefined results.
+ *
+ * \param x Argument. For the default (safe) function version this can be
+ *          arbitrarily small value, but the routine might clamp the result to
+ *          zero for arguments that would produce subnormal IEEE754-2008 results.
+ *          This corresponds to inputs below -126 in single or -1022 in double,
+ *          and it might overflow for arguments reaching 127 (single) or
+ *          1023 (double). If you enable the unsafe math optimization,
+ *          very small arguments will not necessarily be zero-clamped, but
+ *          can produce undefined results.
+ *
+ * \result 2^x. The result is undefined for very large arguments that cause
+ *          internal floating-point overflow. If unsafe optimizations are enabled,
+ *          this is also true for very small values.
+ *
+ * \note    The definition range of this function is just-so-slightly smaller
+ *          than the allowed IEEE exponents for many architectures. This is due
+ *          to the implementation, which will hopefully improve in the future.
+ *
+ * \warning You cannot rely on this implementation returning inf for arguments
+ *          that cause overflow. If you have some very large
+ *          values and need to rely on getting a valid numerical output,
+ *          take the minimum of your variable and the largest valid argument
+ *          before calling this routine.
  */
+template <MathOptimization opt = MathOptimization::Safe>
 static inline SimdFloat gmx_simdcall
 exp2(SimdFloat x)
 {
-    // Lower bound: Disallow numbers that would lead to an IEEE fp exponent reaching +-127.
-    const SimdFloat  arglimit(126.0f);
+    // Lower bound: Clamp args that would lead to an IEEE fp exponent below -127.
+    // Note that we use a slightly wider range inside this *implementation* compared
+    // to that guaranteed by the API documentation in the comment above (which has
+    // to cover all architectures).
+    const SimdFloat  smallArgLimit(-127.0f);
     const SimdFloat  CC6(0.0001534581200287996416911311f);
     const SimdFloat  CC5(0.001339993121934088894618990f);
     const SimdFloat  CC4(0.009618488957115180159497841f);
@@ -349,12 +431,30 @@ exp2(SimdFloat x)
     SimdFloat        intpart;
     SimdFloat        fexppart;
     SimdFloat        p;
-    SimdFBool        m;
+
+    // Large negative values are valid arguments to exp2(), so there are two
+    // things we need to account for:
+    // 1. When the exponents reaches -127, the (biased) exponent field will be
+    //    zero and we can no longer multiply with it. There are special IEEE
+    //    formats to handle this range, but for now we have to accept that
+    //    we cannot handle those arguments. If input value becomes even more
+    //    negative, it will start to loop and we would end up with invalid
+    //    exponents. Thus, we need to limit or mask this.
+    // 2. For VERY large negative values, we will have problems that the
+    //    subtraction to get the fractional part loses accuracy, and then we
+    //    can end up with overflows in the polynomial.
+    //
+    // For now, we handle this by clamping smaller arguments to -127. At this
+    // point we will already return zero, so we don't need to do anything
+    // extra for the exponent.
+
+    if (opt == MathOptimization::Safe)
+    {
+        x         = max(x, smallArgLimit);
+    }
 
     fexppart  = ldexp(one, cvtR2I(x));
     intpart   = round(x);
-    m         = abs(x) <= arglimit;
-    fexppart  = selectByMask(fexppart, m);
     x         = x - intpart;
 
     p         = fma(CC6, x, CC5);
@@ -374,16 +474,44 @@ exp2(SimdFloat x)
  * In addition to scaling the argument for 2^x this routine correctly does
  * extended precision arithmetics to improve accuracy.
  *
- * \param x Argument.
- * \result exp(x). Undefined if input argument caused overflow,
- * which can happen if abs(x) \> 7e13.
+ * \tparam opt If this is changed from the default (safe) into the unsafe
+ *             option, input values that would otherwise lead to zero-clamped
+ *             results are not allowed and will lead to undefined results.
+ *
+ * \param x Argument. For the default (safe) function version this can be
+ *          arbitrarily small value, but the routine might clamp the result to
+ *          zero for arguments that would produce subnormal IEEE754-2008 results.
+ *          This corresponds to input arguments reaching
+ *          -126*ln(2)=-87.3 in single, or -1022*ln(2)=-708.4 (double).
+ *          Similarly, it might overflow for arguments reaching
+ *          127*ln(2)=88.0 (single) or 1023*ln(2)=709.1 (double). If the
+ *          unsafe math optimizations are enabled, small input values that would
+ *          result in zero-clamped output are not allowed.
+ *
+ * \result exp(x). Overflowing arguments are likely to either return 0 or inf,
+ *         depending on the underlying implementation. If unsafe optimizations
+ *         are enabled, this is also true for very small values.
+ *
+ * \note    The definition range of this function is just-so-slightly smaller
+ *          than the allowed IEEE exponents for many architectures. This is due
+ *          to the implementation, which will hopefully improve in the future.
+ *
+ * \warning You cannot rely on this implementation returning inf for arguments
+ *          that cause overflow. If you have some very large
+ *          values and need to rely on getting a valid numerical output,
+ *          take the minimum of your variable and the largest valid argument
+ *          before calling this routine.
  */
+template <MathOptimization opt = MathOptimization::Safe>
 static inline SimdFloat gmx_simdcall
 exp(SimdFloat x)
 {
     const SimdFloat  argscale(1.44269504088896341f);
-    // Lower bound: Disallow numbers that would lead to an IEEE fp exponent reaching +-127.
-    const SimdFloat  arglimit(126.0f);
+    // Lower bound: Clamp args that would lead to an IEEE fp exponent below -127.
+    // Note that we use a slightly wider range inside this *implementation* compared
+    // to that guaranteed by the API documentation in the comment above (which has
+    // to cover all architectures).
+    const SimdFloat  smallArgLimit(-88.0296919311f);
     const SimdFloat  invargscale0(-0.693145751953125f);
     const SimdFloat  invargscale1(-1.428606765330187045e-06f);
     const SimdFloat  CC4(0.00136324646882712841033936f);
@@ -395,13 +523,31 @@ exp(SimdFloat x)
     SimdFloat        fexppart;
     SimdFloat        intpart;
     SimdFloat        y, p;
-    SimdFBool        m;
+
+    // Large negative values are valid arguments to exp2(), so there are two
+    // things we need to account for:
+    // 1. When the IEEE exponents reaches -127, the (biased) exponent field will be
+    //    zero and we can no longer multiply with it. There are special IEEE
+    //    formats to handle this range, but for now we have to accept that
+    //    we cannot handle those arguments. If input value becomes even more
+    //    negative, it will start to loop and we would end up with invalid
+    //    exponents. Thus, we need to limit or mask this.
+    // 2. For VERY large negative values, we will have problems that the
+    //    subtraction to get the fractional part loses accuracy, and then we
+    //    can end up with overflows in the polynomial.
+    //
+    // For now, we handle this by clamping smaller arguments to -127*ln(2). At this
+    // point we will already return zero, so we don't need to do anything
+    // extra for the exponent.
+
+    if (opt == MathOptimization::Safe)
+    {
+        x         = max(x, smallArgLimit);
+    }
 
     y         = x * argscale;
     fexppart  = ldexp(one, cvtR2I(y));
     intpart   = round(y);
-    m         = (abs(y) <= arglimit);
-    fexppart  = selectByMask(fexppart, m);
 
     // Extended precision arithmetics
     x         = fma(invargscale0, intpart, x);
@@ -1357,7 +1503,15 @@ rsqrtIter(SimdDouble lu, SimdDouble x)
 
 /*! \brief Calculate 1/sqrt(x) for SIMD double.
  *
- *  \param x Argument that must be >0. This routine does not check arguments.
+ *  \param x Argument that must be larger than GMX_FLOAT_MIN and smaller than
+ *           GMX_FLOAT_MAX, i.e. within the range of single precision.
+ *           For the single precision implementation this is obviously always
+ *           true for positive values, but for double precision it adds an
+ *           extra restriction since the first lookup step might have to be
+ *           performed in single precision on some architectures. Note that the
+ *           responsibility for checking falls on you - this routine does not
+ *           check arguments.
+ *
  *  \return 1/sqrt(x). Result is undefined if your argument was invalid.
  */
 static inline SimdDouble gmx_simdcall
@@ -1381,13 +1535,22 @@ invsqrt(SimdDouble x)
 
 /*! \brief Calculate 1/sqrt(x) for two SIMD doubles.
  *
- * \param x0  First set of arguments, x0 must be positive - no argument checking.
- * \param x1  Second set of arguments, x1 must be positive - no argument checking.
+ * \param x0  First set of arguments, x0 must be in single range (see below).
+ * \param x1  Second set of arguments, x1 must be in single range (see below).
  * \param[out] out0  Result 1/sqrt(x0)
  * \param[out] out1  Result 1/sqrt(x1)
  *
  *  In particular for double precision we can sometimes calculate square root
  *  pairs slightly faster by using single precision until the very last step.
+ *
+ * \note Both arguments must be larger than GMX_FLOAT_MIN and smaller than
+ *       GMX_FLOAT_MAX, i.e. within the range of single precision.
+ *       For the single precision implementation this is obviously always
+ *       true for positive values, but for double precision it adds an
+ *       extra restriction since the first lookup step might have to be
+ *       performed in single precision on some architectures. Note that the
+ *       responsibility for checking falls on you - this routine does not
+ *       check arguments.
  */
 static inline void gmx_simdcall
 invsqrtPair(SimdDouble x0,    SimdDouble x1,
@@ -1444,7 +1607,15 @@ rcpIter(SimdDouble lu, SimdDouble x)
 
 /*! \brief Calculate 1/x for SIMD double.
  *
- *  \param x Argument that must be nonzero. This routine does not check arguments.
+ *  \param x Argument with magnitude larger than GMX_FLOAT_MIN and smaller than
+ *           GMX_FLOAT_MAX, i.e. within the range of single precision.
+ *           For the single precision implementation this is obviously always
+ *           true for positive values, but for double precision it adds an
+ *           extra restriction since the first lookup step might have to be
+ *           performed in single precision on some architectures. Note that the
+ *           responsibility for checking falls on you - this routine does not
+ *           check arguments.
+ *
  *  \return 1/x. Result is undefined if your argument was invalid.
  */
 static inline SimdDouble gmx_simdcall
@@ -1469,7 +1640,12 @@ inv(SimdDouble x)
 /*! \brief Division for SIMD doubles
  *
  * \param nom    Nominator
- * \param denom  Denominator
+ * \param denom  Denominator, with magnitude in range (GMX_FLOAT_MIN,GMX_FLOAT_MAX).
+ *               For single precision this is equivalent to a nonzero argument,
+ *               but in double precision it adds an extra restriction since
+ *               the first lookup step might have to be performed in single
+ *               precision on some architectures. Note that the responsibility
+ *               for checking falls on you - this routine does not check arguments.
  *
  * \return nom/denom
  *
@@ -1489,7 +1665,9 @@ operator/(SimdDouble nom, SimdDouble denom)
  *  Illegal values in the masked-out elements will not lead to
  *  floating-point exceptions.
  *
- *  \param x Argument that must be >0 for masked-in entries
+ *  \param x Argument that must be larger than GMX_FLOAT_MIN and smaller than
+ *           GMX_FLOAT_MAX for masked-in entries.
+ *           See \ref invsqrt for the discussion about argument restrictions.
  *  \param m Mask
  *  \return 1/sqrt(x). Result is undefined if your argument was invalid or
  *          entry was not masked, and 0.0 for masked-out entries.
@@ -1515,7 +1693,9 @@ maskzInvsqrt(SimdDouble x, SimdDBool m)
 
 /*! \brief Calculate 1/x for SIMD double, masked version.
  *
- *  \param x Argument that must be nonzero for non-masked entries.
+ *  \param x Argument with magnitude larger than GMX_FLOAT_MIN and smaller than
+ *           GMX_FLOAT_MAX for masked-in entries.
+ *           See \ref invsqrt for the discussion about argument restrictions.
  *  \param m Mask
  *  \return 1/x for elements where m is true, or 0.0 for masked-out entries.
  */
@@ -1539,18 +1719,24 @@ maskzInv(SimdDouble x, SimdDBool m)
 }
 
 
-/*! \brief Calculate sqrt(x) correctly for SIMD doubles, including argument 0.0.
+/*! \brief Calculate sqrt(x) for SIMD doubles.
  *
- *  \param x Argument that must be >=0.
- *  \return sqrt(x). If x=0, the result will correctly be set to 0.
- *          if x>0 && x<float_min, the result will incorrectly be set to 0.
- *          The result is undefined if the input value is negative.
+ *  \copydetails sqrt(SimdFloat)
  */
+template <MathOptimization opt = MathOptimization::Safe>
 static inline SimdDouble gmx_simdcall
 sqrt(SimdDouble x)
 {
-    // As we might use a float version of rsqrt, we mask out small values
-    return x * maskzInvsqrt(x, SimdDouble(GMX_FLOAT_MIN) <= x);
+    if (opt == MathOptimization::Safe)
+    {
+        // As we might use a float version of rsqrt, we mask out small values
+        SimdDouble res = maskzInvsqrt(x, SimdDouble(GMX_FLOAT_MIN) < x);
+        return res*x;
+    }
+    else
+    {
+        return x * invsqrt(x);
+    }
 }
 
 #if !GMX_SIMD_HAVE_NATIVE_LOG_DOUBLE
@@ -1605,13 +1791,14 @@ log(SimdDouble x)
 #if !GMX_SIMD_HAVE_NATIVE_EXP2_DOUBLE
 /*! \brief SIMD double 2^x.
  *
- * \param x Argument.
- * \result 2^x. Undefined if input argument caused overflow.
+ * \copydetails exp2(SimdFloat)
  */
+template <MathOptimization opt = MathOptimization::Safe>
 static inline SimdDouble gmx_simdcall
 exp2(SimdDouble x)
 {
-    const SimdDouble  arglimit(1022.0);
+    // Lower bound: Clamp args that would lead to an IEEE fp exponent below -1023.
+    const SimdDouble  smallArgLimit(-1023.0);
     const SimdDouble  CE11(4.435280790452730022081181e-10);
     const SimdDouble  CE10(7.074105630863314448024247e-09);
     const SimdDouble  CE9(1.017819803432096698472621e-07);
@@ -1628,12 +1815,30 @@ exp2(SimdDouble x)
     SimdDouble        intpart;
     SimdDouble        fexppart;
     SimdDouble        p;
-    SimdDBool         m;
+
+    // Large negative values are valid arguments to exp2(), so there are two
+    // things we need to account for:
+    // 1. When the exponents reaches -1023, the (biased) exponent field will be
+    //    zero and we can no longer multiply with it. There are special IEEE
+    //    formats to handle this range, but for now we have to accept that
+    //    we cannot handle those arguments. If input value becomes even more
+    //    negative, it will start to loop and we would end up with invalid
+    //    exponents. Thus, we need to limit or mask this.
+    // 2. For VERY large negative values, we will have problems that the
+    //    subtraction to get the fractional part loses accuracy, and then we
+    //    can end up with overflows in the polynomial.
+    //
+    // For now, we handle this by clamping smaller arguments to -1023. At this
+    // point we will already return zero, so we don't need to do anything
+    // extra for the exponent.
+
+    if (opt == MathOptimization::Safe)
+    {
+        x         = max(x, smallArgLimit);
+    }
 
     fexppart  = ldexp(one, cvtR2I(x));
     intpart   = round(x);
-    m         = abs(x) <= arglimit;
-    fexppart  = selectByMask(fexppart, m);
     x         = x - intpart;
 
     p         = fma(CE11, x, CE10);
@@ -1655,18 +1860,15 @@ exp2(SimdDouble x)
 #if !GMX_SIMD_HAVE_NATIVE_EXP_DOUBLE
 /*! \brief SIMD double exp(x).
  *
- * In addition to scaling the argument for 2^x this routine correctly does
- * extended precision arithmetics to improve accuracy.
- *
- * \param x Argument.
- * \result exp(x). Undefined if input argument caused overflow,
- * which can happen if abs(x) \> 7e13.
+ * \copydetails exp(SimdFloat)
  */
+template <MathOptimization opt = MathOptimization::Safe>
 static inline SimdDouble gmx_simdcall
 exp(SimdDouble x)
 {
     const SimdDouble  argscale(1.44269504088896340735992468100);
-    const SimdDouble  arglimit(1022.0);
+    // Lower bound: Clamp args that would lead to an IEEE fp exponent below -1023.
+    const SimdDouble  smallArgLimit(-709.0895657128);
     const SimdDouble  invargscale0(-0.69314718055966295651160180568695068359375);
     const SimdDouble  invargscale1(-2.8235290563031577122588448175013436025525412068e-13);
     const SimdDouble  CE12(2.078375306791423699350304e-09);
@@ -1684,13 +1886,31 @@ exp(SimdDouble x)
     SimdDouble        fexppart;
     SimdDouble        intpart;
     SimdDouble        y, p;
-    SimdDBool         m;
+
+    // Large negative values are valid arguments to exp2(), so there are two
+    // things we need to account for:
+    // 1. When the exponents reaches -1023, the (biased) exponent field will be
+    //    zero and we can no longer multiply with it. There are special IEEE
+    //    formats to handle this range, but for now we have to accept that
+    //    we cannot handle those arguments. If input value becomes even more
+    //    negative, it will start to loop and we would end up with invalid
+    //    exponents. Thus, we need to limit or mask this.
+    // 2. For VERY large negative values, we will have problems that the
+    //    subtraction to get the fractional part loses accuracy, and then we
+    //    can end up with overflows in the polynomial.
+    //
+    // For now, we handle this by clamping smaller arguments to -1023*ln(2). At this
+    // point we will already return zero, so we don't need to do anything
+    // extra for the exponent.
+
+    if (opt == MathOptimization::Safe)
+    {
+        x         = max(x, smallArgLimit);
+    }
 
     y         = x * argscale;
     fexppart  = ldexp(one, cvtR2I(y));
     intpart   = round(y);
-    m         = (abs(y) <= arglimit);
-    fexppart  = selectByMask(fexppart, m);
 
     // Extended precision arithmetics
     x         = fma(invargscale0, intpart, x);
@@ -2697,7 +2917,15 @@ pmePotentialCorrection(SimdDouble z2)
 
 /*! \brief Calculate 1/sqrt(x) for SIMD double, but in single accuracy.
  *
- *  \param x Argument that must be >0. This routine does not check arguments.
+ *  \param x Argument that must be larger than GMX_FLOAT_MIN and smaller than
+ *           GMX_FLOAT_MAX, i.e. within the range of single precision.
+ *           For the single precision implementation this is obviously always
+ *           true for positive values, but for double precision it adds an
+ *           extra restriction since the first lookup step might have to be
+ *           performed in single precision on some architectures. Note that the
+ *           responsibility for checking falls on you - this routine does not
+ *           check arguments.
+ *
  *  \return 1/sqrt(x). Result is undefined if your argument was invalid.
  */
 static inline SimdDouble gmx_simdcall
@@ -2722,7 +2950,15 @@ invsqrtSingleAccuracy(SimdDouble x)
  *  Illegal values in the masked-out elements will not lead to
  *  floating-point exceptions.
  *
- *  \param x Argument that must be >0 for masked-in entries
+ *  \param x Argument that must be larger than GMX_FLOAT_MIN and smaller than
+ *           GMX_FLOAT_MAX, i.e. within the range of single precision.
+ *           For the single precision implementation this is obviously always
+ *           true for positive values, but for double precision it adds an
+ *           extra restriction since the first lookup step might have to be
+ *           performed in single precision on some architectures. Note that the
+ *           responsibility for checking falls on you - this routine does not
+ *           check arguments.
+ *
  *  \param m Mask
  *  \return 1/sqrt(x). Result is undefined if your argument was invalid or
  *          entry was not masked, and 0.0 for masked-out entries.
@@ -2745,13 +2981,22 @@ maskzInvsqrtSingleAccuracy(SimdDouble x, SimdDBool m)
 
 /*! \brief Calculate 1/sqrt(x) for two SIMD doubles, but single accuracy.
  *
- * \param x0  First set of arguments, x0 must be positive - no argument checking.
- * \param x1  Second set of arguments, x1 must be positive - no argument checking.
+ * \param x0  First set of arguments, x0 must be in single range (see below).
+ * \param x1  Second set of arguments, x1 must be in single range (see below).
  * \param[out] out0  Result 1/sqrt(x0)
  * \param[out] out1  Result 1/sqrt(x1)
  *
  *  In particular for double precision we can sometimes calculate square root
  *  pairs slightly faster by using single precision until the very last step.
+ *
+ * \note Both arguments must be larger than GMX_FLOAT_MIN and smaller than
+ *       GMX_FLOAT_MAX, i.e. within the range of single precision.
+ *       For the single precision implementation this is obviously always
+ *       true for positive values, but for double precision it adds an
+ *       extra restriction since the first lookup step might have to be
+ *       performed in single precision on some architectures. Note that the
+ *       responsibility for checking falls on you - this routine does not
+ *       check arguments.
  */
 static inline void gmx_simdcall
 invsqrtPairSingleAccuracy(SimdDouble x0,    SimdDouble x1,
@@ -2783,7 +3028,15 @@ invsqrtPairSingleAccuracy(SimdDouble x0,    SimdDouble x1,
 
 /*! \brief Calculate 1/x for SIMD double, but in single accuracy.
  *
- *  \param x Argument that must be nonzero. This routine does not check arguments.
+ *  \param x Argument with magnitude larger than GMX_FLOAT_MIN and smaller than
+ *           GMX_FLOAT_MAX, i.e. within the range of single precision.
+ *           For the single precision implementation this is obviously always
+ *           true for positive values, but for double precision it adds an
+ *           extra restriction since the first lookup step might have to be
+ *           performed in single precision on some architectures. Note that the
+ *           responsibility for checking falls on you - this routine does not
+ *           check arguments.
+ *
  *  \return 1/x. Result is undefined if your argument was invalid.
  */
 static inline SimdDouble gmx_simdcall
@@ -2804,7 +3057,15 @@ invSingleAccuracy(SimdDouble x)
 
 /*! \brief 1/x for masked entries of SIMD double, single accuracy.
  *
- *  \param x Argument that must be nonzero for non-masked entries.
+ *  \param x Argument with magnitude larger than GMX_FLOAT_MIN and smaller than
+ *           GMX_FLOAT_MAX, i.e. within the range of single precision.
+ *           For the single precision implementation this is obviously always
+ *           true for positive values, but for double precision it adds an
+ *           extra restriction since the first lookup step might have to be
+ *           performed in single precision on some architectures. Note that the
+ *           responsibility for checking falls on you - this routine does not
+ *           check arguments.
+ *
  *  \param m Mask
  *  \return 1/x for elements where m is true, or 0.0 for masked-out entries.
  */
@@ -2825,18 +3086,26 @@ maskzInvSingleAccuracy(SimdDouble x, SimdDBool m)
 }
 
 
-/*! \brief Calculate sqrt(x) (correct for 0.0) for SIMD double, single accuracy.
+/*! \brief Calculate sqrt(x) (correct for 0.0) for SIMD double, with single accuracy.
  *
- *  \param x Argument that must be >=0.
- *  \return sqrt(x). If x<float_min, the result will correctly be set to 0.
- *          The result is undefined if the input value is negative.
+ *  \copydetails sqrt(SimdFloat)
  */
+template <MathOptimization opt = MathOptimization::Safe>
 static inline SimdDouble gmx_simdcall
 sqrtSingleAccuracy(SimdDouble x)
 {
-    return x * maskzInvsqrtSingleAccuracy(x, SimdDouble(GMX_FLOAT_MIN) <= x);
+    if (opt == MathOptimization::Safe)
+    {
+        SimdDouble res = maskzInvsqrt(x, SimdDouble(GMX_FLOAT_MIN) < x);
+        return res*x;
+    }
+    else
+    {
+        return x * invsqrtSingleAccuracy(x);
+    }
 }
 
+
 /*! \brief SIMD log(x). Double precision SIMD data, single accuracy.
  *
  * \param x Argument, should be >0.
@@ -2878,16 +3147,16 @@ logSingleAccuracy(SimdDouble x)
     return p;
 }
 
-/*! \brief SIMD 2^x. Double precision SIMD data, single accuracy.
+/*! \brief SIMD 2^x. Double precision SIMD, single accuracy.
  *
- * \param x Argument.
- * \result 2^x. Undefined if input argument caused overflow.
+ * \copydetails exp2(SimdFloat)
  */
+template <MathOptimization opt = MathOptimization::Safe>
 static inline SimdDouble gmx_simdcall
 exp2SingleAccuracy(SimdDouble x)
 {
-    // Lower bound: Disallow numbers that would lead to an IEEE fp exponent reaching +-127.
-    const SimdDouble  arglimit = SimdDouble(126.0);
+    // Lower bound: Clamp args that would lead to an IEEE fp exponent below -1023.
+    const SimdDouble  smallArgLimit(-1023.0);
     const SimdDouble  CC6(0.0001534581200287996416911311);
     const SimdDouble  CC5(0.001339993121934088894618990);
     const SimdDouble  CC4(0.009618488957115180159497841);
@@ -2898,12 +3167,31 @@ exp2SingleAccuracy(SimdDouble x)
 
     SimdDouble        intpart;
     SimdDouble        p;
-    SimdDBool         valuemask;
     SimdDInt32        ix;
 
+    // Large negative values are valid arguments to exp2(), so there are two
+    // things we need to account for:
+    // 1. When the exponents reaches -1023, the (biased) exponent field will be
+    //    zero and we can no longer multiply with it. There are special IEEE
+    //    formats to handle this range, but for now we have to accept that
+    //    we cannot handle those arguments. If input value becomes even more
+    //    negative, it will start to loop and we would end up with invalid
+    //    exponents. Thus, we need to limit or mask this.
+    // 2. For VERY large negative values, we will have problems that the
+    //    subtraction to get the fractional part loses accuracy, and then we
+    //    can end up with overflows in the polynomial.
+    //
+    // For now, we handle this by clamping smaller arguments to -1023. At this
+    // point we will already return zero, so we don't need to do anything
+    // extra for the exponent.
+
+    if (opt == MathOptimization::Safe)
+    {
+        x         = max(x, smallArgLimit);
+    }
+
     ix        = cvtR2I(x);
     intpart   = round(x);
-    valuemask = (abs(x) <= arglimit);
     x         = x - intpart;
 
     p         = fma(CC6, x, CC5);
@@ -2913,22 +3201,23 @@ exp2SingleAccuracy(SimdDouble x)
     p         = fma(p, x, CC1);
     p         = fma(p, x, one);
     x         = ldexp(p, ix);
-    x         = selectByMask(x, valuemask);
 
     return x;
 }
 
-/*! \brief SIMD exp(x). Double precision SIMD data, single accuracy.
+
+
+/*! \brief SIMD exp(x). Double precision SIMD, single accuracy.
  *
- * \param x Argument.
- * \result exp(x). Undefined if input argument caused overflow.
+ * \copydetails exp(SimdFloat)
  */
+template <MathOptimization opt = MathOptimization::Safe>
 static inline SimdDouble gmx_simdcall
 expSingleAccuracy(SimdDouble x)
 {
     const SimdDouble  argscale(1.44269504088896341);
-    // Lower bound: Disallow numbers that would lead to an IEEE fp exponent reaching +-127
-    const SimdDouble  arglimit(126.0);
+    // Lower bound: Clamp args that would lead to an IEEE fp exponent below -1023.
+    const SimdDouble  smallArgLimit(-709.0895657128);
     const SimdDouble  invargscale(-0.69314718055994528623);
     const SimdDouble  CC4(0.00136324646882712841033936);
     const SimdDouble  CC3(0.00836596917361021041870117);
@@ -2938,13 +3227,32 @@ expSingleAccuracy(SimdDouble x)
     const SimdDouble  one(1.0);
     SimdDouble        intpart;
     SimdDouble        y, p;
-    SimdDBool         valuemask;
     SimdDInt32        iy;
 
+    // Large negative values are valid arguments to exp2(), so there are two
+    // things we need to account for:
+    // 1. When the exponents reaches -127, the (biased) exponent field will be
+    //    zero and we can no longer multiply with it. There are special IEEE
+    //    formats to handle this range, but for now we have to accept that
+    //    we cannot handle those arguments. If input value becomes even more
+    //    negative, it will start to loop and we would end up with invalid
+    //    exponents. Thus, we need to limit or mask this.
+    // 2. For VERY large negative values, we will have problems that the
+    //    subtraction to get the fractional part loses accuracy, and then we
+    //    can end up with overflows in the polynomial.
+    //
+    // For now, we handle this by clamping smaller arguments to -127. At this
+    // point we will already return zero, so we don't need to do anything
+    // extra for the exponent.
+
+    if (opt == MathOptimization::Safe)
+    {
+        x         = max(x, smallArgLimit);
+    }
+
     y         = x * argscale;
     iy        = cvtR2I(y);
     intpart   = round(y);        // use same rounding algorithm here
-    valuemask = (abs(y) <= arglimit);
 
     // Extended precision arithmetics not needed since
     // we have double precision and only need single accuracy.
@@ -2957,10 +3265,10 @@ expSingleAccuracy(SimdDouble x)
     p         = fma(x*x, p, x);
     p         = p + one;
     x         = ldexp(p, iy);
-    x         = selectByMask(x, valuemask);
     return x;
 }
 
+
 /*! \brief SIMD erf(x). Double precision SIMD data, single accuracy.
  *
  * \param x The value to calculate erf(x) for.
@@ -3660,7 +3968,7 @@ atan2SingleAccuracy(SimdDouble y, SimdDouble x)
  * added to \f$1/r\f$ the error will be insignificant.
  *
  */
-static SimdDouble gmx_simdcall
+static inline SimdDouble gmx_simdcall
 pmeForceCorrectionSingleAccuracy(SimdDouble z2)
 {
     const SimdDouble  FN6(-1.7357322914161492954e-8);
@@ -3732,7 +4040,7 @@ pmeForceCorrectionSingleAccuracy(SimdDouble z2)
  * This approximation achieves an accuracy slightly lower than 1e-6; when
  * added to \f$1/r\f$ the error will be insignificant.
  */
-static SimdDouble gmx_simdcall
+static inline SimdDouble gmx_simdcall
 pmePotentialCorrectionSingleAccuracy(SimdDouble z2)
 {
     const SimdDouble  VN6(1.9296833005951166339e-8);
@@ -3805,8 +4113,15 @@ rsqrtIter(Simd4Float lu, Simd4Float x)
 
 /*! \brief Calculate 1/sqrt(x) for SIMD4 float.
  *
- *  \param x Argument that must be >0. This routine does not check arguments.
- *  \return 1/sqrt(x). Result is undefined if your argument was invalid.
+ *  \param x Argument that must be larger than GMX_FLOAT_MIN and smaller than
+ *           GMX_FLOAT_MAX, i.e. within the range of single precision.
+ *           For the single precision implementation this is obviously always
+ *           true for positive values, but for double precision it adds an
+ *           extra restriction since the first lookup step might have to be
+ *           performed in single precision on some architectures. Note that the
+ *           responsibility for checking falls on you - this routine does not
+ *           check arguments.
+ *  \return  1/sqrt(x). Result is undefined if your argument was invalid.
  */
 static inline Simd4Float gmx_simdcall
 invsqrt(Simd4Float x)
@@ -3854,8 +4169,15 @@ rsqrtIter(Simd4Double lu, Simd4Double x)
 
 /*! \brief Calculate 1/sqrt(x) for SIMD4 double.
  *
- *  \param x Argument that must be >0. This routine does not check arguments.
- *  \return 1/sqrt(x). Result is undefined if your argument was invalid.
+ *  \param x Argument that must be larger than GMX_FLOAT_MIN and smaller than
+ *           GMX_FLOAT_MAX, i.e. within the range of single precision.
+ *           For the single precision implementation this is obviously always
+ *           true for positive values, but for double precision it adds an
+ *           extra restriction since the first lookup step might have to be
+ *           performed in single precision on some architectures. Note that the
+ *           responsibility for checking falls on you - this routine does not
+ *           check arguments.
+ *  \return  1/sqrt(x). Result is undefined if your argument was invalid.
  */
 static inline Simd4Double gmx_simdcall
 invsqrt(Simd4Double x)
@@ -3883,8 +4205,15 @@ invsqrt(Simd4Double x)
 
 /*! \brief Calculate 1/sqrt(x) for SIMD4 double, but in single accuracy.
  *
- *  \param x Argument that must be >0. This routine does not check arguments.
- *  \return 1/sqrt(x). Result is undefined if your argument was invalid.
+ *  \param x Argument that must be larger than GMX_FLOAT_MIN and smaller than
+ *           GMX_FLOAT_MAX, i.e. within the range of single precision.
+ *           For the single precision implementation this is obviously always
+ *           true for positive values, but for double precision it adds an
+ *           extra restriction since the first lookup step might have to be
+ *           performed in single precision on some architectures. Note that the
+ *           responsibility for checking falls on you - this routine does not
+ *           check arguments.
+ *  \return  1/sqrt(x). Result is undefined if your argument was invalid.
  */
 static inline Simd4Double gmx_simdcall
 invsqrtSingleAccuracy(Simd4Double x)
@@ -3911,8 +4240,15 @@ invsqrtSingleAccuracy(Simd4Double x)
 #if GMX_SIMD_HAVE_FLOAT
 /*! \brief Calculate 1/sqrt(x) for SIMD float, only targeting single accuracy.
  *
- *  \param x Argument that must be >0. This routine does not check arguments.
- *  \return 1/sqrt(x). Result is undefined if your argument was invalid.
+ *  \param x Argument that must be larger than GMX_FLOAT_MIN and smaller than
+ *           GMX_FLOAT_MAX, i.e. within the range of single precision.
+ *           For the single precision implementation this is obviously always
+ *           true for positive values, but for double precision it adds an
+ *           extra restriction since the first lookup step might have to be
+ *           performed in single precision on some architectures. Note that the
+ *           responsibility for checking falls on you - this routine does not
+ *           check arguments.
+ *  \return  1/sqrt(x). Result is undefined if your argument was invalid.
  */
 static inline SimdFloat gmx_simdcall
 invsqrtSingleAccuracy(SimdFloat x)
@@ -3926,10 +4262,17 @@ invsqrtSingleAccuracy(SimdFloat x)
  *  Illegal values in the masked-out elements will not lead to
  *  floating-point exceptions.
  *
- *  \param x Argument that must be >0 for masked-in entries
+ *  \param x Argument that must be larger than GMX_FLOAT_MIN and smaller than
+ *           GMX_FLOAT_MAX, i.e. within the range of single precision.
+ *           For the single precision implementation this is obviously always
+ *           true for positive values, but for double precision it adds an
+ *           extra restriction since the first lookup step might have to be
+ *           performed in single precision on some architectures. Note that the
+ *           responsibility for checking falls on you - this routine does not
+ *           check arguments.
  *  \param m Mask
- *  \return 1/sqrt(x). Result is undefined if your argument was invalid or
- *          entry was not masked, and 0.0 for masked-out entries.
+ *  \return  1/sqrt(x). Result is undefined if your argument was invalid or
+ *           entry was not masked, and 0.0 for masked-out entries.
  */
 static inline SimdFloat
 maskzInvsqrtSingleAccuracy(SimdFloat x, SimdFBool m)
@@ -3939,13 +4282,22 @@ maskzInvsqrtSingleAccuracy(SimdFloat x, SimdFBool m)
 
 /*! \brief Calculate 1/sqrt(x) for two SIMD floats, only targeting single accuracy.
  *
- * \param x0  First set of arguments, x0 must be positive - no argument checking.
- * \param x1  Second set of arguments, x1 must be positive - no argument checking.
+ * \param x0  First set of arguments, x0 must be in single range (see below).
+ * \param x1  Second set of arguments, x1 must be in single range (see below).
  * \param[out] out0  Result 1/sqrt(x0)
  * \param[out] out1  Result 1/sqrt(x1)
  *
  *  In particular for double precision we can sometimes calculate square root
  *  pairs slightly faster by using single precision until the very last step.
+ *
+ * \note Both arguments must be larger than GMX_FLOAT_MIN and smaller than
+ *       GMX_FLOAT_MAX, i.e. within the range of single precision.
+ *       For the single precision implementation this is obviously always
+ *       true for positive values, but for double precision it adds an
+ *       extra restriction since the first lookup step might have to be
+ *       performed in single precision on some architectures. Note that the
+ *       responsibility for checking falls on you - this routine does not
+ *       check arguments.
  */
 static inline void gmx_simdcall
 invsqrtPairSingleAccuracy(SimdFloat x0,    SimdFloat x1,
@@ -3956,8 +4308,15 @@ invsqrtPairSingleAccuracy(SimdFloat x0,    SimdFloat x1,
 
 /*! \brief Calculate 1/x for SIMD float, only targeting single accuracy.
  *
- *  \param x Argument that must be nonzero. This routine does not check arguments.
- *  \return 1/x. Result is undefined if your argument was invalid.
+ *  \param x Argument with magnitude larger than GMX_FLOAT_MIN and smaller than
+ *           GMX_FLOAT_MAX, i.e. within the range of single precision.
+ *           For the single precision implementation this is obviously always
+ *           true for positive values, but for double precision it adds an
+ *           extra restriction since the first lookup step might have to be
+ *           performed in single precision on some architectures. Note that the
+ *           responsibility for checking falls on you - this routine does not
+ *           check arguments.
+ *  \return  1/x. Result is undefined if your argument was invalid.
  */
 static inline SimdFloat gmx_simdcall
 invSingleAccuracy(SimdFloat x)
@@ -3968,9 +4327,16 @@ invSingleAccuracy(SimdFloat x)
 
 /*! \brief Calculate 1/x for masked SIMD floats, only targeting single accuracy.
  *
- *  \param x Argument that must be nonzero for non-masked entries.
+ *  \param x Argument with magnitude larger than GMX_FLOAT_MIN and smaller than
+ *           GMX_FLOAT_MAX, i.e. within the range of single precision.
+ *           For the single precision implementation this is obviously always
+ *           true for positive values, but for double precision it adds an
+ *           extra restriction since the first lookup step might have to be
+ *           performed in single precision on some architectures. Note that the
+ *           responsibility for checking falls on you - this routine does not
+ *           check arguments.
  *  \param m Mask
- *  \return 1/x for elements where m is true, or 0.0 for masked-out entries.
+ *  \return  1/x for elements where m is true, or 0.0 for masked-out entries.
  */
 static inline SimdFloat
 maskzInvSingleAccuracy(SimdFloat x, SimdFBool m)
@@ -3978,16 +4344,15 @@ maskzInvSingleAccuracy(SimdFloat x, SimdFBool m)
     return maskzInv(x, m);
 }
 
-/*! \brief Calculate sqrt(x) for SIMD float, only targeting single accuracy.
+/*! \brief Calculate sqrt(x) for SIMD float, always targeting single accuracy.
  *
- *  \param x Argument that must be >=0.
- *  \return sqrt(x). If x=0, the result will correctly be set to 0.
- *          The result is undefined if the input value is negative.
+ * \copydetails sqrt(SimdFloat)
  */
+template <MathOptimization opt = MathOptimization::Safe>
 static inline SimdFloat gmx_simdcall
 sqrtSingleAccuracy(SimdFloat x)
 {
-    return sqrt(x);
+    return sqrt<opt>(x);
 }
 
 /*! \brief SIMD float log(x), only targeting single accuracy. This is the natural logarithm.
@@ -4003,26 +4368,27 @@ logSingleAccuracy(SimdFloat x)
 
 /*! \brief SIMD float 2^x, only targeting single accuracy.
  *
- * \param x Argument.
- * \result 2^x. Undefined if input argument caused overflow.
+ * \copydetails exp2(SimdFloat)
  */
+template <MathOptimization opt = MathOptimization::Safe>
 static inline SimdFloat gmx_simdcall
 exp2SingleAccuracy(SimdFloat x)
 {
-    return exp2(x);
+    return exp2<opt>(x);
 }
 
 /*! \brief SIMD float e^x, only targeting single accuracy.
  *
- * \param x Argument.
- * \result exp(x). Undefined if input argument caused overflow.
+ * \copydetails exp(SimdFloat)
  */
+template <MathOptimization opt = MathOptimization::Safe>
 static inline SimdFloat gmx_simdcall
 expSingleAccuracy(SimdFloat x)
 {
-    return exp(x);
+    return exp<opt>(x);
 }
 
+
 /*! \brief SIMD float erf(x), only targeting single accuracy.
  *
  * \param x The value to calculate erf(x) for.
@@ -4183,7 +4549,14 @@ pmePotentialCorrectionSingleAccuracy(SimdFloat z2)
 #if GMX_SIMD4_HAVE_FLOAT
 /*! \brief Calculate 1/sqrt(x) for SIMD4 float, only targeting single accuracy.
  *
- *  \param x Argument that must be >0. This routine does not check arguments.
+ *  \param x Argument that must be larger than GMX_FLOAT_MIN and smaller than
+ *           GMX_FLOAT_MAX, i.e. within the range of single precision.
+ *           For the single precision implementation this is obviously always
+ *           true for positive values, but for double precision it adds an
+ *           extra restriction since the first lookup step might have to be
+ *           performed in single precision on some architectures. Note that the
+ *           responsibility for checking falls on you - this routine does not
+ *           check arguments.
  *  \return 1/sqrt(x). Result is undefined if your argument was invalid.
  */
 static inline Simd4Float gmx_simdcall
index 503e93bd14fa41e8606fcbe9abf13e2a3ad50a00..3ba4f74d7a1ac93f22e0e0102f9fa719476a93e5 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,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.
@@ -74,6 +74,7 @@ simdString(SimdType s)
         { SimdType::X86_Avx128Fma,  "AVX_128_FMA"     },
         { SimdType::X86_Avx,        "AVX_256"         },
         { SimdType::X86_Avx2,       "AVX2_256"        },
+        { SimdType::X86_Avx2_128,   "AVX2_128"        },
         { SimdType::X86_Avx512,     "AVX_512"         },
         { SimdType::X86_Avx512Knl,  "AVX_512_KNL"     },
         { SimdType::X86_Mic,        "X86_MIC"         },
@@ -126,8 +127,10 @@ simdSuggested(const CpuInfo &c)
             case CpuInfo::Vendor::Amd:
                 if (c.feature(CpuInfo::Feature::X86_Avx2))
                 {
-                    // When Amd starts supporting Avx2 we assume it will be 256 bits
-                    suggested = SimdType::X86_Avx2;
+                    // AMD Ryzen supports 256-bit AVX2, but performs better with 128-bit
+                    // since it can execute two independent such instructions per cycle,
+                    // and wider SIMD has slightly lower efficiency in GROMACS.
+                    suggested = SimdType::X86_Avx2_128;
                 }
                 else if (c.feature(CpuInfo::Feature::X86_Avx))
                 {
@@ -199,6 +202,8 @@ simdCompiled()
     return SimdType::X86_Mic;
 #elif GMX_SIMD_X86_AVX2_256
     return SimdType::X86_Avx2;
+#elif GMX_SIMD_X86_AVX2_128
+    return SimdType::X86_Avx2_128;
 #elif GMX_SIMD_X86_AVX_256
     return SimdType::X86_Avx;
 #elif GMX_SIMD_X86_AVX_128_FMA
index 9a5a53a0c7920e15daec3f112a63eb863100783c..5e223804ee893d8c9183db6a8a7003a78b0b31aa 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,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.
@@ -64,6 +64,7 @@ enum class SimdType
     X86_Avx128Fma,  //!< 128-bit Avx with FMA (Amd)
     X86_Avx,        //!< 256-bit Avx
     X86_Avx2,       //!< AVX2
+    X86_Avx2_128,   //!< 128-bit AVX2, better than 256-bit for AMD Ryzen
     X86_Avx512,     //!< AVX_512
     X86_Avx512Knl,  //!< AVX_512_KNL
     X86_Mic,        //!< Knight's corner
index dd23216959af72fda168861bd52557129a8fdaa8..2f8b30a0742135333640cbdd999011489fc6476d 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) 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.
@@ -35,6 +35,7 @@
 gmx_add_unit_test(SimdUnitTests simd-test
                   bootstrap_loadstore.cpp
                  base.cpp
+                  data.cpp
                   simd.cpp
                  simd_floatingpoint.cpp
                   simd_floatingpoint_util.cpp
diff --git a/src/gromacs/simd/tests/data.cpp b/src/gromacs/simd/tests/data.cpp
new file mode 100644 (file)
index 0000000..1e3ab7b
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * 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.
+ */
+#include "gmxpre.h"
+
+#include "data.h"
+
+#include "gromacs/utility/real.h"
+
+
+namespace gmx
+{
+namespace test
+{
+
+/*! \cond internal */
+/*! \addtogroup module_simd */
+/*! \{ */
+
+// Common test data constants used both for SIMD, SIMD4, and scalar tests.
+// We both want numbers that are easy to identify with integer part from 0 to 9,
+// and to fill all digits in the mantissa and avoid identical differences
+// between adjacent numbers we add a fraction of primes.
+const real czero = 0.0;
+const real c0    = 0.0 + 1.0/3.0;
+const real c1    = 1.0 + 5.0/7.0;
+const real c2    = 2.0 + 9.0/13.0;
+const real c3    = 3.0 + 17.0/19.0;
+const real c4    = 4.0 + 23.0/29.0;
+const real c5    = 5.0 + 31.0/37.0;
+const real c6    = 6.0 + 41.0/43.0;
+const real c7    = 7.0 + 47.0/53.0;
+const real c8    = 8.0 + 59.0/61.0;
+
+/*! \} */
+/*! \endcond */
+
+} // namespace test
+
+} // namespace gmx
diff --git a/src/gromacs/simd/tests/data.h b/src/gromacs/simd/tests/data.h
new file mode 100644 (file)
index 0000000..b66abce
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * 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_TESTS_DATA_H
+#define GMX_SIMD_TESTS_DATA_H
+
+/*! \internal \file
+ * \brief Common test data constants for SIMD, SIMD4 and scalar tests
+ *
+ * To avoid silent bugs due to double/float truncation if we ever use the
+ * wrong return type of routines, we want to use test data that fills all
+ * available bits in either single or double precision. The values themselves
+ * are meaningless.
+ * Note that the data is used to initialize the SIMD constants, which for
+ * technical (alignment) reasons in some compilers cannot be placed inside
+ * the text fixture classes. For that reason this data cannot go in the
+ * fixtures either.
+ *
+ * \author Erik Lindahl <erik.lindahl@scilifelab.se>
+ * \ingroup module_simd
+ */
+
+#include "gromacs/utility/real.h"
+
+namespace gmx
+{
+namespace test
+{
+
+/*! \cond internal */
+/*! \addtogroup module_simd */
+/*! \{ */
+extern const real czero; //!< Value 0.0 in real precision
+extern const real c0;    //!< Random fp value using entire mantissa
+extern const real c1;    //!< Random fp value using entire mantissa
+extern const real c2;    //!< Random fp value using entire mantissa
+extern const real c3;    //!< Random fp value using entire mantissa
+extern const real c4;    //!< Random fp value using entire mantissa
+extern const real c5;    //!< Random fp value using entire mantissa
+extern const real c5;    //!< Random fp value using entire mantissa
+extern const real c6;    //!< Random fp value using entire mantissa
+extern const real c7;    //!< Random fp value using entire mantissa
+extern const real c8;    //!< Random fp value using entire mantissa
+extern const real c9;    //!< Random fp value using entire mantissa
+
+/*! \} */
+/*! \endcond */
+
+}      // namespace test
+}      // namespace gmx
+
+#endif
index 2d6418b1c25f0de1650d3caf9bc0fcbf9dd281a5..540d3b1398795aa0af7187cc792bf52fd8fecdb3 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) 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.
@@ -42,6 +42,8 @@
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/real.h"
 
+#include "data.h"
+
 namespace gmx
 {
 namespace test
@@ -60,38 +62,34 @@ namespace
 
 TEST(SimdScalarTest, load)
 {
-    real ref = 1.234;
-    real val = load(&ref);
+    real val = load(&c1);
 
-    EXPECT_EQ(ref, val);
+    EXPECT_EQ(c1, val);
 }
 
 TEST(SimdScalarTest, loadU)
 {
-    real ref = 1.234;
-    real val = loadU(&ref);
+    real val = loadU(&c1);
 
-    EXPECT_EQ(ref, val);
+    EXPECT_EQ(c1, val);
 }
 
 TEST(SimdScalarTest, store)
 {
-    real ref = 1.234;
     real val;
 
-    store(&val, ref);
+    store(&val, c1);
 
-    EXPECT_EQ(ref, val);
+    EXPECT_EQ(c1, val);
 }
 
 TEST(SimdScalarTest, storeU)
 {
-    real ref = 1.234;
     real val;
 
-    store(&val, ref);
+    store(&val, c1);
 
-    EXPECT_EQ(ref, val);
+    EXPECT_EQ(c1, val);
 }
 
 TEST(SimdScalarTest, setZero)
@@ -105,61 +103,61 @@ TEST(SimdScalarTest, andNot)
 {
     real signBit = GMX_REAL_NEGZERO;
 
-    EXPECT_EQ(real(1), andNot(signBit, real(-1)));
-    EXPECT_EQ(real(2), andNot(signBit, real(2)));
+    EXPECT_EQ(c1, andNot(signBit, -c1));
+    EXPECT_EQ(c2, andNot(signBit, c2));
 }
 
 TEST(SimdScalarTest, fma)
 {
-    EXPECT_EQ(real(27), fma(real(3), real(6), real(9))); // 3*6+9=27
+    EXPECT_EQ(c1*c2+c3, fma(real(c1), real(c2), real(c3)));
 }
 
 TEST(SimdScalarTest, fms)
 {
-    EXPECT_EQ(real(9), fms(real(3), real(6), real(9))); // 3*6-9=9
+    EXPECT_EQ(c1*c2-c3, fms(c1, c2, c3));
 }
 
 TEST(SimdScalarTest, fnma)
 {
-    EXPECT_EQ(real(-9), fnma(real(3), real(6), real(9))); // -3*6+9=-9
+    EXPECT_EQ(-c1*c2+c3, fnma(c1, c2, c3));
 }
 
 TEST(SimdScalarTest, fnms)
 {
-    EXPECT_EQ(real(-27), fnms(real(3), real(6), real(9))); // -3*6-9=-27
+    EXPECT_EQ(-c1*c2-c3, fnms(c1, c2, c3));
 }
 
 TEST(SimdScalarTest, maskAdd)
 {
-    EXPECT_EQ(real(3), maskAdd(real(3), real(6), false));
-    EXPECT_EQ(real(9), maskAdd(real(3), real(6), true));
+    EXPECT_EQ(c1, maskAdd(c1, c2, false));
+    EXPECT_EQ(c1+c2, maskAdd(c1, c2, true));
 }
 
 TEST(SimdScalarTest, maskzMul)
 {
-    EXPECT_EQ(real(0), maskzMul(real(3), real(6), false));
-    EXPECT_EQ(real(18), maskzMul(real(3), real(6), true));
+    EXPECT_EQ(czero, maskzMul(c1, c2, false));
+    EXPECT_EQ(c1*c2, maskzMul(c1, c2, true));
 }
 
 TEST(SimdScalarTest, maskzFma)
 {
-    EXPECT_EQ(real(0), maskzFma(real(3), real(6), real(9), false));
-    EXPECT_EQ(real(27), maskzFma(real(3), real(6), real(9), true));
+    EXPECT_EQ(czero, maskzFma(c1, c2, c3, false));
+    EXPECT_EQ(c1*c2+c3, maskzFma(c1, c2, c3, true));
 }
 
 TEST(SimdScalarTest, abs)
 {
-    EXPECT_EQ(real(3), abs(real(-3)));
+    EXPECT_EQ(c1, abs(-c1));
 }
 
 TEST(SimdScalarTest, max)
 {
-    EXPECT_EQ(real(3), max(real(1), real(3)));
+    EXPECT_EQ(c3, max(c1, c3));
 }
 
 TEST(SimdScalarTest, min)
 {
-    EXPECT_EQ(real(1), min(real(1), real(3)));
+    EXPECT_EQ(c1, min(c1, c3));
 }
 
 TEST(SimdScalarTest, round)
@@ -180,14 +178,14 @@ TEST(SimdScalarTest, trunc)
 
 TEST(SimdScalarTest, reduce)
 {
-    EXPECT_EQ(real(5), reduce(real(5)));
+    EXPECT_EQ(c1, reduce(c1));
 }
 
 TEST(SimdScalarTest, testBits)
 {
-    EXPECT_TRUE(testBits(real(1)));
+    EXPECT_TRUE(testBits(c1));
     EXPECT_TRUE(testBits(GMX_REAL_NEGZERO));
-    EXPECT_FALSE(testBits(real(0)));
+    EXPECT_FALSE(testBits(czero));
 }
 
 TEST(SimdScalarTest, anyTrue)
@@ -198,20 +196,20 @@ TEST(SimdScalarTest, anyTrue)
 
 TEST(SimdScalarTest, selectByMask)
 {
-    EXPECT_EQ(real(5.0), selectByMask(real(5.0), true));
-    EXPECT_EQ(real(0.0), selectByMask(real(5.0), false));
+    EXPECT_EQ(c1, selectByMask(c1, true));
+    EXPECT_EQ(czero, selectByMask(c1, false));
 }
 
 TEST(SimdScalarTest, selectByNotMask)
 {
-    EXPECT_EQ(real(0.0), selectByNotMask(real(5.0), true));
-    EXPECT_EQ(real(5.0), selectByNotMask(real(5.0), false));
+    EXPECT_EQ(czero, selectByNotMask(c1, true));
+    EXPECT_EQ(c1, selectByNotMask(c1, false));
 }
 
 TEST(SimdScalarTest, blend)
 {
-    EXPECT_EQ(real(5.0), blend(real(3.0), real(5.0), true));
-    EXPECT_EQ(real(3.0), blend(real(3.0), real(5.0), false));
+    EXPECT_EQ(c2, blend(c1, c2, true));
+    EXPECT_EQ(c1, blend(c1, c2, false));
 }
 
 TEST(SimdScalarTest, cvtR2I)
index be92f2466746c554012593eb33b93e031b65cecd..df297937b31de69ed0f53dba5f2169d0e32b949f 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) 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.
@@ -44,6 +44,8 @@
 
 #include "testutils/testasserts.h"
 
+#include "data.h"
+
 namespace gmx
 {
 namespace test
@@ -66,14 +68,14 @@ namespace
 
 TEST(SimdScalarMathTest, copysign)
 {
-    EXPECT_EQ(real(-4), copysign(real(4), real(-5)));
-    EXPECT_EQ(real(5), copysign(real(5), real(2)));
+    EXPECT_EQ(real(-c1), copysign(real(c1), real(-c2)));
+    EXPECT_EQ(real(c2), copysign(real(c2), real(c3)));
 }
 
 TEST(SimdScalarMathTest, invsqrtPair)
 {
-    real x0 = 1.2345;
-    real x1 = 9.8765;
+    real x0 = c1;
+    real x1 = c2;
 
     real out0, out1;
 
@@ -85,14 +87,14 @@ TEST(SimdScalarMathTest, invsqrtPair)
 
 TEST(SimdScalarMathTest, inv)
 {
-    real x0 = 1.2345;
+    real x0 = c0;
 
     EXPECT_EQ(real(1.0)/x0, inv(x0));
 }
 
 TEST(SimdScalarMathTest, maskzInvsqrt)
 {
-    real x0 = 1.2345;
+    real x0 = c0;
 
     EXPECT_EQ(invsqrt(x0), maskzInvsqrt(x0, true));
     EXPECT_EQ(real(0), maskzInvsqrt(x0, false));
@@ -100,42 +102,42 @@ TEST(SimdScalarMathTest, maskzInvsqrt)
 
 TEST(SimdScalarMathTest, log)
 {
-    real x0 = 1.2345;
+    real x0 = c0;
 
     EXPECT_EQ(std::log(x0), log(x0));
 }
 
 TEST(SimdScalarMathTest, exp2)
 {
-    real x0 = 1.2345;
+    real x0 = c0;
 
     EXPECT_EQ(std::exp2(x0), exp2(x0));
 }
 
 TEST(SimdScalarMathTest, exp)
 {
-    real x0 = 1.2345;
+    real x0 = c0;
 
     EXPECT_EQ(std::exp(x0), exp(x0));
 }
 
 TEST(SimdScalarMathTest, erf)
 {
-    real x0 = 0.51256;
+    real x0 = c0;
 
     EXPECT_EQ(std::erf(x0), erf(x0));
 }
 
 TEST(SimdScalarMathTest, erfc)
 {
-    real x0 = 0.51256;
+    real x0 = c0;
 
     EXPECT_EQ(std::erfc(x0), erfc(x0));
 }
 
 TEST(SimdScalarMathTest, sincos)
 {
-    real x0 = 0.51256;
+    real x0 = c0;
     real s, c;
 
     sincos(x0, &s, &c);
@@ -146,21 +148,21 @@ TEST(SimdScalarMathTest, sincos)
 
 TEST(SimdScalarMathTest, sin)
 {
-    real x0 = 0.51256;
+    real x0 = c0;
 
     EXPECT_EQ(std::sin(x0), sin(x0));
 }
 
 TEST(SimdScalarMathTest, cos)
 {
-    real x0 = 0.51256;
+    real x0 = c0;
 
     EXPECT_EQ(std::cos(x0), cos(x0));
 }
 
 TEST(SimdScalarMathTest, tan)
 {
-    real x0 = 0.51256;
+    real x0 = c0;
 
     EXPECT_EQ(std::tan(x0), tan(x0));
 }
@@ -168,29 +170,29 @@ TEST(SimdScalarMathTest, tan)
 
 TEST(SimdScalarMathTest, asin)
 {
-    real x0 = 0.51256;
+    real x0 = c0;
 
     EXPECT_EQ(std::asin(x0), asin(x0));
 }
 
 TEST(SimdScalarMathTest, acos)
 {
-    real x0 = 0.51256;
+    real x0 = c0;
 
     EXPECT_EQ(std::acos(x0), acos(x0));
 }
 
 TEST(SimdScalarMathTest, atan)
 {
-    real x0 = 0.51256;
+    real x0 = c0;
 
     EXPECT_EQ(std::atan(x0), atan(x0));
 }
 
 TEST(SimdScalarMathTest, atan2)
 {
-    real x = 0.5;
-    real y = std::sqrt(0.75);
+    real x = c0;
+    real y = std::sqrt(c0);
 
 
     EXPECT_EQ(std::atan2(y, x), atan2(y, x));
@@ -198,7 +200,7 @@ TEST(SimdScalarMathTest, atan2)
 
 TEST(SimdScalarMathTest, pmeForceCorrection)
 {
-    real z2 = 0.51256;
+    real z2 = c0;
 
     // Calculate reference value for z2!=0
     real z   = std::sqrt(z2);
@@ -216,7 +218,7 @@ TEST(SimdScalarMathTest, pmeForceCorrection)
 
 TEST(SimdScalarMathTest, pmePotentialCorrection)
 {
-    real z2 = 0.51256;
+    real z2 = c0;
 
     // Calculate reference value for z2!=0
     real z   = std::sqrt(z2);
@@ -238,8 +240,8 @@ TEST(SimdScalarMathTest, pmePotentialCorrection)
 
 TEST(SimdScalarMathTest, invsqrtPairSingleAccuracy)
 {
-    double x0 = 1.2345;
-    double x1 = 9.8765;
+    double x0 = c1;
+    double x1 = c2;
 
     double out0, out1;
 
@@ -251,7 +253,7 @@ TEST(SimdScalarMathTest, invsqrtPairSingleAccuracy)
 
 TEST(SimdScalarMathTest, invSingleAccuracy)
 {
-    double x0 = 1.2345;
+    double x0 = c1;
 
     EXPECT_EQ(1.0f/static_cast<float>(x0),
               static_cast<float>(invSingleAccuracy(x0)));
@@ -259,7 +261,7 @@ TEST(SimdScalarMathTest, invSingleAccuracy)
 
 TEST(SimdScalarMathTest, maskzInvsqrtSingleAccuracy)
 {
-    double x0 = 1.2345;
+    double x0 = c1;
 
     EXPECT_EQ(invsqrt(static_cast<float>(x0)),
               static_cast<float>(maskzInvsqrtSingleAccuracy(x0, true)));
@@ -269,7 +271,7 @@ TEST(SimdScalarMathTest, maskzInvsqrtSingleAccuracy)
 
 TEST(SimdScalarMathTest, logSingleAccuracy)
 {
-    double x0 = 1.2345;
+    double x0 = c1;
 
     EXPECT_EQ(std::log(static_cast<float>(x0)),
               static_cast<float>(logSingleAccuracy(x0)));
@@ -277,7 +279,7 @@ TEST(SimdScalarMathTest, logSingleAccuracy)
 
 TEST(SimdScalarMathTest, exp2SingleAccuracy)
 {
-    double x0 = 1.2345;
+    double x0 = c1;
 
     EXPECT_EQ(std::exp2(static_cast<float>(x0)),
               static_cast<float>(exp2SingleAccuracy(x0)));
@@ -285,7 +287,7 @@ TEST(SimdScalarMathTest, exp2SingleAccuracy)
 
 TEST(SimdScalarMathTest, expSingleAccuracy)
 {
-    double x0 = 1.2345;
+    double x0 = c1;
 
     EXPECT_EQ(std::exp(static_cast<float>(x0)),
               static_cast<float>(expSingleAccuracy(x0)));
@@ -293,21 +295,21 @@ TEST(SimdScalarMathTest, expSingleAccuracy)
 
 TEST(SimdScalarMathTest, erfSingleAccuracy)
 {
-    double x0 = 0.51256;
+    double x0 = c0;
 
     EXPECT_EQ(std::erf(static_cast<float>(x0)), static_cast<float>(erfSingleAccuracy(x0)));
 }
 
 TEST(SimdScalarMathTest, erfcSingleAccuracy)
 {
-    double x0 = 0.51256;
+    double x0 = c0;
 
     EXPECT_EQ(std::erfc(static_cast<float>(x0)), static_cast<float>(erfcSingleAccuracy(x0)));
 }
 
 TEST(SimdScalarMathTest, sincosSingleAccuracy)
 {
-    double x0 = 0.51256;
+    double x0 = c0;
     double s, c;
 
     sincosSingleAccuracy(x0, &s, &c);
@@ -318,7 +320,7 @@ TEST(SimdScalarMathTest, sincosSingleAccuracy)
 
 TEST(SimdScalarMathTest, sinSingleAccuracy)
 {
-    double x0 = 0.51256;
+    double x0 = c0;
 
     EXPECT_EQ(std::sin(static_cast<float>(x0)),
               static_cast<float>(sinSingleAccuracy(x0)));
@@ -326,7 +328,7 @@ TEST(SimdScalarMathTest, sinSingleAccuracy)
 
 TEST(SimdScalarMathTest, cosSingleAccuracy)
 {
-    double x0 = 0.51256;
+    double x0 = c0;
 
     EXPECT_EQ(std::cos(static_cast<float>(x0)),
               static_cast<float>(cosSingleAccuracy(x0)));
@@ -334,7 +336,7 @@ TEST(SimdScalarMathTest, cosSingleAccuracy)
 
 TEST(SimdScalarMathTest, tanSingleAccuracy)
 {
-    double x0 = 0.51256;
+    double x0 = c0;
 
     EXPECT_EQ(std::tan(static_cast<float>(x0)),
               static_cast<float>(tanSingleAccuracy(x0)));
@@ -343,7 +345,7 @@ TEST(SimdScalarMathTest, tanSingleAccuracy)
 
 TEST(SimdScalarMathTest, asinSingleAccuracy)
 {
-    double x0 = 0.51256;
+    double x0 = c0;
 
     EXPECT_EQ(std::asin(static_cast<float>(x0)),
               static_cast<float>(asinSingleAccuracy(x0)));
@@ -351,7 +353,7 @@ TEST(SimdScalarMathTest, asinSingleAccuracy)
 
 TEST(SimdScalarMathTest, acosSingleAccuracy)
 {
-    double x0 = 0.51256;
+    double x0 = c0;
 
     EXPECT_EQ(std::acos(static_cast<float>(x0)),
               static_cast<float>(acosSingleAccuracy(x0)));
@@ -359,7 +361,7 @@ TEST(SimdScalarMathTest, acosSingleAccuracy)
 
 TEST(SimdScalarMathTest, atanSingleAccuracy)
 {
-    double x0 = 0.51256;
+    double x0 = c0;
 
     EXPECT_EQ(std::atan(static_cast<float>(x0)),
               static_cast<float>(atanSingleAccuracy(x0)));
@@ -367,8 +369,8 @@ TEST(SimdScalarMathTest, atanSingleAccuracy)
 
 TEST(SimdScalarMathTest, atan2SingleAccuracy)
 {
-    double x = 0.5;
-    double y = std::sqrt(0.75);
+    double x = c0;
+    double y = std::sqrt(c0);
 
 
     EXPECT_EQ(std::atan2(static_cast<float>(y), static_cast<float>(x)),
@@ -377,7 +379,7 @@ TEST(SimdScalarMathTest, atan2SingleAccuracy)
 
 TEST(SimdScalarMathTest, pmeForceCorrectionSingleAccuracy)
 {
-    double z2 = 0.51256;
+    double z2 = c0;
 
     // Calculate reference value for z2!=0 in single precision
     float z   = std::sqrt(static_cast<float>(z2));
@@ -391,7 +393,7 @@ TEST(SimdScalarMathTest, pmeForceCorrectionSingleAccuracy)
 
 TEST(SimdScalarMathTest, pmePotentialCorrectionSingleAccuracy)
 {
-    double z2 = 0.51256;
+    double z2 = c0;
 
     // Calculate reference value for z2!=0 in single precision
     float z   = std::sqrt(static_cast<float>(z2));
index daf1e87a3e1dfaad47deace25451992dcd5e0413..76e64c78a80825e9d25defd15a5519384171392f 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) 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.
 #include "gromacs/simd/simd.h"
 #include "gromacs/utility/basedefinitions.h"
 
+#include "testutils/testasserts.h"
+
+#include "data.h"
+
 namespace gmx
 {
 namespace test
@@ -55,7 +59,7 @@ namespace
 
 TEST(SimdScalarUtilTest, gatherLoadTranspose)
 {
-    real         data[8] = {1, 2, 3, 4, 5, 6, 7, 8};
+    real         data[8] = {c0, c1, c2, c3, c4, c5, c6, c7};
     std::int32_t offset  = 1;
     real         v0, v1, v2, v3;
 
@@ -74,7 +78,7 @@ TEST(SimdScalarUtilTest, gatherLoadTranspose)
 
 TEST(SimdScalarUtilTest, gatherLoadUTranspose)
 {
-    real         data[6] = {1, 2, 3, 4, 5, 6};
+    real         data[6] = {c0, c1, c2, c3, c4, c5};
     std::int32_t offset  = 1;
     real         v0, v1, v2;
 
@@ -95,33 +99,33 @@ TEST(SimdScalarUtilTest, transposeScatterStoreU)
 
     transposeScatterStoreU<3>(data, &offset, v0, v1, v2);
 
-    EXPECT_EQ(real(0.0), data[0]);
-    EXPECT_EQ(real(0.0), data[1]);
-    EXPECT_EQ(real(0.0), data[2]);
+    EXPECT_EQ(czero, data[0]);
+    EXPECT_EQ(czero, data[1]);
+    EXPECT_EQ(czero, data[2]);
     EXPECT_EQ(v0, data[3]);
     EXPECT_EQ(v1, data[4]);
     EXPECT_EQ(v2, data[5]);
-    EXPECT_EQ(real(0.0), data[6]);
-    EXPECT_EQ(real(0.0), data[7]);
-    EXPECT_EQ(real(0.0), data[8]);
+    EXPECT_EQ(czero, data[6]);
+    EXPECT_EQ(czero, data[7]);
+    EXPECT_EQ(czero, data[8]);
 }
 
 TEST(SimdScalarUtilTest, transposeScatterIncrU)
 {
     real         data[9] = {10, 20, 30, 40, 50, 60, 70, 80, 90};
     std::int32_t offset  = 1;
-    real         v0      = 1;
-    real         v1      = 2;
-    real         v2      = 3;
+    real         v0      = c1;
+    real         v1      = c2;
+    real         v2      = c3;
 
     transposeScatterIncrU<3>(data, &offset, v0, v1, v2);
 
     EXPECT_EQ(real(10), data[0]);
     EXPECT_EQ(real(20), data[1]);
     EXPECT_EQ(real(30), data[2]);
-    EXPECT_EQ(real(41), data[3]);
-    EXPECT_EQ(real(52), data[4]);
-    EXPECT_EQ(real(63), data[5]);
+    EXPECT_EQ(real(40+c1), data[3]);
+    EXPECT_EQ(real(50+c2), data[4]);
+    EXPECT_EQ(real(60+c3), data[5]);
     EXPECT_EQ(real(70), data[6]);
     EXPECT_EQ(real(80), data[7]);
     EXPECT_EQ(real(90), data[8]);
@@ -131,18 +135,18 @@ TEST(SimdScalarUtilTest, transposeScatterDecrU)
 {
     real         data[9] = {10, 20, 30, 40, 50, 60, 70, 80, 90};
     std::int32_t offset  = 1;
-    real         v0      = 1;
-    real         v1      = 2;
-    real         v2      = 3;
+    real         v0      = c1;
+    real         v1      = c2;
+    real         v2      = c3;
 
     transposeScatterDecrU<3>(data, &offset, v0, v1, v2);
 
     EXPECT_EQ(real(10), data[0]);
     EXPECT_EQ(real(20), data[1]);
     EXPECT_EQ(real(30), data[2]);
-    EXPECT_EQ(real(39), data[3]);
-    EXPECT_EQ(real(48), data[4]);
-    EXPECT_EQ(real(57), data[5]);
+    EXPECT_EQ(real(40-c1), data[3]);
+    EXPECT_EQ(real(50-c2), data[4]);
+    EXPECT_EQ(real(60-c3), data[5]);
     EXPECT_EQ(real(70), data[6]);
     EXPECT_EQ(real(80), data[7]);
     EXPECT_EQ(real(90), data[8]);
@@ -151,7 +155,7 @@ TEST(SimdScalarUtilTest, transposeScatterDecrU)
 
 TEST(SimdScalarTest, expandScalarsToTriplets)
 {
-    real scalar = 1.234;
+    real scalar = c1;
     real t0, t1, t2;
 
     expandScalarsToTriplets(scalar, &t0, &t1, &t2);
@@ -163,7 +167,7 @@ TEST(SimdScalarTest, expandScalarsToTriplets)
 
 TEST(SimdScalarUtilTest, gatherLoadBySimdIntTranspose)
 {
-    real         data[8] = {1, 2, 3, 4, 5, 6, 7, 8};
+    real         data[8] = {c0, c1, c2, c3, c4, c5, c6, c7};
     std::int32_t offset  = 1;
     real         v0, v1, v2, v3;
 
@@ -182,7 +186,7 @@ TEST(SimdScalarUtilTest, gatherLoadBySimdIntTranspose)
 
 TEST(SimdScalarUtilTest, gatherLoadUBySimdIntTranspose)
 {
-    real         data[8] = {1, 2, 3, 4, 5, 6, 7, 8};
+    real         data[8] = {c0, c1, c2, c3, c4, c5, c6, c7};
     std::int32_t offset  = 1;
     real         v0, v1;
 
@@ -195,22 +199,22 @@ TEST(SimdScalarUtilTest, gatherLoadUBySimdIntTranspose)
 TEST(SimdScalarUtilTest, reduceIncr4ReturnSum)
 {
     real data[6] = {0, 0, 0, 0, 0, 0};
-    real v0      = 1;
-    real v1      = 2;
-    real v2      = 3;
-    real v3      = 4;
+    real v0      = c1;
+    real v1      = c2;
+    real v2      = c3;
+    real v3      = c4;
     real sum;
 
     sum = reduceIncr4ReturnSum(data+1, v0, v1, v2, v3);
 
-    EXPECT_EQ(real(0.0), data[0]);
+    EXPECT_EQ(czero, data[0]);
     EXPECT_EQ(v0, data[1]);
     EXPECT_EQ(v1, data[2]);
     EXPECT_EQ(v2, data[3]);
     EXPECT_EQ(v3, data[4]);
-    EXPECT_EQ(real(0.0), data[5]);
+    EXPECT_EQ(czero, data[5]);
 
-    EXPECT_EQ(real(v0+v1+v2+v3), sum);
+    EXPECT_REAL_EQ_TOL(real(v0+v1+v2+v3), sum, defaultRealTolerance());
 }
 
 /*! \} */
index dd56b0d4255a61e064b34bba98986bb894f91f24..6aa0fa04ff311658760d41b9d77ebf203ca1ebfc 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) 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.
@@ -64,29 +64,48 @@ namespace test
  * them in a single place makes sure they are consistent.
  */
 #if GMX_SIMD_HAVE_REAL
-const SimdReal rSimd_1_2_3    = setSimdRealFrom3R(1, 2, 3);
-const SimdReal rSimd_4_5_6    = setSimdRealFrom3R(4, 5, 6);
-const SimdReal rSimd_7_8_9    = setSimdRealFrom3R(7, 8, 9);
-const SimdReal rSimd_5_7_9    = setSimdRealFrom3R(5, 7, 9);
-const SimdReal rSimd_m1_m2_m3 = setSimdRealFrom3R(-1, -2, -3);
-const SimdReal rSimd_3_1_4    = setSimdRealFrom3R(3, 1, 4);
-const SimdReal rSimd_m3_m1_m4 = setSimdRealFrom3R(-3, -1, -4);
-const SimdReal rSimd_2p25     = setSimdRealFrom1R(2.25);
-const SimdReal rSimd_3p25     = setSimdRealFrom1R(3.25);
-const SimdReal rSimd_3p75     = setSimdRealFrom1R(3.75);
+const SimdReal rSimd_c0c1c2 = setSimdRealFrom3R( c0, c1, c2);
+const SimdReal rSimd_c3c4c5 = setSimdRealFrom3R( c3, c4, c5);
+const SimdReal rSimd_c6c7c8 = setSimdRealFrom3R( c6, c7, c8);
+const SimdReal rSimd_c3c0c4 = setSimdRealFrom3R( c3, c0, c4);
+const SimdReal rSimd_c4c6c8 = setSimdRealFrom3R( c4, c6, c8);
+const SimdReal rSimd_c7c2c3 = setSimdRealFrom3R( c7, c2, c3);
+const SimdReal rSimd_m0m1m2 = setSimdRealFrom3R(-c0, -c1, -c2);
+const SimdReal rSimd_m3m0m4 = setSimdRealFrom3R(-c3, -c0, -c4);
+
+const SimdReal rSimd_2p25     = setSimdRealFrom1R( 2.25);
+const SimdReal rSimd_3p25     = setSimdRealFrom1R( 3.25);
+const SimdReal rSimd_3p75     = setSimdRealFrom1R( 3.75);
 const SimdReal rSimd_m2p25    = setSimdRealFrom1R(-2.25);
 const SimdReal rSimd_m3p25    = setSimdRealFrom1R(-3.25);
 const SimdReal rSimd_m3p75    = setSimdRealFrom1R(-3.75);
 const SimdReal rSimd_Exp      = setSimdRealFrom3R( 1.4055235171027452623914516e+18,
                                                    5.3057102734253445623914516e-13,
                                                    -2.1057102745623934534514516e+16);
-#    if GMX_SIMD_HAVE_DOUBLE && GMX_DOUBLE
+#if GMX_SIMD_HAVE_DOUBLE && GMX_DOUBLE
 // Make sure we also test exponents outside single precision when we use double
 const SimdReal rSimd_ExpDouble = setSimdRealFrom3R( 6.287393598732017379054414e+176,
                                                     8.794495252903116023030553e-140,
                                                     -3.637060701570496477655022e+202);
-#    endif
-#endif  // GMX_SIMD_HAVE_REAL
+#endif  // GMX_SIMD_HAVE_DOUBLE && GMX_DOUBLE
+
+#if GMX_SIMD_HAVE_LOGICAL
+// The numbers below all have exponent (2^0), which will not change with AND/OR operations.
+// We also leave the last part of the mantissa as zeros, to avoid rounding issues in the compiler
+#if GMX_DOUBLE
+const SimdReal rSimd_logicalA         = setSimdRealFrom1R(1.3333333332557231188); // mantissa 01010101010101010101010101010101
+const SimdReal rSimd_logicalB         = setSimdRealFrom1R(1.7999999998137354851); // mantissa 11001100110011001100110011001100
+const SimdReal rSimd_logicalResultAnd = setSimdRealFrom1R(1.266666666604578495);  // mantissa 01000100010001000100010001000100
+const SimdReal rSimd_logicalResultOr  = setSimdRealFrom1R(1.8666666664648801088); // mantissa 11011101110111011101110111011101
+#else                                                                             // GMX_DOUBLE
+const SimdReal rSimd_logicalA         = setSimdRealFrom1R(1.3333282470703125);    // mantissa 0101010101010101
+const SimdReal rSimd_logicalB         = setSimdRealFrom1R(1.79998779296875);      // mantissa 1100110011001100
+const SimdReal rSimd_logicalResultAnd = setSimdRealFrom1R(1.26666259765625);      // mantissa 0100010001000100
+const SimdReal rSimd_logicalResultOr  = setSimdRealFrom1R(1.8666534423828125);    // mantissa 1101110111011101
+#endif                                                                            // GMX_DOUBLE
+#endif                                                                            // GMX_SIMD_HAVE_LOGICAL
+
+#endif                                                                            // GMX_SIMD_HAVE_REAL
 #if GMX_SIMD_HAVE_INT32_ARITHMETICS
 const SimdInt32 iSimd_1_2_3      = setSimdIntFrom3I(1, 2, 3);
 const SimdInt32 iSimd_4_5_6      = setSimdIntFrom3I(4, 5, 6);
index 978a3dfa2da45874e088a57003c7552dc93c0450..f4aac8d657cdd8839d7c00df6aae367fdb4ad6c9 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) 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.
@@ -81,6 +81,7 @@
 #include "gromacs/simd/simd.h"
 
 #include "base.h"
+#include "data.h"
 
 #if GMX_SIMD
 
@@ -108,13 +109,15 @@ namespace test
  * them in a single place makes sure they are consistent.
  */
 #if GMX_SIMD_HAVE_REAL
-extern const SimdReal rSimd_1_2_3;     //!< Generic (different) fp values.
-extern const SimdReal rSimd_4_5_6;     //!< Generic (different) fp values.
-extern const SimdReal rSimd_7_8_9;     //!< Generic (different) fp values.
-extern const SimdReal rSimd_5_7_9;     //!< rSimd_1_2_3 + rSimd_4_5_6.
-extern const SimdReal rSimd_m1_m2_m3;  //!< Generic negative floating-point values.
-extern const SimdReal rSimd_3_1_4;     //!< Used to test min/max.
-extern const SimdReal rSimd_m3_m1_m4;  //!< negative rSimd_3_1_4.
+extern const SimdReal rSimd_c0c1c2;    //!< c0,c1,c2 repeated
+extern const SimdReal rSimd_c3c4c5;    //!< c3,c4,c5 repeated
+extern const SimdReal rSimd_c6c7c8;    //!< c6,c7,c8 repeated
+extern const SimdReal rSimd_c3c0c4;    //!< c3,c0,c4 repeated
+extern const SimdReal rSimd_c4c6c8;    //!< c4,c6,c8 repeated
+extern const SimdReal rSimd_c7c2c3;    //!< c7,c2,c3 repeated
+extern const SimdReal rSimd_m0m1m2;    //!< -c0,-c1,-c2 repeated
+extern const SimdReal rSimd_m3m0m4;    //!< -c3,-c0,-c4 repeated
+
 extern const SimdReal rSimd_2p25;      //!< Value that rounds down.
 extern const SimdReal rSimd_3p25;      //!< Value that rounds down.
 extern const SimdReal rSimd_3p75;      //!< Value that rounds up.
@@ -123,6 +126,14 @@ extern const SimdReal rSimd_m3p25;     //!< Negative value that rounds up.
 extern const SimdReal rSimd_m3p75;     //!< Negative value that rounds down.
 //! Three large floating-point values whose exponents are >32.
 extern const SimdReal rSimd_Exp;
+
+#if GMX_SIMD_HAVE_LOGICAL
+extern const SimdReal rSimd_logicalA;         //!< Bit pattern to test logical ops
+extern const SimdReal rSimd_logicalB;         //!< Bit pattern to test logical ops
+extern const SimdReal rSimd_logicalResultOr;  //!< Result or bitwise 'or' of A and B
+extern const SimdReal rSimd_logicalResultAnd; //!< Result or bitwise 'and' of A and B
+#endif                                        // GMX_SIMD_HAVE_LOGICAL
+
 #    if GMX_SIMD_HAVE_DOUBLE && GMX_DOUBLE
 // Make sure we also test exponents outside single precision when we use double
 extern const SimdReal rSimd_ExpDouble;
index c50f8db6a2f99ad46043578d796b569b3753d3a0..edb66badf06bc5dceca67bfb37352965ee630b5d 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,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.
@@ -39,6 +39,8 @@
 #include "gromacs/simd/simd.h"
 #include "gromacs/utility/basedefinitions.h"
 
+#include "data.h"
+
 #if GMX_SIMD
 
 namespace gmx
@@ -52,26 +54,34 @@ namespace test
 
 #if GMX_SIMD4_HAVE_REAL
 
-const Simd4Real rSimd4_1_2_3    = setSimd4RealFrom3R(1, 2, 3);
-const Simd4Real rSimd4_4_5_6    = setSimd4RealFrom3R(4, 5, 6);
-const Simd4Real rSimd4_7_8_9    = setSimd4RealFrom3R(7, 8, 9);
-const Simd4Real rSimd4_5_7_9    = setSimd4RealFrom3R(5, 7, 9);
-const Simd4Real rSimd4_m1_m2_m3 = setSimd4RealFrom3R(-1, -2, -3);
-const Simd4Real rSimd4_3_1_4    = setSimd4RealFrom3R(3, 1, 4);
-const Simd4Real rSimd4_m3_m1_m4 = setSimd4RealFrom3R(-3, -1, -4);
+const Simd4Real rSimd4_c0c1c2   = setSimd4RealFrom3R( c0, c1, c2);
+const Simd4Real rSimd4_c3c4c5   = setSimd4RealFrom3R( c3, c4, c5);
+const Simd4Real rSimd4_c6c7c8   = setSimd4RealFrom3R( c6, c7, c8);
+const Simd4Real rSimd4_c3c0c4   = setSimd4RealFrom3R( c3, c0, c4);
+const Simd4Real rSimd4_c4c6c8   = setSimd4RealFrom3R( c4, c6, c8);
+const Simd4Real rSimd4_c7c2c3   = setSimd4RealFrom3R( c7, c2, c3);
+const Simd4Real rSimd4_m0m1m2   = setSimd4RealFrom3R(-c0, -c1, -c2);
+const Simd4Real rSimd4_m3m0m4   = setSimd4RealFrom3R(-c3, -c0, -c4);
 const Simd4Real rSimd4_2p25     = setSimd4RealFrom1R(2.25);
 const Simd4Real rSimd4_3p75     = setSimd4RealFrom1R(3.75);
 const Simd4Real rSimd4_m2p25    = setSimd4RealFrom1R(-2.25);
 const Simd4Real rSimd4_m3p75    = setSimd4RealFrom1R(-3.75);
-const Simd4Real rSimd4_Exp      = setSimd4RealFrom3R( 1.4055235171027452623914516e+18,
-                                                      5.3057102734253445623914516e-13,
-                                                      -2.1057102745623934534514516e+16);
-#    if GMX_SIMD_HAVE_DOUBLE && GMX_DOUBLE
-// Make sure we also test exponents outside single precision when we use double
-const Simd4Real  rSimd_ExpDouble = setSimd4RealFrom3R( 6.287393598732017379054414e+176,
-                                                       8.794495252903116023030553e-140,
-                                                       -3.637060701570496477655022e+202);
-#    endif
+
+#if GMX_SIMD_HAVE_LOGICAL
+// The numbers below all have exponent (2^0), which will not change with AND/OR operations.
+// We also leave the last part of the mantissa as zeros, to avoid rounding issues in the compiler
+#if GMX_DOUBLE
+const Simd4Real rSimd4_logicalA         = setSimd4RealFrom1R(1.3333333332557231188); // mantissa 01010101010101010101010101010101
+const Simd4Real rSimd4_logicalB         = setSimd4RealFrom1R(1.7999999998137354851); // mantissa 11001100110011001100110011001100
+const Simd4Real rSimd4_logicalResultAnd = setSimd4RealFrom1R(1.266666666604578495);  // mantissa 01000100010001000100010001000100
+const Simd4Real rSimd4_logicalResultOr  = setSimd4RealFrom1R(1.8666666664648801088); // mantissa 11011101110111011101110111011101
+#else                                                                                // GMX_DOUBLE
+const Simd4Real rSimd4_logicalA         = setSimd4RealFrom1R(1.3333282470703125);    // mantissa 0101010101010101
+const Simd4Real rSimd4_logicalB         = setSimd4RealFrom1R(1.79998779296875);      // mantissa 1100110011001100
+const Simd4Real rSimd4_logicalResultAnd = setSimd4RealFrom1R(1.26666259765625);      // mantissa 0100010001000100
+const Simd4Real rSimd4_logicalResultOr  = setSimd4RealFrom1R(1.8666534423828125);    // mantissa 1101110111011101
+#endif                                                                               // GMX_DOUBLE
+#endif                                                                               // GMX_SIMD_HAVE_LOGICAL
 
 ::std::vector<real>
 simd4Real2Vector(const Simd4Real simd4)
index 4432227cf75368ae766f648bb5339ff8c5905795..4d4eecde531a5b824ff9d4edb2a7a1cb89b6f5c3 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,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.
@@ -54,6 +54,7 @@
 #include "gromacs/simd/simd.h"
 
 #include "base.h"
+#include "data.h"
 
 #if GMX_SIMD
 
@@ -67,29 +68,34 @@ namespace test
 /*! \{ */
 
 #if GMX_SIMD4_HAVE_REAL
-extern const Simd4Real rSimd4_1_2_3;     //!< Generic (different) fp values.
-extern const Simd4Real rSimd4_4_5_6;     //!< Generic (different) fp values.
-extern const Simd4Real rSimd4_7_8_9;     //!< Generic (different) fp values.
-extern const Simd4Real rSimd4_5_7_9;     //!< rSimd_1_2_3 + rSimd_4_5_6.
-extern const Simd4Real rSimd4_m1_m2_m3;  //!< Generic negative fp values.
-extern const Simd4Real rSimd4_3_1_4;     //!< Used to test min/max.
-extern const Simd4Real rSimd4_m3_m1_m4;  //!< negative rSimd_3_1_4.
+extern const Simd4Real rSimd4_c0c1c2;    //!< c0,c1,c2 repeated
+extern const Simd4Real rSimd4_c3c4c5;    //!< c3,c4,c5 repeated
+extern const Simd4Real rSimd4_c6c7c8;    //!< c6,c7,c8 repeated
+extern const Simd4Real rSimd4_c3c0c4;    //!< c3,c0,c4 repeated
+extern const Simd4Real rSimd4_c4c6c8;    //!< c4,c6,c8 repeated
+extern const Simd4Real rSimd4_c7c2c3;    //!< c7,c2,c3 repeated
+extern const Simd4Real rSimd4_m0m1m2;    //!< -c0,-c1,-c2 repeated
+extern const Simd4Real rSimd4_m3m0m4;    //!< -c3,-c0,-c4 repeated
 extern const Simd4Real rSimd4_2p25;      //!< Value that rounds down.
 extern const Simd4Real rSimd4_3p75;      //!< Value that rounds up.
 extern const Simd4Real rSimd4_m2p25;     //!< Negative value that rounds up.
 extern const Simd4Real rSimd4_m3p75;     //!< Negative value that rounds down.
 //! Three large floating-point values whose exponents are >32.
 extern const Simd4Real rSimd4_Exp;
-#    if GMX_SIMD_HAVE_DOUBLE && GMX_DOUBLE
-// Make sure we also test exponents outside single precision when we use double
-extern const Simd4Real rSimd4_ExpDouble;
-#    endif
-extern const Simd4Real rSimd4_Bits1; //!< Pattern F0 repeated to fill single/double.
-extern const Simd4Real rSimd4_Bits2; //!< Pattern CC repeated to fill single/double.
-extern const Simd4Real rSimd4_Bits3; //!< Pattern C0 repeated to fill single/double.
-extern const Simd4Real rSimd4_Bits4; //!< Pattern 0C repeated to fill single/double.
-extern const Simd4Real rSimd4_Bits5; //!< Pattern FC repeated to fill single/double.
-extern const Simd4Real rSimd4_Bits6; //!< Pattern 3C repeated to fill single/double.
+
+#if GMX_SIMD_HAVE_LOGICAL
+extern const Simd4Real rSimd4_logicalA;         //!< Bit pattern to test logical ops
+extern const Simd4Real rSimd4_logicalB;         //!< Bit pattern to test logical ops
+extern const Simd4Real rSimd4_logicalResultOr;  //!< Result or bitwise 'or' of A and B
+extern const Simd4Real rSimd4_logicalResultAnd; //!< Result or bitwise 'and' of A and B
+#endif                                          // GMX_SIMD_HAVE_LOGICAL
+
+extern const Simd4Real rSimd4_Bits1;            //!< Pattern F0 repeated to fill single/double.
+extern const Simd4Real rSimd4_Bits2;            //!< Pattern CC repeated to fill single/double.
+extern const Simd4Real rSimd4_Bits3;            //!< Pattern C0 repeated to fill single/double.
+extern const Simd4Real rSimd4_Bits4;            //!< Pattern 0C repeated to fill single/double.
+extern const Simd4Real rSimd4_Bits5;            //!< Pattern FC repeated to fill single/double.
+extern const Simd4Real rSimd4_Bits6;            //!< Pattern 3C repeated to fill single/double.
 
 /*! \internal
  * \brief
index 3705aab566b99c524fd2a83f2fdf1fe2fbbdc171..b2300ec8be733abe5c03a77103b17332224c47ad 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) 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.
@@ -40,6 +40,9 @@
 #include "gromacs/simd/simd.h"
 #include "gromacs/utility/basedefinitions.h"
 
+#include "testutils/testasserts.h"
+
+#include "data.h"
 #include "simd4.h"
 
 #if GMX_SIMD
@@ -67,75 +70,79 @@ TEST_F(Simd4FloatingpointTest, setZero)
 
 TEST_F(Simd4FloatingpointTest, set)
 {
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom1R(1.0), Simd4Real(1.0));
+    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom1R(c1), Simd4Real(c1));
 }
 
 TEST_F(Simd4FloatingpointTest, add)
 {
-    GMX_EXPECT_SIMD4_REAL_EQ(rSimd4_5_7_9, rSimd4_1_2_3 + rSimd4_4_5_6); // 1+4=5, 2+5=7, 3+6=9
+    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(c0 + c3, c1 + c4, c2 + c5 ),
+                             rSimd4_c0c1c2 + rSimd4_c3c4c5);
+
 }
 
 TEST_F(Simd4FloatingpointTest, sub)
 {
-    GMX_EXPECT_SIMD4_REAL_EQ(rSimd4_4_5_6, rSimd4_5_7_9 - rSimd4_1_2_3); // 5-1=4, 7-2=5, 9-3=6
+    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(c0 - c3, c1 - c4, c2 - c5 ),
+                             rSimd4_c0c1c2 - rSimd4_c3c4c5);
 }
 
 TEST_F(Simd4FloatingpointTest, mul)
 {
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(4, 10, 18), rSimd4_1_2_3 * rSimd4_4_5_6);
+    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(c0 * c3, c1 * c4, c2 * c5 ),
+                             rSimd4_c0c1c2 * rSimd4_c3c4c5);
 }
 
 TEST_F(Simd4FloatingpointTest, fma)
 {
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(11, 18, 27), fma(rSimd4_1_2_3, rSimd4_4_5_6, rSimd4_7_8_9)); // 1*4+7, etc.
+    // The last bit of FMA operations depends on hardware, so we don't require exact match
+    GMX_EXPECT_SIMD4_REAL_NEAR(setSimd4RealFrom3R(c0 * c3 + c6, c1 * c4 + c7, c2 * c5 + c8),
+                               fma(rSimd4_c0c1c2, rSimd4_c3c4c5, rSimd4_c6c7c8));
 }
 
 TEST_F(Simd4FloatingpointTest, fms)
 {
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(-3, 2, 9), fms(rSimd4_1_2_3, rSimd4_4_5_6, rSimd4_7_8_9)); // 1*4-7, etc.
+    // The last bit of FMA operations depends on hardware, so we don't require exact match
+    GMX_EXPECT_SIMD4_REAL_NEAR(setSimd4RealFrom3R(c0 * c3 - c6, c1 * c4 - c7, c2 * c5 - c8),
+                               fms(rSimd4_c0c1c2, rSimd4_c3c4c5, rSimd4_c6c7c8));
 }
 
 TEST_F(Simd4FloatingpointTest, fnma)
 {
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(3, -2, -9), fnma(rSimd4_1_2_3, rSimd4_4_5_6, rSimd4_7_8_9)); // -1*4+7, etc.
+    // The last bit of FMA operations depends on hardware, so we don't require exact match
+    GMX_EXPECT_SIMD4_REAL_NEAR(setSimd4RealFrom3R(c6 - c0 * c3, c7 - c1 * c4, c8 - c2 * c5),
+                               fnma(rSimd4_c0c1c2, rSimd4_c3c4c5, rSimd4_c6c7c8));
 }
 
 TEST_F(Simd4FloatingpointTest, fnms)
 {
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(-11, -18, -27), fnms(rSimd4_1_2_3, rSimd4_4_5_6, rSimd4_7_8_9)); // -1*4-7, etc.
+    // The last bit of FMA operations depends on hardware, so we don't require exact match
+    GMX_EXPECT_SIMD4_REAL_NEAR(setSimd4RealFrom3R(-c0 * c3 - c6, -c1 * c4 - c7, -c2 * c5 - c8),
+                               fnms(rSimd4_c0c1c2, rSimd4_c3c4c5, rSimd4_c6c7c8));
 }
 
 TEST_F(Simd4FloatingpointTest, abs)
 {
-    GMX_EXPECT_SIMD4_REAL_EQ(rSimd4_1_2_3, abs(rSimd4_1_2_3));    // fabs(x)=x
-    GMX_EXPECT_SIMD4_REAL_EQ(rSimd4_1_2_3, abs(rSimd4_m1_m2_m3)); // fabs(-x)=x
+    GMX_EXPECT_SIMD4_REAL_EQ(rSimd4_c0c1c2, abs(rSimd4_c0c1c2)); // fabs(x)=x
+    GMX_EXPECT_SIMD4_REAL_EQ(rSimd4_c0c1c2, abs(rSimd4_m0m1m2)); // fabs(-x)=x
 }
 
 TEST_F(Simd4FloatingpointTest, neg)
 {
-    GMX_EXPECT_SIMD4_REAL_EQ(rSimd4_m1_m2_m3, -rSimd4_1_2_3);   // fneg(x)=-x
-    GMX_EXPECT_SIMD4_REAL_EQ(rSimd4_1_2_3,   -rSimd4_m1_m2_m3); // fneg(-x)=x
+    GMX_EXPECT_SIMD4_REAL_EQ(rSimd4_m0m1m2, -(rSimd4_c0c1c2)); // fneg(x)=-x
+    GMX_EXPECT_SIMD4_REAL_EQ(rSimd4_c0c1c2, -(rSimd4_m0m1m2)); // fneg(-x)=x
 }
 
 #if GMX_SIMD_HAVE_LOGICAL
-/* 1.3333282470703125 has mantissa 0101010101010101 (followed by zeros)
- * 1.79998779296875   has mantissa 1100110011001100 (followed by zeros)
- * 1.26666259765625   has mantissa 0100010001000100 (followed by zeros)
- * 1.8666534423828125 has mantissa 1101110111011101 (followed by zeros)
- *
- * Since all of them have the same exponent (2^0), the exponent will
- * not change with AND or OR operations.
- */
 TEST_F(Simd4FloatingpointTest, and)
 {
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom1R(1.26666259765625),
-                             Simd4Real(1.3333282470703125) & Simd4Real(1.79998779296875));
+    GMX_EXPECT_SIMD4_REAL_EQ(rSimd4_logicalResultAnd,
+                             (rSimd4_logicalA & rSimd4_logicalB));
 }
 
 TEST_F(Simd4FloatingpointTest, or)
 {
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom1R(1.8666534423828125),
-                             Simd4Real(1.3333282470703125) | Simd4Real(1.79998779296875));
+    GMX_EXPECT_SIMD4_REAL_EQ(rSimd4_logicalResultOr,
+                             (rSimd4_logicalA | rSimd4_logicalB));
 }
 
 TEST_F(Simd4FloatingpointTest, xor)
@@ -144,8 +151,8 @@ TEST_F(Simd4FloatingpointTest, xor)
      * in only the sign bit being set. We then use this bit change the sign of
      * different numbers.
      */
-    Simd4Real signbit = Simd4Real(1.5) ^ Simd4Real(-1.5);
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(-1, 2, -3), signbit ^ setSimd4RealFrom3R(1, -2, 3));
+    Simd4Real signbit = Simd4Real(c1) ^ Simd4Real(-c1);
+    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(-c2, c3, -c4), signbit ^ setSimd4RealFrom3R(c2, -c3, c4));
 }
 
 TEST_F(Simd4FloatingpointTest, andNot)
@@ -153,26 +160,26 @@ TEST_F(Simd4FloatingpointTest, andNot)
     /* Use xor (which we already tested, so fix that first if both tests fail)
      * to extract the sign bit, and then use andnot to take absolute values.
      */
-    Simd4Real signbit = Simd4Real(1.5) ^ Simd4Real(-1.5);
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(1, 2, 3), andNot(signbit, setSimd4RealFrom3R(-1, 2, -3)));
+    Simd4Real signbit = Simd4Real(c1) ^ Simd4Real(-c1);
+    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(c2, c3, c4), andNot(signbit, setSimd4RealFrom3R(-c2, c3, -c4)));
 }
 
 #endif
 
 TEST_F(Simd4FloatingpointTest, max)
 {
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(3, 2, 4), max(rSimd4_1_2_3, rSimd4_3_1_4));
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(3, 2, 4), max(rSimd4_3_1_4, rSimd4_1_2_3));
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(-1, -1, -3), max(rSimd4_m1_m2_m3, rSimd4_m3_m1_m4));
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(-1, -1, -3), max(rSimd4_m3_m1_m4, rSimd4_m1_m2_m3));
+    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R( c3,  c1,  c4), max(rSimd4_c0c1c2, rSimd4_c3c0c4));
+    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R( c3,  c1,  c4), max(rSimd4_c3c0c4, rSimd4_c0c1c2));
+    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(-c0, -c0, -c2), max(rSimd4_m0m1m2, rSimd4_m3m0m4));
+    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(-c0, -c0, -c2), max(rSimd4_m3m0m4, rSimd4_m0m1m2));
 }
 
 TEST_F(Simd4FloatingpointTest, min)
 {
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(1, 1, 3), min(rSimd4_1_2_3, rSimd4_3_1_4));
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(1, 1, 3), min(rSimd4_3_1_4, rSimd4_1_2_3));
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(-3, -2, -4), min(rSimd4_m1_m2_m3, rSimd4_m3_m1_m4));
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(-3, -2, -4), min(rSimd4_m3_m1_m4, rSimd4_m1_m2_m3));
+    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R( c0,  c0,  c2), min(rSimd4_c0c1c2, rSimd4_c3c0c4));
+    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R( c0,  c0,  c2), min(rSimd4_c3c0c4, rSimd4_c0c1c2));
+    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(-c3, -c1, -c4), min(rSimd4_m0m1m2, rSimd4_m3m0m4));
+    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(-c3, -c1, -c4), min(rSimd4_m3m0m4, rSimd4_m0m1m2));
 }
 
 TEST_F(Simd4FloatingpointTest, round)
@@ -214,46 +221,46 @@ TEST_F(Simd4FloatingpointTest, gmxSimd4RsqrtR)
 
 TEST_F(Simd4FloatingpointTest, cmpEqAndSelectByMask)
 {
-    Simd4Bool eq   = (rSimd4_5_7_9 == rSimd4_7_8_9);
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(0, 0, 3), selectByMask(rSimd4_1_2_3, eq));
+    Simd4Bool eq   = rSimd4_c4c6c8 == rSimd4_c6c7c8;
+    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(0, 0, c2), selectByMask(rSimd4_c0c1c2, eq));
 }
 
 TEST_F(Simd4FloatingpointTest, selectByNotMask)
 {
-    Simd4Bool eq   = (rSimd4_5_7_9 == rSimd4_7_8_9);
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(1, 2, 0), selectByNotMask(rSimd4_1_2_3, eq));
+    Simd4Bool eq   = rSimd4_c4c6c8 == rSimd4_c6c7c8;
+    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(c0, c1, 0), selectByNotMask(rSimd4_c0c1c2, eq));
 }
 
 TEST_F(Simd4FloatingpointTest, cmpNe)
 {
-    Simd4Bool eq   = (rSimd4_5_7_9 != rSimd4_7_8_9);
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(1, 2, 0), selectByMask(rSimd4_1_2_3, eq));
+    Simd4Bool eq   = rSimd4_c4c6c8 != rSimd4_c6c7c8;
+    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(c0, c1, 0), selectByMask(rSimd4_c0c1c2, eq));
 }
 
 TEST_F(Simd4FloatingpointTest, cmpLe)
 {
-    Simd4Bool le   = (rSimd4_5_7_9 <= rSimd4_7_8_9);
-    GMX_EXPECT_SIMD4_REAL_EQ(rSimd4_1_2_3, selectByMask(rSimd4_1_2_3, le));
+    Simd4Bool le   = rSimd4_c4c6c8 <= rSimd4_c6c7c8;
+    GMX_EXPECT_SIMD4_REAL_EQ(rSimd4_c0c1c2, selectByMask(rSimd4_c0c1c2, le));
 }
 
 TEST_F(Simd4FloatingpointTest, cmpLt)
 {
-    Simd4Bool lt   = (rSimd4_5_7_9 < rSimd4_7_8_9);
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(1, 2, 0), selectByMask(rSimd4_1_2_3, lt));
+    Simd4Bool lt   = rSimd4_c4c6c8 < rSimd4_c6c7c8;
+    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(c0, c1, 0), selectByMask(rSimd4_c0c1c2, lt));
 }
 
 TEST_F(Simd4FloatingpointTest, andB)
 {
-    Simd4Bool eq   = (rSimd4_5_7_9 == rSimd4_7_8_9);
-    Simd4Bool le   = (rSimd4_5_7_9 <= rSimd4_7_8_9);
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(0, 0, 3), selectByMask(rSimd4_1_2_3, eq && le));
+    Simd4Bool eq   = rSimd4_c4c6c8 == rSimd4_c6c7c8;
+    Simd4Bool le   = rSimd4_c4c6c8 <= rSimd4_c6c7c8;
+    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(0, 0, c2), selectByMask(rSimd4_c0c1c2, (eq && le)));
 }
 
 TEST_F(Simd4FloatingpointTest, orB)
 {
-    Simd4Bool eq   = (rSimd4_5_7_9 == rSimd4_7_8_9);
-    Simd4Bool lt   = (rSimd4_5_7_9 < rSimd4_7_8_9);
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(1, 2, 3), selectByMask(rSimd4_1_2_3, eq || lt));
+    Simd4Bool eq   = rSimd4_c4c6c8 == rSimd4_c6c7c8;
+    Simd4Bool lt   = rSimd4_c4c6c8  < rSimd4_c6c7c8;
+    GMX_EXPECT_SIMD4_REAL_EQ(rSimd4_c0c1c2, selectByMask(rSimd4_c0c1c2, (eq || lt)));
 }
 
 TEST_F(Simd4FloatingpointTest, anyTrue)
@@ -264,24 +271,24 @@ TEST_F(Simd4FloatingpointTest, anyTrue)
      * We cannot check for truth values for "any" element beyond the first,
      * since that part of the data will not be used if simd width is 1.
      */
-    eq = (rSimd4_5_7_9 == setSimd4RealFrom3R(5, 0, 0));
+    eq = (rSimd4_c4c6c8 == setSimd4RealFrom3R(c4, 0, 0));
     EXPECT_TRUE(anyTrue(eq));
 
-    eq = (rSimd4_1_2_3 == rSimd4_4_5_6);
+    eq = (rSimd4_c0c1c2 == rSimd4_c3c4c5);
     EXPECT_FALSE(anyTrue(eq));
 }
 
 TEST_F(Simd4FloatingpointTest, blend)
 {
-    Simd4Bool lt   = (rSimd4_5_7_9 < rSimd4_7_8_9);
-    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(4, 5, 3), blend(rSimd4_1_2_3, rSimd4_4_5_6, lt));
+    Simd4Bool lt   = rSimd4_c4c6c8 < rSimd4_c6c7c8;
+    GMX_EXPECT_SIMD4_REAL_EQ(setSimd4RealFrom3R(c3, c4, c2), blend(rSimd4_c0c1c2, rSimd4_c3c4c5, lt));
 }
 
 TEST_F(Simd4FloatingpointTest, reduce)
 {
     // The horizontal sum of the SIMD variable depends on the width, so
     // simply store it an extra time and calculate what the sum should be
-    std::vector<real> v   = simd4Real2Vector(rSimd4_1_2_3);
+    std::vector<real> v   = simd4Real2Vector(rSimd4_c3c4c5);
     real              sum = 0.0;
 
     for (int i = 0; i < GMX_SIMD4_WIDTH; i++)
@@ -289,19 +296,15 @@ TEST_F(Simd4FloatingpointTest, reduce)
         sum += v[i];
     }
 
-    EXPECT_EQ(sum, reduce(rSimd4_1_2_3));
+    EXPECT_REAL_EQ_TOL(sum, reduce(rSimd4_c3c4c5), defaultRealTolerance() );
 }
 
 
 TEST_F(Simd4FloatingpointTest, dotProduct)
 {
-    Simd4Real v1 = setSimd4RealFrom3R(1, 4, 5);
-    Simd4Real v2 = setSimd4RealFrom3R(3, 8, 2);
-#    if GMX_DOUBLE
-    EXPECT_DOUBLE_EQ(45.0, dotProduct(v1, v2));
-#    else
-    EXPECT_FLOAT_EQ(45.0, dotProduct(v1, v2));
-#    endif
+    real res = c0*c3 + c1*c4 + c2*c5;
+
+    EXPECT_REAL_EQ_TOL(res, dotProduct(rSimd4_c0c1c2, rSimd4_c3c4c5), defaultRealTolerance());
 }
 
 TEST_F(Simd4FloatingpointTest, transpose)
@@ -317,10 +320,11 @@ TEST_F(Simd4FloatingpointTest, transpose)
     // Assign data with tens as row, single-digit as column
     for (i = 0; i < 4; i++)
     {
-        p0[i] = 0*10 + i*1;
-        p1[i] = 1*10 + i*1;
-        p2[i] = 2*10 + i*1;
-        p3[i] = 3*10 + i*1;
+        // Scale by 1+100*eps to use low bits tii
+        p0[i] = (0*10 + i*1) * (1.0 + 100*GMX_REAL_EPS);
+        p1[i] = (1*10 + i*1) * (1.0 + 100*GMX_REAL_EPS);
+        p2[i] = (2*10 + i*1) * (1.0 + 100*GMX_REAL_EPS);
+        p3[i] = (3*10 + i*1) * (1.0 + 100*GMX_REAL_EPS);
     }
 
     v0 = load4(p0);
@@ -337,10 +341,10 @@ TEST_F(Simd4FloatingpointTest, transpose)
 
     for (i = 0; i < 4; i++)
     {
-        EXPECT_EQ(i*10+0, p0[i]);
-        EXPECT_EQ(i*10+1, p1[i]);
-        EXPECT_EQ(i*10+2, p2[i]);
-        EXPECT_EQ(i*10+3, p3[i]);
+        EXPECT_REAL_EQ_TOL( (i*10+0) * (1.0 + 100*GMX_REAL_EPS), p0[i], defaultRealTolerance());
+        EXPECT_REAL_EQ_TOL( (i*10+1) * (1.0 + 100*GMX_REAL_EPS), p1[i], defaultRealTolerance());
+        EXPECT_REAL_EQ_TOL( (i*10+2) * (1.0 + 100*GMX_REAL_EPS), p2[i], defaultRealTolerance());
+        EXPECT_REAL_EQ_TOL( (i*10+3) * (1.0 + 100*GMX_REAL_EPS), p3[i], defaultRealTolerance());
     }
 }
 
index f32d4ff14b38052d40c1eb5e3e7caeb533608269..97ae2d2d1ffadb382528c99a8bc0ee893483e44f 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,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.
@@ -39,6 +39,7 @@
 #include "gromacs/simd/simd.h"
 #include "gromacs/simd/vector_operations.h"
 
+#include "data.h"
 #include "simd4.h"
 
 #if GMX_SIMD
@@ -61,10 +62,12 @@ typedef Simd4Test Simd4VectorOperationsTest;
 
 TEST_F(Simd4VectorOperationsTest, norm2)
 {
-    Simd4Real simdX  = setSimd4RealFrom3R(1, 2, 3);
-    Simd4Real simdY  = setSimd4RealFrom3R(3, 0, 5);
-    Simd4Real simdZ  = setSimd4RealFrom3R(4, 1, 8);
-    Simd4Real simdR2 = setSimd4RealFrom3R(26, 5, 98);
+    Simd4Real simdX  = rSimd4_c0c1c2;
+    Simd4Real simdY  = rSimd4_c3c4c5;
+    Simd4Real simdZ  = rSimd4_c6c7c8;
+    Simd4Real simdR2 = setSimd4RealFrom3R(c0*c0 + c3*c3 + c6*c6,
+                                          c1*c1 + c4*c4 + c7*c7,
+                                          c2*c2 + c5*c5 + c8*c8);
 
     setUlpTol(2);
     GMX_EXPECT_SIMD4_REAL_NEAR(simdR2, norm2(simdX, simdY, simdZ));
index 4e411343781175417ac2bc87bba7868d2681758a..0e291cabf9c943c6f8a78442bc6f7ce60e6ed3a9 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) 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.
@@ -42,6 +42,7 @@
 
 #include "testutils/testasserts.h"
 
+#include "data.h"
 #include "simd.h"
 
 #if GMX_SIMD
@@ -70,106 +71,103 @@ TEST_F(SimdFloatingpointTest, setZero)
 
 TEST_F(SimdFloatingpointTest, set)
 {
-    real  r  = 2.0;
-    real *p  = &r;
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom1R(1.0), SimdReal(1.0));
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom1R(r), SimdReal(*p));
+    const real *p  = &c0;
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom1R(c1), SimdReal(c1));
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom1R(c0), SimdReal(*p));
 }
 
 TEST_F(SimdFloatingpointTest, add)
 {
-    GMX_EXPECT_SIMD_REAL_EQ(rSimd_5_7_9,
-                            (rSimd_1_2_3 + rSimd_4_5_6)); // 1+4=5, 2+5=7, 3+6=9
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(c0 + c3, c1 + c4, c2 + c5 ),
+                              rSimd_c0c1c2 + rSimd_c3c4c5);
 }
 
 TEST_F(SimdFloatingpointTest, maskAdd)
 {
-    SimdBool m = setSimdRealFrom3R(1, 0, 1) != setZero();
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(5, 2, 9),
-                            maskAdd(rSimd_1_2_3, rSimd_4_5_6, m));
+    SimdBool m = setSimdRealFrom3R(c6, 0, c7) != setZero();
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(c0 + c3, c1 + 0.0, c2 + c5 ),
+                              maskAdd(rSimd_c0c1c2, rSimd_c3c4c5, m));
 }
 
 TEST_F(SimdFloatingpointTest, sub)
 {
-    GMX_EXPECT_SIMD_REAL_EQ(rSimd_4_5_6,
-                            (rSimd_5_7_9 - rSimd_1_2_3)); // 5-1=4, 7-2=5, 9-3=6
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(c0 - c3, c1 - c4, c2 - c5 ),
+                              rSimd_c0c1c2 - rSimd_c3c4c5);
 }
 
 TEST_F(SimdFloatingpointTest, mul)
 {
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(4, 10, 18),
-                            (rSimd_1_2_3 * rSimd_4_5_6));
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(c0 * c3, c1 * c4, c2 * c5 ),
+                              rSimd_c0c1c2 * rSimd_c3c4c5);
 }
 
 TEST_F(SimdFloatingpointTest, maskzMul)
 {
-    SimdBool m = setSimdRealFrom3R(1, 0, 1) != setZero();
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(4, 0, 18),
-                            maskzMul(rSimd_1_2_3, rSimd_4_5_6, m));
+    SimdBool m = setSimdRealFrom3R(c1, 0, c1) != setZero();
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(c0 * c3, 0.0, c2 * c5 ),
+                              maskzMul(rSimd_c0c1c2, rSimd_c3c4c5, m));
 }
 
 TEST_F(SimdFloatingpointTest, fma)
 {
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(11, 18, 27),
-                            fma(rSimd_1_2_3, rSimd_4_5_6, rSimd_7_8_9)); // 1*4+7, etc.
+    // The last bit of FMA operations depends on hardware, so we don't require exact match
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(c0 * c3 + c6, c1 * c4 + c7, c2 * c5 + c8),
+                              fma(rSimd_c0c1c2, rSimd_c3c4c5, rSimd_c6c7c8));
 }
 
+
 TEST_F(SimdFloatingpointTest, maskzFma)
 {
-    SimdBool m = setSimdRealFrom3R(1, 0, 1) != setZero();
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(11, 0, 27),
-                            maskzFma(rSimd_1_2_3, rSimd_4_5_6, rSimd_7_8_9, m)); // 1*4+7, etc.
+    SimdBool m = setSimdRealFrom3R(c2, 0, c3) != setZero();
+    // The last bit of FMA operations depends on hardware, so we don't require exact match
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(c0 * c3 + c6, 0.0, c2 * c5 + c8),
+                              maskzFma(rSimd_c0c1c2, rSimd_c3c4c5, rSimd_c6c7c8, m));
 }
 
 TEST_F(SimdFloatingpointTest, fms)
 {
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(-3, 2, 9),
-                            fms(rSimd_1_2_3, rSimd_4_5_6, rSimd_7_8_9)); // 1*4-7, etc.
+    // The last bit of FMA operations depends on hardware, so we don't require exact match
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(c0 * c3 - c6, c1 * c4 - c7, c2 * c5 - c8),
+                              fms(rSimd_c0c1c2, rSimd_c3c4c5, rSimd_c6c7c8));
 }
 
 TEST_F(SimdFloatingpointTest, fnma)
 {
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(3, -2, -9),
-                            fnma(rSimd_1_2_3, rSimd_4_5_6, rSimd_7_8_9)); // -1*4+7, etc.
+    // The last bit of FMA operations depends on hardware, so we don't require exact match
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(c6 - c0 * c3, c7 - c1 * c4, c8 - c2 * c5),
+                              fnma(rSimd_c0c1c2, rSimd_c3c4c5, rSimd_c6c7c8));
 }
 
 TEST_F(SimdFloatingpointTest, fnms)
 {
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(-11, -18, -27),
-                            fnms(rSimd_1_2_3, rSimd_4_5_6, rSimd_7_8_9)); // -1*4-7, etc.
+    // The last bit of FMA operations depends on hardware, so we don't require exact match
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(-c0 * c3 - c6, -c1 * c4 - c7, -c2 * c5 - c8),
+                              fnms(rSimd_c0c1c2, rSimd_c3c4c5, rSimd_c6c7c8));
 }
 
 TEST_F(SimdFloatingpointTest, abs)
 {
-    GMX_EXPECT_SIMD_REAL_EQ(rSimd_1_2_3, abs(rSimd_1_2_3));    // fabs(x)=x
-    GMX_EXPECT_SIMD_REAL_EQ(rSimd_1_2_3, abs(rSimd_m1_m2_m3)); // fabs(-x)=x
+    GMX_EXPECT_SIMD_REAL_EQ(rSimd_c0c1c2, abs(rSimd_c0c1c2)); // fabs(x)=x
+    GMX_EXPECT_SIMD_REAL_EQ(rSimd_c0c1c2, abs(rSimd_m0m1m2)); // fabs(-x)=x
 }
 
 TEST_F(SimdFloatingpointTest, neg)
 {
-    GMX_EXPECT_SIMD_REAL_EQ(rSimd_m1_m2_m3, -(rSimd_1_2_3));    // fneg(x)=-x
-    GMX_EXPECT_SIMD_REAL_EQ(rSimd_1_2_3,    -(rSimd_m1_m2_m3)); // fneg(-x)=x
+    GMX_EXPECT_SIMD_REAL_EQ(rSimd_m0m1m2, -(rSimd_c0c1c2)); // fneg(x)=-x
+    GMX_EXPECT_SIMD_REAL_EQ(rSimd_c0c1c2, -(rSimd_m0m1m2)); // fneg(-x)=x
 }
 
 #if GMX_SIMD_HAVE_LOGICAL
-/* 1.3333282470703125 has mantissa 0101010101010101 (followed by zeros)
- * 1.79998779296875   has mantissa 1100110011001100 (followed by zeros)
- * 1.26666259765625   has mantissa 0100010001000100 (followed by zeros)
- * 1.8666534423828125 has mantissa 1101110111011101 (followed by zeros)
- *
- * Since all of them have the same exponent (2^0), the exponent will
- * not change with AND or OR operations.
- */
 TEST_F(SimdFloatingpointTest, and)
 {
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom1R(1.26666259765625),
-                            (SimdReal(1.3333282470703125) & SimdReal(1.79998779296875)));
+    GMX_EXPECT_SIMD_REAL_EQ(rSimd_logicalResultAnd,
+                            (rSimd_logicalA & rSimd_logicalB));
 }
 
 TEST_F(SimdFloatingpointTest, or)
 {
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom1R(1.8666534423828125),
-                            (SimdReal(1.3333282470703125) | SimdReal(1.79998779296875)));
+    GMX_EXPECT_SIMD_REAL_EQ(rSimd_logicalResultOr,
+                            (rSimd_logicalA | rSimd_logicalB));
 }
 
 TEST_F(SimdFloatingpointTest, xor)
@@ -178,8 +176,8 @@ TEST_F(SimdFloatingpointTest, xor)
      * in only the sign bit being set. We then use this bit change the sign of
      * different numbers.
      */
-    SimdReal signbit = SimdReal(1.5) ^ SimdReal(-1.5);
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(-1, 2, -3), (signbit ^ setSimdRealFrom3R(1, -2, 3)));
+    SimdReal signbit = SimdReal(c1) ^ SimdReal(-c1);
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(-c2, c3, -c4), (signbit ^ setSimdRealFrom3R(c2, -c3, c4)));
 }
 
 TEST_F(SimdFloatingpointTest, andNot)
@@ -187,34 +185,34 @@ TEST_F(SimdFloatingpointTest, andNot)
     /* Use xor (which we already tested, so fix that first if both tests fail)
      * to extract the sign bit, and then use andnot to take absolute values.
      */
-    SimdReal signbit = SimdReal(1.5) ^ SimdReal(-1.5);
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(1, 2, 3), andNot(signbit, setSimdRealFrom3R(-1, 2, -3)));
+    SimdReal signbit = SimdReal(c1) ^ SimdReal(-c1);
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(c2, c3, c4), andNot(signbit, setSimdRealFrom3R(-c2, c3, -c4)));
 }
 
 #endif
 
 TEST_F(SimdFloatingpointTest, max)
 {
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(3, 2, 4), max(rSimd_1_2_3, rSimd_3_1_4));
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(3, 2, 4), max(rSimd_3_1_4, rSimd_1_2_3));
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(-1, -1, -3), max(rSimd_m1_m2_m3, rSimd_m3_m1_m4));
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(-1, -1, -3), max(rSimd_m3_m1_m4, rSimd_m1_m2_m3));
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R( c3,  c1,  c4), max(rSimd_c0c1c2, rSimd_c3c0c4));
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R( c3,  c1,  c4), max(rSimd_c3c0c4, rSimd_c0c1c2));
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(-c0, -c0, -c2), max(rSimd_m0m1m2, rSimd_m3m0m4));
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(-c0, -c0, -c2), max(rSimd_m3m0m4, rSimd_m0m1m2));
 }
 
 TEST_F(SimdFloatingpointTest, min)
 {
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(1, 1, 3), min(rSimd_1_2_3, rSimd_3_1_4));
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(1, 1, 3), min(rSimd_3_1_4, rSimd_1_2_3));
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(-3, -2, -4), min(rSimd_m1_m2_m3, rSimd_m3_m1_m4));
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(-3, -2, -4), min(rSimd_m3_m1_m4, rSimd_m1_m2_m3));
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R( c0,  c0,  c2), min(rSimd_c0c1c2, rSimd_c3c0c4));
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R( c0,  c0,  c2), min(rSimd_c3c0c4, rSimd_c0c1c2));
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(-c3, -c1, -c4), min(rSimd_m0m1m2, rSimd_m3m0m4));
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(-c3, -c1, -c4), min(rSimd_m3m0m4, rSimd_m0m1m2));
 }
 
 TEST_F(SimdFloatingpointTest, round)
 {
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom1R(2), round(SimdReal(2.25)));
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom1R(4), round(SimdReal(3.75)));
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom1R(-2), round(SimdReal(-2.25)));
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom1R(-4), round(SimdReal(-3.75)));
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom1R(2), round(rSimd_2p25));
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom1R(4), round(rSimd_3p75));
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom1R(-2), round(rSimd_m2p25));
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom1R(-4), round(rSimd_m3p75));
 }
 
 TEST_F(SimdFloatingpointTest, trunc)
@@ -353,58 +351,58 @@ TEST_F(SimdFloatingpointTest, maskzRcp)
 
 TEST_F(SimdFloatingpointTest, cmpEqAndSelectByMask)
 {
-    SimdBool eq   = rSimd_5_7_9 == rSimd_7_8_9;
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(0, 0, 3), selectByMask(rSimd_1_2_3, eq));
+    SimdBool eq   = rSimd_c4c6c8 == rSimd_c6c7c8;
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(0, 0, c2), selectByMask(rSimd_c0c1c2, eq));
 }
 
 TEST_F(SimdFloatingpointTest, selectByNotMask)
 {
-    SimdBool eq   = rSimd_5_7_9 == rSimd_7_8_9;
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(1, 2, 0), selectByNotMask(rSimd_1_2_3, eq));
+    SimdBool eq   = rSimd_c4c6c8 == rSimd_c6c7c8;
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(c0, c1, 0), selectByNotMask(rSimd_c0c1c2, eq));
 }
 
 TEST_F(SimdFloatingpointTest, cmpNe)
 {
-    SimdBool eq   = rSimd_5_7_9 != rSimd_7_8_9;
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(1, 2, 0), selectByMask(rSimd_1_2_3, eq));
+    SimdBool eq   = rSimd_c4c6c8 != rSimd_c6c7c8;
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(c0, c1, 0), selectByMask(rSimd_c0c1c2, eq));
 }
 
 TEST_F(SimdFloatingpointTest, cmpLe)
 {
-    SimdBool le   = rSimd_5_7_9 <= rSimd_7_8_9;
-    GMX_EXPECT_SIMD_REAL_EQ(rSimd_1_2_3, selectByMask(rSimd_1_2_3, le));
+    SimdBool le   = rSimd_c4c6c8 <= rSimd_c6c7c8;
+    GMX_EXPECT_SIMD_REAL_EQ(rSimd_c0c1c2, selectByMask(rSimd_c0c1c2, le));
 }
 
 TEST_F(SimdFloatingpointTest, cmpLt)
 {
-    SimdBool lt   = rSimd_5_7_9 < rSimd_7_8_9;
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(1, 2, 0), selectByMask(rSimd_1_2_3, lt));
+    SimdBool lt   = rSimd_c4c6c8 < rSimd_c6c7c8;
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(c0, c1, 0), selectByMask(rSimd_c0c1c2, lt));
 }
 
 #if GMX_SIMD_HAVE_INT32_LOGICAL || GMX_SIMD_HAVE_LOGICAL
 TEST_F(SimdFloatingpointTest, testBits)
 {
-    SimdBool eq   = testBits(setSimdRealFrom3R(1, 0, 2));
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(1, 0, 3), selectByMask(rSimd_1_2_3, eq));
+    SimdBool eq   = testBits(setSimdRealFrom3R(c1, 0, c1));
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(c0, 0, c2), selectByMask(rSimd_c0c1c2, eq));
 
     // Test if we detect only the sign bit being set
     eq            = testBits(setSimdRealFrom1R(GMX_REAL_NEGZERO));
-    GMX_EXPECT_SIMD_REAL_EQ(rSimd_1_2_3, selectByMask(rSimd_1_2_3, eq));
+    GMX_EXPECT_SIMD_REAL_EQ(rSimd_c0c1c2, selectByMask(rSimd_c0c1c2, eq));
 }
 #endif
 
 TEST_F(SimdFloatingpointTest, andB)
 {
-    SimdBool eq   = rSimd_5_7_9 == rSimd_7_8_9;
-    SimdBool le   = rSimd_5_7_9 <= rSimd_7_8_9;
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(0, 0, 3), selectByMask(rSimd_1_2_3, (eq && le)));
+    SimdBool eq   = rSimd_c4c6c8 == rSimd_c6c7c8;
+    SimdBool le   = rSimd_c4c6c8 <= rSimd_c6c7c8;
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(0, 0, c2), selectByMask(rSimd_c0c1c2, (eq && le)));
 }
 
 TEST_F(SimdFloatingpointTest, orB)
 {
-    SimdBool eq   = rSimd_5_7_9 == rSimd_7_8_9;
-    SimdBool lt   = rSimd_5_7_9 < rSimd_7_8_9;
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(1, 2, 3), selectByMask(rSimd_1_2_3, (eq || lt)));
+    SimdBool eq   = rSimd_c4c6c8 == rSimd_c6c7c8;
+    SimdBool lt   = rSimd_c4c6c8  < rSimd_c6c7c8;
+    GMX_EXPECT_SIMD_REAL_EQ(rSimd_c0c1c2, selectByMask(rSimd_c0c1c2, (eq || lt)));
 }
 
 TEST_F(SimdFloatingpointTest, anyTrueB)
@@ -415,24 +413,24 @@ TEST_F(SimdFloatingpointTest, anyTrueB)
      * We cannot check for truth values for "any" element beyond the first,
      * since that part of the data will not be used if simd width is 1.
      */
-    eq = rSimd_5_7_9 == setSimdRealFrom3R(5, 0, 0);
+    eq = rSimd_c4c6c8 == setSimdRealFrom3R(c4, 0, 0);
     EXPECT_TRUE(anyTrue(eq));
 
-    eq = rSimd_1_2_3 == rSimd_4_5_6;
+    eq = rSimd_c0c1c2 == rSimd_c3c4c5;
     EXPECT_FALSE(anyTrue(eq));
 }
 
 TEST_F(SimdFloatingpointTest, blend)
 {
-    SimdBool lt   = rSimd_5_7_9 < rSimd_7_8_9;
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(4, 5, 3), blend(rSimd_1_2_3, rSimd_4_5_6, lt));
+    SimdBool lt   = rSimd_c4c6c8 < rSimd_c6c7c8;
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(c3, c4, c2), blend(rSimd_c0c1c2, rSimd_c3c4c5, lt));
 }
 
 TEST_F(SimdFloatingpointTest, reduce)
 {
     // The horizontal sum of the SIMD variable depends on the width, so
     // simply store it an extra time and calculate what the sum should be
-    std::vector<real> v   = simdReal2Vector(rSimd_4_5_6);
+    std::vector<real> v   = simdReal2Vector(rSimd_c3c4c5);
     real              sum = 0.0;
 
     for (int i = 0; i < GMX_SIMD_REAL_WIDTH; i++)
@@ -440,7 +438,7 @@ TEST_F(SimdFloatingpointTest, reduce)
         sum += v[i];
     }
 
-    EXPECT_EQ(sum, reduce(rSimd_4_5_6));
+    EXPECT_REAL_EQ_TOL(sum, reduce(rSimd_c3c4c5), defaultRealTolerance() );
 }
 
 #endif      // GMX_SIMD_HAVE_REAL
@@ -458,7 +456,9 @@ TEST_F(SimdFloatingpointTest, cvtFloat2Double)
 
     for (i = 0; i < GMX_SIMD_FLOAT_WIDTH; i++)
     {
-        f[i] = i;
+        // Scale by 1+100*eps to use low bits too.
+        // Due to the conversions we want to avoid being too sensitive to fluctuations in last bit
+        f[i] = i * (1.0 + 100*GMX_FLOAT_EPS);
     }
 
     vf = load(f);
@@ -491,7 +491,9 @@ TEST_F(SimdFloatingpointTest, cvtDouble2Float)
     // This fills elements for pd1 too when double width is 2*single width
     for (i = 0; i < GMX_SIMD_FLOAT_WIDTH; i++)
     {
-        d[i] = i;
+        // Scale by 1+eps to use low bits too.
+        // Due to the conversions we want to avoid being too sensitive to fluctuations in last bit
+        d[i] = i * (1.0 + 100*GMX_FLOAT_EPS);
     }
 
     vd0 = load(d);
@@ -508,7 +510,7 @@ TEST_F(SimdFloatingpointTest, cvtDouble2Float)
     // This will check elements in pd1 too when double width is 2*single width
     for (i = 0; i < GMX_SIMD_FLOAT_WIDTH; i++)
     {
-        EXPECT_REAL_EQ_TOL(d[i], f[i], tolerance);
+        EXPECT_FLOAT_EQ_TOL(d[i], f[i], tolerance);
     }
 }
 #endif      // GMX_SIMD_HAVE_FLOAT && GMX_SIMD_HAVE_DOUBLE
index 6eef2e2a95fd7b5b69fada291d053f7bb5433cd9..8d288f77c69be35d16996814f26aed1aa1906faf 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 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.
@@ -85,10 +85,12 @@ class SimdFloatingpointUtilTest : public SimdTest
             {
                 // Use every third point to avoid a continguous access pattern
                 offset_[i] = 3 * i;
-                val0_[i]   = i;
-                val1_[i]   = i + 0.1;
-                val2_[i]   = i + 0.2;
-                val3_[i]   = i + 0.3;
+                // Multiply numbers by 1+100*GMX_REAL_EPS ensures some low bits are
+                // set too, so the tests make sure we read all bits correctly.
+                val0_[i]   = (i      ) * (1.0 + 100*GMX_REAL_EPS);
+                val1_[i]   = (i + 0.1) * (1.0 + 100*GMX_REAL_EPS);
+                val2_[i]   = (i + 0.2) * (1.0 + 100*GMX_REAL_EPS);
+                val3_[i]   = (i + 0.3) * (1.0 + 100*GMX_REAL_EPS);
             }
         }
 
@@ -265,7 +267,8 @@ TEST_F(SimdFloatingpointUtilTest, transposeScatterStoreU3)
         // Set test and reference memory to background value
         for (std::size_t j = 0; j < s_workMemSize_; j++)
         {
-            mem0_[j] = refmem[j] = 1000.0 + j;
+            // Multiply by 1+100*eps to make sure low bits are also used
+            mem0_[j] = refmem[j] = (1000.0 + j) * (1.0 + 100*GMX_REAL_EPS);
         }
 
         for (std::size_t j = 0; j < GMX_SIMD_REAL_WIDTH; j++)
@@ -316,7 +319,8 @@ TEST_F(SimdFloatingpointUtilTest, transposeScatterIncrU3)
         // Set test and reference memory to background value
         for (std::size_t j = 0; j < s_workMemSize_; j++)
         {
-            mem0_[j] = refmem[j] = 1000.0 + j;
+            // Multiply by 1+100*eps to make sure low bits are also used
+            mem0_[j] = refmem[j] = (1000.0 + j) * (1.0 + 100*GMX_REAL_EPS);
         }
 
         for (std::size_t j = 0; j < GMX_SIMD_REAL_WIDTH; j++)
@@ -366,7 +370,8 @@ TEST_F(SimdFloatingpointUtilTest, transposeScatterIncrU3Overlapping)
     // Set test and reference memory to background value
     for (std::size_t j = 0; j < s_workMemSize_; j++)
     {
-        mem0_[j] = refmem[j] = 1000.0 + j;
+        // Multiply by 1+100*eps to make sure low bits are also used
+        mem0_[j] = refmem[j] = (1000.0 + j) * (1.0 + 100*GMX_REAL_EPS);
     }
 
     for (std::size_t j = 0; j < GMX_SIMD_REAL_WIDTH; j++)
@@ -405,7 +410,8 @@ TEST_F(SimdFloatingpointUtilTest, transposeScatterDecrU3)
         // Set test and reference memory to background value
         for (std::size_t j = 0; j < s_workMemSize_; j++)
         {
-            mem0_[j] = refmem[j] = 1000.0 + j;
+            // Multiply by 1+100*eps to make sure low bits are also used
+            mem0_[j] = refmem[j] = (1000.0 + j) * (1.0 + 100*GMX_REAL_EPS);
         }
 
         for (std::size_t j = 0; j < GMX_SIMD_REAL_WIDTH; j++)
@@ -455,7 +461,8 @@ TEST_F(SimdFloatingpointUtilTest, transposeScatterDecrU3Overlapping)
     // Set test and reference memory to background value
     for (std::size_t j = 0; j < s_workMemSize_; j++)
     {
-        mem0_[j] = refmem[j] = 1000.0 + j;
+        // Multiply by 1+100*eps to make sure low bits are also used
+        mem0_[j] = refmem[j] = (1000.0 + j) * (1.0 + 100*GMX_REAL_EPS);
     }
 
     for (std::size_t j = 0; j < GMX_SIMD_REAL_WIDTH; j++)
@@ -668,17 +675,17 @@ TEST_F(SimdFloatingpointUtilTest, reduceIncr4Sum)
     }
 
     // Just put some numbers in memory so we check the addition is correct
-    mem0_[0] = 5.0;
-    mem0_[1] = 15.0;
-    mem0_[2] = 25.0;
-    mem0_[3] = 35.0;
+    mem0_[0] = c0;
+    mem0_[1] = c1;
+    mem0_[2] = c2;
+    mem0_[3] = c3;
 
     tstsum = reduceIncr4ReturnSum(mem0_, v0, v1, v2, v3);
 
-    EXPECT_REAL_EQ_TOL( 5.0 + sum0, mem0_[0], tolerance);
-    EXPECT_REAL_EQ_TOL(15.0 + sum1, mem0_[1], tolerance);
-    EXPECT_REAL_EQ_TOL(25.0 + sum2, mem0_[2], tolerance);
-    EXPECT_REAL_EQ_TOL(35.0 + sum3, mem0_[3], tolerance);
+    EXPECT_REAL_EQ_TOL(c0 + sum0, mem0_[0], tolerance);
+    EXPECT_REAL_EQ_TOL(c1 + sum1, mem0_[1], tolerance);
+    EXPECT_REAL_EQ_TOL(c2 + sum2, mem0_[2], tolerance);
+    EXPECT_REAL_EQ_TOL(c3 + sum3, mem0_[3], tolerance);
 
     EXPECT_REAL_EQ_TOL(sum0 + sum1 + sum2 + sum3, tstsum, tolerance);
 }
@@ -893,17 +900,17 @@ TEST_F(SimdFloatingpointUtilTest, reduceIncr4SumHsimd)
     }
 
     // Just put some numbers in memory so we check the addition is correct
-    mem0_[0] = 5.0;
-    mem0_[1] = 15.0;
-    mem0_[2] = 25.0;
-    mem0_[3] = 35.0;
+    mem0_[0] = c0;
+    mem0_[1] = c1;
+    mem0_[2] = c2;
+    mem0_[3] = c3;
 
     tstsum = reduceIncr4ReturnSumHsimd(mem0_, v0, v1);
 
-    EXPECT_REAL_EQ_TOL( 5.0 + sum0, mem0_[0], tolerance);
-    EXPECT_REAL_EQ_TOL(15.0 + sum1, mem0_[1], tolerance);
-    EXPECT_REAL_EQ_TOL(25.0 + sum2, mem0_[2], tolerance);
-    EXPECT_REAL_EQ_TOL(35.0 + sum3, mem0_[3], tolerance);
+    EXPECT_REAL_EQ_TOL(c0 + sum0, mem0_[0], tolerance);
+    EXPECT_REAL_EQ_TOL(c1 + sum1, mem0_[1], tolerance);
+    EXPECT_REAL_EQ_TOL(c2 + sum2, mem0_[2], tolerance);
+    EXPECT_REAL_EQ_TOL(c3 + sum3, mem0_[3], tolerance);
 
     EXPECT_REAL_EQ_TOL(sum0 + sum1 + sum2 + sum3, tstsum, tolerance);
 }
index 9ab6e87774c633738b9d4c5bef2128496c417ff1..7dd555bbbd15daee5f37010d9f710dd174daf618 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) 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.
@@ -305,7 +305,7 @@ TEST_F(SimdIntegerTest, blend)
 #if GMX_SIMD_HAVE_REAL && GMX_SIMD_HAVE_INT32_ARITHMETICS
 TEST_F(SimdIntegerTest, cvtB2IB)
 {
-    SimdBool  eq   = (rSimd_5_7_9 == setSimdRealFrom3R(5, 0, 0));  // eq should be T,F,F
+    SimdBool  eq   = (rSimd_c3c4c5 == rSimd_c3c0c4);  // eq should be T,F,F
     SimdIBool eqi  = cvtB2IB(eq);
     GMX_EXPECT_SIMD_INT_EQ(setSimdIntFrom3I(1, 0, 0), selectByMask(iSimd_1_2_3, eqi));
 
@@ -315,7 +315,7 @@ TEST_F(SimdIntegerTest, cvtIB2B)
 {
     SimdIBool eqi  = (iSimd_5_7_9 == setSimdIntFrom3I(5, 0, 0));  // eq should be T,F,F
     SimdBool  eq   = cvtIB2B(eqi);
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(1.0, 0, 0), selectByMask(rSimd_1_2_3, eq));
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(c0, 0, 0), selectByMask(rSimd_c0c1c2, eq));
 }
 #endif      // GMX_SIMD_HAVE_REAL && GMX_SIMD_HAVE_INT32_ARITHMETICS
 
index 605724b8273276c961375b5a487d9ece153aa326..eb3b4f41233a672bf4c7d0daf7d762c4858bd2cd 100644 (file)
@@ -66,8 +66,12 @@ class SimdMathTest : public SimdTest
 {
     public:
         ::testing::AssertionResult
-                            compareSimdMathFunction(const char * refFuncExpr, const char *simdFuncExpr,
-                                                    real refFunc(real x),     SimdReal gmx_simdcall simdFunc(SimdReal x));
+                            compareSimdMathFunction(const char *  refFuncExpr,
+                                                    const char *  simdFuncExpr,
+                                                    const char *  denormalsToZeroExpr,
+                                                    real          refFunc(real x),
+                                                    SimdReal      gmx_simdcall simdFunc(SimdReal x),
+                                                    bool          denormalsToZero);
 };
 
 /*! \brief Test approximate equality of SIMD vs reference version of a function.
@@ -76,22 +80,40 @@ class SimdMathTest : public SimdTest
  * the number of points, range, and tolerances specified by the test fixture class.
  */
 #define GMX_EXPECT_SIMD_FUNC_NEAR(refFunc, tstFunc) \
-    EXPECT_PRED_FORMAT2(compareSimdMathFunction, refFunc, tstFunc)
+    EXPECT_PRED_FORMAT3(compareSimdMathFunction, refFunc, tstFunc, false)
+
+/*! \brief Test approximate equality of SIMD vs reference function, denormals can be zero.
+ *
+ * This macro takes vanilla C and SIMD flavors of a function and tests it with
+ * the number of points, range, and tolerances specified by the test fixture class.
+ *
+ * This version of the function will also return success if the test function
+ * returns zero where the reference function returns a denormal value.
+ */
+#define GMX_EXPECT_SIMD_FUNC_NEAR_DTZ(refFunc, tstFunc) \
+    EXPECT_PRED_FORMAT3(compareSimdMathFunction, refFunc, tstFunc, true)
 
 /*! \brief Implementation routine to compare SIMD vs reference functions.
  *
- * \param refFuncExpr   Description of reference function expression
- * \param simdFuncExpr  Description of SIMD function expression
- * \param refFunc       Reference math function pointer
- * \param simdFunc      SIMD math function pointer
+ * \param refFuncExpr         Description of reference function expression
+ * \param simdFuncExpr        Description of SIMD function expression
+ * \param denormalsToZeroExpr Description of denormal-to-zero setting
+ * \param refFunc             Reference math function pointer
+ * \param simdFunc            SIMD math function pointer
+ * \param denormalsToZero     If true, the function will consider denormal
+ *                            values equivalent to 0.0.
  *
  * The function will be tested with the range and tolerances specified in
  * the SimdBaseTest class. You should not never call this function directly,
  * but use the macro GMX_EXPECT_SIMD_FUNC_NEAR(refFunc,tstFunc) instead.
  */
 ::testing::AssertionResult
-SimdMathTest::compareSimdMathFunction(const char * refFuncExpr, const char *simdFuncExpr,
-                                      real refFunc(real x),     SimdReal gmx_simdcall simdFunc(SimdReal x))
+SimdMathTest::compareSimdMathFunction(const char              * refFuncExpr,
+                                      const char              * simdFuncExpr,
+                                      const char              * denormalsToZeroExpr,
+                                      real                      refFunc(real x),
+                                      SimdReal     gmx_simdcall simdFunc(SimdReal x),
+                                      bool                      denormalsToZero)
 {
     std::vector<real>            vx(GMX_SIMD_REAL_WIDTH);
     std::vector<real>            vref(GMX_SIMD_REAL_WIDTH);
@@ -128,6 +150,19 @@ SimdMathTest::compareSimdMathFunction(const char * refFuncExpr, const char *simd
 
         for (i = 0, signOk = true, absOk = true; i < GMX_SIMD_REAL_WIDTH; i++)
         {
+            if (denormalsToZero)
+            {
+                // Clamp denormal values to zero if requested
+                if (std::abs(vref[i]) < GMX_REAL_MIN)
+                {
+                    vref[i] = 0.0;
+                }
+                if (std::abs(vtst[i]) < GMX_REAL_MIN)
+                {
+                    vtst[i] = 0.0;
+                }
+            }
+
             absDiff = fabs(vref[i]-vtst[i]);
             absOk   = absOk  && ( absDiff < absTol_ );
             signOk  = signOk && ( (vref[i] >= 0 && vtst[i] >= 0) ||
@@ -159,6 +194,7 @@ SimdMathTest::compareSimdMathFunction(const char * refFuncExpr, const char *simd
                    << "Reference function: " << refFuncExpr << std::endl
                    << "Simd function:      " << simdFuncExpr << std::endl
                    << "Test range is ( " << range_.first << " , " << range_.second << " ) " << std::endl
+                   << "Denormals can be 0: " << denormalsToZeroExpr << std::endl
                    << "First sign difference around x=" << std::setprecision(20) << ::testing::PrintToString(vx) << std::endl
                    << "Ref values:  " << std::setprecision(20) << ::testing::PrintToString(vref) << std::endl
                    << "SIMD values: " << std::setprecision(20) << ::testing::PrintToString(vtst) << std::endl;
@@ -175,6 +211,7 @@ SimdMathTest::compareSimdMathFunction(const char * refFuncExpr, const char *simd
                << "Failing SIMD math function ulp comparison between " << refFuncExpr << " and " << simdFuncExpr << std::endl
                << "Requested ulp tolerance: " << ulpTol_ << std::endl
                << "Requested abs tolerance: " << absTol_ << std::endl
+               << "Denormals can be 0: " << denormalsToZeroExpr << std::endl
                << "Largest Ulp difference occurs for x=" << std::setprecision(20) << maxUlpDiffPos << std::endl
                << "Ref  values: " << std::setprecision(20) << refValMaxUlpDiff << std::endl
                << "SIMD values: " << std::setprecision(20) << simdValMaxUlpDiff << std::endl
@@ -198,10 +235,10 @@ namespace
 
 TEST_F(SimdMathTest, copysign)
 {
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(-4, 5, 6), copysign(setSimdRealFrom3R(4, 5, 6), setSimdRealFrom3R(-5, 2, 0)));
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(-4, 5, 6), copysign(setSimdRealFrom3R(-4, -5, -6), setSimdRealFrom3R(-5, 2, 0)));
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(4, -5, 6), copysign(setSimdRealFrom3R(4, 5, 6), setSimdRealFrom3R(5, -2, 0)));
-    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(4, -5, 6), copysign(setSimdRealFrom3R(-4, -5, -6), setSimdRealFrom3R(5, -2, 0)));
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(-c0,  c1, c2), copysign(setSimdRealFrom3R( c0,  c1,  c2), setSimdRealFrom3R(-c3,  c4, 0)));
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R(-c0,  c1, c2), copysign(setSimdRealFrom3R(-c0, -c1, -c2), setSimdRealFrom3R(-c3,  c4, 0)));
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R( c0, -c1, c2), copysign(setSimdRealFrom3R( c0,  c1,  c2), setSimdRealFrom3R( c3, -c4, 0)));
+    GMX_EXPECT_SIMD_REAL_EQ(setSimdRealFrom3R( c0, -c1, c2), copysign(setSimdRealFrom3R(-c0, -c1, -c2), setSimdRealFrom3R( c3, -c4, 0)));
 }
 
 /*! \brief Function wrapper to evaluate reference 1/sqrt(x) */
@@ -213,15 +250,15 @@ refInvsqrt(real x)
 
 TEST_F(SimdMathTest, invsqrt)
 {
-    setRange(1e-10, 1e10);
+    setRange(1.01*GMX_FLOAT_MIN, GMX_FLOAT_MAX);
     GMX_EXPECT_SIMD_FUNC_NEAR(refInvsqrt, invsqrt);
 }
 
 TEST_F(SimdMathTest, maskzInvsqrt)
 {
-    SimdReal x   = setSimdRealFrom3R(1.0, 0.0, 3.0);
+    SimdReal x   = setSimdRealFrom3R(c1, 0.0, c2);
     SimdBool m   = (setZero() < x);
-    SimdReal ref = setSimdRealFrom3R(1.0/std::sqrt(1.0), 0.0, 1.0/std::sqrt(3.0));
+    SimdReal ref = setSimdRealFrom3R(1.0/std::sqrt(c1), 0.0, 1.0/std::sqrt(c2));
     GMX_EXPECT_SIMD_REAL_NEAR(ref, maskzInvsqrt(x, m));
 }
 
@@ -245,7 +282,7 @@ tstInvsqrtPair1(SimdReal x)
 
 TEST_F(SimdMathTest, invsqrtPair)
 {
-    setRange(1e-10, 1e10);
+    setRange(1.01*GMX_FLOAT_MIN, GMX_FLOAT_MAX);
     // The accuracy conversions lose a bit of extra accuracy compared to
     // doing the iterations in all-double.
     setUlpTol(4*ulpTol_);
@@ -254,20 +291,52 @@ TEST_F(SimdMathTest, invsqrtPair)
     GMX_EXPECT_SIMD_FUNC_NEAR(refInvsqrt, tstInvsqrtPair1);
 }
 
+/*! \brief Function wrapper to evaluate reference sqrt(x) */
+static real
+refSqrt(real x)
+{
+    return std::sqrt(x);
+}
+
+/*! \brief Dummy function returning 0.0 to test function ranges that should be zero */
+gmx_unused static real
+refZero(real gmx_unused x)
+{
+    return 0.0;
+}
+
+
 TEST_F(SimdMathTest, sqrt)
 {
-    // Make sure sqrt(0)=0 works and isn't evaluated as 0*1/sqrt(0)=NaN
-    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(0, std::sqrt(3), 2), sqrt(setSimdRealFrom3R(0, 3, 4)));
+    // The accuracy conversions lose a bit of extra accuracy compared to
+    // doing the iterations in all-double.
+    setUlpTol(4*ulpTol_);
+
+    // First test that 0.0 and a few other values works
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(0, std::sqrt(c1), std::sqrt(c2)), sqrt(setSimdRealFrom3R(0, c1, c2)));
+
+    // Values smaller-than-or-equal to GMX_FLOAT_MIN will be clamped to 0.0,
+    // so only test larger values
+    setRange(1.01*GMX_FLOAT_MIN, GMX_FLOAT_MAX);
+    GMX_EXPECT_SIMD_FUNC_NEAR(refSqrt, sqrt);
 
 #if GMX_DOUBLE
-    // Test arguments in the problematic range 0 < x <= GMX_FLOAT_MIN
-    double x0 = GMX_FLOAT_MIN;
-    double x1 = GMX_FLOAT_MIN*0.5;
-    double x2 = GMX_DOUBLE_MIN;
-    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::sqrt(x0), 0, 0), sqrt(setSimdRealFrom3R(x0, x1, x2)));
+    // Make sure that values smaller than GMX_FLOAT_MIN lead to result 0.0
+    setRange(0.0, 0.99*GMX_FLOAT_MIN);
+    GMX_EXPECT_SIMD_FUNC_NEAR(refZero, sqrt);
 #endif
 }
 
+TEST_F(SimdMathTest, sqrtUnsafe)
+{
+    // The accuracy conversions lose a bit of extra accuracy compared to
+    // doing the iterations in all-double.
+    setUlpTol(4*ulpTol_);
+
+    setRange(GMX_FLOAT_MIN, GMX_FLOAT_MAX);
+    GMX_EXPECT_SIMD_FUNC_NEAR(refSqrt, sqrt<MathOptimization::Unsafe>);
+}
+
 /*! \brief Function wrapper to evaluate reference 1/x */
 real refInv(real x)
 {
@@ -285,9 +354,9 @@ TEST_F(SimdMathTest, inv)
 
 TEST_F(SimdMathTest, maskzInv)
 {
-    SimdReal x   = setSimdRealFrom3R(2.0, 0.0, 3.0);
+    SimdReal x   = setSimdRealFrom3R(c1, 0.0, c2);
     SimdBool m   = (setZero() < x);
-    SimdReal ref = setSimdRealFrom3R(0.5, 0.0, 1.0/3.0);
+    SimdReal ref = setSimdRealFrom3R(1.0/c1, 0.0, 1.0/c2);
     GMX_EXPECT_SIMD_REAL_NEAR(ref, maskzInv(x, m));
 }
 
@@ -299,47 +368,102 @@ TEST_F(SimdMathTest, log)
 
 TEST_F(SimdMathTest, exp2)
 {
-    setRange(-100, 100);
+    // Test normal/denormal/zero range separately to make errors clearer
+
+    // First test the range where we get normalized (non-denormal) results,
+    // since we don't require denormal results to be reproduced correctly.
+#if GMX_DOUBLE
+    setRange(-1022, 1023);
+#else
+    setRange(-126, 127);
+#endif
     GMX_EXPECT_SIMD_FUNC_NEAR(std::exp2, exp2);
 
-    // We do not care about the SIMD implementation getting denormal values right,
-    // but they must be clamped to zero rather than producing garbage.
-    // Check by setting the absolute tolerance to machine precision.
-    setAbsTol(GMX_REAL_EPS);
+    // Some implementations might have denormal support, in which case they
+    // support an extended range, adding roughly the number of bits in the
+    // mantissa to the smallest allowed arg (1023+52 in double, 127+23 single).
+    // In this range we allow the value to be either correct (denormal) or 0.0
+#if GMX_DOUBLE
+    setRange(-1075, -1022);
+#else
+    setRange(-150, -126);
+#endif
+    GMX_EXPECT_SIMD_FUNC_NEAR_DTZ(std::exp2, exp2);
 
-    // First two values will have denormal results in single, third value in double too.
-    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::exp2(-150.0), std::exp2(-300.0), std::exp2(-1050.0)),
-                              exp2(setSimdRealFrom3R(-150.0, -300.0, -1050.0)));
+    // For arguments smaller than the subnormal the result should be zero
+    // both in the reference and our implementations.
+#if GMX_DOUBLE
+    setRange(-1000000.0, -1075.0);
+#else
+    setRange(-100000.0, -150.0);
+#endif
+    GMX_EXPECT_SIMD_FUNC_NEAR(std::exp2, exp2);
 
-    // Reset absolute tolerance to enforce ULP checking
-    setAbsTol(0.0);
+    // Test a few very negative values, including values so small that they
+    // will start to cause inf values in the polynomial interpolations
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::exp2(-GMX_FLOAT_MAX), std::exp2(-0.1*GMX_REAL_MAX), std::exp2(-GMX_REAL_MAX)),
+                              exp2(setSimdRealFrom3R(-GMX_FLOAT_MAX, -0.1*GMX_REAL_MAX, -GMX_REAL_MAX)));
+}
 
-    // Make sure that underflowing values are set to zero.
-    // First two values underflow in single, third value in double too.
-    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::exp2(-200.0), std::exp2(-600.0), std::exp2(-1500.0)),
-                              exp2(setSimdRealFrom3R(-200.0, -600.0, -1500.0)));
+TEST_F(SimdMathTest, exp2Unsafe)
+{
+    // The unsafe version is only defined in this range
+#if GMX_DOUBLE
+    setRange(-1022, 1023);
+#else
+    setRange(-126, 127);
+#endif
+    GMX_EXPECT_SIMD_FUNC_NEAR(std::exp2, exp2<MathOptimization::Unsafe>);
 }
 
 TEST_F(SimdMathTest, exp)
 {
-    setRange(-75, 75);
+    // Test normal/denormal/zero range separately to make errors clearer
+
+    // First test the range where we get normalized (non-denormal) results,
+    // since we don't require denormal results to be reproduced correctly.
+#if GMX_DOUBLE
+    setRange(-708.4, 709.1);
+#else
+    setRange(-87.3, 88.0);
+#endif
     GMX_EXPECT_SIMD_FUNC_NEAR(std::exp, exp);
 
-    // We do not care about the SIMD implementation getting denormal values right,
-    // but they must be clamped to zero rather than producing garbage.
-    // Check by setting the absolute tolerance to machine precision.
-    setAbsTol(GMX_REAL_EPS);
-    // First two values will have denormal results in single, third value in double too.
-    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::exp(-90.0), std::exp(-100.0), std::exp(-725.0)),
-                              exp(setSimdRealFrom3R(-90.0, -100.0, -725.0)));
+    // Some implementations might have denormal support, in which case they
+    // support an extended range, adding roughly the number of bits in the
+    // mantissa to the smallest allowed arg (1023+52 in double, 127+23 single).
+    // Then multiply with ln(2) to get our limit for exp().
+    // In this range we allow the value to be either correct (denormal) or 0.0
+#if GMX_DOUBLE
+    setRange(-746.0, -708.4);
+#else
+    setRange(-104.0, -87.3);
+#endif
+    GMX_EXPECT_SIMD_FUNC_NEAR_DTZ(std::exp, exp);
 
-    // Reset absolute tolerance to enforce ULP checking
-    setAbsTol(0.0);
+    // For arguments smaller than the subnormal the result should be zero
+    // both in the reference and our implementations.
+#if GMX_DOUBLE
+    setRange(-1000000.0, -746.0);
+#else
+    setRange(-100000.0, -104.0);
+#endif
+    GMX_EXPECT_SIMD_FUNC_NEAR(std::exp, exp);
 
-    // Make sure that underflowing values are set to zero.
-    // First two values underflow in single, third value in double too.
-    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::exp(-150.0), std::exp(-300.0), std::exp(-800.0)),
-                              exp(setSimdRealFrom3R(-150.0, -300.0, -800.0)));
+    // Test a few very negative values, including values so small that they
+    // will start to cause inf values in the polynomial interpolations
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::exp(-GMX_FLOAT_MAX), std::exp(-0.1*GMX_REAL_MAX), std::exp(-GMX_REAL_MAX)),
+                              exp(setSimdRealFrom3R(-GMX_FLOAT_MAX, -0.1*GMX_REAL_MAX, -GMX_REAL_MAX)));
+}
+
+TEST_F(SimdMathTest, expUnsafe)
+{
+#if GMX_DOUBLE
+    setRange(-708.4, 709.1);
+#else
+    setRange(-87.3, 88.0);
+#endif
+    GMX_EXPECT_SIMD_FUNC_NEAR(std::exp, exp<MathOptimization::Unsafe>);
 }
 
 /*! \brief Function wrapper for erf(x), with argument/return in default Gromacs precision.
@@ -437,16 +561,25 @@ TEST_F(SimdMathTest, atan)
 TEST_F(SimdMathTest, atan2)
 {
     // test each quadrant
-    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom1R(std::atan2(1.0, 1.0)), atan2(rSimd_1_2_3, rSimd_1_2_3));
-    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom1R(std::atan2(-1.0, 1.0)), atan2(rSimd_m1_m2_m3, rSimd_1_2_3));
-    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom1R(std::atan2(-1.0, -1.0)), atan2(rSimd_m1_m2_m3, rSimd_m1_m2_m3));
-    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom1R(std::atan2(1.0, -1.0)), atan2(rSimd_1_2_3, rSimd_m1_m2_m3));
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::atan2(c0, c3), std::atan2(c1, c4), std::atan2(c2, c5)),
+                              atan2(rSimd_c0c1c2, rSimd_c3c4c5));
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::atan2(-c0, c3), std::atan2(-c1, c4), std::atan2(-c2, c5)),
+                              atan2(rSimd_m0m1m2, rSimd_c3c4c5));
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::atan2(-c0, -c3), std::atan2(-c1, -c0), std::atan2(-c2, -c4)),
+                              atan2(rSimd_m0m1m2, rSimd_m3m0m4));
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::atan2(c0, -c3), std::atan2(c1, -c0), std::atan2(c2, -c4)),
+                              atan2(rSimd_c0c1c2, rSimd_m3m0m4));
+
     // cases important for calculating angles
     // values on coordinate axes
-    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom1R(std::atan2(0.0, 1.0)), atan2(setZero(), rSimd_1_2_3));
-    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom1R(std::atan2(1.0, 0.0)), atan2(rSimd_1_2_3, setZero()));
-    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom1R(std::atan2(0.0, -1.0)), atan2(setZero(), rSimd_m1_m2_m3));
-    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom1R(std::atan2(-1.0, 0.0)), atan2(rSimd_m1_m2_m3, setZero()));
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::atan2(0, c0), std::atan2(0, c1), std::atan2(0, c2)),
+                              atan2(setZero(), rSimd_c0c1c2));
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::atan2(c0, 0), std::atan2(c1, 0), std::atan2(c2, 0)),
+                              atan2(rSimd_c0c1c2, setZero()));
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::atan2(0, -c0), std::atan2(0, -c1), std::atan2(0, -c2)),
+                              atan2(setZero(), rSimd_m0m1m2));
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::atan2(-c0, 0), std::atan2(-c1, 0), std::atan2(-c2, 0)),
+                              atan2(rSimd_m0m1m2, setZero()));
     // degenerate value (origin) should return 0.0. At least IBM xlc 13.1.5 gets the reference
     // value wrong (-nan) at -O3 optimization, so we compare to the correct value (0.0) instead.
     GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom1R(0.0), atan2(setSimdRealFrom3R(0.0, 0.0, 0.0), setZero()));
@@ -511,7 +644,7 @@ TEST_F(SimdMathTest, invsqrtSingleAccuracy)
     /* Increase the allowed error by the difference between the actual precision and single */
     setUlpTol(ulpTol_ * (1LL << (std::numeric_limits<real>::digits-std::numeric_limits<float>::digits)));
 
-    setRange(1e-10, 1e10);
+    setRange(1.01*GMX_FLOAT_MIN, GMX_FLOAT_MAX);
     GMX_EXPECT_SIMD_FUNC_NEAR(refInvsqrt, invsqrtSingleAccuracy);
 }
 
@@ -538,7 +671,7 @@ TEST_F(SimdMathTest, invsqrtPairSingleAccuracy)
     /* Increase the allowed error by the difference between the actual precision and single */
     setUlpTol(ulpTol_ * (1LL << (std::numeric_limits<real>::digits-std::numeric_limits<float>::digits)));
 
-    setRange(1e-10, 1e10);
+    setRange(1.01*GMX_FLOAT_MIN, GMX_FLOAT_MAX);
     GMX_EXPECT_SIMD_FUNC_NEAR(refInvsqrt, tst_invsqrt_SingleAccuracy_pair0);
     GMX_EXPECT_SIMD_FUNC_NEAR(refInvsqrt, tst_invsqrt_SingleAccuracy_pair1);
 }
@@ -548,8 +681,29 @@ TEST_F(SimdMathTest, sqrtSingleAccuracy)
     /* Increase the allowed error by the difference between the actual precision and single */
     setUlpTol(ulpTol_ * (1LL << (std::numeric_limits<real>::digits-std::numeric_limits<float>::digits)));
 
-    // Just make sure sqrt(0)=0 works and isn't evaluated as 0*1/sqrt(0)=NaN
-    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(0, std::sqrt(3), 2), sqrtSingleAccuracy(setSimdRealFrom3R(0, 3, 4)));
+    // First test that 0.0 and a few other values works
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(0, std::sqrt(c0), std::sqrt(c1)), sqrtSingleAccuracy(setSimdRealFrom3R(0, c0, c1)));
+
+    // Values smaller-than-or-equal to GMX_FLOAT_MIN will be clamped to 0.0,
+    // so only test larger values
+    setRange(1.01*GMX_FLOAT_MIN, GMX_FLOAT_MAX);
+    GMX_EXPECT_SIMD_FUNC_NEAR(refSqrt, sqrtSingleAccuracy);
+
+#if GMX_DOUBLE
+    // Make sure that values smaller than GMX_FLOAT_MIN lead to result 0.0
+    setRange(0.0, 0.99*GMX_FLOAT_MIN);
+    GMX_EXPECT_SIMD_FUNC_NEAR(refZero, sqrtSingleAccuracy);
+#endif
+}
+
+TEST_F(SimdMathTest, sqrtSingleAccuracyUnsafe)
+{
+    /* Increase the allowed error by the difference between the actual precision and single */
+    setUlpTol(ulpTol_ * (1LL << (std::numeric_limits<real>::digits-std::numeric_limits<float>::digits)));
+
+    // Test the full range
+    setRange(GMX_FLOAT_MIN, GMX_FLOAT_MAX);
+    GMX_EXPECT_SIMD_FUNC_NEAR(refSqrt, sqrtSingleAccuracy<MathOptimization::Unsafe>);
 }
 
 TEST_F(SimdMathTest, invSingleAccuracy)
@@ -578,8 +732,40 @@ TEST_F(SimdMathTest, exp2SingleAccuracy)
     /* Increase the allowed error by the difference between the actual precision and single */
     setUlpTol(ulpTol_ * (1LL << (std::numeric_limits<real>::digits-std::numeric_limits<float>::digits)));
 
-    setRange(-100, 100);
+#if GMX_DOUBLE
+    setRange(-1022.49, 1023.49);
+#else
+    setRange(-126, 127.49);
+#endif
     GMX_EXPECT_SIMD_FUNC_NEAR(std::exp2, exp2SingleAccuracy);
+
+    // Test a range that should be zero both for reference and simd versions.
+    // Some implementations might have subnormal support, in which case they
+    // support an extended range, adding roughly the number of bits in the
+    // mantissa to the smallest allowed arg (1023+52 in double, 127+23 single).
+#if GMX_DOUBLE
+    setRange(-1000000.0, -1075.0);
+#else
+    setRange(-100000.0, -150.0);
+#endif
+    GMX_EXPECT_SIMD_FUNC_NEAR_DTZ(std::exp2, exp2SingleAccuracy);
+
+    // Test a few very negative values
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::exp2(-GMX_FLOAT_MAX), std::exp2(-0.1*GMX_REAL_MAX), std::exp2(-GMX_REAL_MAX)),
+                              exp2SingleAccuracy(setSimdRealFrom3R(-GMX_FLOAT_MAX, -0.1*GMX_REAL_MAX, -GMX_REAL_MAX)));
+}
+
+TEST_F(SimdMathTest, exp2SingleAccuracyUnsafe)
+{
+    /* Increase the allowed error by the difference between the actual precision and single */
+    setUlpTol(ulpTol_ * (1LL << (std::numeric_limits<real>::digits-std::numeric_limits<float>::digits)));
+
+#if GMX_DOUBLE
+    setRange(-1022.49, 1023.49);
+#else
+    setRange(-126, 127.49);
+#endif
+    GMX_EXPECT_SIMD_FUNC_NEAR(std::exp2, exp2SingleAccuracy<MathOptimization::Unsafe>);
 }
 
 TEST_F(SimdMathTest, expSingleAccuracy)
@@ -587,8 +773,42 @@ TEST_F(SimdMathTest, expSingleAccuracy)
     /* Increase the allowed error by the difference between the actual precision and single */
     setUlpTol(ulpTol_ * (1LL << (std::numeric_limits<real>::digits-std::numeric_limits<float>::digits)));
 
-    setRange(-75, 75);
+#if GMX_DOUBLE
+    setRange(-708.7, 709.4);
+#else
+    setRange(-87.3, 88.3);
+#endif
     GMX_EXPECT_SIMD_FUNC_NEAR(std::exp, expSingleAccuracy);
+
+    // Test a range that should be zero both for reference and simd versions.
+    // Some implementations might have subnormal support, in which case they
+    // support an extended range, adding roughly the number of bits in the
+    // mantissa to the smallest result exponent (1023+52 in double, 127+23 single).
+    // Then multiply with ln(2) to get our limit for exp().
+#if GMX_DOUBLE
+    setRange(-1000000.0, -746.0);
+#else
+    setRange(-100000.0, -104.0);
+#endif
+    GMX_EXPECT_SIMD_FUNC_NEAR_DTZ(std::exp, expSingleAccuracy);
+
+    // Test a few very negative values, including values so small that they
+    // will start to cause inf values in the polynomial interpolations
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::exp(-GMX_FLOAT_MAX), std::exp(-0.1*GMX_REAL_MAX), std::exp(-GMX_REAL_MAX)),
+                              expSingleAccuracy(setSimdRealFrom3R(-GMX_FLOAT_MAX, -0.1*GMX_REAL_MAX, -GMX_REAL_MAX)));
+}
+
+TEST_F(SimdMathTest, expSingleAccuracyUnsafe)
+{
+    /* Increase the allowed error by the difference between the actual precision and single */
+    setUlpTol(ulpTol_ * (1LL << (std::numeric_limits<real>::digits-std::numeric_limits<float>::digits)));
+
+#if GMX_DOUBLE
+    setRange(-708.7, 709.4);
+#else
+    setRange(-87.3, 88.3);
+#endif
+    GMX_EXPECT_SIMD_FUNC_NEAR(std::exp, expSingleAccuracy<MathOptimization::Unsafe>);
 }
 
 TEST_F(SimdMathTest, erfSingleAccuracy)
@@ -690,16 +910,25 @@ TEST_F(SimdMathTest, atan2SingleAccuracy)
     setUlpTol(ulpTol_ * (1LL << (std::numeric_limits<real>::digits-std::numeric_limits<float>::digits)));
 
     // test each quadrant
-    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom1R(std::atan2(1.0, 1.0)), atan2SingleAccuracy(rSimd_1_2_3, rSimd_1_2_3));
-    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom1R(std::atan2(-1.0, 1.0)), atan2SingleAccuracy(rSimd_m1_m2_m3, rSimd_1_2_3));
-    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom1R(std::atan2(-1.0, -1.0)), atan2SingleAccuracy(rSimd_m1_m2_m3, rSimd_m1_m2_m3));
-    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom1R(std::atan2(1.0, -1.0)), atan2SingleAccuracy(rSimd_1_2_3, rSimd_m1_m2_m3));
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::atan2(c0, c3), std::atan2(c1, c4), std::atan2(c2, c5)),
+                              atan2SingleAccuracy(rSimd_c0c1c2, rSimd_c3c4c5));
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::atan2(-c0, c3), std::atan2(-c1, c4), std::atan2(-c2, c5)),
+                              atan2SingleAccuracy(rSimd_m0m1m2, rSimd_c3c4c5));
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::atan2(-c0, -c3), std::atan2(-c1, -c0), std::atan2(-c2, -c4)),
+                              atan2SingleAccuracy(rSimd_m0m1m2, rSimd_m3m0m4));
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::atan2(c0, -c3), std::atan2(c1, -c0), std::atan2(c2, -c4)),
+                              atan2SingleAccuracy(rSimd_c0c1c2, rSimd_m3m0m4));
     // cases important for calculating angles
     // values on coordinate axes
-    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom1R(std::atan2(0.0, 1.0)), atan2SingleAccuracy(setZero(), rSimd_1_2_3));
-    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom1R(std::atan2(1.0, 0.0)), atan2SingleAccuracy(rSimd_1_2_3, setZero()));
-    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom1R(std::atan2(0.0, -1.0)), atan2SingleAccuracy(setZero(), rSimd_m1_m2_m3));
-    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom1R(std::atan2(-1.0, 0.0)), atan2SingleAccuracy(rSimd_m1_m2_m3, setZero()));
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::atan2(0, c0), std::atan2(0, c1), std::atan2(0, c2)),
+                              atan2SingleAccuracy(setZero(), rSimd_c0c1c2));
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::atan2(c0, 0), std::atan2(c1, 0), std::atan2(c2, 0)),
+                              atan2SingleAccuracy(rSimd_c0c1c2, setZero()));
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::atan2(0, -c0), std::atan2(0, -c1), std::atan2(0, -c2)),
+                              atan2SingleAccuracy(setZero(), rSimd_m0m1m2));
+    GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom3R(std::atan2(-c0, 0), std::atan2(-c1, 0), std::atan2(-c2, 0)),
+                              atan2SingleAccuracy(rSimd_m0m1m2, setZero()));
+
     // degenerate value (origin) should return 0.0. At least IBM xlc 13.1.5 gets the reference
     // value wrong (-nan) at -O3 optimization, so we compare to the correct value (0.0) instead.
     GMX_EXPECT_SIMD_REAL_NEAR(setSimdRealFrom1R(0.0), atan2SingleAccuracy(setSimdRealFrom3R(0.0, 0.0, 0.0), setZero()));
index fa1570ffa4a6faa0f2320f3a04c8fe291b36ada6..3fbc94c14f3407777b2dbba087cd466b24402062 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,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.
@@ -39,6 +39,7 @@
 #include "gromacs/simd/simd.h"
 #include "gromacs/simd/vector_operations.h"
 
+#include "data.h"
 #include "simd.h"
 
 #if GMX_SIMD
@@ -61,13 +62,15 @@ typedef SimdTest SimdVectorOperationsTest;
 
 TEST_F(SimdVectorOperationsTest, iprod)
 {
-    SimdReal aX       = setSimdRealFrom3R(1, 2, 3);
-    SimdReal aY       = setSimdRealFrom3R(3, 0, 5);
-    SimdReal aZ       = setSimdRealFrom3R(4, 1, 8);
-    SimdReal bX       = setSimdRealFrom3R(8, 3, 6);
-    SimdReal bY       = setSimdRealFrom3R(2, 3, 1);
-    SimdReal bZ       = setSimdRealFrom3R(5, 7, 9);
-    SimdReal iprodRef = setSimdRealFrom3R(34, 13, 95);
+    SimdReal aX       = rSimd_c0c1c2;
+    SimdReal aY       = rSimd_c3c4c5;
+    SimdReal aZ       = rSimd_c6c7c8;
+    SimdReal bX       = rSimd_c3c0c4;
+    SimdReal bY       = rSimd_c4c6c8;
+    SimdReal bZ       = rSimd_c7c2c3;
+    SimdReal iprodRef = setSimdRealFrom3R(c0*c3 + c3*c4 + c6*c7,
+                                          c1*c0 + c4*c6 + c7*c2,
+                                          c2*c4 + c5*c8 + c8*c3);
 
     setUlpTol(2);
     GMX_EXPECT_SIMD_REAL_NEAR(iprodRef, iprod(aX, aY, aZ, bX, bY, bZ));
@@ -75,10 +78,12 @@ TEST_F(SimdVectorOperationsTest, iprod)
 
 TEST_F(SimdVectorOperationsTest, norm2)
 {
-    SimdReal simdX    = setSimdRealFrom3R(1, 2, 3);
-    SimdReal simdY    = setSimdRealFrom3R(3, 0, 5);
-    SimdReal simdZ    = setSimdRealFrom3R(4, 1, 8);
-    SimdReal norm2Ref = setSimdRealFrom3R(26, 5, 98);
+    SimdReal simdX    = rSimd_c0c1c2;
+    SimdReal simdY    = rSimd_c3c4c5;
+    SimdReal simdZ    = rSimd_c6c7c8;
+    SimdReal norm2Ref = setSimdRealFrom3R(c0*c0 + c3*c3 + c6*c6,
+                                          c1*c1 + c4*c4 + c7*c7,
+                                          c2*c2 + c5*c5 + c8*c8);
 
     setUlpTol(2);
     GMX_EXPECT_SIMD_REAL_NEAR(norm2Ref, norm2(simdX, simdY, simdZ));
@@ -86,20 +91,29 @@ TEST_F(SimdVectorOperationsTest, norm2)
 
 TEST_F(SimdVectorOperationsTest, cprod)
 {
-    SimdReal aX    = setSimdRealFrom3R(1, 2, 3);
-    SimdReal aY    = setSimdRealFrom3R(3, 0, 5);
-    SimdReal aZ    = setSimdRealFrom3R(4, 1, 8);
-    SimdReal bX    = setSimdRealFrom3R(8, 3, 6);
-    SimdReal bY    = setSimdRealFrom3R(2, 3, 1);
-    SimdReal bZ    = setSimdRealFrom3R(5, 7, 9);
-    SimdReal refcX = setSimdRealFrom3R(7, -3, 37);
-    SimdReal refcY = setSimdRealFrom3R(27, -11, 21);
-    SimdReal refcZ = setSimdRealFrom3R(-22, 6, -27);
+    SimdReal aX    = rSimd_c0c1c2;
+    SimdReal aY    = rSimd_c3c4c5;
+    SimdReal aZ    = rSimd_c6c7c8;
+    SimdReal bX    = rSimd_c3c0c4;
+    SimdReal bY    = rSimd_c4c6c8;
+    SimdReal bZ    = rSimd_c7c2c3;
+    //The SIMD version might use FMA. If we don't force FMA for the reference value, the compiler is free to use FMA
+    //for either product. If the compiler uses FMA for one product and the SIMD version uses FMA for the other, the
+    //rounding error of each product adds up and the total possible ulp-error is 12.
+    SimdReal refcX = setSimdRealFrom3R( std::fma(-c6, c4, c3*c7), std::fma(-c7, c6, c4*c2), std::fma(-c8, c8, c5*c3));
+    SimdReal refcY = setSimdRealFrom3R( std::fma(-c0, c7, c6*c3), std::fma(-c1, c2, c7*c0), std::fma(-c2, c3, c8*c4));
+    SimdReal refcZ = setSimdRealFrom3R( std::fma(-c3, c3, c0*c4), std::fma(-c4, c0, c1*c6), std::fma(-c5, c4, c2*c8));
     SimdReal cX, cY, cZ;
 
+    //The test assumes that cprod uses FMA on architectures which have FMA so that the compiler can't choose which
+    //product is computed with FMA.
     cprod(aX, aY, aZ, bX, bY, bZ, &cX, &cY, &cZ);
 
-    setUlpTol(2);
+    //The test values cannot be computed without FMA for the case that SIMD has no FMA. Even if no explicit FMA were
+    //used, the compiler could choose to use FMA. This causes up to 6upl error because of the product is up to 6 times
+    //larger than the final result after the difference.
+    setUlpTol(GMX_SIMD_HAVE_FMA ? 0 : 6);
+
     GMX_EXPECT_SIMD_REAL_NEAR(refcX, cX);
     GMX_EXPECT_SIMD_REAL_NEAR(refcY, cY);
     GMX_EXPECT_SIMD_REAL_NEAR(refcZ, cZ);
index e6174ee6ab31c46706c750a2e6aa6c84bf2812a5..9dca30e03a0a4315ea534971d1b152b29be3a746 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,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.
@@ -140,13 +140,13 @@ cprod(SimdFloat ax, SimdFloat ay, SimdFloat az,
       SimdFloat *cx, SimdFloat *cy, SimdFloat *cz)
 {
     *cx = ay * bz;
-    *cx = *cx - az * by;
+    *cx = fnma(az, by, *cx);
 
     *cy = az * bx;
-    *cy = *cy - ax * bz;
+    *cy = fnma(ax, bz, *cy);
 
     *cz = ax * by;
-    *cz = *cz - ay * bx;
+    *cz = fnma(ay, bx, *cz);
 }
 #endif // GMX_SIMD_HAVE_FLOAT
 
index 44214e9b92ca056c57e56718f2de90f6e40d2703..2e9fbc1b8020201664bded23612d1d6cd63ab62f 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, by the GROMACS development team, led by
+ * 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.
@@ -143,19 +143,19 @@ int gmx_stats_get_point(gmx_stats_t gstats, real *x, real *y,
         outlier = (r > rmsd*level);
         if (outlier)
         {
-            if (NULL != x)
+            if (nullptr != x)
             {
                 *x  = stats->x[stats->np_c];
             }
-            if (NULL != y)
+            if (nullptr != y)
             {
                 *y  = stats->y[stats->np_c];
             }
-            if (NULL != dx)
+            if (nullptr != dx)
             {
                 *dx = stats->dx[stats->np_c];
             }
-            if (NULL != dy)
+            if (nullptr != dy)
             {
                 *dy = stats->dy[stats->np_c];
             }
@@ -180,8 +180,8 @@ int gmx_stats_add_points(gmx_stats_t gstats, int n, real *x, real *y,
     {
         int ok;
         if ((ok = gmx_stats_add_point(gstats, x[i], y[i],
-                                      (NULL != dx) ? dx[i] : 0,
-                                      (NULL != dy) ? dy[i] : 0)) != estatsOK)
+                                      (nullptr != dx) ? dx[i] : 0,
+                                      (nullptr != dy) ? dy[i] : 0)) != estatsOK)
         {
             return ok;
         }
@@ -329,27 +329,27 @@ int gmx_stats_get_ab(gmx_stats_t gstats, int weight,
     {
         return ok;
     }
-    if (NULL != a)
+    if (nullptr != a)
     {
         *a    = stats->a;
     }
-    if (NULL != b)
+    if (nullptr != b)
     {
         *b    = stats->b;
     }
-    if (NULL != da)
+    if (nullptr != da)
     {
         *da   = stats->sigma_a;
     }
-    if (NULL != db)
+    if (nullptr != db)
     {
         *db   = stats->sigma_b;
     }
-    if (NULL != chi2)
+    if (nullptr != chi2)
     {
         *chi2 = stats->chi2;
     }
-    if (NULL != Rfit)
+    if (nullptr != Rfit)
     {
         *Rfit = stats->Rfit;
     }
@@ -367,19 +367,19 @@ int gmx_stats_get_a(gmx_stats_t gstats, int weight, real *a, real *da,
     {
         return ok;
     }
-    if (NULL != a)
+    if (nullptr != a)
     {
         *a    = stats->aa;
     }
-    if (NULL != da)
+    if (nullptr != da)
     {
         *da   = stats->sigma_aa;
     }
-    if (NULL != chi2)
+    if (nullptr != chi2)
     {
         *chi2 = stats->chi2aa;
     }
-    if (NULL != Rfit)
+    if (nullptr != Rfit)
     {
         *Rfit = stats->Rfitaa;
     }
@@ -412,15 +412,15 @@ int gmx_stats_get_ase(gmx_stats_t gstats, real *aver, real *sigma, real *error)
         return ok;
     }
 
-    if (NULL != aver)
+    if (nullptr != aver)
     {
         *aver  = stats->aver;
     }
-    if (NULL != sigma)
+    if (nullptr != sigma)
     {
         *sigma = stats->sigma_aver;
     }
-    if (NULL != error)
+    if (nullptr != error)
     {
         *error = stats->error;
     }
@@ -674,7 +674,7 @@ int lsq_y_ax(int n, real x[], real y[], real *a)
     int         ok;
     real        da, chi2, Rfit;
 
-    gmx_stats_add_points(lsq, n, x, y, 0, 0);
+    gmx_stats_add_points(lsq, n, x, y, nullptr, nullptr);
     ok = gmx_stats_get_a(lsq, elsqWEIGHT_NONE, a, &da, &chi2, &Rfit);
     gmx_stats_free(lsq);
 
@@ -691,11 +691,11 @@ static int low_lsq_y_ax_b(int n, real *xr, double *xd, real yr[],
     {
         double pt;
 
-        if (xd != NULL)
+        if (xd != nullptr)
         {
             pt = xd[i];
         }
-        else if (xr != NULL)
+        else if (xr != nullptr)
         {
             pt = xr[i];
         }
@@ -710,7 +710,7 @@ static int low_lsq_y_ax_b(int n, real *xr, double *xd, real yr[],
             return ok;
         }
     }
-    ok = gmx_stats_get_ab(lsq, elsqWEIGHT_NONE, a, b, NULL, NULL, chi2, r);
+    ok = gmx_stats_get_ab(lsq, elsqWEIGHT_NONE, a, b, nullptr, nullptr, chi2, r);
     gmx_stats_free(lsq);
 
     return ok;
@@ -718,13 +718,13 @@ static int low_lsq_y_ax_b(int n, real *xr, double *xd, real yr[],
 
 int lsq_y_ax_b(int n, real x[], real y[], real *a, real *b, real *r, real *chi2)
 {
-    return low_lsq_y_ax_b(n, x, NULL, y, a, b, r, chi2);
+    return low_lsq_y_ax_b(n, x, nullptr, y, a, b, r, chi2);
 }
 
 int lsq_y_ax_b_xdouble(int n, double x[], real y[], real *a, real *b,
                        real *r, real *chi2)
 {
-    return low_lsq_y_ax_b(n, NULL, x, y, a, b, r, chi2);
+    return low_lsq_y_ax_b(n, nullptr, x, y, a, b, r, chi2);
 }
 
 int lsq_y_ax_b_error(int n, real x[], real y[], real dy[],
index 92cbe4ca5c83b978321e3b03ccc6eed6cdb39373..4333572aad3c94dabe77405c84fb08c7ca4921bc 100644 (file)
 #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/observableshistory.h"
+#include "gromacs/mdtypes/swaphistory.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/timing/wallcycle.h"
-#include "gromacs/topology/mtop_util.h"
+#include "gromacs/topology/mtop_lookup.h"
 #include "gromacs/topology/topology.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
@@ -73,8 +76,8 @@
 static const char *SwS      = {"SWAP:"};                                           /**< For output that comes from the swap module */
 static const char *SwSEmpty = {"     "};                                           /**< Placeholder for multi-line output */
 static const char* CompStr[eCompNR] = {"A", "B" };                                 /**< Compartment name */
-static const char *SwapStr[eSwapTypesNR+1] = { "", "X-", "Y-", "Z-", NULL};        /**< Name for the swap types. */
-static const char *DimStr[DIM+1] = { "X", "Y", "Z", NULL};                         /**< Name for the swap dimension. */
+static const char *SwapStr[eSwapTypesNR+1] = { "", "X-", "Y-", "Z-", nullptr};     /**< Name for the swap types. */
+static const char *DimStr[DIM+1] = { "X", "Y", "Z", nullptr};                      /**< Name for the swap dimension. */
 
 /** Keep track of through which channel the ions have passed */
 enum eChannelHistory {
@@ -312,7 +315,7 @@ static void get_molecule_center(
         rvec_add(reference, dx, correctPBCimage);
 
         /* Take weight into account */
-        if (NULL == weights)
+        if (nullptr == weights)
         {
             wi = 1.0;
         }
@@ -701,7 +704,7 @@ static void sortMoleculesIntoCompartments(
                 add_to_list(iAtom, &g->comp[comp], dist);
 
                 /* Master also checks for ion groups through which channel each ion has passed */
-                if (MASTER(cr) && (g->comp_now != NULL) && !bIsSolvent)
+                if (MASTER(cr) && (g->comp_now != nullptr) && !bIsSolvent)
                 {
                     int globalAtomNr = g->ind[iAtom] + 1; /* PDB index starts at 1 ... */
                     detect_flux_per_channel(g, globalAtomNr, comp, g->xc[iAtom],
@@ -737,7 +740,7 @@ static void sortMoleculesIntoCompartments(
         }
     }
 
-    if (bIsSolvent && NULL != fpout)
+    if (bIsSolvent && nullptr != fpout)
     {
         fprintf(fpout, "# Solv. molecules in comp.%s: %d   comp.%s: %d\n",
                 CompStr[eCompA], g->comp[eCompA].nMol,
@@ -842,7 +845,7 @@ static void get_initial_ioncounts(
  * over the values from .cpt file to the swap data structure.
  */
 static void get_initial_ioncounts_from_cpt(
-        t_inputrec *ir, swapstate_t *swapstate,
+        t_inputrec *ir, swaphistory_t *swapstate,
         t_commrec *cr, gmx_bool bVerbose)
 {
     t_swapcoords    *sc;
@@ -924,10 +927,10 @@ static void bc_initial_concentrations(
 /*! \brief Ensure that each atom belongs to at most one of the swap groups. */
 static void check_swap_groups(t_swap *s, int nat, gmx_bool bVerbose)
 {
-    int  *nGroup    = NULL; /* This array counts for each atom in the MD system to
-                               how many swap groups it belongs (should be 0 or 1!) */
+    int  *nGroup    = nullptr; /* This array counts for each atom in the MD system to
+                                  how many swap groups it belongs (should be 0 or 1!) */
     int   ind       = -1;
-    int   nMultiple = 0;    /* Number of atoms belonging to multiple groups */
+    int   nMultiple = 0;       /* Number of atoms belonging to multiple groups */
 
 
     if (bVerbose)
@@ -975,17 +978,16 @@ static int get_group_apm_check(
         int                         igroup,
         t_swap                     *s,
         gmx_bool                    bVerbose,
-        const gmx_mtop_atomlookup_t alook,
         gmx_mtop_t                 *mtop)
 {
-    int        molb, molnr, atnr_mol;
     t_swapgrp *g   = &s->group[igroup];
     int       *ind = s->group[igroup].ind;
     int        nat = s->group[igroup].nat;
 
     /* Determine the number of solvent atoms per solvent molecule from the
      * first solvent atom: */
-    gmx_mtop_atomnr_to_molblock_ind(alook, ind[0], &molb, &molnr, &atnr_mol);
+    int molb = 0;
+    mtopGetMolblockIndex(mtop, ind[0], &molb, nullptr, nullptr);
     int apm = mtop->molblock[molb].natoms_mol;
 
     if (bVerbose)
@@ -997,7 +999,7 @@ static int get_group_apm_check(
     /* Check whether this is also true for all other solvent atoms */
     for (int i = 1; i < nat; i++)
     {
-        gmx_mtop_atomnr_to_molblock_ind(alook, ind[i], &molb, &molnr, &atnr_mol);
+        mtopGetMolblockIndex(mtop, ind[i], &molb, nullptr, nullptr);
         if (apm != mtop->molblock[molb].natoms_mol)
         {
             gmx_fatal(FARGS, "Not all molecules of swap group %d consist of %d atoms.",
@@ -1047,9 +1049,9 @@ static void print_ionlist_legend(t_inputrec             *ir,
     }
 
     // Center of split groups
-    snprintf(buf, STRLEN, "%scenter of %s of split group 0", SwapStr[ir->eSwapCoords], (NULL != s->group[eGrpSplit0].m) ? "mass" : "geometry");
+    snprintf(buf, STRLEN, "%scenter of %s of split group 0", SwapStr[ir->eSwapCoords], (nullptr != s->group[eGrpSplit0].m) ? "mass" : "geometry");
     legend[count++] = gmx_strdup(buf);
-    snprintf(buf, STRLEN, "%scenter of %s of split group 1", SwapStr[ir->eSwapCoords], (NULL != s->group[eGrpSplit1].m) ? "mass" : "geometry");
+    snprintf(buf, STRLEN, "%scenter of %s of split group 1", SwapStr[ir->eSwapCoords], (nullptr != s->group[eGrpSplit1].m) ? "mass" : "geometry");
     legend[count++] = gmx_strdup(buf);
 
     // Ion flux for each channel and ion type
@@ -1089,30 +1091,24 @@ static void print_ionlist_legend(t_inputrec             *ir,
  * they go.
  */
 static void detect_flux_per_channel_init(
-        t_commrec   *cr,
-        t_swap      *s,
-        swapstate_t *swapstate,
-        gmx_bool     bStartFromCpt)
+        t_swap        *s,
+        swaphistory_t *swapstate,
+        gmx_bool       bStartFromCpt)
 {
     t_swapgrp       *g;
     swapstateIons_t *gs;
 
+    /* All these flux detection routines run on the master only */
+    if (swapstate == nullptr)
+    {
+        return;
+    }
 
     for (int ig = eSwapFixedGrpNR; ig < s->ngrp; ig++)
     {
         g  = &s->group[ig];
         gs = &swapstate->ionType[ig - eSwapFixedGrpNR];
 
-        /* All these flux detection routines run on the master only */
-        if (!MASTER(cr))
-        {
-            g->comp_now      = NULL;
-            g->comp_from     = NULL;
-            g->channel_label = NULL;
-
-            return;
-        }
-
         /******************************************************/
         /* Channel and domain history for the individual ions */
         /******************************************************/
@@ -1205,13 +1201,13 @@ static void outputStartStructureIfWanted(gmx_mtop_t *mtop, rvec *x, int ePBC, ma
 {
     char *env = getenv("GMX_COMPELDUMP");
 
-    if (env != NULL)
+    if (env != nullptr)
     {
         fprintf(stderr, "\n%s Found env.var. GMX_COMPELDUMP, will output CompEL starting structure made whole.\n"
                 "%s In case of multimeric channels, please check whether they have the correct PBC representation.\n",
                 SwS, SwSEmpty);
 
-        write_sto_conf_mtop("CompELAssumedWholeConfiguration.pdb", *mtop->name, mtop, x, NULL, ePBC, box);
+        write_sto_conf_mtop("CompELAssumedWholeConfiguration.pdb", *mtop->name, mtop, x, nullptr, ePBC, box);
     }
 }
 
@@ -1227,14 +1223,14 @@ static void outputStartStructureIfWanted(gmx_mtop_t *mtop, rvec *x, int ePBC, ma
  * multimeric channels at the last time step.
  */
 static void init_swapstate(
-        swapstate_t      *swapstate,
+        swaphistory_t    *swapstate,
         t_swapcoords     *sc,
         gmx_mtop_t       *mtop,
         rvec              x[],      /* the initial positions */
         matrix            box,
-        int               ePBC)
+        t_inputrec       *ir)
 {
-    rvec      *x_pbc  = NULL; /* positions of the whole MD system with molecules made whole */
+    rvec      *x_pbc  = nullptr; /* positions of the whole MD system with molecules made whole */
     t_swapgrp *g;
     t_swap    *s;
 
@@ -1259,6 +1255,8 @@ static void init_swapstate(
     }
     else
     {
+        swapstate->eSwapCoords = ir->eSwapCoords;
+
         /* Set the number of ion types and allocate memory for checkpointing */
         swapstate->nIonTypes = s->ngrp - eSwapFixedGrpNR;
         snew(swapstate->ionType, swapstate->nIonTypes);
@@ -1278,10 +1276,10 @@ static void init_swapstate(
         copy_rvecn(x, x_pbc, 0, mtop->natoms);
 
         /* This can only make individual molecules whole, not multimers */
-        do_pbc_mtop(NULL, ePBC, box, mtop, x_pbc);
+        do_pbc_mtop(nullptr, ir->ePBC, box, mtop, x_pbc);
 
         /* Output the starting structure? */
-        outputStartStructureIfWanted(mtop, x_pbc, ePBC, box);
+        outputStartStructureIfWanted(mtop, x_pbc, ir->ePBC, box);
 
         /* If this is the first run (i.e. no checkpoint present) we assume
          * that the starting positions give us the correct PBC representation */
@@ -1338,7 +1336,7 @@ static real getRequestedChargeImbalance(t_swap *s)
  * This routine should be called for the 'anions' and 'cations' group,
  * of which the indices were lumped together in the older version of the code.
  */
-void copyIndicesToGroup(
+static void copyIndicesToGroup(
         int         *indIons,
         int          nIons,
         t_swapGroup *g,
@@ -1382,14 +1380,12 @@ void copyIndicesToGroup(
  * #4 cations        - empty before conversion
  *
  */
-void convertOldToNewGroupFormat(
+static void convertOldToNewGroupFormat(
         t_swapcoords *sc,
         gmx_mtop_t   *mtop,
         gmx_bool      bVerbose,
         t_commrec    *cr)
 {
-    t_atom                *atom;
-    gmx_mtop_atomlookup_t  alook = gmx_mtop_atomlookup_init(mtop);
     t_swapGroup           *g     = &sc->grp[3];
 
     /* Loop through the atom indices of group #3 (anions) and put all indices
@@ -1397,15 +1393,16 @@ void convertOldToNewGroupFormat(
      */
     int  nAnions    = 0;
     int  nCations   = 0;
-    int *indAnions  = NULL;
-    int *indCations = NULL;
+    int *indAnions  = nullptr;
+    int *indCations = nullptr;
     snew(indAnions, g->nat);
     snew(indCations, g->nat);
 
+    int molb = 0;
     for (int i = 0; i < g->nat; i++)
     {
-        gmx_mtop_atomnr_to_atom(alook, g->ind[i], &atom);
-        if (atom->q < 0)
+        const t_atom &atom = mtopGetAtomParameters(mtop, g->ind[i], &molb);
+        if (atom.q < 0)
         {
             // This is an anion, add it to the list of anions
             indAnions[nAnions++] = g->ind[i];
@@ -1440,7 +1437,7 @@ void convertOldToNewGroupFormat(
 /*! \brief Returns TRUE if we started from an old .tpr
  *
  * Then we need to re-sort anions and cations into separate groups */
-gmx_bool bConvertFromOldTpr(t_swapcoords *sc)
+static gmx_bool bConvertFromOldTpr(t_swapcoords *sc)
 {
     // If the last group has no atoms it means we need to convert!
     if ( (sc->ngrp >= 5) && (0 == sc->grp[4].nat) )
@@ -1453,41 +1450,36 @@ gmx_bool bConvertFromOldTpr(t_swapcoords *sc)
 
 void init_swapcoords(
         FILE                   *fplog,
-        gmx_bool                bVerbose,
         t_inputrec             *ir,
         const char             *fn,
         gmx_mtop_t             *mtop,
         rvec                    x[],
         matrix                  box,
-        swapstate_t            *swapstate,
+        ObservablesHistory     *oh,
         t_commrec              *cr,
         const gmx_output_env_t *oenv,
-        unsigned long           Flags)
+        const MdrunOptions     &mdrunOptions)
 {
     t_swapcoords          *sc;
     t_swap                *s;
-    t_atom                *atom;
     t_swapgrp             *g;
     swapstateIons_t       *gs;
-    gmx_bool               bAppend, bStartFromCpt, bRerun;
-    gmx_mtop_atomlookup_t  alook = NULL;
-
-    alook = gmx_mtop_atomlookup_init(mtop);
+    gmx_bool               bAppend, bStartFromCpt;
+    swaphistory_t         *swapstate = nullptr;
 
     if ( (PAR(cr)) && !DOMAINDECOMP(cr) )
     {
         gmx_fatal(FARGS, "Position swapping is only implemented for domain decomposition!");
     }
 
-    bAppend       = Flags & MD_APPENDFILES;
-    bStartFromCpt = Flags & MD_STARTFROMCPT;
-    bRerun        = Flags & MD_RERUN;
+    bAppend       = mdrunOptions.continuationOptions.appendFiles;
+    bStartFromCpt = mdrunOptions.continuationOptions.startedFromCheckpoint;
 
     sc = ir->swap;
     snew(sc->si_priv, 1);
     s = sc->si_priv;
 
-    if (bRerun)
+    if (mdrunOptions.rerun)
     {
         if (PAR(cr))
         {
@@ -1521,6 +1513,8 @@ void init_swapcoords(
             break;
     }
 
+    const gmx_bool bVerbose = mdrunOptions.verbose;
+
     // For compatibility with old .tpr files
     if (bConvertFromOldTpr(sc) )
     {
@@ -1562,7 +1556,13 @@ void init_swapcoords(
 
     if (MASTER(cr))
     {
-        init_swapstate(swapstate, sc, mtop, x, box, ir->ePBC);
+        if (oh->swapHistory == nullptr)
+        {
+            oh->swapHistory = std::unique_ptr<swaphistory_t>(new swaphistory_t {});
+        }
+        swapstate = oh->swapHistory.get();
+
+        init_swapstate(swapstate, sc, mtop, x, box, ir);
     }
 
     /* After init_swapstate we have a set of (old) whole positions for our
@@ -1583,17 +1583,18 @@ void init_swapcoords(
         real charge;
 
         g      = &(s->group[ig]);
-        g->apm = get_group_apm_check(ig, s, MASTER(cr) && bVerbose, alook, mtop);
+        g->apm = get_group_apm_check(ig, s, MASTER(cr) && bVerbose, mtop);
 
         /* Since all molecules of a group are equal, we only need enough space
          * to determine properties of a single molecule at at time */
         snew(g->m, g->apm);  /* For the center of mass */
         charge = 0;          /* To determine the charge imbalance */
+        int molb = 0;
         for (int j = 0; j < g->apm; j++)
         {
-            gmx_mtop_atomnr_to_atom(alook, g->ind[j], &atom);
-            g->m[j] = atom->m;
-            charge += atom->q;
+            const t_atom &atom = mtopGetAtomParameters(mtop, g->ind[j], &molb);
+            g->m[j] = atom.m;
+            charge += atom.q;
         }
         /* Total charge of one molecule of this group: */
         g->q = charge;
@@ -1608,10 +1609,10 @@ void init_swapcoords(
         {
             /* Save the split group masses if mass-weighting is requested */
             snew(g->m, g->nat);
+            int molb = 0;
             for (int i = 0; i < g->nat; i++)
             {
-                gmx_mtop_atomnr_to_atom(alook, g->ind[i], &atom);
-                g->m[i] = atom->m;
+                g->m[i] = mtopGetAtomMass(mtop, g->ind[i], &molb);
             }
         }
     }
@@ -1686,7 +1687,7 @@ void init_swapcoords(
                     sc->cyl1r, sc->cyl1u, sc->cyl1l);
 
             fprintf(s->fpout, "#\n");
-            if (!bRerun)
+            if (!mdrunOptions.rerun)
             {
                 fprintf(s->fpout, "# Coupling constant (number of swap attempt steps to average over): %d  (translates to %f ps).\n",
                         sc->nAverage, sc->nAverage*sc->nstswap*ir->delta_t);
@@ -1698,7 +1699,7 @@ void init_swapcoords(
     }
     else
     {
-        s->fpout = NULL;
+        s->fpout = nullptr;
     }
 
     /* Prepare for parallel or serial run */
@@ -1709,7 +1710,7 @@ void init_swapcoords(
             g             = &(s->group[ig]);
             g->nat_loc    = 0;
             g->nalloc_loc = 0;
-            g->ind_loc    = NULL;
+            g->ind_loc    = nullptr;
         }
     }
     else
@@ -1747,7 +1748,7 @@ void init_swapcoords(
         else
         {
             fprintf(stderr, "%s Determining initial numbers of ions per compartment.\n", SwS);
-            get_initial_ioncounts(ir, x, box, cr, bRerun);
+            get_initial_ioncounts(ir, x, box, cr, mdrunOptions.rerun);
         }
 
         /* Prepare (further) checkpoint writes ... */
@@ -1807,7 +1808,7 @@ void init_swapcoords(
     }
 
     /* Initialize arrays that keep track of through which channel the ions go */
-    detect_flux_per_channel_init(cr, s, swapstate, bStartFromCpt);
+    detect_flux_per_channel_init(s, swapstate, bStartFromCpt);
 
     /* We need to print the legend if we open this file for the first time. */
     if (MASTER(cr) && !bAppend)
@@ -1978,10 +1979,9 @@ gmx_bool do_swapcoords(
         gmx_int64_t       step,
         double            t,
         t_inputrec       *ir,
-        gmx_wallcycle_t   wcycle,
+        gmx_wallcycle    *wcycle,
         rvec              x[],
         matrix            box,
-        gmx_mtop_t       *mtop,
         gmx_bool          bVerbose,
         gmx_bool          bRerun)
 {
@@ -1993,7 +1993,6 @@ gmx_bool do_swapcoords(
     t_swapgrp            *g, *gsol;
     int                   isol, iion;
     rvec                  com_solvent, com_particle; /* solvent and swap molecule's center of mass */
-    gmx_mtop_atomlookup_t alook = NULL;
 
 
     wallcycle_start(wcycle, ewcSWAP);
@@ -2022,8 +2021,8 @@ gmx_bool do_swapcoords(
     for (ig = eSwapFixedGrpNR; ig < s->ngrp; ig++)
     {
         g = &(s->group[ig]);
-        communicate_group_positions(cr, g->xc, NULL, NULL, FALSE,
-                                    x, g->nat, g->nat_loc, g->ind_loc, g->c_ind_loc, NULL, NULL);
+        communicate_group_positions(cr, g->xc, nullptr, nullptr, FALSE,
+                                    x, g->nat, g->nat_loc, g->ind_loc, g->c_ind_loc, nullptr, nullptr);
 
         /* Determine how many ions of this type each compartment contains */
         sortMoleculesIntoCompartments(g, cr, sc, box, step, s->fpout, bRerun, FALSE);
@@ -2049,8 +2048,8 @@ gmx_bool do_swapcoords(
         /* Since we here know that we have to perform ion/water position exchanges,
          * we now assemble the solvent positions */
         g = &(s->group[eGrpSolvent]);
-        communicate_group_positions(cr, g->xc, NULL, NULL, FALSE,
-                                    x, g->nat, g->nat_loc, g->ind_loc, g->c_ind_loc, NULL, NULL);
+        communicate_group_positions(cr, g->xc, nullptr, nullptr, FALSE,
+                                    x, g->nat, g->nat_loc, g->ind_loc, g->c_ind_loc, nullptr, nullptr);
 
         /* Determine how many molecules of solvent each compartment contains */
         sortMoleculesIntoCompartments(g, cr, sc, box, step, s->fpout, bRerun, TRUE);
@@ -2074,7 +2073,6 @@ gmx_bool do_swapcoords(
         }
 
         /* Now actually perform the particle exchanges, one swap group after another */
-        alook  = gmx_mtop_atomlookup_init(mtop);
         gsol   = &s->group[eGrpSolvent];
         for (ig = eSwapFixedGrpNR; ig < s->ngrp; ig++)
         {
@@ -2136,9 +2134,8 @@ gmx_bool do_swapcoords(
                         SwS, nswaps, nswaps > 1 ? "s" : "", step, g->molname);
             }
         }
-        gmx_mtop_atomlookup_destroy(alook);
 
-        if (s->fpout != NULL)
+        if (s->fpout != nullptr)
         {
             print_ionlist(s, t, "  # after swap");
         }
index 8ce0b590f7cbb48d49cb75edcf56c817e567f4f4..3adaa006201c1bde0ad89776e7d117a0ffd544ba 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
 #ifndef GMX_SWAP_SWAPCOORDS_H
 #define GMX_SWAP_SWAPCOORDS_H
 
-#include "gromacs/mdtypes/commrec.h"
-#include "gromacs/timing/wallcycle.h"
+#include <cstdio>
 
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+
+struct gmx_domdec_t;
 struct gmx_mtop_t;
 struct gmx_output_env_t;
-struct swapstate_t;
+struct gmx_wallcycle;
+struct MdrunOptions;
+struct swaphistory_t;
+struct t_commrec;
 struct t_inputrec;
 struct t_swapcoords;
+struct ObservablesHistory;
+
 
 /*! \brief Initialize ion / water position swapping ("Computational Electrophysiology").
  *
@@ -67,31 +75,28 @@ struct t_swapcoords;
  * the output file, sets up swap data checkpoint writing, etc.
  *
  * \param[in] fplog         General output file, normally md.log.
- * \param[in] bVerbose      Should we be quiet or verbose?
  * \param[in] ir            Structure containing MD input parameters, among those
  *                          also the structure needed for position swapping.
  * \param[in] fn            Output file name for swap data.
  * \param[in] mtop          Molecular topology.
  * \param[in] x             The initial positions of all particles.
  * \param[in] box           The simulation box.
- * \param[in] swapstate     Swap-related data that is read from or written to checkpoint.
+ * \param[in] oh            Contains struct with swap data that is read from or written to checkpoint.
  * \param[in] cr            Pointer to MPI communication data.
  * \param[in] oenv          Needed to open the swap output XVGR file.
- * \param[in] Flags         Flags passed over from main, used to determine
- *                          whether we are doing a rerun, appending, etc.
+ * \param[in] mdrunOptions  Options for mdrun.
  */
 void init_swapcoords(
         FILE                   *fplog,
-        gmx_bool                bVerbose,
         t_inputrec             *ir,
         const char             *fn,
         gmx_mtop_t             *mtop,
         rvec                    x[],
         matrix                  box,
-        swapstate_t            *swapstate,
+        ObservablesHistory     *oh,
         t_commrec              *cr,
         const gmx_output_env_t *oenv,
-        unsigned long           Flags);
+        const MdrunOptions     &mdrunOptions);
 
 
 /*! \brief Finalizes ion / water position swapping.
@@ -121,7 +126,6 @@ void dd_make_local_swap_groups(gmx_domdec_t *dd, t_swapcoords *si_pub);
  * \param[in] wcycle   Count wallcycles of swap routines for diagnostic output.
  * \param[in] x        Positions of home particles this node owns.
  * \param[in] box      The simulation box.
- * \param[in] mtop     Molecular topology.
  * \param[in] bVerbose Should we be quiet or verbose?
  * \param[in] bRerun   Are we doing a rerun?
  *
@@ -132,10 +136,9 @@ gmx_bool do_swapcoords(
         gmx_int64_t       step,
         double            t,
         t_inputrec       *ir,
-        gmx_wallcycle_t   wcycle,
+        gmx_wallcycle    *wcycle,
         rvec              x[],
         matrix            box,
-        gmx_mtop_t       *mtop,
         gmx_bool          bVerbose,
         gmx_bool          bRerun);
 
index 6b4ed587fe4d0ee69ff2c60f7b9912eb8317e001..935f31a0fc268117063fce3563c00b889753a826 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2015, by the GROMACS development team, led by
+# Copyright (c) 2015,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.
@@ -36,5 +36,5 @@ file(GLOB TABLE_SOURCES *.cpp)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${TABLE_SOURCES} PARENT_SCOPE)
 
 if (BUILD_TESTING)
-#    add_subdirectory(tests)
+    add_subdirectory(tests)
 endif()
diff --git a/src/gromacs/tables/cubicsplinetable.cpp b/src/gromacs/tables/cubicsplinetable.cpp
new file mode 100644 (file)
index 0000000..f0b589e
--- /dev/null
@@ -0,0 +1,490 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+
+/*! \internal \file
+ * \brief
+ * Implements classes for cubic spline table functions
+ *
+ * \author Erik Lindahl <erik.lindahl@gmail.com>
+ * \ingroup module_tables
+ */
+#include "gmxpre.h"
+
+#include "cubicsplinetable.h"
+
+#include <cmath>
+
+#include <algorithm>
+#include <functional>
+#include <initializer_list>
+#include <utility>
+#include <vector>
+
+#include "gromacs/tables/tableinput.h"
+#include "gromacs/utility/alignedallocator.h"
+#include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/real.h"
+
+#include "splineutil.h"
+
+namespace gmx
+{
+
+namespace
+{
+
+/*! \brief Calculate table elements from function/derivative data
+ *
+ * \param functionValue0   Function value for the present table index
+ * \param functionValue1   Function value for the next table index
+ * \param derivativeValue0 Derivative value for the present table index
+ * \param derivativeValue1 Derivative value for the next table index
+ * \param spacing          Distance between table points
+ * \param Y                Function value for table index
+ * \param F                Component to multiply with offset eps
+ * \param G                Component to multiply with eps^2
+ * \param H                Component to multiply with eps^3
+ */
+void
+calculateCubicSplineCoefficients(double  functionValue0,
+                                 double  functionValue1,
+                                 double  derivativeValue0,
+                                 double  derivativeValue1,
+                                 double  spacing,
+                                 double *Y,
+                                 double *F,
+                                 double *G,
+                                 double *H)
+{
+    *Y  =  functionValue0;
+    *F  =  spacing * derivativeValue0;
+    *G  =  3.0*( functionValue1 - functionValue0) - spacing * (derivativeValue1 + 2.0 * derivativeValue0);
+    *H  = -2.0*( functionValue1 - functionValue0) + spacing * (derivativeValue1 + derivativeValue0);
+}
+
+/*! \brief Perform cubic spline interpolation in interval from function/derivative
+ *
+ * \param      functionValue0               Function value for the present table index
+ * \param      functionValue1               Function value for the next table index
+ * \param      derivativeValue0             Derivative value for the present table index
+ * \param      derivativeValue1             Derivative value for the next table index
+ * \param      spacing                      Distance between table points
+ * \param      eps                          Offset from lower table point for evaluation
+ * \param[out] interpolatedFunctionValue    Output function value
+ * \param[out] interpolatedDerivativeValue  Output derivative value
+ */
+void
+cubicSplineInterpolationFromFunctionAndDerivative(double  functionValue0,
+                                                  double  functionValue1,
+                                                  double  derivativeValue0,
+                                                  double  derivativeValue1,
+                                                  double  spacing,
+                                                  double  eps,
+                                                  double *interpolatedFunctionValue,
+                                                  double *interpolatedDerivativeValue)
+{
+    double Y, F, G, H;
+
+    calculateCubicSplineCoefficients(functionValue0, functionValue1,
+                                     derivativeValue0, derivativeValue1,
+                                     spacing,
+                                     &Y, &F, &G, &H);
+
+    double Fp = fma(fma(H, eps, G), eps, F);
+
+    *interpolatedFunctionValue   = fma(Fp, eps, Y);
+    *interpolatedDerivativeValue = fma(eps, fma(2.0*eps, H, G), Fp)/spacing;
+}
+
+
+
+/*! \brief Construct the data for a single cubic table from analytical functions
+ *
+ * \param[in]  function             Analytical functiojn
+ * \param[in]  derivative           Analytical derivative
+ * \param[in]  range                Upper/lower limit of region to tabulate
+ * \param[in]  spacing              Distance between table points
+ * \param[out] yfghTableData        Output cubic spline table with Y,F,G,H entries
+ */
+void
+fillSingleCubicSplineTableData(const std::function<double(double)>   &function,
+                               const std::function<double(double)>   &derivative,
+                               const std::pair<real, real>           &range,
+                               double                                 spacing,
+                               std::vector<real>                     *yfghTableData)
+{
+    int  endIndex   = range.second / spacing + 2;
+
+    yfghTableData->resize(4*endIndex);
+
+    double       maxMagnitude      = 0.0001*GMX_REAL_MAX;
+    bool         functionIsInRange = true;
+    std::size_t  lastIndexInRange  = endIndex - 1;
+
+    for (int i = endIndex - 1; i >= 0; i--)
+    {
+        double x                    = i * spacing;
+        double tmpFunctionValue;
+        double tmpDerivativeValue;
+        double nextHigherFunction;
+        double nextHigherDerivative;
+        double Y, F, G, H;
+
+        if (range.first > 0 && i == 0)
+        {
+            // Avoid x==0 if it is not in the range, since it can lead to
+            // singularities even if the value for i==1 was within or required magnitude
+            functionIsInRange = false;
+        }
+
+        if (functionIsInRange)
+        {
+            tmpFunctionValue     = function(x);
+            tmpDerivativeValue   = derivative(x);
+            nextHigherFunction   = ((i+1) < endIndex) ? function(x+spacing) : 0.0;
+            nextHigherDerivative = ((i+1) < endIndex) ? derivative(x+spacing) : 0.0;
+
+            if (std::abs(tmpFunctionValue) > maxMagnitude || std::abs(tmpDerivativeValue) > maxMagnitude)
+            {
+                functionIsInRange = false; // Once this happens, it never resets to true again
+            }
+        }
+
+        if (functionIsInRange)
+        {
+            calculateCubicSplineCoefficients(tmpFunctionValue, nextHigherFunction,
+                                             tmpDerivativeValue, nextHigherDerivative,
+                                             spacing,
+                                             &Y, &F, &G, &H);
+            lastIndexInRange--;
+        }
+        else
+        {
+            double lastIndexY = (*yfghTableData)[4*lastIndexInRange];
+            double lastIndexF = (*yfghTableData)[4*lastIndexInRange + 1];
+
+            Y = lastIndexY + lastIndexF * (i - lastIndexInRange);
+            F = lastIndexF;
+            G = 0.0;
+            H = 0.0;
+        }
+
+        (*yfghTableData)[4*i  ] = Y;
+        (*yfghTableData)[4*i+1] = F;
+        (*yfghTableData)[4*i+2] = G;
+        (*yfghTableData)[4*i+3] = H;
+    }
+}
+
+
+/*! \brief Construct the data for a single cubic table from vector data
+ *
+ * \param[in]  function             Input vector with function data
+ * \param[in]  derivative           Input vector with derivative data
+ * \param[in]  inputSpacing         Distance between points in input vectors
+ * \param[in]  range                Upper/lower limit of region to tabulate
+ * \param[in]  spacing              Distance between table points
+ * \param[out] yfghTableData        Output cubic spline table with Y,F,G,H entries
+ */
+void
+fillSingleCubicSplineTableData(ConstArrayRef<double>                  function,
+                               ConstArrayRef<double>                  derivative,
+                               double                                 inputSpacing,
+                               const std::pair<real, real>           &range,
+                               double                                 spacing,
+                               std::vector<real>                     *yfghTableData)
+{
+    int                 endIndex   = range.second / spacing + 2;
+
+    std::vector<double> tmpFunction(endIndex);
+    std::vector<double> tmpDerivative(endIndex);
+
+    double              maxMagnitude      = 0.0001*GMX_REAL_MAX;
+    bool                functionIsInRange = true;
+    std::size_t         lastIndexInRange  = endIndex - 1;
+
+    // Interpolate function and derivative values in positions needed for output
+    for (int i = endIndex - 1; i >= 0; i--)
+    {
+        double x     = i * spacing;
+        double xtab  = x / inputSpacing;
+        int    index = xtab;
+        double eps   = xtab - index;
+
+        if (range.first > 0 && i == 0)
+        {
+            // Avoid x==0 if it is not in the range, since it can lead to
+            // singularities even if the value for i==1 was within or required magnitude
+            functionIsInRange = false;
+        }
+
+        if (functionIsInRange && (std::abs(function[index]) > maxMagnitude || std::abs(derivative[index]) > maxMagnitude))
+        {
+            functionIsInRange = false; // Once this happens, it never resets to true again
+        }
+
+        if (functionIsInRange)
+        {
+            cubicSplineInterpolationFromFunctionAndDerivative(function[index],
+                                                              function[index+1],
+                                                              derivative[index],
+                                                              derivative[index+1],
+                                                              inputSpacing,
+                                                              eps,
+                                                              &(tmpFunction[i]),
+                                                              &(tmpDerivative[i]));
+            lastIndexInRange--;
+        }
+        else
+        {
+            double lastIndexFunction   = tmpFunction[lastIndexInRange];
+            double lastIndexDerivative = tmpDerivative[lastIndexInRange];
+            tmpFunction[i]             = lastIndexFunction + lastIndexDerivative * (i - lastIndexInRange) * spacing;
+            tmpDerivative[i]           = lastIndexDerivative;
+        }
+    }
+
+    yfghTableData->resize(4*endIndex);
+
+    for (int i = 0; i < endIndex; i++)
+    {
+        double Y, F, G, H;
+
+        double nextFunction   = ((i+1) < endIndex) ? tmpFunction[i+1] : 0.0;
+        double nextDerivative = ((i+1) < endIndex) ? tmpDerivative[i+1] : 0.0;
+
+        calculateCubicSplineCoefficients(tmpFunction[i], nextFunction,
+                                         tmpDerivative[i], nextDerivative,
+                                         spacing,
+                                         &Y, &F, &G, &H);
+        (*yfghTableData)[4*i  ] = Y;
+        (*yfghTableData)[4*i+1] = F;
+        (*yfghTableData)[4*i+2] = G;
+        (*yfghTableData)[4*i+3] = H;
+    }
+
+}
+
+}   // namespace anonymous
+
+
+
+#if GMX_DOUBLE
+const real
+CubicSplineTable::defaultTolerance = 1e-10;
+#else
+const real
+CubicSplineTable::defaultTolerance = 10.0 * GMX_FLOAT_EPS;
+#endif
+
+CubicSplineTable::CubicSplineTable(std::initializer_list<AnalyticalSplineTableInput>   analyticalInputList,
+                                   const std::pair<real, real>                        &range,
+                                   real                                                tolerance)
+    : numFuncInTable_(analyticalInputList.size()), range_(range)
+{
+    // Sanity check on input values
+    if (range_.first < 0.0 || (range_.second-range_.first) < 0.001)
+    {
+        GMX_THROW(InvalidInputError("Range to tabulate cannot include negative values and must span at least 0.001"));
+    }
+
+    if (tolerance < GMX_REAL_EPS)
+    {
+        GMX_THROW(ToleranceError("Table tolerance cannot be smaller than GMX_REAL_EPS"));
+    }
+
+    double minQuotient = GMX_REAL_MAX;
+
+    // loop over all functions to find smallest spacing
+    for (auto thisFuncInput : analyticalInputList)
+    {
+        try
+        {
+            internal::throwUnlessDerivativeIsConsistentWithFunction(thisFuncInput.function, thisFuncInput.derivative, range_);
+        }
+        catch (gmx::GromacsException &ex)
+        {
+            ex.prependContext("Error generating cubic spline table for function '" + thisFuncInput.desc + "'");
+            throw;
+        }
+        // Calculate the required table spacing h. The error we make with linear interpolation
+        // of the derivative will be described by the third-derivative correction term.
+        // This means we can compute the required spacing as h = sqrt(12*tolerance*min(f'/f''')),
+        // where f'/f''' is the first and third derivative of the function, respectively.
+
+        double thisMinQuotient = internal::findSmallestQuotientOfFunctionAndThirdDerivative(thisFuncInput.derivative, range_);
+
+        minQuotient = std::min(minQuotient, thisMinQuotient);
+    }
+
+    double spacing = 0.5 * std::cbrt(72.0 * std::sqrt(3.0) * tolerance * minQuotient);
+
+    tableScale_  = 1.0 / spacing;
+
+    if (range_.second * tableScale_ > 2e6)
+    {
+        GMX_THROW(ToleranceError("Over a million points would be required for table; decrease range or increase tolerance"));
+    }
+
+    // Loop over all tables again.
+    // Here we create the actual table for each function, and then
+    // combine them into a multiplexed table function.
+    std::size_t funcIndex = 0;
+
+    for (auto thisFuncInput : analyticalInputList)
+    {
+        try
+        {
+            std::vector<real> tmpYfghTableData;
+
+            fillSingleCubicSplineTableData(thisFuncInput.function,
+                                           thisFuncInput.derivative,
+                                           range_,
+                                           spacing,
+                                           &tmpYfghTableData);
+
+            internal::fillMultiplexedTableData(tmpYfghTableData, &yfghMultiTableData_,
+                                               4, numFuncInTable_, funcIndex);
+
+            funcIndex++;
+        }
+        catch (gmx::GromacsException &ex)
+        {
+            ex.prependContext("Error generating cubic spline table for function '" + thisFuncInput.desc + "'");
+            throw;
+        }
+    }
+}
+
+
+CubicSplineTable::CubicSplineTable(std::initializer_list<NumericalSplineTableInput>   numericalInputList,
+                                   const std::pair<real, real>                       &range,
+                                   real                                               tolerance)
+    : numFuncInTable_(numericalInputList.size()), range_(range)
+{
+    // Sanity check on input values
+    if (range.first < 0.0 || (range.second-range.first) < 0.001)
+    {
+        GMX_THROW(InvalidInputError("Range to tabulate cannot include negative values and must span at least 0.001"));
+    }
+
+    if (tolerance < GMX_REAL_EPS)
+    {
+        GMX_THROW(ToleranceError("Table tolerance cannot be smaller than GMX_REAL_EPS"));
+    }
+
+    double minQuotient = GMX_REAL_MAX;
+
+    // loop over all functions to find smallest spacing
+    for (auto thisFuncInput : numericalInputList)
+    {
+        try
+        {
+            // We do not yet know what the margin is, but we need to test that we at least cover
+            // the requested range before starting to calculate derivatives
+            if (thisFuncInput.function.size() < range_.second / thisFuncInput.spacing + 1)
+            {
+                GMX_THROW(InconsistentInputError("Table input vectors must cover requested range, and a margin beyond the upper endpoint"));
+            }
+
+            if (thisFuncInput.function.size() != thisFuncInput.derivative.size())
+            {
+                GMX_THROW(InconsistentInputError("Function and derivative vectors have different lengths"));
+            }
+
+            internal::throwUnlessDerivativeIsConsistentWithFunction(thisFuncInput.function, thisFuncInput.derivative, thisFuncInput.spacing, range_);
+        }
+        catch (gmx::GromacsException &ex)
+        {
+            ex.prependContext("Error generating cubic spline table for function '" + thisFuncInput.desc + "'");
+            throw;
+        }
+        // Calculate the required table spacing h. The error we make with linear interpolation
+        // of the derivative will be described by the third-derivative correction term.
+        // This means we can compute the required spacing as h = sqrt(12*tolerance*min(f'/f''')),
+        // where f'/f''' is the first and third derivative of the function, respectively.
+
+        double thisMinQuotient = internal::findSmallestQuotientOfFunctionAndThirdDerivative(thisFuncInput.derivative, thisFuncInput.spacing, range_);
+
+        minQuotient = std::min(minQuotient, thisMinQuotient);
+    }
+
+    double spacing     = std::cbrt(72.0 * std::sqrt(3.0) * tolerance * minQuotient);
+
+    tableScale_  = 1.0 / spacing;
+
+    if (range_.second * tableScale_ > 1e6)
+    {
+        GMX_THROW(ToleranceError("Requested tolerance would require over a million points in table"));
+    }
+
+    // Loop over all tables again.
+    // Here we create the actual table for each function, and then
+    // combine them into a multiplexed table function.
+    std::size_t funcIndex = 0;
+
+    for (auto thisFuncInput : numericalInputList)
+    {
+        try
+        {
+            if (spacing < thisFuncInput.spacing)
+            {
+                GMX_THROW(ToleranceError("Input vector spacing cannot achieve tolerance requested"));
+            }
+
+            std::vector<real> tmpYfghTableData;
+
+            fillSingleCubicSplineTableData(thisFuncInput.function,
+                                           thisFuncInput.derivative,
+                                           thisFuncInput.spacing,
+                                           range,
+                                           spacing,
+                                           &tmpYfghTableData);
+
+            internal::fillMultiplexedTableData(tmpYfghTableData, &yfghMultiTableData_,
+                                               4, numFuncInTable_, funcIndex);
+
+            funcIndex++;
+        }
+        catch (gmx::GromacsException &ex)
+        {
+            ex.prependContext("Error generating cubic spline table for function '" + thisFuncInput.desc + "'");
+            throw;
+        }
+    }
+}
+
+} // namespace gmx
diff --git a/src/gromacs/tables/cubicsplinetable.h b/src/gromacs/tables/cubicsplinetable.h
new file mode 100644 (file)
index 0000000..c112211
--- /dev/null
@@ -0,0 +1,645 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+
+/*! \libinternal \file
+ * \brief
+ * Declares classes for cubic spline table
+ *
+ * \inlibraryapi
+ * \author Erik Lindahl <erik.lindahl@gmail.com>
+ * \ingroup module_tables
+ */
+#ifndef GMX_TABLES_CUBICSPLINETABLE_H
+#define GMX_TABLES_CUBICSPLINETABLE_H
+
+#include <initializer_list>
+#include <vector>
+
+#include "gromacs/simd/simd.h"
+#include "gromacs/tables/tableinput.h"
+#include "gromacs/utility/alignedallocator.h"
+#include "gromacs/utility/classhelpers.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/real.h"
+
+namespace gmx
+{
+
+/*! \libinternal \brief Cubic spline interpolation table.
+ *
+ * This class interpolates a function specified either as an analytical
+ * expression or from user-provided table data.
+ *
+ * At initialization, you provide the reference function of vectors
+ * as a list of tuples that contain a brief name, the function, and
+ * derivative for each function to tabulate. To create a table with
+ * two functions this initializer list can for instance look like
+ *
+ *     { {"LJ6", lj6Func, lj6Der}, {"LJ12", lj12Func, lj12Der} }
+ *
+ * The names are only used so exceptions during initialization can
+ * be traced to a specific table.
+ *
+ * When interpolating, there are methods to interpolate either 1, 2, or 3
+ * functions in one go. By default these interpolation routines will
+ * operate on tables with the same number of functions as specified in
+ * the interpolation method (debug builds check that this is consistent with
+ * the table). However, it is also possible to use optional template
+ * parameters that specify the total number of functions in a table, and
+ * what function index to interpolate. For instance, to interpolate the
+ * derivative of the second function (i.e., index 1) in a
+ * multi-function-table with three functions in total, you can write
+ *
+ *     table.evaluateDerivative<3,1>(x,&der);
+ *
+ * Here too, debug builds will check that the template parameters are
+ * consistent with the table.
+ *
+ * This class interpolates a function specified either as an analytical
+ * expression or from user-provided table data. The coefficients for each
+ * table point are precalculated such that we simply evaluate
+ *
+ * \f{eqnarray*}{
+ * V(x)  = Y + F \epsilon + G \epsilon^2 + H \epsilon^3
+ * V'(x) = (F + 2 G \epsilon + 3 H \epsilon^2)/h
+ * \f}
+ *
+ * Where h is the spacing and epsilon the fractional offset from table point.
+ *
+ * While it is possible to create tables only from function values
+ * (i.e., no derivatives), it is recommended to provide derivatives for higher
+ * accuracy and to avoid issues with numerical differentiation. Note that the
+ * table input should be smooth, i.e. it should not contain noise e.g. from an
+ * (iterative) Boltzmann inversion procedure - you have been warned.
+ *
+ * \note This class is responsible for fundamental interpolation of any function,
+ *       which might or might not correspond to a potential. For this reason
+ *       both input and output derivatives are proper function derivatives, and
+ *       we do not swap any signs to get forces directly from the table.
+ *
+ * \note There will be a small additional accuracy loss from the internal
+ *       operation where we calculate the epsilon offset from the nearest table
+ *       point, since the integer part we subtract can get large in those cases.
+ *
+ *       While this is technically possible to solve with extended precision
+ *       arithmetics, that would introduce extra instructions in some highly
+ *       performance-sensitive code parts. For typical GROMACS interaction
+ *       functions the derivatives will decay faster than the potential, which
+ *       means it will never play any role. For other functions it will only
+ *       cause a small increase in the relative error for arguments where the
+ *       magnitude of the function or derivative is very small.
+ *       Since we typically sum several results in GROMACS, this should never
+ *       show up in any real cases, and for this reason we choose not to do
+ *       the extended precision arithmetics.
+ *
+ * \note These routines are not suitable for table ranges starting far away
+ *       from zero, since we allocate memory and calculate indices starting from
+ *       range zero for efficiency reasons.
+ */
+class CubicSplineTable
+{
+    private:
+        /*! \brief Change that function value falls inside range when debugging
+         *
+         *  \tparam T   Lookup argument floating-point type, typically SimdReal or real.
+         *  \param  r   Lookup argument to test
+         *
+         *  \throws Debug builds will throw gmx::RangeError for values that are
+         *          larger than the upper limit of the range, or smaller than 0.
+         *          We allow the table to be called with arguments between 0 and
+         *          the lower limit of the range, since this might in theory occur
+         *          once-in-a-blue-moon with some algorithms.
+         */
+        template <typename T>
+        void
+        rangeCheck(T gmx_unused r) const
+        {
+#ifndef NDEBUG
+            // Check that all values fall in range when debugging
+            if (anyTrue( r < T(0.0) || T(range_.second) <= r ) )
+            {
+                GMX_THROW(RangeError("Interpolation input value falls outside table definition range"));
+            }
+#endif
+        }
+
+    public:
+
+        /*! \brief Default tolerance for cubic spline tables
+         *
+         * This is 10*GMX_FLOAT_EPS in single precision, and
+         * 1e-10 for double precision. It might not be worth setting
+         * this tolerance lower than 1e-10 in double precision, both because
+         * you will end up with very large tables, and because
+         * functions like r^-12 become so large for small values of r the
+         * table generation code will lead to some precision loss even
+         * in double precision.
+         */
+        static const real defaultTolerance;
+
+        /*! \brief Initialize table data from function
+         *
+         * \param analyticalInputList Initializer list with one or more functions to tabulate,
+         *                            specified as elements with a string description and
+         *                            the function as well as derivative. The function will also
+         *                            be called for values smaller than the lower limit of the
+         *                            range, but we avoid calling it for 0.0 if that value
+         *                            is not included in the range.
+         *                            Constructor will throw gmx::APIError for negative values.
+         *                            Due to the way the numerical derivative evaluation depends
+         *                            on machine precision internally, this range must be
+         *                            at least 0.001, or the constructor throws gmx::APIError.
+         * \param range                Range over which the function will be tabulated.
+         *                             Constructor will throw gmx::APIError for negative values,
+         *                             or if the value/derivative vector does not cover the
+         *                             range.
+         * \param tolerance           Requested accuracy of the table. This will be used to
+         *                            calculate the required internal spacing. If this cannot
+         *                            be achieved (for instance because the table would require
+         *                            too much memory) the constructor will throw gmx::ToleranceError.
+         *
+         * \note The functions are always defined in double precision to avoid
+         *       losing accuracy when constructing tables.
+         *
+         * \note Since we fill the table for values below range.first, you can achieve
+         *       a smaller table by using a smaller range where the tolerance has to be
+         *       met, and accept that a few function calls below range.first do not
+         *       quite reach the tolerance.
+         *
+         * \warning For efficiency reasons (since this code is used in some inner
+         *       (kernels), we always allocate memory and calculate table indices
+         *       for the complete interval [0,range.second], although the data will
+         *       not be valid outside the definition range to avoid calling the
+         *       function there. This means you should \a not use this class
+         *       to tabulate functions for small ranges very far away from zero,
+         *       since you would both waste a huge amount of memory and incur
+         *       truncation errors when calculating the index.
+         *
+         * \throws gmx::ToleranceError if the requested tolerance cannot be achieved,
+         *         and gmx::APIError for other incorrect input.
+         */
+        CubicSplineTable(std::initializer_list<AnalyticalSplineTableInput>  analyticalInputList,
+                         const std::pair<real, real>                       &range,
+                         real                                               tolerance = defaultTolerance);
+
+        /*! \brief Initialize table data from tabulated values and derivatives
+         *
+         * \param numericalInputList  Initializer list with one or more functions to tabulate,
+         *                            specified as a string description, vectors with function and
+         *                            derivative values, and the input spacing. Data points are
+         *                            separated by the spacing parameter, starting from 0.
+         *                            Values below the lower limit of the range will be used to
+         *                            attempt defining the table, but we avoid using index 0
+         *                            unless 0.0 is included in the range. Some extra points beyond
+         *                            range.second are required to re-interpolate values, so add
+         *                            some margin. The constructor will throw gmx::APIError if the
+         *                            input vectors are too short to cover the requested range
+         *                            (and they must always be at least five points).
+         * \param range               Range over which the function will be tabulated.
+         *                            Constructor will throw gmx::APIError for negative values,
+         *                            or if the value/derivative vector does not cover the
+         *                            range.
+         * \param tolerance           Requested accuracy of the table. This will be used to
+         *                            calculate the required internal spacing and possibly
+         *                            re-interpolate. The constructor will throw
+         *                            gmx::ToleranceError if the input spacing is too coarse
+         *                            to achieve this accuracy.
+         *
+         * \note The input data vectors are always double precision to avoid
+         *       losing accuracy when constructing tables.
+         *
+         * \note Since we fill the table for values below range.first, you can achieve
+         *       a smaller table by using a smaller range where the tolerance has to be
+         *       met, and accept that a few function calls below range.first do not
+         *       quite reach the tolerance.
+         *
+         * \warning For efficiency reasons (since this code is used in some inner
+         *       (kernels), we always allocate memory and calculate table indices
+         *       for the complete interval [0,range.second], although the data will
+         *       not be valid outside the definition range to avoid calling the
+         *       function there. This means you should \a not use this class
+         *       to tabulate functions for small ranges very far away from zero,
+         *       since you would both waste a huge amount of memory and incur
+         *       truncation errors when calculating the index.
+         */
+        CubicSplineTable(std::initializer_list<NumericalSplineTableInput>  numericalInputList,
+                         const std::pair<real, real>                      &range,
+                         real                                              tolerance = defaultTolerance);
+
+
+        /************************************************************
+         *           Evaluation methods for single functions        *
+         ************************************************************/
+
+        /*! \brief Evaluate both function and derivative, single table function
+         *
+         *  This is a templated method where the template can be either real or SimdReal.
+         *
+         *  \tparam     numFuncInTable  Number of separate functions in table, default is 1
+         *  \tparam     funcIndex       Index of function to evaluate in table, default is 0
+         *  \tparam     T               Type (SimdReal or real) of lookup and result
+         *  \param      r               Points for which to evaluate function and derivative
+         *  \param[out] functionValue   Function value
+         *  \param[out] derivativeValue Function derivative
+         *
+         *  For debug builds we assert that the input values fall in the range
+         *  specified when constructing the table.
+         */
+        template <int numFuncInTable = 1, int funcIndex = 0, typename T>
+        void
+        evaluateFunctionAndDerivative(T     r,
+                                      T *   functionValue,
+                                      T *   derivativeValue) const
+        {
+            rangeCheck(r);
+            GMX_ASSERT(numFuncInTable == numFuncInTable_, "Evaluation method not matching number of functions in table");
+            GMX_ASSERT(funcIndex < numFuncInTable, "Function index not in range of the number of tables");
+
+            T     rTable   = r * T(tableScale_);
+            auto  tabIndex = cvttR2I(rTable); // type is either std::int32_t or SimdInt32
+            T     eps      = rTable - trunc(rTable);
+            T     Y, F, G, H;
+
+            // Load Derivative, Delta, Function, and Zero values for each table point.
+            // The 4 refers to these four values - not any SIMD width.
+            gatherLoadBySimdIntTranspose<4*numFuncInTable>(yfghMultiTableData_.data() + 4*funcIndex, tabIndex, &Y, &F, &G, &H);
+            *functionValue   = fma(fma(fma(H, eps, G), eps, F), eps, Y);
+            *derivativeValue = tableScale_ * fma(fma(T(3.0)*H, eps, T(2.0)*G), eps, F);
+        }
+
+        /*! \brief Evaluate function value only, single table function
+         *
+         *  This is a templated method where the template can be either real or SimdReal.
+         *
+         *  \tparam     numFuncInTable  Number of separate functions in table, default is 1
+         *  \tparam     funcIndex       Index of function to evaluate in table, default is 0
+         *  \tparam     T               Type (SimdReal or real) of lookup and result
+         *  \param      r               Points for which to evaluate function value
+         *  \param[out] functionValue   Function value
+         *
+         *  For debug builds we assert that the input values fall in the range
+         *  specified when constructing the table.
+         */
+        template <int numFuncInTable = 1, int funcIndex = 0, typename T>
+        void
+        evaluateFunction(T     r,
+                         T *   functionValue) const
+        {
+            T     der gmx_unused;
+
+            evaluateFunctionAndDerivative<numFuncInTable, funcIndex>(r, functionValue, &der);
+        }
+
+        /*! \brief Evaluate function derivative only, single table function
+         *
+         *  This is a templated method where the template can be either real or SimdReal.
+         *
+         *  \tparam     numFuncInTable  Number of separate functions in table, default is 1
+         *  \tparam     funcIndex       Index of function to evaluate in table, default is 0
+         *  \tparam     T               Type (SimdReal or real) of lookup and result
+         *  \param      r               Points for which to evaluate function derivative
+         *  \param[out] derivativeValue Function derivative
+         *
+         *  For debug builds we assert that the input values fall in the range
+         *  specified when constructing the table.
+         */
+        template <int numFuncInTable = 1, int funcIndex = 0, typename T>
+        void
+        evaluateDerivative(T     r,
+                           T *   derivativeValue) const
+        {
+            rangeCheck(r);
+            GMX_ASSERT(numFuncInTable == numFuncInTable_, "Evaluation method not matching number of functions in table");
+            GMX_ASSERT(funcIndex < numFuncInTable, "Function index not in range of the number of tables");
+
+            T     rTable   = r * T(tableScale_);
+            auto  tabIndex = cvttR2I(rTable); // type is either std::int32_t or SimdInt32
+            T     eps      = rTable - trunc(rTable);
+            T     Y, F, G, H;
+
+            // Load Derivative, Delta, Function, and Zero values for each table point.
+            // The 4 refers to these four values - not any SIMD width.
+            gatherLoadBySimdIntTranspose<4*numFuncInTable>(yfghMultiTableData_.data() + 4 * funcIndex, tabIndex, &Y, &F, &G, &H);
+            *derivativeValue = tableScale_ * fma(fma(T(3.0)*H, eps, T(2.0)*G), eps, F);
+        }
+
+        /************************************************************
+         *             Evaluation methods for two functions         *
+         ************************************************************/
+
+        /*! \brief Evaluate both function and derivative, two table functions
+         *
+         *  This is a templated method where the template can be either real or SimdReal.
+         *
+         *  \tparam     numFuncInTable  Number of separate functions in table, default is 2
+         *  \tparam     funcIndex0       Index of 1st function to evaluate in table, default is 0
+         *  \tparam     funcIndex1       Index of 2nd function to evaluate in table, default is 1
+         *  \tparam     T                Type (SimdReal or real) of lookup and result
+         *  \param      r                Points for which to evaluate function and derivative
+         *  \param[out] functionValue0   Interpolated value for first function
+         *  \param[out] derivativeValue0 Interpolated derivative for first function
+         *  \param[out] functionValue1   Interpolated value for second function
+         *  \param[out] derivativeValue1 Interpolated derivative for second function
+         *
+         *  For debug builds we assert that the input values fall in the range
+         *  specified when constructing the table.
+         */
+        template <int numFuncInTable = 2, int funcIndex0 = 0, int funcIndex1 = 1, typename T>
+        void
+        evaluateFunctionAndDerivative(T     r,
+                                      T *   functionValue0,
+                                      T *   derivativeValue0,
+                                      T *   functionValue1,
+                                      T *   derivativeValue1) const
+        {
+            rangeCheck(r);
+            GMX_ASSERT(numFuncInTable == numFuncInTable_, "Evaluation method not matching number of functions in table");
+            GMX_ASSERT(funcIndex0 < numFuncInTable && funcIndex1 < numFuncInTable, "Function index not in range of the number of tables");
+
+            T     rTable   = r * T(tableScale_);
+            auto  tabIndex = cvttR2I(rTable); // type is either std::int32_t or SimdInt32
+            T     eps      = rTable - trunc(rTable);
+            T     Y, F, G, H;
+
+            // Load Derivative, Delta, Function, and Zero values for each table point.
+            // The 4 refers to these four values - not any SIMD width.
+            gatherLoadBySimdIntTranspose<4*numFuncInTable>(yfghMultiTableData_.data() + 4*funcIndex0, tabIndex, &Y, &F, &G, &H);
+            *functionValue0   = fma(fma(fma(H, eps, G), eps, F), eps, Y);
+            *derivativeValue0 = tableScale_ * fma(fma(T(3.0)*H, eps, T(2.0)*G), eps, F);
+
+            gatherLoadBySimdIntTranspose<4*numFuncInTable>(yfghMultiTableData_.data() + 4*funcIndex1, tabIndex, &Y, &F, &G, &H);
+            *functionValue1   = fma(fma(fma(H, eps, G), eps, F), eps, Y);
+            *derivativeValue1 = tableScale_ * fma(fma(T(3.0)*H, eps, T(2.0)*G), eps, F);
+        }
+
+        /*! \brief Evaluate function value only, two table functions
+         *
+         *  This is a templated method where the template can be either real or SimdReal.
+         *
+         *  \tparam     numFuncInTable   Number of separate functions in table, default is 2
+         *  \tparam     funcIndex0       Index of 1st function to evaluate in table, default is 0
+         *  \tparam     funcIndex1       Index of 2nd function to evaluate in table, default is 1
+         *  \tparam     T                Type (SimdReal or real) of lookup and result
+         *  \param      r                Points for which to evaluate function value
+         *  \param[out] functionValue0   Interpolated value for first function
+         *  \param[out] functionValue1   Interpolated value for second function
+         *
+         *  For debug builds we assert that the input values fall in the range
+         *  specified when constructing the table.
+         */
+        template <int numFuncInTable = 2, int funcIndex0 = 0, int funcIndex1 = 1, typename T>
+        void
+        evaluateFunction(T     r,
+                         T *   functionValue0,
+                         T *   functionValue1) const
+        {
+            T     der0 gmx_unused;
+            T     der1 gmx_unused;
+
+            evaluateFunctionAndDerivative<numFuncInTable, funcIndex0, funcIndex1>(r, functionValue0, &der0, functionValue1, &der1);
+        }
+
+        /*! \brief Evaluate function derivative only, two table functions
+         *
+         *  This is a templated method where the template can be either real or SimdReal.
+         *
+         *  \tparam     numFuncInTable   Number of separate functions in table, default is 2
+         *  \tparam     funcIndex0       Index of 1st function to evaluate in table, default is 0
+         *  \tparam     funcIndex1       Index of 2nd function to evaluate in table, default is 1
+         *  \tparam     T                Type (SimdReal or real) of lookup and result
+         *  \param      r                Points for which to evaluate function derivative
+         *  \param[out] derivativeValue0 Interpolated derivative for first function
+         *  \param[out] derivativeValue1 Interpolated derivative for second function
+         *
+         *  For debug builds we assert that the input values fall in the range
+         *  specified when constructing the table.
+         */
+        template <int numFuncInTable = 2, int funcIndex0 = 0, int funcIndex1 = 1, typename T>
+        void
+        evaluateDerivative(T     r,
+                           T *   derivativeValue0,
+                           T *   derivativeValue1) const
+        {
+            rangeCheck(r);
+            GMX_ASSERT(numFuncInTable == numFuncInTable_, "Evaluation method not matching number of functions in table");
+            GMX_ASSERT(funcIndex0 < numFuncInTable && funcIndex1 < numFuncInTable, "Function index not in range of the number of tables");
+
+            T     rTable   = r * T(tableScale_);
+            auto  tabIndex = cvttR2I(rTable); // type is either std::int32_t or SimdInt32
+            T     eps      = rTable - trunc(rTable);
+            T     Y, F, G, H;
+
+            // Load Derivative, Delta, Function, and Zero values for each table point.
+            // The 4 refers to these four values - not any SIMD width.
+            gatherLoadBySimdIntTranspose<4*numFuncInTable>(yfghMultiTableData_.data() + 4 * funcIndex0, tabIndex, &Y, &F, &G, &H);
+            *derivativeValue0 = tableScale_ * fma(fma(T(3.0)*H, eps, T(2.0)*G), eps, F);
+
+            gatherLoadBySimdIntTranspose<4*numFuncInTable>(yfghMultiTableData_.data() + 4 * funcIndex1, tabIndex, &Y, &F, &G, &H);
+            *derivativeValue1 = tableScale_ * fma(fma(T(3.0)*H, eps, T(2.0)*G), eps, F);
+        }
+
+        /************************************************************
+         *            Evaluation methods for three functions        *
+         ************************************************************/
+
+
+        /*! \brief Evaluate both function and derivative, three table functions
+         *
+         *  This is a templated method where the template can be either real or SimdReal.
+         *
+         *  \tparam     numFuncInTable   Number of separate functions in table, default is 3
+         *  \tparam     funcIndex0       Index of 1st function to evaluate in table, default is 0
+         *  \tparam     funcIndex1       Index of 2nd function to evaluate in table, default is 1
+         *  \tparam     funcIndex2       Index of 3rd function to evaluate in table, default is 2
+         *  \tparam     T                Type (SimdReal or real) of lookup and result
+         *  \param      r                Points for which to evaluate function and derivative
+         *  \param[out] functionValue0   Interpolated value for first function
+         *  \param[out] derivativeValue0 Interpolated derivative for first function
+         *  \param[out] functionValue1   Interpolated value for second function
+         *  \param[out] derivativeValue1 Interpolated derivative for second function
+         *  \param[out] functionValue2   Interpolated value for third function
+         *  \param[out] derivativeValue2 Interpolated derivative for third function
+         *
+         *  For debug builds we assert that the input values fall in the range
+         *  specified when constructing the table.
+         */
+        template <int numFuncInTable = 3, int funcIndex0 = 0, int funcIndex1 = 1, int funcIndex2 = 2, typename T>
+        void
+        evaluateFunctionAndDerivative(T     r,
+                                      T *   functionValue0,
+                                      T *   derivativeValue0,
+                                      T *   functionValue1,
+                                      T *   derivativeValue1,
+                                      T *   functionValue2,
+                                      T *   derivativeValue2) const
+        {
+            rangeCheck(r);
+            GMX_ASSERT(numFuncInTable == numFuncInTable_, "Evaluation method not matching number of functions in table");
+            GMX_ASSERT(funcIndex0 < numFuncInTable && funcIndex1 < numFuncInTable && funcIndex2 < numFuncInTable, "Function index not in range of the number of tables");
+
+            T     rTable   = r * T(tableScale_);
+            auto  tabIndex = cvttR2I(rTable); // type is either std::int32_t or SimdInt32
+            T     eps      = rTable - trunc(rTable);
+            T     Y, F, G, H;
+
+            // Load Derivative, Delta, Function, and Zero values for each table point.
+            // The 4 refers to these four values - not any SIMD width.
+            gatherLoadBySimdIntTranspose<4*numFuncInTable>(yfghMultiTableData_.data() + 4*funcIndex0, tabIndex, &Y, &F, &G, &H);
+            *functionValue0   = fma(fma(fma(H, eps, G), eps, F), eps, Y);
+            *derivativeValue0 = tableScale_ * fma(fma(T(3.0)*H, eps, T(2.0)*G), eps, F);
+
+            gatherLoadBySimdIntTranspose<4*numFuncInTable>(yfghMultiTableData_.data() + 4*funcIndex1, tabIndex, &Y, &F, &G, &H);
+            *functionValue1   = fma(fma(fma(H, eps, G), eps, F), eps, Y);
+            *derivativeValue1 = tableScale_ * fma(fma(T(3.0)*H, eps, T(2.0)*G), eps, F);
+
+            gatherLoadBySimdIntTranspose<4*numFuncInTable>(yfghMultiTableData_.data() + 4*funcIndex2, tabIndex, &Y, &F, &G, &H);
+            *functionValue2   = fma(fma(fma(H, eps, G), eps, F), eps, Y);
+            *derivativeValue2 = tableScale_ * fma(fma(T(3.0)*H, eps, T(2.0)*G), eps, F);
+        }
+
+        /*! \brief Evaluate function value only, three table functions
+         *
+         *  This is a templated method where the template can be either real or SimdReal.
+         *
+         *  \tparam     numFuncInTable   Number of separate functions in table, default is 3
+         *  \tparam     funcIndex0       Index of 1st function to evaluate in table, default is 0
+         *  \tparam     funcIndex1       Index of 2nd function to evaluate in table, default is 1
+         *  \tparam     funcIndex2       Index of 3rd function to evaluate in table, default is 2
+         *  \tparam     T                Type (SimdReal or real) of lookup and result
+         *  \param      r                Points for which to evaluate function value
+         *  \param[out] functionValue0   Interpolated value for first function
+         *  \param[out] functionValue1   Interpolated value for second function
+         *  \param[out] functionValue2   Interpolated value for third function
+         *
+         *  For debug builds we assert that the input values fall in the range
+         *  specified when constructing the table.
+         */
+        template <int numFuncInTable = 3, int funcIndex0 = 0, int funcIndex1 = 1, int funcIndex2 = 2, typename T>
+        void
+        evaluateFunction(T     r,
+                         T *   functionValue0,
+                         T *   functionValue1,
+                         T *   functionValue2) const
+        {
+            T     der0 gmx_unused;
+            T     der1 gmx_unused;
+            T     der2 gmx_unused;
+
+            evaluateFunctionAndDerivative<numFuncInTable, funcIndex0, funcIndex1, funcIndex2>(r, functionValue0, &der0, functionValue1, &der1, functionValue2, &der2);
+        }
+
+        /*! \brief Evaluate function derivative only, three table functions
+         *
+         *  This is a templated method where the template can be either real or SimdReal.
+         *
+         *  \tparam     numFuncInTable   Number of separate functions in table, default is 3
+         *  \tparam     funcIndex0       Index of 1st function to evaluate in table, default is 0
+         *  \tparam     funcIndex1       Index of 2nd function to evaluate in table, default is 1
+         *  \tparam     funcIndex2       Index of 3rd function to evaluate in table, default is 2
+         *  \tparam     T                Type (SimdReal or real) of lookup and result
+         *  \param      r                Points for which to evaluate function derivative
+         *  \param[out] derivativeValue0 Interpolated derivative for first function
+         *  \param[out] derivativeValue1 Interpolated derivative for second function
+         *  \param[out] derivativeValue2 Interpolated derivative for third function
+         *
+         *  For debug builds we assert that the input values fall in the range
+         *  specified when constructing the table.
+         */
+        template <int numFuncInTable = 3, int funcIndex0 = 0, int funcIndex1 = 1, int funcIndex2 = 2, typename T>
+        void
+        evaluateDerivative(T     r,
+                           T *   derivativeValue0,
+                           T *   derivativeValue1,
+                           T *   derivativeValue2) const
+        {
+            rangeCheck(r);
+            GMX_ASSERT(numFuncInTable == numFuncInTable_, "Evaluation method not matching number of functions in table");
+            GMX_ASSERT(funcIndex0 < numFuncInTable && funcIndex1 < numFuncInTable && funcIndex2 < numFuncInTable, "Function index not in range of the number of tables");
+
+            T     rTable   = r * T(tableScale_);
+            auto  tabIndex = cvttR2I(rTable); // type is either std::int32_t or SimdInt32
+            T     eps      = rTable - trunc(rTable);
+            T     Y, F, G, H;
+
+            // Load Derivative, Delta, Function, and Zero values for each table point.
+            // The 4 refers to these four values - not any SIMD width.
+            gatherLoadBySimdIntTranspose<4*numFuncInTable>(yfghMultiTableData_.data() + 4 * funcIndex0, tabIndex, &Y, &F, &G, &H);
+            *derivativeValue0 = tableScale_ * fma(fma(T(3.0)*H, eps, T(2.0)*G), eps, F);
+
+            gatherLoadBySimdIntTranspose<4*numFuncInTable>(yfghMultiTableData_.data() + 4 * funcIndex1, tabIndex, &Y, &F, &G, &H);
+            *derivativeValue1 = tableScale_ * fma(fma(T(3.0)*H, eps, T(2.0)*G), eps, F);
+
+            gatherLoadBySimdIntTranspose<4*numFuncInTable>(yfghMultiTableData_.data() + 4 * funcIndex2, tabIndex, &Y, &F, &G, &H);
+            *derivativeValue2 = tableScale_ * fma(fma(T(3.0)*H, eps, T(2.0)*G), eps, F);
+        }
+
+        /*! \brief Return the table spacing (distance between points)
+         *
+         *  You should never have to use this for normal code, but due to the
+         *  way tables are constructed internally we need this in the unit tests
+         *  to check relative tolerances over each interval.
+         *
+         *  \return table spacing.
+         */
+        real
+        tableSpacing() const { return 1.0 / tableScale_; }
+
+    private:
+
+        std::size_t             numFuncInTable_; //!< Number of separate tabluated functions
+        std::pair<real, real>   range_;          //!< Range for which table evaluation is allowed
+        real                    tableScale_;     //!< Table scale (inverse of spacing between points)
+
+        /*! \brief Vector with combined table data to save calculations after lookup.
+         *
+         *  For table point i, this vector contains the four coefficients
+         *  Y,F,G,H that we use to express the function value as
+         *  V(x)  = Y + F e + G e^2 + H e^3, where e is the epsilon offset from
+         *  the nearest table point.
+         *
+         *  To allow aligned SIMD loads we need to use an aligned allocator for
+         *  this container.
+         */
+        std::vector<real, AlignedAllocator<real> >  yfghMultiTableData_;
+
+        // There should never be any reason to copy the table since it is read-only
+        GMX_DISALLOW_COPY_AND_ASSIGN(CubicSplineTable);
+};
+
+
+}      // namespace gmx
+
+#endif // GMX_TABLES_CUBICSPLINETABLE_H
index 04eae447f76929965d45e3896b08f082487577f1..6ef0b7d1f72315c2c70ca6ba7451045add273b87 100644 (file)
@@ -211,7 +211,7 @@ void table_spline3_fill_ewald_lr(real                                 *table_f,
             vi = v_inrange - dc*(i - i_inrange)*dx;
         }
 
-        if (table_v != NULL)
+        if (table_v != nullptr)
         {
             table_v[i] = vi;
         }
@@ -281,7 +281,7 @@ void table_spline3_fill_ewald_lr(real                                 *table_f,
     /* Currently the last value only contains half the force: double it */
     table_f[0] *= 2;
 
-    if (table_v != NULL && table_fdv0 != NULL)
+    if (table_v != nullptr && table_fdv0 != nullptr)
     {
         /* Copy to FDV0 table too. Allocation occurs in forcerec.c,
          * init_ewald_f_table().
@@ -382,37 +382,6 @@ real ewald_spline3_table_scale(const interaction_const_t *ic)
     return sc;
 }
 
-/* Calculate the potential and force for an r value
- * in exactly the same way it is done in the inner loop.
- * VFtab is a pointer to the table data, offset is
- * the point where we should begin and stride is
- * 4 if we have a buckingham table, 3 otherwise.
- * If you want to evaluate table no N, set offset to 4*N.
- *
- * We use normal precision here, since that is what we
- * will use in the inner loops.
- */
-static void evaluate_table(real VFtab[], int offset, int stride,
-                           real tabscale, real r, real *y, real *yp)
-{
-    int  n;
-    real rt, eps, eps2;
-    real Y, F, Geps, Heps2, Fp;
-
-    rt       =  r*tabscale;
-    n        =  (int)rt;
-    eps      =  rt - n;
-    eps2     =  eps*eps;
-    n        =  offset+stride*n;
-    Y        =  VFtab[n];
-    F        =  VFtab[n+1];
-    Geps     =  eps*VFtab[n+2];
-    Heps2    =  eps2*VFtab[n+3];
-    Fp       =  F+Geps+Heps2;
-    *y       =  Y+eps*Fp;
-    *yp      =  (Fp+Geps+2.0*Heps2)*tabscale;
-}
-
 static void copy2table(int n, int offset, int stride,
                        double x[], double Vtab[], double Ftab[], real scalefactor,
                        real dest[])
@@ -609,7 +578,7 @@ static void read_tables(FILE *fp, const char *fn,
 {
     char    *libfn;
     char     buf[STRLEN];
-    double **yy = NULL, start, end, dx0, dx1, ssd, vm, vp, f, numf;
+    double **yy = nullptr, start, end, dx0, dx1, ssd, vm, vp, f, numf;
     int      k, i, nx, nx0 = 0, ny, nny, ns;
     gmx_bool bAllZero, bZeroV, bZeroF;
     double   tabscale;
@@ -1573,9 +1542,9 @@ t_forcetable *makeDispersionCorrectionTable(FILE *fp,
                                             t_forcerec *fr, real rtab,
                                             const char *tabfn)
 {
-    t_forcetable *dispersionCorrectionTable = NULL;
+    t_forcetable *dispersionCorrectionTable = nullptr;
 
-    if (tabfn == NULL)
+    if (tabfn == nullptr)
     {
         if (debug)
         {
index 9236b344057acce92dfd6264182329f8858cbb73..d2ca216357b9ad5a9fcbac75cb308d9ce3ac28bc 100644 (file)
 #ifndef GMX_TABLES_FORCETABLE_H
 #define GMX_TABLES_FORCETABLE_H
 
+/*! \libinternal \file
+ * \brief
+ * Old routines for table generation (will eventually be replaced)
+ *
+ * \inlibraryapi
+ * \author Erik Lindahl <erik.lindahl@gmail.com>
+ * \ingroup module_tables
+ */
+
 #include <cstdio>
 
 #include "gromacs/mdtypes/fcdata.h"
 #include "gromacs/mdtypes/interaction_const.h"
 #include "gromacs/utility/real.h"
 
+/*! \brief Flag to select user tables for make_tables */
 #define GMX_MAKETABLES_FORCEUSER  (1<<0)
+/*! \brief Flag to only make 1,4 pair tables for make_tables */
 #define GMX_MAKETABLES_14ONLY     (1<<1)
 
-/* Index in the tables that says which function to use */
+/*! \brief Enumerated type to describe the interaction types in a table */
 enum {
-    etiCOUL, etiLJ6, etiLJ12, etiNR
+    etiCOUL,  //!< Coulomb
+    etiLJ6,   //!< Dispersion
+    etiLJ12,  //!< Repulsion
+    etiNR     //!< Total number of interaction types
 };
 
-typedef double (*real_space_grid_contribution_computer)(double, double);
-/* Function pointer used to tell table_spline3_fill_ewald_lr whether it
+/*! \brief Function pointer to calculate the grid contribution for coulomb/LJ
+ *
+ * Used to tell table_spline3_fill_ewald_lr whether it
  * should calculate the grid contribution for electrostatics or LJ.
  */
+typedef double (*real_space_grid_contribution_computer)(double, double);
+
 
+/*! \brief Fill tables with the Ewald long-range force interaction
+ *
+ * Fill tables of ntab points with spacing dr with the ewald long-range
+ * (mesh) force.
+ * There are three separate tables with format FDV0, F, and V.
+ * This function interpolates the Ewald mesh potential contribution
+ * with coefficient beta using a quadratic spline.
+ * The force can then be interpolated linearly.
+ *
+ * \param table_F    Force table
+ * \param table_V    Potential table
+ * \param table_FDV0 Combined table optimized for SIMD loads
+ * \param ntab       Number of points in tables
+ * \param dx         Spacing
+ * \param beta       Ewald splitting paramter
+ * \param v_lr       Pointer to function calculating real-space grid contribution
+ */
 void table_spline3_fill_ewald_lr(real                                 *table_F,
                                  real                                 *table_V,
                                  real                                 *table_FDV0,
@@ -62,34 +96,58 @@ void table_spline3_fill_ewald_lr(real                                 *table_F,
                                  double                                dx,
                                  real                                  beta,
                                  real_space_grid_contribution_computer v_lr);
-/* Fill tables of ntab points with spacing dr with the ewald long-range
- * (mesh) force.
- * There are three separate tables with format FDV0, F, and V.
- * This function interpolates the Ewald mesh potential contribution
- * with coefficient beta using a quadratic spline.
- * The force can then be interpolated linearly.
- */
 
+/*! \brief Compute scaling for the Ewald quadratic spline tables.
+ *
+ * \param ic  Pointer to interaction constant structure
+ * \return The scaling factor
+ */
 real ewald_spline3_table_scale(const interaction_const_t *ic);
-/* Return the scaling for the Ewald quadratic spline tables. */
 
+/*! \brief Return the real space grid contribution for Ewald
+ *
+ *  \param beta  Ewald splitting parameter
+ *  \param r     Distance for which to calculate the real-space contrib
+ *  \return      Real space grid contribution for Ewald electrostatics
+ */
 double v_q_ewald_lr(double beta, double r);
-/* Return the real space grid contribution for Ewald*/
 
+/*! \brief Return the real space grid contribution for LJ-Ewald
+ *
+ *  \param beta  Ewald splitting parameter
+ *  \param r     Distance for which to calculate the real-space contrib
+ *  \return      Real space grid contribution for Ewald Lennard-Jones interaction
+ */
 double v_lj_ewald_lr(double beta, double r);
-/* Return the real space grid contribution for LJ-Ewald*/
 
+/*! \brief Return tables for inner loops.
+ *
+ * \param fp     Log file pointer
+ * \param fr     Force record
+ * \param fn     File name from which to read user tables
+ * \param rtab   Largest interaction distance to tabulate
+ * \param flags  Flags to select table settings
+ *
+ * \return Pointer to inner loop table structure
+ */
 t_forcetable *make_tables(FILE *fp,
                           const t_forcerec *fr,
                           const char *fn, real rtab, int flags);
-/* Return tables for inner loops. */
 
-bondedtable_t make_bonded_table(FILE *fplog, const char *fn, int angle);
-/* Return a table for bonded interactions,
- * angle should be: bonds 0, angles 1, dihedrals 2
+/*! \brief Return a table for bonded interactions,
+ *
+ * \param  fplog   Pointer to log file
+ * \param  fn      File name
+ * \param  angle   Type of angle: bonds 0, angles 1, dihedrals 2
+ * \return New bonded table datatype
  */
+bondedtable_t make_bonded_table(FILE *fplog, const char *fn, int angle);
 
-/* Return a table for GB calculations */
+/*! \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
diff --git a/src/gromacs/tables/quadraticsplinetable.cpp b/src/gromacs/tables/quadraticsplinetable.cpp
new file mode 100644 (file)
index 0000000..94dc2b3
--- /dev/null
@@ -0,0 +1,467 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+
+/*! \internal \file
+ * \brief
+ * Implements classes for quadratic spline table functions
+ *
+ * \author Erik Lindahl <erik.lindahl@gmail.com>
+ * \ingroup module_tables
+ */
+#include "gmxpre.h"
+
+#include "quadraticsplinetable.h"
+
+#include <cmath>
+
+#include <algorithm>
+#include <functional>
+#include <initializer_list>
+#include <utility>
+#include <vector>
+
+#include "gromacs/tables/tableinput.h"
+#include "gromacs/utility/alignedallocator.h"
+#include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/real.h"
+
+#include "splineutil.h"
+
+namespace gmx
+{
+
+namespace
+{
+
+/*! \brief Construct the data for a single quadratic table from analytical functions
+ *
+ * \param[in]  function             Analytical functiojn
+ * \param[in]  derivative           Analytical derivative
+ * \param[in]  range                Upper/lower limit of region to tabulate
+ * \param[in]  spacing              Distance between table points
+ * \param[out] functionTableData    Output table with function data
+ * \param[out] derivativeTableData  OUtput table with (adjusted) derivative data
+ */
+void
+fillSingleQuadraticSplineTableData(const std::function<double(double)>   &function,
+                                   const std::function<double(double)>   &derivative,
+                                   const std::pair<real, real>           &range,
+                                   double                                 spacing,
+                                   std::vector<real>                     *functionTableData,
+                                   std::vector<real>                     *derivativeTableData)
+{
+    std::size_t  endIndex   = range.second / spacing + 2;
+
+    functionTableData->resize(endIndex);
+    derivativeTableData->resize(endIndex);
+
+    double       maxMagnitude      = 0.0001*GMX_REAL_MAX;
+    bool         functionIsInRange = true;
+    std::size_t  lastIndexInRange  = endIndex - 1;
+
+    for (int i = endIndex - 1; i >= 0; i--)
+    {
+        double x                = i * spacing;
+        double tmpFunctionValue;
+        double tmpDerivativeValue;
+
+        if (range.first > 0 && i == 0)
+        {
+            // Avoid x==0 if it is not in the range, since it can lead to
+            // singularities even if the value for i==1 was within or required magnitude
+            functionIsInRange = false;
+        }
+
+        if (functionIsInRange)
+        {
+            tmpFunctionValue = function(x);
+
+            // Calculate third derivative term (2nd derivative of the derivative)
+            // Make sure we stay in range. In practice this means we use one-sided
+            // interpolation at the interval endpoints (indentical to an offset for 3-point formula)
+            const double h                    = std::pow( GMX_DOUBLE_EPS, 0.25 );
+            double       y                    = std::min( std::max(x, range.first + h), range.second - h);
+            double       thirdDerivativeValue = ( derivative(y+h) - 2.0 * derivative(y) + derivative(y-h) ) / ( h * h );
+
+            tmpDerivativeValue   = derivative(x) - spacing * spacing * thirdDerivativeValue / 12.0;
+
+            if (std::abs(tmpFunctionValue) > maxMagnitude || std::abs(tmpDerivativeValue) > maxMagnitude)
+            {
+                functionIsInRange = false; // Once this happens, it never resets to true again
+            }
+        }
+
+        if (functionIsInRange)
+        {
+            (*functionTableData)[i]   = tmpFunctionValue;
+            (*derivativeTableData)[i] = tmpDerivativeValue;
+            lastIndexInRange--;
+        }
+        else
+        {
+            // Once the function or derivative (more likely) has reached very large values,
+            // we simply make a linear function from the last in-range value of the derivative.
+            double lastIndexFunction   = (*functionTableData)[lastIndexInRange];
+            double lastIndexDerivative = (*derivativeTableData)[lastIndexInRange];
+            (*functionTableData)[i]    = lastIndexFunction + lastIndexDerivative * (i - lastIndexInRange) * spacing;
+            (*derivativeTableData)[i]  = lastIndexDerivative;
+        }
+    }
+}
+
+
+/*! \brief Construct the data for a single quadratic table from vector data
+ *
+ * \param[in]  function             Input vector with function data
+ * \param[in]  derivative           Input vector with derivative data
+ * \param[in]  inputSpacing         Distance between points in input vectors
+ * \param[in]  range                Upper/lower limit of region to tabulate
+ * \param[in]  spacing              Distance between table points
+ * \param[out] functionTableData    Output table with function data
+ * \param[out] derivativeTableData  OUtput table with (adjusted) derivative data
+ */
+void
+fillSingleQuadraticSplineTableData(ConstArrayRef<double>                  function,
+                                   ConstArrayRef<double>                  derivative,
+                                   double                                 inputSpacing,
+                                   const std::pair<real, real>           &range,
+                                   double                                 spacing,
+                                   std::vector<real>                     *functionTableData,
+                                   std::vector<real>                     *derivativeTableData)
+{
+    std::size_t  endIndex   = range.second / spacing + 2;
+
+    functionTableData->resize(endIndex);
+    derivativeTableData->resize(endIndex);
+
+    std::vector<double>  thirdDerivative(internal::vectorSecondDerivative(derivative, inputSpacing));
+
+    double               maxMagnitude      = 0.0001*GMX_REAL_MAX;
+    bool                 functionIsInRange = true;
+    std::size_t          lastIndexInRange  = endIndex - 1;
+
+    for (int i = endIndex - 1; i >= 0; i--)
+    {
+        double x                = i * spacing;
+        double tmpFunctionValue;
+        double tmpDerivativeValue;
+
+        if (range.first > 0 && i == 0)
+        {
+            // Avoid x==0 if it is not in the range, since it can lead to
+            // singularities even if the value for i==1 was within or required magnitude
+            functionIsInRange = false;
+        }
+
+        if (functionIsInRange)
+        {
+            // Step 1: Interpolate the function value at x from input table.
+            double inputXTab  = x / inputSpacing;
+            int    inputIndex = inputXTab;
+            double inputEps   = inputXTab - inputIndex;
+
+            // Linear interpolation of input derivative and third derivative
+            double thirdDerivativeValue = (1.0 - inputEps) * thirdDerivative[inputIndex] + inputEps * thirdDerivative[inputIndex+1];
+            double derivativeValue      = (1.0 - inputEps) *      derivative[inputIndex] + inputEps *      derivative[inputIndex+1];
+
+            // Quadratic interpolation for function value
+            tmpFunctionValue     = function[inputIndex] + 0.5 * (derivative[inputIndex] + derivativeValue) * inputEps * inputSpacing;
+            tmpDerivativeValue   = derivativeValue - spacing * spacing * thirdDerivativeValue / 12.0;
+
+            if (std::abs(tmpFunctionValue) > maxMagnitude || std::abs(tmpDerivativeValue) > maxMagnitude)
+            {
+                functionIsInRange = false; // Once this happens, it never resets to true again
+            }
+        }
+
+        if (functionIsInRange)
+        {
+            (*functionTableData)[i]   = tmpFunctionValue;
+            (*derivativeTableData)[i] = tmpDerivativeValue;
+            lastIndexInRange--;
+        }
+        else
+        {
+            // Once the function or derivative (more likely) has reached very large values,
+            // we simply make a linear function from the last in-range value of the derivative.
+            double lastIndexFunction   = (*functionTableData)[lastIndexInRange];
+            double lastIndexDerivative = (*derivativeTableData)[lastIndexInRange];
+            (*functionTableData)[i]    = lastIndexFunction + lastIndexDerivative * (i - lastIndexInRange) * spacing;
+            (*derivativeTableData)[i]  = lastIndexDerivative;
+        }
+    }
+}
+
+/*! \brief Create merged DDFZ vector from function & derivative data
+ *
+ *  \param functionTableData     Function values
+ *  \param derivativeTableData   Derivative values. We have already subtracted the
+ *                               small third derivative component when calling this
+ *                               function, but in practice it is just an arbitrary
+ *                               vector here.
+ *  \param ddfzTableData         Vector four times longer, filled with
+ *                               the derivative, the difference to the next derivative
+ *                               point, the function value, and zero.
+ *
+ *  \throws If the vector lengths do not match.
+ */
+void
+fillDdfzTableData(const std::vector<real>    &functionTableData,
+                  const std::vector<real>    &derivativeTableData,
+                  std::vector<real>          *ddfzTableData)
+{
+    GMX_ASSERT(functionTableData.size() == derivativeTableData.size(), "Mismatching vector lengths");
+
+    std::size_t points = functionTableData.size();
+
+    ddfzTableData->resize(4 * points);
+
+    for (std::size_t i = 0; i < points; i++)
+    {
+        (*ddfzTableData)[4*i]     = derivativeTableData[i];
+
+        double nextDerivative     = ( i < functionTableData.size() - 1 ) ? derivativeTableData[i+1] : 0.0;
+
+        (*ddfzTableData)[4*i + 1] = nextDerivative - derivativeTableData[i];
+        (*ddfzTableData)[4*i + 2] = functionTableData[i];
+        (*ddfzTableData)[4*i + 3] = 0.0;
+    }
+}
+
+}   // namespace anonymous
+
+
+
+const real
+QuadraticSplineTable::defaultTolerance = 10.0 * GMX_FLOAT_EPS;
+
+
+QuadraticSplineTable::QuadraticSplineTable(std::initializer_list<AnalyticalSplineTableInput>   analyticalInputList,
+                                           const std::pair<real, real>                        &range,
+                                           real                                                tolerance)
+    : numFuncInTable_(analyticalInputList.size()), range_(range)
+{
+    // Sanity check on input values
+    if (range_.first < 0.0 || (range_.second-range_.first) < 0.001)
+    {
+        GMX_THROW(InvalidInputError("Range to tabulate cannot include negative values and must span at least 0.001"));
+    }
+
+    if (tolerance < GMX_REAL_EPS)
+    {
+        GMX_THROW(ToleranceError("Table tolerance cannot be smaller than GMX_REAL_EPS"));
+    }
+
+    double minQuotient = GMX_REAL_MAX;
+
+    // loop over all functions to find smallest spacing
+    for (auto thisFuncInput : analyticalInputList)
+    {
+        try
+        {
+            internal::throwUnlessDerivativeIsConsistentWithFunction(thisFuncInput.function, thisFuncInput.derivative, range_);
+        }
+        catch (gmx::GromacsException &ex)
+        {
+            ex.prependContext("Error generating quadratic spline table for function '" + thisFuncInput.desc + "'");
+            throw;
+        }
+        // Calculate the required table spacing h. The error we make with linear interpolation
+        // of the derivative will be described by the third-derivative correction term.
+        // This means we can compute the required spacing as h = sqrt(12*tolerance*min(f'/f''')),
+        // where f'/f''' is the first and third derivative of the function, respectively.
+
+        double thisMinQuotient = internal::findSmallestQuotientOfFunctionAndSecondDerivative(thisFuncInput.derivative, range_);
+
+        minQuotient = std::min(minQuotient, thisMinQuotient);
+    }
+
+    double spacing = std::sqrt(12.0 * tolerance * minQuotient);
+
+    halfSpacing_ = 0.5 * spacing;
+    tableScale_  = 1.0 / spacing;
+
+    if (range_.second * tableScale_ > 1e6)
+    {
+        GMX_THROW(ToleranceError("Over a million points would be required for table; decrease range or increase tolerance"));
+    }
+
+    // Loop over all tables again.
+    // Here we create the actual table for each function, and then
+    // combine them into a multiplexed table function.
+    std::size_t funcIndex = 0;
+
+    for (auto thisFuncInput : analyticalInputList)
+    {
+        try
+        {
+            std::vector<real> tmpFuncTableData;
+            std::vector<real> tmpDerTableData;
+            std::vector<real> tmpDdfzTableData;
+
+            fillSingleQuadraticSplineTableData(thisFuncInput.function,
+                                               thisFuncInput.derivative,
+                                               range_,
+                                               spacing,
+                                               &tmpFuncTableData,
+                                               &tmpDerTableData);
+
+            fillDdfzTableData(tmpFuncTableData, tmpDerTableData, &tmpDdfzTableData);
+
+            internal::fillMultiplexedTableData(tmpDerTableData, &derivativeMultiTableData_,
+                                               1, numFuncInTable_, funcIndex);
+
+            internal::fillMultiplexedTableData(tmpDdfzTableData, &ddfzMultiTableData_,
+                                               4, numFuncInTable_, funcIndex);
+
+            funcIndex++;
+        }
+        catch (gmx::GromacsException &ex)
+        {
+            ex.prependContext("Error generating quadratic spline table for function '" + thisFuncInput.desc + "'");
+            throw;
+        }
+    }
+}
+
+
+QuadraticSplineTable::QuadraticSplineTable(std::initializer_list<NumericalSplineTableInput>   numericalInputList,
+                                           const std::pair<real, real>                       &range,
+                                           real                                               tolerance)
+    : numFuncInTable_(numericalInputList.size()), range_(range)
+{
+    // Sanity check on input values
+    if (range.first < 0.0 || (range.second-range.first) < 0.001)
+    {
+        GMX_THROW(InvalidInputError("Range to tabulate cannot include negative values and must span at least 0.001"));
+    }
+
+    if (tolerance < GMX_REAL_EPS)
+    {
+        GMX_THROW(ToleranceError("Table tolerance cannot be smaller than GMX_REAL_EPS"));
+    }
+
+    double minQuotient = GMX_REAL_MAX;
+
+    // loop over all functions to find smallest spacing
+    for (auto thisFuncInput : numericalInputList)
+    {
+        try
+        {
+            // We do not yet know what the margin is, but we need to test that we at least cover
+            // the requested range before starting to calculate derivatives
+            if (thisFuncInput.function.size() < range_.second / thisFuncInput.spacing + 1)
+            {
+                GMX_THROW(InconsistentInputError("Table input vectors must cover requested range, and a margin beyond the upper endpoint"));
+            }
+
+            if (thisFuncInput.function.size() != thisFuncInput.derivative.size())
+            {
+                GMX_THROW(InconsistentInputError("Function and derivative vectors have different lengths"));
+            }
+
+            internal::throwUnlessDerivativeIsConsistentWithFunction(thisFuncInput.function, thisFuncInput.derivative, thisFuncInput.spacing, range_);
+        }
+        catch (gmx::GromacsException &ex)
+        {
+            ex.prependContext("Error generating quadratic spline table for function '" + thisFuncInput.desc + "'");
+            throw;
+        }
+        // Calculate the required table spacing h. The error we make with linear interpolation
+        // of the derivative will be described by the third-derivative correction term.
+        // This means we can compute the required spacing as h = sqrt(12*tolerance*min(f'/f''')),
+        // where f'/f''' is the first and third derivative of the function, respectively.
+
+        double thisMinQuotient = internal::findSmallestQuotientOfFunctionAndSecondDerivative(thisFuncInput.derivative, thisFuncInput.spacing, range_);
+
+        minQuotient = std::min(minQuotient, thisMinQuotient);
+    }
+
+    double spacing     = std::sqrt(12.0 * tolerance * minQuotient);
+
+    halfSpacing_ = 0.5 * spacing;
+    tableScale_  = 1.0 / spacing;
+
+    if (range_.second * tableScale_ > 1e6)
+    {
+        GMX_THROW(ToleranceError("Requested tolerance would require over a million points in table"));
+    }
+
+    // Loop over all tables again.
+    // Here we create the actual table for each function, and then
+    // combine them into a multiplexed table function.
+    std::size_t funcIndex = 0;
+
+    for (auto thisFuncInput : numericalInputList)
+    {
+        try
+        {
+            if (spacing < thisFuncInput.spacing)
+            {
+                GMX_THROW(ToleranceError("Input vector spacing cannot achieve tolerance requested"));
+            }
+
+            std::vector<real> tmpFuncTableData;
+            std::vector<real> tmpDerTableData;
+            std::vector<real> tmpDdfzTableData;
+
+            fillSingleQuadraticSplineTableData(thisFuncInput.function,
+                                               thisFuncInput.derivative,
+                                               thisFuncInput.spacing,
+                                               range,
+                                               spacing,
+                                               &tmpFuncTableData,
+                                               &tmpDerTableData);
+
+            fillDdfzTableData(tmpFuncTableData, tmpDerTableData, &tmpDdfzTableData);
+
+            internal::fillMultiplexedTableData(tmpDerTableData, &derivativeMultiTableData_,
+                                               1, numFuncInTable_, funcIndex);
+
+            internal::fillMultiplexedTableData(tmpDdfzTableData, &ddfzMultiTableData_,
+                                               4, numFuncInTable_, funcIndex);
+
+            funcIndex++;
+        }
+        catch (gmx::GromacsException &ex)
+        {
+            ex.prependContext("Error generating quadratic spline table for function '" + thisFuncInput.desc + "'");
+            throw;
+        }
+    }
+}
+
+} // namespace gmx
diff --git a/src/gromacs/tables/quadraticsplinetable.h b/src/gromacs/tables/quadraticsplinetable.h
new file mode 100644 (file)
index 0000000..010372d
--- /dev/null
@@ -0,0 +1,748 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+
+/*! \libinternal
+ * \defgroup module_tables  Classes for table interpolation
+ * \ingroup group_utilitymodules
+ *
+ * \brief Table interpolation from analytical or numerical input
+ *
+ * This module provides quadratic spline interpolation tables used
+ * both for the nonbonded kernels and listed interactions.
+ *
+ * \author Erik Lindahl <erik.lindahl@scilifelab.se>
+ */
+
+
+/*! \libinternal \file
+ * \brief
+ * Declares classes for quadratic spline table
+ *
+ * \inlibraryapi
+ * \author Erik Lindahl <erik.lindahl@gmail.com>
+ * \ingroup module_tables
+ */
+#ifndef GMX_TABLES_QUADRATICSPLINETABLE_H
+#define GMX_TABLES_QUADRATICSPLINETABLE_H
+
+#include <functional>
+#include <initializer_list>
+#include <vector>
+
+#include "gromacs/simd/simd.h"
+#include "gromacs/tables/tableinput.h"
+#include "gromacs/utility/alignedallocator.h"
+#include "gromacs/utility/classhelpers.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/real.h"
+
+namespace gmx
+{
+
+/*! \libinternal \brief Quadratic spline interpolation table.
+ *
+ * This class interpolates a function specified either as an analytical
+ * expression or from user-provided table data.
+ *
+ * At initialization, you provide the reference function of vectors
+ * as a list of tuples that contain a brief name, the function, and
+ * derivative for each function to tabulate. To create a table with
+ * two functions this initializer list can for instance look like
+ *
+ *     { {"LJ6", lj6Func, lj6Der}, {"LJ12", lj12Func, lj12Der} }
+ *
+ * The names are only used so exceptions during initialization can
+ * be traced to a specific table.
+ *
+ * When interpolating, there are methods to interpolate either 1, 2, or 3
+ * functions in one go. By default these interpolation routines will
+ * operate on tables with the same number of functions as specified in
+ * the interpolation method (debug builds check that this is consistent with
+ * the table). However, it is also possible to use optional template
+ * parameters that specify the total number of functions in a table, and
+ * what function index to interpolate. For instance, to interpolate the
+ * derivative of the second function (i.e., index 1) in a
+ * multi-function-table with three functions in total, you can write
+ *
+ *     table.evaluateDerivative<3,1>(x,&der);
+ *
+ * Here too, debug builds will check that the template parameters are
+ * consistent with the table.
+ *
+ * The table data is internally adjusted to guarantee that the interpolated
+ * derivative is the true derivative of the interpolated potential, which is
+ * important to avoid systematic errors for the common case when the derivative
+ * is concave/convex in the entire interval.
+ * We do this by expressing the difference in the function value
+ * at a small offset h relative to a reference value in position 0 with a forward
+ * Taylor series expanded around 0, and then doing the opposite of expressing
+ * difference in the function at position 0 relative to a reference value in
+ * position h when using a backward Taylor expansion:
+ *
+ * \f{eqnarray*}{
+ *  \Delta V & = & hV'(0) + \frac{1}{2} h^2 V''(0) + \frac{1}{6} h^3 V'''(0) + O(h^4) \\
+ *  \Delta V & = & hV'(h) - \frac{1}{2} h^2 V''(h) + \frac{1}{6} h^3 V'''(h) + O(h^4)
+ * \f}
+ *
+ * Summing the equations leads to
+ *
+ * \f[
+ *  2 \Delta V = h(V'(0) + V'(h)) + \frac{1}{2} h^2 (V''(0)-V''(h)) + \frac{1}{6}h^3(V'''(0)+V'''(h)) + O(h^4)
+ * \f]
+ *
+ * To make the second term symmetric too, we can replace it with the average of
+ * the Taylor expansion at 0 and h (i.e., using the third derivative). This gives
+ *
+ * \f[
+ *  2 \Delta V = h(V'(0) + V'(h)) - \frac{1}{12} h^3 (V'''(0)+V'''(h)) + O(h^4)
+ * \f]
+ *
+ * Thus, if we replace the derivative in the internal quadratic table data with
+ *
+ * \f[
+ *  V' - \frac{1}{12}h^2 V'''
+ * \f]
+ *
+ * we will cancel the h^3 term in the error. This will make the integral of the
+ * forces match the potential much better (The h^4 term actually disappears, so
+ * when summing over 1/h points the remaining error will be O(h^4).
+ *
+ * While it is possible to create tables only from function values
+ * (i.e., no derivatives), it is recommended to provide derivatives for higher
+ * accuracy and to avoid issues with numerical differentiation. Note that the
+ * table input should be smooth, i.e. it should not contain noise e.g. from an
+ * (iterative) Boltzmann inversion procedure - you have been warned.
+ *
+ * \note This class is responsible for fundamental interpolation of any function,
+ *       which might or might not correspond to a potential. For this reason
+ *       both input and output derivatives are proper function derivatives, and
+ *       we do not swap any signs to get forces directly from the table.
+ *
+ * \note There will be a small additional accuracy loss from the internal
+ *       operation where we calculate the epsilon offset from the nearest table
+ *       point, since the integer part we subtract can get large in those cases.
+ *       The absolute such error both in the function and derivative value will
+ *       be roughly f''*x*GMX_REAL_EPS, where x is the argument and f'' the
+ *       second derivative.
+ *       While this is technically possible to solve with extended precision
+ *       arithmetics, that would introduce extra instructions in some highly
+ *       performance-sensitive code parts. For typical GROMACS interaction
+ *       functions the derivatives will decay faster than the potential, which
+ *       means it will never play any role. For other functions it will only
+ *       cause a small increase in the relative error for arguments where the
+ *       magnitude of the function or derivative is very small.
+ *       Since we typically sum several results in GROMACS, this should never
+ *       show up in any real cases, and for this reason we choose not to do
+ *       the extended precision arithmetics.
+ *
+ * \note These routines are not suitable for table ranges starting far away
+ *       from zero, since we allocate memory and calculate indices starting from
+ *       range zero for efficiency reasons.
+ */
+class QuadraticSplineTable
+{
+    private:
+        /*! \brief Change that function value falls inside range when debugging
+         *
+         *  \tparam T   Lookup argument floating-point type, typically SimdReal or real.
+         *  \param  r   Lookup argument to test
+         *
+         *  \throws Debug builds will throw gmx::RangeError for values that are
+         *          larger than the upper limit of the range, or smaller than 0.
+         *          We allow the table to be called with arguments between 0 and
+         *          the lower limit of the range, since this might in theory occur
+         *          once-in-a-blue-moon with some algorithms.
+         */
+        template <typename T>
+        void
+        rangeCheck(T gmx_unused r) const
+        {
+#ifndef NDEBUG
+            // Check that all values fall in range when debugging
+            if (anyTrue( r < T(0.0) || T(range_.second) <= r ) )
+            {
+                GMX_THROW(RangeError("Interpolation input value falls outside table definition range"));
+            }
+#endif
+        }
+
+    public:
+
+        /*! \brief Default tolerance for tables is 10*GMX_FLOAT_EPS
+         *
+         *  \note Even for double precision builds we set the tolerance to
+         *        one order of magnitude above the single precision epsilon.
+         */
+        static const real defaultTolerance;
+
+        /*! \brief Initialize table data from function
+         *
+         * \param analyticalInputList Initializer list with one or more functions to tabulate,
+         *                            specified as pairs containing analytical
+         *                            functions and their derivatives. The function will also
+         *                            be called for values smaller than the lower limit of the
+         *                            range, but we avoid calling it for 0.0 if that value
+         *                            is not included in the range.
+         * \param range               Range over which the function will be tabulated.
+         *                            Constructor will throw gmx::APIError for negative values.
+         *                            Due to the way the numerical derivative evaluation depends
+         *                            on machine precision internally, this range must be
+         *                            at least 0.001, or the constructor throws gmx::APIError.
+         * \param tolerance           Requested accuracy of the table. This will be used to
+         *                            calculate the required internal spacing. If this cannot
+         *                            be achieved (for instance because the table would require
+         *                            too much memory) the constructor will throw gmx::ToleranceError.
+         *
+         * \note The functions are always defined in double precision to avoid
+         *       losing accuracy when constructing tables.
+         *
+         * \note Since we fill the table for values below range.first, you can achieve
+         *       a smaller table by using a smaller range where the tolerance has to be
+         *       met, and accept that a few function calls below range.first do not
+         *       quite reach the tolerance.
+         *
+         * \warning For efficiency reasons (since this code is used in some inner
+         *       (kernels), we always allocate memory and calculate table indices
+         *       for the complete interval [0,range.second], although the data will
+         *       not be valid outside the definition range to avoid calling the
+         *       function there. This means you should \a not use this class
+         *       to tabulate functions for small ranges very far away from zero,
+         *       since you would both waste a huge amount of memory and incur
+         *       truncation errors when calculating the index.
+         *
+         * \throws gmx::ToleranceError if the requested tolerance cannot be achieved,
+         *         and gmx::APIError for other incorrect input.
+         */
+        QuadraticSplineTable(std::initializer_list<AnalyticalSplineTableInput>   analyticalInputList,
+                             const std::pair<real, real>                        &range,
+                             real                                                tolerance = defaultTolerance);
+
+        /*! \brief Initialize table data from tabulated values and derivatives
+         *
+         * \param numericalInputList  Initializer list with one or more functions to tabulate,
+         *                            specified as pairs containing containing vectors for the
+         *                            function values and their derivatives. Data points are
+         *                            separated by the spacing parameter, starting from 0.
+         *                            Values below the lower limit of the range will be used to
+         *                            attempt defining the table, but we avoid using index 0
+         *                            unless 0.0 is included in the range. Some extra points beyond
+         *                            range.second are required to re-interpolate values, so add
+         *                            some margin. The constructor will throw gmx::APIError if the
+         *                            input vectors are too short to cover the requested range
+         *                            (and they must always be at least five points).
+         * \param range               Range over which the function will be tabulated.
+         *                            Constructor will throw gmx::APIError for negative values,
+         *                            or if the value/derivative vector does not cover the
+         *                            range.
+         * \param tolerance           Requested accuracy of the table in the range. This will be
+         *                            used to calculate the required internal spacing and possibly
+         *                            re-interpolate. The constructor will throw
+         *                            gmx::ToleranceError if the input spacing is too coarse
+         *                            to achieve this accuracy.
+         *
+         * \note The input data vectors are always double precision to avoid
+         *       losing accuracy when constructing tables.
+         *
+         * \note Since we fill the table for values below range.first, you can achieve
+         *       a smaller table by using a smaller range where the tolerance has to be
+         *       met, and accept that a few function calls below range.first do not
+         *       quite reach the tolerance.
+         *
+         * \warning For efficiency reasons (since this code is used in some inner
+         *       (kernels), we always allocate memory and calculate table indices
+         *       for the complete interval [0,range.second], although the data will
+         *       not be valid outside the definition range to avoid calling the
+         *       function there. This means you should \a not use this class
+         *       to tabulate functions for small ranges very far away from zero,
+         *       since you would both waste a huge amount of memory and incur
+         *       truncation errors when calculating the index.
+         */
+        QuadraticSplineTable(std::initializer_list<NumericalSplineTableInput>    numericalInputList,
+                             const std::pair<real, real>                        &range,
+                             real                                                tolerance = defaultTolerance);
+
+
+        /************************************************************
+         *           Evaluation methods for single functions        *
+         ************************************************************/
+
+        /*! \brief Evaluate both function and derivative, single table function
+         *
+         *  This is a templated method where the template can be either real or SimdReal.
+         *
+         *  \tparam     numFuncInTable  Number of separate functions in table, default is 1
+         *  \tparam     funcIndex       Index of function to evaluate in table, default is 0
+         *  \tparam     T               Type (SimdReal or real) of lookup and result
+         *  \param      r               Points for which to evaluate function and derivative
+         *  \param[out] functionValue   Function value
+         *  \param[out] derivativeValue Function derivative
+         *
+         *  For debug builds we assert that the input values fall in the range
+         *  specified when constructing the table.
+         */
+        template <int numFuncInTable = 1, int funcIndex = 0, typename T>
+        void
+        evaluateFunctionAndDerivative(T     r,
+                                      T *   functionValue,
+                                      T *   derivativeValue) const
+        {
+            rangeCheck(r);
+            GMX_ASSERT(numFuncInTable == numFuncInTable_, "Evaluation method not matching number of functions in table");
+            GMX_ASSERT(funcIndex < numFuncInTable, "Function index not in range of the number of tables");
+
+            T     rTable   = r * T(tableScale_);
+            auto  tabIndex = cvttR2I(rTable); // type is either std::int32_t or SimdInt32
+            T     eps      = rTable - trunc(rTable);
+            T     t0;
+            T     t1;
+            T     t2;
+            T     t3 gmx_unused;
+
+            // Load Derivative, Delta, Function, and Zero values for each table point.
+            // The 4 refers to these four values - not any SIMD width.
+            gatherLoadBySimdIntTranspose<4*numFuncInTable>(ddfzMultiTableData_.data() + 4 * funcIndex, tabIndex, &t0, &t1, &t2, &t3);
+
+            t1               = t0 + eps * t1;
+            *functionValue   = fma( eps * T(halfSpacing_),  t0 + t1, t2);
+            *derivativeValue = t1;
+        }
+
+        /*! \brief Evaluate function value only, single table function
+         *
+         *  This is a templated method where the template can be either real or SimdReal.
+         *
+         *  \tparam     numFuncInTable  Number of separate functions in table, default is 1
+         *  \tparam     funcIndex       Index of function to evaluate in table, default is 0
+         *  \tparam     T               Type (SimdReal or real) of lookup and result
+         *  \param      r               Points for which to evaluate function value
+         *  \param[out] functionValue   Function value
+         *
+         *  For debug builds we assert that the input values fall in the range
+         *  specified when constructing the table.
+         */
+        template <int numFuncInTable = 1, int funcIndex = 0, typename T>
+        void
+        evaluateFunction(T     r,
+                         T *   functionValue) const
+        {
+            T     der gmx_unused;
+
+            evaluateFunctionAndDerivative<numFuncInTable, funcIndex>(r, functionValue, &der);
+        }
+
+        /*! \brief Evaluate function derivative only, single table function
+         *
+         *  This is a templated method where the template can be either real or SimdReal.
+         *
+         *  \tparam     numFuncInTable  Number of separate functions in table, default is 1
+         *  \tparam     funcIndex       Index of function to evaluate in table, default is 0
+         *  \tparam     T               Type (SimdReal or real) of lookup and result
+         *  \param      r               Points for which to evaluate function derivative
+         *  \param[out] derivativeValue Function derivative
+         *
+         *  For debug builds we assert that the input values fall in the range
+         *  specified when constructing the table.
+         */
+        template <int numFuncInTable = 1, int funcIndex = 0, typename T>
+        void
+        evaluateDerivative(T     r,
+                           T *   derivativeValue) const
+        {
+            rangeCheck(r);
+            GMX_ASSERT(numFuncInTable == numFuncInTable_, "Evaluation method not matching number of functions in table");
+            GMX_ASSERT(funcIndex < numFuncInTable, "Function index not in range of the number of tables");
+
+            T     rTable   = r * T(tableScale_);
+            auto  tabIndex = cvttR2I(rTable); // type is either std::int32_t or SimdInt32
+            T     eps      = rTable - trunc(rTable);
+            T     t0;
+            T     t1;
+            T     t2 gmx_unused;
+
+            if (numFuncInTable == 1)
+            {
+                gatherLoadUBySimdIntTranspose<numFuncInTable>(derivativeMultiTableData_.data() + funcIndex, tabIndex, &t0, &t1); // works for scalar T too
+            }
+            else
+            {
+                // This is not ideal, but we need a version of gatherLoadUBySimdIntTranspose that
+                // only loads a single value from memory to implement it better (will be written)
+                gatherLoadUBySimdIntTranspose<numFuncInTable>(derivativeMultiTableData_.data() + funcIndex, tabIndex, &t0, &t2);        // works for scalar T too
+                gatherLoadUBySimdIntTranspose<numFuncInTable>(derivativeMultiTableData_.data() + funcIndex, tabIndex + T(1), &t1, &t2); // works for scalar T too
+            }
+
+            // (1-eps)*t0 + eps*t1
+            *derivativeValue = fma(t1-t0, eps, t0);
+        }
+
+        /************************************************************
+         *             Evaluation methods for two functions         *
+         ************************************************************/
+
+        /*! \brief Evaluate both function and derivative, two table functions
+         *
+         *  This is a templated method where the template can be either real or SimdReal.
+         *
+         *  \tparam     numFuncInTable  Number of separate functions in table, default is 2
+         *  \tparam     funcIndex0       Index of 1st function to evaluate in table, default is 0
+         *  \tparam     funcIndex1       Index of 2nd function to evaluate in table, default is 1
+         *  \tparam     T                Type (SimdReal or real) of lookup and result
+         *  \param      r                Points for which to evaluate function and derivative
+         *  \param[out] functionValue1   Interpolated value for first function
+         *  \param[out] derivativeValue1 Interpolated derivative for first function
+         *  \param[out] functionValue2   Interpolated value for second function
+         *  \param[out] derivativeValue2 Interpolated derivative for second function
+         *
+         *  For debug builds we assert that the input values fall in the range
+         *  specified when constructing the table.
+         */
+        template <int numFuncInTable = 2, int funcIndex0 = 0, int funcIndex1 = 1, typename T>
+        void
+        evaluateFunctionAndDerivative(T     r,
+                                      T *   functionValue1,
+                                      T *   derivativeValue1,
+                                      T *   functionValue2,
+                                      T *   derivativeValue2) const
+        {
+            rangeCheck(r);
+            GMX_ASSERT(numFuncInTable == numFuncInTable_, "Evaluation method not matching number of functions in table");
+            GMX_ASSERT(funcIndex0 < numFuncInTable && funcIndex1 < numFuncInTable, "Function index not in range of the number of tables");
+
+            T     rTable   = r * T(tableScale_);
+            auto  tabIndex = cvttR2I(rTable); // type is either std::int32_t or SimdInt32
+            T     eps      = rTable - trunc(rTable);
+            T     t0;
+            T     t1;
+            T     t2;
+            T     t3 gmx_unused;
+
+            // Load Derivative, Delta, Function, and Zero values for each table point.
+            // The 4 refers to these four values - not any SIMD width.
+            gatherLoadBySimdIntTranspose<4*numFuncInTable>(ddfzMultiTableData_.data() + 4*funcIndex0, tabIndex, &t0, &t1, &t2, &t3);
+            t1                = t0 + eps * t1;
+            *functionValue1   = fma( eps * T(halfSpacing_),  t0 + t1, t2);
+            *derivativeValue1 = t1;
+
+            gatherLoadBySimdIntTranspose<4*numFuncInTable>(ddfzMultiTableData_.data() + 4*funcIndex1, tabIndex, &t0, &t1, &t2, &t3);
+            t1                = t0 + eps * t1;
+            *functionValue2   = fma( eps * T(halfSpacing_),  t0 + t1, t2);
+            *derivativeValue2 = t1;
+        }
+
+        /*! \brief Evaluate function value only, two table functions
+         *
+         *  This is a templated method where the template can be either real or SimdReal.
+         *
+         *  \tparam     numFuncInTable   Number of separate functions in table, default is 2
+         *  \tparam     funcIndex0       Index of 1st function to evaluate in table, default is 0
+         *  \tparam     funcIndex1       Index of 2nd function to evaluate in table, default is 1
+         *  \tparam     T                Type (SimdReal or real) of lookup and result
+         *  \param      r                Points for which to evaluate function value
+         *  \param[out] functionValue1   Interpolated value for first function
+         *  \param[out] functionValue2   Interpolated value for second function
+         *
+         *  For debug builds we assert that the input values fall in the range
+         *  specified when constructing the table.
+         */
+        template <int numFuncInTable = 2, int funcIndex0 = 0, int funcIndex1 = 1, typename T>
+        void
+        evaluateFunction(T     r,
+                         T *   functionValue1,
+                         T *   functionValue2) const
+        {
+            T     der1 gmx_unused;
+            T     der2 gmx_unused;
+
+            evaluateFunctionAndDerivative<numFuncInTable, funcIndex0, funcIndex1>(r, functionValue1, &der1, functionValue2, &der2);
+        }
+
+        /*! \brief Evaluate function derivative only, two table functions
+         *
+         *  This is a templated method where the template can be either real or SimdReal.
+         *
+         *  \tparam     numFuncInTable   Number of separate functions in table, default is 2
+         *  \tparam     funcIndex0       Index of 1st function to evaluate in table, default is 0
+         *  \tparam     funcIndex1       Index of 2nd function to evaluate in table, default is 1
+         *  \tparam     T                Type (SimdReal or real) of lookup and result
+         *  \param      r                Points for which to evaluate function derivative
+         *  \param[out] derivativeValue1 Interpolated derivative for first function
+         *  \param[out] derivativeValue2 Interpolated derivative for second function
+         *
+         *  For debug builds we assert that the input values fall in the range
+         *  specified when constructing the table.
+         */
+        template <int numFuncInTable = 2, int funcIndex0 = 0, int funcIndex1 = 1, typename T>
+        void
+        evaluateDerivative(T     r,
+                           T *   derivativeValue1,
+                           T *   derivativeValue2) const
+        {
+            rangeCheck(r);
+            GMX_ASSERT(numFuncInTable == numFuncInTable_, "Evaluation method not matching number of functions in table");
+            GMX_ASSERT(funcIndex0 < numFuncInTable && funcIndex1 < numFuncInTable, "Function index not in range of the number of tables");
+
+            T     rTable   = r * T(tableScale_);
+            auto  tabIndex = cvttR2I(rTable); // type is either std::int32_t or SimdInt32
+            T     eps      = rTable - trunc(rTable);
+
+            if (numFuncInTable == 2 && funcIndex0 == 0 && funcIndex1 == 1)
+            {
+                T t0A, t0B, t1A, t1B;
+                gatherLoadUBySimdIntTranspose<numFuncInTable>(derivativeMultiTableData_.data(), tabIndex, &t0A, &t0B);     // works for scalar T too
+                gatherLoadUBySimdIntTranspose<numFuncInTable>(derivativeMultiTableData_.data() + 2, tabIndex, &t1A, &t1B); // works for scalar T too
+                *derivativeValue1 = fma(t1A-t0A, eps, t0A);
+                *derivativeValue2 = fma(t1B-t0B, eps, t0B);
+            }
+            else
+            {
+                T t0, t1, t2;
+                // This is not ideal, but we need a version of gatherLoadUBySimdIntTranspose that
+                // only loads a single value from memory to implement it better (will be written)
+                gatherLoadUBySimdIntTranspose<numFuncInTable>(derivativeMultiTableData_.data() + funcIndex0, tabIndex, &t0, &t2);        // works for scalar T too
+                gatherLoadUBySimdIntTranspose<numFuncInTable>(derivativeMultiTableData_.data() + funcIndex0, tabIndex + T(1), &t1, &t2); // works for scalar T too
+                *derivativeValue1 = fma(t1-t0, eps, t0);
+
+                gatherLoadUBySimdIntTranspose<numFuncInTable>(derivativeMultiTableData_.data() + funcIndex1, tabIndex, &t0, &t2);        // works for scalar T too
+                gatherLoadUBySimdIntTranspose<numFuncInTable>(derivativeMultiTableData_.data() + funcIndex1, tabIndex + T(1), &t1, &t2); // works for scalar T too
+                *derivativeValue2 = fma(t1-t0, eps, t0);
+            }
+        }
+
+        /************************************************************
+         *            Evaluation methods for three functions        *
+         ************************************************************/
+
+
+        /*! \brief Evaluate both function and derivative, three table functions
+         *
+         *  This is a templated method where the template can be either real or SimdReal.
+         *
+         *  \tparam     numFuncInTable   Number of separate functions in table, default is 3
+         *  \tparam     funcIndex0       Index of 1st function to evaluate in table, default is 0
+         *  \tparam     funcIndex1       Index of 2nd function to evaluate in table, default is 1
+         *  \tparam     funcIndex2       Index of 3rd function to evaluate in table, default is 2
+         *  \tparam     T                Type (SimdReal or real) of lookup and result
+         *  \param      r                Points for which to evaluate function and derivative
+         *  \param[out] functionValue1   Interpolated value for first function
+         *  \param[out] derivativeValue1 Interpolated derivative for first function
+         *  \param[out] functionValue2   Interpolated value for second function
+         *  \param[out] derivativeValue2 Interpolated derivative for second function
+         *  \param[out] functionValue3   Interpolated value for third function
+         *  \param[out] derivativeValue3 Interpolated derivative for third function
+         *
+         *  For debug builds we assert that the input values fall in the range
+         *  specified when constructing the table.
+         */
+        template <int numFuncInTable = 3, int funcIndex0 = 0, int funcIndex1 = 1, int funcIndex2 = 2, typename T>
+        void
+        evaluateFunctionAndDerivative(T     r,
+                                      T *   functionValue1,
+                                      T *   derivativeValue1,
+                                      T *   functionValue2,
+                                      T *   derivativeValue2,
+                                      T *   functionValue3,
+                                      T *   derivativeValue3) const
+        {
+            rangeCheck(r);
+            GMX_ASSERT(numFuncInTable == numFuncInTable, "Evaluation method not matching number of functions in table");
+            GMX_ASSERT(funcIndex0 < numFuncInTable  && funcIndex1 < numFuncInTable  && funcIndex2 < numFuncInTable,
+                       "Function index not in range of the number of tables");
+
+            T     rTable   = r * T(tableScale_);
+            auto  tabIndex = cvttR2I(rTable); // type is either std::int32_t or SimdInt32
+            T     eps      = rTable - trunc(rTable);
+            T     t0;
+            T     t1;
+            T     t2;
+            T     t3 gmx_unused;
+
+            gatherLoadBySimdIntTranspose<4*numFuncInTable>(ddfzMultiTableData_.data() + 4*funcIndex0, tabIndex, &t0, &t1, &t2, &t3);
+            t1                = t0 + eps * t1;
+            *functionValue1   = fma( eps * T(halfSpacing_),  t0 + t1, t2);
+            *derivativeValue1 = t1;
+
+            gatherLoadBySimdIntTranspose<4*numFuncInTable>(ddfzMultiTableData_.data() + 4*funcIndex1, tabIndex, &t0, &t1, &t2, &t3);
+            t1                = t0 + eps * t1;
+            *functionValue2   = fma( eps * T(halfSpacing_),  t0 + t1, t2);
+            *derivativeValue2 = t1;
+
+            gatherLoadBySimdIntTranspose<4*numFuncInTable>(ddfzMultiTableData_.data() + 4*funcIndex2, tabIndex, &t0, &t1, &t2, &t3);
+            t1                = t0 + eps * t1;
+            *functionValue3   = fma( eps * T(halfSpacing_),  t0 + t1, t2);
+            *derivativeValue3 = t1;
+        }
+
+        /*! \brief Evaluate function value only, three table functions
+         *
+         *  This is a templated method where the template can be either real or SimdReal.
+         *
+         *  \tparam     numFuncInTable   Number of separate functions in table, default is 3
+         *  \tparam     funcIndex0       Index of 1st function to evaluate in table, default is 0
+         *  \tparam     funcIndex1       Index of 2nd function to evaluate in table, default is 1
+         *  \tparam     funcIndex2       Index of 3rd function to evaluate in table, default is 2
+         *  \tparam     T                Type (SimdReal or real) of lookup and result
+         *  \param      r                Points for which to evaluate function value
+         *  \param[out] functionValue1   Interpolated value for first function
+         *  \param[out] functionValue2   Interpolated value for second function
+         *  \param[out] functionValue3   Interpolated value for third function
+         *
+         *  For debug builds we assert that the input values fall in the range
+         *  specified when constructing the table.
+         */
+        template <int numFuncInTable = 3, int funcIndex0 = 0, int funcIndex1 = 1, int funcIndex2 = 2, typename T>
+        void
+        evaluateFunction(T     r,
+                         T *   functionValue1,
+                         T *   functionValue2,
+                         T *   functionValue3) const
+        {
+            T     der1 gmx_unused;
+            T     der2 gmx_unused;
+            T     der3 gmx_unused;
+
+            evaluateFunctionAndDerivative<numFuncInTable, funcIndex0, funcIndex1, funcIndex2>(r, functionValue1, &der1, functionValue2, &der2, functionValue3, &der3);
+        }
+
+        /*! \brief Evaluate function derivative only, three table functions
+         *
+         *  This is a templated method where the template can be either real or SimdReal.
+         *
+         *  \tparam     numFuncInTable   Number of separate functions in table, default is 3
+         *  \tparam     funcIndex0       Index of 1st function to evaluate in table, default is 0
+         *  \tparam     funcIndex1       Index of 2nd function to evaluate in table, default is 1
+         *  \tparam     funcIndex2       Index of 3rd function to evaluate in table, default is 2
+         *  \tparam     T                Type (SimdReal or real) of lookup and result
+         *  \param      r                Points for which to evaluate function derivative
+         *  \param[out] derivativeValue1 Interpolated derivative for first function
+         *  \param[out] derivativeValue2 Interpolated derivative for second function
+         *  \param[out] derivativeValue3 Interpolated derivative for third function
+         *
+         *  For debug builds we assert that the input values fall in the range
+         *  specified when constructing the table.
+         */
+        template <int numFuncInTable = 3, int funcIndex0 = 0, int funcIndex1 = 1, int funcIndex2 = 2, typename T>
+        void
+        evaluateDerivative(T     r,
+                           T *   derivativeValue1,
+                           T *   derivativeValue2,
+                           T *   derivativeValue3) const
+        {
+            rangeCheck(r);
+            GMX_ASSERT(numFuncInTable == numFuncInTable_, "Evaluation method not matching number of functions in table");
+            GMX_ASSERT(funcIndex0 < numFuncInTable  && funcIndex1 < numFuncInTable  && funcIndex2 < numFuncInTable,
+                       "Function index not in range of the number of tables");
+
+            T     rTable   = r * T(tableScale_);
+            auto  tabIndex = cvttR2I(rTable); // type is either std::int32_t or SimdInt32
+            T     eps      = rTable - trunc(rTable);
+
+            if (numFuncInTable == 3 && funcIndex0 == 0 && funcIndex1 == 1 && funcIndex2 == 2)
+            {
+                T t0A, t0B, t0C, t1A, t1B, t1C;
+                gatherLoadUBySimdIntTranspose<numFuncInTable>(derivativeMultiTableData_.data(), tabIndex, &t0A, &t0B);
+                gatherLoadUBySimdIntTranspose<numFuncInTable>(derivativeMultiTableData_.data() + 2, tabIndex, &t0C, &t1A);
+                gatherLoadUBySimdIntTranspose<numFuncInTable>(derivativeMultiTableData_.data() + 4, tabIndex, &t1B, &t1C);
+                *derivativeValue1 = fma(t1A-t0A, eps, t0A);
+                *derivativeValue2 = fma(t1B-t0B, eps, t0B);
+                *derivativeValue3 = fma(t1C-t0C, eps, t0C);
+            }
+            else
+            {
+                T t0, t1, t2;
+                // This is not ideal, but we need a version of gatherLoadUBySimdIntTranspose that
+                // only loads a single value from memory to implement it better (will be written)
+                gatherLoadUBySimdIntTranspose<numFuncInTable>(derivativeMultiTableData_.data() + funcIndex0, tabIndex, &t0, &t2);        // works for scalar T too
+                gatherLoadUBySimdIntTranspose<numFuncInTable>(derivativeMultiTableData_.data() + funcIndex0, tabIndex + T(1), &t1, &t2); // works for scalar T too
+                *derivativeValue1 = fma(t1-t0, eps, t0);
+
+                gatherLoadUBySimdIntTranspose<numFuncInTable>(derivativeMultiTableData_.data() + funcIndex1, tabIndex, &t0, &t2);        // works for scalar T too
+                gatherLoadUBySimdIntTranspose<numFuncInTable>(derivativeMultiTableData_.data() + funcIndex1, tabIndex + T(1), &t1, &t2); // works for scalar T too
+                *derivativeValue2 = fma(t1-t0, eps, t0);
+
+                gatherLoadUBySimdIntTranspose<numFuncInTable>(derivativeMultiTableData_.data() + funcIndex2, tabIndex, &t0, &t2);        // works for scalar T too
+                gatherLoadUBySimdIntTranspose<numFuncInTable>(derivativeMultiTableData_.data() + funcIndex2, tabIndex + T(1), &t1, &t2); // works for scalar T too
+                *derivativeValue3 = fma(t1-t0, eps, t0);
+            }
+        }
+
+        /*! \brief Return the table spacing (distance between points)
+         *
+         *  You should never have to use this for normal code, but due to the
+         *  way tables are constructed internally we need this in the unit tests
+         *  to check relative tolerances over each interval.
+         *
+         *  \return table spacing.
+         */
+        real
+        tableSpacing() const { return 1.0 / tableScale_; }
+
+    private:
+
+        std::size_t             numFuncInTable_; //!< Number of separate tabluated functions
+        std::pair<real, real>   range_;          //!< Range for which table evaluation is allowed
+        real                    tableScale_;     //!< Table scale (inverse of spacing between points)
+        real                    halfSpacing_;    //!< 0.5*spacing (used for DDFZ table data)
+
+        //!< Derivative values only, with the third-derivative subtraction described in the class documentation.
+        std::vector<real>      derivativeMultiTableData_;
+
+        /*! \brief Combined derivative, difference to next derivative, value, and zero.
+         *
+         *  For table point i, this vector contains the four values:
+         *  - derivative[i]
+         *  - (derivative[i+1]-derivative[i])
+         *  - value[i]
+         *  - 0.0
+         *
+         *  For the derivative terms we have subtracted the third-derivative term described
+         *  in the main class documentation.
+         *
+         *  This is typically more efficient than the individual tables, in particular
+         *  when using SIMD. The result should be identical outside the class, so this
+         *  is merely an internal implementation optimization. However, to allow
+         *  aligned SIMD loads we need to use an aligned allocator for this container.
+         *  We occasionally abbreviate this data as DDFZ.
+         */
+        std::vector<real, AlignedAllocator<real> >  ddfzMultiTableData_;
+
+        // There should never be any reason to copy the table since it is read-only
+        GMX_DISALLOW_COPY_AND_ASSIGN(QuadraticSplineTable);
+};
+
+
+}      // namespace gmx
+
+#endif // GMX_TABLES_QUADRATICSPLINETABLE_H
diff --git a/src/gromacs/tables/splineutil.cpp b/src/gromacs/tables/splineutil.cpp
new file mode 100644 (file)
index 0000000..1e4452e
--- /dev/null
@@ -0,0 +1,334 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+
+/*! \internal \file
+ * \brief
+ * Implements internal utility functions for spline tables
+ *
+ * \author Erik Lindahl <erik.lindahl@gmail.com>
+ * \ingroup module_tables
+ */
+#include "gmxpre.h"
+
+#include "splineutil.h"
+
+#include <cmath>
+
+#include <algorithm>
+#include <functional>
+#include <utility>
+#include <vector>
+
+#include "gromacs/utility/alignedallocator.h"
+#include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/real.h"
+#include "gromacs/utility/stringutil.h"
+
+namespace gmx
+{
+
+namespace internal
+{
+
+void
+throwUnlessDerivativeIsConsistentWithFunction(const std::function<double(double)>  &function,
+                                              const std::function<double(double)>  &derivative,
+                                              const std::pair<real, real>          &range)
+{
+    // Since the numerical derivative will evaluate extra points
+    // we shrink the interval slightly to avoid calling the function with values
+    // outside the range specified.
+    double                     h            = std::cbrt(GMX_DOUBLE_EPS); // ideal spacing
+    std::pair<double, double>  newRange(range.first + h, range.second - h);
+    const int                  points       = 1000;                      // arbitrary
+    double                     dx           = (newRange.second - newRange.first) / points;
+    bool                       isConsistent = true;
+    double                     minFail      = newRange.second;
+    double                     maxFail      = newRange.first;
+
+    for (double x = newRange.first; x <= newRange.second; x += dx)
+    {
+        double analyticalDerivative = derivative(x);
+        double numericalDerivative  = (function(x+h)-function(x-h))/(2*h);
+        double thirdDerivative      = (derivative(x+h)-2.0*derivative(x)+derivative(x-h))/(h*h);
+
+        // We make two types of errors in numerical calculation of the derivative:
+        // - The truncation error: eps * |f| / h
+        // - The rounding error: h * h * |f'''| / 6.0
+        double expectedErr = GMX_DOUBLE_EPS*std::abs(function(x))/h + h*h*std::abs(thirdDerivative)/6.0;
+
+        // To avoid triggering false errors because of compiler optimization or numerical issues
+        // in the function evalulation we allow an extra factor of 10 in the expected error
+        if (std::abs(analyticalDerivative-numericalDerivative) > 10.0*expectedErr)
+        {
+            isConsistent = false;
+            minFail      = std::min(minFail, x);
+            maxFail      = std::max(maxFail, x);
+        }
+    }
+
+    if (!isConsistent)
+    {
+        GMX_THROW(InconsistentInputError(formatString("Derivative inconsistent with analytical function in range [%d,%d]", minFail, maxFail)));
+    }
+}
+
+
+void
+throwUnlessDerivativeIsConsistentWithFunction(ConstArrayRef<double>         function,
+                                              ConstArrayRef<double>         derivative,
+                                              double                        inputSpacing,
+                                              const std::pair<real, real>  &range)
+{
+    std::size_t     firstIndex   = range.first / inputSpacing;
+    std::size_t     lastIndex    = range.second / inputSpacing;
+    bool            isConsistent = true;
+    std::size_t     minFail      = lastIndex;
+    std::size_t     maxFail      = firstIndex;
+
+    // The derivative will access one extra point before/after each point, so reduce interval
+    for (std::size_t i = firstIndex + 1; (i + 1) < lastIndex; i++)
+    {
+        double inputDerivative     = derivative[i];
+        double numericalDerivative = (function[i+1] - function[i-1]) / (2.0 * inputSpacing);
+        double thirdDerivative     = (derivative[i+1] - 2.0*derivative[i] + derivative[i-1])/(inputSpacing * inputSpacing);
+
+        // We make two types of errors in numerical calculation of the derivative:
+        // - The truncation error: eps * |f| / h
+        // - The rounding error: h * h * |f'''| / 6.0
+        double expectedErr = GMX_DOUBLE_EPS*std::abs(function[i])/inputSpacing + inputSpacing*inputSpacing*std::abs(thirdDerivative)/6.0;
+
+        // To avoid triggering false errors because of compiler optimization or numerical issues
+        // in the function evalulation we allow an extra factor of 10 in the expected error
+        if (std::abs(inputDerivative-numericalDerivative) > 10.0*expectedErr)
+        {
+            isConsistent = false;
+            minFail      = std::min(minFail, i);
+            maxFail      = std::max(maxFail, i);
+        }
+    }
+    if (!isConsistent)
+    {
+        GMX_THROW(InconsistentInputError(formatString("Derivative inconsistent with numerical vector for elements %d-%d", minFail+1, maxFail+1)));
+    }
+}
+
+
+/*! \brief Update minQuotient if the ratio of this function value and its second derivative is smaller
+ *
+ * This is a utility function used in the functions to find the smallest quotient
+ * in a range.
+ *
+ * \param[in]    previousPoint Value of function at x-h.
+ * \param[in]    thisPoint     Value of function at x.
+ * \param[in]    nextPoint     Value of function at x+h.
+ * \param[in]    spacing       Value of h.
+ * \param[inout] minQuotient   Current minimum of such quotients, updated if this quotient is smaller.
+ */
+static void
+updateMinQuotientOfFunctionAndSecondDerivative(double     previousPoint,
+                                               double     thisPoint,
+                                               double     nextPoint,
+                                               double     spacing,
+                                               double *   minQuotient)
+{
+    double value             = std::abs( thisPoint );
+    double secondDerivative  = std::abs( (previousPoint - 2.0 * thisPoint + nextPoint) / (spacing * spacing ) );
+
+    // Make sure we do not divide by zero. This limit is arbitrary,
+    // but it doesnt matter since this point will have a very large value,
+    // and the whole routine is searching for the smallest value.
+    secondDerivative = std::max(secondDerivative, static_cast<double>(std::sqrt(GMX_REAL_MIN)));
+
+    *minQuotient = std::min(*minQuotient, value / secondDerivative);
+}
+
+
+real
+findSmallestQuotientOfFunctionAndSecondDerivative(const std::function<double(double)>   &f,
+                                                  const std::pair<real, real>           &range)
+{
+    // Since the numerical second derivative will evaluate extra points
+    // we shrink the interval slightly to avoid calling the function with values
+    // outside the range specified.
+    double                     h           = std::pow( GMX_DOUBLE_EPS, 0.25 );
+    std::pair<double, double>  newRange(range.first + h, range.second - h);
+    const int                  points      = 1000; // arbitrary
+    double                     dx          = (newRange.second - newRange.first) / points;
+    double                     minQuotient = GMX_REAL_MAX;
+
+    for (double x = newRange.first; x <= newRange.second; x += dx)
+    {
+        updateMinQuotientOfFunctionAndSecondDerivative(f(x-h), f(x), f(x+h), h, &minQuotient);
+    }
+    return static_cast<real>(minQuotient);
+}
+
+
+
+
+
+
+real
+findSmallestQuotientOfFunctionAndSecondDerivative(ConstArrayRef<double>         function,
+                                                  double                        inputSpacing,
+                                                  const std::pair<real, real>   &range)
+{
+
+    std::size_t  firstIndex  = range.first  / inputSpacing;
+    std::size_t  lastIndex   = range.second / inputSpacing;
+    double       minQuotient = GMX_REAL_MAX;
+
+    for (std::size_t i = firstIndex + 1; (i + 1) < lastIndex; i++)
+    {
+        updateMinQuotientOfFunctionAndSecondDerivative(function[i-1], function[i], function[i+1], inputSpacing, &minQuotient);
+    }
+    return static_cast<real>(minQuotient);
+}
+
+
+
+/*! \brief Update minQuotient if the ratio of this function value and its third derivative is smaller
+ *
+ * This is a utility function used in the functions to find the smallest quotient
+ * in a range.
+ *
+ * \param[in]    previousPreviousPoint Value of function at x-2h.
+ * \param[in]    previousPoint         Value of function at x-h.
+ * \param[in]    thisPoint             Value of function at x.
+ * \param[in]    nextPoint             Value of function at x+h.
+ * \param[in]    nextNextPoint         Value of function at x+2h.
+ * \param[in]    spacing               Value of h.
+ * \param[inout] minQuotient   Current minimum of such quotients, updated if this quotient is smaller.
+ */
+static void
+updateMinQuotientOfFunctionAndThirdDerivative(double     previousPreviousPoint,
+                                              double     previousPoint,
+                                              double     thisPoint,
+                                              double     nextPoint,
+                                              double     nextNextPoint,
+                                              double     spacing,
+                                              double *   minQuotient)
+{
+    double value            = std::abs( thisPoint );
+    double thirdDerivative  = std::abs((nextNextPoint - 2 * nextPoint + 2 * previousPoint - previousPreviousPoint) / (2 * spacing * spacing * spacing));
+
+    // Make sure we do not divide by zero. This limit is arbitrary,
+    // but it doesnt matter since this point will have a very large value,
+    // and the whole routine is searching for the smallest value.
+    thirdDerivative = std::max(thirdDerivative, static_cast<double>(std::sqrt(GMX_REAL_MIN)));
+
+    *minQuotient = std::min(*minQuotient, value / thirdDerivative);
+}
+
+
+real
+findSmallestQuotientOfFunctionAndThirdDerivative(const std::function<double(double)>  &f,
+                                                 const std::pair<real, real>           &range)
+{
+    // Since the numerical second derivative will evaluate extra points
+    // we shrink the interval slightly to avoid calling the function with values
+    // outside the range specified.
+    double                     h           = std::pow( GMX_DOUBLE_EPS, 0.2 ); // optimal spacing for 3rd derivative
+    std::pair<double, double>  newRange(range.first + 2*h, range.second - 2*h);
+    const int                  points      = 1000;                            // arbitrary
+    double                     dx          = (newRange.second - newRange.first) / points;
+    double                     minQuotient = GMX_REAL_MAX;
+
+    for (double x = newRange.first; x <= newRange.second; x += dx)
+    {
+        updateMinQuotientOfFunctionAndThirdDerivative(f(x-2*h), f(x-h), f(x), f(x+h), f(x+2*h), h, &minQuotient);
+    }
+    return static_cast<real>(minQuotient);
+}
+
+
+real
+findSmallestQuotientOfFunctionAndThirdDerivative(ConstArrayRef<double>         function,
+                                                 double                        inputSpacing,
+                                                 const std::pair<real, real>   &range)
+{
+
+    std::size_t  firstIndex  = range.first  / inputSpacing;
+    std::size_t  lastIndex   = range.second / inputSpacing;
+    double       minQuotient = GMX_REAL_MAX;
+
+    for (std::size_t i = firstIndex + 2; (i + 2) < lastIndex; i++)
+    {
+        updateMinQuotientOfFunctionAndThirdDerivative(function[i-2], function[i-1], function[i], function[i+1], function[i+2], inputSpacing, &minQuotient);
+    }
+    return static_cast<real>(minQuotient);
+}
+
+
+
+std::vector<double>
+vectorSecondDerivative(ConstArrayRef<double> f, double spacing)
+{
+    if (f.size() < 5)
+    {
+        GMX_THROW(APIError("Too few points in vector for 5-point differentiation"));
+    }
+
+    std::vector<double> d(f.size());
+    std::size_t         i;
+
+    // 5-point formula evaluated for points 0,1
+    i    = 0;
+    d[i] = (11 * f[i+4] - 56 * f[i+3] + 114 * f[i+2] - 104 * f[i+1] + 35 * f[i]) / ( 12 * spacing * spacing);
+    i    = 1;
+    d[i] = (-f[i+3] + 4 * f[i+2] + 6 * f[i+1] - 20 * f[i] + 11 * f[i-1]) / ( 12 * spacing * spacing);
+
+    for (std::size_t i = 2; i < d.size() - 2; i++)
+    {
+        // 5-point formula evaluated for central point (2)
+        d[i] = (-f[i+2] + 16 * f[i+1] - 30 * f[i] + 16 * f[i-1] - f[i-2]) / (12 * spacing * spacing);
+    }
+
+    // 5-point formula evaluated for points 3,4
+    i    = d.size() - 2;
+    d[i] = (11 * f[i+1] - 20 * f[i] + 6 * f[i-1] + 4 * f[i-2] - f[i-3]) / ( 12 * spacing * spacing);
+    i    = d.size() - 1;
+    d[i] = (35 * f[i] - 104 * f[i-1] + 114 * f[i-2] - 56 * f[i-3] + 11 * f[i-4]) / ( 12 * spacing * spacing);
+
+    return d;
+}
+
+
+
+}  // namespace internal
+
+}  // namespace gmx
diff --git a/src/gromacs/tables/splineutil.h b/src/gromacs/tables/splineutil.h
new file mode 100644 (file)
index 0000000..bbf8cdd
--- /dev/null
@@ -0,0 +1,332 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+
+/*! \internal \file
+ * \brief
+ * Declares internal utility functions for spline tables
+ *
+ * \author Erik Lindahl <erik.lindahl@gmail.com>
+ * \ingroup module_tables
+ */
+#ifndef GMX_TABLES_SPLINEUTIL_H
+#define GMX_TABLES_SPLINEUTIL_H
+
+#include <functional>
+#include <utility>
+#include <vector>
+
+#include "gromacs/utility/alignedallocator.h"
+#include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/real.h"
+
+namespace gmx
+{
+
+namespace internal
+{
+
+/*! \brief Ensure analytical derivative is the derivative of analytical function.
+ *
+ *  This routine evaluates the numerical derivative of the function for
+ *  a few (1000) points in the interval and checks that the relative difference
+ *  between numerical and analytical derivative is within the expected error
+ *  for the numerical derivative approximation we use.
+ *
+ *  The main point of this routine is to make sure the user has not made a
+ *  mistake or sign error when defining the functions.
+ *
+ *  \param function   Analytical function to differentiate
+ *  \param derivative Analytical derivative to compare with
+ *  \param range      Range to test
+ *
+ *  \throws If the provided derivative does not seem to match the function.
+ *
+ *  \note The function/derivative are always double-valued to avoid accuracy loss.
+ */
+void
+throwUnlessDerivativeIsConsistentWithFunction(const std::function<double(double)>  &function,
+                                              const std::function<double(double)>  &derivative,
+                                              const std::pair<real, real>          &range);
+
+/*! \brief Ensure vector of derivative values is the derivative of function vector.
+ *
+ *  This routine differentiates a vector of numerical values and checks
+ *  that the relative difference to a provided vector of numerical derivatives
+ *  is smaller than the expected error from the numerical differentiation.
+ *
+ *  The main point of this routine is to make sure the user has not made a
+ *  mistake or sign error when defining the functions.
+ *
+ *  To avoid problems if the vectors change from zero to finite values at the
+ *  start/end of the interval, we only check inside the range requested.
+ *
+ *  \param function     Numerical function value vector to differentiate
+ *  \param derivative   Numerical derivative vector to compare with
+ *  \param inputSpacing Distance between input points
+ *  \param range        Range to test
+ *
+ *  \throws If the provided derivative does not seem to match the function.
+ *
+ *  \note The function/derivative vectors and spacing are always double-valued
+ *        to avoid accuracy loss.
+ */
+void
+throwUnlessDerivativeIsConsistentWithFunction(ConstArrayRef<double>         function,
+                                              ConstArrayRef<double>         derivative,
+                                              double                        inputSpacing,
+                                              const std::pair<real, real>  &range);
+
+
+
+
+/*! \brief Find smallest quotient between analytical function and its 2nd derivative
+ *
+ *  Used to calculate spacing for quadratic spline tables. This function divides the
+ *  function value by the second derivative (or a very small number when that is zero),
+ *  and returns the smallest such quotient found in the range.
+ *
+ *  Our quadratic tables corresponds to linear interpolation of the derivative,
+ *  which means the derivative will typically have larger error than the value
+ *  when interpolating. The spacing required to reach a particular relative
+ *  tolerance in the derivative depends on the quotient between the first
+ *  derivative and the third derivative of the function itself.
+ *
+ *  You should call this routine with the analytical derivative as the "function"
+ *  parameter, and the quotient between "function and second derivative" will
+ *  then correspond to the quotient bewteen the derivative and the third derivative
+ *  of the actual function we want to tabulate.
+ *
+ *  Since all functions that can be tabulated efficiently are reasonably smooth,
+ *  we simply check 1,000 points in the interval rather than bother about
+ *  implementing any complicated global optimization scheme.
+ *
+ *  \param f          Analytical function
+ *  \param range      Interval
+ *
+ *  \return Smallest quotient found in range.
+ *
+ *  \note The function is always double-valued to avoid accuracy loss.
+ */
+real
+findSmallestQuotientOfFunctionAndSecondDerivative(const std::function<double(double)>  &f,
+                                                  const std::pair<real, real>          &range);
+
+
+
+
+
+/*! \brief Find smallest quotient between vector of values and its 2nd derivative
+ *
+ *  Used to calculate spacing for quadratic spline tables. This function divides the
+ *  function value by the second derivative (or a very small number when that is zero),
+ *  and returns the smallest such quotient found in the range.
+ *
+ *  Our quadratic tables corresponds to linear interpolation of the derivative,
+ *  which means the derivative will typically have larger error than the value
+ *  when interpolating. The spacing required to reach a particular relative
+ *  tolerance in the derivative depends on the quotient between the first
+ *  derivative and the third derivative of the function itself.
+ *
+ *  You should call this routine with the analytical derivative as the "function"
+ *  parameter, and the quotient between "function and second derivative" will
+ *  then correspond to the quotient bewteen the derivative and the third derivative
+ *  of the actual function we want to tabulate.
+ *
+ *  \param function     Vector with function values
+ *  \param inputSpacing Spacing between function values
+ *  \param range        Interval to check
+ *
+ *  \return Smallest quotient found in range.
+ *
+ *  \note The function vector and input spacing are always double-valued to
+ *        avoid accuracy loss.
+ */
+real
+findSmallestQuotientOfFunctionAndSecondDerivative(ConstArrayRef<double>         function,
+                                                  double                        inputSpacing,
+                                                  const std::pair<real, real>  &range);
+
+
+
+
+
+/*! \brief Find smallest quotient between analytical function and its 3rd derivative
+ *
+ *  Used to calculate table spacing. This function divides the function value
+ *  by the second derivative (or a very small number when that is zero), and
+ *  returns the smallest such quotient found in the range.
+ *
+ *  Our quadratic tables corresponds to linear interpolation of the derivative,
+ *  which means the derivative will typically have larger error than the value
+ *  when interpolating. The spacing required to reach a particular relative
+ *  tolerance in the derivative depends on the quotient between the first
+ *  derivative and the third derivative of the function itself.
+ *
+ *  You should call this routine with the analytical derivative as the "function"
+ *  parameter, and the quotient between "function and second derivative" will
+ *  then correspond to the quotient bewteen the derivative and the third derivative
+ *  of the actual function we want to tabulate.
+ *
+ *  Since all functions that can be tabulated efficiently are reasonably smooth,
+ *  we simply check 1,000 points in the interval rather than bother about
+ *  implementing any complicated global optimization scheme.
+ *
+ *  \param f          Analytical function
+ *  \param range      Interval
+ *
+ *  \return Smallest quotient found in range.
+ *
+ *  \note The function is always double-valued to avoid accuracy loss.
+ */
+real
+findSmallestQuotientOfFunctionAndThirdDerivative(const std::function<double(double)>  &f,
+                                                 const std::pair<real, real>          &range);
+
+
+
+
+/*! \brief Find smallest quotient between function and 2nd derivative (vectors)
+ *
+ *  Used to calculate table spacing. This function divides the function value
+ *  by the second derivative (or a very small number when that is zero), and
+ *  returns the smallest such quotient found in the range.
+ *
+ *  Our quadratic tables corresponds to linear interpolation of the derivative,
+ *  which means the derivative will typically have larger error than the value
+ *  when interpolating. The spacing required to reach a particular relative
+ *  tolerance in the derivative depends on the quotient between the first
+ *  derivative and the third derivative of the function itself.
+ *
+ *  You should call this routine with the analytical derivative as the "function"
+ *  parameter, and the quotient between "function and second derivative" will
+ *  then correspond to the quotient bewteen the derivative and the third derivative
+ *  of the actual function we want to tabulate.
+ *
+ *  \param function     Vector with function values
+ *  \param inputSpacing Spacing between function values
+ *  \param range        Interval to check
+ *
+ *  \return Smallest quotient found in range.
+ *
+ *  \note The function vector and input spacing are always double-valued to
+ *        avoid accuracy loss.
+ */
+real
+findSmallestQuotientOfFunctionAndThirdDerivative(ConstArrayRef<double>         function,
+                                                 double                        inputSpacing,
+                                                 const std::pair<real, real>  &range);
+
+
+/*! \brief Calculate second derivative of vector and return vector of same length
+ *
+ *  5-point approximations are used, with endpoints using non-center interpolation.
+ *
+ *  \param f       Vector (function) for which to calculate second derivative
+ *  \param spacing Spacing of input data.
+ *
+ *  \throws If the input vector has fewer than five data points.
+ *
+ * \note This function always uses double precision arguments since it is meant
+ *       to be used on raw user input data for tables, where we want to avoid
+ *       accuracy loss (since differentiation can be numerically fragile).
+ */
+std::vector<double>
+vectorSecondDerivative(ConstArrayRef<double>        f,
+                       double                       spacing);
+
+
+/*! \brief Copy (temporary) table data into aligned multiplexed vector
+ *
+ *  This routine takes the temporary data generated for a single table
+ *  and writes multiplexed output into a multiple-table-data vector.
+ *  If the output vector is empty we will resize it to fit the data, and
+ *  otherwise we assert the size is correct to add out input data.
+ *
+ *  \tparam T     Type of container for input data
+ *  \tparam U     Type of container for output data
+ *
+ *  \param[in]    inputData               Input data for single table
+ *  \param[inout] multiplexedOutputData   Multiplexed output vector, many tables.
+ *  \param[in]    valuesPerTablePoint     Number of real values for each table point,
+ *                                        for instance 4 in DDFZ tables.
+ *  \param[in]    numTables               Number of tables mixed into multiplexed output
+ *  \param[in]    thisTableIndex          Index of this table in multiplexed output
+ *
+ *  \note The output container type can be different from the input since the latter
+ *        sometimes uses an aligned allocator so the data can be loaded efficiently
+ *        in the GROMACS nonbonded kernels.
+ */
+template<class T, class U>
+void
+fillMultiplexedTableData(const T           inputData,
+                         U *               multiplexedOutputData,
+                         std::size_t       valuesPerTablePoint,
+                         std::size_t       numTables,
+                         std::size_t       thisTableIndex)
+{
+    if (multiplexedOutputData->size() == 0)
+    {
+        multiplexedOutputData->resize( inputData.size() * numTables );
+    }
+    else
+    {
+        GMX_ASSERT(inputData.size() * numTables == multiplexedOutputData->size(),
+                   "Size mismatch when multiplexing table data");
+    }
+
+    GMX_ASSERT(inputData.size() % valuesPerTablePoint == 0,
+               "Input table size must be a multiple of valuesPerTablePoint");
+
+    std::size_t points = inputData.size() / valuesPerTablePoint;
+
+    for (std::size_t i = 0; i < points; i++)
+    {
+        std::size_t inputOffset  = valuesPerTablePoint * i;
+        std::size_t outputOffset = valuesPerTablePoint * ( numTables * i + thisTableIndex );
+
+        for (std::size_t j = 0; j < valuesPerTablePoint; j++)
+        {
+            (*multiplexedOutputData)[outputOffset + j] = inputData[inputOffset + j];
+        }
+    }
+}
+
+
+}      // namespace internal
+
+}      // namespace gmx
+
+#endif // GMX_TABLES_SPLINEUTIL_H
diff --git a/src/gromacs/tables/tableinput.h b/src/gromacs/tables/tableinput.h
new file mode 100644 (file)
index 0000000..08b66c2
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+
+/*! \libinternal \file
+ * \brief
+ * Declares structures for analytical or numerical input data to construct tables
+ *
+ * \inlibraryapi
+ * \author Erik Lindahl <erik.lindahl@gmail.com>
+ * \ingroup module_tables
+ */
+
+#ifndef GMX_TABLES_TABLEINPUT_H
+#define GMX_TABLES_TABLEINPUT_H
+
+#include <functional>
+#include <vector>
+
+#include "gromacs/utility/arrayref.h"
+
+namespace gmx
+{
+
+/*! \libinternal \brief Specification for analytical table function (name, function, derivative)
+ */
+struct
+AnalyticalSplineTableInput
+{
+    const std::string                    &desc;        //!< \libinternal Brief description of function
+    std::function<double(double)>         function;    //!< \libinternal Analytical form of function
+    std::function<double(double)>         derivative;  //!< \libinternal Analytical derivative
+};
+
+/*! \libinternal \brief Specification for vector table function (name, function, derivative, spacing)
+ */
+struct
+NumericalSplineTableInput
+{
+    const std::string                    &desc;        //!< \libinternal Brief description of function
+    ConstArrayRef<double>                 function;    //!< \libinternal Vector with function values
+    ConstArrayRef<double>                 derivative;  //!< \libinternal Vector with derivative values
+    double                                spacing;     //!< \libinternal Distance between data points
+};
+
+
+} // namespace gmx
+
+
+#endif // GMX_TABLES_TABLEINPUT_H
diff --git a/src/gromacs/tables/tests/CMakeLists.txt b/src/gromacs/tables/tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..c1cd341
--- /dev/null
@@ -0,0 +1,37 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 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.
+
+gmx_add_unit_test(TableUnitTests table-test
+                  splinetable.cpp
+                  )
diff --git a/src/gromacs/tables/tests/splinetable.cpp b/src/gromacs/tables/tests/splinetable.cpp
new file mode 100644 (file)
index 0000000..02b7ea7
--- /dev/null
@@ -0,0 +1,763 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Tests for simple math functions.eval
+ *
+ * \author Erik Lindahl <erik.lindahl@gmail.com>
+ * \ingroup module_tables
+ */
+#include "gmxpre.h"
+
+#include <cmath>
+
+#include <algorithm>
+#include <functional>
+#include <utility>
+
+#include <gtest/gtest.h>
+
+#include "gromacs/math/utilities.h"
+#include "gromacs/options/basicoptions.h"
+#include "gromacs/options/ioptionscontainer.h"
+#include "gromacs/simd/simd.h"
+#include "gromacs/tables/cubicsplinetable.h"
+#include "gromacs/tables/quadraticsplinetable.h"
+
+#include "testutils/testasserts.h"
+#include "testutils/testoptions.h"
+
+
+namespace gmx
+{
+
+namespace test
+{
+
+namespace
+{
+
+class SplineTableTestBase : public ::testing::Test
+{
+    public:
+        static int  s_testPoints_; //!< Number of points to use. Public so we can set it as option
+};
+
+int
+SplineTableTestBase::s_testPoints_ = 100;
+
+/*! \cond */
+/*! \brief Command-line option to adjust the number of points used to test SIMD math functions. */
+GMX_TEST_OPTIONS(SplineTableTestOptions, options)
+{
+    options->addOption(::gmx::IntegerOption("npoints")
+                           .store(&SplineTableTestBase::s_testPoints_)
+                           .description("Number of points to test for spline table functions"));
+}
+/*! \endcond */
+
+
+
+
+/*! \brief Test fixture for table comparision with analytical/numerical functions */
+template <typename T>
+class SplineTableTest : public SplineTableTestBase
+{
+    public:
+        SplineTableTest() : tolerance_(T::defaultTolerance) {}
+
+        /*! \brief Set a new tolerance to be used in table function comparison
+         *
+         *  \param tol New tolerance to use
+         */
+        void
+        setTolerance(real tol) { tolerance_ = tol; }
+
+        //! \cond internal
+        /*! \internal \brief
+         * Assertion predicate formatter for comparing table with function/derivative
+         */
+        template<int numFuncInTable = 1, int funcIndex = 0>
+        void
+        testSplineTableAgainstFunctions(const std::string                    &desc,
+                                        const std::function<double(double)>  &refFunc,
+                                        const std::function<double(double)>  &refDer,
+                                        const T                              &table,
+                                        const std::pair<real, real>          &testRange);
+        //! \endcond
+
+    private:
+        real        tolerance_;    //!< Tolerance to use
+};
+
+template <class T>
+template<int numFuncInTable, int funcIndex>
+void
+SplineTableTest<T>::testSplineTableAgainstFunctions(const std::string                    &desc,
+                                                    const std::function<double(double)>  &refFunc,
+                                                    const std::function<double(double)>  &refDer,
+                                                    const T                              &table,
+                                                    const std::pair<real, real>          &testRange)
+{
+    real                   dx = (testRange.second - testRange.first) / s_testPoints_;
+
+    FloatingPointTolerance funcTolerance(relativeToleranceAsFloatingPoint(0.0, tolerance_));
+
+    for (real x = testRange.first; x < testRange.second; x += dx)
+    {
+        real h                = std::sqrt(GMX_REAL_EPS);
+        real secondDerivative = (refDer(x+h)-refDer(x))/h;
+
+        real testFuncValue;
+        real testDerValue;
+
+        table.template evaluateFunctionAndDerivative<numFuncInTable, funcIndex>(x, &testFuncValue, &testDerValue);
+
+        // Check that we get the same values from function/derivative-only methods
+        real tmpFunc, tmpDer;
+
+        table.template evaluateFunction<numFuncInTable, funcIndex>(x, &tmpFunc);
+
+        table.template evaluateDerivative<numFuncInTable, funcIndex>(x, &tmpDer);
+
+        if (testFuncValue != tmpFunc)
+        {
+            ADD_FAILURE()
+            << "Interpolation inconsistency for table " << desc << std::endl
+            << numFuncInTable << " function(s) in table, testing index " << funcIndex << std::endl
+            << "First failure at x = " << x << std::endl
+            << "Function value when evaluating function & derivative: " << testFuncValue << std::endl
+            << "Function value when evaluating only function:         " << tmpFunc << std::endl;
+            return;
+        }
+        if (testDerValue != tmpDer)
+        {
+            ADD_FAILURE()
+            << "Interpolation inconsistency for table " << desc << std::endl
+            << numFuncInTable << " function(s) in table, testing index " << funcIndex << std::endl
+            << "First failure at x = " << x << std::endl
+            << "Derivative value when evaluating function & derivative: " << testDerValue << std::endl
+            << "Derivative value when evaluating only derivative:       " << tmpDer << std::endl;
+            return;
+        }
+
+        // There are two sources of errors that we need to account for when checking the values,
+        // and we only fail the test if both of these tolerances are violated:
+        //
+        // 1) First, we have the normal relative error of the test vs. reference value. For this
+        //    we use the normal testutils relative tolerance checking.
+        //    However, there is an additional source of error: When we calculate the forces we
+        //    use average higher derivatives over the interval to improve accuracy, but this
+        //    also means we won't reproduce values at table points exactly. This is usually not
+        //    an issue since the tolerances we have are much larger, but when the reference derivative
+        //    value is exactly zero the relative error will be infinite. To account for this, we
+        //    extract the spacing from the table and evaluate the reference derivative at a point
+        //    this much larger too, and use the largest of the two values as the reference
+        //    magnitude for the derivative when setting the relative tolerance.
+        //    Note that according to the table function definitions, we should be allowed to evaluate
+        //    it one table point beyond the range (this is done already for construction).
+        //
+        // 2) Second, due to the loss-of-accuracy when calculating the index through rtable
+        //    there is an internal absolute tolerance that we can calculate.
+        //    The source of this error is the subtraction eps=rtab-[rtab], which leaves an
+        //    error proportional to eps_machine*rtab=eps_machine*x*tableScale.
+        //    To lowest order, the term in the function and derivative values (respectively) that
+        //    are proportional to eps will be the next-higher derivative multiplied by the spacing.
+        //    This means the truncation error in the value is derivative*x*eps_machine, and in the
+        //    derivative the error is 2nd_derivative*x*eps_machine.
+
+        real refFuncValue     = refFunc(x);
+        real refDerValue      = refDer(x);
+        real nextRefDerValue  = refDer(x + table.tableSpacing());
+
+        real derMagnitude     = std::max( std::abs(refDerValue), std::abs(nextRefDerValue));
+
+        // Since the reference magnitude will change over each interval we need to re-evaluate
+        // the derivative tolerance inside the loop.
+        FloatingPointTolerance  derTolerance(relativeToleranceAsFloatingPoint(derMagnitude, tolerance_));
+
+        FloatingPointDifference funcDiff(refFuncValue, testFuncValue);
+        FloatingPointDifference derDiff(refDerValue, testDerValue);
+
+        real                    allowedAbsFuncErr = std::abs(refDerValue)      * x * GMX_REAL_EPS;
+        real                    allowedAbsDerErr  = std::abs(secondDerivative) * x * GMX_REAL_EPS;
+
+        if ((!funcTolerance.isWithin(funcDiff) && funcDiff.asAbsolute() > allowedAbsFuncErr) ||
+            (!derTolerance.isWithin(derDiff)  &&  derDiff.asAbsolute() > allowedAbsDerErr))
+        {
+            ADD_FAILURE()
+            << "Failing comparison with function for table " << desc << std::endl
+            << numFuncInTable << " function(s) in table, testing index " << funcIndex << std::endl
+            << "Test range is ( " << testRange.first << " , " << testRange.second << " ) " << std::endl
+            << "Tolerance             = " << tolerance_ << std::endl
+            << "First failure at    x = " << x << std::endl
+            << "Reference function    = " << refFuncValue << std::endl
+            << "Test table function   = " << testFuncValue << std::endl
+            << "Reference derivative  = " << refDerValue << std::endl
+            << "Test table derivative = " << testDerValue << std::endl;
+            return;
+        }
+    }
+}
+
+
+/*! \brief Function similar to coulomb electrostatics
+ *
+ *  \param r argument
+ *  \return r^-1
+ */
+double
+coulombFunction(double r)
+{
+    return 1.0/r;
+}
+
+/*! \brief Derivative (not force) of coulomb electrostatics
+ *
+ *  \param r argument
+ *  \return -r^-2
+ */
+double
+coulombDerivative(double r)
+{
+    return -1.0/(r*r);
+}
+
+/*! \brief Function similar to power-6 Lennard-Jones dispersion
+ *
+ *  \param r argument
+ *  \return r^-6
+ */
+double
+lj6Function(double r)
+{
+    return std::pow(r, -6.0);
+}
+
+/*! \brief Derivative (not force) of the power-6 Lennard-Jones dispersion
+ *
+ *  \param r argument
+ *  \return -6.0*r^-7
+ */
+double
+lj6Derivative(double r)
+{
+    return -6.0*std::pow(r, -7.0);
+}
+
+/*! \brief Function similar to power-12 Lennard-Jones repulsion
+ *
+ *  \param r argument
+ *  \return r^-12
+ */
+double
+lj12Function(double r)
+{
+    return std::pow(r, -12.0);
+}
+
+/*! \brief Derivative (not force) of the power-12 Lennard-Jones repulsion
+ *
+ *  \param r argument
+ *  \return -12.0*r^-13
+ */
+double
+lj12Derivative(double r)
+{
+    return -12.0*std::pow(r, -13.0);
+}
+
+/*! \brief The sinc function, sin(r)/r
+ *
+ *  \param r argument
+ *  \return sin(r)/r
+ */
+double
+sincFunction(double r)
+{
+    return std::sin(r)/r;
+}
+
+/*! \brief Derivative of the sinc function
+ *
+ *  \param r argument
+ *  \return derivative of sinc, (r*cos(r)-sin(r))/r^2
+ */
+double
+sincDerivative(double r)
+{
+    return (r*std::cos(r)-std::sin(r))/(r*r);
+}
+
+/*! \brief Function for the direct-space PME correction to 1/r
+ *
+ *  \param r argument
+ *  \return PME correction function, erf(r)/r
+ */
+double
+pmeCorrFunction(double r)
+{
+    if (r == 0)
+    {
+        return 2.0/std::sqrt(M_PI);
+    }
+    else
+    {
+        return std::erf(r)/r;
+    }
+}
+
+/*! \brief Derivative of the direct-space PME correction to 1/r
+ *
+ *  \param r argument
+ *  \return Derivative of the PME correction function.
+ */
+double
+pmeCorrDerivative(double r)
+{
+    if (r == 0)
+    {
+        return 0;
+    }
+    else
+    {
+        return (2.0*std::exp(-r*r)/std::sqrt(3.14159265358979323846)*r-erf(r))/(r*r);
+    }
+}
+
+/*! \brief Typed-test list. We test QuadraticSplineTable and CubicSplineTable
+ */
+typedef ::testing::Types<QuadraticSplineTable, CubicSplineTable> SplineTableTypes;
+TYPED_TEST_CASE(SplineTableTest, SplineTableTypes);
+
+
+TYPED_TEST(SplineTableTest, HandlesIncorrectInput)
+{
+    // negative range
+    EXPECT_THROW_GMX(TypeParam( {{"LJ12", lj12Function, lj12Derivative}}, {-1.0, 0.0}), gmx::InvalidInputError);
+
+    // Too small range
+    EXPECT_THROW_GMX(TypeParam( {{"LJ12", lj12Function, lj12Derivative}}, {1.0, 1.00001}), gmx::InvalidInputError);
+
+    // bad tolerance
+    EXPECT_THROW_GMX(TypeParam( {{"LJ12", lj12Function, lj12Derivative}}, {1.0, 2.0}, 1e-20), gmx::ToleranceError);
+
+    // Range is so close to 0.0 that table would require >1e6 points
+    EXPECT_THROW_GMX(TypeParam( {{"LJ12", lj12Function, lj12Derivative}}, {1e-4, 2.0}), gmx::ToleranceError);
+
+    // mismatching function/derivative
+    EXPECT_THROW_GMX(TypeParam( { {"BadLJ12", lj12Derivative, lj12Function}}, {1.0, 2.0}), gmx::InconsistentInputError);
+}
+
+
+#ifndef NDEBUG
+TYPED_TEST(SplineTableTest, CatchesOutOfRangeValues)
+{
+    TypeParam      table( {{"LJ12", lj12Function, lj12Derivative}}, {0.2, 1.0});
+    real           x, func, der;
+
+    x = -GMX_REAL_EPS;
+    EXPECT_THROW_GMX(table.evaluateFunctionAndDerivative(x, &func, &der), gmx::RangeError);
+
+    x = 1.0;
+    EXPECT_THROW_GMX(table.evaluateFunctionAndDerivative(x, &func, &der), gmx::RangeError);
+}
+#endif
+
+
+TYPED_TEST(SplineTableTest, Sinc)
+{
+    std::pair<real, real>  range(0.1, 10);
+
+    TypeParam              sincTable( {{"Sinc", sincFunction, sincDerivative}}, range);
+
+    TestFixture::testSplineTableAgainstFunctions("Sinc", sincFunction, sincDerivative, sincTable, range);
+}
+
+
+TYPED_TEST(SplineTableTest, LJ12)
+{
+    std::pair<real, real>  range(0.2, 2.0);
+
+    TypeParam              lj12Table( {{"LJ12", lj12Function, lj12Derivative}}, range);
+
+    TestFixture::testSplineTableAgainstFunctions("LJ12", lj12Function, lj12Derivative, lj12Table, range);
+}
+
+
+TYPED_TEST(SplineTableTest, PmeCorrection)
+{
+    std::pair<real, real>  range(0.0, 4.0);
+    real                   tolerance = 1e-5;
+
+    TypeParam              pmeCorrTable( {{"PMECorr", pmeCorrFunction, pmeCorrDerivative}}, range, tolerance);
+
+    TestFixture::setTolerance(tolerance);
+    TestFixture::testSplineTableAgainstFunctions("PMECorr", pmeCorrFunction, pmeCorrDerivative, pmeCorrTable, range);
+}
+
+
+
+TYPED_TEST(SplineTableTest, HandlesIncorrectNumericalInput)
+{
+    // Lengths do not match
+    std::vector<double>   functionValues(10);
+    std::vector<double>   derivativeValues(20);
+    EXPECT_THROW_GMX(TypeParam( {{"EmptyVectors", functionValues, derivativeValues, 0.001}},
+                                {1.0, 2.0}), gmx::InconsistentInputError);
+
+    // Upper range is 2.0, spacing 0.1. This requires at least 21 points. Make sure we get an error for 20.
+    functionValues.resize(20);
+    derivativeValues.resize(20);
+    EXPECT_THROW_GMX(TypeParam( {{"EmptyVectors", functionValues, derivativeValues, 0.1}},
+                                {1.0, 2.0}), gmx::InconsistentInputError);
+
+    // Create some test data
+    functionValues.clear();
+    derivativeValues.clear();
+
+    std::vector<double>   badDerivativeValues;
+    double                spacing = 1e-3;
+
+    for (std::size_t i = 0; i < 1001; i++)
+    {
+        double x    = i * spacing;
+        double func = (x >= 0.1) ? lj12Function(x)   : 0.0;
+        double der  = (x >= 0.1) ? lj12Derivative(x) : 0.0;
+
+        functionValues.push_back(func);
+        derivativeValues.push_back(der);
+        badDerivativeValues.push_back(-der);
+    }
+
+    // Derivatives not consistent with function
+    EXPECT_THROW_GMX(TypeParam( {{"NumericalBadLJ12", functionValues, badDerivativeValues, spacing}},
+                                {0.2, 1.0}), gmx::InconsistentInputError);
+
+    // Spacing 1e-3 is not sufficient for r^-12 in range [0.1,1.0]
+    // Make sure we get a tolerance error
+    EXPECT_THROW_GMX(TypeParam( {{"NumericalLJ12", functionValues, derivativeValues, spacing}},
+                                {0.2, 1.0}), gmx::ToleranceError);
+}
+
+
+TYPED_TEST(SplineTableTest, NumericalInputPmeCorr)
+{
+    std::pair<real, real>  range(0.0, 4.0);
+    std::vector<double>    functionValues;
+    std::vector<double>    derivativeValues;
+
+    double                 inputSpacing = 1e-3;
+    real                   tolerance    = 1e-5;
+
+    // We only need data up to the argument 4.0, but add 1% margin
+    for (std::size_t i = 0; i < range.second*1.01/inputSpacing; i++)
+    {
+        double x    = i * inputSpacing;
+
+        functionValues.push_back(pmeCorrFunction(x));
+        derivativeValues.push_back(pmeCorrDerivative(x));
+    }
+
+    TypeParam  pmeCorrTable( {{"NumericalPMECorr", functionValues, derivativeValues, inputSpacing}},
+                             range, tolerance);
+
+    TestFixture::setTolerance(tolerance);
+    TestFixture::testSplineTableAgainstFunctions("NumericalPMECorr", pmeCorrFunction, pmeCorrDerivative, pmeCorrTable, range);
+}
+
+TYPED_TEST(SplineTableTest, TwoFunctions)
+{
+    std::pair<real, real>  range(0.2, 2.0);
+
+    TypeParam              table( {{"LJ6", lj6Function, lj6Derivative}, {"LJ12", lj12Function, lj12Derivative}}, range);
+
+    // Test entire range for each function. This will use the method that interpolates a single function
+    TestFixture::template testSplineTableAgainstFunctions<2, 0>("LJ6", lj6Function, lj6Derivative, table, range);
+    TestFixture::template testSplineTableAgainstFunctions<2, 1>("LJ12", lj12Function, lj12Derivative, table, range);
+
+    // Test the methods that evaluated both functions for one value
+    real     x        = 0.5 * (range.first + range.second);
+    real     refFunc0 = lj6Function(x);
+    real     refDer0  = lj6Derivative(x);
+    real     refFunc1 = lj12Function(x);
+    real     refDer1  = lj12Derivative(x);
+
+    real     tstFunc0, tstDer0, tstFunc1, tstDer1;
+    real     tmpFunc0, tmpFunc1, tmpDer0, tmpDer1;
+
+    // test that we reproduce the reference functions
+    table.evaluateFunctionAndDerivative(x, &tstFunc0, &tstDer0, &tstFunc1, &tstDer1);
+
+    real funcErr0 = std::abs(tstFunc0-refFunc0) / std::abs(refFunc0);
+    real funcErr1 = std::abs(tstFunc1-refFunc1) / std::abs(refFunc1);
+    real derErr0  = std::abs(tstDer0-refDer0) / std::abs(refDer0);
+    real derErr1  = std::abs(tstDer1-refDer1) / std::abs(refDer1);
+
+    // Use asserts, since the following ones compare to these values.
+    ASSERT_LT(funcErr0, TypeParam::defaultTolerance);
+    ASSERT_LT(derErr0, TypeParam::defaultTolerance);
+    ASSERT_LT(funcErr1, TypeParam::defaultTolerance);
+    ASSERT_LT(derErr1, TypeParam::defaultTolerance);
+
+    // Test that function/derivative-only interpolation methods work
+    table.evaluateFunction(x, &tmpFunc0, &tmpFunc1);
+    table.evaluateDerivative(x, &tmpDer0, &tmpDer1);
+    EXPECT_EQ(tstFunc0, tmpFunc0);
+    EXPECT_EQ(tstFunc1, tmpFunc1);
+    EXPECT_EQ(tstDer0, tmpDer0);
+
+    // Test that scrambled order interpolation methods work
+    table.template evaluateFunctionAndDerivative<2, 1, 0>(x, &tstFunc1, &tstDer1, &tstFunc0, &tstDer0);
+    EXPECT_EQ(tstFunc0, tmpFunc0);
+    EXPECT_EQ(tstFunc1, tmpFunc1);
+    EXPECT_EQ(tstDer0, tmpDer0);
+    EXPECT_EQ(tstDer1, tmpDer1);
+
+    // Test scrambled order for function/derivative-only methods
+    table.template evaluateFunction<2, 1, 0>(x, &tmpFunc1, &tmpFunc0);
+    table.template evaluateDerivative<2, 1, 0>(x, &tmpDer1, &tmpDer0);
+    EXPECT_EQ(tstFunc0, tmpFunc0);
+    EXPECT_EQ(tstFunc1, tmpFunc1);
+    EXPECT_EQ(tstDer0, tmpDer0);
+    EXPECT_EQ(tstDer1, tmpDer1);
+}
+
+TYPED_TEST(SplineTableTest, ThreeFunctions)
+{
+    std::pair<real, real>  range(0.2, 2.0);
+
+    TypeParam              table( {{"Coulomb", coulombFunction, coulombDerivative}, {"LJ6", lj6Function, lj6Derivative}, {"LJ12", lj12Function, lj12Derivative}}, range);
+
+    // Test entire range for each function
+    TestFixture::template testSplineTableAgainstFunctions<3, 0>("Coulomb", coulombFunction, coulombDerivative, table, range);
+    TestFixture::template testSplineTableAgainstFunctions<3, 1>("LJ6", lj6Function, lj6Derivative, table, range);
+    TestFixture::template testSplineTableAgainstFunctions<3, 2>("LJ12", lj12Function, lj12Derivative, table, range);
+
+    // Test the methods that evaluated both functions for one value
+    real     x        = 0.5 * (range.first + range.second);
+    real     refFunc0 = coulombFunction(x);
+    real     refDer0  = coulombDerivative(x);
+    real     refFunc1 = lj6Function(x);
+    real     refDer1  = lj6Derivative(x);
+    real     refFunc2 = lj12Function(x);
+    real     refDer2  = lj12Derivative(x);
+
+    real     tstFunc0, tstDer0, tstFunc1, tstDer1, tstFunc2, tstDer2;
+    real     tmpFunc0, tmpFunc1, tmpFunc2, tmpDer0, tmpDer1, tmpDer2;
+
+    // test that we reproduce the reference functions
+    table.evaluateFunctionAndDerivative(x, &tstFunc0, &tstDer0, &tstFunc1, &tstDer1, &tstFunc2, &tstDer2);
+
+    real funcErr0 = std::abs(tstFunc0-refFunc0) / std::abs(refFunc0);
+    real derErr0  = std::abs(tstDer0-refDer0) / std::abs(refDer0);
+    real funcErr1 = std::abs(tstFunc1-refFunc1) / std::abs(refFunc1);
+    real derErr1  = std::abs(tstDer1-refDer1) / std::abs(refDer1);
+    real funcErr2 = std::abs(tstFunc2-refFunc2) / std::abs(refFunc2);
+    real derErr2  = std::abs(tstDer2-refDer2) / std::abs(refDer2);
+
+    // Use asserts, since the following ones compare to these values.
+    ASSERT_LT(funcErr0, TypeParam::defaultTolerance);
+    ASSERT_LT(derErr0, TypeParam::defaultTolerance);
+    ASSERT_LT(funcErr1, TypeParam::defaultTolerance);
+    ASSERT_LT(derErr1, TypeParam::defaultTolerance);
+    ASSERT_LT(funcErr2, TypeParam::defaultTolerance);
+    ASSERT_LT(derErr2, TypeParam::defaultTolerance);
+
+    // Test that function/derivative-only interpolation methods work
+    table.evaluateFunction(x, &tmpFunc0, &tmpFunc1, &tmpFunc2);
+    table.evaluateDerivative(x, &tmpDer0, &tmpDer1, &tmpDer2);
+    EXPECT_EQ(tstFunc0, tmpFunc0);
+    EXPECT_EQ(tstFunc1, tmpFunc1);
+    EXPECT_EQ(tstFunc2, tmpFunc2);
+    EXPECT_EQ(tstDer0, tmpDer0);
+    EXPECT_EQ(tstDer1, tmpDer1);
+    EXPECT_EQ(tstDer2, tmpDer2);
+
+    // Test two functions out of three
+    table.template evaluateFunctionAndDerivative<3, 0, 1>(x, &tmpFunc0, &tmpDer0, &tmpFunc1, &tmpDer1);
+    EXPECT_EQ(tstFunc0, tmpFunc0);
+    EXPECT_EQ(tstFunc1, tmpFunc1);
+    EXPECT_EQ(tstDer0, tmpDer0);
+    EXPECT_EQ(tstDer1, tmpDer1);
+
+    // two out of three, function/derivative-only
+    table.template evaluateFunction<3, 0, 1>(x, &tmpFunc0, &tmpFunc1);
+    table.template evaluateDerivative<3, 0, 1>(x, &tmpDer0, &tmpDer1);
+    EXPECT_EQ(tstFunc0, tmpFunc0);
+    EXPECT_EQ(tstFunc1, tmpFunc1);
+    EXPECT_EQ(tstDer0, tmpDer0);
+    EXPECT_EQ(tstDer1, tmpDer1);
+
+    // Test that scrambled order interpolation methods work
+    table.template evaluateFunctionAndDerivative<3, 2, 1, 0>(x, &tstFunc2, &tstDer2, &tstFunc1, &tstDer1, &tstFunc0, &tstDer0);
+    EXPECT_EQ(tstFunc0, tmpFunc0);
+    EXPECT_EQ(tstFunc1, tmpFunc1);
+    EXPECT_EQ(tstFunc2, tmpFunc2);
+    EXPECT_EQ(tstDer0, tmpDer0);
+    EXPECT_EQ(tstDer1, tmpDer1);
+    EXPECT_EQ(tstDer2, tmpDer2);
+
+    // Test scrambled order for function/derivative-only methods
+    table.template evaluateFunction<3, 2, 1, 0>(x, &tmpFunc2, &tmpFunc1, &tmpFunc0);
+    table.template evaluateDerivative<3, 2, 1, 0>(x, &tmpDer2, &tmpDer1, &tmpDer0);
+    EXPECT_EQ(tstFunc0, tmpFunc0);
+    EXPECT_EQ(tstFunc1, tmpFunc1);
+    EXPECT_EQ(tstFunc2, tmpFunc2);
+    EXPECT_EQ(tstDer0, tmpDer0);
+    EXPECT_EQ(tstDer1, tmpDer1);
+    EXPECT_EQ(tstDer2, tmpDer2);
+}
+
+#if GMX_SIMD_HAVE_REAL
+TYPED_TEST(SplineTableTest, Simd)
+{
+    std::pair<real, real>  range(0.2, 1.0);
+    TypeParam              table( {{"LJ12", lj12Function, lj12Derivative}}, range);
+
+    // We already test that the SIMD operations handle the different elements
+    // correctly in the SIMD module, so here we only test that interpolation
+    // works for a single value in the middle of the interval
+
+    real     x       = 0.5 * (range.first + range.second);
+    real     refFunc = lj12Function(x);
+    real     refDer  = lj12Derivative(x);
+    SimdReal tstFunc, tstDer;
+    real     funcErr, derErr;
+    GMX_ALIGNED(real, GMX_SIMD_REAL_WIDTH) alignedMem[GMX_SIMD_REAL_WIDTH];
+
+    table.evaluateFunctionAndDerivative(SimdReal(x), &tstFunc, &tstDer);
+
+    store(alignedMem, tstFunc);
+    funcErr = std::abs(alignedMem[0]-refFunc) / std::abs(refFunc);
+
+    store(alignedMem, tstDer);
+    derErr  = std::abs(alignedMem[0]-refDer ) / std::abs(refDer );
+
+    EXPECT_LT(funcErr, TypeParam::defaultTolerance);
+    EXPECT_LT(derErr, TypeParam::defaultTolerance);
+}
+
+TYPED_TEST(SplineTableTest, SimdTwoFunctions)
+{
+    std::pair<real, real>  range(0.2, 2.0);
+
+    TypeParam              table( {{"LJ6", lj6Function, lj6Derivative}, {"LJ12", lj12Function, lj12Derivative}}, range);
+
+    // We already test that the SIMD operations handle the different elements
+    // correctly in the SIMD module, so here we only test that interpolation
+    // works for a single value in the middle of the interval
+
+    real     x        = 0.5 * (range.first + range.second);
+    real     refFunc0 = lj6Function(x);
+    real     refDer0  = lj6Derivative(x);
+    real     refFunc1 = lj12Function(x);
+    real     refDer1  = lj12Derivative(x);
+    SimdReal tstFunc0, tstDer0;
+    SimdReal tstFunc1, tstDer1;
+    real     funcErr0, derErr0;
+    real     funcErr1, derErr1;
+    GMX_ALIGNED(real, GMX_SIMD_REAL_WIDTH) alignedMem[GMX_SIMD_REAL_WIDTH];
+
+    table.evaluateFunctionAndDerivative(SimdReal(x), &tstFunc0, &tstDer0, &tstFunc1, &tstDer1);
+
+    store(alignedMem, tstFunc0);
+    funcErr0 = std::abs(alignedMem[0]-refFunc0) / std::abs(refFunc0);
+
+    store(alignedMem, tstDer0);
+    derErr0  = std::abs(alignedMem[0]-refDer0 ) / std::abs(refDer0 );
+
+    store(alignedMem, tstFunc1);
+    funcErr1 = std::abs(alignedMem[0]-refFunc1) / std::abs(refFunc1);
+
+    store(alignedMem, tstDer1);
+    derErr1  = std::abs(alignedMem[0]-refDer1 ) / std::abs(refDer1 );
+
+    EXPECT_LT(funcErr0, TypeParam::defaultTolerance);
+    EXPECT_LT(derErr0, TypeParam::defaultTolerance);
+    EXPECT_LT(funcErr1, TypeParam::defaultTolerance);
+    EXPECT_LT(derErr1, TypeParam::defaultTolerance);
+}
+#endif
+
+#if GMX_SIMD_HAVE_REAL && !defined NDEBUG
+TYPED_TEST(SplineTableTest, CatchesOutOfRangeValuesSimd)
+{
+    std::pair<real, real>                   range(0.2, 1.0);
+    TypeParam                               table( {{"LJ12", lj12Function, lj12Derivative}}, range);
+    SimdReal                                x, func, der;
+
+    AlignedArray<real, GMX_SIMD_REAL_WIDTH> alignedMem;
+
+    alignedMem.fill(range.first);
+    // Make position 1 incorrect if width>=2, otherwise position 0
+    // range.first-GMX_REAL_EPS is not invalid. See comment in table.
+    alignedMem[ (GMX_SIMD_REAL_WIDTH >= 2) ? 1 : 0] = -GMX_REAL_EPS;
+    x = load(alignedMem);
+
+    EXPECT_THROW_GMX(table.evaluateFunctionAndDerivative(x, &func, &der), gmx::RangeError);
+
+    // Make position 1 incorrect if width>=2, otherwise position 0
+    alignedMem[ (GMX_SIMD_REAL_WIDTH >= 2) ? 1 : 0] = range.second;
+    x = load(alignedMem);
+
+    EXPECT_THROW_GMX(table.evaluateFunctionAndDerivative(x, &func, &der), gmx::RangeError);
+}
+
+TYPED_TEST(SplineTableTest, AcceptsInRangeValuesSimd)
+{
+    std::pair<real, real>  range(0.2, 1.0);
+    TypeParam              table( {{"LJ12", lj12Function, lj12Derivative}}, range);
+    SimdReal               x, func, der;
+
+    GMX_ALIGNED(real, GMX_SIMD_REAL_WIDTH) alignedMem[GMX_SIMD_REAL_WIDTH];
+
+    // Test all values between 0 and range.second
+    for (std::size_t i = 0; i < GMX_SIMD_REAL_WIDTH; i++)
+    {
+        alignedMem[i] = range.second*(1.0-GMX_REAL_EPS)*i/(GMX_SIMD_REAL_WIDTH-1);
+    }
+    x = load(alignedMem);
+
+    EXPECT_NO_THROW_GMX(table.evaluateFunctionAndDerivative(x, &func, &der));
+}
+
+#endif
+
+} // namespace
+
+} // namespace test
+
+} // namespace gmx
index bd776b8b2274c449b5a8cd6b19e4308c9c387e7b..46757699746271b829c049a49ab2027b0cb399f5 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
@@ -105,8 +105,8 @@ gmx_cycles_calibrate(double sampletime)
      *
      * We call gettimeofday an extra time at the start to avoid cache misses.
      */
-    gettimeofday(&t1, NULL);
-    gettimeofday(&t1, NULL);
+    gettimeofday(&t1, nullptr);
+    gettimeofday(&t1, nullptr);
     c1 = gmx_cycles_read();
 
     do
@@ -120,7 +120,7 @@ gmx_cycles_calibrate(double sampletime)
             d = d/(1.0+static_cast<double>(i));
         }
         /* Read the time again */
-        gettimeofday(&t2, NULL);
+        gettimeofday(&t2, nullptr);
         c2       = gmx_cycles_read();
         timediff = static_cast<double>(t2.tv_sec-t1.tv_sec)+(t2.tv_usec-t1.tv_usec)*1e-6;
     }
index f2361a0c77d2a91c620bec29dea693aa6b12d6fe..41cd2ff908decf1794e8f3dca908e7e72c33ab62 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
@@ -46,7 +46,7 @@
 #define GMX_TIMING_CYCLECOUNTER_H
 
 /*
- * define HAVE_RDTSCP to use the serializing rdtscp instruction instead of rdtsc.
+ * Define HAVE_RDTSCP=1 to use the serializing rdtscp instruction instead of rdtsc.
  * This is only supported on newer Intel/AMD hardware, but provides better accuracy.
  */
 #include "config.h"
@@ -221,7 +221,7 @@ static __inline__ gmx_cycles_t gmx_cycles_read(void)
     gmx_cycles_t   cycle;
     unsigned       low, high;
 
-#ifdef HAVE_RDTSCP
+#if HAVE_RDTSCP
     __asm__ __volatile__("rdtscp" : "=a" (low), "=d" (high) :: "ecx" );
 #else
     __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high));
@@ -255,7 +255,7 @@ static __inline gmx_cycles_t gmx_cycles_read(void)
     return __rdpmccntr64();
 #else
     /* x86 */
-#    ifdef HAVE_RDTSCP
+#    if HAVE_RDTSCP
     unsigned int ui;
     return __rdtscp(&ui);
 #    else
index 772b5ee39c49032485cce8b42b9b45e5b76975c7..e9ec67d8555e864cdb46ea6918c4a7175b83b327 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * 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.
@@ -57,14 +57,16 @@ struct gmx_nbnxn_kernel_timing_data_t
 /*! \internal \brief GPU timings for kernels and H2d/D2H transfers. */
 struct gmx_wallclock_gpu_t
 {
-    struct gmx_nbnxn_kernel_timing_data_t ktime[2][2]; /**< table containing the timings of the four
-                                                          versions of the nonbonded kernels: force-only,
-                                                          force+energy, force+pruning, and force+energy+pruning */
-    double  nb_h2d_t;                                  /**< host to device transfer time in nb calculation  */
-    double  nb_d2h_t;                                  /**< device to host transfer time in nb calculation */
-    int     nb_c;                                      /**< total call count of the nonbonded gpu operations */
-    double  pl_h2d_t;                                  /**< pair search step host to device transfer time */
-    int     pl_h2d_c;                                  /**< pair search step  host to device transfer call count */
+    gmx_nbnxn_kernel_timing_data_t ktime[2][2];      /**< table containing the timings of the four
+                                                        versions of the nonbonded kernels: force-only,
+                                                        force+energy, force+pruning, and force+energy+pruning */
+    gmx_nbnxn_kernel_timing_data_t pruneTime;        /**< table containing the timings of the 1st pass prune-only kernels */
+    gmx_nbnxn_kernel_timing_data_t dynamicPruneTime; /**< table containing the timings of dynamic prune-only kernels */
+    double                         nb_h2d_t;         /**< host to device transfer time in nb calculation  */
+    double                         nb_d2h_t;         /**< device to host transfer time in nb calculation */
+    int                            nb_c;             /**< total call count of the nonbonded gpu operations */
+    double                         pl_h2d_t;         /**< pair search step host to device transfer time */
+    int                            pl_h2d_c;         /**< pair search step  host to device transfer call count */
 };
 
 #ifdef __cplusplus
index 548827df384d3c35edc81dea1c689b1d952a610f..637c8d7dac37a54eeb2912397032215e0a06c22b 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
@@ -44,7 +44,6 @@
 
 #include <array>
 
-#include "gromacs/gmxlib/md_logging.h"
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/timing/cyclecounter.h"
 #include "gromacs/timing/gpu_timing.h"
@@ -52,6 +51,7 @@
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/gmxmpi.h"
+#include "gromacs/utility/logger.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/snprintf.h"
 
@@ -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",
-    "PME redist. X/F", "PME spread/gather", "PME 3D-FFT", "PME 3D-FFT Comm.", "PME solve LJ", "PME solve Elec",
+    "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 GPU nonlocal", "Wait GPU local", "NB X/F buffer ops.",
     "Vsite spread", "COM pull force",
     "Write traj.", "Update", "Constraints", "Comm. energies",
@@ -120,6 +120,7 @@ static const char *wcsn[ewcsNR] =
     "Bonded-FEP F",
     "Restraints F",
     "Listed buffer ops.",
+    "Nonbonded pruning",
     "Nonbonded F",
     "Ewald F correction",
     "NB X buffer ops.",
@@ -138,20 +139,20 @@ gmx_wallcycle_t wallcycle_init(FILE *fplog, int resetstep, t_commrec gmx_unused
 
     if (!wallcycle_have_counter())
     {
-        return NULL;
+        return nullptr;
     }
 
     snew(wc, 1);
 
     wc->haveInvalidCount    = FALSE;
     wc->wc_barrier          = FALSE;
-    wc->wcc_all             = NULL;
+    wc->wcc_all             = nullptr;
     wc->wc_depth            = 0;
     wc->ewc_prev            = -1;
     wc->reset_counters      = resetstep;
 
 #if GMX_MPI
-    if (PAR(cr) && getenv("GMX_CYCLE_BARRIER") != NULL)
+    if (PAR(cr) && getenv("GMX_CYCLE_BARRIER") != nullptr)
     {
         if (fplog)
         {
@@ -163,7 +164,7 @@ gmx_wallcycle_t wallcycle_init(FILE *fplog, int resetstep, t_commrec gmx_unused
 #endif
 
     snew(wc->wcc, ewcNR);
-    if (getenv("GMX_CYCLE_ALL") != NULL)
+    if (getenv("GMX_CYCLE_ALL") != nullptr)
     {
         if (fplog)
         {
@@ -184,27 +185,29 @@ gmx_wallcycle_t wallcycle_init(FILE *fplog, int resetstep, t_commrec gmx_unused
     return wc;
 }
 
-void wallcycle_destroy(gmx_wallcycle_t wc)
-{
-    if (wc == NULL)
+/* TODO: Should be called from finish_run() or runner()
+   void wallcycle_destroy(gmx_wallcycle_t wc)
+   {
+    if (wc == nullptr)
     {
         return;
     }
 
-    if (wc->wcc != NULL)
+    if (wc->wcc != nullptr)
     {
         sfree(wc->wcc);
     }
-    if (wc->wcc_all != NULL)
+    if (wc->wcc_all != nullptr)
     {
         sfree(wc->wcc_all);
     }
-    if (wc->wcsc != NULL)
+    if (wc->wcsc != nullptr)
     {
         sfree(wc->wcsc);
     }
     sfree(wc);
-}
+   }
+ */
 
 static void wallcycle_all_start(gmx_wallcycle_t wc, int ewc, gmx_cycles_t cycle)
 {
@@ -255,7 +258,7 @@ void wallcycle_start(gmx_wallcycle_t wc, int ewc)
 {
     gmx_cycles_t cycle;
 
-    if (wc == NULL)
+    if (wc == nullptr)
     {
         return;
     }
@@ -273,7 +276,7 @@ void wallcycle_start(gmx_wallcycle_t wc, int ewc)
 
     cycle              = gmx_cycles_read();
     wc->wcc[ewc].start = cycle;
-    if (wc->wcc_all != NULL)
+    if (wc->wcc_all != nullptr)
     {
         wc->wc_depth++;
         if (ewc == ewcRUN)
@@ -289,7 +292,7 @@ void wallcycle_start(gmx_wallcycle_t wc, int ewc)
 
 void wallcycle_start_nocount(gmx_wallcycle_t wc, int ewc)
 {
-    if (wc == NULL)
+    if (wc == nullptr)
     {
         return;
     }
@@ -302,7 +305,7 @@ double wallcycle_stop(gmx_wallcycle_t wc, int ewc)
 {
     gmx_cycles_t cycle, last;
 
-    if (wc == NULL)
+    if (wc == nullptr)
     {
         return 0;
     }
@@ -364,7 +367,7 @@ void wallcycle_reset_all(gmx_wallcycle_t wc)
 {
     int i;
 
-    if (wc == NULL)
+    if (wc == nullptr)
     {
         return;
     }
@@ -423,7 +426,7 @@ static void subtract_cycles(wallcc_t *wcc, int ewc_main, int ewc_sub)
 
 void wallcycle_scale_by_num_threads(gmx_wallcycle_t wc, bool isPmeRank, int nthreads_pp, int nthreads_pme)
 {
-    if (wc == NULL)
+    if (wc == nullptr)
     {
         return;
     }
@@ -487,7 +490,7 @@ WallcycleCounts wallcycle_sum(t_commrec *cr, gmx_wallcycle_t wc)
     int             i;
     int             nsum;
 
-    if (wc == NULL)
+    if (wc == nullptr)
     {
         /* Default construction of std::array of non-class T can leave
            the values indeterminate, just like a C array, and icc
@@ -569,7 +572,7 @@ WallcycleCounts wallcycle_sum(t_commrec *cr, gmx_wallcycle_t wc)
         MPI_Allreduce(cycles, cycles_sum.data(), nsum, MPI_DOUBLE, MPI_SUM,
                       cr->mpi_comm_mysim);
 
-        if (wc->wcc_all != NULL)
+        if (wc->wcc_all != nullptr)
         {
             double *buf_all, *cyc_all;
 
@@ -606,9 +609,9 @@ static void print_cycles(FILE *fplog, double c2t, const char *name,
                          int nnodes, int nthreads,
                          int ncalls, double c_sum, double tot)
 {
-    char   nnodes_str[6];
-    char   nthreads_str[6];
-    char   ncalls_str[11];
+    char   nnodes_str[STRLEN];
+    char   nthreads_str[STRLEN];
+    char   ncalls_str[STRLEN];
     double wallt;
     double percentage = (tot > 0.) ? (100. * c_sum / tot) : 0.;
 
@@ -710,7 +713,7 @@ static void print_header(FILE *fplog, int nrank_pp, int nth_pp, int nrank_pme, i
 }
 
 
-void wallcycle_print(FILE *fplog, int nnodes, int npme,
+void wallcycle_print(FILE *fplog, const gmx::MDLogger &mdlog, int nnodes, int npme,
                      int nth_pp, int nth_pme, double realtime,
                      gmx_wallcycle_t wc, const WallcycleCounts &cyc_sum,
                      struct gmx_wallclock_gpu_t *gpu_t)
@@ -721,7 +724,7 @@ void wallcycle_print(FILE *fplog, int nnodes, int npme,
     char        buf[STRLEN];
     const char *hline = "-----------------------------------------------------------------------------";
 
-    if (wc == NULL)
+    if (wc == nullptr)
     {
         return;
     }
@@ -751,14 +754,15 @@ void wallcycle_print(FILE *fplog, int nnodes, int npme,
            timing data might still be sensible for some non-Jenkins
            run, than is lost from diagnosing Jenkins FP exceptions on
            runs about whose execution time we don't care. */
-        md_print_warn(NULL, fplog, "WARNING: A total of %f CPU cycles was recorded, so mdrun cannot print a time accounting\n", tot);
+        GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
+                "WARNING: A total of %f CPU cycles was recorded, so mdrun cannot print a time accounting",
+                tot);
         return;
     }
 
     if (wc->haveInvalidCount)
     {
-        md_print_warn(NULL, fplog, "%s\n",
-                      "NOTE: Detected invalid cycle counts, probably because threads moved between CPU cores that do not have synchronized cycle counters. Will not print the cycle accounting.");
+        GMX_LOG(mdlog.warning).asParagraph().appendText("NOTE: Detected invalid cycle counts, probably because threads moved between CPU cores that do not have synchronized cycle counters. Will not print the cycle accounting.");
         return;
     }
 
@@ -808,7 +812,7 @@ void wallcycle_print(FILE *fplog, int nnodes, int npme,
             tot_for_pp += cyc_sum[i];
         }
     }
-    if (wc->wcc_all != NULL)
+    if (wc->wcc_all != nullptr)
     {
         for (i = 0; i < ewcNR; i++)
         {
@@ -889,7 +893,7 @@ void wallcycle_print(FILE *fplog, int nnodes, int npme,
                 tot_k += gpu_t->ktime[i][j].t;
             }
         }
-        tot_gpu += tot_k;
+        tot_gpu += tot_k + gpu_t->pruneTime.t;
 
         tot_cpu_overlap = wc->wcc[ewcFORCE].c;
         if (wc->wcc[ewcPMEMESH].n > 0)
@@ -917,11 +921,23 @@ void wallcycle_print(FILE *fplog, int nnodes, int npme,
                 }
             }
         }
-
+        if (gpu_t->pruneTime.c)
+        {
+            print_gputimes(fplog, "Pruning kernel", gpu_t->pruneTime.c, gpu_t->pruneTime.t, tot_gpu);
+        }
         print_gputimes(fplog, "F D2H",  gpu_t->nb_c, gpu_t->nb_d2h_t, tot_gpu);
         fprintf(fplog, "%s\n", hline);
         print_gputimes(fplog, "Total ", gpu_t->nb_c, tot_gpu, tot_gpu);
         fprintf(fplog, "%s\n", hline);
+        if (gpu_t->dynamicPruneTime.c)
+        {
+            /* We print the dynamic pruning kernel timings after a separator
+             * and avoid adding it to tot_gpu as this is not in the force
+             * overlap. We print the fraction as relative to the rest.
+             */
+            print_gputimes(fplog, "*Dynamic pruning", gpu_t->dynamicPruneTime.c, gpu_t->dynamicPruneTime.t, tot_gpu);
+            fprintf(fplog, "%s\n", hline);
+        }
 
         gpu_cpu_ratio = tot_gpu/tot_cpu_overlap;
         if (gpu_t->nb_c > 0 && wc->wcc[ewcFORCE].n > 0)
@@ -948,26 +964,26 @@ void wallcycle_print(FILE *fplog, int nnodes, int npme,
                         /* The user could have used -notunepme,
                          * but we currently can't check that here.
                          */
-                        md_print_warn(NULL, fplog,
-                                      "\nNOTE: The GPU has >25%% less load than the CPU. This imbalance causes\n"
-                                      "      performance loss. Maybe the domain decomposition limits the PME tuning.\n"
-                                      "      In that case, try setting the DD grid manually (-dd) or lowering -dds.");
+                        GMX_LOG(mdlog.warning).asParagraph().appendText(
+                                "NOTE: The GPU has >25% less load than the CPU. This imbalance causes\n"
+                                "      performance loss. Maybe the domain decomposition limits the PME tuning.\n"
+                                "      In that case, try setting the DD grid manually (-dd) or lowering -dds.");
                     }
                     else
                     {
                         /* We should not end up here, unless the box is
                          * too small for increasing the cut-off for PME tuning.
                          */
-                        md_print_warn(NULL, fplog,
-                                      "\nNOTE: The GPU has >25%% less load than the CPU. This imbalance causes\n"
-                                      "      performance loss.");
+                        GMX_LOG(mdlog.warning).asParagraph().appendText(
+                                "NOTE: The GPU has >25% less load than the CPU. This imbalance causes\n"
+                                "      performance loss.");
                     }
                 }
                 if (gpu_cpu_ratio > 1.2)
                 {
-                    md_print_warn(NULL, fplog,
-                                  "\nNOTE: The GPU has >20%% more load than the CPU. This imbalance causes\n"
-                                  "      performance loss, consider using a shorter cut-off and a finer PME grid.");
+                    GMX_LOG(mdlog.warning).asParagraph().appendText(
+                            "NOTE: The GPU has >20% more load than the CPU. This imbalance causes\n"
+                            "      performance loss, consider using a shorter cut-off and a finer PME grid.");
                 }
             }
         }
@@ -975,9 +991,9 @@ void wallcycle_print(FILE *fplog, int nnodes, int npme,
 
     if (wc->wc_barrier)
     {
-        md_print_warn(NULL, fplog,
-                      "MPI_Barrier was called before each cycle start/stop\n"
-                      "call, so timings are not those of real runs.\n");
+        GMX_LOG(mdlog.warning).asParagraph().appendText(
+                "MPI_Barrier was called before each cycle start/stop\n"
+                "call, so timings are not those of real runs.");
     }
 
     if (wc->wcc[ewcNB_XF_BUF_OPS].n > 0 &&
@@ -987,35 +1003,34 @@ void wallcycle_print(FILE *fplog, int nnodes, int npme,
         /* Only the sim master calls this function, so always print to stderr */
         if (wc->wcc[ewcDOMDEC].n == 0)
         {
-            md_print_warn(NULL, fplog,
-                          "NOTE: %d %% of the run time was spent in pair search,\n"
-                          "      you might want to increase nstlist (this has no effect on accuracy)\n",
-                          (int)(100*cyc_sum[ewcNS]/tot+0.5));
+            GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
+                    "NOTE: %d %% of the run time was spent in pair search,\n"
+                    "      you might want to increase nstlist (this has no effect on accuracy)\n",
+                    (int)(100*cyc_sum[ewcNS]/tot+0.5));
         }
         else
         {
-            md_print_warn(NULL, fplog,
-                          "NOTE: %d %% of the run time was spent in domain decomposition,\n"
-                          "      %d %% of the run time was spent in pair search,\n"
-                          "      you might want to increase nstlist (this has no effect on accuracy)\n",
-                          (int)(100*cyc_sum[ewcDOMDEC]/tot+0.5),
-                          (int)(100*cyc_sum[ewcNS]/tot+0.5));
+            GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
+                    "NOTE: %d %% of the run time was spent in domain decomposition,\n"
+                    "      %d %% of the run time was spent in pair search,\n"
+                    "      you might want to increase nstlist (this has no effect on accuracy)\n",
+                    (int)(100*cyc_sum[ewcDOMDEC]/tot+0.5),
+                    (int)(100*cyc_sum[ewcNS]/tot+0.5));
         }
     }
 
     if (cyc_sum[ewcMoveE] > tot*0.05)
     {
-        /* Only the sim master calls this function, so always print to stderr */
-        md_print_warn(NULL, fplog,
-                      "NOTE: %d %% of the run time was spent communicating energies,\n"
-                      "      you might want to use the -gcom option of mdrun\n",
-                      (int)(100*cyc_sum[ewcMoveE]/tot+0.5));
+        GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
+                "NOTE: %d %% of the run time was spent communicating energies,\n"
+                "      you might want to use the -gcom option of mdrun\n",
+                (int)(100*cyc_sum[ewcMoveE]/tot+0.5));
     }
 }
 
 extern gmx_int64_t wcycle_get_reset_counters(gmx_wallcycle_t wc)
 {
-    if (wc == NULL)
+    if (wc == nullptr)
     {
         return -1;
     }
@@ -1025,7 +1040,7 @@ extern gmx_int64_t wcycle_get_reset_counters(gmx_wallcycle_t wc)
 
 extern void wcycle_set_reset_counters(gmx_wallcycle_t wc, gmx_int64_t reset_counters)
 {
-    if (wc == NULL)
+    if (wc == nullptr)
     {
         return;
     }
@@ -1035,7 +1050,7 @@ extern void wcycle_set_reset_counters(gmx_wallcycle_t wc, gmx_int64_t reset_coun
 
 void wallcycle_sub_start(gmx_wallcycle_t wc, int ewcs)
 {
-    if (useCycleSubcounters && wc != NULL)
+    if (useCycleSubcounters && wc != nullptr)
     {
         wc->wcsc[ewcs].start = gmx_cycles_read();
     }
@@ -1043,7 +1058,7 @@ void wallcycle_sub_start(gmx_wallcycle_t wc, int ewcs)
 
 void wallcycle_sub_start_nocount(gmx_wallcycle_t wc, int ewcs)
 {
-    if (useCycleSubcounters && wc != NULL)
+    if (useCycleSubcounters && wc != nullptr)
     {
         wallcycle_sub_start(wc, ewcs);
         wc->wcsc[ewcs].n--;
@@ -1052,7 +1067,7 @@ void wallcycle_sub_start_nocount(gmx_wallcycle_t wc, int ewcs)
 
 void wallcycle_sub_stop(gmx_wallcycle_t wc, int ewcs)
 {
-    if (useCycleSubcounters && wc != NULL)
+    if (useCycleSubcounters && wc != nullptr)
     {
         wc->wcsc[ewcs].c += gmx_cycles_read() - wc->wcsc[ewcs].start;
         wc->wcsc[ewcs].n++;
index d69aaa63984f5fc4fcef2495a88cae3fbb27ba85..b1325e21d08fca7436af12decb1850dc35c69b0e 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, by the GROMACS development team, led by
+ * 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.
@@ -51,7 +51,7 @@ enum {
     ewcRUN, ewcSTEP, ewcPPDURINGPME, ewcDOMDEC, ewcDDCOMMLOAD,
     ewcDDCOMMBOUND, ewcVSITECONSTR, ewcPP_PMESENDX, ewcNS, ewcLAUNCH_GPU_NB,
     ewcMOVEX, ewcGB, ewcFORCE, ewcMOVEF, ewcPMEMESH,
-    ewcPME_REDISTXF, ewcPME_SPREADGATHER, ewcPME_FFT, ewcPME_FFTCOMM, ewcLJPME, ewcPME_SOLVE,
+    ewcPME_REDISTXF, ewcPME_SPREAD, ewcPME_GATHER, ewcPME_FFT, ewcPME_FFTCOMM, ewcLJPME, ewcPME_SOLVE,
     ewcPMEWAITCOMM, ewcPP_PMEWAITRECVF, ewcWAIT_GPU_NB_NL, ewcWAIT_GPU_NB_L, ewcNB_XF_BUF_OPS,
     ewcVSITESPREAD, ewcPULLPOT,
     ewcTRAJ, ewcUPDATE, ewcCONSTR, ewcMoveE, ewcROT, ewcROTadd, ewcSWAP, ewcIMD,
@@ -68,6 +68,7 @@ enum {
     ewcsLISTED_FEP,
     ewcsRESTRAINTS,
     ewcsLISTED_BUF_OPS,
+    ewcsNONBONDED_PRUNING,
     ewcsNONBONDED,
     ewcsEWALD_CORRECTION,
     ewcsNB_X_BUF_OPS,
index d3c316da592d8554e736b503e20697b525e28546..e84243fe8ca5f5e75a8d6896ef2f2c8875e5b11e 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,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.
 
 #include "gromacs/utility/basedefinitions.h"
 
+struct t_commrec;
+
+namespace gmx
+{
+class MDLogger;
+}
+
 typedef struct gmx_wallcycle *gmx_wallcycle_t;
 typedef struct gmx_wallclock_gpu_t gmx_wallclock_gpu_t;
-struct t_commrec;
 
 typedef std::array<double, ewcNR+ewcsNR> WallcycleCounts;
 /* Convenience typedef */
@@ -57,7 +63,7 @@ WallcycleCounts wallcycle_sum(struct t_commrec *cr, gmx_wallcycle_t wc);
 /* Return a vector of the sum of cycle counts over the nodes in
    cr->mpi_comm_mysim. */
 
-void wallcycle_print(FILE *fplog, int nnodes, int npme,
+void wallcycle_print(FILE *fplog, const gmx::MDLogger &mdlog, int nnodes, int npme,
                      int nth_pp, int nth_pme, double realtime,
                      gmx_wallcycle_t wc, const WallcycleCounts &cyc_sum,
                      struct gmx_wallclock_gpu_t *gpu_t);
index eeb199eded1af28afc73abfb6996993571fdd239..2caa5730d573078df1549b0f04a162f4a70af72a 100644 (file)
@@ -203,7 +203,7 @@ gmx_gettime()
        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, unlike xlc). */
+       functional implementation clock_gettime). */
 #if HAVE_CLOCK_GETTIME && defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0 && !(defined __bgq__ && defined __clang__)
     struct timespec t;
     double          seconds;
@@ -253,7 +253,7 @@ gmx_gettime_per_thread()
        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, unlike xlc). */
+       functional implementation clock_gettime). */
 #if HAVE_CLOCK_GETTIME && defined(_POSIX_THREAD_CPUTIME) && _POSIX_THREAD_CPUTIME > 0 && !(defined __bgq__ && defined __clang__)
     struct timespec t;
     double          seconds;
index 17778e9b3b54a9eca520c09cc19a8a51b7fdb8d6..691d0b136d8b829d94cdb3b4578891d7fbcba0d0 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
@@ -36,6 +36,8 @@
  */
 #include "gmxpre.h"
 
+#include "check.h"
+
 #include <cmath>
 #include <cstdio>
 #include <cstring>
 #include "gromacs/math/functions.h"
 #include "gromacs/math/units.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/mdrunutility/mdmodules.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/mdtypes/state.h"
 #include "gromacs/pbcutil/pbc.h"
-#include "gromacs/tools/compare.h"
 #include "gromacs/topology/atomprop.h"
 #include "gromacs/topology/block.h"
 #include "gromacs/topology/ifunc.h"
@@ -86,11 +89,110 @@ typedef struct {
     float bBox;
 } t_fr_time;
 
+static void comp_tpx(const char *fn1, const char *fn2,
+                     gmx_bool bRMSD, real ftol, real abstol)
+{
+    const char    *ff[2];
+    t_inputrec    *ir[2];
+    t_state        state[2];
+    gmx_mtop_t     mtop[2];
+    t_topology     top[2];
+    int            i;
+
+    ff[0] = fn1;
+    ff[1] = fn2;
+    for (i = 0; i < (fn2 ? 2 : 1); i++)
+    {
+        ir[i] = new t_inputrec();
+        read_tpx_state(ff[i], ir[i], &state[i], &(mtop[i]));
+        gmx::MDModules().adjustInputrecBasedOnModules(ir[i]);
+    }
+    if (fn2)
+    {
+        cmp_inputrec(stdout, ir[0], ir[1], ftol, abstol);
+        /* Convert gmx_mtop_t to t_topology.
+         * We should implement direct mtop comparison,
+         * but it might be useful to keep t_topology comparison as an option.
+         */
+        top[0] = gmx_mtop_t_to_t_topology(&mtop[0], false);
+        top[1] = gmx_mtop_t_to_t_topology(&mtop[1], false);
+        cmp_top(stdout, &top[0], &top[1], ftol, abstol);
+        cmp_groups(stdout, &mtop[0].groups, &mtop[1].groups,
+                   mtop[0].natoms, mtop[1].natoms);
+        comp_state(&state[0], &state[1], bRMSD, ftol, abstol);
+    }
+    else
+    {
+        if (ir[0]->efep == efepNO)
+        {
+            fprintf(stdout, "inputrec->efep = %s\n", efep_names[ir[0]->efep]);
+        }
+        else
+        {
+            if (ir[0]->bPull)
+            {
+                comp_pull_AB(stdout, ir[0]->pull, ftol, abstol);
+            }
+            /* Convert gmx_mtop_t to t_topology.
+             * We should implement direct mtop comparison,
+             * but it might be useful to keep t_topology comparison as an option.
+             */
+            top[0] = gmx_mtop_t_to_t_topology(&mtop[0], true);
+            cmp_top(stdout, &top[0], nullptr, ftol, abstol);
+        }
+    }
+}
+
+static void comp_trx(const gmx_output_env_t *oenv, const char *fn1, const char *fn2,
+                     gmx_bool bRMSD, real ftol, real abstol)
+{
+    int          i;
+    const char  *fn[2];
+    t_trxframe   fr[2];
+    t_trxstatus *status[2];
+    gmx_bool     b[2];
+
+    fn[0] = fn1;
+    fn[1] = fn2;
+    fprintf(stderr, "Comparing trajectory files %s and %s\n", fn1, fn2);
+    for (i = 0; i < 2; i++)
+    {
+        b[i] = read_first_frame(oenv, &status[i], fn[i], &fr[i], TRX_READ_X|TRX_READ_V|TRX_READ_F);
+    }
+
+    if (b[0] && b[1])
+    {
+        do
+        {
+            comp_frame(stdout, &(fr[0]), &(fr[1]), bRMSD, ftol, abstol);
+
+            for (i = 0; i < 2; i++)
+            {
+                b[i] = read_next_frame(oenv, status[i], &fr[i]);
+            }
+        }
+        while (b[0] && b[1]);
+
+        for (i = 0; i < 2; i++)
+        {
+            if (b[i] && !b[1-i])
+            {
+                fprintf(stdout, "\nEnd of file on %s but not on %s\n", fn[1-i], fn[i]);
+            }
+            close_trx(status[i]);
+        }
+    }
+    if (!b[0] && !b[1])
+    {
+        fprintf(stdout, "\nBoth files read correctly\n");
+    }
+}
+
 static void tpx2system(FILE *fp, const gmx_mtop_t *mtop)
 {
     int                       nmol, nvsite = 0;
     gmx_mtop_atomloop_block_t aloop;
-    t_atom                   *atom;
+    const t_atom             *atom;
 
     fprintf(fp, "\\subsection{Simulation system}\n");
     aloop = gmx_mtop_atomloop_block_init(mtop);
@@ -146,11 +248,11 @@ static void tpx2params(FILE *fp, const t_inputrec *ir)
 
 static void tpx2methods(const char *tpx, const char *tex)
 {
-    FILE         *fp;
-    t_inputrec    ir;
-    t_state       state;
-    gmx_mtop_t    mtop;
+    FILE          *fp;
+    t_state        state;
+    gmx_mtop_t     mtop;
 
+    t_inputrec     ir;
     read_tpx_state(tpx, &ir, &state, &mtop);
     fp = gmx_fio_fopen(tex, "w");
     fprintf(fp, "\\section{Methods}\n");
@@ -276,7 +378,7 @@ static void chk_bonds(t_idef *idef, int ePBC, rvec *x, matrix box, real tol)
     }
 }
 
-void chk_trj(const gmx_output_env_t *oenv, const char *fn, const char *tpr, real tol)
+static void chk_trj(const gmx_output_env_t *oenv, const char *fn, const char *tpr, real tol)
 {
     t_trxframe       fr;
     t_count          count;
@@ -286,7 +388,7 @@ void chk_trj(const gmx_output_env_t *oenv, const char *fn, const char *tpr, real
     gmx_bool         bShowTimestep = TRUE, newline = FALSE;
     t_trxstatus     *status;
     gmx_mtop_t       mtop;
-    gmx_localtop_t  *top = NULL;
+    gmx_localtop_t  *top = nullptr;
     t_state          state;
     t_inputrec       ir;
 
@@ -394,7 +496,7 @@ void chk_trj(const gmx_output_env_t *oenv, const char *fn, const char *tpr, real
 
     fprintf(stderr, "\n");
 
-    close_trj(status);
+    close_trx(status);
 
     fprintf(stderr, "\nItem        #frames");
     if (bShowTimestep)
@@ -412,7 +514,7 @@ void chk_trj(const gmx_output_env_t *oenv, const char *fn, const char *tpr, real
     PRINTITEM ( "Box",        bBox );
 }
 
-void chk_tps(const char *fn, real vdw_fac, real bon_lo, real bon_hi)
+static void chk_tps(const char *fn, real vdw_fac, real bon_lo, real bon_hi)
 {
     int            natom, i, j, k;
     t_topology     top;
@@ -613,7 +715,7 @@ void chk_tps(const char *fn, real vdw_fac, real bon_lo, real bon_hi)
     }
 }
 
-void chk_ndx(const char *fn)
+static void chk_ndx(const char *fn)
 {
     t_blocka *grps;
     char    **grpname;
@@ -645,11 +747,11 @@ void chk_ndx(const char *fn)
     done_blocka(grps);
 }
 
-void chk_enx(const char *fn)
+static void chk_enx(const char *fn)
 {
     int            nre, fnr;
     ener_file_t    in;
-    gmx_enxnm_t   *enm = NULL;
+    gmx_enxnm_t   *enm = nullptr;
     t_enxframe    *fr;
     gmx_bool       bShowTStep;
     gmx_bool       timeSet;
@@ -738,18 +840,18 @@ int gmx_check(int argc, char *argv[])
         "consisting of a rough outline for a methods section for a paper."
     };
     t_filenm          fnm[] = {
-        { efTRX, "-f",  NULL, ffOPTRD },
-        { efTRX, "-f2",  NULL, ffOPTRD },
+        { efTRX, "-f",  nullptr, ffOPTRD },
+        { efTRX, "-f2",  nullptr, ffOPTRD },
         { efTPR, "-s1", "top1", ffOPTRD },
         { efTPR, "-s2", "top2", ffOPTRD },
-        { efTPS, "-c",  NULL, ffOPTRD },
-        { efEDR, "-e",  NULL, ffOPTRD },
+        { efTPS, "-c",  nullptr, ffOPTRD },
+        { efEDR, "-e",  nullptr, ffOPTRD },
         { efEDR, "-e2", "ener2", ffOPTRD },
-        { efNDX, "-n",  NULL, ffOPTRD },
-        { efTEX, "-m",  NULL, ffOPTWR }
+        { efNDX, "-n",  nullptr, ffOPTRD },
+        { efTEX, "-m",  nullptr, ffOPTWR }
     };
 #define NFILE asize(fnm)
-    const char       *fn1 = NULL, *fn2 = NULL, *tex = NULL;
+    const char       *fn1 = nullptr, *fn2 = nullptr, *tex = nullptr;
 
     gmx_output_env_t *oenv;
     static real       vdw_fac  = 0.8;
@@ -759,7 +861,7 @@ int gmx_check(int argc, char *argv[])
     static real       ftol     = 0.001;
     static real       abstol   = 0.001;
     static gmx_bool   bCompAB  = FALSE;
-    static char      *lastener = NULL;
+    static char      *lastener = nullptr;
     static t_pargs    pa[]     = {
         { "-vdwfac", FALSE, etREAL, {&vdw_fac},
           "Fraction of sum of VdW radii used as warning cutoff" },
@@ -780,7 +882,7 @@ int gmx_check(int argc, char *argv[])
     };
 
     if (!parse_common_args(&argc, argv, 0, NFILE, fnm, asize(pa), pa,
-                           asize(desc), desc, 0, NULL, &oenv))
+                           asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -807,11 +909,11 @@ int gmx_check(int argc, char *argv[])
     {
         if (bCompAB)
         {
-            if (fn1 == NULL)
+            if (fn1 == nullptr)
             {
                 gmx_fatal(FARGS, "With -ab you need to set the -s1 option");
             }
-            fn2 = NULL;
+            fn2 = nullptr;
         }
         comp_tpx(fn1, fn2, bRMSD, ftol, abstol);
     }
diff --git a/src/gromacs/tools/compare.cpp b/src/gromacs/tools/compare.cpp
deleted file mode 100644 (file)
index b7313c5..0000000
+++ /dev/null
@@ -1,1469 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * 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
- * Mark Abraham, David van der Spoel, Berk Hess, and 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.
- */
-/* This file is completely threadsafe - keep it that way! */
-
-#include "gmxpre.h"
-
-#include <cmath>
-#include <cstdio>
-#include <cstring>
-
-#include <algorithm>
-
-#include "gromacs/fileio/enxio.h"
-#include "gromacs/fileio/tpxio.h"
-#include "gromacs/fileio/trxio.h"
-#include "gromacs/mdtypes/inputrec.h"
-#include "gromacs/mdtypes/md_enums.h"
-#include "gromacs/mdtypes/pull-params.h"
-#include "gromacs/topology/ifunc.h"
-#include "gromacs/topology/mtop_util.h"
-#include "gromacs/topology/topology.h"
-#include "gromacs/trajectory/trajectoryframe.h"
-#include "gromacs/utility/cstringutil.h"
-#include "gromacs/utility/fatalerror.h"
-#include "gromacs/utility/futil.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/utility/stringutil.h"
-
-static void cmp_int(FILE *fp, const char *s, int index, int i1, int i2)
-{
-    if (i1 != i2)
-    {
-        if (index != -1)
-        {
-            fprintf(fp, "%s[%d] (%d - %d)\n", s, index, i1, i2);
-        }
-        else
-        {
-            fprintf(fp, "%s (%d - %d)\n", s, i1, i2);
-        }
-    }
-}
-
-static void cmp_int64(FILE *fp, const char *s, gmx_int64_t i1, gmx_int64_t i2)
-{
-    if (i1 != i2)
-    {
-        fprintf(fp, "%s (", s);
-        fprintf(fp, "%" GMX_PRId64, i1);
-        fprintf(fp, " - ");
-        fprintf(fp, "%" GMX_PRId64, i2);
-        fprintf(fp, ")\n");
-    }
-}
-
-static void cmp_us(FILE *fp, const char *s, int index, unsigned short i1, unsigned short i2)
-{
-    if (i1 != i2)
-    {
-        if (index != -1)
-        {
-            fprintf(fp, "%s[%d] (%hu - %hu)\n", s, index, i1, i2);
-        }
-        else
-        {
-            fprintf(fp, "%s (%hu - %hu)\n", s, i1, i2);
-        }
-    }
-}
-
-static void cmp_uc(FILE *fp, const char *s, int index, unsigned char i1, unsigned char i2)
-{
-    if (i1 != i2)
-    {
-        if (index != -1)
-        {
-            fprintf(fp, "%s[%d] (%d - %d)\n", s, index, i1, i2);
-        }
-        else
-        {
-            fprintf(fp, "%s (%d - %d)\n", s, i1, i2);
-        }
-    }
-}
-
-static gmx_bool cmp_bool(FILE *fp, const char *s, int index, gmx_bool b1, gmx_bool b2)
-{
-    if (b1)
-    {
-        b1 = 1;
-    }
-    else
-    {
-        b1 = 0;
-    }
-    if (b2)
-    {
-        b2 = 1;
-    }
-    else
-    {
-        b2 = 0;
-    }
-    if (b1 != b2)
-    {
-        if (index != -1)
-        {
-            fprintf(fp, "%s[%d] (%s - %s)\n", s, index,
-                    gmx::boolToString(b1), gmx::boolToString(b2));
-        }
-        else
-        {
-            fprintf(fp, "%s (%s - %s)\n", s,
-                    gmx::boolToString(b1), gmx::boolToString(b2));
-        }
-    }
-    return b1 && b2;
-}
-
-static void cmp_str(FILE *fp, const char *s, int index,
-                    const char *s1, const char *s2)
-{
-    if (std::strcmp(s1, s2) != 0)
-    {
-        if (index != -1)
-        {
-            fprintf(fp, "%s[%d] (%s - %s)\n", s, index, s1, s2);
-        }
-        else
-        {
-            fprintf(fp, "%s (%s - %s)\n", s, s1, s2);
-        }
-    }
-}
-
-static gmx_bool equal_real(real i1, real i2, real ftol, real abstol)
-{
-    return ( ( 2*fabs(i1 - i2) <= (fabs(i1) + fabs(i2))*ftol ) || fabs(i1-i2) <= abstol );
-}
-
-static gmx_bool equal_float(float i1, float i2, float ftol, float abstol)
-{
-    return ( ( 2*fabs(i1 - i2) <= (fabs(i1) + fabs(i2))*ftol ) || fabs(i1-i2) <= abstol );
-}
-
-static gmx_bool equal_double(double i1, double i2, real ftol, real abstol)
-{
-    return ( ( 2*fabs(i1 - i2) <= (fabs(i1) + fabs(i2))*ftol ) || fabs(i1-i2) <= abstol );
-}
-
-static void
-cmp_real(FILE *fp, const char *s, int index, real i1, real i2, real ftol, real abstol)
-{
-    if (!equal_real(i1, i2, ftol, abstol))
-    {
-        if (index != -1)
-        {
-            fprintf(fp, "%s[%2d] (%e - %e)\n", s, index, i1, i2);
-        }
-        else
-        {
-            fprintf(fp, "%s (%e - %e)\n", s, i1, i2);
-        }
-    }
-}
-
-static void
-cmp_float(FILE *fp, const char *s, int index, float i1, float i2, float ftol, float abstol)
-{
-    if (!equal_float(i1, i2, ftol, abstol))
-    {
-        if (index != -1)
-        {
-            fprintf(fp, "%s[%2d] (%e - %e)\n", s, index, i1, i2);
-        }
-        else
-        {
-            fprintf(fp, "%s (%e - %e)\n", s, i1, i2);
-        }
-    }
-}
-
-
-
-static void
-cmp_double(FILE *fp, const char *s, int index, double i1, double i2, double ftol, double abstol)
-{
-    if (!equal_double(i1, i2, ftol, abstol))
-    {
-        if (index != -1)
-        {
-            fprintf(fp, "%s[%2d] (%16.9e - %16.9e)\n", s, index, i1, i2);
-        }
-        else
-        {
-            fprintf(fp, "%s (%16.9e - %16.9e)\n", s, i1, i2);
-        }
-    }
-}
-
-static void cmp_rvec(FILE *fp, const char *s, int index, const rvec i1, const rvec i2, real ftol, real abstol)
-{
-    if (!equal_real(i1[XX], i2[XX], ftol, abstol) ||
-        !equal_real(i1[YY], i2[YY], ftol, abstol) ||
-        !equal_real(i1[ZZ], i2[ZZ], ftol, abstol))
-    {
-        if (index != -1)
-        {
-            fprintf(fp, "%s[%5d] (%12.5e %12.5e %12.5e) - (%12.5e %12.5e %12.5e)\n",
-                    s, index, i1[XX], i1[YY], i1[ZZ], i2[XX], i2[YY], i2[ZZ]);
-        }
-        else
-        {
-            fprintf(fp, "%s (%12.5e %12.5e %12.5e) - (%12.5e %12.5e %12.5e)\n",
-                    s, i1[XX], i1[YY], i1[ZZ], i2[XX], i2[YY], i2[ZZ]);
-        }
-    }
-}
-
-static void cmp_ivec(FILE *fp, const char *s, int index, const ivec i1, const ivec i2)
-{
-    if ((i1[XX] != i2[XX]) || (i1[YY] != i2[YY]) || (i1[ZZ] != i2[ZZ]))
-    {
-        if (index != -1)
-        {
-            fprintf(fp, "%s[%5d] (%8d,%8d,%8d - %8d,%8d,%8d)\n", s, index,
-                    i1[XX], i1[YY], i1[ZZ], i2[XX], i2[YY], i2[ZZ]);
-        }
-        else
-        {
-            fprintf(fp, "%s (%8d,%8d,%8d - %8d,%8d,%8d)\n", s,
-                    i1[XX], i1[YY], i1[ZZ], i2[XX], i2[YY], i2[ZZ]);
-        }
-    }
-}
-
-static void cmp_ilist(FILE *fp, int ftype, const t_ilist *il1, const t_ilist *il2)
-{
-    int  i;
-    char buf[256];
-
-    fprintf(fp, "comparing ilist %s\n", interaction_function[ftype].name);
-    sprintf(buf, "%s->nr", interaction_function[ftype].name);
-    cmp_int(fp, buf, -1, il1->nr, il2->nr);
-    sprintf(buf, "%s->iatoms", interaction_function[ftype].name);
-    if (((il1->nr > 0) && (!il1->iatoms)) ||
-        ((il2->nr > 0) && (!il2->iatoms)) ||
-        ((il1->nr != il2->nr)))
-    {
-        fprintf(fp, "Comparing radically different topologies - %s is different\n",
-                buf);
-    }
-    else
-    {
-        for (i = 0; (i < il1->nr); i++)
-        {
-            cmp_int(fp, buf, i, il1->iatoms[i], il2->iatoms[i]);
-        }
-    }
-}
-
-void cmp_iparm(FILE *fp, const char *s, t_functype ft,
-               const t_iparams &ip1, const t_iparams &ip2, real ftol, real abstol)
-{
-    int      i;
-    gmx_bool bDiff;
-
-    bDiff = FALSE;
-    for (i = 0; i < MAXFORCEPARAM && !bDiff; i++)
-    {
-        bDiff = !equal_real(ip1.generic.buf[i], ip2.generic.buf[i], ftol, abstol);
-    }
-    if (bDiff)
-    {
-        fprintf(fp, "%s1: ", s);
-        pr_iparams(fp, ft, &ip1);
-        fprintf(fp, "%s2: ", s);
-        pr_iparams(fp, ft, &ip2);
-    }
-}
-
-void cmp_iparm_AB(FILE *fp, const char *s, t_functype ft, const t_iparams &ip1, real ftol, real abstol)
-{
-    int      nrfpA, nrfpB, p0, i;
-    gmx_bool bDiff;
-
-    /* Normally the first parameter is perturbable */
-    p0    = 0;
-    nrfpA = interaction_function[ft].nrfpA;
-    nrfpB = interaction_function[ft].nrfpB;
-    if (ft == F_PDIHS)
-    {
-        nrfpB = 2;
-    }
-    else if (interaction_function[ft].flags & IF_TABULATED)
-    {
-        /* For tabulated interactions only the second parameter is perturbable */
-        p0    = 1;
-        nrfpB = 1;
-    }
-    bDiff = FALSE;
-    for (i = 0; i < nrfpB && !bDiff; i++)
-    {
-        bDiff = !equal_real(ip1.generic.buf[p0+i], ip1.generic.buf[nrfpA+i], ftol, abstol);
-    }
-    if (bDiff)
-    {
-        fprintf(fp, "%s: ", s);
-        pr_iparams(fp, ft, &ip1);
-    }
-}
-
-static void cmp_cmap(FILE *fp, const gmx_cmap_t *cmap1, const gmx_cmap_t *cmap2, real ftol, real abstol)
-{
-    cmp_int(fp, "cmap ngrid", -1, cmap1->ngrid, cmap2->ngrid);
-    cmp_int(fp, "cmap grid_spacing", -1, cmap1->grid_spacing, cmap2->grid_spacing);
-    if (cmap1->ngrid == cmap2->ngrid &&
-        cmap1->grid_spacing == cmap2->grid_spacing)
-    {
-        int g;
-
-        for (g = 0; g < cmap1->ngrid; g++)
-        {
-            int i;
-
-            fprintf(fp, "comparing cmap %d\n", g);
-
-            for (i = 0; i < 4*cmap1->grid_spacing*cmap1->grid_spacing; i++)
-            {
-                cmp_real(fp, "", i, cmap1->cmapdata[g].cmap[i], cmap2->cmapdata[g].cmap[i], ftol, abstol);
-            }
-        }
-    }
-}
-
-static void cmp_idef(FILE *fp, const t_idef *id1, const t_idef *id2, real ftol, real abstol)
-{
-    int  i;
-    char buf1[64], buf2[64];
-
-    fprintf(fp, "comparing idef\n");
-    if (id2)
-    {
-        cmp_int(fp, "idef->ntypes", -1, id1->ntypes, id2->ntypes);
-        cmp_int(fp, "idef->atnr",  -1, id1->atnr, id2->atnr);
-        for (i = 0; (i < std::min(id1->ntypes, id2->ntypes)); i++)
-        {
-            sprintf(buf1, "idef->functype[%d]", i);
-            sprintf(buf2, "idef->iparam[%d]", i);
-            cmp_int(fp, buf1, i, (int)id1->functype[i], (int)id2->functype[i]);
-            cmp_iparm(fp, buf2, id1->functype[i],
-                      id1->iparams[i], id2->iparams[i], ftol, abstol);
-        }
-        cmp_real(fp, "fudgeQQ", -1, id1->fudgeQQ, id2->fudgeQQ, ftol, abstol);
-        cmp_cmap(fp, &id1->cmap_grid, &id2->cmap_grid, ftol, abstol);
-        for (i = 0; (i < F_NRE); i++)
-        {
-            cmp_ilist(fp, i, &(id1->il[i]), &(id2->il[i]));
-        }
-    }
-    else
-    {
-        for (i = 0; (i < id1->ntypes); i++)
-        {
-            cmp_iparm_AB(fp, "idef->iparam", id1->functype[i], id1->iparams[i], ftol, abstol);
-        }
-    }
-}
-
-static void cmp_block(FILE *fp, const t_block *b1, const t_block *b2, const char *s)
-{
-    char buf[32];
-
-    fprintf(fp, "comparing block %s\n", s);
-    sprintf(buf, "%s.nr", s);
-    cmp_int(fp, buf, -1, b1->nr, b2->nr);
-}
-
-static void cmp_blocka(FILE *fp, const t_blocka *b1, const t_blocka *b2, const char *s)
-{
-    char buf[32];
-
-    fprintf(fp, "comparing blocka %s\n", s);
-    sprintf(buf, "%s.nr", s);
-    cmp_int(fp, buf, -1, b1->nr, b2->nr);
-    sprintf(buf, "%s.nra", s);
-    cmp_int(fp, buf, -1, b1->nra, b2->nra);
-}
-
-static void cmp_atom(FILE *fp, int index, const t_atom *a1, const t_atom *a2, real ftol, real abstol)
-{
-    if (a2)
-    {
-        cmp_us(fp, "atom.type", index, a1->type, a2->type);
-        cmp_us(fp, "atom.ptype", index, a1->ptype, a2->ptype);
-        cmp_int(fp, "atom.resind", index, a1->resind, a2->resind);
-        cmp_int(fp, "atom.atomnumber", index, a1->atomnumber, a2->atomnumber);
-        cmp_real(fp, "atom.m", index, a1->m, a2->m, ftol, abstol);
-        cmp_real(fp, "atom.q", index, a1->q, a2->q, ftol, abstol);
-        cmp_us(fp, "atom.typeB", index, a1->typeB, a2->typeB);
-        cmp_real(fp, "atom.mB", index, a1->mB, a2->mB, ftol, abstol);
-        cmp_real(fp, "atom.qB", index, a1->qB, a2->qB, ftol, abstol);
-    }
-    else
-    {
-        cmp_us(fp, "atom.type", index, a1->type, a1->typeB);
-        cmp_real(fp, "atom.m", index, a1->m, a1->mB, ftol, abstol);
-        cmp_real(fp, "atom.q", index, a1->q, a1->qB, ftol, abstol);
-    }
-}
-
-static void cmp_atoms(FILE *fp, const t_atoms *a1, const t_atoms *a2, real ftol, real abstol)
-{
-    int i;
-
-    fprintf(fp, "comparing atoms\n");
-
-    if (a2)
-    {
-        cmp_int(fp, "atoms->nr", -1, a1->nr, a2->nr);
-        for (i = 0; (i < a1->nr); i++)
-        {
-            cmp_atom(fp, i, &(a1->atom[i]), &(a2->atom[i]), ftol, abstol);
-        }
-    }
-    else
-    {
-        for (i = 0; (i < a1->nr); i++)
-        {
-            cmp_atom(fp, i, &(a1->atom[i]), NULL, ftol, abstol);
-        }
-    }
-}
-
-static void cmp_top(FILE *fp, const t_topology *t1, const t_topology *t2, real ftol, real abstol)
-{
-    fprintf(fp, "comparing top\n");
-    if (t2)
-    {
-        cmp_idef(fp, &(t1->idef), &(t2->idef), ftol, abstol);
-        cmp_atoms(fp, &(t1->atoms), &(t2->atoms), ftol, abstol);
-        cmp_block(fp, &t1->cgs, &t2->cgs, "cgs");
-        cmp_block(fp, &t1->mols, &t2->mols, "mols");
-        cmp_bool(fp, "bIntermolecularInteractions", -1, t1->bIntermolecularInteractions, t2->bIntermolecularInteractions);
-        cmp_blocka(fp, &t1->excls, &t2->excls, "excls");
-    }
-    else
-    {
-        cmp_idef(fp, &(t1->idef), NULL, ftol, abstol);
-        cmp_atoms(fp, &(t1->atoms), NULL, ftol, abstol);
-    }
-}
-
-static void cmp_groups(FILE *fp, const gmx_groups_t *g0, const gmx_groups_t *g1,
-                       int natoms0, int natoms1)
-{
-    int  i, j;
-    char buf[32];
-
-    fprintf(fp, "comparing groups\n");
-
-    for (i = 0; i < egcNR; i++)
-    {
-        sprintf(buf, "grps[%d].nr", i);
-        cmp_int(fp, buf, -1, g0->grps[i].nr, g1->grps[i].nr);
-        if (g0->grps[i].nr == g1->grps[i].nr)
-        {
-            for (j = 0; j < g0->grps[i].nr; j++)
-            {
-                sprintf(buf, "grps[%d].name[%d]", i, j);
-                cmp_str(fp, buf, -1,
-                        *g0->grpname[g0->grps[i].nm_ind[j]],
-                        *g1->grpname[g1->grps[i].nm_ind[j]]);
-            }
-        }
-        cmp_int(fp, "ngrpnr", i, g0->ngrpnr[i], g1->ngrpnr[i]);
-        if (g0->ngrpnr[i] == g1->ngrpnr[i] && natoms0 == natoms1 &&
-            (g0->grpnr[i] != NULL || g1->grpnr[i] != NULL))
-        {
-            for (j = 0; j < natoms0; j++)
-            {
-                cmp_int(fp, gtypes[i], j, ggrpnr(g0, i, j), ggrpnr(g1, i, j));
-            }
-        }
-    }
-    /* We have compared the names in the groups lists,
-     * so we can skip the grpname list comparison.
-     */
-}
-
-static void cmp_rvecs_rmstol(FILE *fp, const char *title, int n, const rvec x1[], const rvec x2[],
-                             real ftol, real abstol)
-{
-    int    i, m;
-    double rms;
-
-    /* For a vector you are usally not interested in a relative difference
-     * on a component that is very small compared to the other components.
-     * Therefore we do the relative comparision relative to the RMS component.
-     */
-    rms = 0.0;
-    for (i = 0; (i < n); i++)
-    {
-        for (m = 0; m < DIM; m++)
-        {
-            rms += x1[i][m]*x1[i][m] + x2[i][m]*x2[i][m];
-        }
-    }
-    rms = sqrt(rms/(2*n*DIM));
-
-    /* Convert the relative tolerance into an absolute tolerance */
-    if (ftol*rms < abstol)
-    {
-        abstol = ftol*rms;
-    }
-
-    /* And now do the actual comparision */
-    for (i = 0; (i < n); i++)
-    {
-        cmp_rvec(fp, title, i, x1[i], x2[i], 0.0, abstol);
-    }
-}
-
-static void cmp_rvecs(FILE *fp, const char *title, int n, const rvec x1[], const rvec x2[],
-                      gmx_bool bRMSD, real ftol, real abstol)
-{
-    int    i, m;
-    double d, ssd;
-
-    if (bRMSD)
-    {
-        ssd = 0;
-        for (i = 0; (i < n); i++)
-        {
-            for (m = 0; m < DIM; m++)
-            {
-                d    = x1[i][m] - x2[i][m];
-                ssd += d*d;
-            }
-        }
-        fprintf(fp, "%s RMSD %g\n", title, std::sqrt(ssd/n));
-    }
-    else
-    {
-        cmp_rvecs_rmstol(fp, title, n, x1, x2, ftol, abstol);
-    }
-}
-
-static void cmp_grpopts(FILE *fp, const t_grpopts *opt1, const t_grpopts *opt2, real ftol, real abstol)
-{
-    int  i, j;
-    char buf1[256], buf2[256];
-
-    cmp_int(fp, "inputrec->grpopts.ngtc", -1,  opt1->ngtc, opt2->ngtc);
-    cmp_int(fp, "inputrec->grpopts.ngacc", -1, opt1->ngacc, opt2->ngacc);
-    cmp_int(fp, "inputrec->grpopts.ngfrz", -1, opt1->ngfrz, opt2->ngfrz);
-    cmp_int(fp, "inputrec->grpopts.ngener", -1, opt1->ngener, opt2->ngener);
-    for (i = 0; (i < std::min(opt1->ngtc, opt2->ngtc)); i++)
-    {
-        cmp_real(fp, "inputrec->grpopts.nrdf", i, opt1->nrdf[i], opt2->nrdf[i], ftol, abstol);
-        cmp_real(fp, "inputrec->grpopts.ref_t", i, opt1->ref_t[i], opt2->ref_t[i], ftol, abstol);
-        cmp_real(fp, "inputrec->grpopts.tau_t", i, opt1->tau_t[i], opt2->tau_t[i], ftol, abstol);
-        cmp_int(fp, "inputrec->grpopts.annealing", i, opt1->annealing[i], opt2->annealing[i]);
-        cmp_int(fp, "inputrec->grpopts.anneal_npoints", i,
-                opt1->anneal_npoints[i], opt2->anneal_npoints[i]);
-        if (opt1->anneal_npoints[i] == opt2->anneal_npoints[i])
-        {
-            sprintf(buf1, "inputrec->grpopts.anneal_time[%d]", i);
-            sprintf(buf2, "inputrec->grpopts.anneal_temp[%d]", i);
-            for (j = 0; j < opt1->anneal_npoints[i]; j++)
-            {
-                cmp_real(fp, buf1, j, opt1->anneal_time[i][j], opt2->anneal_time[i][j], ftol, abstol);
-                cmp_real(fp, buf2, j, opt1->anneal_temp[i][j], opt2->anneal_temp[i][j], ftol, abstol);
-            }
-        }
-    }
-    if (opt1->ngener == opt2->ngener)
-    {
-        for (i = 0; i < opt1->ngener; i++)
-        {
-            for (j = i; j < opt1->ngener; j++)
-            {
-                sprintf(buf1, "inputrec->grpopts.egp_flags[%d]", i);
-                cmp_int(fp, buf1, j,
-                        opt1->egp_flags[opt1->ngener*i+j],
-                        opt2->egp_flags[opt1->ngener*i+j]);
-            }
-        }
-    }
-    for (i = 0; (i < std::min(opt1->ngacc, opt2->ngacc)); i++)
-    {
-        cmp_rvec(fp, "inputrec->grpopts.acc", i, opt1->acc[i], opt2->acc[i], ftol, abstol);
-    }
-    for (i = 0; (i < std::min(opt1->ngfrz, opt2->ngfrz)); i++)
-    {
-        cmp_ivec(fp, "inputrec->grpopts.nFreeze", i, opt1->nFreeze[i], opt2->nFreeze[i]);
-    }
-}
-
-static void cmp_cosines(FILE *fp, const char *s, const t_cosines c1[DIM], const t_cosines c2[DIM], real ftol, real abstol)
-{
-    int  i, m;
-    char buf[256];
-
-    for (m = 0; (m < DIM); m++)
-    {
-        sprintf(buf, "inputrec->%s[%d]", s, m);
-        cmp_int(fp, buf, 0, c1->n, c2->n);
-        for (i = 0; (i < std::min(c1->n, c2->n)); i++)
-        {
-            cmp_real(fp, buf, i, c1->a[i], c2->a[i], ftol, abstol);
-            cmp_real(fp, buf, i, c1->phi[i], c2->phi[i], ftol, abstol);
-        }
-    }
-}
-static void cmp_pull(FILE *fp)
-{
-    fprintf(fp, "WARNING: Both files use COM pulling, but comparing of the pull struct is not implemented (yet). The pull parameters could be the same or different.\n");
-}
-
-static void cmp_simtempvals(FILE *fp, const t_simtemp *simtemp1, const t_simtemp *simtemp2, int n_lambda, real ftol, real abstol)
-{
-    int i;
-    cmp_int(fp, "inputrec->simtempvals->eSimTempScale", -1, simtemp1->eSimTempScale, simtemp2->eSimTempScale);
-    cmp_real(fp, "inputrec->simtempvals->simtemp_high", -1, simtemp1->simtemp_high, simtemp2->simtemp_high, ftol, abstol);
-    cmp_real(fp, "inputrec->simtempvals->simtemp_low", -1, simtemp1->simtemp_low, simtemp2->simtemp_low, ftol, abstol);
-    for (i = 0; i < n_lambda; i++)
-    {
-        cmp_real(fp, "inputrec->simtempvals->temperatures", -1, simtemp1->temperatures[i], simtemp2->temperatures[i], ftol, abstol);
-    }
-}
-
-static void cmp_expandedvals(FILE *fp, const t_expanded *expand1, const t_expanded *expand2, int n_lambda, real ftol, real abstol)
-{
-    int i;
-
-    cmp_bool(fp, "inputrec->fepvals->bInit_weights", -1, expand1->bInit_weights, expand2->bInit_weights);
-    cmp_bool(fp, "inputrec->fepvals->bWLoneovert", -1, expand1->bWLoneovert, expand2->bWLoneovert);
-
-    for (i = 0; i < n_lambda; i++)
-    {
-        cmp_real(fp, "inputrec->expandedvals->init_lambda_weights", -1,
-                 expand1->init_lambda_weights[i], expand2->init_lambda_weights[i], ftol, abstol);
-    }
-
-    cmp_int(fp, "inputrec->expandedvals->lambda-stats", -1, expand1->elamstats, expand2->elamstats);
-    cmp_int(fp, "inputrec->expandedvals->lambda-mc-move", -1, expand1->elmcmove, expand2->elmcmove);
-    cmp_int(fp, "inputrec->expandedvals->lmc-repeats", -1, expand1->lmc_repeats, expand2->lmc_repeats);
-    cmp_int(fp, "inputrec->expandedvals->lmc-gibbsdelta", -1, expand1->gibbsdeltalam, expand2->gibbsdeltalam);
-    cmp_int(fp, "inputrec->expandedvals->lmc-forced-nstart", -1, expand1->lmc_forced_nstart, expand2->lmc_forced_nstart);
-    cmp_int(fp, "inputrec->expandedvals->lambda-weights-equil", -1, expand1->elmceq, expand2->elmceq);
-    cmp_int(fp, "inputrec->expandedvals->,weight-equil-number-all-lambda", -1, expand1->equil_n_at_lam, expand2->equil_n_at_lam);
-    cmp_int(fp, "inputrec->expandedvals->weight-equil-number-samples", -1, expand1->equil_samples, expand2->equil_samples);
-    cmp_int(fp, "inputrec->expandedvals->weight-equil-number-steps", -1, expand1->equil_steps, expand2->equil_steps);
-    cmp_real(fp, "inputrec->expandedvals->weight-equil-wl-delta", -1, expand1->equil_wl_delta, expand2->equil_wl_delta, ftol, abstol);
-    cmp_real(fp, "inputrec->expandedvals->weight-equil-count-ratio", -1, expand1->equil_ratio, expand2->equil_ratio, ftol, abstol);
-    cmp_bool(fp, "inputrec->expandedvals->symmetrized-transition-matrix", -1, expand1->bSymmetrizedTMatrix, expand2->bSymmetrizedTMatrix);
-    cmp_int(fp, "inputrec->expandedvals->nstTij", -1, expand1->nstTij, expand2->nstTij);
-    cmp_int(fp, "inputrec->expandedvals->mininum-var-min", -1, expand1->minvarmin, expand2->minvarmin); /*default is reasonable */
-    cmp_int(fp, "inputrec->expandedvals->weight-c-range", -1, expand1->c_range, expand2->c_range);      /* default is just C=0 */
-    cmp_real(fp, "inputrec->expandedvals->wl-scale", -1, expand1->wl_scale, expand2->wl_scale, ftol, abstol);
-    cmp_real(fp, "inputrec->expandedvals->init-wl-delta", -1, expand1->init_wl_delta, expand2->init_wl_delta, ftol, abstol);
-    cmp_real(fp, "inputrec->expandedvals->wl-ratio", -1, expand1->wl_ratio, expand2->wl_ratio, ftol, abstol);
-    cmp_int(fp, "inputrec->expandedvals->nstexpanded", -1, expand1->nstexpanded, expand2->nstexpanded);
-    cmp_int(fp, "inputrec->expandedvals->lmc-seed", -1, expand1->lmc_seed, expand2->lmc_seed);
-    cmp_real(fp, "inputrec->expandedvals->mc-temperature", -1, expand1->mc_temp, expand2->mc_temp, ftol, abstol);
-}
-
-static void cmp_fepvals(FILE *fp, const t_lambda *fep1, const t_lambda *fep2, real ftol, real abstol)
-{
-    int i, j;
-    cmp_int(fp, "inputrec->nstdhdl", -1, fep1->nstdhdl, fep2->nstdhdl);
-    cmp_double(fp, "inputrec->fepvals->init_fep_state", -1, fep1->init_fep_state, fep2->init_fep_state, ftol, abstol);
-    cmp_double(fp, "inputrec->fepvals->delta_lambda", -1, fep1->delta_lambda, fep2->delta_lambda, ftol, abstol);
-    cmp_int(fp, "inputrec->fepvals->n_lambda", -1, fep1->n_lambda, fep2->n_lambda);
-    for (i = 0; i < efptNR; i++)
-    {
-        for (j = 0; j < std::min(fep1->n_lambda, fep2->n_lambda); j++)
-        {
-            cmp_double(fp, "inputrec->fepvals->all_lambda", -1, fep1->all_lambda[i][j], fep2->all_lambda[i][j], ftol, abstol);
-        }
-    }
-    cmp_int(fp, "inputrec->fepvals->lambda_neighbors", 1, fep1->lambda_neighbors,
-            fep2->lambda_neighbors);
-    cmp_real(fp, "inputrec->fepvals->sc_alpha", -1, fep1->sc_alpha, fep2->sc_alpha, ftol, abstol);
-    cmp_int(fp, "inputrec->fepvals->sc_power", -1, fep1->sc_power, fep2->sc_power);
-    cmp_real(fp, "inputrec->fepvals->sc_r_power", -1, fep1->sc_r_power, fep2->sc_r_power, ftol, abstol);
-    cmp_real(fp, "inputrec->fepvals->sc_sigma", -1, fep1->sc_sigma, fep2->sc_sigma, ftol, abstol);
-    cmp_int(fp, "inputrec->fepvals->edHdLPrintEnergy", -1, fep1->edHdLPrintEnergy, fep1->edHdLPrintEnergy);
-    cmp_bool(fp, "inputrec->fepvals->bScCoul", -1, fep1->bScCoul, fep1->bScCoul);
-    cmp_int(fp, "inputrec->separate_dhdl_file", -1, fep1->separate_dhdl_file, fep2->separate_dhdl_file);
-    cmp_int(fp, "inputrec->dhdl_derivatives", -1, fep1->dhdl_derivatives, fep2->dhdl_derivatives);
-    cmp_int(fp, "inputrec->dh_hist_size", -1, fep1->dh_hist_size, fep2->dh_hist_size);
-    cmp_double(fp, "inputrec->dh_hist_spacing", -1, fep1->dh_hist_spacing, fep2->dh_hist_spacing, ftol, abstol);
-}
-
-static void cmp_inputrec(FILE *fp, const t_inputrec *ir1, const t_inputrec *ir2, real ftol, real abstol)
-{
-    fprintf(fp, "comparing inputrec\n");
-
-    /* gcc 2.96 doesnt like these defines at all, but issues a huge list
-     * of warnings. Maybe it will change in future versions, but for the
-     * moment I've spelled them out instead. /EL 000820
-     * #define CIB(s) cmp_int(fp,"inputrec->"#s,0,ir1->##s,ir2->##s)
-     * #define CII(s) cmp_int(fp,"inputrec->"#s,0,ir1->##s,ir2->##s)
-     * #define CIR(s) cmp_real(fp,"inputrec->"#s,0,ir1->##s,ir2->##s,ftol)
-     */
-    cmp_int(fp, "inputrec->eI", -1, ir1->eI, ir2->eI);
-    cmp_int64(fp, "inputrec->nsteps", ir1->nsteps, ir2->nsteps);
-    cmp_int64(fp, "inputrec->init_step", ir1->init_step, ir2->init_step);
-    cmp_int(fp, "inputrec->simulation_part", -1, ir1->simulation_part, ir2->simulation_part);
-    cmp_int(fp, "inputrec->ePBC", -1, ir1->ePBC, ir2->ePBC);
-    cmp_int(fp, "inputrec->bPeriodicMols", -1, ir1->bPeriodicMols, ir2->bPeriodicMols);
-    cmp_int(fp, "inputrec->cutoff_scheme", -1, ir1->cutoff_scheme, ir2->cutoff_scheme);
-    cmp_int(fp, "inputrec->ns_type", -1, ir1->ns_type, ir2->ns_type);
-    cmp_int(fp, "inputrec->nstlist", -1, ir1->nstlist, ir2->nstlist);
-    cmp_int(fp, "inputrec->nstcomm", -1, ir1->nstcomm, ir2->nstcomm);
-    cmp_int(fp, "inputrec->comm_mode", -1, ir1->comm_mode, ir2->comm_mode);
-    cmp_int(fp, "inputrec->nstlog", -1, ir1->nstlog, ir2->nstlog);
-    cmp_int(fp, "inputrec->nstxout", -1, ir1->nstxout, ir2->nstxout);
-    cmp_int(fp, "inputrec->nstvout", -1, ir1->nstvout, ir2->nstvout);
-    cmp_int(fp, "inputrec->nstfout", -1, ir1->nstfout, ir2->nstfout);
-    cmp_int(fp, "inputrec->nstcalcenergy", -1, ir1->nstcalcenergy, ir2->nstcalcenergy);
-    cmp_int(fp, "inputrec->nstenergy", -1, ir1->nstenergy, ir2->nstenergy);
-    cmp_int(fp, "inputrec->nstxout_compressed", -1, ir1->nstxout_compressed, ir2->nstxout_compressed);
-    cmp_double(fp, "inputrec->init_t", -1, ir1->init_t, ir2->init_t, ftol, abstol);
-    cmp_double(fp, "inputrec->delta_t", -1, ir1->delta_t, ir2->delta_t, ftol, abstol);
-    cmp_real(fp, "inputrec->x_compression_precision", -1, ir1->x_compression_precision, ir2->x_compression_precision, ftol, abstol);
-    cmp_real(fp, "inputrec->fourierspacing", -1, ir1->fourier_spacing, ir2->fourier_spacing, ftol, abstol);
-    cmp_int(fp, "inputrec->nkx", -1, ir1->nkx, ir2->nkx);
-    cmp_int(fp, "inputrec->nky", -1, ir1->nky, ir2->nky);
-    cmp_int(fp, "inputrec->nkz", -1, ir1->nkz, ir2->nkz);
-    cmp_int(fp, "inputrec->pme_order", -1, ir1->pme_order, ir2->pme_order);
-    cmp_real(fp, "inputrec->ewald_rtol", -1, ir1->ewald_rtol, ir2->ewald_rtol, ftol, abstol);
-    cmp_int(fp, "inputrec->ewald_geometry", -1, ir1->ewald_geometry, ir2->ewald_geometry);
-    cmp_real(fp, "inputrec->epsilon_surface", -1, ir1->epsilon_surface, ir2->epsilon_surface, ftol, abstol);
-    cmp_int(fp, "inputrec->bContinuation", -1, ir1->bContinuation, ir2->bContinuation);
-    cmp_int(fp, "inputrec->bShakeSOR", -1, ir1->bShakeSOR, ir2->bShakeSOR);
-    cmp_int(fp, "inputrec->etc", -1, ir1->etc, ir2->etc);
-    cmp_int(fp, "inputrec->bPrintNHChains", -1, ir1->bPrintNHChains, ir2->bPrintNHChains);
-    cmp_int(fp, "inputrec->epc", -1, ir1->epc, ir2->epc);
-    cmp_int(fp, "inputrec->epct", -1, ir1->epct, ir2->epct);
-    cmp_real(fp, "inputrec->tau_p", -1, ir1->tau_p, ir2->tau_p, ftol, abstol);
-    cmp_rvec(fp, "inputrec->ref_p(x)", -1, ir1->ref_p[XX], ir2->ref_p[XX], ftol, abstol);
-    cmp_rvec(fp, "inputrec->ref_p(y)", -1, ir1->ref_p[YY], ir2->ref_p[YY], ftol, abstol);
-    cmp_rvec(fp, "inputrec->ref_p(z)", -1, ir1->ref_p[ZZ], ir2->ref_p[ZZ], ftol, abstol);
-    cmp_rvec(fp, "inputrec->compress(x)", -1, ir1->compress[XX], ir2->compress[XX], ftol, abstol);
-    cmp_rvec(fp, "inputrec->compress(y)", -1, ir1->compress[YY], ir2->compress[YY], ftol, abstol);
-    cmp_rvec(fp, "inputrec->compress(z)", -1, ir1->compress[ZZ], ir2->compress[ZZ], ftol, abstol);
-    cmp_int(fp, "refcoord_scaling", -1, ir1->refcoord_scaling, ir2->refcoord_scaling);
-    cmp_rvec(fp, "inputrec->posres_com", -1, ir1->posres_com, ir2->posres_com, ftol, abstol);
-    cmp_rvec(fp, "inputrec->posres_comB", -1, ir1->posres_comB, ir2->posres_comB, ftol, abstol);
-    cmp_real(fp, "inputrec->verletbuf_tol", -1, ir1->verletbuf_tol, ir2->verletbuf_tol, ftol, abstol);
-    cmp_real(fp, "inputrec->rlist", -1, ir1->rlist, ir2->rlist, ftol, abstol);
-    cmp_real(fp, "inputrec->rtpi", -1, ir1->rtpi, ir2->rtpi, ftol, abstol);
-    cmp_int(fp, "inputrec->coulombtype", -1, ir1->coulombtype, ir2->coulombtype);
-    cmp_int(fp, "inputrec->coulomb_modifier", -1, ir1->coulomb_modifier, ir2->coulomb_modifier);
-    cmp_real(fp, "inputrec->rcoulomb_switch", -1, ir1->rcoulomb_switch, ir2->rcoulomb_switch, ftol, abstol);
-    cmp_real(fp, "inputrec->rcoulomb", -1, ir1->rcoulomb, ir2->rcoulomb, ftol, abstol);
-    cmp_int(fp, "inputrec->vdwtype", -1, ir1->vdwtype, ir2->vdwtype);
-    cmp_int(fp, "inputrec->vdw_modifier", -1, ir1->vdw_modifier, ir2->vdw_modifier);  cmp_real(fp, "inputrec->rvdw_switch", -1, ir1->rvdw_switch, ir2->rvdw_switch, ftol, abstol);
-    cmp_real(fp, "inputrec->rvdw", -1, ir1->rvdw, ir2->rvdw, ftol, abstol);
-    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);
-    cmp_int(fp, "inputrec->efep", -1, ir1->efep, ir2->efep);
-    cmp_fepvals(fp, ir1->fepvals, ir2->fepvals, ftol, abstol);
-    cmp_int(fp, "inputrec->bSimTemp", -1, ir1->bSimTemp, ir2->bSimTemp);
-    if ((ir1->bSimTemp == ir2->bSimTemp) && (ir1->bSimTemp))
-    {
-        cmp_simtempvals(fp, ir1->simtempvals, ir2->simtempvals, std::min(ir1->fepvals->n_lambda, ir2->fepvals->n_lambda), ftol, abstol);
-    }
-    cmp_int(fp, "inputrec->bExpanded", -1, ir1->bExpanded, ir2->bExpanded);
-    if ((ir1->bExpanded == ir2->bExpanded) && (ir1->bExpanded))
-    {
-        cmp_expandedvals(fp, ir1->expandedvals, ir2->expandedvals, std::min(ir1->fepvals->n_lambda, ir2->fepvals->n_lambda), ftol, abstol);
-    }
-    cmp_int(fp, "inputrec->nwall", -1, ir1->nwall, ir2->nwall);
-    cmp_int(fp, "inputrec->wall_type", -1, ir1->wall_type, ir2->wall_type);
-    cmp_int(fp, "inputrec->wall_atomtype[0]", -1, ir1->wall_atomtype[0], ir2->wall_atomtype[0]);
-    cmp_int(fp, "inputrec->wall_atomtype[1]", -1, ir1->wall_atomtype[1], ir2->wall_atomtype[1]);
-    cmp_real(fp, "inputrec->wall_density[0]", -1, ir1->wall_density[0], ir2->wall_density[0], ftol, abstol);
-    cmp_real(fp, "inputrec->wall_density[1]", -1, ir1->wall_density[1], ir2->wall_density[1], ftol, abstol);
-    cmp_real(fp, "inputrec->wall_ewald_zfac", -1, ir1->wall_ewald_zfac, ir2->wall_ewald_zfac, ftol, abstol);
-
-    cmp_bool(fp, "inputrec->bPull", -1, ir1->bPull, ir2->bPull);
-    if (ir1->bPull && ir2->bPull)
-    {
-        cmp_pull(fp);
-    }
-
-    cmp_int(fp, "inputrec->eDisre", -1, ir1->eDisre, ir2->eDisre);
-    cmp_real(fp, "inputrec->dr_fc", -1, ir1->dr_fc, ir2->dr_fc, ftol, abstol);
-    cmp_int(fp, "inputrec->eDisreWeighting", -1, ir1->eDisreWeighting, ir2->eDisreWeighting);
-    cmp_int(fp, "inputrec->bDisreMixed", -1, ir1->bDisreMixed, ir2->bDisreMixed);
-    cmp_int(fp, "inputrec->nstdisreout", -1, ir1->nstdisreout, ir2->nstdisreout);
-    cmp_real(fp, "inputrec->dr_tau", -1, ir1->dr_tau, ir2->dr_tau, ftol, abstol);
-    cmp_real(fp, "inputrec->orires_fc", -1, ir1->orires_fc, ir2->orires_fc, ftol, abstol);
-    cmp_real(fp, "inputrec->orires_tau", -1, ir1->orires_tau, ir2->orires_tau, ftol, abstol);
-    cmp_int(fp, "inputrec->nstorireout", -1, ir1->nstorireout, ir2->nstorireout);
-    cmp_real(fp, "inputrec->em_stepsize", -1, ir1->em_stepsize, ir2->em_stepsize, ftol, abstol);
-    cmp_real(fp, "inputrec->em_tol", -1, ir1->em_tol, ir2->em_tol, ftol, abstol);
-    cmp_int(fp, "inputrec->niter", -1, ir1->niter, ir2->niter);
-    cmp_real(fp, "inputrec->fc_stepsize", -1, ir1->fc_stepsize, ir2->fc_stepsize, ftol, abstol);
-    cmp_int(fp, "inputrec->nstcgsteep", -1, ir1->nstcgsteep, ir2->nstcgsteep);
-    cmp_int(fp, "inputrec->nbfgscorr", 0, ir1->nbfgscorr, ir2->nbfgscorr);
-    cmp_int(fp, "inputrec->eConstrAlg", -1, ir1->eConstrAlg, ir2->eConstrAlg);
-    cmp_int(fp, "inputrec->nProjOrder", -1, ir1->nProjOrder, ir2->nProjOrder);
-    cmp_real(fp, "inputrec->LincsWarnAngle", -1, ir1->LincsWarnAngle, ir2->LincsWarnAngle, ftol, abstol);
-    cmp_int(fp, "inputrec->nLincsIter", -1, ir1->nLincsIter, ir2->nLincsIter);
-    cmp_real(fp, "inputrec->bd_fric", -1, ir1->bd_fric, ir2->bd_fric, ftol, abstol);
-    cmp_int64(fp, "inputrec->ld_seed", ir1->ld_seed, ir2->ld_seed);
-    cmp_real(fp, "inputrec->cos_accel", -1, ir1->cos_accel, ir2->cos_accel, ftol, abstol);
-    cmp_rvec(fp, "inputrec->deform(a)", -1, ir1->deform[XX], ir2->deform[XX], ftol, abstol);
-    cmp_rvec(fp, "inputrec->deform(b)", -1, ir1->deform[YY], ir2->deform[YY], ftol, abstol);
-    cmp_rvec(fp, "inputrec->deform(c)", -1, ir1->deform[ZZ], ir2->deform[ZZ], ftol, abstol);
-
-
-    cmp_int(fp, "inputrec->userint1", -1, ir1->userint1, ir2->userint1);
-    cmp_int(fp, "inputrec->userint2", -1, ir1->userint2, ir2->userint2);
-    cmp_int(fp, "inputrec->userint3", -1, ir1->userint3, ir2->userint3);
-    cmp_int(fp, "inputrec->userint4", -1, ir1->userint4, ir2->userint4);
-    cmp_real(fp, "inputrec->userreal1", -1, ir1->userreal1, ir2->userreal1, ftol, abstol);
-    cmp_real(fp, "inputrec->userreal2", -1, ir1->userreal2, ir2->userreal2, ftol, abstol);
-    cmp_real(fp, "inputrec->userreal3", -1, ir1->userreal3, ir2->userreal3, ftol, abstol);
-    cmp_real(fp, "inputrec->userreal4", -1, ir1->userreal4, ir2->userreal4, ftol, abstol);
-    cmp_grpopts(fp, &(ir1->opts), &(ir2->opts), ftol, abstol);
-    cmp_cosines(fp, "ex", ir1->ex, ir2->ex, ftol, abstol);
-    cmp_cosines(fp, "et", ir1->et, ir2->et, ftol, abstol);
-}
-
-static void comp_pull_AB(FILE *fp, pull_params_t *pull, real ftol, real abstol)
-{
-    int i;
-
-    for (i = 0; i < pull->ncoord; i++)
-    {
-        fprintf(fp, "comparing pull coord %d\n", i);
-        cmp_real(fp, "pull-coord->k", -1, pull->coord[i].k, pull->coord[i].kB, ftol, abstol);
-    }
-}
-
-static void comp_state(const t_state *st1, const t_state *st2,
-                       gmx_bool bRMSD, real ftol, real abstol)
-{
-    int i, j, nc;
-
-    fprintf(stdout, "comparing flags\n");
-    cmp_int(stdout, "flags", -1, st1->flags, st2->flags);
-    fprintf(stdout, "comparing box\n");
-    cmp_rvecs(stdout, "box", DIM, st1->box, st2->box, FALSE, ftol, abstol);
-    fprintf(stdout, "comparing box_rel\n");
-    cmp_rvecs(stdout, "box_rel", DIM, st1->box_rel, st2->box_rel, FALSE, ftol, abstol);
-    fprintf(stdout, "comparing boxv\n");
-    cmp_rvecs(stdout, "boxv", DIM, st1->boxv, st2->boxv, FALSE, ftol, abstol);
-    if (st1->flags & (1<<estSVIR_PREV))
-    {
-        fprintf(stdout, "comparing shake vir_prev\n");
-        cmp_rvecs(stdout, "svir_prev", DIM, st1->svir_prev, st2->svir_prev, FALSE, ftol, abstol);
-    }
-    if (st1->flags & (1<<estFVIR_PREV))
-    {
-        fprintf(stdout, "comparing force vir_prev\n");
-        cmp_rvecs(stdout, "fvir_prev", DIM, st1->fvir_prev, st2->fvir_prev, FALSE, ftol, abstol);
-    }
-    if (st1->flags & (1<<estPRES_PREV))
-    {
-        fprintf(stdout, "comparing prev_pres\n");
-        cmp_rvecs(stdout, "pres_prev", DIM, st1->pres_prev, st2->pres_prev, FALSE, ftol, abstol);
-    }
-    cmp_int(stdout, "ngtc", -1, st1->ngtc, st2->ngtc);
-    cmp_int(stdout, "nhchainlength", -1, st1->nhchainlength, st2->nhchainlength);
-    if (st1->ngtc == st2->ngtc && st1->nhchainlength == st2->nhchainlength)
-    {
-        for (i = 0; i < st1->ngtc; i++)
-        {
-            nc = i*st1->nhchainlength;
-            for (j = 0; j < nc; j++)
-            {
-                cmp_real(stdout, "nosehoover_xi",
-                         i, st1->nosehoover_xi[nc+j], st2->nosehoover_xi[nc+j], ftol, abstol);
-            }
-        }
-    }
-    cmp_int(stdout, "nnhpres", -1, st1->nnhpres, st2->nnhpres);
-    if (st1->nnhpres == st2->nnhpres && st1->nhchainlength == st2->nhchainlength)
-    {
-        for (i = 0; i < st1->nnhpres; i++)
-        {
-            nc = i*st1->nhchainlength;
-            for (j = 0; j < nc; j++)
-            {
-                cmp_real(stdout, "nosehoover_xi",
-                         i, st1->nhpres_xi[nc+j], st2->nhpres_xi[nc+j], ftol, abstol);
-            }
-        }
-    }
-
-    cmp_int(stdout, "natoms", -1, st1->natoms, st2->natoms);
-    if (st1->natoms == st2->natoms)
-    {
-        if ((st1->flags & (1<<estX)) && (st2->flags & (1<<estX)))
-        {
-            fprintf(stdout, "comparing x\n");
-            cmp_rvecs(stdout, "x", st1->natoms, st1->x, st2->x, bRMSD, ftol, abstol);
-        }
-        if ((st1->flags & (1<<estV)) && (st2->flags & (1<<estV)))
-        {
-            fprintf(stdout, "comparing v\n");
-            cmp_rvecs(stdout, "v", st1->natoms, st1->v, st2->v, bRMSD, ftol, abstol);
-        }
-    }
-}
-
-void comp_tpx(const char *fn1, const char *fn2,
-              gmx_bool bRMSD, real ftol, real abstol)
-{
-    const char  *ff[2];
-    t_inputrec   ir[2];
-    t_state      state[2];
-    gmx_mtop_t   mtop[2];
-    t_topology   top[2];
-    int          i;
-
-    ff[0] = fn1;
-    ff[1] = fn2;
-    for (i = 0; i < (fn2 ? 2 : 1); i++)
-    {
-        read_tpx_state(ff[i], &(ir[i]), &state[i], &(mtop[i]));
-    }
-    if (fn2)
-    {
-        cmp_inputrec(stdout, &ir[0], &ir[1], ftol, abstol);
-        /* Convert gmx_mtop_t to t_topology.
-         * We should implement direct mtop comparison,
-         * but it might be useful to keep t_topology comparison as an option.
-         */
-        top[0] = gmx_mtop_t_to_t_topology(&mtop[0]);
-        top[1] = gmx_mtop_t_to_t_topology(&mtop[1]);
-        cmp_top(stdout, &top[0], &top[1], ftol, abstol);
-        cmp_groups(stdout, &mtop[0].groups, &mtop[1].groups,
-                   mtop[0].natoms, mtop[1].natoms);
-        comp_state(&state[0], &state[1], bRMSD, ftol, abstol);
-    }
-    else
-    {
-        if (ir[0].efep == efepNO)
-        {
-            fprintf(stdout, "inputrec->efep = %s\n", efep_names[ir[0].efep]);
-        }
-        else
-        {
-            if (ir[0].bPull)
-            {
-                comp_pull_AB(stdout, ir->pull, ftol, abstol);
-            }
-            /* Convert gmx_mtop_t to t_topology.
-             * We should implement direct mtop comparison,
-             * but it might be useful to keep t_topology comparison as an option.
-             */
-            top[0] = gmx_mtop_t_to_t_topology(&mtop[0]);
-            cmp_top(stdout, &top[0], NULL, ftol, abstol);
-        }
-    }
-}
-
-void comp_frame(FILE *fp, t_trxframe *fr1, t_trxframe *fr2,
-                gmx_bool bRMSD, real ftol, real abstol)
-{
-    fprintf(fp, "\n");
-    cmp_int(fp, "not_ok", -1, fr1->not_ok, fr2->not_ok);
-    cmp_int(fp, "natoms", -1, fr1->natoms, fr2->natoms);
-    if (cmp_bool(fp, "bTitle", -1, fr1->bTitle, fr2->bTitle))
-    {
-        cmp_str(fp, "title", -1, fr1->title, fr2->title);
-    }
-    if (cmp_bool(fp, "bStep", -1, fr1->bStep, fr2->bStep))
-    {
-        cmp_int(fp, "step", -1, fr1->step, fr2->step);
-    }
-    cmp_int(fp, "step", -1, fr1->step, fr2->step);
-    if (cmp_bool(fp, "bTime", -1, fr1->bTime, fr2->bTime))
-    {
-        cmp_real(fp, "time", -1, fr1->time, fr2->time, ftol, abstol);
-    }
-    if (cmp_bool(fp, "bLambda", -1, fr1->bLambda, fr2->bLambda))
-    {
-        cmp_real(fp, "lambda", -1, fr1->lambda, fr2->lambda, ftol, abstol);
-    }
-    if (cmp_bool(fp, "bAtoms", -1, fr1->bAtoms, fr2->bAtoms))
-    {
-        cmp_atoms(fp, fr1->atoms, fr2->atoms, ftol, abstol);
-    }
-    if (cmp_bool(fp, "bPrec", -1, fr1->bPrec, fr2->bPrec))
-    {
-        cmp_real(fp, "prec", -1, fr1->prec, fr2->prec, ftol, abstol);
-    }
-    if (cmp_bool(fp, "bX", -1, fr1->bX, fr2->bX))
-    {
-        cmp_rvecs(fp, "x", std::min(fr1->natoms, fr2->natoms), fr1->x, fr2->x, bRMSD, ftol, abstol);
-    }
-    if (cmp_bool(fp, "bV", -1, fr1->bV, fr2->bV))
-    {
-        cmp_rvecs(fp, "v", std::min(fr1->natoms, fr2->natoms), fr1->v, fr2->v, bRMSD, ftol, abstol);
-    }
-    if (cmp_bool(fp, "bF", -1, fr1->bF, fr2->bF))
-    {
-        cmp_rvecs(fp, "f", std::min(fr1->natoms, fr2->natoms), fr1->f, fr2->f, bRMSD, ftol, abstol);
-    }
-    if (cmp_bool(fp, "bBox", -1, fr1->bBox, fr2->bBox))
-    {
-        cmp_rvecs(fp, "box", 3, fr1->box, fr2->box, FALSE, ftol, abstol);
-    }
-}
-
-void comp_trx(const gmx_output_env_t *oenv, const char *fn1, const char *fn2,
-              gmx_bool bRMSD, real ftol, real abstol)
-{
-    int          i;
-    const char  *fn[2];
-    t_trxframe   fr[2];
-    t_trxstatus *status[2];
-    gmx_bool     b[2];
-
-    fn[0] = fn1;
-    fn[1] = fn2;
-    fprintf(stderr, "Comparing trajectory files %s and %s\n", fn1, fn2);
-    for (i = 0; i < 2; i++)
-    {
-        b[i] = read_first_frame(oenv, &status[i], fn[i], &fr[i], TRX_READ_X|TRX_READ_V|TRX_READ_F);
-    }
-
-    if (b[0] && b[1])
-    {
-        do
-        {
-            comp_frame(stdout, &(fr[0]), &(fr[1]), bRMSD, ftol, abstol);
-
-            for (i = 0; i < 2; i++)
-            {
-                b[i] = read_next_frame(oenv, status[i], &fr[i]);
-            }
-        }
-        while (b[0] && b[1]);
-
-        for (i = 0; i < 2; i++)
-        {
-            if (b[i] && !b[1-i])
-            {
-                fprintf(stdout, "\nEnd of file on %s but not on %s\n", fn[1-i], fn[i]);
-            }
-            close_trj(status[i]);
-        }
-    }
-    if (!b[0] && !b[1])
-    {
-        fprintf(stdout, "\nBoth files read correctly\n");
-    }
-}
-
-static real ener_tensor_diag(int n, int *ind1, int *ind2,
-                             gmx_enxnm_t *enm1,
-                             int *tensi, int i,
-                             t_energy e1[], t_energy e2[])
-{
-    int    d1, d2;
-    int    j;
-    real   prod1, prod2;
-    int    nfound;
-    size_t len;
-
-    d1 = tensi[i]/DIM;
-    d2 = tensi[i] - d1*DIM;
-
-    /* Find the diagonal elements d1 and d2 */
-    len    = std::strlen(enm1[ind1[i]].name);
-    prod1  = 1;
-    prod2  = 1;
-    nfound = 0;
-    for (j = 0; j < n; j++)
-    {
-        if (tensi[j] >= 0 &&
-            std::strlen(enm1[ind1[j]].name) == len &&
-            std::strncmp(enm1[ind1[i]].name, enm1[ind1[j]].name, len-2) == 0 &&
-            (tensi[j] == d1*DIM+d1 || tensi[j] == d2*DIM+d2))
-        {
-            prod1 *= fabs(e1[ind1[j]].e);
-            prod2 *= fabs(e2[ind2[j]].e);
-            nfound++;
-        }
-    }
-
-    if (nfound == 2)
-    {
-        return 0.5*(std::sqrt(prod1) + std::sqrt(prod2));
-    }
-    else
-    {
-        return 0;
-    }
-}
-
-static gmx_bool enernm_equal(const char *nm1, const char *nm2)
-{
-    int len1, len2;
-
-    len1 = std::strlen(nm1);
-    len2 = std::strlen(nm2);
-
-    /* Remove " (bar)" at the end of a name */
-    if (len1 > 6 && std::strcmp(nm1+len1-6, " (bar)") == 0)
-    {
-        len1 -= 6;
-    }
-    if (len2 > 6 && std::strcmp(nm2+len2-6, " (bar)") == 0)
-    {
-        len2 -= 6;
-    }
-
-    return (len1 == len2 && gmx_strncasecmp(nm1, nm2, len1) == 0);
-}
-
-static void cmp_energies(FILE *fp, int step1, int step2,
-                         t_energy e1[], t_energy e2[],
-                         gmx_enxnm_t *enm1,
-                         real ftol, real abstol,
-                         int nre, int *ind1, int *ind2, int maxener)
-{
-    int   i, ii;
-    int  *tensi, len, d1, d2;
-    real  ftol_i, abstol_i;
-
-    snew(tensi, maxener);
-    /* Check for tensor elements ending on "-XX", "-XY", ... , "-ZZ" */
-    for (i = 0; (i < maxener); i++)
-    {
-        ii       = ind1[i];
-        tensi[i] = -1;
-        len      = std::strlen(enm1[ii].name);
-        if (len > 3 && enm1[ii].name[len-3] == '-')
-        {
-            d1 = enm1[ii].name[len-2] - 'X';
-            d2 = enm1[ii].name[len-1] - 'X';
-            if (d1 >= 0 && d1 < DIM &&
-                d2 >= 0 && d2 < DIM)
-            {
-                tensi[i] = d1*DIM + d2;
-            }
-        }
-    }
-
-    for (i = 0; (i < maxener); i++)
-    {
-        /* Check if this is an off-diagonal tensor element */
-        if (tensi[i] >= 0 && tensi[i] != 0 && tensi[i] != 4 && tensi[i] != 8)
-        {
-            /* Turn on the relative tolerance check (4 is maximum relative diff.) */
-            ftol_i = 5;
-            /* Do the relative tolerance through an absolute tolerance times
-             * the size of diagonal components of the tensor.
-             */
-            abstol_i = ftol*ener_tensor_diag(nre, ind1, ind2, enm1, tensi, i, e1, e2);
-            if (debug)
-            {
-                fprintf(debug, "tensor '%s' val %f diag %f\n",
-                        enm1[i].name, e1[i].e, abstol_i/ftol);
-            }
-            if (abstol_i > 0)
-            {
-                /* We found a diagonal, we need to check with the minimum tolerance */
-                abstol_i = std::min(abstol_i, abstol);
-            }
-            else
-            {
-                /* We did not find a diagonal, ignore the relative tolerance check */
-                abstol_i = abstol;
-            }
-        }
-        else
-        {
-            ftol_i   = ftol;
-            abstol_i = abstol;
-        }
-        if (!equal_real(e1[ind1[i]].e, e2[ind2[i]].e, ftol_i, abstol_i))
-        {
-            fprintf(fp, "%-15s  step %3d:  %12g,  step %3d: %12g\n",
-                    enm1[ind1[i]].name,
-                    step1, e1[ind1[i]].e,
-                    step2, e2[ind2[i]].e);
-        }
-    }
-
-    sfree(tensi);
-}
-
-#if 0
-static void cmp_disres(t_enxframe *fr1, t_enxframe *fr2, real ftol, real abstol)
-{
-    int  i;
-    char bav[64], bt[64], bs[22];
-
-    cmp_int(stdout, "ndisre", -1, fr1->ndisre, fr2->ndisre);
-    if ((fr1->ndisre == fr2->ndisre) && (fr1->ndisre > 0))
-    {
-        sprintf(bav, "step %s: disre rav", gmx_step_str(fr1->step, bs));
-        sprintf(bt, "step %s: disre  rt", gmx_step_str(fr1->step, bs));
-        for (i = 0; (i < fr1->ndisre); i++)
-        {
-            cmp_real(stdout, bav, i, fr1->disre_rm3tav[i], fr2->disre_rm3tav[i], ftol, abstol);
-            cmp_real(stdout, bt, i, fr1->disre_rt[i], fr2->disre_rt[i], ftol, abstol);
-        }
-    }
-}
-#endif
-
-static void cmp_eblocks(t_enxframe *fr1, t_enxframe *fr2, real ftol, real abstol)
-{
-    int  i, j, k;
-    char buf[64], bs[22];
-
-    cmp_int(stdout, "nblock", -1, fr1->nblock, fr2->nblock);
-    if ((fr1->nblock == fr2->nblock) && (fr1->nblock > 0))
-    {
-        for (j = 0; (j < fr1->nblock); j++)
-        {
-            t_enxblock *b1, *b2; /* convenience vars */
-
-            b1 = &(fr1->block[j]);
-            b2 = &(fr2->block[j]);
-
-            sprintf(buf, "step %s: block[%d]", gmx_step_str(fr1->step, bs), j);
-            cmp_int(stdout, buf, -1, b1->nsub, b2->nsub);
-            cmp_int(stdout, buf, -1, b1->id, b2->id);
-
-            if ( (b1->nsub == b2->nsub) && (b1->id == b2->id) )
-            {
-                for (i = 0; i < b1->nsub; i++)
-                {
-                    t_enxsubblock *s1, *s2;
-
-                    s1 = &(b1->sub[i]);
-                    s2 = &(b2->sub[i]);
-
-                    cmp_int(stdout, buf, -1, (int)s1->type, (int)s2->type);
-                    cmp_int64(stdout, buf, s1->nr, s2->nr);
-
-                    if ((s1->type == s2->type) && (s1->nr == s2->nr))
-                    {
-                        switch (s1->type)
-                        {
-                            case xdr_datatype_float:
-                                for (k = 0; k < s1->nr; k++)
-                                {
-                                    cmp_float(stdout, buf, i,
-                                              s1->fval[k], s2->fval[k],
-                                              ftol, abstol);
-                                }
-                                break;
-                            case xdr_datatype_double:
-                                for (k = 0; k < s1->nr; k++)
-                                {
-                                    cmp_double(stdout, buf, i,
-                                               s1->dval[k], s2->dval[k],
-                                               ftol, abstol);
-                                }
-                                break;
-                            case xdr_datatype_int:
-                                for (k = 0; k < s1->nr; k++)
-                                {
-                                    cmp_int(stdout, buf, i,
-                                            s1->ival[k], s2->ival[k]);
-                                }
-                                break;
-                            case xdr_datatype_int64:
-                                for (k = 0; k < s1->nr; k++)
-                                {
-                                    cmp_int64(stdout, buf,
-                                              s1->lval[k], s2->lval[k]);
-                                }
-                                break;
-                            case xdr_datatype_char:
-                                for (k = 0; k < s1->nr; k++)
-                                {
-                                    cmp_uc(stdout, buf, i,
-                                           s1->cval[k], s2->cval[k]);
-                                }
-                                break;
-                            case xdr_datatype_string:
-                                for (k = 0; k < s1->nr; k++)
-                                {
-                                    cmp_str(stdout, buf, i,
-                                            s1->sval[k], s2->sval[k]);
-                                }
-                                break;
-                            default:
-                                gmx_incons("Unknown data type!!");
-                        }
-                    }
-                }
-            }
-        }
-    }
-}
-
-void comp_enx(const char *fn1, const char *fn2, real ftol, real abstol, const char *lastener)
-{
-    int            nre, nre1, nre2;
-    ener_file_t    in1, in2;
-    int            i, j, maxener, *ind1, *ind2, *have;
-    gmx_enxnm_t   *enm1 = NULL, *enm2 = NULL;
-    t_enxframe    *fr1, *fr2;
-    gmx_bool       b1, b2;
-
-    fprintf(stdout, "comparing energy file %s and %s\n\n", fn1, fn2);
-
-    in1 = open_enx(fn1, "r");
-    in2 = open_enx(fn2, "r");
-    do_enxnms(in1, &nre1, &enm1);
-    do_enxnms(in2, &nre2, &enm2);
-    if (nre1 != nre2)
-    {
-        fprintf(stdout, "There are %d and %d terms in the energy files\n\n",
-                nre1, nre2);
-    }
-    else
-    {
-        fprintf(stdout, "There are %d terms in the energy files\n\n", nre1);
-    }
-
-    snew(ind1, nre1);
-    snew(ind2, nre2);
-    snew(have, nre2);
-    nre = 0;
-    for (i = 0; i < nre1; i++)
-    {
-        for (j = 0; j < nre2; j++)
-        {
-            if (enernm_equal(enm1[i].name, enm2[j].name))
-            {
-                ind1[nre] = i;
-                ind2[nre] = j;
-                have[j]   = 1;
-                nre++;
-                break;
-            }
-        }
-        if (nre == 0 || ind1[nre-1] != i)
-        {
-            cmp_str(stdout, "enm", i, enm1[i].name, "-");
-        }
-    }
-    for (i = 0; i < nre2; i++)
-    {
-        if (have[i] == 0)
-        {
-            cmp_str(stdout, "enm", i, "-", enm2[i].name);
-        }
-    }
-
-    maxener = nre;
-    for (i = 0; i < nre; i++)
-    {
-        if ((lastener != NULL) && (std::strstr(enm1[i].name, lastener) != NULL))
-        {
-            maxener = i+1;
-            break;
-        }
-    }
-
-    fprintf(stdout, "There are %d terms to compare in the energy files\n\n",
-            maxener);
-
-    for (i = 0; i < maxener; i++)
-    {
-        cmp_str(stdout, "unit", i, enm1[ind1[i]].unit, enm2[ind2[i]].unit);
-    }
-
-    snew(fr1, 1);
-    snew(fr2, 1);
-    do
-    {
-        b1 = do_enx(in1, fr1);
-        b2 = do_enx(in2, fr2);
-        if (b1 && !b2)
-        {
-            fprintf(stdout, "\nEnd of file on %s but not on %s\n", fn2, fn1);
-        }
-        else if (!b1 && b2)
-        {
-            fprintf(stdout, "\nEnd of file on %s but not on %s\n", fn1, fn2);
-        }
-        else if (!b1 && !b2)
-        {
-            fprintf(stdout, "\nFiles read successfully\n");
-        }
-        else
-        {
-            cmp_real(stdout, "t", -1, fr1->t, fr2->t, ftol, abstol);
-            cmp_int(stdout, "step", -1, fr1->step, fr2->step);
-            /* We don't want to print the nre mismatch for every frame */
-            /* cmp_int(stdout,"nre",-1,fr1->nre,fr2->nre); */
-            if ((fr1->nre >= nre) && (fr2->nre >= nre))
-            {
-                cmp_energies(stdout, fr1->step, fr1->step, fr1->ener, fr2->ener,
-                             enm1, ftol, abstol, nre, ind1, ind2, maxener);
-            }
-            /*cmp_disres(fr1,fr2,ftol,abstol);*/
-            cmp_eblocks(fr1, fr2, ftol, abstol);
-        }
-    }
-    while (b1 && b2);
-
-    close_enx(in1);
-    close_enx(in2);
-
-    free_enxframe(fr2);
-    sfree(fr2);
-    free_enxframe(fr1);
-    sfree(fr1);
-}
index 5234d5d1d9262f88ba5cff7cfb147980691d700a..a2b32eb56ae762a2a8dbbf0c18832504248b16b9 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,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.
@@ -36,6 +36,8 @@
  */
 #include "gmxpre.h"
 
+#include "convert_tpr.h"
+
 #include <cmath>
 
 #include "gromacs/commandline/pargs.h"
@@ -43,7 +45,6 @@
 #include "gromacs/fileio/enxio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trrio.h"
-#include "gromacs/gmxpreprocess/readir.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
@@ -266,7 +267,7 @@ static void reduce_topology_x(int gnx, int index[],
     int         *invindex;
     int          i;
 
-    top      = gmx_mtop_t_to_t_topology(mtop);
+    top      = gmx_mtop_t_to_t_topology(mtop, false);
     bKeep    = bKeepIt(gnx, top.atoms.nr, index);
     invindex = invind(gnx, top.atoms.nr, index);
 
@@ -327,67 +328,46 @@ static void zeroq(int index[], gmx_mtop_t *mtop)
 int gmx_convert_tpr(int argc, char *argv[])
 {
     const char       *desc[] = {
-        "[THISMODULE] can edit run input files in four ways.[PAR]",
+        "[THISMODULE] can edit run input files in three ways.[PAR]",
         "[BB]1.[bb] by modifying the number of steps in a run input file",
         "with options [TT]-extend[tt], [TT]-until[tt] or [TT]-nsteps[tt]",
         "(nsteps=-1 means unlimited number of steps)[PAR]",
-        "[BB]2.[bb] (OBSOLETE) by creating a run input file",
-        "for a continuation run when your simulation has crashed due to e.g.",
-        "a full disk, or by making a continuation run input file.",
-        "This option is obsolete, since mdrun now writes and reads",
-        "checkpoint files.",
-        "[BB]Note[bb] that a frame with coordinates and velocities is needed.",
-        "When pressure and/or Nose-Hoover temperature coupling is used",
-        "an energy file can be supplied to get an exact continuation",
-        "of the original run.[PAR]",
-        "[BB]3.[bb] by creating a [REF].tpx[ref] file for a subset of your original",
+        "[BB]2.[bb] by creating a [REF].tpx[ref] file for a subset of your original",
         "tpx file, which is useful when you want to remove the solvent from",
         "your [REF].tpx[ref] file, or when you want to make e.g. a pure C[GRK]alpha[grk] [REF].tpx[ref] file.",
         "Note that you may need to use [TT]-nsteps -1[tt] (or similar) to get",
         "this to work.",
         "[BB]WARNING: this [REF].tpx[ref] file is not fully functional[bb].[PAR]",
-        "[BB]4.[bb] by setting the charges of a specified group",
+        "[BB]3.[bb] by setting the charges of a specified group",
         "to zero. This is useful when doing free energy estimates",
         "using the LIE (Linear Interaction Energy) method."
     };
 
-    const char       *top_fn, *frame_fn;
-    struct t_fileio  *fp;
-    ener_file_t       fp_ener = NULL;
-    gmx_trr_header_t  head;
+    const char       *top_fn;
     int               i;
-    gmx_int64_t       nsteps_req, run_step, frame;
+    gmx_int64_t       nsteps_req, run_step;
     double            run_t, state_t;
-    gmx_bool          bOK, bNsteps, bExtend, bUntil, bTime, bTraj;
-    gmx_bool          bFrame, bUse, bSel, bNeedEner, bReadEner, bScanEner, bFepState;
+    gmx_bool          bSel;
+    gmx_bool          bNsteps, bExtend, bUntil;
     gmx_mtop_t        mtop;
     t_atoms           atoms;
-    t_inputrec       *ir;
     t_state           state;
-    rvec             *newx = NULL, *newv = NULL, *tmpx, *tmpv;
-    matrix            newbox;
     int               gnx;
     char             *grpname;
-    int              *index = NULL;
-    int               nre;
-    gmx_enxnm_t      *enm     = NULL;
-    t_enxframe       *fr_ener = NULL;
+    int              *index = nullptr;
     char              buf[200], buf2[200];
     gmx_output_env_t *oenv;
     t_filenm          fnm[] = {
-        { efTPR, NULL,  NULL,    ffREAD  },
-        { efTRN, "-f",  NULL,    ffOPTRD },
-        { efEDR, "-e",  NULL,    ffOPTRD },
-        { efNDX, NULL,  NULL,    ffOPTRD },
+        { efTPR, nullptr,  nullptr,    ffREAD  },
+        { efNDX, nullptr,  nullptr,    ffOPTRD },
         { efTPR, "-o",  "tprout", ffWRITE }
     };
 #define NFILE asize(fnm)
 
     /* Command line options */
     static int      nsteps_req_int = 0;
-    static real     start_t        = -1.0, extend_t = 0.0, until_t = 0.0;
-    static int      init_fep_state = 0;
-    static gmx_bool bContinuation  = TRUE, bZeroQ = FALSE, bVel = TRUE;
+    static real     extend_t       = 0.0, until_t = 0.0;
+    static gmx_bool bZeroQ         = FALSE;
     static t_pargs  pa[]           = {
         { "-extend",        FALSE, etREAL, {&extend_t},
           "Extend runtime by this amount (ps)" },
@@ -395,21 +375,13 @@ int gmx_convert_tpr(int argc, char *argv[])
           "Extend runtime until this ending time (ps)" },
         { "-nsteps",        FALSE, etINT,  {&nsteps_req_int},
           "Change the number of steps" },
-        { "-time",          FALSE, etREAL, {&start_t},
-          "Continue from frame at this time (ps) instead of the last frame" },
         { "-zeroq",         FALSE, etBOOL, {&bZeroQ},
-          "Set the charges of a group (from the index) to zero" },
-        { "-vel",           FALSE, etBOOL, {&bVel},
-          "Require velocities from trajectory" },
-        { "-cont",          FALSE, etBOOL, {&bContinuation},
-          "For exact continuation, the constraints should not be applied before the first step" },
-        { "-init_fep_state", FALSE, etINT, {&init_fep_state},
-          "fep state to initialize from" },
+          "Set the charges of a group (from the index) to zero" }
     };
 
     /* Parse the command line */
     if (!parse_common_args(&argc, argv, 0, NFILE, fnm, asize(pa), pa,
-                           asize(desc), desc, 0, NULL, &oenv))
+                           asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -419,195 +391,16 @@ int gmx_convert_tpr(int argc, char *argv[])
     bNsteps    = opt2parg_bSet("-nsteps", asize(pa), pa);
     bExtend    = opt2parg_bSet("-extend", asize(pa), pa);
     bUntil     = opt2parg_bSet("-until", asize(pa), pa);
-    bFepState  = opt2parg_bSet("-init_fep_state", asize(pa), pa);
-    bTime      = opt2parg_bSet("-time", asize(pa), pa);
-    bTraj      = (opt2bSet("-f", NFILE, fnm) || bTime);
 
     top_fn = ftp2fn(efTPR, NFILE, fnm);
     fprintf(stderr, "Reading toplogy and stuff from %s\n", top_fn);
 
-    snew(ir, 1);
+    t_inputrec  irInstance;
+    t_inputrec *ir = &irInstance;
     read_tpx_state(top_fn, ir, &state, &mtop);
     run_step = ir->init_step;
     run_t    = ir->init_step*ir->delta_t + ir->init_t;
 
-    if (!EI_STATE_VELOCITY(ir->eI))
-    {
-        bVel = FALSE;
-    }
-
-    if (bTraj)
-    {
-        fprintf(stderr, "\n"
-                "NOTE: Reading the state from trajectory is an obsolete feature of gmx convert-tpr.\n"
-                "      Continuation should be done by loading a checkpoint file with mdrun -cpi\n"
-                "      This guarantees that all state variables are transferred.\n"
-                "      gmx convert-tpr is now only useful for increasing nsteps,\n"
-                "      but even that can often be avoided by using mdrun -maxh\n"
-                "\n");
-
-        if (ir->bContinuation != bContinuation)
-        {
-            fprintf(stderr, "Modifying ir->bContinuation to %s\n",
-                    gmx::boolToString(bContinuation));
-        }
-        ir->bContinuation = bContinuation;
-
-
-        bNeedEner = (ir->epc == epcPARRINELLORAHMAN || ir->etc == etcNOSEHOOVER);
-        bReadEner = (bNeedEner && ftp2bSet(efEDR, NFILE, fnm));
-        bScanEner = (bReadEner && !bTime);
-
-        if (ir->epc != epcNO || EI_SD(ir->eI) || ir->eI == eiBD)
-        {
-            fprintf(stderr, "NOTE: The simulation uses pressure coupling and/or stochastic dynamics.\n"
-                    "gmx convert-tpr can not provide binary identical continuation.\n"
-                    "If you want that, supply a checkpoint file to mdrun\n\n");
-        }
-
-        if (EI_SD(ir->eI) || ir->eI == eiBD)
-        {
-            fprintf(stderr, "\nChanging ld-seed from %" GMX_PRId64 " ", ir->ld_seed);
-            ir->ld_seed = static_cast<int>(gmx::makeRandomSeed());
-            fprintf(stderr, "to %" GMX_PRId64 "\n\n", ir->ld_seed);
-        }
-
-        frame_fn = ftp2fn(efTRN, NFILE, fnm);
-
-        if (fn2ftp(frame_fn) == efCPT)
-        {
-            int sim_part;
-
-            fprintf(stderr,
-                    "\nREADING STATE FROM CHECKPOINT %s...\n\n",
-                    frame_fn);
-
-            read_checkpoint_state(frame_fn, &sim_part,
-                                  &run_step, &run_t, &state);
-        }
-        else
-        {
-            fprintf(stderr,
-                    "\nREADING COORDS, VELS AND BOX FROM TRAJECTORY %s...\n\n",
-                    frame_fn);
-
-            fp = gmx_trr_open(frame_fn, "r");
-            if (bScanEner)
-            {
-                fp_ener = open_enx(ftp2fn(efEDR, NFILE, fnm), "r");
-                do_enxnms(fp_ener, &nre, &enm);
-                snew(fr_ener, 1);
-                fr_ener->t = -1e-12;
-            }
-
-            /* Now scan until the last set of x and v (step == 0)
-             * or the ones at step step.
-             */
-            bFrame = TRUE;
-            frame  = 0;
-            while (bFrame)
-            {
-                bFrame = gmx_trr_read_frame_header(fp, &head, &bOK);
-                if (bOK && frame == 0)
-                {
-                    if (mtop.natoms != head.natoms)
-                    {
-                        gmx_fatal(FARGS, "Number of atoms in Topology (%d) "
-                                  "is not the same as in Trajectory (%d)\n",
-                                  mtop.natoms, head.natoms);
-                    }
-                    snew(newx, head.natoms);
-                    snew(newv, head.natoms);
-                }
-                bFrame = bFrame && bOK;
-                if (bFrame)
-                {
-                    bOK = gmx_trr_read_frame_data(fp, &head, newbox, newx, newv, NULL);
-                }
-                bFrame = bFrame && bOK;
-                bUse   = FALSE;
-                if (bFrame &&
-                    (head.x_size) && (head.v_size || !bVel))
-                {
-                    bUse = TRUE;
-                    if (bScanEner)
-                    {
-                        /* Read until the energy time is >= the trajectory time */
-                        while (fr_ener->t < head.t && do_enx(fp_ener, fr_ener))
-                        {
-                            ;
-                        }
-                        bUse = (fr_ener->t == head.t);
-                    }
-                    if (bUse)
-                    {
-                        tmpx                  = newx;
-                        newx                  = state.x;
-                        state.x               = tmpx;
-                        tmpv                  = newv;
-                        newv                  = state.v;
-                        state.v               = tmpv;
-                        run_t                 = head.t;
-                        run_step              = head.step;
-                        state.fep_state       = head.fep_state;
-                        state.lambda[efptFEP] = head.lambda;
-                        copy_mat(newbox, state.box);
-                    }
-                }
-                if (bFrame || !bOK)
-                {
-                    sprintf(buf, "\r%s %s frame %s%s: step %s%s time %s",
-                            "%s", "%s", "%6", GMX_PRId64, "%6", GMX_PRId64, " %8.3f");
-                    fprintf(stderr, buf,
-                            bUse ? "Read   " : "Skipped", ftp2ext(fn2ftp(frame_fn)),
-                            frame, head.step, head.t);
-                    fflush(stderr);
-                    frame++;
-                    if (bTime && (head.t >= start_t))
-                    {
-                        bFrame = FALSE;
-                    }
-                }
-            }
-            if (bScanEner)
-            {
-                close_enx(fp_ener);
-                free_enxframe(fr_ener);
-                free_enxnms(nre, enm);
-            }
-            gmx_trr_close(fp);
-            fprintf(stderr, "\n");
-
-            if (!bOK)
-            {
-                fprintf(stderr, "%s frame %s (step %s, time %g) is incomplete\n",
-                        ftp2ext(fn2ftp(frame_fn)), gmx_step_str(frame-1, buf2),
-                        gmx_step_str(head.step, buf), head.t);
-            }
-            fprintf(stderr, "\nUsing frame of step %s time %g\n",
-                    gmx_step_str(run_step, buf), run_t);
-
-            if (bNeedEner)
-            {
-                if (bReadEner)
-                {
-                    get_enx_state(ftp2fn(efEDR, NFILE, fnm), run_t, &mtop.groups, ir, &state);
-                }
-                else
-                {
-                    fprintf(stderr, "\nWARNING: The simulation uses %s temperature and/or %s pressure coupling,\n"
-                            "         the continuation will only be exact when an energy file is supplied\n\n",
-                            ETCOUPLTYPE(etcNOSEHOOVER),
-                            EPCOUPLTYPE(epcPARRINELLORAHMAN));
-                }
-            }
-            if (bFepState)
-            {
-                ir->fepvals->init_fep_state = init_fep_state;
-            }
-        }
-    }
-
     if (bNsteps)
     {
         fprintf(stderr, "Setting nsteps to %s\n", gmx_step_str(nsteps_req, buf));
@@ -646,7 +439,7 @@ int gmx_convert_tpr(int argc, char *argv[])
         ir->init_step = run_step;
 
         if (ftp2bSet(efNDX, NFILE, fnm) ||
-            !(bNsteps || bExtend || bUntil || bTraj))
+            !(bNsteps || bExtend || bUntil))
         {
             atoms = gmx_mtop_global_atoms(&mtop);
             get_index(&atoms, ftp2fn_null(efNDX, NFILE, fnm), 1,
@@ -667,7 +460,7 @@ int gmx_convert_tpr(int argc, char *argv[])
             {
                 fprintf(stderr, "Will write subset %s of original tpx containing %d "
                         "atoms\n", grpname, gnx);
-                reduce_topology_x(gnx, index, &mtop, state.x, state.v);
+                reduce_topology_x(gnx, index, &mtop, as_rvec_array(state.x.data()), as_rvec_array(state.v.data()));
                 state.natoms = gnx;
             }
             else if (bZeroQ)
index 9ddd8ec035d0cbc1151c6b14d1337caba69eecac..c085126b61edf3102a190b458eb3e44a953d2b90 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
@@ -36,6 +36,8 @@
  */
 #include "gmxpre.h"
 
+#include "dump.h"
+
 #include "config.h"
 
 #include <cassert>
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/mtxio.h"
 #include "gromacs/fileio/tngio.h"
-#include "gromacs/fileio/tngio_for_tools.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trrio.h"
 #include "gromacs/fileio/xtcio.h"
 #include "gromacs/gmxpreprocess/gmxcpp.h"
 #include "gromacs/linearalgebra/sparsematrix.h"
 #include "gromacs/math/vecdump.h"
+#include "gromacs/mdrunutility/mdmodules.h"
 #include "gromacs/mdtypes/forcerec.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/txtdump.h"
 
-static void list_tpx(const char *fn, gmx_bool bShowNumbers, const char *mdpfn,
-                     gmx_bool bSysTop)
+static void list_tpx(const char *fn,
+                     gmx_bool    bShowNumbers,
+                     gmx_bool    bShowParameters,
+                     const char *mdpfn,
+                     gmx_bool    bSysTop,
+                     gmx_bool    bOriginalInputrec)
 {
     FILE         *gp;
     int           indent, i, j, **gcount, atot;
     t_state       state;
-    t_inputrec    ir;
     t_tpxheader   tpx;
     gmx_mtop_t    mtop;
     gmx_groups_t *groups;
     t_topology    top;
 
     read_tpxheader(fn, &tpx, TRUE);
-
+    t_inputrec     ir;
     read_tpx_state(fn,
-                   tpx.bIr  ? &ir : NULL,
+                   tpx.bIr ? &ir : nullptr,
                    &state,
-                   tpx.bTop ? &mtop : NULL);
+                   tpx.bTop ? &mtop : nullptr);
+    if (tpx.bIr && !bOriginalInputrec)
+    {
+        gmx::MDModules().adjustInputrecBasedOnModules(&ir);
+    }
 
     if (mdpfn && tpx.bIr)
     {
         gp = gmx_fio_fopen(mdpfn, "w");
-        pr_inputrec(gp, 0, NULL, &(ir), TRUE);
+        pr_inputrec(gp, 0, nullptr, &ir, TRUE);
         gmx_fio_fclose(gp);
     }
 
@@ -100,38 +109,38 @@ static void list_tpx(const char *fn, gmx_bool bShowNumbers, const char *mdpfn,
     {
         if (bSysTop)
         {
-            top = gmx_mtop_t_to_t_topology(&mtop);
+            top = gmx_mtop_t_to_t_topology(&mtop, false);
         }
 
         if (available(stdout, &tpx, 0, fn))
         {
             indent = 0;
             pr_title(stdout, indent, fn);
-            pr_inputrec(stdout, 0, "inputrec", tpx.bIr ? &(ir) : NULL, FALSE);
+            pr_inputrec(stdout, 0, "inputrec", tpx.bIr ? &ir : nullptr, FALSE);
 
             pr_tpxheader(stdout, indent, "header", &(tpx));
 
             if (!bSysTop)
             {
-                pr_mtop(stdout, indent, "topology", &(mtop), bShowNumbers);
+                pr_mtop(stdout, indent, "topology", &(mtop), bShowNumbers, bShowParameters);
             }
             else
             {
-                pr_top(stdout, indent, "topology", &(top), bShowNumbers);
+                pr_top(stdout, indent, "topology", &(top), bShowNumbers, bShowParameters);
             }
 
-            pr_rvecs(stdout, indent, "box", tpx.bBox ? state.box : NULL, DIM);
-            pr_rvecs(stdout, indent, "box_rel", tpx.bBox ? state.box_rel : NULL, DIM);
-            pr_rvecs(stdout, indent, "boxv", tpx.bBox ? state.boxv : NULL, DIM);
-            pr_rvecs(stdout, indent, "pres_prev", tpx.bBox ? state.pres_prev : NULL, DIM);
-            pr_rvecs(stdout, indent, "svir_prev", tpx.bBox ? state.svir_prev : NULL, DIM);
-            pr_rvecs(stdout, indent, "fvir_prev", tpx.bBox ? state.fvir_prev : NULL, DIM);
+            pr_rvecs(stdout, indent, "box", tpx.bBox ? state.box : nullptr, DIM);
+            pr_rvecs(stdout, indent, "box_rel", tpx.bBox ? state.box_rel : nullptr, DIM);
+            pr_rvecs(stdout, indent, "boxv", tpx.bBox ? state.boxv : nullptr, DIM);
+            pr_rvecs(stdout, indent, "pres_prev", tpx.bBox ? state.pres_prev : nullptr, DIM);
+            pr_rvecs(stdout, indent, "svir_prev", tpx.bBox ? state.svir_prev : nullptr, DIM);
+            pr_rvecs(stdout, indent, "fvir_prev", tpx.bBox ? state.fvir_prev : nullptr, DIM);
             /* leave nosehoover_xi in for now to match the tpr version */
-            pr_doubles(stdout, indent, "nosehoover_xi", state.nosehoover_xi, state.ngtc);
+            pr_doubles(stdout, indent, "nosehoover_xi", state.nosehoover_xi.data(), state.ngtc);
             /*pr_doubles(stdout,indent,"nosehoover_vxi",state.nosehoover_vxi,state.ngtc);*/
             /*pr_doubles(stdout,indent,"therm_integral",state.therm_integral,state.ngtc);*/
-            pr_rvecs(stdout, indent, "x", tpx.bX ? state.x : NULL, state.natoms);
-            pr_rvecs(stdout, indent, "v", tpx.bV ? state.v : NULL, state.natoms);
+            pr_rvecs(stdout, indent, "x", tpx.bX ? as_rvec_array(state.x.data()) : nullptr, state.natoms);
+            pr_rvecs(stdout, indent, "v", tpx.bV ? as_rvec_array(state.v.data()) : nullptr, state.natoms);
         }
 
         groups = &mtop.groups;
@@ -164,7 +173,6 @@ static void list_tpx(const char *fn, gmx_bool bShowNumbers, const char *mdpfn,
         }
         sfree(gcount);
     }
-    done_state(&state);
 }
 
 static void list_top(const char *fn)
@@ -173,7 +181,7 @@ static void list_top(const char *fn)
 #define BUFLEN 256
     char      buf[BUFLEN];
     gmx_cpp_t handle;
-    char     *cppopts[] = { NULL };
+    char     *cppopts[] = { nullptr };
 
     status = cpp_open_file(fn, &handle, cppopts);
     if (status != 0)
@@ -223,10 +231,10 @@ static void list_trr(const char *fn)
         snew(v, trrheader.natoms);
         snew(f, trrheader.natoms);
         if (gmx_trr_read_frame_data(fpread, &trrheader,
-                                    trrheader.box_size ? box : NULL,
-                                    trrheader.x_size   ? x : NULL,
-                                    trrheader.v_size   ? v : NULL,
-                                    trrheader.f_size   ? f : NULL))
+                                    trrheader.box_size ? box : nullptr,
+                                    trrheader.x_size   ? x : nullptr,
+                                    trrheader.v_size   ? v : nullptr,
+                                    trrheader.f_size   ? f : nullptr))
         {
             sprintf(buf, "%s frame %d", fn, nframe);
             indent = 0;
@@ -270,7 +278,7 @@ static void list_trr(const char *fn)
     gmx_trr_close(fpread);
 }
 
-void list_xtc(const char *fn)
+static void list_xtc(const char *fn)
 {
     t_fileio   *xd;
     int         indent;
@@ -344,16 +352,16 @@ static void list_tng(const char gmx_unused *fn)
 #ifdef GMX_USE_TNG
     tng_trajectory_t     tng;
     gmx_int64_t          nframe = 0;
-    gmx_int64_t          i, *block_ids = NULL, step, ndatablocks;
+    gmx_int64_t          i, *block_ids = nullptr, step, ndatablocks;
     gmx_bool             bOK;
-    real                *values = NULL;
+    real                *values = nullptr;
 
     gmx_tng_open(fn, 'r', &tng);
     gmx_print_tng_molecule_system(tng, stdout);
 
     bOK    = gmx_get_tng_data_block_types_of_next_frame(tng, -1,
                                                         0,
-                                                        NULL,
+                                                        nullptr,
                                                         &step, &ndatablocks,
                                                         &block_ids);
     do
@@ -386,7 +394,7 @@ static void list_tng(const char gmx_unused *fn)
     }
     while (gmx_get_tng_data_block_types_of_next_frame(tng, step,
                                                       0,
-                                                      NULL,
+                                                      nullptr,
                                                       &step,
                                                       &ndatablocks,
                                                       &block_ids));
@@ -400,7 +408,7 @@ static void list_tng(const char gmx_unused *fn)
 #endif
 }
 
-void list_trx(const char *fn)
+static void list_trx(const char *fn)
 {
     switch (fn2ftp(fn))
     {
@@ -419,11 +427,11 @@ void list_trx(const char *fn)
     }
 }
 
-void list_ene(const char *fn)
+static void list_ene(const char *fn)
 {
     ener_file_t    in;
     gmx_bool       bCont;
-    gmx_enxnm_t   *enm = NULL;
+    gmx_enxnm_t   *enm = nullptr;
     t_enxframe    *fr;
     int            i, j, nre, b;
     char           buf[22];
@@ -551,12 +559,12 @@ void list_ene(const char *fn)
 static void list_mtx(const char *fn)
 {
     int                  nrow, ncol, i, j, k;
-    real                *full   = NULL, value;
-    gmx_sparsematrix_t * sparse = NULL;
+    real                *full   = nullptr, value;
+    gmx_sparsematrix_t * sparse = nullptr;
 
     gmx_mtxio_read(fn, &nrow, &ncol, &full, &sparse);
 
-    if (full == NULL)
+    if (full == nullptr)
     {
         snew(full, nrow*ncol);
         for (i = 0; i < nrow*ncol; i++)
@@ -607,23 +615,27 @@ int gmx_dump(int argc, char *argv[])
         "Position restraint output from -sys -s is broken"
     };
     t_filenm    fnm[] = {
-        { efTPR, "-s", NULL, ffOPTRD },
-        { efTRX, "-f", NULL, ffOPTRD },
-        { efEDR, "-e", NULL, ffOPTRD },
-        { efCPT, NULL, NULL, ffOPTRD },
-        { efTOP, "-p", NULL, ffOPTRD },
+        { efTPR, "-s", nullptr, ffOPTRD },
+        { efTRX, "-f", nullptr, ffOPTRD },
+        { efEDR, "-e", nullptr, ffOPTRD },
+        { efCPT, nullptr, nullptr, ffOPTRD },
+        { efTOP, "-p", nullptr, ffOPTRD },
         { efMTX, "-mtx", "hessian", ffOPTRD },
-        { efMDP, "-om", NULL, ffOPTWR }
+        { efMDP, "-om", nullptr, ffOPTWR }
     };
 #define NFILE asize(fnm)
 
     gmx_output_env_t *oenv;
     /* Command line options */
-    static gmx_bool   bShowNumbers = TRUE;
-    static gmx_bool   bSysTop      = FALSE;
-    t_pargs           pa[]         = {
+    gmx_bool          bShowNumbers      = TRUE;
+    gmx_bool          bShowParams       = FALSE;
+    gmx_bool          bSysTop           = FALSE;
+    gmx_bool          bOriginalInputrec = FALSE;
+    t_pargs           pa[]              = {
         { "-nr", FALSE, etBOOL, {&bShowNumbers}, "Show index numbers in output (leaving them out makes comparison easier, but creates a useless topology)" },
-        { "-sys", FALSE, etBOOL, {&bSysTop}, "List the atoms and bonded interactions for the whole system instead of for each molecule type" }
+        { "-param", FALSE, etBOOL, {&bShowParams}, "Show parameters for each bonded interaction (for comparing dumps, it is useful to combine this with -nonr)" },
+        { "-sys", FALSE, etBOOL, {&bSysTop}, "List the atoms and bonded interactions for the whole system instead of for each molecule type" },
+        { "-orgir", FALSE, etBOOL, {&bOriginalInputrec}, "Show input parameters from tpr as they were written by the version that produced the file, instead of how the current version reads them" }
     };
 
     if (!parse_common_args(&argc, argv, 0, NFILE, fnm, asize(pa), pa,
@@ -635,8 +647,8 @@ int gmx_dump(int argc, char *argv[])
 
     if (ftp2bSet(efTPR, NFILE, fnm))
     {
-        list_tpx(ftp2fn(efTPR, NFILE, fnm), bShowNumbers,
-                 ftp2fn_null(efMDP, NFILE, fnm), bSysTop);
+        list_tpx(ftp2fn(efTPR, NFILE, fnm), bShowNumbers, bShowParams,
+                 ftp2fn_null(efMDP, NFILE, fnm), bSysTop, bOriginalInputrec);
     }
     else if (ftp2bSet(efTRX, NFILE, fnm))
     {
index 0fda312f0d82f6b8e27810ca688fdf3296276c16..693d7d8bb5776cd00f445236c52789762d98a7b1 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,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.
@@ -178,8 +178,8 @@ static void add_prop(aprop_t *ap, gmx_residuetype_t *restype,
             srenew(ap->bAvail, ap->maxprop);
             for (i = ap->nprop; (i < ap->maxprop); i++)
             {
-                ap->atomnm[i] = NULL;
-                ap->resnm[i]  = NULL;
+                ap->atomnm[i] = nullptr;
+                ap->resnm[i]  = nullptr;
                 ap->value[i]  = 0;
                 ap->bAvail[i] = FALSE;
             }
@@ -317,7 +317,7 @@ void gmx_atomprop_destroy(gmx_atomprop_t aps)
     gmx_atomprop *ap = (gmx_atomprop*) aps;
     int           p;
 
-    if (aps == NULL)
+    if (aps == nullptr)
     {
         printf("\nWARNING: gmx_atomprop_destroy called with a NULL pointer\n\n");
         return;
@@ -335,7 +335,7 @@ void gmx_atomprop_destroy(gmx_atomprop_t aps)
 
 static void vdw_warning(FILE *fp)
 {
-    if (NULL != fp)
+    if (nullptr != fp)
     {
         fprintf(fp, "NOTE: From version 5.0 %s uses the Van der Waals radii\n",
                 gmx::getProgramContext().displayName());
@@ -414,7 +414,7 @@ char *gmx_atomprop_element(gmx_atomprop_t aps, int atomnumber)
             return ap->prop[epropElement].atomnm[i];
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 int gmx_atomprop_atomnumber(gmx_atomprop_t aps, const char *elem)
index cc04615c90aa68ed1d6a7207be706889c496aaba..72b504596a6d25bfc85b6d14213ddc14817d03c2 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,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.
 
 #include <algorithm>
 
+#include "gromacs/topology/atomprop.h"
 #include "gromacs/topology/symtab.h"
+#include "gromacs/utility/compare.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/txtdump.h"
 
 const char *ptype_str[eptNR+1] = {
-    "Atom", "Nucleus", "Shell", "Bond", "VSite", NULL
+    "Atom", "Nucleus", "Shell", "Bond", "VSite", nullptr
 };
 
 void init_atom(t_atoms *at)
 {
-    at->nr        = 0;
-    at->nres      = 0;
-    at->atom      = NULL;
-    at->resinfo   = NULL;
-    at->atomname  = NULL;
-    at->atomtype  = NULL;
-    at->atomtypeB = NULL;
-    at->pdbinfo   = NULL;
+    at->nr          = 0;
+    at->nres        = 0;
+    at->atom        = nullptr;
+    at->resinfo     = nullptr;
+    at->atomname    = nullptr;
+    at->atomtype    = nullptr;
+    at->atomtypeB   = nullptr;
+    at->pdbinfo     = nullptr;
+    at->haveMass    = FALSE;
+    at->haveCharge  = FALSE;
+    at->haveType    = FALSE;
+    at->haveBState  = FALSE;
+    at->havePdbInfo = FALSE;
 }
 
 void init_atomtypes(t_atomtypes *at)
 {
     at->nr         = 0;
-    at->radius     = NULL;
-    at->vol        = NULL;
-    at->atomnumber = NULL;
-    at->gb_radius  = NULL;
-    at->S_hct      = NULL;
+    at->radius     = nullptr;
+    at->vol        = nullptr;
+    at->atomnumber = nullptr;
+    at->gb_radius  = nullptr;
+    at->S_hct      = nullptr;
 }
 
 void done_atom(t_atoms *at)
@@ -103,33 +111,33 @@ void add_t_atoms(t_atoms *atoms, int natom_extra, int nres_extra)
     {
         srenew(atoms->atomname, atoms->nr+natom_extra);
         srenew(atoms->atom, atoms->nr+natom_extra);
-        if (NULL != atoms->pdbinfo)
+        if (nullptr != atoms->pdbinfo)
         {
             srenew(atoms->pdbinfo, atoms->nr+natom_extra);
         }
-        if (NULL != atoms->atomtype)
+        if (nullptr != atoms->atomtype)
         {
             srenew(atoms->atomtype, atoms->nr+natom_extra);
         }
-        if (NULL != atoms->atomtypeB)
+        if (nullptr != atoms->atomtypeB)
         {
             srenew(atoms->atomtypeB, atoms->nr+natom_extra);
         }
         for (i = atoms->nr; (i < atoms->nr+natom_extra); i++)
         {
-            atoms->atomname[i] = NULL;
+            atoms->atomname[i] = nullptr;
             memset(&atoms->atom[i], 0, sizeof(atoms->atom[i]));
-            if (NULL != atoms->pdbinfo)
+            if (nullptr != atoms->pdbinfo)
             {
                 std::memset(&atoms->pdbinfo[i], 0, sizeof(atoms->pdbinfo[i]));
             }
-            if (NULL != atoms->atomtype)
+            if (nullptr != atoms->atomtype)
             {
-                atoms->atomtype[i] = NULL;
+                atoms->atomtype[i] = nullptr;
             }
-            if (NULL != atoms->atomtypeB)
+            if (nullptr != atoms->atomtypeB)
             {
-                atoms->atomtypeB[i] = NULL;
+                atoms->atomtypeB[i] = nullptr;
             }
         }
         atoms->nr += natom_extra;
@@ -150,17 +158,22 @@ void init_t_atoms(t_atoms *atoms, int natoms, gmx_bool bPdbinfo)
     atoms->nr   = natoms;
     atoms->nres = 0;
     snew(atoms->atomname, natoms);
-    atoms->atomtype  = NULL;
-    atoms->atomtypeB = NULL;
+    atoms->atomtype  = nullptr;
+    atoms->atomtypeB = nullptr;
     snew(atoms->resinfo, natoms);
     snew(atoms->atom, natoms);
-    if (bPdbinfo)
+    atoms->haveMass    = FALSE;
+    atoms->haveCharge  = FALSE;
+    atoms->haveType    = FALSE;
+    atoms->haveBState  = FALSE;
+    atoms->havePdbInfo = bPdbinfo;
+    if (atoms->havePdbInfo)
     {
         snew(atoms->pdbinfo, natoms);
     }
     else
     {
-        atoms->pdbinfo = NULL;
+        atoms->pdbinfo = nullptr;
     }
 }
 
@@ -182,36 +195,36 @@ t_atoms *copy_t_atoms(const t_atoms *src)
     int      i;
 
     snew(dst, 1);
-    init_t_atoms(dst, src->nr, (NULL != src->pdbinfo));
+    init_t_atoms(dst, src->nr, (nullptr != src->pdbinfo));
     dst->nr = src->nr;
-    if (NULL != src->atomname)
+    if (nullptr != src->atomname)
     {
         snew(dst->atomname, src->nr);
     }
-    if (NULL != src->atomtype)
+    if (nullptr != src->atomtype)
     {
         snew(dst->atomtype, src->nr);
     }
-    if (NULL != src->atomtypeB)
+    if (nullptr != src->atomtypeB)
     {
         snew(dst->atomtypeB, src->nr);
     }
     for (i = 0; (i < src->nr); i++)
     {
         dst->atom[i] = src->atom[i];
-        if (NULL != src->pdbinfo)
+        if (nullptr != src->pdbinfo)
         {
             dst->pdbinfo[i] = src->pdbinfo[i];
         }
-        if (NULL != src->atomname)
+        if (nullptr != src->atomname)
         {
             dst->atomname[i]  = src->atomname[i];
         }
-        if (NULL != src->atomtype)
+        if (nullptr != src->atomtype)
         {
             dst->atomtype[i] = src->atomtype[i];
         }
-        if (NULL != src->atomtypeB)
+        if (nullptr != src->atomtypeB)
         {
             dst->atomtypeB[i] = src->atomtypeB[i];
         }
@@ -232,7 +245,7 @@ void t_atoms_set_resinfo(t_atoms *atoms, int atom_ind, t_symtab *symtab,
 
     ri           = &atoms->resinfo[atoms->atom[atom_ind].resind];
     ri->name     = put_symtab(symtab, resname);
-    ri->rtp      = NULL;
+    ri->rtp      = nullptr;
     ri->nr       = resnr;
     ri->ic       = ic;
     ri->chainnum = chainnum;
@@ -326,3 +339,92 @@ void pr_atomtypes(FILE *fp, int indent, const char *title, const t_atomtypes *at
         }
     }
 }
+
+static void cmp_atom(FILE *fp, int index, const t_atom *a1, const t_atom *a2, real ftol, real abstol)
+{
+    if (a2)
+    {
+        cmp_us(fp, "atom.type", index, a1->type, a2->type);
+        cmp_us(fp, "atom.ptype", index, a1->ptype, a2->ptype);
+        cmp_int(fp, "atom.resind", index, a1->resind, a2->resind);
+        cmp_int(fp, "atom.atomnumber", index, a1->atomnumber, a2->atomnumber);
+        cmp_real(fp, "atom.m", index, a1->m, a2->m, ftol, abstol);
+        cmp_real(fp, "atom.q", index, a1->q, a2->q, ftol, abstol);
+        cmp_us(fp, "atom.typeB", index, a1->typeB, a2->typeB);
+        cmp_real(fp, "atom.mB", index, a1->mB, a2->mB, ftol, abstol);
+        cmp_real(fp, "atom.qB", index, a1->qB, a2->qB, ftol, abstol);
+    }
+    else
+    {
+        cmp_us(fp, "atom.type", index, a1->type, a1->typeB);
+        cmp_real(fp, "atom.m", index, a1->m, a1->mB, ftol, abstol);
+        cmp_real(fp, "atom.q", index, a1->q, a1->qB, ftol, abstol);
+    }
+}
+
+void cmp_atoms(FILE *fp, const t_atoms *a1, const t_atoms *a2, real ftol, real abstol)
+{
+    int i;
+
+    fprintf(fp, "comparing atoms\n");
+
+    if (a2)
+    {
+        cmp_int(fp, "atoms->nr", -1, a1->nr, a2->nr);
+        for (i = 0; (i < a1->nr); i++)
+        {
+            cmp_atom(fp, i, &(a1->atom[i]), &(a2->atom[i]), ftol, abstol);
+        }
+    }
+    else
+    {
+        for (i = 0; (i < a1->nr); i++)
+        {
+            cmp_atom(fp, i, &(a1->atom[i]), nullptr, ftol, abstol);
+        }
+    }
+}
+
+void atomsSetMassesBasedOnNames(t_atoms *atoms, gmx_bool printMissingMasses)
+{
+    if (atoms->haveMass)
+    {
+        /* We could decide to anyhow assign then or generate a fatal error,
+         * but it's probably most useful to keep the masses we have.
+         */
+        return;
+    }
+
+    int            maxWarn  = (printMissingMasses ? 10 : 0);
+    int            numWarn  = 0;
+
+    gmx_atomprop_t aps      = gmx_atomprop_init();
+
+    gmx_bool       haveMass = TRUE;
+    for (int i = 0; i < atoms->nr; i++)
+    {
+        if (!gmx_atomprop_query(aps, epropMass,
+                                *atoms->resinfo[atoms->atom[i].resind].name,
+                                *atoms->atomname[i],
+                                &atoms->atom[i].m))
+        {
+            haveMass = FALSE;
+
+            if (numWarn < maxWarn)
+            {
+                fprintf(stderr, "Can not find mass in database for atom %s in residue %d %s\n",
+                        *atoms->atomname[i],
+                        atoms->resinfo[atoms->atom[i].resind].nr,
+                        *atoms->resinfo[atoms->atom[i].resind].name);
+                numWarn++;
+            }
+            else
+            {
+                break;
+            }
+        }
+    }
+    atoms->haveMass = haveMass;
+
+    gmx_atomprop_destroy(aps);
+}
index faadaa98a3caba907454d3f66239ef0d91584d3f..8bb674b67d1845e908e55de6f449a8e628d44160 100644 (file)
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/real.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct t_symtab;
 
 /* The particle type */
@@ -107,19 +103,29 @@ typedef struct t_grps
 
 typedef struct t_atoms
 {
-    int            nr;          /* Nr of atoms                          */
-    t_atom        *atom;        /* Array of atoms (dim: nr)             */
+    int          nr;            /* Nr of atoms                          */
+    t_atom      *atom;          /* Array of atoms (dim: nr)             */
                                 /* The following entries will not       */
                                 /* always be used (nres==0)             */
-    char          ***atomname;  /* Array of pointers to atom name       */
+    char      ***atomname;      /* Array of pointers to atom name       */
                                 /* use: (*(atomname[i]))                */
-    char          ***atomtype;  /* Array of pointers to atom types      */
+    char      ***atomtype;      /* Array of pointers to atom types      */
                                 /* use: (*(atomtype[i]))                */
-    char          ***atomtypeB; /* Array of pointers to B atom types    */
+    char      ***atomtypeB;     /* Array of pointers to B atom types    */
                                 /* use: (*(atomtypeB[i]))               */
-    int              nres;      /* The number of resinfo entries        */
-    t_resinfo       *resinfo;   /* Array of residue names and numbers   */
-    t_pdbinfo       *pdbinfo;   /* PDB Information, such as aniso. Bfac */
+    int          nres;          /* The number of resinfo entries        */
+    t_resinfo   *resinfo;       /* Array of residue names and numbers   */
+    t_pdbinfo   *pdbinfo;       /* PDB Information, such as aniso. Bfac */
+
+    /* Flags that tell if properties are set for all nr atoms.
+     * For B-state parameters, both haveBState and the mass/charge/type
+     * flag should be TRUE.
+     */
+    gmx_bool     haveMass;      /* Mass available                       */
+    gmx_bool     haveCharge;    /* Charge available                     */
+    gmx_bool     haveType;      /* Atom type available                  */
+    gmx_bool     haveBState;    /* B-state parameters available         */
+    gmx_bool     havePdbInfo;   /* pdbinfo available                    */
 } t_atoms;
 
 typedef struct t_atomtypes
@@ -164,8 +170,14 @@ void pr_atoms(FILE *fp, int indent, const char *title, const t_atoms *atoms,
 void pr_atomtypes(FILE *fp, int indent, const char *title,
                   const t_atomtypes *atomtypes, gmx_bool bShowNumbers);
 
-#ifdef __cplusplus
-}
-#endif
+void cmp_atoms(FILE *fp, const t_atoms *a1, const t_atoms *a2, real ftol, real abstol);
+
+/*! \brief Set mass for each atom using the atom and residue names using a database
+ *
+ * If atoms->haveMass = TRUE does nothing.
+ * If printMissingMasss = TRUE, prints details for first 10 missing masses
+ * to stderr.
+ */
+void atomsSetMassesBasedOnNames(t_atoms *atoms, gmx_bool printMissingMasses);
 
 #endif
index 4d7f7711889d7a0bea54c45df11d0f5cee0cd302..281c6666c13646cc13176f9006c59c08c0a103ac 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) 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.
@@ -74,7 +74,7 @@ AtomsBuilder::~AtomsBuilder()
 
 char **AtomsBuilder::symtabString(char **source)
 {
-    if (symtab_ != NULL)
+    if (symtab_ != nullptr)
     {
         return put_symtab(symtab_, *source);
     }
@@ -268,7 +268,7 @@ void AtomsRemover::removeMarkedElements(std::vector<real> *container) const
 void AtomsRemover::removeMarkedAtoms(t_atoms *atoms) const
 {
     const int    originalAtomCount = atoms->nr;
-    AtomsBuilder builder(atoms, NULL);
+    AtomsBuilder builder(atoms, nullptr);
     if (atoms->nr > 0)
     {
         builder.setNextResidueNumber(atoms->resinfo[0].nr);
index 0d09f5e4de2ea5cca833d158c4cd0ef4bc78523e..73c7e47cbbaabb17dec2e52f7ad45eb71081474c 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,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.
@@ -61,7 +61,7 @@ void init_blocka(t_blocka *block)
     snew(block->index, block->nalloc_index);
     block->index[0]     = 0;
     block->nalloc_a     = 0;
-    block->a            = NULL;
+    block->a            = nullptr;
 }
 
 t_blocka *new_blocka(void)
@@ -87,8 +87,8 @@ void done_blocka(t_blocka *block)
     block->nra   = 0;
     sfree(block->index);
     sfree(block->a);
-    block->index        = NULL;
-    block->a            = NULL;
+    block->index        = nullptr;
+    block->a            = nullptr;
     block->nalloc_index = 0;
     block->nalloc_a     = 0;
 }
index 0ad6cbba67d47f31e0997c5fef4da5a079bf6dfb..4806c2a9ba889416ba5dba0afecc4fbac3f85ecc 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,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.
@@ -303,7 +303,9 @@ void pr_iparams(FILE *fp, t_functype ftype, const t_iparams *iparams)
 }
 
 void pr_ilist(FILE *fp, int indent, const char *title,
-              const t_functype *functype, const t_ilist *ilist, gmx_bool bShowNumbers)
+              const t_functype *functype, const t_ilist *ilist,
+              gmx_bool bShowNumbers,
+              gmx_bool bShowParameters, const t_iparams *iparams)
 {
     int      i, j, k, type, ftype;
     t_iatom *iatoms;
@@ -320,24 +322,26 @@ void pr_ilist(FILE *fp, int indent, const char *title,
             iatoms = ilist->iatoms;
             for (i = j = 0; i < ilist->nr; )
             {
-#ifndef DEBUG
                 pr_indent(fp, indent+INDENT);
                 type  = *(iatoms++);
                 ftype = functype[type];
-                fprintf(fp, "%d type=%d (%s)",
-                        bShowNumbers ? j : -1, bShowNumbers ? type : -1,
-                        interaction_function[ftype].name);
+                if (bShowNumbers)
+                {
+                    fprintf(fp, "%d type=%d ", j, type);
+                }
                 j++;
+                printf("(%s)", interaction_function[ftype].name);
                 for (k = 0; k < interaction_function[ftype].nratoms; k++)
                 {
-                    fprintf(fp, " %d", *(iatoms++));
+                    fprintf(fp, " %3d", *(iatoms++));
+                }
+                if (bShowParameters)
+                {
+                    fprintf(fp, "  ");
+                    pr_iparams(fp, ftype,  &iparams[type]);
                 }
                 fprintf(fp, "\n");
                 i += 1+interaction_function[ftype].nratoms;
-#else
-                fprintf(fp, "%5d%5d\n", i, iatoms[i]);
-                i++;
-#endif
             }
         }
     }
@@ -406,7 +410,8 @@ void pr_ffparams(FILE *fp, int indent, const char *title,
     pr_cmap(fp, indent, "cmap", &ffparams->cmap_grid, bShowNumbers);
 }
 
-void pr_idef(FILE *fp, int indent, const char *title, const t_idef *idef, gmx_bool bShowNumbers)
+void pr_idef(FILE *fp, int indent, const char *title, const t_idef *idef,
+             gmx_bool bShowNumbers, gmx_bool bShowParameters)
 {
     int i, j;
 
@@ -430,7 +435,8 @@ void pr_idef(FILE *fp, int indent, const char *title, const t_idef *idef, gmx_bo
         for (j = 0; (j < F_NRE); j++)
         {
             pr_ilist(fp, indent, interaction_function[j].longname,
-                     idef->functype, &idef->il[j], bShowNumbers);
+                     idef->functype, &idef->il[j], bShowNumbers,
+                     bShowParameters, idef->iparams);
         }
     }
 }
index 4446a3f170b3dc82e71ae49dae99bd3d38de18c1..467d7d45f8ad189bf717a5661e1738314a6d836a 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,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.
@@ -406,10 +406,13 @@ typedef struct t_idef
 
 void pr_iparams(FILE *fp, t_functype ftype, const t_iparams *iparams);
 void pr_ilist(FILE *fp, int indent, const char *title,
-              const t_functype *functype, const t_ilist *ilist, gmx_bool bShowNumbers);
+              const t_functype *functype, const t_ilist *ilist,
+              gmx_bool bShowNumbers,
+              gmx_bool bShowParameters, const t_iparams *iparams);
 void pr_ffparams(FILE *fp, int indent, const char *title,
                  const gmx_ffparams_t *ffparams, gmx_bool bShowNumbers);
-void pr_idef(FILE *fp, int indent, const char *title, const t_idef *idef, gmx_bool bShowNumbers);
+void pr_idef(FILE *fp, int indent, const char *title, const t_idef *idef,
+             gmx_bool bShowNumbers, gmx_bool bShowParameters);
 
 #ifdef __cplusplus
 }
index 0825ef1e667bf35cf21fe9c55fd67aec3784bc18..4db21b8e1ae0cc036680bfe48f453b544bf62939 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,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.
@@ -85,14 +85,11 @@ void write_index(const char *outf, t_blocka *b, char **gnames, gmx_bool bDuplica
     /* fprintf(out,"%5d  %5d\n",b->nr,b->nra); */
     for (i = 0; (i < b->nr); i++)
     {
-        fprintf(out, "[ %s ]\n", gnames[i]);
+        fprintf(out, "[ %s ]", gnames[i]);
         for (k = 0, j = b->index[i]; j < b->index[i+1]; j++, k++)
         {
-            fprintf(out, "%4d ", b->a[j]+1);
-            if ((k % 15) == 14)
-            {
-                fprintf(out, "\n");
-            }
+            const char sep = (k % 15 == 0 ? '\n' : ' ');
+            fprintf(out, "%c%4d", sep, b->a[j]+1);
         }
         fprintf(out, "\n");
     }
@@ -103,14 +100,11 @@ void write_index(const char *outf, t_blocka *b, char **gnames, gmx_bool bDuplica
         fprintf(stderr, "Duplicating the whole system with an atom offset of %d atoms.\n", natoms);
         for (i = 0; (i < b->nr); i++)
         {
-            fprintf(out, "[ %s_copy ]\n", gnames[i]);
+            fprintf(out, "[ %s_copy ]", gnames[i]);
             for (k = 0, j = b->index[i]; j < b->index[i+1]; j++, k++)
             {
-                fprintf(out, "%4d ", b->a[j]+1 + natoms );
-                if ((k % 15) == 14)
-                {
-                    fprintf(out, "\n");
-                }
+                const char sep = (k % 15 == 0 ? '\n' : ' ');
+                fprintf(out, "%c%4d", sep, b->a[j]+1 + natoms);
             }
             fprintf(out, "\n");
         }
@@ -235,8 +229,8 @@ typedef struct {
 static void analyse_other(const char ** restype, const t_atoms *atoms,
                           t_blocka *gb, char ***gn, gmx_bool bASK, gmx_bool bVerb)
 {
-    restp_t *restp = NULL;
-    char   **attp  = NULL;
+    restp_t *restp = nullptr;
+    char   **attp  = nullptr;
     char    *rname, *aname;
     int     *aid, *aaid;
     int      i, j, k, l, resind, naid, naaid, natp, nrestp = 0;
@@ -337,7 +331,7 @@ static void analyse_other(const char ** restype, const t_atoms *atoms,
                         }
                     }
                     sfree(attp);
-                    attp = NULL;
+                    attp = nullptr;
                 }
             }
             sfree(aid);
@@ -394,7 +388,7 @@ static void analyse_prot(const char ** restype, const t_atoms *atoms,
     };
 
     static const t_gmx_help_make_index_group constructing_data[] =
-    {{ NULL,   0, "Protein",      TRUE,  -1, -1},
+    {{ nullptr,   0, "Protein",      TRUE,  -1, -1},
      { pnoh,   asize(pnoh),   "Protein-H",    TRUE,  0,  -1},
      { calpha, asize(calpha), "C-alpha",      FALSE, -1, -1},
      { bb,     asize(bb),     "Backbone",     FALSE, -1, -1},
@@ -575,7 +569,7 @@ static void analyse_prot(const char ** restype, const t_atoms *atoms,
 
 void analyse(const t_atoms *atoms, t_blocka *gb, char ***gn, gmx_bool bASK, gmx_bool bVerb)
 {
-    gmx_residuetype_t*rt = NULL;
+    gmx_residuetype_t*rt = nullptr;
     char             *resnm;
     int              *aid;
     const char    **  restype;
@@ -606,7 +600,7 @@ void analyse(const t_atoms *atoms, t_blocka *gb, char ***gn, gmx_bool bASK, gmx_
 
     snew(restype, atoms->nres);
     ntypes     = 0;
-    p_typename = NULL;
+    p_typename = nullptr;
     if (atoms->nres > 0)
     {
         int i = 0;
@@ -771,10 +765,10 @@ t_blocka *init_index(const char *gfile, char ***grpname)
     in = gmx_ffopen(gfile, "r");
     snew(b, 1);
     b->nr      = 0;
-    b->index   = NULL;
+    b->index   = nullptr;
     b->nra     = 0;
-    b->a       = NULL;
-    *grpname   = NULL;
+    b->a       = nullptr;
+    *grpname   = nullptr;
     maxentries = 0;
     while (get_a_line(in, line, STRLEN))
     {
@@ -806,7 +800,7 @@ t_blocka *init_index(const char *gfile, char ***grpname)
                     srenew(b->a, maxentries);
                 }
                 assert(b->a != NULL); // for clang analyzer
-                b->a[i] = strtol(str, NULL, 10)-1;
+                b->a[i] = strtol(str, nullptr, 10)-1;
                 b->index[b->nr]++;
                 (b->nra)++;
                 pt = strstr(pt, str)+strlen(str);
@@ -853,7 +847,6 @@ int find_group(const char *s, int ngrps, char **grpname)
     n         = strlen(s);
     aa        = -1;
     /* first look for whole name match */
-    if (aa == -1)
     {
         for (i = 0; i < ngrps; i++)
         {
@@ -895,7 +888,7 @@ int find_group(const char *s, int ngrps, char **grpname)
             strcpy(string, grpname[i]);
             upstring(string);
             minstring(string);
-            if (strstr(string, key) != NULL)
+            if (strstr(string, key) != nullptr)
             {
                 if (aa != -1)
                 {
@@ -1006,33 +999,26 @@ void rd_index(const char *statfile, int ngrps, int isize[],
     }
     grps = init_index(statfile, &gnames);
     rd_groups(grps, gnames, grpnames, ngrps, isize, index, grpnr);
-}
-
-void rd_index_nrs(char *statfile, int ngrps, int isize[],
-                  int *index[], char *grpnames[], int grpnr[])
-{
-    char    **gnames;
-    t_blocka *grps;
-
-    if (!statfile)
+    for (int i = 0; i < grps->nr; i++)
     {
-        gmx_fatal(FARGS, "No index file specified");
+        sfree(gnames[i]);
     }
-    grps = init_index(statfile, &gnames);
-
-    rd_groups(grps, gnames, grpnames, ngrps, isize, index, grpnr);
+    sfree(gnames);
+    sfree(grpnr);
+    done_blocka(grps);
+    sfree(grps);
 }
 
 void get_index(const t_atoms *atoms, const char *fnm, int ngrps,
                int isize[], int *index[], char *grpnames[])
 {
     char    ***gnames;
-    t_blocka  *grps = NULL;
+    t_blocka  *grps = nullptr;
     int       *grpnr;
 
     snew(grpnr, ngrps);
     snew(gnames, 1);
-    if (fnm != NULL)
+    if (fnm != nullptr)
     {
         grps = init_index(fnm, gnames);
     }
@@ -1048,6 +1034,15 @@ void get_index(const t_atoms *atoms, const char *fnm, int ngrps,
     }
 
     rd_groups(grps, *gnames, grpnames, ngrps, isize, index, grpnr);
+    for (int i = 0; i < grps->nr; ++i)
+    {
+        sfree((*gnames)[i]);
+    }
+    sfree(*gnames);
+    sfree(gnames);
+    sfree(grpnr);
+    done_blocka(grps);
+    sfree(grps);
 }
 
 t_cluster_ndx *cluster_index(FILE *fplog, const char *ndx)
index f22ca9084ec641fa7b62b5287a923d78a14f355d..504b6c4deb6b5310d3f10bc5bb4e4e02c898e7bb 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,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,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.
@@ -75,10 +75,6 @@ void rd_index(const char *statfile, int ngrps, int isize[],
  * the dimension of the isize and grpnames arrays are ngrps.
  */
 
-void rd_index_nrs(char *statfile, int ngrps, int isize[],
-                  int *index[], char *grpnames[], int grpnr[]);
-/* the same but also reads the number of the selected group*/
-
 void get_index(const t_atoms *atoms, const char *fnm, int ngrps,
                int isize[], int *index[], char *grpnames[]);
 /* Does the same as rd_index, but if the fnm pointer is NULL it
diff --git a/src/gromacs/topology/mtop_lookup.h b/src/gromacs/topology/mtop_lookup.h
new file mode 100644 (file)
index 0000000..1d892ab
--- /dev/null
@@ -0,0 +1,270 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ *
+ * \brief This file contains inline functions to look up atom information
+ * using the global atom index.
+ *
+ * \author Berk Hess <hess@kth.se>
+ * \inlibraryapi
+ * \ingroup module_mtop
+ */
+
+#ifndef GMX_TOPOLOGY_MTOP_LOOKUP_H
+#define GMX_TOPOLOGY_MTOP_LOOKUP_H
+
+#include "gromacs/topology/topology.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/gmxassert.h"
+
+struct t_atom;
+
+/*! \brief Look up the molecule block and other indices of a global atom index
+ *
+ * The atom index has to be in range: 0 <= \p globalAtomIndex < \p mtop->natoms.
+ * The input value of moleculeBlock should be in range. Use 0 as starting value.
+ * For subsequent calls to this function, e.g. in a loop, pass in the previously
+ * returned value for best performance. Atoms in a group tend to be in the same
+ * molecule(block), so this minimizes the search time.
+ *
+ * \param[in]     mtop                 The molecule topology
+ * \param[in]     globalAtomIndex      The global atom index to look up
+ * \param[in,out] moleculeBlock        The molecule block index in \p mtop
+ * \param[out]    moleculeIndex        The index of the molecule in the block, can be NULL
+ * \param[out]    atomIndexInMolecule  The atom index in the molecule, can be NULL
+ */
+static inline void
+mtopGetMolblockIndex(const gmx_mtop_t *mtop,
+                     int               globalAtomIndex,
+                     int              *moleculeBlock,
+                     int              *moleculeIndex,
+                     int              *atomIndexInMolecule)
+{
+    GMX_ASSERT(globalAtomIndex >= 0 && globalAtomIndex < mtop->natoms, "The atom index to look up should be within range");
+    GMX_ASSERT(moleculeBlock != nullptr, "molBlock can not be NULL");
+    GMX_ASSERT(*moleculeBlock >= 0 && *moleculeBlock < mtop->nmolblock, "The starting molecule block index for the search should be within range");
+
+    /* Search the molecue block index using bisection */
+    int molBlock0 = -1;
+    int molBlock1 = mtop->nmolblock;
+
+    int globalAtomStart;
+    while (TRUE)
+    {
+        globalAtomStart = mtop->molblock[*moleculeBlock].globalAtomStart;
+        if (globalAtomIndex < globalAtomStart)
+        {
+            molBlock1 = *moleculeBlock;
+        }
+        else if (globalAtomIndex >= mtop->molblock[*moleculeBlock].globalAtomEnd)
+        {
+            molBlock0 = *moleculeBlock;
+        }
+        else
+        {
+            break;
+        }
+        *moleculeBlock = ((molBlock0 + molBlock1 + 1) >> 1);
+    }
+
+    int molIndex = (globalAtomIndex - globalAtomStart) / mtop->molblock[*moleculeBlock].natoms_mol;
+    if (moleculeIndex != nullptr)
+    {
+        *moleculeIndex = molIndex;
+    }
+    if (atomIndexInMolecule != nullptr)
+    {
+        *atomIndexInMolecule = globalAtomIndex - globalAtomStart - molIndex*mtop->molblock[*moleculeBlock].natoms_mol;
+    }
+}
+
+/*! \brief Returns the atom data for an atom based on global atom index
+ *
+ * The atom index has to be in range: 0 <= \p globalAtomIndex < \p mtop->natoms.
+ * The input value of moleculeBlock should be in range. Use 0 as starting value.
+ * For subsequent calls to this function, e.g. in a loop, pass in the previously
+ * returned value for best performance. Atoms in a group tend to be in the same
+ * molecule(block), so this minimizes the search time.
+ *
+ * \param[in]     mtop                 The molecule topology
+ * \param[in]     globalAtomIndex      The global atom index to look up
+ * \param[in,out] moleculeBlock        The molecule block index in \p mtop
+ */
+static inline const t_atom &
+mtopGetAtomParameters(const gmx_mtop_t  *mtop,
+                      int                globalAtomIndex,
+                      int               *moleculeBlock)
+{
+    int atomIndexInMolecule;
+    mtopGetMolblockIndex(mtop, globalAtomIndex, moleculeBlock,
+                         nullptr, &atomIndexInMolecule);
+    const gmx_moltype_t &moltype = mtop->moltype[mtop->molblock[*moleculeBlock].type];
+    return moltype.atoms.atom[atomIndexInMolecule];
+}
+
+/*! \brief Returns the mass of an atom based on global atom index
+ *
+ * Returns that A-state mass of the atom with global index \p globalAtomIndex.
+ * The atom index has to be in range: 0 <= \p globalAtomIndex < \p mtop->natoms.
+ * The input value of moleculeBlock should be in range. Use 0 as starting value.
+ * For subsequent calls to this function, e.g. in a loop, pass in the previously
+ * returned value for best performance. Atoms in a group tend to be in the same
+ * molecule(block), so this minimizes the search time.
+ *
+ * \param[in]     mtop                 The molecule topology
+ * \param[in]     globalAtomIndex      The global atom index to look up
+ * \param[in,out] moleculeBlock        The molecule block index in \p mtop
+ */
+static inline real
+mtopGetAtomMass(const gmx_mtop_t  *mtop,
+                int                globalAtomIndex,
+                int               *moleculeBlock)
+{
+    const t_atom &atom = mtopGetAtomParameters(mtop, globalAtomIndex, moleculeBlock);
+    return atom.m;
+}
+
+/*! \brief Look up the atom and residue name and residue number and index of a global atom index
+ *
+ * The atom index has to be in range: 0 <= \p globalAtomIndex < \p mtop->natoms.
+ * The input value of moleculeBlock should be in range. Use 0 as starting value.
+ * For subsequent calls to this function, e.g. in a loop, pass in the previously
+ * returned value for best performance. Atoms in a group tend to be in the same
+ * molecule(block), so this minimizes the search time.
+ * Note that this function does a (somewhat expensive) lookup. If you want
+ * to look up data sequentially for all atoms in a molecule or the system,
+ * use one of the mtop loop functionalities.
+ *
+ * \param[in]     mtop                The molecule topology
+ * \param[in]     globalAtomIndex     The global atom index to look up
+ * \param[in,out] moleculeBlock       The molecule block index in \p mtop
+ * \param[out]    atomName            The atom name, input can be NULL
+ * \param[out]    residueNumber       The residue number, input can be NULL
+ * \param[out]    residueName         The residue name, input can be NULL
+ * \param[out]    globalResidueIndex  The gobal residue index, input can be NULL
+ */
+static inline void
+mtopGetAtomAndResidueName(const gmx_mtop_t  *mtop,
+                          int                globalAtomIndex,
+                          int               *moleculeBlock,
+                          const char       **atomName,
+                          int               *residueNumber,
+                          const char       **residueName,
+                          int               *globalResidueIndex)
+{
+    int moleculeIndex;
+    int atomIndexInMolecule;
+    mtopGetMolblockIndex(mtop, globalAtomIndex, moleculeBlock,
+                         &moleculeIndex, &atomIndexInMolecule);
+
+    const gmx_molblock_t &molb  = mtop->molblock[*moleculeBlock];
+    const t_atoms        &atoms = mtop->moltype[molb.type].atoms;
+    if (atomName != nullptr)
+    {
+        *atomName = *(atoms.atomname[atomIndexInMolecule]);
+    }
+    if (residueNumber != nullptr)
+    {
+        if (atoms.nres > mtop->maxres_renum)
+        {
+            *residueNumber = atoms.resinfo[atoms.atom[atomIndexInMolecule].resind].nr;
+        }
+        else
+        {
+            /* Single residue molecule, keep counting */
+            *residueNumber = molb.residueNumberStart + moleculeIndex*atoms.nres + atoms.atom[atomIndexInMolecule].resind;
+        }
+    }
+    if (residueName != nullptr)
+    {
+        *residueName = *(atoms.resinfo[atoms.atom[atomIndexInMolecule].resind].name);
+    }
+    if (globalResidueIndex != nullptr)
+    {
+        *globalResidueIndex = molb.globalResidueStart + moleculeIndex*atoms.nres + atoms.atom[atomIndexInMolecule].resind;
+    }
+}
+
+/*! \brief Returns residue information for an atom based on global atom index
+ *
+ * The atom index has to be in range: 0 <= \p globalAtomIndex < \p mtop->natoms.
+ * The input value of moleculeBlock should be in range. Use 0 as starting value.
+ * For subsequent calls to this function, e.g. in a loop, pass in the previously
+ * returned value for best performance. Atoms in a group tend to be in the same
+ * molecule(block), so this minimizes the search time.
+ *
+ * \param[in]     mtop                 The molecule topology
+ * \param[in]     globalAtomIndex      The global atom index to look up
+ * \param[in,out] moleculeBlock        The molecule block index in \p mtop
+ */
+static inline const t_resinfo &
+mtopGetResidueInfo(const gmx_mtop_t  *mtop,
+                   int                globalAtomIndex,
+                   int               *moleculeBlock)
+{
+    int atomIndexInMolecule;
+    mtopGetMolblockIndex(mtop, globalAtomIndex, moleculeBlock,
+                         nullptr, &atomIndexInMolecule);
+    const gmx_moltype_t &moltype = mtop->moltype[mtop->molblock[*moleculeBlock].type];
+    const int            resind  = moltype.atoms.atom[atomIndexInMolecule].resind;
+    return moltype.atoms.resinfo[resind];
+}
+
+/*! \brief Returns PDB information for an atom based on global atom index
+ *
+ * The atom index has to be in range: 0 <= \p globalAtomIndex < \p mtop->natoms.
+ * The input value of moleculeBlock should be in range. Use 0 as starting value.
+ * For subsequent calls to this function, e.g. in a loop, pass in the previously
+ * returned value for best performance. Atoms in a group tend to be in the same
+ * molecule(block), so this minimizes the search time.
+ *
+ * \param[in]     mtop                 The molecule topology
+ * \param[in]     globalAtomIndex      The global atom index to look up
+ * \param[in,out] moleculeBlock        The molecule block index in \p mtop
+ */
+static inline const t_pdbinfo &
+mtopGetAtomPdbInfo(const gmx_mtop_t  *mtop,
+                   int                globalAtomIndex,
+                   int               *moleculeBlock)
+{
+    int atomIndexInMolecule;
+    mtopGetMolblockIndex(mtop, globalAtomIndex, moleculeBlock,
+                         nullptr, &atomIndexInMolecule);
+    const gmx_moltype_t &moltype = mtop->moltype[mtop->molblock[*moleculeBlock].type];
+    GMX_ASSERT(moltype.atoms.havePdbInfo, "PDB information not present when requested");
+    return moltype.atoms.pdbinfo[atomIndexInMolecule];
+}
+
+#endif
index 5ec58477747454534a9b2b2726ebf992dffaefb0..52b1305bd3cac1a54e502ab82eaf42ac9f228edc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2008,2009,2010,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2008,2009,2010,2012,2013,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.
@@ -78,14 +78,50 @@ static int gmx_mtop_maxresnr(const gmx_mtop_t *mtop, int maxres_renum)
     return maxresnr;
 }
 
+static void finalizeMolblocks(gmx_mtop_t *mtop)
+{
+    int atomIndex          = 0;
+    int residueIndex       = 0;
+    int residueNumberStart = mtop->maxresnr + 1;
+    for (int mb = 0; mb < mtop->nmolblock; mb++)
+    {
+        gmx_molblock_t *molb          = &mtop->molblock[mb];
+        int             numResPerMol  = mtop->moltype[molb->type].atoms.nres;
+        molb->globalAtomStart         = atomIndex;
+        molb->globalResidueStart      = residueIndex;
+        atomIndex                    += molb->nmol*molb->natoms_mol;
+        residueIndex                 += molb->nmol*numResPerMol;
+        molb->globalAtomEnd           = atomIndex;
+        molb->residueNumberStart      = residueNumberStart;
+        if (numResPerMol <= mtop->maxres_renum)
+        {
+            residueNumberStart       += molb->nmol*numResPerMol;
+        }
+    }
+}
+
 void gmx_mtop_finalize(gmx_mtop_t *mtop)
 {
     char *env;
 
-    mtop->maxres_renum = 1;
+    if (mtop->nmolblock == 1 && mtop->molblock[0].nmol == 1)
+    {
+        /* We have a single molecule only, no renumbering needed.
+         * This case also covers an mtop converted from pdb/gro/... input,
+         * so we retain the original residue numbering.
+         */
+        mtop->maxres_renum = 0;
+    }
+    else
+    {
+        /* We only renumber single residue molecules. Their intra-molecular
+         * residue numbering is anyhow irrelevant.
+         */
+        mtop->maxres_renum = 1;
+    }
 
     env = getenv("GMX_MAXRESRENUM");
-    if (env != NULL)
+    if (env != nullptr)
     {
         sscanf(env, "%d", &mtop->maxres_renum);
     }
@@ -96,6 +132,8 @@ void gmx_mtop_finalize(gmx_mtop_t *mtop)
     }
 
     mtop->maxresnr = gmx_mtop_maxresnr(mtop, mtop->maxres_renum);
+
+    finalizeMolblocks(mtop);
 }
 
 void gmx_mtop_count_atomtypes(const gmx_mtop_t *mtop, int state, int typecount[])
@@ -142,6 +180,18 @@ int ncg_mtop(const gmx_mtop_t *mtop)
     return ncg;
 }
 
+int gmx_mtop_nres(const gmx_mtop_t *mtop)
+{
+    int nres = 0;
+    for (int mb = 0; mb < mtop->nmolblock; ++mb)
+    {
+        nres +=
+            mtop->molblock[mb].nmol*
+            mtop->moltype[mtop->molblock[mb].type].atoms.nres;
+    }
+    return nres;
+}
+
 void gmx_mtop_remove_chargegroups(gmx_mtop_t *mtop)
 {
     int      mt;
@@ -163,279 +213,6 @@ void gmx_mtop_remove_chargegroups(gmx_mtop_t *mtop)
     }
 }
 
-
-typedef struct
-{
-    int a_start;
-    int a_end;
-    int na_mol;
-} mb_at_t;
-
-typedef struct gmx_mtop_atomlookup
-{
-    const gmx_mtop_t *mtop;
-    int               nmb;
-    int               mb_start;
-    mb_at_t          *mba;
-} t_gmx_mtop_atomlookup;
-
-
-gmx_mtop_atomlookup_t
-gmx_mtop_atomlookup_init(const gmx_mtop_t *mtop)
-{
-    t_gmx_mtop_atomlookup *alook;
-    int                    mb;
-    int                    a_start, a_end, na, na_start = -1;
-
-    snew(alook, 1);
-
-    alook->mtop     = mtop;
-    alook->nmb      = mtop->nmolblock;
-    alook->mb_start = 0;
-    snew(alook->mba, alook->nmb);
-
-    a_start = 0;
-    for (mb = 0; mb < mtop->nmolblock; mb++)
-    {
-        na    = mtop->molblock[mb].nmol*mtop->molblock[mb].natoms_mol;
-        a_end = a_start + na;
-
-        alook->mba[mb].a_start = a_start;
-        alook->mba[mb].a_end   = a_end;
-        alook->mba[mb].na_mol  = mtop->molblock[mb].natoms_mol;
-
-        /* We start the binary search with the largest block */
-        if (mb == 0 || na > na_start)
-        {
-            alook->mb_start = mb;
-            na_start        = na;
-        }
-
-        a_start = a_end;
-    }
-
-    return alook;
-}
-
-gmx_mtop_atomlookup_t
-gmx_mtop_atomlookup_settle_init(const gmx_mtop_t *mtop)
-{
-    t_gmx_mtop_atomlookup *alook;
-    int                    mb;
-    int                    na, na_start = -1;
-
-    alook = gmx_mtop_atomlookup_init(mtop);
-
-    /* Check if the starting molblock has settle */
-    if (mtop->moltype[mtop->molblock[alook->mb_start].type].ilist[F_SETTLE].nr  == 0)
-    {
-        /* Search the largest molblock with settle */
-        alook->mb_start = -1;
-        for (mb = 0; mb < mtop->nmolblock; mb++)
-        {
-            if (mtop->moltype[mtop->molblock[mb].type].ilist[F_SETTLE].nr > 0)
-            {
-                na = alook->mba[mb].a_end - alook->mba[mb].a_start;
-                if (alook->mb_start == -1 || na > na_start)
-                {
-                    alook->mb_start = mb;
-                    na_start        = na;
-                }
-            }
-        }
-
-        if (alook->mb_start == -1)
-        {
-            gmx_incons("gmx_mtop_atomlookup_settle_init called without settles");
-        }
-    }
-
-    return alook;
-}
-
-void
-gmx_mtop_atomlookup_destroy(gmx_mtop_atomlookup_t alook)
-{
-    sfree(alook->mba);
-    sfree(alook);
-}
-
-void gmx_mtop_atomnr_to_atom(const gmx_mtop_atomlookup_t alook,
-                             int                         atnr_global,
-                             t_atom                    **atom)
-{
-    int mb0, mb1, mb;
-    int a_start, atnr_mol;
-
-#ifdef DEBUG_MTOP
-    if (atnr_global < 0 || atnr_global >= mtop->natoms)
-    {
-        gmx_fatal(FARGS, "gmx_mtop_atomnr_to_moltype was called with atnr_global=%d which is not in the atom range of this system (%d-%d)",
-                  atnr_global, 0, mtop->natoms-1);
-    }
-#endif
-
-    mb0 = -1;
-    mb1 = alook->nmb;
-    mb  = alook->mb_start;
-
-    while (TRUE)
-    {
-        a_start = alook->mba[mb].a_start;
-        if (atnr_global < a_start)
-        {
-            mb1 = mb;
-        }
-        else if (atnr_global >= alook->mba[mb].a_end)
-        {
-            mb0 = mb;
-        }
-        else
-        {
-            break;
-        }
-        mb = ((mb0 + mb1 + 1)>>1);
-    }
-
-    atnr_mol = (atnr_global - a_start) % alook->mba[mb].na_mol;
-
-    *atom = &alook->mtop->moltype[alook->mtop->molblock[mb].type].atoms.atom[atnr_mol];
-}
-
-void gmx_mtop_atomnr_to_ilist(const gmx_mtop_atomlookup_t alook,
-                              int atnr_global,
-                              t_ilist **ilist_mol, int *atnr_offset)
-{
-    int mb0, mb1, mb;
-    int a_start, atnr_local;
-
-#ifdef DEBUG_MTOP
-    if (atnr_global < 0 || atnr_global >= mtop->natoms)
-    {
-        gmx_fatal(FARGS, "gmx_mtop_atomnr_to_moltype was called with atnr_global=%d which is not in the atom range of this system (%d-%d)",
-                  atnr_global, 0, mtop->natoms-1);
-    }
-#endif
-
-    mb0 = -1;
-    mb1 = alook->nmb;
-    mb  = alook->mb_start;
-
-    while (TRUE)
-    {
-        a_start = alook->mba[mb].a_start;
-        if (atnr_global < a_start)
-        {
-            mb1 = mb;
-        }
-        else if (atnr_global >= alook->mba[mb].a_end)
-        {
-            mb0 = mb;
-        }
-        else
-        {
-            break;
-        }
-        mb = ((mb0 + mb1 + 1)>>1);
-    }
-
-    *ilist_mol = alook->mtop->moltype[alook->mtop->molblock[mb].type].ilist;
-
-    atnr_local = (atnr_global - a_start) % alook->mba[mb].na_mol;
-
-    *atnr_offset = atnr_global - atnr_local;
-}
-
-void gmx_mtop_atomnr_to_molblock_ind(const gmx_mtop_atomlookup_t alook,
-                                     int atnr_global,
-                                     int *molb, int *molnr, int *atnr_mol)
-{
-    int mb0, mb1, mb;
-    int a_start;
-
-#ifdef DEBUG_MTOP
-    if (atnr_global < 0 || atnr_global >= mtop->natoms)
-    {
-        gmx_fatal(FARGS, "gmx_mtop_atomnr_to_moltype was called with atnr_global=%d which is not in the atom range of this system (%d-%d)",
-                  atnr_global, 0, mtop->natoms-1);
-    }
-#endif
-
-    mb0 = -1;
-    mb1 = alook->nmb;
-    mb  = alook->mb_start;
-
-    while (TRUE)
-    {
-        a_start = alook->mba[mb].a_start;
-        if (atnr_global < a_start)
-        {
-            mb1 = mb;
-        }
-        else if (atnr_global >= alook->mba[mb].a_end)
-        {
-            mb0 = mb;
-        }
-        else
-        {
-            break;
-        }
-        mb = ((mb0 + mb1 + 1)>>1);
-    }
-
-    *molb     = mb;
-    *molnr    = (atnr_global - a_start) / alook->mba[mb].na_mol;
-    *atnr_mol = atnr_global - a_start - (*molnr)*alook->mba[mb].na_mol;
-}
-
-void gmx_mtop_atominfo_global(const gmx_mtop_t *mtop, int atnr_global,
-                              char **atomname, int *resnr, char **resname)
-{
-    int             mb, a_start, a_end, maxresnr, at_loc;
-    t_atoms        *atoms = NULL;
-
-    if (atnr_global < 0 || atnr_global >= mtop->natoms)
-    {
-        gmx_fatal(FARGS, "gmx_mtop_atominfo_global was called with atnr_global=%d which is not in the atom range of this system (%d-%d)",
-                  atnr_global, 0, mtop->natoms-1);
-    }
-
-    mb       = -1;
-    a_end    = 0;
-    maxresnr = mtop->maxresnr;
-    do
-    {
-        if (mb >= 0)
-        {
-            /* cppcheck-suppress nullPointer #6330 will be fixed in cppcheck 1.73 */
-            if (atoms->nres <= mtop->maxres_renum)
-            {
-                /* Single residue molecule, keep counting */
-                /* cppcheck-suppress nullPointer #6330 will be fixed in cppcheck 1.73 */
-                maxresnr += mtop->molblock[mb].nmol*atoms->nres;
-            }
-        }
-        mb++;
-        atoms   = &mtop->moltype[mtop->molblock[mb].type].atoms;
-        a_start = a_end;
-        a_end   = a_start + mtop->molblock[mb].nmol*atoms->nr;
-    }
-    while (atnr_global >= a_end);
-
-    at_loc    = (atnr_global - a_start) % atoms->nr;
-    *atomname = *(atoms->atomname[at_loc]);
-    if (atoms->nres > mtop->maxres_renum)
-    {
-        *resnr = atoms->resinfo[atoms->atom[at_loc].resind].nr;
-    }
-    else
-    {
-        /* Single residue molecule, keep counting */
-        *resnr = maxresnr + 1 + (atnr_global - a_start)/atoms->nr*atoms->nres + atoms->atom[at_loc].resind;
-    }
-    *resname  = *(atoms->resinfo[atoms->atom[at_loc].resind].name);
-}
-
 typedef struct gmx_mtop_atomloop_all
 {
     const gmx_mtop_t *mtop;
@@ -472,9 +249,9 @@ static void gmx_mtop_atomloop_all_destroy(gmx_mtop_atomloop_all_t aloop)
 }
 
 gmx_bool gmx_mtop_atomloop_all_next(gmx_mtop_atomloop_all_t aloop,
-                                    int *at_global, t_atom **atom)
+                                    int *at_global, const t_atom **atom)
 {
-    if (aloop == NULL)
+    if (aloop == nullptr)
     {
         gmx_incons("gmx_mtop_atomloop_all_next called without calling gmx_mtop_atomloop_all_init");
     }
@@ -561,9 +338,9 @@ static void gmx_mtop_atomloop_block_destroy(gmx_mtop_atomloop_block_t aloop)
 }
 
 gmx_bool gmx_mtop_atomloop_block_next(gmx_mtop_atomloop_block_t aloop,
-                                      t_atom **atom, int *nmol)
+                                      const t_atom **atom, int *nmol)
 {
-    if (aloop == NULL)
+    if (aloop == nullptr)
     {
         gmx_incons("gmx_mtop_atomloop_all_next called without calling gmx_mtop_atomloop_all_init");
     }
@@ -615,7 +392,7 @@ static void gmx_mtop_ilistloop_destroy(gmx_mtop_ilistloop_t iloop)
 gmx_bool gmx_mtop_ilistloop_next(gmx_mtop_ilistloop_t iloop,
                                  t_ilist **ilist_mol, int *nmol)
 {
-    if (iloop == NULL)
+    if (iloop == nullptr)
     {
         gmx_incons("gmx_mtop_ilistloop_next called without calling gmx_mtop_ilistloop_init");
     }
@@ -674,7 +451,7 @@ gmx_bool gmx_mtop_ilistloop_all_next(gmx_mtop_ilistloop_all_t iloop,
                                      t_ilist **ilist_mol, int *atnr_offset)
 {
 
-    if (iloop == NULL)
+    if (iloop == nullptr)
     {
         gmx_incons("gmx_mtop_ilistloop_all_next called without calling gmx_mtop_ilistloop_all_init");
     }
@@ -779,13 +556,40 @@ static void atomcat(t_atoms *dest, t_atoms *src, int copies,
     int srcnr  = src->nr;
     int destnr = dest->nr;
 
+    if (dest->nr == 0)
+    {
+        dest->haveMass    = src->haveMass;
+        dest->haveType    = src->haveType;
+        dest->haveCharge  = src->haveCharge;
+        dest->haveBState  = src->haveBState;
+        dest->havePdbInfo = src->havePdbInfo;
+    }
+    else
+    {
+        dest->haveMass    = dest->haveMass    && src->haveMass;
+        dest->haveType    = dest->haveType    && src->haveType;
+        dest->haveCharge  = dest->haveCharge  && src->haveCharge;
+        dest->haveBState  = dest->haveBState  && src->haveBState;
+        dest->havePdbInfo = dest->havePdbInfo && src->havePdbInfo;
+    }
+
     if (srcnr)
     {
         size = destnr+copies*srcnr;
         srenew(dest->atom, size);
         srenew(dest->atomname, size);
-        srenew(dest->atomtype, size);
-        srenew(dest->atomtypeB, size);
+        if (dest->haveType)
+        {
+            srenew(dest->atomtype, size);
+            if (dest->haveBState)
+            {
+                srenew(dest->atomtypeB, size);
+            }
+        }
+        if (dest->havePdbInfo)
+        {
+            srenew(dest->pdbinfo, size);
+        }
     }
     if (src->nres)
     {
@@ -802,14 +606,25 @@ static void atomcat(t_atoms *dest, t_atoms *src, int copies,
 
     for (l = destnr, j = 0; (j < copies); j++, l += srcnr)
     {
-        memcpy((char *) &(dest->atomname[l]), (char *) &(src->atomname[0]),
-               (size_t)(srcnr*sizeof(src->atomname[0])));
-        memcpy((char *) &(dest->atomtype[l]), (char *) &(src->atomtype[0]),
-               (size_t)(srcnr*sizeof(src->atomtype[0])));
-        memcpy((char *) &(dest->atomtypeB[l]), (char *) &(src->atomtypeB[0]),
-               (size_t)(srcnr*sizeof(src->atomtypeB[0])));
         memcpy((char *) &(dest->atom[l]), (char *) &(src->atom[0]),
                (size_t)(srcnr*sizeof(src->atom[0])));
+        memcpy((char *) &(dest->atomname[l]), (char *) &(src->atomname[0]),
+               (size_t)(srcnr*sizeof(src->atomname[0])));
+        if (dest->haveType)
+        {
+            memcpy((char *) &(dest->atomtype[l]), (char *) &(src->atomtype[0]),
+                   (size_t)(srcnr*sizeof(src->atomtype[0])));
+            if (dest->haveBState)
+            {
+                memcpy((char *) &(dest->atomtypeB[l]), (char *) &(src->atomtypeB[0]),
+                       (size_t)(srcnr*sizeof(src->atomtypeB[0])));
+            }
+        }
+        if (dest->havePdbInfo)
+        {
+            memcpy((char *) &(dest->pdbinfo[l]), (char *) &(src->pdbinfo[0]),
+                   (size_t)(srcnr*sizeof(src->pdbinfo[0])));
+        }
     }
 
     /* Increment residue indices */
@@ -1032,7 +847,6 @@ static void gen_local_top(const gmx_mtop_t *mtop,
     real                   *qA, *qB;
     gmx_mtop_atomloop_all_t aloop;
     int                     ag;
-    t_atom                 *atom;
 
     top->atomtypes = mtop->atomtypes;
 
@@ -1043,9 +857,9 @@ static void gen_local_top(const gmx_mtop_t *mtop,
     idef->atnr                    = ffp->atnr;
     idef->functype                = ffp->functype;
     idef->iparams                 = ffp->iparams;
-    idef->iparams_posres          = NULL;
+    idef->iparams_posres          = nullptr;
     idef->iparams_posres_nalloc   = 0;
-    idef->iparams_fbposres        = NULL;
+    idef->iparams_fbposres        = nullptr;
     idef->iparams_fbposres_nalloc = 0;
     idef->fudgeQQ                 = ffp->fudgeQQ;
     idef->cmap_grid               = ffp->cmap_grid;
@@ -1057,7 +871,7 @@ static void gen_local_top(const gmx_mtop_t *mtop,
     {
         idef->il[ftype].nr     = 0;
         idef->il[ftype].nalloc = 0;
-        idef->il[ftype].iatoms = NULL;
+        idef->il[ftype].iatoms = nullptr;
     }
 
     natoms = 0;
@@ -1125,6 +939,7 @@ static void gen_local_top(const gmx_mtop_t *mtop,
         snew(qA, mtop->natoms);
         snew(qB, mtop->natoms);
         aloop = gmx_mtop_atomloop_all_init(mtop);
+        const t_atom *atom;
         while (gmx_mtop_atomloop_all_next(aloop, &ag, &atom))
         {
             qA[ag] = atom->q;
@@ -1153,7 +968,7 @@ gmx_mtop_generate_local_top(const gmx_mtop_t *mtop,
     return top;
 }
 
-t_topology gmx_mtop_t_to_t_topology(gmx_mtop_t *mtop)
+t_topology gmx_mtop_t_to_t_topology(gmx_mtop_t *mtop, bool freeMTop)
 {
     int            mt, mb;
     gmx_localtop_t ltop;
@@ -1172,23 +987,23 @@ t_topology gmx_mtop_t_to_t_topology(gmx_mtop_t *mtop)
     top.bIntermolecularInteractions = mtop->bIntermolecularInteractions;
     top.symtab                      = mtop->symtab;
 
-    /* We only need to free the moltype and molblock data,
-     * all other pointers have been copied to top.
-     *
-     * Well, except for the group data, but we can't free those, because they
-     * are used somewhere even after a call to this function.
-     */
-    for (mt = 0; mt < mtop->nmoltype; mt++)
+    if (freeMTop)
     {
-        done_moltype(&mtop->moltype[mt]);
-    }
-    sfree(mtop->moltype);
+        // Free pointers that have not been copied to top.
+        for (mt = 0; mt < mtop->nmoltype; mt++)
+        {
+            done_moltype(&mtop->moltype[mt]);
+        }
+        sfree(mtop->moltype);
 
-    for (mb = 0; mb < mtop->nmolblock; mb++)
-    {
-        done_molblock(&mtop->molblock[mb]);
+        for (mb = 0; mb < mtop->nmolblock; mb++)
+        {
+            done_molblock(&mtop->molblock[mb]);
+        }
+        sfree(mtop->molblock);
+
+        done_gmx_groups_t(&mtop->groups);
     }
-    sfree(mtop->molblock);
 
     return top;
 }
@@ -1198,7 +1013,7 @@ std::vector<size_t> get_atom_index(const gmx_mtop_t *mtop)
 
     std::vector<size_t>       atom_index;
     gmx_mtop_atomloop_block_t aloopb = gmx_mtop_atomloop_block_init(mtop);
-    t_atom                   *atom;
+    const t_atom             *atom;
     int                       nmol, j = 0;
     while (gmx_mtop_atomloop_block_next(aloopb, &atom, &nmol))
     {
@@ -1210,3 +1025,33 @@ std::vector<size_t> get_atom_index(const gmx_mtop_t *mtop)
     }
     return atom_index;
 }
+
+void convertAtomsToMtop(t_symtab    *symtab,
+                        char       **name,
+                        t_atoms     *atoms,
+                        gmx_mtop_t  *mtop)
+{
+    mtop->symtab                 = *symtab;
+
+    mtop->name                   = name;
+
+    mtop->nmoltype               = 1;
+    // This snew clears all entries, we should replace it by an initializer
+    snew(mtop->moltype, mtop->nmoltype);
+    mtop->moltype[0].atoms       = *atoms;
+    init_block(&mtop->moltype[0].cgs);
+    init_blocka(&mtop->moltype[0].excls);
+
+    mtop->nmolblock              = 1;
+    // This snew clears all entries, we should replace it by an initializer
+    snew(mtop->molblock, mtop->nmolblock);
+    mtop->molblock[0].type       = 0;
+    mtop->molblock[0].nmol       = 1;
+    mtop->molblock[0].natoms_mol = atoms->nr;
+
+    mtop->bIntermolecularInteractions = FALSE;
+
+    mtop->natoms                 = atoms->nr;
+
+    gmx_mtop_finalize(mtop);
+}
index 3c01d34064eb05f1e187a8e4280145333330e2be..366cd13e9eaacb191ac982e41a97010eeb14d525 100644 (file)
 
 #include <vector>
 
+#include "gromacs/topology/topology.h"
 #include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/gmxassert.h"
 
 struct gmx_localtop_t;
-struct gmx_moltype_t;
-struct gmx_mtop_t;
 struct t_atom;
 struct t_atoms;
 struct t_block;
 struct t_ilist;
-struct t_topology;
+struct t_symtab;
 
 /* Should be called after generating or reading mtop,
  * to set some compute intesive variables to avoid
@@ -70,62 +70,12 @@ gmx_mtop_count_atomtypes(const gmx_mtop_t *mtop, int state, int typecount[]);
 int
 ncg_mtop(const gmx_mtop_t *mtop);
 
+/* Returns the total number of residues in mtop. */
+int gmx_mtop_nres(const gmx_mtop_t *mtop);
+
 /* Removes the charge groups, i.e. makes single atom charge groups, in mtop */
 void gmx_mtop_remove_chargegroups(gmx_mtop_t *mtop);
 
-
-/* Abstract data type for looking up atoms by global atom number */
-typedef struct gmx_mtop_atomlookup *gmx_mtop_atomlookup_t;
-
-/* Initialize atom lookup by global atom number */
-gmx_mtop_atomlookup_t
-gmx_mtop_atomlookup_init(const gmx_mtop_t *mtop);
-
-/* As gmx_mtop_atomlookup_init, but optimized for atoms involved in settle */
-gmx_mtop_atomlookup_t
-gmx_mtop_atomlookup_settle_init(const gmx_mtop_t *mtop);
-
-/* Destroy a gmx_mtop_atomlookup_t data structure */
-void
-gmx_mtop_atomlookup_destroy(gmx_mtop_atomlookup_t alook);
-
-
-/* Returns a pointer to the t_atom struct belonging to atnr_global.
- * This can be an expensive operation, so if possible use
- * one of the atom loop constructs below.
- */
-void
-gmx_mtop_atomnr_to_atom(const gmx_mtop_atomlookup_t alook,
-                        int                         atnr_global,
-                        t_atom                    **atom);
-
-
-/* Returns a pointer to the molecule interaction array ilist_mol[F_NRE]
- * and the local atom number in the molecule belonging to atnr_global.
- */
-void
-gmx_mtop_atomnr_to_ilist(const gmx_mtop_atomlookup_t alook,
-                         int atnr_global,
-                         t_ilist **ilist_mol, int *atnr_offset);
-
-
-/* Returns the molecule block index
- * and the molecule number in the block
- * and the atom number offset for the atom indices in moltype
- * belonging to atnr_global.
- */
-void
-gmx_mtop_atomnr_to_molblock_ind(const gmx_mtop_atomlookup_t alook,
-                                int atnr_global,
-                                int *molb, int *molnr, int *atnr_mol);
-
-
-/* Returns atom name, global resnr and residue name  of atom atnr_global */
-void
-gmx_mtop_atominfo_global(const gmx_mtop_t *mtop, int atnr_global,
-                         char **atomname, int *resnr, char **resname);
-
-
 /* Abstract type for atom loop over all atoms */
 typedef struct gmx_mtop_atomloop_all *gmx_mtop_atomloop_all_t;
 
@@ -153,7 +103,7 @@ gmx_mtop_atomloop_all_init(const gmx_mtop_t *mtop);
  */
 gmx_bool
 gmx_mtop_atomloop_all_next(gmx_mtop_atomloop_all_t aloop,
-                           int *at_global, t_atom **atom);
+                           int *at_global, const t_atom **atom);
 
 /* Return the atomname, the residue number and residue name
  * of the current atom in the loop.
@@ -193,7 +143,7 @@ gmx_mtop_atomloop_block_init(const gmx_mtop_t *mtop);
  */
 gmx_bool
 gmx_mtop_atomloop_block_next(gmx_mtop_atomloop_block_t aloop,
-                             t_atom **atom, int *nmol);
+                             const t_atom **atom, int *nmol);
 
 
 /* Abstract type for ilist loop over all ilists */
@@ -253,7 +203,7 @@ gmx_mtop_global_atoms(const gmx_mtop_t *mtop);
 
 
 /* Generate a 'local' topology for the whole system.
- * When feeEnergyInteractionsAtEnd == true, the free energy interactions will
+ * When freeEnergyInteractionsAtEnd == true, the free energy interactions will
  * be sorted to the end.
  */
 gmx_localtop_t *
@@ -261,10 +211,14 @@ gmx_mtop_generate_local_top(const gmx_mtop_t *mtop, bool freeEnergyInteractionsA
 
 
 /* Converts a gmx_mtop_t struct to t_topology.
- * All memory relating only to mtop will be freed.
+ *
+ * If freeMTop == true, memory related to mtop will be freed so that done_top()
+ * on the result value will free all memory.
+ * If freeMTop == false, mtop and the return value will share some of their
+ * memory, and there is currently no way to consistently free all the memory.
  */
 t_topology
-gmx_mtop_t_to_t_topology(gmx_mtop_t *mtop);
+gmx_mtop_t_to_t_topology(gmx_mtop_t *mtop, bool freeMTop);
 
 /*! \brief Get vector of atoms indices from topology
  *
@@ -275,4 +229,20 @@ gmx_mtop_t_to_t_topology(gmx_mtop_t *mtop);
  */
 std::vector<size_t> get_atom_index(const gmx_mtop_t *mtop);
 
+/*! \brief Converts a t_atoms struct to an mtop struct
+ *
+ * All pointers contained in \p atoms will be copied into \p mtop.
+ * Note that this will produce one moleculetype encompassing the whole system.
+ *
+ * \param[in]  symtab  The symbol table
+ * \param[in]  name    Pointer to the name for the topology
+ * \param[in]  atoms   The atoms to convert
+ * \param[out] mtop    The molecular topology output containing atoms.
+ */
+void
+convertAtomsToMtop(t_symtab    *symtab,
+                   char       **name,
+                   t_atoms     *atoms,
+                   gmx_mtop_t  *mtop);
+
 #endif
index 50485b318f8c0c1365945114c4019d39802fbdb9..b7d189f4cceff51fddec45a41ca7ae9a840e64ff 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2013,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.
@@ -66,8 +66,8 @@ gmx_residuetype_init(gmx_residuetype_t **prt)
     *prt = rt;
 
     rt->n        = 0;
-    rt->resname  = NULL;
-    rt->restype  = NULL;
+    rt->resname  = nullptr;
+    rt->restype  = nullptr;
 
     db = libopen("residuetypes.dat");
 
@@ -158,7 +158,7 @@ gmx_residuetype_get_alltypes(gmx_residuetype_t   *rt,
                              int *                ntypes)
 {
     int          n           = 0;
-    const char **my_typename = NULL;
+    const char **my_typename = nullptr;
 
     if (rt->n > 0)
     {
@@ -280,6 +280,6 @@ gmx_residuetype_get_name(gmx_residuetype_t *rt, int index)
     }
     else
     {
-        return NULL;
+        return nullptr;
     }
 }
index 235863d7f4c30b2be1a877b68a8e5c9fb8d181d8..55d3a59d47e343ae1dc4eaaaa996efeb496ded2a 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,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.
@@ -57,6 +57,9 @@ static char *trim_string(const char *s, char *out, int maxlen)
  * Returns a pointer to a static area which contains a copy
  * of s without leading or trailing spaces. Strings are
  * truncated to BUFSIZE positions.
+ *
+ * TODO This partially duplicates code in trim(), but perhaps
+ * replacing symtab with a std::map is a better fix.
  */
 {
     int len, i;
@@ -67,7 +70,7 @@ static char *trim_string(const char *s, char *out, int maxlen)
                   s, strlen(s), maxlen-1);
     }
 
-    for (; (*s) && ((*s) == ' '); s++)
+    for (; (*s) == ' '; s++)
     {
         ;
     }
@@ -97,7 +100,7 @@ int lookup_symtab(t_symtab *symtab, char **name)
 
     base   = 0;
     symbuf = symtab->symbuf;
-    while (symbuf != NULL)
+    while (symbuf != nullptr)
     {
         const int index = name-symbuf->buf;
         if ( ( index >= 0 ) && ( index < symbuf->bufsize ) )
@@ -119,7 +122,7 @@ char **get_symtab_handle(t_symtab *symtab, int name)
     t_symbuf *symbuf;
 
     symbuf = symtab->symbuf;
-    while (symbuf != NULL)
+    while (symbuf != nullptr)
     {
         if (name < symbuf->bufsize)
         {
@@ -132,7 +135,7 @@ char **get_symtab_handle(t_symtab *symtab, int name)
         }
     }
     gmx_fatal(FARGS, "symtab get_symtab_handle %d not found", name);
-    return NULL;
+    return nullptr;
 }
 
 static t_symbuf *new_symbuf(void)
@@ -142,7 +145,7 @@ static t_symbuf *new_symbuf(void)
     snew(symbuf, 1);
     symbuf->bufsize = TABLESIZE;
     snew(symbuf->buf, symbuf->bufsize);
-    symbuf->next = NULL;
+    symbuf->next = nullptr;
 
     return symbuf;
 }
@@ -153,7 +156,7 @@ static char **enter_buf(t_symtab *symtab, char *name)
     t_symbuf    *symbuf;
     gmx_bool     bCont;
 
-    if (symtab->symbuf == NULL)
+    if (symtab->symbuf == nullptr)
     {
         symtab->symbuf = new_symbuf();
     }
@@ -163,7 +166,7 @@ static char **enter_buf(t_symtab *symtab, char *name)
     {
         for (i = 0; (i < symbuf->bufsize); i++)
         {
-            if (symbuf->buf[i] == NULL)
+            if (symbuf->buf[i] == nullptr)
             {
                 symtab->nr++;
                 symbuf->buf[i] = gmx_strdup(name);
@@ -174,7 +177,7 @@ static char **enter_buf(t_symtab *symtab, char *name)
                 return &(symbuf->buf[i]);
             }
         }
-        if (symbuf->next != NULL)
+        if (symbuf->next != nullptr)
         {
             symbuf = symbuf->next;
             bCont  = TRUE;
@@ -204,7 +207,7 @@ char **put_symtab(t_symtab *symtab, const char *name)
 void open_symtab(t_symtab *symtab)
 {
     symtab->nr     = 0;
-    symtab->symbuf = NULL;
+    symtab->symbuf = nullptr;
 }
 
 void close_symtab(t_symtab gmx_unused *symtab)
@@ -218,7 +221,7 @@ void done_symtab(t_symtab *symtab)
 
     close_symtab(symtab);
     symbuf = symtab->symbuf;
-    while (symbuf != NULL)
+    while (symbuf != nullptr)
     {
         for (i = 0; (i < symbuf->bufsize) && (i < symtab->nr); i++)
         {
@@ -230,7 +233,7 @@ void done_symtab(t_symtab *symtab)
         symbuf  = symbuf->next;
         sfree(freeptr);
     }
-    symtab->symbuf = NULL;
+    symtab->symbuf = nullptr;
     if (symtab->nr != 0)
     {
         gmx_incons("Freeing symbol table (symtab) structure");
@@ -243,14 +246,14 @@ void free_symtab(t_symtab *symtab)
 
     close_symtab(symtab);
     symbuf = symtab->symbuf;
-    while (symbuf != NULL)
+    while (symbuf != nullptr)
     {
         symtab->nr -= std::min(symbuf->bufsize, symtab->nr);
         freeptr     = symbuf;
         symbuf      = symbuf->next;
         sfree(freeptr);
     }
-    symtab->symbuf = NULL;
+    symtab->symbuf = nullptr;
     if (symtab->nr != 0)
     {
         gmx_incons("Freeing symbol table (symtab) structure");
@@ -268,7 +271,7 @@ void pr_symtab(FILE *fp, int indent, const char *title, t_symtab *symtab)
         i      = 0;
         nr     = symtab->nr;
         symbuf = symtab->symbuf;
-        while (symbuf != NULL)
+        while (symbuf != nullptr)
         {
             for (j = 0; (j < symbuf->bufsize) && (j < nr); j++)
             {
index d395e58c5fd29174ace16862dd22c0fe266f5a60..40213d9a5b534aa05304fa8a4a82aad863a6252b 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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,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.
@@ -75,6 +75,8 @@ void close_symtab(t_symtab *symtab);
 /* Undoes the effect of open_symtab(), after invoking this function,
  * no value can be added to the symbol table, only values can be
  * retrieved using get_symtab().
+ *
+ * Note that this does no work.
  */
 
 void free_symtab(t_symtab *symtab);
index c2d0f602ccce840000bd45c4c8113cf067deebca..ac9ec0d9bb6f0bf7e3d01588e2dfd69225f0918b 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,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.
 #include <algorithm>
 
 #include "gromacs/math/vecdump.h"
+#include "gromacs/topology/atoms.h"
+#include "gromacs/topology/idef.h"
 #include "gromacs/topology/ifunc.h"
 #include "gromacs/topology/symtab.h"
+#include "gromacs/utility/compare.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/strconvert.h"
 #include "gromacs/utility/txtdump.h"
 
 const char *gtypes[egcNR+1] = {
     "T-Coupling", "Energy Mon.", "Acceleration", "Freeze",
-    "User1", "User2", "VCM", "Compressed X", "Or. Res. Fit", "QMMM", NULL
+    "User1", "User2", "VCM", "Compressed X", "Or. Res. Fit", "QMMM", nullptr
 };
 
 static void init_groups(gmx_groups_t *groups)
 {
     groups->ngrpname = 0;
-    groups->grpname  = NULL;
+    groups->grpname  = nullptr;
     for (int g = 0; g < egcNR; g++)
     {
-        groups->grps[g].nm_ind = NULL;
+        groups->grps[g].nm_ind = nullptr;
         groups->ngrpnr[g]      = 0;
-        groups->grpnr[g]       = NULL;
+        groups->grpnr[g]       = nullptr;
     }
 
 }
 
 void init_mtop(gmx_mtop_t *mtop)
 {
-    mtop->name         = NULL;
+    mtop->name         = nullptr;
     mtop->nmoltype     = 0;
-    mtop->moltype      = NULL;
+    mtop->moltype      = nullptr;
     mtop->nmolblock    = 0;
-    mtop->molblock     = NULL;
+    mtop->molblock     = nullptr;
     mtop->maxres_renum = 0;
     mtop->maxresnr     = -1;
     init_groups(&mtop->groups);
@@ -83,7 +86,7 @@ void init_mtop(gmx_mtop_t *mtop)
 
 void init_top(t_topology *top)
 {
-    top->name = NULL;
+    top->name = nullptr;
     init_atom(&(top->atoms));
     init_atomtypes(&(top->atomtypes));
     init_block(&top->cgs);
@@ -120,15 +123,38 @@ void done_molblock(gmx_molblock_t *molb)
     }
 }
 
-void done_mtop(gmx_mtop_t *mtop, gmx_bool bDoneSymtab)
+void done_gmx_groups_t(gmx_groups_t *g)
 {
-    if (bDoneSymtab)
+    int i;
+
+    for (i = 0; (i < egcNR); i++)
     {
-        done_symtab(&mtop->symtab);
+        if (nullptr != g->grps[i].nm_ind)
+        {
+            sfree(g->grps[i].nm_ind);
+            g->grps[i].nm_ind = nullptr;
+        }
+        if (nullptr != g->grpnr[i])
+        {
+            sfree(g->grpnr[i]);
+            g->grpnr[i] = nullptr;
+        }
     }
+    /* The contents of this array is in symtab, don't free it here */
+    sfree(g->grpname);
+}
+
+void done_mtop(gmx_mtop_t *mtop)
+{
+    done_symtab(&mtop->symtab);
 
     sfree(mtop->ffparams.functype);
     sfree(mtop->ffparams.iparams);
+    for (int i = 0; i < mtop->ffparams.cmap_grid.ngrid; i++)
+    {
+        sfree(mtop->ffparams.cmap_grid.cmapdata[i].cmap);
+    }
+    sfree(mtop->ffparams.cmap_grid.cmapdata);
 
     for (int i = 0; i < mtop->nmoltype; i++)
     {
@@ -140,6 +166,8 @@ void done_mtop(gmx_mtop_t *mtop, gmx_bool bDoneSymtab)
         done_molblock(&mtop->molblock[i]);
     }
     sfree(mtop->molblock);
+    done_atomtypes(&mtop->atomtypes);
+    done_gmx_groups_t(&mtop->groups);
     done_block(&mtop->mols);
 }
 
@@ -150,7 +178,7 @@ void done_top(t_topology *top)
     for (int f = 0; f < F_NRE; ++f)
     {
         sfree(top->idef.il[f].iatoms);
-        top->idef.il[f].iatoms = NULL;
+        top->idef.il[f].iatoms = nullptr;
         top->idef.il[f].nalloc = 0;
     }
 
@@ -165,6 +193,64 @@ void done_top(t_topology *top)
     done_blocka(&(top->excls));
 }
 
+void done_top_mtop(t_topology *top, gmx_mtop_t *mtop)
+{
+    if (mtop != nullptr)
+    {
+        if (top != nullptr)
+        {
+            for (int f = 0; f < F_NRE; ++f)
+            {
+                sfree(top->idef.il[f].iatoms);
+                top->idef.il[f].iatoms = nullptr;
+                top->idef.il[f].nalloc = 0;
+            }
+            done_atom(&top->atoms);
+            done_block(&top->cgs);
+            done_blocka(&top->excls);
+            done_symtab(&top->symtab);
+            open_symtab(&mtop->symtab);
+        }
+        done_mtop(mtop);
+    }
+}
+
+bool gmx_mtop_has_masses(const gmx_mtop_t *mtop)
+{
+    if (mtop == nullptr)
+    {
+        return false;
+    }
+    return mtop->nmoltype == 0 || mtop->moltype[0].atoms.haveMass;
+}
+
+bool gmx_mtop_has_charges(const gmx_mtop_t *mtop)
+{
+    if (mtop == nullptr)
+    {
+        return false;
+    }
+    return mtop->nmoltype == 0 || mtop->moltype[0].atoms.haveCharge;
+}
+
+bool gmx_mtop_has_atomtypes(const gmx_mtop_t *mtop)
+{
+    if (mtop == nullptr)
+    {
+        return false;
+    }
+    return mtop->nmoltype == 0 || mtop->moltype[0].atoms.haveType;
+}
+
+bool gmx_mtop_has_pdbinfo(const gmx_mtop_t *mtop)
+{
+    if (mtop == nullptr)
+    {
+        return false;
+    }
+    return mtop->nmoltype == 0 || mtop->moltype[0].atoms.havePdbInfo;
+}
+
 static void pr_grps(FILE *fp, const char *title, const t_grps grps[], char **grpname[])
 {
     int i, j;
@@ -236,7 +322,7 @@ static void pr_groups(FILE *fp, int indent,
 static void pr_moltype(FILE *fp, int indent, const char *title,
                        const gmx_moltype_t *molt, int n,
                        const gmx_ffparams_t *ffparams,
-                       gmx_bool bShowNumbers)
+                       gmx_bool bShowNumbers, gmx_bool bShowParameters)
 {
     int j;
 
@@ -249,7 +335,8 @@ static void pr_moltype(FILE *fp, int indent, const char *title,
     for (j = 0; (j < F_NRE); j++)
     {
         pr_ilist(fp, indent, interaction_function[j].longname,
-                 ffparams->functype, &molt->ilist[j], bShowNumbers);
+                 ffparams->functype, &molt->ilist[j],
+                 bShowNumbers, bShowParameters, ffparams->iparams);
     }
 }
 
@@ -276,7 +363,7 @@ static void pr_molblock(FILE *fp, int indent, const char *title,
 }
 
 void pr_mtop(FILE *fp, int indent, const char *title, const gmx_mtop_t *mtop,
-             gmx_bool bShowNumbers)
+             gmx_bool bShowNumbers, gmx_bool bShowParameters)
 {
     int mt, mb, j;
 
@@ -299,7 +386,8 @@ void pr_mtop(FILE *fp, int indent, const char *title, const gmx_mtop_t *mtop,
             {
                 pr_ilist(fp, indent, interaction_function[j].longname,
                          mtop->ffparams.functype,
-                         &mtop->intermolecular_ilist[j], bShowNumbers);
+                         &mtop->intermolecular_ilist[j],
+                         bShowNumbers, bShowParameters, mtop->ffparams.iparams);
             }
         }
         pr_ffparams(fp, indent, "ffparams", &(mtop->ffparams), bShowNumbers);
@@ -307,13 +395,14 @@ void pr_mtop(FILE *fp, int indent, const char *title, const gmx_mtop_t *mtop,
         for (mt = 0; mt < mtop->nmoltype; mt++)
         {
             pr_moltype(fp, indent, "moltype", &mtop->moltype[mt], mt,
-                       &mtop->ffparams, bShowNumbers);
+                       &mtop->ffparams, bShowNumbers, bShowParameters);
         }
         pr_groups(fp, indent, &mtop->groups, bShowNumbers);
     }
 }
 
-void pr_top(FILE *fp, int indent, const char *title, const t_topology *top, gmx_bool bShowNumbers)
+void pr_top(FILE *fp, int indent, const char *title, const t_topology *top,
+            gmx_bool bShowNumbers, gmx_bool bShowParameters)
 {
     if (available(fp, top, indent, title))
     {
@@ -327,6 +416,216 @@ void pr_top(FILE *fp, int indent, const char *title, const t_topology *top, gmx_
         pr_str(fp, indent, "bIntermolecularInteractions",
                gmx::boolToString(top->bIntermolecularInteractions));
         pr_blocka(fp, indent, "excls", &top->excls, bShowNumbers);
-        pr_idef(fp, indent, "idef", &top->idef, bShowNumbers);
+        pr_idef(fp, indent, "idef", &top->idef, bShowNumbers, bShowParameters);
+    }
+}
+
+static void cmp_ilist(FILE *fp, int ftype, const t_ilist *il1, const t_ilist *il2)
+{
+    int  i;
+    char buf[256];
+
+    fprintf(fp, "comparing ilist %s\n", interaction_function[ftype].name);
+    sprintf(buf, "%s->nr", interaction_function[ftype].name);
+    cmp_int(fp, buf, -1, il1->nr, il2->nr);
+    sprintf(buf, "%s->iatoms", interaction_function[ftype].name);
+    if (((il1->nr > 0) && (!il1->iatoms)) ||
+        ((il2->nr > 0) && (!il2->iatoms)) ||
+        ((il1->nr != il2->nr)))
+    {
+        fprintf(fp, "Comparing radically different topologies - %s is different\n",
+                buf);
+    }
+    else
+    {
+        for (i = 0; (i < il1->nr); i++)
+        {
+            cmp_int(fp, buf, i, il1->iatoms[i], il2->iatoms[i]);
+        }
+    }
+}
+
+static void cmp_iparm(FILE *fp, const char *s, t_functype ft,
+                      const t_iparams &ip1, const t_iparams &ip2, real ftol, real abstol)
+{
+    int      i;
+    gmx_bool bDiff;
+
+    bDiff = FALSE;
+    for (i = 0; i < MAXFORCEPARAM && !bDiff; i++)
+    {
+        bDiff = !equal_real(ip1.generic.buf[i], ip2.generic.buf[i], ftol, abstol);
+    }
+    if (bDiff)
+    {
+        fprintf(fp, "%s1: ", s);
+        pr_iparams(fp, ft, &ip1);
+        fprintf(fp, "%s2: ", s);
+        pr_iparams(fp, ft, &ip2);
+    }
+}
+
+static void cmp_iparm_AB(FILE *fp, const char *s, t_functype ft,
+                         const t_iparams &ip1, real ftol, real abstol)
+{
+    int      nrfpA, nrfpB, p0, i;
+    gmx_bool bDiff;
+
+    /* Normally the first parameter is perturbable */
+    p0    = 0;
+    nrfpA = interaction_function[ft].nrfpA;
+    nrfpB = interaction_function[ft].nrfpB;
+    if (ft == F_PDIHS)
+    {
+        nrfpB = 2;
+    }
+    else if (interaction_function[ft].flags & IF_TABULATED)
+    {
+        /* For tabulated interactions only the second parameter is perturbable */
+        p0    = 1;
+        nrfpB = 1;
+    }
+    bDiff = FALSE;
+    for (i = 0; i < nrfpB && !bDiff; i++)
+    {
+        bDiff = !equal_real(ip1.generic.buf[p0+i], ip1.generic.buf[nrfpA+i], ftol, abstol);
+    }
+    if (bDiff)
+    {
+        fprintf(fp, "%s: ", s);
+        pr_iparams(fp, ft, &ip1);
+    }
+}
+
+static void cmp_cmap(FILE *fp, const gmx_cmap_t *cmap1, const gmx_cmap_t *cmap2, real ftol, real abstol)
+{
+    cmp_int(fp, "cmap ngrid", -1, cmap1->ngrid, cmap2->ngrid);
+    cmp_int(fp, "cmap grid_spacing", -1, cmap1->grid_spacing, cmap2->grid_spacing);
+    if (cmap1->ngrid == cmap2->ngrid &&
+        cmap1->grid_spacing == cmap2->grid_spacing)
+    {
+        int g;
+
+        for (g = 0; g < cmap1->ngrid; g++)
+        {
+            int i;
+
+            fprintf(fp, "comparing cmap %d\n", g);
+
+            for (i = 0; i < 4*cmap1->grid_spacing*cmap1->grid_spacing; i++)
+            {
+                cmp_real(fp, "", i, cmap1->cmapdata[g].cmap[i], cmap2->cmapdata[g].cmap[i], ftol, abstol);
+            }
+        }
+    }
+}
+
+static void cmp_idef(FILE *fp, const t_idef *id1, const t_idef *id2, real ftol, real abstol)
+{
+    int  i;
+    char buf1[64], buf2[64];
+
+    fprintf(fp, "comparing idef\n");
+    if (id2)
+    {
+        cmp_int(fp, "idef->ntypes", -1, id1->ntypes, id2->ntypes);
+        cmp_int(fp, "idef->atnr",  -1, id1->atnr, id2->atnr);
+        for (i = 0; (i < std::min(id1->ntypes, id2->ntypes)); i++)
+        {
+            sprintf(buf1, "idef->functype[%d]", i);
+            sprintf(buf2, "idef->iparam[%d]", i);
+            cmp_int(fp, buf1, i, (int)id1->functype[i], (int)id2->functype[i]);
+            cmp_iparm(fp, buf2, id1->functype[i],
+                      id1->iparams[i], id2->iparams[i], ftol, abstol);
+        }
+        cmp_real(fp, "fudgeQQ", -1, id1->fudgeQQ, id2->fudgeQQ, ftol, abstol);
+        cmp_cmap(fp, &id1->cmap_grid, &id2->cmap_grid, ftol, abstol);
+        for (i = 0; (i < F_NRE); i++)
+        {
+            cmp_ilist(fp, i, &(id1->il[i]), &(id2->il[i]));
+        }
+    }
+    else
+    {
+        for (i = 0; (i < id1->ntypes); i++)
+        {
+            cmp_iparm_AB(fp, "idef->iparam", id1->functype[i], id1->iparams[i], ftol, abstol);
+        }
+    }
+}
+
+static void cmp_block(FILE *fp, const t_block *b1, const t_block *b2, const char *s)
+{
+    char buf[32];
+
+    fprintf(fp, "comparing block %s\n", s);
+    sprintf(buf, "%s.nr", s);
+    cmp_int(fp, buf, -1, b1->nr, b2->nr);
+}
+
+static void cmp_blocka(FILE *fp, const t_blocka *b1, const t_blocka *b2, const char *s)
+{
+    char buf[32];
+
+    fprintf(fp, "comparing blocka %s\n", s);
+    sprintf(buf, "%s.nr", s);
+    cmp_int(fp, buf, -1, b1->nr, b2->nr);
+    sprintf(buf, "%s.nra", s);
+    cmp_int(fp, buf, -1, b1->nra, b2->nra);
+}
+
+void cmp_top(FILE *fp, const t_topology *t1, const t_topology *t2, real ftol, real abstol)
+{
+    fprintf(fp, "comparing top\n");
+    if (t2)
+    {
+        cmp_idef(fp, &(t1->idef), &(t2->idef), ftol, abstol);
+        cmp_atoms(fp, &(t1->atoms), &(t2->atoms), ftol, abstol);
+        cmp_block(fp, &t1->cgs, &t2->cgs, "cgs");
+        cmp_block(fp, &t1->mols, &t2->mols, "mols");
+        cmp_bool(fp, "bIntermolecularInteractions", -1, t1->bIntermolecularInteractions, t2->bIntermolecularInteractions);
+        cmp_blocka(fp, &t1->excls, &t2->excls, "excls");
+    }
+    else
+    {
+        cmp_idef(fp, &(t1->idef), nullptr, ftol, abstol);
+        cmp_atoms(fp, &(t1->atoms), nullptr, ftol, abstol);
+    }
+}
+
+void cmp_groups(FILE *fp, const gmx_groups_t *g0, const gmx_groups_t *g1,
+                int natoms0, int natoms1)
+{
+    int  i, j;
+    char buf[32];
+
+    fprintf(fp, "comparing groups\n");
+
+    for (i = 0; i < egcNR; i++)
+    {
+        sprintf(buf, "grps[%d].nr", i);
+        cmp_int(fp, buf, -1, g0->grps[i].nr, g1->grps[i].nr);
+        if (g0->grps[i].nr == g1->grps[i].nr)
+        {
+            for (j = 0; j < g0->grps[i].nr; j++)
+            {
+                sprintf(buf, "grps[%d].name[%d]", i, j);
+                cmp_str(fp, buf, -1,
+                        *g0->grpname[g0->grps[i].nm_ind[j]],
+                        *g1->grpname[g1->grps[i].nm_ind[j]]);
+            }
+        }
+        cmp_int(fp, "ngrpnr", i, g0->ngrpnr[i], g1->ngrpnr[i]);
+        if (g0->ngrpnr[i] == g1->ngrpnr[i] && natoms0 == natoms1 &&
+            (g0->grpnr[i] != nullptr || g1->grpnr[i] != nullptr))
+        {
+            for (j = 0; j < natoms0; j++)
+            {
+                cmp_int(fp, gtypes[i], j, ggrpnr(g0, i, j), ggrpnr(g1, i, j));
+            }
+        }
     }
+    /* We have compared the names in the groups lists,
+     * so we can skip the grpname list comparison.
+     */
 }
index 5d3426ccaffa827e17fee744425b31564e3f7b91..89c40bfc0816819247c06a9e7423b45ee58c781e 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,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.
 #include "gromacs/topology/idef.h"
 #include "gromacs/topology/symtab.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 enum {
     egcTC,    egcENER,   egcACC, egcFREEZE,
     egcUser1, egcUser2,  egcVCM, egcCompressedX,
@@ -67,15 +63,22 @@ typedef struct gmx_moltype_t
     t_blocka        excls;        /* The exclusions                       */
 } gmx_moltype_t;
 
+/*! \brief Block of molecules of the same type, used in gmx_mtop_t */
 typedef struct gmx_molblock_t
 {
-    int            type;        /* The molcule type index in mtop.moltype */
-    int            nmol;        /* The number of molecules in this block  */
-    int            natoms_mol;  /* The number of atoms in one molecule    */
-    int            nposres_xA;  /* The number of posres coords for top A  */
-    rvec          *posres_xA;   /* The posres coords for top A            */
-    int            nposres_xB;  /* The number of posres coords for top B  */
-    rvec          *posres_xB;   /* The posres coords for top B            */
+    int     type;               /**< The molecule type index in mtop.moltype  */
+    int     nmol;               /**< The number of molecules in this block    */
+    int     nposres_xA;         /**< The number of posres coords for top A    */
+    rvec   *posres_xA;          /**< Position restraint coordinates for top A */
+    int     nposres_xB;         /**< The number of posres coords for top B    */
+    rvec   *posres_xB;          /**< Position restraint coordinates for top B */
+
+    /* Convenience information, derived from other gmx_mtop_t contents     */
+    int     natoms_mol;         /**< The number of atoms in one molecule      */
+    int     globalAtomStart;    /**< Global atom index of the first atom in the block */
+    int     globalAtomEnd;      /**< Global atom index + 1 of the last atom in the block */
+    int     globalResidueStart; /**< Global residue index of the first residue in the block */
+    int     residueNumberStart; /**< Residue numbers start from this value if the number of residues per molecule is <= maxres_renum */
 } gmx_molblock_t;
 
 typedef struct gmx_groups_t
@@ -144,18 +147,25 @@ void init_mtop(gmx_mtop_t *mtop);
 void init_top(t_topology *top);
 void done_moltype(gmx_moltype_t *molt);
 void done_molblock(gmx_molblock_t *molb);
-void done_mtop(gmx_mtop_t *mtop, gmx_bool bDoneSymtab);
+void done_gmx_groups_t(gmx_groups_t *g);
+void done_mtop(gmx_mtop_t *mtop);
 void done_top(t_topology *top);
+// Frees both t_topology and gmx_mtop_t when the former has been created from
+// the latter.
+void done_top_mtop(t_topology *top, gmx_mtop_t *mtop);
 
-t_atoms *mtop2atoms(gmx_mtop_t *mtop);
-/* generate a t_atoms struct for the system from gmx_mtop_t */
+bool gmx_mtop_has_masses(const gmx_mtop_t *mtop);
+bool gmx_mtop_has_charges(const gmx_mtop_t *mtop);
+bool gmx_mtop_has_atomtypes(const gmx_mtop_t *mtop);
+bool gmx_mtop_has_pdbinfo(const gmx_mtop_t *mtop);
 
 void pr_mtop(FILE *fp, int indent, const char *title, const gmx_mtop_t *mtop,
-             gmx_bool bShowNumbers);
-void pr_top(FILE *fp, int indent, const char *title, const t_topology *top, gmx_bool bShowNumbers);
+             gmx_bool bShowNumbers, gmx_bool bShowParameters);
+void pr_top(FILE *fp, int indent, const char *title, const t_topology *top,
+            gmx_bool bShowNumbers, gmx_bool bShowParameters);
 
-#ifdef __cplusplus
-}
-#endif
+void cmp_top(FILE *fp, const t_topology *t1, const t_topology *t2, real ftol, real abstol);
+void cmp_groups(FILE *fp, const gmx_groups_t *g0, const gmx_groups_t *g1,
+                int natoms0, int natoms1);
 
 #endif
index de8e9850a072b1697f3b4625bfb38b508ff08872..4c3a7e80cec9364a9d8e906361d3596a9b6a377f 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, by the GROMACS development team, led by
+ * 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.
@@ -209,13 +209,13 @@ void gmx_sort_ilist_fe(t_idef *idef, const real *qA, const real *qB)
     t_iatom   *iabuf;
     int        iabuf_nalloc;
 
-    if (qB == NULL)
+    if (qB == nullptr)
     {
         qB = qA;
     }
 
     iabuf_nalloc = 0;
-    iabuf        = NULL;
+    iabuf        = nullptr;
 
     iparams = idef->iparams;
 
index 3bcbd3ced459f4c8407962817d14c524b37f593b..e6f935930714e163a23c2dab294c4eb239263bbc 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2015, by the GROMACS development team, led by
+# Copyright (c) 2015,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.
 # To help us fund GROMACS development, we humbly ask that you cite
 # the research papers on the package. Check out http://www.gromacs.org.
 
+gmx_add_libgromacs_sources(
+    trajectoryframe.cpp
+    )
+
 gmx_install_headers(
     energy.h
     trajectoryframe.h
     )
-
diff --git a/src/gromacs/trajectory/trajectoryframe.cpp b/src/gromacs/trajectory/trajectoryframe.cpp
new file mode 100644 (file)
index 0000000..7508d1c
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+#include "gmxpre.h"
+
+#include "trajectoryframe.h"
+
+#include <cstdio>
+
+#include <algorithm>
+
+#include "gromacs/math/veccompare.h"
+#include "gromacs/topology/atoms.h"
+#include "gromacs/utility/compare.h"
+#include "gromacs/utility/smalloc.h"
+
+void comp_frame(FILE *fp, t_trxframe *fr1, t_trxframe *fr2,
+                gmx_bool bRMSD, real ftol, real abstol)
+{
+    fprintf(fp, "\n");
+    cmp_int(fp, "not_ok", -1, fr1->not_ok, fr2->not_ok);
+    cmp_int(fp, "natoms", -1, fr1->natoms, fr2->natoms);
+    if (cmp_bool(fp, "bStep", -1, fr1->bStep, fr2->bStep))
+    {
+        cmp_int(fp, "step", -1, fr1->step, fr2->step);
+    }
+    cmp_int(fp, "step", -1, fr1->step, fr2->step);
+    if (cmp_bool(fp, "bTime", -1, fr1->bTime, fr2->bTime))
+    {
+        cmp_real(fp, "time", -1, fr1->time, fr2->time, ftol, abstol);
+    }
+    if (cmp_bool(fp, "bLambda", -1, fr1->bLambda, fr2->bLambda))
+    {
+        cmp_real(fp, "lambda", -1, fr1->lambda, fr2->lambda, ftol, abstol);
+    }
+    if (cmp_bool(fp, "bAtoms", -1, fr1->bAtoms, fr2->bAtoms))
+    {
+        cmp_atoms(fp, fr1->atoms, fr2->atoms, ftol, abstol);
+    }
+    if (cmp_bool(fp, "bPrec", -1, fr1->bPrec, fr2->bPrec))
+    {
+        cmp_real(fp, "prec", -1, fr1->prec, fr2->prec, ftol, abstol);
+    }
+    if (cmp_bool(fp, "bX", -1, fr1->bX, fr2->bX))
+    {
+        cmp_rvecs(fp, "x", std::min(fr1->natoms, fr2->natoms), fr1->x, fr2->x, bRMSD, ftol, abstol);
+    }
+    if (cmp_bool(fp, "bV", -1, fr1->bV, fr2->bV))
+    {
+        cmp_rvecs(fp, "v", std::min(fr1->natoms, fr2->natoms), fr1->v, fr2->v, bRMSD, ftol, abstol);
+    }
+    if (cmp_bool(fp, "bF", -1, fr1->bF, fr2->bF))
+    {
+        cmp_rvecs(fp, "f", std::min(fr1->natoms, fr2->natoms), fr1->f, fr2->f, bRMSD, ftol, abstol);
+    }
+    if (cmp_bool(fp, "bBox", -1, fr1->bBox, fr2->bBox))
+    {
+        cmp_rvecs(fp, "box", 3, fr1->box, fr2->box, FALSE, ftol, abstol);
+    }
+}
+
+void done_frame(t_trxframe *frame)
+{
+    if (frame->atoms)
+    {
+        done_atom(frame->atoms);
+        sfree(frame->atoms);
+    }
+    sfree(frame->x);
+    sfree(frame->v);
+    sfree(frame->f);
+}
index f329947fe6b987731d592bb116722865b64efdec..3901eaaef71daabab692c0447ca2c539cf6ed9ea 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,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.
  * Do not try to use a pointer when its gmx_bool is FALSE, as memory might
  * not be allocated.
  */
-
 #ifndef GMX_TRAJECTORY_TRX_H
 #define GMX_TRAJECTORY_TRX_H
 
+#include <cstdio>
+
 #include "gromacs/math/vectypes.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/real.h"
@@ -54,8 +55,6 @@ typedef struct t_trxframe
     int             not_ok;    /* integrity flags                  */
     gmx_bool        bDouble;   /* Double precision?                */
     int             natoms;    /* number of atoms (atoms, x, v, f, index) */
-    gmx_bool        bTitle;
-    const char     *title;     /* title of the frame            */
     gmx_bool        bStep;
     gmx_int64_t     step;      /* MD step number                   */
     gmx_bool        bTime;
@@ -82,4 +81,9 @@ typedef struct t_trxframe
     int            *index;     /* atom indices of contained coordinates */
 } t_trxframe;
 
+void comp_frame(FILE *fp, t_trxframe *fr1, t_trxframe *fr2,
+                gmx_bool bRMSD, real ftol, real abstol);
+
+void done_frame(t_trxframe *frame);
+
 #endif
index fab17441dd41c7107b98fd58a0a5314703d86130..716368b9747e13f57e55187e20df19ed16789fc9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -345,12 +345,12 @@ AbstractAnalysisData &TrajectoryAnalysisModule::datasetFromName(const char *name
 void TrajectoryAnalysisModule::registerBasicDataset(AbstractAnalysisData *data,
                                                     const char           *name)
 {
-    GMX_RELEASE_ASSERT(data != NULL, "Attempting to register NULL data");
+    GMX_RELEASE_ASSERT(data != nullptr, "Attempting to register NULL data");
     // TODO: Strong exception safety should be possible to implement.
     GMX_RELEASE_ASSERT(impl_->datasets_.find(name) == impl_->datasets_.end(),
                        "Duplicate data set name registered");
     impl_->datasets_[name] = data;
-    impl_->datasetNames_.push_back(name);
+    impl_->datasetNames_.emplace_back(name);
 }
 
 
index e8559c04d20c3a9d4e1209f775282b85320d6ef4..4b1e935be6f6dac724448977dccd0a14cac54f14 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -46,6 +46,7 @@
 #include "gromacs/commandline/cmdlineoptionsmodule.h"
 #include "gromacs/fileio/trxio.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/topology/mtop_util.h"
 #include "gromacs/topology/topology.h"
 #include "gromacs/utility/arrayref.h"
 #include "gromacs/utility/exceptions.h"
@@ -185,7 +186,7 @@ TrajectoryAnalysisSettings::setHelpText(const ConstArrayRef<const char *> &help)
  */
 
 TopologyInformation::TopologyInformation()
-    : top_(NULL), bTop_(false), xtop_(NULL), ePBC_(-1)
+    : mtop_(nullptr), top_(nullptr), bTop_(false), xtop_(nullptr), ePBC_(-1)
 {
     clear_mat(boxtop_);
 }
@@ -193,12 +194,21 @@ TopologyInformation::TopologyInformation()
 
 TopologyInformation::~TopologyInformation()
 {
-    if (top_)
+    done_top_mtop(top_, mtop_);
+    sfree(mtop_);
+    sfree(top_);
+    sfree(xtop_);
+}
+
+
+t_topology *TopologyInformation::topology() const
+{
+    if (top_ == nullptr && mtop_ != nullptr)
     {
-        done_top(top_);
-        sfree(top_);
+        snew(top_, 1);
+        *top_ = gmx_mtop_t_to_t_topology(mtop_, false);
     }
-    sfree(xtop_);
+    return top_;
 }
 
 
@@ -213,7 +223,7 @@ TopologyInformation::getTopologyConf(rvec **x, matrix box) const
     {
         if (!xtop_)
         {
-            *x = NULL;
+            *x = nullptr;
             GMX_THROW(APIError("Topology coordinates requested without setting efUseTopX"));
         }
         *x = xtop_;
index 6a34742ec1f9ae039c8ad22e19f80c2807a6caef..f886d0b87954f32ea2bc28133637a5d9a6fc7a34 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,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.
@@ -49,6 +49,7 @@
 #include "gromacs/options/timeunitmanager.h"
 #include "gromacs/utility/classhelpers.h"
 
+struct gmx_mtop_t;
 struct t_topology;
 
 namespace gmx
@@ -253,11 +254,13 @@ class TopologyInformation
 {
     public:
         //! Returns true if a topology file was loaded.
-        bool hasTopology() const { return top_ != NULL; }
+        bool hasTopology() const { return mtop_ != nullptr; }
         //! Returns true if a full topology file was loaded.
         bool hasFullTopology() const { return bTop_; }
         //! Returns the loaded topology, or NULL if not loaded.
-        t_topology *topology() const { return top_; }
+        const gmx_mtop_t *mtop() const { return mtop_; }
+        //! Returns the loaded topology, or NULL if not loaded.
+        t_topology *topology() const;
         //! Returns the ePBC field from the topology.
         int ePBC() const { return ePBC_; }
         /*! \brief
@@ -281,8 +284,10 @@ class TopologyInformation
         TopologyInformation();
         ~TopologyInformation();
 
+        gmx_mtop_t          *mtop_;
         //! The topology structure, or NULL if no topology loaded.
-        t_topology          *top_;
+        // TODO: Replace fully with mtop.
+        mutable t_topology  *top_;
         //! true if full tpx file was loaded, false otherwise.
         bool                 bTop_;
         //! Coordinates from the topology (can be NULL).
index 71992a21f2878372a804138a500a4787716e9ade..77c348ce583c6d252e08040822e4474fee1da6ec 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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -128,7 +128,7 @@ int RunnerModule::run()
     module_->initAfterFirstFrame(settings_, common_.frame());
 
     t_pbc  pbc;
-    t_pbc *ppbc = settings_.hasPBC() ? &pbc : NULL;
+    t_pbc *ppbc = settings_.hasPBC() ? &pbc : nullptr;
 
     int    nframes = 0;
     AnalysisDataParallelOptions         dataOptions;
@@ -138,7 +138,7 @@ int RunnerModule::run()
     {
         common_.initFrame();
         t_trxframe &frame = common_.frame();
-        if (ppbc != NULL)
+        if (ppbc != nullptr)
         {
             set_pbc(ppbc, topology.ePBC(), frame.box);
         }
@@ -151,7 +151,7 @@ int RunnerModule::run()
     }
     while (common_.readNextFrame());
     module_->finishFrames(pdata.get());
-    if (pdata.get() != NULL)
+    if (pdata.get() != nullptr)
     {
         pdata->finish();
     }
@@ -191,7 +191,7 @@ TrajectoryAnalysisCommandLineRunner::runAsMain(
     {
         return createModule(factory());
     };
-    return ICommandLineOptionsModule::runAsMain(argc, argv, NULL, NULL, runnerFactory);
+    return ICommandLineOptionsModule::runAsMain(argc, argv, nullptr, nullptr, runnerFactory);
 }
 
 // static
index 7fc2601f6df577ae02d2d9245c960d2316655d96..94724722169cc6b343f9665d2fa3c676c964e9f5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -53,6 +53,7 @@
 #include "modules/rdf.h"
 #include "modules/sasa.h"
 #include "modules/select.h"
+#include "modules/trajectory.h"
 
 namespace gmx
 {
@@ -96,6 +97,7 @@ void registerTrajectoryAnalysisModules(CommandLineModuleManager *manager)
     registerModule<RdfInfo>(manager, group);
     registerModule<SasaInfo>(manager, group);
     registerModule<SelectInfo>(manager, group);
+    registerModule<TrajectoryInfo>(manager, group);
 }
 //! \endcond
 
index 4304efd0a7732a587d9ebb3dde3a018c8e4af659..058e5329c617a98ce8ada6459f5399acf6b43ee6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,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.
@@ -314,7 +314,7 @@ class Angle : public TrajectoryAnalysisModule
 };
 
 Angle::Angle()
-    : sel1info_(NULL), sel2info_(NULL),
+    : sel1info_(nullptr), sel2info_(nullptr),
       g1type_(Group1Type_Angle), g2type_(Group2Type_None),
       binWidth_(1.0), natoms1_(0), natoms2_(0)
 {
index df8fe70a27ba45860eae26a7c236bc304654b987..c766073734ed8481b65175c85e04ef7be3b46467 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -334,7 +334,7 @@ Distance::analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
             const SelectionPosition &p1 = sel[g].position(i);
             const SelectionPosition &p2 = sel[g].position(i+1);
             rvec                     dx;
-            if (pbc != NULL)
+            if (pbc != nullptr)
             {
                 pbc_dx(pbc, p2.x(), p1.x(), dx);
             }
@@ -345,7 +345,7 @@ Distance::analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
             real dist     = norm(dx);
             bool bPresent = p1.selected() && p2.selected();
             distHandle.setPoint(n, dist, bPresent);
-            xyzHandle.setPoints(n*3, 3, dx);
+            xyzHandle.setPoints(n*3, 3, dx, bPresent);
         }
     }
     distHandle.finishFrame();
index f639d3f6435eac114a23ae69049c92dfd7abdcd8..faa8078eec9cb512973abe6eee208bf1727646ad 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,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.
@@ -317,7 +317,7 @@ FreeVolume::analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
     const Selection                     &sel  = pdata->parallelSelection(sel_);
     gmx::UniformRealDistribution<real>   dist;
 
-    GMX_RELEASE_ASSERT(NULL != pbc, "You have no periodic boundary conditions");
+    GMX_RELEASE_ASSERT(nullptr != pbc, "You have no periodic boundary conditions");
 
     // Analysis framework magic
     dh.startFrame(frnr, fr.time);
index 3091cb4451f299c3891add4012e9a8315eecc36d..72f7417944a668ea8f288687e54a364af529ae7b 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,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.
@@ -238,7 +238,7 @@ PairDistance::initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings
 }
 
 //! Helper function to initialize the grouping for a selection.
-int initSelectionGroups(Selection *sel, t_topology *top, int type)
+int initSelectionGroups(Selection *sel, const gmx_mtop_t *top, int type)
 {
     e_index_t indexType = INDEX_UNKNOWN;
     switch (type)
@@ -256,14 +256,14 @@ void
 PairDistance::initAnalysis(const TrajectoryAnalysisSettings &settings,
                            const TopologyInformation        &top)
 {
-    refGroupCount_ = initSelectionGroups(&refSel_, top.topology(), refGroupType_);
+    refGroupCount_ = initSelectionGroups(&refSel_, top.mtop(), refGroupType_);
 
     maxGroupCount_ = 0;
     distances_.setDataSetCount(sel_.size());
     for (size_t i = 0; i < sel_.size(); ++i)
     {
         const int selGroupCount
-            = initSelectionGroups(&sel_[i], top.topology(), selGroupType_);
+            = initSelectionGroups(&sel_[i], top.mtop(), selGroupType_);
         const int columnCount = refGroupCount_ * selGroupCount;
         maxGroupCount_ = std::max(maxGroupCount_, columnCount);
         distances_.setColumnCount(i, columnCount);
index 958a67b9c6cb071946a4882bf46400af88e29aeb..664682e0abeaecb92e262eef4ac6f76b5a7369e4 100644 (file)
@@ -358,7 +358,7 @@ Rdf::initAnalysis(const TrajectoryAnalysisSettings &settings,
             GMX_THROW(InconsistentInputError("-surf only works with -ref that consists of atoms"));
         }
         const e_index_t type = (surface_ == SurfaceType_Molecule ? INDEX_MOL : INDEX_RES);
-        surfaceGroupCount_ = refSel_.initOriginalIdsToGroup(top.topology(), type);
+        surfaceGroupCount_ = refSel_.initOriginalIdsToGroup(top.mtop(), type);
     }
 
     if (bExclusions_)
index bd440203e22708e8e4a20cd833bab1ae9150305d..de7116cac63dec5fc9d68f1b1bb04e520748843c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2006, The GROMACS development team.
- * Copyright (c) 2008,2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2008,2009,2010,2011,2012,2013,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.
@@ -71,9 +71,9 @@
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/pleasecite.h"
-#include "gromacs/utility/scoped_cptr.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/unique_cptr.h"
 
 #include "surfacearea.h"
 
@@ -217,7 +217,7 @@ void connolly_plot(const char *fn, int ndots, real dots[], rvec x[], t_atoms *at
         srenew(atoms->resinfo, r0+1);
         atoms->atom[i0].resind = r0;
         t_atoms_set_resinfo(atoms, i0, symtab, resnm, r0+1, ' ', 0, ' ');
-        if (atoms->pdbinfo != NULL)
+        if (atoms->pdbinfo != nullptr)
         {
             srenew(atoms->pdbinfo, atoms->nr+ndots);
         }
@@ -234,7 +234,7 @@ void connolly_plot(const char *fn, int ndots, real dots[], rvec x[], t_atoms *at
             xnew[ii0][XX]              = dots[k++];
             xnew[ii0][YY]              = dots[k++];
             xnew[ii0][ZZ]              = dots[k++];
-            if (atoms->pdbinfo != NULL)
+            if (atoms->pdbinfo != nullptr)
             {
                 atoms->pdbinfo[ii0].type   = epdbATOM;
                 atoms->pdbinfo[ii0].atomnr = ii0;
@@ -244,7 +244,7 @@ void connolly_plot(const char *fn, int ndots, real dots[], rvec x[], t_atoms *at
         }
         atoms->nr   = i0+ndots;
         atoms->nres = r0+1;
-        write_sto_conf(fn, title, atoms, xnew, NULL, ePBC, const_cast<rvec *>(box));
+        write_sto_conf(fn, title, atoms, xnew, nullptr, ePBC, const_cast<rvec *>(box));
         atoms->nres = r0;
         atoms->nr   = i0;
     }
@@ -268,7 +268,7 @@ void connolly_plot(const char *fn, int ndots, real dots[], rvec x[], t_atoms *at
             aaa.pdbinfo[ii0].occup  = 0.0;
         }
         aaa.nr = ndots;
-        write_sto_conf(fn, title, &aaa, xnew, NULL, ePBC, const_cast<rvec *>(box));
+        write_sto_conf(fn, title, &aaa, xnew, nullptr, ePBC, const_cast<rvec *>(box));
         do_conect(fn, ndots, xnew);
         done_atom(&aaa);
     }
@@ -394,7 +394,7 @@ class Sasa : public TrajectoryAnalysisModule
 };
 
 Sasa::Sasa()
-    : solsize_(0.14), ndots_(24), dgsDefault_(0), bIncludeSolute_(true), top_(NULL)
+    : solsize_(0.14), ndots_(24), dgsDefault_(0), bIncludeSolute_(true), top_(nullptr)
 {
     //minarea_ = 0.5;
     registerAnalysisDataset(&area_, "area");
@@ -555,7 +555,7 @@ Sasa::initAnalysis(const TrajectoryAnalysisSettings &settings,
         dgsFactor_.reserve(surfaceSel_.posCount());
     }
 
-    const int resCount = surfaceSel_.initOriginalIdsToGroup(top_, INDEX_RES);
+    const int resCount = surfaceSel_.initOriginalIdsToGroup(top.mtop(), INDEX_RES);
 
     // TODO: Not exception-safe, but nice solution would be to have a C++
     // atom properties class...
@@ -924,7 +924,7 @@ Sasa::analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
     // surfacedots contains nsurfacedots entries, and contains the actual
     // points.
     real  totarea, totvolume;
-    real *area = NULL, *surfacedots = NULL;
+    real *area = nullptr, *surfacedots = nullptr;
     int   nsurfacedots;
     calculator_.calculate(surfaceSel.coordinates().data(), pbc,
                           frameData.index_.size(), frameData.index_.data(), flag,
@@ -932,7 +932,7 @@ Sasa::analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
                           &surfacedots, &nsurfacedots);
     // Unpack the atomwise areas into the frameData.atomAreas_ array for easier
     // indexing in the case of dynamic surfaceSel.
-    if (area != NULL)
+    if (area != nullptr)
     {
         if (surfaceSel.isDynamic())
         {
@@ -950,7 +950,7 @@ Sasa::analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
         }
         sfree(area);
     }
-    scoped_guard_sfree dotsGuard(surfacedots);
+    const sfree_guard dotsGuard(surfacedots);
 
     if (bConnolly)
     {
index 44b3db90f8d63a8d4706f4ff5036ec60e426b1e0..3137b8ddac0219c91dbc26491456fe1b84ed5ebf 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, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,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.
@@ -70,9 +70,9 @@
 #include "gromacs/utility/arrayref.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
-#include "gromacs/utility/scoped_cptr.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/unique_cptr.h"
 
 namespace gmx
 {
@@ -137,7 +137,7 @@ class IndexFileWriterModule : public AnalysisDataModuleSerial
  */
 
 IndexFileWriterModule::IndexFileWriterModule()
-    : fp_(NULL), currentGroup_(-1), currentSize_(0), bAnyWritten_(false)
+    : fp_(nullptr), currentGroup_(-1), currentSize_(0), bAnyWritten_(false)
 {
 }
 
@@ -150,10 +150,10 @@ IndexFileWriterModule::~IndexFileWriterModule()
 
 void IndexFileWriterModule::closeFile()
 {
-    if (fp_ != NULL)
+    if (fp_ != nullptr)
     {
         gmx_fio_fclose(fp_);
-        fp_ = NULL;
+        fp_ = nullptr;
     }
 }
 
@@ -168,7 +168,7 @@ void IndexFileWriterModule::addGroup(const std::string &name, bool bDynamic)
 {
     std::string newName(name);
     std::replace(newName.begin(), newName.end(), ' ', '_');
-    groups_.push_back(GroupInfo(newName, bDynamic));
+    groups_.emplace_back(newName, bDynamic);
 }
 
 
@@ -197,7 +197,7 @@ void IndexFileWriterModule::frameStarted(const AnalysisDataFrameHeader & /*heade
 void
 IndexFileWriterModule::pointsAdded(const AnalysisDataPointSetRef &points)
 {
-    if (fp_ == NULL)
+    if (fp_ == nullptr)
     {
         return;
     }
@@ -245,7 +245,7 @@ void IndexFileWriterModule::frameFinished(const AnalysisDataFrameHeader & /*head
 
 void IndexFileWriterModule::dataFinished()
 {
-    if (fp_ != NULL)
+    if (fp_ != nullptr)
     {
         std::fprintf(fp_, "\n");
     }
@@ -293,7 +293,6 @@ class Select : public TrajectoryAnalysisModule
 
     private:
         SelectionList                       sel_;
-        SelectionOptionInfo                *selOpt_;
 
         std::string                         fnSize_;
         std::string                         fnFrac_;
@@ -321,9 +320,9 @@ class Select : public TrajectoryAnalysisModule
 };
 
 Select::Select()
-    : selOpt_(NULL), bTotNorm_(false), bFracNorm_(false), bResInd_(false),
+    : bTotNorm_(false), bFracNorm_(false), bResInd_(false),
       bCumulativeLifetimes_(true), resNumberType_(ResidueNumbering_ByNumber),
-      pdbAtoms_(PdbAtomsSelection_All), top_(NULL),
+      pdbAtoms_(PdbAtomsSelection_All), top_(nullptr),
       occupancyModule_(new AnalysisDataAverageModule()),
       lifetimeModule_(new AnalysisDataLifetimeModule())
 {
@@ -351,11 +350,13 @@ Select::initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings *sett
         "be combined with output from other programs and/or external",
         "analysis programs to calculate more complex things.",
         "For detailed help on the selection syntax, please use",
-        "[TT]gmx help selections[tt].[PAR]",
+        "[TT]gmx help selections[tt].",
+        "",
         "Any combination of the output options is possible, but note",
         "that [TT]-om[tt] only operates on the first selection.",
         "Also note that if you provide no output options, no output is",
-        "produced.[PAR]",
+        "produced.",
+        "",
         "With [TT]-os[tt], calculates the number of positions in each",
         "selection for each frame. With [TT]-norm[tt], the output is",
         "between 0 and 1 and describes the fraction from the maximum",
@@ -364,35 +365,42 @@ Select::initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings *sett
         "RA residues). With [TT]-cfnorm[tt], the output is divided",
         "by the fraction covered by the selection.",
         "[TT]-norm[tt] and [TT]-cfnorm[tt] can be specified independently",
-        "of one another.[PAR]",
+        "of one another.",
+        "",
         "With [TT]-oc[tt], the fraction covered by each selection is",
-        "written out as a function of time.[PAR]",
+        "written out as a function of time.",
+        "",
         "With [TT]-oi[tt], the selected atoms/residues/molecules are",
         "written out as a function of time. In the output, the first",
         "column contains the frame time, the second contains the number",
         "of positions, followed by the atom/residue/molecule numbers.",
         "If more than one selection is specified, the size of the second",
         "group immediately follows the last number of the first group",
-        "and so on.[PAR]",
+        "and so on.",
+        "",
         "With [TT]-on[tt], the selected atoms are written as a index file",
         "compatible with [TT]make_ndx[tt] and the analyzing tools. Each selection",
         "is written as a selection group and for dynamic selections a",
-        "group is written for each frame.[PAR]",
+        "group is written for each frame.",
+        "",
         "For residue numbers, the output of [TT]-oi[tt] can be controlled",
         "with [TT]-resnr[tt]: [TT]number[tt] (default) prints the residue",
         "numbers as they appear in the input file, while [TT]index[tt] prints",
         "unique numbers assigned to the residues in the order they appear",
         "in the input file, starting with 1. The former is more intuitive,",
         "but if the input contains multiple residues with the same number,",
-        "the output can be less useful.[PAR]",
+        "the output can be less useful.",
+        "",
         "With [TT]-om[tt], a mask is printed for the first selection",
         "as a function of time. Each line in the output corresponds to",
         "one frame, and contains either 0/1 for each atom/residue/molecule",
         "possibly selected. 1 stands for the atom/residue/molecule being",
-        "selected for the current frame, 0 for not selected.[PAR]",
+        "selected for the current frame, 0 for not selected.",
+        "",
         "With [TT]-of[tt], the occupancy fraction of each position (i.e.,",
         "the fraction of frames where the position is selected) is",
-        "printed.[PAR]",
+        "printed.",
+        "",
         "With [TT]-ofpdb[tt], a PDB file is written out where the occupancy",
         "column is filled with the occupancy fraction of each atom in the",
         "selection. The coordinates in the PDB file will be those from the",
@@ -400,13 +408,16 @@ Select::initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings *sett
         "appear in the output PDB file: with [TT]all[tt] all atoms are",
         "present, with [TT]maxsel[tt] all atoms possibly selected by the",
         "selection are present, and with [TT]selected[tt] only atoms that are",
-        "selected at least in one frame are present.[PAR]",
+        "selected at least in one frame are present.",
+        "",
         "With [TT]-olt[tt], a histogram is produced that shows the number of",
         "selected positions as a function of the time the position was",
         "continuously selected. [TT]-cumlt[tt] can be used to control whether",
         "subintervals of longer intervals are included in the histogram.[PAR]",
         "[TT]-om[tt], [TT]-of[tt], and [TT]-olt[tt] only make sense with",
-        "dynamic selections."
+        "dynamic selections.",
+        "",
+        "To plot coordinates for selections, use [gmx-trajectory]."
     };
 
     settings->setHelpText(desc);
@@ -436,9 +447,9 @@ Select::initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings *sett
                            .store(&fnLifetime_).defaultBasename("lifetime")
                            .description("Lifetime histogram"));
 
-    selOpt_ = options->addOption(SelectionOption("select").storeVector(&sel_)
-                                     .required().multiValue()
-                                     .description("Selections to analyze"));
+    options->addOption(SelectionOption("select").storeVector(&sel_)
+                           .required().multiValue()
+                           .description("Selections to analyze"));
 
     options->addOption(BooleanOption("norm").store(&bTotNorm_)
                            .description("Normalize by total number of positions with -os"));
@@ -671,11 +682,15 @@ Select::writeOutput()
         atoms = top_->topology()->atoms;
         t_pdbinfo         *pdbinfo;
         snew(pdbinfo, atoms.nr);
-        scoped_guard_sfree pdbinfoGuard(pdbinfo);
-        if (atoms.pdbinfo != NULL)
+        const sfree_guard  pdbinfoGuard(pdbinfo);
+        if (atoms.havePdbInfo)
         {
             std::memcpy(pdbinfo, atoms.pdbinfo, atoms.nr*sizeof(*pdbinfo));
         }
+        else
+        {
+            atoms.havePdbInfo = TRUE;
+        }
         atoms.pdbinfo = pdbinfo;
         for (int i = 0; i < atoms.nr; ++i)
         {
@@ -708,7 +723,7 @@ Select::writeOutput()
             case PdbAtomsSelection_All:
             {
                 t_trxstatus *status = open_trx(fnPDB_.c_str(), "w");
-                write_trxframe(status, &fr, NULL);
+                write_trxframe(status, &fr, nullptr);
                 close_trx(status);
                 break;
             }
@@ -724,7 +739,7 @@ Select::writeOutput()
                                                  atomIndicesSet.end());
                 t_trxstatus      *status = open_trx(fnPDB_.c_str(), "w");
                 write_trxframe_indexed(status, &fr, allAtomIndices.size(),
-                                       allAtomIndices.data(), NULL);
+                                       allAtomIndices.data(), nullptr);
                 close_trx(status);
                 break;
             }
@@ -739,7 +754,7 @@ Select::writeOutput()
                     }
                 }
                 t_trxstatus *status = open_trx(fnPDB_.c_str(), "w");
-                write_trxframe_indexed(status, &fr, indices.size(), indices.data(), NULL);
+                write_trxframe_indexed(status, &fr, indices.size(), indices.data(), nullptr);
                 close_trx(status);
                 break;
             }
index 00aa76f12f5a800dd5b0358cb719314bb7d206b6..a3801082683f686731cadd8dcdf34aa491461aa8 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2007, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * 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.
@@ -574,7 +574,7 @@ nsc_dclm_pbc(const rvec *coords, const ConstArrayRef<real> &radius, int nat,
         return;
     }
     real        area = 0.0, vol = 0.0;
-    real       *dots = NULL, *atom_area = NULL;
+    real       *dots = nullptr, *atom_area = nullptr;
     int         lfnr = 0, maxdots = 0;
     if (mode & FLAG_VOLUME)
     {
@@ -806,7 +806,7 @@ void SurfaceAreaCalculator::calculate(
 {
     flags |= impl_->flags_;
     *area  = 0;
-    if (volume == NULL)
+    if (volume == nullptr)
     {
         flags &= ~FLAG_VOLUME;
     }
@@ -814,23 +814,23 @@ void SurfaceAreaCalculator::calculate(
     {
         *volume = 0;
     }
-    if (at_area == NULL)
+    if (at_area == nullptr)
     {
         flags &= ~FLAG_ATOM_AREA;
     }
     else
     {
-        *at_area = NULL;
+        *at_area = nullptr;
     }
-    if (lidots == NULL)
+    if (lidots == nullptr)
     {
         flags &= ~FLAG_DOTS;
     }
     else
     {
-        *lidots = NULL;
+        *lidots = nullptr;
     }
-    if (n_dots == NULL)
+    if (n_dots == nullptr)
     {
         flags &= ~FLAG_DOTS;
     }
diff --git a/src/gromacs/trajectoryanalysis/modules/trajectory.cpp b/src/gromacs/trajectoryanalysis/modules/trajectory.cpp
new file mode 100644 (file)
index 0000000..b83d188
--- /dev/null
@@ -0,0 +1,330 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Implements gmx::analysismodules::Trajectory.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_trajectoryanalysis
+ */
+#include "gmxpre.h"
+
+#include "trajectory.h"
+
+#include <algorithm>
+
+#include "gromacs/analysisdata/analysisdata.h"
+#include "gromacs/analysisdata/modules/plot.h"
+#include "gromacs/fileio/trxio.h"
+#include "gromacs/options/basicoptions.h"
+#include "gromacs/options/filenameoption.h"
+#include "gromacs/options/ioptionscontainer.h"
+#include "gromacs/selection/selection.h"
+#include "gromacs/selection/selectionoption.h"
+#include "gromacs/trajectory/trajectoryframe.h"
+#include "gromacs/trajectoryanalysis/analysissettings.h"
+
+namespace gmx
+{
+
+namespace analysismodules
+{
+
+namespace
+{
+
+/********************************************************************
+ * Trajectory
+ */
+
+class Trajectory : public TrajectoryAnalysisModule
+{
+    public:
+        Trajectory();
+
+        virtual void initOptions(IOptionsContainer          *options,
+                                 TrajectoryAnalysisSettings *settings);
+        virtual void optionsFinished(TrajectoryAnalysisSettings *settings);
+        virtual void initAnalysis(const TrajectoryAnalysisSettings &settings,
+                                  const TopologyInformation        &top);
+
+        virtual void analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
+                                  TrajectoryAnalysisModuleData *pdata);
+
+        virtual void finishAnalysis(int nframes);
+        virtual void writeOutput();
+
+    private:
+        SelectionList                       sel_;
+
+        std::string                         fnX_;
+        std::string                         fnV_;
+        std::string                         fnF_;
+        bool                                dimMask_[4];
+        bool                                maskSet_[4];
+
+        AnalysisData                        xdata_;
+        AnalysisData                        vdata_;
+        AnalysisData                        fdata_;
+};
+
+Trajectory::Trajectory()
+{
+    std::fill(std::begin(dimMask_), std::end(dimMask_), true);
+    dimMask_[DIM] = false;
+    std::fill(std::begin(maskSet_), std::end(maskSet_), false);
+    registerAnalysisDataset(&xdata_, "x");
+    registerAnalysisDataset(&vdata_, "v");
+    registerAnalysisDataset(&fdata_, "f");
+}
+
+
+void
+Trajectory::initOptions(IOptionsContainer *options, TrajectoryAnalysisSettings *settings)
+{
+    static const char *const desc[] = {
+        "[THISMODULE] plots coordinates, velocities, and/or forces for",
+        "provided selections. By default, the X, Y, and Z components for",
+        "the requested vectors are plotted, but specifying one or more of",
+        "[TT]-len[tt], [TT]-x[tt], [TT]-y[tt], and [TT]-z[tt] overrides this.",
+        "",
+        "For dynamic selections, currently the values are written out for",
+        "all positions that the selection could select."
+    };
+
+    settings->setHelpText(desc);
+
+    options->addOption(FileNameOption("ox").filetype(eftPlot).outputFile()
+                           .store(&fnX_).defaultBasename("coord")
+                           .description("Coordinates for each position as a function of time"));
+    options->addOption(FileNameOption("ov").filetype(eftPlot).outputFile()
+                           .store(&fnV_).defaultBasename("veloc")
+                           .description("Velocities for each position as a function of time"));
+    options->addOption(FileNameOption("of").filetype(eftPlot).outputFile()
+                           .store(&fnF_).defaultBasename("force")
+                           .description("Forces for each position as a function of time"));
+
+    options->addOption(SelectionOption("select").storeVector(&sel_)
+                           .required().dynamicMask().multiValue()
+                           .description("Selections to analyze"));
+
+    options->addOption(BooleanOption("x").store(&dimMask_[XX])
+                           .storeIsSet(&maskSet_[XX])
+                           .description("Plot X component"));
+    options->addOption(BooleanOption("y").store(&dimMask_[YY])
+                           .storeIsSet(&maskSet_[YY])
+                           .description("Plot Y component"));
+    options->addOption(BooleanOption("z").store(&dimMask_[ZZ])
+                           .storeIsSet(&maskSet_[ZZ])
+                           .description("Plot Z component"));
+    options->addOption(BooleanOption("len").store(&dimMask_[DIM])
+                           .storeIsSet(&maskSet_[DIM])
+                           .description("Plot vector length"));
+}
+
+
+void
+Trajectory::optionsFinished(TrajectoryAnalysisSettings *settings)
+{
+    int frameFlags = TRX_NEED_X;
+    if (!fnV_.empty())
+    {
+        frameFlags |= TRX_READ_V;
+    }
+    if (!fnF_.empty())
+    {
+        frameFlags |= TRX_READ_F;
+    }
+    settings->setFrameFlags(frameFlags);
+    if (std::count(std::begin(maskSet_), std::end(maskSet_), true) > 0)
+    {
+        for (int i = 0; i <= DIM; ++i)
+        {
+            if (!maskSet_[i])
+            {
+                dimMask_[i] = false;
+            }
+        }
+    }
+}
+
+
+void
+Trajectory::initAnalysis(const TrajectoryAnalysisSettings &settings,
+                         const TopologyInformation         & /*top*/)
+{
+    if (!fnX_.empty())
+    {
+        xdata_.setDataSetCount(sel_.size());
+        for (size_t g = 0; g < sel_.size(); ++g)
+        {
+            xdata_.setColumnCount(g, 3*sel_[g].posCount());
+        }
+        AnalysisDataVectorPlotModulePointer plot(
+                new AnalysisDataVectorPlotModule(settings.plotSettings()));
+        plot->setWriteMask(dimMask_);
+        plot->setFileName(fnX_);
+        plot->setTitle("Coordinates");
+        plot->setXAxisIsTime();
+        plot->setYLabel("Value [nm]");
+        xdata_.addModule(plot);
+    }
+    if (!fnV_.empty())
+    {
+        vdata_.setDataSetCount(sel_.size());
+        for (size_t g = 0; g < sel_.size(); ++g)
+        {
+            sel_[g].setEvaluateVelocities(true);
+            vdata_.setColumnCount(g, 3*sel_[g].posCount());
+        }
+        AnalysisDataVectorPlotModulePointer plot(
+                new AnalysisDataVectorPlotModule(settings.plotSettings()));
+        plot->setWriteMask(dimMask_);
+        plot->setFileName(fnV_);
+        plot->setTitle("Velocities");
+        plot->setXAxisIsTime();
+        plot->setYLabel("Value [nm/ps]");
+        vdata_.addModule(plot);
+    }
+    if (!fnF_.empty())
+    {
+        fdata_.setDataSetCount(sel_.size());
+        for (size_t g = 0; g < sel_.size(); ++g)
+        {
+            sel_[g].setEvaluateForces(true);
+            fdata_.setColumnCount(g, 3*sel_[g].posCount());
+        }
+        AnalysisDataVectorPlotModulePointer plot(
+                new AnalysisDataVectorPlotModule(settings.plotSettings()));
+        plot->setWriteMask(dimMask_);
+        plot->setFileName(fnF_);
+        plot->setTitle("Forces");
+        plot->setXAxisIsTime();
+        plot->setYLabel("Value [kJ mol\\S-1\\N nm\\S-1\\N]");
+        fdata_.addModule(plot);
+    }
+}
+
+
+void
+Trajectory::analyzeFrame(int frnr, const t_trxframe &fr, t_pbc * /* pbc */,
+                         TrajectoryAnalysisModuleData *pdata)
+{
+    const SelectionList &sel = pdata->parallelSelections(sel_);
+
+    // There is some duplication here, but cppcheck cannot handle function
+    // types that return rvec references, and MSVC also apparently segfaults
+    // when using std::function with a member function here...
+    {
+        AnalysisDataHandle dh = pdata->dataHandle(xdata_);
+        if (dh.isValid())
+        {
+            dh.startFrame(frnr, fr.time);
+            for (size_t g = 0; g < sel.size(); ++g)
+            {
+                dh.selectDataSet(g);
+                for (int i = 0; i < sel[g].posCount(); ++i)
+                {
+                    const SelectionPosition &pos = sel[g].position(i);
+                    dh.setPoints(i*3, 3, pos.x(), pos.selected());
+                }
+            }
+            dh.finishFrame();
+        }
+    }
+    if (fr.bV)
+    {
+        AnalysisDataHandle dh = pdata->dataHandle(xdata_);
+        if (dh.isValid())
+        {
+            dh.startFrame(frnr, fr.time);
+            for (size_t g = 0; g < sel.size(); ++g)
+            {
+                dh.selectDataSet(g);
+                for (int i = 0; i < sel[g].posCount(); ++i)
+                {
+                    const SelectionPosition &pos = sel[g].position(i);
+                    dh.setPoints(i*3, 3, pos.v(), pos.selected());
+                }
+            }
+            dh.finishFrame();
+        }
+    }
+    if (fr.bF)
+    {
+        AnalysisDataHandle dh = pdata->dataHandle(xdata_);
+        if (dh.isValid())
+        {
+            dh.startFrame(frnr, fr.time);
+            for (size_t g = 0; g < sel.size(); ++g)
+            {
+                dh.selectDataSet(g);
+                for (int i = 0; i < sel[g].posCount(); ++i)
+                {
+                    const SelectionPosition &pos = sel[g].position(i);
+                    dh.setPoints(i*3, 3, pos.f(), pos.selected());
+                }
+            }
+            dh.finishFrame();
+        }
+    }
+}
+
+
+void
+Trajectory::finishAnalysis(int /*nframes*/)
+{
+}
+
+
+void
+Trajectory::writeOutput()
+{
+}
+
+}       // namespace
+
+const char TrajectoryInfo::name[]             = "trajectory";
+const char TrajectoryInfo::shortDescription[] =
+    "Print coordinates, velocities, and/or forces for selections";
+
+TrajectoryAnalysisModulePointer TrajectoryInfo::create()
+{
+    return TrajectoryAnalysisModulePointer(new Trajectory);
+}
+
+} // namespace analysismodules
+
+} // namespace gmx
diff --git a/src/gromacs/trajectoryanalysis/modules/trajectory.h b/src/gromacs/trajectoryanalysis/modules/trajectory.h
new file mode 100644 (file)
index 0000000..1f510af
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Declares trajectory analysis module for basic trajectory information.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_trajectoryanalysis
+ */
+#ifndef GMX_TRAJECTORYANALYSIS_MODULES_TRAJECTORY_H
+#define GMX_TRAJECTORYANALYSIS_MODULES_TRAJECTORY_H
+
+#include "gromacs/trajectoryanalysis/analysismodule.h"
+
+namespace gmx
+{
+
+namespace analysismodules
+{
+
+class TrajectoryInfo
+{
+    public:
+        static const char name[];
+        static const char shortDescription[];
+        static TrajectoryAnalysisModulePointer create();
+};
+
+} // namespace analysismodules
+
+} // namespace gmx
+
+#endif
diff --git a/src/gromacs/trajectoryanalysis/modules/unionfind.h b/src/gromacs/trajectoryanalysis/modules/unionfind.h
new file mode 100644 (file)
index 0000000..ac52981
--- /dev/null
@@ -0,0 +1,273 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Implements gmx::UnionFinder and gmx::MappedUnionFinder.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_trajectoryanalysis
+ */
+#ifndef GMX_TRAJECTORYANALYSIS_UNIONFIND_H
+#define GMX_TRAJECTORYANALYSIS_UNIONFIND_H
+
+#include <algorithm>
+#include <numeric>
+#include <vector>
+
+#include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/gmxassert.h"
+
+namespace gmx
+{
+
+/*! \libinternal \brief
+ * Union-find data structure for keeping track of disjoint sets.
+ *
+ * Union-find keeps track of a number of items, represented here by continuous
+ * integer indices starting at zero, and supports the following operations:
+ *  - Initialization puts each item into a set of its own.
+ *  - Given two items, merge the sets that contain these items.
+ *  - Given an item, find a representative item that is in the same set, such
+ *    that queries for items in the same set yield the same value.
+ * Merging and querying is supported in amortized constant time.
+ *
+ * Note that in order to achieve the amortized behavior, querying the structure
+ * modifies the internal state, but does not alter the externally visible
+ * behavior.
+ *
+ * \ingroup module_trajectoryanalysis
+ */
+class UnionFinder
+{
+    public:
+        /*! \brief
+         * Initializes `count` items, putting each in its own set.
+         */
+        void init(int count)
+        {
+            parent_.clear();
+            rank_.clear();
+            parent_.reserve(count);
+            rank_.reserve(count);
+            parent_.resize(count);
+            rank_.resize(count, 0);
+            std::iota(parent_.begin(), parent_.end(), 0);
+        }
+        /*! \brief
+         * Merges sets that contain two given items.
+         *
+         * If the items are already in the same set, nothing happens.
+         */
+        void merge(int item1, int item2)
+        {
+            GMX_ASSERT(item1 >= 0 && item1 < count(), "Input index out of range");
+            GMX_ASSERT(item2 >= 0 && item2 < count(), "Input index out of range");
+            const int root1 = findRootAndCompressPath(item1);
+            const int root2 = findRootAndCompressPath(item2);
+            if (root1 != root2)
+            {
+                mergeRoots(root1, root2);
+            }
+        }
+        /*! \brief
+         * Returns a representative item from the set containing `item`.
+         */
+        int representativeItem(int item)
+        {
+            GMX_ASSERT(item >= 0 && item < count(), "Input index out of range");
+            return findRootAndCompressPath(item);
+        }
+        /*! \brief
+         * Returns the sizes of all sets (in arbitrary order).
+         */
+        std::vector<int> allSizes()
+        {
+            const int        count = parent_.size();
+            std::vector<int> result(count, 0);
+            for (int i = 0; i < count; ++i)
+            {
+                ++result[findRootAndCompressPath(i)];
+            }
+            result.erase(std::remove(result.begin(), result.end(), 0),
+                         result.end());
+            return result;
+        }
+
+    private:
+        //! Number of items.
+        int count() const { return parent_.size(); }
+        int findRootAndCompressPath(int i)
+        {
+            while (parent_[i] != i)
+            {
+                const int prev = i;
+                i              = parent_[i];
+                parent_[prev]  = parent_[i];
+            }
+            return i;
+        }
+        void mergeRoots(int root1, int root2)
+        {
+            if (rank_[root1] > rank_[root2])
+            {
+                parent_[root2] = root1;
+            }
+            else if (rank_[root2] > rank_[root1])
+            {
+                parent_[root1] = root2;
+            }
+            else
+            {
+                parent_[root1] = root2;
+                ++rank_[root1];
+            }
+        }
+
+        /*! \brief
+         * Parent item for each item in the tree representing the set.
+         *
+         * Root items are parents of themselves, and are the reprensentative
+         * items of their sets.
+         */
+        std::vector<int> parent_;
+        //! Worst-case height for each root (as if no compression was done).
+        std::vector<int> rank_;
+};
+
+/*! \libinternal \brief
+ * Extension of UnionFind that supports non-consecutive integer indices as
+ * items.
+ *
+ * Sometimes, it is more convenient to operate on a set of integers that do not
+ * start at zero and are not consecutive as UnionFind expects.  This class
+ * implements a mapping on top of UnionFind such that this is possible.
+ *
+ * The current implementation assumes that the indices are bounded between zero
+ * and some reasonably small integer, i.e., the memory usage depends on the
+ * largest index number, not just on the number of items.
+ *
+ * \ingroup module_trajectoryanalysis
+ */
+class MappedUnionFinder
+{
+    public:
+        /*! \brief
+         * Initializes the finder with indices.
+         *
+         * The size of `indices` sets the number of input items, and each
+         * unique value in `indices` maps to a single internal item.
+         * If multiple indices are the same, then these items are considered
+         * equivalent.
+         */
+        void initWithGroupIndices(ConstArrayRef<int> indices)
+        {
+            mapping_.clear();
+            int groupCount = 0;
+            if (!indices.empty())
+            {
+                const int maxIndex = *std::max_element(indices.begin(),
+                                                       indices.end());
+                mapping_.resize(maxIndex + 1, -1);
+                for (int item : indices)
+                {
+                    GMX_ASSERT(item >= 0, "Negative group numbers not supported");
+                    if (mapping_[item] == -1)
+                    {
+                        mapping_[item] = groupCount;
+                        ++groupCount;
+                    }
+                }
+            }
+            finder_.init(groupCount);
+        }
+        /*! \brief
+         * Returns a reprensetative value for an item that is unique for each
+         * set.
+         *
+         * `group` should be one of the values that were passed in as an index
+         * to initWithGroupIndices().
+         * The return value is an internal index that has no simple relation to
+         * the input indices.
+         */
+        int representativeValue(int group)
+        {
+            GMX_ASSERT(group >= 0 && group < maxGroupNumber(),
+                       "Input value out of range");
+            GMX_ASSERT(mapping_[group] != -1,
+                       "Input value not in initialization set");
+            return finder_.representativeItem(mapping_[group]);
+        }
+        /*! \brief
+         * Merges sets that contain two given items.
+         *
+         * If the items are already in the same set, nothing happens.
+         * Each input value should be one of the values that were passed in as
+         * an index to initWithGroupIndices().
+         */
+        void mergeGroups(int group1, int group2)
+        {
+            GMX_ASSERT(group1 >= 0 && group1 < maxGroupNumber(),
+                       "Input value out of range");
+            GMX_ASSERT(group2 >= 0 && group2 < maxGroupNumber(),
+                       "Input value out of range");
+            GMX_ASSERT(mapping_[group1] != -1,
+                       "Input value not in initialization set");
+            GMX_ASSERT(mapping_[group2] != -1,
+                       "Input value not in initialization set");
+            finder_.merge(mapping_[group1], mapping_[group2]);
+        }
+        /*! \brief
+         * Returns the sizes of all sets (in arbitrary order).
+         *
+         * If there were multiple identical indices passed to
+         * initWithGroupIndices(), these are only counted as one when
+         * computing the sizes.
+         */
+        std::vector<int> allSizes()
+        {
+            return finder_.allSizes();
+        }
+
+    private:
+        int maxGroupNumber() const { return mapping_.size(); }
+
+        UnionFinder        finder_;
+        //! Mapping from input indices to zero-based indices used by finder_.
+        std::vector<int>   mapping_;
+};
+
+} // namespace gmx
+
+#endif
index 2ed120638e028cfa4cb8bfbe88b0ac5a559dc0c9..38c74f1f96a40ef8ce813612047957f6e23b971f 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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -90,10 +90,10 @@ class TrajectoryAnalysisRunnerCommon::Impl : public ITopologyProvider
         void finishTrajectory();
 
         // From ITopologyProvider
-        virtual t_topology *getTopology(bool required)
+        virtual gmx_mtop_t *getTopology(bool required)
         {
             initTopology(required);
-            return topInfo_.topology();
+            return topInfo_.mtop_;
         }
         virtual int getAtomCount()
         {
@@ -140,7 +140,7 @@ TrajectoryAnalysisRunnerCommon::Impl::Impl(TrajectoryAnalysisSettings *settings)
     : settings_(*settings),
       startTime_(0.0), endTime_(0.0), deltaTime_(0.0),
       bStartTimeSet_(false), bEndTimeSet_(false), bDeltaTimeSet_(false),
-      bTrajOpen_(false), fr(NULL), gpbc_(NULL), status_(NULL), oenv_(NULL)
+      bTrajOpen_(false), fr(nullptr), gpbc_(nullptr), status_(nullptr), oenv_(nullptr)
 {
 }
 
@@ -180,14 +180,26 @@ TrajectoryAnalysisRunnerCommon::Impl::initTopology(bool required)
     // Load the topology if requested.
     if (!topfile_.empty())
     {
-        snew(topInfo_.top_, 1);
-        topInfo_.bTop_ = read_tps_conf(topfile_.c_str(), topInfo_.top_, &topInfo_.ePBC_,
-                                       &topInfo_.xtop_, NULL, topInfo_.boxtop_, TRUE);
+        snew(topInfo_.mtop_, 1);
+        readConfAndTopology(topfile_.c_str(), &topInfo_.bTop_, topInfo_.mtop_,
+                            &topInfo_.ePBC_, &topInfo_.xtop_, nullptr,
+                            topInfo_.boxtop_);
+        // TODO: Only load this here if the tool actually needs it; selections
+        // take care of themselves.
+        for (int i = 0; i < topInfo_.mtop_->nmoltype; ++i)
+        {
+            gmx_moltype_t &moltype = topInfo_.mtop_->moltype[i];
+            if (!moltype.atoms.haveMass)
+            {
+                // Try to read masses from database, be silent about missing masses
+                atomsSetMassesBasedOnNames(&moltype.atoms, FALSE);
+            }
+        }
         if (hasTrajectory()
             && !settings_.hasFlag(TrajectoryAnalysisSettings::efUseTopX))
         {
             sfree(topInfo_.xtop_);
-            topInfo_.xtop_ = NULL;
+            topInfo_.xtop_ = nullptr;
         }
     }
 }
@@ -196,7 +208,7 @@ void
 TrajectoryAnalysisRunnerCommon::Impl::initFirstFrame()
 {
     // Return if we have already initialized the trajectory.
-    if (fr != NULL)
+    if (fr != nullptr)
     {
         return;
     }
@@ -290,10 +302,10 @@ TrajectoryAnalysisRunnerCommon::Impl::finishTrajectory()
         close_trx(status_);
         bTrajOpen_ = false;
     }
-    if (gpbc_ != NULL)
+    if (gpbc_ != nullptr)
     {
         gmx_rmpbc_done(gpbc_);
-        gpbc_ = NULL;
+        gpbc_ = nullptr;
     }
 }
 
@@ -452,7 +464,7 @@ TrajectoryAnalysisRunnerCommon::readNextFrame()
 void
 TrajectoryAnalysisRunnerCommon::initFrame()
 {
-    if (impl_->gpbc_ != NULL)
+    if (impl_->gpbc_ != nullptr)
     {
         gmx_rmpbc_trxfr(impl_->gpbc_, impl_->fr);
     }
@@ -476,7 +488,7 @@ TrajectoryAnalysisRunnerCommon::topologyInformation() const
 t_trxframe &
 TrajectoryAnalysisRunnerCommon::frame() const
 {
-    GMX_RELEASE_ASSERT(impl_->fr != NULL, "Frame not available when accessed");
+    GMX_RELEASE_ASSERT(impl_->fr != nullptr, "Frame not available when accessed");
     return *impl_->fr;
 }
 
index b59d79fd980c1f8395c7fc1de09c19856b64219b..9181b778c8c459b31e4f5401efec76a76ba05eb0 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2010,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+# Copyright (c) 2010,2012,2013,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.
@@ -34,6 +34,7 @@
 
 gmx_add_unit_test(TrajectoryAnalysisUnitTests trajectoryanalysis-test
                   moduletest.cpp
+                  clustsize.cpp
                   cmdlinerunner.cpp
                   angle.cpp
                   distance.cpp
@@ -43,6 +44,8 @@ gmx_add_unit_test(TrajectoryAnalysisUnitTests trajectoryanalysis-test
                   sasa.cpp
                   select.cpp
                   surfacearea.cpp
+                  trajectory.cpp
+                  unionfind.cpp
                   $<TARGET_OBJECTS:analysisdata-test-shared>)
 
 add_executable(test_selection ${UNITTEST_TARGET_OPTIONS} test_selection.cpp)
diff --git a/src/gromacs/trajectoryanalysis/tests/clustsize.cpp b/src/gromacs/trajectoryanalysis/tests/clustsize.cpp
new file mode 100644 (file)
index 0000000..72ed81b
--- /dev/null
@@ -0,0 +1,156 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Tests for gmx clustsize
+ *
+ * \todo These will be superseded by tests of the new style analysis
+ * modules.
+ *
+ * \author David van der Spoel <david.vanderspoel@icm.uu.se>
+ * \ingroup module_trajectoryanalysis
+ */
+
+#include "gmxpre.h"
+
+#include <cstring>
+
+#include <string>
+
+#include "gromacs/gmxana/gmx_ana.h"
+
+#include "testutils/cmdlinetest.h"
+#include "testutils/refdata.h"
+#include "testutils/testasserts.h"
+#include "testutils/textblockmatchers.h"
+#include "testutils/xvgtest.h"
+
+namespace gmx
+{
+
+namespace test
+{
+
+namespace
+{
+
+class ClustsizeTest : public CommandLineTestBase
+{
+    public:
+        ClustsizeTest()
+        {
+            double            tolerance = 1e-4;
+            test::XvgMatch    xvg;
+            test::XvgMatch   &toler     = xvg.tolerance(gmx::test::relativeToleranceAsFloatingPoint(1, tolerance));
+
+            setOutputFile("-mc", ".xvg", toler);
+            setOutputFile("-nc", ".xvg", toler);
+            setOutputFile("-ac", ".xvg", toler);
+            setOutputFile("-hc", ".xvg", toler);
+            setInputFile("-f", "clustsize.pdb");
+        }
+
+        void runTest(const CommandLine &args)
+        {
+            CommandLine &cmdline = commandLine();
+            cmdline.merge(args);
+
+            gmx::test::TestReferenceChecker rootChecker(this->rootChecker());
+            rootChecker.checkString(args.toString(), "CommandLine");
+
+            ASSERT_EQ(0, gmx_clustsize(cmdline.argc(), cmdline.argv()));
+
+            checkOutputFiles();
+        }
+};
+
+TEST_F(ClustsizeTest, NoMolDefaultCutoff)
+{
+    const char *const command[] = { "clustsize" };
+    CommandLine       args      = CommandLine(command);
+
+    setInputFile("-n", "clustsize.ndx");
+
+    runTest(args);
+}
+
+TEST_F(ClustsizeTest, NoMolShortCutoff)
+{
+    const char *const command[] = { "clustsize", "-cut", "0.3" };
+    CommandLine       args      = CommandLine(command);
+
+    setInputFile("-n", "clustsize.ndx");
+
+    runTest(args);
+}
+
+TEST_F(ClustsizeTest, MolDefaultCutoff)
+{
+    const char *const command[] = { "clustsize", "-mol" };
+    CommandLine       args      = CommandLine(command);
+
+    setInputFile("-s", "clustsize.tpr");
+
+    runTest(args);
+}
+
+TEST_F(ClustsizeTest, MolShortCutoff)
+{
+    const char *const command[] = { "clustsize", "-mol", "-cut", "0.3" };
+    CommandLine       args      = CommandLine(command);
+
+    setInputFile("-s", "clustsize.tpr");
+
+    runTest(args);
+}
+
+TEST_F(ClustsizeTest, MolCSize)
+{
+    const char *const command[] = { "clustsize", "-mol", "-nlevels", "6" };
+    CommandLine       args      = CommandLine(command);
+
+    setOutputFile("-o", ".xpm", ExactTextMatch());
+    setOutputFile("-ow", ".xpm", ExactTextMatch());
+
+    setInputFile("-s", "clustsize.tpr");
+
+    runTest(args);
+}
+
+} // namespace
+
+} // namespace
+
+} // namespace
diff --git a/src/gromacs/trajectoryanalysis/tests/clustsize.ndx b/src/gromacs/trajectoryanalysis/tests/clustsize.ndx
new file mode 100644 (file)
index 0000000..1fc0f43
--- /dev/null
@@ -0,0 +1,3 @@
+[ SOL ]
+   1    2    3    4    5    6    7    8    9   10   11   12   13   14   15 
+  16   17   18   19   20   21   22   23   24 
diff --git a/src/gromacs/trajectoryanalysis/tests/clustsize.pdb b/src/gromacs/trajectoryanalysis/tests/clustsize.pdb
new file mode 100644 (file)
index 0000000..e8abf0f
--- /dev/null
@@ -0,0 +1,57 @@
+TITLE     216H2O,WATJP01,SPC216,SPC-MODEL,300K,BOX(M)=1.86206NM,WFVG,MAR. 1984
+REMARK    THIS IS A SIMULATION BOX
+CRYST1   18.621   18.621   18.621  90.00  90.00  90.00 P 1           1
+MODEL        1
+ATOM      1  OW  SOL     1       2.300   6.280   1.130  1.00  0.00            
+ATOM      2  HW1 SOL     1       1.370   6.260   1.500  1.00  0.00            
+ATOM      3  HW2 SOL     1       2.310   5.890   0.210  1.00  0.00            
+ATOM     70  OW  SOL    24       2.220   6.430   4.630  1.00  0.00            
+ATOM     71  HW1 SOL    24       0.770   5.550   4.800  1.00  0.00            
+ATOM     72  HW2 SOL    24       1.210   6.970   6.470  1.00  0.00            
+ATOM     73  OW  SOL    25      -0.200  -0.950   3.590  1.00  0.00            
+ATOM     74  HW1 SOL    25       0.340  -1.240   4.390  1.00  0.00            
+ATOM     75  HW2 SOL    25       0.100  -0.050   3.300  1.00  0.00            
+ATOM     76  OW  SOL    26       0.270  -2.660   1.170  1.00  0.00            
+ATOM     77  HW1 SOL    26       0.080  -3.620   1.380  1.00  0.00            
+ATOM     78  HW2 SOL    26      -0.060  -2.080   1.920  1.00  0.00            
+ATOM    637  OW  SOL   213      -5.620   4.530   6.910  1.00  0.00            
+ATOM    638  HW1 SOL   213      -6.210   5.330   6.950  1.00  0.00            
+ATOM    639  HW2 SOL   213      -5.470   4.180   7.840  1.00  0.00            
+ATOM    640  OW  SOL   214      -2.690   2.210   8.820  1.00  0.00            
+ATOM    641  HW1 SOL   214      -3.530   2.200   9.360  1.00  0.00            
+ATOM    642  HW2 SOL   214      -2.670   3.040   8.260  1.00  0.00            
+ATOM    643  OW  SOL   215       0.390  -7.850   3.000  1.00  0.00            
+ATOM    644  HW1 SOL   215       1.380  -7.960   2.910  1.00  0.00            
+ATOM    645  HW2 SOL   215      -0.010  -8.710   3.320  1.00  0.00            
+ATOM    646  OW  SOL   216       8.750  -2.160   3.370  1.00  0.00            
+ATOM    647  HW1 SOL   216       7.980  -2.510   2.830  1.00  0.00            
+ATOM    648  HW2 SOL   216       8.430  -1.450   3.990  1.00  0.00            
+TER
+ENDMDL
+MODEL        2
+ATOM      1  OW  SOL     1       2.300   6.280   1.130  1.00  0.00            
+ATOM      2  HW1 SOL     1       1.370   6.260   1.500  1.00  0.00            
+ATOM      3  HW2 SOL     1       2.310   5.890   0.210  1.00  0.00            
+ATOM     70  OW  SOL    24       1.220   6.430   5.630  1.00  0.00            
+ATOM     71  HW1 SOL    24       0.770   5.550   5.800  1.00  0.00            
+ATOM     72  HW2 SOL    24       1.210   6.970   6.470  1.00  0.00            
+ATOM     73  OW  SOL    25      -0.200  -0.950   3.590  1.00  0.00            
+ATOM     74  HW1 SOL    25       0.340  -1.240   4.390  1.00  0.00            
+ATOM     75  HW2 SOL    25       0.100  -0.050   3.300  1.00  0.00            
+ATOM     76  OW  SOL    26       0.270  -2.660   1.170  1.00  0.00            
+ATOM     77  HW1 SOL    26       0.080  -3.620   1.380  1.00  0.00            
+ATOM     78  HW2 SOL    26      -0.060  -2.080   1.920  1.00  0.00            
+ATOM    637  OW  SOL   213      -5.620   4.530   6.910  1.00  0.00            
+ATOM    638  HW1 SOL   213      -6.210   5.330   6.950  1.00  0.00            
+ATOM    639  HW2 SOL   213      -5.470   4.180   7.840  1.00  0.00            
+ATOM    640  OW  SOL   214      -2.690   2.210   8.820  1.00  0.00            
+ATOM    641  HW1 SOL   214      -3.530   2.200   9.360  1.00  0.00            
+ATOM    642  HW2 SOL   214      -2.670   3.040   8.260  1.00  0.00            
+ATOM    643  OW  SOL   215       0.390  -7.850   3.000  1.00  0.00            
+ATOM    644  HW1 SOL   215       1.380  -7.960   2.910  1.00  0.00            
+ATOM    645  HW2 SOL   215      -0.010  -8.710   3.320  1.00  0.00            
+ATOM    646  OW  SOL   216       8.750  -2.160   3.370  1.00  0.00            
+ATOM    647  HW1 SOL   216       7.980  -2.510   2.830  1.00  0.00            
+ATOM    648  HW2 SOL   216       8.430  -1.450   3.990  1.00  0.00            
+TER
+ENDMDL
diff --git a/src/gromacs/trajectoryanalysis/tests/clustsize.tpr b/src/gromacs/trajectoryanalysis/tests/clustsize.tpr
new file mode 100644 (file)
index 0000000..8eb67f8
Binary files /dev/null and b/src/gromacs/trajectoryanalysis/tests/clustsize.tpr differ
index eccd685fe708c40fe7c46670bb4984bcef983ff9..d80e1b74caf44cd9e50a033b5570eff0bd6dc979 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,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.
@@ -109,7 +109,7 @@ AbstractTrajectoryAnalysisModuleTestFixture::Impl::module()
 void
 AbstractTrajectoryAnalysisModuleTestFixture::Impl::ensureModuleCreated()
 {
-    if (module_.get() == NULL)
+    if (module_.get() == nullptr)
     {
         module_ = parent_.createModule();
         const std::vector<std::string>          &datasetNames(module_->datasetNames());
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/ClustsizeTest_MolCSize.xml b/src/gromacs/trajectoryanalysis/tests/refdata/ClustsizeTest_MolCSize.xml
new file mode 100644 (file)
index 0000000..958dacc
--- /dev/null
@@ -0,0 +1,151 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">clustsize -mol -nlevels 6</String>
+  <OutputFiles Name="Files">
+    <File Name="-mc">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Max cluster size"
+xaxis  label "Time (ps)"
+yaxis  label "#molecules"
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>1.000000e+00</Real>
+          <Real>2</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">2</Int>
+          <Real>2.000000e+00</Real>
+          <Real>2</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+    <File Name="-nc">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Number of clusters"
+xaxis  label "Time (ps)"
+yaxis  label "N"
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>1.000000e+00</Real>
+          <Real>5</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">2</Int>
+          <Real>2.000000e+00</Real>
+          <Real>6</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+    <File Name="-ac">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Average cluster size"
+xaxis  label "Time (ps)"
+yaxis  label "#molecules"
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>1.000000e+00</Real>
+          <Real>2.000</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">2</Int>
+          <Real>2.000000e+00</Real>
+          <Real>2.000</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+    <File Name="-hc">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Cluster size distribution"
+xaxis  label "Cluster size"
+yaxis  label "()"
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>0</Real>
+          <Real>0.000</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">2</Int>
+          <Real>1</Real>
+          <Real>3.000</Real>
+        </Sequence>
+        <Sequence Name="Row2">
+          <Int Name="Length">2</Int>
+          <Real>2</Real>
+          <Real>2.500</Real>
+        </Sequence>
+        <Sequence Name="Row3">
+          <Int Name="Length">2</Int>
+          <Real>3</Real>
+          <Real>0.000</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+    <File Name="-o">
+      <String Name="Contents"><![CDATA[
+/* XPM */
+/* This file can be converted to EPS by the GROMACS program xpm2ps */
+/* title:   "Cluster size distribution" */
+/* legend:  "# clusters" */
+/* x-label: "Time (ps)" */
+/* y-label: "Size" */
+/* type:    "Continuous" */
+static char *gromacs_xpm[] = {
+"2 2   6 1",
+"A  c #FFFFFF " /* "0" */,
+"B  c #FFFF00 " /* "1" */,
+"C  c #BFBF40 " /* "1.75" */,
+"D  c #808080 " /* "2.5" */,
+"E  c #4040BF " /* "3.25" */,
+"F  c #0000FF " /* "4" */,
+/* x-axis:  1 2 */
+/* y-axis:  1 2 */
+"EC",
+"CF"
+]]></String>
+    </File>
+    <File Name="-ow">
+      <String Name="Contents"><![CDATA[
+/* XPM */
+/* This file can be converted to EPS by the GROMACS program xpm2ps */
+/* title:   "Weighted cluster size distribution" */
+/* legend:  "Fraction" */
+/* x-label: "Time (ps)" */
+/* y-label: "Size" */
+/* type:    "Continuous" */
+static char *gromacs_xpm[] = {
+"2 2   6 1",
+"A  c #FFFFFF " /* "0" */,
+"B  c #FFFF00 " /* "2" */,
+"C  c #BFBF40 " /* "3" */,
+"D  c #808080 " /* "4" */,
+"E  c #4040BF " /* "5" */,
+"F  c #0000FF " /* "6" */,
+/* x-axis:  1 2 */
+/* y-axis:  1 2 */
+"FD",
+"BD"
+]]></String>
+    </File>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/ClustsizeTest_MolDefaultCutoff.xml b/src/gromacs/trajectoryanalysis/tests/refdata/ClustsizeTest_MolDefaultCutoff.xml
new file mode 100644 (file)
index 0000000..abe2eb8
--- /dev/null
@@ -0,0 +1,105 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">clustsize -mol</String>
+  <OutputFiles Name="Files">
+    <File Name="-mc">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Max cluster size"
+xaxis  label "Time (ps)"
+yaxis  label "#molecules"
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>1.000000e+00</Real>
+          <Real>2</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">2</Int>
+          <Real>2.000000e+00</Real>
+          <Real>2</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+    <File Name="-nc">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Number of clusters"
+xaxis  label "Time (ps)"
+yaxis  label "N"
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>1.000000e+00</Real>
+          <Real>5</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">2</Int>
+          <Real>2.000000e+00</Real>
+          <Real>6</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+    <File Name="-ac">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Average cluster size"
+xaxis  label "Time (ps)"
+yaxis  label "#molecules"
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>1.000000e+00</Real>
+          <Real>2.000</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">2</Int>
+          <Real>2.000000e+00</Real>
+          <Real>2.000</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+    <File Name="-hc">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Cluster size distribution"
+xaxis  label "Cluster size"
+yaxis  label "()"
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>0</Real>
+          <Real>0.000</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">2</Int>
+          <Real>1</Real>
+          <Real>3.000</Real>
+        </Sequence>
+        <Sequence Name="Row2">
+          <Int Name="Length">2</Int>
+          <Real>2</Real>
+          <Real>2.500</Real>
+        </Sequence>
+        <Sequence Name="Row3">
+          <Int Name="Length">2</Int>
+          <Real>3</Real>
+          <Real>0.000</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/ClustsizeTest_MolShortCutoff.xml b/src/gromacs/trajectoryanalysis/tests/refdata/ClustsizeTest_MolShortCutoff.xml
new file mode 100644 (file)
index 0000000..018d47d
--- /dev/null
@@ -0,0 +1,105 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">clustsize -mol -cut 0.3</String>
+  <OutputFiles Name="Files">
+    <File Name="-mc">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Max cluster size"
+xaxis  label "Time (ps)"
+yaxis  label "#molecules"
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>1.000000e+00</Real>
+          <Real>2</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">2</Int>
+          <Real>2.000000e+00</Real>
+          <Real>2</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+    <File Name="-nc">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Number of clusters"
+xaxis  label "Time (ps)"
+yaxis  label "N"
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>1.000000e+00</Real>
+          <Real>7</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">2</Int>
+          <Real>2.000000e+00</Real>
+          <Real>7</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+    <File Name="-ac">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Average cluster size"
+xaxis  label "Time (ps)"
+yaxis  label "#molecules"
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>1.000000e+00</Real>
+          <Real>2.000</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">2</Int>
+          <Real>2.000000e+00</Real>
+          <Real>2.000</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+    <File Name="-hc">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Cluster size distribution"
+xaxis  label "Cluster size"
+yaxis  label "()"
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>0</Real>
+          <Real>0.000</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">2</Int>
+          <Real>1</Real>
+          <Real>6.000</Real>
+        </Sequence>
+        <Sequence Name="Row2">
+          <Int Name="Length">2</Int>
+          <Real>2</Real>
+          <Real>1.000</Real>
+        </Sequence>
+        <Sequence Name="Row3">
+          <Int Name="Length">2</Int>
+          <Real>3</Real>
+          <Real>0.000</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/ClustsizeTest_NoMolDefaultCutoff.xml b/src/gromacs/trajectoryanalysis/tests/refdata/ClustsizeTest_NoMolDefaultCutoff.xml
new file mode 100644 (file)
index 0000000..8ae771b
--- /dev/null
@@ -0,0 +1,125 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">clustsize</String>
+  <OutputFiles Name="Files">
+    <File Name="-mc">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Max cluster size"
+xaxis  label "Time (ps)"
+yaxis  label "#molecules"
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>1.000000e+00</Real>
+          <Real>6</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">2</Int>
+          <Real>2.000000e+00</Real>
+          <Real>6</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+    <File Name="-nc">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Number of clusters"
+xaxis  label "Time (ps)"
+yaxis  label "N"
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>1.000000e+00</Real>
+          <Real>5</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">2</Int>
+          <Real>2.000000e+00</Real>
+          <Real>6</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+    <File Name="-ac">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Average cluster size"
+xaxis  label "Time (ps)"
+yaxis  label "#molecules"
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>1.000000e+00</Real>
+          <Real>4.800</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">2</Int>
+          <Real>2.000000e+00</Real>
+          <Real>4.000</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+    <File Name="-hc">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Cluster size distribution"
+xaxis  label "Cluster size"
+yaxis  label "()"
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>0</Real>
+          <Real>0.000</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">2</Int>
+          <Real>1</Real>
+          <Real>0.000</Real>
+        </Sequence>
+        <Sequence Name="Row2">
+          <Int Name="Length">2</Int>
+          <Real>2</Real>
+          <Real>0.000</Real>
+        </Sequence>
+        <Sequence Name="Row3">
+          <Int Name="Length">2</Int>
+          <Real>3</Real>
+          <Real>3.000</Real>
+        </Sequence>
+        <Sequence Name="Row4">
+          <Int Name="Length">2</Int>
+          <Real>4</Real>
+          <Real>0.000</Real>
+        </Sequence>
+        <Sequence Name="Row5">
+          <Int Name="Length">2</Int>
+          <Real>5</Real>
+          <Real>0.000</Real>
+        </Sequence>
+        <Sequence Name="Row6">
+          <Int Name="Length">2</Int>
+          <Real>6</Real>
+          <Real>2.500</Real>
+        </Sequence>
+        <Sequence Name="Row7">
+          <Int Name="Length">2</Int>
+          <Real>7</Real>
+          <Real>0.000</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/ClustsizeTest_NoMolShortCutoff.xml b/src/gromacs/trajectoryanalysis/tests/refdata/ClustsizeTest_NoMolShortCutoff.xml
new file mode 100644 (file)
index 0000000..df027f4
--- /dev/null
@@ -0,0 +1,125 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">clustsize -cut 0.3</String>
+  <OutputFiles Name="Files">
+    <File Name="-mc">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Max cluster size"
+xaxis  label "Time (ps)"
+yaxis  label "#molecules"
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>1.000000e+00</Real>
+          <Real>6</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">2</Int>
+          <Real>2.000000e+00</Real>
+          <Real>6</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+    <File Name="-nc">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Number of clusters"
+xaxis  label "Time (ps)"
+yaxis  label "N"
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>1.000000e+00</Real>
+          <Real>7</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">2</Int>
+          <Real>2.000000e+00</Real>
+          <Real>7</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+    <File Name="-ac">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Average cluster size"
+xaxis  label "Time (ps)"
+yaxis  label "#molecules"
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>1.000000e+00</Real>
+          <Real>3.429</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">2</Int>
+          <Real>2.000000e+00</Real>
+          <Real>3.429</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+    <File Name="-hc">
+      <XvgLegend Name="Legend">
+        <String Name="XvgLegend"><![CDATA[
+title "Cluster size distribution"
+xaxis  label "Cluster size"
+yaxis  label "()"
+TYPE xy
+]]></String>
+      </XvgLegend>
+      <XvgData Name="Data">
+        <Sequence Name="Row0">
+          <Int Name="Length">2</Int>
+          <Real>0</Real>
+          <Real>0.000</Real>
+        </Sequence>
+        <Sequence Name="Row1">
+          <Int Name="Length">2</Int>
+          <Real>1</Real>
+          <Real>0.000</Real>
+        </Sequence>
+        <Sequence Name="Row2">
+          <Int Name="Length">2</Int>
+          <Real>2</Real>
+          <Real>0.000</Real>
+        </Sequence>
+        <Sequence Name="Row3">
+          <Int Name="Length">2</Int>
+          <Real>3</Real>
+          <Real>6.000</Real>
+        </Sequence>
+        <Sequence Name="Row4">
+          <Int Name="Length">2</Int>
+          <Real>4</Real>
+          <Real>0.000</Real>
+        </Sequence>
+        <Sequence Name="Row5">
+          <Int Name="Length">2</Int>
+          <Real>5</Real>
+          <Real>0.000</Real>
+        </Sequence>
+        <Sequence Name="Row6">
+          <Int Name="Length">2</Int>
+          <Real>6</Real>
+          <Real>1.000</Real>
+        </Sequence>
+        <Sequence Name="Row7">
+          <Int Name="Length">2</Int>
+          <Real>7</Real>
+          <Real>0.000</Real>
+        </Sequence>
+      </XvgData>
+    </File>
+  </OutputFiles>
+</ReferenceData>
index 06d7089fed4e5924b6c9ea9f9ae0cb4106fcb989..2eecb9af435ca89caa0b0955ef1795a82cb21a4f 100644 (file)
           </DataValue>
           <DataValue>
             <Real Name="Value">0</Real>
+            <Bool Name="Present">false</Bool>
           </DataValue>
           <DataValue>
             <Real Name="Value">1</Real>
+            <Bool Name="Present">false</Bool>
           </DataValue>
           <DataValue>
             <Real Name="Value">0</Real>
+            <Bool Name="Present">false</Bool>
           </DataValue>
           <DataValue>
             <Real Name="Value">0</Real>
+            <Bool Name="Present">false</Bool>
           </DataValue>
           <DataValue>
             <Real Name="Value">1</Real>
+            <Bool Name="Present">false</Bool>
           </DataValue>
           <DataValue>
             <Real Name="Value">0</Real>
+            <Bool Name="Present">false</Bool>
           </DataValue>
         </DataValues>
       </DataFrame>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/TrajectoryModuleTest_BasicTest.xml b/src/gromacs/trajectoryanalysis/tests/refdata/TrajectoryModuleTest_BasicTest.xml
new file mode 100644 (file)
index 0000000..2d8c33b
--- /dev/null
@@ -0,0 +1,142 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">trajectory -select 'resnr 1' 'resnr 3'</String>
+  <OutputData Name="Data">
+    <AnalysisData Name="x">
+      <DataFrame Name="Frame0">
+        <Real Name="X">0</Real>
+        <DataValues>
+          <Int Name="Count">9</Int>
+          <Int Name="DataSet">0</Int>
+          <DataValue>
+            <Real Name="Value">4</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">4</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">4</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+        </DataValues>
+        <DataValues>
+          <Int Name="Count">9</Int>
+          <Int Name="DataSet">1</Int>
+          <DataValue>
+            <Real Name="Value">1</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">4</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+      <DataFrame Name="Frame1">
+        <Real Name="X">0</Real>
+        <DataValues>
+          <Int Name="Count">9</Int>
+          <Int Name="DataSet">0</Int>
+          <DataValue>
+            <Real Name="Value">4</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">4</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">4</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">4</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+        </DataValues>
+        <DataValues>
+          <Int Name="Count">9</Int>
+          <Int Name="DataSet">1</Int>
+          <DataValue>
+            <Real Name="Value">1</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">4</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+    </AnalysisData>
+  </OutputData>
+  <OutputFiles Name="Files">
+    <File Name="-ox"></File>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/TrajectoryModuleTest_HandlesNoForces.xml b/src/gromacs/trajectoryanalysis/tests/refdata/TrajectoryModuleTest_HandlesNoForces.xml
new file mode 100644 (file)
index 0000000..13876a0
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">trajectory -select 'resnr 1' 'resnr 3'</String>
+  <OutputData Name="Data">
+    <AnalysisData Name="f"></AnalysisData>
+  </OutputData>
+  <OutputFiles Name="Files">
+    <File Name="-of"></File>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/TrajectoryModuleTest_HandlesNoVelocities.xml b/src/gromacs/trajectoryanalysis/tests/refdata/TrajectoryModuleTest_HandlesNoVelocities.xml
new file mode 100644 (file)
index 0000000..dc51121
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">trajectory -select 'resnr 1' 'resnr 3'</String>
+  <OutputData Name="Data">
+    <AnalysisData Name="v"></AnalysisData>
+  </OutputData>
+  <OutputFiles Name="Files">
+    <File Name="-ov"></File>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/TrajectoryModuleTest_PlotsXOnly.xml b/src/gromacs/trajectoryanalysis/tests/refdata/TrajectoryModuleTest_PlotsXOnly.xml
new file mode 100644 (file)
index 0000000..9715cae
--- /dev/null
@@ -0,0 +1,142 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">trajectory -select 'resnr 1' 'resnr 3' -x</String>
+  <OutputData Name="Data">
+    <AnalysisData Name="x">
+      <DataFrame Name="Frame0">
+        <Real Name="X">0</Real>
+        <DataValues>
+          <Int Name="Count">9</Int>
+          <Int Name="DataSet">0</Int>
+          <DataValue>
+            <Real Name="Value">4</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">4</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">4</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+        </DataValues>
+        <DataValues>
+          <Int Name="Count">9</Int>
+          <Int Name="DataSet">1</Int>
+          <DataValue>
+            <Real Name="Value">1</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">4</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+      <DataFrame Name="Frame1">
+        <Real Name="X">0</Real>
+        <DataValues>
+          <Int Name="Count">9</Int>
+          <Int Name="DataSet">0</Int>
+          <DataValue>
+            <Real Name="Value">4</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">4</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">4</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">4</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+        </DataValues>
+        <DataValues>
+          <Int Name="Count">9</Int>
+          <Int Name="DataSet">1</Int>
+          <DataValue>
+            <Real Name="Value">1</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">4</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+    </AnalysisData>
+  </OutputData>
+  <OutputFiles Name="Files">
+    <File Name="-ox"></File>
+  </OutputFiles>
+</ReferenceData>
index 30dc1a344eedc16ce8d74c6b7caed2c846827a52..cdc64442bc29ef31fbb814a2239df83cf4adfc04 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) 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.
@@ -71,7 +71,7 @@ class SurfaceAreaTest : public ::testing::Test
     public:
         SurfaceAreaTest()
             : rng_(12345), area_(0.0), volume_(0.0),
-              atomArea_(NULL), dotCount_(0), dots_(NULL)
+              atomArea_(nullptr), dotCount_(0), dots_(nullptr)
         {
             clear_mat(box_);
         }
@@ -88,7 +88,7 @@ class SurfaceAreaTest : public ::testing::Test
             {
                 index_.push_back(x_.size());
             }
-            x_.push_back(gmx::RVec(x, y, z));
+            x_.emplace_back(x, y, z);
             radius_.push_back(radius);
         }
 
@@ -142,10 +142,10 @@ class SurfaceAreaTest : public ::testing::Test
         {
             volume_   = 0.0;
             sfree(atomArea_);
-            atomArea_ = NULL;
+            atomArea_ = nullptr;
             dotCount_ = 0;
             sfree(dots_);
-            dots_     = NULL;
+            dots_     = nullptr;
             t_pbc       pbc;
             if (bPBC)
             {
@@ -156,7 +156,7 @@ class SurfaceAreaTest : public ::testing::Test
                         gmx::SurfaceAreaCalculator calculator;
                         calculator.setDotCount(ndots);
                         calculator.setRadii(radius_);
-                        calculator.calculate(as_rvec_array(x_.data()), bPBC ? &pbc : NULL,
+                        calculator.calculate(as_rvec_array(x_.data()), bPBC ? &pbc : nullptr,
                                              index_.size(), index_.data(), flags,
                                              &area_, &volume_, &atomArea_,
                                              &dots_, &dotCount_);
@@ -176,11 +176,11 @@ class SurfaceAreaTest : public ::testing::Test
             {
                 compound.checkReal(volume_, "Volume");
             }
-            if (atomArea_ != NULL)
+            if (atomArea_ != nullptr)
             {
                 compound.checkSequenceArray(index_.size(), atomArea_, "AtomArea");
             }
-            if (dots_ != NULL)
+            if (dots_ != nullptr)
             {
                 if (checkDotCoordinates)
                 {
diff --git a/src/gromacs/trajectoryanalysis/tests/trajectory.cpp b/src/gromacs/trajectoryanalysis/tests/trajectory.cpp
new file mode 100644 (file)
index 0000000..2124ebe
--- /dev/null
@@ -0,0 +1,125 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Tests for functionality of the "trajectory" trajectory analysis module.
+ *
+ * Line coverage for the module code is good, but due to missing input data
+ * with velocities or forces, the output of these quantities is not really
+ * tested.  But the values are only computed in the selection engine, and
+ * at least the low-level computation is tested there.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_trajectoryanalysis
+ */
+#include "gmxpre.h"
+
+#include "gromacs/trajectoryanalysis/modules/trajectory.h"
+
+#include <gtest/gtest.h>
+
+#include "testutils/cmdlinetest.h"
+#include "testutils/textblockmatchers.h"
+
+#include "moduletest.h"
+
+namespace
+{
+
+using gmx::test::CommandLine;
+using gmx::test::NoTextMatch;
+
+/********************************************************************
+ * Tests for gmx::analysismodules::Trajectory.
+ */
+
+//! Test fixture for the select analysis module.
+typedef gmx::test::TrajectoryAnalysisModuleTestFixture<gmx::analysismodules::TrajectoryInfo>
+    TrajectoryModuleTest;
+
+TEST_F(TrajectoryModuleTest, BasicTest)
+{
+    const char *const cmdline[] = {
+        "trajectory",
+        "-select", "resnr 1", "resnr 3"
+    };
+    setTopology("simple.gro");
+    setTrajectory("simple.gro");
+    setOutputFile("-ox", "coord.xvg", NoTextMatch());
+    includeDataset("x");
+    runTest(CommandLine(cmdline));
+}
+
+TEST_F(TrajectoryModuleTest, PlotsXOnly)
+{
+    const char *const cmdline[] = {
+        "trajectory",
+        "-select", "resnr 1", "resnr 3",
+        "-x"
+    };
+    setTopology("simple.gro");
+    setTrajectory("simple.gro");
+    setOutputFile("-ox", "coord.xvg", NoTextMatch());
+    includeDataset("x");
+    runTest(CommandLine(cmdline));
+}
+
+TEST_F(TrajectoryModuleTest, HandlesNoVelocities)
+{
+    const char *const cmdline[] = {
+        "trajectory",
+        "-select", "resnr 1", "resnr 3",
+    };
+    setTopology("simple.gro");
+    setTrajectory("simple.gro");
+    setOutputFile("-ov", "vel.xvg", NoTextMatch());
+    includeDataset("v");
+    runTest(CommandLine(cmdline));
+}
+
+TEST_F(TrajectoryModuleTest, HandlesNoForces)
+{
+    const char *const cmdline[] = {
+        "trajectory",
+        "-select", "resnr 1", "resnr 3",
+    };
+    setTopology("simple.gro");
+    setTrajectory("simple.gro");
+    setOutputFile("-of", "force.xvg", NoTextMatch());
+    includeDataset("f");
+    runTest(CommandLine(cmdline));
+}
+
+} // namespace
diff --git a/src/gromacs/trajectoryanalysis/tests/unionfind.cpp b/src/gromacs/trajectoryanalysis/tests/unionfind.cpp
new file mode 100644 (file)
index 0000000..abfecf0
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Tests for the union-find implementation in unionfind.h.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_trajectoryanalysis
+ */
+#include "gmxpre.h"
+
+#include "gromacs/trajectoryanalysis/modules/unionfind.h"
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+namespace
+{
+
+/********************************************************************
+ * Tests for UnionFinder
+ */
+
+TEST(UnionFinderTest, WorksEmpty)
+{
+    using ::testing::IsEmpty;
+    gmx::UnionFinder finder;
+    finder.init(0);
+    EXPECT_THAT(finder.allSizes(), IsEmpty());
+}
+
+TEST(UnionFinderTest, BasicMerges)
+{
+    using ::testing::Each;
+    using ::testing::UnorderedElementsAre;
+    gmx::UnionFinder finder;
+    finder.init(7);
+    EXPECT_EQ(7U, finder.allSizes().size());
+    EXPECT_THAT(finder.allSizes(), Each(1));
+    finder.merge(0, 1);
+    finder.merge(2, 3);
+    finder.merge(0, 4);
+    finder.merge(3, 5);
+    EXPECT_THAT(finder.allSizes(), UnorderedElementsAre(3, 3, 1));
+}
+
+TEST(UnionFinderTest, LargerMerges)
+{
+    using ::testing::UnorderedElementsAre;
+    gmx::UnionFinder finder;
+    finder.init(7);
+    finder.merge(0, 1);
+    finder.merge(2, 3);
+    finder.merge(4, 5);
+    finder.merge(3, 5);
+    finder.merge(1, 5);
+    EXPECT_THAT(finder.allSizes(), UnorderedElementsAre(6, 1));
+}
+
+TEST(UnionFinderTest, LongRightMerge)
+{
+    using ::testing::ElementsAre;
+    gmx::UnionFinder finder;
+    finder.init(7);
+    finder.merge(0, 1);
+    finder.merge(1, 2);
+    finder.merge(2, 3);
+    finder.merge(3, 4);
+    finder.merge(4, 5);
+    finder.merge(5, 6);
+    EXPECT_THAT(finder.allSizes(), ElementsAre(7));
+}
+
+TEST(UnionFinderTest, LongLeftMerge)
+{
+    using ::testing::ElementsAre;
+    gmx::UnionFinder finder;
+    finder.init(7);
+    finder.merge(5, 6);
+    finder.merge(4, 5);
+    finder.merge(3, 4);
+    finder.merge(2, 3);
+    finder.merge(1, 2);
+    finder.merge(0, 1);
+    EXPECT_THAT(finder.allSizes(), ElementsAre(7));
+}
+
+/********************************************************************
+ * Tests for MappedUnionFinder
+ */
+
+TEST(MappedUnionFinderTest, BasicMerges)
+{
+    using ::testing::Each;
+    const int              mapping[] = {1, 1, 2, 2, 4, 6};
+    gmx::MappedUnionFinder finder;
+    finder.initWithGroupIndices(mapping);
+    EXPECT_EQ(4U, finder.allSizes().size());
+    EXPECT_THAT(finder.allSizes(), Each(1));
+    finder.mergeGroups(1, 4);
+    finder.mergeGroups(2, 6);
+    EXPECT_EQ(2U, finder.allSizes().size());
+    EXPECT_THAT(finder.allSizes(), Each(2));
+}
+
+} // namespace
index 0602323c3231fa225c02dae9c338543a3491722b..609b906cbeaa7b23473ff8a0881e9f39e659338c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,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.
  * managing directories and files.
  * The fate of this header depends on what is decided in Redmine issue #950.
  *
+ * <H3>Logging</H3>
+ *
+ * The headers logger.h and loggerbuilder.h provide interfaces and classes for
+ * writing log files (or logging to other targets).  See \ref page_logging for
+ * an overview.
+ *
  * \endif
  *
  * <H3>Implementation helpers</H3>
  *
  * \if libapi
  *
+ * The header strconvert.h declares string parsing routines.
+ *
  * The header gmxmpi.h abstracts away the mechanism of including either MPI or
  * thread-MPI headers depending on compilation options.
  * Similarly, gmxomp.h removes the need to use conditional compilation for code
index 5821a5970df1bd31d2171cee46639eb9d6bae68f..3c51372f8212bf9b29df71f7ba7ff9563782ade5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 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.
@@ -87,7 +87,7 @@ namespace internal
  *        gmx::alignedMalloc(). Just like system-provided routines, it provides
  *        memory that is aligned - but not padded.
  */
-static void *
+gmx_unused static void *
 alignedMallocGeneric(std::size_t bytes, std::size_t alignment)
 {
     // The amount of extra memory (beyound what the user asked for) we need is:
@@ -127,7 +127,7 @@ alignedMallocGeneric(std::size_t bytes, std::size_t alignment)
  * \note  This is an internal routine that should only be called from
  *        gmx::alignedFree().
  */
-static void
+gmx_unused static void
 alignedFreeGeneric(void *p)
 {
     if (p)
index df6769428f2600f46a414189f7727e0608ca35f9..a86df70fb159ecc25f93b6242d90cb04853d4588 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 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.
@@ -180,7 +180,7 @@ class AlignedAllocator
          *  \throws std::bad_alloc if the allocation fails.
          */
         pointer
-        allocate(std::size_t n, typename std::allocator<void>::const_pointer gmx_unused hint = 0)
+        allocate(std::size_t n, typename std::allocator<void>::const_pointer gmx_unused hint = nullptr)
         {
             void *p = internal::alignedMalloc(n*sizeof(T));
 
@@ -239,7 +239,7 @@ class AlignedAllocator
          */
         template<class T2>
         bool
-        operator==(const AlignedAllocator<T2> &gmx_unused rhs) const { return std::is_same<T, T2>::value; }
+        operator==(const AlignedAllocator<T2> &gmx_unused rhs) const { return std::is_same<T, T2>::value; GMX_UNUSED_VALUE(rhs); }
 
         /*! \brief Return true if two allocators are different
          *
index 5522d34556d91e4c362178308f51dc04c146ffe6..ab676b5ba1783f3e42867f1be64266a2e7e1d37e 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,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.
@@ -45,6 +45,7 @@
 
 #include <cstddef>
 
+#include <array>
 #include <iterator>
 #include <stdexcept>
 #include <utility>
@@ -67,8 +68,8 @@ namespace gmx
  */
 struct EmptyArrayRef {};
 
-/*! \brief
- * STL-like container for an interface to a C array (or part of a std::vector).
+/*! \brief STL-like container for an interface to a C array of T (or part
+ * of a std::vector<T> or std::array<T>).
  *
  * \tparam T  Value type of elements.
  *
@@ -76,14 +77,15 @@ struct EmptyArrayRef {};
  * following main differences:
  *  - This class does not have its own storage.  Instead, it references an
  *    existing array of values (either a C-style array or part of an existing
- *    std::vector<T>).
+ *    std::vector<T> or std::array<T>).
  *  - It is only possible to modify the values themselves through ArrayRef;
  *    it is not possible to add or remove values.
  *  - Copying objects of this type is cheap, and the copies behave identically
  *    to the original object: the copy references the same set of values.
  *
- * This class is useful for writing wrappers that expose a different view of
- * the internal data stored as a single vector/array.
+ * This class is useful for writing wrappers that expose a view of the
+ * internal data stored as a single vector/array, which can be a whole
+ * or part of the underlying storage.
  *
  * Methods in this class do not throw, except where indicated.
  *
@@ -165,7 +167,7 @@ class ArrayRef
         fromVector(typename std::vector<value_type>::iterator begin,
                    typename std::vector<value_type>::iterator end)
         {
-            value_type *p_begin = (begin != end) ? &*begin : NULL;
+            value_type *p_begin = (begin != end) ? &*begin : nullptr;
             value_type *p_end   = p_begin + (end-begin);
             return ArrayRef<value_type>(p_begin, p_end);
         }
@@ -181,7 +183,7 @@ class ArrayRef
          * used to initialize any ArrayRef, without specifying the template
          * type.  It is not explicit to enable that usage.
          */
-        ArrayRef(const EmptyArrayRef &) : begin_(NULL), end_(NULL) {}
+        ArrayRef(const EmptyArrayRef &) : begin_(nullptr), end_(nullptr) {}
         /*! \brief
          * Constructs a reference to a particular range.
          *
@@ -199,7 +201,7 @@ class ArrayRef
             GMX_ASSERT(end >= begin, "Invalid range");
         }
         /*! \brief
-         * Constructs a reference to a whole vector.
+         * Constructs a reference to a whole std::vector<T>.
          *
          * \param[in] v  Vector to reference.
          *
@@ -207,11 +209,28 @@ class ArrayRef
          * lifetime of this object.
          *
          * This constructor is not explicit to allow directly passing
-         * std::vector to a method that takes ArrayRef.
+         * std::vector<T> to a method that takes ArrayRef.
          */
         ArrayRef(std::vector<T> &v)
-            : begin_((!v.empty()) ? &v[0] : NULL),
-              end_((!v.empty()) ? &v[0] + v.size() : NULL)
+            : begin_((!v.empty()) ? &v[0] : nullptr),
+              end_((!v.empty()) ? &v[0] + v.size() : nullptr)
+        {
+        }
+        /*! \brief
+         * Constructs a reference to a whole std::array<T>.
+         *
+         * \param[in] a  Array to reference.
+         *
+         * Passed array must remain valid for the lifetime of this
+         * object.
+         *
+         * This constructor is not explicit to allow directly passing
+         * std::array<T> to a method that takes ArrayRef.
+         */
+        template <size_t count>
+        ArrayRef(std::array<T, count> &a)
+            : begin_((!a.empty()) ? &a[0] : NULL),
+              end_((!a.empty()) ? &a[0] + a.size() : NULL)
         {
         }
         //! \cond
@@ -231,11 +250,6 @@ class ArrayRef
          *
          * This constructor is not explicit to allow directly passing
          * a C array to a function that takes an ArrayRef parameter.
-         *
-         * xlc on BG/Q compiles wrong code if the C array is a struct
-         * field, unless value_type is char or unsigned char. There's
-         * no good way to assert on this before C++11 (which that
-         * compiler will never support).
          */
         template <size_t count>
         ArrayRef(value_type (&array)[count])
@@ -323,9 +337,8 @@ class ArrayRef
 
 
 
-/*! \brief
- * STL-like container for non-mutable interface to a C array (or part of a
- * std::vector).
+/*! \brief STL-like container for non-mutable interface to a C array of T
+ * (or part of a std::vector<T> or std::array<T>).
  *
  * \tparam T  Value type of elements.
  *
@@ -333,14 +346,15 @@ class ArrayRef
  * following main differences:
  *  - This class does not have its own storage.  Instead, it references an
  *    existing array of values (either a C-style array or part of an existing
- *    std::vector<T>).
+ *    std::vector<T> or std::array<T>).
  *  - Only const methods are provided to access the stored values.
  *    It is not possible to alter the referenced array.
  *  - Copying objects of this type is cheap, and the copies behave identically
  *    to the original object: the copy references the same set of values.
  *
- * This class is useful for writing wrappers that expose a different view of
- * the internal data stored as a single vector/array.
+ * This class is useful for writing wrappers that expose a view of the
+ * internal data stored as a single vector/array, which can be a whole
+ * or part of the underlying storage.
  *
  * Methods in this class do not throw, except where indicated.
  *
@@ -394,7 +408,7 @@ class ConstArrayRef
         fromVector(typename std::vector<value_type>::const_iterator begin,
                    typename std::vector<value_type>::const_iterator end)
         {
-            const value_type *p_begin = (begin != end) ? &*begin : NULL;
+            const value_type *p_begin = (begin != end) ? &*begin : nullptr;
             const value_type *p_end   = p_begin + (end-begin);
             return ConstArrayRef<value_type>(p_begin, p_end);
         }
@@ -402,7 +416,7 @@ class ConstArrayRef
         /*! \brief
          * Constructs an empty reference.
          */
-        ConstArrayRef() : begin_(NULL), end_(NULL) {}
+        ConstArrayRef() : begin_(nullptr), end_(nullptr) {}
         /*! \brief
          * Constructs an empty reference.
          *
@@ -410,7 +424,11 @@ class ConstArrayRef
          * used to initialize any Const ArrayRef, without specifying the
          * template type.  It is not explicit to enable that usage.
          */
-        ConstArrayRef(const EmptyArrayRef &) : begin_(NULL), end_(NULL) {}
+        ConstArrayRef(const EmptyArrayRef &) : begin_(nullptr), end_(nullptr) {}
+        /*! \brief
+         * Constructs a const reference from a non-const reference.
+         */
+        ConstArrayRef(const ArrayRef<T> &other) : begin_(other.begin()), end_(other.end()) {}
         /*! \brief
          * Constructs a reference to a particular range.
          *
@@ -428,7 +446,7 @@ class ConstArrayRef
             GMX_ASSERT(end >= begin, "Invalid range");
         }
         /*! \brief
-         * Constructs a reference to a whole vector.
+         * Constructs a reference to a whole std::vector<T>.
          *
          * \param[in] v  Vector to reference.
          *
@@ -436,11 +454,28 @@ class ConstArrayRef
          * lifetime of this object.
          *
          * This constructor is not explicit to allow directly passing
-         * std::vector to a method that takes ConstArrayRef.
+         * std::vector<T> to a method that takes ConstArrayRef.
          */
         ConstArrayRef(const std::vector<T> &v)
-            : begin_((!v.empty()) ? &v[0] : NULL),
-              end_((!v.empty()) ? &v[0] + v.size() : NULL)
+            : begin_((!v.empty()) ? &v[0] : nullptr),
+              end_((!v.empty()) ? &v[0] + v.size() : nullptr)
+        {
+        }
+        /*! \brief
+         * Constructs a reference to a whole std::array<T>.
+         *
+         * \param[in] a  Array to reference.
+         *
+         * Passed array must remain valid for the lifetime of this
+         * object.
+         *
+         * This constructor is not explicit to allow directly passing
+         * std::array<T> to a method that takes ConstArrayRef.
+         */
+        template <size_t count>
+        ConstArrayRef(const std::array<T, count> &a)
+            : begin_((!a.empty()) ? &a[0] : NULL),
+              end_((!a.empty()) ? &a[0] + a.size() : NULL)
         {
         }
         //! \cond
@@ -460,11 +495,6 @@ class ConstArrayRef
          *
          * This constructor is not explicit to allow directly passing
          * a C array to a function that takes a ConstArrayRef parameter.
-         *
-         * xlc on BG/Q compiles wrong code if the C array is a struct
-         * field, unless value_type is char or unsigned char. There's
-         * no good way to assert on this before C++11 (which that
-         * compiler will never support).
          */
         template <size_t count>
         ConstArrayRef(const value_type (&array)[count])
index 47a820a04588e8650ed5f7a9ece8ee3dc757d02f..1c3e36c5da895c601ec318309249d02dd08507b5 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,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.
@@ -226,22 +226,6 @@ typedef uint64_t gmx_uint64_t;
 #endif
 #endif
 
-/*! \def gmx_constexpr
- * \brief C++11 constexpr everywhere except MSVC 2013, where it is empty.
- *
- * Support for constexpr was not added until MSVC 2015, and it still
- * seems to be unreliable. Since interacting with parts of libc++ and
- * libstdc++ depend on it (for instance the min/max calls in our
- * random engines), we need to specify it for other compilers.
- */
-#ifndef gmx_constexpr
-#if !defined(_MSC_VER)
-#    define gmx_constexpr constexpr
-#else
-#    define gmx_constexpr
-#endif
-#endif
-
 /*! \def GMX_ALIGNED(type, alignment)
  * \brief
  * Declare variable with data alignment
@@ -255,18 +239,10 @@ typedef uint64_t gmx_uint64_t;
    \endcode
  */
 
-#if (defined(__GNUC__) && !defined(__clang__)) || defined(__ibmxl__) || defined(__xlC__) || defined(__PATHCC__)
-// Gcc-4.6.4 does not support alignas, but both gcc, pathscale and xlc
-// support the standard GNU alignment attributes. PGI also sets __GNUC__ now,
-// and mostly supports it. clang 3.2 does not support the GCC alignment attribute.
-#    define GMX_ALIGNED(type, alignment) __attribute__ ((aligned(alignment*sizeof(type)))) type
-#else
-// If nothing else works we rely on C++11. This will for instance work for MSVC2015 and later.
+// We rely on C++11. This will for instance work for MSVC2015 and later.
 // If you get an error here, find out what attribute to use to get your compiler to align
 // data properly and add it as a case.
-#    define GMX_ALIGNED(type, alignment) alignas(alignment*alignof(type)) type
-#endif
-
+#define GMX_ALIGNED(type, alignment) alignas(alignment*sizeof(type)) type
 
 /*! \brief
  * Macro to explicitly ignore an unused value.
index 9feb963c50ba81e5c961bdc5103896880830e85b..a222478069847e6291e638a48f87c1194206b566 100644 (file)
@@ -68,6 +68,7 @@
 #include <cstring>
 
 #include <algorithm>
+#include <string>
 
 /* This file is completely threadsafe - keep it that way! */
 
 #include "gromacs/utility/path.h"
 #include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/textwriter.h"
 
 #include "cuda_version_information.h"
 
 namespace
 {
 
+using gmx::formatString;
+
 //! \cond Doxygen does not need to care about most of this stuff, and the macro usage is painful to document
 
 int centeringOffset(int width, int length)
@@ -92,13 +96,13 @@ int centeringOffset(int width, int length)
     return std::max(width - length, 0) / 2;
 }
 
-void printCentered(FILE *fp, int width, const char *text)
+std::string formatCentered(int width, const char *text)
 {
     const int offset = centeringOffset(width, std::strlen(text));
-    fprintf(fp, "%*s%s", offset, "", text);
+    return formatString("%*s%s", offset, "", text);
 }
 
-void printCopyright(FILE *fp)
+void printCopyright(gmx::TextWriter *writer)
 {
     static const char * const Contributors[] = {
         "Emile Apol",
@@ -157,8 +161,8 @@ void printCopyright(FILE *fp)
 #define NLICENSE (int)asize(LicenseText)
 #endif
 
-    printCentered(fp, 78, "GROMACS is written by:");
-    fprintf(fp, "\n");
+    // TODO a centering behaviour of TextWriter could be useful here
+    writer->writeLine(formatCentered(78, "GROMACS is written by:"));
     for (int i = 0; i < NCONTRIBUTORS; )
     {
         for (int j = 0; j < 4 && i < NCONTRIBUTORS; ++j, ++i)
@@ -170,22 +174,21 @@ void printCopyright(FILE *fp)
                                "Formatting buffer is not long enough");
             std::fill(buf, buf+width, ' ');
             std::strcpy(buf+offset, Contributors[i]);
-            fprintf(fp, " %-*s", width, buf);
+            writer->writeString(formatString(" %-*s", width, buf));
         }
-        fprintf(fp, "\n");
+        writer->ensureLineBreak();
     }
-    printCentered(fp, 78, "and the project leaders:");
-    fprintf(fp, "\n");
-    printCentered(fp, 78, "Mark Abraham, Berk Hess, Erik Lindahl, and David van der Spoel");
-    fprintf(fp, "\n\n");
+    writer->writeLine(formatCentered(78, "and the project leaders:"));
+    writer->writeLine(formatCentered(78, "Mark Abraham, Berk Hess, Erik Lindahl, and David van der Spoel"));
+    writer->ensureEmptyLine();
     for (int i = 0; i < NCR; ++i)
     {
-        fprintf(fp, "%s\n", CopyrightText[i]);
+        writer->writeLine(CopyrightText[i]);
     }
-    fprintf(fp, "\n");
+    writer->ensureEmptyLine();
     for (int i = 0; i < NLICENSE; ++i)
     {
-        fprintf(fp, "%s\n", LicenseText[i]);
+        writer->writeLine(LicenseText[i]);
     }
 }
 
@@ -214,96 +217,97 @@ const char *getFftDescriptionString()
 #endif
 };
 
-void gmx_print_version_info(FILE *fp)
+void gmx_print_version_info(gmx::TextWriter *writer)
 {
-    fprintf(fp, "GROMACS version:    %s\n", gmx_version());
+    writer->writeLine(formatString("GROMACS version:    %s", gmx_version()));
     const char *const git_hash = gmx_version_git_full_hash();
     if (git_hash[0] != '\0')
     {
-        fprintf(fp, "GIT SHA1 hash:      %s\n", git_hash);
+        writer->writeLine(formatString("GIT SHA1 hash:      %s", git_hash));
     }
     const char *const base_hash = gmx_version_git_central_base_hash();
     if (base_hash[0] != '\0')
     {
-        fprintf(fp, "Branched from:      %s\n", base_hash);
+        writer->writeLine(formatString("Branched from:      %s", base_hash));
     }
 
 #if GMX_DOUBLE
-    fprintf(fp, "Precision:          double\n");
+    writer->writeLine("Precision:          double");
 #else
-    fprintf(fp, "Precision:          single\n");
+    writer->writeLine("Precision:          single");
 #endif
-    fprintf(fp, "Memory model:       %u bit\n", (unsigned)(8*sizeof(void *)));
+    writer->writeLine(formatString("Memory model:       %u bit", (unsigned)(8*sizeof(void *))));
 
 #if GMX_THREAD_MPI
-    fprintf(fp, "MPI library:        thread_mpi\n");
+    writer->writeLine("MPI library:        thread_mpi");
 #elif GMX_MPI
-    fprintf(fp, "MPI library:        MPI\n");
+    writer->writeLine("MPI library:        MPI");
 #else
-    fprintf(fp, "MPI library:        none\n");
+    writer->writeLine("MPI library:        none");
 #endif
 #if GMX_OPENMP
-    fprintf(fp, "OpenMP support:     enabled (GMX_OPENMP_MAX_THREADS = %d)\n", GMX_OPENMP_MAX_THREADS);
-#else
-    fprintf(fp, "OpenMP support:     disabled\n");
-#endif
-    fprintf(fp, "GPU support:        %s\n", getGpuImplementationString());
-    fprintf(fp, "SIMD instructions:  %s\n", GMX_SIMD_STRING);
-    fprintf(fp, "FFT library:        %s\n", getFftDescriptionString());
-#ifdef HAVE_RDTSCP
-    fprintf(fp, "RDTSCP usage:       enabled\n");
+    writer->writeLine(formatString("OpenMP support:     enabled (GMX_OPENMP_MAX_THREADS = %d)", GMX_OPENMP_MAX_THREADS));
 #else
-    fprintf(fp, "RDTSCP usage:       disabled\n");
+    writer->writeLine("OpenMP support:     disabled");
 #endif
+    writer->writeLine(formatString("GPU support:        %s", getGpuImplementationString()));
+    writer->writeLine(formatString("SIMD instructions:  %s", GMX_SIMD_STRING));
+    writer->writeLine(formatString("FFT library:        %s", getFftDescriptionString()));
+    writer->writeLine(formatString("RDTSCP usage:       %s", HAVE_RDTSCP ? "enabled" : "disabled"));
 #ifdef GMX_USE_TNG
-    fprintf(fp, "TNG support:        enabled\n");
+    writer->writeLine("TNG support:        enabled");
 #else
-    fprintf(fp, "TNG support:        disabled\n");
+    writer->writeLine("TNG support:        disabled");
 #endif
 #if GMX_HWLOC
-    fprintf(fp, "Hwloc support:      hwloc-%d.%d.%d\n",
-            HWLOC_API_VERSION>>16,
-            (HWLOC_API_VERSION>>8) & 0xFF,
-            HWLOC_API_VERSION & 0xFF);
+    writer->writeLine(formatString("Hwloc support:      hwloc-%d.%d.%d",
+                                   HWLOC_API_VERSION>>16,
+                                   (HWLOC_API_VERSION>>8) & 0xFF,
+                                   HWLOC_API_VERSION & 0xFF));
 #else
-    fprintf(fp, "Hwloc support:      disabled\n");
+    writer->writeLine("Hwloc support:      disabled");
 #endif
 #if HAVE_EXTRAE
     unsigned major, minor, revision;
     Extrae_get_version(&major, &minor, &revision);
-    fprintf(fp, "Tracing support:    enabled. Using Extrae-%d.%d.%d\n", major, minor, revision);
+    writer->writeLine(formatString("Tracing support:    enabled. Using Extrae-%d.%d.%d", major, minor, revision));
 #else
-    fprintf(fp, "Tracing support:    disabled\n");
+    writer->writeLine("Tracing support:    disabled");
 #endif
 
 
-    fprintf(fp, "Built on:           %s\n", BUILD_TIME);
-    fprintf(fp, "Built by:           %s\n", BUILD_USER);
-    fprintf(fp, "Build OS/arch:      %s\n", BUILD_HOST);
-    fprintf(fp, "Build CPU vendor:   %s\n", BUILD_CPU_VENDOR);
-    fprintf(fp, "Build CPU brand:    %s\n", BUILD_CPU_BRAND);
-    fprintf(fp, "Build CPU family:   %d   Model: %d   Stepping: %d\n",
-            BUILD_CPU_FAMILY, BUILD_CPU_MODEL, BUILD_CPU_STEPPING);
+    writer->writeLine(formatString("Built on:           %s", BUILD_TIME));
+    writer->writeLine(formatString("Built by:           %s", BUILD_USER));
+    writer->writeLine(formatString("Build OS/arch:      %s", BUILD_HOST));
+    writer->writeLine(formatString("Build CPU vendor:   %s", BUILD_CPU_VENDOR));
+    writer->writeLine(formatString("Build CPU brand:    %s", BUILD_CPU_BRAND));
+    writer->writeLine(formatString("Build CPU family:   %d   Model: %d   Stepping: %d",
+                                   BUILD_CPU_FAMILY, BUILD_CPU_MODEL, BUILD_CPU_STEPPING));
     /* TODO: The below strings can be quite long, so it would be nice to wrap
      * them. Can wait for later, as the master branch has ready code to do all
      * that. */
-    fprintf(fp, "Build CPU features: %s\n", BUILD_CPU_FEATURES);
-    fprintf(fp, "C compiler:         %s\n", BUILD_C_COMPILER);
-    fprintf(fp, "C compiler flags:   %s\n", BUILD_CFLAGS);
-    fprintf(fp, "C++ compiler:       %s\n", BUILD_CXX_COMPILER);
-    fprintf(fp, "C++ compiler flags: %s\n", BUILD_CXXFLAGS);
+    writer->writeLine(formatString("Build CPU features: %s", BUILD_CPU_FEATURES));
+    writer->writeLine(formatString("C compiler:         %s", BUILD_C_COMPILER));
+    writer->writeLine(formatString("C compiler flags:   %s", BUILD_CFLAGS));
+    writer->writeLine(formatString("C++ compiler:       %s", BUILD_CXX_COMPILER));
+    writer->writeLine(formatString("C++ compiler flags: %s", BUILD_CXXFLAGS));
 #ifdef HAVE_LIBMKL
     /* MKL might be used for LAPACK/BLAS even if FFTs use FFTW, so keep it separate */
-    fprintf(fp, "Linked with Intel MKL version %d.%d.%d.\n",
-            __INTEL_MKL__, __INTEL_MKL_MINOR__, __INTEL_MKL_UPDATE__);
+    writer->writeLine(formatString("Linked with Intel MKL version %d.%d.%d.",
+                                   __INTEL_MKL__, __INTEL_MKL_MINOR__, __INTEL_MKL_UPDATE__));
 #endif
 #if GMX_GPU == GMX_GPU_OPENCL
-    fprintf(fp, "OpenCL include dir: %s\n", OPENCL_INCLUDE_DIR);
-    fprintf(fp, "OpenCL library:     %s\n", OPENCL_LIBRARY);
-    fprintf(fp, "OpenCL version:     %s\n", OPENCL_VERSION_STRING);
+    writer->writeLine(formatString("OpenCL include dir: %s", OPENCL_INCLUDE_DIR));
+    writer->writeLine(formatString("OpenCL library:     %s", OPENCL_LIBRARY));
+    writer->writeLine(formatString("OpenCL version:     %s", OPENCL_VERSION_STRING));
 #endif
 #if GMX_GPU == GMX_GPU_CUDA
-    gmx_print_version_info_cuda_gpu(fp);
+    writer->writeLine(formatString("CUDA compiler:      %s\n", CUDA_NVCC_COMPILER_INFO));
+    writer->writeLine(formatString("CUDA compiler flags:%s\n", CUDA_NVCC_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));
 #endif
 }
 
@@ -323,13 +327,28 @@ BinaryInformationSettings::BinaryInformationSettings()
 void printBinaryInformation(FILE                  *fp,
                             const IProgramContext &programContext)
 {
-    printBinaryInformation(fp, programContext, BinaryInformationSettings());
+    TextWriter writer(fp);
+    printBinaryInformation(&writer, programContext, BinaryInformationSettings());
 }
 
 void printBinaryInformation(FILE                            *fp,
                             const IProgramContext           &programContext,
                             const BinaryInformationSettings &settings)
 {
+    try
+    {
+        TextWriter writer(fp);
+        printBinaryInformation(&writer, programContext, settings);
+    }
+    GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
+}
+
+void printBinaryInformation(TextWriter                      *writer,
+                            const IProgramContext           &programContext,
+                            const BinaryInformationSettings &settings)
+{
+    // TODO Perhaps the writer could be configured with the prefix and
+    // suffix strings from the settings?
     const char *prefix          = settings.prefix_;
     const char *suffix          = settings.suffix_;
     const char *precisionString = "";
@@ -339,7 +358,7 @@ void printBinaryInformation(FILE                            *fp,
     const char *const name = programContext.displayName();
     if (settings.bGeneratedByHeader_)
     {
-        fprintf(fp, "%sCreated by:%s\n", prefix, suffix);
+        writer->writeLine(formatString("%sCreated by:%s", prefix, suffix));
     }
     // TODO: It would be nice to know here whether we are really running a
     // Gromacs binary or some other binary that is calling Gromacs; we
@@ -348,50 +367,50 @@ void printBinaryInformation(FILE                            *fp,
         = formatString(":-) GROMACS - %s, %s%s (-:", name, gmx_version(), precisionString);
     const int   indent
         = centeringOffset(78 - std::strlen(prefix) - std::strlen(suffix), title.length()) + 1;
-    fprintf(fp, "%s%*c%s%s\n", prefix, indent, ' ', title.c_str(), suffix);
-    fprintf(fp, "%s%s\n", prefix, suffix);
+    writer->writeLine(formatString("%s%*c%s%s", prefix, indent, ' ', title.c_str(), suffix));
+    writer->writeLine(formatString("%s%s", prefix, suffix));
     if (settings.bCopyright_)
     {
         GMX_RELEASE_ASSERT(prefix[0] == '\0' && suffix[0] == '\0',
                            "Prefix/suffix not supported with copyright");
-        printCopyright(fp);
-        fprintf(fp, "\n");
+        printCopyright(writer);
+        writer->ensureEmptyLine();
         // This line is printed again after the copyright notice to make it
         // appear together with all the other information, so that it is not
         // necessary to read stuff above the copyright notice.
         // The line above the copyright notice puts the copyright notice is
         // context, though.
-        fprintf(fp, "%sGROMACS:      %s, version %s%s%s\n", prefix, name,
-                gmx_version(), precisionString, suffix);
+        writer->writeLine(formatString("%sGROMACS:      %s, version %s%s%s", prefix, name,
+                                       gmx_version(), precisionString, suffix));
     }
     const char *const binaryPath = programContext.fullBinaryPath();
     if (!gmx::isNullOrEmpty(binaryPath))
     {
-        fprintf(fp, "%sExecutable:   %s%s\n", prefix, binaryPath, suffix);
+        writer->writeLine(formatString("%sExecutable:   %s%s", prefix, binaryPath, suffix));
     }
     const gmx::InstallationPrefixInfo installPrefix = programContext.installationPrefix();
     if (!gmx::isNullOrEmpty(installPrefix.path))
     {
-        fprintf(fp, "%sData prefix:  %s%s%s\n", prefix, installPrefix.path,
-                installPrefix.bSourceLayout ? " (source tree)" : "", suffix);
+        writer->writeLine(formatString("%sData prefix:  %s%s%s", prefix, installPrefix.path,
+                                       installPrefix.bSourceLayout ? " (source tree)" : "", suffix));
     }
     const std::string workingDir = Path::getWorkingDirectory();
     if (!workingDir.empty())
     {
-        fprintf(fp, "%sWorking dir:  %s%s\n", prefix, workingDir.c_str(), suffix);
+        writer->writeLine(formatString("%sWorking dir:  %s%s", prefix, workingDir.c_str(), suffix));
     }
     const char *const commandLine = programContext.commandLine();
     if (!gmx::isNullOrEmpty(commandLine))
     {
-        fprintf(fp, "%sCommand line:%s\n%s  %s%s\n",
-                prefix, suffix, prefix, commandLine, suffix);
+        writer->writeLine(formatString("%sCommand line:%s\n%s  %s%s",
+                                       prefix, suffix, prefix, commandLine, suffix));
     }
     if (settings.bExtendedInfo_)
     {
         GMX_RELEASE_ASSERT(prefix[0] == '\0' && suffix[0] == '\0',
                            "Prefix/suffix not supported with extended info");
-        fprintf(fp, "\n");
-        gmx_print_version_info(fp);
+        writer->ensureEmptyLine();
+        gmx_print_version_info(writer);
     }
 }
 
index 4611aa79538b018b7bce2418cbfdc82ee45343a1..670f0a88bba27d55dd4e7e4129f81b57b07e9191 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,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.
@@ -49,6 +49,7 @@ namespace gmx
 {
 
 class IProgramContext;
+class TextWriter;
 
 /*! \libinternal \brief
  * Settings for printBinaryInformation().
@@ -103,7 +104,8 @@ class BinaryInformationSettings
 
         //! Needed to read the members without otherwise unnecessary accessors.
         friend void printBinaryInformation(
-            FILE *fp, const IProgramContext &programContext,
+            TextWriter                      *writer,
+            const IProgramContext           &programContext,
             const BinaryInformationSettings &settings);
 };
 
@@ -128,6 +130,20 @@ void printBinaryInformation(FILE                            *fp,
                             const IProgramContext           &programContext,
                             const BinaryInformationSettings &settings);
 
+/*! \brief
+ * Print basic information about the executable with custom settings.
+ *
+ * \param[out] writer         Where to print the information.
+ * \param[in]  programContext Program information object to use.
+ * \param[in]  settings       Specifies what to print.
+ * \throws     std::bad_alloc if out of memory.
+ *
+ * \see BinaryInformationSettings
+ */
+void printBinaryInformation(TextWriter                      *writer,
+                            const IProgramContext           &programContext,
+                            const BinaryInformationSettings &settings);
+
 }     // namespace gmx
 
 #endif
index 6dceffc528b3832a1e67c714e8438d52caf5438d..3714313fe6cd5dea3dc9172ea09df8c7fc4d531c 100644 (file)
@@ -52,6 +52,7 @@
 namespace gmx
 {
 
+#ifdef DOXYGEN
 /*! \brief
  * Macro to declare a class non-copyable and non-assignable.
  *
@@ -59,9 +60,12 @@ namespace gmx
  *
  * \ingroup module_utility
  */
+#define GMX_DISALLOW_COPY_AND_ASSIGN(ClassName)
+#else
 #define GMX_DISALLOW_COPY_AND_ASSIGN(ClassName) \
     ClassName &operator=(const ClassName &) = delete;   \
     ClassName(const ClassName &)            = delete
+#endif
 /*! \brief
  * Macro to declare a class non-assignable.
  *
diff --git a/src/gromacs/utility/compare.cpp b/src/gromacs/utility/compare.cpp
new file mode 100644 (file)
index 0000000..3f170b5
--- /dev/null
@@ -0,0 +1,216 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * 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
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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.
+ */
+/* This file is completely threadsafe - keep it that way! */
+
+#include "gmxpre.h"
+
+#include "compare.h"
+
+#include <cmath>
+#include <cstdio>
+#include <cstring>
+
+#include "gromacs/utility/strconvert.h"
+
+void cmp_int(FILE *fp, const char *s, int index, int i1, int i2)
+{
+    if (i1 != i2)
+    {
+        if (index != -1)
+        {
+            fprintf(fp, "%s[%d] (%d - %d)\n", s, index, i1, i2);
+        }
+        else
+        {
+            fprintf(fp, "%s (%d - %d)\n", s, i1, i2);
+        }
+    }
+}
+
+void cmp_int64(FILE *fp, const char *s, gmx_int64_t i1, gmx_int64_t i2)
+{
+    if (i1 != i2)
+    {
+        fprintf(fp, "%s (", s);
+        fprintf(fp, "%" GMX_PRId64, i1);
+        fprintf(fp, " - ");
+        fprintf(fp, "%" GMX_PRId64, i2);
+        fprintf(fp, ")\n");
+    }
+}
+
+void cmp_us(FILE *fp, const char *s, int index, unsigned short i1, unsigned short i2)
+{
+    if (i1 != i2)
+    {
+        if (index != -1)
+        {
+            fprintf(fp, "%s[%d] (%hu - %hu)\n", s, index, i1, i2);
+        }
+        else
+        {
+            fprintf(fp, "%s (%hu - %hu)\n", s, i1, i2);
+        }
+    }
+}
+
+void cmp_uc(FILE *fp, const char *s, int index, unsigned char i1, unsigned char i2)
+{
+    if (i1 != i2)
+    {
+        if (index != -1)
+        {
+            fprintf(fp, "%s[%d] (%d - %d)\n", s, index, i1, i2);
+        }
+        else
+        {
+            fprintf(fp, "%s (%d - %d)\n", s, i1, i2);
+        }
+    }
+}
+
+gmx_bool cmp_bool(FILE *fp, const char *s, int index, gmx_bool b1, gmx_bool b2)
+{
+    if (b1)
+    {
+        b1 = 1;
+    }
+    else
+    {
+        b1 = 0;
+    }
+    if (b2)
+    {
+        b2 = 1;
+    }
+    else
+    {
+        b2 = 0;
+    }
+    if (b1 != b2)
+    {
+        if (index != -1)
+        {
+            fprintf(fp, "%s[%d] (%s - %s)\n", s, index,
+                    gmx::boolToString(b1), gmx::boolToString(b2));
+        }
+        else
+        {
+            fprintf(fp, "%s (%s - %s)\n", s,
+                    gmx::boolToString(b1), gmx::boolToString(b2));
+        }
+    }
+    return b1 && b2;
+}
+
+void cmp_str(FILE *fp, const char *s, int index, const char *s1, const char *s2)
+{
+    if (std::strcmp(s1, s2) != 0)
+    {
+        if (index != -1)
+        {
+            fprintf(fp, "%s[%d] (%s - %s)\n", s, index, s1, s2);
+        }
+        else
+        {
+            fprintf(fp, "%s (%s - %s)\n", s, s1, s2);
+        }
+    }
+}
+
+gmx_bool equal_real(real i1, real i2, real ftol, real abstol)
+{
+    return ( ( 2*fabs(i1 - i2) <= (fabs(i1) + fabs(i2))*ftol ) || fabs(i1-i2) <= abstol );
+}
+
+gmx_bool equal_float(float i1, float i2, float ftol, float abstol)
+{
+    return ( ( 2*fabs(i1 - i2) <= (fabs(i1) + fabs(i2))*ftol ) || fabs(i1-i2) <= abstol );
+}
+
+gmx_bool equal_double(double i1, double i2, real ftol, real abstol)
+{
+    return ( ( 2*fabs(i1 - i2) <= (fabs(i1) + fabs(i2))*ftol ) || fabs(i1-i2) <= abstol );
+}
+
+void
+cmp_real(FILE *fp, const char *s, int index, real i1, real i2, real ftol, real abstol)
+{
+    if (!equal_real(i1, i2, ftol, abstol))
+    {
+        if (index != -1)
+        {
+            fprintf(fp, "%s[%2d] (%e - %e)\n", s, index, i1, i2);
+        }
+        else
+        {
+            fprintf(fp, "%s (%e - %e)\n", s, i1, i2);
+        }
+    }
+}
+
+void
+cmp_float(FILE *fp, const char *s, int index, float i1, float i2, float ftol, float abstol)
+{
+    if (!equal_float(i1, i2, ftol, abstol))
+    {
+        if (index != -1)
+        {
+            fprintf(fp, "%s[%2d] (%e - %e)\n", s, index, i1, i2);
+        }
+        else
+        {
+            fprintf(fp, "%s (%e - %e)\n", s, i1, i2);
+        }
+    }
+}
+
+void
+cmp_double(FILE *fp, const char *s, int index, double i1, double i2, double ftol, double abstol)
+{
+    if (!equal_double(i1, i2, ftol, abstol))
+    {
+        if (index != -1)
+        {
+            fprintf(fp, "%s[%2d] (%16.9e - %16.9e)\n", s, index, i1, i2);
+        }
+        else
+        {
+            fprintf(fp, "%s (%16.9e - %16.9e)\n", s, i1, i2);
+        }
+    }
+}
diff --git a/src/gromacs/utility/compare.h b/src/gromacs/utility/compare.h
new file mode 100644 (file)
index 0000000..e322d20
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * 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
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Utilities for comparing data structures (for gmx check).
+ *
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_COMPARE_H
+#define GMX_UTILITY_COMPARE_H
+
+#include <cstdio>
+
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
+
+//! Compares two real values for equality.
+gmx_bool equal_real(real i1, real i2, real ftol, real abstol);
+//! Compares two float values for equality.
+gmx_bool equal_float(float i1, float i2, float ftol, float abstol);
+//! Compares two double values for equality.
+gmx_bool equal_double(double i1, double i2, real ftol, real abstol);
+
+//! Compares two integers and prints differences.
+void cmp_int(FILE *fp, const char *s, int index, int i1, int i2);
+
+//! Compares two 64-bit integers and prints differences.
+void cmp_int64(FILE *fp, const char *s, gmx_int64_t i1, gmx_int64_t i2);
+
+//! Compares two unsigned short values and prints differences.
+void cmp_us(FILE *fp, const char *s, int index, unsigned short i1, unsigned short i2);
+
+//! Compares two unsigned char values and prints differences.
+void cmp_uc(FILE *fp, const char *s, int index, unsigned char i1, unsigned char i2);
+
+//! Compares two boolean values and prints differences, and returns whether both are true.
+gmx_bool cmp_bool(FILE *fp, const char *s, int index, gmx_bool b1, gmx_bool b2);
+
+//! Compares two strings and prints differences.
+void cmp_str(FILE *fp, const char *s, int index, const char *s1, const char *s2);
+
+//! Compares two reals and prints differences.
+void cmp_real(FILE *fp, const char *s, int index, real i1, real i2, real ftol, real abstol);
+
+//! Compares two floats and prints differences.
+void cmp_float(FILE *fp, const char *s, int index, float i1, float i2, float ftol, float abstol);
+
+//! Compares two doubles and prints differences.
+void cmp_double(FILE *fp, const char *s, int index, double i1, double i2, double ftol, double abstol);
+
+#endif
index def9fe79dd0ee53b22bf741413844a8808db4fe5..8b313b40568a5137fa782b50a4288a278f39f423 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,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.
@@ -65,7 +65,7 @@ bool beCool(void)
      * a mutex for locking the variable...
      */
 #if GMX_COOL_QUOTES
-    return (getenv("GMX_NO_QUOTES") == NULL);
+    return (getenv("GMX_NO_QUOTES") == nullptr);
 #else
     /*be uncool*/
     return false;
@@ -629,7 +629,7 @@ std::string getCoolQuote()
         { "I was told I'd never make it to VP rank because I was too outspoken. Maybe so, but I think men will always find an excuse for keeping women in their 'place.' So, let's make that place the executive suite and start more of our own companies.", "Jean Bartik, ENIAC developer" },
         { "If it's a good idea, go ahead and do it. It's much easier to apologize than it is to get permission.", "Grace Hopper, developer of COBOL" },
         { "This isn't right. This isn't even wrong.", "Wolfgang Pauli" },
-        { "Louis Pasteur's theory of germs is ridicolous fiction.", "Pierre Pachet, Professor of Physiology at Toulouse, 1872" },
+        { "Louis Pasteur's theory of germs is ridiculous fiction.", "Pierre Pachet, Professor of Physiology at Toulouse, 1872" },
         { "Research ! A mere excuse for idleness; it has never achieved, and will never achieve any results of the slightest value.", "Benjamin Jowett, British theologian, 1817-93" },
         { "Problems worthy of attack prove their worth by hitting back.", "Piet Hein" },
         { "You should never bet against anything in science at odds of more than about 10^12 to 1.", "Ernest Rutherford" },
@@ -711,7 +711,7 @@ std::string getCoolQuote()
         { "Sir, spare your threats: The bug which you would fright me with I seek.", "Hermione, Act III, scene II of Shakespeare's Winter's Tale" },
         { "Erwin with his psi can do / Calculations quite a few. / But one thing has not been seen / Just what psi really mean.", "Felix Bloch" },
         { "Only entropy comes easy.", "Anton Chekov" },
-        { "The lovliest theories are being overthrown by these damned experiments; it is no fun being a chemist any more.", "Justus von Liebig, letter to J.J. Berzelius 1834" },
+        { "The loveliest theories are being overthrown by these damned experiments; it is no fun being a chemist any more.", "Justus von Liebig, letter to J.J. Berzelius 1834" },
         { "If all else fails, immortality can always be assured by spectacular error.", "John Kenneth Galbraith" },
         { "Always code as if the person who ends up maintaining your code is a violent psychopath who knows where you live.", "Martin Golding" },
         { "If I have not seen as far as others, it is because giants were standing on my shoulders.", "Hal Abelson" },
@@ -736,6 +736,78 @@ std::string getCoolQuote()
         { "They don't have half hours in the north", "Carl Caleman" },
         { "Safety lights are for dudes", "Ghostbusters 2016" },
         { "It's 2040 now. Our President is a plant.",  "Ghostbusters 2016" },
+        { "It's just B I O L O G Y, can't you see?" "Joe Jackson" },
+        { "Input, output, electricity", "Joni Mitchell" },
+        { "Your daddy ain't your daddy but your daddy don't know", "Dalahan" },
+        { "Why is the Earth moving 'round the sun? Floating in the vacuum with no purpose, not a one", "Fleet Foxes" },
+        { "Everybody has a plan until they get punched in the mouth", "Mike Tyson" },
+        { "Sacrifices must be made", "Otto Lilienthal, dying after having crashed with his glider in 1896" },
+        { "The secret to getting ahead is getting started", "Mark Twain" },
+        { "Water is just water", "Berk Hess" },
+        { "GROMACS First : Making MD Great Again", "Vedran Miletic" },
+        { "You still have to climb to the shoulders of the giants", "Vedran Miletic" },
+        { "The road to openness is paved with git commits", "Vedran Miletic" },
+        { "Performance and power are great targets for tuning, but really you want to tune for money!", "Erik Lindahl" },
+        { "Here are all the 'gmx' tools... but no gmx writethesis", "Christian Blau" },
+        { "The best part of winter in Stockholm is going to Australia", "Mark Abraham" },
+        { "If you don't know what you're doing, use a (M)BAR-based method", "Erik Lindahl" },
+        { "All models are wrong, but some are useful.", "George Box" },
+        { "If your experiment needs a statistician, you need a better experiment.", "Ernest Rutherford" },
+        { "Facts are stubborn things, but statistics are more pliable.", "Laurence Peter" },
+        { "In ancient times they had no statistics so they had to fall back on lies.", "Stephen Leacock" },
+        { "If at first you don't succeed, try two more times so that your failure is statistically significant.", "Dallas Warren" },
+        { "Your theory is crazy, but it's not crazy enough to be true.", "Niels Bohr" },
+        { "Science may never come up with a better office communication system than the coffee break.", "Earl Wilson" },
+        { "A scientific truth does not triumph by convincing its opponents and making them see the light, but rather because its opponents eventually die and a new generation grows up that is familiar with it.", "Max Planck" },
+        { "Computer science is no more about computers than astronomy is about telescopes", "Edsger Dijkstra" },
+        { "If we knew what it was we were doing, it would not be called research, would it?", "Albert Einstein" },
+        { "I have not failed. I've just found 10,000 ways that won't work", "Thomas Alva Edison" },
+        { "The public have an insatiable curiosity to know everything, except what is worth knowing.", "Oscar Wilde" },
+        { "Philosophy of science is about as useful to scientists as ornithology is to birds.", "Richard Feynman" },
+        { "I had trouble with physics in college. When I signed up I thought it said psychics.", "Greg Tamblyn" },
+        { "There’s an old saying among scientific guys: “You can’t make an omelet without breaking eggs, ideally by dropping a cement truck on them from a crane.", "Dave Barry" },
+        { "Occams Razor is the scientific principle that, all things being equal, the simplest explanation is always the dog ate my homework.", "Greg Tamblyn" },
+        { "When you get right down to it, almost every explanation Man came up with for anything until about 1926 was stupid.", "Dave Barry" },
+        { "We all understand the twinge of discomfort at the thought that we share a common ancestor with the apes. No one can embarrass you like a relative.", "Neal DeGrasse Tyson" },
+        { "In physics, you don't have to go around making trouble for yourself. Nature does it for you.", "Frank Wilczek" },
+        { "Every revolutionary idea seems to evoke three stages of reaction. They may be summed up by the phrases: (1) It's completely impossible. (2) It's possible, but not worth doing. (3) I said it was a good idea all along.", "Arthur C. Clarke" },
+        { "Computers are like humans - they do everything except think.", "John von Neumann" },
+        { "With four parameters I can fit an elephant, and with five I can make him wiggle his trunk.", "John von Neumann" },
+        { "Christianity may be OK between consenting adults in private but should not be taught to young children.", "Francis Crick" },
+        { "All approaches at a higher level are suspect until confirmed at the molecular level.", "Francis Crick" },
+        { "We haven’t the money, so we’ve got to think.", "Ernest Rutherford" },
+        { "Furious activity is no substitute for understanding.", "H.H. Williams" },
+        { "Discovery: A couple of months in the laboratory can frequently save a couple of hours in the library.", "Anonymous" },
+        { "Never replicate a successful experiment.", "Fett's law." },
+        { "Raw data is like raw sewage, it requires some processing before it can be spread around. The opposite is true of theories.", "Jim Carr" },
+        { "A university faculty is 500 egotists with a common parking problem.", "Keith Sullivan" },
+        { "Studying expands knowledge. Knowledge is power. Power corrupts. Corruption is a crime. Crime doesn't pay.", "Anonymous" },
+        { "A professor is one who talks in someone else's sleep.", "W.H. Auden" },
+        { "A tidy laboratory means a lazy chemist.", "J.J. Berzelius" },
+        { "Microbiology Lab - Staph Only.", "Anonymous" },
+        { "I can’t go to a restaurant and order food because I keep looking at the fonts on the menu. Five minutes later I realize that it’s also talking about food.", "Donald Knuth" },
+        { "Physics is like sex: sure, it may give some practical results, but that’s not why we do it", "Richard P. Feynman" },
+        { "Statistics: The only science that enables different experts using the same figures to draw different conclusions.", "Evan Esar" },
+        { "If I could remember the names of all these particles, I’d be a botanist.", "Albert Einstein" },
+        { "Science... never solves a problem without creating ten more.", "George Bernard Shaw" },
+        { "A mathematician is a blind man in a dark room looking for a black cat which isn't there.", "Charles Darwin" },
+        { "Nothing shocks me. I'm a scientist.", "Harrison Ford as Indiana Jones" },
+        { "There is an infinite set A that is not too big.", "John von Neumann" },
+        { "If it's all right with Dirac, it's all right with me.", "Enrico Fermi, on being told that there was experimental evidence He-3 nuclei obey Fermi-Dirac statistics." },
+        { "I cannot think of a single one, not even intelligence.", "Enrico Fermi, when asked what characteristics physics Nobel laureates had in common." },
+        { "Heavier-than-air flying machines are impossible.", "Lord Kelvin, President of Royal Society, 1895." },
+        { "All that glitters may not be gold, but at least it contains free electrons.", "John Desmond Baernal" },
+        { "It is disconcerting to reflect on the number of students we have flunked in chemistry for not knowing what we later found to be untrue.", "Robert L. Weber" },
+        { "People are DNA's way of making more DNA.", "Edward O. Wilson" },
+        { "The best model of a cat is another cat..., specially the same cat.", "Arturo Rosenblueth" },
+        { "Computer dating is fine, if you are a computer.", "Rita May Brown" },
+        { "The most likely way for the world to be destroyed, most experts agree, is by accident. That’s where we come in; we’re computer professionals. We cause accidents.", "Nathaniel Borenstein" },
+        { "An intellectual is someone who has found something more interesting than sex.", "Edgar Wallace" },
+        { "Base eight is just like base ten really, if you’re missing two fingers.", "Tom Lehrer" },
+        { "If 10 years from now, when you are doing something quick and dirty, you suddenly visualize that I am looking over your shoulders and say to yourself: ‘Dijkstra would not have liked this’, well that would be enough immortality for me.", "Edsger Dijkstra" },
+        { "Memory is like an orgasm. It’s a lot better of you don’t have to fake it.", "Seymour Cray, on virtual memory" },
+        { "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" }
     };
 
     if (beCool())
index c9b906d0739edcc19f3dfeebe2fa87fe4aa8051a..764a7711dd06ec9ec550621756333b33ae1b9c35 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,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.
@@ -46,7 +46,6 @@
 #include <cctype>
 #include <cstring>
 
-#include <sstream>
 #include <string>
 #include <vector>
 
@@ -54,7 +53,9 @@
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/utility/sysinfo.h"
+
+//! Comment sign to use.
+#define COMMENTSIGN ';'
 
 int continuing(char *s)
 {
@@ -79,11 +80,11 @@ int continuing(char *s)
 char *fgets2(char *line, int n, FILE *stream)
 {
     char *c;
-    if (fgets(line, n, stream) == NULL)
+    if (fgets(line, n, stream) == nullptr)
     {
-        return NULL;
+        return nullptr;
     }
-    if ((c = strchr(line, '\n')) != NULL)
+    if ((c = strchr(line, '\n')) != nullptr)
     {
         *c = '\0';
     }
@@ -98,7 +99,7 @@ char *fgets2(char *line, int n, FILE *stream)
             gmx_fatal(FARGS, "An input file contains a line longer than %d characters, while the buffer passed to fgets2 has size %d. The line starts with: '%20.20s'", n, n, line);
         }
     }
-    if ((c = strchr(line, '\r')) != NULL)
+    if ((c = strchr(line, '\r')) != nullptr)
     {
         *c = '\0';
     }
@@ -116,7 +117,7 @@ void strip_comment (char *line)
     }
 
     /* search for a comment mark and replace it by a zero */
-    if ((c = strchr(line, COMMENTSIGN)) != NULL)
+    if ((c = strchr(line, COMMENTSIGN)) != nullptr)
     {
         (*c) = 0;
     }
@@ -136,7 +137,7 @@ void ltrim (char *str)
 {
     int   i, c;
 
-    if (NULL == str)
+    if (nullptr == str)
     {
         return;
     }
@@ -160,7 +161,7 @@ void rtrim (char *str)
 {
     int nul;
 
-    if (NULL == str)
+    if (nullptr == str)
     {
         return;
     }
@@ -179,28 +180,6 @@ void trim (char *str)
     rtrim (str);
 }
 
-void nice_header(FILE *out, const char *fn)
-{
-    int            uid;
-    char           userbuf[256];
-    char           hostbuf[256];
-    char           timebuf[STRLEN];
-
-    /* Print a nice header above the file */
-    fprintf(out, "%c\n", COMMENTSIGN);
-    fprintf(out, "%c\tFile '%s' was generated\n", COMMENTSIGN, fn ? fn : "unknown");
-
-    uid  = gmx_getuid();
-    gmx_getusername(userbuf, 256);
-    gmx_gethostname(hostbuf, 256);
-    gmx_format_current_time(timebuf, STRLEN);
-
-    fprintf(out, "%c\tBy user: %s (%d)\n", COMMENTSIGN, userbuf, uid);
-    fprintf(out, "%c\tOn host: %s\n", COMMENTSIGN, hostbuf);
-    fprintf(out, "%c\tAt date: %s\n", COMMENTSIGN, timebuf);
-    fprintf(out, "%c\n", COMMENTSIGN);
-}
-
 int gmx_strcasecmp_min(const char *str1, const char *str2)
 {
     char ch1, ch2;
@@ -440,7 +419,7 @@ char *wrap_lines(const char *buf, int line_width, int indent, gmx_bool bIndentFi
      * the current line (where it also won't fit, but looks better)
      */
 
-    b2    = NULL;
+    b2    = nullptr;
     b2len = strlen(buf)+1+indent;
     snew(b2, b2len);
     i0 = i2 = 0;
@@ -540,80 +519,3 @@ char *gmx_step_str(gmx_int64_t i, char *buf)
     sprintf(buf, "%" GMX_PRId64, i);
     return buf;
 }
-
-void parse_digits_from_string(const char *digitstring, int *ndigits, int **digitlist)
-{
-    /* TODO use std::string, once gmx_gpu_opt_t is ready for it */
-    if (NULL == digitstring)
-    {
-        *ndigits   = 0;
-        *digitlist = NULL;
-        return;
-    }
-
-    if (strstr(digitstring, ",") != NULL)
-    {
-        parse_digits_from_csv_string(digitstring, ndigits, digitlist);
-    }
-    else
-    {
-        parse_digits_from_plain_string(digitstring, ndigits, digitlist);
-    }
-}
-
-void parse_digits_from_plain_string(const char *digitstring, int *ndigits, int **digitlist)
-{
-    int i;
-
-    if (NULL == digitstring)
-    {
-        *ndigits   = 0;
-        *digitlist = NULL;
-        return;
-    }
-
-    *ndigits = strlen(digitstring);
-
-    snew(*digitlist, *ndigits);
-
-    for (i = 0; i < *ndigits; i++)
-    {
-        if (digitstring[i] < '0' || digitstring[i] > '9')
-        {
-            gmx_fatal(FARGS, "Invalid character in digit-only string: '%c'\n",
-                      digitstring[i]);
-        }
-        (*digitlist)[i] = digitstring[i] - '0';
-    }
-}
-
-void parse_digits_from_csv_string(const char *digitstring, int *ndigits, int **digitlist)
-{
-    if (NULL == digitstring)
-    {
-        *ndigits   = 0;
-        *digitlist = NULL;
-        return;
-    }
-
-    std::vector<int>   digits;
-    std::istringstream ss(digitstring);
-    std::string        token;
-    while (std::getline(ss, token, ','))
-    {
-        if (token.find_first_not_of("0123456789") != std::string::npos)
-        {
-            gmx_fatal(FARGS, "Invalid token in digit-only string: \"%s\"\n",
-                      token.c_str());
-        }
-        int number = static_cast<int>(str_to_int64_t(token.c_str(), NULL));
-        digits.push_back(number);
-    }
-
-    *ndigits = digits.size();
-    snew(*digitlist, *ndigits);
-    for (size_t i = 0; i < digits.size(); i++)
-    {
-        (*digitlist)[i] = digits[i];
-    }
-}
index 44f6012500776de136e848c46924bce35a2471a6..a27a0ba353d43cc3a8927876215a91c5bdcef73d 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,2013,2014,2015, by the GROMACS development team, led by
+ * 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.
@@ -56,8 +56,6 @@ extern "C" {
 
 /** Continuation character. */
 #define CONTINUE    '\\'
-/** Comment sign to use. */
-#define COMMENTSIGN ';'
 /** Standard size for char* string buffers. */
 #define STRLEN 4096
 
@@ -77,7 +75,7 @@ int continuing(char *s);
  */
 char *fgets2(char *s, int n, FILE *stream);
 
-/** Remove portion of a line after a ::COMMENTSIGN.  */
+/** Remove portion of a line after a ';' comment sign.  */
 void strip_comment(char *line);
 
 /** Make a string uppercase. */
@@ -92,9 +90,6 @@ void rtrim(char *str);
 /** Remove leading and trailing whitespace from a string. */
 void trim(char *str);
 
-/** Prints creation time stamp and user information into a file as comments. */
-void nice_header(FILE *out, const char *fn);
-
 /** Version of gmx_strcasecmp() that also ignores '-' and '_'. */
 int gmx_strcasecmp_min(const char *str1, const char *str2);
 /** Version of gmx_strncasecmp() that also ignores '-' and '_'. */
@@ -191,52 +186,6 @@ gmx_int64_t str_to_int64_t(const char *str, char **endptr);
  */
 char *gmx_step_str(gmx_int64_t i, char *buf);
 
-/*! \brief Construct an array of digits found in the input string
- *
- * \param[in]  digitstring  String that must contain only digits
- * \param[out] ndigits      Size of return array with the values of the digits
- * \param[out] digitlist    Array of digits found in
- *                          digitstring. Allocated by this function
- *                          with size *ndigits. Calling code is
- *                          responsible for deallocation.
- *
- * If digitstring is NULL, then ndigits is set to zero and digitlist
- * to NULL. If digitstring contains a non-digit character, a fatal
- * error results.
- */
-void parse_digits_from_plain_string(const char *digitstring, int *ndigits, int **digitlist);
-
-/*! \brief Construct an array of digits from a comma separated input string
- *
- * \param[in]  digitstring  String that must contain only digits and commas
- * \param[out] ndigits      Size of return array with the values of the digits
- * \param[out] digitlist    Array of digits found in
- *                          digitstring. Allocated by this function
- *                          with size *ndigits. Calling code is
- *                          responsible for deallocation.
- *
- * If digitstring is NULL, then ndigits is set to zero and digitlist
- * to NULL. If digitstring contains a non digit-or-comma character, a fatal
- * error results.
- */
-void parse_digits_from_csv_string(const char *digitstring, int *ndigits, int **digitlist);
-
-/*! \brief Construct an array of digits an input string
- *
- *
- * \param[in]  digitstring  String that must contain only digits, or only
- *                          digits and commas
- * \param[out] ndigits      Size of return array with the values of the digits
- * \param[out] digitlist    Array of digits found in
- *                          digitstring. Allocated by this function
- *                          with size *ndigits. Calling code is
- *                          responsible for deallocation.
- * If digitstring is NULL, then ndigits is set to zero and digitlist
- * to NULL. If digitstring contains a non digit-or-comma character, a fatal
- * error results.
- */
-void parse_digits_from_string(const char *digitstring, int *ndigits, int **digitlist);
-
 #ifdef __cplusplus
 }
 #endif
index 98ce1cc2ccf7fc4e0b20f5d2e53f535e50024436..0d759bb47221b3a3cbee8dc9bca5c474890e961a 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,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.
 
 #include "cuda_version_information.h"
 
-#include <cstdio>
+#include <utility>
 
-#include "buildinfo.h"
+namespace gmx
+{
 
-void gmx_print_version_info_cuda_gpu(FILE *fp)
+std::pair<int, int> getCudaDriverVersion()
 {
-    int cuda_driver, cuda_runtime;
-    fprintf(fp, "CUDA compiler:      %s\n", CUDA_NVCC_COMPILER_INFO);
-    fprintf(fp, "CUDA compiler flags:%s\n", CUDA_NVCC_COMPILER_FLAGS);
-    cuda_driver = 0;
+    int cuda_driver;
     cudaDriverGetVersion(&cuda_driver);
-    cuda_runtime = 0;
+    return std::pair<int, int>(cuda_driver/1000, cuda_driver%100);
+}
+
+std::pair<int, int> getCudaRuntimeVersion()
+{
+    int cuda_runtime;
     cudaRuntimeGetVersion(&cuda_runtime);
-    fprintf(fp, "CUDA driver:        %d.%d\n", cuda_driver/1000, cuda_driver%100);
-    fprintf(fp, "CUDA runtime:       %d.%d\n", cuda_runtime/1000, cuda_runtime%100);
+    return std::pair<int, int>(cuda_runtime/1000, cuda_runtime%100);
 }
+
+} // namespace
index edff41ce498c51315fc4f46a227e4a27aaac3e7b..4cced2ca80e25d1475d8b816974e22a5b6a494a6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 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.
  * 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_GMXLIB_CUDA_TOOLS_CUDA_VERSION_INFORMATION_H
-#define GMX_GMXLIB_CUDA_TOOLS_CUDA_VERSION_INFORMATION_H
+#ifndef GMX_UTILITY_CUDA_VERSION_INFORMATION_H
+#define GMX_UTILITY_CUDA_VERSION_INFORMATION_H
 
-#include <cstdio>
+#include <utility>
 
-void gmx_print_version_info_cuda_gpu(FILE *fp);
+namespace gmx
+{
+
+//! Returns a (major, minor) tuple of the CUDA driver version.
+std::pair<int, int> getCudaDriverVersion();
+
+//! Returns a (major, minor) tuple of the CUDA runtime version.
+std::pair<int, int> getCudaRuntimeVersion();
+
+} // namespace
 
 #endif
index af7020e9395e129e74add506c511d3ba9a339108..96eec7f501686a56727ab572b79d65c5fe02df2a 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) 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.
@@ -68,7 +68,7 @@ class DataFileFinder::Impl
     public:
         static std::string getDefaultPath();
 
-        Impl() : envName_(NULL), bEnvIsSet_(false) {}
+        Impl() : envName_(nullptr), bEnvIsSet_(false) {}
 
         const char               *envName_;
         bool                      bEnvIsSet_;
@@ -125,7 +125,7 @@ FILE *DataFileFinder::openFile(const DataFileOptions &options) const
     std::string filename = findFile(options);
     if (filename.empty())
     {
-        return NULL;
+        return nullptr;
     }
 #if 0
     if (debug)
@@ -201,7 +201,7 @@ std::string DataFileFinder::findFile(const DataFileOptions &options) const
             message.append(defaultPath);
             message.append(" (default)");
         }
-        if (!bEnvIsSet && envName != NULL)
+        if (!bEnvIsSet && envName != nullptr)
         {
             message.append(
                     formatString("\nYou can set additional directories to search "
@@ -227,7 +227,7 @@ DataFileFinder::enumerateFiles(const DataFileOptions &options) const
                         ".", options.filename_, false);
         for (i = files.begin(); i != files.end(); ++i)
         {
-            result.push_back(DataFileInfo(".", *i, false));
+            result.emplace_back(".", *i, false);
         }
     }
     if (impl_ != nullptr)
@@ -240,7 +240,7 @@ DataFileFinder::enumerateFiles(const DataFileOptions &options) const
                             j->c_str(), options.filename_, false);
             for (i = files.begin(); i != files.end(); ++i)
             {
-                result.push_back(DataFileInfo(*j, *i, false));
+                result.emplace_back(*j, *i, false);
             }
         }
     }
@@ -252,7 +252,7 @@ DataFileFinder::enumerateFiles(const DataFileOptions &options) const
                         defaultPath.c_str(), options.filename_, false);
         for (i = files.begin(); i != files.end(); ++i)
         {
-            result.push_back(DataFileInfo(defaultPath, *i, true));
+            result.emplace_back(defaultPath, *i, true);
         }
     }
     if (result.empty() && options.bThrow_)
index 8ec23c6d890e0fb50cfa8364ca2f813fed8255a4..230f456be8bcdb8049633f3fc6587923cc9e9d8e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,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.
@@ -163,7 +163,7 @@ class DirectoryEnumerator::Impl
         {
             errno       = 0;
             DIR *handle = opendir(dirname);
-            if (handle == NULL)
+            if (handle == nullptr)
             {
                 if (bThrow)
                 {
@@ -173,7 +173,7 @@ class DirectoryEnumerator::Impl
                                      dirname);
                     GMX_THROW_WITH_ERRNO(FileIOError(message), "opendir", code);
                 }
-                return NULL;
+                return nullptr;
             }
             return new Impl(handle);
         }
@@ -187,7 +187,7 @@ class DirectoryEnumerator::Impl
         {
             errno = 0;
             dirent *p = readdir(dirent_handle);
-            if (p == NULL)
+            if (p == nullptr)
             {
                 if (errno == 0)
                 {
@@ -266,7 +266,7 @@ DirectoryEnumerator::enumerateFilesWithExtension(
 DirectoryEnumerator::DirectoryEnumerator(const char *dirname, bool bThrow)
     : impl_(nullptr)
 {
-    GMX_RELEASE_ASSERT(dirname != NULL && dirname[0] != '\0',
+    GMX_RELEASE_ASSERT(dirname != nullptr && dirname[0] != '\0',
                        "Attempted to open empty/null directory path");
     impl_.reset(Impl::init(dirname, bThrow));
 }
index 879d66a3248e03a1a123e6e2233d7309dd07cb0c..d18c8bd1164d7a9f9c33a57707927ec3ae8dd5d4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,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.
@@ -64,6 +64,7 @@ const char *const error_names[] =
     "System I/O error",
     "Error in user input",
     "Inconsistency in user input",
+    "Requested tolerance cannot be achieved",
     "Simulation instability detected",
 
     "Feature not implemented",
index 9d2b084d4c4527cf35ec24073dbd555507a1dfbd..b8158c63b3a1eab5ea3452bc7db015f6963277c7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2015,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.
@@ -67,6 +67,8 @@ enum ErrorCode
     eeInvalidInput,
     //! Invalid user input (conflicting or unsupported settings).
     eeInconsistentInput,
+    //! Requested tolerance cannot be achieved.
+    eeTolerance,
     //! Simulation instability detected.
     eeInstability,
 
index 2c8b21fb2b56191361b6bc62a4360a1a166a3059..1fc9d8b9cb2325d67af52979462090bd0faf3123 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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -76,12 +76,12 @@ void printFatalErrorHeader(FILE *fp, const char *title,
 
     std::fprintf(fp, "\n-------------------------------------------------------\n");
     std::fprintf(fp, "Program:     %s, version %s\n", programName, gmx_version());
-    if (file != NULL)
+    if (file != nullptr)
     {
         std::fprintf(fp, "Source file: %s (line %d)\n",
                      Path::stripSourcePrefix(file), line);
     }
-    if (func != NULL)
+    if (func != nullptr)
     {
         std::fprintf(fp, "Function:    %s\n", func);
     }
index e0d1325980da8cc7d1f22c6264d700097d4aa264..a90da61fbf7da22edfd0c40fed635c3a47c07470 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,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.
@@ -191,7 +191,7 @@ GromacsException::GromacsException(const ExceptionInitializer &details)
 const char *GromacsException::what() const noexcept
 {
     const ErrorMessage *msg = getInfo<ExceptionInfoMessage>();
-    if (msg == NULL)
+    if (msg == nullptr)
     {
         return "No reason provided";
     }
@@ -205,7 +205,7 @@ const char *GromacsException::what() const noexcept
 void GromacsException::prependContext(const std::string &context)
 {
     const ErrorMessage *msg = getInfo<ExceptionInfoMessage>();
-    GMX_RELEASE_ASSERT(msg != NULL, "Message should always be set");
+    GMX_RELEASE_ASSERT(msg != nullptr, "Message should always be set");
     setInfo(ExceptionInfoMessage(msg->prependContext(context)));
 }
 
@@ -245,6 +245,11 @@ int InconsistentInputError::errorCode() const
     return eeInconsistentInput;
 }
 
+int ToleranceError::errorCode() const
+{
+    return eeTolerance;
+}
+
 int SimulationInstabilityError::errorCode() const
 {
     return eeInstability;
@@ -260,6 +265,11 @@ int APIError::errorCode() const
     return eeAPIError;
 }
 
+int RangeError::errorCode() const
+{
+    return eeRange;
+}
+
 int NotImplementedError::errorCode() const
 {
     return eeNotImplemented;
@@ -329,7 +339,7 @@ class MessageWriterFileNoThrow : public IMessageWriter
         {
             std::fprintf(fp_, "%*sReason: %s\n", indent, "",
                          std::strerror(errorNumber));
-            if (funcName != NULL)
+            if (funcName != nullptr)
             {
                 std::fprintf(fp_, "%*s(call to %s() returned error code %d)\n",
                              indent, "", funcName, errorNumber);
@@ -361,7 +371,7 @@ class MessageWriterTextWriter : public IMessageWriter
         {
             writer_->wrapperSettings().setIndent(indent);
             writer_->writeLine(formatString("Reason: %s", std::strerror(errorNumber)));
-            if (funcName != NULL)
+            if (funcName != nullptr)
             {
                 writer_->writeLine(
                         formatString("(call to %s() returned error code %d)",
@@ -401,7 +411,7 @@ class MessageWriterString : public IMessageWriter
         {
             writeLine(formatString("Reason: %s", std::strerror(errorNumber)).c_str(),
                       indent);
-            if (funcName != NULL)
+            if (funcName != nullptr)
             {
                 writeLine(formatString("(call to %s() returned error code %d)",
                                        funcName, errorNumber).c_str(),
@@ -429,7 +439,7 @@ void formatExceptionMessageInternal(IMessageWriter *writer,
                                     const std::exception &ex, int indent)
 {
     const GromacsException *gmxEx = dynamic_cast<const GromacsException *>(&ex);
-    if (gmxEx != NULL)
+    if (gmxEx != nullptr)
     {
         // TODO: Add an option to print location information for the tests
 
@@ -443,15 +453,15 @@ void formatExceptionMessageInternal(IMessageWriter *writer,
         bool                bAnythingWritten = false;
         // TODO: Remove duplicate context if present in multiple nested exceptions.
         const ErrorMessage *msg = gmxEx->getInfo<ExceptionInfoMessage>();
-        if (msg != NULL)
+        if (msg != nullptr)
         {
-            while (msg != NULL && msg->isContext())
+            while (msg != nullptr && msg->isContext())
             {
                 writer->writeLine(msg->text().c_str(), indent*2);
                 ++indent;
                 msg = &msg->child();
             }
-            if (msg != NULL && !msg->text().empty())
+            if (msg != nullptr && !msg->text().empty())
             {
                 writer->writeLine(msg->text().c_str(), indent*2);
                 bAnythingWritten = true;
@@ -464,19 +474,19 @@ void formatExceptionMessageInternal(IMessageWriter *writer,
         }
 
         const int *errorNumber = gmxEx->getInfo<ExceptionInfoErrno>();
-        if (errorNumber != NULL && *errorNumber != 0)
+        if (errorNumber != nullptr && *errorNumber != 0)
         {
             const char * const *funcName
                 = gmxEx->getInfo<ExceptionInfoApiFunction>();
             writer->writeErrNoInfo(*errorNumber,
-                                   funcName != NULL ? *funcName : NULL,
+                                   funcName != nullptr ? *funcName : nullptr,
                                    (indent+1)*2);
             bAnythingWritten = true;
         }
 
         const internal::NestedExceptionList *nested
             = gmxEx->getInfo<ExceptionInfoNestedExceptions>();
-        if (nested != NULL)
+        if (nested != nullptr)
         {
             internal::NestedExceptionList::const_iterator ni;
             for (ni = nested->begin(); ni != nested->end(); ++ni)
@@ -509,24 +519,24 @@ void printFatalErrorMessage(FILE *fp, const std::exception &ex)
     bool                    bPrintType = false;
     const GromacsException *gmxEx      = dynamic_cast<const GromacsException *>(&ex);
     // TODO: Treat more of the standard exceptions
-    if (gmxEx != NULL)
+    if (gmxEx != nullptr)
     {
         title = getErrorCodeString(gmxEx->errorCode());
     }
-    else if (dynamic_cast<const tMPI::system_error *>(&ex) != NULL)
+    else if (dynamic_cast<const tMPI::system_error *>(&ex) != nullptr)
     {
         title = "System error in thread synchronization";
     }
-    else if (dynamic_cast<const std::bad_alloc *>(&ex) != NULL)
+    else if (dynamic_cast<const std::bad_alloc *>(&ex) != nullptr)
     {
         title = "Memory allocation failed";
     }
-    else if (dynamic_cast<const std::logic_error *>(&ex) != NULL)
+    else if (dynamic_cast<const std::logic_error *>(&ex) != nullptr)
     {
         title      = "Standard library logic error (bug)";
         bPrintType = true;
     }
-    else if (dynamic_cast<const std::runtime_error *>(&ex) != NULL)
+    else if (dynamic_cast<const std::runtime_error *>(&ex) != nullptr)
     {
         title      = "Standard library runtime error (possible bug)";
         bPrintType = true;
index 13e4f8f734ad04f4af82197966374f052eded8b3..fd66bdb98870ca2fafa92a5fcd9ab49257cd6726 100644 (file)
@@ -462,6 +462,30 @@ class InconsistentInputError : public UserInputError
         virtual int errorCode() const;
 };
 
+/*! \brief
+ * Exception class when a specified tolerance cannot be achieved.
+ *
+ * \inpublicapi
+ */
+class ToleranceError : public GromacsException
+{
+    public:
+        /*! \brief
+         * Creates an exception object with the provided initializer/reason.
+         *
+         * \param[in] details  Initializer for the exception.
+         * \throws    std::bad_alloc if out of memory.
+         *
+         * It is possible to call this constructor either with an explicit
+         * ExceptionInitializer object (useful for more complex cases), or
+         * a simple string if only a reason string needs to be provided.
+         */
+        explicit ToleranceError(const ExceptionInitializer &details)
+            : GromacsException(details) {}
+
+        virtual int errorCode() const;
+};
+
 /*! \brief
  * Exception class for simulation instabilities.
  *
@@ -507,6 +531,21 @@ class APIError : public GromacsException
         virtual int errorCode() const;
 };
 
+/*! \brief
+ * Exception class for out-of-range values or indices
+ *
+ * \inpublicapi
+ */
+class RangeError : public GromacsException
+{
+    public:
+        //! \copydoc FileIOError::FileIOError()
+        explicit RangeError(const ExceptionInitializer &details)
+            : GromacsException(details) {}
+
+        virtual int errorCode() const;
+};
+
 /*! \brief
  * Exception class for use of an unimplemented feature.
  *
@@ -522,7 +561,6 @@ class NotImplementedError : public APIError
         virtual int errorCode() const;
 };
 
-
 /*! \brief
  * Macro for throwing an exception.
  *
index 1b16b1bea5027863e8f1e8f2ca76eff2537d2c9e..6f176140f8a5a0d3e2bd2a4e8287c637f7179f07 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,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.
 
 #include <exception>
 
-#include "thread_mpi/threads.h"
-
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/baseversion.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/errorcodes.h"
 #include "gromacs/utility/futil.h"
+#include "gromacs/utility/mutex.h"
 #include "gromacs/utility/programcontext.h"
 
 #if GMX_MPI
 
 #include "errorformat.h"
 
-static bool                bDebug         = false;
-static tMPI_Thread_mutex_t where_mutex    = TMPI_THREAD_MUTEX_INITIALIZER;
+static bool       bDebug         = false;
+static gmx::Mutex where_mutex;
+
+FILE             *debug          = nullptr;
+gmx_bool          gmx_debug_at   = FALSE;
 
-FILE                      *debug          = NULL;
-gmx_bool                   gmx_debug_at   = FALSE;
+static FILE      *log_file       = nullptr;
+static gmx::Mutex error_mutex;
 
-static FILE               *log_file       = NULL;
-static tMPI_Thread_mutex_t error_mutex    = TMPI_THREAD_MUTEX_INITIALIZER;
+using Lock = gmx::lock_guard<gmx::Mutex>;
 
 void gmx_init_debug(const int dbglevel, const char *dbgfile)
 {
@@ -101,19 +102,21 @@ void _where(const char *file, int line)
 
     if (bFirst)
     {
-        tMPI_Thread_mutex_lock(&where_mutex);
+        Lock lock(where_mutex);
         if (bFirst) /* we repeat the check in the locked section because things
                        might have changed */
         {
-            if ((temp = getenv("GMX_PRINT_DEBUG_LINES")) != NULL)
+            if ((temp = getenv("GMX_PRINT_DEBUG_LINES")) != nullptr)
             {
-                nskip = strtol(temp, NULL, 10);
+                nskip = strtol(temp, nullptr, 10);
             }
             bFirst = FALSE;
         }
-        tMPI_Thread_mutex_unlock(&where_mutex);
     }
 
+    // TODO None of this is thread safe, and presumably it was only
+    // meant to run when debugging. But it runs many times every MD
+    // step. Nice. See Redmine #2122.
     if (nskip >= 0)
     {
         /* Skip the first n occasions, this allows to see where it goes wrong */
@@ -143,11 +146,11 @@ static void default_error_handler(const char *title, const char *msg,
 {
     if (log_file)
     {
-        gmx::internal::printFatalErrorHeader(log_file, title, NULL, file, line);
+        gmx::internal::printFatalErrorHeader(log_file, title, nullptr, file, line);
         gmx::internal::printFatalErrorMessageLine(log_file, msg, 0);
         gmx::internal::printFatalErrorFooter(log_file);
     }
-    gmx::internal::printFatalErrorHeader(stderr, title, NULL, file, line);
+    gmx::internal::printFatalErrorHeader(stderr, title, nullptr, file, line);
     gmx::internal::printFatalErrorMessageLine(stderr, msg, 0);
     gmx::internal::printFatalErrorFooter(stderr);
 }
@@ -156,9 +159,8 @@ static gmx_error_handler_t gmx_error_handler = default_error_handler;
 
 void gmx_set_error_handler(gmx_error_handler_t func)
 {
-    tMPI_Thread_mutex_lock(&error_mutex);
+    Lock lock(error_mutex);
     gmx_error_handler = func;
-    tMPI_Thread_mutex_unlock(&error_mutex);
 }
 
 static const char *gmx_strerror(const char *key)
@@ -180,7 +182,7 @@ static const char *gmx_strerror(const char *key)
         { "range",  "Range checking error" }
     };
 
-    if (key == NULL)
+    if (key == nullptr)
     {
         return "NULL error type (should not occur)";
     }
@@ -196,13 +198,12 @@ static const char *gmx_strerror(const char *key)
 
 static void call_error_handler(const char *key, const char *file, int line, const char *msg)
 {
-    if (msg == NULL)
+    if (msg == nullptr)
     {
         msg = "Empty gmx_fatal message (bug).";
     }
-    tMPI_Thread_mutex_lock(&error_mutex);
+    Lock lock(error_mutex);
     gmx_error_handler(gmx_strerror(key), msg, file, line);
-    tMPI_Thread_mutex_unlock(&error_mutex);
 }
 
 void gmx_exit_on_fatal_error(ExitType exitType, int returnValue)
@@ -289,7 +290,7 @@ void _range_check(int n, int n_min, int n_max, const char *warn_str,
 
     if ((n < n_min) || (n >= n_max))
     {
-        if (warn_str != NULL)
+        if (warn_str != nullptr)
         {
             strcpy(buf, warn_str);
             strcat(buf, "\n");
index 5f245858a5662fd6a0bace6138f10771179ad668..b24f687b27a50b7546a37973ca6806ef1e7d72c3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 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.
@@ -70,7 +70,7 @@ bool readLineImpl(FILE *fp, std::string *line)
     std::string  result;
     char         buf[bufsize];
     buf[0] = '\0';
-    while (std::fgets(buf, bufsize, fp) != NULL)
+    while (std::fgets(buf, bufsize, fp) != nullptr)
     {
         const size_t length = std::strlen(buf);
         result.append(buf, length);
@@ -105,10 +105,10 @@ class FileStreamImpl
         {
         }
         FileStreamImpl(const char *filename, const char *mode)
-            : fp_(NULL), bClose_(true)
+            : fp_(nullptr), bClose_(true)
         {
             fp_ = std::fopen(filename, mode);
-            if (fp_ == NULL)
+            if (fp_ == nullptr)
             {
                 GMX_THROW_WITH_ERRNO(
                         FileIOError(formatString("Could not open file '%s'", filename)),
@@ -117,7 +117,7 @@ class FileStreamImpl
         }
         ~FileStreamImpl()
         {
-            if (fp_ != NULL && bClose_)
+            if (fp_ != nullptr && bClose_)
             {
                 if (std::fclose(fp_) != 0)
                 {
@@ -128,19 +128,19 @@ class FileStreamImpl
 
         FILE *handle()
         {
-            GMX_RELEASE_ASSERT(fp_ != NULL,
+            GMX_RELEASE_ASSERT(fp_ != nullptr,
                                "Attempted to access a file object that is not open");
             return fp_;
         }
 
         void close()
         {
-            GMX_RELEASE_ASSERT(fp_ != NULL,
+            GMX_RELEASE_ASSERT(fp_ != nullptr,
                                "Attempted to close a file object that is not open");
             GMX_RELEASE_ASSERT(bClose_,
                                "Attempted to close a file object that should not be");
             const bool bOk = (std::fclose(fp_) == 0);
-            fp_ = NULL;
+            fp_ = nullptr;
             if (!bOk)
             {
                 GMX_THROW_WITH_ERRNO(
@@ -192,7 +192,7 @@ StandardInputStream &StandardInputStream::instance()
 FILE *TextInputFile::openRawHandle(const char *filename)
 {
     FILE *fp = fopen(filename, "r");
-    if (fp == NULL)
+    if (fp == nullptr)
     {
         GMX_THROW_WITH_ERRNO(
                 FileIOError(formatString("Could not open file '%s'", filename)),
index 0b5fe92cfed5f0069e297426d027504229075e0d..c7d0a40521895531393841ce4c5aa1034f3bbcc5 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,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.
 #include <windows.h>
 #endif
 
-#include "thread_mpi/threads.h"
-
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/datafilefinder.h"
 #include "gromacs/utility/dir_separator.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/mutex.h"
 #include "gromacs/utility/path.h"
 #include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/smalloc.h"
@@ -79,13 +78,15 @@ typedef struct t_pstack {
     struct t_pstack *prev;
 } t_pstack;
 
-static t_pstack    *pstack           = NULL;
+static t_pstack    *pstack           = nullptr;
 static bool         bUnbuffered      = false;
 static int          s_maxBackupCount = 0;
 
 /* this linked list is an intrinsically globally shared object, so we have
    to protect it with mutexes */
-static tMPI_Thread_mutex_t pstack_mutex = TMPI_THREAD_MUTEX_INITIALIZER;
+static gmx::Mutex pstack_mutex;
+
+using Lock = gmx::lock_guard<gmx::Mutex>;
 
 namespace gmx
 {
@@ -99,7 +100,7 @@ const DataFileFinder  g_defaultLibFileFinder;
 
 const DataFileFinder &getLibraryFileFinder()
 {
-    if (g_libFileFinder != NULL)
+    if (g_libFileFinder != nullptr)
     {
         return *g_libFileFinder;
     }
@@ -123,10 +124,10 @@ void gmx_set_max_backup_count(int count)
     if (count < 0)
     {
         const char *env = getenv("GMX_MAXBACKUP");
-        if (env != NULL)
+        if (env != nullptr)
         {
             // TODO: Check that the value is converted properly.
-            count = strtol(env, NULL, 10);
+            count = strtol(env, nullptr, 10);
             if (count < 0)
             {
                 count = 0;
@@ -143,18 +144,16 @@ void gmx_set_max_backup_count(int count)
     s_maxBackupCount = count;
 }
 
-void push_ps(FILE *fp)
+static void push_ps(FILE *fp)
 {
     t_pstack *ps;
 
-    tMPI_Thread_mutex_lock(&pstack_mutex);
+    Lock      pstackLock(pstack_mutex);
 
     snew(ps, 1);
     ps->fp   = fp;
     ps->prev = pstack;
     pstack   = ps;
-
-    tMPI_Thread_mutex_unlock(&pstack_mutex);
 }
 
 #ifdef GMX_FAHCORE
@@ -191,19 +190,19 @@ int gmx_ffclose(FILE *fp)
     t_pstack *ps, *tmp;
     int       ret = 0;
 
-    tMPI_Thread_mutex_lock(&pstack_mutex);
+    Lock      pstackLock(pstack_mutex);
 
     ps = pstack;
-    if (ps == NULL)
+    if (ps == nullptr)
     {
-        if (fp != NULL)
+        if (fp != nullptr)
         {
             ret = fclose(fp);
         }
     }
     else if (ps->fp == fp)
     {
-        if (fp != NULL)
+        if (fp != nullptr)
         {
             ret = pclose(fp);
         }
@@ -212,13 +211,13 @@ int gmx_ffclose(FILE *fp)
     }
     else
     {
-        while ((ps->prev != NULL) && (ps->prev->fp != fp))
+        while ((ps->prev != nullptr) && (ps->prev->fp != fp))
         {
             ps = ps->prev;
         }
-        if ((ps->prev != NULL) && ps->prev->fp == fp)
+        if ((ps->prev != nullptr) && ps->prev->fp == fp)
         {
-            if (ps->prev->fp != NULL)
+            if (ps->prev->fp != nullptr)
             {
                 ret = pclose(ps->prev->fp);
             }
@@ -228,14 +227,13 @@ int gmx_ffclose(FILE *fp)
         }
         else
         {
-            if (fp != NULL)
+            if (fp != nullptr)
             {
                 ret = fclose(fp);
             }
         }
     }
 
-    tMPI_Thread_mutex_unlock(&pstack_mutex);
     return ret;
 #endif
 }
@@ -243,21 +241,19 @@ int gmx_ffclose(FILE *fp)
 
 void frewind(FILE *fp)
 {
-    tMPI_Thread_mutex_lock(&pstack_mutex);
+    Lock      pstackLock(pstack_mutex);
 
     t_pstack *ps = pstack;
-    while (ps != NULL)
+    while (ps != nullptr)
     {
         if (ps->fp == fp)
         {
             fprintf(stderr, "Cannot rewind compressed file!\n");
-            tMPI_Thread_mutex_unlock(&pstack_mutex);
             return;
         }
         ps = ps->prev;
     }
     rewind(fp);
-    tMPI_Thread_mutex_unlock(&pstack_mutex);
 }
 
 int gmx_fseek(FILE *stream, gmx_off_t offset, int whence)
@@ -317,7 +313,7 @@ static FILE *uncompress(const char *fn, const char *mode)
 
     sprintf(buf, "uncompress -c < %s", fn);
     fprintf(stderr, "Going to execute '%s'\n", buf);
-    if ((fp = popen(buf, mode)) == NULL)
+    if ((fp = popen(buf, mode)) == nullptr)
     {
         gmx_open(fn);
     }
@@ -333,7 +329,7 @@ static FILE *gunzip(const char *fn, const char *mode)
 
     sprintf(buf, "gunzip -c < %s", fn);
     fprintf(stderr, "Going to execute '%s'\n", buf);
-    if ((fp = popen(buf, mode)) == NULL)
+    if ((fp = popen(buf, mode)) == nullptr)
     {
         gmx_open(fn);
     }
@@ -346,12 +342,12 @@ gmx_bool gmx_fexist(const char *fname)
 {
     FILE *test;
 
-    if (fname == NULL)
+    if (fname == nullptr)
     {
         return FALSE;
     }
     test = fopen(fname, "r");
-    if (test == NULL)
+    if (test == nullptr)
     {
         /*Windows doesn't allow fopen of directory - so we need to check this seperately */
         #if GMX_NATIVE_WINDOWS
@@ -445,14 +441,14 @@ FILE *gmx_ffopen(const char *file, const char *mode)
 #ifdef SKIP_FFOPS
     return fopen(file, mode);
 #else
-    FILE    *ff = NULL;
-    char     buf[256], *bufsize = 0, *ptr;
+    FILE    *ff = nullptr;
+    char     buf[256], *bufsize = nullptr, *ptr;
     gmx_bool bRead;
     int      bs;
 
-    if (file == NULL)
+    if (file == nullptr)
     {
-        return NULL;
+        return nullptr;
     }
 
     if (mode[0] == 'w')
@@ -465,7 +461,7 @@ FILE *gmx_ffopen(const char *file, const char *mode)
     strcpy(buf, file);
     if (!bRead || gmx_fexist(buf))
     {
-        if ((ff = fopen(buf, mode)) == NULL)
+        if ((ff = fopen(buf, mode)) == nullptr)
         {
             gmx_file(buf);
         }
@@ -473,7 +469,7 @@ FILE *gmx_ffopen(const char *file, const char *mode)
         /* Check whether we should be using buffering (default) or not
          * (for debugging)
          */
-        if (bUnbuffered || ((bufsize = getenv("GMX_LOG_BUFFER")) != NULL))
+        if (bUnbuffered || ((bufsize = getenv("GMX_LOG_BUFFER")) != nullptr))
         {
             /* Check whether to use completely unbuffered */
             if (bUnbuffered)
@@ -482,11 +478,11 @@ FILE *gmx_ffopen(const char *file, const char *mode)
             }
             else
             {
-                bs = strtol(bufsize, NULL, 10);
+                bs = strtol(bufsize, nullptr, 10);
             }
             if (bs <= 0)
             {
-                setbuf(ff, NULL);
+                setbuf(ff, nullptr);
             }
             else
             {
@@ -539,7 +535,7 @@ char *low_gmxlibfn(const char *file, gmx_bool bAddCWD, gmx_bool bFatal)
         }
     }
     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
-    return NULL;
+    return nullptr;
 }
 
 FILE *low_libopen(const char *file, gmx_bool bFatal)
@@ -554,7 +550,7 @@ FILE *low_libopen(const char *file, gmx_bool bFatal)
         return fp;
     }
     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
-    return NULL;
+    return nullptr;
 }
 
 char *gmxlibfn(const char *file)
@@ -610,7 +606,7 @@ void gmx_tmpnam(char *buf)
 FILE *gmx_fopen_temporary(char *buf)
 {
     int   i, len;
-    FILE *fpout = NULL;
+    FILE *fpout = nullptr;
 
     if ((len = strlen(buf)) < 7)
     {
@@ -642,7 +638,7 @@ FILE *gmx_fopen_temporary(char *buf)
         gmx_fatal(FARGS, "Error creating temporary file %s: %s", buf,
                   strerror(errno));
     }
-    if ((fpout = fdopen(fd, "w")) == NULL)
+    if ((fpout = fdopen(fd, "w")) == nullptr)
     {
         gmx_fatal(FARGS, "Cannot open temporary file %s", buf);
     }
@@ -674,8 +670,8 @@ int gmx_file_copy(const char *oldname, const char *newname, gmx_bool copy_if_emp
 {
 /* the full copy buffer size: */
 #define FILECOPY_BUFSIZE (1<<16)
-    FILE *in  = NULL;
-    FILE *out = NULL;
+    FILE *in  = nullptr;
+    FILE *out = nullptr;
     char *buf;
 
     snew(buf, FILECOPY_BUFSIZE);
@@ -819,7 +815,7 @@ void gmx_getcwd(char *buffer, size_t size)
 #else
     char *pdum = getcwd(buffer, size);
 #endif
-    if (pdum == NULL)
+    if (pdum == nullptr)
     {
         gmx_fatal(FARGS, "Cannot get working directory. Reason: %s",
                   strerror(errno));
index e093b3692a2fcd674a30610f257cfe4a80913aaa..eb2942a1f4e8bbfe0538d7f8a1edcc0a80d8e390 100644 (file)
@@ -34,7 +34,7 @@
  */
 /*! \libinternal \file
  * \brief
- * Wraps <mpi.h> usage in Gromacs.
+ * Wraps mpi.h usage in Gromacs.
  *
  * This header wraps the MPI header <mpi.h>, and should be included instead of
  * that one.  It abstracts away the case that depending on compilation
index 1b3ceccc129a4a15b7fa76e8b7360ba9d2d0aaeb..6dc2d2adafce571544729f6e35d4aa390e9a14f3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,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.
@@ -98,7 +98,7 @@ gmx_bool gmx_omp_check_thread_affinity(char **message)
 {
     bool shouldSetAffinity = true;
 
-    *message = NULL;
+    *message = nullptr;
 #if GMX_OPENMP
     /* We assume that the affinity setting is available on all platforms
      * gcc supports. Even if this is not the case (e.g. Mac OS) the user
@@ -112,7 +112,7 @@ gmx_bool gmx_omp_check_thread_affinity(char **message)
     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
 
     const char *const gomp_env            = getenv("GOMP_CPU_AFFINITY");
-    const bool        bGompCpuAffinitySet = (gomp_env != NULL);
+    const bool        bGompCpuAffinitySet = (gomp_env != nullptr);
 
     /* turn off internal pinning if GOMP_CPU_AFFINITY is set & non-empty */
     if (bGompCpuAffinitySet && *gomp_env != '\0')
index 87ccafa9b1be695a07bbb8310d7a8fbe8ff9bab2..a15a71b6db7cf0dadd4942c4f933a40195ebc334 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * 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.
@@ -88,7 +88,7 @@ class Regex::Impl
 
         bool match(const char *value) const
         {
-            int rc = regexec(&regex_, value, 0, NULL, 0);
+            int rc = regexec(&regex_, value, 0, nullptr, 0);
             if (rc != 0 && rc != REG_NOMATCH)
             {
                 // TODO: Handle errors.
diff --git a/src/gromacs/utility/ikeyvaluetreeerror.cpp b/src/gromacs/utility/ikeyvaluetreeerror.cpp
new file mode 100644 (file)
index 0000000..4afe797
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+#include "gmxpre.h"
+
+#include "ikeyvaluetreeerror.h"
+
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/keyvaluetree.h"
+#include "gromacs/utility/stringutil.h"
+
+namespace gmx
+{
+
+namespace
+{
+
+class DefaultKeyValueTreeErrorHandler : public IKeyValueTreeErrorHandler
+{
+    public:
+        virtual bool onError(UserInputError *ex, const KeyValueTreePath &context)
+        {
+            std::string message
+                = formatString("While processing '%s':", context.toString().c_str());
+            ex->prependContext(message);
+            return false;
+        }
+};
+
+}   // namespace
+
+IKeyValueTreeErrorHandler::~IKeyValueTreeErrorHandler()
+{
+}
+
+//! \cond libapi
+IKeyValueTreeErrorHandler *defaultKeyValueTreeErrorHandler()
+{
+    static DefaultKeyValueTreeErrorHandler instance;
+    return &instance;
+}
+//! \endcond
+
+} // namespace gmx
similarity index 63%
rename from src/gromacs/gmxlib/md_logging.h
rename to src/gromacs/utility/ikeyvaluetreeerror.h
index 8da09734f09707d10d5748e3bad2e042a4b5b5f3..5917cb5fe4cbbd56d6cc709c382197432fc6a047 100644 (file)
@@ -1,9 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 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.
  * 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_GMXLIB_MD_LOGGING_H
-#define GMX_GMXLIB_MD_LOGGING_H
+/*! \libinternal \file
+ * \brief
+ * Declares an error handling interface for key-value tree operations.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_KEYVALUETREEERROR_H
+#define GMX_UTILITY_KEYVALUETREEERROR_H
 
-#include <cstdio>
+namespace gmx
+{
 
-struct t_commrec;
+class KeyValueTreePath;
+class UserInputError;
 
-void md_print_info(const t_commrec *cr, FILE *fplog,
-                   const char *fmt, ...);
-/* Print an general information message to stderr on the master node
- * and to fplog if fplog!=NULL.
- * fmt is a standard printf formatting string which should end in \n,
- * the arguments after that contain the values to be printed, as in printf.
- */
+class IKeyValueTreeErrorHandler
+{
+    public:
+        virtual bool onError(UserInputError *ex, const KeyValueTreePath &context) = 0;
 
-void md_print_warn(const t_commrec *cr, FILE *fplog,
-                   const char *fmt, ...);
-/* As md_print_info above, but for important notices or warnings.
- * The only difference with md_print_info is that a newline is printed
- * before and after the message such that it stands out.
+    protected:
+        ~IKeyValueTreeErrorHandler();
+};
+
+//! \cond libapi
+/*! \brief
+ * Returns a default IKeyValueTreeErrorHandler that throws on first exception.
+ *
+ * \ingroup module_utility
  */
+IKeyValueTreeErrorHandler *defaultKeyValueTreeErrorHandler();
+//! \endcond
+
+} // namespace gmx
 
 #endif
diff --git a/src/gromacs/utility/inmemoryserializer.cpp b/src/gromacs/utility/inmemoryserializer.cpp
new file mode 100644 (file)
index 0000000..0c55e48
--- /dev/null
@@ -0,0 +1,225 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+#include "gmxpre.h"
+
+#include "inmemoryserializer.h"
+
+#include <algorithm>
+#include <vector>
+
+#include "gromacs/utility/gmxassert.h"
+
+namespace gmx
+{
+
+namespace
+{
+
+template <typename T>
+class CharBuffer
+{
+    public:
+        static const size_t ValueSize = sizeof(T);
+
+        explicit CharBuffer(T value)
+        {
+            u.v = value;
+        }
+        explicit CharBuffer(const char buffer[])
+        {
+            std::copy(buffer, buffer + ValueSize, u.c);
+        }
+
+        T value() const { return u.v; }
+
+        void appendTo(std::vector<char> *buffer)
+        {
+            buffer->insert(buffer->end(), u.c, u.c + ValueSize);
+        }
+
+    private:
+        union {
+            char c[ValueSize];
+            T    v;
+        } u;
+};
+
+}   // namespace
+
+/********************************************************************
+ * InMemorySerializer
+ */
+
+class InMemorySerializer::Impl
+{
+    public:
+        template <typename T>
+        void doValue(T value)
+        {
+            CharBuffer<T>(value).appendTo(&buffer_);
+        }
+        void doString(const std::string &value)
+        {
+            doValue<size_t>(value.size());
+            buffer_.insert(buffer_.end(), value.begin(), value.end());
+        }
+
+        std::vector<char> buffer_;
+};
+
+InMemorySerializer::InMemorySerializer()
+    : impl_(new Impl)
+{
+}
+
+InMemorySerializer::~InMemorySerializer()
+{
+}
+
+std::vector<char> InMemorySerializer::finishAndGetBuffer()
+{
+    return std::move(impl_->buffer_);
+}
+
+void InMemorySerializer::doBool(bool *value)
+{
+    impl_->doValue(*value);
+}
+
+void InMemorySerializer::doUChar(unsigned char *value)
+{
+    impl_->doValue(*value);
+}
+
+void InMemorySerializer::doInt(int *value)
+{
+    impl_->doValue(*value);
+}
+
+void InMemorySerializer::doInt64(gmx_int64_t *value)
+{
+    impl_->doValue(*value);
+}
+
+void InMemorySerializer::doFloat(float *value)
+{
+    impl_->doValue(*value);
+}
+
+void InMemorySerializer::doDouble(double *value)
+{
+    impl_->doValue(*value);
+}
+
+void InMemorySerializer::doString(std::string *value)
+{
+    impl_->doString(*value);
+}
+
+/********************************************************************
+ * InMemoryDeserializer
+ */
+
+class InMemoryDeserializer::Impl
+{
+    public:
+        explicit Impl(const std::vector<char> &buffer)
+            : buffer_(buffer), pos_(0)
+        {
+        }
+
+        template <typename T>
+        void doValue(T *value)
+        {
+            *value = CharBuffer<T>(&buffer_[pos_]).value();
+            pos_  += CharBuffer<T>::ValueSize;
+        }
+        void doString(std::string *value)
+        {
+            size_t size;
+            doValue<size_t>(&size);
+            *value = std::string(&buffer_[pos_], size);
+            pos_  += size;
+        }
+
+        const std::vector<char> &buffer_;
+        size_t                   pos_;
+};
+
+InMemoryDeserializer::InMemoryDeserializer(const std::vector<char> &buffer)
+    : impl_(new Impl(buffer))
+{
+}
+
+InMemoryDeserializer::~InMemoryDeserializer()
+{
+}
+
+void InMemoryDeserializer::doBool(bool *value)
+{
+    impl_->doValue(value);
+}
+
+void InMemoryDeserializer::doUChar(unsigned char *value)
+{
+    impl_->doValue(value);
+}
+
+void InMemoryDeserializer::doInt(int *value)
+{
+    impl_->doValue(value);
+}
+
+void InMemoryDeserializer::doInt64(gmx_int64_t *value)
+{
+    impl_->doValue(value);
+}
+
+void InMemoryDeserializer::doFloat(float *value)
+{
+    impl_->doValue(value);
+}
+
+void InMemoryDeserializer::doDouble(double *value)
+{
+    impl_->doValue(value);
+}
+
+void InMemoryDeserializer::doString(std::string *value)
+{
+    impl_->doString(value);
+}
+
+} // namespace gmx
diff --git a/src/gromacs/utility/inmemoryserializer.h b/src/gromacs/utility/inmemoryserializer.h
new file mode 100644 (file)
index 0000000..1b96f1f
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares gmx::ISerializer implementation for in-memory serialization.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_INMEMORYSERIALIZER_H
+#define GMX_UTILITY_INMEMORYSERIALIZER_H
+
+#include <vector>
+
+#include "gromacs/utility/classhelpers.h"
+#include "gromacs/utility/iserializer.h"
+
+namespace gmx
+{
+
+class InMemorySerializer : public ISerializer
+{
+    public:
+        InMemorySerializer();
+        virtual ~InMemorySerializer();
+
+        std::vector<char> finishAndGetBuffer();
+
+        // From ISerializer
+        virtual bool reading() const { return false; }
+        virtual void doBool(bool *value);
+        virtual void doUChar(unsigned char *value);
+        virtual void doInt(int *value);
+        virtual void doInt64(gmx_int64_t *value);
+        virtual void doFloat(float *value);
+        virtual void doDouble(double *value);
+        virtual void doString(std::string *value);
+
+    private:
+        class Impl;
+
+        PrivateImplPointer<Impl> impl_;
+};
+
+class InMemoryDeserializer : public ISerializer
+{
+    public:
+        explicit InMemoryDeserializer(const std::vector<char> &buffer);
+        virtual ~InMemoryDeserializer();
+
+        // From ISerializer
+        virtual bool reading() const { return true; }
+        virtual void doBool(bool *value);
+        virtual void doUChar(unsigned char *value);
+        virtual void doInt(int *value);
+        virtual void doInt64(gmx_int64_t *value);
+        virtual void doFloat(float *value);
+        virtual void doDouble(double *value);
+        virtual void doString(std::string *value);
+
+    private:
+        class Impl;
+
+        PrivateImplPointer<Impl> impl_;
+};
+
+} // namespace gmx
+
+#endif
index 2d1a595e6818a727b6ab6b4bd2718aea60acd311..8f4c8c8ee3b77121edbfb6efb66eac4739748c05 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 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.
@@ -46,7 +46,7 @@ int gmx_int64_to_int(gmx_int64_t step, const char *warn)
 
     i = static_cast<int>(step);
 
-    if (warn != NULL && (static_cast<gmx_int64_t>(i) != step))
+    if (warn != nullptr && (static_cast<gmx_int64_t>(i) != step))
     {
         fprintf(stderr, "\nWARNING during %s:\n", warn);
         fprintf(stderr, "int64 value ");
diff --git a/src/gromacs/utility/iserializer.h b/src/gromacs/utility/iserializer.h
new file mode 100644 (file)
index 0000000..70d7973
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares a generic serialization interface that supports both directions.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_ISERIALIZER_H
+#define GMX_UTILITY_ISERIALIZER_H
+
+#include <string>
+
+#include "gromacs/utility/basedefinitions.h"
+
+namespace gmx
+{
+
+/*! \libinternal
+ * \brief Interface for types that convert standard data types into a
+ * form suitable for storage or transfer.
+ *
+ * Different implementations could suit MPI, file I/O, or in-memory
+ * conversion. */
+class ISerializer
+{
+    public:
+        //! Destructor.
+        virtual ~ISerializer() {}
+        /*! \brief Returns whether the serializer is reading or
+         * writing, because details like memory management vary
+         * accordingly. */
+        virtual bool reading() const = 0;
+        //! \brief Serialize values of different types.
+        ///@{
+        virtual void doBool(bool *value)           = 0;
+        virtual void doUChar(unsigned char *value) = 0;
+        virtual void doInt(int *value)             = 0;
+        virtual void doInt64(gmx_int64_t *value)   = 0;
+        virtual void doFloat(float *value)         = 0;
+        virtual void doDouble(double *value)       = 0;
+        virtual void doString(std::string *value)  = 0;
+        ///@}
+};
+
+} // namespace gmx
+
+#endif
diff --git a/src/gromacs/utility/keyvaluetree.cpp b/src/gromacs/utility/keyvaluetree.cpp
new file mode 100644 (file)
index 0000000..039e73d
--- /dev/null
@@ -0,0 +1,320 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+#include "gmxpre.h"
+
+#include "keyvaluetree.h"
+
+#include <string>
+#include <vector>
+
+#include "gromacs/utility/compare.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/strconvert.h"
+#include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/textwriter.h"
+
+namespace gmx
+{
+
+namespace
+{
+
+//! Helper function to split a KeyValueTreePath to its components
+std::vector<std::string> splitPathElements(const std::string &path)
+{
+    GMX_ASSERT(!path.empty() && path[0] == '/',
+               "Paths to KeyValueTree should start with '/'");
+    return splitDelimitedString(path.substr(1), '/');
+}
+
+}   // namespace
+
+/********************************************************************
+ * KeyValueTreePath
+ */
+
+KeyValueTreePath::KeyValueTreePath(const char *path)
+    : path_(splitPathElements(path))
+{
+}
+
+KeyValueTreePath::KeyValueTreePath(const std::string &path)
+    : path_(splitPathElements(path))
+{
+}
+
+std::string KeyValueTreePath::toString() const
+{
+    return "/" + joinStrings(path_, "/");
+}
+
+/********************************************************************
+ * KeyValueTreeObject
+ */
+
+bool KeyValueTreeObject::hasDistinctProperties(const KeyValueTreeObject &obj) const
+{
+    for (const auto &prop : obj.values_)
+    {
+        if (keyExists(prop.key()))
+        {
+            GMX_RELEASE_ASSERT(!prop.value().isArray(),
+                               "Comparison of arrays not implemented");
+            if (prop.value().isObject() && valueMap_.at(prop.key()).isObject())
+            {
+                return valueMap_.at(prop.key()).asObject().hasDistinctProperties(prop.value().asObject());
+            }
+            return false;
+        }
+    }
+    return true;
+}
+
+/********************************************************************
+ * Key value tree dump
+ */
+
+//! \cond libapi
+void dumpKeyValueTree(TextWriter *writer, const KeyValueTreeObject &tree)
+{
+    for (const auto &prop : tree.properties())
+    {
+        const auto &value = prop.value();
+        if (value.isObject())
+        {
+            writer->writeString(prop.key());
+            writer->writeLine(":");
+            int oldIndent = writer->wrapperSettings().indent();
+            writer->wrapperSettings().setIndent(oldIndent + 2);
+            dumpKeyValueTree(writer, value.asObject());
+            writer->wrapperSettings().setIndent(oldIndent);
+        }
+        else
+        {
+            int indent = writer->wrapperSettings().indent();
+            writer->writeString(formatString("%*s", -(33-indent), prop.key().c_str()));
+            writer->writeString(" = ");
+            if (value.isArray())
+            {
+                writer->writeString("[");
+                for (const auto &elem : value.asArray().values())
+                {
+                    GMX_RELEASE_ASSERT(!elem.isObject() && !elem.isArray(),
+                                       "Arrays of objects not currently implemented");
+                    writer->writeString(" ");
+                    writer->writeString(simpleValueToString(elem));
+                }
+                writer->writeString(" ]");
+            }
+            else
+            {
+                writer->writeString(simpleValueToString(value));
+            }
+            writer->writeLine();
+        }
+    }
+}
+//! \endcond
+
+/********************************************************************
+ * Key value tree comparison
+ */
+
+namespace
+{
+
+class CompareHelper
+{
+    public:
+        CompareHelper(TextWriter *writer, real ftol, real abstol)
+            : writer_(writer), ftol_(ftol), abstol_(abstol)
+        {
+        }
+
+        void compareObjects(const KeyValueTreeObject &obj1,
+                            const KeyValueTreeObject &obj2)
+        {
+            for (const auto &prop1 : obj1.properties())
+            {
+                currentPath_.append(prop1.key());
+                if (obj2.keyExists(prop1.key()))
+                {
+                    compareValues(prop1.value(), obj2[prop1.key()]);
+                }
+                else
+                {
+                    handleMissingKeyInSecondObject(prop1.value());
+                }
+                currentPath_.pop_back();
+            }
+            for (const auto &prop2 : obj2.properties())
+            {
+                currentPath_.append(prop2.key());
+                if (!obj1.keyExists(prop2.key()))
+                {
+                    handleMissingKeyInFirstObject(prop2.value());
+                }
+                currentPath_.pop_back();
+            }
+        }
+
+    private:
+        void compareValues(const KeyValueTreeValue &value1,
+                           const KeyValueTreeValue &value2)
+        {
+            if (value1.type() == value2.type())
+            {
+                if (value1.isObject())
+                {
+                    compareObjects(value1.asObject(), value2.asObject());
+                }
+                else if (value1.isArray())
+                {
+                    GMX_RELEASE_ASSERT(false, "Array comparison not implemented");
+                }
+                else if (!areSimpleValuesOfSameTypeEqual(value1, value2))
+                {
+                    writer_->writeString(currentPath_.toString());
+                    writer_->writeLine(formatString(" (%s - %s)", simpleValueToString(value1).c_str(), simpleValueToString(value2).c_str()));
+                }
+            }
+            else if ((value1.isType<double>() && value2.isType<float>())
+                     || (value1.isType<float>() && value2.isType<double>()))
+            {
+                const bool  firstIsDouble
+                    = value1.isType<double>();
+                const float v1 = firstIsDouble ? value1.cast<double>() : value1.cast<float>();
+                const float v2 = firstIsDouble ? value2.cast<float>() : value2.cast<double>();
+                if (!equal_float(v1, v2, ftol_, abstol_))
+                {
+                    writer_->writeString(currentPath_.toString());
+                    writer_->writeLine(formatString(" (%e - %e)", v1, v2));
+                }
+            }
+            else
+            {
+                handleMismatchingTypes(value1, value2);
+            }
+        }
+
+        bool areSimpleValuesOfSameTypeEqual(
+            const KeyValueTreeValue &value1,
+            const KeyValueTreeValue &value2)
+        {
+            GMX_ASSERT(value1.type() == value2.type(),
+                       "Caller should ensure that types are equal");
+            if (value1.isType<bool>())
+            {
+                return value1.cast<bool>() == value2.cast<bool>();
+            }
+            else if (value1.isType<int>())
+            {
+                return value1.cast<int>() == value2.cast<int>();
+            }
+            else if (value1.isType<gmx_int64_t>())
+            {
+                return value1.cast<gmx_int64_t>() == value2.cast<gmx_int64_t>();
+            }
+            else if (value1.isType<double>())
+            {
+                return equal_double(value1.cast<double>(), value2.cast<double>(), ftol_, abstol_);
+            }
+            else if (value1.isType<float>())
+            {
+                return equal_float(value1.cast<float>(), value2.cast<float>(), ftol_, abstol_);
+            }
+            else if (value1.isType<std::string>())
+            {
+                return value1.cast<std::string>() == value2.cast<std::string>();
+            }
+            else
+            {
+                GMX_RELEASE_ASSERT(false, "Unknown value type");
+                return false;
+            }
+        }
+
+        void handleMismatchingTypes(const KeyValueTreeValue & /* value1 */,
+                                    const KeyValueTreeValue & /* value2 */)
+        {
+            writer_->writeString(currentPath_.toString());
+            writer_->writeString(" type mismatch");
+        }
+
+        void handleMissingKeyInFirstObject(const KeyValueTreeValue &value)
+        {
+            const std::string message = formatString(
+                        "%s (missing - %s)", currentPath_.toString().c_str(),
+                        formatValueForMissingMessage(value).c_str());
+            writer_->writeLine(message);
+        }
+        void handleMissingKeyInSecondObject(const KeyValueTreeValue &value)
+        {
+            const std::string message = formatString(
+                        "%s (%s - missing)", currentPath_.toString().c_str(),
+                        formatValueForMissingMessage(value).c_str());
+            writer_->writeLine(message);
+        }
+
+        std::string formatValueForMissingMessage(const KeyValueTreeValue &value)
+        {
+            if (value.isObject() || value.isArray())
+            {
+                return "present";
+            }
+            return simpleValueToString(value);
+        }
+
+        KeyValueTreePath  currentPath_;
+        TextWriter       *writer_;
+        real              ftol_;
+        real              abstol_;
+};
+
+}   // namespace
+
+//! \cond libapi
+void compareKeyValueTrees(TextWriter               *writer,
+                          const KeyValueTreeObject &tree1,
+                          const KeyValueTreeObject &tree2,
+                          real                      ftol,
+                          real                      abstol)
+{
+    CompareHelper helper(writer, ftol, abstol);
+    helper.compareObjects(tree1, tree2);
+}
+//! \endcond
+
+} // namespace gmx
diff --git a/src/gromacs/utility/keyvaluetree.h b/src/gromacs/utility/keyvaluetree.h
new file mode 100644 (file)
index 0000000..5b7ea96
--- /dev/null
@@ -0,0 +1,359 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares a data structure for JSON-like structured key-value mapping.
+ *
+ * A tree is composed of nodes that can have different types:
+ *  - _Value_ (gmx::KeyValueTreeValue) is a generic node that can
+ *    represent either a scalar value of arbitrary type, or an object or
+ *    an array.
+ *  - _Array_ (gmx::KeyValueTreeArray) is a collection of any number of values
+ *    (including zero).  The values can be of any type and different types
+ *    can be mixed in the same array.
+ *  - _Object_ (gmx::KeyValueTreeObject) is a collection of properties.
+ *    Each property must have a unique key.  Order of properties is preserved,
+ *    i.e., they can be iterated in the order they were added.
+ *  - _Property_ (gmx::KeyValueTreeProperty) is an arbitrary type of value
+ *    associated with a string key.
+ * The root object of a tree is typically an object, but could also be an
+ * array.  The data structure itself does not enforce any other constraints,
+ * but the context in which it is used can limit the allowed scalar types or,
+ * e.g., require arrays to have values of uniform type.  Also, several
+ * operations defined for the structure (string output, comparison,
+ * serialization, etc.) only work on a limited set of scalar types, or have
+ * limitations with the types of trees they work on (in particular, arrays are
+ * currently poorly supported).
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_KEYVALUETREE_H
+#define GMX_UTILITY_KEYVALUETREE_H
+
+#include <algorithm>
+#include <functional>
+#include <map>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "gromacs/utility/real.h"
+#include "gromacs/utility/variant.h"
+
+namespace gmx
+{
+
+class KeyValueTreeArray;
+class KeyValueTreeObject;
+class TextWriter;
+
+/*! \libinternal \brief
+ * Identifies an entry in a key-value tree.
+ *
+ * This class is mainly an internal utility within the key-value tree
+ * implementation, but it is exposed on the API level where string-based
+ * specification of a location in the tree is necessary.  Constructors are not
+ * explicit to allow passing a simple string in contexts where a
+ * KeyValueTreePath is expected.
+ *
+ * The string specifying a location should start with a `/`, followed by the
+ * names of the properties separated by `/`.  For example, `/a/b/c` specifies
+ * property `c` in an object that is the value of `b` in an object that is the
+ * value of `a` at the root of the tree.
+ * Currently, there is no support for specifying paths to values within arrays
+ * (since none of the places where this is used implement array handling,
+ * either).
+ *
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+class KeyValueTreePath
+{
+    public:
+        //! Creates an empty path (corresponds to the root object).
+        KeyValueTreePath() = default;
+        //! Creates a path from given string representation.
+        KeyValueTreePath(const char *path);
+        //! Creates a path from given string representation.
+        KeyValueTreePath(const std::string &path);
+
+        //! Adds another element to the path, making it a child of the old path.
+        void append(const std::string &key) { path_.push_back(key); }
+        //! Adds elements from another path to the path.
+        void append(const KeyValueTreePath &other)
+        {
+            auto elements = other.elements();
+            path_.insert(path_.end(), elements.begin(), elements.end());
+        }
+        //! Removes the last element in the path, making it the parent path.
+        void pop_back() { return path_.pop_back(); }
+        //! Removes and returns the last element in the path.
+        std::string pop_last()
+        {
+            std::string result = std::move(path_.back());
+            path_.pop_back();
+            return result;
+        }
+
+        //! Whether the path is empty (pointing to the root object).
+        bool empty() const { return path_.empty(); }
+        //! Returns the number of elements (=nesting level) in the path.
+        size_t size() const { return path_.size(); }
+        //! Returns the i'th path element.
+        const std::string &operator[](int i) const { return path_[i]; }
+        //! Returns all the path elements.
+        const std::vector<std::string> &elements() const { return path_; }
+
+        //! Formats the path as a string for display.
+        std::string toString() const;
+
+    private:
+        std::vector<std::string> path_;
+};
+
+//! \cond libapi
+
+//! Combines two paths as with KeyValueTreePath::append().
+inline KeyValueTreePath operator+(const KeyValueTreePath &a, const KeyValueTreePath &b)
+{
+    KeyValueTreePath result(a);
+    result.append(b);
+    return result;
+}
+
+//! Combines an element to a path as with KeyValueTreePath::append().
+inline KeyValueTreePath operator+(const KeyValueTreePath &a, const std::string &b)
+{
+    KeyValueTreePath result(a);
+    result.append(b);
+    return result;
+}
+//! \endcond
+
+class KeyValueTreeValue
+{
+    public:
+        //! Returns whether the value is an array (KeyValueTreeArray).
+        bool isArray() const;
+        //! Returns whether the value is an object (KeyValueTreeObject).
+        bool isObject() const;
+        //! Returns whether the value is of a given type.
+        template <typename T>
+        bool isType() const { return value_.isType<T>(); }
+        //! Returns the type of the value.
+        std::type_index type() const { return value_.type(); }
+
+        KeyValueTreeArray &asArray();
+        KeyValueTreeObject       &asObject();
+        const KeyValueTreeArray  &asArray() const;
+        const KeyValueTreeObject &asObject() const;
+        template <typename T>
+        const T                  &cast() const { return value_.cast<T>(); }
+
+        //! Returns the raw Variant value (always possible).
+        const Variant            &asVariant() const { return value_; }
+
+    private:
+        explicit KeyValueTreeValue(Variant &&value) : value_(std::move(value)) {}
+
+        Variant             value_;
+
+        friend class KeyValueTreeBuilder;
+        friend class KeyValueTreeObjectBuilder;
+        friend class KeyValueTreeValueBuilder;
+};
+
+class KeyValueTreeArray
+{
+    public:
+        //! Whether all elements of the array are objects.
+        bool isObjectArray() const
+        {
+            return std::all_of(values_.begin(), values_.end(),
+                               std::mem_fn(&KeyValueTreeValue::isObject));
+        }
+
+        //! Returns the values in the array.
+        const std::vector<KeyValueTreeValue> &values() const { return values_; }
+
+    private:
+        std::vector<KeyValueTreeValue> values_;
+
+        friend class KeyValueTreeArrayBuilderBase;
+};
+
+class KeyValueTreeProperty
+{
+    public:
+        const std::string &key() const { return value_->first; }
+        const KeyValueTreeValue &value() const { return value_->second; }
+
+    private:
+        typedef std::map<std::string, KeyValueTreeValue>::const_iterator
+            IteratorType;
+
+        explicit KeyValueTreeProperty(IteratorType value) : value_(value) {}
+
+        IteratorType value_;
+
+        friend class KeyValueTreeObject;
+        friend class KeyValueTreeObjectBuilder;
+};
+
+class KeyValueTreeObject
+{
+    public:
+        KeyValueTreeObject() = default;
+        //! Creates a deep copy of an object.
+        KeyValueTreeObject(const KeyValueTreeObject &other)
+        {
+            for (const auto &value : other.values_)
+            {
+                auto iter = valueMap_.insert(std::make_pair(value.key(), value.value())).first;
+                values_.push_back(KeyValueTreeProperty(iter));
+            }
+        }
+        //! Assigns a deep copy of an object.
+        KeyValueTreeObject &operator=(KeyValueTreeObject &other)
+        {
+            KeyValueTreeObject tmp(other);
+            std::swap(tmp.valueMap_, valueMap_);
+            std::swap(tmp.values_, values_);
+            return *this;
+        }
+        //! Default move constructor.
+        KeyValueTreeObject(KeyValueTreeObject &&)            = default;
+        //! Default move assignment.
+        KeyValueTreeObject &operator=(KeyValueTreeObject &&) = default;
+
+        /*! \brief
+         * Returns all properties in the object.
+         *
+         * The properties are in the order they were added to the object.
+         */
+        const std::vector<KeyValueTreeProperty> &properties() const { return values_; }
+
+        //! Whether a property with given key exists.
+        bool keyExists(const std::string &key) const
+        {
+            return valueMap_.find(key) != valueMap_.end();
+        }
+        //! Returns value for a given key.
+        const KeyValueTreeValue &operator[](const std::string &key) const
+        {
+            GMX_ASSERT(keyExists(key), "Accessing non-existent value");
+            return valueMap_.at(key);
+        }
+
+        /*! \brief
+         * Returns whether the given object shares any keys with `this`.
+         */
+        bool hasDistinctProperties(const KeyValueTreeObject &obj) const;
+
+    private:
+        //! Keeps the properties by key.
+        std::map<std::string, KeyValueTreeValue> valueMap_;
+        //! Keeps the insertion order of properties.
+        std::vector<KeyValueTreeProperty>        values_;
+
+        friend class KeyValueTreeObjectBuilder;
+};
+
+/********************************************************************
+ * Inline functions that could not be declared within the classes
+ */
+
+inline bool KeyValueTreeValue::isArray() const
+{
+    return value_.isType<KeyValueTreeArray>();
+}
+inline bool KeyValueTreeValue::isObject() const
+{
+    return value_.isType<KeyValueTreeObject>();
+}
+inline const KeyValueTreeArray &KeyValueTreeValue::asArray() const
+{
+    return value_.cast<KeyValueTreeArray>();
+}
+inline const KeyValueTreeObject &KeyValueTreeValue::asObject() const
+{
+    return value_.cast<KeyValueTreeObject>();
+}
+inline KeyValueTreeArray &KeyValueTreeValue::asArray()
+{
+    return value_.castRef<KeyValueTreeArray>();
+}
+inline KeyValueTreeObject &KeyValueTreeValue::asObject()
+{
+    return value_.castRef<KeyValueTreeObject>();
+}
+
+//! \cond libapi
+/*! \brief
+ * Writes a human-readable representation of the tree with given writer.
+ *
+ * The output format is designed to be readable by humans; if some
+ * particular machine-readable format is needed, that should be
+ * implemented outside the generic key-value tree code.
+ *
+ * \ingroup module_utility
+ */
+void dumpKeyValueTree(TextWriter *writer, const KeyValueTreeObject &tree);
+
+/*! \brief
+ * Compares two KeyValueTrees and prints any differences.
+ *
+ * \ingroup module_utility
+ */
+void compareKeyValueTrees(TextWriter               *writer,
+                          const KeyValueTreeObject &tree1,
+                          const KeyValueTreeObject &tree2,
+                          real                      ftol,
+                          real                      abstol);
+
+//! Helper function to format a simple KeyValueTreeValue.
+static inline std::string
+simpleValueToString(const KeyValueTreeValue &value)
+{
+    return simpleValueToString(value.asVariant());
+}
+
+//! \endcond
+
+} // namespace gmx
+
+#endif
diff --git a/src/gromacs/utility/keyvaluetreebuilder.h b/src/gromacs/utility/keyvaluetreebuilder.h
new file mode 100644 (file)
index 0000000..145f493
--- /dev/null
@@ -0,0 +1,460 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares classes for building the data structures in keyvaluetree.h.
+ *
+ * These are separate from the data structures to enforce clear separation of
+ * the APIs, and to make the data structure immutable after construction.
+ *
+ * For the main use case described in \ref page_mdmodules, they are mainly
+ * used internally, but currently gmx::KeyValueTreeObjectBuilder (and
+ * everything it references) is exposed for more complex transforms through
+ * gmx::IKeyValueTreeTransformRules.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_KEYVALUETREEBUILDER_H
+#define GMX_UTILITY_KEYVALUETREEBUILDER_H
+
+#include <initializer_list>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/keyvaluetree.h"
+#include "gromacs/utility/variant.h"
+
+namespace gmx
+{
+
+class KeyValueTreeArrayBuilder;
+class KeyValueTreeObjectBuilder;
+
+/*! \libinternal \brief
+ * Root builder for creating trees that have an object at the root.
+ *
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+class KeyValueTreeBuilder
+{
+    public:
+        //! Returns a builder for the root object.
+        KeyValueTreeObjectBuilder rootObject();
+
+        /*! \brief
+         * Builds the final object.
+         *
+         * The builder should not be accessed after this call.
+         */
+        KeyValueTreeObject build() { return std::move(root_); }
+
+    private:
+        /*! \brief
+         * Helper function for other builders to create values of certain type.
+         */
+        template <typename T>
+        static KeyValueTreeValue createValue(const T &value)
+        {
+            return KeyValueTreeValue(Variant::create<T>(value));
+        }
+        /*! \brief
+         * Helper function for other builders to create default-constructed
+         * values.
+         */
+        template <typename T>
+        static KeyValueTreeValue createValue()
+        {
+            return KeyValueTreeValue(Variant::create<T>(T()));
+        }
+
+        KeyValueTreeObject root_;
+
+        //! For access to createValue() methods.
+        friend class KeyValueTreeObjectArrayBuilder;
+        //! For access to createValue() methods.
+        friend class KeyValueTreeObjectBuilder;
+        //! For access to createValue() methods.
+        template <typename T>
+        friend class KeyValueTreeUniformArrayBuilder;
+};
+
+/*! \libinternal \brief
+ * Builder for KeyValueTreeValue objects.
+ *
+ * This builder can be constructed directly and can create self-standing
+ * KeyValueTreeValue objects.
+ *
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+class KeyValueTreeValueBuilder
+{
+    public:
+        //! Assigns a scalar value of certain type.
+        template <typename T>
+        void setValue(const T &value)
+        {
+            value_ = Variant::create<T>(value);
+        }
+        //! Assigns a Variant value to the built value.
+        void setVariantValue(Variant &&value)
+        {
+            value_ = std::move(value);
+        }
+        /*! \brief
+         * Returns an object builder for building an object into this value.
+         *
+         * Any method call in this value builder invalidates the returned
+         * builder.
+         */
+        KeyValueTreeObjectBuilder createObject();
+        /*! \brief
+         * Returns an array builder for building an array into this value.
+         *
+         * Any method call in this value builder invalidates the returned
+         * builder.
+         */
+        KeyValueTreeArrayBuilder createArray();
+
+        /*! \brief
+         * Builds the final value.
+         *
+         * The builder should not be accessed after this call.
+         */
+        KeyValueTreeValue build() { return KeyValueTreeValue(std::move(value_)); }
+
+    private:
+        Variant value_;
+};
+
+class KeyValueTreeArrayBuilderBase
+{
+    protected:
+        //! Creates an array builder for populating given array object.
+        explicit KeyValueTreeArrayBuilderBase(KeyValueTreeArray *array)
+            : array_(array)
+        {
+        }
+
+        //! Appends a raw Variant value to the array.
+        KeyValueTreeValue &addRawValue(Variant &&value)
+        {
+            KeyValueTreeValueBuilder builder;
+            builder.setVariantValue(std::move(value));
+            array_->values_.push_back(builder.build());
+            return array_->values_.back();
+        }
+        //! Appends a raw KeyValueTreeValue to the array.
+        KeyValueTreeValue &addRawValue(KeyValueTreeValue &&value)
+        {
+            array_->values_.push_back(std::move(value));
+            return array_->values_.back();
+        }
+
+    private:
+        KeyValueTreeArray *array_;
+};
+
+class KeyValueTreeArrayBuilder : public KeyValueTreeArrayBuilderBase
+{
+    public:
+        using KeyValueTreeArrayBuilderBase::addRawValue;
+
+    private:
+        explicit KeyValueTreeArrayBuilder(KeyValueTreeArray *array)
+            : KeyValueTreeArrayBuilderBase(array)
+        {
+        }
+
+        friend class KeyValueTreeObjectBuilder;
+        friend class KeyValueTreeValueBuilder;
+};
+
+/*! \libinternal \brief
+ * Builder for KeyValueTreeArray objects where all elements are of type `T`.
+ *
+ * The builder does not own the array being constructed, but instead holds a
+ * reference to an object within a tree rooted in KeyValueTreeBuilder or
+ * KeyValueTreeValueBuilder.
+ *
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+template <typename T>
+class KeyValueTreeUniformArrayBuilder : public KeyValueTreeArrayBuilderBase
+{
+    public:
+        //! Appends a value to the array.
+        void addValue(const T &value)
+        {
+            addRawValue(KeyValueTreeBuilder::createValue<T>(value));
+        }
+
+    private:
+        explicit KeyValueTreeUniformArrayBuilder(KeyValueTreeArray *array)
+            : KeyValueTreeArrayBuilderBase(array)
+        {
+        }
+
+        friend class KeyValueTreeObjectBuilder;
+};
+
+/*! \libinternal \brief
+ * Builder for KeyValueTreeArray objects where all elements are
+ * KeyValueTreeObject objects.
+ *
+ * The builder does not own the array being constructed, but instead holds a
+ * reference to an object within a tree rooted in KeyValueTreeBuilder or
+ * KeyValueTreeValueBuilder.
+ *
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+class KeyValueTreeObjectArrayBuilder : public KeyValueTreeArrayBuilderBase
+{
+    public:
+        /*! \brief
+         * Appends an object to the array.
+         *
+         * The object is created empty and can be built using the returned
+         * builder.
+         */
+        KeyValueTreeObjectBuilder addObject();
+
+    private:
+        explicit KeyValueTreeObjectArrayBuilder(KeyValueTreeArray *array)
+            : KeyValueTreeArrayBuilderBase(array)
+        {
+        }
+
+        friend class KeyValueTreeObjectBuilder;
+};
+
+/*! \libinternal \brief
+ * Builder for KeyValueTreeObject objects.
+ *
+ * The builder does not own the object being constructed, but instead holds a
+ * reference to an object within a tree rooted in KeyValueTreeBuilder or
+ * KeyValueTreeValueBuilder.
+ *
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+class KeyValueTreeObjectBuilder
+{
+    public:
+        //! Adds a property with given key from a KeyValueTreeValue.
+        void addRawValue(const std::string &key, KeyValueTreeValue &&value)
+        {
+            addProperty(key, std::move(value));
+        }
+        //! Adds a property with given key from a Variant value.
+        void addRawValue(const std::string &key, Variant &&value)
+        {
+            addProperty(key, KeyValueTreeValue(std::move(value)));
+        }
+        //! Adds a scalar property with given key, type, and value.
+        template <typename T>
+        void addValue(const std::string &key, const T &value)
+        {
+            addRawValue(key, KeyValueTreeBuilder::createValue<T>(value));
+        }
+        /*! \brief
+         * Adds an object-valued property with given key.
+         *
+         * The object is created empty and can be built using the returned
+         * builder.
+         */
+        KeyValueTreeObjectBuilder addObject(const std::string &key)
+        {
+            auto iter = addProperty(key, KeyValueTreeBuilder::createValue<KeyValueTreeObject>());
+            return KeyValueTreeObjectBuilder(&iter->second);
+        }
+        /*! \brief
+         * Adds a generic array-valued property with given key.
+         *
+         * The array is created empty and can be built using the returned
+         * builder.
+         */
+        KeyValueTreeArrayBuilder addArray(const std::string &key)
+        {
+            auto iter = addProperty(key, KeyValueTreeBuilder::createValue<KeyValueTreeArray>());
+            return KeyValueTreeArrayBuilder(&iter->second.asArray());
+        }
+        /*! \brief
+         * Adds an array-valued property with uniform value types with given
+         * key.
+         *
+         * \tparam T  Type for all values in the array.
+         *
+         * The array is created empty and can be built using the returned
+         * builder.
+         */
+        template <typename T>
+        KeyValueTreeUniformArrayBuilder<T> addUniformArray(const std::string &key)
+        {
+            auto iter = addProperty(key, KeyValueTreeBuilder::createValue<KeyValueTreeArray>());
+            return KeyValueTreeUniformArrayBuilder<T>(&iter->second.asArray());
+        }
+        /*! \brief
+         * Adds an array-valued property with uniform value types with given
+         * key and values.
+         *
+         * \tparam T  Type for all values in the array.
+         *
+         * The array is created to contain the values from `values`.
+         */
+        template <typename T>
+        void addUniformArray(const std::string &key, std::initializer_list<T> values)
+        {
+            auto builder = addUniformArray<T>(key);
+            for (const auto &value : values)
+            {
+                builder.addValue(value);
+            }
+        }
+        /*! \brief
+         * Adds an array-valued property with objects in the array with given
+         * key.
+         *
+         * The array is created empty and can be built using the returned
+         * builder.
+         */
+        KeyValueTreeObjectArrayBuilder addObjectArray(const std::string &key)
+        {
+            auto iter = addProperty(key, KeyValueTreeBuilder::createValue<KeyValueTreeArray>());
+            return KeyValueTreeObjectArrayBuilder(&iter->second.asArray());
+        }
+
+        //! Whether a property with given key exists.
+        bool keyExists(const std::string &key) const { return object_->keyExists(key); }
+        //! Returns value for a given key.
+        const KeyValueTreeValue &operator[](const std::string &key) const
+        {
+            return (*object_)[key];
+        }
+        //! Returns an object builder for an existing object.
+        KeyValueTreeObjectBuilder getObjectBuilder(const std::string &key)
+        {
+            GMX_ASSERT(keyExists(key), "Requested non-existent value");
+            GMX_ASSERT((*this)[key].isObject(), "Accessing non-object value as object");
+            return KeyValueTreeObjectBuilder(&object_->valueMap_.at(key).asObject());
+        }
+
+        /*! \brief
+         * Returns whether the given object shares any keys with \p this.
+         */
+        bool objectHasDistinctProperties(const KeyValueTreeObject &obj) const
+        {
+            return object_->hasDistinctProperties(obj);
+        }
+        /*! \brief
+         * Merges properties from a given object to `this`.
+         *
+         * The objects should not share any keys, i.e.,
+         * objectHasDistinctProperties() should return `true`.
+         */
+        void mergeObject(KeyValueTreeObject &&obj)
+        {
+            GMX_ASSERT(objectHasDistinctProperties(obj),
+                       "Trying to merge overlapping object");
+            for (auto &prop : obj.valueMap_)
+            {
+                addRawValue(prop.first, std::move(prop.second));
+            }
+        }
+
+    private:
+        explicit KeyValueTreeObjectBuilder(KeyValueTreeObject *object)
+            : object_(object)
+        {
+        }
+        explicit KeyValueTreeObjectBuilder(KeyValueTreeValue *value)
+            : object_(&value->asObject())
+        {
+        }
+
+        std::map<std::string, KeyValueTreeValue>::iterator
+        addProperty(const std::string &key, KeyValueTreeValue &&value)
+        {
+            GMX_RELEASE_ASSERT(!keyExists(key), "Duplicate key value");
+            object_->values_.reserve(object_->values_.size() + 1);
+            auto iter = object_->valueMap_.insert(std::make_pair(key, std::move(value))).first;
+            object_->values_.push_back(KeyValueTreeProperty(iter));
+            return iter;
+        }
+
+        KeyValueTreeObject *object_;
+
+        friend class KeyValueTreeBuilder;
+        friend class KeyValueTreeValueBuilder;
+        friend class KeyValueTreeObjectArrayBuilder;
+};
+
+/********************************************************************
+ * Inline functions that could not be declared within the classes
+ */
+
+inline KeyValueTreeObjectBuilder KeyValueTreeBuilder::rootObject()
+{
+    return KeyValueTreeObjectBuilder(&root_);
+}
+
+inline KeyValueTreeObjectBuilder KeyValueTreeValueBuilder::createObject()
+{
+    value_ = Variant::create<KeyValueTreeObject>(KeyValueTreeObject());
+    return KeyValueTreeObjectBuilder(&value_.castRef<KeyValueTreeObject>());
+}
+
+inline KeyValueTreeArrayBuilder KeyValueTreeValueBuilder::createArray()
+{
+    value_ = Variant::create<KeyValueTreeArray>(KeyValueTreeArray());
+    return KeyValueTreeArrayBuilder(&value_.castRef<KeyValueTreeArray>());
+}
+
+inline KeyValueTreeObjectBuilder KeyValueTreeObjectArrayBuilder::addObject()
+{
+    auto &value = addRawValue(KeyValueTreeBuilder::createValue<KeyValueTreeObject>());
+    return KeyValueTreeObjectBuilder(&value);
+}
+
+} // namespace gmx
+
+#endif
diff --git a/src/gromacs/utility/keyvaluetreeserializer.cpp b/src/gromacs/utility/keyvaluetreeserializer.cpp
new file mode 100644 (file)
index 0000000..60ca5da
--- /dev/null
@@ -0,0 +1,311 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+#include "gmxpre.h"
+
+#include "keyvaluetreeserializer.h"
+
+#include "gromacs/utility/iserializer.h"
+#include "gromacs/utility/keyvaluetree.h"
+#include "gromacs/utility/keyvaluetreebuilder.h"
+#include "gromacs/utility/mutex.h"
+
+namespace gmx
+{
+
+namespace
+{
+
+class ValueSerializer
+{
+    public:
+        static void initSerializers();
+
+        static void serialize(const KeyValueTreeValue &value, ISerializer *serializer);
+        static KeyValueTreeValue deserialize(ISerializer *serializer);
+
+    private:
+        ValueSerializer();
+
+        typedef void (*SerializerFunction)(const KeyValueTreeValue &value, ISerializer *serializer);
+        typedef void (*DeserializerFunction)(KeyValueTreeValueBuilder *builder, ISerializer *serializer);
+
+        struct Serializer
+        {
+            unsigned char         typeTag;
+            SerializerFunction    serialize;
+            DeserializerFunction  deserialize;
+        };
+
+        static Mutex                                         s_initMutex;
+        static std::map<std::type_index, Serializer>         s_serializers;
+        static std::map<unsigned char, DeserializerFunction> s_deserializers;
+};
+
+Mutex                                                          ValueSerializer::s_initMutex;
+std::map<std::type_index, ValueSerializer::Serializer>         ValueSerializer::s_serializers;
+std::map<unsigned char, ValueSerializer::DeserializerFunction> ValueSerializer::s_deserializers;
+
+template <typename T>
+struct SerializationTraits
+{
+};
+
+template <>
+struct SerializationTraits<KeyValueTreeObject>
+{
+    static void serialize(const KeyValueTreeObject &value, ISerializer *serializer)
+    {
+        int         count = value.properties().size();
+        serializer->doInt(&count);
+        for (const auto &prop : value.properties())
+        {
+            serializer->doString(const_cast<std::string *>(&prop.key()));
+            ValueSerializer::serialize(prop.value(), serializer);
+        }
+    }
+    static void deserialize(KeyValueTreeValueBuilder *value, ISerializer *serializer)
+    {
+        KeyValueTreeObjectBuilder builder(value->createObject());
+        deserializeObject(&builder, serializer);
+    }
+    static void deserializeObject(KeyValueTreeObjectBuilder *builder, ISerializer *serializer)
+    {
+        int         count;
+        std::string key;
+        serializer->doInt(&count);
+        for (int i = 0; i < count; ++i)
+        {
+            serializer->doString(&key);
+            builder->addRawValue(key, ValueSerializer::deserialize(serializer));
+        }
+    }
+};
+
+template <>
+struct SerializationTraits<KeyValueTreeArray>
+{
+    static void serialize(const KeyValueTreeArray &array, ISerializer *serializer)
+    {
+        int         count = array.values().size();
+        serializer->doInt(&count);
+        for (const auto &value : array.values())
+        {
+            ValueSerializer::serialize(value, serializer);
+        }
+    }
+    static void deserialize(KeyValueTreeValueBuilder *value, ISerializer *serializer)
+    {
+        KeyValueTreeArrayBuilder builder(value->createArray());
+        int                      count;
+        serializer->doInt(&count);
+        for (int i = 0; i < count; ++i)
+        {
+            builder.addRawValue(ValueSerializer::deserialize(serializer));
+        }
+    }
+};
+
+template <>
+struct SerializationTraits<std::string>
+{
+    static void serialize(const std::string &value, ISerializer *serializer)
+    {
+        serializer->doString(const_cast<std::string *>(&value));
+    }
+    static void deserialize(KeyValueTreeValueBuilder *builder, ISerializer *serializer)
+    {
+        std::string value;
+        serializer->doString(&value);
+        builder->setValue<std::string>(value);
+    }
+};
+
+template <>
+struct SerializationTraits<bool>
+{
+    static void serialize(bool value, ISerializer *serializer)
+    {
+        serializer->doBool(&value);
+    }
+    static void deserialize(KeyValueTreeValueBuilder *builder, ISerializer *serializer)
+    {
+        bool value;
+        serializer->doBool(&value);
+        builder->setValue<bool>(value);
+    }
+};
+
+template <>
+struct SerializationTraits<int>
+{
+    static void serialize(int value, ISerializer *serializer)
+    {
+        serializer->doInt(&value);
+    }
+    static void deserialize(KeyValueTreeValueBuilder *builder, ISerializer *serializer)
+    {
+        int value;
+        serializer->doInt(&value);
+        builder->setValue<int>(value);
+    }
+};
+
+template <>
+struct SerializationTraits<gmx_int64_t>
+{
+    static void serialize(gmx_int64_t value, ISerializer *serializer)
+    {
+        serializer->doInt64(&value);
+    }
+    static void deserialize(KeyValueTreeValueBuilder *builder, ISerializer *serializer)
+    {
+        gmx_int64_t value;
+        serializer->doInt64(&value);
+        builder->setValue<gmx_int64_t>(value);
+    }
+};
+
+template <>
+struct SerializationTraits<float>
+{
+    static void serialize(float value, ISerializer *serializer)
+    {
+        serializer->doFloat(&value);
+    }
+    static void deserialize(KeyValueTreeValueBuilder *builder, ISerializer *serializer)
+    {
+        float value;
+        serializer->doFloat(&value);
+        builder->setValue<float>(value);
+    }
+};
+
+template <>
+struct SerializationTraits<double>
+{
+    static void serialize(double value, ISerializer *serializer)
+    {
+        serializer->doDouble(&value);
+    }
+    static void deserialize(KeyValueTreeValueBuilder *builder, ISerializer *serializer)
+    {
+        double value;
+        serializer->doDouble(&value);
+        builder->setValue<double>(value);
+    }
+};
+
+//! Helper function for serializing values of a certain type.
+template <typename T>
+void serializeValueType(const KeyValueTreeValue &value, ISerializer *serializer)
+{
+    SerializationTraits<T>::serialize(value.cast<T>(), serializer);
+}
+
+#define SERIALIZER(tag, type) \
+    { std::type_index(typeid(type)), \
+      { tag, &serializeValueType<type>, &SerializationTraits<type>::deserialize } \
+    }
+
+// static
+void ValueSerializer::initSerializers()
+{
+    lock_guard<Mutex> lock(s_initMutex);
+    if (!s_serializers.empty())
+    {
+        return;
+    }
+    s_serializers = {
+        SERIALIZER('O', KeyValueTreeObject),
+        SERIALIZER('A', KeyValueTreeArray),
+        SERIALIZER('s', std::string),
+        SERIALIZER('b', bool),
+        SERIALIZER('i', int),
+        SERIALIZER('l', gmx_int64_t),
+        SERIALIZER('f', float),
+        SERIALIZER('d', double),
+    };
+    for (const auto item : s_serializers)
+    {
+        s_deserializers[item.second.typeTag] = item.second.deserialize;
+    }
+}
+
+void ValueSerializer::serialize(const KeyValueTreeValue &value, ISerializer *serializer)
+{
+    auto iter = s_serializers.find(value.type());
+    GMX_RELEASE_ASSERT(iter != s_serializers.end(),
+                       "Unknown value type for serializization");
+    unsigned char typeTag = iter->second.typeTag;
+    serializer->doUChar(&typeTag);
+    iter->second.serialize(value, serializer);
+}
+
+KeyValueTreeValue ValueSerializer::deserialize(ISerializer *serializer)
+{
+    unsigned char typeTag;
+    serializer->doUChar(&typeTag);
+    auto          iter = s_deserializers.find(typeTag);
+    GMX_RELEASE_ASSERT(iter != s_deserializers.end(),
+                       "Unknown type tag for deserializization");
+    KeyValueTreeValueBuilder builder;
+    iter->second(&builder, serializer);
+    return builder.build();
+}
+
+}   // namespace
+
+//! \cond libapi
+void serializeKeyValueTree(const KeyValueTreeObject &root, ISerializer *serializer)
+{
+    GMX_RELEASE_ASSERT(!serializer->reading(),
+                       "Incorrect serializer direction");
+    ValueSerializer::initSerializers();
+    SerializationTraits<KeyValueTreeObject>::serialize(root, serializer);
+}
+
+KeyValueTreeObject deserializeKeyValueTree(ISerializer *serializer)
+{
+    GMX_RELEASE_ASSERT(serializer->reading(),
+                       "Incorrect serializer direction");
+    ValueSerializer::initSerializers();
+    KeyValueTreeBuilder       builder;
+    KeyValueTreeObjectBuilder obj(builder.rootObject());
+    SerializationTraits<KeyValueTreeObject>::deserializeObject(&obj, serializer);
+    return builder.build();
+}
+//! \endcond
+
+} // namespace gmx
diff --git a/src/gromacs/utility/keyvaluetreeserializer.h b/src/gromacs/utility/keyvaluetreeserializer.h
new file mode 100644 (file)
index 0000000..0cbbb2c
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares serialization routines for KeyValueTree objects.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_KEYVALUETREESERIALIZER_H
+#define GMX_UTILITY_KEYVALUETREESERIALIZER_H
+
+namespace gmx
+{
+
+class KeyValueTreeObject;
+class ISerializer;
+
+//! \cond libapi
+/*! \brief
+ * Serializes a KeyValueTreeObject with given serializer.
+ *
+ * \ingroup module_utility
+ */
+void serializeKeyValueTree(const KeyValueTreeObject &root, ISerializer *serializer);
+/*! \brief
+ * Deserializes a KeyValueTreeObject from a given serializer.
+ *
+ * \ingroup module_utility
+ */
+KeyValueTreeObject deserializeKeyValueTree(ISerializer *serializer);
+//! \endcond
+
+} // namespace gmx
+
+#endif
diff --git a/src/gromacs/utility/keyvaluetreetransform.cpp b/src/gromacs/utility/keyvaluetreetransform.cpp
new file mode 100644 (file)
index 0000000..7d86115
--- /dev/null
@@ -0,0 +1,588 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+#include "gmxpre.h"
+
+#include "keyvaluetreetransform.h"
+
+#include <functional>
+#include <map>
+#include <memory>
+#include <typeindex>
+#include <vector>
+
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/ikeyvaluetreeerror.h"
+#include "gromacs/utility/keyvaluetreebuilder.h"
+#include "gromacs/utility/stringcompare.h"
+#include "gromacs/utility/stringutil.h"
+
+namespace gmx
+{
+
+/********************************************************************
+ * IKeyValueTreeTransformRules
+ */
+
+IKeyValueTreeTransformRules::~IKeyValueTreeTransformRules()
+{
+}
+
+/********************************************************************
+ * KeyValueTreeTransformRulesScoped::Impl
+ */
+
+class KeyValueTreeTransformRulesScoped::Impl : public IKeyValueTreeTransformRules
+{
+    public:
+        Impl(internal::KeyValueTreeTransformerImpl *impl, const KeyValueTreePath &prefix)
+            : impl_(impl), prefix_(prefix)
+        {
+        }
+
+        KeyValueTreeTransformRuleBuilder addRule() override
+        {
+            return KeyValueTreeTransformRuleBuilder(impl_, prefix_);
+        }
+
+        KeyValueTreeTransformRulesScoped
+        scopedTransform(const KeyValueTreePath &scope) override
+        {
+            return KeyValueTreeTransformRulesScoped(impl_, prefix_ + scope);
+        }
+
+    private:
+        internal::KeyValueTreeTransformerImpl *impl_;
+        KeyValueTreePath                       prefix_;
+};
+
+/********************************************************************
+ * KeyValueTreeTransformRulesScoped
+ */
+
+KeyValueTreeTransformRulesScoped::KeyValueTreeTransformRulesScoped(
+        internal::KeyValueTreeTransformerImpl *impl, const KeyValueTreePath &prefix)
+    : impl_(new Impl(impl, prefix))
+{
+}
+
+KeyValueTreeTransformRulesScoped::KeyValueTreeTransformRulesScoped(
+        KeyValueTreeTransformRulesScoped &&) = default;
+
+KeyValueTreeTransformRulesScoped &
+KeyValueTreeTransformRulesScoped::operator=(
+        KeyValueTreeTransformRulesScoped &&) = default;
+
+KeyValueTreeTransformRulesScoped::~KeyValueTreeTransformRulesScoped()
+{
+}
+
+IKeyValueTreeTransformRules *KeyValueTreeTransformRulesScoped::rules()
+{
+    return impl_.get();
+}
+
+/********************************************************************
+ * IKeyValueTreeBackMapping
+ */
+
+IKeyValueTreeBackMapping::~IKeyValueTreeBackMapping()
+{
+}
+
+namespace
+{
+
+class KeyValueTreeBackMapping : public IKeyValueTreeBackMapping
+{
+    public:
+        class Entry
+        {
+            public:
+                Entry() = default;
+                explicit Entry(const KeyValueTreePath &path) : sourcePath_(path) {}
+
+                Entry *getOrCreateChildEntry(const std::string &key)
+                {
+                    auto iter = childEntries_.find(key);
+                    if (iter == childEntries_.end())
+                    {
+                        iter = childEntries_.insert(std::make_pair(key, Entry())).first;
+                    }
+                    return &iter->second;
+                }
+                void setMapping(const KeyValueTreePath  &path,
+                                const KeyValueTreeValue &value)
+                {
+                    GMX_RELEASE_ASSERT(sourcePath_.empty(),
+                                       "Multiple entries map to same path");
+                    if (value.isObject())
+                    {
+                        const KeyValueTreeObject &object = value.asObject();
+                        for (const auto &prop : object.properties())
+                        {
+                            GMX_RELEASE_ASSERT(!prop.value().isObject(),
+                                               "Nested objects not implemented");
+                            childEntries_[prop.key()] = Entry(path);
+                        }
+                    }
+                    else
+                    {
+                        sourcePath_ = path;
+                    }
+                }
+
+                KeyValueTreePath             sourcePath_;
+                std::map<std::string, Entry> childEntries_;
+        };
+
+        virtual KeyValueTreePath
+        originalPath(const KeyValueTreePath &path) const
+        {
+            const Entry *entry = &rootEntry_;
+            for (const auto &element : path.elements())
+            {
+                auto iter = entry->childEntries_.find(element);
+                if (iter == entry->childEntries_.end())
+                {
+                    break;
+                }
+                entry = &iter->second;
+            }
+            GMX_RELEASE_ASSERT(entry->childEntries_.empty()
+                               && !entry->sourcePath_.empty(),
+                               "Requested path not uniquely mapped");
+            return entry->sourcePath_;
+        }
+
+        Entry *rootEntry() { return &rootEntry_; }
+
+    private:
+        Entry rootEntry_;
+};
+
+}   // namespace
+
+namespace internal
+{
+
+/********************************************************************
+ * KeyValueTreeTransformerImpl
+ */
+
+class KeyValueTreeTransformerImpl
+{
+    public:
+        class Rule
+        {
+            public:
+                typedef std::function<void(KeyValueTreeValueBuilder *, const KeyValueTreeValue &)>
+                    TransformFunction;
+                typedef std::map<std::string, Rule, StringCompare> ChildRuleMap;
+
+                explicit Rule(StringCompareType keyMatchType)
+                    : expectedType_(typeid(void)), childRules_(keyMatchType)
+                {
+                }
+
+                const Rule *findMatchingChildRule(const std::string &key) const
+                {
+                    auto iter = childRules_.find(key);
+                    if (iter == childRules_.end())
+                    {
+                        return nullptr;
+                    }
+                    return &iter->second;
+                }
+                Rule *getOrCreateChildRule(const std::string &key)
+                {
+                    auto iter = childRules_.find(key);
+                    if (iter == childRules_.end())
+                    {
+                        return createChildRule(key, StringCompareType::Exact);
+                    }
+                    return &iter->second;
+                }
+                Rule *createChildRule(const std::string &key,
+                                      StringCompareType  keyMatchType)
+                {
+                    auto result = childRules_.insert(std::make_pair(key, Rule(keyMatchType)));
+                    GMX_RELEASE_ASSERT(result.second,
+                                       "Cannot specify key match type after child rules");
+                    return &result.first->second;
+                }
+
+                void collectMappedPaths(const KeyValueTreePath        &prefix,
+                                        std::vector<KeyValueTreePath> *result) const
+                {
+                    for (const auto &value : childRules_)
+                    {
+                        KeyValueTreePath path = prefix;
+                        path.append(value.first);
+                        const Rule      &rule = value.second;
+                        if (rule.transform_)
+                        {
+                            result->push_back(path);
+                        }
+                        else
+                        {
+                            rule.collectMappedPaths(path, result);
+                        }
+                    }
+                }
+
+                KeyValueTreePath            targetPath_;
+                std::string                 targetKey_;
+                std::type_index             expectedType_;
+                TransformFunction           transform_;
+                ChildRuleMap                childRules_;
+        };
+
+        class Transformer
+        {
+            public:
+                explicit Transformer(IKeyValueTreeErrorHandler *errorHandler)
+                    : errorHandler_(errorHandler),
+                      backMapping_(new KeyValueTreeBackMapping)
+                {
+                    if (errorHandler_ == nullptr)
+                    {
+                        errorHandler_ = defaultKeyValueTreeErrorHandler();
+                    }
+                }
+
+                void transform(const Rule *rootRule, const KeyValueTreeObject &tree)
+                {
+                    if (rootRule != nullptr)
+                    {
+                        doChildTransforms(rootRule, tree);
+                    }
+                }
+
+                KeyValueTreeTransformResult result()
+                {
+                    return KeyValueTreeTransformResult(builder_.build(),
+                                                       std::move(backMapping_));
+                }
+
+            private:
+                void doTransform(const Rule *rule, const KeyValueTreeValue &value);
+                void doChildTransforms(const Rule *rule, const KeyValueTreeObject &object);
+                void applyTransformedValue(const Rule *rule, KeyValueTreeValue &&value);
+
+                IKeyValueTreeErrorHandler               *errorHandler_;
+                KeyValueTreeBuilder                      builder_;
+                std::unique_ptr<KeyValueTreeBackMapping> backMapping_;
+                KeyValueTreePath                         context_;
+        };
+
+        KeyValueTreeTransformerImpl()
+            : rootScope_(this, KeyValueTreePath())
+        {
+        }
+
+        Rule *getOrCreateRootRule()
+        {
+            if (rootRule_ == nullptr)
+            {
+                createRootRule(StringCompareType::Exact);
+            }
+            return rootRule_.get();
+        }
+        void createRootRule(StringCompareType keyMatchType)
+        {
+            GMX_RELEASE_ASSERT(rootRule_ == nullptr,
+                               "Cannot specify key match type after child rules");
+            rootRule_.reset(new Rule(keyMatchType));
+        }
+
+        std::unique_ptr<Rule>             rootRule_;
+        KeyValueTreeTransformRulesScoped  rootScope_;
+};
+
+/********************************************************************
+ * KeyValueTreeTransformerImpl::Transformer
+ */
+
+void KeyValueTreeTransformerImpl::Transformer::doTransform(
+        const Rule *rule, const KeyValueTreeValue &value)
+{
+    if (rule->transform_ != nullptr)
+    {
+        KeyValueTreeValueBuilder valueBuilder;
+        try
+        {
+            if (value.type() != rule->expectedType_)
+            {
+                // TODO: Better error message.
+                GMX_THROW(InvalidInputError("Unexpected type of value"));
+            }
+            rule->transform_(&valueBuilder, value);
+        }
+        catch (UserInputError &ex)
+        {
+            if (!errorHandler_->onError(&ex, context_))
+            {
+                throw;
+            }
+            return;
+        }
+        applyTransformedValue(rule, valueBuilder.build());
+        return;
+    }
+    if (!rule->childRules_.empty())
+    {
+        doChildTransforms(rule, value.asObject());
+    }
+}
+
+void KeyValueTreeTransformerImpl::Transformer::doChildTransforms(
+        const Rule *rule, const KeyValueTreeObject &object)
+{
+    for (const auto &prop : object.properties())
+    {
+        const Rule *childRule = rule->findMatchingChildRule(prop.key());
+        if (childRule != nullptr)
+        {
+            context_.append(prop.key());
+            doTransform(childRule, prop.value());
+            context_.pop_back();
+        }
+    }
+}
+
+void KeyValueTreeTransformerImpl::Transformer::applyTransformedValue(
+        const Rule *rule, KeyValueTreeValue &&value)
+{
+    KeyValueTreeObjectBuilder       objBuilder = builder_.rootObject();
+    KeyValueTreeBackMapping::Entry *mapEntry   = backMapping_->rootEntry();
+    for (const std::string &key : rule->targetPath_.elements())
+    {
+        if (objBuilder.keyExists(key))
+        {
+            GMX_RELEASE_ASSERT(objBuilder[key].isObject(),
+                               "Inconsistent transform (different items map to same path)");
+            objBuilder = objBuilder.getObjectBuilder(key);
+        }
+        else
+        {
+            objBuilder = objBuilder.addObject(key);
+        }
+        mapEntry = mapEntry->getOrCreateChildEntry(key);
+    }
+    mapEntry = mapEntry->getOrCreateChildEntry(rule->targetKey_);
+    mapEntry->setMapping(context_, value);
+    if (objBuilder.keyExists(rule->targetKey_))
+    {
+        GMX_RELEASE_ASSERT(value.isObject(),
+                           "Inconsistent transform (different items map to same path)");
+        GMX_RELEASE_ASSERT(objBuilder[rule->targetKey_].isObject(),
+                           "Inconsistent transform (different items map to same path)");
+        objBuilder = objBuilder.getObjectBuilder(rule->targetKey_);
+        GMX_RELEASE_ASSERT(objBuilder.objectHasDistinctProperties(value.asObject()),
+                           "Inconsistent transform (different items map to same path)");
+        objBuilder.mergeObject(std::move(value.asObject()));
+    }
+    else
+    {
+        objBuilder.addRawValue(rule->targetKey_, std::move(value));
+    }
+}
+
+}   // namespace internal
+
+/********************************************************************
+ * KeyValueTreeTransformer
+ */
+
+KeyValueTreeTransformer::KeyValueTreeTransformer()
+    : impl_(new internal::KeyValueTreeTransformerImpl)
+{
+}
+
+KeyValueTreeTransformer::~KeyValueTreeTransformer()
+{
+}
+
+IKeyValueTreeTransformRules *KeyValueTreeTransformer::rules()
+{
+    return impl_->rootScope_.rules();
+}
+
+std::vector<KeyValueTreePath> KeyValueTreeTransformer::mappedPaths() const
+{
+    std::vector<KeyValueTreePath> result;
+    if (impl_->rootRule_)
+    {
+        impl_->rootRule_->collectMappedPaths(KeyValueTreePath(), &result);
+    }
+    return result;
+}
+
+KeyValueTreeTransformResult
+KeyValueTreeTransformer::transform(const KeyValueTreeObject  &tree,
+                                   IKeyValueTreeErrorHandler *errorHandler) const
+{
+    internal::KeyValueTreeTransformerImpl::Transformer transformer(errorHandler);
+    transformer.transform(impl_->rootRule_.get(), tree);
+    return transformer.result();
+}
+
+/********************************************************************
+ * KeyValueTreeTransformRuleBuilder::Data
+ */
+
+class KeyValueTreeTransformRuleBuilder::Data
+{
+    public:
+        typedef internal::KeyValueTreeTransformerImpl::Rule Rule;
+
+        explicit Data(const KeyValueTreePath &prefix)
+            : prefixPath_(prefix), expectedType_(typeid(void)),
+              keyMatchType_(StringCompareType::Exact), keyMatchRule_(false)
+        {
+        }
+
+        void createRule(internal::KeyValueTreeTransformerImpl *impl)
+        {
+            if (keyMatchRule_)
+            {
+                createRuleWithKeyMatchType(impl);
+                return;
+            }
+            GMX_RELEASE_ASSERT(transform_ != nullptr,
+                               "Transform has not been specified");
+            Rule *rule = impl->getOrCreateRootRule();
+            for (const std::string &key : fromPath_.elements())
+            {
+                GMX_RELEASE_ASSERT(rule->targetKey_.empty(),
+                                   "Cannot specify multiple rules from a single path");
+                rule = rule->getOrCreateChildRule(key);
+            }
+            GMX_RELEASE_ASSERT(rule->targetKey_.empty(),
+                               "Cannot specify multiple rules from a single path");
+            rule->targetKey_    = toPath_.pop_last();
+            rule->targetPath_   = std::move(toPath_);
+            rule->expectedType_ = expectedType_;
+            rule->transform_    = transform_;
+        }
+
+        void createRuleWithKeyMatchType(internal::KeyValueTreeTransformerImpl *impl)
+        {
+            if (fromPath_.empty())
+            {
+                impl->createRootRule(keyMatchType_);
+            }
+            else
+            {
+                std::string lastKey = fromPath_.pop_last();
+                Rule       *rule    = impl->getOrCreateRootRule();
+                for (const std::string &key : fromPath_.elements())
+                {
+                    rule = rule->getOrCreateChildRule(key);
+                }
+                rule->createChildRule(lastKey, keyMatchType_);
+            }
+        }
+
+        const KeyValueTreePath   prefixPath_;
+        KeyValueTreePath         fromPath_;
+        KeyValueTreePath         toPath_;
+        std::type_index          expectedType_;
+        Rule::TransformFunction  transform_;
+        StringCompareType        keyMatchType_;
+        bool                     keyMatchRule_;
+};
+
+/********************************************************************
+ * KeyValueTreeTransformRuleBuilder
+ */
+
+KeyValueTreeTransformRuleBuilder::KeyValueTreeTransformRuleBuilder(
+        internal::KeyValueTreeTransformerImpl *impl, const KeyValueTreePath &prefix)
+    : impl_(impl), data_(new Data(prefix))
+{
+}
+
+KeyValueTreeTransformRuleBuilder::~KeyValueTreeTransformRuleBuilder()
+{
+    if (!std::uncaught_exception())
+    {
+        data_->createRule(impl_);
+    }
+}
+
+void KeyValueTreeTransformRuleBuilder::setFromPath(const KeyValueTreePath &path)
+{
+    data_->fromPath_ = path;
+}
+
+void KeyValueTreeTransformRuleBuilder::setExpectedType(const std::type_index &type)
+{
+    data_->expectedType_ = type;
+}
+
+void KeyValueTreeTransformRuleBuilder::setToPath(const KeyValueTreePath &path)
+{
+    data_->toPath_ = data_->prefixPath_ + path;
+}
+
+void KeyValueTreeTransformRuleBuilder::setKeyMatchType(StringCompareType keyMatchType)
+{
+    data_->keyMatchType_ = keyMatchType;
+    data_->keyMatchRule_ = true;
+}
+
+void KeyValueTreeTransformRuleBuilder::addTransformToVariant(
+        std::function<Variant(const Variant &)> transform)
+{
+    data_->transform_ =
+        [transform] (KeyValueTreeValueBuilder *builder, const KeyValueTreeValue &value)
+        {
+            builder->setVariantValue(transform(value.asVariant()));
+        };
+}
+
+void KeyValueTreeTransformRuleBuilder::addTransformToObject(
+        std::function<void(KeyValueTreeObjectBuilder *, const Variant &)> transform)
+{
+    data_->transform_ =
+        [transform] (KeyValueTreeValueBuilder *builder, const KeyValueTreeValue &value)
+        {
+            KeyValueTreeObjectBuilder obj = builder->createObject();
+            transform(&obj, value.asVariant());
+        };
+}
+
+} // namespace gmx
diff --git a/src/gromacs/utility/keyvaluetreetransform.h b/src/gromacs/utility/keyvaluetreetransform.h
new file mode 100644 (file)
index 0000000..a44a658
--- /dev/null
@@ -0,0 +1,408 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares utilities for transforming key-value trees.
+ *
+ * See \ref page_mdmodules for the main use case that these support.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_KEYVALUETREETRANSFORM_H
+#define GMX_UTILITY_KEYVALUETREETRANSFORM_H
+
+#include <functional>
+#include <string>
+#include <typeindex>
+#include <vector>
+
+#include "gromacs/utility/classhelpers.h"
+#include "gromacs/utility/keyvaluetree.h"
+#include "gromacs/utility/variant.h"
+
+namespace gmx
+{
+
+class IKeyValueTreeErrorHandler;
+class KeyValueTreeObjectBuilder;
+
+enum class StringCompareType;
+
+class KeyValueTreeTransformResult;
+class KeyValueTreeTransformRuleBuilder;
+class KeyValueTreeTransformRulesScoped;
+
+namespace internal
+{
+class KeyValueTreeTransformerImpl;
+}
+
+/*! \libinternal \brief
+ * Interface to declare rules for transforming key-value trees.
+ *
+ * This interface is used to add transformation rules for key-value trees.
+ * A transformation is a set of rules that is used to map an input key-value
+ * tree to an output key-value tree, with possible conversion steps performed
+ * in the process.  Currently, each rule maps one item from the source tree to
+ * one item in the target tree (it is possible to expand a single value into an
+ * object with multiple properties).  See KeyValueTreeTransformRuleBuilder for
+ * the kinds of rules currently supported.
+ *
+ * The main use currently is in converting flat-format mdp files to a
+ * structured internal representation.
+ *
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+class IKeyValueTreeTransformRules
+{
+    public:
+        /*! \brief
+         * Creates a new rule.
+         *
+         * Properties of the new rule must be specified using the returned
+         * builder.
+         */
+        virtual KeyValueTreeTransformRuleBuilder addRule() = 0;
+        /*! \brief
+         * Creates a scoped set of rules, where all rules use a target sub-tree.
+         *
+         * \param[in] scope Prefix defining the scope in the target tree
+         *
+         * Any rules added to the returned scope will have `scope` prefixed to
+         * their target paths, i.e., it is not possible to produce elements
+         * outside the specified subtree.
+         */
+        virtual KeyValueTreeTransformRulesScoped
+        scopedTransform(const KeyValueTreePath &scope) = 0;
+
+    protected:
+        ~IKeyValueTreeTransformRules();
+};
+
+/*! \libinternal \brief
+ * Helper object returned from IKeyValueTreeTransformRules::scopedTransform().
+ *
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+class KeyValueTreeTransformRulesScoped
+{
+    public:
+        //! Internal constructor for creating the scope.
+        KeyValueTreeTransformRulesScoped(
+            internal::KeyValueTreeTransformerImpl *impl,
+            const KeyValueTreePath                &prefix);
+        //! Supports returning the object from IKeyValueTreeTransformRules::scopedTransform().
+        KeyValueTreeTransformRulesScoped(KeyValueTreeTransformRulesScoped &&other);
+        //! Supports returning the object from IKeyValueTreeTransformRules::scopedTransform().
+        KeyValueTreeTransformRulesScoped &operator=(KeyValueTreeTransformRulesScoped &&other);
+        ~KeyValueTreeTransformRulesScoped();
+
+        //! Returns the interface for adding rules to this scope.
+        IKeyValueTreeTransformRules *rules();
+
+    private:
+        class Impl;
+
+        PrivateImplPointer<Impl> impl_;
+};
+
+/*! \libinternal \brief
+ * Provides methods to specify one transformation rule.
+ *
+ * \if internal
+ * The builder is implemented as a set of nested objects, each of which is
+ * provides methods for setting a particular property of the rule.  Setting a
+ * property returns another object that has relevant methods for the context.
+ * This provides some structure to the methods, and catches at least some types
+ * of incorrect rules already at compile time.
+ * Additionally, if you use an IDE with completion facilities, it can nicely
+ * guide you through which values you need to specify.
+ * All values are stored within the main builder object, and the rule is
+ * created at the end of the statement.
+ * \endif
+ *
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+class KeyValueTreeTransformRuleBuilder
+{
+    public:
+        /*! \internal \brief
+         * Base class used for implementing parameter provider objects.
+         */
+        class Base
+        {
+            protected:
+                //! Creates a parameter provider object within given builder.
+                explicit Base(KeyValueTreeTransformRuleBuilder *builder)
+                    : builder_(builder)
+                {
+                }
+
+                //! The parent builder.
+                KeyValueTreeTransformRuleBuilder *builder_;
+        };
+
+        /*! \libinternal \brief
+         * Properties that can be specified after from().to().
+         *
+         * \tparam FromType Type specified for from() to map from.
+         * \tparam ToType Type specified for to() to map to.
+         */
+        template <typename FromType, typename ToType>
+        class ToValue : public Base
+        {
+            public:
+                //! Creates a parameter provider object within given builder.
+                explicit ToValue(KeyValueTreeTransformRuleBuilder *builder)
+                    : Base(builder)
+                {
+                }
+
+                /*! \brief
+                 * Specifies the transformation function to convert the value
+                 * from FromType to ToType.
+                 */
+                void transformWith(std::function<ToType(const FromType &)> transform)
+                {
+                    builder_->addTransformToVariant(
+                            [transform] (const Variant &value)
+                            {
+                                return Variant::create<ToType>(transform(value.cast<FromType>()));
+                            });
+                }
+        };
+
+        /*! \libinternal \brief
+         * Properties that can be specified after from().toObject().
+         *
+         * \tparam FromType Type specified for from() to map from.
+         */
+        template <typename FromType>
+        class ToObject : public Base
+        {
+            public:
+                //! Creates a parameter provider object within given builder.
+                explicit ToObject(KeyValueTreeTransformRuleBuilder *builder)
+                    : Base(builder)
+                {
+                }
+
+                /*! \brief
+                 * Specifies the transformation function to build the output
+                 * object.
+                 *
+                 * The transform should build the output object with the
+                 * provided builder.
+                 */
+                void transformWith(std::function<void(KeyValueTreeObjectBuilder *, const FromType &)> transform)
+                {
+                    builder_->addTransformToObject(
+                            [transform] (KeyValueTreeObjectBuilder *builder, const Variant &value)
+                            {
+                                transform(builder, value.cast<FromType>());
+                            });
+                }
+        };
+
+        /*! \libinternal \brief
+         * Properties that can be specified after from().
+         *
+         * \tparam FromType Type specified for from() to map from.
+         */
+        template <typename FromType>
+        class AfterFrom : public Base
+        {
+            public:
+                //! Creates a parameter provider object within given builder.
+                explicit AfterFrom(KeyValueTreeTransformRuleBuilder *builder)
+                    : Base(builder)
+                {
+                }
+
+                /*! \brief
+                 * Specifies a rule that maps to a value at given path.
+                 *
+                 * \tparam ToType  Type to map to.
+                 * \param[in] path Path to map to.
+                 *
+                 * It is an error if multiple rules map to the same path, or to
+                 * a parent path of the target of an existing rule.
+                 * Note that it is possible to have a to() rule map to a child
+                 * of a toObject() rule, provided that the path is not created
+                 * by the object rule.
+                 */
+                template <typename ToType>
+                ToValue<FromType, ToType> to(const KeyValueTreePath &path)
+                {
+                    builder_->setToPath(path);
+                    return ToValue<FromType, ToType>(builder_);
+                }
+
+                /*! \brief
+                 * Specifies a rule that maps to an object (collection of named
+                 * values) at given path.
+                 *
+                 * \param[in] path Path to map to.
+                 *
+                 * It is an error if multiple rules map to the same path, or to
+                 * a parent path of the target of an existing rule.
+                 * However, it is allowed to have two toObject() rules map to
+                 * the same path, provided that the properties they produce are
+                 * distinct.
+                 */
+                ToObject<FromType> toObject(const KeyValueTreePath &path)
+                {
+                    builder_->setToPath(path);
+                    return ToObject<FromType>(builder_);
+                }
+        };
+
+        //! Internal constructor for creating a builder.
+        KeyValueTreeTransformRuleBuilder(internal::KeyValueTreeTransformerImpl *impl,
+                                         const KeyValueTreePath                &prefix);
+        //! Supports returning the builder from IKeyValueTreeTransformRules::addRule().
+        KeyValueTreeTransformRuleBuilder(KeyValueTreeTransformRuleBuilder &&)            = default;
+        //! Supports returning the builder from IKeyValueTreeTransformRules::addRule().
+        KeyValueTreeTransformRuleBuilder &operator=(KeyValueTreeTransformRuleBuilder &&) = default;
+        ~KeyValueTreeTransformRuleBuilder();
+
+        /*! \brief
+         * Specifies a rule that maps a value at given path.
+         *
+         * \tparam FromType Type of value expected at `path`.
+         * \param[in] path Path to map in this rule.
+         *
+         * If the input tree has `path`, but it is not of type `FromType`,
+         * the transform will produce an error.
+         *
+         * It is an error to use the same path in two from() rules.  Similarly,
+         * it is an error to use a child path of a path used in a different
+         * from() rule.
+         */
+        template <typename FromType>
+        AfterFrom<FromType> from(const KeyValueTreePath &path)
+        {
+            setFromPath(path);
+            setExpectedType(typeid(FromType));
+            return AfterFrom<FromType>(this);
+        }
+        /*! \brief
+         * Specifies how strings are matched when matching rules against a path.
+         *
+         * For properties of the object at `path`, `keyMatchType` is used for
+         * string comparison.
+         *
+         * This rule must be specified first for a path, before any other
+         * from() rule specifies the path or a subpath.
+         * The rule only applies to immediate properties at the given path, not
+         * recursively.
+         * It is an error to specify the match type multiple times for a path.
+         */
+        void keyMatchType(const KeyValueTreePath &path, StringCompareType keyMatchType)
+        {
+            setFromPath(path);
+            setKeyMatchType(keyMatchType);
+        }
+
+    private:
+        void setFromPath(const KeyValueTreePath &path);
+        void setExpectedType(const std::type_index &type);
+        void setToPath(const KeyValueTreePath &path);
+        void setKeyMatchType(StringCompareType keyMatchType);
+        void addTransformToVariant(std::function<Variant(const Variant &)> transform);
+        void addTransformToObject(std::function<void(KeyValueTreeObjectBuilder *, const Variant &)> transform);
+
+        class Data;
+
+        internal::KeyValueTreeTransformerImpl *impl_;
+        std::unique_ptr<Data>                  data_;
+};
+
+class KeyValueTreeTransformer
+{
+    public:
+        KeyValueTreeTransformer();
+        ~KeyValueTreeTransformer();
+
+        IKeyValueTreeTransformRules *rules();
+
+        std::vector<KeyValueTreePath> mappedPaths() const;
+
+        KeyValueTreeTransformResult
+        transform(const KeyValueTreeObject  &tree,
+                  IKeyValueTreeErrorHandler *errorHandler) const;
+
+    private:
+        PrivateImplPointer<internal::KeyValueTreeTransformerImpl> impl_;
+};
+
+class IKeyValueTreeBackMapping
+{
+    public:
+        virtual ~IKeyValueTreeBackMapping();
+
+        virtual KeyValueTreePath
+        originalPath(const KeyValueTreePath &path) const = 0;
+};
+
+class KeyValueTreeTransformResult
+{
+    public:
+        KeyValueTreeObject object() { return std::move(object_); }
+        const IKeyValueTreeBackMapping &backMapping() const { return *mapping_; }
+
+    private:
+        typedef std::unique_ptr<IKeyValueTreeBackMapping> MappingPointer;
+
+        KeyValueTreeTransformResult(KeyValueTreeObject &&object,
+                                    MappingPointer     &&mapping)
+            : object_(std::move(object)), mapping_(std::move(mapping))
+        {
+        }
+
+        KeyValueTreeObject  object_;
+        MappingPointer      mapping_;
+
+        friend class internal::KeyValueTreeTransformerImpl;
+};
+
+} // namespace gmx
+
+#endif
diff --git a/src/gromacs/utility/logger.cpp b/src/gromacs/utility/logger.cpp
new file mode 100644 (file)
index 0000000..7be5808
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+#include "gmxpre.h"
+
+#include "logger.h"
+
+#include <cstdarg>
+
+#include "gromacs/utility/stringutil.h"
+
+namespace gmx
+{
+
+namespace
+{
+
+//! Helper method for reading logging targets from an array.
+ILogTarget *getTarget(ILogTarget        *targets[MDLogger::LogLevelCount],
+                      MDLogger::LogLevel level)
+{
+    return targets[static_cast<int>(level)];
+}
+
+}   // namespace
+
+ILogTarget::~ILogTarget()
+{
+}
+
+
+LogEntryWriter &LogEntryWriter::appendTextFormatted(const char *fmt, ...)
+{
+    va_list ap;
+
+    va_start(ap, fmt);
+    entry_.text.append(formatStringV(fmt, ap));
+    va_end(ap);
+    return *this;
+}
+
+MDLogger::MDLogger()
+    : warning(nullptr), info(nullptr)
+{
+}
+
+MDLogger::MDLogger(ILogTarget *targets[LogLevelCount])
+    : warning(getTarget(targets, LogLevel::Warning)),
+      info(getTarget(targets, LogLevel::Info))
+{
+}
+
+} // namespace gmx
diff --git a/src/gromacs/utility/logger.h b/src/gromacs/utility/logger.h
new file mode 100644 (file)
index 0000000..4f52ec6
--- /dev/null
@@ -0,0 +1,230 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares functionality for logging.
+ *
+ * See \ref page_logging for an overview of the functionality.
+ *
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_LOGGER_H
+#define GMX_UTILITY_LOGGER_H
+
+#include <string>
+
+namespace gmx
+{
+
+struct LogEntry
+{
+    LogEntry() : asParagraph(false) {}
+
+    std::string text;
+    bool        asParagraph;
+};
+
+/*! \libinternal \brief
+ * Target where log output can be written.
+ *
+ * \ingroup module_utility
+ */
+class ILogTarget
+{
+    public:
+        virtual ~ILogTarget();
+
+        //! Writes a log entry to this target.
+        virtual void writeEntry(const LogEntry &entry) = 0;
+};
+
+/*! \libinternal \brief
+ * Helper class for creating log entries with ::GMX_LOG.
+ *
+ * \ingroup module_utility
+ */
+class LogEntryWriter
+{
+    public:
+        //! Appends given text to the log entry.
+        LogEntryWriter &appendText(const char *text)
+        {
+            entry_.text.append(text);
+            return *this;
+        }
+        //! Appends given text to the log entry.
+        LogEntryWriter &appendText(const std::string &text)
+        {
+            entry_.text.append(text);
+            return *this;
+        }
+        //! Appends given text to the log entry, with printf-style formatting.
+        LogEntryWriter &appendTextFormatted(const char *fmt, ...);
+        //! Writes the log entry with empty lines before and after.
+        LogEntryWriter &asParagraph()
+        {
+            entry_.asParagraph = true;
+            return *this;
+        }
+
+    private:
+        LogEntry    entry_;
+
+        friend class LogWriteHelper;
+};
+
+/*! \internal \brief
+ * Helper class for implementing ::GMX_LOG.
+ *
+ * \ingroup module_utility
+ */
+class LogWriteHelper
+{
+    public:
+        //! Initializes a helper for writing to the given target.
+        explicit LogWriteHelper(ILogTarget *target) : target_(target) {}
+
+        // Should be explicit, once that works in CUDA.
+        /*! \brief
+         * Returns whether anything needs to be written.
+         *
+         * Note that the return value is unintuitively `false` when the target
+         * is active, to allow implementing ::GMX_LOG like it is now.
+         */
+        operator bool() const { return target_ == nullptr; }
+
+        /*! \brief
+         * Writes the entry from the given writer to the log target.
+         *
+         * This is implemented as an assignment operator to get proper
+         * precedence for operations for the ::GMX_LOG macro; this is a common
+         * technique for implementing macros that allow streming information to
+         * them (see, e.g., Google Test).
+         */
+        void operator=(const LogEntryWriter &entryWriter)
+        {
+            target_->writeEntry(entryWriter.entry_);
+        }
+
+    private:
+        ILogTarget *target_;
+};
+
+/*! \libinternal \brief
+ * Represents a single logging level.
+ *
+ * Typically this type is not used directly, but instances in MDLogger are
+ * simply accessed through ::GMX_LOG in code that writes to the log.
+ *
+ * \ingroup module_utility
+ */
+class LogLevelHelper
+{
+    public:
+        //! Initializes a helper for writing to the given target.
+        explicit LogLevelHelper(ILogTarget *target) : target_(target) {}
+
+        // Both of the below should be explicit, once that works in CUDA.
+        //! Returns whether the output for this log level goes anywhere.
+        operator bool() const { return target_ != nullptr; }
+
+        //! Creates a helper for ::GMX_LOG.
+        operator LogWriteHelper() const { return LogWriteHelper(target_); }
+
+    private:
+        ILogTarget *target_;
+};
+
+/*! \libinternal \brief
+ * Declares a logging interface.
+ *
+ * Typically, this object is not created directly, but instead through
+ * LoggerBuilder.
+ *
+ * For now, this is named MDLogger, since it is used only there, and it is not
+ * clear whether the logging levels can be the same throughout the code.  It
+ * should be relatively straightforward to split this into multiple classes
+ * with different supported logging levels without changing calling code, or to
+ * rename it to Logger if we do not need any specialization.
+ *
+ * \ingroup module_utility
+ */
+class MDLogger
+{
+    public:
+        //! Supported logging levels.
+        enum LogLevel
+        {
+            Warning,
+            Info
+        };
+        //! Number of logging levels.
+        static const int LogLevelCount = static_cast<int>(Info) + 1;
+
+        MDLogger();
+        //! Creates a logger with the given targets.
+        explicit MDLogger(ILogTarget *targets[LogLevelCount]);
+
+        //! For writing at LogLevel::Warning level.
+        LogLevelHelper warning;
+        //! For writing at LogLevel::Info level.
+        LogLevelHelper info;
+};
+
+/*! \brief
+ * Helper to log information using gmx::MDLogger.
+ *
+ * \param  logger  LogLevelHelper instance to use for logging.
+ *
+ * Used as
+ * \code
+   GMX_LOG(logger.warning).appendText(...);
+   \endcode
+ * and ensures that the code to format the output is only executed when the
+ * output goes somewhere.
+ *
+ * See LogEntryWriter for functions that can be used with the macro (such as
+ * the appendText() in the example).
+ *
+ * \ingroup module_utility
+ */
+#define GMX_LOG(logger) \
+    if (::gmx::LogWriteHelper helper = ::gmx::LogWriteHelper(logger)) { } else \
+        helper = ::gmx::LogEntryWriter()
+
+} // namespace gmx
+
+#endif
diff --git a/src/gromacs/utility/loggerbuilder.cpp b/src/gromacs/utility/loggerbuilder.cpp
new file mode 100644 (file)
index 0000000..a5da7d0
--- /dev/null
@@ -0,0 +1,211 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+#include "gmxpre.h"
+
+#include "loggerbuilder.h"
+
+#include <memory>
+#include <vector>
+
+#include "gromacs/utility/filestream.h"
+#include "gromacs/utility/logger.h"
+#include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/textwriter.h"
+
+namespace gmx
+{
+
+class LogTargetCollection : public ILogTarget
+{
+    public:
+        void addTarget(ILogTarget *target)
+        {
+            targets_.push_back(target);
+        }
+
+        virtual void writeEntry(const LogEntry &entry)
+        {
+            for (ILogTarget *target : targets_)
+            {
+                target->writeEntry(entry);
+            }
+        }
+
+    private:
+        std::vector<ILogTarget *> targets_;
+};
+
+class LogTargetFormatter : public ILogTarget
+{
+    public:
+        explicit LogTargetFormatter(TextOutputStream *stream) : writer_(stream) {}
+
+        virtual void writeEntry(const LogEntry &entry);
+
+    private:
+        TextWriter writer_;
+};
+
+
+void LogTargetFormatter::writeEntry(const LogEntry &entry)
+{
+    if (entry.asParagraph)
+    {
+        writer_.ensureEmptyLine();
+    }
+    writer_.writeLine(entry.text);
+    if (entry.asParagraph)
+    {
+        writer_.ensureEmptyLine();
+    }
+}
+
+/********************************************************************
+ * LoggerOwner::Impl
+ */
+
+class LoggerOwner::Impl
+{
+    public:
+        explicit Impl(ILogTarget *loggerTargets[MDLogger::LogLevelCount])
+            : logger_(loggerTargets)
+        {
+        }
+
+        MDLogger                                        logger_;
+        std::vector<std::unique_ptr<TextOutputStream> > streams_;
+        std::vector<std::unique_ptr<ILogTarget> >       targets_;
+};
+
+/********************************************************************
+ * LoggerOwner
+ */
+
+LoggerOwner::LoggerOwner(std::unique_ptr<Impl> impl)
+    : impl_(impl.release()), logger_(&impl_->logger_)
+{
+}
+
+LoggerOwner::LoggerOwner(LoggerOwner &&other)
+    : impl_(std::move(other.impl_)), logger_(&impl_->logger_)
+{
+}
+
+LoggerOwner &LoggerOwner::operator=(LoggerOwner &&other)
+{
+    impl_   = std::move(other.impl_);
+    logger_ = &impl_->logger_;
+    return *this;
+}
+
+LoggerOwner::~LoggerOwner()
+{
+}
+
+/********************************************************************
+ * LoggerBuilder::Impl
+ */
+
+class LoggerBuilder::Impl
+{
+    public:
+        std::vector<std::unique_ptr<TextOutputStream> > streams_;
+        std::vector<std::unique_ptr<ILogTarget> >       targets_;
+        std::vector<ILogTarget *> loggerTargets_[MDLogger::LogLevelCount];
+};
+
+/********************************************************************
+ * LoggerBuilder
+ */
+
+LoggerBuilder::LoggerBuilder()
+    : impl_(new Impl)
+{
+}
+
+LoggerBuilder::~LoggerBuilder()
+{
+}
+
+void LoggerBuilder::addTargetStream(MDLogger::LogLevel level, TextOutputStream *stream)
+{
+    impl_->targets_.push_back(std::unique_ptr<ILogTarget>(new LogTargetFormatter(stream)));
+    ILogTarget *target = impl_->targets_.back().get();
+    for (int i = 0; i <= static_cast<int>(level); ++i)
+    {
+        impl_->loggerTargets_[i].push_back(target);
+    }
+}
+
+void LoggerBuilder::addTargetFile(MDLogger::LogLevel level, FILE *fp)
+{
+    std::unique_ptr<TextOutputStream> stream(new TextOutputFile(fp));
+    addTargetStream(level, stream.get());
+    impl_->streams_.push_back(std::move(stream));
+}
+
+LoggerOwner LoggerBuilder::build()
+{
+    ILogTarget *loggerTargets[MDLogger::LogLevelCount];
+    for (int i = 0; i < MDLogger::LogLevelCount; ++i)
+    {
+        auto &levelTargets = impl_->loggerTargets_[i];
+        loggerTargets[i] = nullptr;
+        if (!levelTargets.empty())
+        {
+            if (levelTargets.size() == 1)
+            {
+                loggerTargets[i] = levelTargets[0];
+            }
+            else
+            {
+                std::unique_ptr<LogTargetCollection> collection(new LogTargetCollection);
+                for (auto &target : levelTargets)
+                {
+                    collection->addTarget(target);
+                }
+                loggerTargets[i] = collection.get();
+                impl_->targets_.push_back(std::move(collection));
+            }
+        }
+        levelTargets.clear();
+    }
+    std::unique_ptr<LoggerOwner::Impl> data(new LoggerOwner::Impl(loggerTargets));
+    data->targets_ = std::move(impl_->targets_);
+    data->streams_ = std::move(impl_->streams_);
+    return LoggerOwner(std::move(data));
+}
+
+} // namespace gmx
diff --git a/src/gromacs/utility/loggerbuilder.h b/src/gromacs/utility/loggerbuilder.h
new file mode 100644 (file)
index 0000000..75ff25f
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares functionality for initializing logging.
+ *
+ * See \ref page_logging for an overview of the functionality.
+ *
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_LOGGERBUILDER_H
+#define GMX_UTILITY_LOGGERBUILDER_H
+
+#include <memory>
+#include <string>
+
+#include "gromacs/utility/classhelpers.h"
+#include "gromacs/utility/logger.h"
+
+namespace gmx
+{
+
+class TextOutputStream;
+
+class LoggerFormatterBuilder;
+class LoggerOwner;
+
+/*! \libinternal \brief
+ * Initializes loggers.
+ *
+ * This class provides methods for specifying logging targets for a logger and
+ * building the logger after all targets have been specified.  Having this
+ * separate from the logger allows using different internal data structures
+ * during initialization and operation, and simplifies the responsibilities of
+ * the involved classes.
+ *
+ * \ingroup module_utility
+ */
+class LoggerBuilder
+{
+    public:
+        LoggerBuilder();
+        ~LoggerBuilder();
+
+        /*! \brief
+         * Adds a stream to which log output is written.
+         *
+         * All output at level \p level or above it is written to \p stream.
+         * The caller is responsible of closing and freeing \p stream once the
+         * logger is discarded.
+         */
+        void addTargetStream(MDLogger::LogLevel level, TextOutputStream *stream);
+        /*! \brief
+         * Adds a file to which log output is written.
+         *
+         * All output at level \p level or above it is written to \p fp.
+         * The caller is responsible of closing \p fp once the logger is
+         * discarded.
+         */
+        void addTargetFile(MDLogger::LogLevel level, FILE *fp);
+
+        /*! \brief
+         * Builds the logger with the targets set for this builder.
+         *
+         * After this function has been called, the builder can (and should) be
+         * discarded.
+         */
+        LoggerOwner build();
+
+    private:
+        class Impl;
+
+        PrivateImplPointer<Impl> impl_;
+};
+
+/*! \libinternal \brief
+ * Manages memory for a logger built with LoggerBuilder.
+ *
+ * This class is responsible of managing all memory allocated by LoggerBuilder
+ * that is needed for operation of the actual logger.  Also the actual logger
+ * instance is owned by this class.  This allows keeing the actual logger simple
+ * and streamlined.
+ *
+ * This class supports move construction and assignment, which allows
+ * initializing it on the stack and assigning a new instance if the targets
+ * need to be changed.
+ *
+ * \ingroup module_utility
+ */
+class LoggerOwner
+{
+    public:
+        //! Move-constructs the owner.
+        LoggerOwner(LoggerOwner &&other);
+        ~LoggerOwner();
+
+        //! Move-assings the owner.
+        LoggerOwner &operator=(LoggerOwner &&other);
+
+        //! Returns the logger for writing the logs.
+        const MDLogger &logger() const { return *logger_; }
+
+    private:
+        class Impl;
+
+        LoggerOwner(std::unique_ptr<Impl> impl);
+
+        PrivateImplPointer<Impl>  impl_;
+        const MDLogger           *logger_;
+
+        friend class LoggerBuilder;
+};
+
+} // namespace gmx
+
+#endif
index 937bb541cb99510b665d0426b72a066b5ff73321..97d2853ec499829435a13cff94ad949b2def908d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2014, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,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.
@@ -71,7 +71,7 @@ MessageStringCollector::~MessageStringCollector()
 
 void MessageStringCollector::startContext(const char *name)
 {
-    impl_->contexts_.push_back(name);
+    impl_->contexts_.emplace_back(name);
 }
 
 void MessageStringCollector::append(const std::string &message)
diff --git a/src/gromacs/utility/niceheader.cpp b/src/gromacs/utility/niceheader.cpp
new file mode 100644 (file)
index 0000000..d1ce031
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Implements functions from niceheader.h.
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ * \ingroup module_utility
+ */
+#include "gmxpre.h"
+
+#include "niceheader.h"
+
+#include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/sysinfo.h"
+#include "gromacs/utility/textwriter.h"
+
+namespace gmx
+{
+
+void niceHeader(TextWriter *writer, const char *fn, char commentChar)
+{
+    int            uid;
+    char           userbuf[256];
+    char           hostbuf[256];
+    char           timebuf[256];
+
+    /* Write a nice header for an output file */
+    writer->writeLine(formatString("%c", commentChar));
+    writer->writeLine(formatString("%c\tFile '%s' was generated", commentChar, fn ? fn : "unknown"));
+
+    uid  = gmx_getuid();
+    gmx_getusername(userbuf, 256);
+    gmx_gethostname(hostbuf, 256);
+    gmx_format_current_time(timebuf, 256);
+
+    writer->writeLine(formatString("%c\tBy user: %s (%d)", commentChar, userbuf, uid));
+    writer->writeLine(formatString("%c\tOn host: %s", commentChar, hostbuf));
+    writer->writeLine(formatString("%c\tAt date: %s", commentChar, timebuf));
+    writer->writeLine(formatString("%c", commentChar));
+}
+
+} // namespace
diff --git a/src/gromacs/utility/niceheader.h b/src/gromacs/utility/niceheader.h
new file mode 100644 (file)
index 0000000..fb72ca8
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares function for printing a nice header for text output files.
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_NICEHEADER_H
+#define GMX_UTILITY_NICEHEADER_H
+
+namespace gmx
+{
+
+class TextWriter;
+
+/*! \brief
+ * Prints creation time stamp and user information into a string as comments, and returns it.
+ *
+ * \param[out] writer         Where to print the information.
+ * \param[in]  fn             Name of the file being written; if nullptr, described as "unknown".
+ * \param[in]  commentChar    Character to use as the starting delimiter for comments.
+ * \throws     std::bad_alloc if out of memory. */
+void niceHeader(TextWriter *writer, const char *fn, char commentChar);
+
+} // namespace
+
+#endif
index c71f4fdb0313d04937e29971ff687f6284ff122a..1bf323f4c28f9349055f4477e520e6cbe54c33b8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,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.
@@ -418,7 +418,7 @@ std::vector<std::string> Path::getExecutablePaths()
     result.push_back("");
 #endif
     const char *path = std::getenv("PATH");
-    if (path != NULL)
+    if (path != nullptr)
     {
         splitPathEnvironment(path, &result);
     }
@@ -481,12 +481,12 @@ void File::throwOnNotFound(const NotFoundInfo &info)
 // static
 bool File::exists(const char *filename, NotFoundHandler onNotFound)
 {
-    if (filename == NULL)
+    if (filename == nullptr)
     {
         return false;
     }
     FILE *test = std::fopen(filename, "r");
-    if (test == NULL)
+    if (test == nullptr)
     {
         const bool   wasError = (errno != ENOENT && errno != ENOTDIR);
         NotFoundInfo info(filename, "The file could not be opened.",
@@ -512,7 +512,7 @@ bool File::exists(const char *filename, NotFoundHandler onNotFound)
         if (!S_ISREG(st_buf.st_mode))
         {
             NotFoundInfo info(filename, "The file is not a regular file.",
-                              NULL, true, 0);
+                              nullptr, true, 0);
             onNotFound(info);
             return false;
         }
index f472f2d15b599e25f86fcb67760e0ebe83307b0a..98c12342e135470f4ce40de75b2207efee547128 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,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.
@@ -366,6 +366,16 @@ void please_cite(FILE *fp, const char *key)
           "GROMACS: High performance molecular simulations through multi-level parallelism from laptops to supercomputers",
           "SoftwareX",
           1, 2015, "19-25" },
+        { "Ballenegger2009",
+          "V. Ballenegger, A. Arnold, J. J. Cerdà",
+          "Simulations of non-neutral slab systems with long-range electrostatic interactions in two-dimensional periodic boundary conditions",
+          "J. Chem. Phys",
+          131, 2009, "094107" },
+        { "Hub2014a",
+          "J. S. Hub, B. L. de Groot, H. Grubmueller, G. Groenhof",
+          "Quantifying Artifacts in Ewald Simulations of Inhomogeneous Systems with a Net Charge",
+          "J. Chem. Theory Comput.",
+          10, 2014, "381-393" },
     };
 #define NSTR (int)asize(citedb)
 
@@ -374,7 +384,7 @@ void please_cite(FILE *fp, const char *key)
     char *title;
 #define LINE_WIDTH 79
 
-    if (fp == NULL)
+    if (fp == nullptr)
     {
         return;
     }
index 4de54036ab0948f8babc697f4be49ebe67a9e5ac..7ec9df222f87731e1f60a13ee3dbd6da77ad5589 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,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.
@@ -88,7 +88,7 @@ const DefaultProgramContext    g_defaultContext;
 
 const IProgramContext &getProgramContext()
 {
-    if (g_programContext != NULL)
+    if (g_programContext != nullptr)
     {
         return *g_programContext;
     }
index 6a63bf225f43857a984686b22a2954ead4c47384..40fc08ae62cb9183df33ca39cff63854d73147b0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,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.
@@ -138,7 +138,7 @@ gmx_qsort(void *           base,
 
     cbase = (char *)base;
 
-    swaptype = (size_t)(cbase - (char *)0) % sizeof(int) || size % sizeof(int) ? 2 : size == sizeof(int) ? 0 : 1;
+    swaptype = (size_t)(cbase - (char *)nullptr) % sizeof(int) || size % sizeof(int) ? 2 : size == sizeof(int) ? 0 : 1;
 
     if (nmemb < 7)
     {
diff --git a/src/gromacs/utility/scoped_cptr.h b/src/gromacs/utility/scoped_cptr.h
deleted file mode 100644 (file)
index 944d2cc..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,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.
- */
-/*! \libinternal \file
- * \brief
- * Declares gmx::scoped_cptr and gmx::scoped_guard_sfree.
- *
- * \author Teemu Murtola <teemu.murtola@gmail.com>
- * \inlibraryapi
- * \ingroup module_utility
- */
-#ifndef GMX_UTILITY_SCOPED_PTR_SFREE_H
-#define GMX_UTILITY_SCOPED_PTR_SFREE_H
-
-#include "gromacs/utility/classhelpers.h"
-#include "gromacs/utility/smalloc.h"
-
-namespace gmx
-{
-
-//! sfree wrapper to be used as scoped_cptr deleter
-template <class T>
-inline void sfree_wrapper(T *p)
-{
-    sfree(p);
-}
-
-/*! \libinternal \brief
- * Stripped-down version of scoped_ptr that uses sfree() or custom deleter.
- *
- * Currently only implements some operations; other operations can be added
- * if they become necessary.
- * The presence of a release() method is not strictly according to `scoped_ptr`
- * design, but makes it easier to make existing C code exception-safe, and does
- * not really warrant a separate class for such a purpose.
- *
- * This class provides a basic guard/smart pointer for C pointers.
- *
- * Methods in this class do not throw.
- *
- * \inlibraryapi
- * \ingroup module_utility
- */
-template <class T, void D(T *) = sfree_wrapper>
-class scoped_cptr
-{
-    public:
-        /*! \brief
-         * Initializes a scoped_cptr that frees \p ptr on scope exit.
-         *
-         * \param[in] ptr  Pointer to use for initialization.
-         */
-        explicit scoped_cptr(T *ptr = NULL) : ptr_(ptr) {}
-        //! Frees the pointer passed to the constructor.
-        ~scoped_cptr() { D(ptr_); }
-        //! Returns the stored pointer.
-        T *get() const { return ptr_; }
-        //! Check for non-null pointer in boolean context.
-        explicit operator bool () const { return ptr_ != 0; }
-        //! Sets the pointer and frees previous pointer if necessary.
-        void reset(T *ptr) { D(ptr_); ptr_ = ptr; }
-        //! Clears the pointer without freeing the memory, and returns the old value.
-        T *release() { T *ptr = ptr_; ptr_ = NULL; return ptr; }
-
-    private:
-        T                    *ptr_;
-
-        GMX_DISALLOW_COPY_AND_ASSIGN(scoped_cptr);
-};
-
-//! Simple guard which calls sfree. See scoped_cptr for details.
-typedef scoped_cptr<void> scoped_guard_sfree;
-
-}      // namespace gmx
-
-#endif
index 2410b22149f63d373f263cdd6b3c71aa23e68bbd..699681faa63f16586b46e7ed31da4554f043cbba 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,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.
@@ -120,14 +120,14 @@ void *save_malloc(const char *name, const char *file, int line, size_t size)
 {
     void *p;
 
-    p = NULL;
+    p = nullptr;
     if (size == 0)
     {
-        p = NULL;
+        p = nullptr;
     }
     else
     {
-        if ((p = malloc(size)) == NULL)
+        if ((p = malloc(size)) == nullptr)
         {
             gmx_fatal(errno, __FILE__, __LINE__,
                       "Not enough memory. Failed to malloc %" GMX_PRId64 " bytes for %s\n"
@@ -147,10 +147,10 @@ void *save_calloc(const char *name, const char *file, int line,
 {
     void *p;
 
-    p = NULL;
+    p = nullptr;
     if ((nelem == 0) || (elsize == 0))
     {
-        p = NULL;
+        p = nullptr;
     }
     else
     {
@@ -176,7 +176,7 @@ void *save_calloc(const char *name, const char *file, int line,
         }
         memset(p, 0, (size_t) (nelem * elsize));
 #else
-        if ((p = calloc((size_t)nelem, (size_t)elsize)) == NULL)
+        if ((p = calloc((size_t)nelem, (size_t)elsize)) == nullptr)
         {
             gmx_fatal(errno, __FILE__, __LINE__,
                       "Not enough memory. Failed to calloc %" GMX_PRId64
@@ -198,7 +198,7 @@ void *save_realloc(const char *name, const char *file, int line, void *ptr,
     void  *p;
     size_t size = nelem*elsize;
 
-    p = NULL;
+    p = nullptr;
     if (size == 0)
     {
         save_free(name, file, line, ptr);
@@ -213,7 +213,7 @@ void *save_realloc(const char *name, const char *file, int line, void *ptr,
                    size/1048576.0, name, file, line, rank);
         }
 #endif
-        if (ptr == NULL)
+        if (ptr == nullptr)
         {
             p = malloc((size_t)size);
         }
@@ -221,7 +221,7 @@ void *save_realloc(const char *name, const char *file, int line, void *ptr,
         {
             p = realloc(ptr, (size_t)size);
         }
-        if (p == NULL)
+        if (p == nullptr)
         {
             gmx_fatal(errno, __FILE__, __LINE__,
                       "Not enough memory. Failed to realloc %" GMX_PRId64 " bytes for %s, %s=%x\n"
@@ -240,7 +240,7 @@ void save_free(const char gmx_unused *name, const char gmx_unused *file, int gmx
 #ifdef DEBUG
     log_action(0, name, file, line, 0, 0, ptr);
 #endif
-    if (ptr != NULL)
+    if (ptr != nullptr)
     {
         free(ptr);
     }
@@ -300,7 +300,7 @@ void *save_calloc_aligned(const char *name, const char *file, int line,
                           size_t nelem, size_t elsize, size_t alignment)
 {
     void *aligned = save_malloc_aligned(name, file, line, nelem, elsize, alignment);
-    if (aligned != NULL)
+    if (aligned != nullptr)
     {
         memset(aligned, 0, (size_t)(nelem * elsize));
     }
diff --git a/src/gromacs/utility/strconvert.cpp b/src/gromacs/utility/strconvert.cpp
new file mode 100644 (file)
index 0000000..f85fcd3
--- /dev/null
@@ -0,0 +1,155 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Implements functions in strconvert.h.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_utility
+ */
+#include "gmxpre.h"
+
+#include "strconvert.h"
+
+#include <cerrno>
+#include <cstdlib>
+
+#include <limits>
+#include <string>
+
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/exceptions.h"
+
+namespace gmx
+{
+
+//! \cond libapi
+
+bool boolFromString(const char *value)
+{
+    if (gmx_strcasecmp(value, "1") == 0
+        || gmx_strcasecmp(value, "yes") == 0
+        || gmx_strcasecmp(value, "true") == 0)
+    {
+        return true;
+    }
+    if (gmx_strcasecmp(value, "0") == 0
+        || gmx_strcasecmp(value, "no") == 0
+        || gmx_strcasecmp(value, "false") == 0)
+    {
+        return false;
+    }
+    GMX_THROW(InvalidInputError("Invalid value: '" + std::string(value) + "'; supported values are: 1, 0, yes, no, true, false"));
+}
+
+int intFromString(const char *str)
+{
+    errno = 0;
+    char           *endptr;
+    const long int  value = std::strtol(str, &endptr, 10);
+    if (errno == ERANGE
+        || value < std::numeric_limits<int>::min()
+        || value > std::numeric_limits<int>::max())
+    {
+        GMX_THROW(InvalidInputError("Invalid value: '" + std::string(str)
+                                    + "'; it causes an integer overflow"));
+    }
+    if (str[0] == '\0' || *endptr != '\0')
+    {
+        GMX_THROW(InvalidInputError("Invalid value: '" + std::string(str)
+                                    + "'; expected an integer"));
+    }
+    return value;
+}
+
+gmx_int64_t int64FromString(const char *str)
+{
+    errno = 0;
+    char              *endptr;
+    const gmx_int64_t  value = str_to_int64_t(str, &endptr);
+    if (errno == ERANGE)
+    {
+        GMX_THROW(InvalidInputError("Invalid value: '" + std::string(str)
+                                    + "'; it causes an integer overflow"));
+    }
+    if (str[0] == '\0' || *endptr != '\0')
+    {
+        GMX_THROW(InvalidInputError("Invalid value: '" + std::string(str)
+                                    + "'; expected an integer"));
+    }
+    return value;
+}
+
+float floatFromString(const char *str)
+{
+    errno = 0;
+    char         *endptr;
+    const double  value = std::strtod(str, &endptr);
+    if (errno == ERANGE
+        || value < -std::numeric_limits<float>::max()
+        || value >  std::numeric_limits<float>::max())
+    {
+        GMX_THROW(InvalidInputError("Invalid value: '" + std::string(str)
+                                    + "'; it causes an overflow/underflow"));
+    }
+    if (str[0] == '\0' || *endptr != '\0')
+    {
+        GMX_THROW(InvalidInputError("Invalid value: '" + std::string(str)
+                                    + "'; expected a number"));
+    }
+    return value;
+}
+
+double doubleFromString(const char *str)
+{
+    errno = 0;
+    char         *endptr;
+    const double  value = std::strtod(str, &endptr);
+    if (errno == ERANGE)
+    {
+        GMX_THROW(InvalidInputError("Invalid value: '" + std::string(str)
+                                    + "'; it causes an overflow/underflow"));
+    }
+    if (str[0] == '\0' || *endptr != '\0')
+    {
+        GMX_THROW(InvalidInputError("Invalid value: '" + std::string(str)
+                                    + "'; expected a number"));
+    }
+    return value;
+}
+
+//! \endcond
+
+} // namespace gmx
diff --git a/src/gromacs/utility/strconvert.h b/src/gromacs/utility/strconvert.h
new file mode 100644 (file)
index 0000000..4b6f13c
--- /dev/null
@@ -0,0 +1,187 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares common utility functions for conversions to and from strings.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_STRCONVERT_H
+#define GMX_UTILITY_STRCONVERT_H
+
+#include <string>
+
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/stringutil.h"
+
+namespace gmx
+{
+
+//! \cond libapi
+//! \addtogroup module_utility
+//! \{
+
+/*! \brief
+ * Parses a boolean from a string.
+ *
+ * \throws  InvalidInputError if `str` is not recognized as a boolean value.
+ */
+bool boolFromString(const char *str);
+/*! \brief
+ * Parses an integer from a string.
+ *
+ * \throws  InvalidInputError if `str` is not a valid integer.
+ *
+ * Also checks for overflow.
+ */
+int intFromString(const char *str);
+/*! \brief
+ * Parses a 64-bit integer from a string.
+ *
+ * \throws  InvalidInputError if `str` is not a valid integer.
+ *
+ * Also checks for overflow.
+ */
+gmx_int64_t int64FromString(const char *str);
+/*! \brief
+ * Parses a float value from a string.
+ *
+ * \throws  InvalidInputError if `str` is not a valid number.
+ *
+ * Also checks for overflow.
+ */
+float floatFromString(const char *str);
+/*! \brief
+ * Parses a double value from a string.
+ *
+ * \throws  InvalidInputError if `str` is not a valid number.
+ *
+ * Also checks for overflow.
+ */
+double doubleFromString(const char *str);
+
+/*! \brief
+ * Parses a value from a string to a given type.
+ *
+ * \tparam T Type of value to parse.
+ *
+ * `T` can only be one of the types that is explicity supported.
+ * The main use for this function is to write `fromString<real>(value)`,
+ * but it can also be used for other types for consistency.
+ */
+template <typename T> static inline T fromString(const char *str);
+//! \copydoc fromString(const char *)
+template <typename T> static inline T fromString(const std::string &str)
+{
+    return fromString<T>(str.c_str());
+}
+/*! \copydoc fromString(const char *)
+ *
+ * Provided for situations where overload resolution cannot easily resolve the
+ * desired std::string parameter.
+ */
+template <typename T> static inline T fromStdString(const std::string &str)
+{
+    return fromString<T>(str.c_str());
+}
+
+//! Implementation for boolean values.
+template <> inline
+bool fromString<bool>(const char *str) { return boolFromString(str); }
+//! Implementation for integer values.
+template <> inline
+int fromString<int>(const char *str) { return intFromString(str); }
+//! Implementation for 64-bit integer values.
+template <> inline
+gmx_int64_t fromString<gmx_int64_t>(const char *str) { return int64FromString(str); }
+//! Implementation for float values.
+template <> inline
+float fromString<float>(const char *str) { return floatFromString(str); }
+//! Implementation for double values.
+template <> inline
+double fromString<double>(const char *str) { return doubleFromString(str); }
+
+/*! \brief
+ * Converts a boolean to a "true"/"false" string.
+ *
+ * Does not throw.
+ */
+static inline const char *boolToString(bool value)
+{
+    return value ? "true" : "false";
+}
+/*! \brief
+ * Returns a string containing the value of \c t.
+ *
+ * \throws std::bad_alloc if out of memory.
+ */
+static inline std::string intToString(int t)
+{
+    return formatString("%d", t);
+}
+//! \copydoc intToString(int)
+static inline std::string int64ToString(gmx_int64_t t)
+{
+    return formatString("%" GMX_PRId64, t);
+}
+//! \copydoc intToString(int)
+static inline std::string doubleToString(double t)
+{
+    return formatString("%g", t);
+}
+
+/*! \name
+ * Overloads for converting a value of a given type to a string.
+ *
+ * \throws std::bad_alloc if out of memory.
+ * \{
+ */
+static inline std::string toString(bool t) { return boolToString(t); }
+static inline std::string toString(int t) { return intToString(t); }
+static inline std::string toString(gmx_int64_t t) { return int64ToString(t); }
+static inline std::string toString(float t) { return doubleToString(t); }
+static inline std::string toString(double t) { return doubleToString(t); }
+static inline std::string toString(std::string t) { return t; }
+//! \}
+
+//! \}
+//! \endcond
+
+} // namespace gmx
+
+#endif
index 0985d3c5bbbb4b353c117abcc2c342173b68dc52..5ea2fa3c1d5226fc1983e6b1e29757159dae5ac1 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,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.
@@ -97,13 +97,13 @@ gmx_bool get_header(char line[], char *header)
 
     std::strcpy(temp, line);
     dum = std::strchr(temp, '[');
-    if (dum == NULL)
+    if (dum == nullptr)
     {
         return FALSE;
     }
     dum[0] = ' ';
     dum    = std::strchr(temp, ']');
-    if (dum == NULL)
+    if (dum == nullptr)
     {
         gmx_fatal(FARGS, "header is not terminated on line:\n'%s'\n", line);
         return FALSE;
@@ -141,7 +141,7 @@ static int fget_lines(FILE *in, const char *db, char ***strings)
     char  *pret;
 
     pret = fgets(buf, STRLEN, in);
-    if (pret == NULL  || sscanf(buf, "%d", &nstr) != 1)
+    if (pret == nullptr  || sscanf(buf, "%d", &nstr) != 1)
     {
         gmx_warning("File is empty");
         gmx_ffclose(in);
diff --git a/src/gromacs/utility/stringcompare.h b/src/gromacs/utility/stringcompare.h
new file mode 100644 (file)
index 0000000..211a4b6
--- /dev/null
@@ -0,0 +1,110 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares utility functionst for string comparison.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_STRINGCOMPARE_H
+#define GMX_UTILITY_STRINGCOMPARE_H
+
+#include <string>
+
+#include "gromacs/utility/cstringutil.h"
+
+namespace gmx
+{
+
+//! \cond libapi
+/*! \brief
+ * Specifies how strings should be compared in various contexts.
+ *
+ * \ingroup module_utility
+ */
+enum class StringCompareType
+{
+    //! Only exact matches are accepted.
+    Exact,
+    //! Case-insensitive comparison.
+    CaseInsensitive,
+    //! Case-insensitive comparison that also ignores '-' and '_'.
+    CaseAndDashInsensitive
+};
+//! \endcond
+
+/*! \libinternal \brief
+ * Compare object for std::string STL containers and algorithms that supports
+ * run-time decision on how to compare.
+ *
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+class StringCompare
+{
+    public:
+        /*! \brief
+         * Creates a comparer with the given type
+         *
+         * This is not explicit, which allows passing \ref StringCompareType
+         * directly to, e.g., `std::map` constructors.
+         */
+        StringCompare(StringCompareType type = StringCompareType::Exact)
+            : type_(type) {}
+
+        //! The comparison operation.
+        bool operator()(const std::string &a, const std::string &b) const
+        {
+            switch (type_)
+            {
+                case StringCompareType::Exact:
+                    return a < b;
+                case StringCompareType::CaseInsensitive:
+                    return gmx_strcasecmp(a.c_str(), b.c_str()) < 0;
+                case StringCompareType::CaseAndDashInsensitive:
+                    return gmx_strcasecmp_min(a.c_str(), b.c_str()) < 0;
+            }
+            return a < b;
+        }
+
+    private:
+        StringCompareType type_;
+};
+
+} // namespace gmx
+
+#endif
index cc3b1bfa3b9928779c80ce1dd4f21360730453ee..386e40aaaf92999a90685bd4918e73d000c4c75c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,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.
 #include <cstring>
 
 #include <algorithm>
+#include <sstream>
 #include <string>
 #include <vector>
 
+#include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
 
 namespace gmx
@@ -105,7 +107,7 @@ bool endsWith(const char *str, const char *suffix)
 
 std::string stripSuffixIfPresent(const std::string &str, const char *suffix)
 {
-    if (suffix != NULL)
+    if (suffix != nullptr)
     {
         size_t suffixLength = std::strlen(suffix);
         if (suffixLength > 0 && endsWith(str, suffix))
@@ -133,7 +135,16 @@ std::string stripString(const std::string &str)
 
 std::string formatString(const char *fmt, ...)
 {
-    va_list           ap;
+    va_list     ap;
+    va_start(ap, fmt);
+    std::string result = formatStringV(fmt, ap);
+    va_end(ap);
+    return result;
+}
+
+std::string formatStringV(const char *fmt, va_list ap)
+{
+    va_list           ap_copy;
     char              staticBuf[1024];
     int               length = 1024;
     std::vector<char> dynamicBuf;
@@ -143,9 +154,9 @@ std::string formatString(const char *fmt, ...)
     // provides their own way of doing things...
     while (1)
     {
-        va_start(ap, fmt);
-        int n = vsnprintf(buf, length, fmt, ap);
-        va_end(ap);
+        va_copy(ap_copy, ap);
+        int n = vsnprintf(buf, length, fmt, ap_copy);
+        va_end(ap_copy);
         if (n > -1 && n < length)
         {
             std::string result(buf);
@@ -182,12 +193,40 @@ std::vector<std::string> splitString(const std::string &str)
         }
         if (startPos != end)
         {
-            result.push_back(std::string(startPos, currPos));
+            result.emplace_back(startPos, currPos);
         }
     }
     return result;
 }
 
+std::vector<std::string> splitDelimitedString(const std::string &str, char delim)
+{
+    std::vector<std::string> result;
+    size_t                   currPos = 0;
+    const size_t             len     = str.length();
+    if (len > 0)
+    {
+        size_t nextDelim;
+        do
+        {
+            nextDelim = str.find(delim, currPos);
+            result.push_back(str.substr(currPos, nextDelim - currPos));
+            currPos = nextDelim < len ? nextDelim + 1 : len;
+        }
+        while (currPos < len || nextDelim < len);
+    }
+    return result;
+}
+
+std::vector<std::string> splitAndTrimDelimitedString(const std::string &str, char delim)
+{
+    std::vector<std::string> result;
+
+    result = splitDelimitedString(str, delim);
+    std::transform(result.begin(), result.end(), result.begin(), stripString);
+    return result;
+}
+
 namespace
 {
 
@@ -219,7 +258,7 @@ std::string
 replaceInternal(const std::string &input, const char *from, const char *to,
                 bool bWholeWords)
 {
-    GMX_RELEASE_ASSERT(from != NULL && to != NULL,
+    GMX_RELEASE_ASSERT(from != nullptr && to != nullptr,
                        "Replacement strings must not be NULL");
     size_t      matchLength = std::strlen(from);
     std::string result;
@@ -324,7 +363,7 @@ TextLineWrapper::findNextLine(const char *input, size_t lineStart) const
     {
         const char *nextBreakPtr = std::strpbrk(input + lineEnd, " \n");
         size_t      nextBreak
-            = (nextBreakPtr != NULL ? nextBreakPtr - input : inputLength);
+            = (nextBreakPtr != nullptr ? nextBreakPtr - input : inputLength);
         if (nextBreak > lastAllowedBreakPoint && lineEnd > lineStart)
         {
             break;
@@ -358,8 +397,15 @@ TextLineWrapper::formatLine(const std::string &input,
     }
     int  indent        = (bFirstLine ? settings_.firstLineIndent() : settings_.indent());
     bool bContinuation = (lineEnd < inputLength && input[lineEnd - 1] != '\n');
-    // Strip trailing whitespace.
-    if (!settings_.bKeepFinalSpaces_ || lineEnd < inputLength || input[inputLength - 1] == '\n')
+    // Remove explicit line breaks in input
+    // (the returned line should not contain line breaks).
+    while (lineEnd > lineStart && input[lineEnd - 1] == '\n')
+    {
+        --lineEnd;
+    }
+    // Strip trailing whitespace, unless they are explicit in the input and it
+    // has been requested to keep them.
+    if (bContinuation || !settings_.bKeepFinalSpaces_)
     {
         while (lineEnd > lineStart && std::isspace(input[lineEnd - 1]))
         {
@@ -417,4 +463,25 @@ TextLineWrapper::wrapToVector(const std::string &input) const
     return result;
 }
 
+std::vector<int> parseDigitsFromString(const std::string &input)
+{
+    std::vector<int>   digits;
+    std::istringstream ss(input);
+    std::string        token;
+    digits.reserve(input.length());
+    token.reserve(input.length());
+    while (std::getline(ss, token, ','))
+    {
+        for (const auto &c : token)
+        {
+            if (std::isdigit(c) == 0)
+            {
+                GMX_THROW(InvalidInputError(formatString("Invalid character in digit-only string: \"%c\"\n", c)));
+            }
+            digits.push_back(c - '0');
+        }
+    }
+    return digits;
+}
+
 } // namespace gmx
index f54aedaa9ebf0b700b632e40e2c7f7ef04414bd2..525037883833fb164fa86e3093db81425055834c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,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.
@@ -43,6 +43,7 @@
 #ifndef GMX_UTILITY_STRINGUTIL_H
 #define GMX_UTILITY_STRINGUTIL_H
 
+#include <cstdarg>
 #include <cstring>
 
 #include <string>
@@ -61,7 +62,7 @@ namespace gmx
  */
 static inline bool isNullOrEmpty(const char *str)
 {
-    return str == NULL || str[0] == '\0';
+    return str == nullptr || str[0] == '\0';
 }
 
 /*! \brief
@@ -167,7 +168,6 @@ std::string stripSuffixIfPresent(const std::string &str, const char *suffix);
  * \throws    std::bad_alloc if out of memory.
  */
 std::string stripString(const std::string &str);
-
 /*! \brief
  * Formats a string (snprintf() wrapper).
  *
@@ -178,6 +178,16 @@ std::string stripString(const std::string &str);
  * supported.
  */
 std::string formatString(const char *fmt, ...);
+/*! \brief
+ * Formats a string (vsnprintf() wrapper).
+ *
+ * \throws  std::bad_alloc if out of memory.
+ *
+ * This function works like vsprintf(), except that it returns an std::string
+ * instead of requiring a preallocated buffer.  Arbitrary length output is
+ * supported.
+ */
+std::string formatStringV(const char *fmt, va_list ap);
 
 /*! \brief Function object that wraps a call to formatString() that
  * expects a single conversion argument, for use with algorithms. */
@@ -310,16 +320,6 @@ std::string joinStrings(const char *const (&array)[count], const char *separator
     return joinStrings(array, array + count, separator);
 }
 
-/*! \brief
- * Converts a boolean to a "true"/"false" string.
- *
- * Does not throw.
- */
-static inline const char *boolToString(bool value)
-{
-    return value ? "true" : "false";
-}
-
 /*! \brief
  * Splits a string to whitespace separated tokens.
  *
@@ -332,6 +332,35 @@ static inline const char *boolToString(bool value)
  * separator.
  */
 std::vector<std::string> splitString(const std::string &str);
+/*! \brief
+ * Splits a string to tokens separated by a given delimiter.
+ *
+ * \param[in] str   String to process.
+ * \param[in] delim Delimiter to use for splitting.
+ * \returns   \p str split into tokens at delimiter.
+ * \throws    std::bad_alloc if out of memory.
+ *
+ * Unlike splitString(), consecutive delimiters will generate empty tokens, as
+ * will leading or trailing delimiters.
+ * Empty input will return an empty vector.
+ */
+std::vector<std::string> splitDelimitedString(const std::string &str, char delim);
+/*! \brief
+ * Splits \c str to tokens separated by delimiter \c delim. Removes
+ * leading and trailing whitespace from those strings with std::isspace.
+ *
+ * \param[in] str   String to process.
+ * \param[in] delim Delimiter to use for splitting.
+ * \returns   \p str split into tokens at delimiter, with whitespace stripped.
+ * \throws    std::bad_alloc if out of memory.
+ *
+ * Unlike splitString(), consecutive delimiters will generate empty tokens, as
+ * will leading or trailing delimiters.
+ * Empty input will return an empty vector.
+ * Input with only whitespace will return a vector of size 1,
+ * that contains an empty token.
+ */
+std::vector<std::string> splitAndTrimDelimitedString(const std::string &str, char delim);
 
 /*! \brief
  * Replace all occurrences of a string with another string.
@@ -657,6 +686,18 @@ class TextLineWrapper
         TextLineWrapperSettings settings_;
 };
 
+/*! \brief Construct a vector of decimal digits parsed from an \c input string.
+ *
+ * \param[in]  input  String that must contain only decimal digits, or only
+ *                    decimal digits separated by comma delimiters.
+ *
+ * \returns           Vector of any digits found in \c input.
+ *
+ * \throws  std::bad_alloc if out of memory
+ *          InvalidInputError if an invalid digit character is found.
+ */
+std::vector<int> parseDigitsFromString(const std::string &input);
+
 //! \}
 
 } // namespace gmx
index 8bcf8b5de0e215b083a7ef6a239770963d5583eb..91fc69cc7764fd55dedb68852090193eb185ef62 100644 (file)
@@ -156,7 +156,7 @@ gmx_ctime_r(const time_t *clock, char *buf, size_t len)
 
 void gmx_format_current_time(char *buf, size_t len)
 {
-    time_t clock = time(NULL);
+    time_t clock = time(nullptr);
     gmx_ctime_r(&clock, buf, len);
 }
 
index 3b3c50a40c4416b065ad87cf2bb8f5a884bdc817..fedb8bb082b024bb4381346dc3c3217ab04ec878 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,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.
@@ -34,8 +34,9 @@
  */
 /*! \libinternal \file
  * \brief
- * Declares functions for obtaining information about the operating environment
- * and the current process.
+ * Declares functions that wrap platform-specific calls for obtaining
+ * information about the operating environment and the current
+ * process.
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \inlibraryapi
 #include <stddef.h>
 #include <time.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /*! \addtogroup module_utility
  * \{
  */
@@ -117,8 +114,4 @@ int gmx_set_nice(int level);
 
 /*! \} */
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif
index 3fe52c713c5b9ec7cccf3a7a04d844df358b757c..57cf2a19f199326019a87d5197a1f361855f8fa5 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,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.
@@ -37,7 +37,13 @@ gmx_add_unit_test(UtilityUnitTests utility-test
                   arrayref.cpp
                   basedefinitions.cpp
                   bitmask32.cpp bitmask64.cpp bitmask128.cpp
+                  keyvaluetreeserializer.cpp
+                  keyvaluetreetransform.cpp
+                  logger.cpp
+                  mutex.cpp
                   path.cpp
                   stringutil.cpp
+                  textreader.cpp
                   textwriter.cpp
+                  typetraits.cpp
                   )
index d7868e2d05dbe0ead9b104609d3aeb816344a8fa..1face9567dcf0b300c4875a7155f8250d3b501e9 100644 (file)
@@ -42,8 +42,6 @@
 
 #include "gromacs/utility/arrayref.h"
 
-#include "config.h"
-
 #include <vector>
 
 #include <gtest/gtest.h>
@@ -217,16 +215,10 @@ struct Helper
  *
  * There, we take a non-const struct-field array of static length and
  * make an ArrayRef to it using the template constructor that is
- * supposed to infer the length from the static size. But on xlc on
- * BlueGene/Q, if the base type is not char (or unsigned char), the
- * generated code ends up with an ArrayRef of zero size, so everything
- * breaks. Presumably the default code path accidentally works for
- * char.
- *
- * Fortunately, all current uses of that constructor have a base type
- * of char, so there's no big problem. Using a pointer-based
- * constructor does work, if there's ever a problem (and that is
- * tested above). */
+ * supposed to infer the length from the static size. This has
+ * been a problem (for a compiler that we no longer support),
+ * so we test it.
+ */
 
 TYPED_TEST(ArrayRefTest, ConstructFromStructFieldWithTemplateConstructorWorks)
 {
@@ -238,12 +230,7 @@ TYPED_TEST(ArrayRefTest, ConstructFromStructFieldWithTemplateConstructorWorks)
         h.a[i] = a[i];
     }
     typename TestFixture::ArrayRefType arrayRef(h.a);
-#if GMX_TARGET_BGQ && defined(__xlC__)
-    if (sizeof(typename TestFixture::ValueType) == sizeof(char))
-#endif
-    {
-        this->runTests(h.a, h.size, h.a, arrayRef);
-    }
+    this->runTests(h.a, h.size, h.a, arrayRef);
 }
 
 #else   // GTEST_HAS_TYPED_TEST
diff --git a/src/gromacs/utility/tests/keyvaluetreeserializer.cpp b/src/gromacs/utility/tests/keyvaluetreeserializer.cpp
new file mode 100644 (file)
index 0000000..ac893f7
--- /dev/null
@@ -0,0 +1,164 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+#include "gmxpre.h"
+
+#include "gromacs/utility/keyvaluetreeserializer.h"
+
+#include <gtest/gtest.h>
+
+#include "gromacs/utility/inmemoryserializer.h"
+#include "gromacs/utility/iserializer.h"
+#include "gromacs/utility/keyvaluetreebuilder.h"
+
+#include "testutils/refdata.h"
+
+namespace
+{
+
+class RefDataSerializer : public gmx::ISerializer
+{
+    public:
+        RefDataSerializer(gmx::test::TestReferenceChecker *parentChecker,
+                          const char                      *id)
+            : checker_(parentChecker->checkCompound("SerializedData", id))
+        {
+        }
+
+        virtual bool reading() const { return false; }
+
+        virtual void doBool(bool *value)
+        {
+            checker_.checkBoolean(*value, nullptr);
+        }
+        virtual void doUChar(unsigned char *value)
+        {
+            checker_.checkUChar(*value, nullptr);
+        }
+        virtual void doInt(int *value)
+        {
+            checker_.checkInteger(*value, nullptr);
+        }
+        virtual void doInt64(gmx_int64_t *value)
+        {
+            checker_.checkInt64(*value, nullptr);
+        }
+        virtual void doFloat(float *value)
+        {
+            checker_.checkFloat(*value, nullptr);
+        }
+        virtual void doDouble(double *value)
+        {
+            checker_.checkDouble(*value, nullptr);
+        }
+        virtual void doString(std::string *value)
+        {
+            checker_.checkString(*value, nullptr);
+        }
+
+    private:
+        gmx::test::TestReferenceChecker checker_;
+};
+
+class KeyValueTreeSerializerTest : public ::testing::Test
+{
+    public:
+        void runTest()
+        {
+            gmx::KeyValueTreeObject           input(builder_.build());
+            gmx::test::TestReferenceData      data;
+            gmx::test::TestReferenceChecker   checker(data.rootChecker());
+            checker.checkKeyValueTreeObject(input, "Input");
+            {
+                RefDataSerializer             serializer(&checker, "Stream");
+                gmx::serializeKeyValueTree(input, &serializer);
+            }
+            std::vector<char>                 buffer = serializeTree(input);
+            {
+                gmx::InMemoryDeserializer     deserializer(buffer);
+                gmx::KeyValueTreeObject       output
+                    = gmx::deserializeKeyValueTree(&deserializer);
+                checker.checkKeyValueTreeObject(output, "Input");
+            }
+        }
+
+        gmx::KeyValueTreeBuilder builder_;
+
+    private:
+        std::vector<char> serializeTree(const gmx::KeyValueTreeObject &tree)
+        {
+            gmx::InMemorySerializer serializer;
+            gmx::serializeKeyValueTree(tree, &serializer);
+            return serializer.finishAndGetBuffer();
+        }
+};
+
+TEST_F(KeyValueTreeSerializerTest, EmptyTree)
+{
+    runTest();
+}
+
+TEST_F(KeyValueTreeSerializerTest, SimpleObject)
+{
+    builder_.rootObject().addValue<int>("foo", 1);
+    builder_.rootObject().addValue<std::string>("bar", "a");
+    builder_.rootObject().addValue<float>("f", 1.5);
+    builder_.rootObject().addValue<double>("d", 2.5);
+    runTest();
+}
+
+TEST_F(KeyValueTreeSerializerTest, ObjectWithArrays)
+{
+    auto arr1 = builder_.rootObject().addUniformArray<int>("a");
+    arr1.addValue(1);
+    arr1.addValue(2);
+    auto arr2 = builder_.rootObject().addUniformArray<std::string>("b");
+    arr2.addValue("foo");
+    arr2.addValue("bar");
+    runTest();
+}
+
+TEST_F(KeyValueTreeSerializerTest, ObjectWithObjects)
+{
+    auto obj1 = builder_.rootObject().addObject("obj");
+    obj1.addValue<int>("a", 1);
+    obj1.addValue<std::string>("b", "foo");
+    auto obj2 = builder_.rootObject().addObject("obj2");
+    obj2.addValue<int>("c", 2);
+    obj2.addValue<std::string>("d", "bar");
+    builder_.rootObject().addValue<int>("foo", 3);
+    runTest();
+}
+
+} // namespace
diff --git a/src/gromacs/utility/tests/keyvaluetreetransform.cpp b/src/gromacs/utility/tests/keyvaluetreetransform.cpp
new file mode 100644 (file)
index 0000000..c512cf6
--- /dev/null
@@ -0,0 +1,238 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+#include "gmxpre.h"
+
+#include "gromacs/utility/keyvaluetreetransform.h"
+
+#include <string>
+#include <vector>
+
+#include <gtest/gtest.h>
+
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/keyvaluetree.h"
+#include "gromacs/utility/keyvaluetreebuilder.h"
+#include "gromacs/utility/strconvert.h"
+#include "gromacs/utility/stringcompare.h"
+#include "gromacs/utility/stringutil.h"
+
+#include "testutils/refdata.h"
+#include "testutils/testasserts.h"
+
+namespace
+{
+
+class TreeValueTransformTest : public ::testing::Test
+{
+    public:
+        void testTransform(const gmx::KeyValueTreeObject      &input,
+                           const gmx::KeyValueTreeTransformer &transform)
+        {
+            gmx::KeyValueTreeTransformResult  result = transform.transform(input, nullptr);
+            gmx::KeyValueTreeObject           object = result.object();
+
+            gmx::test::TestReferenceData      data;
+            gmx::test::TestReferenceChecker   checker(data.rootChecker());
+            checker.checkKeyValueTreeObject(input, "Input");
+            auto mappedPaths = transform.mappedPaths();
+            checker.checkSequence(mappedPaths.begin(), mappedPaths.end(), "MappedPaths",
+                                  &TreeValueTransformTest::checkMappedPath);
+            checker.checkKeyValueTreeObject(object, "Tree");
+            checkBackMapping(&checker, object, result.backMapping());
+        }
+
+    private:
+        static void checkMappedPath(gmx::test::TestReferenceChecker *checker,
+                                    const gmx::KeyValueTreePath     &path)
+        {
+            checker->checkString(path.toString(), nullptr);
+        }
+        void checkBackMapping(gmx::test::TestReferenceChecker     *checker,
+                              const gmx::KeyValueTreeObject       &object,
+                              const gmx::IKeyValueTreeBackMapping &mapping)
+        {
+            auto compound(checker->checkCompound("BackMapping", "Mapping"));
+            checkBackMappingImpl(&compound, object, mapping, gmx::KeyValueTreePath());
+        }
+
+        void checkBackMappingImpl(gmx::test::TestReferenceChecker     *checker,
+                                  const gmx::KeyValueTreeObject       &object,
+                                  const gmx::IKeyValueTreeBackMapping &mapping,
+                                  const gmx::KeyValueTreePath         &prefix)
+        {
+            for (const auto &prop : object.properties())
+            {
+                gmx::KeyValueTreePath path = prefix;
+                path.append(prop.key());
+                if (prop.value().isObject())
+                {
+                    checkBackMappingImpl(checker, prop.value().asObject(), mapping, path);
+                }
+                else
+                {
+                    gmx::KeyValueTreePath orgPath = mapping.originalPath(path);
+                    checker->checkString(orgPath.toString(), path.toString().c_str());
+                }
+            }
+        }
+};
+
+TEST_F(TreeValueTransformTest, SimpleTransforms)
+{
+    gmx::KeyValueTreeBuilder     builder;
+    builder.rootObject().addValue<std::string>("a", "1");
+    builder.rootObject().addValue<std::string>("b", "2");
+    gmx::KeyValueTreeObject      input = builder.build();
+
+    gmx::KeyValueTreeTransformer transform;
+    transform.rules()->addRule()
+        .from<std::string>("/a").to<int>("/i").transformWith(&gmx::fromStdString<int>);
+    transform.rules()->addRule()
+        .from<std::string>("/b").to<int>("/j").transformWith(&gmx::fromStdString<int>);
+
+    testTransform(input, transform);
+}
+
+TEST_F(TreeValueTransformTest, SimpleTransformsCaseAndDashInsensitive)
+{
+    gmx::KeyValueTreeBuilder     builder;
+    builder.rootObject().addValue<std::string>("a-x", "1");
+    builder.rootObject().addValue<std::string>("by", "2");
+    gmx::KeyValueTreeObject      input = builder.build();
+
+    gmx::KeyValueTreeTransformer transform;
+    transform.rules()->addRule()
+        .keyMatchType("/", gmx::StringCompareType::CaseAndDashInsensitive);
+    transform.rules()->addRule()
+        .from<std::string>("/Ax").to<int>("/i").transformWith(&gmx::fromStdString<int>);
+    transform.rules()->addRule()
+        .from<std::string>("/B-Y").to<int>("/j").transformWith(&gmx::fromStdString<int>);
+
+    testTransform(input, transform);
+}
+
+TEST_F(TreeValueTransformTest, SimpleTransformsToObject)
+{
+    gmx::KeyValueTreeBuilder     builder;
+    builder.rootObject().addValue<std::string>("a", "1");
+    builder.rootObject().addValue<std::string>("b", "2");
+    gmx::KeyValueTreeObject      input = builder.build();
+
+    gmx::KeyValueTreeTransformer transform;
+    transform.rules()->addRule()
+        .from<std::string>("/a").to<int>("/foo/i").transformWith(&gmx::fromStdString<int>);
+    transform.rules()->addRule()
+        .from<std::string>("/b").to<int>("/foo/j").transformWith(&gmx::fromStdString<int>);
+
+    testTransform(input, transform);
+}
+
+
+TEST_F(TreeValueTransformTest, ObjectFromString)
+{
+    gmx::KeyValueTreeBuilder     builder;
+    builder.rootObject().addValue<std::string>("a", "1 2");
+    gmx::KeyValueTreeObject      input = builder.build();
+
+    gmx::KeyValueTreeTransformer transform;
+    transform.rules()->addRule()
+        .from<std::string>("/a").toObject("/foo").transformWith(
+            [] (gmx::KeyValueTreeObjectBuilder *builder, const std::string &value)
+            {
+                std::vector<std::string> values = gmx::splitString(value);
+                builder->addValue<int>("a", gmx::fromString<int>(values[0]));
+                builder->addValue<int>("b", gmx::fromString<int>(values[1]));
+            });
+
+    testTransform(input, transform);
+}
+
+TEST_F(TreeValueTransformTest, ObjectFromMultipleStrings)
+{
+    gmx::KeyValueTreeBuilder     builder;
+    builder.rootObject().addValue<std::string>("a", "1");
+    builder.rootObject().addValue<std::string>("b", "2 3");
+    gmx::KeyValueTreeObject      input = builder.build();
+
+    gmx::KeyValueTreeTransformer transform;
+    transform.rules()->addRule()
+        .from<std::string>("/a").to<int>("/foo/a").transformWith(&gmx::fromStdString<int>);
+    transform.rules()->addRule()
+        .from<std::string>("/b").toObject("/foo").transformWith(
+            [] (gmx::KeyValueTreeObjectBuilder *builder, const std::string &value)
+            {
+                std::vector<std::string> values = gmx::splitString(value);
+                builder->addValue<int>("b", gmx::fromString<int>(values[0]));
+                builder->addValue<int>("c", gmx::fromString<int>(values[1]));
+            });
+
+    testTransform(input, transform);
+}
+
+TEST_F(TreeValueTransformTest, ScopedTransformRules)
+{
+    gmx::KeyValueTreeBuilder     builder;
+    builder.rootObject().addValue<std::string>("a", "1");
+    builder.rootObject().addValue<std::string>("b", "2");
+    gmx::KeyValueTreeObject      input = builder.build();
+
+    gmx::KeyValueTreeTransformer transform;
+    auto                         scope = transform.rules()->scopedTransform("/foo");
+    scope.rules()->addRule()
+        .from<std::string>("/a").to<int>("/i").transformWith(&gmx::fromStdString<int>);
+    scope.rules()->addRule()
+        .from<std::string>("/b").to<int>("/j").transformWith(&gmx::fromStdString<int>);
+
+    testTransform(input, transform);
+}
+
+/********************************************************************
+ * Tests for errors
+ */
+
+TEST(TreeValueTransformErrorTest, ConversionError)
+{
+    gmx::KeyValueTreeBuilder     builder;
+    builder.rootObject().addValue<std::string>("a", "foo");
+    gmx::KeyValueTreeObject      input = builder.build();
+
+    gmx::KeyValueTreeTransformer transform;
+    transform.rules()->addRule()
+        .from<std::string>("/a").to<int>("/i").transformWith(&gmx::fromStdString<int>);
+
+    EXPECT_THROW_GMX(transform.transform(input, nullptr), gmx::InvalidInputError);
+}
+
+} // namespace
diff --git a/src/gromacs/utility/tests/logger.cpp b/src/gromacs/utility/tests/logger.cpp
new file mode 100644 (file)
index 0000000..3385ab4
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+#include "gmxpre.h"
+
+#include "gromacs/utility/logger.h"
+
+#include <gtest/gtest.h>
+
+#include "gromacs/utility/loggerbuilder.h"
+#include "gromacs/utility/stringstream.h"
+
+#include "testutils/stringtest.h"
+#include "testutils/testfilemanager.h"
+
+namespace
+{
+
+//! Test fixture for logging tests.
+typedef gmx::test::StringTestBase LoggerTest;
+
+TEST_F(LoggerTest, EmptyLoggerWorks)
+{
+    gmx::MDLogger logger;
+    GMX_LOG(logger.info).appendText("foobar");
+    GMX_LOG(logger.warning).appendText("foobar").asParagraph();
+}
+
+TEST_F(LoggerTest, LogsToStream)
+{
+    gmx::StringOutputStream stream;
+    gmx::LoggerBuilder      builder;
+    builder.addTargetStream(gmx::MDLogger::LogLevel::Info, &stream);
+    gmx::LoggerOwner        owner  = builder.build();
+    const gmx::MDLogger    &logger = owner.logger();
+    GMX_LOG(logger.info).appendText("line");
+    GMX_LOG(logger.warning).appendText("par").asParagraph();
+    GMX_LOG(logger.info).appendText("line2");
+    checkText(stream.toString(), "Output");
+}
+
+TEST_F(LoggerTest, LogsToFile)
+{
+    gmx::test::TestFileManager files;
+    std::string                filename(files.getTemporaryFilePath("log.txt"));
+    FILE                      *fp = fopen(filename.c_str(), "w");
+    {
+        gmx::LoggerBuilder      builder;
+        builder.addTargetFile(gmx::MDLogger::LogLevel::Info, fp);
+        gmx::LoggerOwner        owner  = builder.build();
+        const gmx::MDLogger    &logger = owner.logger();
+        GMX_LOG(logger.info).appendText("line");
+        GMX_LOG(logger.warning).appendText("par").asParagraph();
+        GMX_LOG(logger.info).appendText("line2");
+    }
+    fclose(fp);
+    checkFileContents(filename, "Output");
+}
+
+TEST_F(LoggerTest, LevelFilteringWorks)
+{
+    gmx::StringOutputStream stream;
+    gmx::LoggerBuilder      builder;
+    builder.addTargetStream(gmx::MDLogger::LogLevel::Warning, &stream);
+    gmx::LoggerOwner        owner  = builder.build();
+    const gmx::MDLogger    &logger = owner.logger();
+    GMX_LOG(logger.info).appendText("line");
+    GMX_LOG(logger.warning).appendText("par").asParagraph();
+    GMX_LOG(logger.info).appendText("line2");
+    checkText(stream.toString(), "Output");
+}
+
+TEST_F(LoggerTest, LogsToMultipleStreams)
+{
+    gmx::StringOutputStream stream1;
+    gmx::StringOutputStream stream2;
+    gmx::LoggerBuilder      builder;
+    builder.addTargetStream(gmx::MDLogger::LogLevel::Info, &stream1);
+    builder.addTargetStream(gmx::MDLogger::LogLevel::Warning, &stream2);
+    gmx::LoggerOwner        owner  = builder.build();
+    const gmx::MDLogger    &logger = owner.logger();
+    GMX_LOG(logger.info).appendText("line");
+    GMX_LOG(logger.warning).appendText("par").asParagraph();
+    GMX_LOG(logger.info).appendText("line2");
+    checkText(stream1.toString(), "Output1");
+    checkText(stream2.toString(), "Output2");
+}
+
+} // namespace
diff --git a/src/gromacs/utility/tests/mutex.cpp b/src/gromacs/utility/tests/mutex.cpp
new file mode 100644 (file)
index 0000000..45f2226
--- /dev/null
@@ -0,0 +1,244 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief Tests for gmx::Mutex
+ *
+ * These tests ensure that basic mutual-exclusion properties hold.
+ * Note that no testing can prove there isn't a bug, but if one
+ * exists, then these tests might expose one.
+ *
+ * In particular, try_lock can be implemented differently on different
+ * platforms, or with different default mutex types, so we should
+ * check that the behaviour continues to conform with the thread-MPI
+ * documentation.
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ * \ingroup module_utility
+ */
+
+#include "gmxpre.h"
+
+#include "gromacs/utility/mutex.h"
+
+#include "config.h"
+
+#include <future>
+#include <gtest/gtest.h>
+
+
+namespace gmx
+{
+namespace test
+{
+namespace
+{
+
+//! Convenience definition.
+using Lock = gmx::lock_guard<Mutex>;
+
+TEST(MutexBasicTest, CanBeMade)
+{
+    Mutex m;
+}
+
+TEST(MutexBasicTest, CanBeLocked)
+{
+    Mutex m;
+    ASSERT_NO_THROW(m.lock());
+    m.unlock();
+}
+
+TEST(MutexBasicTest, CanBeTryLocked)
+{
+    Mutex m;
+    ASSERT_TRUE(m.try_lock());
+    m.unlock();
+}
+
+TEST(MutexBasicTest, CanBeUsedInLockGuard)
+{
+    Mutex m;
+    Lock  g(m);
+}
+
+//! A shared value for a mutex to protect
+static int   g_sharedValue;
+//! A mutex to protect a shared value
+static Mutex g_sharedValueMutex;
+
+//! Function type for asynchronous tasks.
+using TaskType = std::function<int(void)>;
+
+//! A task that just does work.
+int updateSharedValue()
+{
+    return ++g_sharedValue;
+}
+
+//! A task that does work after it gets the mutex.
+int updateSharedValueWithLock()
+{
+    Lock guard(g_sharedValueMutex);
+    return updateSharedValue();
+}
+
+//! A task that does work only if it can get the mutex immediately.
+int updateSharedValueWithTryLock()
+{
+    // Special return value to signal when work was not done because
+    // the lock was not acquired.
+    int result = -1;
+    if (g_sharedValueMutex.try_lock())
+    {
+        result = updateSharedValue();
+        g_sharedValueMutex.unlock();
+    }
+    return result;
+}
+
+/*! \brief Parameterized test fixture.
+ *
+ * Checks that different launch policies work. In further tests of
+ * mutual exclusion, we need to specify std::thread::async, to require
+ * that a thread actually launched. The default policy permits the
+ * std:: implementation to avoid launching a thread, and at least the
+ * behaviour of thread-MPI try_lock also varies with the threading
+ * implementation underlying it. */
+class DifferentTasksTest : public ::testing::TestWithParam<TaskType>
+{
+    public:
+        //! Constructor
+        DifferentTasksTest()
+        {
+            g_sharedValue = 0;
+        }
+        //! Check the results
+        void checkResults()
+        {
+            int result;
+            EXPECT_NO_THROW(result = futureResult_.get()) << "Future should not contain an exception";
+            EXPECT_EQ(1, result) << "Task should have run";
+            EXPECT_EQ(1, g_sharedValue) << "Shared value should be updated";
+        }
+        //! Contains the result the task returns.
+        std::future<int> futureResult_;
+};
+
+TEST_P(DifferentTasksTest, StdAsyncWorksWithDefaultPolicy)
+{
+    auto task = GetParam();
+    EXPECT_NO_THROW(futureResult_ = std::async(task)) << "Async should succeed";
+    checkResults();
+}
+
+TEST_P(DifferentTasksTest, StdAsyncWorksWithAsyncLaunchPolicy)
+{
+    auto task = GetParam();
+    EXPECT_NO_THROW(futureResult_ = std::async(std::launch::async, task)) << "Async should succeed";
+    checkResults();
+}
+
+TEST_P(DifferentTasksTest, StdAsyncWorksWithDeferredLaunchPolicy)
+{
+    auto task = GetParam();
+    EXPECT_NO_THROW(futureResult_ = std::async(std::launch::deferred, task)) << "Async should succeed";
+    checkResults();
+}
+
+// Test that the different launch policies work with the different tasks
+INSTANTIATE_TEST_CASE_P(WithAndWithoutMutex, DifferentTasksTest, ::testing::Values(updateSharedValue, updateSharedValueWithLock, updateSharedValueWithTryLock));
+
+TEST(MutexTaskTest, MutualExclusionWorksWithLock)
+{
+    g_sharedValue = 0;
+    std::future<int> result;
+    {
+        // Hold the mutex, launch a lock attempt on another
+        // thread, check that the shared value isn't changed, then
+        // release the mutex by leaving the scope, after which the
+        // other thread's lock can get the mutex.
+        Lock guard(g_sharedValueMutex);
+        result = std::async(std::launch::async, updateSharedValueWithLock);
+        EXPECT_EQ(0, g_sharedValue) << "Task should not have run yet";
+    }
+    EXPECT_EQ(1, result.get()) << "Task should have run";
+    EXPECT_EQ(1, g_sharedValue) << "Shared value should be updated";
+}
+
+TEST(MutexTaskTest, MutualExclusionWorksWithTryLockOnOtherThread)
+{
+    g_sharedValue = 0;
+    {
+        // Hold the mutex, launch a try_lock attempt on another
+        // thread, check that the shared value isn't changed, then
+        // make sure the try_lock attempt has returned, double check
+        // that the shared value isn't changed, and release the mutex
+        // by leaving the scope.
+        Lock guard(g_sharedValueMutex);
+        auto result = std::async(std::launch::async, updateSharedValueWithTryLock);
+        EXPECT_EQ(0, g_sharedValue) << "Data race detected";
+        EXPECT_EQ(-1, result.get()) << "The try_lock should fail";
+        EXPECT_EQ(0, g_sharedValue) << "Task should not have run";
+    }
+    EXPECT_EQ(0, g_sharedValue) << "Mutex release can't affect the protected value";
+}
+
+TEST(MutexTaskTest, MutualExclusionWorksWithTryLockOnSameThread)
+{
+    g_sharedValue = 0;
+    int finalSharedValue = GMX_NATIVE_WINDOWS ? 1 : 0;
+    {
+        // Hold the mutex and launch a try_lock attempt on this
+        // thread. Behaviour then varies with the implementation
+        // underlying thread-MPI.
+        Lock guard(g_sharedValueMutex);
+        int  result = updateSharedValueWithTryLock();
+        if (GMX_NATIVE_WINDOWS)
+        {
+            EXPECT_EQ(1, result) << "The try_lock should succeed";
+            EXPECT_EQ(finalSharedValue, g_sharedValue) << "Task should have run";
+        }
+        else
+        {
+            EXPECT_EQ(-1, result) << "The try_lock should fail";
+            EXPECT_EQ(finalSharedValue, g_sharedValue) << "Task should not have run";
+        }
+    }
+    EXPECT_EQ(finalSharedValue, g_sharedValue) << "Mutex release can't affect the protected value";
+}
+
+} // namespace
+} // namespace
+} // namespace
diff --git a/src/gromacs/utility/tests/refdata/KeyValueTreeSerializerTest_EmptyTree.xml b/src/gromacs/utility/tests/refdata/KeyValueTreeSerializerTest_EmptyTree.xml
new file mode 100644 (file)
index 0000000..0fe3670
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Object Name="Input"></Object>
+  <SerializedData Name="Stream">
+    <Int>0</Int>
+  </SerializedData>
+</ReferenceData>
diff --git a/src/gromacs/utility/tests/refdata/KeyValueTreeSerializerTest_ObjectWithArrays.xml b/src/gromacs/utility/tests/refdata/KeyValueTreeSerializerTest_ObjectWithArrays.xml
new file mode 100644 (file)
index 0000000..6e809da
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Object Name="Input">
+    <Sequence Name="a">
+      <Int Name="Length">2</Int>
+      <Int>1</Int>
+      <Int>2</Int>
+    </Sequence>
+    <Sequence Name="b">
+      <Int Name="Length">2</Int>
+      <String>foo</String>
+      <String>bar</String>
+    </Sequence>
+  </Object>
+  <SerializedData Name="Stream">
+    <Int>2</Int>
+    <String>a</String>
+    <UChar>65</UChar>
+    <Int>2</Int>
+    <UChar>105</UChar>
+    <Int>1</Int>
+    <UChar>105</UChar>
+    <Int>2</Int>
+    <String>b</String>
+    <UChar>65</UChar>
+    <Int>2</Int>
+    <UChar>115</UChar>
+    <String>foo</String>
+    <UChar>115</UChar>
+    <String>bar</String>
+  </SerializedData>
+</ReferenceData>
diff --git a/src/gromacs/utility/tests/refdata/KeyValueTreeSerializerTest_ObjectWithObjects.xml b/src/gromacs/utility/tests/refdata/KeyValueTreeSerializerTest_ObjectWithObjects.xml
new file mode 100644 (file)
index 0000000..f7eeb51
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Object Name="Input">
+    <Object Name="obj">
+      <Int Name="a">1</Int>
+      <String Name="b">foo</String>
+    </Object>
+    <Object Name="obj2">
+      <Int Name="c">2</Int>
+      <String Name="d">bar</String>
+    </Object>
+    <Int Name="foo">3</Int>
+  </Object>
+  <SerializedData Name="Stream">
+    <Int>3</Int>
+    <String>obj</String>
+    <UChar>79</UChar>
+    <Int>2</Int>
+    <String>a</String>
+    <UChar>105</UChar>
+    <Int>1</Int>
+    <String>b</String>
+    <UChar>115</UChar>
+    <String>foo</String>
+    <String>obj2</String>
+    <UChar>79</UChar>
+    <Int>2</Int>
+    <String>c</String>
+    <UChar>105</UChar>
+    <Int>2</Int>
+    <String>d</String>
+    <UChar>115</UChar>
+    <String>bar</String>
+    <String>foo</String>
+    <UChar>105</UChar>
+    <Int>3</Int>
+  </SerializedData>
+</ReferenceData>
diff --git a/src/gromacs/utility/tests/refdata/KeyValueTreeSerializerTest_SimpleObject.xml b/src/gromacs/utility/tests/refdata/KeyValueTreeSerializerTest_SimpleObject.xml
new file mode 100644 (file)
index 0000000..5e7a62f
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Object Name="Input">
+    <Int Name="foo">1</Int>
+    <String Name="bar">a</String>
+    <Real Name="f">1.5</Real>
+    <Real Name="d">2.5</Real>
+  </Object>
+  <SerializedData Name="Stream">
+    <Int>4</Int>
+    <String>foo</String>
+    <UChar>105</UChar>
+    <Int>1</Int>
+    <String>bar</String>
+    <UChar>115</UChar>
+    <String>a</String>
+    <String>f</String>
+    <UChar>102</UChar>
+    <Real>1.5</Real>
+    <String>d</String>
+    <UChar>100</UChar>
+    <Real>2.5</Real>
+  </SerializedData>
+</ReferenceData>
diff --git a/src/gromacs/utility/tests/refdata/LoggerTest_LevelFilteringWorks.xml b/src/gromacs/utility/tests/refdata/LoggerTest_LevelFilteringWorks.xml
new file mode 100644 (file)
index 0000000..fac25be
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="Output"><![CDATA[
+par
+]]></String>
+</ReferenceData>
diff --git a/src/gromacs/utility/tests/refdata/LoggerTest_LogsToFile.xml b/src/gromacs/utility/tests/refdata/LoggerTest_LogsToFile.xml
new file mode 100644 (file)
index 0000000..79dfcd4
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="Output"><![CDATA[
+line
+
+par
+
+line2
+]]></String>
+</ReferenceData>
diff --git a/src/gromacs/utility/tests/refdata/LoggerTest_LogsToMultipleStreams.xml b/src/gromacs/utility/tests/refdata/LoggerTest_LogsToMultipleStreams.xml
new file mode 100644 (file)
index 0000000..9a7bee1
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="Output1"><![CDATA[
+line
+
+par
+
+line2
+]]></String>
+  <String Name="Output2"><![CDATA[
+par
+]]></String>
+</ReferenceData>
diff --git a/src/gromacs/utility/tests/refdata/LoggerTest_LogsToStream.xml b/src/gromacs/utility/tests/refdata/LoggerTest_LogsToStream.xml
new file mode 100644 (file)
index 0000000..79dfcd4
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="Output"><![CDATA[
+line
+
+par
+
+line2
+]]></String>
+</ReferenceData>
index 1bb9fb422799f30449e826cc210bca64490a9c0a..2a303ac9fc073eb7b97e1fe703964e1f167ad8b0 100644 (file)
@@ -5,5 +5,10 @@
  A quick brown
 fox jumps
  over the lazy
+dog]]></String>
+  <String Name="WrappedAt14WithTrailingWhitespace"><![CDATA[
+ A quick brown
+fox jumps  
+ over the lazy
 dog]]></String>
 </ReferenceData>
diff --git a/src/gromacs/utility/tests/refdata/TextWriterTest_PreservesTrailingWhitespace.xml b/src/gromacs/utility/tests/refdata/TextWriterTest_PreservesTrailingWhitespace.xml
new file mode 100644 (file)
index 0000000..b947fb7
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="Output"><![CDATA[
+Line   
+Line   
+Line   
+Line   
+Line   
+Line   
+]]></String>
+</ReferenceData>
diff --git a/src/gromacs/utility/tests/refdata/TreeValueTransformTest_ObjectFromMultipleStrings.xml b/src/gromacs/utility/tests/refdata/TreeValueTransformTest_ObjectFromMultipleStrings.xml
new file mode 100644 (file)
index 0000000..2815bdb
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Object Name="Input">
+    <String Name="a">1</String>
+    <String Name="b">2 3</String>
+  </Object>
+  <Sequence Name="MappedPaths">
+    <Int Name="Length">2</Int>
+    <String>/a</String>
+    <String>/b</String>
+  </Sequence>
+  <Object Name="Tree">
+    <Object Name="foo">
+      <Int Name="a">1</Int>
+      <Int Name="b">2</Int>
+      <Int Name="c">3</Int>
+    </Object>
+  </Object>
+  <BackMapping Name="Mapping">
+    <String Name="/foo/a">/a</String>
+    <String Name="/foo/b">/b</String>
+    <String Name="/foo/c">/b</String>
+  </BackMapping>
+</ReferenceData>
diff --git a/src/gromacs/utility/tests/refdata/TreeValueTransformTest_ObjectFromString.xml b/src/gromacs/utility/tests/refdata/TreeValueTransformTest_ObjectFromString.xml
new file mode 100644 (file)
index 0000000..0f0dac9
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Object Name="Input">
+    <String Name="a">1 2</String>
+  </Object>
+  <Sequence Name="MappedPaths">
+    <Int Name="Length">1</Int>
+    <String>/a</String>
+  </Sequence>
+  <Object Name="Tree">
+    <Object Name="foo">
+      <Int Name="a">1</Int>
+      <Int Name="b">2</Int>
+    </Object>
+  </Object>
+  <BackMapping Name="Mapping">
+    <String Name="/foo/a">/a</String>
+    <String Name="/foo/b">/a</String>
+  </BackMapping>
+</ReferenceData>
diff --git a/src/gromacs/utility/tests/refdata/TreeValueTransformTest_ScopedTransformRules.xml b/src/gromacs/utility/tests/refdata/TreeValueTransformTest_ScopedTransformRules.xml
new file mode 100644 (file)
index 0000000..603fd2b
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Object Name="Input">
+    <String Name="a">1</String>
+    <String Name="b">2</String>
+  </Object>
+  <Sequence Name="MappedPaths">
+    <Int Name="Length">2</Int>
+    <String>/a</String>
+    <String>/b</String>
+  </Sequence>
+  <Object Name="Tree">
+    <Object Name="foo">
+      <Int Name="i">1</Int>
+      <Int Name="j">2</Int>
+    </Object>
+  </Object>
+  <BackMapping Name="Mapping">
+    <String Name="/foo/i">/a</String>
+    <String Name="/foo/j">/b</String>
+  </BackMapping>
+</ReferenceData>
diff --git a/src/gromacs/utility/tests/refdata/TreeValueTransformTest_SimpleTransforms.xml b/src/gromacs/utility/tests/refdata/TreeValueTransformTest_SimpleTransforms.xml
new file mode 100644 (file)
index 0000000..1fecf83
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Object Name="Input">
+    <String Name="a">1</String>
+    <String Name="b">2</String>
+  </Object>
+  <Sequence Name="MappedPaths">
+    <Int Name="Length">2</Int>
+    <String>/a</String>
+    <String>/b</String>
+  </Sequence>
+  <Object Name="Tree">
+    <Int Name="i">1</Int>
+    <Int Name="j">2</Int>
+  </Object>
+  <BackMapping Name="Mapping">
+    <String Name="/i">/a</String>
+    <String Name="/j">/b</String>
+  </BackMapping>
+</ReferenceData>
diff --git a/src/gromacs/utility/tests/refdata/TreeValueTransformTest_SimpleTransformsCaseAndDashInsensitive.xml b/src/gromacs/utility/tests/refdata/TreeValueTransformTest_SimpleTransformsCaseAndDashInsensitive.xml
new file mode 100644 (file)
index 0000000..3e4ae5e
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Object Name="Input">
+    <String Name="a-x">1</String>
+    <String Name="by">2</String>
+  </Object>
+  <Sequence Name="MappedPaths">
+    <Int Name="Length">2</Int>
+    <String>/Ax</String>
+    <String>/B-Y</String>
+  </Sequence>
+  <Object Name="Tree">
+    <Int Name="i">1</Int>
+    <Int Name="j">2</Int>
+  </Object>
+  <BackMapping Name="Mapping">
+    <String Name="/i">/a-x</String>
+    <String Name="/j">/by</String>
+  </BackMapping>
+</ReferenceData>
diff --git a/src/gromacs/utility/tests/refdata/TreeValueTransformTest_SimpleTransformsToObject.xml b/src/gromacs/utility/tests/refdata/TreeValueTransformTest_SimpleTransformsToObject.xml
new file mode 100644 (file)
index 0000000..603fd2b
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Object Name="Input">
+    <String Name="a">1</String>
+    <String Name="b">2</String>
+  </Object>
+  <Sequence Name="MappedPaths">
+    <Int Name="Length">2</Int>
+    <String>/a</String>
+    <String>/b</String>
+  </Sequence>
+  <Object Name="Tree">
+    <Object Name="foo">
+      <Int Name="i">1</Int>
+      <Int Name="j">2</Int>
+    </Object>
+  </Object>
+  <BackMapping Name="Mapping">
+    <String Name="/foo/i">/a</String>
+    <String Name="/foo/j">/b</String>
+  </BackMapping>
+</ReferenceData>
index 7145fdb109a48cddf46ce992ad2fa340e5fce318..675e9802866f4809531df82d6cbecc7a37b21d2f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,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.
 #include <gtest/gtest.h>
 
 #include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/exceptions.h"
 
 #include "testutils/refdata.h"
 #include "testutils/stringtest.h"
 
+namespace gmx
+{
+namespace test
+{
 namespace
 {
 
@@ -84,7 +89,7 @@ TEST(StringUtilityTest, StartsWith)
 TEST(StringUtilityTest, EndsWith)
 {
     EXPECT_TRUE(gmx::endsWith("foobar", "bar"));
-    EXPECT_TRUE(gmx::endsWith("foobar", NULL));
+    EXPECT_TRUE(gmx::endsWith("foobar", nullptr));
     EXPECT_TRUE(gmx::endsWith("foobar", ""));
     EXPECT_TRUE(gmx::endsWith("", ""));
     EXPECT_FALSE(gmx::endsWith("", "foobar"));
@@ -96,7 +101,7 @@ TEST(StringUtilityTest, EndsWith)
 TEST(StringUtilityTest, StripSuffixIfPresent)
 {
     EXPECT_EQ("foo", gmx::stripSuffixIfPresent("foobar", "bar"));
-    EXPECT_EQ("foobar", gmx::stripSuffixIfPresent("foobar", NULL));
+    EXPECT_EQ("foobar", gmx::stripSuffixIfPresent("foobar", nullptr));
     EXPECT_EQ("foobar", gmx::stripSuffixIfPresent("foobar", ""));
     EXPECT_EQ("foobar", gmx::stripSuffixIfPresent("foobar", "bbar"));
     EXPECT_EQ("foobar", gmx::stripSuffixIfPresent("foobar", "barr"));
@@ -126,6 +131,38 @@ TEST(StringUtilityTest, SplitString)
     EXPECT_THAT(gmx::splitString("   "), IsEmpty());
 }
 
+TEST(StringUtilityTest, SplitDelimitedString)
+{
+    using ::testing::ElementsAre;
+    using ::testing::IsEmpty;
+    EXPECT_THAT(gmx::splitDelimitedString("foo;bar", ';'), ElementsAre("foo", "bar"));
+    EXPECT_THAT(gmx::splitDelimitedString(";foo;bar;", ';'), ElementsAre("", "foo", "bar", ""));
+    EXPECT_THAT(gmx::splitDelimitedString("foo;;bar", ';'), ElementsAre("foo", "", "bar"));
+    EXPECT_THAT(gmx::splitDelimitedString("foo", ';'), ElementsAre("foo"));
+    EXPECT_THAT(gmx::splitDelimitedString(";", ';'), ElementsAre("", ""));
+    EXPECT_THAT(gmx::splitDelimitedString("", ';'), IsEmpty());
+}
+
+TEST(StringUtilityTest, SplitAndTrimDelimitedString)
+{
+    using ::testing::ElementsAre;
+    using ::testing::IsEmpty;
+    EXPECT_THAT(splitAndTrimDelimitedString("", ';'), IsEmpty());
+    EXPECT_THAT(splitAndTrimDelimitedString(" \t\n ", ';'), ElementsAre(""));
+    EXPECT_THAT(splitAndTrimDelimitedString("foo", ';'), ElementsAre("foo"));
+    EXPECT_THAT(splitAndTrimDelimitedString(" foo ", ';'), ElementsAre("foo"));
+    EXPECT_THAT(splitAndTrimDelimitedString("foo;bar", ';'), ElementsAre("foo", "bar"));
+    EXPECT_THAT(splitAndTrimDelimitedString(";foo;bar", ';'), ElementsAre("", "foo", "bar"));
+    EXPECT_THAT(splitAndTrimDelimitedString("foo;bar;", ';'), ElementsAre("foo", "bar", ""));
+    EXPECT_THAT(splitAndTrimDelimitedString(";foo;bar;", ';'), ElementsAre("", "foo", "bar", ""));
+    EXPECT_THAT(splitAndTrimDelimitedString("foo;;bar", ';'), ElementsAre("foo", "", "bar"));
+    EXPECT_THAT(splitAndTrimDelimitedString("foo  ;  bar ", ';'), ElementsAre("foo", "bar"));
+    EXPECT_THAT(splitAndTrimDelimitedString("  ; foo ;  bar ", ';'), ElementsAre("", "foo", "bar"));
+    EXPECT_THAT(splitAndTrimDelimitedString(" foo  ;  bar ; ", ';'), ElementsAre("foo", "bar", ""));
+    EXPECT_THAT(splitAndTrimDelimitedString(" ;  foo\n ;  bar ;  ", ';'), ElementsAre("", "foo", "bar", ""));
+    EXPECT_THAT(splitAndTrimDelimitedString(" foo  ; ; \tbar", ';'), ElementsAre("foo", "", "bar"));
+}
+
 /********************************************************************
  * Tests for formatString()
  */
@@ -272,7 +309,7 @@ TEST_F(TextLineWrapperTest, HandlesTrailingWhitespace)
 
     wrapper.settings().setKeepFinalSpaces(true);
     EXPECT_EQ("line   ", wrapper.wrapToString("line   "));
-    EXPECT_EQ("line\n", wrapper.wrapToString("line   \n"));
+    EXPECT_EQ("line   \n", wrapper.wrapToString("line   \n"));
 }
 
 TEST_F(TextLineWrapperTest, HandlesTrailingNewlines)
@@ -388,6 +425,28 @@ TEST_F(TextLineWrapperTest, WrapsCorrectlyWithExtraWhitespace)
 
     checkText(wrapper.wrapToString(g_wrapTextWhitespace),
               "WrappedAt14");
+
+    wrapper.settings().setKeepFinalSpaces(true);
+    checkText(wrapper.wrapToString(g_wrapTextWhitespace),
+              "WrappedAt14WithTrailingWhitespace");
 }
 
+TEST(StringUtilityTest, ParseDigitsFromString)
+{
+    using ::testing::ElementsAre;
+    using ::testing::IsEmpty;
+    EXPECT_THAT(parseDigitsFromString("01"), ElementsAre(0, 1));
+    EXPECT_THAT(parseDigitsFromString("0,1"), ElementsAre(0, 1));
+    EXPECT_THAT(parseDigitsFromString(",0,1"), ElementsAre(0, 1));
+    EXPECT_THAT(parseDigitsFromString("0,1,"), ElementsAre(0, 1));
+    EXPECT_THAT(parseDigitsFromString(",0,1,"), ElementsAre(0, 1));
+    EXPECT_THAT(parseDigitsFromString(","), IsEmpty());
+    EXPECT_THAT(parseDigitsFromString(",,"), IsEmpty());
+    EXPECT_THAT(parseDigitsFromString(""), IsEmpty());
+    EXPECT_THROW(parseDigitsFromString("a"), InvalidInputError);
+    EXPECT_THROW(parseDigitsFromString("0a"), InvalidInputError);
+}
+
+} // namespace
+} // namespace
 } // namespace
diff --git a/src/gromacs/utility/tests/textreader.cpp b/src/gromacs/utility/tests/textreader.cpp
new file mode 100644 (file)
index 0000000..aa1b3e8
--- /dev/null
@@ -0,0 +1,280 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Tests for gmx::TextReader.
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ * \ingroup module_utility
+ */
+#include "gmxpre.h"
+
+#include "gromacs/utility/textreader.h"
+
+#include <functional>
+#include <string>
+#include <vector>
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/stringstream.h"
+#include "gromacs/utility/stringutil.h"
+
+#include "testutils/refdata.h"
+#include "testutils/stringtest.h"
+
+namespace gmx
+{
+namespace test
+{
+namespace
+{
+
+//! Convenience name.
+using Container = std::vector<std::string>;
+//! Convenience type for callbacks.
+using TestCallbackFunc = void(*)(TextReader &);
+
+//! Helper struct.
+struct TextReaderTestParams
+{
+    //! Input data.
+    const Container  input;
+    //! Callback to configure the reader with the behaviour being tested.
+    TestCallbackFunc callback;
+    //! Output to expect from the configured reader acting on the \c input.
+    const Container  expectedOutput;
+};
+
+//! Test fixture.
+class TextReaderTest : public ::testing::TestWithParam<TextReaderTestParams>
+{
+};
+
+TEST_P(TextReaderTest, UsingDifferentConfigurations)
+{
+    const auto &params = GetParam();
+
+    // Prepare the reader with the input lines.
+    StringInputStream stream(params.input);
+    TextReader        reader(&stream);
+    // Configure the intended reading behaviour.
+    params.callback(reader);
+    // Read the input and store what is read.
+    Container   readLines;
+    std::string line;
+    while (reader.readLine(&line))
+    {
+        readLines.push_back(line);
+    }
+    // Check the results
+    EXPECT_THAT(readLines, ::testing::ElementsAreArray(params.expectedOutput));
+}
+
+//! Test input data. Some configurations will remove comments delimited by '#'.
+const Container g_inputs =
+{
+    "",
+    " \t ",
+    "expected text",
+    " expected text ",
+    "expected text \t",
+    " \t expected text",
+    " \t expected text \t",
+    "expected text#",
+    "expected text\t #",
+    "expected text# ",
+    "expected text   # not expected ",
+    "#",
+    "\t #",
+    "   # not expected ",
+};
+
+/*! \brief A case of expected output data that is produced from two
+ * different configurations.
+ *
+ * Note that the implementation of StringInputStream joins the input
+ * container with "\n", so the inputs are always changed before being
+ * read. The name of this variable reflects that TextReader does not
+ * change them during reading. */
+const Container g_unchangedOutputs =
+{
+    "\n",
+    " \t \n",
+    "expected text\n",
+    " expected text \n",
+    "expected text \t\n",
+    " \t expected text\n",
+    " \t expected text \t\n",
+    "expected text#\n",
+    "expected text\t #\n",
+    "expected text# \n",
+    "expected text   # not expected \n",
+    "#\n",
+    "\t #\n",
+    "   # not expected \n",
+};
+INSTANTIATE_TEST_CASE_P(ParsesLinesDifferently, TextReaderTest,
+                            ::testing::Values(TextReaderTestParams {
+                                                  g_inputs,
+                                                  [](TextReader &r)
+                                                  {
+                                                      GMX_UNUSED_VALUE(r);
+                                                  },
+                                                  g_unchangedOutputs
+                                              },
+                                              TextReaderTestParams {
+                                                  g_inputs,
+                                                  [](TextReader &r)
+                                                  {
+                                                      r.setTrimLeadingWhiteSpace(true);
+                                                  },
+                                                  { "",
+                                                    "",
+                                                    "expected text\n",
+                                                    "expected text \n",
+                                                    "expected text \t\n",
+                                                    "expected text\n",
+                                                    "expected text \t\n",
+                                                    "expected text#\n",
+                                                    "expected text\t #\n",
+                                                    "expected text# \n",
+                                                    "expected text   # not expected \n",
+                                                    "#\n",
+                                                    "#\n",
+                                                    "# not expected \n", }
+                                              },
+                                              TextReaderTestParams {
+                                                  g_inputs,
+                                                  [](TextReader &r)
+                                                  {
+                                                      r.setTrimTrailingWhiteSpace(true);
+                                                  },
+                                                  { "",
+                                                    "",
+                                                    "expected text",
+                                                    " expected text",
+                                                    "expected text",
+                                                    " \t expected text",
+                                                    " \t expected text",
+                                                    "expected text#",
+                                                    "expected text\t #",
+                                                    "expected text#",
+                                                    "expected text   # not expected",
+                                                    "#",
+                                                    "\t #",
+                                                    "   # not expected", }
+                                              },
+                                              TextReaderTestParams {
+                                                  g_inputs,
+                                                  [](TextReader &r)
+                                                  {
+                                                      r.setTrimTrailingWhiteSpace(true);
+                                                      r.setTrimLeadingWhiteSpace(true);
+                                                  },
+                                                  { "",
+                                                    "",
+                                                    "expected text",
+                                                    "expected text",
+                                                    "expected text",
+                                                    "expected text",
+                                                    "expected text",
+                                                    "expected text#",
+                                                    "expected text\t #",
+                                                    "expected text#",
+                                                    "expected text   # not expected",
+                                                    "#",
+                                                    "#",
+                                                    "# not expected", }
+                                              },
+                                              TextReaderTestParams {
+                                                  g_inputs,
+                                                  [](TextReader &r)
+                                                  {
+                                                      r.setTrimTrailingComment(true, '#');
+                                                  },
+                                                  { "\n",
+                                                    " \t \n",
+                                                    "expected text\n",
+                                                    " expected text \n",
+                                                    "expected text \t\n",
+                                                    " \t expected text\n",
+                                                    " \t expected text \t\n",
+                                                    "expected text",
+                                                    "expected text\t ",
+                                                    "expected text",
+                                                    "expected text   ",
+                                                    "",
+                                                    "\t ",
+                                                    "   ", }
+                                              },
+                                              TextReaderTestParams {
+                                                  g_inputs,
+                                                  [](TextReader &r)
+                                                  {
+                                                      r.setTrimTrailingComment(true, '#');
+                                                      r.setTrimTrailingComment(false, 0);
+                                                  },
+                                                  g_unchangedOutputs
+                                              },
+                                              TextReaderTestParams {
+                                                  g_inputs,
+                                                  [](TextReader &r)
+                                                  {
+                                                      r.setTrimTrailingComment(true, '#');
+                                                      r.setTrimTrailingWhiteSpace(true);
+                                                  },
+                                                  { "",
+                                                    "",
+                                                    "expected text",
+                                                    " expected text",
+                                                    "expected text",
+                                                    " \t expected text",
+                                                    " \t expected text",
+                                                    "expected text",
+                                                    "expected text",
+                                                    "expected text",
+                                                    "expected text",
+                                                    "",
+                                                    "",
+                                                    "",   }
+                                              }
+                                              ));
+
+} // namespace
+} // namespace
+} // namespace
index ae671eca9040678aebc8c481620ea46ae7b31df0..db870a26841d0421c4c4af48ba085ac6459ce86b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 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.
@@ -138,4 +138,17 @@ TEST_F(TextWriterTest, TracksNewlines)
     checkOutput();
 }
 
+TEST_F(TextWriterTest, PreservesTrailingWhitespace)
+{
+    writer_.writeString("Line   ");
+    writer_.writeLine();
+    writer_.writeString(std::string("Line   "));
+    writer_.writeLine();
+    writer_.writeLine("Line   ");
+    writer_.writeLine(std::string("Line   "));
+    writer_.writeString("Line   \n");
+    writer_.writeString(std::string("Line   \n"));
+    checkOutput();
+}
+
 } // namespace
diff --git a/src/gromacs/utility/tests/typetraits.cpp b/src/gromacs/utility/tests/typetraits.cpp
new file mode 100644 (file)
index 0000000..d6c8abd
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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 "gromacs/utility/typetraits.h"
+
+#include <gtest/gtest.h>
+
+namespace gmx
+{
+namespace test
+{
+TEST(TypeTraitsTest, IsIntegralConstant)
+{
+    EXPECT_FALSE(isIntegralConstant<int>::value);
+    EXPECT_TRUE((isIntegralConstant<std::integral_constant<int, 5> >::value));
+    EXPECT_FALSE((isIntegralConstant<std::integral_constant<short, 5>, long>::value));
+    EXPECT_TRUE((isIntegralConstant<std::integral_constant<long, 5>, long>::value));
+}
+}
+}
index dd727bb93cfd5cd0628a698b23763ed88533399e..f0a14e82f5a245cfc7ff6b1cea79c242471380f0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 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.
@@ -65,15 +65,30 @@ std::string TextReader::readFileToString(const std::string &filename)
     return readFileToString(filename.c_str());
 }
 
+//! Implementation class
 class TextReader::Impl
 {
     public:
+        //! Constructor.
         explicit Impl(const TextInputStreamPointer &stream)
-            : stream_(stream)
+            : stream_(stream), trimLeadingWhiteSpace_(false), trimTrailingWhiteSpace_(false),
+              trimTrailingComment_(false), commentChar_(0)
         {
         }
 
+        //! Stream used by this reader.
         TextInputStreamPointer stream_;
+        //! Whether leading whitespace should be removed.
+        bool                   trimLeadingWhiteSpace_;
+        //! Whether trailing whitespace should be removed.
+        bool                   trimTrailingWhiteSpace_;
+        //! Whether a trailing comment should be removed.
+        bool                   trimTrailingComment_;
+        /*! \brief Character that denotes the start of a comment on a line.
+         *
+         * Zero until TextReader::setTrimTrailingComment is called to
+         * activate such trimming with a given character. */
+        char                   commentChar_;
 };
 
 TextReader::TextReader(const std::string &filename)
@@ -95,25 +110,68 @@ TextReader::~TextReader()
 {
 }
 
-bool TextReader::readLine(std::string *line)
+bool TextReader::readLine(std::string *linePtr)
 {
-    return impl_->stream_->readLine(line);
-}
-
-bool TextReader::readLineTrimmed(std::string *line)
-{
-    if (!readLine(line))
+    if (!impl_->stream_->readLine(linePtr))
     {
         return false;
     }
-    const size_t endPos = line->find_last_not_of(" \t\r\n");
-    if (endPos != std::string::npos)
+    auto      &line              = *linePtr;
+    const char whiteSpaceChars[] = " \t\r\n";
+    if (impl_->trimLeadingWhiteSpace_)
+    {
+        const size_t endPos = line.find_first_not_of(whiteSpaceChars);
+        if (endPos == std::string::npos)
+        {
+            line.resize(0);
+        }
+        else
+        {
+            line = line.substr(endPos, std::string::npos);
+        }
+    }
+    if (impl_->trimTrailingComment_)
     {
-        line->resize(endPos + 1);
+        auto commentPos = line.find(impl_->commentChar_);
+        if (commentPos != std::string::npos)
+        {
+            line.resize(commentPos);
+        }
+    }
+    if (impl_->trimTrailingWhiteSpace_)
+    {
+        const size_t endPos = line.find_last_not_of(whiteSpaceChars);
+        if (endPos == std::string::npos)
+        {
+            line.resize(0);
+        }
+        else
+        {
+            line.resize(endPos + 1);
+        }
     }
     return true;
 }
 
+void TextReader::setTrimLeadingWhiteSpace(bool doTrimming)
+{
+    impl_->trimLeadingWhiteSpace_ = doTrimming;
+}
+
+void TextReader::setTrimTrailingWhiteSpace(bool doTrimming)
+{
+    impl_->trimTrailingWhiteSpace_ = doTrimming;
+}
+
+void TextReader::setTrimTrailingComment(bool doTrimming, char commentChar)
+{
+    impl_->trimTrailingComment_ = doTrimming;
+    if (impl_->trimTrailingComment_)
+    {
+        impl_->commentChar_ = commentChar;
+    }
+}
+
 std::string TextReader::readAll()
 {
     std::string result;
index 3d425ec9d1f7516c4708fa7b2a89bdeeea172efa..df713459de6a8938f5e32ce281adb4d3a70ae264 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 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.
@@ -133,22 +133,37 @@ class TextReader
                // ...
            }
            \endcode
+         *
+         * Behaviours such as trimming whitespace or comments can be
+         * configured by calling other methods before this one.
          */
         bool readLine(std::string *line);
-        /*! \brief
-         * Reads a single line from the stream.
+        /*! \brief Sets whether the reader should trim leading whitespace
+         * from a line before returning it.
          *
-         * \param[out] line    String to receive the line.
-         * \returns    false if nothing was read because the file ended.
+         * \param[in] doTrimming  Whether trimming should be active.
+         */
+        void setTrimLeadingWhiteSpace(bool doTrimming);
+        /*! \brief Sets whether the reader should trim trailing whitespace
+         * from a line before returning it.
          *
-         * On error or when false is returned, \p line will be empty.
-         * Works as readLine(), except that trailing whitespace will be removed
-         * from \p line.
+         * Note that comment trimming will precede whitespace trimming
+         * when both are active.
          *
-         * \see readLine()
+         * \param[in] doTrimming  Whether trimming should be active.
          */
-        bool readLineTrimmed(std::string *line);
-
+        void setTrimTrailingWhiteSpace(bool doTrimming);
+        /*! \brief Sets whether the reader should trim at trailing
+         * comment from a line before returning it.
+         *
+         * Note that comment trimming will precede whitespace trimming
+         * when both are active.
+         *
+         * \param[in]  commentChar  The character that begins a comment.
+         *
+         * \param[in] doTrimming  Whether trimming should be active.
+         */
+        void setTrimTrailingComment(bool doTrimming, char commentChar);
         /*! \brief
          * Reads all remaining lines from the stream as a single string.
          *
index eaab84f0c52e7d779104a46d00c8e4dce47cc5cd..7701950eaf6fdc7b50a3185d5bd167298b5c7472 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 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.
@@ -105,7 +105,14 @@ class TextWriter::Impl
 
         void writeWrappedString(const std::string &str)
         {
-            writeRawString(wrapper_.wrapToString(str));
+            if (newLineCount_ > 0)
+            {
+                writeRawString(wrapper_.wrapToString(str));
+            }
+            else
+            {
+                writeRawString(str);
+            }
         }
 
         TextOutputStreamPointer stream_;
index bcb2b10d797e08044f43405166457eead0748bbe..a978b7ad200841ba200054be5e48ff1710d3abbc 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,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.
@@ -66,7 +66,7 @@ int available(FILE *fp, const void *p, int indent, const char *title)
         }
         fprintf(fp, "%s: not available\n", title);
     }
-    return (p != NULL);
+    return (p != nullptr);
 }
 
 int pr_title(FILE *fp, int indent, const char *title)
@@ -129,7 +129,7 @@ void pr_reals_of_dim(FILE *fp, int indent, const char *title, const real *vec, i
     const char *flong  = "%15.8e";
     const char *format;
 
-    if (getenv("GMX_PRINT_LONGFORMAT") != NULL)
+    if (getenv("GMX_PRINT_LONGFORMAT") != nullptr)
     {
         format = flong;
     }
diff --git a/src/gromacs/utility/typetraits.h b/src/gromacs/utility/typetraits.h
new file mode 100644 (file)
index 0000000..2ba69ba
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares type traits
+ *
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+
+#ifndef GMX_UTILITY_TYPETRAITS_H
+#define GMX_UTILITY_TYPETRAITS_H
+
+#include <type_traits>
+
+namespace gmx
+{
+
+/*! \libinternal \brief
+ * Is true if type is a std::integral_constant
+ *
+ * If the optional integral type is given, than it is only true for a
+ * std::integral_constant of that integral type.
+ *
+ * \tparam T type to check
+ * \tparam Int optional integral type
+ */
+template<typename T, typename Int = void>
+struct isIntegralConstant : public std::false_type {};
+
+template<typename Int, Int N>
+struct isIntegralConstant<std::integral_constant<Int, N>, void> : public std::true_type {};
+
+template<typename Int, Int N>
+struct isIntegralConstant<std::integral_constant<Int, N>, Int> : public std::true_type {};
+
+} // namespace gmx
+
+#endif
diff --git a/src/gromacs/utility/unique_cptr.h b/src/gromacs/utility/unique_cptr.h
new file mode 100644 (file)
index 0000000..b98d0b4
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2012,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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares gmx::unique_cptr and gmx::sfree_guard.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_UNIQUE_PTR_SFREE_H
+#define GMX_UTILITY_UNIQUE_PTR_SFREE_H
+
+#include <cstdlib>
+
+#include <memory>
+
+#include "gromacs/utility/smalloc.h"
+
+namespace gmx
+{
+
+/*! \brief Wrapper of standard library free(), to be used as
+ * unique_cptr deleter for memory allocated by malloc, e.g. by an
+ * external library such as TNG. */
+template <class T>
+inline void free_wrapper(T *p)
+{
+    free(p);
+}
+
+//! sfree wrapper to be used as unique_cptr deleter
+template <class T>
+inline void sfree_wrapper(T *p)
+{
+    sfree(p);
+}
+
+//! \internal \brief wrap function into functor to be used as deleter
+template<class T, void D(T *)>
+struct functor_wrapper {
+    //! call wrapped function
+    void operator()(T* t) { D(t); }
+};
+
+//! unique_ptr which takes function pointer (has to return void) as template argument
+template<typename T, void D(T *) = sfree_wrapper>
+using unique_cptr                = std::unique_ptr<T, functor_wrapper<T, D> >;
+
+//! Simple guard which calls sfree. See unique_cptr for details.
+typedef unique_cptr<void> sfree_guard;
+
+
+//! Create unique_ptr with any deleter function or lambda
+template<typename T, typename D>
+std::unique_ptr<T, D> create_unique_with_deleter(T *t, D d) { return std::unique_ptr<T, D>(t, d); }
+
+}      // namespace gmx
+
+#endif
similarity index 59%
rename from src/gromacs/gmxlib/md_logging.cpp
rename to src/gromacs/utility/variant.cpp
index a114643162e7eb83c4d5a06039fbedf850afc9a1..b5601af20791f9c51c839cc4071c686257425a43 100644 (file)
@@ -1,9 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
+/*! \internal \file
+ * \brief
+ * Implements functionality from variant.h.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_utility
+ */
 #include "gmxpre.h"
 
-#include "md_logging.h"
-
-#include <cstdarg>
-#include <cstdio>
+#include "variant.h"
 
-#include "gromacs/mdtypes/commrec.h"
+#include <string>
 
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/strconvert.h"
 
-void md_print_info(const t_commrec *cr, FILE *fplog,
-                   const char *fmt, ...)
+namespace gmx
 {
-    va_list ap;
 
-    if (cr == NULL || SIMMASTER(cr))
+//! \cond libapi
+std::string simpleValueToString(const Variant &value)
+{
+    if (value.isType<bool>())
     {
-        va_start(ap, fmt);
-
-        vfprintf(stderr, fmt, ap);
-
-        va_end(ap);
+        // TODO: Consider if this would be better as yes/no instead of
+        // true/false.
+        return toString(value.cast<bool>());
     }
-    if (fplog != NULL)
+    else if (value.isType<float>())
     {
-        va_start(ap, fmt);
-
-        vfprintf(fplog, fmt, ap);
-
-        va_end(ap);
+        return toString(value.cast<float>());
     }
-}
-
-void md_print_warn(const t_commrec *cr, FILE *fplog,
-                   const char *fmt, ...)
-{
-    va_list ap;
-
-    if (cr == NULL || SIMMASTER(cr))
+    else if (value.isType<double>())
     {
-        va_start(ap, fmt);
-
-        fprintf(stderr, "\n");
-        vfprintf(stderr, fmt, ap);
-        fprintf(stderr, "\n");
-
-        va_end(ap);
+        return toString(value.cast<double>());
     }
-    if (fplog != NULL)
+    else if (value.isType<int>())
     {
-        va_start(ap, fmt);
-
-        fprintf(fplog, "\n");
-        vfprintf(fplog, fmt, ap);
-        fprintf(fplog, "\n");
-
-        va_end(ap);
+        return toString(value.cast<int>());
     }
+    else if (value.isType<gmx_int64_t>())
+    {
+        return toString(value.cast<gmx_int64_t>());
+    }
+    else if (value.isType<std::string>())
+    {
+        return value.cast<std::string>();
+    }
+    GMX_RELEASE_ASSERT(false, "Unknown value type");
+    return std::string();
 }
+//! \endcond
+
+} // namespace gmx
diff --git a/src/gromacs/utility/variant.h b/src/gromacs/utility/variant.h
new file mode 100644 (file)
index 0000000..9d1b37d
--- /dev/null
@@ -0,0 +1,266 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares gmx::Variant.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_VARIANT_H
+#define GMX_UTILITY_VARIANT_H
+
+#include <memory>
+#include <string>
+#include <type_traits>
+#include <typeindex>
+#include <typeinfo>
+#include <utility>
+
+#include "gromacs/utility/gmxassert.h"
+
+namespace gmx
+{
+
+/*! \libinternal \brief
+ * Represents a dynamically typed value of an arbitrary type.
+ *
+ * To create a variant, either initialize it as empty, or with the create()
+ * method (or the equivalent constructor, if the type parameter can be deduced
+ * and is clear to the reader from the context).
+ *
+ * To query the type of the contents in the variant, use isEmpty(), type(), and
+ * isType().
+ *
+ * To access the value, you need to know the type as a compile-time constant
+ * (e.g., through branching based on isType()), and then use cast() or
+ * tryCast().
+ *
+ * Methods in this class do not throw unless otherwise indicated.
+ *
+ * This provides essentially the same functionality as boost::any.
+ *
+ * \ingroup module_utility
+ */
+class Variant
+{
+    public:
+        /*! \brief
+         * Creates a variant that holds the given value.
+         *
+         * \throws std::bad_alloc if out of memory.
+         *
+         * This method allows explicitly specifying the template argument,
+         * contrary to the templated constructor.
+         */
+        template <typename T>
+        static Variant create(const T &value) { return Variant(value); }
+        /*! \brief
+         * Creates a variant that holds the given value.
+         *
+         * \throws std::bad_alloc if out of memory.
+         *
+         * In addition to allowing specifying the template argument, this
+         * method avoids copying when move-construction is possible.
+         */
+        template <typename T>
+        static Variant create(T &&value) { return Variant(std::move(value)); }
+
+        //! Creates an empty variant value.
+        Variant() {}
+        /*! \brief
+         * Creates a variant that holds the given value.
+         *
+         * \throws std::bad_alloc if out of memory.
+         */
+        template <typename T>
+        explicit Variant(const T &value)
+            : content_(new Content<typename std::decay<T>::type>(value))
+        {
+        }
+        /*! \brief
+         * Creates a variant that holds the given value.
+         *
+         * \throws std::bad_alloc if out of memory.
+         */
+        template <typename T>
+        explicit Variant(T &&value)
+            : content_(new Content<typename std::decay<T>::type>(std::move(value)))
+        {
+        }
+        /*! \brief
+         * Creates a deep copy of a variant.
+         *
+         * \throws std::bad_alloc if out of memory.
+         */
+        Variant(const Variant &other) : content_(other.cloneContent()) {}
+        //! Move-constructs a variant.
+        Variant(Variant &&other) noexcept : content_(std::move(other.content_)) {}
+        /*! \brief
+         * Assigns the variant.
+         *
+         * \throws std::bad_alloc if out of memory.
+         */
+        Variant &operator=(const Variant &other)
+        {
+            content_.reset(other.cloneContent());
+            return *this;
+        }
+        //! Move-assigns the variant.
+        Variant &operator=(Variant &&other) noexcept
+        {
+            content_ = std::move(other.content_);
+            return *this;
+        }
+
+        //! Whether any value is stored.
+        bool isEmpty() const { return content_ == nullptr; }
+        //! Returns the dynamic type of the value that is currently stored.
+        std::type_index type() const
+        {
+            const std::type_info &info
+                = !isEmpty() ? content_->typeInfo() : typeid(void);
+            return std::type_index(info);
+        }
+        //! Returns whether the type stored matches the template parameter.
+        template <typename T>
+        bool isType() const
+        {
+            return !isEmpty() && content_->typeInfo() == typeid(T);
+        }
+
+        /*! \brief
+         * Tries to get the value as the given type.
+         *
+         * \tparam T  Type to get.
+         * \returns Pointer to the value, or nullptr if the type does not match
+         *     the stored value.
+         */
+        template <typename T>
+        const T *tryCast() const
+        {
+            return isType<T>() ? &static_cast<Content<T> *>(content_.get())->value_ : nullptr;
+        }
+        /*! \brief
+         * Gets the value when the type is known.
+         *
+         * \tparam T  Type to get (which must match what the variant stores).
+         *
+         * Asserts if the variant is empty or does not contain the requested type.
+         */
+        template <typename T>
+        const T &cast() const
+        {
+            const T *value = tryCast<T>();
+            GMX_RELEASE_ASSERT(value != nullptr, "Cast to incorrect type");
+            return *value;
+        }
+        /*! \brief
+         * Tries to get the value as the given type as a non-const pointer.
+         *
+         * \tparam T  Type to get.
+         * \returns Pointer to the value, or nullptr if the type does not match
+         *     the stored value.
+         *
+         * This method allows modifying the value in-place, which is useful
+         * with more complicated data structures.
+         */
+        template <typename T>
+        T *tryCastRef()
+        {
+            return isType<T>() ? &static_cast<Content<T> *>(content_.get())->value_ : nullptr;
+        }
+        /*! \brief
+         * Gets the value when the type is known as a modifiable reference.
+         *
+         * \tparam T  Type to get (which must match what the variant stores).
+         *
+         * Asserts if the variant is empty or does not contain the requested type.
+         */
+        template <typename T>
+        T &castRef()
+        {
+            T *value = tryCastRef<T>();
+            GMX_RELEASE_ASSERT(value != nullptr, "Cast to incorrect type");
+            return *value;
+        }
+
+    private:
+        class IContent
+        {
+            public:
+                virtual ~IContent() {}
+                virtual const std::type_info &typeInfo() const = 0;
+                virtual IContent *clone() const                = 0;
+        };
+
+        template <typename T>
+        class Content : public IContent
+        {
+            public:
+                explicit Content(const T &value) : value_(value) {}
+                explicit Content(T &&value) : value_(std::move(value)) {}
+
+                virtual const std::type_info &typeInfo() const { return typeid(T); }
+                virtual IContent *clone() const { return new Content(value_); }
+
+                T value_;
+        };
+
+        //! Creates a deep copy of the content.
+        IContent *cloneContent() const
+        {
+            return content_ != nullptr ? content_->clone() : nullptr;
+        }
+
+        std::unique_ptr<IContent> content_;
+};
+
+//! \cond libapi
+/*! \brief
+ * Converts a Variant value to a string.
+ *
+ * As the name suggests, only some types of "simple" values (such as int) are
+ * supported.  Asserts for unsupported types.
+ *
+ * \ingroup module_utility
+ */
+std::string simpleValueToString(const Variant &value);
+//! \endcond
+
+} // namespace gmx
+
+#endif
index 16590b6d18b30e2869aa3f535b326c7ebde50619..81e7e293014bd0b990f8302a17d21feed4fe1029 100644 (file)
@@ -41,9 +41,13 @@ if(GMX_FAHCORE)
     # may break some generators, according to CMake documentation. If
     # so, we can consider adding some dummy file to make it work.
     add_library(fahcore $<TARGET_OBJECTS:mdrun_objlib>)
+    target_link_libraries(fahcore PRIVATE ${GMX_COMMON_LIBRARIES})
 elseif(GMX_BUILD_MDRUN_ONLY)
     add_executable(mdrun $<TARGET_OBJECTS:mdrun_objlib> mdrun_main.cpp)
-    target_link_libraries(mdrun libgromacs ${GMX_EXE_LINKER_FLAGS} ${GMX_STDLIB_LIBRARIES})
+    target_link_libraries(mdrun libgromacs
+        ${GMX_COMMON_LIBRARIES}
+        ${GMX_EXE_LINKER_FLAGS}
+        ${GMX_STDLIB_LIBRARIES})
     set(BINARY_NAME "mdrun${GMX_BINARY_SUFFIX}")
     set_target_properties(mdrun PROPERTIES
         OUTPUT_NAME "${BINARY_NAME}"
@@ -65,7 +69,10 @@ else()
         ${GMX_MAIN_SOURCES}
         $<TARGET_OBJECTS:mdrun_objlib>
         $<TARGET_OBJECTS:view_objlib>)
-    target_link_libraries(gmx libgromacs ${GMX_EXE_LINKER_FLAGS} ${GMX_STDLIB_LIBRARIES})
+    target_link_libraries(gmx libgromacs
+        ${GMX_COMMON_LIBRARIES}
+        ${GMX_EXE_LINKER_FLAGS}
+        ${GMX_STDLIB_LIBRARIES})
     if(GMX_X11)
         target_link_libraries(gmx ${X11_LIBRARIES})
     endif()
index 10a6f64c342d2a66b6357c371aede70f1c737840..c39c2c4ae99548ad3e7373078e103d69d754d1d3 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,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.
@@ -84,7 +84,7 @@ class ObsoleteToolModule : public gmx::ICommandLineModule
         }
         virtual const char *shortDescription() const
         {
-            return NULL;
+            return nullptr;
         }
 
         virtual void init(gmx::CommandLineModuleSettings * /*settings*/)
index bbb8e59754577e05b1f2fe1c3b6c5f253d1eaeaa..faa20e8b333c666abe8ffffd88d889a5320070b1 100644 (file)
@@ -45,6 +45,7 @@
 #include <stdlib.h>
 
 #include <algorithm>
+#include <memory>
 
 #include "thread_mpi/threads.h"
 
 #include "gromacs/domdec/domdec.h"
 #include "gromacs/domdec/domdec_network.h"
 #include "gromacs/domdec/domdec_struct.h"
+#include "gromacs/essentialdynamics/edsam.h"
 #include "gromacs/ewald/pme.h"
 #include "gromacs/ewald/pme-load-balancing.h"
 #include "gromacs/fileio/trxio.h"
-#include "gromacs/gmxlib/md_logging.h"
 #include "gromacs/gmxlib/network.h"
 #include "gromacs/gmxlib/nrnb.h"
 #include "gromacs/gpu_utils/gpu_utils.h"
@@ -68,6 +69,7 @@
 #include "gromacs/mdlib/compute_io.h"
 #include "gromacs/mdlib/constr.h"
 #include "gromacs/mdlib/ebin.h"
+#include "gromacs/mdlib/expanded.h"
 #include "gromacs/mdlib/force.h"
 #include "gromacs/mdlib/force_flags.h"
 #include "gromacs/mdlib/forcerec.h"
@@ -76,6 +78,7 @@
 #include "gromacs/mdlib/mdebin.h"
 #include "gromacs/mdlib/mdoutf.h"
 #include "gromacs/mdlib/mdrun.h"
+#include "gromacs/mdlib/mdsetup.h"
 #include "gromacs/mdlib/nb_verlet.h"
 #include "gromacs/mdlib/nbnxn_gpu_data_mgmt.h"
 #include "gromacs/mdlib/ns.h"
 #include "gromacs/mdtypes/interaction_const.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/mdtypes/mdatom.h"
+#include "gromacs/mdtypes/observableshistory.h"
 #include "gromacs/mdtypes/state.h"
 #include "gromacs/pbcutil/mshift.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/logger.h"
 #include "gromacs/utility/real.h"
 #include "gromacs/utility/smalloc.h"
 
@@ -153,7 +158,7 @@ static void checkNumberOfBondedInteractions(FILE *fplog, t_commrec *cr, int tota
     }
 }
 
-static void reset_all_counters(FILE *fplog, t_commrec *cr,
+static void reset_all_counters(FILE *fplog, const gmx::MDLogger &mdlog, t_commrec *cr,
                                gmx_int64_t step,
                                gmx_int64_t *step_rel, t_inputrec *ir,
                                gmx_wallcycle_t wcycle, t_nrnb *nrnb,
@@ -163,8 +168,9 @@ static void reset_all_counters(FILE *fplog, t_commrec *cr,
     char sbuf[STEPSTRSIZE];
 
     /* Reset all the counters related to performance over the run */
-    md_print_warn(cr, fplog, "step %s: resetting all time and cycle counters\n",
-                  gmx_step_str(step, sbuf));
+    GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
+            "step %s: resetting all time and cycle counters",
+            gmx_step_str(step, sbuf));
 
     if (use_GPU(nbv))
     {
@@ -188,50 +194,47 @@ static void reset_all_counters(FILE *fplog, t_commrec *cr,
 }
 
 /*! \libinternal
-    \copydoc integrator_t (FILE *fplog, t_commrec *cr,
+    \copydoc integrator_t (FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
                            int nfile, const t_filenm fnm[],
-                           const gmx_output_env_t *oenv, gmx_bool bVerbose,
-                           int nstglobalcomm,
+                           const gmx_output_env_t *oenv,
+                           const MdrunOptions &mdrunOptions,
                            gmx_vsite_t *vsite, gmx_constr_t constr,
-                           int stepout,
+                           gmx::IMDOutputProvider *outputProvider,
                            t_inputrec *inputrec,
                            gmx_mtop_t *top_global, t_fcdata *fcd,
                            t_state *state_global,
                            t_mdatoms *mdatoms,
                            t_nrnb *nrnb, gmx_wallcycle_t wcycle,
-                           gmx_edsam_t ed,
                            t_forcerec *fr,
-                           int repl_ex_nst, int repl_ex_nex, int repl_ex_seed,
-                           real cpt_period, real max_hours,
-                           int imdport,
-                           unsigned long Flags,
+                           const ReplicaExchangeParameters &replExParams,
+                           gmx_membed_t *membed,
                            gmx_walltime_accounting_t walltime_accounting)
  */
-double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
-                  const gmx_output_env_t *oenv, gmx_bool bVerbose,
-                  int nstglobalcomm,
+double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
+                  int nfile, const t_filenm fnm[],
+                  const gmx_output_env_t *oenv,
+                  const MdrunOptions &mdrunOptions,
                   gmx_vsite_t *vsite, gmx_constr_t constr,
-                  int stepout, t_inputrec *ir,
+                  gmx::IMDOutputProvider *outputProvider,
+                  t_inputrec *ir,
                   gmx_mtop_t *top_global,
                   t_fcdata *fcd,
                   t_state *state_global,
+                  ObservablesHistory *observablesHistory,
                   t_mdatoms *mdatoms,
                   t_nrnb *nrnb, gmx_wallcycle_t wcycle,
-                  gmx_edsam_t ed, t_forcerec *fr,
-                  int repl_ex_nst, int repl_ex_nex, int repl_ex_seed,
+                  t_forcerec *fr,
+                  const ReplicaExchangeParameters &replExParams,
                   gmx_membed_t *membed,
-                  real cpt_period, real max_hours,
-                  int imdport,
-                  unsigned long Flags,
                   gmx_walltime_accounting_t walltime_accounting)
 {
-    gmx_mdoutf_t    outf = NULL;
+    gmx_mdoutf_t    outf = nullptr;
     gmx_int64_t     step, step_rel;
     double          elapsed_time;
     double          t, t0, lam0[efptNR];
     gmx_bool        bGStatEveryStep, bGStat, bCalcVir, bCalcEnerStep, bCalcEner;
-    gmx_bool        bNS, bNStList, bSimAnn, bStopCM, bRerunMD,
-                    bFirstStep, startingFromCheckpoint, bInitStep, bLastStep = FALSE,
+    gmx_bool        bNS, bNStList, bSimAnn, bStopCM,
+                    bFirstStep, bInitStep, bLastStep = FALSE,
                     bBornRadii, bUsingEnsembleRestraints;
     gmx_bool          bDoDHDL = FALSE, bDoFEP = FALSE, bDoExpanded = FALSE;
     gmx_bool          do_ene, do_log, do_verbose, bRerunWarnNoV = TRUE,
@@ -243,18 +246,17 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
     t_trxstatus      *status;
     rvec              mu_tot;
     t_vcm            *vcm;
-    matrix            pcoupl_mu, M;
+    matrix            parrinellorahmanMu, M;
     t_trxframe        rerun_fr;
-    gmx_repl_ex_t     repl_ex = NULL;
+    gmx_repl_ex_t     repl_ex = nullptr;
     int               nchkpt  = 1;
     gmx_localtop_t   *top;
-    t_mdebin         *mdebin   = NULL;
-    t_state          *state    = NULL;
+    t_mdebin         *mdebin   = nullptr;
     gmx_enerdata_t   *enerd;
-    rvec             *f = NULL;
+    PaddedRVecVector  f {};
     gmx_global_stat_t gstat;
-    gmx_update_t     *upd   = NULL;
-    t_graph          *graph = NULL;
+    gmx_update_t     *upd   = nullptr;
+    t_graph          *graph = nullptr;
     gmx_groups_t     *groups;
     gmx_ekindata_t   *ekind;
     gmx_shellfc_t    *shellfc;
@@ -262,7 +264,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
     gmx_bool          bResetCountersHalfMaxH = FALSE;
     gmx_bool          bTemp, bPres, bTrotter;
     real              dvdl_constr;
-    rvec             *cbuf        = NULL;
+    rvec             *cbuf        = nullptr;
     int               cbuf_nalloc = 0;
     matrix            lastbox;
     int               lamnew  = 0;
@@ -278,7 +280,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
 
 
     /* PME load balancing data for GPU kernels */
-    pme_load_balancing_t *pme_loadbal      = NULL;
+    pme_load_balancing_t *pme_loadbal      = nullptr;
     gmx_bool              bPMETune         = FALSE;
     gmx_bool              bPMETunePrinting = FALSE;
 
@@ -303,9 +305,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
     // signals, and will use this object to achieve that.
     SimulationSignaller nullSignaller(nullptr, nullptr, false, false);
 
-    /* Check for special mdrun options */
-    bRerunMD = (Flags & MD_RERUN);
-    if (Flags & MD_RESETCOUNTERSHALFWAY)
+    if (mdrunOptions.timingOptions.resetHalfway)
     {
         if (ir->nsteps > 0)
         {
@@ -313,7 +313,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
             wcycle_set_reset_counters(wcycle, ir->nsteps/2);
         }
         /* Signal to reset the counters halfway the simulation time. */
-        bResetCountersHalfMaxH = (max_hours > 0);
+        bResetCountersHalfMaxH = (mdrunOptions.maximumHoursToRun > 0);
     }
 
     /* md-vv uses averaged full step velocities for T-control
@@ -321,6 +321,9 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
        md uses averaged half step kinetic energies to determine temperature unless defined otherwise by GMX_EKIN_AVE_VEL; */
     bTrotter = (EI_VV(ir->eI) && (inputrecNptTrotter(ir) || inputrecNphTrotter(ir) || inputrecNvtTrotter(ir)));
 
+    const gmx_bool bRerunMD      = mdrunOptions.rerun;
+    int            nstglobalcomm = mdrunOptions.globalCommunicationInterval;
+
     if (bRerunMD)
     {
         /* Since we don't know if the frames read are related in any way,
@@ -331,7 +334,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
         nstglobalcomm     = 1;
     }
 
-    nstglobalcomm   = check_nstglobalcomm(fplog, cr, nstglobalcomm, ir);
+    nstglobalcomm   = check_nstglobalcomm(mdlog, nstglobalcomm, ir);
     bGStatEveryStep = (nstglobalcomm == 1);
 
     if (bRerunMD)
@@ -340,19 +343,31 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
     }
     groups = &top_global->groups;
 
+    gmx_edsam *ed = nullptr;
+    if (opt2bSet("-ei", nfile, fnm) || observablesHistory->edsamHistory != nullptr)
+    {
+        /* Initialize essential dynamics sampling */
+        ed = init_edsam(opt2fn_null("-ei", nfile, fnm), opt2fn("-eo", nfile, fnm),
+                        top_global, ir, cr, constr,
+                        as_rvec_array(state_global->x.data()),
+                        state_global->box, observablesHistory,
+                        oenv, mdrunOptions.continuationOptions.appendFiles);
+    }
+
     if (ir->eSwapCoords != eswapNO)
     {
         /* Initialize ion swapping code */
-        init_swapcoords(fplog, bVerbose, ir, opt2fn_master("-swap", nfile, fnm, cr),
-                        top_global, state_global->x, state_global->box, &state_global->swapstate, cr, oenv, Flags);
+        init_swapcoords(fplog, ir, opt2fn_master("-swap", nfile, fnm, cr),
+                        top_global, as_rvec_array(state_global->x.data()), state_global->box, observablesHistory, cr, oenv, mdrunOptions);
     }
 
     /* Initial values */
-    init_md(fplog, cr, ir, oenv, &t, &t0, state_global->lambda,
+    init_md(fplog, cr, outputProvider, ir, oenv, mdrunOptions,
+            &t, &t0, state_global->lambda,
             &(state_global->fep_state), lam0,
             nrnb, top_global, &upd,
             nfile, fnm, &outf, &mdebin,
-            force_vir, shake_vir, mu_tot, &bSimAnn, &vcm, Flags, wcycle);
+            force_vir, shake_vir, mu_tot, &bSimAnn, &vcm, wcycle);
 
     clear_mat(total_vir);
     clear_mat(pres);
@@ -360,14 +375,6 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
     snew(enerd, 1);
     init_enerdata(top_global->groups.grps[egcENER].nr, ir->fepvals->n_lambda,
                   enerd);
-    if (DOMAINDECOMP(cr))
-    {
-        f = NULL;
-    }
-    else
-    {
-        snew(f, top_global->natoms);
-    }
 
     /* Kinetic energy data */
     snew(ekind, 1);
@@ -410,44 +417,41 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
         }
     }
 
+    // Local state only becomes valid now.
+    std::unique_ptr<t_state> stateInstance;
+    t_state *                state;
+
     if (DOMAINDECOMP(cr))
     {
         top = dd_init_local_top(top_global);
 
-        snew(state, 1);
+        stateInstance = std::unique_ptr<t_state>(new t_state);
+        state         = stateInstance.get();
         dd_init_local_state(cr->dd, state_global, state);
     }
     else
     {
-        top = gmx_mtop_generate_local_top(top_global, ir->efep != efepNO);
-
-        state    = serial_init_local_state(state_global);
-
-        atoms2md(top_global, ir, 0, NULL, top_global->natoms, mdatoms);
-
-        if (vsite)
-        {
-            set_vsite_top(vsite, top, mdatoms, cr);
-        }
-
-        if (ir->ePBC != epbcNONE && !fr->bMolPBC)
-        {
-            graph = mk_graph(fplog, &(top->idef), 0, top_global->natoms, FALSE, FALSE);
-        }
-
-        if (shellfc)
-        {
-            make_local_shells(cr, mdatoms, shellfc);
-        }
+        state_change_natoms(state_global, state_global->natoms);
+        /* We need to allocate one element extra, since we might use
+         * (unaligned) 4-wide SIMD loads to access rvec entries.
+         */
+        f.resize(state_global->natoms + 1);
+        /* Copy the pointer to the global state */
+        state = state_global;
 
-        setup_bonded_threading(fr, &top->idef);
+        snew(top, 1);
+        mdAlgorithmsSetupAtomData(cr, ir, top_global, top, fr,
+                                  &graph, mdatoms, vsite, shellfc);
 
-        update_realloc(upd, state->nalloc);
+        update_realloc(upd, state->natoms);
     }
+    // TODO Global state should be destroyed now that we have local
+    // state. Nothing should need to use it. (Global topology should
+    // persist.)
 
     /* Set up interactive MD (IMD) */
-    init_IMD(ir, cr, top_global, fplog, ir->nstcalcenergy, state_global->x,
-             nfile, fnm, oenv, imdport, Flags);
+    init_IMD(ir, cr, top_global, fplog, ir->nstcalcenergy, as_rvec_array(state_global->x.data()),
+             nfile, fnm, oenv, mdrunOptions);
 
     if (DOMAINDECOMP(cr))
     {
@@ -456,18 +460,19 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                             state_global, top_global, ir,
                             state, &f, mdatoms, top, fr,
                             vsite, constr,
-                            nrnb, NULL, FALSE);
+                            nrnb, nullptr, FALSE);
         shouldCheckNumberOfBondedInteractions = true;
-        update_realloc(upd, state->nalloc);
+        update_realloc(upd, state->natoms);
     }
 
     update_mdatoms(mdatoms, state->lambda[efptMASS]);
 
-    startingFromCheckpoint = Flags & MD_STARTFROMCPT;
+    const ContinuationOptions &continuationOptions    = mdrunOptions.continuationOptions;
+    bool                       startingFromCheckpoint = continuationOptions.startedFromCheckpoint;
 
     if (ir->bExpanded)
     {
-        init_expanded_ensemble(startingFromCheckpoint, ir, &state->dfhist);
+        init_expanded_ensemble(startingFromCheckpoint, ir, state->dfhist);
     }
 
     if (MASTER(cr))
@@ -475,21 +480,25 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
         if (startingFromCheckpoint)
         {
             /* Update mdebin with energy history if appending to output files */
-            if (Flags & MD_APPENDFILES)
+            if (continuationOptions.appendFiles)
             {
-                restore_energyhistory_from_state(mdebin, state_global->enerhist);
+                restore_energyhistory_from_state(mdebin, observablesHistory->energyHistory.get());
             }
-            else
+            else if (observablesHistory->energyHistory.get() != nullptr)
             {
-                /* We might have read an energy history from checkpoint,
-                 * free the allocated memory and reset the counts.
+                /* We might have read an energy history from checkpoint.
+                 * As we are not appending, we want to restart the statistics.
+                 * Free the allocated memory and reset the counts.
                  */
-                done_energyhistory(state_global->enerhist);
-                init_energyhistory(state_global->enerhist);
+                observablesHistory->energyHistory = {};
             }
         }
+        if (observablesHistory->energyHistory.get() == nullptr)
+        {
+            observablesHistory->energyHistory = std::unique_ptr<energyhistory_t>(new energyhistory_t {});
+        }
         /* Set the initial energy history in state by updating once */
-        update_energyhistory(state_global->enerhist, mdebin);
+        update_energyhistory(observablesHistory->energyHistory.get(), mdebin);
     }
 
     /* Initialize constraints */
@@ -498,36 +507,45 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
         set_constraints(constr, top, ir, mdatoms, cr);
     }
 
-    if (repl_ex_nst > 0 && MASTER(cr))
+    const bool useReplicaExchange = (replExParams.exchangeInterval > 0);
+    if (useReplicaExchange && MASTER(cr))
     {
         repl_ex = init_replica_exchange(fplog, cr->ms, state_global, ir,
-                                        repl_ex_nst, repl_ex_nex, repl_ex_seed);
+                                        replExParams);
     }
 
     /* PME tuning is only supported in the Verlet scheme, with PME for
      * Coulomb. It is not supported with only LJ PME, or for
      * reruns. */
-    bPMETune = ((Flags & MD_TUNEPME) && EEL_PME(fr->eeltype) && !bRerunMD &&
-                !(Flags & MD_REPRODUCIBLE) && ir->cutoff_scheme != ecutsGROUP);
+    bPMETune = (mdrunOptions.tunePme && EEL_PME(fr->eeltype) && !bRerunMD &&
+                !mdrunOptions.reproducible && ir->cutoff_scheme != ecutsGROUP);
     if (bPMETune)
     {
-        pme_loadbal_init(&pme_loadbal, cr, fplog, ir, state->box,
-                         fr->ic, fr->pmedata, use_GPU(fr->nbv),
+        pme_loadbal_init(&pme_loadbal, cr, mdlog, ir, state->box,
+                         fr->ic, fr->nbv->listParams.get(), fr->pmedata, use_GPU(fr->nbv),
                          &bPMETunePrinting);
     }
 
     if (!ir->bContinuation && !bRerunMD)
     {
-        if (mdatoms->cFREEZE && (state->flags & (1<<estV)))
+        if (state->flags & (1 << estV))
         {
-            /* Set the velocities of frozen particles to zero */
+            /* Set the velocities of vsites, shells and frozen atoms to zero */
             for (i = 0; i < mdatoms->homenr; i++)
             {
-                for (m = 0; m < DIM; m++)
+                if (mdatoms->ptype[i] == eptVSite ||
+                    mdatoms->ptype[i] == eptShell)
+                {
+                    clear_rvec(state->v[i]);
+                }
+                else if (mdatoms->cFREEZE)
                 {
-                    if (ir->opts.nFreeze[mdatoms->cFREEZE[i]][m])
+                    for (m = 0; m < DIM; m++)
                     {
-                        state->v[i][m] = 0;
+                        if (ir->opts.nFreeze[mdatoms->cFREEZE[i]][m])
+                        {
+                            state->v[i][m] = 0;
+                        }
                     }
                 }
             }
@@ -542,7 +560,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
         if (vsite)
         {
             /* Construct the virtual sites for the initial configuration */
-            construct_vsites(vsite, state->x, ir->delta_t, NULL,
+            construct_vsites(vsite, as_rvec_array(state->x.data()), ir->delta_t, nullptr,
                              top->idef.iparams, top->idef.il,
                              fr->ePBC, fr->bMolPBC, cr, state->box);
         }
@@ -557,9 +575,9 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
         {
             nstfep = gmx_greatest_common_divisor(ir->expandedvals->nstexpanded, nstfep);
         }
-        if (repl_ex_nst > 0)
+        if (useReplicaExchange)
         {
-            nstfep = gmx_greatest_common_divisor(repl_ex_nst, nstfep);
+            nstfep = gmx_greatest_common_divisor(replExParams.exchangeInterval, nstfep);
         }
     }
 
@@ -569,7 +587,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
      */
     bStopCM = (ir->comm_mode != ecmNO && !ir->bContinuation);
 
-    if (Flags & MD_READ_EKIN)
+    if (continuationOptions.haveReadEkin)
     {
         restore_ekinstate_from_state(cr, ekind, &state_global->ekinstate);
     }
@@ -578,11 +596,11 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                   | (bStopCM ? CGLO_STOPCM : 0)
                   | (EI_VV(ir->eI) ? CGLO_PRESSURE : 0)
                   | (EI_VV(ir->eI) ? CGLO_CONSTRAINT : 0)
-                  | ((Flags & MD_READ_EKIN) ? CGLO_READEKIN : 0));
+                  | (continuationOptions.haveReadEkin ? CGLO_READEKIN : 0));
 
     bSumEkinhOld = FALSE;
     compute_globals(fplog, gstat, cr, ir, fr, ekind, state, mdatoms, nrnb, vcm,
-                    NULL, enerd, force_vir, shake_vir, total_vir, pres, mu_tot,
+                    nullptr, enerd, force_vir, shake_vir, total_vir, pres, mu_tot,
                     constr, &nullSignaller, state->box,
                     &totalNumberOfBondedInteractions, &bSumEkinhOld, cglo_flags
                     | (shouldCheckNumberOfBondedInteractions ? CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS : 0));
@@ -598,14 +616,14 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
            perhaps loses some logic?*/
 
         compute_globals(fplog, gstat, cr, ir, fr, ekind, state, mdatoms, nrnb, vcm,
-                        NULL, enerd, force_vir, shake_vir, total_vir, pres, mu_tot,
+                        nullptr, enerd, force_vir, shake_vir, total_vir, pres, mu_tot,
                         constr, &nullSignaller, state->box,
-                        NULL, &bSumEkinhOld,
+                        nullptr, &bSumEkinhOld,
                         cglo_flags &~(CGLO_STOPCM | CGLO_PRESSURE));
     }
 
     /* Calculate the initial half step temperature, and save the ekinh_old */
-    if (!(Flags & MD_STARTFROMCPT))
+    if (!continuationOptions.startedFromCheckpoint)
     {
         for (i = 0; (i < ir->opts.ngtc); i++)
         {
@@ -646,7 +664,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
             fprintf(stderr, "starting md rerun '%s', reading coordinates from"
                     " input trajectory '%s'\n\n",
                     *(top_global->name), opt2fn("-rerun", nfile, fnm));
-            if (bVerbose)
+            if (mdrunOptions.verbose)
             {
                 fprintf(stderr, "Calculated time to finish depends on nsteps from "
                         "run input file,\nwhich may not correspond to the time "
@@ -750,8 +768,11 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
         }
     }
 
-    /* loop over MD steps or if rerunMD to end of input trajectory */
-    bFirstStep = TRUE;
+    /* Loop over MD steps or if rerunMD to end of input trajectory,
+     * or, if max_hours>0, until max_hours is reached.
+     */
+    real max_hours   = mdrunOptions.maximumHoursToRun;
+    bFirstStep       = TRUE;
     /* Skip the first Nose-Hoover integration when we get the state from tpx */
     bInitStep        = !startingFromCheckpoint || EI_VV(ir->eI);
     bSumEkinhOld     = FALSE;
@@ -767,31 +788,34 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
         // checkpoints and stop conditions to act on the same step, so
         // the propagation of such signals must take place between
         // simulations, not just within simulations.
-        bool checkpointIsLocal    = (repl_ex_nst <= 0) && !bUsingEnsembleRestraints;
-        bool stopConditionIsLocal = (repl_ex_nst <= 0) && !bUsingEnsembleRestraints;
+        bool checkpointIsLocal    = !useReplicaExchange && !bUsingEnsembleRestraints;
+        bool stopConditionIsLocal = !useReplicaExchange && !bUsingEnsembleRestraints;
         bool resetCountersIsLocal = true;
         signals[eglsCHKPT]         = SimulationSignal(checkpointIsLocal);
         signals[eglsSTOPCOND]      = SimulationSignal(stopConditionIsLocal);
         signals[eglsRESETCOUNTERS] = SimulationSignal(resetCountersIsLocal);
     }
 
+    DdOpenBalanceRegionBeforeForceComputation ddOpenBalanceRegion   = (DOMAINDECOMP(cr) ? DdOpenBalanceRegionBeforeForceComputation::yes : DdOpenBalanceRegionBeforeForceComputation::no);
+    DdCloseBalanceRegionAfterForceComputation ddCloseBalanceRegion  = (DOMAINDECOMP(cr) ? DdCloseBalanceRegionAfterForceComputation::yes : DdCloseBalanceRegionAfterForceComputation::no);
+
     step     = ir->init_step;
     step_rel = 0;
 
     // TODO extract this to new multi-simulation module
-    if (MASTER(cr) && MULTISIM(cr) && (repl_ex_nst <= 0 ))
+    if (MASTER(cr) && MULTISIM(cr) && !useReplicaExchange)
     {
         if (!multisim_int_all_are_equal(cr->ms, ir->nsteps))
         {
-            md_print_info(cr, fplog,
-                          "Note: The number of steps is not consistent across multi simulations,\n"
-                          "but we are proceeding anyway!\n");
+            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))
         {
-            md_print_info(cr, fplog,
-                          "Note: The initial step is not consistent across multi simulations,\n"
-                          "but we are proceeding anyway!\n");
+            GMX_LOG(mdlog.warning).appendText(
+                    "Note: The initial step is not consistent across multi simulations,\n"
+                    "but we are proceeding anyway!");
         }
     }
 
@@ -807,8 +831,8 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
         {
             /* PME grid + cut-off optimization with GPUs or PME nodes */
             pme_loadbal_do(pme_loadbal, cr,
-                           (bVerbose && MASTER(cr)) ? stderr : NULL,
-                           fplog,
+                           (mdrunOptions.verbose && MASTER(cr)) ? stderr : nullptr,
+                           fplog, mdlog,
                            ir, fr, state,
                            wcycle,
                            step, step_rel,
@@ -852,8 +876,8 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                             && (ir->bExpanded) && (step > 0) && (!startingFromCheckpoint));
         }
 
-        bDoReplEx = ((repl_ex_nst > 0) && (step > 0) && !bLastStep &&
-                     do_per_step(step, repl_ex_nst));
+        bDoReplEx = (useReplicaExchange && (step > 0) && !bLastStep &&
+                     do_per_step(step, replExParams.exchangeInterval));
 
         if (bSimAnn)
         {
@@ -894,7 +918,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
             copy_mat(rerun_fr.box, state_global->box);
             copy_mat(state_global->box, state->box);
 
-            if (vsite && (Flags & MD_RERUN_VSITE))
+            if (vsite && mdrunOptions.rerunConstructVsites)
             {
                 if (DOMAINDECOMP(cr))
                 {
@@ -905,15 +929,15 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                     /* Following is necessary because the graph may get out of sync
                      * with the coordinates if we only have every N'th coordinate set
                      */
-                    mk_mshift(fplog, graph, fr->ePBC, state->box, state->x);
-                    shift_self(graph, state->box, state->x);
+                    mk_mshift(fplog, graph, fr->ePBC, state->box, as_rvec_array(state->x.data()));
+                    shift_self(graph, state->box, as_rvec_array(state->x.data()));
                 }
-                construct_vsites(vsite, state->x, ir->delta_t, state->v,
+                construct_vsites(vsite, as_rvec_array(state->x.data()), ir->delta_t, as_rvec_array(state->v.data()),
                                  top->idef.iparams, top->idef.il,
                                  fr->ePBC, fr->bMolPBC, cr, state->box);
                 if (graph)
                 {
-                    unshift_self(graph, state->box, state->x);
+                    unshift_self(graph, state->box, as_rvec_array(state->x.data()));
                 }
             }
         }
@@ -953,8 +977,8 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
          * beyond the last step. But we don't consider that to be an issue.
          */
         do_log     = do_per_step(step, ir->nstlog) || (bFirstStep && !startingFromCheckpoint) || bLastStep || bRerunMD;
-        do_verbose = bVerbose &&
-            (step % stepout == 0 || bFirstStep || bLastStep || bRerunMD);
+        do_verbose = mdrunOptions.verbose &&
+            (step % mdrunOptions.verboseStepPrintInterval == 0 || bFirstStep || bLastStep || bRerunMD);
 
         if (bNS && !(bFirstStep && ir->bContinuation && !bRerunMD))
         {
@@ -990,7 +1014,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                                     nrnb, wcycle,
                                     do_verbose && !bPMETunePrinting);
                 shouldCheckNumberOfBondedInteractions = true;
-                update_realloc(upd, state->nalloc);
+                update_realloc(upd, state->natoms);
             }
         }
 
@@ -1011,7 +1035,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
              * the full step kinetic energy and possibly for T-coupling.*/
             /* This may not be quite working correctly yet . . . . */
             compute_globals(fplog, gstat, cr, ir, fr, ekind, state, mdatoms, nrnb, vcm,
-                            wcycle, enerd, NULL, NULL, NULL, NULL, mu_tot,
+                            wcycle, enerd, nullptr, nullptr, nullptr, nullptr, mu_tot,
                             constr, &nullSignaller, state->box,
                             &totalNumberOfBondedInteractions, &bSumEkinhOld,
                             CGLO_GSTAT | CGLO_TEMPERATURE | CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS);
@@ -1027,7 +1051,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
          * but never at the first step or with rerun.
          */
         bCPT = (((signals[eglsCHKPT].set && (bNS || ir->nstlist == 0)) ||
-                 (bLastStep && (Flags & MD_CONFOUT))) &&
+                 (bLastStep && mdrunOptions.writeConfout)) &&
                 step > ir->init_step && !bRerunMD);
         if (bCPT)
         {
@@ -1081,13 +1105,14 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
         if (shellfc)
         {
             /* Now is the time to relax the shells */
-            relax_shell_flexcon(fplog, cr, bVerbose, step,
+            relax_shell_flexcon(fplog, cr, mdrunOptions.verbose, step,
                                 ir, bNS, force_flags, top,
                                 constr, enerd, fcd,
-                                state, f, force_vir, mdatoms,
+                                state, &f, force_vir, mdatoms,
                                 nrnb, wcycle, graph, groups,
                                 shellfc, fr, bBornRadii, t, mu_tot,
-                                vsite, mdoutf_get_fp_field(outf));
+                                vsite,
+                                ddOpenBalanceRegion, ddCloseBalanceRegion);
         }
         else
         {
@@ -1097,17 +1122,18 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
              * Check comments in sim_util.c
              */
             do_force(fplog, cr, ir, step, nrnb, wcycle, top, groups,
-                     state->box, state->x, &state->hist,
-                     f, force_vir, mdatoms, enerd, fcd,
+                     state->box, &state->x, &state->hist,
+                     &f, force_vir, mdatoms, enerd, fcd,
                      state->lambda, graph,
-                     fr, vsite, mu_tot, t, mdoutf_get_fp_field(outf), ed, bBornRadii,
-                     (bNS ? GMX_FORCE_NS : 0) | force_flags);
+                     fr, vsite, mu_tot, t, ed, bBornRadii,
+                     (bNS ? GMX_FORCE_NS : 0) | force_flags,
+                     ddOpenBalanceRegion, ddCloseBalanceRegion);
         }
 
         if (EI_VV(ir->eI) && !startingFromCheckpoint && !bRerunMD)
         /*  ############### START FIRST UPDATE HALF-STEP FOR VV METHODS############### */
         {
-            rvec *vbuf = NULL;
+            rvec *vbuf = nullptr;
 
             wallcycle_start(wcycle, ewcUPDATE);
             if (ir->eI == eiVV && bInitStep)
@@ -1119,7 +1145,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                  * so that the input is actually the initial step.
                  */
                 snew(vbuf, state->natoms);
-                copy_rvecn(state->v, vbuf, 0, state->natoms); /* should make this better for parallelizing? */
+                copy_rvecn(as_rvec_array(state->v.data()), vbuf, 0, state->natoms); /* should make this better for parallelizing? */
             }
             else
             {
@@ -1127,15 +1153,15 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                 trotter_update(ir, step, ekind, enerd, state, total_vir, mdatoms, &MassQ, trotter_seq, ettTSEQ1);
             }
 
-            update_coords(fplog, step, ir, mdatoms, state, f, fcd,
+            update_coords(fplog, step, ir, mdatoms, state, &f, fcd,
                           ekind, M, upd, etrtVELOCITY1,
                           cr, constr);
 
             if (!bRerunMD || rerun_fr.bV || bForceUpdate)         /* Why is rerun_fr.bV here?  Unclear. */
             {
                 wallcycle_stop(wcycle, ewcUPDATE);
-                update_constraints(fplog, step, NULL, ir, mdatoms,
-                                   state, fr->bMolPBC, graph, f,
+                update_constraints(fplog, step, nullptr, ir, mdatoms,
+                                   state, fr->bMolPBC, graph, &f,
                                    &top->idef, shake_vir,
                                    cr, nrnb, wcycle, upd, constr,
                                    TRUE, bCalcVir);
@@ -1145,7 +1171,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
             {
                 /* Need to unshift here if a do_force has been
                    called in the previous step */
-                unshift_self(graph, state->box, state->x);
+                unshift_self(graph, state->box, as_rvec_array(state->x.data()));
             }
             /* if VV, compute the pressure and constraints */
             /* For VV2, we strictly only need this if using pressure
@@ -1212,7 +1238,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                     if (inputrecNvtTrotter(ir) && ir->eI == eiVV)
                     {
                         /* update temperature and kinetic energy now that step is over - this is the v(t+dt) point */
-                        enerd->term[F_TEMP] = sum_ekin(&(ir->opts), ekind, NULL, (ir->eI == eiVV), FALSE);
+                        enerd->term[F_TEMP] = sum_ekin(&(ir->opts), ekind, nullptr, (ir->eI == eiVV), FALSE);
                         enerd->term[F_EKIN] = trace(ekind->ekin);
                     }
                 }
@@ -1223,9 +1249,9 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                      * the full step kinetic energy and possibly for T-coupling.*/
                     /* This may not be quite working correctly yet . . . . */
                     compute_globals(fplog, gstat, cr, ir, fr, ekind, state, mdatoms, nrnb, vcm,
-                                    wcycle, enerd, NULL, NULL, NULL, NULL, mu_tot,
+                                    wcycle, enerd, nullptr, nullptr, nullptr, nullptr, mu_tot,
                                     constr, &nullSignaller, state->box,
-                                    NULL, &bSumEkinhOld,
+                                    nullptr, &bSumEkinhOld,
                                     CGLO_GSTAT | CGLO_TEMPERATURE);
                     wallcycle_start(wcycle, ewcUPDATE);
                 }
@@ -1233,7 +1259,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
             /* if it's the initial step, we performed this first step just to get the constraint virial */
             if (ir->eI == eiVV && bInitStep)
             {
-                copy_rvecn(vbuf, state->v, 0, state->natoms);
+                copy_rvecn(vbuf, as_rvec_array(state->v.data()), 0, state->natoms);
                 sfree(vbuf);
             }
             wallcycle_stop(wcycle, ewcUPDATE);
@@ -1242,7 +1268,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
         /* compute the conserved quantity */
         if (EI_VV(ir->eI))
         {
-            saved_conserved_quantity = compute_conserved_from_auxiliary(ir, state, &MassQ);
+            saved_conserved_quantity = NPT_energy(ir, state, &MassQ);
             if (ir->eI == eiVV)
             {
                 last_ekin = enerd->term[F_EKIN];
@@ -1267,9 +1293,9 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                statistics, but if performing simulated tempering, we
                do update the velocities and the tau_t. */
 
-            lamnew = ExpandedEnsembleDynamics(fplog, ir, enerd, state, &MassQ, state->fep_state, &state->dfhist, step, state->v, mdatoms);
+            lamnew = ExpandedEnsembleDynamics(fplog, ir, enerd, state, &MassQ, state->fep_state, state->dfhist, step, as_rvec_array(state->v.data()), mdatoms);
             /* history is maintained in state->dfhist, but state_global is what is sent to trajectory and log output */
-            copy_df_history(&state_global->dfhist, &state->dfhist);
+            copy_df_history(state_global->dfhist, state->dfhist);
         }
 
         /* Now we have the energies and forces corresponding to the
@@ -1277,13 +1303,15 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
          * the update.
          */
         do_md_trajectory_writing(fplog, cr, nfile, fnm, step, step_rel, t,
-                                 ir, state, state_global, top_global, fr,
-                                 outf, mdebin, ekind, f,
+                                 ir, state, state_global, observablesHistory,
+                                 top_global, fr,
+                                 outf, mdebin, ekind, &f,
                                  &nchkpt,
-                                 bCPT, bRerunMD, bLastStep, (Flags & MD_CONFOUT),
+                                 bCPT, bRerunMD, bLastStep,
+                                 mdrunOptions.writeConfout,
                                  bSumEkinhOld);
         /* Check if IMD step and do IMD communication, if bIMD is TRUE. */
-        bIMDstep = do_IMD(ir->bIMD, step, cr, bNS, state->box, state->x, ir, t, wcycle);
+        bIMDstep = do_IMD(ir->bIMD, step, cr, bNS, state->box, as_rvec_array(state->x.data()), ir, t, wcycle);
 
         /* kludge -- virial is lost with restart for MTTK NPT control. Must reload (saved earlier). */
         if (startingFromCheckpoint && (inputrecNptTrotter(ir) || inputrecNphTrotter(ir)))
@@ -1353,6 +1381,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
          * where we do global communication,
          *  otherwise the other nodes don't know.
          */
+        const real cpt_period = mdrunOptions.checkpointOptions.period;
         if (MASTER(cr) && ((bGStat || !PAR(cr)) &&
                            cpt_period >= 0 &&
                            (cpt_period == 0 ||
@@ -1374,8 +1403,8 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
             /* if we have constraints, we have to remove the kinetic energy parallel to the bonds */
             if (constr && bIfRandomize)
             {
-                update_constraints(fplog, step, NULL, ir, mdatoms,
-                                   state, fr->bMolPBC, graph, f,
+                update_constraints(fplog, step, nullptr, ir, mdatoms,
+                                   state, fr->bMolPBC, graph, &f,
                                    &top->idef, tmp_vir,
                                    cr, nrnb, wcycle, upd, constr,
                                    TRUE, bCalcVir);
@@ -1406,13 +1435,15 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
             else
             {
                 update_tcouple(step, ir, state, ekind, &MassQ, mdatoms);
-                update_pcouple(fplog, step, ir, state, pcoupl_mu, M, bInitStep);
+                update_pcouple_before_coordinates(fplog, step, ir, state,
+                                                  parrinellorahmanMu, M,
+                                                  bInitStep);
             }
 
             if (EI_VV(ir->eI))
             {
                 /* velocity half-step update */
-                update_coords(fplog, step, ir, mdatoms, state, f, fcd,
+                update_coords(fplog, step, ir, mdatoms, state, &f, fcd,
                               ekind, M, upd, etrtVELOCITY2,
                               cr, constr);
             }
@@ -1430,15 +1461,15 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                     cbuf_nalloc = state->natoms;
                     srenew(cbuf, cbuf_nalloc);
                 }
-                copy_rvecn(state->x, cbuf, 0, state->natoms);
+                copy_rvecn(as_rvec_array(state->x.data()), cbuf, 0, state->natoms);
             }
 
-            update_coords(fplog, step, ir, mdatoms, state, f, fcd,
+            update_coords(fplog, step, ir, mdatoms, state, &f, fcd,
                           ekind, M, upd, etrtPOSITION, cr, constr);
             wallcycle_stop(wcycle, ewcUPDATE);
 
             update_constraints(fplog, step, &dvdl_constr, ir, mdatoms, state,
-                               fr->bMolPBC, graph, f,
+                               fr->bMolPBC, graph, &f,
                                &top->idef, shake_vir,
                                cr, nrnb, wcycle, upd, constr,
                                FALSE, bCalcVir);
@@ -1450,27 +1481,27 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                 compute_globals(fplog, gstat, cr, ir, fr, ekind, state, mdatoms, nrnb, vcm,
                                 wcycle, enerd, force_vir, shake_vir, total_vir, pres, mu_tot,
                                 constr, &nullSignaller, lastbox,
-                                NULL, &bSumEkinhOld,
+                                nullptr, &bSumEkinhOld,
                                 (bGStat ? CGLO_GSTAT : 0) | CGLO_TEMPERATURE
                                 );
                 wallcycle_start(wcycle, ewcUPDATE);
                 trotter_update(ir, step, ekind, enerd, state, total_vir, mdatoms, &MassQ, trotter_seq, ettTSEQ4);
                 /* now we know the scaling, we can compute the positions again again */
-                copy_rvecn(cbuf, state->x, 0, state->natoms);
+                copy_rvecn(cbuf, as_rvec_array(state->x.data()), 0, state->natoms);
 
-                update_coords(fplog, step, ir, mdatoms, state, f, fcd,
+                update_coords(fplog, step, ir, mdatoms, state, &f, fcd,
                               ekind, M, upd, etrtPOSITION, cr, constr);
                 wallcycle_stop(wcycle, ewcUPDATE);
 
-                /* do we need an extra constraint here? just need to copy out of state->v to upd->xp? */
+                /* do we need an extra constraint here? just need to copy out of as_rvec_array(state->v.data()) to upd->xp? */
                 /* are the small terms in the shake_vir here due
                  * to numerical errors, or are they important
                  * physically? I'm thinking they are just errors, but not completely sure.
                  * For now, will call without actually constraining, constr=NULL*/
-                update_constraints(fplog, step, NULL, ir, mdatoms,
-                                   state, fr->bMolPBC, graph, f,
+                update_constraints(fplog, step, nullptr, ir, mdatoms,
+                                   state, fr->bMolPBC, graph, &f,
                                    &top->idef, tmp_vir,
-                                   cr, nrnb, wcycle, upd, NULL,
+                                   cr, nrnb, wcycle, upd, nullptr,
                                    FALSE, bCalcVir);
             }
             if (EI_VV(ir->eI))
@@ -1499,23 +1530,23 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
         else if (graph)
         {
             /* Need to unshift here */
-            unshift_self(graph, state->box, state->x);
+            unshift_self(graph, state->box, as_rvec_array(state->x.data()));
         }
 
-        if (vsite != NULL)
+        if (vsite != nullptr)
         {
             wallcycle_start(wcycle, ewcVSITECONSTR);
-            if (graph != NULL)
+            if (graph != nullptr)
             {
-                shift_self(graph, state->box, state->x);
+                shift_self(graph, state->box, as_rvec_array(state->x.data()));
             }
-            construct_vsites(vsite, state->x, ir->delta_t, state->v,
+            construct_vsites(vsite, as_rvec_array(state->x.data()), ir->delta_t, as_rvec_array(state->v.data()),
                              top->idef.iparams, top->idef.il,
                              fr->ePBC, fr->bMolPBC, cr, state->box);
 
-            if (graph != NULL)
+            if (graph != nullptr)
             {
-                unshift_self(graph, state->box, state->x);
+                unshift_self(graph, state->box, as_rvec_array(state->x.data()));
             }
             wallcycle_stop(wcycle, ewcVSITECONSTR);
         }
@@ -1574,8 +1605,11 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                Currently done every step so that dhdl is correct in the .edr */
             sum_dhdl(enerd, state->lambda, ir->fepvals);
         }
-        update_box(fplog, step, ir, mdatoms, state, f,
-                   pcoupl_mu, nrnb, upd);
+
+        update_pcouple_after_coordinates(fplog, step, ir, mdatoms,
+                                         pres, force_vir, shake_vir,
+                                         parrinellorahmanMu,
+                                         state, nrnb, upd);
 
         /* ################# END UPDATE STEP 2 ################# */
         /* #### We now have r(t+dt) and v(t+dt/2)  ############# */
@@ -1589,24 +1623,30 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
             bSumEkinhOld = TRUE;
         }
 
-        /* #########  BEGIN PREPARING EDR OUTPUT  ###########  */
-
-        /* use the directly determined last velocity, not actually the averaged half steps */
-        if (bTrotter && ir->eI == eiVV)
+        if (bCalcEner)
         {
-            enerd->term[F_EKIN] = last_ekin;
-        }
-        enerd->term[F_ETOT] = enerd->term[F_EPOT] + enerd->term[F_EKIN];
+            /* #########  BEGIN PREPARING EDR OUTPUT  ###########  */
 
-        if (EI_VV(ir->eI))
-        {
-            enerd->term[F_ECONSERVED] = enerd->term[F_ETOT] + saved_conserved_quantity;
-        }
-        else
-        {
-            enerd->term[F_ECONSERVED] = enerd->term[F_ETOT] + compute_conserved_from_auxiliary(ir, state, &MassQ);
+            /* use the directly determined last velocity, not actually the averaged half steps */
+            if (bTrotter && ir->eI == eiVV)
+            {
+                enerd->term[F_EKIN] = last_ekin;
+            }
+            enerd->term[F_ETOT] = enerd->term[F_EPOT] + enerd->term[F_EKIN];
+
+            if (integratorHasConservedEnergyQuantity(ir))
+            {
+                if (EI_VV(ir->eI))
+                {
+                    enerd->term[F_ECONSERVED] = enerd->term[F_ETOT] + saved_conserved_quantity;
+                }
+                else
+                {
+                    enerd->term[F_ECONSERVED] = enerd->term[F_ETOT] + NPT_energy(ir, state, &MassQ);
+                }
+            }
+            /* #########  END PREPARING EDR OUTPUT  ###########  */
         }
-        /* #########  END PREPARING EDR OUTPUT  ###########  */
 
         /* Output stuff */
         if (MASTER(cr))
@@ -1614,8 +1654,8 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
             if (fplog && do_log && bDoExpanded)
             {
                 /* only needed if doing expanded ensemble */
-                PrintFreeEnergyInfoToFile(fplog, ir->fepvals, ir->expandedvals, ir->bSimTemp ? ir->simtempvals : NULL,
-                                          &state_global->dfhist, state->fep_state, ir->nstlog, step);
+                PrintFreeEnergyInfoToFile(fplog, ir->fepvals, ir->expandedvals, ir->bSimTemp ? ir->simtempvals : nullptr,
+                                          state_global->dfhist, state->fep_state, ir->nstlog, step);
             }
             if (bCalcEner)
             {
@@ -1633,7 +1673,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
             gmx_bool do_dr  = do_per_step(step, ir->nstdisreout);
             gmx_bool do_or  = do_per_step(step, ir->nstorireout);
 
-            print_ebin(mdoutf_get_fp_ene(outf), do_ene, do_dr, do_or, do_log ? fplog : NULL,
+            print_ebin(mdoutf_get_fp_ene(outf), do_ene, do_dr, do_or, do_log ? fplog : nullptr,
                        step, t,
                        eprNORMAL, mdebin, fcd, groups, &(ir->opts));
 
@@ -1676,9 +1716,10 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
             do_per_step(step, ir->swap->nstswap))
         {
             bNeedRepartition = do_swapcoords(cr, step, t, ir, wcycle,
-                                             bRerunMD ? rerun_fr.x   : state->x,
+                                             bRerunMD ? rerun_fr.x   : as_rvec_array(state->x.data()),
                                              bRerunMD ? rerun_fr.box : state->box,
-                                             top_global, MASTER(cr) && bVerbose, bRerunMD);
+                                             MASTER(cr) && mdrunOptions.verbose,
+                                             bRerunMD);
 
             if (bNeedRepartition && DOMAINDECOMP(cr))
             {
@@ -1703,12 +1744,12 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                                 vsite, constr,
                                 nrnb, wcycle, FALSE);
             shouldCheckNumberOfBondedInteractions = true;
-            update_realloc(upd, state->nalloc);
+            update_realloc(upd, state->natoms);
         }
 
         bFirstStep             = FALSE;
         bInitStep              = FALSE;
-        startingFromCheckpoint = FALSE;
+        startingFromCheckpoint = false;
 
         /* #######  SET VARIABLES FOR NEXT ITERATION IF THEY STILL NEED IT ###### */
         /* With all integrators, except VV, we need to retain the pressure
@@ -1726,9 +1767,9 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
 
         /* #######  END SET VARIABLES FOR NEXT ITERATION ###### */
 
-        if ( (membed != NULL) && (!bLastStep) )
+        if ( (membed != nullptr) && (!bLastStep) )
         {
-            rescale_membed(step_rel, membed, state_global->x);
+            rescale_membed(step_rel, membed, as_rvec_array(state_global->x.data()));
         }
 
         if (bRerunMD)
@@ -1780,8 +1821,8 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                           "resetting counters later in the run, e.g. with gmx "
                           "mdrun -resetstep.", step);
             }
-            reset_all_counters(fplog, cr, step, &step_rel, ir, wcycle, nrnb, walltime_accounting,
-                               use_GPU(fr->nbv) ? fr->nbv : NULL);
+            reset_all_counters(fplog, mdlog, cr, step, &step_rel, ir, wcycle, nrnb, walltime_accounting,
+                               use_GPU(fr->nbv) ? fr->nbv : nullptr);
             wcycle_set_reset_counters(wcycle, -1);
             if (!(cr->duty & DUTY_PME))
             {
@@ -1811,7 +1852,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
 
     if (bRerunMD && MASTER(cr))
     {
-        close_trj(status);
+        close_trx(status);
     }
 
     if (!(cr->duty & DUTY_PME))
@@ -1833,12 +1874,12 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
 
     if (bPMETune)
     {
-        pme_loadbal_done(pme_loadbal, cr, fplog, use_GPU(fr->nbv));
+        pme_loadbal_done(pme_loadbal, fplog, mdlog, use_GPU(fr->nbv));
     }
 
     done_shellfc(fplog, shellfc, step_rel);
 
-    if (repl_ex_nst > 0 && MASTER(cr))
+    if (useReplicaExchange && MASTER(cr))
     {
         print_replica_exchange_statistics(fplog, repl_ex);
     }
@@ -1849,6 +1890,9 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
         finish_swapcoords(ir->swap);
     }
 
+    /* Do essential dynamics cleanup if needed. Close .edo file */
+    done_ed(&ed);
+
     /* IMD cleanup, if bIMD is TRUE. */
     IMD_finalize(ir->bIMD, ir->imd);
 
index 798f7682742304554848fcc85b505101ffa6cad9..9fcdb4ce480531a0cec4eda9cf28e4be3130d87e 100644 (file)
 
 #include "config.h"
 
-#include <stdio.h>
-#include <string.h>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
 
 #include "gromacs/commandline/filenm.h"
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/readinp.h"
+#include "gromacs/domdec/domdec.h"
 #include "gromacs/gmxlib/network.h"
 #include "gromacs/mdlib/main.h"
 #include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/utility/arraysize.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 #include "mdrun_main.h"
+#include "repl_ex.h"
 #include "runner.h"
 
 /*! \brief Return whether either of the command-line parameters that
@@ -87,6 +90,15 @@ static bool is_multisim_option_set(int argc, const char *const argv[])
 
 //! Implements C-style main function for mdrun
 int gmx_mdrun(int argc, char *argv[])
+{
+    gmx::Mdrunner runner;
+    return runner.mainFunction(argc, argv);
+}
+
+namespace gmx
+{
+
+int Mdrunner::mainFunction(int argc, char *argv[])
 {
     const char   *desc[] = {
         "[THISMODULE] is the main computational chemistry engine",
@@ -156,7 +168,8 @@ int gmx_mdrun(int argc, char *argv[])
         "The option [TT]-pforce[tt] is useful when you suspect a simulation",
         "crashes due to too large forces. With this option coordinates and",
         "forces of atoms with a force larger than a certain value will",
-        "be printed to stderr.",
+        "be printed to stderr. It will also terminate the run when non-finite",
+        "forces are present.",
         "[PAR]",
         "Checkpoints containing the complete state of the system are written",
         "at regular intervals (option [TT]-cpt[tt]) to the file [TT]-cpo[tt],",
@@ -226,101 +239,29 @@ int gmx_mdrun(int argc, char *argv[])
         "[PAR]",
         "When [TT]mdrun[tt] is started with MPI, it does not run niced by default."
     };
-    t_commrec    *cr;
-    t_filenm      fnm[] = {
-        { efTPR, NULL,      NULL,       ffREAD },
-        { efTRN, "-o",      NULL,       ffWRITE },
-        { efCOMPRESSED, "-x", NULL,     ffOPTWR },
-        { efCPT, "-cpi",    NULL,       ffOPTRD | ffALLOW_MISSING },
-        { efCPT, "-cpo",    NULL,       ffOPTWR },
-        { efSTO, "-c",      "confout",  ffWRITE },
-        { efEDR, "-e",      "ener",     ffWRITE },
-        { efLOG, "-g",      "md",       ffWRITE },
-        { efXVG, "-dhdl",   "dhdl",     ffOPTWR },
-        { efXVG, "-field",  "field",    ffOPTWR },
-        { efXVG, "-table",  "table",    ffOPTRD },
-        { efXVG, "-tablep", "tablep",   ffOPTRD },
-        { efXVG, "-tableb", "table",    ffOPTRDMULT },
-        { efTRX, "-rerun",  "rerun",    ffOPTRD },
-        { efXVG, "-tpi",    "tpi",      ffOPTWR },
-        { efXVG, "-tpid",   "tpidist",  ffOPTWR },
-        { efEDI, "-ei",     "sam",      ffOPTRD },
-        { efXVG, "-eo",     "edsam",    ffOPTWR },
-        { efXVG, "-devout", "deviatie", ffOPTWR },
-        { efXVG, "-runav",  "runaver",  ffOPTWR },
-        { efXVG, "-px",     "pullx",    ffOPTWR },
-        { efXVG, "-pf",     "pullf",    ffOPTWR },
-        { efXVG, "-ro",     "rotation", ffOPTWR },
-        { efLOG, "-ra",     "rotangles", ffOPTWR },
-        { efLOG, "-rs",     "rotslabs", ffOPTWR },
-        { efLOG, "-rt",     "rottorque", ffOPTWR },
-        { efMTX, "-mtx",    "nm",       ffOPTWR },
-        { efRND, "-multidir", NULL,      ffOPTRDMULT},
-        { efDAT, "-membed", "membed",   ffOPTRD },
-        { efTOP, "-mp",     "membed",   ffOPTRD },
-        { efNDX, "-mn",     "membed",   ffOPTRD },
-        { efXVG, "-if",     "imdforces", ffOPTWR },
-        { efXVG, "-swap",   "swapions", ffOPTWR }
-    };
-    const int     NFILE = asize(fnm);
-
-    /* Command line options ! */
-    gmx_bool          bDDBondCheck  = TRUE;
-    gmx_bool          bDDBondComm   = TRUE;
-    gmx_bool          bTunePME      = TRUE;
-    gmx_bool          bVerbose      = FALSE;
-    gmx_bool          bRerunVSite   = FALSE;
-    gmx_bool          bConfout      = TRUE;
-    gmx_bool          bReproducible = FALSE;
-    gmx_bool          bIMDwait      = FALSE;
-    gmx_bool          bIMDterm      = FALSE;
-    gmx_bool          bIMDpull      = FALSE;
-
-    int               npme          = -1;
-    int               nstlist       = 0;
-    int               nmultisim     = 0;
-    int               nstglobalcomm = -1;
-    int               repl_ex_nst   = 0;
-    int               repl_ex_seed  = -1;
-    int               repl_ex_nex   = 0;
-    int               nstepout      = 100;
-    int               resetstep     = -1;
-    gmx_int64_t       nsteps        = -2;   /* the value -2 means that the mdp option will be used */
-    int               imdport       = 8888; /* can be almost anything, 8888 is easy to remember */
-
-    rvec              realddxyz                   = {0, 0, 0};
-    const char       *ddrank_opt[ddrankorderNR+1] =
-    { NULL, "interleave", "pp_pme", "cartesian", NULL };
-    const char       *dddlb_opt[] =
-    { NULL, "auto", "no", "yes", NULL };
-    const char       *thread_aff_opt[threadaffNR+1] =
-    { NULL, "auto", "on", "off", NULL };
-    const char       *nbpu_opt[] =
-    { NULL, "auto", "cpu", "gpu", "gpu_cpu", NULL };
-    real              rdd                   = 0.0, rconstr = 0.0, dlb_scale = 0.8, pforce = -1;
-    char             *ddcsx                 = NULL, *ddcsy = NULL, *ddcsz = NULL;
-    real              cpt_period            = 15.0, max_hours = -1;
+
+    /* Command line options */
+    rvec              realddxyz                                               = {0, 0, 0};
+    const char       *ddrank_opt_choices[static_cast<int>(DdRankOrder::nr)+1] =
+    { nullptr, "interleave", "pp_pme", "cartesian", nullptr };
+    const char       *dddlb_opt_choices[static_cast<int>(DlbOption::nr)+1] =
+    { nullptr, "auto", "no", "yes", nullptr };
+    const char       *thread_aff_opt_choices[threadaffNR+1] =
+    { nullptr, "auto", "on", "off", nullptr };
+    const char       *nbpu_opt_choices[] =
+    { nullptr, "auto", "cpu", "gpu", "gpu_cpu", nullptr };
     gmx_bool          bTryToAppendFiles     = TRUE;
-    gmx_bool          bKeepAndNumCPT        = FALSE;
-    gmx_bool          bResetCountersHalfWay = FALSE;
-    gmx_output_env_t *oenv                  = NULL;
+    const char       *gpuIdTaskAssignment   = "";
 
-    /* Non transparent initialization of a complex gmx_hw_opt_t struct.
-     * But unfortunately we are not allowed to call a function here,
-     * since declarations follow below.
-     */
-    gmx_hw_opt_t    hw_opt = {
-        0, 0, 0, 0, threadaffSEL, 0, 0,
-        { NULL, FALSE, 0, NULL }
-    };
+    ImdOptions       &imdOptions = mdrunOptions.imdOptions;
 
-    t_pargs         pa[] = {
+    t_pargs           pa[] = {
 
         { "-dd",      FALSE, etRVEC, {&realddxyz},
           "Domain decomposition grid, 0 is optimize" },
-        { "-ddorder", FALSE, etENUM, {ddrank_opt},
+        { "-ddorder", FALSE, etENUM, {ddrank_opt_choices},
           "DD rank order" },
-        { "-npme",    FALSE, etINT, {&npme},
+        { "-npme",    FALSE, etINT, {&domdecOptions.numPmeRanks},
           "Number of separate ranks to be used for PME, -1 is guess" },
         { "-nt",      FALSE, etINT, {&hw_opt.nthreads_tot},
           "Total number of threads to start (0 is guess)" },
@@ -330,97 +271,92 @@ int gmx_mdrun(int argc, char *argv[])
           "Number of OpenMP threads per MPI rank to start (0 is guess)" },
         { "-ntomp_pme", FALSE, etINT, {&hw_opt.nthreads_omp_pme},
           "Number of OpenMP threads per MPI rank to start (0 is -ntomp)" },
-        { "-pin",     FALSE, etENUM, {thread_aff_opt},
+        { "-pin",     FALSE, etENUM, {thread_aff_opt_choices},
           "Whether mdrun should try to set thread affinities" },
         { "-pinoffset", FALSE, etINT, {&hw_opt.core_pinning_offset},
           "The lowest logical core number to which mdrun should pin the first thread" },
         { "-pinstride", FALSE, etINT, {&hw_opt.core_pinning_stride},
           "Pinning distance in logical cores for threads, use 0 to minimize the number of threads per physical core" },
-        { "-gpu_id",  FALSE, etSTR, {&hw_opt.gpu_opt.gpu_id},
+        { "-gpu_id",  FALSE, etSTR, {&gpuIdTaskAssignment},
           "List of GPU device id-s to use, specifies the per-node PP rank to GPU mapping" },
-        { "-ddcheck", FALSE, etBOOL, {&bDDBondCheck},
+        { "-ddcheck", FALSE, etBOOL, {&domdecOptions.checkBondedInteractions},
           "Check for all bonded interactions with DD" },
-        { "-ddbondcomm", FALSE, etBOOL, {&bDDBondComm},
+        { "-ddbondcomm", FALSE, etBOOL, {&domdecOptions.useBondedCommunication},
           "HIDDENUse special bonded atom communication when [TT]-rdd[tt] > cut-off" },
-        { "-rdd",     FALSE, etREAL, {&rdd},
+        { "-rdd",     FALSE, etREAL, {&domdecOptions.minimumCommunicationRange},
           "The maximum distance for bonded interactions with DD (nm), 0 is determine from initial coordinates" },
-        { "-rcon",    FALSE, etREAL, {&rconstr},
+        { "-rcon",    FALSE, etREAL, {&domdecOptions.constraintCommunicationRange},
           "Maximum distance for P-LINCS (nm), 0 is estimate" },
-        { "-dlb",     FALSE, etENUM, {dddlb_opt},
+        { "-dlb",     FALSE, etENUM, {dddlb_opt_choices},
           "Dynamic load balancing (with DD)" },
-        { "-dds",     FALSE, etREAL, {&dlb_scale},
+        { "-dds",     FALSE, etREAL, {&domdecOptions.dlbScaling},
           "Fraction in (0,1) by whose reciprocal the initial DD cell size will be increased in order to "
           "provide a margin in which dynamic load balancing can act while preserving the minimum cell size." },
-        { "-ddcsx",   FALSE, etSTR, {&ddcsx},
+        { "-ddcsx",   FALSE, etSTR, {&domdecOptions.cellSizeX},
           "HIDDENA string containing a vector of the relative sizes in the x "
           "direction of the corresponding DD cells. Only effective with static "
           "load balancing." },
-        { "-ddcsy",   FALSE, etSTR, {&ddcsy},
+        { "-ddcsy",   FALSE, etSTR, {&domdecOptions.cellSizeY},
           "HIDDENA string containing a vector of the relative sizes in the y "
           "direction of the corresponding DD cells. Only effective with static "
           "load balancing." },
-        { "-ddcsz",   FALSE, etSTR, {&ddcsz},
+        { "-ddcsz",   FALSE, etSTR, {&domdecOptions.cellSizeZ},
           "HIDDENA string containing a vector of the relative sizes in the z "
           "direction of the corresponding DD cells. Only effective with static "
           "load balancing." },
-        { "-gcom",    FALSE, etINT, {&nstglobalcomm},
+        { "-gcom",    FALSE, etINT, {&mdrunOptions.globalCommunicationInterval},
           "Global communication frequency" },
-        { "-nb",      FALSE, etENUM, {&nbpu_opt},
+        { "-nb",      FALSE, etENUM, {nbpu_opt_choices},
           "Calculate non-bonded interactions on" },
-        { "-nstlist", FALSE, etINT, {&nstlist},
+        { "-nstlist", FALSE, etINT, {&nstlist_cmdline},
           "Set nstlist when using a Verlet buffer tolerance (0 is guess)" },
-        { "-tunepme", FALSE, etBOOL, {&bTunePME},
+        { "-tunepme", FALSE, etBOOL, {&mdrunOptions.tunePme},
           "Optimize PME load between PP/PME ranks or GPU/CPU (only with the Verlet cut-off scheme)" },
-        { "-v",       FALSE, etBOOL, {&bVerbose},
+        { "-v",       FALSE, etBOOL, {&mdrunOptions.verbose},
           "Be loud and noisy" },
         { "-pforce",  FALSE, etREAL, {&pforce},
           "Print all forces larger than this (kJ/mol nm)" },
-        { "-reprod",  FALSE, etBOOL, {&bReproducible},
+        { "-reprod",  FALSE, etBOOL, {&mdrunOptions.reproducible},
           "Try to avoid optimizations that affect binary reproducibility" },
-        { "-cpt",     FALSE, etREAL, {&cpt_period},
+        { "-cpt",     FALSE, etREAL, {&mdrunOptions.checkpointOptions.period},
           "Checkpoint interval (minutes)" },
-        { "-cpnum",   FALSE, etBOOL, {&bKeepAndNumCPT},
+        { "-cpnum",   FALSE, etBOOL, {&mdrunOptions.checkpointOptions.keepAndNumberCheckpointFiles},
           "Keep and number checkpoint files" },
         { "-append",  FALSE, etBOOL, {&bTryToAppendFiles},
           "Append to previous output files when continuing from checkpoint instead of adding the simulation part number to all file names" },
-        { "-nsteps",  FALSE, etINT64, {&nsteps},
+        { "-nsteps",  FALSE, etINT64, {&mdrunOptions.numStepsCommandline},
           "Run this number of steps, overrides .mdp file option (-1 means infinite, -2 means use mdp option, smaller is invalid)" },
-        { "-maxh",   FALSE, etREAL, {&max_hours},
+        { "-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, {&repl_ex_nst},
+        { "-replex",  FALSE, etINT, {&replExParams.exchangeInterval},
           "Attempt replica exchange periodically with this period (steps)" },
-        { "-nex",  FALSE, etINT, {&repl_ex_nex},
+        { "-nex",  FALSE, etINT, {&replExParams.numExchanges},
           "Number of random exchanges to carry out each exchange interval (N^3 is one suggestion).  -nex zero or not specified gives neighbor replica exchange." },
-        { "-reseed",  FALSE, etINT, {&repl_ex_seed},
+        { "-reseed",  FALSE, etINT, {&replExParams.randomSeed},
           "Seed for replica exchange, -1 is generate a seed" },
-        { "-imdport",    FALSE, etINT, {&imdport},
+        { "-imdport",    FALSE, etINT, {&imdOptions.port},
           "HIDDENIMD listening port" },
-        { "-imdwait",  FALSE, etBOOL, {&bIMDwait},
+        { "-imdwait",  FALSE, etBOOL, {&imdOptions.wait},
           "HIDDENPause the simulation while no IMD client is connected" },
-        { "-imdterm",  FALSE, etBOOL, {&bIMDterm},
+        { "-imdterm",  FALSE, etBOOL, {&imdOptions.terminatable},
           "HIDDENAllow termination of the simulation from IMD client" },
-        { "-imdpull",  FALSE, etBOOL, {&bIMDpull},
+        { "-imdpull",  FALSE, etBOOL, {&imdOptions.pull},
           "HIDDENAllow pulling in the simulation from IMD client" },
-        { "-rerunvsite", FALSE, etBOOL, {&bRerunVSite},
+        { "-rerunvsite", FALSE, etBOOL, {&mdrunOptions.rerunConstructVsites},
           "HIDDENRecalculate virtual site coordinates with [TT]-rerun[tt]" },
-        { "-confout", FALSE, etBOOL, {&bConfout},
+        { "-confout", FALSE, etBOOL, {&mdrunOptions.writeConfout},
           "HIDDENWrite the last configuration with [TT]-c[tt] and force checkpointing at the last step" },
-        { "-stepout", FALSE, etINT, {&nstepout},
+        { "-stepout", FALSE, etINT, {&mdrunOptions.verboseStepPrintInterval},
           "HIDDENFrequency of writing the remaining wall clock time for the run" },
-        { "-resetstep", FALSE, etINT, {&resetstep},
+        { "-resetstep", FALSE, etINT, {&mdrunOptions.timingOptions.resetStep},
           "HIDDENReset cycle counters after these many time steps" },
-        { "-resethway", FALSE, etBOOL, {&bResetCountersHalfWay},
+        { "-resethway", FALSE, etBOOL, {&mdrunOptions.timingOptions.resetHalfway},
           "HIDDENReset the cycle counters after half the number of steps or halfway [TT]-maxh[tt]" }
     };
-    unsigned long   Flags;
-    ivec            ddxyz;
-    int             dd_rank_order;
-    gmx_bool        bDoAppendFiles, bStartFromCpt;
-    FILE           *fplog;
-    int             rc;
-    char          **multidir = NULL;
+    int               rc;
+    char            **multidir = nullptr;
 
     cr = init_commrec();
 
@@ -446,34 +382,53 @@ int gmx_mdrun(int argc, char *argv[])
        }
      */
 
-    if (!parse_common_args(&argc, argv, PCA_Flags, NFILE, fnm, asize(pa), pa,
-                           asize(desc), desc, 0, NULL, &oenv))
+    if (!parse_common_args(&argc, argv, PCA_Flags, nfile, fnm, asize(pa), pa,
+                           asize(desc), desc, 0, nullptr, &oenv))
     {
+        sfree(cr);
         return 0;
     }
 
+    // Handle the option that permits the user to select a GPU task
+    // assignment, which could be in an environment variable (so that
+    // there is a way to customize it, when using MPI in heterogeneous
+    // contexts).
+    {
+        // TODO Argument parsing can't handle std::string. We should
+        // fix that by changing the parsing, once more of the roles of
+        // handling, validating and implementing defaults for user
+        // command-line options have been seperated.
+        hw_opt.gpuIdTaskAssignment = gpuIdTaskAssignment;
+        const char *env = getenv("GMX_GPU_ID");
+        if (env != nullptr)
+        {
+            if (!hw_opt.gpuIdTaskAssignment.empty())
+            {
+                gmx_fatal(FARGS, "GMX_GPU_ID and -gpu_id can not be used at the same time");
+            }
+            hw_opt.gpuIdTaskAssignment = env;
+        }
+    }
 
-    dd_rank_order = nenum(ddrank_opt);
-
-    hw_opt.thread_affinity = nenum(thread_aff_opt);
+    hw_opt.thread_affinity = nenum(thread_aff_opt_choices);
 
     /* now check the -multi and -multidir option */
-    if (opt2bSet("-multidir", NFILE, fnm))
+    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);
+        nmultisim = opt2fns(&multidir, "-multidir", nfile, fnm);
     }
 
 
-    if (repl_ex_nst != 0 && nmultisim < 2)
+    if (replExParams.exchangeInterval != 0 && nmultisim < 2)
     {
         gmx_fatal(FARGS, "Need at least two replicas for replica exchange (option -multi)");
     }
 
-    if (repl_ex_nex < 0)
+    if (replExParams.numExchanges < 0)
     {
         gmx_fatal(FARGS, "Replica exchange number of exchanges needs to be positive");
     }
@@ -481,14 +436,14 @@ int gmx_mdrun(int argc, char *argv[])
     if (nmultisim >= 1)
     {
 #if !GMX_THREAD_MPI
-        init_multisystem(cr, nmultisim, multidir, NFILE, fnm);
+        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
     }
 
-    if (!opt2bSet("-cpi", NFILE, fnm))
+    if (!opt2bSet("-cpi", nfile, fnm))
     {
         // If we are not starting from a checkpoint we never allow files to be appended
         // to, since that has caused a ton of strange behaviour and bugs in the past.
@@ -504,56 +459,45 @@ int gmx_mdrun(int argc, char *argv[])
         }
     }
 
-    handleRestart(cr, bTryToAppendFiles, NFILE, fnm, &bDoAppendFiles, &bStartFromCpt);
-
-    Flags = opt2bSet("-rerun", NFILE, fnm) ? MD_RERUN : 0;
-    Flags = Flags | (bDDBondCheck  ? MD_DDBONDCHECK  : 0);
-    Flags = Flags | (bDDBondComm   ? MD_DDBONDCOMM   : 0);
-    Flags = Flags | (bTunePME      ? MD_TUNEPME      : 0);
-    Flags = Flags | (bConfout      ? MD_CONFOUT      : 0);
-    Flags = Flags | (bRerunVSite   ? MD_RERUN_VSITE  : 0);
-    Flags = Flags | (bReproducible ? MD_REPRODUCIBLE : 0);
-    Flags = Flags | (bDoAppendFiles  ? MD_APPENDFILES  : 0);
-    Flags = Flags | (opt2parg_bSet("-append", asize(pa), pa) ? MD_APPENDFILESSET : 0);
-    Flags = Flags | (bKeepAndNumCPT ? MD_KEEPANDNUMCPT : 0);
-    Flags = Flags | (bStartFromCpt ? MD_STARTFROMCPT : 0);
-    Flags = Flags | (bResetCountersHalfWay ? MD_RESETCOUNTERSHALFWAY : 0);
-    Flags = Flags | (opt2parg_bSet("-ntomp", asize(pa), pa) ? MD_NTOMPSET : 0);
-    Flags = Flags | (bIMDwait      ? MD_IMDWAIT      : 0);
-    Flags = Flags | (bIMDterm      ? MD_IMDTERM      : 0);
-    Flags = Flags | (bIMDpull      ? MD_IMDPULL      : 0);
+    ContinuationOptions &continuationOptions = mdrunOptions.continuationOptions;
+
+    continuationOptions.appendFilesOptionSet = opt2parg_bSet("-append", asize(pa), pa);
+
+    handleRestart(cr, bTryToAppendFiles, nfile, fnm, &continuationOptions.appendFiles, &continuationOptions.startedFromCheckpoint);
+
+    mdrunOptions.rerun            = opt2bSet("-rerun", nfile, fnm);
+    mdrunOptions.ntompOptionIsSet = opt2parg_bSet("-ntomp", asize(pa), pa);
 
     /* We postpone opening the log file if we are appending, so we can
        first truncate the old log file and append to the correct position
        there instead.  */
-    if (MASTER(cr) && !bDoAppendFiles)
+    if (MASTER(cr) && !continuationOptions.appendFiles)
     {
-        gmx_log_open(ftp2fn(efLOG, NFILE, fnm), cr,
-                     Flags & MD_APPENDFILES, &fplog);
+        gmx_log_open(ftp2fn(efLOG, nfile, fnm), cr,
+                     continuationOptions.appendFiles, &fplog);
     }
     else
     {
-        fplog = NULL;
+        fplog = nullptr;
     }
 
-    ddxyz[XX] = (int)(realddxyz[XX] + 0.5);
-    ddxyz[YY] = (int)(realddxyz[YY] + 0.5);
-    ddxyz[ZZ] = (int)(realddxyz[ZZ] + 0.5);
+    domdecOptions.rankOrder    = static_cast<DdRankOrder>(nenum(ddrank_opt_choices));
+    domdecOptions.dlbOption    = static_cast<DlbOption>(nenum(dddlb_opt_choices));
+    domdecOptions.numCells[XX] = (int)(realddxyz[XX] + 0.5);
+    domdecOptions.numCells[YY] = (int)(realddxyz[YY] + 0.5);
+    domdecOptions.numCells[ZZ] = (int)(realddxyz[ZZ] + 0.5);
 
-    rc = gmx::mdrunner(&hw_opt, fplog, cr, NFILE, fnm, oenv, bVerbose,
-                       nstglobalcomm, ddxyz, dd_rank_order, npme, rdd, rconstr,
-                       dddlb_opt[0], dlb_scale, ddcsx, ddcsy, ddcsz,
-                       nbpu_opt[0], nstlist,
-                       nsteps, nstepout, resetstep,
-                       nmultisim, repl_ex_nst, repl_ex_nex, repl_ex_seed,
-                       pforce, cpt_period, max_hours, imdport, Flags);
+    nbpu_opt  = nbpu_opt_choices[0];
+    rc        = mdrunner();
 
     /* Log file has to be closed in mdrunner if we are appending to it
        (fplog not set here) */
-    if (MASTER(cr) && !bDoAppendFiles)
+    if (MASTER(cr) && !continuationOptions.appendFiles)
     {
         gmx_log_close(fplog);
     }
 
     return rc;
 }
+
+} // namespace
index cab4835715d82f02ee7788c351385133a7962715..375df08f419c02671b58abd008f8421c491e6484 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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,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.
@@ -40,8 +40,8 @@
 #include <stdlib.h>
 
 #include "gromacs/commandline/filenm.h"
-#include "gromacs/essentialdynamics/edsam.h"
 #include "gromacs/fileio/readinp.h"
+#include "gromacs/fileio/warninp.h"
 #include "gromacs/gmxlib/network.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/state.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/topology/index.h"
+#include "gromacs/topology/mtop_lookup.h"
 #include "gromacs/topology/mtop_util.h"
 #include "gromacs/topology/topology.h"
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/filestream.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 
@@ -106,18 +109,15 @@ static int get_mol_id(int at, gmx_mtop_t  *mtop, int *type, int *block)
     int                   mol_id = 0;
     int                   i;
     int                   atnr_mol;
-    gmx_mtop_atomlookup_t alook;
 
-    alook = gmx_mtop_atomlookup_settle_init(mtop);
-    gmx_mtop_atomnr_to_molblock_ind(alook, at, block, &mol_id, &atnr_mol);
+    *block = 0;
+    mtopGetMolblockIndex(mtop, at, block, &mol_id, &atnr_mol);
     for (i = 0; i < *block; i++)
     {
         mol_id += mtop->molblock[i].nmol;
     }
     *type = mtop->molblock[*block].type;
 
-    gmx_mtop_atomlookup_destroy(alook);
-
     return mol_id;
 }
 
@@ -222,7 +222,11 @@ static void get_input(const char *membed_input, real *xy_fac, real *xy_max, real
 
     wi = init_warning(TRUE, 0);
 
-    inp = read_inpfile(membed_input, &ninp, wi);
+    {
+        gmx::TextInputFile stream(membed_input);
+        inp = read_inpfile(&stream, membed_input, &ninp, wi);
+        stream.close();
+    }
     ITYPE ("nxy", *it_xy, 1000);
     ITYPE ("nz", *it_z, 0);
     RTYPE ("xyinit", *xy_fac, 0.5);
@@ -234,8 +238,13 @@ static void get_input(const char *membed_input, real *xy_fac, real *xy_max, real
     ITYPE ("maxwarn", *maxwarn, 0);
     ITYPE ("pieces", *pieces, 1);
     EETYPE("asymmetry", *bALLOW_ASYMMETRY, yesno_names);
+
     check_warning_error(wi, FARGS);
-    write_inpfile(membed_input, ninp, inp, FALSE, wi);
+    {
+        gmx::TextOutputFile stream(membed_input);
+        write_inpfile(&stream, membed_input, ninp, inp, FALSE, WriteMdpHeader::yes, wi);
+        stream.close();
+    }
     done_warning(wi, FARGS);
 }
 
@@ -722,13 +731,12 @@ static void rm_group(gmx_groups_t *groups, gmx_mtop_t *mtop, rm_t *rm_p, t_state
     mtop->mols.index = new_mols;
     mtop->natoms    -= n;
     state->natoms   -= n;
-    state->nalloc    = state->natoms;
-    snew(x_tmp, state->nalloc);
-    snew(v_tmp, state->nalloc);
+    snew(x_tmp, state->natoms);
+    snew(v_tmp, state->natoms);
 
     for (i = 0; i < egcNR; i++)
     {
-        if (groups->grpnr[i] != NULL)
+        if (groups->grpnr[i] != nullptr)
         {
             groups->ngrpnr[i] = state->natoms;
             snew(new_egrp[i], state->natoms);
@@ -752,7 +760,7 @@ static void rm_group(gmx_groups_t *groups, gmx_mtop_t *mtop, rm_t *rm_p, t_state
         {
             for (j = 0; j < egcNR; j++)
             {
-                if (groups->grpnr[j] != NULL)
+                if (groups->grpnr[j] != nullptr)
                 {
                     new_egrp[j][i-rm] = groups->grpnr[j][i];
                 }
@@ -779,14 +787,20 @@ static void rm_group(gmx_groups_t *groups, gmx_mtop_t *mtop, rm_t *rm_p, t_state
             }
         }
     }
-    sfree(state->x);
-    state->x = x_tmp;
-    sfree(state->v);
-    state->v = v_tmp;
+    for (int i = 0; i < state->natoms; i++)
+    {
+        copy_rvec(x_tmp[i], state->x[i]);
+    }
+    sfree(x_tmp);
+    for (int i = 0; i < state->natoms; i++)
+    {
+        copy_rvec(v_tmp[i], state->v[i]);
+    }
+    sfree(v_tmp);
 
     for (i = 0; i < egcNR; i++)
     {
-        if (groups->grpnr[i] != NULL)
+        if (groups->grpnr[i] != nullptr)
         {
             sfree(groups->grpnr[i]);
             groups->grpnr[i] = new_egrp[i];
@@ -810,7 +824,7 @@ static void rm_group(gmx_groups_t *groups, gmx_mtop_t *mtop, rm_t *rm_p, t_state
 }
 
 /* remove al bonded interactions from mtop for the molecule to be embedded */
-int rm_bonded(t_block *ins_at, gmx_mtop_t *mtop)
+static int rm_bonded(t_block *ins_at, gmx_mtop_t *mtop)
 {
     int       i, j, m;
     int       type, natom, nmol, at, atom1 = 0, rm_at = 0;
@@ -904,7 +918,7 @@ static void top_update(const char *topfile, rm_t *rm_p, gmx_mtop_t *mtop)
         if (buf[0] != ';')
         {
             strcpy(buf2, buf);
-            if ((temp = strchr(buf2, '\n')) != NULL)
+            if ((temp = strchr(buf2, '\n')) != nullptr)
             {
                 temp[0] = '\0';
             }
@@ -912,7 +926,7 @@ static void top_update(const char *topfile, rm_t *rm_p, gmx_mtop_t *mtop)
             if (buf2[0] == '[')
             {
                 buf2[0] = ' ';
-                if ((temp = strchr(buf2, '\n')) != NULL)
+                if ((temp = strchr(buf2, '\n')) != nullptr)
                 {
                     temp[0] = '\0';
                 }
@@ -1009,7 +1023,7 @@ gmx_membed_t *init_membed(FILE *fplog, int nfile, const t_filenm fnm[], gmx_mtop
     int                       i, rm_bonded_at, fr_id, fr_i = 0, tmp_id, warn = 0;
     int                       ng, j, max_lip_rm, ins_grp_id, ntype, lip_rm;
     real                      prot_area;
-    rvec                     *r_ins = NULL;
+    rvec                     *r_ins = nullptr;
     t_block                  *ins_at, *rest_at;
     pos_ins_t                *pos_ins;
     mem_t                    *mem_p;
@@ -1018,11 +1032,10 @@ gmx_membed_t *init_membed(FILE *fplog, int nfile, const t_filenm fnm[], gmx_mtop
     gmx_bool                  bExcl = FALSE;
     t_atoms                   atoms;
     t_pbc                    *pbc;
-    char                    **piecename = NULL;
-    gmx_membed_t             *membed    = NULL;
+    char                    **piecename = nullptr;
+    gmx_membed_t             *membed    = nullptr;
 
     /* input variables */
-    const char *membed_input;
     real        xy_fac           = 0.5;
     real        xy_max           = 1.0;
     real        z_fac            = 1.0;
@@ -1051,9 +1064,13 @@ gmx_membed_t *init_membed(FILE *fplog, int nfile, const t_filenm fnm[], gmx_mtop
     if (MASTER(cr))
     {
         /* get input data out membed file */
-        membed_input = opt2fn("-membed", nfile, fnm);
-        get_input(membed_input, &xy_fac, &xy_max, &z_fac, &z_max, &it_xy, &it_z, &probe_rad, &low_up_rm,
-                  &maxwarn, &pieces, &bALLOW_ASYMMETRY);
+        try
+        {
+            get_input(opt2fn("-membed", nfile, fnm),
+                      &xy_fac, &xy_max, &z_fac, &z_max, &it_xy, &it_z, &probe_rad, &low_up_rm,
+                      &maxwarn, &pieces, &bALLOW_ASYMMETRY);
+        }
+        GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
 
         if (!EI_DYNAMICS(inputrec->eI) )
         {
@@ -1204,9 +1221,9 @@ gmx_membed_t *init_membed(FILE *fplog, int nfile, const t_filenm fnm[], gmx_mtop
         /* Check that moleculetypes in insertion group are not part of the rest of the system */
         check_types(ins_at, rest_at, mtop);
 
-        init_mem_at(mem_p, mtop, state->x, state->box, pos_ins);
+        init_mem_at(mem_p, mtop, as_rvec_array(state->x.data()), state->box, pos_ins);
 
-        prot_area = est_prot_area(pos_ins, state->x, ins_at, mem_p);
+        prot_area = est_prot_area(pos_ins, as_rvec_array(state->x.data()), ins_at, mem_p);
         if ( (prot_area > prot_vs_box) && ( (state->box[XX][XX]*state->box[YY][YY]-state->box[XX][YY]*state->box[YY][XX]) < box_vs_prot) )
         {
             warn++;
@@ -1236,14 +1253,14 @@ gmx_membed_t *init_membed(FILE *fplog, int nfile, const t_filenm fnm[], gmx_mtop
 
         /* resize the protein by xy and by z if necessary*/
         snew(r_ins, ins_at->nr);
-        init_resize(ins_at, r_ins, pos_ins, mem_p, state->x, bALLOW_ASYMMETRY);
+        init_resize(ins_at, r_ins, pos_ins, mem_p, as_rvec_array(state->x.data()), bALLOW_ASYMMETRY);
         membed->fac[0] = membed->fac[1] = xy_fac;
         membed->fac[2] = z_fac;
 
         membed->xy_step = (xy_max-xy_fac)/(double)(it_xy);
         membed->z_step  = (z_max-z_fac)/(double)(it_z-1);
 
-        resize(r_ins, state->x, pos_ins, membed->fac);
+        resize(r_ins, as_rvec_array(state->x.data()), pos_ins, membed->fac);
 
         /* remove overlapping lipids and water from the membrane box*/
         /*mark molecules to be removed*/
@@ -1251,7 +1268,7 @@ gmx_membed_t *init_membed(FILE *fplog, int nfile, const t_filenm fnm[], gmx_mtop
         set_pbc(pbc, inputrec->ePBC, state->box);
 
         snew(rm_p, 1);
-        lip_rm = gen_rm_list(rm_p, ins_at, rest_at, pbc, mtop, state->x, mem_p, pos_ins,
+        lip_rm = gen_rm_list(rm_p, ins_at, rest_at, pbc, mtop, as_rvec_array(state->x.data()), mem_p, pos_ins,
                              probe_rad, low_up_rm, bALLOW_ASYMMETRY);
         lip_rm -= low_up_rm;
 
index d4da9ee8198c8e8919602cdc7567b4dd7a16e39c..9f754fa9ae5d94afaefdc2ba4647258ea8bf2b39 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * 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.
@@ -46,7 +46,7 @@ struct gmx_mtop_t;
 struct t_commrec;
 struct t_filenm;
 struct t_inputrec;
-struct t_state;
+class t_state;
 
 /* initialisation of membed code */
 gmx_membed_t *init_membed(FILE *fplog, int nfile, const t_filenm fnm[], gmx_mtop_t *mtop,
index a3d89573f6936e2821da63f792bd7caed3a53537..c886b180e4e8f5dfcaf8e2fa8e1ec54b42f59fb8 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, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,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.
@@ -53,6 +53,7 @@
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/mdtypes/state.h"
 #include "gromacs/random/threefry.h"
 #include "gromacs/random/uniformintdistribution.h"
 #include "gromacs/random/uniformrealdistribution.h"
@@ -148,11 +149,12 @@ static gmx_bool repl_quantity(const gmx_multisim_t *ms,
     return bDiff;
 }
 
-gmx_repl_ex_t init_replica_exchange(FILE *fplog,
-                                    const gmx_multisim_t *ms,
-                                    const t_state *state,
-                                    const t_inputrec *ir,
-                                    int nst, int nex, int init_seed)
+gmx_repl_ex_t
+init_replica_exchange(FILE                            *fplog,
+                      const gmx_multisim_t            *ms,
+                      const t_state                   *state,
+                      const t_inputrec                *ir,
+                      const ReplicaExchangeParameters &replExParams)
 {
     real                pres;
     int                 i, j, k;
@@ -162,7 +164,7 @@ gmx_repl_ex_t init_replica_exchange(FILE *fplog,
 
     fprintf(fplog, "\nInitializing Replica Exchange\n");
 
-    if (ms == NULL || ms->nsim == 1)
+    if (ms == nullptr || ms->nsim == 1)
     {
         gmx_fatal(FARGS, "Nothing to exchange with only one replica, maybe you forgot to set the -multi option of mdrun?");
     }
@@ -191,6 +193,7 @@ gmx_repl_ex_t init_replica_exchange(FILE *fplog,
     check_multi_int(fplog, ms, state->natoms, "the number of atoms", FALSE);
     check_multi_int(fplog, ms, ir->eI, "the integrator", FALSE);
     check_multi_int64(fplog, ms, ir->init_step+ir->nsteps, "init_step+nsteps", FALSE);
+    const int nst = replExParams.exchangeInterval;
     check_multi_int64(fplog, ms, (ir->init_step+nst-1)/nst,
                       "first exchange step: init_step/-replex", FALSE);
     check_multi_int(fplog, ms, ir->etc, "the temperature coupling", FALSE);
@@ -371,7 +374,7 @@ gmx_repl_ex_t init_replica_exchange(FILE *fplog,
         }
     }
     re->nst = nst;
-    if (init_seed == -1)
+    if (replExParams.randomSeed == -1)
     {
         if (MASTERSIM(ms))
         {
@@ -385,7 +388,7 @@ gmx_repl_ex_t init_replica_exchange(FILE *fplog,
     }
     else
     {
-        re->seed = init_seed;
+        re->seed = replExParams.randomSeed;
     }
     fprintf(fplog, "\nReplica exchange interval: %d\n", re->nst);
     fprintf(fplog, "\nReplica random seed: %d\n", re->seed);
@@ -427,7 +430,7 @@ gmx_repl_ex_t init_replica_exchange(FILE *fplog,
     {
         snew(re->de[i], re->nrepl);
     }
-    re->nex = nex;
+    re->nex = replExParams.numExchanges;
     return re;
 }
 
@@ -542,102 +545,33 @@ static void exchange_state(const gmx_multisim_t *ms, int b, t_state *state)
     exchange_rvecs(ms, b, state->svir_prev, DIM);
     exchange_rvecs(ms, b, state->fvir_prev, DIM);
     exchange_rvecs(ms, b, state->pres_prev, DIM);
-    exchange_doubles(ms, b, state->nosehoover_xi, ngtc);
-    exchange_doubles(ms, b, state->nosehoover_vxi, ngtc);
-    exchange_doubles(ms, b, state->nhpres_xi, nnhpres);
-    exchange_doubles(ms, b, state->nhpres_vxi, nnhpres);
-    exchange_doubles(ms, b, state->therm_integral, state->ngtc);
-    exchange_rvecs(ms, b, state->x, state->natoms);
-    exchange_rvecs(ms, b, state->v, state->natoms);
+    exchange_doubles(ms, b, state->nosehoover_xi.data(), ngtc);
+    exchange_doubles(ms, b, state->nosehoover_vxi.data(), ngtc);
+    exchange_doubles(ms, b, state->nhpres_xi.data(), nnhpres);
+    exchange_doubles(ms, b, state->nhpres_vxi.data(), nnhpres);
+    exchange_doubles(ms, b, state->therm_integral.data(), state->ngtc);
+    exchange_doubles(ms, b, &state->baros_integral, 1);
+    exchange_rvecs(ms, b, as_rvec_array(state->x.data()), state->natoms);
+    exchange_rvecs(ms, b, as_rvec_array(state->v.data()), state->natoms);
 }
 
-static void copy_rvecs(rvec *s, rvec *d, int n)
+static void copy_state_serial(const t_state *src, t_state *dest)
 {
-    int i;
-
-    if (d != NULL)
-    {
-        for (i = 0; i < n; i++)
-        {
-            copy_rvec(s[i], d[i]);
-        }
-    }
-}
-
-static void copy_doubles(const double *s, double *d, int n)
-{
-    int i;
-
-    if (d != NULL)
-    {
-        for (i = 0; i < n; i++)
-        {
-            d[i] = s[i];
-        }
-    }
-}
-
-static void copy_reals(const real *s, real *d, int n)
-{
-    int i;
-
-    if (d != NULL)
+    if (dest != src)
     {
-        for (i = 0; i < n; i++)
-        {
-            d[i] = s[i];
-        }
-    }
-}
-
-static void copy_ints(const int *s, int *d, int n)
-{
-    int i;
-
-    if (d != NULL)
-    {
-        for (i = 0; i < n; i++)
-        {
-            d[i] = s[i];
-        }
+        /* Currently the local state is always a pointer to the global
+         * in serial, so we should never end up here.
+         * TODO: Implement a (trivial) t_state copy once converted to C++.
+         */
+        GMX_RELEASE_ASSERT(false, "State copying is currently not implemented in replica exchange");
     }
 }
 
-#define scopy_rvecs(v, n)   copy_rvecs(state->v, state_local->v, n);
-#define scopy_doubles(v, n) copy_doubles(state->v, state_local->v, n);
-#define scopy_reals(v, n) copy_reals(state->v, state_local->v, n);
-#define scopy_ints(v, n)   copy_ints(state->v, state_local->v, n);
-
-static void copy_state_nonatomdata(t_state *state, t_state *state_local)
-{
-    /* When t_state changes, this code should be updated. */
-    int ngtc, nnhpres;
-    ngtc    = state->ngtc * state->nhchainlength;
-    nnhpres = state->nnhpres* state->nhchainlength;
-    scopy_rvecs(box, DIM);
-    scopy_rvecs(box_rel, DIM);
-    scopy_rvecs(boxv, DIM);
-    state_local->veta = state->veta;
-    state_local->vol0 = state->vol0;
-    scopy_rvecs(svir_prev, DIM);
-    scopy_rvecs(fvir_prev, DIM);
-    scopy_rvecs(pres_prev, DIM);
-    scopy_doubles(nosehoover_xi, ngtc);
-    scopy_doubles(nosehoover_vxi, ngtc);
-    scopy_doubles(nhpres_xi, nnhpres);
-    scopy_doubles(nhpres_vxi, nnhpres);
-    scopy_doubles(therm_integral, state->ngtc);
-    scopy_rvecs(x, state->natoms);
-    scopy_rvecs(v, state->natoms);
-    copy_ints(&(state->fep_state), &(state_local->fep_state), 1);
-    scopy_reals(lambda, efptNR);
-}
-
 static void scale_velocities(t_state *state, real fac)
 {
     int i;
 
-    if (state->v)
+    if (as_rvec_array(state->v.data()))
     {
         for (i = 0; i < state->natoms; i++)
         {
@@ -690,7 +624,7 @@ static void print_ind(FILE *fplog, const char *leg, int n, int *ind, gmx_bool *b
     fprintf(fplog, "Repl %2s %2d", leg, ind[0]);
     for (i = 1; i < n; i++)
     {
-        fprintf(fplog, " %c %2d", (bEx != 0 && bEx[i]) ? 'x' : ' ', ind[i]);
+        fprintf(fplog, " %c %2d", (bEx != nullptr && bEx[i]) ? 'x' : ' ', ind[i]);
     }
     fprintf(fplog, "\n");
 }
@@ -1315,7 +1249,7 @@ gmx_bool replica_exchange(FILE *fplog, const t_commrec *cr, struct gmx_repl_ex *
         }
         else
         {
-            copy_state_nonatomdata(state_local, state);
+            copy_state_serial(state_local, state);
         }
 
         if (MASTER(cr))
@@ -1351,7 +1285,7 @@ gmx_bool replica_exchange(FILE *fplog, const t_commrec *cr, struct gmx_repl_ex *
         if (!DOMAINDECOMP(cr))
         {
             /* Copy the global state to the local state data structure */
-            copy_state_nonatomdata(state, state_local);
+            copy_state_serial(state, state_local);
         }
     }
 
@@ -1381,11 +1315,11 @@ void print_replica_exchange_statistics(FILE *fplog, struct gmx_repl_ex *re)
                 re->prob[i] =  re->prob_sum[i]/re->nattempt[i%2];
             }
         }
-        print_ind(fplog, "", re->nrepl, re->ind, NULL);
+        print_ind(fplog, "", re->nrepl, re->ind, nullptr);
         print_prob(fplog, "", re->nrepl, re->prob);
 
         fprintf(fplog, "Repl  number of exchanges:\n");
-        print_ind(fplog, "", re->nrepl, re->ind, NULL);
+        print_ind(fplog, "", re->nrepl, re->ind, nullptr);
         print_count(fplog, "", re->nrepl, re->nexchange);
 
         fprintf(fplog, "Repl  average number of exchanges:\n");
@@ -1400,7 +1334,7 @@ void print_replica_exchange_statistics(FILE *fplog, struct gmx_repl_ex *re)
                 re->prob[i] =  ((real)re->nexchange[i])/re->nattempt[i%2];
             }
         }
-        print_ind(fplog, "", re->nrepl, re->ind, NULL);
+        print_ind(fplog, "", re->nrepl, re->ind, nullptr);
         print_prob(fplog, "", re->nrepl, re->prob);
 
         fprintf(fplog, "\n");
index dcb47d1fdd3a425bdb4f1414c259bddff07ac653..d5064e176300c7ec6677d5efac05dff287ba1872 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, by the GROMACS development team, led by
+ * Copyright (c) 2011,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.
@@ -47,17 +47,33 @@ struct gmx_enerdata_t;
 struct gmx_multisim_t;
 struct t_commrec;
 struct t_inputrec;
-struct t_state;
+class t_state;
+
+/* The parameters for the replica exchange algorithm */
+struct ReplicaExchangeParameters
+{
+    ReplicaExchangeParameters() :
+        exchangeInterval(0),
+        numExchanges(0),
+        randomSeed(-1)
+    {
+    };
+
+    int exchangeInterval; /* Interval in steps at which to attempt exchanges, 0 means no replica exchange */
+    int numExchanges;     /* The number of exchanges to attempt at an exchange step */
+    int randomSeed;       /* The random seed, -1 means generate a seed */
+};
 
 /* Abstract type for replica exchange */
 typedef struct gmx_repl_ex *gmx_repl_ex_t;
 
-gmx_repl_ex_t init_replica_exchange(FILE *fplog,
-                                    const gmx_multisim_t *ms,
-                                    const t_state *state,
-                                    const t_inputrec *ir,
-                                    int nst, int nmultiex, int init_seed);
-/* Should only be called on the master nodes */
+gmx_repl_ex_t
+init_replica_exchange(FILE                            *fplog,
+                      const gmx_multisim_t            *ms,
+                      const t_state                   *state,
+                      const t_inputrec                *ir,
+                      const ReplicaExchangeParameters &replExParams);
+/* Should only be called on the master ranks */
 
 gmx_bool replica_exchange(FILE *fplog,
                           const t_commrec *cr,
@@ -65,15 +81,15 @@ gmx_bool replica_exchange(FILE *fplog,
                           t_state *state, gmx_enerdata_t *enerd,
                           t_state *state_local,
                           gmx_int64_t step, real time);
-/* Attempts replica exchange, should be called on all nodes.
+/* Attempts replica exchange, should be called on all ranks.
  * Returns TRUE if this state has been exchanged.
  * When running each replica in parallel,
- * this routine collects the state on the master node before exchange.
+ * this routine collects the state on the master rank before exchange.
  * With domain decomposition, the global state after exchange is stored
- * in state and still needs to be redistributed over the nodes.
+ * in state and still needs to be redistributed over the ranks.
  */
 
 void print_replica_exchange_statistics(FILE *fplog, gmx_repl_ex_t re);
-/* Should only be called on the master nodes */
+/* Should only be called on the master ranks */
 
 #endif  /* _repl_ex_h */
index 7d489bb013bb83d98aa92b4e8192181b8bfb0f3f..f7988b03ed322448d6cf41b4d43c771f0e5585b3 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,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.
 
 #include <algorithm>
 
-#include "gromacs/gmxlib/md_logging.h"
 #include "gromacs/hardware/cpuinfo.h"
 #include "gromacs/hardware/detecthardware.h"
-#include "gromacs/hardware/gpu_hw_info.h"
+#include "gromacs/hardware/hardwareassign.h"
 #include "gromacs/hardware/hardwaretopology.h"
 #include "gromacs/hardware/hw_info.h"
 #include "gromacs/mdlib/gmx_omp_nthreads.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/topology/topology.h"
+#include "gromacs/utility/baseversion.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/logger.h"
 #include "gromacs/utility/stringutil.h"
 
 
@@ -70,6 +71,7 @@
  * and after a switch point doesn't change too much.
  */
 
+//! Constant used to help minimize preprocessed code
 static const bool bHasOmpSupport = GMX_OPENMP;
 
 #if GMX_THREAD_MPI
@@ -99,6 +101,7 @@ static const int min_atoms_per_gpu        = 900;
 const int nthreads_omp_faster_default   =  8;
 const int nthreads_omp_faster_Nehalem   = 12;
 const int nthreads_omp_faster_Intel_AVX = 16;
+const int nthreads_omp_faster_AMD_Ryzen = 16;
 /* For CPU only runs the fastest options are usually MPI or OpenMP only.
  * With one GPU, using MPI only is almost never optimal, so we need to
  * compare running pure OpenMP with combined MPI+OpenMP. This means higher
@@ -140,6 +143,11 @@ static int nthreads_omp_faster(const gmx::CpuInfo &cpuInfo, gmx_bool bUseGPU)
         // Intel Nehalem
         nth = nthreads_omp_faster_Nehalem;
     }
+    else if (cpuInfo.vendor() == gmx::CpuInfo::Vendor::Amd && cpuInfo.family() >= 23)
+    {
+        // AMD Ryzen
+        nth = nthreads_omp_faster_AMD_Ryzen;
+    }
     else
     {
         nth = nthreads_omp_faster_default;
@@ -156,9 +164,9 @@ static int nthreads_omp_faster(const gmx::CpuInfo &cpuInfo, gmx_bool bUseGPU)
 }
 
 /* Returns that maximum OpenMP thread count that passes the efficiency check */
-static int nthreads_omp_efficient_max(int gmx_unused       nrank,
-                                      const gmx::CpuInfo  &cpuInfo,
-                                      gmx_bool             bUseGPU)
+gmx_unused static int nthreads_omp_efficient_max(int gmx_unused       nrank,
+                                                 const gmx::CpuInfo  &cpuInfo,
+                                                 gmx_bool             bUseGPU)
 {
 #if GMX_OPENMP && GMX_MPI
     if (nrank > 1)
@@ -175,10 +183,10 @@ static int nthreads_omp_efficient_max(int gmx_unused       nrank,
 /* Return the number of thread-MPI ranks to use.
  * This is chosen such that we can always obey our own efficiency checks.
  */
-static int get_tmpi_omp_thread_division(const gmx_hw_info_t *hwinfo,
-                                        const gmx_hw_opt_t  *hw_opt,
-                                        int                  nthreads_tot,
-                                        int                  ngpu)
+gmx_unused static int get_tmpi_omp_thread_division(const gmx_hw_info_t *hwinfo,
+                                                   const gmx_hw_opt_t  &hw_opt,
+                                                   int                  nthreads_tot,
+                                                   int                  ngpu)
 {
     int                 nrank;
     const gmx::CpuInfo &cpuInfo = *hwinfo->cpuInfo;
@@ -200,8 +208,8 @@ static int get_tmpi_omp_thread_division(const gmx_hw_info_t *hwinfo,
          * If the user does not set the number of OpenMP threads, nthreads_omp==0 and
          * this code has no effect.
          */
-        GMX_RELEASE_ASSERT(hw_opt->nthreads_omp >= 0, "nthreads_omp is negative, but previous checks should have prevented this");
-        while (nrank*hw_opt->nthreads_omp > hwinfo->nthreads_hw_avail && nrank > 1)
+        GMX_RELEASE_ASSERT(hw_opt.nthreads_omp >= 0, "nthreads_omp is negative, but previous checks should have prevented this");
+        while (nrank*hw_opt.nthreads_omp > hwinfo->nthreads_hw_avail && nrank > 1)
         {
             nrank--;
         }
@@ -211,9 +219,8 @@ static int get_tmpi_omp_thread_division(const gmx_hw_info_t *hwinfo,
             /* #thread < #gpu is very unlikely, but if so: waste gpu(s) */
             nrank = nthreads_tot;
         }
-        else if (gmx_gpu_sharing_supported() &&
-                 (nthreads_tot > nthreads_omp_faster(cpuInfo, ngpu > 0) ||
-                  (ngpu > 1 && nthreads_tot/ngpu > nthreads_omp_mpi_target_max)))
+        else if (nthreads_tot > nthreads_omp_faster(cpuInfo, ngpu > 0) ||
+                 (ngpu > 1 && nthreads_tot/ngpu > nthreads_omp_mpi_target_max))
         {
             /* The high OpenMP thread count will likely result in sub-optimal
              * performance. Increase the rank count to reduce the thread count
@@ -235,10 +242,10 @@ static int get_tmpi_omp_thread_division(const gmx_hw_info_t *hwinfo,
                    (nthreads_tot/(ngpu*(nshare + 1)) >= nthreads_omp_mpi_ok_min_gpu && nthreads_tot % nrank != 0));
         }
     }
-    else if (hw_opt->nthreads_omp > 0)
+    else if (hw_opt.nthreads_omp > 0)
     {
         /* Here we could oversubscribe, when we do, we issue a warning later */
-        nrank = std::max(1, nthreads_tot/hw_opt->nthreads_omp);
+        nrank = std::max(1, nthreads_tot/hw_opt.nthreads_omp);
     }
     else
     {
@@ -258,36 +265,6 @@ static int get_tmpi_omp_thread_division(const gmx_hw_info_t *hwinfo,
 }
 
 
-static int getMaxGpuUsable(FILE *fplog, const t_commrec *cr, const gmx_hw_info_t *hwinfo,
-                           int cutoff_scheme, gmx_bool bUseGpu)
-{
-    /* This code relies on the fact that GPU are not detected when GPU
-     * acceleration was disabled at run time by the user.
-     */
-    if (cutoff_scheme == ecutsVERLET &&
-        bUseGpu &&
-        hwinfo->gpu_info.n_dev_compatible > 0)
-    {
-        if (gmx_multiple_gpu_per_node_supported())
-        {
-            return hwinfo->gpu_info.n_dev_compatible;
-        }
-        else
-        {
-            if (hwinfo->gpu_info.n_dev_compatible > 1)
-            {
-                md_print_warn(cr, fplog, "More than one compatible GPU is available, but GROMACS can only use one of them. Using a single thread-MPI rank.\n");
-            }
-            return 1;
-        }
-    }
-    else
-    {
-        return 0;
-    }
-}
-
-
 #if GMX_THREAD_MPI
 
 static bool
@@ -341,14 +318,14 @@ class SingleRankChecker
  * Thus all options should be internally consistent and consistent
  * with the hardware, except that ntmpi could be larger than #GPU.
  */
-int get_nthreads_mpi(const gmx_hw_info_t *hwinfo,
-                     gmx_hw_opt_t        *hw_opt,
-                     const t_inputrec    *inputrec,
-                     const gmx_mtop_t    *mtop,
-                     const t_commrec     *cr,
-                     FILE                *fplog,
-                     gmx_bool             bUseGpu,
-                     bool                 doMembed)
+int get_nthreads_mpi(const gmx_hw_info_t    *hwinfo,
+                     gmx_hw_opt_t           *hw_opt,
+                     int                     numPmeRanks,
+                     bool                    nonbondedOnGpu,
+                     const t_inputrec       *inputrec,
+                     const gmx_mtop_t       *mtop,
+                     const gmx::MDLogger    &mdlog,
+                     bool                    doMembed)
 {
     int                          nthreads_hw, nthreads_tot_max, nrank, ngpu;
     int                          min_atoms_per_mpi_rank;
@@ -356,6 +333,35 @@ int get_nthreads_mpi(const gmx_hw_info_t *hwinfo,
     const gmx::CpuInfo          &cpuInfo = *hwinfo->cpuInfo;
     const gmx::HardwareTopology &hwTop   = *hwinfo->hardwareTopology;
 
+    /* If the user made a GPU task assignment, that sets the number of thread-MPI ranks. */
+    auto userGpuTaskAssignment = gmx::parseGpuTaskAssignment(hw_opt->gpuIdTaskAssignment);
+    int  numGpuIdsSupplied     = static_cast<int>(userGpuTaskAssignment.size());
+
+    /* TODO Here we handle the case where the user set GPU IDs, and
+       further below we handle the case where the algorithm does not
+       support multiple ranks. We need also to handle the case where
+       the user set multiple GPU IDs for an algorithm that cannot
+       handle multiple ranks. */
+    if (hw_opt->nthreads_tmpi < 1 && numGpuIdsSupplied > 0)
+    {
+        /* If the user chose both mdrun -nt -gpu_id, is that consistent? */
+        if (numPmeRanks <= 0)
+        {
+            if (hw_opt->nthreads_tot > 0 &&
+                (hw_opt->nthreads_tot % numGpuIdsSupplied) != 0)
+            {
+                gmx_fatal(FARGS, "Cannot run %d total threads with %d GPU ranks. Choose the total number of threads to be a multiple of the number of GPU ranks.", hw_opt->nthreads_tot, numGpuIdsSupplied);
+            }
+            return numGpuIdsSupplied;
+        }
+        else
+        {
+            gmx_fatal(FARGS, "The combination of choosing a number of PME ranks, and specific GPU IDs "
+                      "is not supported. Use also -ntmpi and/or -ntomp and -ntomp_pme to specify what "
+                      "distribution of threads to ranks you require.");
+        }
+    }
+
     {
         /* Check if an algorithm does not support parallel simulation.  */
         // TODO This might work better if e.g. implemented algorithms
@@ -372,17 +378,48 @@ int get_nthreads_mpi(const gmx_hw_info_t *hwinfo,
             {
                 gmx_fatal(FARGS, "%s However, you asked for more than 1 thread-MPI rank, so mdrun cannot continue. Choose a single rank, or a different algorithm.", message.c_str());
             }
-            md_print_warn(cr, fplog, "%s Choosing to use only a single thread-MPI rank.", message.c_str());
+            GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted("%s Choosing to use only a single thread-MPI rank.", message.c_str());
+
+            if (numGpuIdsSupplied > 1)
+            {
+                gmx_fatal(FARGS, "You supplied %d GPU IDs but only 1 rank can be used "
+                          "by this simulation. Supply only one GPU ID.", numGpuIdsSupplied);
+            }
             return 1;
         }
     }
 
     if (hw_opt->nthreads_tmpi > 0)
     {
-        /* Trivial, return right away */
+        if (numPmeRanks <= 0)
+        {
+            int numPpRanks = hw_opt->nthreads_tmpi;
+            if ((numGpuIdsSupplied > 0) &&
+                (numGpuIdsSupplied != numPpRanks))
+            {
+                gmx_fatal(FARGS, "Cannot run %d thread-MPI total ranks with %d "
+                          "GPU IDs supplied. The number of particle-particle (PP) ranks and the "
+                          "number of GPU IDs must match.", hw_opt->nthreads_tmpi, numGpuIdsSupplied);
+            }
+        }
+        else
+        {
+            int numPpRanks = hw_opt->nthreads_tmpi - numPmeRanks;
+            if ((numGpuIdsSupplied > 0) &&
+                (numGpuIdsSupplied != numPpRanks))
+            {
+                gmx_fatal(FARGS, "Cannot run %d thread-MPI total ranks with %d PME ranks and %d "
+                          "GPU IDs supplied. The number of particle-particle ranks and the "
+                          "number of GPU IDs must match.", hw_opt->nthreads_tmpi, numPmeRanks, numGpuIdsSupplied);
+            }
+        }
+        /* Trivial, return the user's choice right away */
         return hw_opt->nthreads_tmpi;
     }
+    GMX_RELEASE_ASSERT(numGpuIdsSupplied == 0,
+                       "If mdrun -gpu_id had information, the number of ranks should have already been chosen");
 
+    // Now implement automatic selection of number of thread-MPI ranks
     nthreads_hw = hwinfo->nthreads_hw_avail;
 
     if (nthreads_hw <= 0)
@@ -401,7 +438,9 @@ int get_nthreads_mpi(const gmx_hw_info_t *hwinfo,
         nthreads_tot_max = nthreads_hw;
     }
 
-    ngpu = getMaxGpuUsable(fplog, cr, hwinfo, inputrec->cutoff_scheme, bUseGpu);
+    /* nonbondedOnGpu might be false e.g. because this simulation uses
+     * the group scheme, or is a rerun with energy groups. */
+    ngpu = (nonbondedOnGpu ? hwinfo->gpu_info.n_dev_compatible : 0);
 
     if (inputrec->cutoff_scheme == ecutsGROUP)
     {
@@ -410,7 +449,7 @@ int get_nthreads_mpi(const gmx_hw_info_t *hwinfo,
     }
 
     nrank =
-        get_tmpi_omp_thread_division(hwinfo, hw_opt, nthreads_tot_max, ngpu);
+        get_tmpi_omp_thread_division(hwinfo, *hw_opt, nthreads_tot_max, ngpu);
 
     if (inputrec->eI == eiNM || EI_TPI(inputrec->eI))
     {
@@ -520,13 +559,14 @@ int get_nthreads_mpi(const gmx_hw_info_t *hwinfo,
 
 
 void check_resource_division_efficiency(const gmx_hw_info_t *hwinfo,
-                                        const gmx_hw_opt_t  *hw_opt,
+                                        int                  numTotalThreads,
+                                        bool                 willUsePhysicalGpu,
                                         gmx_bool             bNtOmpOptionSet,
                                         t_commrec           *cr,
-                                        FILE                *fplog)
+                                        const gmx::MDLogger &mdlog)
 {
 #if GMX_OPENMP && GMX_MPI
-    int         nth_omp_min, nth_omp_max, ngpu;
+    int         nth_omp_min, nth_omp_max;
     char        buf[1000];
 #if GMX_THREAD_MPI
     const char *mpi_option = " (option -ntmpi)";
@@ -539,14 +579,13 @@ void check_resource_division_efficiency(const gmx_hw_info_t *hwinfo,
      */
 #if GMX_THREAD_MPI
     GMX_RELEASE_ASSERT(nthreads_omp_faster_default >= nthreads_omp_mpi_ok_max, "Inconsistent OpenMP thread count default values");
-    GMX_RELEASE_ASSERT(hw_opt->nthreads_tmpi >= 1, "Must have at least one thread-MPI rank");
 #endif
     GMX_RELEASE_ASSERT(gmx_omp_nthreads_get(emntDefault) >= 1, "Must have at least one OpenMP thread");
 
     nth_omp_min = gmx_omp_nthreads_get(emntDefault);
     nth_omp_max = gmx_omp_nthreads_get(emntDefault);
-    ngpu        = hw_opt->gpu_opt.n_dev_use;
 
+    bool anyRankIsUsingGpus = willUsePhysicalGpu;
     /* Thread-MPI seems to have a bug with reduce on 1 node, so use a cond. */
     if (cr->nnodes + cr->npmenodes > 1)
     {
@@ -554,19 +593,19 @@ void check_resource_division_efficiency(const gmx_hw_info_t *hwinfo,
 
         count[0] = -nth_omp_min;
         count[1] =  nth_omp_max;
-        count[2] =  ngpu;
+        count[2] =  willUsePhysicalGpu;
 
         MPI_Allreduce(count, count_max, 3, MPI_INT, MPI_MAX, cr->mpi_comm_mysim);
 
         /* In case of an inhomogeneous run setup we use the maximum counts */
-        nth_omp_min = -count_max[0];
-        nth_omp_max =  count_max[1];
-        ngpu        =  count_max[2];
+        nth_omp_min        = -count_max[0];
+        nth_omp_max        =  count_max[1];
+        anyRankIsUsingGpus = count_max[2] > 0;
     }
 
     int nthreads_omp_mpi_ok_min;
 
-    if (ngpu == 0)
+    if (!anyRankIsUsingGpus)
     {
         nthreads_omp_mpi_ok_min = nthreads_omp_mpi_ok_min_cpu;
     }
@@ -581,8 +620,7 @@ void check_resource_division_efficiency(const gmx_hw_info_t *hwinfo,
     if (DOMAINDECOMP(cr) && cr->nnodes > 1)
     {
         if (nth_omp_max < nthreads_omp_mpi_ok_min ||
-            (!(ngpu > 0 && !gmx_gpu_sharing_supported()) &&
-             nth_omp_max > nthreads_omp_mpi_ok_max))
+            nth_omp_max > nthreads_omp_mpi_ok_max)
         {
             /* Note that we print target_max here, not ok_max */
             sprintf(buf, "Your choice of number of MPI ranks and amount of resources results in using %d OpenMP threads per rank, which is most likely inefficient. The optimum is usually between %d and %d threads per rank.",
@@ -592,7 +630,7 @@ void check_resource_division_efficiency(const gmx_hw_info_t *hwinfo,
 
             if (bNtOmpOptionSet)
             {
-                md_print_warn(cr, fplog, "NOTE: %s\n", buf);
+                GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted("NOTE: %s", buf);
             }
             else
             {
@@ -609,14 +647,13 @@ void check_resource_division_efficiency(const gmx_hw_info_t *hwinfo,
         const gmx::CpuInfo &cpuInfo = *hwinfo->cpuInfo;
 
         /* No domain decomposition (or only one domain) */
-        if (!(ngpu > 0 && !gmx_gpu_sharing_supported()) &&
-            nth_omp_max > nthreads_omp_faster(cpuInfo, ngpu > 0))
+        if (nth_omp_max > nthreads_omp_faster(cpuInfo, anyRankIsUsingGpus))
         {
             /* To arrive here, the user/system set #ranks and/or #OMPthreads */
             gmx_bool bEnvSet;
             char     buf2[256];
 
-            bEnvSet = (getenv("OMP_NUM_THREADS") != NULL);
+            bEnvSet = (getenv("OMP_NUM_THREADS") != nullptr);
 
             if (bNtOmpOptionSet || bEnvSet)
             {
@@ -627,7 +664,7 @@ void check_resource_division_efficiency(const gmx_hw_info_t *hwinfo,
                 sprintf(buf2, "Your choice of %d MPI rank%s and the use of %d total threads %sleads to the use of %d OpenMP threads",
                         cr->nnodes + cr->npmenodes,
                         cr->nnodes + cr->npmenodes == 1 ? "" : "s",
-                        hw_opt->nthreads_tot > 0 ? hw_opt->nthreads_tot : hwinfo->nthreads_hw_avail,
+                        numTotalThreads > 0 ? numTotalThreads : hwinfo->nthreads_hw_avail,
                         hwinfo->nphysicalnode > 1 ? "on a node " : "",
                         nth_omp_max);
             }
@@ -640,7 +677,7 @@ void check_resource_division_efficiency(const gmx_hw_info_t *hwinfo,
              */
             if (bNtOmpOptionSet || (bEnvSet && nth_omp_min != nth_omp_max))
             {
-                md_print_warn(cr, fplog, "NOTE: %s\n", buf);
+                GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted("NOTE: %s", buf);
             }
             else
             {
@@ -650,22 +687,17 @@ void check_resource_division_efficiency(const gmx_hw_info_t *hwinfo,
     }
 #else /* GMX_OPENMP && GMX_MPI */
       /* No OpenMP and/or MPI: it doesn't make much sense to check */
-    GMX_UNUSED_VALUE(hw_opt);
     GMX_UNUSED_VALUE(bNtOmpOptionSet);
+    GMX_UNUSED_VALUE(numTotalThreads);
+    GMX_UNUSED_VALUE(willUsePhysicalGpu);
+    GMX_UNUSED_VALUE(cr);
     /* Check if we have more than 1 physical core, if detected,
      * or more than 1 hardware thread if physical cores were not detected.
      */
-#if !GMX_OPENMP && !GMX_MPI
-    if (hwinfo->hardwareTopology->numberOfCores() > 1)
+    if (!GMX_OPENMP && !GMX_MPI && hwinfo->hardwareTopology->numberOfCores() > 1)
     {
-        md_print_warn(cr, fplog, "NOTE: GROMACS was compiled without OpenMP and (thread-)MPI support, can only use a single CPU core\n");
+        GMX_LOG(mdlog.warning).asParagraph().appendText("NOTE: GROMACS was compiled without OpenMP and (thread-)MPI support, can only use a single CPU core");
     }
-#else
-    GMX_UNUSED_VALUE(hwinfo);
-    GMX_UNUSED_VALUE(cr);
-    GMX_UNUSED_VALUE(fplog);
-#endif
-
 #endif /* GMX_OPENMP && GMX_MPI */
 }
 
@@ -677,7 +709,7 @@ static void print_hw_opt(FILE *fp, const gmx_hw_opt_t *hw_opt)
             hw_opt->nthreads_tmpi,
             hw_opt->nthreads_omp,
             hw_opt->nthreads_omp_pme,
-            hw_opt->gpu_opt.gpu_id != NULL ? hw_opt->gpu_opt.gpu_id : "");
+            hw_opt->gpuIdTaskAssignment.c_str());
 }
 
 /* Checks we can do when we don't (yet) know the cut-off scheme */
@@ -772,41 +804,20 @@ void check_and_update_hw_opt_1(gmx_hw_opt_t    *hw_opt,
         }
     }
 
-    if (hw_opt->nthreads_tot == 1)
+    if (hw_opt->nthreads_tot > 0)
     {
-        hw_opt->nthreads_tmpi = 1;
-
-        if (hw_opt->nthreads_omp > 1)
+        if (hw_opt->nthreads_omp > hw_opt->nthreads_tot)
         {
-            gmx_fatal(FARGS, "You requested %d OpenMP threads with %d total threads",
-                      hw_opt->nthreads_tmpi, hw_opt->nthreads_tot);
+            gmx_fatal(FARGS, "You requested %d OpenMP threads with %d total threads. Choose a total number of threads that is a multiple of the number of OpenMP threads.",
+                      hw_opt->nthreads_omp, hw_opt->nthreads_tot);
         }
-        hw_opt->nthreads_omp     = 1;
-        hw_opt->nthreads_omp_pme = 1;
-    }
 
-    /* Parse GPU IDs, if provided.
-     * We check consistency with the tMPI thread count later.
-     */
-    gmx_parse_gpu_ids(&hw_opt->gpu_opt);
-
-#if GMX_THREAD_MPI
-    if (hw_opt->gpu_opt.n_dev_use > 0 && hw_opt->nthreads_tmpi == 0)
-    {
-        /* Set the number of MPI threads equal to the number of GPUs */
-        hw_opt->nthreads_tmpi = hw_opt->gpu_opt.n_dev_use;
-
-        if (hw_opt->nthreads_tot > 0 &&
-            hw_opt->nthreads_tmpi > hw_opt->nthreads_tot)
+        if (hw_opt->nthreads_tmpi > hw_opt->nthreads_tot)
         {
-            /* We have more GPUs than total threads requested.
-             * We choose to (later) generate a mismatch error,
-             * instead of launching more threads than requested.
-             */
-            hw_opt->nthreads_tmpi = hw_opt->nthreads_tot;
+            gmx_fatal(FARGS, "You requested %d thread-MPI ranks with %d total threads. Choose a total number of threads that is a multiple of the number of thread-MPI ranks.",
+                      hw_opt->nthreads_tmpi, hw_opt->nthreads_tot);
         }
     }
-#endif
 
     if (debug)
     {
@@ -837,7 +848,7 @@ void check_and_update_hw_opt_2(gmx_hw_opt_t *hw_opt,
 }
 
 /* Checks we can do when we know the thread-MPI rank count */
-void check_and_update_hw_opt_3(gmx_hw_opt_t gmx_unused *hw_opt)
+void check_and_update_hw_opt_3(gmx_hw_opt_t *hw_opt)
 {
 #if GMX_THREAD_MPI
     GMX_RELEASE_ASSERT(hw_opt->nthreads_tmpi >= 1, "Must have at least one thread-MPI rank");
index 0f292aaf63a56386dd871da8ae4b356d53c863fb..b949e955d566b413f1740b336a4622800c46a81a 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,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.
@@ -38,6 +38,8 @@
 
 #include <cstdio>
 
+#include <vector>
+
 #include "gromacs/utility/basedefinitions.h"
 
 struct gmx_hw_info_t;
@@ -46,6 +48,11 @@ struct gmx_mtop_t;
 struct t_commrec;
 struct t_inputrec;
 
+namespace gmx
+{
+class MDLogger;
+}
+
 /* Return the number of threads to use for thread-MPI based on how many
  * were requested, which algorithms we're using,
  * and how many particles there are.
@@ -54,14 +61,14 @@ struct t_inputrec;
  * with the hardware, except that ntmpi could be larger than #GPU.
  * If necessary, this function will modify hw_opt->nthreads_omp.
  */
-int get_nthreads_mpi(const gmx_hw_info_t *hwinfo,
-                     gmx_hw_opt_t        *hw_opt,
-                     const t_inputrec    *inputrec,
-                     const gmx_mtop_t    *mtop,
-                     const t_commrec     *cr,
-                     FILE                *fplog,
-                     gmx_bool             bUseGpu,
-                     bool                 doMembed);
+int get_nthreads_mpi(const gmx_hw_info_t    *hwinfo,
+                     gmx_hw_opt_t           *hw_opt,
+                     int                     numPmeRanks,
+                     bool                    nonbondedOnGpu,
+                     const t_inputrec       *inputrec,
+                     const gmx_mtop_t       *mtop,
+                     const gmx::MDLogger    &mdlog,
+                     bool                    doMembed);
 
 /* Check if the number of OpenMP threads is within reasonable range
  * considering the hardware used. This is a crude check, but mainly
@@ -72,10 +79,11 @@ int get_nthreads_mpi(const gmx_hw_info_t *hwinfo,
  * This function should be called after thread-MPI and OpenMP are set up.
  */
 void check_resource_division_efficiency(const gmx_hw_info_t *hwinfo,
-                                        const gmx_hw_opt_t  *hw_opt,
+                                        int                  numTotalThreads,
+                                        bool                 willUsePhysicalGpu,
                                         gmx_bool             bNtOmpOptionSet,
-                                        struct t_commrec    *cr,
-                                        FILE                *fplog);
+                                        t_commrec           *cr,
+                                        const gmx::MDLogger &mdlog);
 
 /* Checks we can do when we don't (yet) know the cut-off scheme */
 void check_and_update_hw_opt_1(gmx_hw_opt_t    *hw_opt,
index 560b923ba600d4304b2eea72a1a5d76b7a1f6bfa..9fb82dfcae148403ec82e3ef65b140e62b057d8a 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, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,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.
 
 #include "config.h"
 
-#include <assert.h>
-#include <signal.h>
-#include <stdlib.h>
-#include <string.h>
+#include <cassert>
+#include <csignal>
+#include <cstdlib>
+#include <cstring>
 
 #include <algorithm>
 
 #include "gromacs/commandline/filenm.h"
 #include "gromacs/domdec/domdec.h"
 #include "gromacs/domdec/domdec_struct.h"
-#include "gromacs/essentialdynamics/edsam.h"
 #include "gromacs/ewald/pme.h"
 #include "gromacs/fileio/checkpoint.h"
 #include "gromacs/fileio/oenv.h"
 #include "gromacs/fileio/tpxio.h"
-#include "gromacs/gmxlib/md_logging.h"
 #include "gromacs/gmxlib/network.h"
 #include "gromacs/gpu_utils/gpu_utils.h"
 #include "gromacs/hardware/cpuinfo.h"
 #include "gromacs/hardware/detecthardware.h"
+#include "gromacs/hardware/hardwareassign.h"
+#include "gromacs/hardware/printhardware.h"
 #include "gromacs/listed-forces/disre.h"
 #include "gromacs/listed-forces/orires.h"
 #include "gromacs/math/calculate-ewald-splitting-coefficient.h"
 #include "gromacs/mdlib/mdatoms.h"
 #include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/minimize.h"
+#include "gromacs/mdlib/nb_verlet.h"
 #include "gromacs/mdlib/nbnxn_search.h"
+#include "gromacs/mdlib/nbnxn_tuning.h"
 #include "gromacs/mdlib/qmmm.h"
 #include "gromacs/mdlib/sighandler.h"
 #include "gromacs/mdlib/sim_util.h"
 #include "gromacs/mdlib/tpi.h"
+#include "gromacs/mdrunutility/mdmodules.h"
 #include "gromacs/mdrunutility/threadaffinity.h"
 #include "gromacs/mdtypes/commrec.h"
+#include "gromacs/mdtypes/edsamhistory.h"
+#include "gromacs/mdtypes/energyhistory.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/mdtypes/observableshistory.h"
 #include "gromacs/mdtypes/state.h"
+#include "gromacs/mdtypes/swaphistory.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/pulling/pull.h"
 #include "gromacs/pulling/pull_rotation.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/filestream.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/gmxmpi.h"
+#include "gromacs/utility/logger.h"
+#include "gromacs/utility/loggerbuilder.h"
 #include "gromacs/utility/pleasecite.h"
+#include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/smalloc.h"
 
 #include "deform.h"
@@ -132,414 +143,88 @@ tMPI_Thread_mutex_t deform_init_box_mutex = TMPI_THREAD_MUTEX_INITIALIZER;
 #define MIN_ATOMS_PER_MPI_THREAD    90
 #define MIN_ATOMS_PER_GPU           900
 
-struct mdrunner_arglist
-{
-    gmx_hw_opt_t            hw_opt;
-    FILE                   *fplog;
-    t_commrec              *cr;
-    int                     nfile;
-    const t_filenm         *fnm;
-    const gmx_output_env_t *oenv;
-    gmx_bool                bVerbose;
-    int                     nstglobalcomm;
-    ivec                    ddxyz;
-    int                     dd_rank_order;
-    int                     npme;
-    real                    rdd;
-    real                    rconstr;
-    const char             *dddlb_opt;
-    real                    dlb_scale;
-    const char             *ddcsx;
-    const char             *ddcsy;
-    const char             *ddcsz;
-    const char             *nbpu_opt;
-    int                     nstlist_cmdline;
-    gmx_int64_t             nsteps_cmdline;
-    int                     nstepout;
-    int                     resetstep;
-    int                     nmultisim;
-    int                     repl_ex_nst;
-    int                     repl_ex_nex;
-    int                     repl_ex_seed;
-    real                    pforce;
-    real                    cpt_period;
-    real                    max_hours;
-    int                     imdport;
-    unsigned long           Flags;
-};
-
-
-/* The function used for spawning threads. Extracts the mdrunner()
-   arguments from its one argument and calls mdrunner(), after making
-   a commrec. */
-static void mdrunner_start_fn(void *arg)
+namespace gmx
 {
-    try
-    {
-        struct mdrunner_arglist *mda = (struct mdrunner_arglist*)arg;
-        struct mdrunner_arglist  mc  = *mda; /* copy the arg list to make sure
-                                                that it's thread-local. This doesn't
-                                                copy pointed-to items, of course,
-                                                but those are all const. */
-        t_commrec *cr;                       /* we need a local version of this */
-        FILE      *fplog = NULL;
-        t_filenm  *fnm;
 
-        fnm = dup_tfn(mc.nfile, mc.fnm);
+void Mdrunner::reinitializeOnSpawnedThread()
+{
+    // TODO This duplication is formally necessary if any thread might
+    // modify any memory in fnm or the pointers it contains. If the
+    // contents are ever provably const, then we can remove this
+    // allocation (and memory leak).
+    // TODO This should probably become part of a copy constructor for
+    // Mdrunner.
+    fnm = dup_tfn(nfile, fnm);
 
-        cr = reinitialize_commrec_for_this_thread(mc.cr);
+    cr  = reinitialize_commrec_for_this_thread(cr);
 
-        if (MASTER(cr))
-        {
-            fplog = mc.fplog;
-        }
+    if (!MASTER(cr))
+    {
+        // Only the master rank writes to the log files
+        fplog = nullptr;
+    }
+}
 
-        gmx::mdrunner(&mc.hw_opt, fplog, cr, mc.nfile, fnm, mc.oenv,
-                      mc.bVerbose, mc.nstglobalcomm,
-                      mc.ddxyz, mc.dd_rank_order, mc.npme, mc.rdd,
-                      mc.rconstr, mc.dddlb_opt, mc.dlb_scale,
-                      mc.ddcsx, mc.ddcsy, mc.ddcsz,
-                      mc.nbpu_opt, mc.nstlist_cmdline,
-                      mc.nsteps_cmdline, mc.nstepout, mc.resetstep,
-                      mc.nmultisim, mc.repl_ex_nst, mc.repl_ex_nex, mc.repl_ex_seed, mc.pforce,
-                      mc.cpt_period, mc.max_hours, mc.imdport, mc.Flags);
+/*! \brief The callback used for running on spawned threads.
+ *
+ * Obtains the pointer to the master mdrunner object from the one
+ * argument permitted to the thread-launch API call, copies it to make
+ * a new runner for this thread, reinitializes necessary data, and
+ * proceeds to the simulation. */
+static void mdrunner_start_fn(void *arg)
+{
+    try
+    {
+        auto masterMdrunner = reinterpret_cast<const gmx::Mdrunner *>(arg);
+        /* copy the arg list to make sure that it's thread-local. This
+           doesn't copy pointed-to items, of course, but those are all
+           const. */
+        gmx::Mdrunner mdrunner = *masterMdrunner;
+        mdrunner.reinitializeOnSpawnedThread();
+        mdrunner.mdrunner();
     }
     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
 }
 
 
-/* called by mdrunner() to start a specific number of threads (including
-   the main thread) for thread-parallel runs. This in turn calls mdrunner()
-   for each thread.
-   All options besides nthreads are the same as for mdrunner(). */
-static t_commrec *mdrunner_start_threads(gmx_hw_opt_t *hw_opt,
-                                         FILE *fplog, t_commrec *cr, int nfile,
-                                         const t_filenm fnm[], const gmx_output_env_t *oenv, gmx_bool bVerbose,
-                                         int nstglobalcomm,
-                                         ivec ddxyz, int dd_rank_order, int npme,
-                                         real rdd, real rconstr,
-                                         const char *dddlb_opt, real dlb_scale,
-                                         const char *ddcsx, const char *ddcsy, const char *ddcsz,
-                                         const char *nbpu_opt, int nstlist_cmdline,
-                                         gmx_int64_t nsteps_cmdline,
-                                         int nstepout, int resetstep,
-                                         int nmultisim, int repl_ex_nst, int repl_ex_nex, int repl_ex_seed,
-                                         real pforce, real cpt_period, real max_hours,
-                                         unsigned long Flags)
+/*! \brief Start thread-MPI threads.
+ *
+ * Called by mdrunner() to start a specific number of threads
+ * (including the main thread) for thread-parallel runs. This in turn
+ * calls mdrunner() for each thread. All options are the same as for
+ * mdrunner(). */
+t_commrec *Mdrunner::spawnThreads(int numThreadsToLaunch)
 {
-    int                      ret;
-    struct mdrunner_arglist *mda;
-    t_commrec               *crn; /* the new commrec */
-    t_filenm                *fnmn;
 
     /* first check whether we even need to start tMPI */
-    if (hw_opt->nthreads_tmpi < 2)
+    if (numThreadsToLaunch < 2)
     {
         return cr;
     }
 
-    /* a few small, one-time, almost unavoidable memory leaks: */
-    snew(mda, 1);
-    fnmn = dup_tfn(nfile, fnm);
-
-    /* fill the data structure to pass as void pointer to thread start fn */
-    /* hw_opt contains pointers, which should all be NULL at this stage */
-    mda->hw_opt          = *hw_opt;
-    mda->fplog           = fplog;
-    mda->cr              = cr;
-    mda->nfile           = nfile;
-    mda->fnm             = fnmn;
-    mda->oenv            = oenv;
-    mda->bVerbose        = bVerbose;
-    mda->nstglobalcomm   = nstglobalcomm;
-    mda->ddxyz[XX]       = ddxyz[XX];
-    mda->ddxyz[YY]       = ddxyz[YY];
-    mda->ddxyz[ZZ]       = ddxyz[ZZ];
-    mda->dd_rank_order   = dd_rank_order;
-    mda->npme            = npme;
-    mda->rdd             = rdd;
-    mda->rconstr         = rconstr;
-    mda->dddlb_opt       = dddlb_opt;
-    mda->dlb_scale       = dlb_scale;
-    mda->ddcsx           = ddcsx;
-    mda->ddcsy           = ddcsy;
-    mda->ddcsz           = ddcsz;
-    mda->nbpu_opt        = nbpu_opt;
-    mda->nstlist_cmdline = nstlist_cmdline;
-    mda->nsteps_cmdline  = nsteps_cmdline;
-    mda->nstepout        = nstepout;
-    mda->resetstep       = resetstep;
-    mda->nmultisim       = nmultisim;
-    mda->repl_ex_nst     = repl_ex_nst;
-    mda->repl_ex_nex     = repl_ex_nex;
-    mda->repl_ex_seed    = repl_ex_seed;
-    mda->pforce          = pforce;
-    mda->cpt_period      = cpt_period;
-    mda->max_hours       = max_hours;
-    mda->Flags           = Flags;
+    gmx::Mdrunner spawnedMdrunner = *this;
+    // TODO This duplication is formally necessary if any thread might
+    // modify any memory in fnm or the pointers it contains. If the
+    // contents are ever provably const, then we can remove this
+    // allocation (and memory leak).
+    // TODO This should probably become part of a copy constructor for
+    // Mdrunner.
+    spawnedMdrunner.fnm = dup_tfn(this->nfile, fnm);
 
     /* now spawn new threads that start mdrunner_start_fn(), while
        the main thread returns, we set thread affinity later */
-    ret = tMPI_Init_fn(TRUE, hw_opt->nthreads_tmpi, TMPI_AFFINITY_NONE,
-                       mdrunner_start_fn, (void*)(mda) );
-    if (ret != TMPI_SUCCESS)
+    if (tMPI_Init_fn(TRUE, numThreadsToLaunch, TMPI_AFFINITY_NONE,
+                     mdrunner_start_fn, static_cast<void*>(&spawnedMdrunner)) != TMPI_SUCCESS)
     {
-        return NULL;
+        GMX_THROW(gmx::InternalError("Failed to spawn thread-MPI threads"));
     }
 
-    crn = reinitialize_commrec_for_this_thread(cr);
-    return crn;
+    return reinitialize_commrec_for_this_thread(cr);
 }
 
-#endif /* GMX_THREAD_MPI */
-
-
-/*! \brief Cost of non-bonded kernels
- *
- * We determine the extra cost of the non-bonded kernels compared to
- * a reference nstlist value of 10 (which is the default in grompp).
- */
-static const int    nbnxnReferenceNstlist = 10;
-//! The values to try when switching
-const int           nstlist_try[] = { 20, 25, 40 };
-//! Number of elements in the neighborsearch list trials.
-#define NNSTL  sizeof(nstlist_try)/sizeof(nstlist_try[0])
-/* Increase nstlist until the non-bonded cost increases more than listfac_ok,
- * but never more than listfac_max.
- * A standard (protein+)water system at 300K with PME ewald_rtol=1e-5
- * needs 1.28 at rcoulomb=0.9 and 1.24 at rcoulomb=1.0 to get to nstlist=40.
- * Note that both CPU and GPU factors are conservative. Performance should
- * not go down due to this tuning, except with a relatively slow GPU.
- * On the other hand, at medium/high parallelization or with fast GPUs
- * nstlist will not be increased enough to reach optimal performance.
- */
-/* CPU: pair-search is about a factor 1.5 slower than the non-bonded kernel */
-//! Max OK performance ratio beween force calc and neighbor searching
-static const float  nbnxn_cpu_listfac_ok    = 1.05;
-//! Too high performance ratio beween force calc and neighbor searching
-static const float  nbnxn_cpu_listfac_max   = 1.09;
-/* CPU: pair-search is about a factor 2-3 slower than the non-bonded kernel */
-//! Max OK performance ratio beween force calc and neighbor searching
-static const float  nbnxn_knl_listfac_ok    = 1.22;
-//! Too high performance ratio beween force calc and neighbor searching
-static const float  nbnxn_knl_listfac_max   = 1.3;
-/* GPU: pair-search is a factor 1.5-3 slower than the non-bonded kernel */
-//! Max OK performance ratio beween force calc and neighbor searching
-static const float  nbnxn_gpu_listfac_ok    = 1.20;
-//! Too high performance ratio beween force calc and neighbor searching
-static const float  nbnxn_gpu_listfac_max   = 1.30;
-
-/*! \brief Try to increase nstlist when using the Verlet cut-off scheme */
-static void increase_nstlist(FILE *fp, t_commrec *cr,
-                             t_inputrec *ir, int nstlist_cmdline,
-                             const gmx_mtop_t *mtop, matrix box,
-                             gmx_bool bGPU, const gmx::CpuInfo &cpuinfo)
-{
-    float                  listfac_ok, listfac_max;
-    int                    nstlist_orig, nstlist_prev;
-    verletbuf_list_setup_t ls;
-    real                   rlistWithReferenceNstlist, rlist_inc, rlist_ok, rlist_max;
-    real                   rlist_new, rlist_prev;
-    size_t                 nstlist_ind = 0;
-    t_state                state_tmp;
-    gmx_bool               bBox, bDD, bCont;
-    const char            *nstl_gpu = "\nFor optimal performance with a GPU nstlist (now %d) should be larger.\nThe optimum depends on your CPU and GPU resources.\nYou might want to try several nstlist values.\n";
-    const char            *nve_err  = "Can not increase nstlist because an NVE ensemble is used";
-    const char            *vbd_err  = "Can not increase nstlist because verlet-buffer-tolerance is not set or used";
-    const char            *box_err  = "Can not increase nstlist because the box is too small";
-    const char            *dd_err   = "Can not increase nstlist because of domain decomposition limitations";
-    char                   buf[STRLEN];
-
-    if (nstlist_cmdline <= 0)
-    {
-        if (ir->nstlist == 1)
-        {
-            /* The user probably set nstlist=1 for a reason,
-             * don't mess with the settings.
-             */
-            return;
-        }
-
-        if (fp != NULL && bGPU && ir->nstlist < nstlist_try[0])
-        {
-            fprintf(fp, nstl_gpu, ir->nstlist);
-        }
-        nstlist_ind = 0;
-        while (nstlist_ind < NNSTL && ir->nstlist >= nstlist_try[nstlist_ind])
-        {
-            nstlist_ind++;
-        }
-        if (nstlist_ind == NNSTL)
-        {
-            /* There are no larger nstlist value to try */
-            return;
-        }
-    }
-
-    if (EI_MD(ir->eI) && ir->etc == etcNO)
-    {
-        if (MASTER(cr))
-        {
-            fprintf(stderr, "%s\n", nve_err);
-        }
-        if (fp != NULL)
-        {
-            fprintf(fp, "%s\n", nve_err);
-        }
-
-        return;
-    }
-
-    if (ir->verletbuf_tol == 0 && bGPU)
-    {
-        gmx_fatal(FARGS, "You are using an old tpr file with a GPU, please generate a new tpr file with an up to date version of grompp");
-    }
-
-    if (ir->verletbuf_tol < 0)
-    {
-        if (MASTER(cr))
-        {
-            fprintf(stderr, "%s\n", vbd_err);
-        }
-        if (fp != NULL)
-        {
-            fprintf(fp, "%s\n", vbd_err);
-        }
-
-        return;
-    }
-
-    if (bGPU)
-    {
-        listfac_ok  = nbnxn_gpu_listfac_ok;
-        listfac_max = nbnxn_gpu_listfac_max;
-    }
-    else if (cpuinfo.feature(gmx::CpuInfo::Feature::X86_Avx512ER))
-    {
-        listfac_ok  = nbnxn_knl_listfac_ok;
-        listfac_max = nbnxn_knl_listfac_max;
-    }
-    else
-    {
-        listfac_ok  = nbnxn_cpu_listfac_ok;
-        listfac_max = nbnxn_cpu_listfac_max;
-    }
-
-    nstlist_orig = ir->nstlist;
-    if (nstlist_cmdline > 0)
-    {
-        if (fp)
-        {
-            sprintf(buf, "Getting nstlist=%d from command line option",
-                    nstlist_cmdline);
-        }
-        ir->nstlist = nstlist_cmdline;
-    }
-
-    verletbuf_get_list_setup(TRUE, bGPU, &ls);
+}      // namespace
 
-    /* Allow rlist to make the list a given factor larger than the list
-     * would be with the reference value for nstlist (10).
-     */
-    nstlist_prev = ir->nstlist;
-    ir->nstlist  = nbnxnReferenceNstlist;
-    calc_verlet_buffer_size(mtop, det(box), ir, -1, &ls, NULL,
-                            &rlistWithReferenceNstlist);
-    ir->nstlist  = nstlist_prev;
-
-    /* Determine the pair list size increase due to zero interactions */
-    rlist_inc = nbnxn_get_rlist_effective_inc(ls.cluster_size_j,
-                                              mtop->natoms/det(box));
-    rlist_ok  = (rlistWithReferenceNstlist + rlist_inc)*std::cbrt(listfac_ok) - rlist_inc;
-    rlist_max = (rlistWithReferenceNstlist + rlist_inc)*std::cbrt(listfac_max) - rlist_inc;
-    if (debug)
-    {
-        fprintf(debug, "nstlist tuning: rlist_inc %.3f rlist_ok %.3f rlist_max %.3f\n",
-                rlist_inc, rlist_ok, rlist_max);
-    }
-
-    nstlist_prev = nstlist_orig;
-    rlist_prev   = ir->rlist;
-    do
-    {
-        if (nstlist_cmdline <= 0)
-        {
-            ir->nstlist = nstlist_try[nstlist_ind];
-        }
-
-        /* Set the pair-list buffer size in ir */
-        calc_verlet_buffer_size(mtop, det(box), ir, -1, &ls, NULL, &rlist_new);
-
-        /* Does rlist fit in the box? */
-        bBox = (gmx::square(rlist_new) < max_cutoff2(ir->ePBC, box));
-        bDD  = TRUE;
-        if (bBox && DOMAINDECOMP(cr))
-        {
-            /* Check if rlist fits in the domain decomposition */
-            if (inputrec2nboundeddim(ir) < DIM)
-            {
-                gmx_incons("Changing nstlist with domain decomposition and unbounded dimensions is not implemented yet");
-            }
-            copy_mat(box, state_tmp.box);
-            bDD = change_dd_cutoff(cr, &state_tmp, ir, rlist_new);
-        }
-
-        if (debug)
-        {
-            fprintf(debug, "nstlist %d rlist %.3f bBox %d bDD %d\n",
-                    ir->nstlist, rlist_new, bBox, bDD);
-        }
-
-        bCont = FALSE;
-
-        if (nstlist_cmdline <= 0)
-        {
-            if (bBox && bDD && rlist_new <= rlist_max)
-            {
-                /* Increase nstlist */
-                nstlist_prev = ir->nstlist;
-                rlist_prev   = rlist_new;
-                bCont        = (nstlist_ind+1 < NNSTL && rlist_new < rlist_ok);
-            }
-            else
-            {
-                /* Stick with the previous nstlist */
-                ir->nstlist = nstlist_prev;
-                rlist_new   = rlist_prev;
-                bBox        = TRUE;
-                bDD         = TRUE;
-            }
-        }
-
-        nstlist_ind++;
-    }
-    while (bCont);
-
-    if (!bBox || !bDD)
-    {
-        gmx_warning(!bBox ? box_err : dd_err);
-        if (fp != NULL)
-        {
-            fprintf(fp, "\n%s\n", bBox ? box_err : dd_err);
-        }
-        ir->nstlist = nstlist_orig;
-    }
-    else if (ir->nstlist != nstlist_orig || rlist_new != ir->rlist)
-    {
-        sprintf(buf, "Changing nstlist from %d to %d, rlist from %g to %g",
-                nstlist_orig, ir->nstlist,
-                ir->rlist, rlist_new);
-        if (MASTER(cr))
-        {
-            fprintf(stderr, "%s\n\n", buf);
-        }
-        if (fp != NULL)
-        {
-            fprintf(fp, "%s\n\n", buf);
-        }
-        ir->rlist     = rlist_new;
-    }
-}
+#endif /* GMX_THREAD_MPI */
 
 /*! \brief Initialize variables for Verlet scheme simulation */
 static void prepare_verlet_scheme(FILE                           *fplog,
@@ -547,8 +232,8 @@ static void prepare_verlet_scheme(FILE                           *fplog,
                                   t_inputrec                     *ir,
                                   int                             nstlist_cmdline,
                                   const gmx_mtop_t               *mtop,
-                                  matrix                          box,
-                                  gmx_bool                        bUseGPU,
+                                  const matrix                    box,
+                                  bool                            makeGpuPairList,
                                   const gmx::CpuInfo             &cpuinfo)
 {
     /* For NVE simulations, we will retain the initial list buffer */
@@ -564,13 +249,13 @@ static void prepare_verlet_scheme(FILE                           *fplog,
          * calc_verlet_buffer_size gives the same results for 4x8 and 4x4
          * and 4x2 gives a larger buffer than 4x4, this is ok.
          */
-        verletbuf_get_list_setup(TRUE, bUseGPU, &ls);
+        verletbuf_get_list_setup(true, makeGpuPairList, &ls);
 
-        calc_verlet_buffer_size(mtop, det(box), ir, -1, &ls, NULL, &rlist_new);
+        calc_verlet_buffer_size(mtop, det(box), ir, ir->nstlist, ir->nstlist - 1, -1, &ls, nullptr, &rlist_new);
 
         if (rlist_new != ir->rlist)
         {
-            if (fplog != NULL)
+            if (fplog != nullptr)
             {
                 fprintf(fplog, "\nChanging rlist from %g to %g for non-bonded %dx%d atom kernels\n\n",
                         ir->rlist, rlist_new,
@@ -589,7 +274,7 @@ static void prepare_verlet_scheme(FILE                           *fplog,
     if (EI_DYNAMICS(ir->eI))
     {
         /* Set or try nstlist values */
-        increase_nstlist(fplog, cr, ir, nstlist_cmdline, mtop, box, bUseGPU, cpuinfo);
+        increaseNstlist(fplog, cr, ir, nstlist_cmdline, mtop, box, makeGpuPairList, cpuinfo);
     }
 }
 
@@ -597,13 +282,11 @@ static void prepare_verlet_scheme(FILE                           *fplog,
  *
  * with value passed on the command line (if any)
  */
-static void override_nsteps_cmdline(FILE            *fplog,
-                                    gmx_int64_t      nsteps_cmdline,
-                                    t_inputrec      *ir,
-                                    const t_commrec *cr)
+static void override_nsteps_cmdline(const gmx::MDLogger &mdlog,
+                                    gmx_int64_t          nsteps_cmdline,
+                                    t_inputrec          *ir)
 {
     assert(ir);
-    assert(cr);
 
     /* override with anything else than the default -2 */
     if (nsteps_cmdline > -2)
@@ -624,7 +307,7 @@ static void override_nsteps_cmdline(FILE            *fplog,
                     gmx_step_str(nsteps_cmdline, sbuf_steps));
         }
 
-        md_print_warn(cr, fplog, "%s\n", sbuf_msg);
+        GMX_LOG(mdlog.warning).asParagraph().appendText(sbuf_msg);
     }
     else if (nsteps_cmdline < -2)
     {
@@ -637,6 +320,65 @@ static void override_nsteps_cmdline(FILE            *fplog,
 namespace gmx
 {
 
+//! Halt the run if there are inconsistences between user choices to run with GPUs and/or hardware detection.
+static void exitIfCannotForceGpuRun(bool                requirePhysicalGpu,
+                                    EmulateGpuNonbonded emulateGpuNonbonded,
+                                    bool                useVerletScheme,
+                                    bool                compatibleGpusFound)
+{
+    /* Was GPU acceleration either explicitly (-nb gpu) or implicitly
+     * (gpu ID passed) requested? */
+    if (!requirePhysicalGpu)
+    {
+        return;
+    }
+
+    if (GMX_GPU == GMX_GPU_NONE)
+    {
+        gmx_fatal(FARGS, "GPU acceleration requested, but %s was compiled without GPU support!",
+                  gmx::getProgramContext().displayName());
+    }
+
+    if (emulateGpuNonbonded == EmulateGpuNonbonded::Yes)
+    {
+        gmx_fatal(FARGS, "GPU emulation cannot be requested together with GPU acceleration!");
+    }
+
+    if (!useVerletScheme)
+    {
+        gmx_fatal(FARGS, "GPU acceleration requested, but can't be used without cutoff-scheme=Verlet");
+    }
+
+    if (!compatibleGpusFound)
+    {
+        gmx_fatal(FARGS, "GPU acceleration requested, but no compatible GPUs were detected.");
+    }
+}
+
+/*! \brief Return whether GPU acceleration is useful with the given settings.
+ *
+ * If not, logs a message about falling back to CPU code. */
+static bool gpuAccelerationIsUseful(const MDLogger   &mdlog,
+                                    const t_inputrec *ir,
+                                    bool              doRerun)
+{
+    if (doRerun && ir->opts.ngener > 1)
+    {
+        /* Rerun execution time is dominated by I/O and pair search,
+         * so GPUs are not very useful, plus they do not support more
+         * than one energy group. If the user requested GPUs
+         * explicitly, a fatal error is given later.  With non-reruns,
+         * we fall back to a single whole-of system energy group
+         * (which runs much faster than a multiple-energy-groups
+         * implementation would), and issue a note in the .log
+         * file. Users can re-run if they want the information. */
+        GMX_LOG(mdlog.warning).asParagraph().appendText("Multiple energy groups is not implemented for GPUs, so is not useful for this rerun, so falling back to the CPU");
+        return false;
+    }
+
+    return true;
+}
+
 //! \brief Return the correct integrator function.
 static integrator_t *my_integrator(unsigned int ei)
 {
@@ -674,69 +416,86 @@ static integrator_t *my_integrator(unsigned int ei)
     }
 }
 
-int mdrunner(gmx_hw_opt_t *hw_opt,
-             FILE *fplog, t_commrec *cr, int nfile,
-             const t_filenm fnm[], const gmx_output_env_t *oenv, gmx_bool bVerbose,
-             int nstglobalcomm,
-             ivec ddxyz, int dd_rank_order, int npme, real rdd, real rconstr,
-             const char *dddlb_opt, real dlb_scale,
-             const char *ddcsx, const char *ddcsy, const char *ddcsz,
-             const char *nbpu_opt, int nstlist_cmdline,
-             gmx_int64_t nsteps_cmdline, int nstepout, int resetstep,
-             int gmx_unused nmultisim, int repl_ex_nst, int repl_ex_nex,
-             int repl_ex_seed, real pforce, real cpt_period, real max_hours,
-             int imdport, unsigned long Flags)
+//! Initializes the logger for mdrun.
+static gmx::LoggerOwner buildLogger(FILE *fplog, const t_commrec *cr)
+{
+    gmx::LoggerBuilder builder;
+    if (fplog != nullptr)
+    {
+        builder.addTargetFile(gmx::MDLogger::LogLevel::Info, fplog);
+    }
+    if (cr == nullptr || SIMMASTER(cr))
+    {
+        builder.addTargetStream(gmx::MDLogger::LogLevel::Warning,
+                                &gmx::TextOutputFile::standardError());
+    }
+    return builder.build();
+}
+
+int Mdrunner::mdrunner()
 {
-    gmx_bool                  bForceUseGPU, bTryUseGPU, bRerunMD;
-    t_inputrec               *inputrec;
-    t_state                  *state = NULL;
     matrix                    box;
     gmx_ddbox_t               ddbox = {0};
     int                       npme_major, npme_minor;
     t_nrnb                   *nrnb;
-    gmx_mtop_t               *mtop          = NULL;
-    t_mdatoms                *mdatoms       = NULL;
-    t_forcerec               *fr            = NULL;
-    t_fcdata                 *fcd           = NULL;
+    gmx_mtop_t               *mtop          = nullptr;
+    t_mdatoms                *mdatoms       = nullptr;
+    t_forcerec               *fr            = nullptr;
+    t_fcdata                 *fcd           = nullptr;
     real                      ewaldcoeff_q  = 0;
     real                      ewaldcoeff_lj = 0;
-    struct gmx_pme_t        **pmedata       = NULL;
-    gmx_vsite_t              *vsite         = NULL;
+    struct gmx_pme_t        **pmedata       = nullptr;
+    gmx_vsite_t              *vsite         = nullptr;
     gmx_constr_t              constr;
     int                       nChargePerturbed = -1, nTypePerturbed = 0, status;
     gmx_wallcycle_t           wcycle;
-    gmx_walltime_accounting_t walltime_accounting = NULL;
+    gmx_walltime_accounting_t walltime_accounting = nullptr;
     int                       rc;
     gmx_int64_t               reset_counters;
-    gmx_edsam_t               ed           = NULL;
     int                       nthreads_pme = 1;
-    gmx_membed_t *            membed       = NULL;
-    gmx_hw_info_t            *hwinfo       = NULL;
-    /* The master rank decides early on bUseGPU and broadcasts this later */
-    gmx_bool                  bUseGPU            = FALSE;
+    gmx_membed_t *            membed       = nullptr;
+    gmx_hw_info_t            *hwinfo       = nullptr;
 
     /* CAUTION: threads may be started later on in this function, so
        cr doesn't reflect the final parallel state right now */
-    snew(inputrec, 1);
+    gmx::MDModules mdModules;
+    t_inputrec     inputrecInstance;
+    t_inputrec    *inputrec = &inputrecInstance;
     snew(mtop, 1);
 
-    if (Flags & MD_APPENDFILES)
+    if (mdrunOptions.continuationOptions.appendFiles)
     {
-        fplog = NULL;
+        fplog = nullptr;
     }
 
     bool doMembed = opt2bSet("-membed", nfile, fnm);
-    bRerunMD     = (Flags & MD_RERUN);
-    bForceUseGPU = (strncmp(nbpu_opt, "gpu", 3) == 0);
-    bTryUseGPU   = (strncmp(nbpu_opt, "auto", 4) == 0) || bForceUseGPU;
+    bool doRerun  = mdrunOptions.rerun;
+
+    /* Handle GPU-related user options. Later, we check consistency
+     * with things like whether support is compiled, or tMPI thread
+     * count. */
+    EmulateGpuNonbonded emulateGpuNonbonded = (getenv("GMX_EMULATE_GPU") != nullptr ?
+                                               EmulateGpuNonbonded::Yes : EmulateGpuNonbonded::No);
+    bool                forceUseCpu           = (strncmp(nbpu_opt, "cpu", 3) == 0);
+    if (!hw_opt.gpuIdTaskAssignment.empty() && forceUseCpu)
+    {
+        gmx_fatal(FARGS, "GPU IDs were specified, and short-ranged interactions were assigned to the CPU. Make no more than one of these choices.");
+    }
+    bool forceUsePhysicalGpu = (strncmp(nbpu_opt, "gpu", 3) == 0) || !hw_opt.gpuIdTaskAssignment.empty();
+    bool tryUsePhysicalGpu   = (strncmp(nbpu_opt, "auto", 4) == 0) && hw_opt.gpuIdTaskAssignment.empty() && (emulateGpuNonbonded == EmulateGpuNonbonded::No);
+    GMX_RELEASE_ASSERT(!(forceUsePhysicalGpu && tryUsePhysicalGpu), "Must either force use of "
+                       "GPUs for short-ranged interactions, or try to use them, not both.");
+
+    // Here we assume that SIMMASTER(cr) does not change even after the
+    // threads are started.
+    gmx::LoggerOwner logOwner(buildLogger(fplog, cr));
+    gmx::MDLogger    mdlog(logOwner.logger());
 
-    /* Detect hardware, gather information. This is an operation that is
-     * global for this process (MPI rank). */
-    hwinfo = gmx_detect_hardware(fplog, cr, bTryUseGPU);
+    hwinfo = gmx_detect_hardware(mdlog, cr);
 
-    gmx_print_detected_hardware(fplog, cr, hwinfo);
+    gmx_print_detected_hardware(fplog, cr, mdlog, hwinfo);
 
-    if (fplog != NULL)
+    if (fplog != nullptr)
     {
         /* Print references after all software/hardware printing */
         please_cite(fplog, "Abraham2015");
@@ -748,37 +507,36 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
         please_cite(fplog, "Berendsen95a");
     }
 
-    snew(state, 1);
+    // TODO state should be nullptr on non-master ranks, and perhaps call it globalState
+    std::unique_ptr<t_state> stateInstance = std::unique_ptr<t_state>(new t_state);
+    t_state *                state         = stateInstance.get();
+
     if (SIMMASTER(cr))
     {
         /* Read (nearly) all data required for the simulation */
         read_tpx_state(ftp2fn(efTPR, nfile, fnm), inputrec, state, mtop);
 
+        exitIfCannotForceGpuRun(forceUsePhysicalGpu,
+                                emulateGpuNonbonded,
+                                inputrec->cutoff_scheme == ecutsVERLET,
+                                compatibleGpusFound(hwinfo->gpu_info));
+
         if (inputrec->cutoff_scheme == ecutsVERLET)
         {
-            /* Here the master rank decides if all ranks will use GPUs */
-            bUseGPU = (hwinfo->gpu_info.n_dev_compatible > 0 ||
-                       getenv("GMX_EMULATE_GPU") != NULL);
-
-            /* TODO add GPU kernels for this and replace this check by:
-             * (bUseGPU && (ir->vdwtype == evdwPME &&
-             *               ir->ljpme_combination_rule == eljpmeLB))
-             * update the message text and the content of nbnxn_acceleration_supported.
-             */
-            if (bUseGPU &&
-                !nbnxn_gpu_acceleration_supported(fplog, cr, inputrec, bRerunMD))
+            /* TODO This logic could run later, e.g. before -npme -1
+               is handled. If inputrec has already been communicated,
+               then the resulting tryUsePhysicalGpu does not need to
+               be communicated. */
+            if ((tryUsePhysicalGpu || forceUsePhysicalGpu) &&
+                !gpuAccelerationIsUseful(mdlog, inputrec, doRerun))
             {
                 /* Fallback message printed by nbnxn_acceleration_supported */
-                if (bForceUseGPU)
+                if (forceUsePhysicalGpu)
                 {
                     gmx_fatal(FARGS, "GPU acceleration requested, but not supported with the given input settings");
                 }
-                bUseGPU = FALSE;
+                tryUsePhysicalGpu = false;
             }
-
-            prepare_verlet_scheme(fplog, cr,
-                                  inputrec, nstlist_cmdline, mtop, state->box,
-                                  bUseGPU, *hwinfo->cpuInfo);
         }
         else
         {
@@ -787,38 +545,28 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
                 gmx_fatal(FARGS, "Can not set nstlist with the group cut-off scheme");
             }
 
-            if (hwinfo->gpu_info.n_dev_compatible > 0)
+            if (compatibleGpusFound(hwinfo->gpu_info))
             {
-                md_print_warn(cr, fplog,
-                              "NOTE: GPU(s) found, but the current simulation can not use GPUs\n"
-                              "      To use a GPU, set the mdp option: cutoff-scheme = Verlet\n");
+                GMX_LOG(mdlog.warning).asParagraph().appendText(
+                        "NOTE: GPU(s) found, but the current simulation can not use GPUs\n"
+                        "      To use a GPU, set the mdp option: cutoff-scheme = Verlet");
             }
-
-            if (bForceUseGPU)
-            {
-                gmx_fatal(FARGS, "GPU requested, but can't be used without cutoff-scheme=Verlet");
-            }
-
-#if GMX_TARGET_BGQ
-            md_print_warn(cr, fplog,
-                          "NOTE: There is no SIMD implementation of the group scheme kernels on\n"
-                          "      BlueGene/Q. You will observe better performance from using the\n"
-                          "      Verlet cut-off scheme.\n");
-#endif
+            tryUsePhysicalGpu = false;
         }
     }
+    bool nonbondedOnGpu = (tryUsePhysicalGpu || forceUsePhysicalGpu) && compatibleGpusFound(hwinfo->gpu_info);
 
     /* Check and update the hardware options for internal consistency */
-    check_and_update_hw_opt_1(hw_opt, cr, npme);
+    check_and_update_hw_opt_1(&hw_opt, cr, domdecOptions.numPmeRanks);
 
     /* Early check for externally set process affinity. */
-    gmx_check_thread_affinity_set(fplog, cr,
-                                  hw_opt, hwinfo->nthreads_hw_avail, FALSE);
+    gmx_check_thread_affinity_set(mdlog, cr,
+                                  &hw_opt, hwinfo->nthreads_hw_avail, FALSE);
 
 #if GMX_THREAD_MPI
     if (SIMMASTER(cr))
     {
-        if (npme > 0 && hw_opt->nthreads_tmpi <= 0)
+        if (domdecOptions.numPmeRanks > 0 && hw_opt.nthreads_tmpi <= 0)
         {
             gmx_fatal(FARGS, "You need to explicitly specify the number of MPI threads (-ntmpi) when using separate PME ranks");
         }
@@ -827,35 +575,28 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
          * This is done later for normal MPI and also once more with tMPI
          * for all tMPI ranks.
          */
-        check_and_update_hw_opt_2(hw_opt, inputrec->cutoff_scheme);
-
-        /* NOW the threads will be started: */
-        hw_opt->nthreads_tmpi = get_nthreads_mpi(hwinfo,
-                                                 hw_opt,
-                                                 inputrec, mtop,
-                                                 cr, fplog, bUseGPU,
-                                                 doMembed);
-
-        if (hw_opt->nthreads_tmpi > 1)
-        {
-            t_commrec *cr_old       = cr;
-            /* now start the threads. */
-            cr = mdrunner_start_threads(hw_opt, fplog, cr_old, nfile, fnm,
-                                        oenv, bVerbose, nstglobalcomm,
-                                        ddxyz, dd_rank_order, npme, rdd, rconstr,
-                                        dddlb_opt, dlb_scale, ddcsx, ddcsy, ddcsz,
-                                        nbpu_opt, nstlist_cmdline,
-                                        nsteps_cmdline, nstepout, resetstep, nmultisim,
-                                        repl_ex_nst, repl_ex_nex, repl_ex_seed, pforce,
-                                        cpt_period, max_hours,
-                                        Flags);
-            /* the main thread continues here with a new cr. We don't deallocate
-               the old cr because other threads may still be reading it. */
-            if (cr == NULL)
-            {
-                gmx_comm("Failed to spawn threads");
-            }
-        }
+        check_and_update_hw_opt_2(&hw_opt, inputrec->cutoff_scheme);
+
+        /* Determine how many thread-MPI ranks to start.
+         *
+         * TODO Over-writing the user-supplied value here does
+         * prevent any possible subsequent checks from working
+         * correctly. */
+        hw_opt.nthreads_tmpi = get_nthreads_mpi(hwinfo,
+                                                &hw_opt,
+                                                domdecOptions.numPmeRanks,
+                                                nonbondedOnGpu,
+                                                inputrec, mtop,
+                                                mdlog,
+                                                doMembed);
+
+        // Now start the threads for thread MPI.
+        cr = spawnThreads(hw_opt.nthreads_tmpi);
+        /* The main thread continues here with a new cr. We don't deallocate
+           the old cr because other threads may still be reading it. */
+        // TODO Both master and spawned threads call dup_tfn and
+        // reinitialize_commrec_for_this_thread. Find a way to express
+        // this better.
     }
 #endif
     /* END OF CAUTION: cr is now reliable */
@@ -865,13 +606,12 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
         /* now broadcast everything to the non-master nodes/threads: */
         init_parallel(cr, inputrec, mtop);
 
-        /* The master rank decided on the use of GPUs,
-         * broadcast this information to all ranks.
-         */
-        gmx_bcast_sim(sizeof(bUseGPU), &bUseGPU, cr);
+        gmx_bcast_sim(sizeof(nonbondedOnGpu), &nonbondedOnGpu, cr);
     }
+    // TODO: Error handling
+    mdModules.assignOptionsToModules(*inputrec->params, nullptr);
 
-    if (fplog != NULL)
+    if (fplog != nullptr)
     {
         pr_inputrec(fplog, 0, "Input Parameters", inputrec, FALSE);
         fprintf(fplog, "\n");
@@ -882,8 +622,10 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
 
     /* A parallel command line option consistency check that we can
        only do after any threads have started. */
-    if (!PAR(cr) &&
-        (ddxyz[XX] > 1 || ddxyz[YY] > 1 || ddxyz[ZZ] > 1 || npme > 0))
+    if (!PAR(cr) && (domdecOptions.numCells[XX] > 1 ||
+                     domdecOptions.numCells[YY] > 1 ||
+                     domdecOptions.numCells[ZZ] > 1 ||
+                     domdecOptions.numPmeRanks > 0))
     {
         gmx_fatal(FARGS,
                   "The -dd or -npme option request a parallel simulation, "
@@ -900,7 +642,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
                   );
     }
 
-    if (bRerunMD &&
+    if (doRerun &&
         (EI_ENERGY_MINIMIZATION(inputrec->eI) || eiNM == inputrec->eI))
     {
         gmx_fatal(FARGS, "The .mdp file specified an energy mininization or normal mode algorithm, and these are not compatible with mdrun -rerun");
@@ -913,22 +655,22 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
 
     if (!(EEL_PME(inputrec->coulombtype) || EVDW_PME(inputrec->vdwtype)))
     {
-        if (npme > 0)
+        if (domdecOptions.numPmeRanks > 0)
         {
             gmx_fatal_collective(FARGS, cr->mpi_comm_mysim, MASTER(cr),
                                  "PME-only ranks are requested, but the system does not use PME for electrostatics or LJ");
         }
 
-        npme = 0;
+        domdecOptions.numPmeRanks = 0;
     }
 
-    if (bUseGPU && npme < 0)
+    if (nonbondedOnGpu && domdecOptions.numPmeRanks < 0)
     {
         /* With GPUs we don't automatically use PME-only ranks. PME ranks can
          * improve performance with many threads per GPU, since our OpenMP
          * scaling is bad, but it's difficult to automate the setup.
          */
-        npme = 0;
+        domdecOptions.numPmeRanks = 0;
     }
 
 #ifdef GMX_FAHCORE
@@ -948,9 +690,9 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
     snew(fcd, 1);
 
     /* This needs to be called before read_checkpoint to extend the state */
-    init_disres(fplog, mtop, inputrec, cr, fcd, state, repl_ex_nst > 0);
+    init_disres(fplog, mtop, inputrec, cr, fcd, state, replExParams.exchangeInterval > 0);
 
-    init_orires(fplog, mtop, state->x, inputrec, cr, &(fcd->orires),
+    init_orires(fplog, mtop, as_rvec_array(state->x.data()), inputrec, cr, &(fcd->orires),
                 state);
 
     if (inputrecDeform(inputrec))
@@ -976,7 +718,11 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
         tMPI_Thread_mutex_unlock(&deform_init_box_mutex);
     }
 
-    if (Flags & MD_STARTFROMCPT)
+    ObservablesHistory   observablesHistory = {};
+
+    ContinuationOptions &continuationOptions = mdrunOptions.continuationOptions;
+
+    if (continuationOptions.startedFromCheckpoint)
     {
         /* Check if checkpoint file exists before doing continuation.
          * This way we can use identical input options for the first and subsequent runs...
@@ -984,26 +730,28 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
         gmx_bool bReadEkin;
 
         load_checkpoint(opt2fn_master("-cpi", nfile, fnm, cr), &fplog,
-                        cr, ddxyz, &npme,
-                        inputrec, state, &bReadEkin,
-                        (Flags & MD_APPENDFILES),
-                        (Flags & MD_APPENDFILESSET),
-                        (Flags & MD_REPRODUCIBLE));
+                        cr, domdecOptions.numCells,
+                        inputrec, state, &bReadEkin, &observablesHistory,
+                        continuationOptions.appendFiles,
+                        continuationOptions.appendFilesOptionSet,
+                        mdrunOptions.reproducible);
 
         if (bReadEkin)
         {
-            Flags |= MD_READ_EKIN;
+            continuationOptions.haveReadEkin = true;
         }
     }
 
-    if (MASTER(cr) && (Flags & MD_APPENDFILES))
+    if (SIMMASTER(cr) && continuationOptions.appendFiles)
     {
         gmx_log_open(ftp2fn(efLOG, nfile, fnm), cr,
-                     Flags, &fplog);
+                     continuationOptions.appendFiles, &fplog);
+        logOwner = buildLogger(fplog, nullptr);
+        mdlog    = logOwner.logger();
     }
 
-    /* override nsteps with value from cmdline */
-    override_nsteps_cmdline(fplog, nsteps_cmdline, inputrec, cr);
+    /* override nsteps with value set on the commamdline */
+    override_nsteps_cmdline(mdlog, mdrunOptions.numStepsCommandline, inputrec);
 
     if (SIMMASTER(cr))
     {
@@ -1015,27 +763,21 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
         gmx_bcast(sizeof(box), box, cr);
     }
 
-    // TODO This should move to do_md(), because it only makes sense
-    // with dynamical integrators, but there is no test coverage and
-    // it interacts with constraints, somehow.
-    /* Essential dynamics */
-    if (opt2bSet("-ei", nfile, fnm))
+    /* Update rlist and nstlist. */
+    if (inputrec->cutoff_scheme == ecutsVERLET)
     {
-        /* Open input and output files, allocate space for ED data structure */
-        ed = ed_open(mtop->natoms, &state->edsamstate, nfile, fnm, Flags, oenv, cr);
+        prepare_verlet_scheme(fplog, cr, inputrec, nstlist_cmdline, mtop, box,
+                              nonbondedOnGpu || (emulateGpuNonbonded == EmulateGpuNonbonded::Yes), *hwinfo->cpuInfo);
     }
 
     if (PAR(cr) && !(EI_TPI(inputrec->eI) ||
                      inputrec->eI == eiNM))
     {
-        cr->dd = init_domain_decomposition(fplog, cr, Flags, ddxyz, npme,
-                                           dd_rank_order,
-                                           rdd, rconstr,
-                                           dddlb_opt, dlb_scale,
-                                           ddcsx, ddcsy, ddcsz,
+        cr->dd = init_domain_decomposition(fplog, cr, domdecOptions, mdrunOptions,
                                            mtop, inputrec,
-                                           box, state->x,
+                                           box, as_rvec_array(state->x.data()),
                                            &ddbox, &npme_major, &npme_minor);
+        // Note that local state still does not exist yet.
     }
     else
     {
@@ -1066,32 +808,33 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
 #if GMX_MPI
     if (MULTISIM(cr))
     {
-        md_print_info(cr, fplog,
-                      "This is simulation %d out of %d running as a composite GROMACS\n"
-                      "multi-simulation job. Setup for this simulation:\n\n",
-                      cr->ms->sim, cr->ms->nsim);
+        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);
     }
-    md_print_info(cr, fplog, "Using %d MPI %s\n",
-                  cr->nnodes,
+    GMX_LOG(mdlog.warning).appendTextFormatted(
+            "Using %d MPI %s\n",
+            cr->nnodes,
 #if GMX_THREAD_MPI
-                  cr->nnodes == 1 ? "thread" : "threads"
+            cr->nnodes == 1 ? "thread" : "threads"
 #else
-                  cr->nnodes == 1 ? "process" : "processes"
+            cr->nnodes == 1 ? "process" : "processes"
 #endif
-                  );
+            );
     fflush(stderr);
 #endif
 
     /* Check and update hw_opt for the cut-off scheme */
-    check_and_update_hw_opt_2(hw_opt, inputrec->cutoff_scheme);
+    check_and_update_hw_opt_2(&hw_opt, inputrec->cutoff_scheme);
 
     /* Check and update hw_opt for the number of MPI ranks */
-    check_and_update_hw_opt_3(hw_opt);
+    check_and_update_hw_opt_3(&hw_opt);
 
-    gmx_omp_nthreads_init(fplog, cr,
+    gmx_omp_nthreads_init(mdlog, cr,
                           hwinfo->nthreads_hw_avail,
-                          hw_opt->nthreads_omp,
-                          hw_opt->nthreads_omp_pme,
+                          hw_opt.nthreads_omp,
+                          hw_opt.nthreads_omp_pme,
                           (cr->duty & DUTY_PP) == 0,
                           inputrec->cutoff_scheme == ecutsVERLET);
 
@@ -1103,30 +846,65 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
     }
 #endif
 
-    if (bUseGPU)
+    // Contains the ID of the GPU used by each PP rank on this node,
+    // indexed by that rank. Empty if no GPUs are selected for use on
+    // this node.
+    std::vector<int> gpuTaskAssignment;
+    if (nonbondedOnGpu)
     {
-        /* Select GPU id's to use */
-        gmx_select_gpu_ids(fplog, cr, &hwinfo->gpu_info, bForceUseGPU,
-                           &hw_opt->gpu_opt);
+        /* Currently the DD code assigns duty to ranks that can
+         * include PP work that currently can be executed on a single
+         * GPU, if present and compatible.  This has to be coordinated
+         * across PP ranks on a node, with possible multiple devices
+         * or sharing devices on a node, either from the user
+         * selection, or automatically. */
+        bool rankCanUseGpu = cr->duty & DUTY_PP;
+        gpuTaskAssignment = mapPpRanksToGpus(rankCanUseGpu, cr, hwinfo->gpu_info, hw_opt);
     }
-    else
+
+    reportGpuUsage(mdlog, hwinfo->gpu_info, !hw_opt.gpuIdTaskAssignment.empty(),
+                   gpuTaskAssignment, cr->nrank_pp_intranode, cr->nnodes > 1);
+
+    if (!gpuTaskAssignment.empty())
     {
-        /* Ignore (potentially) manually selected GPUs */
-        hw_opt->gpu_opt.n_dev_use = 0;
+        GMX_RELEASE_ASSERT(cr->nrank_pp_intranode == static_cast<int>(gpuTaskAssignment.size()),
+                           "The number of PP ranks on each node must equal the number of GPU tasks used on each node");
     }
 
-    /* check consistency across ranks of things like SIMD
-     * support and number of GPUs selected */
-    gmx_check_hw_runconf_consistency(fplog, hwinfo, cr, hw_opt, bUseGPU);
+    /* Prevent other ranks from continuing after an issue was found
+     * and reported as a fatal error.
+     *
+     * TODO This function implements a barrier so that MPI runtimes
+     * can organize an orderly shutdown if one of the ranks has had to
+     * issue a fatal error in various code already run. When we have
+     * MPI-aware error handling and reporting, this should be
+     * improved. */
+#if GMX_MPI
+    if (PAR(cr))
+    {
+        MPI_Barrier(cr->mpi_comm_mysim);
+    }
+#endif
 
     /* Now that we know the setup is consistent, check for efficiency */
-    check_resource_division_efficiency(hwinfo, hw_opt, Flags & MD_NTOMPSET,
-                                       cr, fplog);
+    check_resource_division_efficiency(hwinfo, hw_opt.nthreads_tot, !gpuTaskAssignment.empty(), mdrunOptions.ntompOptionIsSet,
+                                       cr, mdlog);
+
+    gmx_device_info_t *shortRangedDeviceInfo = nullptr;
+    int                shortRangedDeviceId   = -1;
+    if (cr->duty & DUTY_PP)
+    {
+        if (!gpuTaskAssignment.empty())
+        {
+            shortRangedDeviceId   = gpuTaskAssignment[cr->rank_pp_intranode];
+            shortRangedDeviceInfo = getDeviceInfo(hwinfo->gpu_info, shortRangedDeviceId);
+        }
+    }
 
     if (DOMAINDECOMP(cr))
     {
         /* When we share GPUs over ranks, we need to know this for the DLB */
-        dd_setup_dlb_resource_sharing(cr, hwinfo, hw_opt);
+        dd_setup_dlb_resource_sharing(cr, shortRangedDeviceId);
     }
 
     /* getting number of PP/PME threads
@@ -1135,7 +913,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
      */
     nthreads_pme = gmx_omp_nthreads_get(emntPME);
 
-    wcycle = wallcycle_init(fplog, resetstep, cr);
+    wcycle = wallcycle_init(fplog, mdrunOptions.timingOptions.resetStep, cr);
 
     if (PAR(cr))
     {
@@ -1156,7 +934,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
         /* Note that membed cannot work in parallel because mtop is
          * changed here. Fix this if we ever want to make it run with
          * multiple ranks. */
-        membed = init_membed(fplog, nfile, fnm, mtop, inputrec, state, cr, &cpt_period);
+        membed = init_membed(fplog, nfile, fnm, mtop, inputrec, state, cr, &mdrunOptions.checkpointOptions.period);
     }
 
     snew(nrnb, 1);
@@ -1165,14 +943,15 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
         bcast_state(cr, state);
 
         /* Initiate forcerecord */
-        fr          = mk_forcerec();
-        fr->hwinfo  = hwinfo;
-        fr->gpu_opt = &hw_opt->gpu_opt;
-        init_forcerec(fplog, fr, fcd, inputrec, mtop, cr, box,
+        fr                 = mk_forcerec();
+        fr->forceProviders = mdModules.initForceProviders();
+        init_forcerec(fplog, mdlog, fr, fcd,
+                      inputrec, mtop, cr, box,
                       opt2fn("-table", nfile, fnm),
                       opt2fn("-tablep", nfile, fnm),
                       getFilenm("-tableb", nfile, fnm),
                       nbpu_opt,
+                      shortRangedDeviceInfo,
                       FALSE,
                       pforce);
 
@@ -1202,7 +981,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
             /* Make molecules whole at start of run */
             if (fr->ePBC != epbcNONE)
             {
-                do_pbc_first_mtop(fplog, inputrec->ePBC, box, mtop, state->x);
+                do_pbc_first_mtop(fplog, inputrec->ePBC, box, mtop, as_rvec_array(state->x.data()));
             }
             if (vsite)
             {
@@ -1210,7 +989,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
                  * for the initial distribution in the domain decomposition
                  * and for the initial shell prediction.
                  */
-                construct_vsites_mtop(vsite, mtop, state->x);
+                construct_vsites_mtop(vsite, mtop, as_rvec_array(state->x.data()));
             }
         }
 
@@ -1222,7 +1001,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
         }
         else
         {
-            pmedata = NULL;
+            pmedata = nullptr;
         }
     }
     else
@@ -1230,24 +1009,37 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
         /* This is a PME only node */
 
         /* We don't need the state */
-        done_state(state);
+        stateInstance.reset();
+        state         = nullptr;
 
         ewaldcoeff_q  = calc_ewaldcoeff_q(inputrec->rcoulomb, inputrec->ewald_rtol);
         ewaldcoeff_lj = calc_ewaldcoeff_lj(inputrec->rvdw, inputrec->ewald_rtol_lj);
         snew(pmedata, 1);
     }
 
-    if (hw_opt->thread_affinity != threadaffOFF)
+    if (hw_opt.thread_affinity != threadaffOFF)
     {
         /* Before setting affinity, check whether the affinity has changed
          * - which indicates that probably the OpenMP library has changed it
          * since we first checked).
          */
-        gmx_check_thread_affinity_set(fplog, cr,
-                                      hw_opt, hwinfo->nthreads_hw_avail, TRUE);
+        gmx_check_thread_affinity_set(mdlog, cr,
+                                      &hw_opt, hwinfo->nthreads_hw_avail, TRUE);
+
+        int nthread_local;
+        /* threads on this MPI process or TMPI thread */
+        if (cr->duty & DUTY_PP)
+        {
+            nthread_local = gmx_omp_nthreads_get(emntNonbonded);
+        }
+        else
+        {
+            nthread_local = gmx_omp_nthreads_get(emntPME);
+        }
 
         /* Set the CPU affinity */
-        gmx_set_thread_affinity(fplog, cr, hw_opt, hwinfo);
+        gmx_set_thread_affinity(mdlog, cr, &hw_opt, *hwinfo->hardwareTopology,
+                                nthread_local, nullptr);
     }
 
     /* Initiate PME if necessary,
@@ -1271,9 +1063,15 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
 
         if (cr->duty & DUTY_PME)
         {
-            status = gmx_pme_init(pmedata, cr, npme_major, npme_minor, inputrec,
-                                  mtop ? mtop->natoms : 0, nChargePerturbed, nTypePerturbed,
-                                  (Flags & MD_REPRODUCIBLE), nthreads_pme);
+            try
+            {
+                status = gmx_pme_init(pmedata, cr, npme_major, npme_minor, inputrec,
+                                      mtop ? mtop->natoms : 0, nChargePerturbed, nTypePerturbed,
+                                      mdrunOptions.reproducible,
+                                      ewaldcoeff_q, ewaldcoeff_lj,
+                                      nthreads_pme);
+            }
+            GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
             if (status != 0)
             {
                 gmx_fatal(FARGS, "Error %d initializing PME", status);
@@ -1303,17 +1101,23 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
             inputrec->pull_work =
                 init_pull(fplog, inputrec->pull, inputrec, nfile, fnm,
                           mtop, cr, oenv, inputrec->fepvals->init_lambda,
-                          EI_DYNAMICS(inputrec->eI) && MASTER(cr), Flags);
+                          EI_DYNAMICS(inputrec->eI) && MASTER(cr),
+                          continuationOptions);
         }
 
         if (inputrec->bRot)
         {
             /* Initialize enforced rotation code */
-            init_rot(fplog, inputrec, nfile, fnm, cr, state->x, state->box, mtop, oenv,
-                     bVerbose, Flags);
+            init_rot(fplog, inputrec, nfile, fnm, cr, as_rvec_array(state->x.data()), state->box, mtop, oenv,
+                     mdrunOptions);
         }
 
-        constr = init_constraints(fplog, mtop, inputrec, ed, state, cr);
+        /* Let init_constraints know whether we have essential dynamics constraints.
+         * TODO: inputrec should tell us whether we use an algorithm, not a file option or the checkpoint
+         */
+        bool doEdsam = (opt2fn_null("-ei", nfile, fnm) != nullptr || observablesHistory.edsamHistory);
+
+        constr = init_constraints(fplog, mtop, inputrec, doEdsam, cr);
 
         if (DOMAINDECOMP(cr))
         {
@@ -1322,22 +1126,21 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
              * because fr->cginfo_mb is set later.
              */
             dd_init_bondeds(fplog, cr->dd, mtop, vsite, inputrec,
-                            Flags & MD_DDBONDCHECK, fr->cginfo_mb);
+                            domdecOptions.checkBondedInteractions,
+                            fr->cginfo_mb);
         }
 
         /* Now do whatever the user wants us to do (how flexible...) */
-        my_integrator(inputrec->eI) (fplog, cr, nfile, fnm,
-                                     oenv, bVerbose,
-                                     nstglobalcomm,
+        my_integrator(inputrec->eI) (fplog, cr, mdlog, nfile, fnm,
+                                     oenv,
+                                     mdrunOptions,
                                      vsite, constr,
-                                     nstepout, inputrec, mtop,
-                                     fcd, state,
-                                     mdatoms, nrnb, wcycle, ed, fr,
-                                     repl_ex_nst, repl_ex_nex, repl_ex_seed,
+                                     mdModules.outputProvider(),
+                                     inputrec, mtop,
+                                     fcd, state, &observablesHistory,
+                                     mdatoms, nrnb, wcycle, fr,
+                                     replExParams,
                                      membed,
-                                     cpt_period, max_hours,
-                                     imdport,
-                                     Flags,
                                      walltime_accounting);
 
         if (inputrec->bRot)
@@ -1364,14 +1167,20 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
     /* Finish up, write some stuff
      * if rerunMD, don't write last frame again
      */
-    finish_run(fplog, cr,
+    finish_run(fplog, mdlog, cr,
                inputrec, nrnb, wcycle, walltime_accounting,
-               fr ? fr->nbv : NULL,
+               fr ? fr->nbv : nullptr,
                EI_DYNAMICS(inputrec->eI) && !MULTISIM(cr));
 
+    // Free PME data
+    if (pmedata)
+    {
+        gmx_pme_destroy(*pmedata); // TODO: pmedata is always a single element list, refactor
+        pmedata = nullptr;
+    }
 
     /* Free GPU memory and context */
-    free_gpu_resources(fr, cr, &hwinfo->gpu_info, fr ? fr->gpu_opt : NULL);
+    free_gpu_resources(fr, cr, shortRangedDeviceInfo);
 
     if (doMembed)
     {
@@ -1385,15 +1194,13 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
     walltime_accounting_destroy(walltime_accounting);
 
     /* Close logfile already here if we were appending to it */
-    if (MASTER(cr) && (Flags & MD_APPENDFILES))
+    if (MASTER(cr) && continuationOptions.appendFiles)
     {
         gmx_log_close(fplog);
     }
 
     rc = (int)gmx_get_stop_condition();
 
-    done_ed(&ed);
-
 #if GMX_THREAD_MPI
     /* we need to join all threads. The sub-threads join when they
        exit this function, but the master thread needs to be told to
index bfbaa315a193a03d3da68bc535f2be9caba51f2b..90fe1d98b8e9415a8e54b136cb418e0b28808b89 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 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.
@@ -32,7 +32,7 @@
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-/*! \internal \file
+/*! \libinternal \file
  *
  * \brief Declares the routine running the inetgrators.
  *
 
 #include <cstdio>
 
+#include <array>
+
+#include "gromacs/commandline/filenm.h"
+#include "gromacs/domdec/domdec.h"
 #include "gromacs/hardware/hw_info.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/real.h"
 
+#include "repl_ex.h"
+
 struct gmx_output_env_t;
+struct ReplicaExchangeParameters;
 struct t_commrec;
-struct t_filenm;
 
 namespace gmx
 {
 
-/*! \brief Driver routine, that calls the different methods
+/*! \libinternal \brief Runner object for supporting setup and execution of mdrun.
+ *
+ * This class has responsibility for the lifetime of data structures
+ * that exist for the life of the simulation, e.g. for logging and
+ * communication.
  *
- * \param[in] hw_opt   Hardware detection structure
- * \param[in] fplog    File pointer for log file
- * \param[in] cr       Communication data
- * \param[in] nfile    Number of files
- * \param[in] fnm      Array of filenames and file properties
- * \param[in] oenv     Output variables for storing xvg files etc.
- * \param[in] bVerbose Verbose output or not
- * \param[in] nstglobalcomm Number of steps between global communication
- * \param[in] ddxyz    Division of sub-boxes over processors for
- *                     use in domain decomposition parallellization
- * \param[in] dd_rank_order Ordering of the PP and PME ranks
- * \param[in] npme     The number of separate PME ranks requested, -1 = auto
- * \param[in] rdd      The maximum distance for bonded interactions with DD (nm)
- * \param[in] rconstr  Maximum distance for P-LINCS (nm)
- * \param[in] dddlb_opt File name for debugging
- * \param[in] dlb_scale File name for debugging
- * \param[in] ddcsx     File name for debugging
- * \param[in] ddcsy     File name for debugging
- * \param[in] ddcsz     File name for debugging
- * \param[in] nbpu_opt  Type of nonbonded processing unit
- * \param[in] nstlist_cmdline  Override neighbor search frequency
- * \param[in] nsteps_cmdline   Override number of simulation steps
- * \param[in] nstepout     How often to write to the console
- * \param[in] resetstep    Reset the step counter
- * \param[in] nmultisim    Number of parallel simulations to run
- * \param[in] repl_ex_nst  Number steps between replica exchange attempts
- * \param[in] repl_ex_nex  Number of replicas in REMD
- * \param[in] repl_ex_seed The seed for Monte Carlo swaps
- * \param[in] pforce       Minimum force for printing (for debugging)
- * \param[in] cpt_period    How often to checkpoint the simulation
- * \param[in] max_hours     Maximume length of the simulation (wall time)
- * \param[in] imdport       Interactive MD port (socket)
- * \param[in] Flags         More command line options
+ * \todo Most of the attributes should be declared by specific modules
+ * as command-line options. Accordingly, they do not conform to the
+ * naming scheme, because that would make for a lot of noise in the
+ * diff, only to have it change again when the options move to their
+ * modules.
+ *
+ * \todo Preparing logging and MPI contexts could probably be a
+ * higher-level responsibility, so that an Mdrunner would get made
+ * without needing to re-initialize these components (as currently
+ * happens always for the master rank, and differently for the spawned
+ * ranks with thread-MPI).
  */
-int mdrunner(gmx_hw_opt_t *hw_opt,
-             FILE *fplog, struct t_commrec *cr, int nfile,
-             const t_filenm fnm[], const gmx_output_env_t *oenv, gmx_bool bVerbose,
-             int nstglobalcomm, ivec ddxyz, int dd_rank_order, int npme,
-             real rdd, real rconstr, const char *dddlb_opt, real dlb_scale,
-             const char *ddcsx, const char *ddcsy, const char *ddcsz,
-             const char *nbpu_opt, int nstlist_cmdline,
-             gmx_int64_t nsteps_cmdline, int nstepout, int resetstep,
-             int nmultisim, int repl_ex_nst, int repl_ex_nex,
-             int repl_ex_seed, real pforce, real cpt_period, real max_hours,
-             int imdport, unsigned long Flags);
+class Mdrunner
+{
+    private:
+        //! Parallelism-related user options.
+        gmx_hw_opt_t             hw_opt;
+        //! Filenames and properties from command-line argument values.
+        std::array<t_filenm, 34> filenames =
+        {{{ efTPR, nullptr,     nullptr,     ffREAD },
+          { efTRN, "-o",        nullptr,     ffWRITE },
+          { efCOMPRESSED, "-x", nullptr,     ffOPTWR },
+          { efCPT, "-cpi",      nullptr,     ffOPTRD | ffALLOW_MISSING },
+          { efCPT, "-cpo",      nullptr,     ffOPTWR },
+          { efSTO, "-c",        "confout",   ffWRITE },
+          { efEDR, "-e",        "ener",      ffWRITE },
+          { efLOG, "-g",        "md",        ffWRITE },
+          { efXVG, "-dhdl",     "dhdl",      ffOPTWR },
+          { efXVG, "-field",    "field",     ffOPTWR },
+          { efXVG, "-table",    "table",     ffOPTRD },
+          { efXVG, "-tablep",   "tablep",    ffOPTRD },
+          { efXVG, "-tableb",   "table",     ffOPTRDMULT },
+          { efTRX, "-rerun",    "rerun",     ffOPTRD },
+          { efXVG, "-tpi",      "tpi",       ffOPTWR },
+          { efXVG, "-tpid",     "tpidist",   ffOPTWR },
+          { efEDI, "-ei",       "sam",       ffOPTRD },
+          { efXVG, "-eo",       "edsam",     ffOPTWR },
+          { efXVG, "-devout",   "deviatie",  ffOPTWR },
+          { efXVG, "-runav",    "runaver",   ffOPTWR },
+          { efXVG, "-px",       "pullx",     ffOPTWR },
+          { efXVG, "-pf",       "pullf",     ffOPTWR },
+          { efXVG, "-ro",       "rotation",  ffOPTWR },
+          { efLOG, "-ra",       "rotangles", ffOPTWR },
+          { efLOG, "-rs",       "rotslabs",  ffOPTWR },
+          { efLOG, "-rt",       "rottorque", ffOPTWR },
+          { efMTX, "-mtx",      "nm",        ffOPTWR },
+          { efRND, "-multidir", nullptr,     ffOPTRDMULT},
+          { efDAT, "-membed",   "membed",    ffOPTRD },
+          { efTOP, "-mp",       "membed",    ffOPTRD },
+          { efNDX, "-mn",       "membed",    ffOPTRD },
+          { efXVG, "-if",       "imdforces", ffOPTWR },
+          { efXVG, "-swap",     "swapions",  ffOPTWR }}};
+        /*! \brief Filename arguments.
+         *
+         * Provided for compatibility with old C-style code accessing
+         * command-line arguments that are file names. */
+        t_filenm *fnm = filenames.data();
+        /*! \brief Number of filename argument values.
+         *
+         * Provided for compatibility with old C-style code accessing
+         * command-line arguments that are file names. */
+        int nfile = filenames.size();
+        //! Output context for writing text files
+        gmx_output_env_t                *oenv = nullptr;
+        //! Ongoing collection of mdrun options
+        MdrunOptions                     mdrunOptions;
+        //! Options for the domain decomposition.
+        DomdecOptions                    domdecOptions;
+        //! Target short-range interations for "cpu", "gpu", "gpu_cpu", or "auto". Default is "auto".
+        const char                      *nbpu_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).
+        real                             pforce = -1;
+        //! Handle to file used for logging.
+        FILE                            *fplog;
+        //! Handle to communication data structure.
+        t_commrec                       *cr;
 
+    public:
+        /*! \brief Defaulted constructor.
+         *
+         * Note that when member variables are not present in the constructor
+         * member initialization list (which is true for the default constructor),
+         * then they are initialized with any default member initializer specified
+         * when they were declared, or default initialized. */
+        Mdrunner() = default;
+        //! Start running mdrun by calling its C-style main function.
+        int mainFunction(int argc, char *argv[]);
+        /*! \brief Driver routine, that calls the different simulation methods. */
+        int mdrunner();
+        //! Called when thread-MPI spawns threads.
+        t_commrec *spawnThreads(int numThreadsToLaunch);
+        /*! \brief Re-initializes the object after threads spawn.
+         *
+         * \todo Can this be refactored so that the Mdrunner on a spawned thread is
+         * constructed ready to use? */
+        void reinitializeOnSpawnedThread();
+};
 
 }      // namespace gmx
 
index 6c5270d3e919639328fb87b9b83bd90aac04afa4..d4763d2f7b25a3422fe4192b104d1655cca79f27 100644 (file)
@@ -60,10 +60,7 @@ gmx_add_gtest_executable(
     # pseudo-library for code for mdrun
     $<TARGET_OBJECTS:mdrun_objlib>
     )
-gmx_register_integration_test(
-    ${testname}
-    ${exename}
-    )
+gmx_register_gtest_test(${testname} ${exename} INTEGRATION_TEST)
 
 set(testname "MdrunMpiTests")
 set(exename "mdrun-mpi-test")
@@ -80,8 +77,4 @@ gmx_add_gtest_executable(
     # pseudo-library for code for mdrun
     $<TARGET_OBJECTS:mdrun_objlib>
     )
-gmx_register_mpi_integration_test(
-    ${testname}
-    ${exename}
-    2
-    )
+gmx_register_gtest_test(${testname} ${exename} MPI_RANKS 2 INTEGRATION_TEST)
index 47e0414959d67602e129a5d613cb24643a0a4494..0fe91c7e1e78b9ea6ed13df16313b9bc1fe79b9b 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,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.
@@ -52,7 +52,6 @@
 
 #include "gromacs/fileio/enxio.h"
 #include "gromacs/utility/exceptions.h"
-#include "gromacs/utility/scoped_cptr.h"
 #include "gromacs/utility/stringutil.h"
 
 #include "testutils/testasserts.h"
@@ -123,7 +122,7 @@ openEnergyFileToReadFields(const std::string              &filename,
 }
 
 //! Helper function to obtain resources
-t_enxframe *make_enxframe()
+static t_enxframe *make_enxframe()
 {
     t_enxframe *frame;
 
index 8ecfae71e4b2a2bfb3b195fb34d068a01182f03b..b33af5466dcbc22b57d938752a2f6088e36fe50b 100644 (file)
@@ -60,7 +60,7 @@
 #include <vector>
 
 #include "gromacs/fileio/enxio.h"
-#include "gromacs/utility/scoped_cptr.h"
+#include "gromacs/utility/unique_cptr.h"
 
 #include "testutils/testasserts.h"
 
@@ -91,11 +91,11 @@ EnergyFrameReaderPtr openEnergyFileToReadFields(const std::string              &
 class EnergyFrame;
 
 //! Convenience smart pointer typedef
-typedef scoped_cptr<ener_file, done_ener_file> ener_file_ptr;
+typedef unique_cptr<ener_file, done_ener_file> ener_file_ptr;
 //! Helper function to free resources (NB free_enxframe only frees the contents, not the pointer itself)
 void done_enxframe(t_enxframe *fr);
 //! Convenience smart pointer typedef
-typedef scoped_cptr<t_enxframe, done_enxframe> enxframe_ptr;
+typedef unique_cptr<t_enxframe, done_enxframe> enxframe_ptr;
 
 /*! \internal
  * \brief Manages returning an EnergyFrame containing required energy
@@ -138,9 +138,9 @@ class EnergyFrameReader
         //! Convert energy field name to its index within a t_enxframe from this file.
         std::map<std::string, int> indicesOfEnergyFields_;
         //! Owning handle of an open energy file ready to read frames.
-        ener_file_ptr              energyFileGuard_;
+        const ener_file_ptr        energyFileGuard_;
         //! Owning handle of contents of .edr file frame after reading.
-        enxframe_ptr               enxframeGuard_;
+        const enxframe_ptr         enxframeGuard_;
         //! Whether the API has been used properly (ie. probe before reading).
         bool                       haveProbedForNextFrame_;
         //! Whether there has been a probe that found a next frame.
index cf1c3ada4ba36f10ee4f030eba1192600862ecbb..d5244f3fbe522a0d1993dfe93fe921e3f26d7335 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,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.
@@ -58,7 +58,8 @@
 #include "programs/mdrun/mdrun_main.h"
 
 #include "testutils/cmdlinetest.h"
-#include "testutils/integrationtests.h"
+#include "testutils/mpitest.h"
+#include "testutils/testfilemanager.h"
 #include "testutils/testoptions.h"
 
 namespace gmx
@@ -73,10 +74,6 @@ namespace test
 namespace
 {
 
-#if GMX_THREAD_MPI || defined(DOXYGEN)
-//! Number of tMPI threads for child mdrun call.
-int g_numThreads = 1;
-#endif
 #if GMX_OPENMP || defined(DOXYGEN)
 //! Number of OpenMP threads for child mdrun call.
 int g_numOpenMPThreads = 1;
@@ -85,10 +82,6 @@ int g_numOpenMPThreads = 1;
 GMX_TEST_OPTIONS(MdrunTestOptions, options)
 {
     GMX_UNUSED_VALUE(options);
-#if GMX_THREAD_MPI
-    options->addOption(IntegerOption("nt").store(&g_numThreads)
-                           .description("Number of thread-MPI threads/ranks for child mdrun calls"));
-#endif
 #if GMX_OPENMP
     options->addOption(IntegerOption("nt_omp").store(&g_numOpenMPThreads)
                            .description("Number of OpenMP threads for child mdrun calls"));
@@ -98,18 +91,18 @@ GMX_TEST_OPTIONS(MdrunTestOptions, options)
 
 }
 
-SimulationRunner::SimulationRunner(IntegrationTestFixture *fixture) :
-    fixture_(fixture),
+SimulationRunner::SimulationRunner(TestFileManager *fileManager) :
     topFileName_(),
     groFileName_(),
     fullPrecisionTrajectoryFileName_(),
     ndxFileName_(),
-    mdpInputFileName_(fixture_->fileManager_.getTemporaryFilePath("input.mdp")),
-    mdpOutputFileName_(fixture_->fileManager_.getTemporaryFilePath("output.mdp")),
-    tprFileName_(fixture_->fileManager_.getTemporaryFilePath(".tpr")),
-    logFileName_(fixture_->fileManager_.getTemporaryFilePath(".log")),
-    edrFileName_(fixture_->fileManager_.getTemporaryFilePath(".edr")),
-    nsteps_(-2)
+    mdpInputFileName_(fileManager->getTemporaryFilePath("input.mdp")),
+    mdpOutputFileName_(fileManager->getTemporaryFilePath("output.mdp")),
+    tprFileName_(fileManager->getTemporaryFilePath(".tpr")),
+    logFileName_(fileManager->getTemporaryFilePath(".log")),
+    edrFileName_(fileManager->getTemporaryFilePath(".edr")),
+    nsteps_(-2),
+    fileManager_(*fileManager)
 {
 #if GMX_LIB_MPI
     GMX_RELEASE_ASSERT(gmx_mpi_initialized(), "MPI system not initialized for mdrun tests");
@@ -120,6 +113,9 @@ SimulationRunner::SimulationRunner(IntegrationTestFixture *fixture) :
 // and verlet-buffer-tolerance = -1 gives a grompp error. If we keep
 // things that way, this function should be renamed. For now,
 // force the use of the group scheme.
+// TODO There is possible outstanding unexplained behaviour of mdp
+// input parsing e.g. Redmine 2074, so this particular set of mdp
+// contents is also tested with GetIrTest in gmxpreprocess-test.
 void
 SimulationRunner::useEmptyMdpFile()
 {
@@ -148,15 +144,15 @@ SimulationRunner::useStringAsNdxFile(const char *ndxString)
 void
 SimulationRunner::useTopGroAndNdxFromDatabase(const char *name)
 {
-    topFileName_ = fixture_->fileManager_.getInputFilePath((std::string(name) + ".top").c_str());
-    groFileName_ = fixture_->fileManager_.getInputFilePath((std::string(name) + ".gro").c_str());
-    ndxFileName_ = fixture_->fileManager_.getInputFilePath((std::string(name) + ".ndx").c_str());
+    topFileName_ = fileManager_.getInputFilePath((std::string(name) + ".top").c_str());
+    groFileName_ = fileManager_.getInputFilePath((std::string(name) + ".gro").c_str());
+    ndxFileName_ = fileManager_.getInputFilePath((std::string(name) + ".ndx").c_str());
 }
 
 void
 SimulationRunner::useGroFromDatabase(const char *name)
 {
-    groFileName_ = fixture_->fileManager_.getInputFilePath((std::string(name) + ".gro").c_str());
+    groFileName_ = fileManager_.getInputFilePath((std::string(name) + ".gro").c_str());
 }
 
 int
@@ -169,6 +165,7 @@ SimulationRunner::callGromppOnThisRank(const CommandLine &callerRef)
     caller.addOption("-n", ndxFileName_);
     caller.addOption("-p", topFileName_);
     caller.addOption("-c", groFileName_);
+    caller.addOption("-r", groFileName_);
 
     caller.addOption("-po", mdpOutputFileName_);
     caller.addOption("-o", tprFileName_);
@@ -228,57 +225,21 @@ SimulationRunner::callMdrun(const CommandLine &callerRef)
     caller.addOption("-o", fullPrecisionTrajectoryFileName_);
     caller.addOption("-x", reducedPrecisionTrajectoryFileName_);
 
-    caller.addOption("-deffnm", fixture_->fileManager_.getTemporaryFilePath("state"));
+    caller.addOption("-deffnm", fileManager_.getTemporaryFilePath("state"));
 
     if (nsteps_ > -2)
     {
         caller.addOption("-nsteps", nsteps_);
     }
 
-#if GMX_MPI
-#  if GMX_GPU != GMX_GPU_NONE
-#    if GMX_THREAD_MPI
-    int         numGpusNeeded = g_numThreads;
-#    else   /* Must be real MPI */
-    int         numGpusNeeded = gmx_node_num();
-#    endif
-    std::string gpuIdString(numGpusNeeded, '0');
-    caller.addOption("-gpu_id", gpuIdString.c_str());
-#  endif
-#endif
-
 #if GMX_THREAD_MPI
-    caller.addOption("-ntmpi", g_numThreads);
+    caller.addOption("-ntmpi", getNumberOfTestMpiRanks());
 #endif
 
 #if GMX_OPENMP
     caller.addOption("-ntomp", g_numOpenMPThreads);
 #endif
 
-#if GMX_GPU != GMX_GPU_NONE
-    /* TODO Ideally, with real MPI, we could call
-     * gmx_collect_hardware_mpi() here and find out how many nodes
-     * mdrun will run on. For now, we assume that we're running on one
-     * node regardless of the number of ranks, because that's true in
-     * Jenkins and for most developers running the tests. */
-    int numberOfNodes = 1;
-#if GMX_THREAD_MPI
-    /* Can't use gmx_node_num() because it is only valid after spawn of thread-MPI threads */
-    int numberOfRanks = g_numThreads;
-#elif GMX_LIB_MPI
-    int numberOfRanks = gmx_node_num();
-#else
-    int numberOfRanks = 1;
-#endif
-    if (numberOfRanks > numberOfNodes && !gmx_multiple_gpu_per_node_supported())
-    {
-        if (gmx_node_rank() == 0)
-        {
-            fprintf(stderr, "GROMACS in this build configuration cannot run on more than one GPU per node,\n so with %d ranks and %d nodes, this test will disable GPU support", numberOfRanks, numberOfNodes);
-        }
-        caller.addOption("-nb", "cpu");
-    }
-#endif
     return gmx_mdrun(caller.argc(), caller.argv());
 }
 
@@ -303,7 +264,7 @@ MdrunTestFixtureBase::~MdrunTestFixtureBase()
 
 // ====
 
-MdrunTestFixture::MdrunTestFixture() : runner_(this)
+MdrunTestFixture::MdrunTestFixture() : runner_(&fileManager_)
 {
 }
 
index a7a608d426d47782e54fa9697f1bf5aa3c213844..c7649b6d47befc253b6bc30d99d5d02441e1bda9 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,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.
 
 #include <gtest/gtest.h>
 
+#include "gromacs/utility/classhelpers.h"
+
 #include "testutils/cmdlinetest.h"
-#include "testutils/integrationtests.h"
+#include "testutils/testfilemanager.h"
 
 namespace gmx
 {
-
 namespace test
 {
 
@@ -86,9 +87,8 @@ namespace test
 class SimulationRunner
 {
     public:
-        /*! \brief Constructor, which establishes the fixture that
-         * will own each object */
-        explicit SimulationRunner(IntegrationTestFixture *fixture_);
+        //! Initializes a runner with given manager for temporary files.
+        explicit SimulationRunner(TestFileManager *fileManager);
 
         //! Use an empty .mdp file as input to grompp
         void useEmptyMdpFile();
@@ -116,10 +116,6 @@ class SimulationRunner
          * with default command line */
         int callMdrun();
 
-    private:
-        //! Provides access to the test fixture, e.g. for the TestFileManager
-        IntegrationTestFixture *fixture_;
-    public:
         //@{
         /*! \name Names for frequently used grompp and mdrun output files
          *
@@ -146,6 +142,11 @@ class SimulationRunner
         std::string swapFileName_;
         int         nsteps_;
         //@}
+
+    private:
+        TestFileManager &fileManager_;
+
+        GMX_DISALLOW_COPY_AND_ASSIGN(SimulationRunner);
 };
 
 /*! \internal
@@ -172,7 +173,7 @@ class SimulationRunner
  *
  * \ingroup module_mdrun_integration_tests
  */
-class MdrunTestFixtureBase : public IntegrationTestFixture
+class MdrunTestFixtureBase : public ::testing::Test
 {
     public:
         MdrunTestFixtureBase();
@@ -187,12 +188,14 @@ class MdrunTestFixtureBase : public IntegrationTestFixture
  *
  * \ingroup module_mdrun_integration_tests
  */
-class MdrunTestFixture : public IntegrationTestFixture
+class MdrunTestFixture : public ::testing::Test
 {
     public:
         MdrunTestFixture();
         virtual ~MdrunTestFixture();
 
+        //! Manages temporary files during the test.
+        TestFileManager  fileManager_;
         //! Helper object to manage the preparation for and call of mdrun
         SimulationRunner runner_;
 };
index a3a315563d14cb0f9a0db99e844bcf65c15bdcc7..84368cee16e1e69b95a30946c784c6c547e34d75 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,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.
@@ -80,22 +80,22 @@ TEST_P(MdrunRerun, WithDifferentInputFormats)
  * database. These all have two identical frames of two SPC water
  * molecules, which were generated via trjconv from the .gro
  * version. */
-const char *trajectoryFileNames[] = {
-    "../../../gromacs/gmxana/legacytests/spc2-traj.trr",
-#if defined GMX_USE_TNG && HAVE_ZLIB
-    "../../../gromacs/gmxana/legacytests/spc2-traj.tng",
+const char *const trajectoryFileNames[] = {
+    "../../../gromacs/gmxana/tests/spc2-traj.trr",
+#if GMX_USE_TNG
+    "../../../gromacs/gmxana/tests/spc2-traj.tng",
 #endif
-    "../../../gromacs/gmxana/legacytests/spc2-traj.xtc",
-    "../../../gromacs/gmxana/legacytests/spc2-traj.gro",
-    "../../../gromacs/gmxana/legacytests/spc2-traj.pdb",
-    "../../../gromacs/gmxana/legacytests/spc2-traj.g96"
+    "../../../gromacs/gmxana/tests/spc2-traj.xtc",
+    "../../../gromacs/gmxana/tests/spc2-traj.gro",
+    "../../../gromacs/gmxana/tests/spc2-traj.pdb",
+    "../../../gromacs/gmxana/tests/spc2-traj.g96"
 };
 // TODO later. Find a better way to manage this file database and
 // these string arrays that index it
 
 INSTANTIATE_TEST_CASE_P(NoFatalErrorFrom,
                         MdrunRerun,
-                            ::testing::ValuesIn(gmx::ArrayRef<const char*>(trajectoryFileNames)));
+                            ::testing::ValuesIn(trajectoryFileNames));
 
 /*! \todo Add other tests for mdrun -rerun, e.g.
  *
index ec775502486f03784b9a173deb18301c13468f7a..3ab7316310e5926ed65a5e3274c373d8406e7197 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,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.
@@ -55,7 +55,7 @@ namespace test
 {
 
 //! Build a simple .mdp file
-void organizeMdpFile(SimulationRunner *runner)
+static void organizeMdpFile(SimulationRunner *runner)
 {
     // Make sure -maxh has a chance to propagate
     runner->useStringAsMdpFile("nsteps = 100\n"
index cda1460c8c83055b13f6f8898e5c55b72b1216dc..fb237221b4c76cff6c47193859ab4a58e8e616de 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,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.
@@ -51,7 +51,6 @@
 #include "gromacs/fileio/trxio.h"
 #include "gromacs/trajectory/trajectoryframe.h"
 #include "gromacs/utility/exceptions.h"
-#include "gromacs/utility/scoped_cptr.h"
 #include "gromacs/utility/stringutil.h"
 
 #include "testutils/testasserts.h"
@@ -62,7 +61,7 @@ namespace test
 {
 
 //! Helper function to obtain resources
-t_trxframe *make_trxframe()
+static t_trxframe *make_trxframe()
 {
     t_trxframe *frame;
 
index a2fe2c68f9565e6d628f2c95ca302000e96f9534..9184cb141bcb25e422635da5ee815b70473858d5 100644 (file)
@@ -54,7 +54,7 @@
 #include "gromacs/fileio/oenv.h"
 #include "gromacs/fileio/trxio.h"
 #include "gromacs/trajectory/trajectoryframe.h"
-#include "gromacs/utility/scoped_cptr.h"
+#include "gromacs/utility/unique_cptr.h"
 
 #include "testutils/testasserts.h"
 
@@ -70,13 +70,13 @@ namespace test
 class TrajectoryFrame;
 
 //! Convenience smart pointer typedef
-typedef scoped_cptr<gmx_output_env_t, output_env_done> oenv_ptr;
+typedef unique_cptr<gmx_output_env_t, output_env_done> oenv_ptr;
 //! Convenience smart pointer typedef
-typedef scoped_cptr<t_trxstatus, close_trx> trxstatus_file_ptr;
+typedef unique_cptr<t_trxstatus, close_trx> trxstatus_file_ptr;
 //! Helper function to free all resources
 void done_trxframe(t_trxframe *fr);
 //! Convenience smart pointer typedef
-typedef scoped_cptr<t_trxframe, done_trxframe> trxframe_ptr;
+typedef unique_cptr<t_trxframe, done_trxframe> trxframe_ptr;
 
 /*! \internal
  * \brief Manages returning a t_trxframe whose contents were read from
@@ -125,7 +125,7 @@ class TrajectoryFrameReader
         //! Owning handle of an open trajectory file ready to read frames.
         trxstatus_file_ptr trajectoryFileGuard_;
         //! Owning handle of contents of trajectory file frame after reading.
-        trxframe_ptr       trxframeGuard_;
+        const trxframe_ptr trxframeGuard_;
         //! Whether the first frame has been read
         bool               haveReadFirstFrame_;
         //! Whether the API has been used properly (ie. probe before reading).
index 050394cad21d1414062371d17d23364f1cbd6a1d..4005555dc194543c8ad6dbb0ee639e958efc922c 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
@@ -129,7 +129,7 @@ static void MBCallback(t_x11 * /*x11*/, int dlg_mess, int /*item_id*/,
 {
     t_gmx *gmx;
 
-    gmx = (t_gmx *)data;
+    gmx = static_cast<t_gmx *>(data);
     if (dlg_mess == DLG_EXIT)
     {
         hide_mb(gmx);
@@ -155,7 +155,7 @@ static void QuitCB(t_x11 *x11, int dlg_mess, int /*item_id*/,
                    char *set, void *data)
 {
     t_gmx  *gmx;
-    gmx = (t_gmx *)data;
+    gmx = static_cast<t_gmx *>(data);
 
     hide_mb(gmx);
     if (dlg_mess == DLG_EXIT)
@@ -215,7 +215,7 @@ static void ExportCB(t_x11 *x11, int dlg_mess, int item_id,
     t_gmx     *gmx;
     t_dlg     *dlg;
 
-    gmx = (t_gmx *)data;
+    gmx = static_cast<t_gmx *>(data);
     dlg = gmx->dlgs[edExport];
     switch (dlg_mess)
     {
@@ -253,17 +253,6 @@ enum {
     eg0, egTOPOL, egCONFIN, egPARAM, eg1, eg1PROC, eg32PROC
 };
 
-static void Extract(t_dlg *dlg, int ID, char *buf)
-{
-    char *et;
-
-    et = EditText(dlg, ID);
-    if (et)
-    {
-        std::strcpy(buf, et);
-    }
-}
-
 enum bond_set {
     ebShowH = 11, ebDPlus, ebRMPBC, ebCue, ebSkip, ebWait
 };
@@ -278,7 +267,7 @@ static void BondsCB(t_x11 *x11, int dlg_mess, int item_id,
     t_gmx     *gmx;
     char      *endptr;
 
-    gmx = (t_gmx *)data;
+    gmx = static_cast<t_gmx *>(data);
     if (ebond == -1)
     {
         ebond = gmx->man->molw->bond_type;
@@ -413,19 +402,6 @@ enum {
     esFUNCT = 1, esBSHOW, esINFIL, esINDEXFIL, esLSQ, esSHOW, esPLOTFIL
 };
 
-static bool in_set(int i, int n, int set[])
-{
-    int j;
-    for (j = 0; (j < n); j++)
-    {
-        if (set[j] == i)
-        {
-            return true;
-        }
-    }
-    return false;
-}
-
 typedef t_dlg *t_mmb (t_x11 *x11, t_gmx *gmx);
 
 typedef struct {
index 08dc54edfc14fcd58f64890fc18cecde0d878894..526552a190746e88da331daf7d280e0a933b1bed 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, by the GROMACS development team, led by
+ * 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.
@@ -52,8 +52,8 @@ static const char *type[] = {
     "pixmap", "statictext",   "edittext", "defbutton"
 };
 
-void ReadDlgError(const char *infile, eDLGERR err, const char *s,
-                  const char *file, int line)
+static void ReadDlgError(const char *infile, eDLGERR err, const char *s,
+                         const char *file, int line)
 {
     std::fprintf(stderr, "Error: ");
     switch (err)
@@ -182,11 +182,11 @@ static t_fitem *NewFItem(void)
 
     snew(fitem, 1);
     fitem->nname = 0;
-    fitem->name  = NULL;
-    fitem->set   = NULL;
-    fitem->get   = NULL;
-    fitem->def   = NULL;
-    fitem->help  = NULL;
+    fitem->name  = nullptr;
+    fitem->set   = nullptr;
+    fitem->get   = nullptr;
+    fitem->def   = nullptr;
+    fitem->help  = nullptr;
 
     return fitem;
 }
@@ -211,9 +211,9 @@ static t_fgroup *NewFGroup(void)
     t_fgroup *fgroup;
 
     snew(fgroup, 1);
-    fgroup->name   = NULL;
+    fgroup->name   = nullptr;
     fgroup->nfitem = 0;
-    fgroup->fitem  = NULL;
+    fgroup->fitem  = nullptr;
 
     return fgroup;
 }
@@ -246,9 +246,9 @@ static t_fgrid *NewFGrid(void)
     fgrid->w        = 0;
     fgrid->h        = 0;
     fgrid->nfgroup  = 0;
-    fgrid->fgroup   = NULL;
+    fgrid->fgroup   = nullptr;
     fgrid->nfsimple = 0;
-    fgrid->fsimple  = NULL;
+    fgrid->fsimple  = nullptr;
 
     return fgrid;
 }
index 177e787982b15b3ec4b50e44cc80085d48b4f9e5..3bcfd9bcd030e6ea6652c059fa37f8b3b0ad87d4 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, by the GROMACS development team, led by
+ * 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.
@@ -57,7 +57,7 @@ t_filter *init_filter(t_atoms *atoms, const char *fn, int natom_trx)
     int       g, i;
 
     snew(f, 1);
-    if (fn != NULL)
+    if (fn != nullptr)
     {
         f->grps = init_index(fn, &f->grpnames);
     }
index 1e2bbdde598184b162a0fa057ec2bab7aa03d9c2..bb397e2af699eefc549285a184e78ba7d8a0307b 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, by the GROMACS development team, led by
+ * 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.
@@ -105,12 +105,12 @@ static bool LogoCallBack(t_x11 *x11, XEvent *event, Window /*w*/, void *data)
     };
 #define COFFS 70
     static t_mess   Mess[] = {
-        { "GROMACS",                         0,       20, NULL },
-        { NULL,                             16,        9, NULL },
-        { "Copyright (c) 1991-2013",        COFFS+ 2,  9, NULL },
-        { "D.v.d.Spoel, E.Lindahl, B.Hess", COFFS+11,  9, NULL },
-        { "& Groningen University ",        COFFS+20,  9, NULL },
-        { "click to dismiss",               COFFS+31,  8, NULL }
+        { "GROMACS",                         0,       20, nullptr },
+        { nullptr,                             16,        9, nullptr },
+        { "Copyright (c) 1991-2013",        COFFS+ 2,  9, nullptr },
+        { "D.v.d.Spoel, E.Lindahl, B.Hess", COFFS+11,  9, nullptr },
+        { "& Groningen University ",        COFFS+20,  9, nullptr },
+        { "click to dismiss",               COFFS+31,  8, nullptr }
     };
 #define NMESS asize(Mess)
     int             i;
@@ -201,7 +201,7 @@ t_logo *init_logo(t_x11 *x11, Window parent, bool bQuitOnClick)
     logo->bQuitOnClick = bQuitOnClick;
     InitWin(&logo->wd, 0, 0, 360, 270, 1, "GROMACS");
     bg = LIGHTGREY;
-    if ((newcol = std::getenv("GMX_LOGO_COLOR")) != NULL)
+    if ((newcol = std::getenv("GMX_LOGO_COLOR")) != nullptr)
     {
         GetNamedColor(x11, newcol, &bg);
     }
@@ -209,9 +209,9 @@ t_logo *init_logo(t_x11 *x11, Window parent, bool bQuitOnClick)
                                         logo->wd.x, logo->wd.y,
                                         logo->wd.width, logo->wd.height,
                                         logo->wd.bwidth, WHITE, bg);
-    for (i = 0, logo->bigfont = NULL; (i < NBF); i++)
+    for (i = 0, logo->bigfont = nullptr; (i < NBF); i++)
     {
-        if ((logo->bigfont = XLoadQueryFont(x11->disp, bfname[i])) != NULL)
+        if ((logo->bigfont = XLoadQueryFont(x11->disp, bfname[i])) != nullptr)
         {
             break;
         }
@@ -224,9 +224,9 @@ t_logo *init_logo(t_x11 *x11, Window parent, bool bQuitOnClick)
 #ifdef DEBUG
     std::fprintf(stderr, "Big Logofont: %s\n", bfname[i]);
 #endif
-    for (i = 0, logo->smallfont = NULL; (i < NSF); i++)
+    for (i = 0, logo->smallfont = nullptr; (i < NSF); i++)
     {
-        if ((logo->smallfont = XLoadQueryFont(x11->disp, sfname[i])) != NULL)
+        if ((logo->smallfont = XLoadQueryFont(x11->disp, sfname[i])) != nullptr)
         {
             break;
         }
index d9d43e72858b70652205fa5c6e008ba6b6f629cc..f30af45af66f16644da60993de997a88a15e2926 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,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.
@@ -229,7 +229,7 @@ void set_file(t_x11 *x11, t_manager *man, const char *trajectory,
     snew(man->szLab, sh.natoms);
     snew(man->bHydro, sh.natoms);
     snew(bB, sh.natoms);
-    read_tpx_top(status, NULL, man->box, &man->natom, NULL, NULL, &man->top);
+    read_tpx_top(status, nullptr, man->box, &man->natom, nullptr, nullptr, &man->top);
     man->gpbc = gmx_rmpbc_init(&man->top.idef, -1, man->natom);
 
     man->natom =
@@ -500,7 +500,7 @@ static bool TitleCallBack(t_x11 *x11, XEvent *event, Window /*w*/, void *data)
 {
     t_windata *wd;
 
-    wd = (t_windata *)data;
+    wd = static_cast<t_windata *>(data);
     switch (event->type)
     {
         case Expose:
@@ -525,7 +525,7 @@ static bool ManCallBack(t_x11 *x11, XEvent *event, Window /*w*/, void *data)
     t_manager *man;
     int        width, height;
 
-    man = (t_manager *)data;
+    man = static_cast<t_manager *>(data);
     switch (event->type)
     {
         case ConfigureNotify:
@@ -644,7 +644,7 @@ t_manager *init_man(t_x11 *x11, Window Parent,
     t_manager *man;
 
     snew(man, 1);
-    man->status = NULL;
+    man->status = nullptr;
     man->bPlus  = true;
     man->bSort  = true;
     man->oenv   = oenv;
@@ -661,7 +661,7 @@ t_manager *init_man(t_x11 *x11, Window Parent,
     man->molw = init_mw(x11, man->wd.self, 0, 0, 1, 1, WHITE, BLUE, ePBC, box);
 
     /* Title Window */
-    InitWin(&(man->title), 0, 0, 1, 1, 0, NULL);
+    InitWin(&(man->title), 0, 0, 1, 1, 0, nullptr);
     man->title.self = XCreateSimpleWindow(x11->disp, man->molw->wd.self,
                                           man->title.x, man->title.y,
                                           man->title.width, man->title.height,
index a2c605462985fe3bbe886df287dbd0526ea5f1a5..e285dd43d4c3988851c7334ac4640e677e81cb76 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, by the GROMACS development team, led by
+ * 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.
@@ -36,6 +36,8 @@
  */
 #include "gmxpre.h"
 
+#include "molps.h"
+
 #include <cstdlib>
 
 #include "gromacs/fileio/writeps.h"
index f31009eca27bdb3de2d4d759a26bfdc642d3fcee..f9920c2d470604c6ea2230660b6a9d132ada4826 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, by the GROMACS development team, led by
+ * 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.
@@ -68,13 +68,13 @@ static t_atomcolor ac[] = {
 };
 #define NAC asize(ac)
 
-int search_ac(const char *type)
+static int search_ac(const char *type)
 {
     unsigned int i, nb, mij, best, besti;
 
     best  = 0;
     besti = 0;
-    if (NULL != type)
+    if (nullptr != type)
     {
         for (i = 0; (i < NAC); i++)
         {
@@ -114,7 +114,7 @@ t_rgb *Type2RGB(const char *type)
     return &(ac[i].rgb);
 }
 
-void DrawLegend(t_x11 *x11, t_windata *Win)
+static void DrawLegend(t_x11 *x11, t_windata *Win)
 {
 #define NLAB 6
 #define COLS 3
index d2f27ef9d3f9b609d1853058ed92ebcd5d1e3488..c1123cf54cb47b6e6e1ad1a9379b64188739dd67 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
@@ -61,7 +61,7 @@ static bool MWCallBack(t_x11 *x11, XEvent *event, Window /*w*/, void *data)
     Window    To;
     XEvent    letter;
 
-    mw                          = (t_molwin *)data;
+    mw                          = static_cast<t_molwin *>(data);
     To                          = mw->wd.Parent;
     letter.type                 = ClientMessage;
     letter.xclient.display      = x11->disp;
@@ -98,7 +98,7 @@ static bool MWCallBack(t_x11 *x11, XEvent *event, Window /*w*/, void *data)
     return false;
 }
 
-void set_def (t_molwin *mw, int ePBC, matrix box)
+static void set_def (t_molwin *mw, int ePBC, matrix box)
 {
     mw->bShowHydrogen = true;
     mw->bond_type     = eBFat;
@@ -284,11 +284,11 @@ static void draw_bond(Display *disp, Window w, GC gc,
 
 int compare_obj(const void *a, const void *b)
 {
-    t_object *oa, *ob;
-    real      z;
+    const t_object *oa, *ob;
+    real            z;
 
-    oa = (t_object *)a;
-    ob = (t_object *)b;
+    oa = static_cast<const t_object *>(a);
+    ob = static_cast<const t_object *>(b);
 
     z = oa->z-ob->z;
 
@@ -368,10 +368,10 @@ int filter_vis(t_manager *man)
     return nvis;
 }
 
-void draw_objects(Display *disp, Window w, GC gc, int nobj,
-                  t_object objs[], iv2 vec2[], rvec x[],
-                  unsigned long col[], int size[], bool bShowHydro, int bond_type,
-                  bool bPlus)
+static void draw_objects(Display *disp, Window w, GC gc, int nobj,
+                         t_object objs[], iv2 vec2[], rvec x[],
+                         unsigned long col[], int size[], bool bShowHydro, int bond_type,
+                         bool bPlus)
 {
     bool         bBalls;
     int          i;
@@ -442,7 +442,7 @@ static void draw_box(t_x11 *x11, Window w, t_3dview *view, matrix box,
         { 4, 5 }, { 5, 6 }, { 6, 7 }, { 7, 4 },
         { 0, 4 }, { 1, 5 }, { 2, 6 }, { 3, 7 }
     };
-    static int *edge = NULL;
+    static int *edge = nullptr;
     int         i, j, k, i0, i1;
     rvec        corner[NCUCEDGE], box_center;
     vec4        x4;
@@ -452,7 +452,7 @@ static void draw_box(t_x11 *x11, Window w, t_3dview *view, matrix box,
     if (boxtype == esbTrunc)
     {
         calc_compact_unitcell_vertices(view->ecenter, box, corner);
-        if (edge == NULL)
+        if (edge == nullptr)
         {
             edge = compact_unitcell_edges();
         }
index cc8a4dc63870f39fedbede99e47ceba3763222f3..94fae9e02073980f8bb25f5af74edff58d5fdd99 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, by the GROMACS development team, led by
+ * 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.
@@ -48,7 +48,7 @@
 #include "x11.h"
 #include "xutil.h"
 
-bool ChildCallBack(t_x11 *x11, XEvent *event, Window w, void *data)
+static bool ChildCallBack(t_x11 *x11, XEvent *event, Window w, void *data)
 {
     t_child   *child;
     t_mentry  *m;
@@ -93,7 +93,7 @@ bool ChildCallBack(t_x11 *x11, XEvent *event, Window w, void *data)
     return false;
 }
 
-bool MenuCallBack(t_x11 *x11, XEvent *event, Window /*w*/, void *data)
+static bool MenuCallBack(t_x11 *x11, XEvent *event, Window /*w*/, void *data)
 {
     t_menu *m;
 
@@ -190,7 +190,7 @@ t_menu *init_menu(t_x11 *x11, Window Parent, unsigned long fg, unsigned long bg,
             kid->m      = &(ent[l]);
             kid->Parent = Parent;
             w           = &(kid->wd);
-            InitWin(w, j*mlen, k*mht, mlen-2, mht-2, 1, NULL);
+            InitWin(w, j*mlen, k*mht, mlen-2, mht-2, 1, nullptr);
             w->self = XCreateSimpleWindow(x11->disp, m->wd.self,
                                           w->x, w->y, w->width, w->height,
                                           w->bwidth, bg, bg);
index f72e7aa64ccaf7099a186e32a9413554987605fd..ce3c306b3a22b1c756507e71ee9353d77c21eeac 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,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.
@@ -36,6 +36,8 @@
  */
 #include "gmxpre.h"
 
+#include "view.h"
+
 #include "config.h"
 
 #include <cstdio>
@@ -134,7 +136,7 @@ static bool HandleClient(t_x11 *x11, int ID, t_gmx *gmx)
         case IDDOEXPORT:
             write_sto_conf(gmx->confout, *gmx->man->top.name,
                            &(gmx->man->top.atoms),
-                           gmx->man->x, NULL, gmx->man->molw->ePBC, gmx->man->box);
+                           gmx->man->x, nullptr, gmx->man->molw->ePBC, gmx->man->box);
             break;
         case IDQUIT:
             show_mb(gmx, emQuit);
@@ -311,7 +313,7 @@ static void init_gmx(t_x11 *x11, char *program, int nfile, t_filenm fnm[],
     snew(gmx->wd, 1);
 
     ePBC = read_tpx_top(ftp2fn(efTPR, nfile, fnm),
-                        NULL, box, &natom, NULL, NULL, &top);
+                        nullptr, box, &natom, nullptr, nullptr, &top);
 
     read_first_frame(oenv, &status, ftp2fn(efTRX, nfile, fnm), &fr, TRX_DONT_SKIP);
     close_trx(status);
@@ -333,7 +335,7 @@ static void init_gmx(t_x11 *x11, char *program, int nfile, t_filenm fnm[],
     hints.min_width  = 2*EWIDTH+40;
     hints.min_height = EHEIGHT+LDHEIGHT+LEGHEIGHT+40;
     XSetStandardProperties(x11->disp, gmx->wd->self, gmx->wd->text, program,
-                           pm, NULL, 0, &hints);
+                           pm, nullptr, 0, &hints);
 
     x11->RegisterCallback(x11, gmx->wd->self, x11->root, MainCallBack, gmx);
     x11->SetInputMask(x11, gmx->wd->self,
@@ -396,21 +398,21 @@ int gmx_view(int argc, char *argv[])
 
     gmx_output_env_t *oenv;
     t_filenm          fnm[] = {
-        { efTRX, "-f", NULL, ffREAD },
-        { efTPR, NULL, NULL, ffREAD },
-        { efNDX, NULL, NULL, ffOPTRD }
+        { efTRX, "-f", nullptr, ffREAD },
+        { efTPR, nullptr, nullptr, ffREAD },
+        { efNDX, nullptr, nullptr, ffOPTRD }
     };
 #define NFILE asize(fnm)
 
     if (parse_common_args(&argc, argv, PCA_CAN_TIME, NFILE, fnm,
-                          0, NULL, asize(desc), desc, asize(bugs), bugs, &oenv))
+                          0, nullptr, asize(desc), desc, asize(bugs), bugs, &oenv))
     {
 #if !GMX_X11
         std::fprintf(stderr, "Compiled without X-Windows - can not run viewer.\n");
 #else
         t_x11 *x11;
 
-        if ((x11 = GetX11(&argc, argv)) == NULL)
+        if ((x11 = GetX11(&argc, argv)) == nullptr)
         {
             std::fprintf(stderr, "Can't connect to X Server.\n"
                          "Check your DISPLAY environment variable\n");
index 478bb5c9853fb2e7ad4d3b8effb490a5067e5049..fcfc76d27505d6c4f54676d917418dec3c7f81d5 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, by the GROMACS development team, led by
+ * 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.
@@ -80,16 +80,16 @@ static XFontStruct *GetFont(FILE *err, Display *disp, char *name)
 
     if (name)
     {
-        bFont = ((font = XLQF(err, disp, name)) != NULL);
+        bFont = ((font = XLQF(err, disp, name)) != nullptr);
     }
     else
     {
-        font = NULL;
+        font = nullptr;
     }
 
     for (i = 0; (!bFont && (i < MAXNAMES)); i++)
     {
-        bFont = ((font = XLQF(err, disp, fontnames[i])) != NULL);
+        bFont = ((font = XLQF(err, disp, fontnames[i])) != nullptr);
     }
 
     if (!bFont)
@@ -97,7 +97,7 @@ static XFontStruct *GetFont(FILE *err, Display *disp, char *name)
         fontlist = XListFonts(disp, "?", 1, &count);
         if (count != 0)
         {
-            bFont = ((font = XLQF(err, disp, fontlist[0])) != NULL);
+            bFont = ((font = XLQF(err, disp, fontlist[0])) != nullptr);
         }
     }
     if (!bFont)
@@ -171,7 +171,7 @@ static void MainLoop(t_x11 *x11)
                         /* Filter out expose events with non-zero count field */
                         if (event.xexpose.count != 0)
                         {
-                            curs = NULL;
+                            curs = nullptr;
                         }
                         break;
                     case ConfigureNotify:
@@ -202,7 +202,7 @@ static void RegisterCallback(t_x11 *x11, Window w, Window Parent,
     item->cb     = cb;
     item->mask   = 0;
     item->data   = data;
-    item->next   = NULL;
+    item->next   = nullptr;
 
     if (x11->wlist)
     {
@@ -317,7 +317,7 @@ t_x11 *GetX11(int *argc, char *argv[])
     char          **ARGV;
     char           *display;
     char           *fontname;
-    char           *title, *FG = NULL, *BG = NULL;
+    char           *title, *FG = nullptr, *BG = nullptr;
     bool            bVerbose = false;
     int             i;
 
@@ -380,7 +380,7 @@ t_x11 *GetX11(int *argc, char *argv[])
         argv[i] = ARGV[i];
     }
     *argc      = ARGC;
-    argv[ARGC] = NULL;
+    argv[ARGC] = nullptr;
 
     snew(x11, 1);
     x11->dispname = display;
@@ -389,27 +389,27 @@ t_x11 *GetX11(int *argc, char *argv[])
         x11->console = stderr;
     }
     else
-    if ((x11->console = std::fopen("/dev/null", "w")) == NULL)
+    if ((x11->console = std::fopen("/dev/null", "w")) == nullptr)
     {
         x11->console = stderr;
     }
 
-    if ((x11->disp = XOpenDisplay(display)) == NULL)
+    if ((x11->disp = XOpenDisplay(display)) == nullptr)
     {
         if (bVerbose)
         {
             std::fprintf(x11->console, "Display %s invalid\n", display);
         }
-        return NULL;
+        return nullptr;
     }
 
-    if ((x11->font = GetFont(x11->console, x11->disp, fontname)) == NULL)
+    if ((x11->font = GetFont(x11->console, x11->disp, fontname)) == nullptr)
     {
-        return NULL;
+        return nullptr;
     }
-    if ((x11->gc = GetGC(x11->disp, x11->font)) == NULL)
+    if ((x11->gc = GetGC(x11->disp, x11->font)) == nullptr)
     {
-        return NULL;
+        return nullptr;
     }
 
     x11->root   = DefaultRootWindow(x11->disp);
@@ -486,7 +486,7 @@ t_x11 *GetX11(int *argc, char *argv[])
     }
     x11->title = gmx_strdup(title);
     sfree(title);
-    x11->wlist              = NULL;
+    x11->wlist              = nullptr;
     x11->GetNamedColor      = &GetNamedColor;
     x11->MainLoop           = &MainLoop;
     x11->RegisterCallback   = &RegisterCallback;
index e52f9cb0e35f647207b0ba7b1b4ffcb0460e3e61..027b116f4c45ee45381085750ab620f3f4d7f28c 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,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.
@@ -65,7 +65,7 @@ t_dlgitem *FindItem(t_dlg *dlg, t_id id)
             return dlg->dlgitem[i];
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 t_dlgitem *FindWin(t_dlg *dlg, Window win)
@@ -79,7 +79,7 @@ t_dlgitem *FindWin(t_dlg *dlg, Window win)
             return dlg->dlgitem[i];
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 /*****************************
@@ -91,7 +91,7 @@ bool QueryDlgItemSize(t_dlg *dlg, t_id id, int *w, int *h)
 {
     t_dlgitem *dlgitem;
 
-    if ((dlgitem = FindItem(dlg, id)) != NULL)
+    if ((dlgitem = FindItem(dlg, id)) != nullptr)
     {
         *w = dlgitem->win.width;
         *h = dlgitem->win.height;
@@ -104,7 +104,7 @@ bool QueryDlgItemPos(t_dlg *dlg, t_id id, int *x0, int *y0)
 {
     t_dlgitem *dlgitem;
 
-    if ((dlgitem = FindItem(dlg, id)) != NULL)
+    if ((dlgitem = FindItem(dlg, id)) != nullptr)
     {
         *x0 = dlgitem->win.x;
         *y0 = dlgitem->win.y;
@@ -117,7 +117,7 @@ int QueryDlgItemX(t_dlg *dlg, t_id id)
 {
     t_dlgitem *dlgitem;
 
-    if ((dlgitem = FindItem(dlg, id)) != NULL)
+    if ((dlgitem = FindItem(dlg, id)) != nullptr)
     {
         return dlgitem->win.x;
     }
@@ -128,7 +128,7 @@ int QueryDlgItemY(t_dlg *dlg, t_id id)
 {
     t_dlgitem *dlgitem;
 
-    if ((dlgitem = FindItem(dlg, id)) != NULL)
+    if ((dlgitem = FindItem(dlg, id)) != nullptr)
     {
         return dlgitem->win.y;
     }
@@ -139,7 +139,7 @@ int QueryDlgItemW(t_dlg *dlg, t_id id)
 {
     t_dlgitem *dlgitem;
 
-    if ((dlgitem = FindItem(dlg, id)) != NULL)
+    if ((dlgitem = FindItem(dlg, id)) != nullptr)
     {
         return dlgitem->win.width;
     }
@@ -150,7 +150,7 @@ int QueryDlgItemH(t_dlg *dlg, t_id id)
 {
     t_dlgitem *dlgitem;
 
-    if ((dlgitem = FindItem(dlg, id)) != NULL)
+    if ((dlgitem = FindItem(dlg, id)) != nullptr)
     {
         return dlgitem->win.height;
     }
@@ -164,7 +164,7 @@ bool SetDlgItemSize(t_dlg *dlg, t_id id, int w, int h)
     int        old_w, old_h;
 #endif
 
-    if ((dlgitem = FindItem(dlg, id)) != NULL)
+    if ((dlgitem = FindItem(dlg, id)) != nullptr)
     {
 #ifdef DEBUG
         old_w = dlgitem->win.width;
@@ -213,7 +213,7 @@ bool SetDlgItemPos(t_dlg *dlg, t_id id, int x0, int y0)
     t_dlgitem *dlgitem;
     int        old_x, old_y;
 
-    if ((dlgitem = FindItem(dlg, id)) != NULL)
+    if ((dlgitem = FindItem(dlg, id)) != nullptr)
     {
         old_x          = dlgitem->win.x;
         old_y          = dlgitem->win.y;
@@ -259,7 +259,7 @@ bool IsCBChecked(t_dlg *dlg, t_id id)
 {
     t_dlgitem *dlgitem;
 
-    if ((dlgitem = FindItem(dlg, id)) != NULL)
+    if ((dlgitem = FindItem(dlg, id)) != nullptr)
     {
         if (dlgitem->type == edlgCB)
         {
@@ -291,7 +291,7 @@ int EditTextLen(t_dlg *dlg, t_id id)
 {
     t_dlgitem *dlgitem;
 
-    if ((dlgitem = FindItem(dlg, id)) != NULL)
+    if ((dlgitem = FindItem(dlg, id)) != nullptr)
     {
         if (dlgitem->type == edlgET)
         {
@@ -306,7 +306,7 @@ char *EditText(t_dlg *dlg, t_id id)
 {
     t_dlgitem *dlgitem;
 
-    if ((dlgitem = FindItem(dlg, id)) != NULL)
+    if ((dlgitem = FindItem(dlg, id)) != nullptr)
     {
         if (dlgitem->type == edlgET)
         {
@@ -314,7 +314,7 @@ char *EditText(t_dlg *dlg, t_id id)
         }
     }
 
-    return NULL;
+    return nullptr;
 }
 
 /*****************************
@@ -369,7 +369,7 @@ void NoHelp(t_dlg *dlg)
         "No help for this item"
     };
     MessageBox(dlg->x11, dlg->wDad, "No Help", 2, lines,
-               MB_OK | MB_ICONSTOP | MB_APPLMODAL, NULL, NULL);
+               MB_OK | MB_ICONSTOP | MB_APPLMODAL, nullptr, nullptr);
 }
 
 void HelpDlg(t_dlg *dlg)
@@ -380,7 +380,7 @@ void HelpDlg(t_dlg *dlg)
         "First press the OK button."
     };
     MessageBox(dlg->x11, dlg->win.self, "Help Dialogbox",
-               3, lines, MB_OK | MB_ICONINFORMATION | MB_APPLMODAL, NULL, NULL);
+               3, lines, MB_OK | MB_ICONINFORMATION | MB_APPLMODAL, nullptr, nullptr);
 }
 
 void HelpNow(t_dlg *dlg, t_dlgitem *dlgitem)
@@ -388,7 +388,7 @@ void HelpNow(t_dlg *dlg, t_dlgitem *dlgitem)
     char     buf[80];
     bool     bCont = true;
     int      i, nlines = 0;
-    char   **lines = NULL;
+    char   **lines = nullptr;
 
     if (!dlgitem->help)
     {
@@ -431,7 +431,7 @@ void HelpNow(t_dlg *dlg, t_dlgitem *dlgitem)
     while (bCont);
     MessageBox(dlg->x11, dlg->wDad, "Help",
                nlines, lines,
-               MB_OK | MB_ICONINFORMATION | MB_APPLMODAL, NULL, NULL);
+               MB_OK | MB_ICONINFORMATION | MB_APPLMODAL, nullptr, nullptr);
     for (i = 0; (i < nlines); i++)
     {
         sfree(lines[i]);
@@ -471,7 +471,7 @@ static bool DlgCB(t_x11 *x11, XEvent *event, Window w, void *data)
     int        i, nWndProc;
     t_dlgitem *dlgitem;
 
-    if ((dlgitem = FindWin(dlg, w)) != NULL)
+    if ((dlgitem = FindWin(dlg, w)) != nullptr)
     {
         nWndProc = (dlgitem->WndProc)(x11, dlgitem, event);
 #ifdef DEBUG
@@ -598,7 +598,7 @@ static bool DlgCB(t_x11 *x11, XEvent *event, Window w, void *data)
  * the item itself may not be freed until the dlg is done with
  *
  ****************************/
-void DoCreateDlg(t_dlg *dlg)
+static void DoCreateDlg(t_dlg *dlg)
 {
     XSizeHints           hints;
     XSetWindowAttributes attr;
@@ -630,7 +630,7 @@ void DoCreateDlg(t_dlg *dlg)
     hints.y     = dlg->win.y;
     hints.flags = PPosition;
     XSetStandardProperties(dlg->x11->disp, dlg->win.self, dlg->title,
-                           dlg->title, None, NULL, 0, &hints);
+                           dlg->title, None, nullptr, 0, &hints);
 }
 
 void AddDlgItem(t_dlg *dlg, t_dlgitem *item)
@@ -699,7 +699,7 @@ void FreeDlgItem(t_dlg *dlg, t_id id)
     t_dlgitem *dlgitem;
     int        i;
 
-    if ((dlgitem = FindItem(dlg, id)) != NULL)
+    if ((dlgitem = FindItem(dlg, id)) != nullptr)
     {
         dlg->x11->UnRegisterCallback(dlg->x11, dlgitem->win.self);
         if (dlgitem->win.self)
@@ -757,7 +757,7 @@ void FreeDlg(t_dlg *dlg)
         {
             XDestroyWindow(dlg->x11->disp, dlg->win.self);
         }
-        dlg->dlgitem = NULL;
+        dlg->dlgitem = nullptr;
     }
 }
 
@@ -783,7 +783,7 @@ t_dlg *CreateDlg(t_x11 *x11, Window Parent, const char *title,
     }
     else
     {
-        dlg->title = NULL;
+        dlg->title = nullptr;
     }
     if (w == 0)
     {
@@ -820,14 +820,14 @@ t_dlg *CreateDlg(t_x11 *x11, Window Parent, const char *title,
     {
         y = y0;
     }
-    InitWin(&(dlg->win), x, y, w, h, bw, NULL);
+    InitWin(&(dlg->win), x, y, w, h, bw, nullptr);
     SetDlgSize(dlg, w, h, x0 || y0);
 
     dlg->wDad    = Parent;
     dlg->fg      = x11->fg;
     dlg->bg      = x11->bg;
     dlg->nitem   = 0;
-    dlg->dlgitem = NULL;
+    dlg->dlgitem = nullptr;
 
     DoCreateDlg(dlg);
     return dlg;
index 3fc04abfd6d6f0cf05a16a9ed91da0eb812a2116..3cae52d971c57c2df6d1809dbee9f26857a33cc3 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, by the GROMACS development team, led by
+ * 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.
@@ -250,7 +250,7 @@ static t_dlgitemlist **NewDlgitemList(int w, int h)
         for (j = 0; (j < h); j++)
         {
             grid[i][j].nitem = 0;
-            grid[i][j].list  = NULL;
+            grid[i][j].list  = nullptr;
         }
     }
     return grid;
@@ -348,7 +348,7 @@ static void AddListFGroup(t_x11 *x11, t_dlgitemlist **grid,
     GroupID = (*ID)++;
     item    = &(grid[fgroup->x][fgroup->y]);
     AddListItem(item, CreateGroupBox(x11, fgroup->name, GroupID,
-                                     0, NULL, 0, 0, 0, 0, 0));
+                                     0, nullptr, 0, 0, 0, 0, 0));
     x = 2*OFFS_X;
     y = item->list[0]->win.y+item->list[0]->win.height;
     w = 0;
index 87c5b903cbbd2acaa293ba1acb7dff4aaf2328d7..cf75e603cdedba7b7d2ac8d24e69de35a02854d1 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, by the GROMACS development team, led by
+ * 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.
@@ -436,7 +436,7 @@ static int WndProcET(t_x11 *x11, t_dlgitem *dlgitem, XEvent *event)
             {
                 return DefWndProc(x11, dlgitem, event);
             }
-            XLookupString(&(event->xkey), c, BUFSIZE, &keysym, NULL);
+            XLookupString(&(event->xkey), c, BUFSIZE, &keysym, nullptr);
 #ifdef DEBUG
             std::printf("Keysym: %x\n", keysym);
 #endif
@@ -670,7 +670,7 @@ t_dlgitem *CreatePixmap(Pixmap pm, t_id id,
     t_dlgitem *dlgitem;
 
     dlgitem = newitem();
-    InitWin(&(dlgitem->win), x0, y0, w, h, bw, NULL);
+    InitWin(&(dlgitem->win), x0, y0, w, h, bw, nullptr);
     dlgitem->ID          = id;
     dlgitem->type        = edlgPM;
     dlgitem->u.pixmap.pm = pm;
@@ -700,7 +700,7 @@ t_dlgitem *CreateStaticText(t_x11 *x11,
         }
         w += 2*OFFS_X;
     }
-    InitWin(&(dlgitem->win), x0, y0, w, h, bw, NULL);
+    InitWin(&(dlgitem->win), x0, y0, w, h, bw, nullptr);
     dlgitem->ID                  = id;
     dlgitem->GroupID             = groupid;
     dlgitem->type                = edlgST;
index 51db50c433219f7094089657da090f27032f3bdb..155d1a3d1447261fb5ac120cf8f5191f6ade003b 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, by the GROMACS development team, led by
+ * 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.
 #define ID_ICON    -2
 #define ID_TEXT    -1
 
-static bmchar         *icon_bits   = NULL;
+static bmchar         *icon_bits   = nullptr;
 static int             icon_width  = 0;
 static int             icon_height = 0;
 static unsigned long   icon_fg     = 0;
 static unsigned long   icon_bg     = 0;
 
-void SetIcon(unsigned char *bits, int w, int h, unsigned long fg, unsigned long bg)
+static void SetIcon(unsigned char *bits, int w, int h, unsigned long fg, unsigned long bg)
 {
     icon_bits   = (bmchar *)bits;
     icon_width  = w;
index 8bbc3b358feed5f9f09b7fbf297ad9fb07b7bca0..2c53b3e78508953665f28840446ce925e1130a69 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, by the GROMACS development team, led by
+ * 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.
@@ -145,7 +145,7 @@ void TextInRect(t_x11 *x11, Drawable win,
                 const char *s, int x, int y, int width, int height,
                 eXPos eX, eYPos eY)
 {
-    SpecialTextInRect(x11, NULL, win, s, x, y, width, height, eX, eY);
+    SpecialTextInRect(x11, nullptr, win, s, x, y, width, height, eX, eY);
 }
 
 void TextInWin(t_x11 *x11, t_windata *win,
@@ -171,7 +171,7 @@ void InitWin(t_windata *win, int x0, int y0, int w, int h, int bw, const char *t
     }
     else
     {
-        win->text = NULL;
+        win->text = nullptr;
     }
 #ifdef DEBUG
     std::printf("%s: %d x %d at %d, %d\n", text, w, h, x0, y0);
@@ -255,7 +255,7 @@ typedef struct t_mpos {
     struct t_mpos *prev;
 } t_mpos;
 
-static t_mpos *mpos = NULL;
+static t_mpos *mpos = nullptr;
 
 void PushMouse(Display *disp, Window dest, int x, int y)
 {
index da1fc6a6603530da8b06e35fd1c8540abc21220d..8d48a3a3c3d0e1f1895081ffbf6543f76249b8fa 100644 (file)
 # To help us fund GROMACS development, we humbly ask that you cite
 # the research papers on the package. Check out http://www.gromacs.org.
 
+if (NOT GMX_BUILD_UNITTESTS)
+    gmx_add_missing_tests_notice("Unit tests have not been run. You need to set GMX_BUILD_UNITTESTS=ON if you want to build and run them.")
+    return()
+endif()
+
 include_directories(BEFORE SYSTEM ${GMOCK_INCLUDE_DIRS})
 set(TESTUTILS_SOURCES
     cmdlinetest.cpp
     conftest.cpp
-    integrationtests.cpp
+    filematchers.cpp
     interactivetest.cpp
+    loggertest.cpp
     mpi-printer.cpp
+    mpitest.cpp
     refdata.cpp
     refdata-xml.cpp
+    stdiohelper.cpp
     stringtest.cpp
     testasserts.cpp
     testfilemanager.cpp
@@ -59,7 +67,7 @@ add_library(testutils STATIC ${UNITTEST_TARGET_OPTIONS} ${TESTUTILS_SOURCES})
 set(TESTUTILS_LIBS testutils)
 set_property(TARGET testutils APPEND PROPERTY COMPILE_DEFINITIONS "${GMOCK_COMPILE_DEFINITIONS}")
 set_property(TARGET testutils APPEND PROPERTY COMPILE_FLAGS "${GMOCK_COMPILE_FLAGS}")
-target_link_libraries(testutils libgromacs ${GMOCK_LIBRARIES})
+target_link_libraries(testutils libgromacs ${GMX_COMMON_LIBRARIES} ${GMOCK_LIBRARIES})
 
 if(HAVE_TINYXML2)
     include_directories(SYSTEM ${TinyXML2_INCLUDE_DIR})
@@ -68,8 +76,35 @@ else()
     include_directories(BEFORE SYSTEM "../external/tinyxml2")
 endif()
 
+# TODO Use gmx_add_missing_tests_notice() instead of the messages below.
+set(GMX_CAN_RUN_MPI_TESTS 1)
+if (GMX_MPI)
+    set(_an_mpi_variable_had_content 0)
+    foreach(VARNAME MPIEXEC MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXEC_POSTFLAGS)
+        # These variables need a valid value for the test to run
+        # and pass, but conceivably any of them might be valid
+        # with arbitrary (including empty) content. They can't be
+        # valid if they've been populated with the CMake
+        # find_package magic suffix/value "NOTFOUND", though.
+        if (${VARNAME} MATCHES ".*NOTFOUND")
+            message(STATUS "CMake variable ${VARNAME} was not detected to be a valid value. To test GROMACS correctly, check the advice in the install guide.")
+            set(GMX_CAN_RUN_MPI_TESTS 0)
+        endif()
+        if (NOT VARNAME STREQUAL MPIEXEC AND ${VARNAME})
+            set(_an_mpi_variable_had_content 1)
+        endif()
+    endforeach()
+    if(_an_mpi_variable_had_content AND NOT MPIEXEC)
+        message(STATUS "CMake variable MPIEXEC must have a valid value if one of the other related MPIEXEC variables does. To test GROMACS correctly, check the advice in the install guide.")
+        set(GMX_CAN_RUN_MPI_TESTS 0)
+    endif()
+elseif (NOT GMX_THREAD_MPI)
+    set(GMX_CAN_RUN_MPI_TESTS 0)
+endif()
+
 set(TESTUTILS_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 set(TESTUTILS_DIR ${TESTUTILS_DIR} PARENT_SCOPE)
 set(TESTUTILS_LIBS ${TESTUTILS_LIBS} PARENT_SCOPE)
+set(GMX_CAN_RUN_MPI_TESTS ${GMX_CAN_RUN_MPI_TESTS} PARENT_SCOPE)
 
 add_subdirectory(tests)
index faff8af3d290a8416d7635334253bbfd31806762..5b71c5972d47aa80c72139a2bf986bce099e0cff 100644 (file)
@@ -71,7 +71,8 @@ function (gmx_add_gtest_executable EXENAME)
         add_executable(${EXENAME} ${UNITTEST_TARGET_OPTIONS}
             ${_source_files} ${TESTUTILS_DIR}/unittest_main.cpp)
         target_link_libraries(${EXENAME}
-            ${TESTUTILS_LIBS} libgromacs ${GMOCK_LIBRARIES} ${GMX_EXE_LINKER_FLAGS} ${GMX_STDLIB_LIBRARIES})
+            ${TESTUTILS_LIBS} libgromacs ${GMOCK_LIBRARIES}
+            ${GMX_COMMON_LIBRARIES} ${GMX_EXE_LINKER_FLAGS} ${GMX_STDLIB_LIBRARIES})
         set_property(TARGET ${EXENAME}
             APPEND PROPERTY COMPILE_FLAGS "${GMOCK_COMPILE_FLAGS}")
         set_property(TARGET ${EXENAME}
@@ -81,87 +82,59 @@ function (gmx_add_gtest_executable EXENAME)
     endif()
 endfunction()
 
-function (gmx_register_unit_test NAME EXENAME)
-    if (GMX_BUILD_UNITTESTS AND BUILD_TESTING)
-        add_test(NAME ${NAME}
-                 COMMAND ${EXENAME} --gtest_output=xml:${CMAKE_BINARY_DIR}/Testing/Temporary/${NAME}.xml)
-        set_tests_properties(${NAME} PROPERTIES LABELS "GTest;UnitTest")
-        add_dependencies(tests ${EXENAME})
-    endif()
-endfunction ()
-
-# Use this function to register a test binary as an integration test
-function (gmx_register_integration_test NAME EXENAME)
-    if (GMX_BUILD_UNITTESTS AND BUILD_TESTING)
-        add_test(NAME ${NAME}
-                 COMMAND ${EXENAME} --gtest_output=xml:${CMAKE_BINARY_DIR}/Testing/Temporary/${NAME}.xml)
-        set_tests_properties(${testname} PROPERTIES LABELS "IntegrationTest")
-        add_dependencies(tests ${EXENAME})
-
-        # GMX_EXTRA_LIBRARIES might be needed for mdrun integration tests at
-        # some point.
-        # target_link_libraries(${EXENAME} ${GMX_EXTRA_LIBRARIES} ${GMX_STDLIB_LIBRARIES})
-    endif()
-endfunction ()
-
-# Use this function to register a test binary as an integration test
-# that requires MPI. The intended number of MPI ranks is also passed
+# Use this function with MPI_RANKS <N> INTEGRATION_TEST to register a test
+# binary as an integration test that requires MPI. The intended number of MPI
+# ranks is also passed
 #
-# TODO When a test case needs it, generalize the NUMPROC mechanism so
+# TODO When a test case needs it, generalize the MPI_RANKS mechanism so
 # that ctest can run the test binary over a range of numbers of MPI
 # ranks.
-function (gmx_register_mpi_integration_test NAME EXENAME NUMPROC)
+function (gmx_register_gtest_test NAME EXENAME)
     if (GMX_BUILD_UNITTESTS AND BUILD_TESTING)
-        if (GMX_MPI)
-            foreach(VARNAME MPIEXEC MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXEC_POSTFLAGS)
-                # These variables need a valid value for the test to run
-                # and pass, but conceivably any of them might be valid
-                # with arbitrary (including empty) content. They can't be
-                # valid if they've been populated with the CMake
-                # find_package magic suffix/value "NOTFOUND", though.
-                if (${VARNAME} MATCHES ".*NOTFOUND")
-                    message(STATUS "CMake variable ${VARNAME} was not detected to be a valid value. To test GROMACS correctly, check the advice in the install guide.")
-                    set(_cannot_run_mpi_tests 1)
-                endif()
-                if (NOT VARNAME STREQUAL MPIEXEC AND ${VARNAME})
-                    set(_an_mpi_variable_had_content 1)
-                endif()
-            endforeach()
-            if(_an_mpi_variable_had_content AND NOT MPIEXEC)
-                message(STATUS "CMake variable MPIEXEC must have a valid value if one of the other related MPIEXEC variables does. To test GROMACS correctly, check the advice in the install guide.")
-                set(_cannot_run_mpi_tests 1)
+        set(_options INTEGRATION_TEST)
+        set(_one_value_args MPI_RANKS)
+        cmake_parse_arguments(ARG "${_options}" "${_one_value_args}" "" ${ARGN})
+        set(_xml_path ${CMAKE_BINARY_DIR}/Testing/Temporary/${NAME}.xml)
+        set(_labels GTest)
+        set(_timeout 30)
+        if (ARG_INTEGRATION_TEST)
+            list(APPEND _labels IntegrationTest)
+            set(_timeout 120)
+            gmx_get_test_prefix_cmd(_prefix_cmd IGNORE_LEAKS)
+        else()
+            list(APPEND _labels UnitTest)
+            gmx_get_test_prefix_cmd(_prefix_cmd)
+        endif()
+        set(_cmd ${_prefix_cmd} $<TARGET_FILE:${EXENAME}>)
+        if (ARG_MPI_RANKS)
+            if (NOT GMX_CAN_RUN_MPI_TESTS)
+                return()
             endif()
-            if(NOT _cannot_run_mpi_tests)
-                add_test(NAME ${NAME}
-                    COMMAND
-                    ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${NUMPROC}
-                    ${MPIEXEC_PREFLAGS} $<TARGET_FILE:${EXENAME}> ${MPIEXEC_POSTFLAGS}
-                    --gtest_output=xml:${CMAKE_BINARY_DIR}/Testing/Temporary/${NAME}.xml
-                    )
-                set_tests_properties(${testname} PROPERTIES LABELS "MpiIntegrationTest")
-                add_dependencies(tests ${EXENAME})
+            list(APPEND _labels MpiTest)
+            if (GMX_MPI)
+                set(_cmd
+                    ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${ARG_MPI_RANKS}
+                    ${MPIEXEC_PREFLAGS} ${_cmd} ${MPIEXEC_POSTFLAGS})
+            elseif (GMX_THREAD_MPI)
+                list(APPEND _cmd -ntmpi ${ARG_MPI_RANKS})
             endif()
-
-            # GMX_EXTRA_LIBRARIES might be needed for mdrun integration tests at
-            # some point.
-            # target_link_libraries(${EXENAME} ${GMX_EXTRA_LIBRARIES} ${GMX_STDLIB_LIBRARIES})
-        elseif(GMX_THREAD_MPI)
-            add_test(NAME ${NAME}
-                COMMAND
-                $<TARGET_FILE:${EXENAME}> -nt ${NUMPROC}
-                --gtest_output=xml:${CMAKE_BINARY_DIR}/Testing/Temporary/${NAME}.xml
-                )
-            set_tests_properties(${testname} PROPERTIES LABELS "MpiIntegrationTest")
-            add_dependencies(tests ${EXENAME})
-
-            # GMX_EXTRA_LIBRARIES might be needed for mdrun integration tests at
-            # some point.
-            # target_link_libraries(${EXENAME} ${GMX_EXTRA_LIBRARIES} ${GMX_STDLIB_LIBRARIES})
         endif()
+        add_test(NAME ${NAME}
+                 COMMAND ${_cmd} --gtest_output=xml:${_xml_path})
+        set_tests_properties(${NAME} PROPERTIES LABELS "${_labels}")
+        set_tests_properties(${NAME} PROPERTIES TIMEOUT ${_timeout})
+        add_dependencies(tests ${EXENAME})
     endif()
 endfunction ()
 
 function (gmx_add_unit_test NAME EXENAME)
     gmx_add_gtest_executable(${EXENAME} ${ARGN})
-    gmx_register_unit_test(${NAME} ${EXENAME})
+    gmx_register_gtest_test(${NAME} ${EXENAME})
+endfunction()
+
+function (gmx_add_mpi_unit_test NAME EXENAME RANKS)
+    if (GMX_MPI OR (GMX_THREAD_MPI AND GTEST_IS_THREADSAFE))
+        gmx_add_gtest_executable(${EXENAME} MPI ${ARGN})
+        gmx_register_gtest_test(${NAME} ${EXENAME} MPI_RANKS ${RANKS})
+    endif()
 endfunction()
index d70187ea534dda0b7a83c88fb1c3f11e13b5fdbe..5d2ec6e5f57f9aa715fc0b7a69ddcd4d4e263cb3 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,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.
 #include "gromacs/commandline/cmdlineoptionsmodule.h"
 #include "gromacs/commandline/cmdlineprogramcontext.h"
 #include "gromacs/utility/arrayref.h"
-#include "gromacs/utility/filestream.h"
 #include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/strconvert.h"
 #include "gromacs/utility/stringstream.h"
 #include "gromacs/utility/stringutil.h"
 #include "gromacs/utility/textreader.h"
 #include "gromacs/utility/textwriter.h"
 
+#include "testutils/filematchers.h"
 #include "testutils/refdata.h"
 #include "testutils/testfilemanager.h"
-#include "testutils/textblockmatchers.h"
 
 namespace gmx
 {
@@ -94,14 +94,14 @@ CommandLine::Impl::Impl(const char *const cmdline[], size_t count)
     for (size_t i = 0; i < count; ++i)
     {
         char *arg = strdup(cmdline[i]);
-        if (arg == NULL)
+        if (arg == nullptr)
         {
             throw std::bad_alloc();
         }
         args_.push_back(arg);
         argv_.push_back(arg);
     }
-    argv_.push_back(NULL);
+    argv_.push_back(nullptr);
 }
 
 CommandLine::Impl::~Impl()
@@ -117,7 +117,7 @@ CommandLine::Impl::~Impl()
  */
 
 CommandLine::CommandLine()
-    : impl_(new Impl(NULL, 0))
+    : impl_(new Impl(nullptr, 0))
 {
 }
 
@@ -148,31 +148,22 @@ void CommandLine::append(const char *arg)
     impl_->args_.reserve(newSize);
     impl_->argv_.reserve(newSize + 1);
     char *newArg = strdup(arg);
-    if (newArg == NULL)
+    if (newArg == nullptr)
     {
         throw std::bad_alloc();
     }
     impl_->args_.push_back(newArg);
     impl_->argv_.pop_back(); // Remove the trailing NULL.
     impl_->argv_.push_back(newArg);
-    impl_->argv_.push_back(NULL);
+    impl_->argv_.push_back(nullptr);
     impl_->argc_ = static_cast<int>(newSize);
 }
 
-namespace
+void CommandLine::addOption(const char *name)
 {
-
-//! Helper function for converting values to strings
-template <typename T>
-std::string value2string(T value)
-{
-    std::stringstream ss;
-    ss << value;
-    return ss.str();
+    append(name);
 }
 
-}       // namespace
-
 void CommandLine::addOption(const char *name, const char *value)
 {
     append(name);
@@ -187,13 +178,13 @@ void CommandLine::addOption(const char *name, const std::string &value)
 void CommandLine::addOption(const char *name, int value)
 {
     append(name);
-    append(value2string(value));
+    append(gmx::toString(value));
 }
 
 void CommandLine::addOption(const char *name, double value)
 {
     append(name);
-    append(value2string(value));
+    append(gmx::toString(value));
 }
 
 void CommandLine::merge(const CommandLine &args)
@@ -235,6 +226,18 @@ std::string CommandLine::toString() const
     return CommandLineProgramContext(argc(), argv()).commandLine();
 }
 
+bool CommandLine::contains(const char *name) const
+{
+    for (int i = 0; i < impl_->argc_; ++i)
+    {
+        if (std::strcmp(arg(i), name) == 0)
+        {
+            return true;
+        }
+    }
+    return false;
+}
+
 /********************************************************************
  * CommandLineTestHelper::Impl
  */
@@ -245,27 +248,14 @@ class CommandLineTestHelper::Impl
         struct OutputFileInfo
         {
             OutputFileInfo(const char *option, const std::string &path,
-                           TextBlockMatcherPointer matcher)
+                           FileMatcherPointer matcher)
                 : option(option), path(path), matcher(move(matcher))
             {
             }
-            OutputFileInfo(OutputFileInfo &&other)
-                : option(std::move(other.option)), path(std::move(other.path)),
-                  matcher(std::move(other.matcher))
-            {
-            }
-
-            OutputFileInfo &operator=(OutputFileInfo &&other)
-            {
-                option  = std::move(other.option);
-                path    = std::move(other.path);
-                matcher = std::move(other.matcher);
-                return *this;
-            }
 
             std::string              option;
             std::string              path;
-            TextBlockMatcherPointer  matcher;
+            FileMatcherPointer       matcher;
         };
 
         typedef std::vector<OutputFileInfo>        OutputFileList;
@@ -298,7 +288,7 @@ int CommandLineTestHelper::runModuleDirect(
 {
     // The name and description are not used in the tests, so they can be NULL.
     const std::unique_ptr<ICommandLineModule> wrapperModule(
-            ICommandLineOptionsModule::createModule(NULL, NULL, std::move(module)));
+            ICommandLineOptionsModule::createModule(nullptr, nullptr, std::move(module)));
     return runModuleDirect(wrapperModule.get(), commandLine);
 }
 
@@ -350,6 +340,13 @@ void CommandLineTestHelper::setInputFileContents(
 void CommandLineTestHelper::setOutputFile(
         CommandLine *args, const char *option, const char *filename,
         const ITextBlockMatcherSettings &matcher)
+{
+    setOutputFile(args, option, filename, TextFileMatch(matcher));
+}
+
+void CommandLineTestHelper::setOutputFile(
+        CommandLine *args, const char *option, const char *filename,
+        const IFileMatcherSettings &matcher)
 {
     std::string suffix(filename);
     if (startsWith(filename, "."))
@@ -358,8 +355,7 @@ void CommandLineTestHelper::setOutputFile(
     }
     std::string fullFilename = impl_->fileManager_.getTemporaryFilePath(suffix);
     args->addOption(option, fullFilename);
-    impl_->outputFiles_.push_back(
-            Impl::OutputFileInfo(option, fullFilename, matcher.createMatcher()));
+    impl_->outputFiles_.emplace_back(option, fullFilename, matcher.createFileMatcher());
 }
 
 void CommandLineTestHelper::checkOutputFiles(TestReferenceChecker checker) const
@@ -369,15 +365,11 @@ void CommandLineTestHelper::checkOutputFiles(TestReferenceChecker checker) const
         TestReferenceChecker                 outputChecker(
                 checker.checkCompound("OutputFiles", "Files"));
         Impl::OutputFileList::const_iterator outfile;
-        for (outfile = impl_->outputFiles_.begin();
-             outfile != impl_->outputFiles_.end();
-             ++outfile)
+        for (const auto &outfile : impl_->outputFiles_)
         {
             TestReferenceChecker fileChecker(
-                    outputChecker.checkCompound("File", outfile->option.c_str()));
-            TextInputFile        stream(outfile->path);
-            outfile->matcher->checkStream(&stream, &fileChecker);
-            stream.close();
+                    outputChecker.checkCompound("File", outfile.option.c_str()));
+            outfile.matcher->checkFile(outfile.path, &fileChecker);
         }
     }
 }
@@ -441,6 +433,13 @@ void CommandLineTestBase::setOutputFile(
     impl_->helper_.setOutputFile(&impl_->cmdline_, option, filename, matcher);
 }
 
+void CommandLineTestBase::setOutputFile(
+        const char *option, const char *filename,
+        const IFileMatcherSettings &matcher)
+{
+    impl_->helper_.setOutputFile(&impl_->cmdline_, option, filename, matcher);
+}
+
 CommandLine &CommandLineTestBase::commandLine()
 {
     return impl_->cmdline_;
index d4573e27d4e125e384bb663fb2c72eab7342c02c..5afb6c813e735d16e9708a2dc0f8cb63a0290c8c 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,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.
@@ -63,6 +63,7 @@ class ICommandLineOptionsModule;
 namespace test
 {
 
+class IFileMatcherSettings;
 class ITextBlockMatcherSettings;
 class TestFileManager;
 class TestReferenceChecker;
@@ -140,6 +141,13 @@ class CommandLine
         void append(const char *arg);
         //! Convenience overload taking a std::string.
         void append(const std::string &arg) { append(arg.c_str()); }
+        /*! \brief
+         * Adds an option to the command line, typically a boolean.
+         *
+         * \param[in] name   Name of the option to append, which
+         *                   should start with "-".
+         */
+        void addOption(const char *name);
         /*! \brief
          * Adds an option-value pair to the command line.
          *
@@ -176,6 +184,9 @@ class CommandLine
         //! Returns the command line formatted as a single string.
         std::string toString() const;
 
+        //! Whether the command line contains the given option.
+        bool contains(const char *name) const;
+
     private:
         class Impl;
 
@@ -309,11 +320,16 @@ class CommandLineTestHelper
          *
          * If the output file is needed to trigger some computation, or is
          * unconditionally produced by the code under test, but the contents
-         * are not interesting for the test, use NoTextMatch as the matcher.
+         * are not interesting for the test, use NoContentsMatch as the matcher.
+         * Note that the existence of the output file is still verified.
          */
         void setOutputFile(CommandLine *args, const char *option,
                            const char *filename,
                            const ITextBlockMatcherSettings &matcher);
+        //! \copydoc setOutputFile(CommandLine *, const char *, const char *, const ITextBlockMatcherSettings &)
+        void setOutputFile(CommandLine *args, const char *option,
+                           const char *filename,
+                           const IFileMatcherSettings &matcher);
 
         /*! \brief
          * Checks output files added with setOutputFile() against reference
@@ -391,6 +407,13 @@ class CommandLineTestBase : public ::testing::Test
          */
         void setOutputFile(const char *option, const char *filename,
                            const ITextBlockMatcherSettings &matcher);
+        /*! \brief
+         * Sets an output file parameter and adds it to the set of tested files.
+         *
+         * \see CommandLineTestHelper::setOutputFile()
+         */
+        void setOutputFile(const char *option, const char *filename,
+                           const IFileMatcherSettings &matcher);
 
         /*! \brief
          * Returns the internal CommandLine object used to construct the
diff --git a/src/testutils/filematchers.cpp b/src/testutils/filematchers.cpp
new file mode 100644 (file)
index 0000000..cd68d38
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Implements classes from filematchers.h.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_testutils
+ */
+#include "gmxpre.h"
+
+#include "filematchers.h"
+
+#include "gromacs/utility/filestream.h"
+
+#include "testutils/textblockmatchers.h"
+
+namespace gmx
+{
+namespace test
+{
+
+namespace
+{
+
+class TextFileMatcher : public IFileMatcher
+{
+    public:
+        explicit TextFileMatcher(TextBlockMatcherPointer matcher)
+            : matcher_(std::move(matcher))
+        {
+        }
+
+        virtual void checkFile(const std::string    &path,
+                               TestReferenceChecker *checker)
+        {
+            TextInputFile stream(path);
+            matcher_->checkStream(&stream, checker);
+            stream.close();
+        }
+
+    private:
+        TextBlockMatcherPointer matcher_;
+};
+
+}       // namespace
+
+IFileMatcher::~IFileMatcher()
+{
+}
+
+IFileMatcherSettings::~IFileMatcherSettings()
+{
+}
+
+FileMatcherPointer TextFileMatch::createFileMatcher() const
+{
+    return FileMatcherPointer(new TextFileMatcher(streamSettings_.createMatcher()));
+}
+
+FileMatcherPointer NoContentsMatch::createFileMatcher() const
+{
+    return TextFileMatch(NoTextMatch()).createFileMatcher();
+}
+
+} // namespace test
+} // namespace gmx
diff --git a/src/testutils/filematchers.h b/src/testutils/filematchers.h
new file mode 100644 (file)
index 0000000..df86c13
--- /dev/null
@@ -0,0 +1,156 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares utility classes for testing file contents.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_testutils
+ */
+#ifndef GMX_TESTUTILS_FILEMATCHERS_H
+#define GMX_TESTUTILS_FILEMATCHERS_H
+
+#include <memory>
+#include <string>
+
+namespace gmx
+{
+namespace test
+{
+
+class ITextBlockMatcherSettings;
+class TestReferenceChecker;
+
+/*! \libinternal \brief
+ * Represents a file matcher, matching file contents against reference (or
+ * other) data.
+ *
+ * Typical pattern of declaring such matchers is to
+ *  - Create a factory that implements IFileMatcherSettings,
+ *  - Make that factory provide any necessary parameters that the matcher needs,
+ *    using a "named parameter" idiom (see XvgMatch for an example), and
+ *  - Make the factory create and return an instance of an internal
+ *    implementation class that implements IFileMatcher and provides
+ *    the actual matching logic.
+ *
+ * Any method that then wants to accept a matcher can accept a
+ * IFileMatcherSettings.
+ *
+ * \inlibraryapi
+ * \ingroup module_testutils
+ */
+class IFileMatcher
+{
+    public:
+        virtual ~IFileMatcher();
+
+        /*! \brief
+         * Matches contents of a file.
+         *
+         * \param  path     Path to the file to match.
+         * \param  checker  Checker to use for matching.
+         *
+         * The method can change the state of the provided checker (e.g., by
+         * changing the default tolerance).
+         * The caller is responsible of providing a checker where such state
+         * changes do not matter.
+         */
+        virtual void checkFile(const std::string    &path,
+                               TestReferenceChecker *checker) = 0;
+};
+
+//! Smart pointer for managing a IFileMatcher.
+typedef std::unique_ptr<IFileMatcher> FileMatcherPointer;
+
+/*! \libinternal \brief
+ * Represents a factory for creating a file matcher.
+ *
+ * See derived classes for available matchers.  Each derived class represents
+ * one type of matcher (see IFileMatcher), and provides any methods
+ * necessary to pass parameters to such a matcher.  Methods that accept a
+ * matcher can then take in this interface, and call createFileMatcher() to use
+ * the matcher that the caller of the method specifies.
+ *
+ * \inlibraryapi
+ * \ingroup module_testutils
+ */
+class IFileMatcherSettings
+{
+    public:
+        //! Factory method that constructs the matcher after parameters are set.
+        virtual FileMatcherPointer createFileMatcher() const = 0;
+
+    protected:
+        virtual ~IFileMatcherSettings();
+};
+
+/*! \libinternal \brief
+ * Use a ITextStreamMatcher for matching the contents.
+ *
+ * \inlibraryapi
+ * \ingroup module_testutils
+ */
+class TextFileMatch : public IFileMatcherSettings
+{
+    public:
+        //! Creates a matcher to match contents with given text matcher.
+        explicit TextFileMatch(const ITextBlockMatcherSettings &streamSettings)
+            : streamSettings_(streamSettings)
+        {
+        }
+
+        virtual FileMatcherPointer createFileMatcher() const;
+
+    private:
+        const ITextBlockMatcherSettings &streamSettings_;
+};
+
+/*! \libinternal \brief
+ * Do not check the contents of the file.
+ *
+ * \inlibraryapi
+ * \ingroup module_testutils
+ */
+class NoContentsMatch : public IFileMatcherSettings
+{
+    public:
+        virtual FileMatcherPointer createFileMatcher() const;
+};
+
+} // namespace test
+} // namespace gmx
+
+#endif
index ce8c8541b52d659ddd71e88ca789ff3ed78a9f3a..da76c52d454f96125bff7d5bf5c9edfd6338abe1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 2015,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.
@@ -122,19 +122,14 @@ class InteractiveTestHelper::Impl
 
         void checkOutput()
         {
-            const std::string id = formatString("Output%d", static_cast<int>(currentLine_));
-            if (checker_.checkPresent(bHasOutput_, id.c_str()))
+            if (bHasOutput_)
             {
+                const std::string id = formatString("Output%d", static_cast<int>(currentLine_));
                 StringTestBase::checkText(&checker_, currentOutput_, id.c_str());
+                bHasOutput_ = false;
             }
-            bHasOutput_ = false;
             currentOutput_.clear();
         }
-        void checkPendingInput()
-        {
-            const std::string id = formatString("Input%d", static_cast<int>(currentLine_+1));
-            checker_.checkPresent(false, id.c_str());
-        }
 
         TestReferenceChecker             checker_;
         ConstArrayRef<const char *>      inputLines_;
@@ -180,7 +175,7 @@ TextOutputStream &InteractiveTestHelper::outputStream()
 void InteractiveTestHelper::checkSession()
 {
     impl_->checkOutput();
-    impl_->checkPendingInput();
+    impl_->checker_.checkUnusedEntries();
 }
 
 } // namespace test
diff --git a/src/testutils/loggertest.cpp b/src/testutils/loggertest.cpp
new file mode 100644 (file)
index 0000000..7d3076e
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Implements gmx::test::LoggerTestHelper.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_testutils
+ */
+#include "gmxpre.h"
+
+#include "loggertest.h"
+
+#include <gmock/gmock.h>
+
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/logger.h"
+
+namespace gmx
+{
+namespace test
+{
+
+using ::testing::NiceMock;
+
+namespace
+{
+class MockLogTarget : public ILogTarget
+{
+    public:
+        MOCK_METHOD1(writeEntry, void(const LogEntry &));
+};
+}       // namespace
+
+/********************************************************************
+ * LoggerTestHelper::Impl
+ */
+
+class LoggerTestHelper::Impl
+{
+    public:
+        Impl()
+        {
+            // TODO: Add support for -stdout for echoing the log to stdout.
+            logger_.warning = LogLevelHelper(&getTarget(MDLogger::LogLevel::Warning));
+            logger_.info    = LogLevelHelper(&getTarget(MDLogger::LogLevel::Info));
+        }
+
+        NiceMock<MockLogTarget> &getTarget(MDLogger::LogLevel level)
+        {
+            return targets_[static_cast<int>(level)];
+        }
+
+        NiceMock<MockLogTarget>  targets_[MDLogger::LogLevelCount];
+        MDLogger                 logger_;
+};
+
+/********************************************************************
+ * LoggerTestHelper
+ */
+
+LoggerTestHelper::LoggerTestHelper()
+    : impl_(new Impl)
+{
+}
+
+LoggerTestHelper::~LoggerTestHelper()
+{
+}
+
+const MDLogger &LoggerTestHelper::logger()
+{
+    return impl_->logger_;
+}
+
+void LoggerTestHelper::expectEntryMatchingRegex(gmx::MDLogger::LogLevel level,
+                                                const char             *re)
+{
+    using ::testing::ContainsRegex;
+    using ::testing::Field;
+    auto &target = impl_->getTarget(level);
+    EXPECT_CALL(target, writeEntry(Field(&LogEntry::text, ContainsRegex(re))));
+}
+
+} // namespace test
+} // namespace gmx
diff --git a/src/testutils/loggertest.h b/src/testutils/loggertest.h
new file mode 100644 (file)
index 0000000..1fc4fbf
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares gmx::test::LoggerTestHelper.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_testutils
+ */
+#ifndef GMX_TESTUTILS_LOGGERTEST_H
+#define GMX_TESTUTILS_LOGGERTEST_H
+
+#include "gromacs/utility/classhelpers.h"
+#include "gromacs/utility/logger.h"
+
+namespace gmx
+{
+
+namespace test
+{
+
+/*! \libinternal \brief
+ * Helper class for tests to check output written to a logger.
+ *
+ * \inlibraryapi
+ * \ingroup module_testutils
+ */
+class LoggerTestHelper
+{
+    public:
+        LoggerTestHelper();
+        ~LoggerTestHelper();
+
+        //! Returns the logger to pass to code under test.
+        const MDLogger &logger();
+
+        /*! \brief
+         * Expects a log entry at a given level matching a given regex.
+         *
+         * Currently, the order of the entries is not checked, and if this
+         * method is called once for a log level, then it needs to be called
+         * for all entries produced by the test.
+         *
+         * If not called for a log level, all entries for that level are
+         * accepted.
+         */
+        void expectEntryMatchingRegex(gmx::MDLogger::LogLevel level,
+                                      const char             *re);
+
+    private:
+        class Impl;
+
+        PrivateImplPointer<Impl> impl_;
+};
+
+} // namespace test
+} // namespace gmx
+
+#endif
diff --git a/src/testutils/mpitest.cpp b/src/testutils/mpitest.cpp
new file mode 100644 (file)
index 0000000..959b9c5
--- /dev/null
@@ -0,0 +1,152 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \internal \file
+ * \brief
+ * Implements functions in mpitest.h.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_testutils
+ */
+#include "gmxpre.h"
+
+#include "mpitest.h"
+
+#include "config.h"
+
+#include <gtest/gtest.h>
+
+#include "thread_mpi/tmpi.h"
+
+#include "gromacs/options/basicoptions.h"
+#include "gromacs/options/ioptionscontainer.h"
+#include "gromacs/utility/basenetwork.h"
+#include "gromacs/utility/exceptions.h"
+
+#include "testutils/testoptions.h"
+
+namespace gmx
+{
+namespace test
+{
+
+#if GMX_THREAD_MPI
+
+namespace
+{
+
+//! Number of tMPI threads.
+int g_numThreads = 1;
+//! \cond
+GMX_TEST_OPTIONS(ThreadMpiTestOptions, options)
+{
+    options->addOption(IntegerOption("ntmpi").store(&g_numThreads)
+                           .description("Number of thread-MPI threads/ranks for the test"));
+}
+//! \endcond
+
+//! Thread entry function for other thread-MPI threads.
+void threadStartFunc(void *data)
+{
+    std::function<void()> &testBody = *reinterpret_cast<std::function<void()> *>(data);
+    try
+    {
+        testBody();
+    }
+    GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
+}
+
+//! Helper function for starting thread-MPI threads for a test.
+bool startThreads(std::function<void()> *testBody)
+{
+    int ret = tMPI_Init_fn(TRUE, g_numThreads, TMPI_AFFINITY_NONE,
+                           threadStartFunc, testBody);
+    return ret == TMPI_SUCCESS;
+}
+
+class InTestGuard
+{
+    public:
+        explicit InTestGuard(bool *inTest) : inTest_(inTest) { *inTest = true; }
+        ~InTestGuard() { *inTest_ = false; }
+
+    private:
+        bool *inTest_;
+};
+
+}       // namespace
+
+//! \cond internal
+bool threadMpiTestRunner(std::function<void()> testBody)
+{
+    static bool inTest = false;
+
+    if (inTest || g_numThreads <= 1)
+    {
+        return true;
+    }
+#if GMX_THREAD_MPI && !GTEST_IS_THREADSAFE
+    ADD_FAILURE()
+    << "Google Test is not thread safe on this platform. "
+    << "Cannot run multi-rank tests with thread-MPI.";
+#else
+    InTestGuard guard(&inTest);
+    if (!startThreads(&testBody))
+    {
+        return false;
+    }
+    try
+    {
+        testBody();
+    }
+    GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
+    tMPI_Finalize();
+#endif
+    return false;
+}
+//! \endcond
+
+#endif
+
+int getNumberOfTestMpiRanks()
+{
+#if GMX_THREAD_MPI
+    return g_numThreads;
+#else
+    return gmx_node_num();
+#endif
+}
+
+} // namespace test
+} // namespace gmx
diff --git a/src/testutils/mpitest.h b/src/testutils/mpitest.h
new file mode 100644 (file)
index 0000000..20629fd
--- /dev/null
@@ -0,0 +1,131 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Helper functions for MPI tests to make thread-MPI look like real MPI.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_testutils
+ */
+#ifndef GMX_TESTUTILS_MPITEST_H
+#define GMX_TESTUTILS_MPITEST_H
+
+#include "config.h"
+
+#include <functional>
+#include <type_traits>
+
+#include "gromacs/utility/basenetwork.h"
+
+namespace gmx
+{
+namespace test
+{
+
+/*! \brief
+ * Returns the number of MPI ranks to use for an MPI test.
+ *
+ * For thread-MPI builds, this will return the requested number of ranks
+ * even before the thread-MPI threads have been started.
+ *
+ * \ingroup module_testutils
+ */
+int getNumberOfTestMpiRanks();
+//! \cond internal
+/*! \brief
+ * Helper function for GMX_MPI_TEST().
+ *
+ * \ingroup module_testutils
+ */
+bool threadMpiTestRunner(std::function<void()> testBody);
+//! \endcond
+
+/*! \brief
+ * Declares that this test is an MPI-enabled unit test.
+ *
+ * \param[in] expectedRankCount Expected number of ranks for this test.
+ *     The test will fail if run with unsupported number of ranks.
+ *
+ * To write unit tests that run under MPI, you need to do a few things:
+ *  - Put GMX_MPI_TEST() as the first statement in your test body and
+ *    specify the number of ranks this test expects.
+ *  - Declare your unit test in CMake with gmx_add_mpi_unit_test().
+ *    Note that all tests in the binary should fulfill the conditions above,
+ *    and work with the same number of ranks.
+ * TODO: Figure out a mechanism for mixing tests with different rank counts in
+ * the same binary (possibly, also MPI and non-MPI tests).
+ *
+ * When you do the above, the following will happen:
+ *  - The test will get compiled only if thread-MPI or real MPI is enabled.
+ *  - The test will get executed on the number of ranks specified.
+ *    If you are using real MPI, the whole test binary is run under MPI and
+ *    test execution across the processes is synchronized (GMX_MPI_TEST()
+ *    actually has no effect in this case, the synchronization is handled at a
+ *    higher level).
+ *    If you are using thread-MPI, GMX_MPI_TEST() is required and it
+ *    initializes thread-MPI with the specified number of threads and runs the
+ *    rest of the test on each of the threads.
+ *
+ * You need to be extra careful for variables in the test fixture, if you use
+ * one: when run under thread-MPI, these will be shared across all the ranks,
+ * while under real MPI, these are naturally different for each process.
+ * Local variables in the test body are private to each rank in both cases.
+ *
+ * Currently, it is not possible to specify the number of ranks as one, because
+ * that will lead to problems with (at least) thread-MPI, but such tests can be
+ * written as serial tests anyways.
+ *
+ * \ingroup module_testutils
+ */
+#if GMX_THREAD_MPI
+#define GMX_MPI_TEST(expectedRankCount) \
+    do { \
+        ASSERT_EQ(expectedRankCount, ::gmx::test::getNumberOfTestMpiRanks()); \
+        typedef std::remove_reference<decltype(*this)>::type MyTestClass; \
+        if (!::gmx::test::threadMpiTestRunner(std::bind(&MyTestClass::TestBody, this))) \
+        { \
+            return; \
+        } \
+    } while (0)
+#else
+#define GMX_MPI_TEST(expectedRankCount) \
+    ASSERT_EQ(expectedRankCount, ::gmx::test::getNumberOfTestMpiRanks())
+#endif
+
+} // namespace test
+} // namespace gmx
+
+#endif
index 493771c866b5a6b1c565b16d4d9759d124f01e64..9a5c4fd0a4ae145532b1beb1db5ae5f0cca3949a 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,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.
@@ -52,6 +52,7 @@
 
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/strconvert.h"
 #include "gromacs/utility/stringutil.h"
 
 #include "testutils/refdata-impl.h"
@@ -143,27 +144,13 @@ class ExactStringBlockChecker : public IReferenceDataEntryChecker
         std::string  value_;
 };
 
-//! Helper function to parse a floating-point value.
-// TODO: Move this into src/gromacs/utility/, and consolidate with similar code
-// elsewhere.
-double convertDouble(const std::string &value)
-{
-    char   *endptr;
-    double  convertedValue = std::strtod(value.c_str(), &endptr);
-    // TODO: Check for overflow
-    if (*endptr != '\0')
-    {
-        GMX_THROW(InvalidInputError("Invalid floating-point value: " + value));
-    }
-    return convertedValue;
-}
 
 //! Helper function to parse a floating-point reference data value.
-double convertDoubleReferenceValue(const std::string &value)
+static inline double convertDoubleReferenceValue(const std::string &value)
 {
     try
     {
-        return convertDouble(value);
+        return fromString<double>(value);
     }
     catch (const InvalidInputError &ex)
     {
@@ -224,7 +211,7 @@ class FloatingPointFromStringChecker : public IReferenceDataEntryChecker
         virtual ::testing::AssertionResult
         checkEntry(const ReferenceDataEntry &entry, const std::string &fullId) const
         {
-            FloatType               value    = static_cast<FloatType>(convertDouble(value_));
+            FloatType               value    = fromString<FloatType>(value_);
             FloatType               refValue = static_cast<FloatType>(convertDoubleReferenceValue(entry.value()));
             FloatingPointDifference diff(refValue, value);
             if (tolerance_.isWithin(diff))
@@ -244,6 +231,41 @@ class FloatingPointFromStringChecker : public IReferenceDataEntryChecker
         FloatingPointTolerance  tolerance_;
 };
 
+template <typename ValueType>
+class ValueExtractor : public IReferenceDataEntryChecker
+{
+    public:
+        explicit ValueExtractor(ValueType *value)
+            : value_(value)
+        {
+        }
+
+        virtual void fillEntry(ReferenceDataEntry *) const
+        {
+            GMX_THROW(TestException("Extracting value from non-existent reference data entry"));
+        }
+        virtual ::testing::AssertionResult
+        checkEntry(const ReferenceDataEntry &entry, const std::string &) const
+        {
+            extractValue(entry.value());
+            return ::testing::AssertionSuccess();
+        }
+
+        void extractValue(const std::string &value) const
+        {
+            *value_ = fromString<ValueType>(value);
+        }
+
+    private:
+        ValueType *value_;
+};
+
+template <> inline void
+ValueExtractor<std::string>::extractValue(const std::string &value) const
+{
+    *value_ = value;
+}
+
 } // namespace test
 } // namespace gmx
 
index 4d80baeee37727bd76db95255b0011e7140127ca..144668763cd4fe7d8e8400b51ec759f7f5fc9e24 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 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.
@@ -66,8 +66,8 @@ class ReferenceDataEntry
         }
 
         ReferenceDataEntry(const char *type, const char *id)
-            : type_(type), id_(id != NULL ? id : ""), isTextBlock_(false),
-              correspondingOutputEntry_(NULL)
+            : type_(type), id_(id != nullptr ? id : ""), isTextBlock_(false),
+              hasBeenChecked_(false), correspondingOutputEntry_(nullptr)
         {
         }
 
@@ -84,7 +84,7 @@ class ReferenceDataEntry
 
         bool idMatches(const char *id) const
         {
-            return (id == NULL && id_.empty()) || (id != NULL && id_ == id);
+            return (id == nullptr && id_.empty()) || (id != nullptr && id_ == id);
         }
 
         ChildIterator findChild(const char *id, const ChildIterator &prev) const
@@ -97,7 +97,7 @@ class ReferenceDataEntry
             bool           wrappingSearch = true;
             if (child != children_.end())
             {
-                if (id == NULL && (*child)->id().empty())
+                if (id == nullptr && (*child)->id().empty())
                 {
                     wrappingSearch = false;
                     ++child;
@@ -132,6 +132,18 @@ class ReferenceDataEntry
             return prev != children_.end();
         }
 
+        bool hasBeenChecked() const { return hasBeenChecked_; }
+        void setChecked() { hasBeenChecked_ = true; }
+
+        void setCheckedIncludingChildren()
+        {
+            setChecked();
+            for (const auto &child : children_)
+            {
+                child->setCheckedIncludingChildren();
+            }
+        }
+
         EntryPointer cloneToOutputEntry()
         {
             EntryPointer entry(new ReferenceDataEntry(type_.c_str(), id_.c_str()));
@@ -162,7 +174,7 @@ class ReferenceDataEntry
         }
         void setCorrespondingOutputEntry(ReferenceDataEntry *entry)
         {
-            GMX_RELEASE_ASSERT(correspondingOutputEntry_ == NULL,
+            GMX_RELEASE_ASSERT(correspondingOutputEntry_ == nullptr,
                                "Output entry already exists");
             correspondingOutputEntry_ = entry;
         }
@@ -179,6 +191,7 @@ class ReferenceDataEntry
         std::string         value_;
         bool                isTextBlock_;
         ChildList           children_;
+        bool                hasBeenChecked_;
         ReferenceDataEntry *correspondingOutputEntry_;
 };
 
index 2afd1ec41ce81d46c591da5175b16f8d23ccbefe..2d80f779f7582aeb5dd30a862e5249de8d05b600 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,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.
 #include "gromacs/options/ioptionscontainer.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/keyvaluetree.h"
 #include "gromacs/utility/path.h"
 #include "gromacs/utility/real.h"
 #include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/variant.h"
 
 #include "testutils/refdata-checkers.h"
 #include "testutils/refdata-impl.h"
@@ -203,6 +205,67 @@ class ReferenceDataTestEventListener : public ::testing::EmptyTestEventListener
         }
 };
 
+//! Formats a path to a reference data entry with a non-null id.
+std::string formatEntryPath(const std::string &prefix, const std::string &id)
+{
+    return prefix + "/" + id;
+}
+
+//! Formats a path to a reference data entry with a null id.
+std::string formatSequenceEntryPath(const std::string &prefix, int seqIndex)
+{
+    return formatString("%s/[%d]", prefix.c_str(), seqIndex+1);
+}
+
+//! Finds all entries that have not been checked under a given root.
+void gatherUnusedEntries(const ReferenceDataEntry &root,
+                         const std::string        &rootPath,
+                         std::vector<std::string> *unusedPaths)
+{
+    if (!root.hasBeenChecked())
+    {
+        unusedPaths->push_back(rootPath);
+        return;
+    }
+    int seqIndex = 0;
+    for (const auto &child : root.children())
+    {
+        std::string path;
+        if (child->id().empty())
+        {
+            path = formatSequenceEntryPath(rootPath, seqIndex);
+            ++seqIndex;
+        }
+        else
+        {
+            path = formatEntryPath(rootPath, child->id());
+        }
+        gatherUnusedEntries(*child, path, unusedPaths);
+    }
+}
+
+//! Produces a GTest assertion of any entries under given root have not been checked.
+void checkUnusedEntries(const ReferenceDataEntry &root, const std::string &rootPath)
+{
+    std::vector<std::string> unusedPaths;
+    gatherUnusedEntries(root, rootPath, &unusedPaths);
+    if (!unusedPaths.empty())
+    {
+        std::string paths;
+        if (unusedPaths.size() > 5)
+        {
+            paths = joinStrings(unusedPaths.begin(), unusedPaths.begin() + 5, "\n  ");
+            paths = "  " + paths + "\n  ...";
+        }
+        else
+        {
+            paths = joinStrings(unusedPaths.begin(), unusedPaths.end(), "\n  ");
+            paths = "  " + paths;
+        }
+        ADD_FAILURE() << "Reference data items not used in test:" << std::endl << paths;
+    }
+}
+
 }       // namespace
 
 void initReferenceData(IOptionsContainer *options)
@@ -276,18 +339,29 @@ TestReferenceDataImpl::TestReferenceDataImpl(
 
 void TestReferenceDataImpl::onTestEnd(bool testPassed)
 {
+    if (!bInUse_)
+    {
+        return;
+    }
     // TODO: Only write the file with update-changed if there were actual changes.
-    if (testPassed && bInUse_ && outputRootEntry_)
+    if (outputRootEntry_)
     {
-        std::string dirname = Path::getParentPath(fullFilename_);
-        if (!Directory::exists(dirname))
+        if (testPassed)
         {
-            if (Directory::create(dirname) != 0)
+            std::string dirname = Path::getParentPath(fullFilename_);
+            if (!Directory::exists(dirname))
             {
-                GMX_THROW(TestException("Creation of reference data directory failed: " + dirname));
+                if (Directory::create(dirname) != 0)
+                {
+                    GMX_THROW(TestException("Creation of reference data directory failed: " + dirname));
+                }
             }
+            writeReferenceDataFile(fullFilename_, *outputRootEntry_);
         }
-        writeReferenceDataFile(fullFilename_, *outputRootEntry_);
+    }
+    else if (compareRootEntry_)
+    {
+        checkUnusedEntries(*compareRootEntry_, "");
     }
 }
 
@@ -310,6 +384,8 @@ class TestReferenceChecker::Impl
         static const char * const    cBooleanNodeName;
         //! String constant for naming XML elements for string values.
         static const char * const    cStringNodeName;
+        //! String constant for naming XML elements for unsigned char values.
+        static const char * const    cUCharNodeName;
         //! String constant for naming XML elements for integer values.
         static const char * const    cIntegerNodeName;
         //! String constant for naming XML elements for int64 values.
@@ -322,6 +398,8 @@ class TestReferenceChecker::Impl
         static const char * const    cIdAttrName;
         //! String constant for naming compounds for vectors.
         static const char * const    cVectorType;
+        //! String constant for naming compounds for key-value tree objects.
+        static const char * const    cObjectType;
         //! String constant for naming compounds for sequences.
         static const char * const    cSequenceType;
         //! String constant for value identifier for sequence length.
@@ -414,7 +492,7 @@ class TestReferenceChecker::Impl
         {
             GMX_RELEASE_ASSERT(initialized(),
                                "Accessing uninitialized reference data checker.");
-            return compareRootEntry_ == NULL;
+            return compareRootEntry_ == nullptr;
         }
 
         //! Whether initialized with other means than the default constructor.
@@ -468,27 +546,29 @@ class TestReferenceChecker::Impl
         /*! \brief
          * Current number of unnamed elements in a sequence.
          *
-         * It is the index of the next added unnamed element.
+         * It is the index of the current unnamed element.
          */
         int                     seqIndex_;
 };
 
 const char *const TestReferenceChecker::Impl::cBooleanNodeName    = "Bool";
 const char *const TestReferenceChecker::Impl::cStringNodeName     = "String";
+const char *const TestReferenceChecker::Impl::cUCharNodeName      = "UChar";
 const char *const TestReferenceChecker::Impl::cIntegerNodeName    = "Int";
 const char *const TestReferenceChecker::Impl::cInt64NodeName      = "Int64";
 const char *const TestReferenceChecker::Impl::cUInt64NodeName     = "UInt64";
 const char *const TestReferenceChecker::Impl::cRealNodeName       = "Real";
 const char *const TestReferenceChecker::Impl::cIdAttrName         = "Name";
 const char *const TestReferenceChecker::Impl::cVectorType         = "Vector";
+const char *const TestReferenceChecker::Impl::cObjectType         = "Object";
 const char *const TestReferenceChecker::Impl::cSequenceType       = "Sequence";
 const char *const TestReferenceChecker::Impl::cSequenceLengthName = "Length";
 
 
 TestReferenceChecker::Impl::Impl(bool initialized)
     : initialized_(initialized), defaultTolerance_(defaultRealTolerance()),
-      compareRootEntry_(NULL), outputRootEntry_(NULL),
-      updateMismatchingEntries_(false), bSelfTestMode_(false), seqIndex_(0)
+      compareRootEntry_(nullptr), outputRootEntry_(nullptr),
+      updateMismatchingEntries_(false), bSelfTestMode_(false), seqIndex_(-1)
 {
 }
 
@@ -498,11 +578,11 @@ TestReferenceChecker::Impl::Impl(const std::string &path,
                                  ReferenceDataEntry *outputRootEntry,
                                  bool updateMismatchingEntries, bool bSelfTestMode,
                                  const FloatingPointTolerance &defaultTolerance)
-    : initialized_(true), defaultTolerance_(defaultTolerance), path_(path + "/"),
+    : initialized_(true), defaultTolerance_(defaultTolerance), path_(path),
       compareRootEntry_(compareRootEntry), outputRootEntry_(outputRootEntry),
       lastFoundEntry_(compareRootEntry->children().end()),
       updateMismatchingEntries_(updateMismatchingEntries),
-      bSelfTestMode_(bSelfTestMode), seqIndex_(0)
+      bSelfTestMode_(bSelfTestMode), seqIndex_(-1)
 {
 }
 
@@ -510,21 +590,22 @@ TestReferenceChecker::Impl::Impl(const std::string &path,
 std::string
 TestReferenceChecker::Impl::appendPath(const char *id) const
 {
-    std::string printId = (id != NULL) ? id : formatString("[%d]", seqIndex_);
-    return path_ + printId;
+    return id != nullptr
+           ? formatEntryPath(path_, id)
+           : formatSequenceEntryPath(path_, seqIndex_);
 }
 
 
 ReferenceDataEntry *TestReferenceChecker::Impl::findEntry(const char *id)
 {
     ReferenceDataEntry::ChildIterator entry = compareRootEntry_->findChild(id, lastFoundEntry_);
-    seqIndex_ = (id == NULL) ? seqIndex_+1 : 0;
+    seqIndex_ = (id == nullptr) ? seqIndex_+1 : -1;
     if (compareRootEntry_->isValidChild(entry))
     {
         lastFoundEntry_ = entry;
         return entry->get();
     }
-    return NULL;
+    return nullptr;
 }
 
 ReferenceDataEntry *
@@ -533,7 +614,7 @@ TestReferenceChecker::Impl::findOrCreateEntry(
         const IReferenceDataEntryChecker &checker)
 {
     ReferenceDataEntry *entry = findEntry(id);
-    if (entry == NULL && outputRootEntry_ != NULL)
+    if (entry == nullptr && outputRootEntry_ != nullptr)
     {
         lastFoundEntry_ = compareRootEntry_->addChild(createEntry(type, id, checker));
         entry           = lastFoundEntry_->get();
@@ -551,13 +632,14 @@ TestReferenceChecker::Impl::processItem(const char *type, const char *id,
     }
     std::string         fullId = appendPath(id);
     ReferenceDataEntry *entry  = findOrCreateEntry(type, id, checker);
-    if (entry == NULL)
+    if (entry == nullptr)
     {
         return ::testing::AssertionFailure()
                << "Reference data item " << fullId << " not found";
     }
+    entry->setChecked();
     ::testing::AssertionResult result(checkEntry(*entry, fullId, type, checker));
-    if (outputRootEntry_ != NULL && entry->correspondingOutputEntry() == NULL)
+    if (outputRootEntry_ != nullptr && entry->correspondingOutputEntry() == nullptr)
     {
         if (!updateMismatchingEntries_ || result)
         {
@@ -616,6 +698,7 @@ TestReferenceChecker TestReferenceData::rootChecker()
     {
         return TestReferenceChecker(new TestReferenceChecker::Impl(true));
     }
+    impl_->compareRootEntry_->setChecked();
     return TestReferenceChecker(
             new TestReferenceChecker::Impl("", impl_->compareRootEntry_.get(),
                                            impl_->outputRootEntry_.get(),
@@ -672,9 +755,20 @@ void TestReferenceChecker::setDefaultTolerance(
 }
 
 
+void TestReferenceChecker::checkUnusedEntries()
+{
+    if (impl_->compareRootEntry_)
+    {
+        gmx::test::checkUnusedEntries(*impl_->compareRootEntry_, impl_->path_);
+        // Mark them checked so that they are reported only once.
+        impl_->compareRootEntry_->setCheckedIncludingChildren();
+    }
+}
+
+
 bool TestReferenceChecker::checkPresent(bool bPresent, const char *id)
 {
-    if (impl_->shouldIgnore() || impl_->outputRootEntry_ != NULL)
+    if (impl_->shouldIgnore() || impl_->outputRootEntry_ != nullptr)
     {
         return bPresent;
     }
@@ -707,11 +801,12 @@ TestReferenceChecker TestReferenceChecker::checkCompound(const char *type, const
     std::string         fullId = impl_->appendPath(id);
     NullChecker         checker;
     ReferenceDataEntry *entry  = impl_->findOrCreateEntry(type, id, checker);
-    if (entry == NULL)
+    if (entry == nullptr)
     {
         ADD_FAILURE() << "Reference data item " << fullId << " not found";
         return TestReferenceChecker(new Impl(true));
     }
+    entry->setChecked();
     if (impl_->updateMismatchingEntries_)
     {
         entry->makeCompound(type);
@@ -725,7 +820,7 @@ TestReferenceChecker TestReferenceChecker::checkCompound(const char *type, const
             return TestReferenceChecker(new Impl(true));
         }
     }
-    if (impl_->outputRootEntry_ != NULL && entry->correspondingOutputEntry() == NULL)
+    if (impl_->outputRootEntry_ != nullptr && entry->correspondingOutputEntry() == nullptr)
     {
         impl_->outputRootEntry_->addChild(entry->cloneToOutputEntry());
     }
@@ -793,6 +888,12 @@ void TestReferenceChecker::checkTextBlock(const std::string &value,
 }
 
 
+void TestReferenceChecker::checkUChar(unsigned char value, const char *id)
+{
+    EXPECT_PLAIN(impl_->processItem(Impl::cUCharNodeName, id,
+                                    ExactStringChecker(formatString("%d", value))));
+}
+
 void TestReferenceChecker::checkInteger(int value, const char *id)
 {
     EXPECT_PLAIN(impl_->processItem(Impl::cIntegerNodeName, id,
@@ -871,6 +972,68 @@ void TestReferenceChecker::checkVector(const double value[3], const char *id)
 }
 
 
+void TestReferenceChecker::checkVariant(const Variant &variant, const char *id)
+{
+    if (variant.isType<bool>())
+    {
+        checkBoolean(variant.cast<bool>(), id);
+    }
+    else if (variant.isType<int>())
+    {
+        checkInteger(variant.cast<int>(), id);
+    }
+    else if (variant.isType<gmx_int64_t>())
+    {
+        checkInt64(variant.cast<gmx_int64_t>(), id);
+    }
+    else if (variant.isType<float>())
+    {
+        checkFloat(variant.cast<float>(), id);
+    }
+    else if (variant.isType<double>())
+    {
+        checkDouble(variant.cast<double>(), id);
+    }
+    else if (variant.isType<std::string>())
+    {
+        checkString(variant.cast<std::string>(), id);
+    }
+    else
+    {
+        GMX_THROW(TestException("Unsupported variant type"));
+    }
+}
+
+
+void TestReferenceChecker::checkKeyValueTreeObject(const KeyValueTreeObject &tree, const char *id)
+{
+    TestReferenceChecker compound(checkCompound(Impl::cObjectType, id));
+    for (const auto &prop : tree.properties())
+    {
+        compound.checkKeyValueTreeValue(prop.value(), prop.key().c_str());
+    }
+    compound.checkUnusedEntries();
+}
+
+
+void TestReferenceChecker::checkKeyValueTreeValue(const KeyValueTreeValue &value, const char *id)
+{
+    if (value.isObject())
+    {
+        checkKeyValueTreeObject(value.asObject(), id);
+    }
+    else if (value.isArray())
+    {
+        const auto &values = value.asArray().values();
+        checkSequence(values.begin(), values.end(), id);
+    }
+    else
+    {
+        checkVariant(value.asVariant(), id);
+    }
+}
+
+
 TestReferenceChecker
 TestReferenceChecker::checkSequenceCompound(const char *id, size_t length)
 {
@@ -879,5 +1042,83 @@ TestReferenceChecker::checkSequenceCompound(const char *id, size_t length)
     return compound;
 }
 
+
+unsigned char TestReferenceChecker::readUChar(const char *id)
+{
+    if (impl_->shouldIgnore())
+    {
+        GMX_THROW(TestException("Trying to read from non-existent reference data value"));
+    }
+    int value = 0;
+    EXPECT_PLAIN(impl_->processItem(Impl::cUCharNodeName, id,
+                                    ValueExtractor<int>(&value)));
+    return value;
+}
+
+
+int TestReferenceChecker::readInteger(const char *id)
+{
+    if (impl_->shouldIgnore())
+    {
+        GMX_THROW(TestException("Trying to read from non-existent reference data value"));
+    }
+    int value = 0;
+    EXPECT_PLAIN(impl_->processItem(Impl::cIntegerNodeName, id,
+                                    ValueExtractor<int>(&value)));
+    return value;
+}
+
+
+gmx_int64_t TestReferenceChecker::readInt64(const char *id)
+{
+    if (impl_->shouldIgnore())
+    {
+        GMX_THROW(TestException("Trying to read from non-existent reference data value"));
+    }
+    gmx_int64_t value = 0;
+    EXPECT_PLAIN(impl_->processItem(Impl::cInt64NodeName, id,
+                                    ValueExtractor<gmx_int64_t>(&value)));
+    return value;
+}
+
+
+float TestReferenceChecker::readFloat(const char *id)
+{
+    if (impl_->shouldIgnore())
+    {
+        GMX_THROW(TestException("Trying to read from non-existent reference data value"));
+    }
+    float value = 0;
+    EXPECT_PLAIN(impl_->processItem(Impl::cRealNodeName, id,
+                                    ValueExtractor<float>(&value)));
+    return value;
+}
+
+
+double TestReferenceChecker::readDouble(const char *id)
+{
+    if (impl_->shouldIgnore())
+    {
+        GMX_THROW(TestException("Trying to read from non-existent reference data value"));
+    }
+    double value = 0;
+    EXPECT_PLAIN(impl_->processItem(Impl::cRealNodeName, id,
+                                    ValueExtractor<double>(&value)));
+    return value;
+}
+
+
+std::string TestReferenceChecker::readString(const char *id)
+{
+    if (impl_->shouldIgnore())
+    {
+        GMX_THROW(TestException("Trying to read from non-existent reference data value"));
+    }
+    std::string value;
+    EXPECT_PLAIN(impl_->processItem(Impl::cStringNodeName, id,
+                                    ValueExtractor<std::string>(&value)));
+    return value;
+}
+
 } // namespace test
 } // namespace gmx
index 99763e12c3f59a08fa8a41e918bd37e8c9cc6484..acf44b5ea5976a69676c437106ba8fd58ad5df2a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,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.
@@ -56,6 +56,9 @@ namespace gmx
 {
 
 class IOptionsContainer;
+class KeyValueTreeObject;
+class KeyValueTreeValue;
+class Variant;
 
 namespace test
 {
@@ -274,6 +277,22 @@ class TestReferenceChecker
          */
         void setDefaultTolerance(const FloatingPointTolerance &tolerance);
 
+        /*! \brief
+         * Checks that all reference values have been compared against.
+         *
+         * All values under the compound represented by this checker are
+         * checked, and a non-fatal Google Test assertion is produced if some
+         * values have not been used.
+         *
+         * If not called explicitly, the same check will be done for all
+         * reference data values when the test ends.
+         *
+         * This method also marks the values used, so that subsequent checks
+         * (including the check at the end of the test) will not produce
+         * another assertion about the same values.
+         */
+        void checkUnusedEntries();
+
         /*! \brief
          * Checks whether a data item is present.
          *
@@ -329,6 +348,8 @@ class TestReferenceChecker
          * is easier to edit by hand to set the desired output formatting.
          */
         void checkTextBlock(const std::string &value, const char *id);
+        //! Check a single unsigned char value.
+        void checkUChar(unsigned char value, const char *id);
         //! Check a single integer value.
         void checkInteger(int value, const char *id);
         //! Check a single int64 value.
@@ -351,6 +372,37 @@ class TestReferenceChecker
         void checkVector(const double value[3], const char *id);
         //! Check a single floating-point value from a string.
         void checkRealFromString(const std::string &value, const char *id);
+        //! Checks a variant value that contains a supported simple type.
+        void checkVariant(const Variant &value, const char *id);
+        //! Checks a key-value tree rooted at a object.
+        void checkKeyValueTreeObject(const KeyValueTreeObject &tree, const char *id);
+        //! Checks a generic key-value tree value.
+        void checkKeyValueTreeValue(const KeyValueTreeValue &value, const char *id);
+
+        /*! \name Methods to read values from reference data
+         *
+         * These methods assume that a value with the given `id` has already
+         * been created in the test with `check*()` methods, and that it has
+         * the correct type.
+         *
+         * Currently, these methods do not work correctly if the reference data
+         * file does not exist, so a test using them may fail with exceptions
+         * before the reference data has been generated.
+         * \{
+         */
+        //! Reads an unsigned char value.
+        unsigned char readUChar(const char *id);
+        //! Reads an integer value.
+        int readInteger(const char *id);
+        //! Reads a 64-bit integer value.
+        gmx_int64_t readInt64(const char *id);
+        //! Reads a float value.
+        float readFloat(const char *id);
+        //! Reads a double value.
+        double readDouble(const char *id);
+        //! Reads a string value.
+        std::string readString(const char *id);
+        //! \}
 
         /*! \name Overloaded versions of simple checker methods
          *
@@ -416,6 +468,11 @@ class TestReferenceChecker
         {
             checkVector(value, id);
         }
+        //! Check a generic key-value tree value.
+        void checkValue(const KeyValueTreeValue &value, const char *id)
+        {
+            checkKeyValueTreeValue(value, id);
+        }
         /*!\}*/
 
         /*! \brief
@@ -437,7 +494,7 @@ class TestReferenceChecker
             TestReferenceChecker compound(checkSequenceCompound(id, length));
             for (Iterator i = begin; i != end; ++i)
             {
-                compound.checkValue(*i, NULL);
+                compound.checkValue(*i, nullptr);
             }
         }
         /*! \brief
similarity index 82%
rename from src/testutils/integrationtests.cpp
rename to src/testutils/stdiohelper.cpp
index 9913f6053ee00b7ff7e115d0596b669d8434aa62..60b95cf6eb43049b16224f8e7a389b158475aa59 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,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.
  */
 /*! \internal \file
  * \brief
- * Implements classes in integrationtests.h.
+ * Implements classes in stdiohelper.h.
  *
  * \author Mark Abraham <mark.j.abraham@gmail.com>
  * \ingroup module_testutils
  */
 #include "gmxpre.h"
 
-#include "integrationtests.h"
+#include "stdiohelper.h"
 
-#include <stdio.h>
+#include <cerrno>
+#include <cstdio>
 
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/textwriter.h"
 
+#include "testutils/testfilemanager.h"
+
 namespace gmx
 {
 namespace test
 {
 
 /********************************************************************
- * IntegrationTestFixture
+ * StdioTestHelper
  */
 
-IntegrationTestFixture::IntegrationTestFixture()
-{
-}
-
-IntegrationTestFixture::~IntegrationTestFixture()
-{
-}
-
 void
-IntegrationTestFixture::redirectStringToStdin(const char* theString)
+StdioTestHelper::redirectStringToStdin(const char *theString)
 {
-    std::string fakeStdin("fake-stdin");
+    const std::string fakeStdin = fileManager_.getTemporaryFilePath(".stdin");
     gmx::TextWriter::writeFileFromString(fakeStdin, theString);
-    if (NULL == std::freopen(fakeStdin.c_str(), "r", stdin))
+    if (nullptr == std::freopen(fakeStdin.c_str(), "r", stdin))
     {
         GMX_THROW_WITH_ERRNO(FileIOError("Failed to redirect a string to stdin"),
                              "freopen",
similarity index 62%
rename from src/testutils/integrationtests.h
rename to src/testutils/stdiohelper.h
index 426f5c08c3143815d464c3add46ef5610e626400..c111476ce44e7d9b7e81ca189650f1ba04dfd2d1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,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.
  */
 /*! \libinternal \file
  * \brief
- * Declares test fixture for integration tests
+ * Declares gmx::test::StdioTestHelper.
  *
  * \author Mark Abraham <mark.j.abraham@gmail.com>
  * \inlibraryapi
  * \ingroup module_testutils
  */
-#ifndef GMX_INTEGRATION_TESTS_MODULETEST_H
-#define GMX_INTEGRATION_TESTS_MODULETEST_H
+#ifndef GMX_TESTUTILS_STDIOHELPER_H
+#define GMX_TESTUTILS_STDIOHELPER_H
 
-#include <gtest/gtest.h>
-
-#include "testutils/testfilemanager.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
-
 namespace test
 {
 
+class TestFileManager;
+
 /*! \libinternal \brief
- * Test fixture for integration tests.
+ * Helper class for tests where code reads directly from `stdin`.
  *
  * Any method in this class may throw std::bad_alloc if out of memory.
  *
  * \inlibraryapi
  * \ingroup module_testutils
  */
-class IntegrationTestFixture : public ::testing::Test
+class StdioTestHelper
 {
-    protected:
-        IntegrationTestFixture();
-        virtual ~IntegrationTestFixture();
+    public:
+        //! Creates a helper using the given file manager.
+        explicit StdioTestHelper(TestFileManager *fileManager)
+            : fileManager_(*fileManager)
+        {
+        }
 
         /*! \brief Accepts a string as input, writes it to a temporary
          * file and then reopens stdin to read the contents of that
@@ -73,29 +75,12 @@ class IntegrationTestFixture : public ::testing::Test
          *
          * \throws FileIOError  when the freopen() fails
          */
-        void redirectStringToStdin(const chartheString);
+        void redirectStringToStdin(const char *theString);
 
-        /*! \brief Discards stdout while running a test
-         *
-         * \todo Implement this when the output routines are
-         * sufficiently modular to permit it to work. */
-        void redirectStdoutToDevNull();
-        /*! \brief Discards stderr while running a test
-         *
-         * \todo Implement this when the output routines are
-         * sufficiently modular to permit it to work. */
-        void redirectStderrToDevNull();
-
-        /* TEST_F() constructs derived classes, and those classes and
-         * their member objects might need to access implementation
-         * details, so we cannot use the private access specifer
-         * here. */
-    public:
+    private:
+        TestFileManager &fileManager_;
 
-        /*! \brief Object that manages finding input files, writing
-         * temporary output files and cleaning up files.
-         */
-        ::gmx::test::TestFileManager fileManager_;
+        GMX_DISALLOW_COPY_AND_ASSIGN(StdioTestHelper);
 };
 
 } // namespace test
index 7f475b8e316c2b7b7de9b4644ed3c098863f7cc6..ca0322e6ca5f61379923852303bd25b8f7a690bf 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,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.
@@ -65,6 +65,10 @@ class TestReferenceChecker;
  * If this flag is not given, they check the strings using the XML reference
  * framework (see TestReferenceData).
  *
+ * Tests that need simple checking of a string, or container of
+ * strings, should consider the normal implementation in
+ * TestReferenceChecker.
+ *
  * \inlibraryapi
  * \ingroup module_testutils
  */
index 4d9b499e9eb6a21f6da5541335170f2d8a8d4f21..fe77b048a6035c67925bf7b454378c3e288a12ce 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,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.
@@ -193,16 +193,18 @@ gmx_uint64_t relativeToleranceToUlp(FloatType tolerance)
  * FloatingPointDifference
  */
 
-FloatingPointDifference::FloatingPointDifference(float value1, float value2)
+FloatingPointDifference::FloatingPointDifference(float ref, float value)
+    : termMagnitude_(std::abs(ref))
 {
-    initDifference(value1, value2,
+    initDifference(ref, value,
                    &absoluteDifference_, &ulpDifference_, &bSignDifference_);
     bDouble_ = false;
 }
 
-FloatingPointDifference::FloatingPointDifference(double value1, double value2)
+FloatingPointDifference::FloatingPointDifference(double ref, double value)
+    : termMagnitude_(std::abs(ref))
 {
-    initDifference(value1, value2,
+    initDifference(ref, value,
                    &absoluteDifference_, &ulpDifference_, &bSignDifference_);
     bDouble_ = true;
 }
@@ -214,11 +216,29 @@ bool FloatingPointDifference::isNaN() const
 
 std::string FloatingPointDifference::toString() const
 {
-    const double eps = isDouble() ? GMX_DOUBLE_EPS : GMX_FLOAT_EPS;
-    return formatString("%g (%" GMX_PRIu64 " %s-prec. ULPs, rel. %.3g)%s",
+    std::string relDiffStr;
+
+    if (termMagnitude_ > 0)
+    {
+        // If the reference value is finite we calculate the proper quotient
+        relDiffStr = formatString("%.3g", std::abs(absoluteDifference_/termMagnitude_));
+    }
+    else if (absoluteDifference_ == 0.0)
+    {
+        // If the numbers are identical the quotient is strictly NaN here, but
+        // there no reason to worry when we have a perfect match.
+        relDiffStr = formatString("%.3g", 0.0);
+    }
+    else
+    {
+        // If the reference value is zero and numbers are non-identical, relative difference is infinite.
+        relDiffStr = formatString("Inf");
+    }
+
+    return formatString("%g (%" GMX_PRIu64 " %s-prec. ULPs, rel. %s)%s",
                         absoluteDifference_, ulpDifference_,
                         isDouble() ? "double" : "single",
-                        ulpDifference_ * eps,
+                        relDiffStr.c_str(),
                         bSignDifference_ ? ", signs differ" : "");
 }
 
@@ -246,12 +266,24 @@ bool FloatingPointTolerance::isWithin(
         return true;
     }
 
+    // By using smaller-than-or-equal below, we allow the test to pass if
+    // the numbers are identical, even if the term magnitude is 0, which seems
+    // a reasonable thing to do...
+    const double relativeTolerance
+        = difference.isDouble() ? doubleRelativeTolerance_ : singleRelativeTolerance_;
+
+    if (difference.asAbsolute() <= relativeTolerance * difference.termMagnitude())
+    {
+        return true;
+    }
+
     const gmx_uint64_t ulpTolerance
         = difference.isDouble() ? doubleUlpTolerance_ : singleUlpTolerance_;
     if (ulpTolerance < GMX_UINT64_MAX && difference.asUlps() <= ulpTolerance)
     {
         return true;
     }
+
     return false;
 }
 
@@ -260,22 +292,30 @@ std::string FloatingPointTolerance::toString(const FloatingPointDifference &diff
     std::string        result;
     const double       absoluteTolerance
         = difference.isDouble() ? doubleAbsoluteTolerance_ : singleAbsoluteTolerance_;
+    const double       relativeTolerance
+        = difference.isDouble() ? doubleRelativeTolerance_ : singleRelativeTolerance_;
     const gmx_uint64_t ulpTolerance
         = difference.isDouble() ? doubleUlpTolerance_ : singleUlpTolerance_;
-    const double       eps
-        = difference.isDouble() ? GMX_DOUBLE_EPS : GMX_FLOAT_EPS;
 
     if (absoluteTolerance > 0.0)
     {
         result.append(formatString("abs. %g", absoluteTolerance));
     }
+    if (relativeTolerance > 0.0)
+    {
+        if (!result.empty())
+        {
+            result.append(", ");
+        }
+        result.append(formatString("rel. %.3g", relativeTolerance));
+    }
     if (ulpTolerance < GMX_UINT64_MAX)
     {
         if (!result.empty())
         {
             result.append(", ");
         }
-        result.append(formatString("%" GMX_PRIu64 " ULPs (rel. %.3g)", ulpTolerance, ulpTolerance * eps));
+        result.append(formatString("%" GMX_PRIu64 " ULPs", ulpTolerance));
     }
     if (bSignMustMatch_)
     {
@@ -293,10 +333,10 @@ std::string FloatingPointTolerance::toString(const FloatingPointDifference &diff
 FloatingPointTolerance
 relativeToleranceAsFloatingPoint(double magnitude, double tolerance)
 {
-    const double absoluteTolerance = magnitude * tolerance;
+    const double absoluteTolerance = std::abs(magnitude) * tolerance;
     return FloatingPointTolerance(absoluteTolerance, absoluteTolerance,
-                                  relativeToleranceToUlp<float>(tolerance),
-                                  relativeToleranceToUlp<double>(tolerance),
+                                  tolerance, tolerance,
+                                  GMX_UINT64_MAX, GMX_UINT64_MAX,
                                   false);
 }
 //! \endcond
index dc4b68bba235bbd84c57879b12d629f7e49da212..c13c00ec569555c21931e3366ccb36a4bf300f82 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,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.
@@ -209,10 +209,30 @@ void processExpectedException(const std::exception &ex);
 class FloatingPointDifference
 {
     public:
-        //! Initializes a single-precision difference.
-        FloatingPointDifference(float value1, float value2);
-        //! Initializes a double-precision difference.
-        FloatingPointDifference(double value1, double value2);
+
+        /*! \brief Initializes a single-precision difference.
+         *
+         *  \param ref    First term in difference
+         *  \param value  Second term in difference
+         *
+         *  For absolute and ULP differences the two parameters are equivalent,
+         *  since the difference is symmetric. For relative differences
+         *  the first term is interpreted as the reference value, from which
+         *  we extract the magnitude to compare with.
+         */
+        FloatingPointDifference(float ref, float value);
+
+        /*! \brief Initializes a double-precision difference.
+         *
+         *  \param ref    First term in difference
+         *  \param value  Second term in difference
+         *
+         *  For absolute and ULP differences the two parameters are equivalent,
+         *  since the difference is symmetric. For relative differences
+         *  the first term is interpreted as the reference value, from which
+         *  we extract the magnitude to compare with.
+         */
+        FloatingPointDifference(double ref, double value);
 
         /*! \brief
          * Whether one or both of the compared values were NaN.
@@ -244,7 +264,13 @@ class FloatingPointDifference
         //! Formats the difference as a string for assertion failure messages.
         std::string toString() const;
 
+        //! Returns the magnitude of the original second term of the difference.
+        double termMagnitude() const { return termMagnitude_; }
+
     private:
+
+        //! Save the magnitude of the reference value for relative (i.e., not ULP) tolerance
+        double       termMagnitude_;
         //! Stores the absolute difference, or NaN if one or both values were NaN.
         double       absoluteDifference_;
         gmx_uint64_t ulpDifference_;
@@ -270,6 +296,9 @@ class FloatingPointDifference
  *    the given tolerance for the check to pass.
  *    Setting the absolute tolerance to zero disables the absolute tolerance
  *    check.
+ *  - _relative tolerance_: the absolute difference between the numbers must
+ *    be smaller than the tolerance multiplied by the first number. Setting
+ *    the relative tolerance to zero disables this check.
  *  - _ULP tolerance_: ULP (units of least precision) difference between the
  *    values must be smaller than the given tolerance for the check to pass.
  *    Setting the ULP tolerance to zero requires exact match.
@@ -279,13 +308,13 @@ class FloatingPointDifference
  *    check (note that this also applies to `0.0` and `-0.0`: a value with a
  *    different sign than the zero will fail the check).
  *
- * Either an absolute or a ULP tolerance must always be specified.
- * If both are specified, then the check passes if either of the tolerances is
- * satisfied.
+ * Either an absolute, relative, or ULP tolerance must always be specified.
+ * If several of them are specified, then the check passes if either of the
+ * tolerances is satisfied.
  *
- * Any combination of absolute and ULP tolerance can be combined with the sign
- * check.  In this case, the sign check must succeed for the check to pass,
- * even if other tolerances are satisfied.
+ * Any combination of absolute, relative, and ULP tolerance can be combined with
+ * the sign check.  In this case, the sign check must succeed for the check to
+ * pass, even if other tolerances are satisfied.
  *
  * The tolerances can be specified separately for single and double precision
  * comparison.  Different initialization functions have different semantics on
@@ -312,6 +341,10 @@ class FloatingPointTolerance
          *     Allowed absolute difference in a single-precision number.
          * \param[in]  doubleAbsoluteTolerance
          *     Allowed absolute difference in a double-precision number.
+         * \param[in]  singleRelativeTolerance
+         *     Allowed relative difference in a single-precision number.
+         * \param[in]  doubleRelativeTolerance
+         *     Allowed relative difference in a double-precision number.
          * \param[in]  singleUlpTolerance
          *     Allowed ULP difference in a single-precision number.
          * \param[in]  doubleUlpTolerance
@@ -321,11 +354,15 @@ class FloatingPointTolerance
          */
         FloatingPointTolerance(float        singleAbsoluteTolerance,
                                double       doubleAbsoluteTolerance,
+                               float        singleRelativeTolerance,
+                               double       doubleRelativeTolerance,
                                gmx_uint64_t singleUlpTolerance,
                                gmx_uint64_t doubleUlpTolerance,
                                bool         bSignMustMatch)
             : singleAbsoluteTolerance_(singleAbsoluteTolerance),
               doubleAbsoluteTolerance_(doubleAbsoluteTolerance),
+              singleRelativeTolerance_(singleRelativeTolerance),
+              doubleRelativeTolerance_(doubleRelativeTolerance),
               singleUlpTolerance_(singleUlpTolerance),
               doubleUlpTolerance_(doubleUlpTolerance),
               bSignMustMatch_(bSignMustMatch)
@@ -345,6 +382,8 @@ class FloatingPointTolerance
     private:
         float        singleAbsoluteTolerance_;
         double       doubleAbsoluteTolerance_;
+        float        singleRelativeTolerance_;
+        double       doubleRelativeTolerance_;
         gmx_uint64_t singleUlpTolerance_;
         gmx_uint64_t doubleUlpTolerance_;
         bool         bSignMustMatch_;
@@ -361,7 +400,7 @@ class FloatingPointTolerance
 static inline FloatingPointTolerance
 ulpTolerance(gmx_uint64_t ulpDiff)
 {
-    return FloatingPointTolerance(0.0, 0.0, ulpDiff, ulpDiff, false);
+    return FloatingPointTolerance(0.0, 0.0, 0.0, 0.0, ulpDiff, ulpDiff, false);
 }
 
 /*! \brief
@@ -371,7 +410,7 @@ ulpTolerance(gmx_uint64_t ulpDiff)
  * \param[in] magnitude  Magnitude of the numbers the computation operates in.
  * \param[in] tolerance  Relative tolerance permitted (e.g. 1e-4).
  *
- * In addition to setting an ULP tolerance equivalent to \p tolerance for both
+ * In addition to setting an relative tolerance for both
  * precisions, this sets the absolute tolerance such that values close to zero
  * (in general, smaller than \p magnitude) do not fail the check if they
  * differ by less than \p tolerance evaluated at \p magnitude.  This accounts
@@ -379,9 +418,6 @@ ulpTolerance(gmx_uint64_t ulpDiff)
  * accuracy of values much less than \p magnitude do not matter for
  * correctness.
  *
- * The ULP tolerance for different precisions will be different to make them
- * both match \p tolerance.
- *
  * \related FloatingPointTolerance
  */
 FloatingPointTolerance
@@ -412,6 +448,7 @@ relativeToleranceAsPrecisionDependentUlp(double       magnitude,
 {
     return FloatingPointTolerance(magnitude*singleUlpDiff*GMX_FLOAT_EPS,
                                   magnitude*doubleUlpDiff*GMX_DOUBLE_EPS,
+                                  0.0, 0.0,
                                   singleUlpDiff, doubleUlpDiff, false);
 }
 
@@ -423,7 +460,7 @@ relativeToleranceAsPrecisionDependentUlp(double       magnitude,
 static inline FloatingPointTolerance
 absoluteTolerance(double tolerance)
 {
-    return FloatingPointTolerance(tolerance, tolerance,
+    return FloatingPointTolerance(tolerance, tolerance, 0.0, 0.0,
                                   GMX_UINT64_MAX, GMX_UINT64_MAX, false);
 }
 
@@ -555,27 +592,6 @@ static inline ::testing::AssertionResult assertEqualWithinTolerance(
 
 //! \}
 
-/*! \name Assertions for NULL comparison
- *
- * These macros should be used instead of `(EXPECT|ASSERT)_EQ(NULL, ...)`,
- * because Google Test doesn't support the NULL comparison with xlC++ 12.1 on
- * BG/Q.
- */
-//! \{
-
-/*! \brief
- * Asserts that a pointer is null.
- *
- * Works exactly like EXPECT_EQ comparing with a null pointer. */
-#define EXPECT_NULL(val) EXPECT_EQ((void *) NULL, val)
-/*! \brief
- * Asserts that a pointer is null.
- *
- * Works exactly like ASSERT_EQ comparing with a null pointer. */
-#define ASSERT_NULL(val) ASSERT_EQ((void *) NULL, val)
-
-//! \}
-
 //! \cond internal
 /*! \internal \brief
  * Helper method for `(EXPECT|ASSERT)_PLAIN`.
index e3841fb48cabe7caab479c80d494b883327930d4..5d55a584348eb10155d133232164af2e8e888899 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,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.
@@ -112,7 +112,7 @@ class TestFileManager::Impl
 };
 
 std::string TestFileManager::Impl::s_inputDirectory;
-const char *TestFileManager::Impl::s_globalOutputTempDirectory = NULL;
+const char *TestFileManager::Impl::s_globalOutputTempDirectory = nullptr;
 /** Controls whether TestFileManager should delete temporary files
     after the test finishes. */
 static bool g_bDeleteFilesAfterTest = true;
@@ -206,7 +206,7 @@ const char *TestFileManager::getInputDataDirectory()
 
 const char *TestFileManager::getGlobalOutputTempDirectory()
 {
-    GMX_RELEASE_ASSERT(Impl::s_globalOutputTempDirectory != NULL, "Global path for temporary output files from tests is not set");
+    GMX_RELEASE_ASSERT(Impl::s_globalOutputTempDirectory != nullptr, "Global path for temporary output files from tests is not set");
     return Impl::s_globalOutputTempDirectory;
 }
 
index 5844d99966b51f804775c3ae0d5a94ff430a5e56..993b4070e7a87d0395e6348d23ba9f7731751910 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 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.
@@ -80,7 +80,7 @@ bool TestFileInputRedirector::fileExists(const char            *filename,
 {
     if (existingFiles_.count(filename) == 0)
     {
-        File::NotFoundInfo info(filename, "File not present in test", NULL, false, 0);
+        File::NotFoundInfo info(filename, "File not present in test", nullptr, false, 0);
         onNotFound(info);
         return false;
     }
@@ -119,7 +119,7 @@ TextOutputStream &TestFileOutputRedirector::standardOutput()
     if (!impl_->stdoutStream_)
     {
         impl_->stdoutStream_.reset(new StringOutputStream);
-        impl_->fileList_.push_back(Impl::FileListEntry("<stdout>", impl_->stdoutStream_));
+        impl_->fileList_.emplace_back("<stdout>", impl_->stdoutStream_);
     }
     return *impl_->stdoutStream_;
 }
@@ -128,7 +128,7 @@ TextOutputStreamPointer
 TestFileOutputRedirector::openTextOutputFile(const char *filename)
 {
     Impl::StringStreamPointer stream(new StringOutputStream);
-    impl_->fileList_.push_back(Impl::FileListEntry(filename, stream));
+    impl_->fileList_.emplace_back(filename, stream);
     return stream;
 }
 
index 83e877d7be942f26d0397b5fe72b7b8aae6173f2..751e3e5d18d078a98478f353700f77d7cf1a2b22 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,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.
@@ -145,7 +145,7 @@ void printHelp(const Options &options)
                  "\nYou can use the following GROMACS-specific command-line flags\n"
                  "to control the behavior of the tests:\n\n");
     TextWriter             writer(&TextOutputFile::standardError());
-    CommandLineHelpContext context(&writer, eHelpOutputFormat_Console, NULL, program);
+    CommandLineHelpContext context(&writer, eHelpOutputFormat_Console, nullptr, program);
     context.setModuleDisplayName(program);
     CommandLineHelpWriter(options).writeHelp(context);
 }
@@ -168,37 +168,37 @@ void initTestUtils(const char *dataPath, const char *tempPath, bool usesMpi,
     {
         if (!usesMpi && gmx_node_num() > 1)
         {
+            // We cannot continue, since some tests might be using
+            // MPI_COMM_WORLD, which could deadlock if we would only
+            // continue with the master rank here.
             if (gmx_node_rank() == 0)
             {
                 fprintf(stderr, "NOTE: You are running %s on %d MPI ranks, "
                         "but it is does not contain MPI-enabled tests. "
-                        "Rank 0 will run the tests, other ranks will exit.",
+                        "The test will now exit.\n",
                         context.programName(), gmx_node_num());
             }
-            else
-            {
-                finalizeForCommandLine();
-                std::exit(0);
-            }
+            finalizeForCommandLine();
+            std::exit(1);
         }
         g_testContext.reset(new TestProgramContext(context));
         setProgramContext(g_testContext.get());
         // Use the default finder that does not respect GMXLIB, since the tests
         // generally can only get confused by a different set of data files.
-        setLibraryFileFinder(NULL);
+        setLibraryFileFinder(nullptr);
         ::testing::InitGoogleMock(argc, *argv);
-        if (dataPath != NULL)
+        if (dataPath != nullptr)
         {
             TestFileManager::setInputDataDirectory(
                     Path::join(CMAKE_SOURCE_DIR, dataPath));
         }
-        if (tempPath != NULL)
+        if (tempPath != nullptr)
         {
             TestFileManager::setGlobalOutputTempDirectory(tempPath);
         }
         bool        bHelp = false;
         std::string sourceRoot;
-        Options     options(NULL, NULL);
+        Options     options;
         // TODO: A single option that accepts multiple names would be nicer.
         // Also, we recognize -help, but GTest doesn't, which leads to a bit
         // unintuitive behavior.
@@ -256,7 +256,7 @@ void initTestUtils(const char *dataPath, const char *tempPath, bool usesMpi,
 
 void finalizeTestUtils()
 {
-    setProgramContext(NULL);
+    setProgramContext(nullptr);
     g_testContext.reset();
     finalizeForCommandLine();
 }
index 6f8cb9c9b7b69a2d6725456f9623b6e3ff8963ab..3070802cbf1f6398423ba507ab41f43d4a575b9a 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2011,2012,2014,2015, by the GROMACS development team, led by
+# Copyright (c) 2011,2012,2014,2015,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.
@@ -37,3 +37,6 @@ gmx_add_unit_test(TestUtilsUnitTests testutils-test
                   refdata_tests.cpp
                   testasserts_tests.cpp
                   xvgtest_tests.cpp)
+
+gmx_add_mpi_unit_test(TestUtilsMpiUnitTests testutils-mpi-test 2
+                      mpitest.cpp)
index 974688cdbee435f1ea167e49d97570c430c86aed..eb1ac9914feea3f08121287dc16c47c806bd7089 100644 (file)
@@ -65,7 +65,7 @@ class InteractiveSession
 
         void addOutput(const char *output)
         {
-            events_.push_back(Event(WriteOutput, output));
+            events_.emplace_back(WriteOutput, output);
         }
         void addInputLine(const char *inputLine)
         {
@@ -73,7 +73,7 @@ class InteractiveSession
         }
         void addReadInput()
         {
-            events_.push_back(Event(ReadInput, ""));
+            events_.emplace_back(ReadInput, "");
         }
         void addInput(const char *inputLine)
         {
@@ -84,7 +84,7 @@ class InteractiveSession
         {
             addInputLine(inputLine);
             helper_.setLastNewline(false);
-            events_.push_back(Event(ReadInputNoNewline, ""));
+            events_.emplace_back(ReadInputNoNewline, "");
         }
 
         void run()
similarity index 61%
rename from src/gromacs/mdtypes/energyhistory.cpp
rename to src/testutils/tests/mpitest.cpp
index 12a585a56234283d1c2e64dccfaf8434b33036bc..b810a2597fb83526fcf2db1d2d8cd3ddcdf1790f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-/* This file is completely threadsafe - keep it that way! */
+/*! \internal \file
+ * \brief
+ * Tests for infrastructure for running tests under MPI.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_testutils
+ */
 #include "gmxpre.h"
 
-#include "energyhistory.h"
+#include "testutils/mpitest.h"
 
-#include <cstring>
+#include "config.h"
 
-#include <algorithm>
+#include <gtest/gtest.h>
 
-#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/basenetwork.h"
+#include "gromacs/utility/gmxmpi.h"
 
-static void done_delta_h_history(delta_h_history_t *dht)
+namespace
 {
-    int i;
-
-    for (i = 0; i < dht->nndh; i++)
-    {
-        sfree(dht->dh[i]);
-    }
-    sfree(dht->dh);
-    sfree(dht->ndh);
-}
 
-void init_energyhistory(energyhistory_t * enerhist)
+class MpiSelfTest : public ::testing::Test
 {
-    enerhist->nener = 0;
+    public:
+        MpiSelfTest() : reached {0, 0}
+        {}
 
-    enerhist->ener_ave     = NULL;
-    enerhist->ener_sum     = NULL;
-    enerhist->ener_sum_sim = NULL;
-    enerhist->dht          = NULL;
+        int reached[2];
+};
 
-    enerhist->nsteps     = 0;
-    enerhist->nsum       = 0;
-    enerhist->nsteps_sim = 0;
-    enerhist->nsum_sim   = 0;
-
-    enerhist->dht = NULL;
-}
-
-void done_energyhistory(energyhistory_t * enerhist)
+TEST_F(MpiSelfTest, Runs)
 {
-    sfree(enerhist->ener_ave);
-    sfree(enerhist->ener_sum);
-    sfree(enerhist->ener_sum_sim);
-
-    if (enerhist->dht != NULL)
+    GMX_MPI_TEST(2);
+#if GMX_THREAD_MPI
+    reached[gmx_node_rank()] = 1;
+    MPI_Barrier(MPI_COMM_WORLD);
+#else
+    int value = 1;
+    MPI_Gather(&value, 1, MPI_INT, reached, 1, MPI_INT, 0, MPI_COMM_WORLD);
+#endif
+    if (gmx_node_rank() == 0)
     {
-        done_delta_h_history(enerhist->dht);
-        sfree(enerhist->dht);
+        EXPECT_EQ(1, reached[0]);
+        EXPECT_EQ(1, reached[1]);
     }
 }
+
+} // namespace
index 0a13555be2cd1b5944aca4d8d47ea109cce0bf90..f81272a73aaf876b06ffe42fe6367c6162ee8bad 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,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.
 
 #include "testutils/refdata.h"
 
+#include <string>
 #include <vector>
 
 #include <gtest/gtest.h>
 #include <gtest/gtest-spi.h>
 
+#include "gromacs/utility/keyvaluetree.h"
+#include "gromacs/utility/keyvaluetreebuilder.h"
+#include "gromacs/utility/variant.h"
+
 #include "testutils/testasserts.h"
 #include "testutils/testexceptions.h"
 
@@ -190,7 +195,7 @@ typedef double dvec[3];
 //! Helper function for HandlesSequenceOfCustomData
 void checkCustomVector(TestReferenceChecker *checker, const dvec &value)
 {
-    checker->checkVector(value, NULL);
+    checker->checkVector(value, nullptr);
 }
 
 TEST(ReferenceDataTest, HandlesSequenceOfCustomData)
@@ -266,6 +271,203 @@ TEST(ReferenceDataTest, HandlesMissingData)
         TestReferenceChecker checker(data.rootChecker());
         EXPECT_NONFATAL_FAILURE(checker.checkInteger(1, "missing"), "");
         EXPECT_NONFATAL_FAILURE(checker.checkSequenceArray(5, seq, "missing"), "");
+        // Needed to not make the test fail because of unused "int" and "seq".
+        EXPECT_NONFATAL_FAILURE(checker.checkUnusedEntries(), "");
+    }
+}
+
+
+TEST(ReferenceDataTest, HandlesUncheckedData)
+{
+    const int seq[5] = { -1, 3, 5, 2, 4 };
+
+    {
+        TestReferenceData    data(gmx::test::erefdataUpdateAll);
+        TestReferenceChecker checker(data.rootChecker());
+        checker.checkInteger(1, "int");
+        checker.checkSequenceArray(5, seq, "seq");
+        checker.checkUnusedEntries();
+    }
+    {
+        TestReferenceData    data(gmx::test::erefdataCompare);
+        TestReferenceChecker checker(data.rootChecker());
+        checker.checkInteger(1, "int");
+        EXPECT_NONFATAL_FAILURE(checker.checkUnusedEntries(), "");
+    }
+}
+
+
+TEST(ReferenceDataTest, HandlesUncheckedDataInSequence)
+{
+    const int seq[5] = { -1, 3, 5, 2, 4 };
+
+    {
+        TestReferenceData    data(gmx::test::erefdataUpdateAll);
+        TestReferenceChecker checker(data.rootChecker());
+        checker.checkInteger(1, "int");
+        checker.checkSequenceArray(5, seq, "seq");
+        checker.checkUnusedEntries();
+    }
+    {
+        TestReferenceData    data(gmx::test::erefdataCompare);
+        TestReferenceChecker checker(data.rootChecker());
+        checker.checkInteger(1, "int");
+        EXPECT_NONFATAL_FAILURE(checker.checkSequenceArray(3, seq, "seq"), "");
+        // It might be nicer to not report the unused sequence entries also
+        // here, but both behaviors are quite OK.
+        EXPECT_NONFATAL_FAILURE(checker.checkUnusedEntries(), "");
+    }
+}
+
+
+TEST(ReferenceDataTest, HandlesUncheckedDataInCompound)
+{
+    {
+        TestReferenceData    data(gmx::test::erefdataUpdateAll);
+        TestReferenceChecker checker(data.rootChecker());
+        TestReferenceChecker compound(checker.checkCompound("Compound", "Compound"));
+        compound.checkInteger(1, "int1");
+        compound.checkInteger(2, "int2");
+        compound.checkUnusedEntries();
+        checker.checkInteger(1, "int");
+        checker.checkUnusedEntries();
+    }
+    {
+        TestReferenceData    data(gmx::test::erefdataCompare);
+        TestReferenceChecker checker(data.rootChecker());
+        TestReferenceChecker compound(checker.checkCompound("Compound", "Compound"));
+        compound.checkInteger(1, "int1");
+        EXPECT_NONFATAL_FAILURE(compound.checkUnusedEntries(), "");
+        checker.checkInteger(1, "int");
+        checker.checkUnusedEntries();
+    }
+}
+
+
+TEST(ReferenceDataTest, HandlesVariants)
+{
+    using gmx::Variant;
+    {
+        TestReferenceData    data(gmx::test::erefdataUpdateAll);
+        TestReferenceChecker checker(data.rootChecker());
+        checker.checkVariant(Variant::create<bool>(true), "bool");
+        checker.checkVariant(Variant::create<int>(1), "int");
+        checker.checkVariant(Variant::create<double>(3.5), "real");
+        checker.checkVariant(Variant::create<std::string>("foo"), "str");
+    }
+    {
+        TestReferenceData    data(gmx::test::erefdataCompare);
+        TestReferenceChecker checker(data.rootChecker());
+        checker.checkVariant(Variant::create<bool>(true), "bool");
+        checker.checkVariant(Variant::create<int>(1), "int");
+        checker.checkVariant(Variant::create<double>(3.5), "real");
+        checker.checkVariant(Variant::create<std::string>("foo"), "str");
+    }
+}
+
+//! Helper for building a KeyValueTree for testing.
+gmx::KeyValueTreeObject buildKeyValueTree(bool full)
+{
+    gmx::KeyValueTreeBuilder builder;
+    auto                     root = builder.rootObject();
+    auto                     obj  = root.addObject("o");
+    obj.addValue<int>("i", 1);
+    if (full)
+    {
+        obj.addValue<std::string>("s", "x");
+    }
+    auto arr  = root.addUniformArray<int>("a");
+    arr.addValue(2);
+    arr.addValue(3);
+    root.addValue<std::string>("s", "y");
+    return builder.build();
+}
+
+
+TEST(ReferenceDataTest, HandlesKeyValueTree)
+{
+    gmx::KeyValueTreeObject tree = buildKeyValueTree(true);
+    {
+        TestReferenceData    data(gmx::test::erefdataUpdateAll);
+        TestReferenceChecker checker(data.rootChecker());
+        checker.checkKeyValueTreeObject(tree, "tree");
+    }
+    {
+        TestReferenceData    data(gmx::test::erefdataCompare);
+        TestReferenceChecker checker(data.rootChecker());
+        checker.checkKeyValueTreeObject(tree, "tree");
+    }
+}
+
+
+TEST(ReferenceDataTest, HandlesKeyValueTreeExtraKey)
+{
+    {
+        TestReferenceData    data(gmx::test::erefdataUpdateAll);
+        TestReferenceChecker checker(data.rootChecker());
+        checker.checkKeyValueTreeObject(buildKeyValueTree(false), "tree");
+    }
+    {
+        TestReferenceData    data(gmx::test::erefdataCompare);
+        TestReferenceChecker checker(data.rootChecker());
+        EXPECT_NONFATAL_FAILURE(checker.checkKeyValueTreeObject(buildKeyValueTree(true), "tree"), "");
+    }
+}
+
+
+TEST(ReferenceDataTest, HandlesKeyValueTreeMissingKey)
+{
+    {
+        TestReferenceData    data(gmx::test::erefdataUpdateAll);
+        TestReferenceChecker checker(data.rootChecker());
+        checker.checkKeyValueTreeObject(buildKeyValueTree(true), "tree");
+    }
+    {
+        TestReferenceData    data(gmx::test::erefdataCompare);
+        TestReferenceChecker checker(data.rootChecker());
+        EXPECT_NONFATAL_FAILURE(checker.checkKeyValueTreeObject(buildKeyValueTree(false), "tree"), "");
+    }
+}
+
+
+TEST(ReferenceDataTest, HandlesVariantsWithIncorrectValue)
+{
+    using gmx::Variant;
+    {
+        TestReferenceData    data(gmx::test::erefdataUpdateAll);
+        TestReferenceChecker checker(data.rootChecker());
+        checker.checkVariant(Variant::create<bool>(true), "bool");
+        checker.checkVariant(Variant::create<int>(1), "int");
+        checker.checkVariant(Variant::create<double>(3.5), "real");
+        checker.checkVariant(Variant::create<std::string>("foo"), "str");
+    }
+    {
+        TestReferenceData    data(gmx::test::erefdataCompare);
+        TestReferenceChecker checker(data.rootChecker());
+        EXPECT_NONFATAL_FAILURE(checker.checkVariant(Variant::create<bool>(false), "bool"), "");
+        EXPECT_NONFATAL_FAILURE(checker.checkVariant(Variant::create<int>(2), "int"), "");
+        EXPECT_NONFATAL_FAILURE(checker.checkVariant(Variant::create<double>(2.5), "real"), "");
+        EXPECT_NONFATAL_FAILURE(checker.checkVariant(Variant::create<std::string>("bar"), "str"), "");
+    }
+}
+
+
+TEST(ReferenceDataTest, HandlesVariantsWithIncorrectType)
+{
+    using gmx::Variant;
+    {
+        TestReferenceData    data(gmx::test::erefdataUpdateAll);
+        TestReferenceChecker checker(data.rootChecker());
+        checker.checkVariant(Variant::create<bool>(true), "bool");
+        checker.checkVariant(Variant::create<int>(1), "int");
+        checker.checkVariant(Variant::create<double>(3.5), "real");
+    }
+    {
+        TestReferenceData    data(gmx::test::erefdataCompare);
+        TestReferenceChecker checker(data.rootChecker());
+        EXPECT_NONFATAL_FAILURE(checker.checkVariant(Variant::create<int>(1), "bool"), "");
+        EXPECT_NONFATAL_FAILURE(checker.checkVariant(Variant::create<bool>(true), "int"), "");
+        EXPECT_NONFATAL_FAILURE(checker.checkVariant(Variant::create<int>(2), "real"), "");
     }
 }
 
@@ -312,8 +514,8 @@ TEST(ReferenceDataTest, HandlesStringsWithTextAndWhitespace)
         TestReferenceChecker checker(data.rootChecker());
         for (const auto &s : strings)
         {
-            checker.checkString(s, NULL);
-            checker.checkTextBlock(s, NULL);
+            checker.checkString(s, nullptr);
+            checker.checkTextBlock(s, nullptr);
         }
     }
     {
@@ -321,8 +523,8 @@ TEST(ReferenceDataTest, HandlesStringsWithTextAndWhitespace)
         TestReferenceChecker checker(data.rootChecker());
         for (const auto &s : strings)
         {
-            checker.checkString(s, NULL);
-            checker.checkTextBlock(s, NULL);
+            checker.checkString(s, nullptr);
+            checker.checkTextBlock(s, nullptr);
         }
     }
 }
@@ -423,15 +625,15 @@ TEST(ReferenceDataTest, HandlesMultipleNullIds)
     {
         TestReferenceData    data(gmx::test::erefdataUpdateAll);
         TestReferenceChecker checker(data.rootChecker());
-        checker.checkString("Test", NULL);
-        checker.checkString("Test2", NULL);
+        checker.checkString("Test", nullptr);
+        checker.checkString("Test2", nullptr);
     }
     {
         TestReferenceData    data(gmx::test::erefdataCompare);
         TestReferenceChecker checker(data.rootChecker());
-        checker.checkString("Test", NULL);
-        checker.checkString("Test2", NULL);
-        EXPECT_NONFATAL_FAILURE(checker.checkString("Test", NULL), "");
+        checker.checkString("Test", nullptr);
+        checker.checkString("Test2", nullptr);
+        EXPECT_NONFATAL_FAILURE(checker.checkString("Test", nullptr), "");
     }
 }
 
@@ -442,26 +644,45 @@ TEST(ReferenceDataTest, HandlesMultipleComparisonsAgainstNullIds)
         TestReferenceData    data(gmx::test::erefdataUpdateAll);
         TestReferenceChecker checker(data.rootChecker());
         checker.checkInteger(1, "int1");
-        checker.checkString("Test", NULL);
-        checker.checkString("Test2", NULL);
+        checker.checkString("Test", nullptr);
+        checker.checkString("Test2", nullptr);
         checker.checkInteger(2, "int2");
-        EXPECT_NONFATAL_FAILURE(checker.checkString("Test3", NULL), "");
-        checker.checkString("Test2", NULL);
+        EXPECT_NONFATAL_FAILURE(checker.checkString("Test3", nullptr), "");
+        checker.checkString("Test2", nullptr);
     }
     {
         TestReferenceData    data(gmx::test::erefdataCompare);
         TestReferenceChecker checker(data.rootChecker());
         checker.checkInteger(1, "int1");
-        checker.checkString("Test", NULL);
-        checker.checkString("Test2", NULL);
+        checker.checkString("Test", nullptr);
+        checker.checkString("Test2", nullptr);
         checker.checkInteger(2, "int2");
-        EXPECT_NONFATAL_FAILURE(checker.checkString("Test3", NULL), "");
+        EXPECT_NONFATAL_FAILURE(checker.checkString("Test3", nullptr), "");
         checker.checkInteger(1, "int1");
-        checker.checkString("Test", NULL);
-        checker.checkString("Test2", NULL);
-        EXPECT_NONFATAL_FAILURE(checker.checkString("Test", NULL), "");
+        checker.checkString("Test", nullptr);
+        checker.checkString("Test2", nullptr);
+        EXPECT_NONFATAL_FAILURE(checker.checkString("Test", nullptr), "");
         checker.checkInteger(2, "int2");
-        EXPECT_NONFATAL_FAILURE(checker.checkString("Test3", NULL), "");
+        EXPECT_NONFATAL_FAILURE(checker.checkString("Test3", nullptr), "");
+    }
+}
+
+
+TEST(ReferenceDataTest, HandlesReadingValues)
+{
+    {
+        TestReferenceData    data(gmx::test::erefdataUpdateAll);
+        TestReferenceChecker checker(data.rootChecker());
+        checker.checkUChar('A', "char");
+        checker.checkInteger(1, "int");
+        checker.checkString("Test", "string");
+    }
+    {
+        TestReferenceData    data(gmx::test::erefdataCompare);
+        TestReferenceChecker checker(data.rootChecker());
+        EXPECT_EQ('A', checker.readUChar("char"));
+        EXPECT_EQ(1, checker.readInteger("int"));
+        EXPECT_EQ("Test", checker.readString("string"));
     }
 }
 
@@ -563,4 +784,24 @@ TEST(ReferenceDataTest, HandlesUpdateChangedWithCompoundChanges)
     }
 }
 
+TEST(ReferenceDataTest, HandlesUpdateChangedWithRemovedEntries)
+{
+    {
+        TestReferenceData    data(gmx::test::erefdataUpdateAll);
+        TestReferenceChecker checker(data.rootChecker());
+        checker.checkInteger(1, "int");
+        checker.checkString("Test", "string");
+    }
+    {
+        TestReferenceData    data(gmx::test::erefdataUpdateChanged);
+        TestReferenceChecker checker(data.rootChecker());
+        checker.checkInteger(2, "int");
+    }
+    {
+        TestReferenceData    data(gmx::test::erefdataCompare);
+        TestReferenceChecker checker(data.rootChecker());
+        checker.checkInteger(2, "int");
+    }
+}
+
 } // namespace
index 5621821b129458020fb8f405f5a766c342aa6d3e..37a336b89b678a058755699b5b947bac3b293baa 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 2015,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.
@@ -110,7 +110,7 @@ TEST(XvgTests, CheckMissing)
         gmx::test::TestReferenceData    data(gmx::test::erefdataCompare);
         gmx::test::TestReferenceChecker checker(data.rootChecker());
         gmx::StringInputStream          sis(input);
-        EXPECT_NONFATAL_FAILURE(checkXvgFile(&sis, &checker, XvgMatchSettings()), "absent");
+        EXPECT_NONFATAL_FAILURE(checkXvgFile(&sis, &checker, XvgMatchSettings()), "not used in test");
     }
 }
 
index 184ebfbfdd3b3f95cef0444f2eb9ab9804394736..eb111256d0d3adc34e59f78658b75f38d410da94 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 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.
  *    See \ref page_refdata for more details.
  *  - gmx::test::CommandLine and related classes (in cmdlinetest.h) provide
  *    utilities for constructing command line argument arrays for use in tests
- *    that invoke actual commands.
+ *    that invoke actual commands.  The same header also provides
+ *    gmx::test::CommandLineTestHelper and gmx::test::CommandLineTestBase
+ *    for easily creating tests that execute essentially full command-line
+ *    programs, including checking the output files produced.
  *  - gmx::test::StringTestBase provides a test fixture for tests that need to
  *    test long strings for correctness.
- *  - gmx::test::IntegrationTestFixture provides a test fixture for tests that
- *    execute legacy code where `stdin` reading etc. cannot be easily mocked.
+ *  - gmx::test::StdioTestHelper provides a helper class for tests that need to
+ *    execute legacy code where `stdin` reading cannot be easily mocked.
  *
  * Additionally, testinit.h and mpi-printer.h, and their corresponding source
  * files, provide functionality that is not visible on the API level: they
index b69e0c87bb24088bb0317b1b1b9c4769dc15eb09..d1b2a3e6f0f189cf891753211bedd64c292ee0c3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 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.
@@ -96,7 +96,7 @@ bool isRelevantXvgCommand(const std::string &line)
 //! Helper function to check a single xvg value in a sequence.
 void checkXvgDataPoint(TestReferenceChecker *checker, const std::string &value)
 {
-    checker->checkRealFromString(value, NULL);
+    checker->checkRealFromString(value, nullptr);
 }
 
 }       // namespace
@@ -140,10 +140,7 @@ void checkXvgFile(TextInputStream        *input,
                                   &checkXvgDataPoint);
         ++dataRowCount;
     }
-    if (settings.testData)
-    {
-        dataChecker.checkPresent(false, formatString("Row%d", dataRowCount).c_str());
-    }
+    dataChecker.checkUnusedEntries();
     legendChecker.checkTextBlock(legendText, "XvgLegend");
 }
 
index ebffac5d7b9652d09e2009ebd0e67b14fa79d4f3..5a946bf27df69c596a0ff6f8ca2dda3bf4e200ce 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,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.
@@ -87,10 +87,10 @@ log: ${log}")
     set(REGRESSIONTEST_DOWNLOAD OFF CACHE BOOL "Tests already downloaded. Set to yes to download again" FORCE)
 endif()
 
-if(REGRESSIONTEST_PATH AND (GMX_BLUEGENE OR CMAKE_CROSSCOMPILING OR CMAKE_CONFIGURATION_TYPES OR GMX_BUILD_MDRUN_ONLY))
-    # TODO: It would be nicer to do these before potentially downloading the tests.
-    # Bluegene requires us to compile both front-end and back-end binaries
-    # (single build is insufficient)
+if(REGRESSIONTEST_PATH AND (CMAKE_CROSSCOMPILING OR CMAKE_CONFIGURATION_TYPES OR GMX_BUILD_MDRUN_ONLY))
+    # TODO: It would be nicer to do these checks before potentially downloading the tests.
+    # Cross-compiling toolchains require us to compile both front-end and
+    # back-end binaries to run gmxtest.pl.
     # Testing an mdrun-only builds require supporting binaries from a full build
     message(WARNING
         "With cross-compiling, multi-configuration generators (e.g. Visual Studio), or with mdrun-only builds, running regressiontests from build system is not supported. Please run gmxtest.pl directly.")
@@ -174,11 +174,8 @@ if(REGRESSIONTEST_PATH)
             ENVIRONMENT "PATH=${PATH}")
     endforeach()
 else()
-    add_custom_target(regressiontests-notice
-        ${CMAKE_COMMAND} -E echo "NOTE: Regression tests have not been run. If you want to run them from the build system, get the correct version of the regression tests package and set REGRESSIONTEST_PATH in CMake to point to it, or set REGRESSIONTEST_DOWNLOAD=ON."
-        DEPENDS run-ctest
-        COMMENT "Regression tests not available" VERBATIM)
-    add_dependencies(check regressiontests-notice)
+    gmx_add_missing_tests_notice("Regression tests have not been run. If you want to run them from the build system, get the correct version of the regression tests package and set REGRESSIONTEST_PATH in CMake to point to it, or set REGRESSIONTEST_DOWNLOAD=ON.")
 endif()
 
+gmx_create_missing_tests_notice_target()
 include(CppCheck.cmake)
diff --git a/tests/CheckTarget.cmake b/tests/CheckTarget.cmake
new file mode 100644 (file)
index 0000000..d621cf4
--- /dev/null
@@ -0,0 +1,67 @@
+#
+# 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.
+
+# "tests" target builds all the separate test binaries.
+add_custom_target(tests)
+# "run-ctest" is an internal target that actually runs the tests.
+# This is necessary to be able to add separate targets that execute as part
+# of 'make check', but are ensured to be executed after the actual tests.
+add_custom_target(run-ctest
+                  COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure
+                  COMMENT "Running all tests"
+                  USES_TERMINAL VERBATIM)
+add_dependencies(run-ctest tests)
+# "check" target builds and runs all tests.
+add_custom_target(check DEPENDS run-ctest)
+
+# Global property for collecting notices to show at the end of the "check"
+# target.
+set_property(GLOBAL PROPERTY GMX_TESTS_NOTICE)
+
+function (gmx_add_missing_tests_notice TEXT)
+    set_property(GLOBAL APPEND PROPERTY GMX_TESTS_NOTICE ${TEXT})
+endfunction()
+
+function (gmx_create_missing_tests_notice_target)
+    get_property(_text GLOBAL PROPERTY GMX_TESTS_NOTICE)
+    set(_cmds)
+    foreach (_line ${_text})
+        list(APPEND _cmds COMMAND ${CMAKE_COMMAND} -E echo "NOTE: ${_line}")
+    endforeach()
+    add_custom_target(missing-tests-notice
+        ${_cmds}
+        DEPENDS run-ctest
+        COMMENT "Some tests not available" VERBATIM)
+    add_dependencies(check missing-tests-notice)
+endfunction()
index 0500bafe8b52fdf9944b7d0cfd3c1bf8139c1faf..61826c1ce25ff2f187ebdb4a97be3e0f0656a834 100644 (file)
@@ -88,12 +88,7 @@ if (CPPCHECK_EXECUTABLE AND UNIX)
         --suppress=invalidscanf
         --suppress=sizeofCalculation
         --suppress=invalidscanf_libc
-        --suppress=missingInclude:src/programs/mdrun/gmx_gpu_utils/gmx_gpu_utils.cu
         --suppress=*:src/external/Random123-1.08/include/Random123/features/compilerfeatures.h
-        --suppress=invalidPointerCast:src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh
-        --suppress=passedByValue:src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh
-        --suppress=passedByValue:src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_utils.cuh
-        --suppress=shiftTooManyBits:src/gromacs/gpu_utils/gpu_utils.cu
         ) 
     set(_cxx_flags
         -D__cplusplus
@@ -105,7 +100,19 @@ if (CPPCHECK_EXECUTABLE AND UNIX)
         --suppress=passedByValue:src/gromacs/simd/tests/*
         --suppress=redundantAssignment:src/gromacs/simd/simd_math.h #seems to be a bug in cppcheck
         --suppress=noExplicitConstructor # can't be selective about this, see http://sourceforge.net/p/cppcheck/discussion/general/thread/db1e4ba7/
+        --suppress=unusedStructMember:src/gromacs/onlinehelp/tests/helpmanager.cpp
+        --suppress=unusedStructMember:src/gromacs/commandline/cmdlinehelpmodule.cpp
+        --suppress=unusedStructMember:src/gromacs/selection/selhelp.cpp
+        --suppress=redundantPointerOp:src/gromacs/fileio/gmxfio-xdr.cpp
+        --suppress=passedByValue # See comment below
+        --suppress=shiftTooManyBits:src/gromacs/gpu_utils/gpu_utils.cu # CUDA kernel launch false positive
         )
+        # Passing non-trivial objects by value is rarely a problem for
+        # GROMACS in performance-sensitive code, and shouldn't be
+        # enforced for types that are intended to be used like value
+        # types (e.g. SIMD wrapper types, ArrayRef) , nor for
+        # move-enabled types. cppcheck isn't sensitive to these
+        # subtleties yet.
 
     # This list will hold the list of all files with cppcheck errors
     # (one per input file)
@@ -115,7 +122,7 @@ if (CPPCHECK_EXECUTABLE AND UNIX)
         set(_target_name cppcheck-${_filename}.${_outputext})
         string(REPLACE "/" "_" _target_name ${_target_name})
         list(APPEND _filelist ${_target_name})
-        if (_filename MATCHES "\\.cpp$")
+        if (_filename MATCHES "\\.cpp$" OR _filename MATCHES "\\.cu$")
             set(_lang CXX)
             set(_lang_flags ${_cxx_flags})
         else()